Esempio n. 1
0
function softdie($txt)
{
    $array = array();
    $array['settings'] = $GLOBALS['settings'];
    $array['can_create_file'] = can_create_file();
    $array['result'] = $txt;
    echo '<aefer>' . base64_encode(serialize($array)) . '</aefer>';
    die;
}
Esempio n. 2
0
// Set a Minimum Memory limit of 32 MB
soft_memory_limit(32);
// The Clock is ticking
$start_time = microtime_float();
// First Delete yourself !
@unlink(__FILE__);
// More has to be done here !
// Destination
$destination = GET('destination');
// The settings
$settings = unserialize(base64_decode('[[[settings]]]'));
$settings['site_diff_path'] = $settings['diff_path'];
// For publish's _pclzip.php compatibility
$_include = unserialize(base64_decode('[[[include]]]'));
$_exclude = unserialize(base64_decode('[[[exclude]]]'));
$can_write = can_create_file();
// Can we Create files ?
if (!$can_write) {
    $ftp = ampps_ftp('127.0.0.1', $settings['port'], $settings['ftp_user'], $settings['ftp_pass'], $settings['ftp_softpath'], base64_decode($settings['_public_key']), base64_decode($settings['_private_key']), $settings['passphrase']);
    if ($ftp <= 0) {
        // Try again with domain - Windows
        $ftp = ampps_ftp($settings['softdomain'], $settings['port'], $settings['ftp_user'], $settings['ftp_pass'], $settings['ftp_softpath'], base64_decode($settings['_public_key']), base64_decode($settings['_private_key']), $settings['passphrase']);
        if ($ftp <= 0) {
            softdie('f' . $ftp);
            // - Error unzipping
        }
    }
}
//Extract data.zip to softdatadir
if (!unzip(GET('zipfile'), GET('zipfile') == 'data.zip' ? $settings['softdatadir'] : (!empty($destination) ? $destination : $settings['softpath']), 1, $_include, $_exclude)) {
    softdie('4');