Make WordPress Core


Ignore:
Timestamp:
09/30/2024 10:48:16 PM (6 weeks ago)
Author:
SergeyBiryukov
Message:

External Libraries: Update the SimplePie library to version 1.8.0.

The most notable change in this update is that all code is now namespaced and uses PSR-4 classes, though there is a compatibility layer available for extenders using the older class names, so plugin or theme authors directly using SimplePie can decide for themselves when they want to change to using the namespaced names for SimplePie classes.

Note: This commit includes additional fixes for PHP 8.4 compatibility (PR 875, PR 888) from the one-dot-eight branch of SimplePie, which is expected to be released as SimplePie 1.8.1 soon.

References:

Follow-up to [47733], [49176], [52393], [52413].

Props jrf, peterwilsoncc, chaion07, cu121, markparnell, audrasjb, costdev, Presskopp, desrosj, faisal03, mukesh27, SergeyBiryukov.
See #55604.

Location:
trunk/src/wp-includes/SimplePie/src
Files:
1 added
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/SimplePie/src/Cache/Base.php

    r47733 r59141  
    11<?php
     2
    23/**
    34 * SimplePie
     
    67 * Takes the hard work out of managing a complete RSS/Atom solution.
    78 *
    8  * Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
     9 * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
    910 * All rights reserved.
    1011 *
     
    4243 */
    4344
     45namespace SimplePie\Cache;
     46
    4447/**
    4548 * Base for cache objects
    4649 *
    47  * Classes to be used with {@see SimplePie_Cache::register()} are expected
     50 * Classes to be used with {@see \SimplePie\Cache::register()} are expected
    4851 * to implement this interface.
    4952 *
    5053 * @package SimplePie
    5154 * @subpackage Caching
     55 * @deprecated since SimplePie 1.8.0, use "Psr\SimpleCache\CacheInterface" instead
    5256 */
    53 interface SimplePie_Cache_Base
     57interface Base
    5458{
    55     /**
    56     * Feed cache type
    57     *
    58     * @var string
    59     */
    60     const TYPE_FEED = 'spc';
     59    /**
     60    * Feed cache type
     61    *
     62    * @var string
     63    */
     64    public const TYPE_FEED = 'spc';
    6165
    62     /**
    63     * Image cache type
    64     *
    65     * @var string
    66     */
    67     const TYPE_IMAGE = 'spi';
     66    /**
     67    * Image cache type
     68    *
     69    * @var string
     70    */
     71    public const TYPE_IMAGE = 'spi';
    6872
    69     /**
    70     * Create a new cache object
    71     *
    72     * @param string $location Location string (from SimplePie::$cache_location)
    73     * @param string $name Unique ID for the cache
    74      * @param string $type Either TYPE_FEED for SimplePie data, or TYPE_IMAGE for image data
    75     */
    76     public function __construct($location, $name, $type);
     73    /**
     74    * Create a new cache object
     75    *
     76    * @param string $location Location string (from SimplePie::$cache_location)
     77    * @param string $name Unique ID for the cache
     78     * @param Base::TYPE_FEED|Base::TYPE_IMAGE $type Either TYPE_FEED for SimplePie data, or TYPE_IMAGE for image data
     79    */
     80    public function __construct($location, $name, $type);
    7781
    78     /**
    79     * Save data to the cache
    80     *
    81      * @param array|SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property
    82     * @return bool Successfulness
    83     */
    84     public function save($data);
     82    /**
     83    * Save data to the cache
     84    *
     85     * @param array|\SimplePie\SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property
     86    * @return bool Successfulness
     87    */
     88    public function save($data);
    8589
    86     /**
    87     * Retrieve the data saved to the cache
    88     *
    89     * @return array Data for SimplePie::$data
    90     */
    91     public function load();
     90    /**
     91    * Retrieve the data saved to the cache
     92    *
     93    * @return array Data for SimplePie::$data
     94    */
     95    public function load();
    9296
    93     /**
    94     * Retrieve the last modified time for the cache
    95     *
    96     * @return int Timestamp
    97     */
    98     public function mtime();
     97    /**
     98    * Retrieve the last modified time for the cache
     99    *
     100    * @return int Timestamp
     101    */
     102    public function mtime();
    99103
    100     /**
    101     * Set the last modified time to the current time
    102     *
    103     * @return bool Success status
    104     */
    105     public function touch();
     104    /**
     105    * Set the last modified time to the current time
     106    *
     107    * @return bool Success status
     108    */
     109    public function touch();
    106110
    107     /**
    108     * Remove the cache
    109     *
    110     * @return bool Success status
    111     */
    112     public function unlink();
     111    /**
     112    * Remove the cache
     113    *
     114    * @return bool Success status
     115    */
     116    public function unlink();
    113117}
     118
     119class_alias('SimplePie\Cache\Base', 'SimplePie_Cache_Base');
Note: See TracChangeset for help on using the changeset viewer.