| @@ -66,8 +66,37 @@ | ||
| 66 | 66 | return $GLOBALS['sync_basalam_jobs_runner_test_state']['transients'][$transient] ?? false; |
| 67 | 67 | } |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | +if (!function_exists('get_option')) { | |
| 71 | + function get_option($name, $default = false) | |
| 72 | + { | |
| 73 | + return $GLOBALS['sync_basalam_test_options'][$name] ?? $default; | |
| 74 | + } | |
| 75 | +} | |
| 76 | + | |
| 77 | +if (!function_exists('update_option')) { | |
| 78 | + function update_option($name, $value, $autoload = null) | |
| 79 | + { | |
| 80 | + $GLOBALS['sync_basalam_test_options'][$name] = $value; | |
| 81 | + return true; | |
| 82 | + } | |
| 83 | +} | |
| 84 | + | |
| 85 | +if (!function_exists('wp_using_ext_object_cache')) { | |
| 86 | + function wp_using_ext_object_cache() | |
| 87 | + { | |
| 88 | + return $GLOBALS['sync_basalam_jobs_runner_test_state']['external_object_cache'] ?? false; | |
| 89 | + } | |
| 90 | +} | |
| 91 | + | |
| 92 | +if (!function_exists('wp_installing')) { | |
| 93 | + function wp_installing() | |
| 94 | + { | |
| 95 | + return false; | |
| 96 | + } | |
| 97 | +} | |
| 98 | + | |
| 70 | 99 | if (!function_exists('set_transient')) { |
| 71 | 100 | function set_transient($transient, $value, $expiration = 0) |
| 72 | 101 | { |
| 73 | 102 | $GLOBALS['sync_basalam_jobs_runner_test_state']['events'][] = 'set_transient'; |
| @@ -76,8 +105,11 @@ | ||
| 76 | 105 | 'value' => $value, |
| 77 | 106 | 'expiration' => $expiration, |
| 78 | 107 | ]; |
| 79 | 108 | $GLOBALS['sync_basalam_jobs_runner_test_state']['transients'][$transient] = $value; |
| 109 | + if ($expiration > 0) { | |
| 110 | + $GLOBALS['sync_basalam_test_options']['_transient_timeout_' . $transient] = time() + $expiration; | |
| 111 | + } | |
| 80 | 112 | |
| 81 | 113 | return true; |
| 82 | 114 | } |
| 83 | 115 | } |