Install Composer with Puppet and Vagrant

I started a personal project to update my WordPress theme so that it would match the design on my portfolio site. In the process; I decided it would be a good time to use Vagrant, and in particular, a project called VagrantPress to quickly setup a WordPress development environment. The advantage I wanted to capitalize on was the convenience of throwing away the environment once the project was finished. I didn’t want to leave any remnants of PHP or custom path variables on my laptop after the project was done. It would also be easy to develop on multiple machines since the vagrant instance would be the same across all devices.

After I checked out the VagrantPress project from github, I was ready to roll (commence finger tent gesture). Ran vagrant up. But sadly, errors were thrown about plugins not able to install due to an issue with PEAR. What?? PEAR has been around for a long time and I’ve used it on many, probably every PHP, project. Why is it failing? After some digging around the internets, I came across an  end of life message from the folks that develop/maintain PEAR and PHPUnit. Sad days. The people involved with that project deserve major recognition for their efforts and service through the years. Thousands of PHP projects still rely on PEAR and will have to transition to Composer (or other dependencies managers) if they haven’t already.

Install Composer with Puppet

Alas, new methods to install PHP plugins have emerged in the past few years, and Composer has become the de facto dependency manager for PHP.

This shouldn’t be a big deal to fix, I thought. VagrantPress is using Puppet to provision Vagrant. In other words, puppet handles automated tasks for installing infrastructure dependencies and configurations. I’ll use a puppet project that installs Composer to modify the way VagrantPress installs the PHP Quality Tools. Long story short, it wasn’t easy and I went another route. I still used puppet, but created my own puppet manifest for installing Composer based off an example I found. Here is what I ended up with:

Continue reading

Readmill API Authentication with oAuth using PHP


I started using Readmill on my iPad 3 months ago and have been in love with the app/service ever since.
The minimalist reader makes it very easy to dive right into the book you are reading at the moment. As well as quickly switch in an out of other books in your library. And the social interaction and highlighting features with other Readmillers is quite excellent. You can even import your Kindle library into your Readmill library.

Enough about how awesome Readmill is; check it out if you do a lot of reading on your device. It is definitely worth your time. You’ll love it. It has replaced the Kindle App for me, which is a big deal.

I decided to dive into the Readmill API to see if I could create a web app. However, I was not able to find any PHP flavored examples out there. So I put together an example for anyone looking to do Readmill API oAuth connections using PHP. Here is a link to the  gist.

Continue reading