Skip to content

Commit

Permalink
Tweak index.php doc.
Browse files Browse the repository at this point in the history
Signed-off-by: Norv <a.w.norv@gmail.com>
  • Loading branch information
norv committed Apr 1, 2013
1 parent b079fec commit fd594e8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
23 changes: 13 additions & 10 deletions index.php
Expand Up @@ -21,25 +21,26 @@

$forum_version = 'ELKARTE 1.0 Alpha';

// Get everything started up...
// First things first, but not necessarily in that order.
define('ELKARTE', 1);

if (function_exists('set_magic_quotes_runtime'))
@set_magic_quotes_runtime(0);
error_reporting(defined('E_STRICT') ? E_ALL | E_STRICT : E_ALL);
$time_start = microtime(true);

// This makes it so headers can be sent!
// Turn on output buffering.
ob_start();

// Do some cleaning, just in case.
// We don't need no globals.
foreach (array('db_character_set', 'cachedir') as $variable)
if (isset($GLOBALS[$variable]))
unset($GLOBALS[$variable], $GLOBALS[$variable]);

// Load the settings...
// Ready to load the site settings.
require_once(dirname(__FILE__) . '/Settings.php');

// Make absolutely sure the new directories are defined.
// Double-check that directories which didn't exist in past releases are initialized.
if ((empty($cachedir) || !file_exists($cachedir)) && file_exists($boarddir . '/cache'))
$cachedir = $boarddir . '/cache';

Expand All @@ -55,7 +56,7 @@
DEFINE('SUBSDIR', $sourcedir . '/subs');
unset($boarddir, $cachedir, $sourcedir);

// And important includes.
// Files we cannot live without.
require_once(SOURCEDIR . '/QueryString.php');
require_once(SOURCEDIR . '/Session.php');
require_once(SOURCEDIR . '/Subs.php');
Expand All @@ -67,7 +68,7 @@
require_once(SOURCEDIR . '/BrowserDetect.class.php');
require_once(SOURCEDIR . '/Errors.class.php');

// If $maintenance is set specifically to 2, then we're upgrading or something.
// Forum in extended maintenance mode? Our trip ends here with a bland message.
if (!empty($maintenance) && $maintenance == 2)
display_maintenance_message();

Expand All @@ -77,11 +78,13 @@
// Initiate the database connection and define some database functions to use.
loadDatabase();

// Load the settings from the settings table, and perform operations like optimizing.
// It's time for settings loaded from the database.
reloadSettings();

// Clean the request variables, add slashes, etc.
// Clean the request!
cleanRequest();

// Our good ole' contextual array, which will hold everything
$context = array();

// Seed the random generator.
Expand Down Expand Up @@ -174,7 +177,7 @@ function elk_main()
// Do some logging, unless this is an attachment, avatar, toggle of editor buttons, theme option, XML feed etc.
if (empty($_REQUEST['action']) || !in_array($_REQUEST['action'], $no_stat_actions))
{
// Log this user as online.
// I see you!
writeLog();

// Track forum statistics and hits...?
Expand Down
7 changes: 6 additions & 1 deletion sources/Subs.php
Expand Up @@ -4131,7 +4131,7 @@ function fixchar__callback($matches)
* strpos, strlen, substr etc
*
* @param array $matches
* @return string $string
* @return string
*/
function entity_fix__callback($matches)
{
Expand All @@ -4147,6 +4147,11 @@ function entity_fix__callback($matches)
return '&#' . $num . ';';
}

/**
* Retrieve additional search engines, if there are any,as an array.
*
* @return array array of engines
*/
function prepareSearchEngines()
{
global $modSettings;
Expand Down

0 comments on commit fd594e8

Please sign in to comment.