" . PUBLIC_FOLDER . "/install folder and follow installation procedure"; die(); } // if // --------------------------------------------------- // config.php + extended config // --------------------------------------------------- define('PRODUCT_NAME', 'ProjectPier'); if(!defined('PRODUCT_VERSION')) { define('PRODUCT_VERSION', '0.8'); } // if define('MAX_SEARCHABLE_FILE_SIZE', 1048576); // if file type is searchable script will load its content into search index. Using this constant you can set the max filesize of the file that will be imported. Noone wants 500MB in search index for single file define('SESSION_LIFETIME', 3600); define('REMEMBER_LOGIN_LIFETIME', 1209600); // two weeks // Defaults define('DEFAULT_CONTROLLER', 'dashboard'); define('DEFAULT_ACTION', 'index'); define('DEFAULT_THEME', 'default'); // Default cookie settings... define('COOKIE_PATH', '/'); define('COOKIE_DOMAIN', ''); define('COOKIE_SECURE', false); // --------------------------------------------------- // Init... // --------------------------------------------------- include_once 'environment/environment.php'; // Lets prepare everything for autoloader require APPLICATION_PATH . '/functions.php'; // __autoload() function is defined here... @include ROOT . '/cache/autoloader.php'; // Prepare logger... We might need it early... if(!Env::isDebugging()) { Logger::setSession(new Logger_Session('default')); Logger::setBackend(new Logger_Backend_File(CACHE_DIR . '/log.php')); set_error_handler('__production_error_handler'); set_exception_handler('__production_exception_handler'); } // if register_shutdown_function('__shutdown'); // Connect to database... try { DB::connect(DB_ADAPTER, array( 'host' => DB_HOST, 'user' => DB_USER, 'pass' => DB_PASS, 'name' => DB_NAME, 'persist' => DB_PERSIST )); // connect if(defined('DB_CHARSET') && trim(DB_CHARSET)) { DB::execute("SET NAMES ?", DB_CHARSET); } // if } catch(Exception $e) { if(Env::isDebugging()) { Env::dumpError($e); } else { Logger::log($e, Logger::FATAL); Env::executeAction('error', 'db_connect'); } // if } // try // Init application if(Env::isDebugging()) { benchmark_timer_set_marker('Init application'); } // if // We need to call application.php after the routing is executed because // some of the application classes may need CONTROLLER, ACTION or $_GET // data collected by the matched route require_once 'application.php'; // Set handle request timer... if(Env::isDebugging()) { benchmark_timer_set_marker('Handle request'); } // if // Get controller and action and execute... try { Env::executeAction(request_controller(), request_action()); } catch(Exception $e) { if(Env::isDebugging()) { Env::dumpError($e); } else { Logger::log($e, Logger::FATAL); redirect_to(get_url('error', 'execute_action')); } // if } // try ?>