Beispiel #1
0
function phabricator_startup()
{
    // Load the PhabricatorStartup class itself.
    $t_startup = microtime(true);
    $root = dirname(dirname(__FILE__));
    require_once $root . '/support/PhabricatorStartup.php';
    // If the preamble script exists, load it.
    $t_preamble = microtime(true);
    $preamble_path = $root . '/support/preamble.php';
    if (file_exists($preamble_path)) {
        require_once $preamble_path;
    }
    $t_hook = microtime(true);
    PhabricatorStartup::didStartup($t_startup);
    PhabricatorStartup::recordStartupPhase('startup.init', $t_startup);
    PhabricatorStartup::recordStartupPhase('preamble', $t_preamble);
    PhabricatorStartup::recordStartupPhase('hook', $t_hook);
}
Beispiel #2
0
<?php

$phabricator_root = dirname(dirname(__FILE__));
require_once $phabricator_root . '/support/PhabricatorStartup.php';
// If the preamble script exists, load it.
$preamble_path = $phabricator_root . '/support/preamble.php';
if (file_exists($preamble_path)) {
    require_once $preamble_path;
}
PhabricatorStartup::didStartup();
$show_unexpected_traces = false;
try {
    PhabricatorStartup::loadCoreLibraries();
    PhabricatorEnv::initializeWebEnvironment();
    $show_unexpected_traces = PhabricatorEnv::getEnvConfig('phabricator.developer-mode');
    // This is the earliest we can get away with this, we need env config first.
    PhabricatorAccessLog::init();
    $access_log = PhabricatorAccessLog::getLog();
    PhabricatorStartup::setGlobal('log.access', $access_log);
    $access_log->setData(array('R' => AphrontRequest::getHTTPHeader('Referer', '-'), 'r' => idx($_SERVER, 'REMOTE_ADDR', '-'), 'M' => idx($_SERVER, 'REQUEST_METHOD', '-')));
    DarkConsoleXHProfPluginAPI::hookProfiler();
    DarkConsoleErrorLogPluginAPI::registerErrorHandler();
    $sink = new AphrontPHPHTTPSink();
    $response = PhabricatorSetupCheck::willProcessRequest();
    if ($response) {
        PhabricatorStartup::endOutputCapture();
        $sink->writeResponse($response);
        return;
    }
    $host = AphrontRequest::getHTTPHeader('Host');
    $path = $_REQUEST['__path__'];