- Configure firewall to allow httpd requests: system-config-securitylevel
- Get PHP development RPM: http://rpm.pbone.net/index.php3/stat/4/idpl/8077900/com/php-devel-5.1.6-20.el5.i386.rpm.html
- Get PHP source RPM: ftp://ftp.pbone.net/mirror/ftp.centos.org/5.3/os/SRPMS/php-5.1.6-23.el5.src.rpm
- Use yum to handle RPM dependencies. yum install php-5.1.6-23.el5.src.rpm
- Update SPECS/php.spec and enable/disable options as necessary.
- rpmbuild -bb –target=i386 SPECS/php.spec - It’s good to specify the target, since otherwise, the RPM build may take a very long time.
- Force the installation of the updated RPMs. I did an ls of the RPMS directory and forced them all.
rpm -i –force php-5.1.6-23.i386.rpm php-bcmath-5.1.6-23.i386.rpm php-cli-5.1.6-23.i386.rpm php-common-5.1.6-23.i386.rpm php-dba-5.1.6-23.i38
6.rpm php-debuginfo-5.1.6-23.i386.rpm php-devel-5.1.6-23.i386.rpm php-gd-5.1.6-23.i386.rpm php-imap-5.1.6-23.i386.rpm php-ldap-5.1.6-23.i386.
rpm php-mbstring-5.1.6-23.i386.rpm php-mysql-5.1.6-23.i386.rpm php-ncurses-5.1.6-23.i386.rpm php-odbc-5.1.6-23.i386.rpm php-pdo-5.1.6-23.i386
.rpm php-pgsql-5.1.6-23.i386.rpm php-snmp-5.1.6-23.i386.rpm php-soap-5.1.6-23.i386.rpm php-xml-5.1.6-23.i386.rpm php-xmlrpc-5.1.6-23.i386.rpm
Allows you to upload up to 10 images.
Assembles them into a banner 100px high. Adjusts height, retains aspect ratio.
Produces both a .PNG and .JPG.
The code in the previous post was converted to use Zend Framework’s Db component for database access. One of the first things I noticed was that the code got smaller.
There are many ways to use Zend_Db, for this implementation, this approach fits well. Note the use of Zend_Config_Ini as well.
object.class.php changed, and item.class.php was converted to store the properties in an object, rather than an array. classes/db.class.php was deleted.
The objective of this wrapper is to provide a streamlined interface to data stored in a database.
- Object properties are stored in an array. This makes managing them must easier. Upon instantiation, the array is loaded with empty strings.
- Magic methods are used to set and return properties.
- The properties have a one-to-one, exact mapping to the underlying database.
- A generic object exists beneath the specific object. It accepts a table name, identifier column name, and an array of values.
A search function will be added.
The basic idea of this rating script is to count the number of votes and the ratings and store them in a text file (a database could also be used).
The first step was to create some images to represent the ratings. The easiest approach was to use ImageMagick to create colorful asterisks.
Finally, the PHP was written and tested. It is listed below.
In a production environment, some CAPTCHA or other tool should be used to prevent automated submissions.