芝麻web文件管理V1.00
编辑当前文件:/home/mybf1/www/sabun.bf1.my/wp-content/plugins/all-in-one-seo-pack/app/Common/Utils/Transients.php
prefix . $name; $expirationTransientName = $this->prefix . 'expiration_' . $name; $value = get_option( $transientName ); $expiration = get_option( $expirationTransientName ); if ( ! $expiration ) { // Transient doesn't appear correct. delete_option( $transientName ); return false; } if ( $expiration < time() ) { delete_option( $transientName ); delete_option( $expirationTransientName ); return false; } self::$transients[ $name ] = $value; return $value; } /** * Updates the given transient or creates it if it doesn't exist. * * @since 4.0.13 * * @param string $name The transient name. * @param mixed $value The value. * @param int $expiration The expiration time. Defaults to 24 hours. * @return void */ public function update( $name, $value, $expiration = DAY_IN_SECONDS ) { update_option( $this->prefix . $name, $value, false ); update_option( $this->prefix . 'expiration_' . $name, time() + $expiration, false ); self::$transients[ $name ] = $value; } /** * Deletes the given transient. * * @since 4.0.13 * * @param string $name The transient name. * @return void */ public function delete( $name ) { delete_option( $this->prefix . $name ); delete_option( $this->prefix . 'expiration_' . $name ); } /** * Clears all of our transients. * * @since 4.0.17 * * @return void */ public function clearCache() { $table = aioseo()->db->db->options; aioseo()->db->db->query( "DELETE FROM {$table} WHERE option_name LIKE '\_aioseo\_cache\_%'" ); } }