<?php
/**
 * Installer
 * 
 * Tool to deploy Linea21 in few steps with UI
 * 
 * @package linea21\externals\Installer
 * @author $Author$ - Vadim V. Gabriel <vadimg88@gmail.com> http://www.vadimg.co.il/ - modified by Simon Georget <simon@linea21.com>
 * @link http://absynthe.is.free.fr/aFiles/
 * @version $Id$ 1.0.0a
 * @license GNU Lesser General Public License
 */

$installation_process = true; // necessary for test in /config/define.php
include_once("../config/define.php");

include_once('../lib/input_helpers.php');

# Define root path
define('ROOT_PATH', dirname(__FILE__));

define('INSTALLER_PATH', dirname(__FILE__) . DIRECTORY_SEPARATOR . 'installer');

# Define templates path
if(!defined('TMPL_PATH'))
{
  define('TMPL_PATH', INSTALLER_PATH . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR);
}

# Define base url
is_https() ? $protocol = 'https://' : $protocol = 'http://';
define('BASE_URL', $protocol . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME']);

# Default step
$_POST['step'] = isset($_POST['step']) ? $_POST['step'] : 'index';
require_once(INSTALLER_PATH . '/Installer.php');
$installer = new Installer();
$installer->display();

# Done!