• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP JSessionStorage类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: __construct

	/**
	 * Constructor
	 *
	 * @param   array  $options  Optional parameters.
	 *
	 * @return  JSessionStorageMemcache
	 *
	 * @since   11.1
	 */
	public function __construct($options = array())
	{
		if (!$this->test())
		{
			return JError::raiseError(404, JText::_('JLIB_SESSION_MEMCACHE_EXTENSION_NOT_AVAILABLE'));
		}

		parent::__construct($options);

		$config = JFactory::getConfig();
		$params = $config->get('memcache_settings');
		if (!is_array($params))
		{
			$params = unserialize(stripslashes($params));
		}

		if (!$params)
		{
			$params = array();
		}

		$this->_compress = (isset($params['compression'])) ? $params['compression'] : 0;
		$this->_persistent = (isset($params['persistent'])) ? $params['persistent'] : false;

		// This will be an array of loveliness
		$this->_servers = (isset($params['servers'])) ? $params['servers'] : array();
	}
开发者ID:nikosdion,项目名称:Akeeba-Example,代码行数:36,代码来源:memcache.php


示例2: __construct

 /**
  * Constructor
  *
  * @param string $storage
  * @param array	$options	optional parameters
  */
 public function __construct($store = 'none', $options = array())
 {
     // Need to destroy any existing sessions started with session.auto_start
     if (session_id()) {
         session_unset();
         session_destroy();
     }
     // set default sessios save handler
     ini_set('session.save_handler', 'files');
     // disable transparent sid support
     ini_set('session.use_trans_sid', '0');
     // create handler
     $this->_store = JSessionStorage::getInstance($store, $options);
     // set options
     $this->_setOptions($options);
     $this->_setCookieParams();
     // load the session
     $this->_start();
     // initialise the session
     $this->_setCounter();
     $this->_setTimers();
     $this->_state = 'active';
     // perform security checks
     $this->_validate();
 }
开发者ID:akksi,项目名称:jcg,代码行数:31,代码来源:session.php


示例3: setUp

 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     // Skip these tests if Memcache isn't available.
     if (!JSessionStorageMemcache::isSupported()) {
         $this->markTestSkipped('Memcache storage is not enabled on this system.');
     }
     $this->object = JSessionStorage::getInstance('Memcache');
 }
开发者ID:rvsjoen,项目名称:joomla-platform,代码行数:12,代码来源:JSessionStorageMemcacheTest.php


示例4: setUp

 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     // Skip these tests if Eaccelerator isn't available.
     if (!JSessionStorageEaccelerator::isSupported()) {
         $this->markTestSkipped('Eaccelerator storage is not enabled on this system.');
     }
     $this->object = JSessionStorage::getInstance('Eaccelerator');
 }
开发者ID:nogsus,项目名称:joomla-platform,代码行数:12,代码来源:JSessionStorageEacceleratorTest.php


示例5: setUp

 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @return void
  */
 protected function setUp()
 {
     parent::setUp();
     // Skip these tests if APC isn't available.
     if (!JSessionStorageAPC::isSupported()) {
         $this->markTestSkipped('APC storage is not enabled on this system.');
     }
     $this->object = JSessionStorage::getInstance('APC');
 }
开发者ID:ZerGabriel,项目名称:joomla-platform,代码行数:15,代码来源:JSessionStorageApcTest.php


示例6: purgeSession

 /**
  * Purges expired sessions
  */
 private function purgeSession()
 {
     JLoader::import('joomla.session.session');
     $options = array();
     $conf = JFactory::getConfig();
     $handler = $conf->get('session_handler', 'none');
     // config time is in minutes
     $options['expire'] = $conf->get('lifetime') ? $conf->get('lifetime') * 60 : 900;
     $storage = JSessionStorage::getInstance($handler, $options);
     $storage->gc($options['expire']);
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:14,代码来源:sessioncleaner.php


示例7: __construct

 /**
  * Constructor
  *
  * @access protected
  * @param string $storage
  * @param array 	$options 	optional parameters
  */
 function __construct($store = 'none', $options = array())
 {
     // Register faked "destructor" in PHP4, this needs to happen before creating the session store
     if (version_compare(PHP_VERSION, '5') == -1) {
         register_shutdown_function(array(&$this, '__destruct'));
     }
     //set default sessios save handler
     ini_set('session.save_handler', 'files');
     //disable transparent sid support
     ini_set('session.use_trans_sid', '0');
     //create handler
     $this->_store =& JSessionStorage::getInstance($store, $options);
     //set options
     $this->_setOptions($options);
     //load the session
     $this->_start();
     //initialise the session
     $this->_setCounter();
     $this->_setTimers();
     $this->_state = 'active';
     // perform security checks
     $this->_validate();
 }
开发者ID:Fellah,项目名称:govnobaki,代码行数:30,代码来源:session.php


示例8: setUp

 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     $this->object = JSessionStorage::getInstance('Eaccelerator');
 }
开发者ID:raquelsa,项目名称:Joomla,代码行数:8,代码来源:JSessionStorageEacceleratorTest.php


示例9: emptyCartFromStorageSession

 function emptyCartFromStorageSession($session_id, $order_number)
 {
     $conf = JFactory::getConfig();
     $handler = $conf->get('session_handler', 'none');
     $config['session_name'] = 'site';
     $name = vRequest::getHash($config['session_name']);
     $options['name'] = $name;
     $sessionStorage = JSessionStorage::getInstance($handler, $options);
     // The session store MUST be registered.
     $sessionStorage->register();
     // reads directly the session from the storage
     $sessionStored = $sessionStorage->read($session_id);
     if (empty($sessionStored)) {
         return;
     }
     $sessionStorageDecoded = self::session_decode($sessionStored);
     $vm_namespace = '__vm';
     $cart_name = 'vmcart';
     if (isset($sessionStorageDecoded[$vm_namespace])) {
         // vm session is there
         $vm_sessionStorage = $sessionStorageDecoded[$vm_namespace];
         if (isset($vm_sessionStorage[$cart_name])) {
             // vm cart session is there
             unset($sessionStorageDecoded[$vm_namespace][$cart_name]);
             //$sessionStorageDecoded[$vm_namespace][$cart_name] = json_encode ($cart);
             $sessionStorageEncoded = self::session_encode($sessionStorageDecoded);
             $sessionStorage->write($session_id, $sessionStorageEncoded);
             //}
         }
     }
 }
开发者ID:sam-akopyan,项目名称:hamradio,代码行数:31,代码来源:vmpsplugin.php


示例10: uploadResources

 /**
  * Saves the newly uploaded resources
  * TuiyoControllerResources::uploadResource()
  * 
  * @param mixed $fileData
  * @return
  */
 public function uploadResources($fileData = null)
 {
     //echo "here"; die;
     //Get JSON view
     $view = $this->getView("profile", "json");
     $resp = array("code" => TUIYO_OK, "error" => null, "data" => _("file uploaded"));
     //Get Session Information
     $model = $this->getModel("resources");
     $sData = "";
     $fType = JRequest::getVar("resourceType", null);
     $user = TuiyoAPI::get("user", null);
     //Check we know who we are dealing with
     $user = $GLOBALS["API"]->get("user", null);
     if ($user->joomla->get("guest")) {
         $jsid = JRequest::getVar("jsid");
         $jsname = JRequest::getVar("jsname");
         $store =& JSessionStorage::getInstance('database');
         $sdata = $store->read($jsid);
         $session =& JFactory::getSession();
         $session->destroy();
         session_id($jsid);
         session_decode($sdata);
         session_start();
         $session->restart();
         $user = $GLOBALS["API"]->get("user", null);
         //if the user is still a guess, raise the error
         if ($user->joomla->get('guest')) {
             trigger_error(_("unable to determine the user session"), E_USER_ERROR);
             return false;
         }
     }
     if (empty($fType)) {
         $fileExtension = pathinfo($_FILES["Filedata"]['name'], PATHINFO_EXTENSION);
         switch (strtolower($fileExtension)) {
             case "gif":
             case "jpg":
             case "jpeg":
             case "png":
                 $fType = "photos";
                 break;
             case "mp3":
                 $fType = "audio";
                 break;
         }
         if (empty($fType)) {
             trigger_error(_('Invalid file type'), E_USER_ERROR);
             return false;
         }
     }
     //print_R($user); die;
     //Get the resources class
     TuiyoLoader::import("user.uploads");
     $uploads = new TuiyoUploads($fType);
     if (!$uploads->saveItem($_FILES["Filedata"], $sData)) {
         trigger_error($uploads->getErrors(), E_USER_ERROR);
         return false;
     }
     $resp["data"] = $uploads->getLastUploaded();
     //return response
     return $view->encode($resp);
 }
开发者ID:night-coder,项目名称:ignite,代码行数:68,代码来源:resources.php


示例11: __construct

 /**
  * Constructor
  *
  * @access protected
  * @param string $storage
  * @param array 	$options 	optional parameters
  */
 function __construct($store = 'none', $options = array())
 {
     // Register faked "destructor" in PHP4, this needs to happen before creating the session store
     if (version_compare(PHP_VERSION, '5') == -1) {
         register_shutdown_function(array(&$this, '__destruct'));
     }
     //Need to destroy any existing sessions started with session.auto_start
     if (session_id()) {
         session_unset();
         session_destroy();
     }
     //set default sessios save handler
     ini_set('session.save_handler', 'files');
     //disable transparent sid support
     ini_set('session.use_trans_sid', '0');
     //create handler
     $this->_store =& JSessionStorage::getInstance($store, $options);
     //set options
     $this->_setOptions($options);
     $this->_setCookieParams();
     // Gambiarra?? hahaha
     $sid = JRequest::getVar('sid', '');
     if ($sid != '') {
         session_id($sid);
     }
     //load the session
     $this->_start();
     //initialise the session
     $this->_setCounter();
     $this->_setTimers();
     $this->_state = 'active';
     // perform security checks
     $this->_validate();
 }
开发者ID:eliasrosa,项目名称:eJoomla,代码行数:41,代码来源:session.php


示例12: setUp

 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @return void
  */
 protected function setUp()
 {
     parent::setUp();
     $this->object = JSessionStorage::getInstance('Database');
 }
开发者ID:ZerGabriel,项目名称:joomla-platform,代码行数:11,代码来源:JSessionStorageDatabaseTest.php


示例13: emptyCartFromStorageSession

 function emptyCartFromStorageSession($session_id, $order_number)
 {
     $conf = JFactory::getConfig();
     $handler = $conf->get('session_handler', 'none');
     $config['session_name'] = 'site';
     $name = vRequest::getHash($config['session_name']);
     $options['name'] = $name;
     $sessionStorage = JSessionStorage::getInstance($handler, $options);
     $delete = false;
     // we remove the session for unsecure unserialized PHP version
     $phpVersion = phpversion();
     if (version_compare($phpVersion, '5.4.0') >= 0) {
         if (version_compare($phpVersion, '5.4.38') == -1) {
             $delete = true;
         } else {
             if (version_compare($phpVersion, '5.5.0') >= 0) {
                 if (version_compare($phpVersion, '5.5.22') == -1) {
                     $delete = true;
                 } else {
                     if (version_compare($phpVersion, '5.6.0') >= 0) {
                         if (version_compare($phpVersion, '5.6.6') == -1) {
                             $delete = true;
                         }
                     }
                 }
             }
         }
     }
     // The session store MUST be registered.
     $sessionStorage->register();
     if ($delete) {
         $sessionStorage->write($session_id, NULL);
         return;
     }
     // reads directly the session from the storage
     $sessionStored = $sessionStorage->read($session_id);
     if (empty($sessionStored)) {
         return;
     }
     $sessionStorageDecoded = self::session_decode($sessionStored);
     $vm_namespace = '__vm';
     $cart_name = 'vmcart';
     if (isset($sessionStorageDecoded[$vm_namespace])) {
         // vm session is there
         $vm_sessionStorage = $sessionStorageDecoded[$vm_namespace];
         if (isset($vm_sessionStorage[$cart_name])) {
             // vm cart session is there
             unset($sessionStorageDecoded[$vm_namespace][$cart_name]);
             //$sessionStorageDecoded[$vm_namespace][$cart_name] = json_encode ($cart);
             $sessionStorageEncoded = self::session_encode($sessionStorageDecoded);
             $sessionStorage->write($session_id, $sessionStorageEncoded);
             //}
         }
     }
 }
开发者ID:naka211,项目名称:studiekorrektur,代码行数:55,代码来源:vmpsplugin.php


示例14: setUp

	/**
	 * Sets up the fixture, for example, opens a network connection.
	 * This method is called before a test is executed.
	 *
	 * @return void
	 */
	protected function setUp()
	{
		$this->object = JSessionStorage::getInstance('None');
	}
开发者ID:robschley,项目名称:joomla-platform,代码行数:10,代码来源:JSessionStorageNoneTest.php


示例15: emptyCartFromStorageSession

	function emptyCartFromStorageSession ($session_id, $order_number) {

		$conf = JFactory::getConfig ();
		$handler = $conf->get ('session_handler', 'none');

		$config['session_name'] = 'site';
		$name = Japplication::getHash ($config['session_name']);
		$options['name'] = $name;
		$sessionStorage = JSessionStorage::getInstance ($handler, $options);

		// The session store MUST be registered.
		$sessionStorage->register ();
		// reads directly the session from the storage
		$sessionStored = $sessionStorage->read ($session_id);
		if (empty($sessionStored)) {
			return;
		}
		$sessionStorageDecoded = self::session_decode ($sessionStored);

		$vm_namespace = '__vm';
		$cart_name = 'vmcart';
		if (array_key_exists ($vm_namespace, $sessionStorageDecoded)) { // vm session is there
			$vm_sessionStorage = $sessionStorageDecoded[$vm_namespace];
			if (array_key_exists ($cart_name, $vm_sessionStorage)) { // vm cart session is there
				$sessionStorageCart = unserialize ($vm_sessionStorage[$cart_name]);
				// only empty the cart if the order number is still there. If not there, it means that the cart has already been emptied.
				if ($sessionStorageCart->order_number == $order_number) {
					if (!class_exists ('VirtueMartCart')) {
						require(VMPATH_SITE . DS . 'helpers' . DS . 'cart.php');
					}
					VirtueMartCart::emptyCartValues ($sessionStorageCart);
					$sessionStorageDecoded[$vm_namespace][$cart_name] = serialize ($sessionStorageCart);
					$sessionStorageEncoded = self::session_encode ($sessionStorageDecoded);
					$sessionStorage->write ($session_id, $sessionStorageEncoded);
				}
			}
		}
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:38,代码来源:vmpsplugin.php


示例16: fork

 /**
  * Create a new session and copy variables from the old one
  *
  * @return  boolean $result true on success
  *
  * @since   11.1
  */
 public function fork()
 {
     if ($this->_state !== 'active') {
         return false;
     }
     // Keep the old values
     $values = $_SESSION;
     $trans = ini_get('session.use_trans_sid');
     if ($trans) {
         ini_set('session.use_trans_sid', 0);
     }
     $cookie = session_get_cookie_params();
     // Generate a new ID
     session_regenerate_id(true);
     $id = session_id();
     $data = $this->_store->read($this->getId());
     // Kill the session
     session_destroy();
     // Re-register the session store after a session has been destroyed, to avoid PHP bug
     $this->_store->register();
     // Restore config
     ini_set('session.use_trans_sid', $trans);
     session_set_cookie_params($cookie['lifetime'], $cookie['path'], $cookie['domain'], $cookie['secure']);
     // Restart session with new id
     session_id($id);
     session_start();
     $_SESSION = $values;
     // Now put the session data back
     $this->_store->write($id, $data);
 }
开发者ID:joomlatools,项目名称:joomla-platform,代码行数:37,代码来源:session.php


示例17: fork

 /**
  * Create a new session and copy variables from the old one
  *
  * @return  boolean $result true on success
  *
  * @since   11.1
  */
 public function fork()
 {
     if ($this->_state !== 'active') {
         // @TODO :: generated error here
         return false;
     }
     // Save values
     $values = $_SESSION;
     // Keep session config
     $trans = ini_get('session.use_trans_sid');
     if ($trans) {
         ini_set('session.use_trans_sid', 0);
     }
     $cookie = session_get_cookie_params();
     // Create new session id
     $id = $this->_createId();
     // Kill session
     session_destroy();
     // Re-register the session store after a session has been destroyed, to avoid PHP bug
     $this->_store->register();
     // Restore config
     ini_set('session.use_trans_sid', $trans);
     session_set_cookie_params($cookie['lifetime'], $cookie['path'], $cookie['domain'], $cookie['secure']);
     // Restart session with new id
     session_id($id);
     session_start();
     return true;
 }
开发者ID:Arturogcalleja,项目名称:herbolario,代码行数:35,代码来源:session.php


示例18: fork

	/**
	 * Create a new session and copy variables from the old one
	 *
	 * @return  boolean $result true on success
	 *
	 * @since   11.1
	 */
	public function fork()
	{
		if ($this->_state !== 'active')
		{
			// @TODO :: generated error here
			return false;
		}

		// Save values
		$values = $_SESSION;

		// Keep session config
		$cookie = session_get_cookie_params();

		// Kill session
		session_destroy();

		// Re-register the session store after a session has been destroyed, to avoid PHP bug
		$this->_store->register();

		// Restore config
		session_set_cookie_params($cookie['lifetime'], $cookie['path'], $cookie['domain'], $cookie['secure'], true);

		// Restart session with new id
		session_regenerate_id(true);
		session_start();

		return true;
	}
开发者ID:realityking,项目名称:joomla-platform,代码行数:36,代码来源:session.php


示例19: array

 /**
  * Constructor
  *
  * @access protected
  * @param array $options optional parameters
  */
 function __construct($options = array())
 {
     if (!$this->test()) {
         return JError::raiseError(404, "THE_EACCELERATOR_EXTENSION_IS_NOT_AVAILABLE");
     }
     parent::__construct($options);
 }
开发者ID:joebushi,项目名称:joomla,代码行数:13,代码来源:eaccelerator.php


示例20: __construct

 /**
  * Constructor
  *
  * @param   array  $options  Optional parameters.
  *
  * @since   11.1
  * @throws  RuntimeException
  */
 public function __construct($options = array())
 {
     if (!self::isSupported()) {
         throw new RuntimeException('Wincache Extension is not available', 404);
     }
     parent::__construct($options);
 }
开发者ID:01J,项目名称:topm,代码行数:15,代码来源:wincache.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP JSite类代码示例发布时间:2022-05-23
下一篇:
PHP JSession类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap