Friday, January 14, 2011

zend config file

[production]
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
;includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.layout.layout = "layout"
resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts"
resources.frontController.plugins.acl = "Plugin_acl"
[staging : production]

[testing : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1

[development : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
;# Layout
;resources.layout.layout = "layout"
;resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts"

resources.db.adapter = "pdo_mysql"
resources.db.params.host = "localhost"
resources.db.params.username = "root"
resources.db.params.password = ""
resources.db.params.dbname = "honda"
resources.db.isDefaultTableAdapter = true

Zend Boot strap


class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{

protected function _initView()
{

$view = new Zend_View();
$view->doctype('XHTML1_STRICT');
$view->headTitle('Pioneer India');
$view->env = APPLICATION_ENV;
$view->skin = 'blues';
// Add it to the ViewRenderer
$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper(
'ViewRenderer'
);
$view->addHelperPath('ZendX/JQuery/View/Helper/', 'ZendX_JQuery_View_Helper');
$viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();
$viewRenderer->setView($view);
Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
$viewRenderer->setView($view);
/////////////////////////////////////////////

// Return it, so that it can be stored by the bootstrap
return $view;
}
protected function _initAutoload()
{
// Add autoloader empty namespace
$autoLoader = Zend_Loader_Autoloader::getInstance();
$autoLoader->registerNamespace('Pioneersys_');
$autoLoader->registerNamespace('OFC_');
$resourceLoader = new Zend_Loader_Autoloader_Resource(array(
'basePath' => APPLICATION_PATH,
'namespace' => '',
'resourceTypes' => array(
'form' => array(
'path' => 'forms',
'namespace' => 'Form_',
),
'model' => array(
'path' => 'models/',
'namespace' => 'Model_'
),
'plugin' => array(
'path' => 'plugin/',
'namespace' => 'Plugin_'
)
),
));
// Return it so that it can be stored by the bootstrap
return $autoLoader;
}