Index: install/install_data.sql =================================================================== --- install/install_data.sql (revision 13170) +++ install/install_data.sql (working copy) @@ -177,7 +177,7 @@ INSERT INTO ConfigurationValues VALUES (DEFAULT, 'CSVExportEncoding', '0', 'In-Portal', 'in-portal:configure_advanced'); INSERT INTO ConfigurationAdmin VALUES ('MemcacheServers', 'la_section_SettingsCaching', 'la_config_MemcacheServers', 'text', '', '', 80.01, 0, 0); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'MemcacheServers', 'localhost:11211', 'In-Portal', 'in-portal:configure_advanced'); -INSERT INTO ConfigurationAdmin VALUES ('CacheHandler', 'la_section_SettingsCaching', 'la_config_CacheHandler', 'select', NULL, 'Fake=la_None,Memcache=+Memcached,Apc=+Alternative PHP Cache', 80.02, 0, 0); +INSERT INTO ConfigurationAdmin VALUES ('CacheHandler', 'la_section_SettingsCaching', 'la_config_CacheHandler', 'select', NULL, 'Fake=la_None,Memcache=+Memcached,Apc=+Alternative PHP Cache,XCache=+XCache', 80.02, 0, 0); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'CacheHandler', 'Fake', 'In-Portal', 'in-portal:configure_advanced'); # Section "in-portal:configure_users": Index: install/upgrades.sql =================================================================== --- install/upgrades.sql (revision 13170) +++ install/upgrades.sql (working copy) @@ -1683,5 +1683,5 @@ KEY LifeTime (LifeTime) ); -INSERT INTO ConfigurationAdmin VALUES ('CacheHandler', 'la_section_SettingsCaching', 'la_config_CacheHandler', 'select', NULL, 'Fake=la_None,Memcache=+Memcached,Apc=+Alternative PHP Cache', 80.02, 0, 0); +INSERT INTO ConfigurationAdmin VALUES ('CacheHandler', 'la_section_SettingsCaching', 'la_config_CacheHandler', 'select', NULL, 'Fake=la_None,Memcache=+Memcached,Apc=+Alternative PHP Cache,XCache=+XCache', 80.02, 0, 0); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'CacheHandler', 'Fake', 'In-Portal', 'in-portal:configure_advanced'); \ No newline at end of file Index: kernel/utility/cache.php =================================================================== --- kernel/utility/cache.php (revision 13171) +++ kernel/utility/cache.php (working copy) @@ -517,4 +517,66 @@ { return $this->_enabled; } + } + + class XCacheCacheHandler { + + var $_enabled = false; + + var $cachingType = CACHING_TYPE_MEMORY; + + function XCacheCacheHandler() + { + $this->_enabled = function_exists('xcache_get'); + + // verify, that xcache is working + if ($this->_enabled && !$this->set('test', 1)) { + $this->_enabled = false; + } + } + + /** + * Retrieves value from cache + * + * @param string $name + * @return mixed + */ + function get($name) + { + return xcache_isset($name) ? xcache_get($name) : false; + } + + /** + * Stores value in cache + * + * @param string $name + * @param mixed $value + * @param int $expiration + * @return bool + */ + function set($name, $value, $expiration = 0) + { + return xcache_set($name, $value, $expiration); + } + + /** + * Deletes key from cache + * + * @param string $name + * @return bool + */ + function delete($name) + { + return xcache_unset($name); + } + + /** + * Determines, that cache storage is working fine + * + * @return bool + */ + function isWorking() + { + return $this->_enabled; + } } \ No newline at end of file