AAAAhome/academiac/www/administrator/components/com_virtuemart_allinone/classes/storage/storage.php000060400000004067151372467470027476 0ustar00 */ defined('_JEXEC') or die(); /** * Abstract class for the update parameters storage * @author nicholas * */ class LiveUpdateStorage { /** * The update data registry * @var JRegistry */ public static $registry = null; /** * * @param string $type * @param array $config * @return LiveUpdateStorage */ public static function getInstance($type, $config) { static $instances = array(); $sig = md5($type, serialize($config)); if(!array_key_exists($sig, $instances)) { require_once dirname(__FILE__).'/'.strtolower($type).'.php'; $className = 'LiveUpdateStorage'.ucfirst($type); $object = new $className($config); $object->load($config); $newRegistry = clone(self::$registry); $object->setRegistry($newRegistry); $instances[$sig] = $object; } return $instances[$sig]; } public function &getRegistry() { return self::$registry; } public function setRegistry($registry) { self::$registry = $registry; } public final function set($key, $value) { if($key == 'updatedata') { if(function_exists('json_encode') && function_exists('json_decode')) { $value = json_encode($value); } elseif(function_exists('base64_encode') && function_exists('base64_decode')) { $value = base64_encode(serialize($value)); } else { $value = serialize($value); } } self::$registry->setValue("update.$key", $value); } public final function get($key, $default) { $value = self::$registry->getValue("update.$key", $default); if($key == 'updatedata') { if(function_exists('json_encode') && function_exists('json_decode')) { $value = json_decode($value); } elseif(function_exists('base64_encode') && function_exists('base64_decode')) { $value = unserialize(base64_decode($value)); } else { $value = unserialize($value); } } return $value; } public function save() {} public function load($config) {} }home/academiac/www/administrator/components/com_virtuemart/liveupdate/classes/storage/storage.php000060400000004067151372473640027753 0ustar00 */ defined('_JEXEC') or die(); /** * Abstract class for the update parameters storage * @author nicholas * */ class LiveUpdateStorage { /** * The update data registry * @var JRegistry */ public static $registry = null; /** * * @param string $type * @param array $config * @return LiveUpdateStorage */ public static function getInstance($type, $config) { static $instances = array(); $sig = md5($type, serialize($config)); if(!array_key_exists($sig, $instances)) { require_once dirname(__FILE__).'/'.strtolower($type).'.php'; $className = 'LiveUpdateStorage'.ucfirst($type); $object = new $className($config); $object->load($config); $newRegistry = clone(self::$registry); $object->setRegistry($newRegistry); $instances[$sig] = $object; } return $instances[$sig]; } public function &getRegistry() { return self::$registry; } public function setRegistry($registry) { self::$registry = $registry; } public final function set($key, $value) { if($key == 'updatedata') { if(function_exists('json_encode') && function_exists('json_decode')) { $value = json_encode($value); } elseif(function_exists('base64_encode') && function_exists('base64_decode')) { $value = base64_encode(serialize($value)); } else { $value = serialize($value); } } self::$registry->setValue("update.$key", $value); } public final function get($key, $default) { $value = self::$registry->getValue("update.$key", $default); if($key == 'updatedata') { if(function_exists('json_encode') && function_exists('json_decode')) { $value = json_decode($value); } elseif(function_exists('base64_encode') && function_exists('base64_decode')) { $value = unserialize(base64_decode($value)); } else { $value = unserialize($value); } } return $value; } public function save() {} public function load($config) {} }home/academiac/www/libraries/joomla/session/storage.php000064400000010113151372647340017314 0ustar00register($options); } /** * Returns a session storage handler object, only creating it if it doesn't already exist. * * @param string $name The session store to instantiate * @param array $options Array of options * * @return JSessionStorage * * @since 11.1 */ public static function getInstance($name = 'none', $options = array()) { $name = strtolower(JFilterInput::getInstance()->clean($name, 'word')); if (empty(self::$instances[$name])) { $class = 'JSessionStorage' . ucfirst($name); if (!class_exists($class)) { $path = dirname(__FILE__) . '/storage/' . $name . '.php'; if (file_exists($path)) { require_once $path; } else { // No attempt to die gracefully here, as it tries to close the non-existing session jexit('Unable to load session storage class: ' . $name); } } self::$instances[$name] = new $class($options); } return self::$instances[$name]; } /** * Register the functions of this class with PHP's session handler * * @return void * * @since 11.1 */ public function register() { // Use this object as the session handler session_set_save_handler( array($this, 'open'), array($this, 'close'), array($this, 'read'), array($this, 'write'), array($this, 'destroy'), array($this, 'gc') ); } /** * Open the SessionHandler backend. * * @param string $save_path The path to the session object. * @param string $session_name The name of the session. * * @return boolean True on success, false otherwise. * * @since 11.1 */ public function open($save_path, $session_name) { return true; } /** * Close the SessionHandler backend. * * @return boolean True on success, false otherwise. * * @since 11.1 */ public function close() { return true; } /** * Read the data for a particular session identifier from the * SessionHandler backend. * * @param string $id The session identifier. * * @return string The session data. * * @since 11.1 */ public function read($id) { return; } /** * Write session data to the SessionHandler backend. * * @param string $id The session identifier. * @param string $session_data The session data. * * @return boolean True on success, false otherwise. * * @since 11.1 */ public function write($id, $session_data) { return true; } /** * Destroy the data for a particular session identifier in the * SessionHandler backend. * * @param string $id The session identifier. * * @return boolean True on success, false otherwise. * * @since 11.1 */ public function destroy($id) { return true; } /** * Garbage collect stale sessions from the SessionHandler backend. * * @param integer $maxlifetime The maximum age of a session. * * @return boolean True on success, false otherwise. * * @since 11.1 */ public function gc($maxlifetime = null) { return true; } /** * Test to see if the SessionHandler is available. * * @return boolean True on success, false otherwise. * * @since 11.1 */ public static function test() { return true; } } home/academiac/www/libraries/joomla/cache/storage.php000064400000016166151372671640016712 0ustar00_hash = md5($config->get('secret')); $this->_application = (isset($options['application'])) ? $options['application'] : null; $this->_language = (isset($options['language'])) ? $options['language'] : 'en-GB'; $this->_locking = (isset($options['locking'])) ? $options['locking'] : true; $this->_lifetime = (isset($options['lifetime'])) ? $options['lifetime'] * 60 : $config->get('cachetime') * 60; $this->_now = (isset($options['now'])) ? $options['now'] : time(); // Set time threshold value. If the lifetime is not set, default to 60 (0 is BAD) // _threshold is now available ONLY as a legacy (it's deprecated). It's no longer used in the core. if (empty($this->_lifetime)) { $this->_threshold = $this->_now - 60; $this->_lifetime = 60; } else { $this->_threshold = $this->_now - $this->_lifetime; } } /** * Returns a cache storage handler object, only creating it * if it doesn't already exist. * * @param string $handler The cache storage handler to instantiate * @param array $options Array of handler options * * @return JCacheStorageHandler A JCacheStorageHandler object * * @since 11.1 */ public static function getInstance($handler = null, $options = array()) { static $now = null; JCacheStorage::addIncludePath(JPATH_PLATFORM . '/joomla/cache/storage'); if (!isset($handler)) { $conf = JFactory::getConfig(); $handler = $conf->get('cache_handler'); if (empty($handler)) { return JError::raiseWarning(500, JText::_('JLIB_CACHE_ERROR_CACHE_HANDLER_NOT_SET')); } } if (is_null($now)) { $now = time(); } $options['now'] = $now; //We can't cache this since options may change... $handler = strtolower(preg_replace('/[^A-Z0-9_\.-]/i', '', $handler)); $class = 'JCacheStorage' . ucfirst($handler); if (!class_exists($class)) { // Search for the class file in the JCacheStorage include paths. jimport('joomla.filesystem.path'); if ($path = JPath::find(JCacheStorage::addIncludePath(), strtolower($handler) . '.php')) { include_once $path; } else { return JError::raiseWarning(500, JText::sprintf('JLIB_CACHE_ERROR_CACHE_STORAGE_LOAD', $handler)); } } return new $class($options); } /** * Get cached data by id and group * * @param string $id The cache data id * @param string $group The cache data group * @param boolean $checkTime True to verify cache time expiration threshold * * @return mixed Boolean false on failure or a cached data object * * @since 11.1 */ public function get($id, $group, $checkTime = true) { return false; } /** * Get all cached data * * @return mixed Boolean false on failure or a cached data object * * @since 11.1 */ public function getAll() { if (!class_exists('JCacheStorageHelper', false)) { include_once JPATH_PLATFORM . '/joomla/cache/storage/helpers/helper.php'; } return; } /** * Store the data to cache by id and group * * @param string $id The cache data id * @param string $group The cache data group * @param string $data The data to store in cache * * @return boolean True on success, false otherwise * * @since 11.1 */ public function store($id, $group, $data) { return true; } /** * Remove a cached data entry by id and group * * @param string $id The cache data id * @param string $group The cache data group * * @return boolean True on success, false otherwise * * @since 11.1 */ public function remove($id, $group) { return true; } /** * Clean cache for a group given a mode. * * @param string $group The cache data group * @param string $mode The mode for cleaning cache [group|notgroup] * group mode : cleans all cache in the group * notgroup mode : cleans all cache not in the group * * @return boolean True on success, false otherwise * * @since 11.1 */ public function clean($group, $mode = null) { return true; } /** * Garbage collect expired cache data * * @return boolean True on success, false otherwise. * * @since 11.1 */ public function gc() { return true; } /** * Test to see if the storage handler is available. * * @return boolean True on success, false otherwise * * @since 11.1. */ public static function test() { return true; } /** * Lock cached item * * @param string $id The cache data id * @param string $group The cache data group * @param integer $locktime Cached item max lock time * * @return boolean True on success, false otherwise. * * @since 11.1 */ public function lock($id, $group, $locktime) { return false; } /** * Unlock cached item * * @param string $id The cache data id * @param string $group The cache data group * * @return boolean True on success, false otherwise. * * @since 11.1 */ public function unlock($id, $group = null) { return false; } /** * Get a cache_id string from an id/group pair * * @param string $id The cache data id * @param string $group The cache data group * * @return string The cache_id string * * @since 11.1 */ protected function _getCacheId($id, $group) { $name = md5($this->_application . '-' . $id . '-' . $this->_language); $this->rawname = $this->_hash . '-' . $name; return $this->_hash . '-cache-' . $group . '-' . $name; } /** * Add a directory where JCacheStorage should search for handlers. You may * either pass a string or an array of directories. * * @param string $path A path to search. * * @return array An array with directory elements * * @since 11.1 */ public static function addIncludePath($path = '') { static $paths; if (!isset($paths)) { $paths = array(); } if (!empty($path) && !in_array($path, $paths)) { jimport('joomla.filesystem.path'); array_unshift($paths, JPath::clean($path)); } return $paths; } }