PATH:
var
/
www
/
clients
/
client1
/
web1
/
web
/
wp-content
/
sitepress-multilingual-cms
/
classes
/
utilities
<?php /** * Class WPML_Non_Persistent_Cache * * Implements non-persistent cache based on an array. Suitable to cache objects during single page load. */ class WPML_Non_Persistent_Cache { /** * @var array Cached objects. */ private static $cache = array(); /** * Retrieves the data contents from the cache, if it exists. * * @param string $key Cache key. * @param string $group Cache group. * @param bool $found Whether the key was found in the cache (passed by reference). * Disambiguates a return of false, a storable value. * * @return mixed|bool */ public static function get( $key, $group = 'default', &$found = null ) { if ( isset( self::$cache[ $group ] ) && ( isset( self::$cache[ $group ][ $key ] ) || array_key_exists( $key, self::$cache[ $group ] ) ) ) { $found = true; return self::$cache[ $group ][ $key ]; } $found = false; return false; } /** * Sets the data contents into the cache. * * @param string $key Cache key. * @param mixed $data Data to store in cache. * @param string $group Cache group. * * @return bool */ public static function set( $key, $data, $group = 'default' ) { if ( is_object( $data ) ) { $data = clone $data; } self::$cache[ $group ][ $key ] = $data; return true; } /** * Executes callback function and caches its result. * * @param string $key Cache key. * @param callable $callback Callback function. * @param string $group Cache group. * * @return bool */ public static function execute_and_cache( $key, $callback, $group = 'default' ) { $data = self::get( $key, $group, $found ); if ( ! $found ) { $data = $callback(); self::set( $key, $data, $group ); } return $data; } /** * Flush cache. * * @return bool */ public static function flush() { self::$cache = array(); return true; } /** * Flush cache group. * * @param array|string $groups Cache group name. * * @return bool */ public static function flush_group( $groups = 'default' ) { $groups = (array) $groups; foreach ( $groups as $group ) { unset( self::$cache[ $group ] ); } return true; } }
[-] class-wpml-wp-cache-factory.php
[edit]
[-] class-wpml-inactive-content.php
[edit]
[-] class-wpml-slash-management.php
[edit]
[-] class-wpml-transient.php
[edit]
[-] class-wpml-ajax.php
[edit]
[-] class-wpml-locale.php
[edit]
[-] class-wpml-string-functions.php
[edit]
[-] class-wpml-deactivate-old-media-factory.php
[edit]
[-] class-wpml-global-ajax.php
[edit]
[+]
admin
[-] AutoAdjustIdsFactory.php
[edit]
[-] wpml-queried-object.php
[edit]
[-] class-wpml-wp-query-api.php
[edit]
[-] class-debug-backtrace.php
[edit]
[-] class-wpml-temporary-switch-admin-language.php
[edit]
[-] class-wpml-flags-factory.php
[edit]
[-] class-wpml-deactivate-old-media.php
[edit]
[-] AutoAdjustIds.php
[edit]
[-] Resources.php
[edit]
[-] class-wpml-encoding.php
[edit]
[-] class-wpml-temporary-switch-language.php
[edit]
[-] class-wpml-flags.php
[edit]
[+]
..
[-] Pager.php
[edit]
[-] class-wpml-wp-post.php
[edit]
[-] class-wpml-cache-factory.php
[edit]
[-] wpml-uuid.php
[edit]
[-] class-wpml-encoding-validation.php
[edit]
[-] wpml-languages-notices.php
[edit]
[-] class-wpml-non-persistent-cache.php
[edit]
[+]
user
[-] class-wpml-wp-cache.php
[edit]
[+]
lock
[-] class-wpml-simple-language-selector.php
[edit]
[-] class-wpml-debug-backtrace.php
[edit]
[-] class-wpml-wp-taxonomy-query.php
[edit]
[-] class-wpml-wp-cache-item.php
[edit]
[-] class-wpml-translate-link-targets.php
[edit]