Ejemplo n.º 1
0
// If not familiar with PHP please don't change anything below this line
// *******************************************************************************************
//define ('VERSION','0.32b');
define('DATA_CHUNK_LENGTH', 16384);
// How many chars are read per time
define('MAX_QUERY_LINES', 300);
// How many lines may be considered to be one query (except text lines)
define('TESTMODE', false);
// Set to true to process the file without actually accessing the database
@ini_set('auto_detect_line_endings', true);
@set_time_limit(0);
if (function_exists("date_default_timezone_set") && function_exists("date_default_timezone_get")) {
    @date_default_timezone_set(@date_default_timezone_get());
}
header('Content-Type: text/html; charset=' . $LANG_CHARSET);
echo Installer::getHeader($LANG_MIGRATE[17]);
$error = false;
$file = false;
// Check if mysql extension is available
$availableDrivers = Geeklog\Db::getDrivers();
if (!$error && count($availableDrivers) === 0) {
    echo '<p>' . $LANG_BIGDUMP[11] . '</p>' . PHP_EOL;
    $error = true;
}
// Get the current directory
$upload_dir = __DIR__;
// Connect to the database
$db = false;
$dbConnection = false;
$errorMessage = '';
$args = array('host' => $_DB_host, 'user' => $_DB_user, 'pass' => $_DB_pass, 'name' => $_DB_name, 'charset' => $db_connection_charset);
Ejemplo n.º 2
0
$step = isset($_GET['step']) ? $_GET['step'] : (isset($_POST['step']) ? $_POST['step'] : 1);
if (file_exists(PATH_INSTALL . 'language/' . $language . '.php')) {
    include_once PATH_INSTALL . 'language/' . $language . '.php';
} else {
    include_once PATH_INSTALL . 'language/' . Installer::DEFAULT_LANGUAGE . '.php';
}
if (!isset($LANG_DIRECTION)) {
    $LANG_DIRECTION = 'ltr';
}
if ($LANG_DIRECTION === 'rtl') {
    $form_label_dir = 'form-label-right';
} else {
    $form_label_dir = 'form-label-left';
}
// $display holds all the outputted HTML and content
$display = Installer::getHeader($LANG_PLUGINS[2] . ' 3 - ' . $LANG_PLUGINS[1]);
// Grab the beginning HTML for the installer theme.
// Make sure the version of PHP is supported.
$installer->checkPhpVersion();
// Ok, the user's version of PHP is supported. Let's move on
switch ($step) {
    /**
     * Step 1 - Display the upload form and allow
     * the user to select which plugins to install
     */
    case 1:
        // If 'file_uploads' is enabled in php.ini and the plugin directories are writable by the web server.
        $upload_enabled = ini_get('file_uploads') && is_writable($_CONF['path'] . 'plugins/') && is_writable($_CONF['path_html']) && is_writable($installer->getAdminPath() . 'plugins/');
        $display .= '<p>' . $LANG_PLUGINS[3] . ($upload_enabled ? ' ' . $LANG_PLUGINS[4] : '') . '</p>' . PHP_EOL;
        // Check if a plugin file was uploaded
        $upload_success = false;