Ejemplo n.º 1
0
include DIR . 'langs/ru.php';
include DIR . 'lib/installer.php';
include DIR . 'lib/dropWebLight.php';
include DIR . 'lib/http.php';
$i = new installer();
$v = '0.1';
$repo = 'https://www.dropbox.com/sh/5heu2fsn394fnka/QTmCe0-vy7';
$h = new http();
$h->setProxy('localhost', 666);
$d = new dropWebLight($repo, $h);
$file_list = 'file_list.json';
$c['{collapsible}'] = 'false';
$use_current = isset($_POST['use_current']) && $_POST['use_current'] == 'on';
$lang['{use_this}'] = '<br/><input type="checkbox" name="use_current" class="use" ' . ($use_current ? 'checked' : '') . '> Использовать текущую?';
$c['{install_path}'] = DIR;
if (!$i->check('e|w', DIR . 'tmp')) {
    mkdir(DIR . 'tmp');
}
if (!isset($_POST['app_name']) || !isset($_POST['install_path'])) {
    $c['{app}'] = $lang['{app}'];
    $c['{install_path}'] = DIR . 'tmp/';
} else {
    $c['{app}'] = $_POST['app_name'];
    $c['{install_path}'] = $_POST['install_path'];
}
$i->check('em', $c['{app}']) ? $i->step('app_name', true) : $i->step('app_name', false);
$c = listResult('options', $i, $c);
$i->check('e|w', $c['{install_path}']) ? $i->step('install_path', true) : $i->step('install_path', false);
$c = listResult('perms', $i, $c);
if (!$i->check('e|r|f', DIR . $file_list)) {
    $d->get($file_list, DIR);