@@ -37,7 +37,7 @@ |
||
| 37 | 37 | { |
| 38 | 38 | if ( is_object($mObject)) { |
| 39 | 39 | |
| 40 | - $mObject = (array) $mObject; |
|
| 40 | + $mObject = (array) $mObject; |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | |
@@ -7,12 +7,12 @@ |
||
| 7 | 7 | */ |
| 8 | 8 | class LogLevel |
| 9 | 9 | { |
| 10 | - const EMERGENCY = 'emergency'; |
|
| 11 | - const ALERT = 'alert'; |
|
| 12 | - const CRITICAL = 'critical'; |
|
| 13 | - const ERROR = 'error'; |
|
| 14 | - const WARNING = 'warning'; |
|
| 15 | - const NOTICE = 'notice'; |
|
| 16 | - const INFO = 'info'; |
|
| 17 | - const DEBUG = 'debug'; |
|
| 10 | + const EMERGENCY = 'emergency'; |
|
| 11 | + const ALERT = 'alert'; |
|
| 12 | + const CRITICAL = 'critical'; |
|
| 13 | + const ERROR = 'error'; |
|
| 14 | + const WARNING = 'warning'; |
|
| 15 | + const NOTICE = 'notice'; |
|
| 16 | + const INFO = 'info'; |
|
| 17 | + const DEBUG = 'debug'; |
|
| 18 | 18 | } |
@@ -19,96 +19,96 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | interface LoggerInterface |
| 21 | 21 | { |
| 22 | - /** |
|
| 23 | - * System is unusable. |
|
| 24 | - * |
|
| 25 | - * @param string $message |
|
| 26 | - * @param array $context |
|
| 27 | - * @return null |
|
| 28 | - */ |
|
| 29 | - public function emergency($message, array $context = array()); |
|
| 22 | + /** |
|
| 23 | + * System is unusable. |
|
| 24 | + * |
|
| 25 | + * @param string $message |
|
| 26 | + * @param array $context |
|
| 27 | + * @return null |
|
| 28 | + */ |
|
| 29 | + public function emergency($message, array $context = array()); |
|
| 30 | 30 | |
| 31 | - /** |
|
| 32 | - * Action must be taken immediately. |
|
| 33 | - * |
|
| 34 | - * Example: Entire website down, database unavailable, etc. This should |
|
| 35 | - * trigger the SMS alerts and wake you up. |
|
| 36 | - * |
|
| 37 | - * @param string $message |
|
| 38 | - * @param array $context |
|
| 39 | - * @return null |
|
| 40 | - */ |
|
| 41 | - public function alert($message, array $context = array()); |
|
| 31 | + /** |
|
| 32 | + * Action must be taken immediately. |
|
| 33 | + * |
|
| 34 | + * Example: Entire website down, database unavailable, etc. This should |
|
| 35 | + * trigger the SMS alerts and wake you up. |
|
| 36 | + * |
|
| 37 | + * @param string $message |
|
| 38 | + * @param array $context |
|
| 39 | + * @return null |
|
| 40 | + */ |
|
| 41 | + public function alert($message, array $context = array()); |
|
| 42 | 42 | |
| 43 | - /** |
|
| 44 | - * Critical conditions. |
|
| 45 | - * |
|
| 46 | - * Example: Application component unavailable, unexpected exception. |
|
| 47 | - * |
|
| 48 | - * @param string $message |
|
| 49 | - * @param array $context |
|
| 50 | - * @return null |
|
| 51 | - */ |
|
| 52 | - public function critical($message, array $context = array()); |
|
| 43 | + /** |
|
| 44 | + * Critical conditions. |
|
| 45 | + * |
|
| 46 | + * Example: Application component unavailable, unexpected exception. |
|
| 47 | + * |
|
| 48 | + * @param string $message |
|
| 49 | + * @param array $context |
|
| 50 | + * @return null |
|
| 51 | + */ |
|
| 52 | + public function critical($message, array $context = array()); |
|
| 53 | 53 | |
| 54 | - /** |
|
| 55 | - * Runtime errors that do not require immediate action but should typically |
|
| 56 | - * be logged and monitored. |
|
| 57 | - * |
|
| 58 | - * @param string $message |
|
| 59 | - * @param array $context |
|
| 60 | - * @return null |
|
| 61 | - */ |
|
| 62 | - public function error($message, array $context = array()); |
|
| 54 | + /** |
|
| 55 | + * Runtime errors that do not require immediate action but should typically |
|
| 56 | + * be logged and monitored. |
|
| 57 | + * |
|
| 58 | + * @param string $message |
|
| 59 | + * @param array $context |
|
| 60 | + * @return null |
|
| 61 | + */ |
|
| 62 | + public function error($message, array $context = array()); |
|
| 63 | 63 | |
| 64 | - /** |
|
| 65 | - * Exceptional occurrences that are not errors. |
|
| 66 | - * |
|
| 67 | - * Example: Use of deprecated APIs, poor use of an API, undesirable things |
|
| 68 | - * that are not necessarily wrong. |
|
| 69 | - * |
|
| 70 | - * @param string $message |
|
| 71 | - * @param array $context |
|
| 72 | - * @return null |
|
| 73 | - */ |
|
| 74 | - public function warning($message, array $context = array()); |
|
| 64 | + /** |
|
| 65 | + * Exceptional occurrences that are not errors. |
|
| 66 | + * |
|
| 67 | + * Example: Use of deprecated APIs, poor use of an API, undesirable things |
|
| 68 | + * that are not necessarily wrong. |
|
| 69 | + * |
|
| 70 | + * @param string $message |
|
| 71 | + * @param array $context |
|
| 72 | + * @return null |
|
| 73 | + */ |
|
| 74 | + public function warning($message, array $context = array()); |
|
| 75 | 75 | |
| 76 | - /** |
|
| 77 | - * Normal but significant events. |
|
| 78 | - * |
|
| 79 | - * @param string $message |
|
| 80 | - * @param array $context |
|
| 81 | - * @return null |
|
| 82 | - */ |
|
| 83 | - public function notice($message, array $context = array()); |
|
| 76 | + /** |
|
| 77 | + * Normal but significant events. |
|
| 78 | + * |
|
| 79 | + * @param string $message |
|
| 80 | + * @param array $context |
|
| 81 | + * @return null |
|
| 82 | + */ |
|
| 83 | + public function notice($message, array $context = array()); |
|
| 84 | 84 | |
| 85 | - /** |
|
| 86 | - * Interesting events. |
|
| 87 | - * |
|
| 88 | - * Example: User logs in, SQL logs. |
|
| 89 | - * |
|
| 90 | - * @param string $message |
|
| 91 | - * @param array $context |
|
| 92 | - * @return null |
|
| 93 | - */ |
|
| 94 | - public function info($message, array $context = array()); |
|
| 85 | + /** |
|
| 86 | + * Interesting events. |
|
| 87 | + * |
|
| 88 | + * Example: User logs in, SQL logs. |
|
| 89 | + * |
|
| 90 | + * @param string $message |
|
| 91 | + * @param array $context |
|
| 92 | + * @return null |
|
| 93 | + */ |
|
| 94 | + public function info($message, array $context = array()); |
|
| 95 | 95 | |
| 96 | - /** |
|
| 97 | - * Detailed debug information. |
|
| 98 | - * |
|
| 99 | - * @param string $message |
|
| 100 | - * @param array $context |
|
| 101 | - * @return null |
|
| 102 | - */ |
|
| 103 | - public function debug($message, array $context = array()); |
|
| 96 | + /** |
|
| 97 | + * Detailed debug information. |
|
| 98 | + * |
|
| 99 | + * @param string $message |
|
| 100 | + * @param array $context |
|
| 101 | + * @return null |
|
| 102 | + */ |
|
| 103 | + public function debug($message, array $context = array()); |
|
| 104 | 104 | |
| 105 | - /** |
|
| 106 | - * Logs with an arbitrary level. |
|
| 107 | - * |
|
| 108 | - * @param mixed $level |
|
| 109 | - * @param string $message |
|
| 110 | - * @param array $context |
|
| 111 | - * @return null |
|
| 112 | - */ |
|
| 113 | - public function log($level, $message, array $context = array()); |
|
| 105 | + /** |
|
| 106 | + * Logs with an arbitrary level. |
|
| 107 | + * |
|
| 108 | + * @param mixed $level |
|
| 109 | + * @param string $message |
|
| 110 | + * @param array $context |
|
| 111 | + * @return null |
|
| 112 | + */ |
|
| 113 | + public function log($level, $message, array $context = array()); |
|
| 114 | 114 | } |
@@ -32,37 +32,37 @@ |
||
| 32 | 32 | */ |
| 33 | 33 | class Demo extends Controller |
| 34 | 34 | { |
| 35 | - /** |
|
| 36 | - * Constructor |
|
| 37 | - * |
|
| 38 | - * @access public |
|
| 39 | - * @return Demo |
|
| 40 | - */ |
|
| 41 | - public function __construct() |
|
| 42 | - { |
|
| 43 | - parent::__construct(); |
|
| 44 | - } |
|
| 35 | + /** |
|
| 36 | + * Constructor |
|
| 37 | + * |
|
| 38 | + * @access public |
|
| 39 | + * @return Demo |
|
| 40 | + */ |
|
| 41 | + public function __construct() |
|
| 42 | + { |
|
| 43 | + parent::__construct(); |
|
| 44 | + } |
|
| 45 | 45 | |
| 46 | - /** |
|
| 47 | - * bootstrap |
|
| 48 | - * |
|
| 49 | - * @access public |
|
| 50 | - * @return void |
|
| 51 | - */ |
|
| 52 | - public function bootstrap() |
|
| 53 | - { |
|
| 54 | - ; |
|
| 55 | - } |
|
| 46 | + /** |
|
| 47 | + * bootstrap |
|
| 48 | + * |
|
| 49 | + * @access public |
|
| 50 | + * @return void |
|
| 51 | + */ |
|
| 52 | + public function bootstrap() |
|
| 53 | + { |
|
| 54 | + ; |
|
| 55 | + } |
|
| 56 | 56 | |
| 57 | - /** |
|
| 58 | - * install method |
|
| 59 | - * |
|
| 60 | - * @access public |
|
| 61 | - * @param string $sPortal |
|
| 62 | - * @return void |
|
| 63 | - */ |
|
| 64 | - public function install($sPortal) |
|
| 65 | - { |
|
| 66 | - $this->installDb; |
|
| 67 | - } |
|
| 57 | + /** |
|
| 58 | + * install method |
|
| 59 | + * |
|
| 60 | + * @access public |
|
| 61 | + * @param string $sPortal |
|
| 62 | + * @return void |
|
| 63 | + */ |
|
| 64 | + public function install($sPortal) |
|
| 65 | + { |
|
| 66 | + $this->installDb; |
|
| 67 | + } |
|
| 68 | 68 | } |
@@ -6,42 +6,42 @@ |
||
| 6 | 6 | |
| 7 | 7 | class Phpunit extends Controller |
| 8 | 8 | { |
| 9 | - /** |
|
| 10 | - * Constructs a test case with the given name. |
|
| 11 | - * |
|
| 12 | - */ |
|
| 13 | - public function __construct() |
|
| 14 | - { |
|
| 15 | - parent::__construct(); |
|
| 16 | - } |
|
| 17 | - |
|
| 18 | - /** |
|
| 19 | - * new method to launch a web server |
|
| 20 | - * @param array $options |
|
| 21 | - * @tutorial php bin/console server:run |
|
| 22 | - * php bin/console server:run -a 192.168.0.1:8000 |
|
| 23 | - */ |
|
| 24 | - public function phpunit(array $options = array()) |
|
| 25 | - { |
|
| 26 | - ob_get_clean(); |
|
| 27 | - |
|
| 28 | - $files = scandir(__DIR__.'/../../../../tests'); |
|
| 29 | - |
|
| 30 | - foreach ($files as $one) { |
|
| 31 | - |
|
| 32 | - if (is_dir(__DIR__.'/../../../../tests/'.$one) && $one != '..' && $one != '.') { |
|
| 33 | - |
|
| 34 | - $controllerFiles = scandir(__DIR__.'/../../../../tests'.'/'.$one.'/app/Controller'); |
|
| 35 | - |
|
| 36 | - foreach ($controllerFiles as $oneController) { |
|
| 37 | - |
|
| 38 | - if (is_file(__DIR__.'/../../../../tests/'.$one.'/app/Controller/' . $oneController) && $oneController != '..' && $oneController != '.') { |
|
| 39 | - |
|
| 40 | - $unitTest = new \PHPUnit_TextUI_Command; |
|
| 41 | - $unitTest->run([__DIR__.'/../../../../tests/'.$one.'/app/Controller/' . $oneController]); |
|
| 42 | - } |
|
| 43 | - } |
|
| 44 | - } |
|
| 45 | - } |
|
| 46 | - } |
|
| 9 | + /** |
|
| 10 | + * Constructs a test case with the given name. |
|
| 11 | + * |
|
| 12 | + */ |
|
| 13 | + public function __construct() |
|
| 14 | + { |
|
| 15 | + parent::__construct(); |
|
| 16 | + } |
|
| 17 | + |
|
| 18 | + /** |
|
| 19 | + * new method to launch a web server |
|
| 20 | + * @param array $options |
|
| 21 | + * @tutorial php bin/console server:run |
|
| 22 | + * php bin/console server:run -a 192.168.0.1:8000 |
|
| 23 | + */ |
|
| 24 | + public function phpunit(array $options = array()) |
|
| 25 | + { |
|
| 26 | + ob_get_clean(); |
|
| 27 | + |
|
| 28 | + $files = scandir(__DIR__.'/../../../../tests'); |
|
| 29 | + |
|
| 30 | + foreach ($files as $one) { |
|
| 31 | + |
|
| 32 | + if (is_dir(__DIR__.'/../../../../tests/'.$one) && $one != '..' && $one != '.') { |
|
| 33 | + |
|
| 34 | + $controllerFiles = scandir(__DIR__.'/../../../../tests'.'/'.$one.'/app/Controller'); |
|
| 35 | + |
|
| 36 | + foreach ($controllerFiles as $oneController) { |
|
| 37 | + |
|
| 38 | + if (is_file(__DIR__.'/../../../../tests/'.$one.'/app/Controller/' . $oneController) && $oneController != '..' && $oneController != '.') { |
|
| 39 | + |
|
| 40 | + $unitTest = new \PHPUnit_TextUI_Command; |
|
| 41 | + $unitTest->run([__DIR__.'/../../../../tests/'.$one.'/app/Controller/' . $oneController]); |
|
| 42 | + } |
|
| 43 | + } |
|
| 44 | + } |
|
| 45 | + } |
|
| 46 | + } |
|
| 47 | 47 | } |
@@ -7,68 +7,68 @@ |
||
| 7 | 7 | |
| 8 | 8 | class Server extends Controller |
| 9 | 9 | { |
| 10 | - /** |
|
| 11 | - * new method to launch a web server |
|
| 12 | - * @param array $options |
|
| 13 | - * @tutorial php bin/console server:run |
|
| 14 | - * php bin/console server:run -a 192.168.0.1:8000 |
|
| 15 | - */ |
|
| 16 | - public function run(array $options = array()) |
|
| 17 | - { |
|
| 18 | - ob_get_clean(); |
|
| 10 | + /** |
|
| 11 | + * new method to launch a web server |
|
| 12 | + * @param array $options |
|
| 13 | + * @tutorial php bin/console server:run |
|
| 14 | + * php bin/console server:run -a 192.168.0.1:8000 |
|
| 15 | + */ |
|
| 16 | + public function run(array $options = array()) |
|
| 17 | + { |
|
| 18 | + ob_get_clean(); |
|
| 19 | 19 | |
| 20 | - if (!isset($options['a'])) { |
|
| 21 | - $options['a'] = 'localhost:8000'; |
|
| 22 | - } |
|
| 20 | + if (!isset($options['a'])) { |
|
| 21 | + $options['a'] = 'localhost:8000'; |
|
| 22 | + } |
|
| 23 | 23 | |
| 24 | - echo "\n\n"; |
|
| 25 | - echo Bash::setBackground(" ", 'green'); |
|
| 26 | - echo Bash::setBackground(" [OK] Start web server ", 'green'); |
|
| 27 | - echo Bash::setBackground(" ", 'green'); |
|
| 28 | - echo "\n\n"; |
|
| 29 | - echo " > Use ".$options['a']." in browser"; |
|
| 30 | - echo "\n\n"; |
|
| 31 | - echo " > Clic Ctrl+C to stop the web server"; |
|
| 32 | - echo "\n\n"; |
|
| 24 | + echo "\n\n"; |
|
| 25 | + echo Bash::setBackground(" ", 'green'); |
|
| 26 | + echo Bash::setBackground(" [OK] Start web server ", 'green'); |
|
| 27 | + echo Bash::setBackground(" ", 'green'); |
|
| 28 | + echo "\n\n"; |
|
| 29 | + echo " > Use ".$options['a']." in browser"; |
|
| 30 | + echo "\n\n"; |
|
| 31 | + echo " > Clic Ctrl+C to stop the web server"; |
|
| 32 | + echo "\n\n"; |
|
| 33 | 33 | |
| 34 | - exec('php -S '.$options['a'].' /public/index.php'); |
|
| 35 | - } |
|
| 34 | + exec('php -S '.$options['a'].' /public/index.php'); |
|
| 35 | + } |
|
| 36 | 36 | |
| 37 | - /** |
|
| 38 | - * check if a server web is launched |
|
| 39 | - * @param array $options |
|
| 40 | - * @tutorial php bin/console server:status |
|
| 41 | - * php bin/console server:status -a 192.168.0.1:8000 |
|
| 42 | - */ |
|
| 43 | - public function status(array $options = array()) |
|
| 44 | - { |
|
| 45 | - ob_get_clean(); |
|
| 37 | + /** |
|
| 38 | + * check if a server web is launched |
|
| 39 | + * @param array $options |
|
| 40 | + * @tutorial php bin/console server:status |
|
| 41 | + * php bin/console server:status -a 192.168.0.1:8000 |
|
| 42 | + */ |
|
| 43 | + public function status(array $options = array()) |
|
| 44 | + { |
|
| 45 | + ob_get_clean(); |
|
| 46 | 46 | |
| 47 | - if (!isset($options['a'])) { |
|
| 48 | - $options['a'] = 'localhost:8000'; |
|
| 49 | - } |
|
| 47 | + if (!isset($options['a'])) { |
|
| 48 | + $options['a'] = 'localhost:8000'; |
|
| 49 | + } |
|
| 50 | 50 | |
| 51 | - list($hostname, $port) = explode(':', $options['a']); |
|
| 51 | + list($hostname, $port) = explode(':', $options['a']); |
|
| 52 | 52 | |
| 53 | - if (false !== $fp = @fsockopen($hostname, $port, $errno, $errstr, 1)) { |
|
| 54 | - fclose($fp); |
|
| 53 | + if (false !== $fp = @fsockopen($hostname, $port, $errno, $errstr, 1)) { |
|
| 54 | + fclose($fp); |
|
| 55 | 55 | |
| 56 | - echo "\n\n"; |
|
| 57 | - echo Bash::setBackground(" ", 'green'); |
|
| 58 | - echo Bash::setBackground(" [OK] A web server is launched ", 'green'); |
|
| 59 | - echo Bash::setBackground(" ", 'green'); |
|
| 60 | - echo "\n\n"; |
|
| 61 | - echo " > Check realized on ".$options['a']; |
|
| 62 | - echo "\n\n"; |
|
| 63 | - } |
|
| 64 | - else { |
|
| 65 | - echo "\n\n"; |
|
| 66 | - echo Bash::setBackground(" ", 'red'); |
|
| 67 | - echo Bash::setBackground(" [WARNING] A web server is not used ", 'red'); |
|
| 68 | - echo Bash::setBackground(" ", 'red'); |
|
| 69 | - echo "\n\n"; |
|
| 70 | - echo " > Check realized on ".$options['a']; |
|
| 71 | - echo "\n\n"; |
|
| 72 | - } |
|
| 73 | - } |
|
| 56 | + echo "\n\n"; |
|
| 57 | + echo Bash::setBackground(" ", 'green'); |
|
| 58 | + echo Bash::setBackground(" [OK] A web server is launched ", 'green'); |
|
| 59 | + echo Bash::setBackground(" ", 'green'); |
|
| 60 | + echo "\n\n"; |
|
| 61 | + echo " > Check realized on ".$options['a']; |
|
| 62 | + echo "\n\n"; |
|
| 63 | + } |
|
| 64 | + else { |
|
| 65 | + echo "\n\n"; |
|
| 66 | + echo Bash::setBackground(" ", 'red'); |
|
| 67 | + echo Bash::setBackground(" [WARNING] A web server is not used ", 'red'); |
|
| 68 | + echo Bash::setBackground(" ", 'red'); |
|
| 69 | + echo "\n\n"; |
|
| 70 | + echo " > Check realized on ".$options['a']; |
|
| 71 | + echo "\n\n"; |
|
| 72 | + } |
|
| 73 | + } |
|
| 74 | 74 | } |
@@ -49,11 +49,11 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | public static function get(string $sName, string $sPortal = null, bool $bNoDoRedirect = false) |
| 51 | 51 | { |
| 52 | - if ($bNoDoRedirect === true) { $sNameCache = $sName.'_true'; } else { $sNameCache = $sName; } |
|
| 52 | + if ($bNoDoRedirect === true) { $sNameCache = $sName.'_true'; } else { $sNameCache = $sName; } |
|
| 53 | 53 | |
| 54 | 54 | if ($sPortal === null || !is_string($sPortal)) { |
| 55 | 55 | |
| 56 | - if (defined('PORTAL')) { |
|
| 56 | + if (defined('PORTAL')) { |
|
| 57 | 57 | |
| 58 | 58 | $sPortal = PORTAL; |
| 59 | 59 | $aDirectories = array($sPortal); |
@@ -70,93 +70,93 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | foreach ($aDirectories as $sPortal) { |
| 72 | 72 | |
| 73 | - if ($sPortal != '..' && $sPortal != '.') { |
|
| 73 | + if ($sPortal != '..' && $sPortal != '.') { |
|
| 74 | 74 | |
| 75 | - if (file_exists(str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-local')) { |
|
| 75 | + if (file_exists(str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-local')) { |
|
| 76 | 76 | |
| 77 | - $sJsonFile = str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-local'; |
|
| 78 | - $base = self::_mergeAndGetConf($sJsonFile, $base); |
|
| 79 | - } |
|
| 77 | + $sJsonFile = str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-local'; |
|
| 78 | + $base = self::_mergeAndGetConf($sJsonFile, $base); |
|
| 79 | + } |
|
| 80 | 80 | |
| 81 | - if (file_exists(str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-local')) { |
|
| 81 | + if (file_exists(str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-local')) { |
|
| 82 | 82 | |
| 83 | - $sJsonFile = str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-local'; |
|
| 84 | - $base = self::_mergeAndGetConf($sJsonFile, $base); |
|
| 85 | - } |
|
| 83 | + $sJsonFile = str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-local'; |
|
| 84 | + $base = self::_mergeAndGetConf($sJsonFile, $base); |
|
| 85 | + } |
|
| 86 | 86 | |
| 87 | - if (file_exists(str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev') && getenv('DEV') == 1) { |
|
| 87 | + if (file_exists(str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev') && getenv('DEV') == 1) { |
|
| 88 | 88 | |
| 89 | - $sJsonFile = str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev'; |
|
| 90 | - $base = self::_mergeAndGetConf($sJsonFile, $base); |
|
| 91 | - } |
|
| 89 | + $sJsonFile = str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev'; |
|
| 90 | + $base = self::_mergeAndGetConf($sJsonFile, $base); |
|
| 91 | + } |
|
| 92 | 92 | |
| 93 | - if (file_exists(str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev') && getenv('DEV') == 1) { |
|
| 93 | + if (file_exists(str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev') && getenv('DEV') == 1) { |
|
| 94 | 94 | |
| 95 | - $sJsonFile = str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev'; |
|
| 96 | - $base = self::_mergeAndGetConf($sJsonFile, $base); |
|
| 97 | - } |
|
| 95 | + $sJsonFile = str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev'; |
|
| 96 | + $base = self::_mergeAndGetConf($sJsonFile, $base); |
|
| 97 | + } |
|
| 98 | 98 | |
| 99 | - if (file_exists(str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev') && getenv('PROD') == 1) { |
|
| 99 | + if (file_exists(str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev') && getenv('PROD') == 1) { |
|
| 100 | 100 | |
| 101 | - $sJsonFile = str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-prod'; |
|
| 102 | - $base = self::_mergeAndGetConf($sJsonFile, $base); |
|
| 103 | - } |
|
| 101 | + $sJsonFile = str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-prod'; |
|
| 102 | + $base = self::_mergeAndGetConf($sJsonFile, $base); |
|
| 103 | + } |
|
| 104 | 104 | |
| 105 | - if (file_exists(str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev') && getenv('PROD') == 1) { |
|
| 105 | + if (file_exists(str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev') && getenv('PROD') == 1) { |
|
| 106 | 106 | |
| 107 | - $sJsonFile = str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-prod'; |
|
| 108 | - $base = self::_mergeAndGetConf($sJsonFile, $base); |
|
| 109 | - } |
|
| 107 | + $sJsonFile = str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-prod'; |
|
| 108 | + $base = self::_mergeAndGetConf($sJsonFile, $base); |
|
| 109 | + } |
|
| 110 | 110 | |
| 111 | - if (file_exists(str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev') && getenv('PREPROD') == 1) { |
|
| 111 | + if (file_exists(str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev') && getenv('PREPROD') == 1) { |
|
| 112 | 112 | |
| 113 | - $sJsonFile = str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-pprod'; |
|
| 114 | - $base = self::_mergeAndGetConf($sJsonFile, $base); |
|
| 115 | - } |
|
| 113 | + $sJsonFile = str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-pprod'; |
|
| 114 | + $base = self::_mergeAndGetConf($sJsonFile, $base); |
|
| 115 | + } |
|
| 116 | 116 | |
| 117 | - if (file_exists(str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev') && getenv('PREPROD') == 1) { |
|
| 117 | + if (file_exists(str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev') && getenv('PREPROD') == 1) { |
|
| 118 | 118 | |
| 119 | - $sJsonFile = str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-pprod'; |
|
| 120 | - $base = self::_mergeAndGetConf($sJsonFile, $base); |
|
| 121 | - } |
|
| 119 | + $sJsonFile = str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-pprod'; |
|
| 120 | + $base = self::_mergeAndGetConf($sJsonFile, $base); |
|
| 121 | + } |
|
| 122 | 122 | |
| 123 | - if (file_exists(str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev') && getenv('RECETTE') == 1) { |
|
| 123 | + if (file_exists(str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev') && getenv('RECETTE') == 1) { |
|
| 124 | 124 | |
| 125 | - $sJsonFile = str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-rec'; |
|
| 126 | - $base = self::_mergeAndGetConf($sJsonFile, $base); |
|
| 127 | - } |
|
| 125 | + $sJsonFile = str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-rec'; |
|
| 126 | + $base = self::_mergeAndGetConf($sJsonFile, $base); |
|
| 127 | + } |
|
| 128 | 128 | |
| 129 | - if (file_exists(str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev') && getenv('RECETTE') == 1) { |
|
| 129 | + if (file_exists(str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev') && getenv('RECETTE') == 1) { |
|
| 130 | 130 | |
| 131 | - $sJsonFile = str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-rec'; |
|
| 132 | - $base = self::_mergeAndGetConf($sJsonFile, $base); |
|
| 133 | - } |
|
| 131 | + $sJsonFile = str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-rec'; |
|
| 132 | + $base = self::_mergeAndGetConf($sJsonFile, $base); |
|
| 133 | + } |
|
| 134 | 134 | |
| 135 | - if (file_exists(str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-local')) { |
|
| 135 | + if (file_exists(str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-local')) { |
|
| 136 | 136 | |
| 137 | - $sJsonFile = str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-local'; |
|
| 138 | - $base = self::_mergeAndGetConf($sJsonFile, $base); |
|
| 139 | - } |
|
| 137 | + $sJsonFile = str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-local'; |
|
| 138 | + $base = self::_mergeAndGetConf($sJsonFile, $base); |
|
| 139 | + } |
|
| 140 | 140 | |
| 141 | - if (file_exists(str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf')) { |
|
| 141 | + if (file_exists(str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf')) { |
|
| 142 | 142 | |
| 143 | - $sJsonFile = str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf'; |
|
| 144 | - $base = self::_mergeAndGetConf($sJsonFile, $base); |
|
| 145 | - } |
|
| 143 | + $sJsonFile = str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf'; |
|
| 144 | + $base = self::_mergeAndGetConf($sJsonFile, $base); |
|
| 145 | + } |
|
| 146 | 146 | |
| 147 | - $sJsonFile = str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf'; |
|
| 148 | - $base = self::_mergeAndGetConf($sJsonFile, $base); |
|
| 149 | - } |
|
| 150 | - } |
|
| 147 | + $sJsonFile = str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf'; |
|
| 148 | + $base = self::_mergeAndGetConf($sJsonFile, $base); |
|
| 149 | + } |
|
| 150 | + } |
|
| 151 | 151 | |
| 152 | - if ($base === '') { |
|
| 152 | + if ($base === '') { |
|
| 153 | 153 | |
| 154 | 154 | trigger_error("Error in your Json format in this file : ".$sJsonFile, E_USER_NOTICE); |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | if (isset($base->redirect) && $bNoDoRedirect === false) { |
| 158 | 158 | |
| 159 | - $base = self::get($sName, $base->redirect); |
|
| 159 | + $base = self::get($sName, $base->redirect); |
|
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | self::$_aConfCache[$sNameCache] = $base; |
@@ -180,9 +180,9 @@ discard block |
||
| 180 | 180 | */ |
| 181 | 181 | public static function getBundleLocationName(string $sName): string |
| 182 | 182 | { |
| 183 | - $oConfig = self::get($sName, null, true); |
|
| 183 | + $oConfig = self::get($sName, null, true); |
|
| 184 | 184 | |
| 185 | - if (isset($oConfig->redirect)) { return $oConfig->redirect; } else { return PORTAL; } |
|
| 185 | + if (isset($oConfig->redirect)) { return $oConfig->redirect; } else { return PORTAL; } |
|
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | /** |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | echo "The Json ".$sFileToMerge." has an error! Please verify!\n"; |
| 207 | 207 | $oDebug = Debug::getInstance(); |
| 208 | 208 | $oDebug->error("The Json ".$sFileToMerge." has an error! Please verify!\n"); |
| 209 | - new \Exception("The Json ".$sFileToMerge." has an error! Please verify!\n"); |
|
| 209 | + new \Exception("The Json ".$sFileToMerge." has an error! Please verify!\n"); |
|
| 210 | 210 | } |
| 211 | 211 | } |
| 212 | 212 | |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | } else if (is_array($oConfFiles) && is_array($base) && !isset($base[$sKey])) { |
| 229 | 229 | |
| 230 | 230 | $base[$sKey] = $oConfFiles[$sKey]; |
| 231 | - } else if (!isset($base->$sKey) && is_array($mOne)) { |
|
| 231 | + } else if (!isset($base->$sKey) && is_array($mOne)) { |
|
| 232 | 232 | |
| 233 | 233 | $base->$sKey = new \StdClass; |
| 234 | 234 | list($oConfFiles, $base) = self::_recursiveGet($mOne, $base->$sKey); |
@@ -32,17 +32,17 @@ |
||
| 32 | 32 | */ |
| 33 | 33 | class Yaml implements ResponseInterface |
| 34 | 34 | { |
| 35 | - /** |
|
| 36 | - * translate the content |
|
| 37 | - * @see \Venus\lib\Response\ResponseInterface::translate() |
|
| 38 | - * |
|
| 39 | - * @access public |
|
| 40 | - * @param mixed $mContent content to translate |
|
| 41 | - * @return mixed |
|
| 42 | - */ |
|
| 43 | - public static function translate($mContent) |
|
| 44 | - { |
|
| 45 | - return yaml_emit($mContent); |
|
| 46 | - } |
|
| 35 | + /** |
|
| 36 | + * translate the content |
|
| 37 | + * @see \Venus\lib\Response\ResponseInterface::translate() |
|
| 38 | + * |
|
| 39 | + * @access public |
|
| 40 | + * @param mixed $mContent content to translate |
|
| 41 | + * @return mixed |
|
| 42 | + */ |
|
| 43 | + public static function translate($mContent) |
|
| 44 | + { |
|
| 45 | + return yaml_emit($mContent); |
|
| 46 | + } |
|
| 47 | 47 | |
| 48 | 48 | } |
@@ -33,17 +33,17 @@ |
||
| 33 | 33 | */ |
| 34 | 34 | class Json implements ResponseInterface |
| 35 | 35 | { |
| 36 | - /** |
|
| 37 | - * translate the content |
|
| 38 | - * @see \Venus\lib\Response\ResponseInterface::translate() |
|
| 39 | - * |
|
| 40 | - * @access public |
|
| 41 | - * @param mixed $mContent content to translate |
|
| 42 | - * @return mixed |
|
| 43 | - */ |
|
| 44 | - public static function translate($mContent) |
|
| 45 | - { |
|
| 46 | - return json_encode(ObjectOperation::objectToArray($mContent)); |
|
| 47 | - } |
|
| 36 | + /** |
|
| 37 | + * translate the content |
|
| 38 | + * @see \Venus\lib\Response\ResponseInterface::translate() |
|
| 39 | + * |
|
| 40 | + * @access public |
|
| 41 | + * @param mixed $mContent content to translate |
|
| 42 | + * @return mixed |
|
| 43 | + */ |
|
| 44 | + public static function translate($mContent) |
|
| 45 | + { |
|
| 46 | + return json_encode(ObjectOperation::objectToArray($mContent)); |
|
| 47 | + } |
|
| 48 | 48 | |
| 49 | 49 | } |