Uname:Linux Sandbox-A 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64

Base Dir : /var/www/html

User : gavin


403WebShell
403Webshell
Server IP : 68.183.124.220  /  Your IP : 216.73.216.141
Web Server : Apache/2.4.18 (Ubuntu)
System : Linux Sandbox-A 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64
User : gavin ( 1000)
PHP Version : 7.0.33-0ubuntu0.16.04.16
Disable Function : 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,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/gavin/ninja-forms/deprecated/includes/admin/upgrades/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/gavin/ninja-forms/deprecated/includes/admin/upgrades/database-migrations.php
<?php if ( ! defined( 'ABSPATH' ) ) exit;

final class NF_Upgrade_Database_Migrations extends NF_Upgrade
{
    public $name = 'database_migrations';

    public $priority = "0.0.1";

    public $description = 'The database needs to be updated to support the new version.';

    public $args = array();

    public $errors = array();

    public function loading()
    {
        $already_run = $this->isComplete();

        $this->total_steps = ( $already_run ) ? 0 : 1;
    }

    public function step( $step )
    {
        $this->createObjectTable();
        $this->createObjectMetaTable();
        $this->createObjectRelationshipsTable();
    }

    public function complete()
    {
        update_option( 'nf_database_migrations', true);
    }

    public function isComplete()
    {
        if( $this->existsObjectTable() ||
            $this->existsObjectMetaTable() ||
            $this->existsObjectRelationshipsTable()
        ) {
            return true;
        }
        return get_option( 'nf_database_migrations', false );
    }

    /*
     * PRIVATE METHODS
     */

    private function createObjectTable()
    {
        require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );

        $sql = "CREATE TABLE IF NOT EXISTS " . NF_OBJECTS_TABLE_NAME . " (
        `id` bigint(20) NOT NULL AUTO_INCREMENT,
        `type` varchar(255) NOT NULL,
        PRIMARY KEY (`id`)
        ) DEFAULT CHARSET=utf8;";

        dbDelta( $sql );
    }

    private function existsObjectTable()
    {
        global $wpdb;
        return $wpdb->query( "SHOW TABLES LIKE '" . NF_OBJECTS_TABLE_NAME . "'" );
    }


    private function createObjectMetaTable()
    {
        require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );

        $sql = "CREATE TABLE IF NOT EXISTS ". NF_OBJECT_META_TABLE_NAME . " (
        `id` bigint(20) NOT NULL AUTO_INCREMENT,
        `object_id` bigint(20) NOT NULL,
        `meta_key` varchar(255) NOT NULL,
        `meta_value` longtext NOT NULL,
        PRIMARY KEY (`id`)
        ) DEFAULT CHARSET=utf8;";

        dbDelta( $sql );
    }

    private function existsObjectMetaTable()
    {
        global $wpdb;
        return $wpdb->query( "SHOW TABLES LIKE '" . NF_OBJECT_META_TABLE_NAME . "'" );
    }

    private function createObjectRelationshipsTable()
    {
        require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );

        $sql = "CREATE TABLE IF NOT EXISTS " . NF_OBJECT_RELATIONSHIPS_TABLE_NAME . " (
        `id` bigint(20) NOT NULL AUTO_INCREMENT,
        `child_id` bigint(20) NOT NULL,
        `parent_id` bigint(20) NOT NULL,
        `child_type` varchar(255) NOT NULL,
        `parent_type` varchar(255) NOT NULL,
        PRIMARY KEY (`id`)
        ) DEFAULT CHARSET=utf8;";

        dbDelta( $sql );
    }

    private function existsObjectRelationshipsTable()
    {
        global $wpdb;
        return $wpdb->query( "SHOW TABLES LIKE '" . NF_OBJECT_RELATIONSHIPS_TABLE_NAME . "'" );
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit