Пример #1
0
function start_update()
{
    global $errors, $notes, $lang_update_php, $LINEBREAK;
    global $update_icon, $ok_icon, $already_done_icon, $error_icon, $file_system_icon;
    // The updater
    //html_header($lang_update_php['title']);
    test_sql_connection();
    if (function_exists('cpg_fetch_icon')) {
        $update_icon = cpg_fetch_icon('update_database', 2);
        $ok_icon = cpg_fetch_icon('ok', 2);
        $already_done_icon = cpg_fetch_icon('info', 2);
        $error_icon = cpg_fetch_icon('stop', 2);
        $file_system_icon = cpg_fetch_icon('hdd', 2);
    } else {
        $update_icon = '';
        $ok_icon = '';
        $already_done_icon = '';
        $error_icon = '';
        $file_system_icon = '';
    }
    if ($errors == '') {
        echo '        <table border="0" cellspacing="0" cellpadding="0" class="maintable">' . $LINEBREAK;
        update_tables();
        update_files();
        echo '        </table>' . $LINEBREAK;
    } else {
        html_error($errors);
    }
    if ($errors == '') {
        html_install_success($notes);
        session_destroy();
    } else {
        html_error($errors);
    }
    //html_footer();
}
Пример #2
0
     if ($result === false) {
         echo implode(',', $err->last_message());
     } else {
         echo 'OK';
     }
     break;
     /* 升级文件 */
 /* 升级文件 */
 case 'update_files':
     include_once ROOT_PATH . 'includes/cls_json.php';
     $json = new JSON();
     $next_ver = isset($_REQUEST['next_ver']) ? $_REQUEST['next_ver'] : '';
     if ($next_ver === '') {
         die('EMPTY');
     }
     $result = update_files($next_ver);
     echo $json->encode($result);
     break;
     /* 升级数据结构 */
 /* 升级数据结构 */
 case 'update_structure':
     $next_ver = isset($_REQUEST['next_ver']) ? $_REQUEST['next_ver'] : '';
     $cur_pos = isset($_REQUEST['cur_pos']) ? $_REQUEST['cur_pos'] : '';
     if ($next_ver === '' || intval($cur_pos) < 1) {
         die('EMPTY');
     }
     $result = update_structure_automatically($next_ver, intval($cur_pos) - 1);
     if ($result === false) {
         echo implode(',', $err->last_message());
     } else {
         echo 'OK';
Пример #3
0
use Drupal\Core\DrupalKernel;
use Drupal\Core\Site\Settings;
use Symfony\Component\HttpFoundation\Request;
$autoloader = (require_once __DIR__ . '/core/vendor/autoload.php');
try {
    $request = Request::createFromGlobals();
    $kernel = DrupalKernel::createFromRequest($request, $autoloader, 'prod');
    $kernel->boot();
    // Blocks.
    update_blocks();
    // Batch table: no need to migrate.
    // Cache tags, a special table.
    update_cache_tags_table();
    // Comments: no need to migrate for us.
    // Files.
    update_files();
    // Menus will be manually recreated.
    // Node tables.
    update_node_table();
    // Node fields content.
    update_node_fields();
    update_sequences_table();
    // Shortcuts.
    update_shortcuts();
    // Taxonomy terms.
    update_taxonomy_tables();
    // Url aliases.
    update_url_aliases();
    // Users.
    update_users();
    // We do not migrate the watchdog at the moment.