diff --git a/www/_include.php b/www/_include.php index 6b1c60f70d57357dc88fba711be263a06bc50704..90f15ef48e5eb553675db2081a5b02148ed2da33 100644 --- a/www/_include.php +++ b/www/_include.php @@ -33,11 +33,25 @@ ini_set('include_path', $path); /** - * If you have troubles with the ini_set method above, in example because you run on a hosted - * web hotel where this method is not allowed to call, comment out the three lines above, and instead - * uncomment this line: + * Class which should print a warning every time a reference to $SIMPLESAML_INCPREFIX is made. */ -//$SIMPLESAML_INCPREFIX = $path_extra . '/'; +class SimpleSAML_IncPrefixWarn { + + /** + * Print a warning, as a call to this function means that $SIMPLESAML_INCPREFIX is referenced. + * + * @return A blank string. + */ + function __toString() { + $backtrace = debug_backtrace(); + $where = $backtrace[0]['file'] . ':' . $backtrace[0]['line']; + error_log('Deprecated $SIMPLESAML_INCPREFIX still in use at ' . $where . + '. The simpleSAMLphp library now uses an autoloader.'); + return ''; + } +} +/* Set the $SIMPLESAML_INCPREFIX to a reference to the class. */ +$SIMPLESAML_INCPREFIX = new SimpleSAML_IncPrefixWarn(); $configdir = dirname(dirname(__FILE__)) . '/config';