Changeset 60771 for trunk/src/wp-includes/SimplePie/src/Cache/MySQL.php
- Timestamp:
- 09/16/2025 10:45:37 PM (2 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/SimplePie/src/Cache/MySQL.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\Cache; … … 54 17 * `root` and the password `password`. All tables will be prefixed with `sp_` 55 18 * 56 * @package SimplePie57 * @subpackage Caching58 19 * @deprecated since SimplePie 1.8.0, use implementation of "Psr\SimpleCache\CacheInterface" instead 59 20 */ … … 63 24 * PDO instance 64 25 * 65 * @var \PDO 26 * @var \PDO|null 66 27 */ 67 28 protected $mysql; … … 70 31 * Options 71 32 * 72 * @var array 33 * @var array<string, mixed> 73 34 */ 74 35 protected $options; … … 88 49 * @param Base::TYPE_FEED|Base::TYPE_IMAGE $type Either TYPE_FEED for SimplePie data, or TYPE_IMAGE for image data 89 50 */ 90 public function __construct( $location,$name, $type)51 public function __construct(string $location, string $name, $type) 91 52 { 92 53 $this->options = [ … … 148 109 * Save data to the cache 149 110 * 150 * @param array |\SimplePie\SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property111 * @param array<string>|\SimplePie\SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property 151 112 * @return bool Successfulness 152 113 */ … … 269 230 * Retrieve the data saved to the cache 270 231 * 271 * @return array Data for SimplePie::$data232 * @return array<string>|false Data for SimplePie::$data 272 233 */ 273 234 public function load() … … 311 272 if ($query->execute()) { 312 273 while ($row = $query->fetchColumn()) { 313 $feed['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['entry'][] = unserialize( $row);274 $feed['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['entry'][] = unserialize((string) $row); 314 275 } 315 276 } else { … … 326 287 * Retrieve the last modified time for the cache 327 288 * 328 * @return int Timestamp289 * @return int|false Timestamp 329 290 */ 330 291 public function mtime() … … 337 298 $query->bindValue(':id', $this->id); 338 299 if ($query->execute() && ($time = $query->fetchColumn())) { 339 return $time;300 return (int) $time; 340 301 } 341 302
Note: See TracChangeset
for help on using the changeset viewer.