Beispiel #1
0
 public function __construct($config = array())
 {
     parent::__construct($config);
     $this->container = new \Dsc\Container();
     foreach ($config as $key => $value) {
         $this->container->share($key, $value);
     }
 }
Beispiel #2
0
 public function __construct($name = '')
 {
     parent::__construct();
     $this->name = $name;
     if (isset($_COOKIE[$name])) {
         foreach ($_COOKIE[$name] as $key => $value) {
             $this->cookie[$key] = $value;
         }
     }
 }
Beispiel #3
0
 /**
  * Constructor for the class Lang
  * @throws Exception Default Lang isn't available
  */
 public function __construct()
 {
     parent::__construct();
     // Lang is set to default
     $this->setLang(_DEFAULT_LANG);
     // Try to use the visitor's lang
     // If not possible, use the default one
     //TODO
     // $this->setLang();
 }
Beispiel #4
0
 public function __construct()
 {
     parent::__construct();
     $sid = F::i('Cookie')->get('sid');
     $ip = $_SERVER['REMOTE_ADDR'];
     $check = FALSE;
     try {
         $check = $this->checkSid($sid);
     } catch (BadSIDException $e) {
         // Hacking attempt... Say no and log !
         $check = FALSE;
         Record::note($e->__toString());
     } catch (NullSIDException $e) {
         // Nothing important...
         $check = FALSE;
     }
     // If DatabaseException is raised, it's more important, let it throws !
     // If Check return FALSE, sid is incorrect !
     if (!$check) {
         // Create a new session
         // 0.00000000000000000000000000000000000000001
         // chance of having 2 sessions with the same id !
         // I hope never happen
         $sid = $this->generateID();
         $this->mid = _ID_VISITOR;
         // Register it
         F::i(_DBMS_SYS)->exec('INSERT INTO !prefix_sessions (s_id, m_id, v_ip, s_date) VALUES (?, ?, ?, NOW())', array($sid, $this->mid, ip2long($ip)));
     } else {
         // Update it
         F::i(_DBMS_SYS)->exec('UPDATE !prefix_sessions SET s_date=NOW() WHERE s_id = ?', array($sid));
         $result = F::i(_DBMS_SYS)->query('SELECT m.m_id, m.m_auth FROM !prefix_sessions s, !prefix_members m WHERE m.m_id = s.m_id AND s.s_id = ?', array($sid));
         $obj = $result->getObject();
         if ($obj !== NULL) {
             $this->mid = intval($obj->m_id);
             $this->auth = intval($obj->m_auth);
         }
     }
     $this->setSID($sid);
 }
Beispiel #5
0
 protected function __construct()
 {
     parent::__construct();
     $this->tabProfiler = array();
     $seedDate = date('c');
     $this->namePOTFile = $seedDate . '.log.txt';
     //TODO intialisation des fichiers / ouverture lecture ?
 }
	public function __construct(){
		parent::__construct();
	}
Beispiel #7
0
 /**
  * Constructor por defecto
  */
 public function __construct()
 {
     parent::__construct();
     $this->clearContext();
 }
 private function __construct()
 {
     parent::__construct();
 }
 function __construct($args = array())
 {
     if (!function_exists('my_t_define_constants')) {
         die('Theme constants not defined.');
     }
     parent::__construct();
     // default
     self::$assets_path = MY_BASEPATH . DS . 'assets';
     self::$assets_url = MY_BASEURL . '/' . 'assets';
     self::$widgets_path = MY_BASEPATH . DS . 'widgets';
     self::$feeds_path = MY_BASEPATH . DS . 'feeds';
     self::$admin_path = MY_BASEPATH . DS . 'admin-pages';
     self::$builds_path = MY_BASEPATH . DS . 'builds';
     self::$tools_path = MY_BASEPATH . DS . 'tools';
     // custom overrides + dynamic property declarations
     // this allows use to save some space
     foreach ($args as $key => $value) {
         if (property_exists($this, $key) or $this->is_switch_var($key)) {
             $this->{$key} = $value;
         }
     }
     $this->assets = new MY_Theme_Assets(array('handle' => self::$assets_path, 'url' => self::$assets_url));
     $this->check_dependencies();
     $this->check_phpversion();
     $this->check_activation();
     $this->add_wp_hooks();
     if (MY_ISADMIN) {
         add_action('admin_menu', array($this, 'add_admin_pages'), 1);
         // add first b/c we're important
     }
     // TODO - do admin
     $this->save_plugins_list();
     // outsource data sanitizing
     // wp-post/query interface, request var handling
     $this->template = new StdClass();
 }
 protected function __construct()
 {
     parent::__construct();
     $this->en_el = array_merge(array_flip($this->el_en), $this->en_el);
 }