| Server IP : 14.225.204.176 / Your IP : 216.73.216.6 Web Server : nginx/1.24.0 System : Linux nodejs-ybgk 6.8.0-40-generic #40-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 5 10:34:03 UTC 2024 x86_64 User : root ( 0) PHP Version : 8.1.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/html/php/harmoniegolfpark.com/wp-content/plugins/loco-translate/src/data/ |
Upload File : |
<?php
/**
*
*/
abstract class Loco_data_Transient extends Loco_data_Serializable {
/**
* Lifespan to persist object in transient cache on shutdown
* @var int
*/
private $lazy;
/**
* Get short suffix for use as end of cache key.
* DB allows 191 characters including "_transient_timeout_loco_" prefix, leaving 167 bytes
* @return string
*/
abstract public function getKey();
/**
* Persist object in WordPress cache
* @return Loco_data_Transient
*/
public function persist( $ttl = 0, $immediate = false ){
if( $immediate ){
$key = 'loco_'.$this->getKey();
$data = $this->getSerializable();
set_transient( $key, $data, $ttl );
$this->lazy = null;
$this->clean();
}
else {
$this->lazy = $ttl;
}
return $this;
}
/**
* Commit to transient cache on object destruction
*/
final public function __destruct(){
if( is_int($this->lazy) ){
$this->persistIfDirty( $this->lazy, true );
}
}
/**
* Retrieve and unserialize this object from WordPress transient cache
* @return bool whether object existed in cache
*/
public function fetch(){
$v = $this->getVersion();
$key = 'loco_'.$this->getKey();
$data = get_transient( $key );
try {
$this->setUnserialized($data);
return true;
}
catch( InvalidArgumentException $e ){
return false;
}
}
}