@@ -118,8 +118,7 @@ |
||
| 118 | 118 | */ |
| 119 | 119 | public function redirect(string $sUrl, int $iHttpCode = 301) |
| 120 | 120 | { |
| 121 | - if ($iHttpCode === 301) { header('Status: 301 Moved Permanently', false, 301); } |
|
| 122 | - else if ($iHttpCode === 302) { header('Status: Moved Temporarily', false, 301); } |
|
| 121 | + if ($iHttpCode === 301) { header('Status: 301 Moved Permanently', false, 301); } else if ($iHttpCode === 302) { header('Status: Moved Temporarily', false, 301); } |
|
| 123 | 122 | |
| 124 | 123 | header('Location: '.$sUrl); |
| 125 | 124 | exit; |
@@ -62,15 +62,13 @@ discard block |
||
| 62 | 62 | if (!is_callable($data = $this->_aDataType[$mKey][$mKey]) || (is_string($data) && function_exists($data))) { |
| 63 | 63 | |
| 64 | 64 | return $data; |
| 65 | - } |
|
| 66 | - else { |
|
| 65 | + } else { |
|
| 67 | 66 | |
| 68 | 67 | $dataStore = &$this->_aDataType[$mKey]; |
| 69 | 68 | $dataStore[$mKey] = call_user_func($data, null); |
| 70 | 69 | return $dataStore[$mKey]; |
| 71 | 70 | } |
| 72 | - } |
|
| 73 | - else { |
|
| 71 | + } else { |
|
| 74 | 72 | |
| 75 | 73 | return null; |
| 76 | 74 | } |
@@ -89,8 +87,7 @@ discard block |
||
| 89 | 87 | |
| 90 | 88 | $this->_aClosures[$mKey] = $mValue; |
| 91 | 89 | $this->_aDataType[$mKey] = &$this->_aClosures; |
| 92 | - } |
|
| 93 | - else { |
|
| 90 | + } else { |
|
| 94 | 91 | |
| 95 | 92 | $this->_aData[$mKey] = $mValue; |
| 96 | 93 | $this->_aDataType[$mKey] = &$this->_aData; |
@@ -60,8 +60,7 @@ |
||
| 60 | 60 | echo "\n\n"; |
| 61 | 61 | echo " > Check realized on ".$options['a']; |
| 62 | 62 | echo "\n\n"; |
| 63 | - } |
|
| 64 | - else { |
|
| 63 | + } else { |
|
| 65 | 64 | echo "\n\n"; |
| 66 | 65 | echo Bash::setBackground(" ", 'red'); |
| 67 | 66 | echo Bash::setBackground(" [WARNING] A web server is not used ", 'red'); |
@@ -50,8 +50,7 @@ discard block |
||
| 50 | 50 | /** |
| 51 | 51 | * option -p [portail] |
| 52 | 52 | */ |
| 53 | - if (isset($aOptions['p'])) { $sPortal = $aOptions['p']; } |
|
| 54 | - else { $sPortal = 'Batch'; } |
|
| 53 | + if (isset($aOptions['p'])) { $sPortal = $aOptions['p']; } else { $sPortal = 'Batch'; } |
|
| 55 | 54 | |
| 56 | 55 | if (!preg_match('/^[a-zA-Z0-9]+$/', $sPortal)) { |
| 57 | 56 | |
@@ -67,16 +66,14 @@ discard block |
||
| 67 | 66 | |
| 68 | 67 | echo 'The batch can`t create public folders for '.$sPortal.'! Please check the rights.'; |
| 69 | 68 | throw new \Exception('The batch can`t create public folders for '.$sPortal.'! Please check the rights.'); |
| 70 | - } |
|
| 71 | - else { |
|
| 69 | + } else { |
|
| 72 | 70 | |
| 73 | 71 | if (!file_exists($sPrivatePath.'Controller')) { |
| 74 | 72 | |
| 75 | 73 | mkdir($sPublicPath . 'css', 0777, true); |
| 76 | 74 | mkdir($sPublicPath . 'js', 0777, true); |
| 77 | 75 | mkdir($sPublicPath . 'img', 0777, true); |
| 78 | - } |
|
| 79 | - else { |
|
| 76 | + } else { |
|
| 80 | 77 | |
| 81 | 78 | echo 'The Project (public part) ' . $sPrivatePath . " exists\n"; |
| 82 | 79 | } |
@@ -86,8 +83,7 @@ discard block |
||
| 86 | 83 | |
| 87 | 84 | echo 'The batch can`t create private folders for '.$sPortal.'! Please check the rights.'; |
| 88 | 85 | throw new \Exception('The batch can`t create private folders for '.$sPortal.'! Please check the rights.'); |
| 89 | - } |
|
| 90 | - else { |
|
| 86 | + } else { |
|
| 91 | 87 | |
| 92 | 88 | if (!file_exists($sPrivatePath.'Controller')) { |
| 93 | 89 | |
@@ -97,8 +93,7 @@ discard block |
||
| 97 | 93 | mkdir($sPrivatePath . 'View', 0777, true); |
| 98 | 94 | mkdir($sPrivatePath . 'conf', 0777, true); |
| 99 | 95 | mkdir($sPrivatePath . 'common', 0777, true); |
| 100 | - } |
|
| 101 | - else { |
|
| 96 | + } else { |
|
| 102 | 97 | |
| 103 | 98 | echo 'The Project (private part) ' . $sPrivatePath . " exists\n"; |
| 104 | 99 | } |
@@ -48,8 +48,7 @@ |
||
| 48 | 48 | |
| 49 | 49 | require $sFileClassName; |
| 50 | 50 | } |
| 51 | - } |
|
| 52 | - else { |
|
| 51 | + } else { |
|
| 53 | 52 | |
| 54 | 53 | if (strstr($sFileName, 'Venus\\') && file_exists(preg_replace('#^(src/[a-zA-Z0-9_]+/)#', '$1app/', str_replace(['\\', '/'], '/', str_replace('conf', '', __DIR__).str_replace('Venus\\', '', $sFileName))))) { |
| 55 | 54 | |
@@ -19,8 +19,7 @@ |
||
| 19 | 19 | { |
| 20 | 20 | if (isset($_COOKIE[$name]) && $_COOKIE[$name] != '') { |
| 21 | 21 | return $_COOKIE[$name]; |
| 22 | - } |
|
| 23 | - else if ($default != null) { |
|
| 22 | + } else if ($default != null) { |
|
| 24 | 23 | return $default; |
| 25 | 24 | } |
| 26 | 25 | } |
@@ -19,8 +19,7 @@ |
||
| 19 | 19 | { |
| 20 | 20 | if (isset($_COOKIE[$name]) && $_COOKIE[$name] != '') { |
| 21 | 21 | return $_COOKIE[$name]; |
| 22 | - } |
|
| 23 | - else if ($default != null) { |
|
| 22 | + } else if ($default != null) { |
|
| 24 | 23 | return $default; |
| 25 | 24 | } |
| 26 | 25 | } |
@@ -19,8 +19,7 @@ |
||
| 19 | 19 | { |
| 20 | 20 | if (isset($_COOKIE[$name]) && $_COOKIE[$name] != '') { |
| 21 | 21 | return $_COOKIE[$name]; |
| 22 | - } |
|
| 23 | - else if ($default != null) { |
|
| 22 | + } else if ($default != null) { |
|
| 24 | 23 | return $default; |
| 25 | 24 | } |
| 26 | 25 | } |
@@ -19,8 +19,7 @@ |
||
| 19 | 19 | { |
| 20 | 20 | if (isset($_COOKIE[$name]) && $_COOKIE[$name] != '') { |
| 21 | 21 | return $_COOKIE[$name]; |
| 22 | - } |
|
| 23 | - else if ($default != null) { |
|
| 22 | + } else if ($default != null) { |
|
| 24 | 23 | return $default; |
| 25 | 24 | } |
| 26 | 25 | } |