diff options
author | Jaime Perez Crespo <jaime.perez@uninett.no> | 2016-02-26 11:05:03 +0100 |
---|---|---|
committer | Jaime Perez Crespo <jaime.perez@uninett.no> | 2016-02-26 11:06:54 +0100 |
commit | dd9facac9728f9bca710f8c745a2b3ec14c066a6 (patch) | |
tree | 12bf7ca8a7f30e50ce8339386be2477771faf97f /lib/SimpleSAML | |
parent | 2c050ee98dc0677547e4cf5cd917db9e3af45fe9 (diff) | |
download | simplesamlphp-dd9facac9728f9bca710f8c745a2b3ec14c066a6.zip simplesamlphp-dd9facac9728f9bca710f8c745a2b3ec14c066a6.tar.gz simplesamlphp-dd9facac9728f9bca710f8c745a2b3ec14c066a6.tar.bz2 |
Move the SimpleSAML_Logger class to SimpleSAML\Logger.
Diffstat (limited to 'lib/SimpleSAML')
-rw-r--r-- | lib/SimpleSAML/Logger.php | 22 | ||||
-rw-r--r-- | lib/SimpleSAML/Metadata/SAMLParser.php | 6 |
2 files changed, 15 insertions, 13 deletions
diff --git a/lib/SimpleSAML/Logger.php b/lib/SimpleSAML/Logger.php index f505a43..07a6fc4 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 82b912d..02e6e91 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; } } |