diff -r dc6026376919 -r 5bd429428101 includes/common.php --- a/includes/common.php Wed Jan 23 12:48:22 2008 -0500 +++ b/includes/common.php Thu Jan 24 22:06:09 2008 -0500 @@ -121,6 +121,8 @@ strip_magic_quotes_gpc(); +profiler_log('Files included and magic_quotes_gpc reversed if applicable'); + // Enano has five main components: the database abstraction layer (DBAL), the session manager, // the path/URL manager, the template engine, and the plugin manager. // Each part has its own class and a global object; nearly all Enano functions are handled by one of these five components. @@ -163,6 +165,8 @@ $db = new $dbdriver(); $db->connect(); +profiler_log('Database connected'); + // The URL separator is the character appended to contentPath + url_title type strings. // If the contentPath has a ? in it, this should be an ampersand; else, it should be a // question mark. @@ -203,6 +207,8 @@ $db->free_result(); +profiler_log('Config fetched'); + // Now that we have the config, check the Enano version. if ( enano_version(false, true) != $version && !defined('IN_ENANO_UPGRADE') ) { @@ -240,7 +246,7 @@ } // Is there no default language? -if ( getConfig('lang_default') === false && !defined('IN_ENANO_MIGRATION') ) +if ( getConfig('default_language') === false && !defined('IN_ENANO_MIGRATION') ) { $q = $db->sql_query('SELECT lang_id FROM '.table_prefix.'language LIMIT 1;'); if ( !$q ) @@ -260,6 +266,8 @@ setConfig('default_language', $row['lang_id']); } +profiler_log('Ran checks'); + // Load plugin manager $plugins = new pluginLoader(); @@ -278,12 +286,16 @@ include_once $f; } +profiler_log('Loaded plugins'); + // Three fifths of the Enano API gets the breath of life right here. $session = new sessionManager(); $paths = new pathManager(); $template = new template(); $email = new EmailEncryptor(); +profiler_log('Instanciated important singletons'); + // We've got the five main objects - flick on the switch so if a problem occurs, we can have a "friendly" UI define('ENANO_BASE_CLASSES_INITIALIZED', ''); @@ -301,6 +313,8 @@ eval($cmd); } + profiler_log('Finished base_classes_initted hook'); + // For special and administration pages, sometimes there is a "preloader" function that must be run // before the session manager and/or path manager get the init signal. Call it here. $p = RenderMan::strToPageId($paths->get_pageid_from_url()); @@ -309,6 +323,8 @@ @call_user_func('page_'.$p[1].'_'.$p[0].'_preloader'); } + profiler_log('Checked for preloader'); + // One quick security check... if ( !is_valid_ip($_SERVER['REMOTE_ADDR']) ) { @@ -328,6 +344,8 @@ eval($cmd); } + profiler_log('Ran session_started hook'); + $paths->init(); // We're ready for whatever life throws us now. @@ -369,10 +387,14 @@ eval($cmd); } + profiler_log('Ran disabled-site checks and common_post'); + if ( isset($_GET['noheaders']) ) $template->no_headers = true; } +profiler_log('common finished'); + // That's the end. Enano should be loaded now :-) ?>