Skip to content

Instantly share code, notes, and snippets.

@stefanheimes
Created October 23, 2013 13:43
Show Gist options
  • Save stefanheimes/7119030 to your computer and use it in GitHub Desktop.
Save stefanheimes/7119030 to your computer and use it in GitHub Desktop.
Search the initialize.php . Special feature for symlinks.
<?php
/**
* Initialize the system
*/
$dir = dirname(isset($_SERVER['SCRIPT_FILENAME']) ? $_SERVER['SCRIPT_FILENAME'] : __FILE__);
while ($dir && $dir != '.' && $dir != '/' && !is_file($dir . '/system/initialize.php')) {
$dir = dirname($dir);
}
if (!is_file($dir . '/system/initialize.php')) {
header("HTTP/1.0 500 Internal Server Error");
header('Content-Type: text/html; charset=utf-8');
echo '<h1>500 Internal Server Error</h1>';
echo '<p>Could not find initialize.php!</p>';
exit(1);
}
define('TL_MODE', 'BE');
require($dir . '/system/initialize.php');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment