Файловый менеджер - Редактировать - /var/www/xthruster/html/wp-content/uploads/flags/Storage.tar
Назад
WpTransientPerLanguage.php 0000644 00000002565 14721552604 0011664 0 ustar 00 <?php namespace WPML\ST\Storage; class WpTransientPerLanguage implements StoragePerLanguageInterface { /** @var string $id */ private $id; /** @var int $lifetime Lifetime of storage in seconds.*/ private $lifetime = 86400; // 1 day. /** * @param string $id */ public function __construct( $id ) { $this->id = $id; } /** * @param string $lang * @return mixed Returns StorageInterface::NOTHING if there is no cache. */ public function get( $lang ) { $value = get_transient( $this->getName( $lang ) ); return false === $value ? StoragePerLanguageInterface::NOTHING : $value; } /** * @param string $lang * @param mixed $value */ public function save( $lang, $value ) { return set_transient( $this->getName( $lang ), $value, $this->lifetime ); } public function delete( $lang ) { return delete_transient( $this->getName( $lang ) ); } /** * Set the lifetime. * * @param int $lifetime */ public function setLifetime( $lifetime ) { $lifetime = (int) $lifetime; if ( $lifetime <= 0 ) { // Don't allow no expiration for lifetime. // Because WordPress sets 'autoload' to 'yes' for transients with // no expiration, which would be very bad for language based data. $lifetime = 86400 * 365; // 1 year. } $this->lifetime = $lifetime; } private function getName( $lang ) { return $this->id . '-' . $lang; } } StoragePerLanguageInterface.php 0000644 00000001076 14721552604 0012627 0 ustar 00 <?php namespace WPML\ST\Storage; interface StoragePerLanguageInterface { /* Defined value to allow for null/false values to be stored. */ const NOTHING = '___NOTHING___'; // Allow to store a value for all languages. const GLOBAL_GROUP = '__ALL_LANG__'; /** * @param string $lang * * @return mixed Returns self::NOTHING if there is nothing stored. */ public function get( $lang ); /** * @param string $lang * @param mixed $value */ public function save( $lang, $value ); /** * @param string $lang */ public function delete( $lang ); }
| ver. 1.4 |
Github
|
.
| PHP 7.4.3-4ubuntu2.24 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка