/** * Run this before every call * * @return void * @access public */ public function before() { // Profile the loader \Profiler::mark('Start of loader\'s before() function'); \Profiler::mark_memory($this, 'Start of loader\'s before() function'); // Set the environment parent::before(); // Load the config for Segment so we can process analytics data. \Config::load('segment', true); // Load the config file for event names. Having events names in one place keeps things synchronized. \Config::load('analyticsstrings', true); // Engine configuration \Config::load('engine', true); // Load the package configuration file. \Config::load('tiers', true); // Soccket connection configuration \Config::load('socket', true); /** * Ensure that all user language strings are appropriately translated. * * @link https://github.com/fuel/core/issues/1860#issuecomment-92022320 */ if (is_string(\Input::post('language', false))) { \Environment::set_language(\Input::post('language', 'en')); } // Load the error strings. \Lang::load('errors', true); }
/** * This will set the DI Container before the controller loads */ public function before() { parent::before(); //init di containers $di = new Library\Di(); $this->setDi($di->getDi()); }
public function before() { parent::before(); // Load Exchange package \Package::load('Skills'); $this->skills = \Skills\Skills::forge(); }
public function before() { parent::before(); Config::load('base'); foreach (Input::post() as $k => $v) { Log::info($k . ':' . $v); } }
public function before() { parent::before(); //\Session::delete(self::ORDER); if (empty(\Session::get(self::ORDER))) { \Session::set(self::ORDER, array('cart' => array())); } }
public function before() { parent::before(); // if (!\Input::is_ajax()) // { // throw new HttpNotFoundException; // } }
public function before() { parent::before(); if (!Model_User::is_logged()) { $this->response($this->_error('login error'), 200); } else { $this->_user = Model_User::get_login_user(); } }
public function before() { // Make sure we call the parent package before function parent::before(); // Load the config file for this package \Config::load(static::$_configFile, true); // Now set the view directory for this package static::$_viewPath = \Config::get(static::$_configFile . '.view_directory'); }
public function before() { parent::before(); // Assign current_user to the instance so controllers can use it $this->user = Warden::check() ? Warden::current_user() : null; if (!$this->user) { $this->response(array('status' => 0, 'error' => 'Not Authorized'), 401); } }
/** * Load the template and create the $this->template object */ public function before() { if (!\Input::is_ajax()) { if (!empty($this->template) and is_string($this->template)) { // Load the template $this->template = \View::forge($this->template); } } return parent::before(); }
public function before() { parent::before(); if (Auth::check()) { $user_id = Auth::get_user_id()[1]; $this->user = Model_User::find($user_id); if ($this->user->group_id == 100) { $this->auth_status = true; } } }
/** * Load the template and create the $this->template object if needed */ public function before() { // setup the template if this isn't a RESTful call if (!$this->is_restful()) { if (!empty($this->template) and is_string($this->template)) { // Load the template $this->template = \View::forge($this->template); } } return parent::before(); }
/** * This method gets called before the action is called */ public function before() { parent::before(); // 各種設定ファイルロード $this->load_conf(); // メンテナンスモード $this->maintenance(); // ログイン済専用ページ処理 $this->logined_action(); // 各コントローラ独自の前処理 if (method_exists(static::$this, 'before_controller')) { $this->before_controller(); } }
public function before() { parent::before(); if (Auth::check()) { $user_id = Auth::get_user_id()[1]; $this->user = Model_User::find($user_id); if ($this->user->group_id == 1) { $this->auth_status = true; if ($this->user->timezone != "") { $timezone = Config::get("timezone.timezone"); if (isset($timezone[$this->user->timezone])) { date_default_timezone_set($timezone[$this->user->timezone]); } } } } }
public function before() { parent::before(); // 利用者を識別する if (isset($_SESSION['user'])) { $this->user = $_SESSION['user']; } else { header('HTTP/1.1 401 Authorization Required'); exit; } $this->model_todo = new Model_Todo($this->user); if (!isset($_SESSION['sort_setting'])) { $_SESSION['sort_setting'] = $this->model_todo->make_initial_setting('sort_setting'); } if (!isset($_SESSION['search_keyword'])) { $_SESSION['search_keyword'] = $this->model_todo->make_initial_setting('search_keyword'); } }
public function before() { parent::before(); // 利用者を識別する if (isset($_SESSION['user'])) { $this->user = $_SESSION['user']; } else { var_dump('利用可能なユーザーでアクセスしてください。'); exit; } $this->model_todo = new Model_Todo($this->user); if (!isset($_SESSION['sort_setting'])) { $_SESSION['sort_setting'] = $this->model_todo->make_initial_setting('sort_setting'); } if (!isset($_SESSION['search_keyword'])) { $_SESSION['search_keyword'] = $this->model_todo->make_initial_setting('search_keyword'); } }
public function before() { # まず最初に親のbefore()を呼ばないといけないfuelのルール。エラーになる。 parent::before(); $this->format = self::DEFAULT_RESPONSE_FORMAT; }
public function before() { parent::before(); }
public function before() { parent::before(); libxml_use_internal_errors(true); }