Bootstrap
[
class tree: Bootstrap
] [
index: Bootstrap
] [
all elements
]
Packages:
Application
Base
Bootstrap
Controllers
Models
Source for file Application.php
Documentation is available at
Application.php
<?php
/**
* Application_Bootstrap_Application
*
* 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
*
*
@package
Bootstrap
*
@subpackage
Application
*
*/
/**
* Application_Bootstrap_Application is the bootstrap for the application.
*
*
@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
*
*
@package
Bootstrap
*
@subpackage
Application
*
*
*/
class
Application_Bootstrap_Application
extends
Application_Bootstrap_Base
{
/**
* Private constructor to prevent creation of this object.
*
@return
void
*/
private
function
__construct
(
)
{
}
/**
* Starts up the bootstrap.
*
@return
void
*/
static
public
function
run
(
)
{
//Set include paths
parent
::
initIncludePaths
(
)
;
//Start auto loader
parent
::
initAutoLoader
(
)
;
//Load global config
parent
::
initGlobalConfig
(
)
;
//Init base db connection
parent
::
initBaseDbConnection
(
parent
::
returnDbConfig
(
))
;
//Init user db connection
parent
::
initUserDbConnection
(
parent
::
returnDbConfig
(
))
;
//Configure Doctrine
//@Mai Todo: Move this to a seperate function inside Application_Bootstrap_Base
Doctrine_Manager
::
getInstance
(
)
->
setAttribute
(
Doctrine
::
ATTR_AUTO_ACCESSOR_OVERRIDE
,
true
)
;
//Init frontcontroller
self
::
initFrontController
(
)
;
//Dispatch the application
Zend_Controller_Front
::
getInstance
(
)
->
dispatch
(
)
;
}
/**
* Configure the frontController.
*
@return
void
*/
static
private
function
initFrontController
(
)
{
//Get the frontcontroller
$frontController
=
Zend_Controller_Front
::
getInstance
(
)
;
//Set modules
$frontController
->
setControllerDirectory
(
array
(
'default'
=>
APPLICATION_PATH
.
'/modules/default/controllers'
,
))
;
$frontController
->
setDefaultModule
(
'default'
)
;
//Define plugin cache file
//Creates an file with require_once statements for faster plugin loading.
$classFileIncCache
=
BASE_PATH
.
'/cache/plugins/pluginLoaderCache.php'
;
if
(
file_exists
(
$classFileIncCache
))
{
include_once
$classFileIncCache
;
}
Zend_Loader_PluginLoader
::
setIncludeFileCache
(
$classFileIncCache
)
;
//Show errors when in development
if
(
Zend_Registry
::
get
(
'config'
)
->
application
->
development
)
{
$frontController
->
throwExceptions
(
true
)
;
}
//Register plugins
self
::
registerFrontControllerPlugins
(
$frontController
)
;
}
/**
* Register the frontController plugins.
*
@param
Zend_Controller_Front
$frontController
*
@return
void
*/
static
private
function
registerFrontControllerPlugins
(
Zend_Controller_Front
$frontController
)
{
//Register plugins
}
}
Documentation generated on Mon, 27 Jul 2009 19:51:46 +0200 by
phpDocumentor 1.4.1