Changeset 60771 for trunk/src/wp-includes/SimplePie/src/Cache.php
- Timestamp:
- 09/16/2025 10:45:37 PM (2 months ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/SimplePie/src/Cache.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/SimplePie/src/Cache.php
r59141 r60771 1 1 <?php 2 2 3 /** 4 * SimplePie 5 * 6 * A PHP-Based RSS and Atom Feed Framework. 7 * Takes the hard work out of managing a complete RSS/Atom solution. 8 * 9 * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors 10 * All rights reserved. 11 * 12 * Redistribution and use in source and binary forms, with or without modification, are 13 * permitted provided that the following conditions are met: 14 * 15 * * Redistributions of source code must retain the above copyright notice, this list of 16 * conditions and the following disclaimer. 17 * 18 * * Redistributions in binary form must reproduce the above copyright notice, this list 19 * of conditions and the following disclaimer in the documentation and/or other materials 20 * provided with the distribution. 21 * 22 * * Neither the name of the SimplePie Team nor the names of its contributors may be used 23 * to endorse or promote products derived from this software without specific prior 24 * written permission. 25 * 26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS 27 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 28 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS 29 * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 30 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 31 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 33 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 34 * POSSIBILITY OF SUCH DAMAGE. 35 * 36 * @package SimplePie 37 * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue 38 * @author Ryan Parman 39 * @author Sam Sneddon 40 * @author Ryan McCue 41 * @link http://simplepie.org/ SimplePie 42 * @license http://www.opensource.org/licenses/bsd-license.php BSD License 43 */ 3 // SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue 4 // SPDX-License-Identifier: BSD-3-Clause 5 6 declare(strict_types=1); 44 7 45 8 namespace SimplePie; … … 54 17 * via {@see register()} 55 18 * 56 * @package SimplePie57 * @subpackage Caching58 19 * @deprecated since SimplePie 1.8.0, use "SimplePie\SimplePie::set_cache()" instead 59 20 */ … … 65 26 * These receive 3 parameters to their constructor, as documented in 66 27 * {@see register()} 67 * @var array 28 * @var array<string, class-string<Base>> 68 29 */ 69 30 protected static $handlers = [ 70 'mysql' => 'SimplePie\Cache\MySQL',71 'memcache' => 'SimplePie\Cache\Memcache',72 'memcached' => 'SimplePie\Cache\Memcached',73 'redis' => 'SimplePie\Cache\Redis'31 'mysql' => Cache\MySQL::class, 32 'memcache' => Cache\Memcache::class, 33 'memcached' => Cache\Memcached::class, 34 'redis' => Cache\Redis::class, 74 35 ]; 75 36 … … 89 50 * @return Base Type of object depends on scheme of `$location` 90 51 */ 91 public static function get_handler( $location,$filename, $extension)52 public static function get_handler(string $location, string $filename, $extension) 92 53 { 93 54 $type = explode(':', $location, 2); … … 105 66 * 106 67 * @deprecated since SimplePie 1.3.1, use {@see get_handler()} instead 68 * @param string $location 69 * @param string $filename 70 * @param Base::TYPE_FEED|Base::TYPE_IMAGE $extension 71 * @return Base 107 72 */ 108 public function create( $location,$filename, $extension)73 public function create(string $location, string $filename, $extension) 109 74 { 110 75 trigger_error('Cache::create() has been replaced with Cache::get_handler() since SimplePie 1.3.1, use the registry system instead.', \E_USER_DEPRECATED); … … 118 83 * @param string $type DSN type to register for 119 84 * @param class-string<Base> $class Name of handler class. Must implement Base 85 * @return void 120 86 */ 121 public static function register( $type, $class)87 public static function register(string $type, $class) 122 88 { 123 89 self::$handlers[$type] = $class; … … 128 94 * 129 95 * @param string $url 130 * @return array 96 * @return array<string, mixed> 131 97 */ 132 public static function parse_URL( $url)98 public static function parse_URL(string $url) 133 99 { 134 $params = parse_url($url); 135 $params['extras'] = []; 100 $parsedUrl = parse_url($url); 101 102 if ($parsedUrl === false) { 103 return []; 104 } 105 106 $params = array_merge($parsedUrl, ['extras' => []]); 136 107 if (isset($params['query'])) { 137 108 parse_str($params['query'], $params['extras']);
Note: See TracChangeset
for help on using the changeset viewer.