/** * (non-PHPdoc) * @see \mithra62\Bootstrap::getServices() */ public function getServices() { $this->container = parent::getServices(); $this->container['settings'] = function ($c) { $settings = new Settings($c['db'], $c['lang']); $db_info = $this->getDbConfig(); $settings->setOverrides($c['platform']->getConfigOverrides())->setEncrypt($c['encrypt'])->setValidate($c['settings_validate'])->setTable($db_info['settings_table_name']); return $settings; }; $this->container['backups'] = function ($c) { $backups = new Backups($c['files']); return $backups; }; $this->container['backup'] = function ($c) { $backup = new Backup($c['db']); $backup->setServices($c); return $backup; }; $this->container['restore'] = function ($c) { $restore = new Restore($c['db']); $restore->setServices($c); return $restore; }; $this->container['errors'] = function ($c) { $errors = new Errors(); $errors->setValidation($c['validate']); return $errors; }; $this->container['notify'] = function ($c) { $notify = new Notify(); $view_dir = realpath(dirname(__FILE__) . '/view'); $notify->setMail($c['email'])->setViewPath($view_dir)->setSettings($c['settings']->get()); return $notify; }; $this->container['settings_validate'] = function ($c) { $validate = new valSettings(); $validate->setRegex($this->container['regex']); return $validate; }; return $this->container; }
/** * Sets everything up for use * * Should be called before any thing else! */ public function initController() { $this->m62 = new Bootstrap(); $this->services = $this->m62->getServices(); }