Example #1
0
/**
 * processes the installer
 */
function process($argv)
{
    // Determine ANSI output from --ansi and --no-ansi flags
    setUseAnsi($argv);
    if (in_array('--help', $argv)) {
        displayHelp();
        exit(0);
    }
    $check = in_array('--check', $argv);
    $help = in_array('--help', $argv);
    $force = in_array('--force', $argv);
    $quiet = in_array('--quiet', $argv);
    $channel = in_array('--snapshot', $argv) ? 'snapshot' : (in_array('--preview', $argv) ? 'preview' : 'stable');
    $disableTls = in_array('--disable-tls', $argv);
    $installDir = getOptValue('--install-dir', $argv, false);
    $version = getOptValue('--version', $argv, false);
    $filename = getOptValue('--filename', $argv, 'composer.phar');
    $cafile = getOptValue('--cafile', $argv, false);
    if (!checkParams($installDir, $version, $cafile)) {
        exit(1);
    }
    $ok = checkPlatform($quiet, $disableTls);
    if (true === $disableTls) {
        out("You have instructed the Installer not to enforce SSL/TLS security on remote HTTPS requests.", 'info');
        out("This will leave all downloads during installation vulnerable to Man-In-The-Middle (MITM) attacks.", 'info');
    }
    if ($check) {
        exit($ok ? 0 : 1);
    }
    if ($ok || $force) {
        installComposer($version, $installDir, $filename, $quiet, $disableTls, $cafile, $channel);
        exit(0);
    }
    exit(1);
}
Example #2
0
/**
 * processes the installer
 */
function process($argv)
{
    // Determine ANSI output from --ansi and --no-ansi flags
    setUseAnsi($argv);
    if (in_array('--help', $argv)) {
        displayHelp();
        exit(0);
    }
    $check = in_array('--check', $argv);
    $help = in_array('--help', $argv);
    $force = in_array('--force', $argv);
    $quiet = in_array('--quiet', $argv);
    $channel = in_array('--snapshot', $argv) ? 'snapshot' : (in_array('--preview', $argv) ? 'preview' : 'stable');
    $disableTls = in_array('--disable-tls', $argv);
    $installDir = getOptValue('--install-dir', $argv, false);
    $version = getOptValue('--version', $argv, false);
    $filename = getOptValue('--filename', $argv, 'composer.phar');
    $cafile = getOptValue('--cafile', $argv, false);
    if (!checkParams($installDir, $version, $cafile)) {
        exit(1);
    }
    $ok = checkPlatform($warnings, $quiet, $disableTls);
    if ($check) {
        // Only show warnings if we haven't output any errors
        if ($ok) {
            showWarnings($warnings);
            showSecurityWarning($disableTls);
        }
        exit($ok ? 0 : 1);
    }
    if ($ok || $force) {
        installComposer($version, $installDir, $filename, $quiet, $disableTls, $cafile, $channel);
        showWarnings($warnings);
        showSecurityWarning($disableTls);
        exit(0);
    }
    exit(1);
}
Example #3
0
<?php

if (php_sapi_name() !== 'cli') {
    exit(1);
}
set_time_limit(0);
ini_set('display_errors', 1);
define('COMPOSER_FILE', 'composer.phar');
define('COMPOSER_SETUP_FILE', 'composer-setup.php');
setUseAnsi($argv);
$argv = is_array($argv) ? $argv : array();
$argv[1] = isset($argv[1]) ? $argv[1] : null;
$argv[2] = isset($argv[2]) ? $argv[2] : null;
if (in_array('--help', $argv) || empty($argv[1])) {
    displayHelp($argv);
    exit(0);
}
if (in_array('-v', $argv) || in_array('--version', $argv)) {
    require __DIR__ . '/src/Eccube/Common/Constant.php';
    echo 'EC-CUBE ' . Eccube\Common\Constant::VERSION . PHP_EOL;
    exit(0);
}
out('EC-CUBE3 installer use database driver of ', null, false);
$database_driver = 'pdo_sqlite';
switch ($argv[1]) {
    case 'mysql':
        $database_driver = 'pdo_mysql';
        break;
    case 'pgsql':
        $database_driver = 'pdo_pgsql';
        break;