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


PHP parent::_readable方法代码示例

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


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

示例1: start

 /**
  * start() - Start the session.
  *
  * @param bool|array $options  OPTIONAL Either user supplied options, or flag indicating if start initiated automatically
  * @throws Zend_Session_Exception
  * @return void
  */
 public static function start($options = false)
 {
     if (self::$_sessionStarted && self::$_destroyed) {
         // require_once 'Zend/Session/Exception.php';
         throw new Zend_Session_Exception('The session was explicitly destroyed during this request, attempting to re-start is not allowed.');
     }
     if (self::$_sessionStarted) {
         return;
         // already started
     }
     // make sure our default options (at the least) have been set
     if (!self::$_defaultOptionsSet) {
         self::setOptions(is_array($options) ? $options : array());
     }
     // In strict mode, do not allow auto-starting Zend_Session, such as via "new Zend_Session_Namespace()"
     if (self::$_strict && $options === true) {
         /** @see Zend_Session_Exception */
         // require_once 'Zend/Session/Exception.php';
         throw new Zend_Session_Exception('You must explicitly start the session with Zend_Session::start() when session options are set to strict.');
     }
     $filename = $linenum = null;
     if (!self::$_unitTestEnabled && headers_sent($filename, $linenum)) {
         /** @see Zend_Session_Exception */
         // require_once 'Zend/Session/Exception.php';
         throw new Zend_Session_Exception("Session must be started before any output has been sent to the browser;" . " output started in {$filename}/{$linenum}");
     }
     // See http://www.php.net/manual/en/ref.session.php for explanation
     if (!self::$_unitTestEnabled && defined('SID')) {
         /** @see Zend_Session_Exception */
         // require_once 'Zend/Session/Exception.php';
         throw new Zend_Session_Exception('session has already been started by session.auto-start or session_start()');
     }
     /**
      * Hack to throw exceptions on start instead of php errors
      * @see http://framework.zend.com/issues/browse/ZF-1325
      */
     $errorLevel = is_int(self::$_throwStartupExceptions) ? self::$_throwStartupExceptions : E_ALL;
     /** @see Zend_Session_Exception */
     if (!self::$_unitTestEnabled) {
         if (self::$_throwStartupExceptions) {
             // require_once 'Zend/Session/Exception.php';
             set_error_handler(array('Zend_Session_Exception', 'handleSessionStartError'), $errorLevel);
         }
         $startedCleanly = session_start();
         if (self::$_throwStartupExceptions) {
             restore_error_handler();
         }
         if (!$startedCleanly || Zend_Session_Exception::$sessionStartError != null) {
             if (self::$_throwStartupExceptions) {
                 set_error_handler(array('Zend_Session_Exception', 'handleSilentWriteClose'), $errorLevel);
             }
             session_write_close();
             if (self::$_throwStartupExceptions) {
                 restore_error_handler();
                 throw new Zend_Session_Exception(__CLASS__ . '::' . __FUNCTION__ . '() - ' . Zend_Session_Exception::$sessionStartError);
             }
         }
     }
     parent::$_readable = true;
     parent::$_writable = true;
     self::$_sessionStarted = true;
     if (self::$_regenerateIdState === -1) {
         self::regenerateId();
     }
     // run validators if they exist
     if (isset($_SESSION['__ZF']['VALID'])) {
         self::_processValidators();
     }
     self::_processStartupMetadataGlobal();
 }
开发者ID:openbizx,项目名称:openbizx-cubix,代码行数:77,代码来源:Session.php

示例2: start

 /**
  * start() - Start the session.
  *
  * @param bool|array $options  OPTIONAL Either user supplied options, or flag indicating if start initiated automatically
  * @throws \Micro\Session\Exception
  * @return void
  */
 public static function start($options = false)
 {
     // Check to see if we've been passed an invalid session ID
     if (self::getId() && !self::_checkId(self::getId())) {
         // Generate a valid, temporary replacement
         self::setId(md5(self::getId()));
         // Force a regenerate after session is started
         self::$_regenerateIdState = -1;
     }
     if (self::$_sessionStarted && self::$_destroyed) {
         throw new Exception('The session was explicitly destroyed during this request, attempting to re-start is not allowed.');
     }
     if (self::$_sessionStarted) {
         return;
         // already started
     }
     // make sure our default options (at the least) have been set
     if (!self::$_defaultOptionsSet) {
         self::setOptions(is_array($options) ? $options : array());
     }
     // In strict mode, do not allow auto-starting \Micro\Session\Session, such as via "new \Micro\Session\SessionNamespace()"
     if (self::$_strict && $options === true) {
         throw new Exception('You must explicitly start the session with \\Micro\\Session\\Session::start() when session options are set to strict.');
     }
     $filename = $linenum = null;
     if (!self::$_unitTestEnabled && headers_sent($filename, $linenum)) {
         throw new Exception("Session must be started before any output has been sent to the browser;" . " output started in {$filename}/{$linenum}");
     }
     // See http://www.php.net/manual/en/ref.session.php for explanation
     if (!self::$_unitTestEnabled && defined('SID')) {
         throw new Exception('session has already been started by session.auto-start or session_start()');
     }
     $errorLevel = is_int(self::$_throwStartupExceptions) ? self::$_throwStartupExceptions : E_ALL;
     /** @see \Micro\Session\Exception */
     if (!self::$_unitTestEnabled) {
         if (self::$_throwStartupExceptions) {
             set_error_handler(array('Micro\\Session\\Exception', 'handleSessionStartError'), $errorLevel);
         }
         $startedCleanly = session_start();
         if (self::$_throwStartupExceptions) {
             restore_error_handler();
         }
         if (!$startedCleanly || Exception::$sessionStartError != null) {
             if (self::$_throwStartupExceptions) {
                 set_error_handler(array('Micro\\Session\\Exception', 'handleSilentWriteClose'), $errorLevel);
             }
             session_write_close();
             if (self::$_throwStartupExceptions) {
                 restore_error_handler();
                 throw new Exception(__CLASS__ . '::' . __FUNCTION__ . '() - ' . Exception::$sessionStartError);
             }
         }
     }
     parent::$_readable = true;
     parent::$_writable = true;
     self::$_sessionStarted = true;
     if (self::$_regenerateIdState === -1) {
         self::regenerateId();
     }
     // run validators if they exist
     if (isset($_SESSION['__MICRO']['VALID'])) {
         self::_processValidators();
     }
     self::_processStartupMetadataGlobal();
 }
开发者ID:control-corp,项目名称:micro,代码行数:72,代码来源:Session.php

示例3: setStarted

 /**
  * Ifw Hack for using Zend_Session in WordPress context if session is already started
  * @param $started
  */
 public static function setStarted($started)
 {
     if ($started === true) {
         self::$_sessionStarted = true;
         parent::$_readable = true;
         parent::$_writable = true;
     }
 }
开发者ID:jasmun,项目名称:Noco100,代码行数:12,代码来源:Session.php

示例4: start

 /**
  * start() - Start the session.
  *
  * @param bool|array $options  OPTIONAL Either user supplied options, or flag indicating if start initiated automatically
  * @throws Zend_Session_Exception
  * @return void
  */
 public static function start($options = false)
 {
     if (self::$_sessionStarted) {
         return;
         // already started
     }
     // make sure our default options (at the least) have been set
     if (!self::$_defaultOptionsSet) {
         self::setOptions(is_array($options) ? $options : array());
     }
     // In strict mode, do not allow auto-starting Zend_Session, such as via "new Zend_Session_Namespace()"
     if (self::$_strict && $options === true) {
         throw new Zend_Session_Exception('You must explicitly start the session with Zend_Session::start() when session options are set to strict.');
     }
     if (headers_sent($filename, $linenum)) {
         throw new Zend_Session_Exception("Session must be started before any output has been sent to the browser;" . " output started in {$filename}/{$linenum}");
     }
     // See http://www.php.net/manual/en/ref.session.php for explanation
     if (defined('SID')) {
         throw new Zend_Session_Exception('session has already been started by session.auto-start or session_start()');
     }
     session_start();
     parent::$_readable = true;
     parent::$_writable = true;
     self::$_sessionStarted = true;
     if (self::$_regenerateIdState === -1) {
         self::regenerateId();
     }
     // run validators if they exist
     if (isset($_SESSION['__ZF']['VALID'])) {
         self::_processValidators();
     }
     self::_processStartupMetadataGlobal();
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:41,代码来源:Session.php

示例5: start

 /**
  * start() - Start the session.
  *
  * @param bool|array $options  OPTIONAL Either user supplied options, or flag indicating if start initiated automatically
  * @throws Zend_Session_Exception
  * @return void
  */
 public static function start($options = false)
 {
     // Check to see if we've been passed an invalid session ID
     if (self::getId() && !self::_checkId(self::getId())) {
         // Generate a valid, temporary replacement
         self::setId(md5(self::getId()));
         // Force a regenerate after session is started
         self::$_regenerateIdState = -1;
     }
     if (self::$_sessionStarted && self::$_destroyed) {
         require_once 'Zend/Session/Exception.php';
         throw new Zend_Session_Exception('The session was explicitly destroyed during this request, attempting to re-start is not allowed.');
     }
     if (self::$_sessionStarted) {
         return;
         // already started
     }
     // make sure our default options (at the least) have been set
     if (!self::$_defaultOptionsSet) {
         self::setOptions(is_array($options) ? $options : array());
     }
     // In strict mode, do not allow auto-starting Zend_Session, such as via "new Zend_Session_Namespace()"
     if (self::$_strict && $options === true) {
         /** @see Zend_Session_Exception */
         require_once 'Zend/Session/Exception.php';
         throw new Zend_Session_Exception('You must explicitly start the session with Zend_Session::start() when session options are set to strict.');
     }
     $filename = $linenum = null;
     if (!self::$_unitTestEnabled && headers_sent($filename, $linenum)) {
         /** @see Zend_Session_Exception */
         require_once 'Zend/Session/Exception.php';
         throw new Zend_Session_Exception("Session must be started before any output has been sent to the browser;" . " output started in {$filename}/{$linenum}");
     }
     // See http://www.php.net/manual/en/ref.session.php for explanation
     if (!self::$_unitTestEnabled && defined('SID')) {
         /** @see Zend_Session_Exception */
         require_once 'Zend/Session/Exception.php';
         throw new Zend_Session_Exception('session has already been started by session.auto-start or session_start()');
     }
     /**
      * Hack to throw exceptions on start instead of php errors
      * @see http://framework.zend.com/issues/browse/ZF-1325
      */
     $errorLevel = is_int(self::$_throwStartupExceptions) ? self::$_throwStartupExceptions : E_ALL;
     // alcalbg - do not start session for robots
     $is_human = true;
     $robots = array('googlebot' => 'Googlebot', 'msnbot' => 'MSNBot', 'baiduspider' => 'Baiduspider', 'bingbot' => 'Bing', 'slurp' => 'Inktomi Slurp', 'yahoo' => 'Yahoo', 'askjeeves' => 'AskJeeves', 'fastcrawler' => 'FastCrawler', 'infoseek' => 'InfoSeek Robot 1.0', 'lycos' => 'Lycos', 'yandex' => 'YandexBot', 'newrelic' => 'NewRelicPinger');
     foreach ($robots as $key => $value) {
         if (isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'], $value) !== false) {
             $is_human = false;
             break;
         }
     }
     /** @see Zend_Session_Exception */
     if ($is_human && !self::$_unitTestEnabled) {
         if (self::$_throwStartupExceptions) {
             require_once 'Zend/Session/Exception.php';
             set_error_handler(array('Zend_Session_Exception', 'handleSessionStartError'), $errorLevel);
         }
         $startedCleanly = session_start();
         if (self::$_throwStartupExceptions) {
             restore_error_handler();
         }
         if (!$startedCleanly || Zend_Session_Exception::$sessionStartError != null) {
             if (self::$_throwStartupExceptions) {
                 set_error_handler(array('Zend_Session_Exception', 'handleSilentWriteClose'), $errorLevel);
             }
             session_write_close();
             if (self::$_throwStartupExceptions) {
                 restore_error_handler();
                 throw new Zend_Session_Exception(__CLASS__ . '::' . __FUNCTION__ . '() - ' . Zend_Session_Exception::$sessionStartError);
             }
         }
     }
     parent::$_readable = true;
     parent::$_writable = true;
     self::$_sessionStarted = true;
     if (self::$_regenerateIdState === -1) {
         self::regenerateId();
     }
     // run validators if they exist
     if (isset($_SESSION['__ZF']['VALID'])) {
         self::_processValidators();
     }
     self::_processStartupMetadataGlobal();
 }
开发者ID:georgepaul,项目名称:socialstrap,代码行数:93,代码来源:Session.php


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