From 5afa4f8a5e9c2b6f74b384d992d2656709051141 Mon Sep 17 00:00:00 2001 From: Jaime Perez Crespo <jaime.perez@uninett.no> Date: Mon, 20 Apr 2015 16:28:18 +0200 Subject: [PATCH] Move SimpleSAML_Utils_System to SimpleSAML\Utils\System. --- lib/SimpleSAML/Bindings/Shib13/Artifact.php | 4 ++-- lib/SimpleSAML/Logger/LoggingHandlerSyslog.php | 2 +- lib/SimpleSAML/Utilities.php | 12 ++++++------ lib/SimpleSAML/Utils/System.php | 4 ++-- modules/metarefresh/lib/MetaLoader.php | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/SimpleSAML/Bindings/Shib13/Artifact.php b/lib/SimpleSAML/Bindings/Shib13/Artifact.php index 649d7905c..5f5ce01f5 100644 --- a/lib/SimpleSAML/Bindings/Shib13/Artifact.php +++ b/lib/SimpleSAML/Bindings/Shib13/Artifact.php @@ -137,9 +137,9 @@ class SimpleSAML_Bindings_Shib13_Artifact { "-----END CERTIFICATE-----\n"; } - $file = SimpleSAML_Utils_System::getTempDir() . DIRECTORY_SEPARATOR . sha1($certData) . '.crt'; + $file = SimpleSAML\Utils\System::getTempDir() . DIRECTORY_SEPARATOR . sha1($certData) . '.crt'; if (!file_exists($file)) { - SimpleSAML_Utils_System::writeFile($file, $certData); + SimpleSAML\Utils\System::writeFile($file, $certData); } $spKeyCertFile = SimpleSAML_Utilities::resolveCert($spMetadata->getString('privatekey')); diff --git a/lib/SimpleSAML/Logger/LoggingHandlerSyslog.php b/lib/SimpleSAML/Logger/LoggingHandlerSyslog.php index 04c3711ac..6b8abef9d 100644 --- a/lib/SimpleSAML/Logger/LoggingHandlerSyslog.php +++ b/lib/SimpleSAML/Logger/LoggingHandlerSyslog.php @@ -27,7 +27,7 @@ class SimpleSAML_Logger_LoggingHandlerSyslog implements SimpleSAML_Logger_Loggin $processname = $config->getString('logging.processname', 'simpleSAMLphp'); // Setting facility to LOG_USER (only valid in Windows), enable log level rewrite on windows systems. - if (SimpleSAML_Utils_System::getOS() === SimpleSAML_Utils_System::WINDOWS) { + if (SimpleSAML\Utils\System::getOS() === SimpleSAML\Utils\System::WINDOWS) { $this->isWindows = TRUE; $facility = LOG_USER; } diff --git a/lib/SimpleSAML/Utilities.php b/lib/SimpleSAML/Utilities.php index 92b2fda3c..247019e4b 100644 --- a/lib/SimpleSAML/Utilities.php +++ b/lib/SimpleSAML/Utilities.php @@ -1321,18 +1321,18 @@ class SimpleSAML_Utilities { } /** - * @deprecated This method will be removed in SSP 2.0. Please use SimpleSAML_Utils_System::writeFile() instead. + * @deprecated This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\System::writeFile() instead. */ public static function writeFile($filename, $data, $mode=0600) { - return SimpleSAML_Utils_System::writeFile($filename, $data, $mode); + return SimpleSAML\Utils\System::writeFile($filename, $data, $mode); } /** - * @deprecated This method will be removed in SSP 2.0. Please use SimpleSAML_Utils_System::getTempDir instead. + * @deprecated This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\System::getTempDir instead. */ public static function getTempDir() { - return SimpleSAML_Utils_System::getTempDir(); + return SimpleSAML\Utils\System::getTempDir(); } @@ -1587,10 +1587,10 @@ class SimpleSAML_Utilities { /** - * @deprecated This method will be removed in SSP 2.0. Please use SimpleSAML_Utils_System::getOS() instead. + * @deprecated This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\System::getOS() instead. */ public static function isWindowsOS() { - return SimpleSAML_Utils_System::getOS() === SimpleSAML_Utils_System::WINDOWS; + return SimpleSAML\Utils\System::getOS() === SimpleSAML\Utils\System::WINDOWS; } diff --git a/lib/SimpleSAML/Utils/System.php b/lib/SimpleSAML/Utils/System.php index bce9285cd..8b2b3ed1d 100644 --- a/lib/SimpleSAML/Utils/System.php +++ b/lib/SimpleSAML/Utils/System.php @@ -1,12 +1,12 @@ <?php - +namespace SimpleSAML\Utils; /** * System-related utility methods. * * @package SimpleSAMLphp */ -class SimpleSAML_Utils_System +class System { const WINDOWS = 1; diff --git a/modules/metarefresh/lib/MetaLoader.php b/modules/metarefresh/lib/MetaLoader.php index f9393ebc6..e8d869677 100644 --- a/modules/metarefresh/lib/MetaLoader.php +++ b/modules/metarefresh/lib/MetaLoader.php @@ -238,7 +238,7 @@ class sspmod_metarefresh_MetaLoader { public function writeState() { if($this->changed) { SimpleSAML_Logger::debug('Writing: ' . $this->stateFile); - SimpleSAML_Utils_System::writeFile( + SimpleSAML\Utils\System::writeFile( $this->stateFile, "<?php\n/* This file was generated by the metarefresh module at ".$this->getTime() . ".\n". " Do not update it manually as it will get overwritten. */\n". @@ -393,7 +393,7 @@ class sspmod_metarefresh_MetaLoader { $content .= "\n" . '?>'; - SimpleSAML_Utils_System::writeFile($filename, $content, 0644); + SimpleSAML\Utils\System::writeFile($filename, $content, 0644); } elseif(is_file($filename)) { if(unlink($filename)) { SimpleSAML_Logger::debug('Deleting stale metadata file: ' . $filename); -- GitLab