Exemplo n.º 1
0
global $logger;
$logger = new Logger();
$timer->logTime("Read Config");
if ($configArray['System']['debug']) {
    ini_set('display_errors', true);
    error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT);
}
//Use output buffering to allow session cookies to have different values
// this can't be determined before session_start is called
ob_start();
initMemcache();
initDatabase();
requireSystemLibraries();
initLocale();
// Sets global error handler for PEAR errors
PEAR_Singleton::setErrorHandling(PEAR_ERROR_CALLBACK, 'handlePEARError');
loadLibraryAndLocation();
loadSearchInformation();
$timer->logTime('Bootstrap');
function initMemcache()
{
    //Connect to memcache
    /** @var Memcache $memCache */
    global $memCache;
    global $timer;
    global $configArray;
    // Set defaults if nothing set in config file.
    $host = isset($configArray['Caching']['memcache_host']) ? $configArray['Caching']['memcache_host'] : 'localhost';
    $port = isset($configArray['Caching']['memcache_port']) ? $configArray['Caching']['memcache_port'] : 11211;
    $timeout = isset($configArray['Caching']['memcache_connection_timeout']) ? $configArray['Caching']['memcache_connection_timeout'] : 1;
    // Connect to Memcache: