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


PHP static::initialized方法代码示例

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


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

示例1: init

 public static function init()
 {
     if (!static::$initialized) {
         $sessionTimeLimit = 20 * 60;
         session_set_cookie_params($sessionTimeLimit);
         session_start();
         // Verify if session already is valid
         $keyDiscardTime = '___discard_after___';
         $now = time();
         if (isset($_SESSION[$keyDiscardTime]) && $now > $_SESSION[$keyDiscardTime]) {
             // this session has worn out its welcome; kill it and start a brand new one
             session_unset();
             session_destroy();
             session_start();
         }
         // either new or old, it should live at most for another hour
         $_SESSION[$keyDiscardTime] = $now + $sessionTimeLimit;
         static::$initialized = true;
         //Clear all old flash data
         foreach ($_SESSION as $k => $v) {
             if (Str::contains($k, ":old:")) {
                 static::clear($k);
             }
         }
         //Set all new flash data as old, to be cleared on the next request
         foreach ($_SESSION as $k => $v) {
             $parts = explode(":new:", $k);
             if (is_array($parts) && count($parts) == 2) {
                 $newKey = "flash:old:" . $parts[1];
                 static::set($newKey, $v);
                 static::clear($k);
             }
         }
     }
 }
开发者ID:jura-php,项目名称:jura,代码行数:35,代码来源:Session.php

示例2: initialize

 /**
  * Define internal static values.
  * @codeCoverageIgnore
  */
 public static function initialize()
 {
     if (!static::$initialized) {
         static::$initialized = true;
         static::$placeholder = new \stdClass();
     }
 }
开发者ID:rkgladson,项目名称:PHPixme,代码行数:11,代码来源:__PRIVATE__.php

示例3: _init

	/**
	 * Init
	 *
	 * Loads in the config and sets the variables
	 *
	 * @access	public
	 * @return	void
	 */
	public static function _init()
	{
		// Prevent multiple initializations
		if (static::$initialized)
		{
			return;
		}

		\Config::load('asset', true);

		$paths = \Config::get('asset.paths');

		foreach($paths as $path)
		{
			static::add_path($path);
		}

		static::$_asset_url = \Config::get('asset.url');

		static::$_folders = array(
			'css'	=>	\Config::get('asset.css_dir'),
			'js'	=>	\Config::get('asset.js_dir'),
			'img'	=>	\Config::get('asset.img_dir')
		);

		static::$initialized = true;
	}
开发者ID:ralf57,项目名称:fuel,代码行数:35,代码来源:asset.php

示例4: init

 /**
  * Initialization function.
  * Here a config array must be passed with the client configuration
  * Sensible values are set by default, but further configuration could also
  * be set.
  *
  * A list of required fields is also set (with no default value set)
  */
 public static function init($config = array())
 {
     $default = array('base_url' => '{scheme}://{hostname}:{port}/api/{version}/{client_endpoint}', 'scheme' => 'http', 'hostname' => 'localhost', 'port' => 9292, 'version' => 'v1', 'includes_json_root' => true, 'json_root' => 'subject');
     $required = array('client_endpoint', 'subclient_endpoint');
     $config = Collection::fromConfig($config, $default, $required);
     static::$client = new Client($config->get('base_url'), $config);
     static::$initialized = true;
 }
开发者ID:foris,项目名称:darwined-core-php-clients,代码行数:16,代码来源:DarwinSubClient.php

示例5: initializeContext

 /**
  * setup the wordpress environment / stack if the context is a wordpress context
  *
  * @param Context $context
  */
 public function initializeContext(Context $context)
 {
     if (static::$initialized) {
         return;
     }
     static::$initialized = true;
     $this->prepareEnvironment();
     $this->loadStack();
 }
开发者ID:johnpbloch,项目名称:WpBehatExtension,代码行数:14,代码来源:WpContextInitializer.php

示例6: initialize

 protected static function initialize()
 {
     if (static::$initialized) {
         return;
     }
     static::$initialized = true;
     static::start();
     static::setCsrfToken();
 }
开发者ID:mehulsbhatt,项目名称:MindaPHP,代码行数:9,代码来源:Session.php

示例7: init

 public static function init()
 {
     if (static::$initialized) {
         return;
     }
     static::$profiler = new PhpQuickProfiler(FUEL_START_TIME);
     static::$profiler->queries = array();
     static::$profiler->queryCount = 0;
     static::$initialized = true;
 }
开发者ID:quickpacket,项目名称:noclayer,代码行数:10,代码来源:profiler.php

示例8: Init

 public static function Init()
 {
     if (static::$initialized) {
         return;
     }
     self::$headers = array();
     self::$status = self::STATUS_200;
     self::$headers[static::HEADER_CONTENT_TYPE] = Mimes::getExtension('html');
     self::$autoHeaders = true;
     static::$initialized = true;
 }
开发者ID:andrixh,项目名称:rotor,代码行数:11,代码来源:Response.php

示例9: initialize

 protected function initialize()
 {
     if (\Staq::App() && \Staq::App()->isInitialized()) {
         static::$cacheFile = reset($this->extensions) . '/cache/autoload.php';
         if (\is_file(static::$cacheFile)) {
             require_once static::$cacheFile;
         }
         static::$initialized = TRUE;
     }
     return $this;
 }
开发者ID:pixel418,项目名称:staq,代码行数:11,代码来源:Autoloader.php

示例10: initialize

 /**
  * Initializes properties.
  *
  * @return boolean Returns the `$initialized` property w/ a TRUE value.
  *
  * @note Sets some class properties & registers class alias.
  */
 public static final function initialize()
 {
     if (static::$initialized) {
         return TRUE;
     }
     // Initialized already.
     if (!class_exists(stub::$core_ns_stub . '__instance')) {
         class_alias(__CLASS__, stub::$core_ns_stub . '__instance');
     }
     return static::$initialized = TRUE;
 }
开发者ID:panvagenas,项目名称:x-related-posts,代码行数:18,代码来源:instance.php

示例11: configure

 public static function configure()
 {
     if (static::$initialized === false) {
         // loop over all settings and set them
         foreach (static::$initSettings as $key => $value) {
             ini_set("xdebug.{$key}", $value);
         }
     }
     // set initialized status flag
     static::$initialized = true;
 }
开发者ID:ksst,项目名称:kf,代码行数:11,代码来源:XDebug.php

示例12: Init

 protected static function Init()
 {
     if (static::$initialized) {
         return;
     }
     if (preg_match("#local\$#", $_SERVER['SERVER_NAME'])) {
         static::$current = static::DEV;
     } else {
         static::$current = static::PROD;
     }
     static::$initialized = true;
 }
开发者ID:andrixh,项目名称:rotor,代码行数:12,代码来源:Environment.php

示例13: initialize

 protected static function initialize()
 {
     if (static::$initialized) {
         return;
     }
     static::$initialized = true;
     static::$parentPath = __FILE__;
     for ($i = substr_count(get_class(), static::$nsChar); $i >= 0; $i--) {
         static::$parentPath = dirname(static::$parentPath);
     }
     static::$paths = array();
     static::$files = array(__FILE__);
 }
开发者ID:smileytechguy,项目名称:nLine,代码行数:13,代码来源:loader.php

示例14: __construct

 /**
  * Sets the initial Ftp filename and local data.
  *
  * @param   array  The settings
  * @return  void
  */
 public function __construct(array $config)
 {
     // Prep the hostname
     $this->_hostname = preg_replace('|.+?://|', '', $config['hostname']);
     $this->_username = $config['username'];
     $this->_password = $config['password'];
     $this->_timeout = isset($config['timeout']) ? (int) $config['timeout'] : $this->_timeout;
     $this->_port = isset($config['port']) ? (int) $config['port'] : $this->_port;
     $this->_passive = isset($config['passive']) ? (bool) $config['passive'] : $this->_passive;
     $this->_ssl = isset($config['ssl']) ? (bool) $config['ssl'] : $this->_ssl;
     $this->_debug = isset($config['debug']) ? (bool) $config['debug'] : $this->_debug;
     static::$initialized = true;
 }
开发者ID:nguyen113,项目名称:Rai5,代码行数:19,代码来源:Ftp.php

示例15: initialize

 protected function initialize()
 {
     if ($path = \Staq::App()->getPath('cache/', TRUE)) {
         static::$cacheFile = $path . '/setting.' . \Staq::App()->getPlatform() . '.php';
         if (is_file(static::$cacheFile) && is_readable(static::$cacheFile)) {
             @(include static::$cacheFile);
             if (isset($cache) && is_array($cache)) {
                 static::$cache = $cache;
             }
         }
     }
     static::$initialized = TRUE;
     return $this;
 }
开发者ID:pixel418,项目名称:staq,代码行数:14,代码来源:Setting.php


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