Victor's Blog about PHP, Zend Framework & Cake PHP

This blog is about PHP in general. It tackles various topics related to the language itself especially at the OOP level, discusses various topics related to Zend Framework and shares my experience with Cake PHP. I believe that mastering technology is heavily based on one's ability to discuss its details and share knowledge with others. Technology is a wide wild world after all!

PHP Autoloading

Printable Version

victor | 22 February, 2010 09:20

Autoloading is the process of automatically loading classes when needed wthout having to go through the traditional include() and require() directives. This helps PHP developers work without having to worry about whether the class that they need has already been loaded or not.

To achieve this, PHP 5 provides the __autoload() magic method that is called automatically whenever a class / object is being referenced while not being defined. If a definition exists for that class, the magic method will not be invoked. If a definition does not exist, the __autoload() method will be invoked before giving up and generating a warning / error message.

So how does auto loading work in examples?


What is PHP, Zend Framework and Cake PHP?

Printable Version

victor | 21 February, 2010 01:33

My first really mini-article will be simply a definition of the 3 topics behind this blog.

PHP is a widely used, general-purpose web scripting language that is embedded into the HTML source document and interpreted by a web-server integrated PHP processor module.

The name "PHP" is a recursive acronym that stands for "PHP Hypertext Preprocessor". PHP code can be also processed by an interpreter application in command-line mode to perform desired operating system operations. It may also function as a graphical application through the integration of a windowing toolkit (like PHP GTK).PHP is available as a processor for most modern web servers and as standalone interpreter on most operating systems and computing platforms.

Zend Framework (ZF) is an open source, object-oriented web application framework implemented in PHP 5. ZF is a use-at-will framework.

There is no single development paradigm or pattern that all Zend Framework users must follow, although ZF does provide components for the (Model View Controller paradigm) MVC, Table Data Gateway, and Row Data Gateway design patterns. Zend Framework provides individual components for many other common requirements in web application development.

CakePHP is an open source web application framework for producing web applications. It is written in PHP and is compatible with PHP 4 and PHP 5.

CakePHP makes it easier for the user to interface with the database with the active record pattern. It also encourages the use of the MVC architectural pattern and provides cool features like integrated CRUD for datasource interaction, application scaffolding, built-in validation, data sanitization, and internationalization and localization, various behaviors, components and helpers to minimize development time, as well as unit testing using the SimpleTest framework.

PHP, Zend Framework and CakePHP are all available through open-source licenses that allow for their free usage (although dontaion is highly recommended to maintain them) and that provide complete access to the source code behind them. More detailed topics pertaining to specific characteristics of these technologies will be provided in future articles.

My PHP Blog

Printable Version

victor | 21 February, 2010 01:24

In this blog, I will be writing specialized articles about PHP, Zend Framework, Cake PHP and other PHP-related topics as I come across them. The main point behind this blog is two-fold: sharing my findings with the community and receiving feedback in return. If you have any topic that you wish to discuss, please contact me using the contact form. I will also really appreciate having your feedback. Sharing knowledge is the key to mastering topics afterall.
Accessible and Valid XHTML 1.0 Strict and CSS