About Jamie on Software

Jamie on Software is the online journal of web developer and writer Jamie Rumbelow.

Jamie likes books, guitars, programming, open source and food. He writes about these things too. This is where he puts the things he writes.

My Books

Tags
Tweets
Feeds
We Love
Powered by Squarespace
Friday
Oct052012

The Trick to Writing Large PHP Applications

The trick to writing large-scale, stable PHP applications? Don't. Write lots of small ones. Test each component in isolation with unit tests. Use Composer. Lots. Get it on GitHub and use Travis + a master / pull request flow model to handle collaboration. Listen to Jeff Buckley loudly. Rock out.

Thursday
Oct042012

Using Composer on (gs)

I love using MediaTemple for my simple sites. When I don't have complex hosting requirements, I know I can get my PHP applications up and running really quickly. Their support is great, their hosting fast and feature-rich and their prices competitive.

...but there's one problem. (gs), their shared hosting platform, has a limited PHP CLI binary. You can't configure it through a php.ini (see this tweet for more). This makes it impossible to use Composer. Since Composer is the future of PHP, this is quite worrying.

There is, however, a solution. We can use the -d flag to set the runtime config variables required to get Composer running.

Installing Composer:

curl -s https://getcomposer.org/installer | php -d allow_url_fopen=1 -d suhosin.executor.include.whitelist=phar

...and then to run composer.phar:

php -d memory_limit=512M -d allow_url_fopen=1 -d suhosin.executor.include.whitelist=phar composer.phar

This is ugly, so let's clean it up. We'll add an alias to the bash profile:

$ vim ~/.profile

We'll alias get_composer to our install command and composer to our composer.phar file. This way we can set up new subdomains and such easily:

alias get_composer="curl -s https://getcomposer.org/installer | php -d allow_url_fopen=1 -d suhosin.executor.include.whitelist=phar"
alias composer="php -d memory_limit=512M -d allow_url_fopen=1 -d suhosin.executor.include.whitelist=phar composer.phar"

Save, and reload the profile (this will be done automatically next login):

$ source ~/.profile

Now, we can use Composer to our hearts' content:

$ get_composer
All settings correct for using Composer
Downloading...

Composer successfully installed to: /blah/domains/efendibooks.com/composer.phar
Use it: php composer.phar

$ composer -V
Composer version cb2a0f4
Wednesday
Oct032012

Don't Just Roll The Dice

Over at Efendi Books, we've been working hard and are thrilled to announce the immediate release of the second Efendi Minibook, Neil Davidson's sensational Don't Just Roll The Dice. Don't Just Roll The Dice is a usefully short guide to software pricing from the CEO of a rather large software company. Its style is wonderful and content invaluable.

It's been given a lick of paint as well as gutted and given a bunch of brand new content. We're very proud of it and can't wait to spread it far and wide! It's available for free from the Efendi Books website.

Head over there now and get your copy!

Monday
Sep242012

Life lessons

A few small business / personal things I've learnt over the past few days:

  1. Don't have a beer at lunchtime. You won't get anything done in the afternoon, even if you try.
  2. Things always take longer than you'd expect to get done.
  3. Your best work should only ever be your latest work.
  4. Never compromise.
  5. Lying is a linguistic tool, much like lists of three or alliteration, and should be used as such. But be very careful.
  6. Reality distortion fields do exist, and you can use them to your advantage.
  7. If you're not focusing at your desk, stop trying. Sit in a café, or in a park, or on a bridge, or something.
  8. Never take up an offer, no matter how generous, if you've even the slightest reservation or feeling that you may be being rude.
  9. Get a mentor.
  10. This isn't the worst day of your life. It's the best day of your life with the most challenges.

 

Thursday
Sep132012

It's The Little Things

An excellent talk from 37signals developer Jamis Buck about what makes people passionate about Ruby. A very interesting chat that made me learn a lot about the language in a very short space of time.

Definitely recommended watching, even if you're not a Ruby person.