Exemplo n.º 1
0
<?php

// Exit if accessed directly
if (!defined('DUPLICATOR_INIT')) {
    $_baseURL = "http://" . strlen($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : $_SERVER['HTTP_HOST'];
    header("HTTP/1.1 301 Moved Permanently");
    header("Location: {$_baseURL}");
    exit;
}
//DETECT ARCHIVE FILES
$zip_files = DUPX_Util::get_zip_files();
$zip_count = count($zip_files);
if ($zip_count > 1) {
    $zip_name = "Too many zip files in directory";
} else {
    if ($zip_count == 1) {
        $zip_name = $zip_files[0];
    } else {
        $zip_name = "No package file found";
    }
}
$req01a = @is_writeable($GLOBALS["CURRENT_ROOT_PATH"]) ? 'Pass' : 'Fail';
if (is_dir($GLOBALS["CURRENT_ROOT_PATH"])) {
    if ($dh = @opendir($GLOBALS["CURRENT_ROOT_PATH"])) {
        closedir($dh);
    } else {
        $req01a = 'Fail';
    }
}
$req01b = $zip_count == 1 ? 'Pass' : 'Fail';
$req01 = $req01a == 'Pass' && $req01b == 'Pass' ? 'Pass' : 'Fail';