use one path file for cronjobs and normal usage. Adjust the config.inc.php (because it may not include path.inc.php itself)

main
hecht 13 years ago
parent fc8dfae658
commit a7ca637692

@ -12,7 +12,6 @@
*/ */
// Immer den ganzen Pfad angeben, dann hat man es einfacher ^^ // Immer den ganzen Pfad angeben, dann hat man es einfacher ^^
include_once('../path.inc.php'); // get the path ;)
include_once (ROOT_PATH . '/include/config/db.inc.php'); include_once (ROOT_PATH . '/include/config/db.inc.php');
include_once (ROOT_PATH . '/include/config/server.inc.php'); include_once (ROOT_PATH . '/include/config/server.inc.php');
include_once (ROOT_PATH . '/include/config/settings.inc.php'); include_once (ROOT_PATH . '/include/config/settings.inc.php');

@ -4,20 +4,29 @@
// okay and now define the url ;) // okay and now define the url ;)
if(!defined('ROOT_PATH')) { if(!defined('ROOT_PATH')) {
if(isset($_SERVER['SCRIPT_FILENAME'])) {
$actual_path = $_SERVER['SCRIPT_FILENAME']; $actual_path = $_SERVER['SCRIPT_FILENAME'];
$url_path = $_SERVER['SCRIPT_NAME' ]; $url_path = $_SERVER['SCRIPT_NAME' ];
//s echo $actual_path .'<br>'; } else {
$actual_path = __FILE__;
$url_path = NULL;
}
// okay this is the script that has included us :) -> lets search for the include/config/ directory // okay this is the script that has included us :) -> lets search for the include/config/ directory
while(strlen($actual_path) > 0) { while(strlen($actual_path) > 0) {
$actual_path = substr($actual_path,0,strrpos($actual_path,'/')); $actual_path = substr($actual_path,0,strrpos($actual_path,'/'));
if($url_path != null) {
$url_path = substr($url_path,0,strrpos($url_path,'/')); $url_path = substr($url_path,0,strrpos($url_path,'/'));
}
if(is_dir($actual_path . '/include/config')) { if(is_dir($actual_path . '/include/config')) {
define('ROOT_PATH', $actual_path); define('ROOT_PATH', $actual_path);
if($url_path != null) {
define('ROOT_URL', $url_path); define('ROOT_URL', $url_path);
} else {
define('ROOT_URL', '/ag'); // --> currently no support for cronjobs
}
} }
} }
} }
?> ?>

Loading…
Cancel
Save