Created
December 8, 2011 23:50
-
-
Save eminetto/1449311 to your computer and use it in GitHub Desktop.
bootstrap do blog
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap | |
{ | |
/** | |
* Salva o config no registry | |
* @return void | |
* @author Elton Minetto | |
*/ | |
public function _initConfig() | |
{ | |
$config = new Zend_Config($this->getApplication()->getOptions(), true); | |
Zend_Registry::set('config', $config); | |
} | |
/** | |
* Inicializa a sessão | |
* | |
* @return void | |
* @author Elton Minetto | |
*/ | |
public function _initSession() | |
{ | |
$session = new Zend_Session_Namespace('Blog'); | |
Zend_Registry::set('session', $session); | |
} | |
/** | |
* Inicializa o banco de dados. Somente necessário se desejado salvar a conexão no Registry | |
* | |
* @return void | |
* @author Elton Minetto | |
*/ | |
public function _initDb() | |
{ | |
$db = $this->getPluginResource('db')->getDbAdapter(); | |
Zend_Db_Table::setDefaultAdapter($db); | |
Zend_Registry::set('db', $db); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment