コード例 #1
0
ファイル: install_inc.php プロジェクト: bitweaver/install
        require_once 'create_config_inc.php';
        $createHash = array("gBitDbType" => $_REQUEST['db'], "gBitDbHost" => $tmpHost, "gBitDbUser" => $_REQUEST['user'], "gBitDbPassword" => $_REQUEST['pass'], "gBitDbName" => $_REQUEST['name'], "gBitDbCaseSensitivity" => $_REQUEST['dbcase'], "bit_db_prefix" => $_REQUEST['prefix'], "bit_root_url" => $_REQUEST['baseurl'], "auto_bug_submit" => !empty($_REQUEST['auto_bug_submit']) ? 'TRUE' : 'FALSE', "is_live" => !empty($_REQUEST['is_live']) ? 'TRUE' : 'FALSE');
        create_config($createHash);
        include $config_file;
    }
}
require_once "../kernel/setup_inc.php";
require_once 'BitInstaller.php';
if (defined('ROLE_MODEL')) {
    require_once USERS_PKG_PATH . 'RoleUser.php';
} else {
    require_once USERS_PKG_PATH . 'BitUser.php';
}
// set some preferences during installation
global $gBitInstaller, $gBitSystem, $gBitThemes;
$gBitInstaller = new BitInstaller();
// IF DB has not been created yet, then packages will not have been scanned yet.
// and even if they have been scanned, then they will only include active packages,
// not all packages. So we scan again here including all packages.
$gBitSystem->scanPackages('bit_setup_inc.php', TRUE, 'all', TRUE, TRUE);
$gBitInstaller->mPackages = $gBitSystem->mPackages;
// we need this massive array available during install to work out if bitweaver has already been installed
// this array is so massive that it will kill system with too little memory allocated to php
$dbTables = $gBitInstaller->verifyInstalledPackages('all');
// set prefs to display help during install
$gBitSystem->setConfig('site_online_help', 'y');
$gBitSystem->setConfig('site_form_help', 'y');
$gBitSystem->setConfig('site_help_popup', 'n');
$commands = array();
global $failedcommands;
$failedcommands = array();
コード例 #2
0
     $c = 0;
     $gDb_dst->StartTrans();
     // get source data
     $result = $gDb_src->Execute("SELECT * FROM {$table}");
     // identify blob fields
     //echo "$table\n";
     //print_r($encoded_tables);
     //var_dump(array_search($table, $encoded_tables));die;
     $blobs = BitInstaller::identifyBlobs($result);
     //print_r($blobs);
     while ($res = $result->FetchRow()) {
         //var_dump($res);die;
         // convert blobs
         if ($convert_blobs && !empty($blobs)) {
             $c++;
             BitInstaller::convertBlobs($gDb_dst, $res, $blobs);
         }
         $q++;
         // insert data into destination
         if ($gDb_dst->associateInsert($table, $res) === false) {
             array_push($gDb_dst->mFailed, $gDb_dst->mDb->ErrorMsg());
             if ($stop_on_errors) {
                 break;
             }
         }
     }
     $gDb_dst->CompleteTrans();
     $results[] = "{$table}: migrated {$q} records" . ($c > 0 ? "and converted {$c} blobs" : "");
 }
 //vd($gDb_dst->mFailed);die;
 $gBitSmarty->assignByRef('results', $results);