Edmonton Web Design and Photography

Running PHP5 in the Dreamhost CLI


Some times a PHP framework might include a command line interface, this might be Cake PHP or Symfony and many others.

This interesting thing that I learned while attempting to use Symfony (php 5 only) compared to Cake PHP (php 4+) was that the command line environment is not the same as the web environment.

When I tested the version of php on the front end I got 5.2.4 and figured I’m good to go.

While after running the Symfony command line tool to build my project I was getting a php error.

My knowledge of the command line is just enough to do damage.

As the Symfony documentation stated I checked the CLI php version and found it to be 4.4.9 and that the configuration would not work with Symfony.

I had a look in the DreamHost Wiki and found this could be fixed!

DreamHost by default has PHP installed with the option to run php 5.

  • PHP 4 – /usr/local/bin/php
  • PHP 5 – /usr/local/php5/bin/php

All hope was not lost.

So I am spreading the word, as well as making a mental note for me self.

Open your .alias file using FTP or command line.

Add the following alias to the bottom of the file.

alias 'php=/usr/local/php5/bin/php'

This will work for other servers as well, but the path will be different.

Posted in: Programming on January 5th, 2010
by: Adam Patterson

phpCollab v3


I am volunteering what precious free time I have to an Open Source Project called phpCollab. phpCollab has been around for many years and has sat neglected for the past 3 years. Recently new life has been brought to the project by http://www.ideato.it. I will be working on the Wireframeing, Visual Design, and front end developement.

phpCollab is an open source internet-enabled system for use in projects that require collaboration over the internet. Those organizations, such as consulting firms, that rely on a division between firm-side and client-side information will benefit most from use of phpCollab

http://www.php-collab.com/

Posted in: Design, Programming on November 18th, 2009
by: Adam Patterson

My battle with Cake PHP


I have been reading “Beginning CakePHP: From Novice to Professional” and really enjoying the book. I think I have learned a lot, and while I am about 1/3rd through the book I have made a General observation about Cake PHP while using the Bake feature. While it appears to save time in setting up an application and will allow you to test the relations and mapping of your Database Scheme it lacks documentation. Not documentation in the process of baking your scripts but documentation in the code explaining what the MVC is doing and its relations to each other.

Posted in: Programming on November 11th, 2009
by: Adam Patterson

And I’m A Mac


A few days ago i found andimapc.com and made my own version. It follows the format saying then catch phrase. Another example is When Obama Wins. I spent a little over 2 hours creating the site, another 30 min changing the design to be less like andimapc.com, and then a few hours creating a moderation system for it due to abusers.

Go have a look.

Posted in: General, Programming, Wordpress on September 30th, 2008
by: Adam Patterson
Comments Off

How Much Does a Traffic Jam Cost?


got the idea for this project when I was obviously stuck in a traffic jam. I began to first wonder why no one bothered to help push the stalled car off the road. Second I began to wonder why the city doesn’t come out and tow the problem vehicle and avoid the headache of having intersections blocked by cars that got caught by the gridlock ahead.

Keeping that in mind I started to come up with an estimate of how much it would cost the city to simple move the vehicle vs. the time and money wasted by the people affected by the delay.

Gas costing what it does and lets not forget that time is money. So I came up with this little calculator that takes the fuel cost, the time it took to get though the traffic jam, as well as the length, and how many lanes of traffic were effected. Take that figure out how many sets (time to get thought divided by total time of the traffic jam) get thought and that should give you a total average cost of the traffic Jam.

I did make some speculations such as the average car being about 14 feet long and being about 3 feet from the next car in front of it.

The average wage numbers came in my case from Stats Canada.

The information collected on this site will possibly go towards a national average or total cost of all traffic jams entered in the site.

Try your calculations out here.
Lets remember that this is just for fun and can not be taken as fact but still holds enough truth to make a point.

Traffic Jam Calculator

Posted in: Programming on May 8th, 2008
by: Adam Patterson

Spoke Calculator 2.5


Its been a long time since i updated my Spoke Calculator, i have actually had the new version working for some time but lacked the necessary time to get things tested and updated.

So the time has come.

whats new?

Improved Code.
I added the ability to add rims and hubs to groups in bulk, so no more one at a time! i got tired my self of grouping 1000s of pieces of information.
Refreshed the design.
Accordion sorting in the Get info section for calculations.
Refined the search field to be more intelligent.
Improved the manage page and how you can sort information.

Demo Spoke Calculator Pro

Download Spoke Calculator Pro.
Downloaded 2565 Times.
Posted in: Programming on May 8th, 2008
by: Adam Patterson

Google Chart API


Pie chart Adam Patterson The Google Chart API lets you dynamically generate charts. The thumbnail for this article is generated by Google’s Chart API. The API is simple, the image is generated from URL parameters. The following Code chunk breaks down the images into its basic components.

Download the Source File.
Downloaded 706 Times.

Read on..

Posted in: Design, Programming on January 8th, 2008
by: Adam Patterson

Del.icio.us to CSV


Del.icio.us to CSVA few months ago i made a small script that will take the Del.icio.us history of a URL and convert it to a CSV file. you might ask what the heck would this be good for. well i at first wondered the same thing when i was asked to make it.

Gene Smith a co-worker of mine is in the process of writing a book for Peach Pit/New Riders on tagging. So the Del.icio.us to CSV spits out a file that gene can open in Excel to look at tag order (and anything else that’s interesting).

I used a free php app called Magpie RSS is an XML-based RSS parser. So after a bit of mucking around and trial and error i was left with a little script that would do Genes bidding, it seams to work on a URL with under 500 bookmarks, anything after that it dies.

Check out the Original Post:

http://atomiq.org/archives/2007/07/delicious_to_csv.html

Posted in: Programming on October 25th, 2007
by: Adam Patterson

Ruby on Rails


RailsRuby on rails is a fairly new programing language to me and version one was released a little over two years ago and it benefits from the open source community. For more information on ruby check out there website as well as Wikipedia.

The other half of the language involves what is called Rails or Ruby on Rails, and Rails is an open source frame work makes programing a breeze. Imagine adding a database table to your MySQL DB and then having it show up in your website without changing any code! its that smart.
Read on..

Posted in: Programming on December 30th, 2006
by: Adam Patterson

Search


Archive


Subscribe