Skip to content

Instantly share code, notes, and snippets.

@BugBuster1701
Created May 13, 2014 09:59
Show Gist options
  • Save BugBuster1701/4b7a1fafe59fd65fd656 to your computer and use it in GitHub Desktop.
Save BugBuster1701/4b7a1fafe59fd65fd656 to your computer and use it in GitHub Desktop.
Contao und dynamischer Pfad für die Initialisierung
<?php
/*
* Damit ist es egal ob das Modul von composer normal als ZIP geladen und entpackt wird
* oder per git clone und dynamischen links, wodurch die Verzeichnisebene eine andere wird
*/
/**
* Initialize the system
*/
$dir = __DIR__;
while ($dir != '.' && $dir != '/' && !is_file($dir . '/system/initialize.php'))
{
$dir = dirname($dir);
}
if (!is_file($dir . '/system/initialize.php'))
{
echo 'Could not find initialize.php!';
exit(1);
}
define('TL_MODE', 'BE');
require($dir . '/system/initialize.php');
//weiter im Quelltext, z.B. die runonce
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment