<?php

if(!ini_get('date.timezone')) date_default_timezone_set('GMT');


if(!file_exists('config.php')){
    $protocol = "http" .((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") ? "s" : "") . "://";
    $server   = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME'];
    $basename = preg_replace('@/+$@','',dirname($_SERVER['SCRIPT_NAME'])).'/';
    $url = $protocol . $server . $basename;

    header('Location: '.$url.'setup/pre-install.php');
    die;
}

/*
 *---------------------------------------------------------------
 * SYSTEM CHECK
 *---------------------------------------------------------------
 *
 */

if(version_compare(PHP_VERSION, '5.4.0', '<'))
{
    die('The Facebook SDK v4 requires PHP version 5.4 or higher.');
}

if(!function_exists('mb_substr'))
{
    die('Function mb_substr() does not exist. Please activate the function on your hosting.');
}


include_once 'config.php';

header('Location: app/index.php');