Joomla Platform  13.1
Documentation des API du framework Joomla Platform
 Tout Classes Espaces de nommage Fichiers Fonctions Variables Pages
wincache.php
Aller à la documentation de ce fichier.
1 <?php
2 /**
3  * @package Joomla.Platform
4  * @subpackage Session
5  *
6  * @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
7  * @license GNU General Public License version 2 or later; see LICENSE
8  */
9 
10 defined('JPATH_PLATFORM') or die;
11 
12 /**
13  * WINCACHE session storage handler for PHP
14  *
15  * @package Joomla.Platform
16  * @subpackage Session
17  * @since 11.1
18  */
20 {
21  /**
22  * Constructor
23  *
24  * @param array $options Optional parameters.
25  *
26  * @since 11.1
27  * @throws RuntimeException
28  */
29  public function __construct($options = array())
30  {
31  if (!self::isSupported())
32  {
33  throw new RuntimeException('Wincache Extension is not available', 404);
34  }
35 
36  parent::__construct($options);
37  }
38 
39  /**
40  * Register the functions of this class with PHP's session handler
41  *
42  * @return void
43  *
44  * @since 12.2
45  */
46  public function register()
47  {
48  ini_set('session.save_handler', 'wincache');
49  }
50 
51  /**
52  * Test to see if the SessionHandler is available.
53  *
54  * @return boolean True on success, false otherwise.
55  *
56  * @since 12.1
57  */
58  static public function isSupported()
59  {
60  return (extension_loaded('wincache') && function_exists('wincache_ucache_get') && !strcmp(ini_get('wincache.ucenabled'), "1"));
61  }
62 }