/** * {@inheritDoc} */ protected function init() { if ($languages = $this->_getCache(0, MODULE_NAME . DS . LANG . DS . 'comments', false, LANG_PATH)) { L($languages); } parent::init(); }
protected function init() { parent::init(); $this->_cursorPath = "House_Updown_HouseLogFixedV2"; $options = $this->getOptions(); if (isset($options['city'])) { $this->_city = explode(',', $options['city']); $this->_cursorPath .= "-" . $options['city']; } if (isset($options['mod'])) { $this->_mod = explode(',', $options['mod']); $this->_cursorPath .= "-" . $options['mod']; } }
public function init() { parent::init(); $currentRequest = '/' . strtolower(implode('/', [$this->_request->module, $this->_request->controller, $this->_request->action])); $this->getView()->currentRequest = $currentRequest; if ($this->checkAuthorization && $this->userInfo) { $rbacManage = \Core\ServiceLocator::getInstance()->get('rbacManage'); if (!$rbacManage->isAdmin($this->userInfo['name'])) { $authInfo = $rbacManage->checkAuthorization($this->userInfo['id'], $currentRequest); if ($authInfo == false) { throw new \Exception('没有节点访问权限'); } } } }
protected function init() { parent::init(); if (!file_exists($this->_cursorFile)) { if (false === file_put_contents($this->_cursorFile, 0)) { $this->logMsg(sprintf('写入游标失败。请检查目录的权限。游标文件:%s', $this->_cursorFile)); exit; } return; } if (!is_readable($this->_cursorFile)) { $this->logMsg(sprintf('游标文件:%s 不可读,请检查文件权限。', $this->_cursorFile)); exit; } if (!is_writable($this->_cursorFile)) { $this->logMsg(sprintf('游标文件:%s 不可写,请检查文件权限。', $this->_cursorFile)); exit; } file_put_contents($this->_doneFile, ''); $this->_startId = intval(file_get_contents($this->_cursorFile)); }
function init() { parent::init(); $app = Yii::app(); $app->sourceLanguage = 'xx'; if (isset($_POST['_lang'])) { $app->language = $_POST['_lang']; $app->session['_lang'] = $app->language; } if (isset($_GET['_lang'])) { $app->language = $_GET['_lang']; $app->session['_lang'] = $app->language; } else { if (isset($app->session['_lang'])) { $app->language = $app->session['_lang']; } else { $app->language = 'es_mx'; // default to spanish / mexico } } }
/** * {@inheritDoc} */ protected function init() { require CORE_PATH . 'functions/dir.php'; parent::init(); }
public function init() { parent::init(); $this->auth = new Service\user\DbUserAuth(); }