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


PHP Zend_Session::_defaultOptionsSet方法代码示例

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


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

示例1: setOptions

 /**
  * setOptions - set both the class specified
  *
  * @param  array $userOptions - pass-by-keyword style array of <option name, option value> pairs
  * @throws Zend_Session_Exception
  * @return void
  */
 public static function setOptions(array $userOptions = array())
 {
     // set default options on first run only (before applying user settings)
     if (!self::$_defaultOptionsSet) {
         foreach (self::$_defaultOptions as $defaultOptionName => $defaultOptionValue) {
             if (isset(self::$_defaultOptions[$defaultOptionName])) {
                 ini_set("session.{$defaultOptionName}", $defaultOptionValue);
             }
         }
         self::$_defaultOptionsSet = true;
     }
     // set the options the user has requested to set
     foreach ($userOptions as $userOptionName => $userOptionValue) {
         $userOptionName = strtolower($userOptionName);
         // set the ini based values
         if (array_key_exists($userOptionName, self::$_defaultOptions)) {
             ini_set("session.{$userOptionName}", $userOptionValue);
         } elseif (isset(self::$_localOptions[$userOptionName])) {
             self::${self::$_localOptions[$userOptionName]} = $userOptionValue;
         } else {
             /** @see Zend_Session_Exception */
             // require_once 'Zend/Session/Exception.php';
             throw new Zend_Session_Exception("Unknown option: {$userOptionName} = {$userOptionValue}");
         }
     }
 }
开发者ID:openbizx,项目名称:openbizx-cubix,代码行数:33,代码来源:Session.php

示例2: setOptions

 /**
  * setOptions - set both the class specified
  *
  * @param array $userOptions - pass-by-keyword style array of <option name, option value> pairs
  * @throws Zend_Session_Exception
  * @return void
  */
 public static function setOptions(array $userOptions = array())
 {
     // set default options on first run only (before applying user settings)
     if (!self::$_defaultOptionsSet) {
         foreach (self::$_defaultOptions as $default_option_name => $default_option_value) {
             if (isset(self::$_defaultOptions[$default_option_name])) {
                 ini_set('session.' . $default_option_name, $default_option_value);
             }
         }
         self::$_defaultOptionsSet = true;
     }
     // set the options the user has requested to set
     foreach ($userOptions as $user_option_name => $user_option_value) {
         $user_option_name = strtolower($user_option_name);
         // set the ini based values
         if (array_key_exists($user_option_name, self::$_defaultOptions)) {
             ini_set('session.' . $user_option_name, $user_option_value);
         } elseif (isset(self::$_localOptions[$user_option_name])) {
             self::${self::$_localOptions[$user_option_name]} = $user_option_value;
         } else {
             throw new Zend_Session_Exception("Unknown option: {$user_option_name} = {$user_option_value}");
         }
     }
     $savePath = ini_get('session.save_path');
     if (strpos($savePath, ';')) {
         $savePath = explode(';', $savePath);
         $savePath = realpath(array_pop($savePath));
     }
     if (!is_writable($savePath)) {
         throw new Zend_Session_Exception("Unwritable session.save_path: {$savePath}");
     }
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:39,代码来源:Session.php

示例3: writeClose

 /**
  * writeClose() - Shutdown the sesssion, close writing and detach $_SESSION from the back-end storage mechanism.
  * This will complete the internal data transformation on this request.
  *
  * @param bool $readonly - OPTIONAL remove write access (i.e. throw error if Zend_Session's attempt writes)
  * @return void
  */
 public static function writeClose($readonly = true)
 {
     if (self::$_writeClosed) {
         return;
     }
     if ($readonly) {
         parent::$_writable = false;
     }
     if (!self::$_unitTestEnabled) {
         session_write_close();
         session_id('');
     }
     session_write_close();
     self::$_writeClosed = true;
     self::$_sessionStarted = false;
     self::$_defaultOptionsSet = false;
 }
开发者ID:ClaudioThomas,项目名称:shopware-4,代码行数:24,代码来源:Session.php

示例4: setOptions

 /**
  * setOptions - set both the class specified
  *
  * @param array $userOptions - pass-by-keyword style array of <option name, option value> pairs
  * @throws Zend_Session_Exception
  * @return void
  */
 public static function setOptions(array $userOptions = array())
 {
     // set default options on first run only (before applying user settings)
     if (!self::$_defaultOptionsSet) {
         foreach (self::$_defaultOptions as $default_option_name => $default_option_value) {
             if (isset(self::$_defaultOptions[$default_option_name]) && $default_option_value !== null) {
                 ini_set('session.' . $default_option_name, $default_option_value);
             }
         }
         self::$_defaultOptionsSet = true;
     }
     // set the options the user has requested to set
     foreach ($userOptions as $user_option_name => $user_option_value) {
         $user_option_name = strtolower($user_option_name);
         // set the ini based values
         if (array_key_exists($user_option_name, self::$_defaultOptions)) {
             ini_set('session.' . $user_option_name, $user_option_value);
         } elseif (isset(self::$_localOptions[$user_option_name])) {
             self::${self::$_localOptions[$user_option_name]} = $user_option_value;
         } else {
             throw new Zend_Session_Exception("Unknown option: {$user_option_name} = {$user_option_value}");
         }
     }
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:31,代码来源:Session.php


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