From 452bf6b2d0ed511c9ccc7a4085ecf6a5788014c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Thu, 20 Jul 2017 23:12:45 -0300 Subject: [PATCH] Add PhpMyAdmin\Setup namespace MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: MaurĂ­cio Meneghini Fauth --- composer.json | 3 ++- setup/config.php | 2 +- setup/frames/config.inc.php | 2 +- setup/lib/ConfigGenerator.php | 2 +- setup/validate.php | 4 ++-- test/classes/ConfigGeneratorTest.php | 10 +++++----- 6 files changed, 12 insertions(+), 11 deletions(-) diff --git a/composer.json b/composer.json index 959b35e64e..36afdb9438 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,8 @@ "autoload": { "psr-4": { "PMA\\": "./", - "PhpMyAdmin\\": "libraries/classes" + "PhpMyAdmin\\": "libraries/classes", + "PhpMyAdmin\\Setup\\": "setup/lib" } }, "repositories": [ diff --git a/setup/config.php b/setup/config.php index 5f521492a6..e4917a561c 100644 --- a/setup/config.php +++ b/setup/config.php @@ -6,7 +6,7 @@ * @package PhpMyAdmin-Setup */ use PhpMyAdmin\Config\FormDisplay; -use PMA\setup\lib\ConfigGenerator; +use PhpMyAdmin\Setup\ConfigGenerator; use PhpMyAdmin\Core; use PhpMyAdmin\Url; use PhpMyAdmin\Response; diff --git a/setup/frames/config.inc.php b/setup/frames/config.inc.php index fc4de3bf35..ba24104750 100644 --- a/setup/frames/config.inc.php +++ b/setup/frames/config.inc.php @@ -6,7 +6,7 @@ * @package PhpMyAdmin-Setup */ -use PMA\setup\lib\ConfigGenerator; +use PhpMyAdmin\Setup\ConfigGenerator; use PhpMyAdmin\Core; if (!defined('PHPMYADMIN')) { diff --git a/setup/lib/ConfigGenerator.php b/setup/lib/ConfigGenerator.php index 0630217ab5..7073016414 100644 --- a/setup/lib/ConfigGenerator.php +++ b/setup/lib/ConfigGenerator.php @@ -5,7 +5,7 @@ * * @package PhpMyAdmin-Setup */ -namespace PMA\setup\lib; +namespace PhpMyAdmin\Setup; use PhpMyAdmin\Config\ConfigFile; diff --git a/setup/validate.php b/setup/validate.php index 6482919749..ae291eb2ec 100644 --- a/setup/validate.php +++ b/setup/validate.php @@ -6,6 +6,7 @@ * @package PhpMyAdmin-Setup */ +use PhpMyAdmin\Config\Validator; use PhpMyAdmin\Core; /** @@ -14,7 +15,6 @@ use PhpMyAdmin\Core; require './lib/common.inc.php'; $validators = array(); -require './libraries/config/Validator.php'; Core::headerJSON(); @@ -26,7 +26,7 @@ if (!($values instanceof stdClass)) { Core::fatalError(__('Wrong data')); } $values = (array)$values; -$result = PhpMyAdmin\Config\Validator::validate($GLOBALS['ConfigFile'], $vids, $values, true); +$result = Validator::validate($GLOBALS['ConfigFile'], $vids, $values, true); if ($result === false) { $result = sprintf( __('Wrong data or no validation for %s'), diff --git a/test/classes/ConfigGeneratorTest.php b/test/classes/ConfigGeneratorTest.php index 754dcd81a6..912237dc42 100644 --- a/test/classes/ConfigGeneratorTest.php +++ b/test/classes/ConfigGeneratorTest.php @@ -11,12 +11,12 @@ */ use PhpMyAdmin\Config; use PhpMyAdmin\Config\ConfigFile; -use PMA\setup\lib\ConfigGenerator; +use PhpMyAdmin\Setup\ConfigGenerator; require_once 'test/PMATestCase.php'; /** - * Tests for PMA\setup\lib\ConfigGenerator + * Tests for PhpMyAdmin\Setup\ConfigGenerator * * @package PhpMyAdmin-test */ @@ -80,7 +80,7 @@ class ConfigGeneratorTest extends PMATestCase */ public function testGetVarExport() { - $reflection = new \ReflectionClass('PMA\setup\lib\ConfigGenerator'); + $reflection = new \ReflectionClass('PhpMyAdmin\Setup\ConfigGenerator'); $method = $reflection->getMethod('_getVarExport'); $method->setAccessible(true); @@ -127,7 +127,7 @@ class ConfigGeneratorTest extends PMATestCase */ public function testIsZeroBasedArray() { - $reflection = new \ReflectionClass('PMA\setup\lib\ConfigGenerator'); + $reflection = new \ReflectionClass('PhpMyAdmin\Setup\ConfigGenerator'); $method = $reflection->getMethod('_isZeroBasedArray'); $method->setAccessible(true); @@ -174,7 +174,7 @@ class ConfigGeneratorTest extends PMATestCase */ public function testExportZeroBasedArray() { - $reflection = new \ReflectionClass('PMA\setup\lib\ConfigGenerator'); + $reflection = new \ReflectionClass('PhpMyAdmin\Setup\ConfigGenerator'); $method = $reflection->getMethod('_exportZeroBasedArray'); $method->setAccessible(true);