Exemple #1
0
}
// Find the URL of this script
if (isset($_FILE_TO_URL_MAPPING)) {
    $fullPath = $testPath = $_SERVER['SCRIPT_FILENAME'];
    while ($testPath && $testPath != "/") {
        if (isset($_FILE_TO_URL_MAPPING[$testPath])) {
            $url = $_FILE_TO_URL_MAPPING[$testPath] . substr($fullPath, strlen($testPath));
            $_SERVER['HTTP_HOST'] = parse_url($url, PHP_URL_HOST);
            $_SERVER['SCRIPT_NAME'] = parse_url($url, PHP_URL_PATH);
            $_SERVER['REQUEST_PORT'] = parse_url($url, PHP_URL_PORT);
            break;
        }
        $testPath = dirname($testPath);
    }
}
if (ManifestBuilder::staleManifest()) {
    ManifestBuilder::compileManifest();
}
require_once MANIFEST_FILE;
if (isset($_GET['debugmanifest'])) {
    Debug::show(file_get_contents(MANIFEST_FILE));
}
if (!isset(Director::$environment_type)) {
    Director::set_environment_type($envType);
}
// Default director
Director::addRules(10, array('Security/$Action' => 'Security', 'db/$Action' => 'DatabaseAdmin', '$Controller/$Action/$ID/$OtherID' => '*', 'images/$Action/$Class/$ID/$Field' => 'Image_Uploader', '' => '->home/', '$URLSegment/$Action/$ID/$OtherID' => 'ModelAsController'));
// Load error handlers
Debug::loadErrorHandlers();
// Connect to database
require_once "core/model/DB.php";