Whoops, it looks like you have an invalid PHP version.

Magento supports PHP 5.3.0 or newer. Find out how to install Magento using PHP-CGI as a work-around.

'; exit; } /** * Error reporting */ error_reporting(E_ERROR); /*register_shutdown_function("fatal_handler"); function fatal_handler() { $error = error_get_last(); // echo("
");
    print_r($error);
}*/
// IP autorizzati a vedere il sito anche in manutenzione
$allowedIps = array(
    '217.61.165.145',
);

// Recupero IP reale (dietro proxy)
// Prima HTTP_X_FORWARDED_FOR, altrimenti REMOTE_ADDR
$clientIp = '';

if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
    // Può contenere più IP separati da virgola
    $parts = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);
    $clientIp = trim($parts[0]);
} elseif (!empty($_SERVER['REMOTE_ADDR'])) {
    $clientIp = $_SERVER['REMOTE_ADDR'];
}

// Se esiste il file maintenance.flag e l'IP non è tra quelli consentiti → mostra manutenzione
if (file_exists(__DIR__ . '/maintenance.flag') && !in_array($clientIp, $allowedIps, true)) {
    header('HTTP/1.1 503 Service Unavailable');
    header('Status: 503 Service Unavailable');
    header('Retry-After: 3600'); // opzionale

    // Pagina di manutenzione personalizzata (opzionale)
    $maintenanceFile = __DIR__ . '/maintenance.html';
    if (file_exists($maintenanceFile)) {
        readfile($maintenanceFile);
    } else {
        echo 'Sito in manutenzione. Riprova più tardi.';
    }
    exit;
}

// Da qui in poi il normale bootstrap della tua applicazione
// require 'bootstrap.php';
// ...



/**
 * Compilation includes configuration file
 */
define('MAGENTO_ROOT', getcwd());

$compilerConfig = MAGENTO_ROOT . '/includes/config.php';
if (file_exists($compilerConfig)) {
    include $compilerConfig;
}

$mageFilename = MAGENTO_ROOT . '/app/Mage.php';
$maintenanceFile = 'maintenance.flag';
if (!file_exists($mageFilename)) {
    if (is_dir('downloader')) {
        header("Location: downloader");
    } else {
        echo $mageFilename." was not found";
    }
    exit;
}

if (file_exists($maintenanceFile)) {
    include_once dirname(__FILE__) . '/errors/503.php';
    exit;
}

require_once $mageFilename;

//Varien_Profiler::enable();

if (isset($_SERVER['MAGE_IS_DEVELOPER_MODE'])) {
    Mage::setIsDeveloperMode(true);
}

ini_set('display_errors', 1);
// Mage::setIsDeveloperMode(true);

umask(0);

/* Store or website code */
$mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : '';

/* Run store or run website */
$mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE'] : 'store';
$mageRunCode='default';
Mage::run($mageRunCode, $mageRunType);