<?php
define("LMPIC_VERSION","ver 4.0");
if(file_exists("install/index.php")&&!file_exists("install/install.lock")){
 	die("<script language='javascript'> window.location='install/index.php';</script>");
}
define('BASEURI','/myproject/lmcms4-2-3/index.php/');            
define('IN_PRODUCTION', FALSE);
$kohana_application		= 'app';
$kohana_modules			= 'modules';
$kohana_system			= 'system';
version_compare(PHP_VERSION, '5.2', '<') and exit('LMCMS requires PHP 5.2 or newer.');
error_reporting(E_ALL & ~E_STRICT);
ini_set('display_errors', TRUE);
define('EXT', '.php');
define('DOCROOT', dirname(realpath(__FILE__))."/");
define('KOHANA',  __FILE__);
is_link(KOHANA) and chdir(dirname(realpath(__FILE__)));
define('APPPATH',str_replace('\\', '/', DOCROOT.$kohana_application).'/');
define('MODPATH',str_replace('\\', '/', DOCROOT.$kohana_modules).'/');
define('SYSPATH',str_replace('\\', '/', DOCROOT.$kohana_system).'/');
define("DATADIR",str_replace('\\', '/', DOCROOT."data").'/');
unset($kohana_application, $kohana_modules, $kohana_system);
if ( ! IN_PRODUCTION)
{
	// Check APPPATH
	if ( ! (is_dir(APPPATH) AND is_file(APPPATH.'config/config'.EXT)))
	{
		die
		(
			'<div style="width:80%;margin:50px auto;text-align:center;">'.
				'<h3>Application Directory Not Found</h3>'.
				'<p>The <code>$kohana_application</code> directory does not exist.</p>'.
				'<p>Set <code>$kohana_application</code> in <tt>'.KOHANA.'</tt> to a valid directory and refresh the page.</p>'.
			'</div>'
		);
	}

	// Check SYSPATH
	if ( ! (is_dir(SYSPATH) AND is_file(SYSPATH.'core/Bootstrap'.EXT)))
	{
		die
		(
			'<div style="width:80%;margin:50px auto;text-align:center;">'.
				'<h3>System Directory Not Found</h3>'.
				'<p>The <code>$kohana_system</code> directory does not exist.</p>'.
				'<p>Set <code>$kohana_system</code> in <tt>'.KOHANA.'</tt> to a valid directory and refresh the page.</p>'.
			'</div>'
		);
	}
}

// Initialize.
require SYSPATH.'core/Bootstrap'.EXT;