diff --git a/lib/SimpleSAML/Logger.php b/lib/SimpleSAML/Logger.php index f505a4339c2bd7a595d3365b0be0efe60eef72dd..07a6fc4941f1e9c48b9a030cade3164eb752d0c3 100644 --- a/lib/SimpleSAML/Logger.php +++ b/lib/SimpleSAML/Logger.php @@ -1,5 +1,7 @@ <?php +namespace SimpleSAML; + /** * The main logger class for SimpleSAMLphp. @@ -10,11 +12,11 @@ * @package SimpleSAMLphp * @version $ID$ */ -class SimpleSAML_Logger +class Logger { /** - * @var SimpleSAML_Logger_LoggingHandler|false|null + * @var \SimpleSAML_Logger_LoggingHandler|false|null */ private static $loggingHandler = null; @@ -264,7 +266,7 @@ class SimpleSAML_Logger */ public static function flush() { - $s = SimpleSAML_Session::getSessionFromRequest(); + $s = \SimpleSAML_Session::getSessionFromRequest(); self::$trackid = $s->getTrackID(); self::$shuttingDown = true; @@ -333,7 +335,7 @@ class SimpleSAML_Logger // register a shutdown handler if needed if (!self::$shutdownRegistered) { - register_shutdown_function(array('SimpleSAML_Logger', 'flush')); + register_shutdown_function(array('SimpleSAML\Logger', 'flush')); self::$shutdownRegistered = true; } } @@ -344,8 +346,8 @@ class SimpleSAML_Logger self::$loggingHandler = false; // get the configuration - $config = SimpleSAML_Configuration::getInstance(); - assert($config instanceof SimpleSAML_Configuration); + $config = \SimpleSAML_Configuration::getInstance(); + assert($config instanceof \SimpleSAML_Configuration); // get the metadata handler option from the configuration $handler = $config->getString('logging.handler', 'syslog'); @@ -356,13 +358,13 @@ class SimpleSAML_Logger $handler = strtolower($handler); if ($handler === 'syslog') { - $sh = new SimpleSAML_Logger_LoggingHandlerSyslog(); + $sh = new \SimpleSAML_Logger_LoggingHandlerSyslog(); } elseif ($handler === 'file') { - $sh = new SimpleSAML_Logger_LoggingHandlerFile(); + $sh = new \SimpleSAML_Logger_LoggingHandlerFile(); } elseif ($handler === 'errorlog') { - $sh = new SimpleSAML_Logger_LoggingHandlerErrorLog(); + $sh = new \SimpleSAML_Logger_LoggingHandlerErrorLog(); } else { - throw new Exception( + throw new \Exception( 'Invalid value for the [logging.handler] configuration option. Unknown handler: '.$handler ); } diff --git a/lib/SimpleSAML/Metadata/SAMLParser.php b/lib/SimpleSAML/Metadata/SAMLParser.php index 82b912db46ebf1d6760604a17e5f15293266f5cb..02e6e91c44ff9ccdca0f9abcca8e23a087b03e36 100644 --- a/lib/SimpleSAML/Metadata/SAMLParser.php +++ b/lib/SimpleSAML/Metadata/SAMLParser.php @@ -1042,7 +1042,7 @@ class SimpleSAML_Metadata_SAMLParser // Registration Authority cannot be overridden (warn only if override attempts to change the value) if (isset($ret['RegistrationInfo']['registrationAuthority']) && $ret['RegistrationInfo']['registrationAuthority'] !== $e->registrationAuthority) { - SimpleSAML_Logger::warning('Invalid attempt to override registrationAuthority \'' + SimpleSAML\Logger::warning('Invalid attempt to override registrationAuthority \'' . $ret['RegistrationInfo']['registrationAuthority'] . "' with '{$e->registrationAuthority}'"); } else { $ret['RegistrationInfo']['registrationAuthority'] = $e->registrationAuthority; @@ -1465,7 +1465,7 @@ class SimpleSAML_Metadata_SAMLParser } } } - SimpleSAML_Logger::debug('Could not validate signature'); + SimpleSAML\Logger::debug('Could not validate signature'); return false; } @@ -1496,7 +1496,7 @@ class SimpleSAML_Metadata_SAMLParser } } } - SimpleSAML_Logger::debug('Fingerprint was ['.$fingerprint.'] not one of ['.join(', ', $candidates).']'); + SimpleSAML\Logger::debug('Fingerprint was ['.$fingerprint.'] not one of ['.join(', ', $candidates).']'); return false; } } diff --git a/lib/_autoload_modules.php b/lib/_autoload_modules.php index 71cebf8ecf99b16c1f9764685c443dccf47807b7..e17c187dd0f85455a5ec46c0c90803d2983b3395 100644 --- a/lib/_autoload_modules.php +++ b/lib/_autoload_modules.php @@ -26,7 +26,7 @@ function temporaryLoader($class) $path = explode('_', $class); $new = join('\\', $path); if (class_exists($new, false)) { - SimpleSAML_Logger::warning("The class '$class' is now using namespaces, please use '$new'."); + SimpleSAML\Logger::warning("The class '$class' is now using namespaces, please use '$new'."); class_alias($new, $class); } diff --git a/www/_include.php b/www/_include.php index 875559d1d0cca2220ec4ee545600d94aee2061c4..f587766c726bcaf3d4f72678aa552796fcbc941c 100644 --- a/www/_include.php +++ b/www/_include.php @@ -50,7 +50,7 @@ set_exception_handler('SimpleSAML_exception_handler'); // log full backtrace on errors and warnings function SimpleSAML_error_handler($errno, $errstr, $errfile = null, $errline = 0, $errcontext = null) { - if (!class_exists('SimpleSAML_Logger')) { + if (!class_exists('SimpleSAML\Logger')) { /* We are probably logging a deprecation-warning during parsing. Unfortunately, the autoloader is disabled at * this point, so we should stop here. * @@ -59,7 +59,7 @@ function SimpleSAML_error_handler($errno, $errstr, $errfile = null, $errline = 0 return false; } - if (SimpleSAML_Logger::isErrorMasked($errno)) { + if (SimpleSAML\Logger::isErrorMasked($errno)) { // masked error return false; }