当前位置: 首页>>代码示例>>PHP>>正文


PHP Singleton::__construct方法代码示例

本文整理汇总了PHP中Singleton::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Singleton::__construct方法的具体用法?PHP Singleton::__construct怎么用?PHP Singleton::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Singleton的用法示例。


在下文中一共展示了Singleton::__construct方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct($config = array())
 {
     parent::__construct($config);
     $this->container = new \Dsc\Container();
     foreach ($config as $key => $value) {
         $this->container->share($key, $value);
     }
 }
开发者ID:dioscouri,项目名称:f3-lib,代码行数:8,代码来源:System.php

示例2: __construct

 public function __construct($name = '')
 {
     parent::__construct();
     $this->name = $name;
     if (isset($_COOKIE[$name])) {
         foreach ($_COOKIE[$name] as $key => $value) {
             $this->cookie[$key] = $value;
         }
     }
 }
开发者ID:Korko,项目名称:RiskOnline,代码行数:10,代码来源:Cookie.php

示例3: __construct

 /**
  * 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();
 }
开发者ID:Korko,项目名称:RiskOnline,代码行数:14,代码来源:Lang.php

示例4: __construct

 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);
 }
开发者ID:Korko,项目名称:RiskOnline,代码行数:39,代码来源:Session.php

示例5: __construct

 protected function __construct()
 {
     parent::__construct();
     $this->tabProfiler = array();
     $seedDate = date('c');
     $this->namePOTFile = $seedDate . '.log.txt';
     //TODO intialisation des fichiers / ouverture lecture ?
 }
开发者ID:TheProjecter,项目名称:log4gy,代码行数:8,代码来源:Log4GY.php

示例6: __construct

	public function __construct(){
		parent::__construct();
	}
开发者ID:xiaoxiaoJun,项目名称:phpper,代码行数:3,代码来源:单例模式分析01.php

示例7: __construct

 /**
  * Constructor por defecto
  */
 public function __construct()
 {
     parent::__construct();
     $this->clearContext();
 }
开发者ID:c15k0,项目名称:psfs,代码行数:8,代码来源:Service.php

示例8: __construct

 private function __construct()
 {
     parent::__construct();
 }
开发者ID:srinathweb,项目名称:HeadFirstDesignPatternsInPHP,代码行数:4,代码来源:CoolerSingleton.php

示例9: array

 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();
 }
开发者ID:hlfcoding,项目名称:hlf-wordpress,代码行数:36,代码来源:abstract.theme-base.php

示例10: __construct

 protected function __construct()
 {
     parent::__construct();
     $this->en_el = array_merge(array_flip($this->el_en), $this->en_el);
 }
开发者ID:panvagenas,项目名称:acs-web-services-for-prestashop,代码行数:5,代码来源:TransLit.php


注:本文中的Singleton::__construct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。