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


PHP self::read方法代码示例

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


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

示例1: load

 /**
  * Loads session.
  * @since 1.0.0
  *
  * @param string $options Filename as options.
  *
  * @return object Session.
  */
 public static function load($options)
 {
     if (!isset(static::$filename)) {
         static::$filename = $options;
     }
     $sess = new self();
     if (file_exists($options)) {
         $sess->read($options);
     }
     return $sess;
 }
开发者ID:10quality,项目名称:scheduler,代码行数:19,代码来源:File.php

示例2: getInstance

 /**
  * Get settings instance
  * 
  * @return ilObjDiskQuotaSettings
  */
 public static function getInstance()
 {
     global $ilDB;
     $query = "SELECT object_reference.ref_id FROM object_reference,tree,object_data " . "WHERE tree.parent = " . $ilDB->quote(SYSTEM_FOLDER_ID, 'integer') . " " . "AND object_data.type = " . $ilDB->quote('facs', 'text') . "AND object_reference.ref_id = tree.child " . "AND object_reference.obj_id = object_data.obj_id";
     $res = $ilDB->query($query);
     $row = $res->fetchRow(DB_FETCHMODE_ASSOC);
     $ref_id = $row["ref_id"];
     if ($ref_id) {
         $obj = new self($ref_id);
         $obj->read();
         return $obj;
     }
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:18,代码来源:class.ilObjDiskQuotaSettings.php

示例3: buildInstance

 /**
  * @param shibServerData $shibServerData
  *
  * @return shibUser
  */
 public static function buildInstance(shibServerData $shibServerData)
 {
     $shibUser = new self();
     $shibUser->shibServerData = $shibServerData;
     $ext_id = $shibUser->shibServerData->getLogin();
     $shibUser->setExternalAccount($ext_id);
     $existing_usr_id = self::getUsrIdByExtId($ext_id);
     if ($existing_usr_id) {
         $shibUser->setId($existing_usr_id);
         $shibUser->read();
     }
     $shibUser->setAuthMode('shibboleth');
     return $shibUser;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:19,代码来源:class.shibUser.php

示例4: getInstance

 /**
  * Short description for 'getInstance'
  *
  * Long description (if any) ...
  *
  * @param	  unknown $instance Parameter description (if any) ...
  * @return	 mixed Return description (if any) ...
  */
 public static function getInstance($instance)
 {
     $hztv = new self();
     if ($hztv->read($instance) === false) {
         return false;
     }
     return $hztv;
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:16,代码来源:version.php

示例5: self

 static function __init()
 {
     self::$savePath = $CONFIG['session.save_path'];
     self::$cookiePath = $CONFIG['session.cookie_path'];
     self::$cookieDomain = $CONFIG['session.cookie_domain'];
     $CONFIG['session.auth_vars'] && (self::$authVars = array_merge(self::$authVars, $CONFIG['session.auth_vars']));
     $CONFIG['session.group_vars'] && (self::$groupVars = array_merge(self::$groupVars, $CONFIG['session.group_vars']));
     self::$authVars = array_flip(self::$authVars);
     self::$groupVars = array_flip(self::$groupVars);
     if (self::$maxIdleTime < 1 && self::$maxLifeTime < 1) {
         user_error('At least one of the SESSION::$max*Time variables must be strictly positive.');
     }
     if (mt_rand(1, self::$gcProbabilityDenominator) <= self::$gcProbabilityNumerator) {
         $adapter = new self('0lastGC');
         $i = $adapter->read();
         $j = max(self::$maxIdleTime, self::$maxLifeTime);
         if ($j && $_SERVER['REQUEST_TIME'] - $i > $j) {
             $adapter->write($_SERVER['REQUEST_TIME']);
             register_shutdown_function(array(__CLASS__, 'gc'), $j);
         }
         unset($adapter);
     }
     if (isset($_COOKIE['SID'])) {
         self::setSID($_COOKIE['SID']);
         self::$adapter = new self(self::$SID);
         $i = self::$adapter->read();
     } else {
         $i = false;
     }
     if ($i) {
         $i = unserialize($i);
         self::$lastseen = $i[0];
         self::$birthtime = $i[1];
         if (self::$maxIdleTime && $_SERVER['REQUEST_TIME'] - self::$lastseen > self::$maxIdleTime) {
             // Session has idled
             self::onIdle();
             self::$isIdled = true;
         } else {
             if (self::$maxLifeTime && $_SERVER['REQUEST_TIME'] - self::$birthtime > self::$maxLifeTime) {
                 // Session has expired
                 self::onExpire();
             } else {
                 self::$DATA =& $i[2];
             }
         }
         if (isset($_SERVER['HTTPS']) && (!isset($_COOKIE['SSL']) || $i[3] != $_COOKIE['SSL'])) {
             self::regenerateId(true);
         } else {
             self::$sslid = $i[3];
             if ('-' == self::$sslid[0] && isset($_SERVER['HTTPS'])) {
                 self::$sslid = p::strongId();
                 setcookie('SSL', self::$sslid, 0, self::$cookiePath, self::$cookieDomain, true, true);
                 unset($_SERVER['HTTP_IF_NONE_MATCH'], $_SERVER['HTTP_IF_MODIFIED_SINCE']);
             }
         }
     } else {
         self::regenerateId(true);
     }
 }
开发者ID:nicolas-grekas,项目名称:Patchwork,代码行数:59,代码来源:SESSION.php

示例6: find_or_create

 /**
  * Fine a specific record, or create it
  * if not found
  *
  * @param   string  $type
  * @param   string  $authenticator
  * @param   string  $domain
  * @return  mixed
  */
 public static function find_or_create($type, $authenticator, $domain = null)
 {
     $hzad = new self();
     $hzad->type = $type;
     $hzad->authenticator = $authenticator;
     $hzad->domain = $domain;
     $hzad->read();
     if (empty($hzad->id) && !$hzad->create()) {
         return false;
     }
     return $hzad;
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:21,代码来源:Domain.php

示例7: find_or_create

 /**
  * Find a record, creating it if not found.
  *
  * @param   string  $type
  * @param   string  $authenticator
  * @param   string  $domain
  * @param   string  $username
  * @return  mixed   Object on success, False on failure
  */
 public static function find_or_create($type, $authenticator, $domain, $username)
 {
     $hzad = Domain::find_or_create($type, $authenticator, $domain);
     if (!is_object($hzad)) {
         return false;
     }
     if (empty($username)) {
         return false;
     }
     $hzal = new self();
     $hzal->username = $username;
     $hzal->auth_domain_id = $hzad->id;
     $hzal->read();
     if (empty($hzal->id) && !$hzal->create()) {
         return false;
     }
     return $hzal;
 }
开发者ID:mined-gatech,项目名称:framework,代码行数:27,代码来源:Link.php

示例8: create

 /**
  * @param string      $cachePath
  * @param FileScanner $scanner
  * @return CachingFileScanner
  */
 public static function create($cachePath, FileScanner $scanner)
 {
     $self = new self($cachePath, $scanner);
     $self->read();
     return $self;
 }
开发者ID:jesseschalken,项目名称:php-autoload-generator,代码行数:11,代码来源:main.php

示例9: saveValue

 static function saveValue($k, $v)
 {
     $config = new self();
     $config->read();
     $config->set($k, $v);
     $config->save();
 }
开发者ID:alexanderTsig,项目名称:arabic,代码行数:7,代码来源:App.php

示例10: load

 /**
  * Loads a WKT string into a Geometry Object
  *
  * @param string $WKT
  *
  * @return Geometry\Geometry
  */
 public static function load($WKT)
 {
     $instance = new self();
     return $instance->read($WKT);
 }
开发者ID:szymonskirgajllo,项目名称:GeoJson,代码行数:12,代码来源:WKT.php

示例11: getInstance

 /**
  * Short description for 'getInstance' Long description (if any) . ..
  *
  * @param   unknown $instance Parameter description (if any) ...
  * @param   unknown $storage Parameter description (if any) ...
  * @return  mixed Return description (if any) ...
  */
 public static function getInstance($instance, $storage = null)
 {
     $hzup = new self();
     if ($hzup->read($instance) === false) {
         return false;
     }
     return $hzup;
 }
开发者ID:mined-gatech,项目名称:framework,代码行数:15,代码来源:Password.php

示例12: getInstance

 /**
  * Returns a reference to a group object
  *
  * @param   mixed  $group  A string (cn) or integer (ID)
  * @return  mixed  Object if instance found, false if not
  */
 public static function getInstance($group)
 {
     static $instances;
     // Set instances array
     if (!isset($instances)) {
         $instances = array();
     }
     // Do we have a matching instance?
     if (!isset($instances[$group])) {
         // If an ID is passed, check for a match in existing instances
         if (is_numeric($group)) {
             foreach ($instances as $instance) {
                 if ($instance && $instance->get('gidNumber') == $group) {
                     // Match found
                     return $instance;
                     break;
                 }
             }
         }
         // No matches
         // Create group object
         $hzg = new self();
         if ($hzg->read($group) === false) {
             $instances[$group] = false;
         } else {
             $instances[$group] = $hzg;
         }
     }
     // Return instance
     return $instances[$group];
 }
开发者ID:mined-gatech,项目名称:framework,代码行数:37,代码来源:Group.php

示例13: file_gc

 /**
  * Cleanup expired cache entries.
  */
 private static function file_gc()
 {
     $dir = new DirectoryIterator(\Sledgehammer\TMP_DIR . 'Cache');
     $files = [];
     foreach ($dir as $entry) {
         if ($entry->isFile()) {
             $files[] = $entry->getFilename();
         }
     }
     shuffle($files);
     $files = array_slice($files, 0, ceil(count($files) / 10));
     // Take 10% of the files
     $cache = new self('GC', 'file');
     foreach ($files as $id) {
         $cache->_guid = $id;
         $cache->_file = fopen(\Sledgehammer\TMP_DIR . 'Cache/' . $id, 'r');
         $hit = $cache->read($output);
         fclose($cache->_file);
         $cache->_file = null;
         if ($hit === false) {
             // Expired?
             $cache->clear();
         }
     }
 }
开发者ID:sledgehammer,项目名称:core,代码行数:28,代码来源:Cache.php

示例14: find_or_create

 /**
  * Find a project. Create it if one doesn't exist.
  *
  * @param   string  $name  Project name
  * @return  mixed
  */
 public static function find_or_create($name)
 {
     $hztp = new self();
     if (is_numeric($name)) {
         $hztp->id = $name;
     } else {
         $hztp->name = $name;
     }
     if ($hztp->read() == false) {
         if ($hztp->create() == false) {
             return false;
         }
     }
     return $hztp;
 }
开发者ID:mined-gatech,项目名称:framework,代码行数:21,代码来源:Project.php


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