Pages

Sunday, November 14, 2010

zend framework index creation

<?php

/** Test Program

 * Defining ROOT_DIR The root directory of the

 * application

 * @var string

 */

define('ROOT_DIR', realpath(dirname(__FILE__)));

/** Test Program

 * Definig the path seperator

 * @var string

 */

define('DS','/');

// Define path to application directory

defined('APPLICATION_PATH') or define('APPLICATION_PATH', ROOT_DIR . DS. 'application');

// Define path to librarry directory

defined('LIBRARY_PATH') or define('LIBRARY_PATH', ROOT_DIR . DS. 'library');

// Define application environment

defined('APPLICATION_ENV')

    || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'local'));

// Ensure library/ is on include_path

//--    setup for the include paths

$paths = array(

    get_include_path(),

    ROOT_DIR .DS. 'library',

    APPLICATION_PATH .DS. 'modules'.DS.'storefront'.DS.'models',

);

set_include_path(implode(PATH_SEPARATOR, $paths));

//require 'error.php';

/** Zend_Application */

require_once 'Zend/Application.php';

// Create application, bootstrap, and run

$application = new Zend_Application(

    APPLICATION_ENV,

    APPLICATION_PATH . '/configs/application.ini'

);

$application->bootstrap()->run();

No comments:

Post a Comment