Changeset 38112
- Timestamp:
- 07/20/2016 07:32:26 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-feed.php
r37518 r38112 4 4 require_once( ABSPATH . WPINC . '/class-simplepie.php' ); 5 5 6 /** 7 * Core class used to implement a feed cache. 8 * 9 * @since 2.8.0 10 * 11 * @see SimplePie_Cache 12 */ 6 13 class WP_Feed_Cache extends SimplePie_Cache { 7 /** 8 * Create a new SimplePie_Cache object 9 * 10 * @static 14 15 /** 16 * Creates a new SimplePie_Cache object. 17 * 18 * @since 2.8.0 11 19 * @access public 12 20 * … … 21 29 } 22 30 31 /** 32 * Core class used to implement feed cache transients. 33 * 34 * @since 2.8.0 35 */ 23 36 class WP_Feed_Cache_Transient { 37 38 /** 39 * Holds the transient name. 40 * 41 * @since 2.8.0 42 * @access public 43 * @var string 44 */ 24 45 public $name; 46 47 /** 48 * Holds the transient mod name. 49 * 50 * @since 2.8.0 51 * @access public 52 * @var string 53 */ 25 54 public $mod_name; 26 public $lifetime = 43200; //Default lifetime in cache of 12 hours 27 28 /** 29 * Class instantiator. 30 * 55 56 /** 57 * Holds the cache duration in seconds. 58 * 59 * Defaults to 43200 seconds (12 hours). 60 * 61 * @since 2.8.0 62 * @access public 63 * @var int 64 */ 65 public $lifetime = 43200; 66 67 /** 68 * Constructor. 69 * 70 * @since 2.8.0 71 * @since 3.2.0 Updated to use a PHP5 constructor. 72 * @access public 73 * 31 74 * @param string $location URL location (scheme is used to determine handler). 32 75 * @param string $filename Unique identifier for cache object. … … 50 93 51 94 /** 95 * Sets the transient. 96 * 97 * @since 2.8.0 52 98 * @access public 53 99 * … … 66 112 67 113 /** 68 * @access public 114 * Gets the transient. 115 * 116 * @since 2.8.0 117 * @access public 118 * 119 * @return mixed Transient value. 69 120 */ 70 121 public function load() { … … 73 124 74 125 /** 75 * @access public 126 * Gets mod transient. 127 * 128 * @since 2.8.0 129 * @access public 130 * 131 * @return mixed Transient value. 76 132 */ 77 133 public function mtime() { … … 80 136 81 137 /** 82 * @access public 138 * Sets mod transient. 139 * 140 * @since 2.8.0 141 * @access public 142 * 143 * @return bool False if value was not set and true if value was set. 83 144 */ 84 145 public function touch() { … … 87 148 88 149 /** 89 * @access public 150 * Deletes transients. 151 * 152 * @since 2.8.0 153 * @access public 154 * 155 * @return true Always true. 90 156 */ 91 157 public function unlink() { … … 96 162 } 97 163 164 /** 165 * Core class for fetching remote files and reading local files with SimplePie. 166 * 167 * @since 2.8.0 168 * 169 * @see SimplePie_File 170 */ 98 171 class WP_SimplePie_File extends SimplePie_File { 99 172 173 /** 174 * Constructor. 175 * 176 * @since 2.8.0 177 * @since 3.2.0 Updated to use a PHP5 constructor. 178 * @access public 179 * 180 * @param string $url Remote file URL. 181 * @param integer $timeout Optional. How long the connection should stay open in seconds. 182 * Default 10. 183 * @param integer $redirects Optional. The number of allowed redirects. Default 5. 184 * @param string|array $headers Optional. Array or string of headers to send with the request. 185 * Default null. 186 * @param string $useragent Optional. User-agent value sent. Default null. 187 * @param boolean $force_fsockopen Optional. Whether to force opening internet or unix domain socket 188 * connection or not. Default false. 189 */ 100 190 public function __construct($url, $timeout = 10, $redirects = 5, $headers = null, $useragent = null, $force_fsockopen = false) { 101 191 $this->url = $url; … … 137 227 138 228 /** 139 * WordPress SimplePie Sanitization Class 140 * 141 * Extension of the SimplePie_Sanitize class to use KSES, because 142 * we cannot universally count on DOMDocument being available 143 * 144 * @package WordPress 229 * Core class used to implement SimpliePie feed sanitization. 230 * 231 * Extends the SimplePie_Sanitize class to use KSES, because 232 * we cannot universally count on DOMDocument being available. 233 * 145 234 * @since 3.5.0 235 * 236 * @see SimplePie_Sanitize 146 237 */ 147 238 class WP_SimplePie_Sanitize_KSES extends SimplePie_Sanitize { 239 240 /** 241 * WordPress SimplePie sanitization using KSES. 242 * 243 * Sanitizes the incoming data, to ensure that it matches the type of data expected, using KSES. 244 * 245 * @since 3.5.0 246 * @access public 247 * 248 * @param mixed $data The data that needs to be sanitized. 249 * @param integer $type The type of data that it's supposed to be. 250 * @param string $base Optional. The `xml:base` value to use when converting relative 251 * URLs to absolute ones. Default empty. 252 * @return mixed Sanitized data. 253 */ 148 254 public function sanitize( $data, $type, $base = '' ) { 149 255 $data = trim( $data );
Note: See TracChangeset
for help on using the changeset viewer.