���ѧۧݧ�ӧ�� �ާ֧ߧ֧էا֧� - ���֧էѧܧ�ڧ��ӧѧ�� - /home/zhaagvlk/public_html/wp-includes/Requests/library/block-bindings/Cache.php.tar
���ѧ٧ѧ�
home/zhaagvlk/public_html/wp-includes/SimplePie/src/Cache.php 0000644 00000006260 15157515234 0020245 0 ustar 00 <?php // SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue // SPDX-License-Identifier: BSD-3-Clause declare(strict_types=1); namespace SimplePie; use SimplePie\Cache\Base; /** * Used to create cache objects * * This class can be overloaded with {@see SimplePie::set_cache_class()}, * although the preferred way is to create your own handler * via {@see register()} * * @deprecated since SimplePie 1.8.0, use "SimplePie\SimplePie::set_cache()" instead */ class Cache { /** * Cache handler classes * * These receive 3 parameters to their constructor, as documented in * {@see register()} * @var array<string, class-string<Base>> */ protected static $handlers = [ 'mysql' => Cache\MySQL::class, 'memcache' => Cache\Memcache::class, 'memcached' => Cache\Memcached::class, 'redis' => Cache\Redis::class, ]; /** * Don't call the constructor. Please. */ private function __construct() { } /** * Create a new SimplePie\Cache object * * @param string $location URL location (scheme is used to determine handler) * @param string $filename Unique identifier for cache object * @param Base::TYPE_FEED|Base::TYPE_IMAGE $extension 'spi' or 'spc' * @return Base Type of object depends on scheme of `$location` */ public static function get_handler(string $location, string $filename, $extension) { $type = explode(':', $location, 2); $type = $type[0]; if (!empty(self::$handlers[$type])) { $class = self::$handlers[$type]; return new $class($location, $filename, $extension); } return new \SimplePie\Cache\File($location, $filename, $extension); } /** * Create a new SimplePie\Cache object * * @deprecated since SimplePie 1.3.1, use {@see get_handler()} instead * @param string $location * @param string $filename * @param Base::TYPE_FEED|Base::TYPE_IMAGE $extension * @return Base */ public function create(string $location, string $filename, $extension) { trigger_error('Cache::create() has been replaced with Cache::get_handler() since SimplePie 1.3.1, use the registry system instead.', \E_USER_DEPRECATED); return self::get_handler($location, $filename, $extension); } /** * Register a handler * * @param string $type DSN type to register for * @param class-string<Base> $class Name of handler class. Must implement Base * @return void */ public static function register(string $type, $class) { self::$handlers[$type] = $class; } /** * Parse a URL into an array * * @param string $url * @return array<string, mixed> */ public static function parse_URL(string $url) { $parsedUrl = parse_url($url); if ($parsedUrl === false) { return []; } $params = array_merge($parsedUrl, ['extras' => []]); if (isset($params['query'])) { parse_str($params['query'], $params['extras']); } return $params; } } class_alias('SimplePie\Cache', 'SimplePie_Cache'); home/zhaagvlk/web.zhaap.com/vendor__1b5d5ff/whichbrowser/parser/src/Cache.php 0000644 00000005444 15160245217 0023126 0 ustar 00 <?php namespace WhichBrowser; use Psr\Cache\CacheItemPoolInterface; trait Cache { private $cache; private $expires; /** * @var boolean $cached Was this result retrieve from the cache? */ public $cached = false; /** * Enable caching of results * * @param object $cache An PSR-6 cache pool (an object that implements Psr\Cache\CacheItemPoolInterface) * @param int $expires Optional the number of seconds after which a cached item expires, default is 15 minutes */ public function setCache($cache, $expires = 900) { $this->cache = $cache; $this->expires = $expires; } /** * Apply cached data to the main Parser object * * @internal * * @param array $data An array with a key for every property it needs to apply */ private function applyCachedData($data) { foreach ($data as $key => $value) { $this->$key = $value; } $this->cached = true; } /** * Retrieve the data that can be cached from the main Parser object * * @internal * * @return array An array with a key for every property that will be cached */ private function retrieveCachedData() { return [ 'browser' => $this->browser, 'engine' => $this->engine, 'os' => $this->os, 'device' => $this->device, 'camouflage' => $this->camouflage, 'features' => $this->features ]; } /** * Retrieve the result from the cache, or analyse and store in the cache * * @internal * * @param array|string $headers An array with all of the headers or a string with just the User-Agent header * * @return boolean did we actually retrieve or analyse results */ private function analyseWithCache($headers, $options = []) { if (isset($options['cache'])) { if (isset($options['cacheExpires'])) { $this->setCache($options['cache'], $options['cacheExpires']); } else { $this->setCache($options['cache']); } } if ($this->cache instanceof CacheItemPoolInterface) { $item = $this->cache->getItem('whichbrowser_' . md5(serialize($headers))); if ($item->isHit()) { $this->applyCachedData($item->get()); } else { $analyser = new Analyser($headers, $options); $analyser->setdata($this); $analyser->analyse(); $item->set($this->retrieveCachedData()); $item->expiresAfter($this->expires); $this->cache->save($item); } return true; } } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.34 | ���֧ߧ֧�ѧ�ڧ� ����ѧߧڧ��: 0.1 |
proxy
|
phpinfo
|
���ѧ����ۧܧ�