Ganesh H S

Thoughts on open source technologies, search engine optimization, website security

zend framework tutorial: Part 6 - Zend Debug

Zend debug is used for debugging purpose. The static method Zend_Debug::dump() prints or returns information about an expression, which is much similar of using var_dump.
Syntax is as below -
<?php

// $var argument specifies the expression or variable
// $label argument is a string to be prepended to the output
// $echo argument specifies whether the output […]

zend framework tutorial: Part 5 - Zend Exception

As in other object oriented programming languages, zend framework supports try catch, all exceptions thrown by Zend Framework classes should throw an exception that derives from the base class Zend_Exception.
Example 1:
In this example, code require_once “Zend_Loader.php”; is commented, so error is thrown when we are trying to access Zend_Loader.
<?php
//require_once “Zend_Loader.php”;

try
{
Zend_Loader::loadClass(’Zend_Session’);
}
catch (Zend_Exception $e) {
echo “Error message: […]

zend framework tutorial: Part 4 - zend config

In the previous post about setting project environment setting http://ganeshhs.com/php/php-configuring-project-environment-using-ini-file , zend config plays a vital role in initializing the environment variables and by default, configuration data made available through Zend_Config are read-only.
Lets write the ini configuration file application/config.ini
[staging]
db.adapter = PDO_MYSQL
db.config.host = localhost
db.config.username = mysql_user
db.config.password […]

zend framework tutorial : Part 3 - zend loader

Zend loader is much similar to require_once, best usage is if we have to load a file based on the variable value.
<?php

require_once “Zend/Loader.php”;

Zend_Loader::loadClass(’Zend_Session’);

Zend_Session::start();
?>
The above example, illustrates loading the zend session class and starting the session.
Here i am not going to discuss complete usage of zend loader, i will be explaining zend framework concepts to quick […]