From 1414837a20b857415c07f62be15a75fa99dc1697 Mon Sep 17 00:00:00 2001 From: cdujeu Date: Tue, 20 Oct 2015 12:23:43 +0200 Subject: [PATCH] Fix tests syntax: use __construct(), remove strange semi-colomn after class creation. --- core/src/core/tests/test.AJXPVersion.php | 4 +-- core/src/core/tests/test.Client.php | 4 +-- core/src/core/tests/test.PHPCLI.php | 4 +-- core/src/core/tests/test.PHPDomXML.php | 4 +-- core/src/core/tests/test.PHPErrorLevel.php | 4 +-- core/src/core/tests/test.PHPExif.php | 4 +-- core/src/core/tests/test.PHPGDVersion.php | 4 +-- core/src/core/tests/test.PHPLimits.php | 4 +-- core/src/core/tests/test.PHPMCrypt.php | 4 +-- core/src/core/tests/test.PHPOS.php | 4 +-- core/src/core/tests/test.PHPSession.php | 4 +-- core/src/core/tests/test.PHPVersion.php | 4 +-- core/src/core/tests/test.PHP_APC.php | 4 +-- core/src/core/tests/test.PHP_OB.php | 4 +-- core/src/core/tests/test.PHP_magic_quotes.php | 4 +-- core/src/core/tests/test.SSLEncryption.php | 4 +-- core/src/core/tests/test.ServerEncoding.php | 4 +-- core/src/core/tests/test.Upload.php | 17 ++---------- core/src/core/tests/test.UsersConfig.php | 4 +-- core/src/core/tests/test.Writeability.php | 27 ++----------------- core/src/core/tests/test.Zlib.php | 10 ++----- 21 files changed, 42 insertions(+), 84 deletions(-) diff --git a/core/src/core/tests/test.AJXPVersion.php b/core/src/core/tests/test.AJXPVersion.php index ea952566ab..baf75771c9 100644 --- a/core/src/core/tests/test.AJXPVersion.php +++ b/core/src/core/tests/test.AJXPVersion.php @@ -29,10 +29,10 @@ */ class AJXPVersion extends AbstractTest { - public function AJXPVersion() { parent::AbstractTest("Pydio version", "Version : ".AJXP_VERSION); } + public function __construct() { parent::AbstractTest("Pydio version", "Version : ".AJXP_VERSION); } public function doTest() { $this->failedLevel = "info"; return FALSE; } -}; +} \ No newline at end of file diff --git a/core/src/core/tests/test.Client.php b/core/src/core/tests/test.Client.php index 57d6cd356c..1ea61b0872 100644 --- a/core/src/core/tests/test.Client.php +++ b/core/src/core/tests/test.Client.php @@ -29,11 +29,11 @@ */ class Client extends AbstractTest { - public function Client() { parent::AbstractTest("Client Browser", "Current client ".$_SERVER['HTTP_USER_AGENT']); } + public function __construct() { parent::AbstractTest("Client Browser", "Current client ".$_SERVER['HTTP_USER_AGENT']); } public function doTest() { $this->testedParams["Client"] = $_SERVER['HTTP_USER_AGENT']; $this->failedLevel = "info"; return FALSE; } -}; +} \ No newline at end of file diff --git a/core/src/core/tests/test.PHPCLI.php b/core/src/core/tests/test.PHPCLI.php index 444a71e712..750f04ceb6 100644 --- a/core/src/core/tests/test.PHPCLI.php +++ b/core/src/core/tests/test.PHPCLI.php @@ -28,7 +28,7 @@ */ class PHPCLI extends AbstractTest { - public function PHPCLI() { parent::AbstractTest("PHP Command Line", "Testing PHP command line (default is php)"); } + public function __construct() { parent::AbstractTest("PHP Command Line", "Testing PHP command line (default is php)"); } public function doTest() { if (!is_writable(AJXP_CACHE_DIR)) { @@ -132,4 +132,4 @@ public function doTest() return $availability; } -}; +} \ No newline at end of file diff --git a/core/src/core/tests/test.PHPDomXML.php b/core/src/core/tests/test.PHPDomXML.php index 7ea98c414b..d10a55860d 100644 --- a/core/src/core/tests/test.PHPDomXML.php +++ b/core/src/core/tests/test.PHPDomXML.php @@ -28,7 +28,7 @@ */ class PHPDomXML extends AbstractTest { - public function PHPDomXML() { parent::AbstractTest("DOM Xml enabled", "Dom XML is required, you may have to install the php-xml extension."); } + public function __construct() { parent::AbstractTest("DOM Xml enabled", "Dom XML is required, you may have to install the php-xml extension."); } public function doTest() { $this->failedLevel = "error"; @@ -39,4 +39,4 @@ public function doTest() $this->testedParams["DOM Enabled"] = "Yes"; return TRUE; } -}; +} \ No newline at end of file diff --git a/core/src/core/tests/test.PHPErrorLevel.php b/core/src/core/tests/test.PHPErrorLevel.php index a023cd4856..ca74244972 100644 --- a/core/src/core/tests/test.PHPErrorLevel.php +++ b/core/src/core/tests/test.PHPErrorLevel.php @@ -28,7 +28,7 @@ */ class PHPErrorLevel extends AbstractTest { - public function PHPErrorLevel() { parent::AbstractTest("PHP error level", PHPErrorLevel::error2string(error_reporting())); } + public function __construct() { parent::AbstractTest("PHP error level", PHPErrorLevel::error2string(error_reporting())); } public function doTest() { if (error_reporting() & E_NOTICE) { @@ -59,4 +59,4 @@ public function error2string($value) if(($value&$level)==$level) $levels[]=$name; return implode(' | ',$levels); } -}; +} \ No newline at end of file diff --git a/core/src/core/tests/test.PHPExif.php b/core/src/core/tests/test.PHPExif.php index de1dcd0e5e..1030633342 100644 --- a/core/src/core/tests/test.PHPExif.php +++ b/core/src/core/tests/test.PHPExif.php @@ -28,7 +28,7 @@ */ class PHPExif extends AbstractTest { - public function PHPExif() { + public function __construct() { parent::AbstractTest("Exif Extension enabled", "Installing php-exif extension is recommended if you plan to handle images"); } public function doTest() @@ -41,4 +41,4 @@ public function doTest() $this->testedParams["Exif Enabled"] = "Yes"; return TRUE; } -}; +} \ No newline at end of file diff --git a/core/src/core/tests/test.PHPGDVersion.php b/core/src/core/tests/test.PHPGDVersion.php index 42d9bdbec4..5e8d648c1c 100644 --- a/core/src/core/tests/test.PHPGDVersion.php +++ b/core/src/core/tests/test.PHPGDVersion.php @@ -28,7 +28,7 @@ */ class PHPGDVersion extends AbstractTest { - public function PHPGDVersion() { parent::AbstractTest("PHP GD version", "GD is required for generating thumbnails"); } + public function __construct() { parent::AbstractTest("PHP GD version", "GD is required for generating thumbnails"); } public function doTest() { $this->failedLevel = "warning"; @@ -39,4 +39,4 @@ public function doTest() $this->testedParams["GD Enabled"] = "Yes"; return TRUE; } -}; +} \ No newline at end of file diff --git a/core/src/core/tests/test.PHPLimits.php b/core/src/core/tests/test.PHPLimits.php index 5d3505e33c..4a4ebe9eae 100644 --- a/core/src/core/tests/test.PHPLimits.php +++ b/core/src/core/tests/test.PHPLimits.php @@ -28,7 +28,7 @@ */ class PHPLimits extends AbstractTest { - public function PHPLimits() { parent::AbstractTest("PHP Limits variables", "Testing configs"); } + public function __construct() { parent::AbstractTest("PHP Limits variables", "Testing configs"); } public function doTest() { $this->testedParams["Upload Max Size"] = ini_get("upload_max_filesize"); @@ -43,4 +43,4 @@ public function doTest() $this->failedLevel = "info"; return FALSE; } -}; +} \ No newline at end of file diff --git a/core/src/core/tests/test.PHPMCrypt.php b/core/src/core/tests/test.PHPMCrypt.php index 22552cb275..86af5d91b0 100644 --- a/core/src/core/tests/test.PHPMCrypt.php +++ b/core/src/core/tests/test.PHPMCrypt.php @@ -28,7 +28,7 @@ */ class PHPMCrypt extends AbstractTest { - public function PHPMCrypt() { parent::AbstractTest("MCrypt enabled", "MCrypt is required by all security functions."); } + public function __construct() { parent::AbstractTest("MCrypt enabled", "MCrypt is required by all security functions."); } public function doTest() { $this->failedLevel = "error"; @@ -39,4 +39,4 @@ public function doTest() $this->testedParams["MCrypt Enabled"] = "Yes"; return TRUE; } -}; +} \ No newline at end of file diff --git a/core/src/core/tests/test.PHPOS.php b/core/src/core/tests/test.PHPOS.php index 61c2b24387..34bb27ed81 100644 --- a/core/src/core/tests/test.PHPOS.php +++ b/core/src/core/tests/test.PHPOS.php @@ -28,11 +28,11 @@ */ class PHPOS extends AbstractTest { - public function PHPOS() { parent::AbstractTest("PHP operating system", "Current operating system ".PHP_OS); } + public function __construct() { parent::AbstractTest("PHP operating system", "Current operating system ".PHP_OS); } public function doTest() { $this->testedParams["Server OS"] = PHP_OS; $this->failedLevel = "info"; return FALSE; } -}; +} \ No newline at end of file diff --git a/core/src/core/tests/test.PHPSession.php b/core/src/core/tests/test.PHPSession.php index 85bb4fa558..8b01cfae37 100644 --- a/core/src/core/tests/test.PHPSession.php +++ b/core/src/core/tests/test.PHPSession.php @@ -28,7 +28,7 @@ */ class PHPSession extends AbstractTest { - public function PHPSession() { parent::AbstractTest("PHP Session", "Testing configs"); } + public function __construct() { parent::AbstractTest("PHP Session", "Testing configs"); } public function doTest() { $handler = ini_get("session.save_handler"); @@ -54,4 +54,4 @@ public function doTest() $this->failedLevel = "info"; return FALSE; } -}; +} \ No newline at end of file diff --git a/core/src/core/tests/test.PHPVersion.php b/core/src/core/tests/test.PHPVersion.php index 5e458c6618..c93195ee2d 100644 --- a/core/src/core/tests/test.PHPVersion.php +++ b/core/src/core/tests/test.PHPVersion.php @@ -28,7 +28,7 @@ */ class PHPVersion extends AbstractTest { - public function PHPVersion() { parent::AbstractTest("PHP version", "Minimum required version is PHP 5.3.0"); } + public function __construct() { parent::AbstractTest("PHP version", "Minimum required version is PHP 5.3.0"); } public function doTest() { $version = phpversion(); @@ -42,4 +42,4 @@ public function doTest() if (floatval($version) < 5.3 && $locale != "C" && $dirSep != '\\') { $this->failedLevel = "warning"; return FALSE; } // PHP4 doesn't work well with foreign encoding return TRUE; } -}; +} \ No newline at end of file diff --git a/core/src/core/tests/test.PHP_APC.php b/core/src/core/tests/test.PHP_APC.php index a4a6c77e6b..a1c5b267ce 100644 --- a/core/src/core/tests/test.PHP_APC.php +++ b/core/src/core/tests/test.PHP_APC.php @@ -28,7 +28,7 @@ */ class PHP_APC extends AbstractTest { - public function PHP_APC() { parent::AbstractTest("PHP APC extension", "Pydio framework loads a lot of PHP files at each query, and using a PHP accelerator is greatly recommanded."); } + public function __construct() { parent::AbstractTest("PHP APC extension", "Pydio framework loads a lot of PHP files at each query, and using a PHP accelerator is greatly recommanded."); } public function doTest() { $this->failedLevel = "warning"; @@ -44,4 +44,4 @@ public function doTest() $this->testedParams["PHP APC extension loaded"] = "Yes"; return TRUE; } -}; +} \ No newline at end of file diff --git a/core/src/core/tests/test.PHP_OB.php b/core/src/core/tests/test.PHP_OB.php index a060a6f780..0b479a9ca8 100644 --- a/core/src/core/tests/test.PHP_OB.php +++ b/core/src/core/tests/test.PHP_OB.php @@ -28,7 +28,7 @@ */ class PHP_OB extends AbstractTest { - public function PHP_OB() { parent::AbstractTest("PHP Output Buffer disabled", "You should disable php output_buffering parameter for better performances with Pydio."); } + public function __construct() { parent::AbstractTest("PHP Output Buffer disabled", "You should disable php output_buffering parameter for better performances with Pydio."); } public function doTest() { $this->failedLevel = "warning"; @@ -44,4 +44,4 @@ public function doTest() $this->testedParams["PHP Output Buffer disabled"] = "Yes"; return TRUE; } -}; +} \ No newline at end of file diff --git a/core/src/core/tests/test.PHP_magic_quotes.php b/core/src/core/tests/test.PHP_magic_quotes.php index d3e16470a9..8296217dbb 100644 --- a/core/src/core/tests/test.PHP_magic_quotes.php +++ b/core/src/core/tests/test.PHP_magic_quotes.php @@ -28,7 +28,7 @@ */ class PHP_magic_quotes extends AbstractTest { - public function PHP_magic_quotes() { parent::AbstractTest("Magic quotes disabled", "Magic quotes need to be disabled, only relevent for php 5.3"); } + public function __construct() { parent::AbstractTest("Magic quotes disabled", "Magic quotes need to be disabled, only relevent for php 5.3"); } public function doTest() { $this->failedLevel = "error"; @@ -39,4 +39,4 @@ public function doTest() $this->testedParams["Magic quotes disabled"] = "Yes"; return TRUE; } -}; +} \ No newline at end of file diff --git a/core/src/core/tests/test.SSLEncryption.php b/core/src/core/tests/test.SSLEncryption.php index 19695e63d9..d808962166 100644 --- a/core/src/core/tests/test.SSLEncryption.php +++ b/core/src/core/tests/test.SSLEncryption.php @@ -28,7 +28,7 @@ */ class SSLEncryption extends AbstractTest { - public function SSLEncryption() { parent::AbstractTest("SSL Encryption", "You are not using SSL encryption, or it was not detected by the server. Be aware that it is strongly recommended to secure all communication of data over the network."); } + public function __construct() { parent::AbstractTest("SSL Encryption", "You are not using SSL encryption, or it was not detected by the server. Be aware that it is strongly recommended to secure all communication of data over the network."); } public function doTest() { // Get the locale @@ -45,4 +45,4 @@ public function doTest() return TRUE; } } -}; +} \ No newline at end of file diff --git a/core/src/core/tests/test.ServerEncoding.php b/core/src/core/tests/test.ServerEncoding.php index d51c084a61..a77a7a8d02 100644 --- a/core/src/core/tests/test.ServerEncoding.php +++ b/core/src/core/tests/test.ServerEncoding.php @@ -28,7 +28,7 @@ */ class ServerEncoding extends AbstractTest { - public function ServerEncoding() { parent::AbstractTest("Server charset encoding", "You must set a correct charset encoding + public function __construct() { parent::AbstractTest("Server charset encoding", "You must set a correct charset encoding in your locale definition in the form: en_us.UTF-8. Please refer to setlocale man page. If your detected locale is C, simply type echo \$LANG on your server command line to read the correct value."); } public function doTest() @@ -58,4 +58,4 @@ public function doTest() } return TRUE; } -}; +} \ No newline at end of file diff --git a/core/src/core/tests/test.Upload.php b/core/src/core/tests/test.Upload.php index f5077a9a99..a265de65f6 100644 --- a/core/src/core/tests/test.Upload.php +++ b/core/src/core/tests/test.Upload.php @@ -28,7 +28,7 @@ */ class Upload extends AbstractTest { - public function Upload() { parent::AbstractTest("Upload particularities", "Testing configs"); } + public function __construct() { parent::AbstractTest("Upload particularities", "Testing configs"); } public function doTest() { $tmpDir = ini_get("upload_tmp_dir"); @@ -42,7 +42,6 @@ public function doTest() $this->testedParams["Upload Tmp Dir Writeable"] = @is_writable($tmpDir); $this->testedParams["PHP Upload Max Size"] = $this->returnBytes(ini_get("upload_max_filesize")); $this->testedParams["PHP Post Max Size"] = $this->returnBytes(ini_get("post_max_size")); - //$this->testedParams["AJXP Upload Max Size"] = $this->returnBytes($upload_max_size_per_file); foreach ($this->testedParams as $paramName => $paramValue) { $this->failedInfo .= "\n$paramName=$paramValue"; } @@ -52,20 +51,8 @@ public function doTest() $this->failedInfo .= "

Suggestion : Set the AJXP_TMP_DIR parameter in the conf/bootstrap_conf.php file

"; return FALSE; } - /* - if ($this->testedParams["AJXP Upload Max Size"] > $this->testedParams["PHP Upload Max Size"]) { - $this->failedLevel = "warning"; - $this->failedInfo .= "\nAjaxplorer cannot override the PHP setting! Unless you edit your php.ini, your upload will be limited to ".ini_get("upload_max_filesize")." per file."; - return FALSE; - } - if ($this->testedParams["AJXP Upload Max Size"] > $this->testedParams["PHP Post Max Size"]) { - $this->failedLevel = "warning"; - $this->failedInfo .= "\nAjaxplorer cannot override the PHP setting! Unless you edit your php.ini, your upload will be limited to ".ini_get("post_max_size")." per file."; - return FALSE; - } - */ $this->failedLevel = "info"; return FALSE; } -}; +} \ No newline at end of file diff --git a/core/src/core/tests/test.UsersConfig.php b/core/src/core/tests/test.UsersConfig.php index 784a2c74b4..754e9f7bdf 100644 --- a/core/src/core/tests/test.UsersConfig.php +++ b/core/src/core/tests/test.UsersConfig.php @@ -28,7 +28,7 @@ */ class UsersConfig extends AbstractTest { - public function UsersConfig() { parent::AbstractTest("Users Configuration", "Current config for users"); } + public function __construct() { parent::AbstractTest("Users Configuration", "Current config for users"); } public function doTest() { $this->testedParams["Users enabled"] = AuthService::usersEnabled(); @@ -36,4 +36,4 @@ public function doTest() $this->failedLevel = "info"; return FALSE; } -}; +} \ No newline at end of file diff --git a/core/src/core/tests/test.Writeability.php b/core/src/core/tests/test.Writeability.php index 8cfbc614f1..4af1fb18d0 100644 --- a/core/src/core/tests/test.Writeability.php +++ b/core/src/core/tests/test.Writeability.php @@ -28,33 +28,10 @@ */ class Writeability extends AbstractTest { - public function Writeability() { parent::AbstractTest("Required writeable folder", "One of the following folder should be writeable and is not : "); } + public function __construct() { parent::AbstractTest("Required writeable folder", "One of the following folder should be writeable and is not : "); } public function doTest() { - //include(AJXP_CONF_PATH."/bootstrap_plugins.php"); $checks = array(); - /* - if (isSet($PLUGINS["CONF_DRIVER"])) { - $confDriver = $PLUGINS["CONF_DRIVER"]; - if (isSet($confDriver["OPTIONS"]) && isSet($confDriver["OPTIONS"]["REPOSITORIES_FILEPATH"])) { - $checks[] = dirname($confDriver["OPTIONS"]["REPOSITORIES_FILEPATH"]); - } - if (isSet($confDriver["OPTIONS"]) && isSet($confDriver["OPTIONS"]["USERS_DIRPATH"])) { - $checks[] = $confDriver["OPTIONS"]["REPOSITORIES_FILEPATH"]; - } - } - if (isset($PLUGINS["AUTH_DRIVER"])) { - $authDriver = $PLUGINS["AUTH_DRIVER"]; - if (isset($authDriver["OPTIONS"]) && isSet($authDriver["OPTIONS"]["USERS_FILEPATH"])) { - $checks[] = dirname($authDriver["OPTIONS"]["USERS_FILEPATH"]); - } - } - if (isset($PLUGINS["LOG_DRIVER"])) { - if (isset($PLUGINS["LOG_DRIVER"]["OPTIONS"]) && isSet($PLUGINS["LOG_DRIVER"]["OPTIONS"]["LOG_PATH"])) { - $checks[] = $PLUGINS["LOG_DRIVER"]["OPTIONS"]["LOG_PATH"]; - } - } - */ $checks[] = AJXP_CACHE_DIR; $checks[] = AJXP_DATA_PATH; $checked = array(); @@ -78,4 +55,4 @@ public function doTest() $this->failedInfo = "[".implode(',
', array_values($checked))."]"; return FALSE; } -}; +} \ No newline at end of file diff --git a/core/src/core/tests/test.Zlib.php b/core/src/core/tests/test.Zlib.php index 7c3f02d3b6..76337ed40a 100644 --- a/core/src/core/tests/test.Zlib.php +++ b/core/src/core/tests/test.Zlib.php @@ -28,17 +28,11 @@ */ class Zlib extends AbstractTest { - public function Zlib() { parent::AbstractTest("Zlib extension (ZIP)", "Extension enabled : ".((function_exists('gzopen')||function_exists('gzopen64'))?"1":"0")); } + public function __construct() { parent::AbstractTest("Zlib extension (ZIP)", "Extension enabled : ".((function_exists('gzopen')||function_exists('gzopen64'))?"1":"0")); } public function doTest() { $this->testedParams["Zlib Enabled"] = ((function_exists('gzopen')||function_exists('gzopen64'))?"Yes":"No"); - $os = PHP_OS; - /*if (stristr($os, "win")!==false && $this->testedParams["Zlib Enabled"]) { - $this->failedLevel = "warning"; - $this->failedInfo = "Warning, the zip functions are erraticaly working on Windows, please don't rely too much on them!"; - return FALSE; - }*/ $this->failedLevel = "info"; return false; } -}; +} \ No newline at end of file