Example #1
0
 /**
  * Finish up config by connecting to db
  */
 public function end()
 {
     // set config for each component
     foreach ((array) $this->controller as $key => $value) {
         Mad_Controller_Base::${$key} = $value;
     }
     foreach ((array) $this->mailer as $key => $value) {
         Mad_Mailer_Base::${$key} = $value;
     }
     foreach ((array) $this->view as $key => $value) {
         Mad_View_Base::${$key} = $value;
     }
     foreach ((array) $this->model as $key => $value) {
         Mad_Model_Base::${$key} = $value;
     }
     foreach ((array) $this->test as $key => $value) {
         Mad_Test_Base::${$key} = $value;
     }
     // database connection
     Mad_Model_Base::establishConnection(MAD_ENV);
 }
Example #2
0
 public function testEstablishConnectionArray()
 {
     $conn = Mad_Model_Base::establishConnection(array());
 }
Example #3
0
 /**
  * Connect to the database.
  * 
  * @return  object  {@link Mad_Model_ConnectionAdapter_Abstract}
  */
 protected function _connect()
 {
     if (!Mad_Model_Base::isConnected()) {
         Mad_Model_Base::setLogger();
         // default logger
         Mad_Model_Base::establishConnection($this->_spec);
     }
     $this->_conn = Mad_Model_Base::connection();
 }
Example #4
0
 /**
  * Connect to the database.
  * 
  * @return  object  {@link Mad_Model_ConnectionAdapter_Abstract}
  */
 protected function _connect()
 {
     if (!Mad_Model_Base::isConnected()) {
         Mad_Model_Base::establishConnection(MAD_ENV);
     }
     return Mad_Model_Base::connection();
 }