Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Define path to application directory
- defined('APPLICATION_PATH')
- || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
- // Define path to application directory
- defined('PUBLIC_PATH')
- || define('PUBLIC_PATH', dirname($_SERVER['SCRIPT_NAME']));
- // Define application environment
- defined('APPLICATION_ENV')
- || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
- // Ensure library/ is on include_path
- set_include_path(implode(PATH_SEPARATOR, array(
- realpath(APPLICATION_PATH . '/../library'),
- get_include_path(),
- )));
- /** Zend_Application */
- require_once 'Zend/Application.php';
- // create application, bootstrap, and run
- $application = new Zend_Application(
- APPLICATION_ENV,
- APPLICATION_PATH . '/configs/application.ini'
- );
- $bootstrap = $application->getBootstrap();
- $configIni = new Zend_Config_Ini(APPLICATION_PATH . '/configs/application.ini',
- 'development');
- // set the connection to the database
- $dbAdapter = new Zend_Db_Adapter_Pdo_Mysql(array(
- 'host' => $configIni->resources->db->params->host,
- 'username' => $configIni->resources->db->params->username,
- 'password' => $configIni->resources->db->params->password,
- 'dbname' => $configIni->resources->db->params->dbname,
- 'profiler' => true
- ));
- // set the authentification adapter
- $authAdapter = new Zend_Auth_Adapter_DbTable($dbAdapter);
- $authAdapter->setTableName('users')
- ->setIdentityColumn('login')
- ->setCredentialColumn('pass')
- ->setCredentialTreatment('MD5(?)');
- // set the user language
- $locale = new Zend_Locale('en');
- // set variables in registry
- Zend_Registry::set('dbAdapter', $dbAdapter);
- Zend_Registry::set('bootstrap', $bootstrap);
- Zend_Registry::set('configIni', $configIni);
- Zend_Registry::set('authAdapter', $authAdapter);
- $application->bootstrap()
- ->run();
Add Comment
Please, Sign In to add comment