GRAYBYTE WORDPRESS FILE MANAGER2527

Server IP : 198.54.121.189 / Your IP : 216.73.216.112
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /home/giriqfky/trustyourlawyer.com/wp-content/plugins/ninja-forms/includes/Abstracts/
Upload Files :
Current_dir [ Writeable ] Document_root [ Writeable ]

Command :


Current File : /home/giriqfky/trustyourlawyer.com/wp-content/plugins/ninja-forms/includes/Abstracts//Migration.php
<?php if ( ! defined( 'ABSPATH' ) ) exit;

require_once( ABSPATH . 'wp-admin/includes/upgrade.php');

abstract class NF_Abstracts_Migration
{
    public $table_name = '';

    public $charset_collate = '';

    public $flag = '';


    /**
     * Constructor method for the NF_Abstracts_Migration class.
     * 
     * @param $table_name (String) The database table name managed by the extension.
     * @param $flag (String) The wp option set to determine if this migration has already been run.
     * 
     * @since 3.0.0
     */
    public function __construct( $table_name, $flag )
    {
        $this->table_name =  $table_name;
    }


    /**
     * Function to retrieve the full table name of the extension.
     * 
     * @return (String) The full table name, including database prefix.
     * 
     * @since 3.0.28
     */
    public function table_name()
    {
        global $wpdb;
        return $wpdb->prefix . $this->table_name;
    }


    /**
     * Function to check for the existence of a column in the extension's table.
     * 
     * @param $column (String) The name of the column to search for.
     * 
     * @return (Boolean) Whether or not the column exists.
     * 
     * @since 3.4.0
     */
    public function column_exists( $column )
    {
        global $wpdb;
        $response = false;
        // Fetch any records of the target column.
        $sql = $wpdb->prepare( "SHOW COLUMNS FROM `{$this->table_name()}` WHERE `Field` = '%s';", $column );
        $result = $wpdb->query( $sql );
        // If we got anything back, say so.
        if ( ! empty( $result ) ) $response = true;
        return $response;
    }


    /**
     * Funciton to get the charset and collate for migrations.
     * 
     * @param $use_default (Boolean) Whether or not to include the DEFAULT keyword in the return pattern.
     * 
     * @return (String) A SQL formatted charset and collate for use by table definition.
     * 
     * @since 3.0.28
     * @updated 3.1.14
     */
    public function charset_collate( $use_default = false )
    {
        $response = '';
        global $wpdb;
        // If our mysql version is 5.5.3 or higher...
        if ( version_compare( $wpdb->db_version(), '5.5.3', '>=' ) ) {
            // We can use mb4.
            $response = 'CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci';
        } // Otherwise...
        else {
            // We use standard utf8.
            $response = 'CHARACTER SET utf8 COLLATE utf8_general_ci';
        }
        // If we need to use default...
        if ( $use_default ) {
            // Append that to the response.
            $response = 'DEFAULT ' . $response;
        }
        return $response;
    }

    /**
     * Function to run our required update functions.
     * 
     * @param $callback (String) The function to be run by this call.
     * 
     * @since 3.4.0
     */
    public function _do_upgrade( $callback )
    {
        // If the method exists...
        if ( method_exists( $this, $callback ) ) {
            $blacklist = array(
                '__construct',
                '_do_upgrade',
                '_run',
                'run',
                '_drop',
                'drop'
            );
            // If this callback method isn't blacklisted...
            if ( ! in_array( $callback, $blacklist ) ) {
                // Run it.
                $this->{$callback}();
            }
        }
    }


    /**
     * Function to run our initial migration.
     * 
     * @since 3.0.0
     */
    public function _run()
    {
        // Check the flag
        if( get_option( $this->flag, FALSE ) ) return;

        // Run the migration
        $this->run();

        // Set the Flag
        update_option( $this->flag, TRUE );
    }


    /**
     * Abstract protection of inherited funciton run.
     * 
     * @since 3.0.0
     */
    protected abstract function run();


    /**
     * Function to drop the table managed by this migration.
     * 
     * @since 3.0.28
     */
    public function _drop()
    {
        global $wpdb;
        // If we don't have a table name, exit early.
        if( ! $this->table_name ) return;
        // If the table doesn't exist, exit early.
        if( 0 == $wpdb->query( $wpdb->prepare( "SHOW TABLES LIKE '%s'", $this->table_name() ) ) ) return;
        // Drop the table.
        $wpdb->query( "DROP TABLE " . $this->table_name() );
        return $this->drop();
    }


    /**
     * Protection of inherited function drop.
     * 
     * @since 3.0.28
     */
    protected function drop()
    {
        // This section intentionally left blank.
    }
}

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
July 10 2025 04:32:23
giriqfky / giriqfky
0755
.htaccess
0.41 KB
July 10 2025 04:32:23
giriqfky / giriqfky
0644
Action.php
5.331 KB
July 09 2024 21:34:32
giriqfky / giriqfky
0644
ActionNewsletter.php
4.452 KB
February 04 2020 21:17:42
giriqfky / giriqfky
0644
BatchProcess.php
5.563 KB
June 15 2022 07:30:14
giriqfky / giriqfky
0644
Controller.php
1.605 KB
April 05 2018 22:28:06
giriqfky / giriqfky
0644
Element.php
0.118 KB
August 25 2020 22:28:06
giriqfky / giriqfky
0644
Extension.php
3.077 KB
March 14 2016 18:30:08
giriqfky / giriqfky
0644
Field.php
6.882 KB
February 12 2024 22:23:38
giriqfky / giriqfky
0644
FieldOptIn.php
2.289 KB
February 04 2020 21:17:42
giriqfky / giriqfky
0644
Input.php
0.621 KB
May 02 2017 19:42:16
giriqfky / giriqfky
0644
List.php
3.313 KB
August 12 2019 18:00:44
giriqfky / giriqfky
0644
LogLevel.php
0.354 KB
June 21 2017 21:56:02
giriqfky / giriqfky
0644
Logger.php
3.151 KB
June 21 2017 21:56:02
giriqfky / giriqfky
0644
LoggerInterface.php
2.846 KB
June 21 2017 21:56:02
giriqfky / giriqfky
0644
Menu.php
2.351 KB
May 02 2017 19:42:16
giriqfky / giriqfky
0644
MergeTags.php
5.728 KB
April 02 2025 18:14:40
giriqfky / giriqfky
0644
Metabox.php
1.763 KB
December 09 2024 19:37:34
giriqfky / giriqfky
0644
Migration.php
4.521 KB
February 05 2019 21:29:12
giriqfky / giriqfky
0644
Model.php
22.841 KB
March 12 2025 21:40:36
giriqfky / giriqfky
0644
ModelFactory.php
14.163 KB
June 07 2021 21:40:12
giriqfky / giriqfky
0644
PaymentGateway.php
0.878 KB
March 14 2016 18:30:08
giriqfky / giriqfky
0644
RequiredUpdate.php
6.038 KB
January 14 2019 22:58:06
giriqfky / giriqfky
0644
Routes.php
0.38 KB
October 11 2021 19:04:16
giriqfky / giriqfky
0644
SotAction.php
3.429 KB
December 09 2024 19:37:34
giriqfky / giriqfky
0644
SotActionNewsletter.php
4.487 KB
December 09 2024 19:37:34
giriqfky / giriqfky
0644
Submenu.php
2.73 KB
September 18 2020 19:17:16
giriqfky / giriqfky
0644
SubmissionHandler.php
4.265 KB
November 15 2021 22:31:24
giriqfky / giriqfky
0644
SubmissionMetabox.php
1.002 KB
December 09 2024 19:37:34
giriqfky / giriqfky
0644
UserInfo.php
1.307 KB
February 04 2020 21:17:42
giriqfky / giriqfky
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF