Example #1
0
<?php

/**
 * @package        Arastta eCommerce
 * @copyright      Copyright (C) 2015 Arastta Association. All rights reserved. (arastta.org)
 * @credits        See CREDITS.txt for credits and other copyright notices.
 * @license        GNU General Public License version 3; see LICENSE.txt
 */
// Installation check, and check on removal of the install directory.
if ((!file_exists(DIR_ROOT . 'config.php') || filesize(DIR_ROOT . 'config.php') < 10) && !Client::isInstall() && !Client::isCli()) {
    if (file_exists(DIR_INSTALL . 'index.php')) {
        header('Location: ' . str_replace(array('admin', 'index.php', '//'), array('', '', '/'), $_SERVER['REQUEST_URI']) . 'install/index.php');
        exit;
    } else {
        die('No configuration file found and no installation code available. Exiting...');
    }
}
// Error Reporting
error_reporting(E_ALL);
// Check Version
if (version_compare(PHP_VERSION, '5.3.10', '<')) {
    die('Your host needs to use PHP 5.3.10 or higher to run Arastta.');
}
if (!ini_get('date.timezone')) {
    date_default_timezone_set('UTC');
}
// Windows IIS Compatibility
if (!isset($_SERVER['DOCUMENT_ROOT'])) {
    if (isset($_SERVER['SCRIPT_FILENAME'])) {
        $_SERVER['DOCUMENT_ROOT'] = str_replace('\\', '/', substr($_SERVER['SCRIPT_FILENAME'], 0, 0 - strlen($_SERVER['PHP_SELF'])));
    }