Archive for the 'PHP' Category

PHP JAVA Integration

May 23, 2006 in PHP, Java

While searching for a good text-search engine for PHP, something like the excellent Apache Lucene for Java, I came across a post about PHP-Lucene Integration. Briefly, the post introduce a way to integrate Lucene with PHP via a PHP JAVA Bridge. This piece of software enables PHP to communicate with Java via a XML-based network protocol which can be used to connect a native script engine with a Java virtual machine. It is also stated that it is 50 times faster than local RPC via SOAP. Now this is really good news for me. I have been developing intensively with Java before I started my company, so my Java skill is actually better than PHP (but PHP is so much simpler).

I really PHP love using PHP because it is fast and easy to develop frontend of a web application with templates engine like Smarty.IMO, PHP as the frontend is more mature than Java. Java on the other hand, are excellent for the backend. Java technology like the upcoming EJB3, Hibernate, Swing framework are all really scalable and are design for enterprise.

I am REALLY tempted to explore a full scale PHP/JAVA hybird solution. @_@ But it doesn’t sounds really feasible because there aren’t many developers out there who are good at both PHP and Java. It WILL be a big problem finding programmers if I were to expand my business in the future.
Hmm… I wonder if I could get Cradle to fund my research. =)

Getting started with PHP development for FREE

May 21, 2006 in PHP, CakePHP

I got several web development projects on hand now which requires something more than static html but doesn’t need something powerful and complex like Java. Therefore I have chosen PHP as the programming language of my choice. Beside being less complicated, it is also less resource intensive than something like Java. I will not be stating any opinion on specific tools or framework, rather just a list of my choice.

Setting up the Web Server

My webserver is made up of Apache 1.3.34 , PHP 5.1.4, MySQL 4.1.18 on a Windows XP Professional SP2. Technically you could install PHP4 and PHP5 on the same server, but hey… why would you wanna complicate things? I just read the README available on each download for installation steps, or you could use an all in one package like XAMPP to speed things up. But I would advise developers to do it manually, because if you can’t setup a server… you are definitely in the wrong field. Another goody is PHPMyAdmin, a PHP web-based administration tool for MySQL. Try googling for “apache php mysql on windows” if you get stuck somewhere.

Integrated Development Environment (IDE) Resource

You need an IDE to do REAL work. Eclipse with PHPEclipse plugin is your best bet… for free or not. Also get additonal plug in listed here. At the moment, PHPDebugger for PHP 5.1.4 is not out yet… therefore, no debugging with breakpoint at the moment. You should really read here for other useful stuff like PHPDocumentor and integrating PHP Manual into PHPEclipse.

Framework

PHP is a very flexible language which made some people thinks that PHP is unsecure. The problem is not the language, but rather how a programmer follow the rules. When something is flexible, we tend to bend the rules quite often. Therefore, we need a framework to speed things up and keep security in line. With so many frameworks out there, there is really no reason for you to write one yourself. My choice would either Symfony or CakePHP. At this very moment, I am using CakePHP for a project of mine because of the built-in fine-grain Access Control Lists (ACL) feature and a less complicated way of accessing database. Symfony uses Propel which reminds me of Hibernate without Annotations from Java 5. It is a PAIN writing and updating XML files even with the automated tools.

CakePHP Integration with PHPEclipse

There is only 1 small thing I want to mention here, CakePHP uses the *.thtml for the Views. To enable syntax highlights for *.thtml correctly you might wanna checkout this post.