/** * Set Db factory by config from Registry and set dbAdapter object */ function __construct() { $DbSettings = Registry::get('settings'); $config = $DbSettings['database']; $name = $DbSettings['database']['name']; $dbAdapter = Db::factory($name, $config); parent::__construct($dbAdapter, 'video'); }
/** * call auto loader and set Registry with application config */ public function run() { spl_autoload_register(array($this, 'load')); $settings = (require 'config' . DS . 'application.php'); Registry::set('settings', $settings); }