Add access modifiers to methods/members in WP_Feed_Cache
, WP_SimplePie_File
, and WP_Feed_Cache_Transient
.
See #27881, #22234. git-svn-id: https://develop.svn.wordpress.org/trunk@28505 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
1d13dc8a85
commit
8c2ccf6d7c
@ -10,17 +10,17 @@ class WP_Feed_Cache extends SimplePie_Cache {
|
|||||||
* @static
|
* @static
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function create($location, $filename, $extension) {
|
public function create($location, $filename, $extension) {
|
||||||
return new WP_Feed_Cache_Transient($location, $filename, $extension);
|
return new WP_Feed_Cache_Transient($location, $filename, $extension);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class WP_Feed_Cache_Transient {
|
class WP_Feed_Cache_Transient {
|
||||||
var $name;
|
public $name;
|
||||||
var $mod_name;
|
public $mod_name;
|
||||||
var $lifetime = 43200; //Default lifetime in cache of 12 hours
|
public $lifetime = 43200; //Default lifetime in cache of 12 hours
|
||||||
|
|
||||||
function __construct($location, $filename, $extension) {
|
public function __construct($location, $filename, $extension) {
|
||||||
$this->name = 'feed_' . $filename;
|
$this->name = 'feed_' . $filename;
|
||||||
$this->mod_name = 'feed_mod_' . $filename;
|
$this->mod_name = 'feed_mod_' . $filename;
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ class WP_Feed_Cache_Transient {
|
|||||||
$this->lifetime = apply_filters( 'wp_feed_cache_transient_lifetime', $lifetime, $filename);
|
$this->lifetime = apply_filters( 'wp_feed_cache_transient_lifetime', $lifetime, $filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
function save($data) {
|
public function save($data) {
|
||||||
if ( is_a($data, 'SimplePie') )
|
if ( is_a($data, 'SimplePie') )
|
||||||
$data = $data->data;
|
$data = $data->data;
|
||||||
|
|
||||||
@ -45,19 +45,19 @@ class WP_Feed_Cache_Transient {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function load() {
|
public function load() {
|
||||||
return get_transient($this->name);
|
return get_transient($this->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
function mtime() {
|
public function mtime() {
|
||||||
return get_transient($this->mod_name);
|
return get_transient($this->mod_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
function touch() {
|
public function touch() {
|
||||||
return set_transient($this->mod_name, time(), $this->lifetime);
|
return set_transient($this->mod_name, time(), $this->lifetime);
|
||||||
}
|
}
|
||||||
|
|
||||||
function unlink() {
|
public function unlink() {
|
||||||
delete_transient($this->name);
|
delete_transient($this->name);
|
||||||
delete_transient($this->mod_name);
|
delete_transient($this->mod_name);
|
||||||
return true;
|
return true;
|
||||||
@ -66,7 +66,7 @@ class WP_Feed_Cache_Transient {
|
|||||||
|
|
||||||
class WP_SimplePie_File extends SimplePie_File {
|
class WP_SimplePie_File extends SimplePie_File {
|
||||||
|
|
||||||
function __construct($url, $timeout = 10, $redirects = 5, $headers = null, $useragent = null, $force_fsockopen = false) {
|
public function __construct($url, $timeout = 10, $redirects = 5, $headers = null, $useragent = null, $force_fsockopen = false) {
|
||||||
$this->url = $url;
|
$this->url = $url;
|
||||||
$this->timeout = $timeout;
|
$this->timeout = $timeout;
|
||||||
$this->redirects = $redirects;
|
$this->redirects = $redirects;
|
||||||
|
Loading…
Reference in New Issue
Block a user