codeigniter

Getting a Codeigniter Query Source

Using CodeIgniter’s framework for query binding is great but can make it hard to debug problems in your SQL statement. The solutions I have come up with is to use the compile_binds function. This will output your SQL statement after the parameters have been cleaned and added.

var_dump($this->db->compile_binds($sql, array($param1, $param2)));


Continue reading

HTML to PDF Conversion

I just wanted to shamelessly promote one of the best open source project I have found.

html2pdf

The project is a PHP library that converts HTML into a PDF document. I have used it in two projects now and its performed brilliantly. Before I would use the ezpdf library to create a PDF from code. Its a good library but it so much easier to create your document in HMTL and then convert it.
Continue reading

Drupal Supports PHP 5.3

The new version of Drupal 6.14 now supports PHP 5.3. This news was tacked onto the bottom of the 6.14 release notes and read:


Drupal 6.14 is the first stable release to support PHP 5.3.0, but this might not be true about the contributed modules you are using. Watch out for updates to your contributed modules if you experience problems with PHP 5.3.0 support.

This is great news for me because like many OS X users I upgraded to snow leopard which comes bundled with PHP 5.3 and stop all by Drupal projects from running.


Continue reading

PHP Auto Load Includes

I have been recently working with a new contractor and he mentioned after looking at my code that I should think about auto loading the php includes using the __autoload method. At first this sounded great but I soon saw the limitations in this magic method.

The method is called when a class is instantiated but is not defined as a last ditch attempt to find it. Writing a basic function to load in classes that have not been included yet is easy but I wanted a system to include everything.


Continue reading

Compiling and Installing php5


./configure --prefix=/usr/local/php-5.2.4 --with-apxs2=/usr/local/apache2/bin/apxs --with-mysqli=/usr/local/mysql-max-5.0.18-linux-i686-glibc23/
bin/mysql_config
make && make install
libtool --finish /usr/local/php-5.2.4/libs

Continue reading