Skip to content
Snippets Groups Projects
Commit 14a8660e authored by Olav Morken's avatar Olav Morken
Browse files

Replace the $SIMPLESAML_INCPREFIX variable with a objects which prints a warning if it is accessed.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@612 44740490-163a-0410-bde0-09ae8108e29a
parent 057c7c46
No related branches found
No related tags found
No related merge requests found
...@@ -33,11 +33,25 @@ ini_set('include_path', $path); ...@@ -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 * Class which should print a warning every time a reference to $SIMPLESAML_INCPREFIX is made.
* web hotel where this method is not allowed to call, comment out the three lines above, and instead
* uncomment this line:
*/ */
//$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'; $configdir = dirname(dirname(__FILE__)) . '/config';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment