MOON
Server: Apache
System: Linux host.communityeducationproject.org 3.10.0-1160.105.1.vz7.214.3 #1 SMP Tue Jan 9 19:45:01 MSK 2024 i686
User: ohiobwc (508)
PHP: 5.6.23
Disabled: show_source, system, passthru, popen, proc_open, allow_url_fopen
Upload Files
File: //scripts/setup_whmxfer_db
#!/usr/local/cpanel/3rdparty/bin/perl
# cpanel - scripts/setup_whmxfer_db               Copyright(c) 2014 cPanel, Inc.
#                                                           All rights Reserved.
# copyright@cpanel.net                                         http://cpanel.net
# This code is subject to the cPanel license. Unauthorized copying is prohibited

package Scripts::Setup_Whmxfer_Db;

use strict;

use Cpanel::MysqlUtils::Diff             ();
use Cpanel::MysqlUtils                   ();
use Whostmgr::Transfers::SessionDB       ();
use Whostmgr::Transfers::SessionBase     ();
use Whostmgr::Transfers::Session::Config ();

sub script {
    my $mysqlcheck = Cpanel::MysqlUtils::find_mysqlcheck();

    my $session_db = Whostmgr::Transfers::SessionDB->new();

    system( $mysqlcheck, '-s', '--auto-repair', $Whostmgr::Transfers::Session::Config::DBNAME, $Whostmgr::Transfers::SessionBase::SESSIONS_TABLE );

    my $diff = Cpanel::MysqlUtils::Diff::mysqldiff_no_drop_column( $Whostmgr::Transfers::Session::Config::DBNAME, $Whostmgr::Transfers::SessionBase::WHMXFER_SQL_FILE, '^' . $Whostmgr::Transfers::SessionBase::SESSIONS_TABLE . '$' );

    if ($diff) {
        $session_db->_retried_do($diff);
        print "setup_whmxfer_db: updated whmxfer database schema.\n";
    }
    else {
        print "setup_whmxfer_db: database schema is up to date.\n";
    }
    $session_db->disconnect();    # TP TASK 20767 disconnect before global destruct
    exit(0);
}

__PACKAGE__->script() unless caller();