Make a pear channel
- Create a new repository on GitHub called
pear
- Make the project on github
$ mkdir pear
$ cd pear
$ git init
$ git remote add origin git@github.com:[your git username]/pear.git
- Install Pirum
$ pear channel-discover pear.pirum-project.org
$ pear install pirum/Pirum-beta
- Create a pirum configuration file:
- It's called
pirum.xml
- It goes in the root of your pear repository
- It contains:
<?xml version="1.0" encoding="UTF-8" ?> <server> <name>[username].github.com/pear</name> <summary>[username]'s PEAR Channel Server</summary> <alias>[username]</alias> <url>http://[username].github.com/pear</url> </server>
- It's called
- Run the build command
$ pirum build .
- Now add and commit everything
$ git add -A
$ git commit -m "Initial server build. Sauce Labs is awesome"
- Rename your master branch to gh-pages and push it to GitHub
$ git branch -m master gh-pages
$ git push origin gh-pages
- Your PEAR channel server is now available (after maybe 15 minutes) under
[username].github.com/pear
. Test it out!$ pear channel-discover [username].github.com/pear
$ pear channel-info [username]
$ pear list-all -c [username]
There! Now you have a pear channel. Now you need to
Make a PHP package
- Go to the directory that contains your PHP files
- Create a package.xml file that contains metadata about your package
- Check that it's a valid package
$ pear package-validate
- Make the package!
$ pear package
(this should create a .tgz file that's named after the package you detailed in package.xml)
Woo! Now you have a package and a channel. Next step is to
Add the package to the channel
- Copy the .tgz file to your pear repository
- Navigate to that directory
- Add the package to the channel locally
$ pirum add . [filename].tgz
- Upload the changes to github! Note that you push to gh-pages and not to master.
$ git add -A
$ git commit -m "Added first version of my pear package. Sauce Labs is awesome"
$ git push origin gh-pages
And you're done! No more bullets! Or numbered lists. Now the whole world is exposed to your PHP. Hopefully that's a good thing. Here’s our Pear channel: https://github.com/saucelabs/pear Here’s the source we distribute through it: https://github.com/saucelabs/phpunit-selenium-sauceondemand Special thanks to Jan Sorgalla for showing me by example how to do all this.