Server IP : 104.21.38.3 / Your IP : 172.71.124.240 Web Server : Apache System : Linux krdc-ubuntu-s-2vcpu-4gb-amd-blr1-01.localdomain 5.15.0-142-generic #152-Ubuntu SMP Mon May 19 10:54:31 UTC 2025 x86_64 User : www ( 1000) PHP Version : 7.4.33 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /www/wwwroot/www.houseboatjetty.com/wp-content/plugins/woocommerce/src/Admin/API/Reports/ |
Upload File : |
<?php /** * REST API Reports Cache. * * Handles report data object caching. */ namespace Automattic\WooCommerce\Admin\API\Reports; defined( 'ABSPATH' ) || exit; /** * REST API Reports Cache class. */ class Cache { /** * Cache version. Used to invalidate all cached values. */ const VERSION_OPTION = 'woocommerce_reports'; /** * Invalidate cache. */ public static function invalidate() { \WC_Cache_Helper::get_transient_version( self::VERSION_OPTION, true ); } /** * Get cache version number. * * @return string */ public static function get_version() { $version = \WC_Cache_Helper::get_transient_version( self::VERSION_OPTION ); return $version; } /** * Get cached value. * * @param string $key Cache key. * @return mixed */ public static function get( $key ) { $transient_version = self::get_version(); $transient_value = get_transient( $key ); if ( isset( $transient_value['value'], $transient_value['version'] ) && $transient_value['version'] === $transient_version ) { return $transient_value['value']; } return false; } /** * Update cached value. * * @param string $key Cache key. * @param mixed $value New value. * @return bool */ public static function set( $key, $value ) { $transient_version = self::get_version(); $transient_value = array( 'version' => $transient_version, 'value' => $value, ); $result = set_transient( $key, $transient_value, WEEK_IN_SECONDS ); return $result; } }