propel

Release: Pale Purple's Trac Project Planning Board

This week, we are releasing our first full open source project.

It's basically a piece of web-based software, written in Python and PHP, that allows you to allocate tickets from multiple Trac projects to a simple week-based 'board' in order to organise work priority for developers.

More training courses

We've scheduled some more PHP training courses up to June next year, running monthly.

People who are active members of Birmingham, Wolverhampton or Redditch and Bromsgrove LUGs or PHPWM can receive a discount of £25/day

See here for more details

PHP DateTime vs mktime / strtotime in Propel

One of the relatively new features in PHP 5.2, is the DateTime class/functions. It has a few useful functions (date_parse, date_date_set, date_time_set etc) which make dealing with dates and times easier (date_parse provides some useful error info too).

Unfortunately, the PHP api still doesn't allow for something like :


$seconds = $dateTime->parse($string, $format);

Oxford Compsoc Talk on PHP

I've put the slides we presented to Oxford computer society online - see here - it's based on a shorter version we gave to the UK Linux Expo thing a few months ago.

Propel ...

Propel

If you get turned on by Object Relational Mapping tools, or alternatively you're fed up of writing quite so much SQL when writing web applications try reading this guide on Propel

Propel : An introduction to a PHP Object Relational Mapping and Querying Framework

What is Propel?

Propel is a PHP framework that provides a fairly complete ORM solution - object persistence and querying, allowing you to access your database of choice using objects. Its API is similar to that of the Apache Torque project upon which it is based. Torque is written in Java, Propel in PHP. Propel is available for PHP4 and PHP5, although I've only used the PHP5 version, I assume the API remains the same.

What is Object-Relational Mapping?

Whatever reason you have for using objects in your code, anybody who uses them to represent their data in 'traditional' SQL driven PHP applications will know about the blood, sweat, tears that go into the masses of code produced to perform what is in many cases 'boilerplate' actions.

Propel Date Handling

Date Handling in PHP/Propel

We're using Propel as a framework for a PHP application we're currently writing (I'm also in the process of writing a Linux User&Developer article on it).

Yesterday, I noticed we were not saving dates correctly, and it appears that we need to always use the format yyyy/mm/dd instead of the more natural dd/mm/yyyy (at least from a UI point of view).

Propel would save the date in e.g. yyyy/mm/dd format, into the database (MySQL) without a problem, but then upon calling the getDate() function to retrieve it, it would become mangled (e.g. 29/07/06 would become something like 2029/07/06 or thrown a Propel exception). I had a look in the Propel internal code, and it uses the PHP strftime function and defaults to passing it '%x' to format what it returns to the user.

Syndicate content