Creating a Splint Library

Create Project Directory

With Splint installed, open terminal at the root of a fresh code-igniter distribution and run the command

splint -c vendor_name/package_name
N.B vendor_name should be your set username at https://splint.cynobit.com

Replace the package_name with a name of your choice.

Next, create a splint.json file at the root of the newly created package to have the contents as below, given that as for example, your vendor name is jonas and your package name is super-regex; the path to create the file will be at application/splints/jonas/super-regex.

{
  "name": "jonas/super-regex",
  "type": "library",
  "description": "A library that gives you regexps features on steroids.",
  "tags": ["regex", "string"],
  "page": "https://github.com/jonas/super-regex",
  "authors": [
    {
      "name": "Jonas Gutierez",
      "email": "jonas@gmail.com",
      "page": "about.me/jonas",
      "role": "Developer"
    }
  ],
  "php": ">=5.3.0"
}

See splint.json Docs for more about what you can do with the above file.

N.B The splint.json is necessary for the importation of the package into Splint and must be created with the same letter case as shown.
N.B All the above tasks (Creating of folders and files) can be done manually without the terminal tool.
N.B Packages are developed relative to a patched (MY_Loader.php and other files in the core directory along side dependent packages.) to enable you debug and run them as they would in their target environment.

Next, initialize the newly created package as a git repository. (git init must be run at the root of the newly created package.)

Next, go to GitHub and create a repository (super-regex) for example. Then run the following command at the root of your newly created package in application/splints/jonas/super-regex. Again, jonas/super-regex is used for illustration.

git remote add origin https://github.com/jonas/super-regex.git
git add *
git push -u origin master
N.B how you handle this stage may differ. all that's required here is that you make your new splint package a repository. This is because only git repositories are allowed to be imported to splint.
N.B The Git repository must be public and must be on GitHub

Now go ahead and work on your library by creating models, views, helpers, libraries (php script(s) in libraries folder). Remember that people have to use the libraries you develop, hence you need to document all about it in a README.md file.

N.B README.md has to be README.md before Splint can see it.

Publishing/Deploying your Package on Splint

When you have finished developing your package, push all your commits on your master branch to GitHub. Then head on to the repository page of the package to make a release. See Creating GitHub releases on how to go about that.

Log into your account on Splint and go to the Import Package page. you should see a page that looks like this.

 Splint Import Package

Fill in the url of the git repository for the package in the given input field and click the Import Package button.

Once your package has been successfully imported, you can now install the package on any Code-Igniter distribution with the command splint install jonas/super-regex.

When you browse your list of packages, you'll see your newly imported package.

when you click any package that you own on Splint, you'll see a control bar at the top of it's page that looks like this.

 Splint Package Control

Releases are what Splint considers as package versions. If you made some changes to your package and would like to make it available for others to install, make another release on GitHub with your most recent changes and click the update button on the particular package page from Splint. the update button looks like a Thunder sign as squared in green below.


This will quer it's original GitHub repository for new releases or tags. The next time someone runs splint install jonas/super-regex, They'll get the most recent version of your package.

NEXT

PREVIOUS