Source for file Base.php
Documentation is available at Base.php
* Application_Bootstrap_Base
* Copyright (C) 2009 Mai (Me Artificial Intelligence)
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* @author Wouter Bulten (wouterbulten@mai-ai.org)
* @copyright Copyright (C) 2009 Mai (Me Artificial Intelligence)
* @license http://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3 (GPLv3)
* @link http://www.launchpad.net/mai
* Application_Bootstrap_Base is a base class for bootstrap classes.
* @author Wouter Bulten (wouterbulten@mai-ai.org)
* @copyright Copyright (C) 2009 Mai (Me Artificial Intelligence)
* @license http://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3 (GPLv3)
* @link http://www.launchpad.net/mai
* Private constructor to prevent creation of this object.
* Starts up the bootstrap.
static public function run(){}
* Loads the global.ini file and saves it to the registry.
$config = new Zend_Config_Ini(APPLICATION_PATH . '/config/config.ini', 'global');
Zend_Registry::set('config', $config);
* @return Zend_Config_Ini
return new Zend_Config_Ini(APPLICATION_PATH . '/config/config.ini', 'db');
* Loads the doctrine-cli.ini file and outputs an array with config variables for the base db.
$config = new Zend_Config_Ini(APPLICATION_PATH . '/config/doctrine-cli.ini');
'data_fixtures_path' => BASE_PATH . $config->doctrine_cli->path_fixtures_base,
'models_path' => BASE_PATH . $config->doctrine_cli->path_models_base,
'migrations_path' => BASE_PATH . $config->doctrine_cli->path_migrations_base,
'sql_path' => BASE_PATH . $config->doctrine_cli->path_sql_base,
'yaml_schema_path' => BASE_PATH . $config->doctrine_cli->path_schema_base,
'generate_models_options' => array('generateTableClasses' => true)
* Loads the doctrine-cli.ini file and outputs an array with config variables for the user db.
$config = new Zend_Config_Ini(APPLICATION_PATH . '/config/doctrine-cli.ini');
'data_fixtures_path' => BASE_PATH . $config->doctrine_cli->path_fixtures_user,
'models_path' => BASE_PATH . $config->doctrine_cli->path_models_user,
'migrations_path' => BASE_PATH . $config->doctrine_cli->path_migrations_user,
'sql_path' => BASE_PATH . $config->doctrine_cli->path_sql_user,
'yaml_schema_path' => BASE_PATH . $config->doctrine_cli->path_schema_user,
'generate_models_options' => array('generateTableClasses' => true),
$config->db_base->dbtype,
$config->db_base->username,
$config->db_base->password,
$config->db_base->dbname);
$conn = Doctrine_Manager::connection($dsn, $config->db_base->connection_name);
Zend_Registry::set('conn_dbbase', $conn);
$config->db_user->dbtype,
$config->db_user->username,
$config->db_user->password,
$config->db_user->dbname);
$conn = Doctrine_Manager::connection($dsn, $config->db_user->connection_name);
Zend_Registry::set('conn_dbuser', $conn);
//Include paths for libraries
. PATH_SEPERATOR . BASE_PATH . '/library'
. PATH_SEPERATOR . APPLICATION_PATH . '/models'
* Setup auto loading of classes.
require_once('Zend/Loader.php');
require_once('Zend/Loader/Autoloader.php');
$autoloader = Zend_Loader_Autoloader::getInstance();
//Register namespace Mai_
$autoloader->registerNamespace('Mai_');
$autoloader->registerNamespace('Doctrine_');
$autoloader->registerNamespace('Doctrine');
$autoloader->setFallbackAutoloader(true);
$autoloader->suppressNotFoundWarnings(false);
* Cloning of a bootstrap class is not allowed.
|