Passed
Branch master (e94900)
by judicael
03:54
created
bundles/lib/Request/Files.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -9,19 +9,19 @@
 block discarded – undo
9 9
 
10 10
 class Files implements RequestInterface
11 11
 {
12
-    /**
13
-     * get parameter
14
-     * @param string $name
15
-     * @param string $default
16
-     * @return string
17
-     */
18
-    public function get(string $name, string $default = null) : string
19
-    {
20
-        if (isset($_FILES[$name]) && $_FILES[$name] != '') {
21
-            return $_FILES[$name];
22
-        }
23
-        else if ($default != null) {
24
-            return $default;
25
-        }
26
-    }
12
+	/**
13
+	 * get parameter
14
+	 * @param string $name
15
+	 * @param string $default
16
+	 * @return string
17
+	 */
18
+	public function get(string $name, string $default = null) : string
19
+	{
20
+		if (isset($_FILES[$name]) && $_FILES[$name] != '') {
21
+			return $_FILES[$name];
22
+		}
23
+		else if ($default != null) {
24
+			return $default;
25
+		}
26
+	}
27 27
 }
28 28
\ No newline at end of file
Please login to merge, or discard this patch.
bundles/lib/Request/Headers.php 1 patch
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -9,37 +9,37 @@
 block discarded – undo
9 9
 
10 10
 class Headers implements RequestInterface
11 11
 {
12
-    /**
13
-     * get parameter
14
-     * @param string $name
15
-     * @param string $default
16
-     * @return string
17
-     */
18
-    public function get(string $name, string $default = null) : string
19
-    {
20
-        if (isset(apache_request_headers()[$name]) && apache_request_headers()[$name] != '') {
21
-            return apache_request_headers()[$name];
22
-        }
23
-        else if ($default != null) {
24
-            return $default;
25
-        }
26
-    }
12
+	/**
13
+	 * get parameter
14
+	 * @param string $name
15
+	 * @param string $default
16
+	 * @return string
17
+	 */
18
+	public function get(string $name, string $default = null) : string
19
+	{
20
+		if (isset(apache_request_headers()[$name]) && apache_request_headers()[$name] != '') {
21
+			return apache_request_headers()[$name];
22
+		}
23
+		else if ($default != null) {
24
+			return $default;
25
+		}
26
+	}
27 27
 
28
-    /**
29
-     * set a new header
30
-     * @param string $name
31
-     * @param string $value
32
-     * @return string|Headers
33
-     */
34
-    public function set(string $name, string $value = null) : Headers
35
-    {
36
-        if ($value !== null) {
37
-            header($name . ': ' . $value);
38
-        }
39
-        else {
40
-            header($name);
41
-        }
28
+	/**
29
+	 * set a new header
30
+	 * @param string $name
31
+	 * @param string $value
32
+	 * @return string|Headers
33
+	 */
34
+	public function set(string $name, string $value = null) : Headers
35
+	{
36
+		if ($value !== null) {
37
+			header($name . ': ' . $value);
38
+		}
39
+		else {
40
+			header($name);
41
+		}
42 42
         
43
-        return $this;
44
-    }
43
+		return $this;
44
+	}
45 45
 }
46 46
\ No newline at end of file
Please login to merge, or discard this patch.
bundles/lib/Request/RequestInterface.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@
 block discarded – undo
9 9
 
10 10
 interface RequestInterface
11 11
 {
12
-    /**
13
-     * get parameter
14
-     * @param string $name
15
-     * @param string $default
16
-     * @return string
17
-     */
18
-    public function get(string $name, string $default = null) : string;
12
+	/**
13
+	 * get parameter
14
+	 * @param string $name
15
+	 * @param string $default
16
+	 * @return string
17
+	 */
18
+	public function get(string $name, string $default = null) : string;
19 19
 }
20 20
\ No newline at end of file
Please login to merge, or discard this patch.
bundles/lib/Request/Request.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -9,19 +9,19 @@
 block discarded – undo
9 9
 
10 10
 class Request implements RequestInterface
11 11
 {
12
-    /**
13
-     * get parameter
14
-     * @param string $name
15
-     * @param string $default
16
-     * @return string
17
-     */
18
-    public function get(string $name, string $default = null) : string
19
-    {
20
-        if (isset($_POST[$name]) && $_POST[$name] != '') {
21
-            return $_POST[$name];
22
-        }
23
-        else if ($default != null) {
24
-            return $default;
25
-        }
26
-    }
12
+	/**
13
+	 * get parameter
14
+	 * @param string $name
15
+	 * @param string $default
16
+	 * @return string
17
+	 */
18
+	public function get(string $name, string $default = null) : string
19
+	{
20
+		if (isset($_POST[$name]) && $_POST[$name] != '') {
21
+			return $_POST[$name];
22
+		}
23
+		else if ($default != null) {
24
+			return $default;
25
+		}
26
+	}
27 27
 }
28 28
\ No newline at end of file
Please login to merge, or discard this patch.
bundles/lib/Request/Query.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -9,19 +9,19 @@
 block discarded – undo
9 9
 
10 10
 class Query implements RequestInterface
11 11
 {
12
-    /**
13
-     * get parameter
14
-     * @param string $name
15
-     * @param string $default
16
-     * @return string
17
-     */
18
-    public function get(string $name, string $default = null) : string
19
-    {
20
-        if (isset($_GET[$name]) && $_GET[$name] != '') {
21
-            return $_GET[$name];
22
-        }
23
-        else if ($default != null) {
24
-            return $default;
25
-        }
26
-    }
12
+	/**
13
+	 * get parameter
14
+	 * @param string $name
15
+	 * @param string $default
16
+	 * @return string
17
+	 */
18
+	public function get(string $name, string $default = null) : string
19
+	{
20
+		if (isset($_GET[$name]) && $_GET[$name] != '') {
21
+			return $_GET[$name];
22
+		}
23
+		else if ($default != null) {
24
+			return $default;
25
+		}
26
+	}
27 27
 }
28 28
\ No newline at end of file
Please login to merge, or discard this patch.
bundles/lib/Request/Cookies.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -9,19 +9,19 @@
 block discarded – undo
9 9
 
10 10
 class Cookies implements RequestInterface
11 11
 {
12
-    /**
13
-     * get parameter
14
-     * @param string $name
15
-     * @param string $default
16
-     * @return string
17
-     */
18
-    public function get(string $name, string $default = null) : string
19
-    {
20
-        if (isset($_COOKIE[$name]) && $_COOKIE[$name] != '') {
21
-            return $_COOKIE[$name];
22
-        }
23
-        else if ($default != null) {
24
-            return $default;
25
-        }
26
-    }
12
+	/**
13
+	 * get parameter
14
+	 * @param string $name
15
+	 * @param string $default
16
+	 * @return string
17
+	 */
18
+	public function get(string $name, string $default = null) : string
19
+	{
20
+		if (isset($_COOKIE[$name]) && $_COOKIE[$name] != '') {
21
+			return $_COOKIE[$name];
22
+		}
23
+		else if ($default != null) {
24
+			return $default;
25
+		}
26
+	}
27 27
 }
28 28
\ No newline at end of file
Please login to merge, or discard this patch.
bundles/core/Config.php 1 patch
Indentation   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -50,17 +50,17 @@  discard block
 block discarded – undo
50 50
 	 */
51 51
 	public static function get(string $sName, string $sPortal = null, bool $bNoDoRedirect = false)
52 52
 	{
53
-	    if ($bNoDoRedirect === true) { $sNameCache = $sName.'_true'; }
54
-	    else { $sNameCache = $sName; }
53
+		if ($bNoDoRedirect === true) { $sNameCache = $sName.'_true'; }
54
+		else { $sNameCache = $sName; }
55 55
 	    
56 56
 		if ($sPortal === null || !is_string($sPortal)) {
57 57
 		    
58
-		    if (defined('PORTAL')) {
58
+			if (defined('PORTAL')) {
59 59
 
60 60
 				$sPortal = PORTAL;
61 61
 				$aDirectories = array($sPortal);
62 62
 			}
63
-		    else {
63
+			else {
64 64
 
65 65
 				$sPortal = '';
66 66
 				$aDirectories = scandir(str_replace('core', 'src', __DIR__));
@@ -73,84 +73,84 @@  discard block
 block discarded – undo
73 73
 
74 74
 			foreach ($aDirectories as $sPortal) {
75 75
 			
76
-			    if ($sPortal != '..' && $sPortal != '.') {
76
+				if ($sPortal != '..' && $sPortal != '.') {
77 77
 
78
-        			if (file_exists(str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-local')) {
78
+					if (file_exists(str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-local')) {
79 79
         
80
-        				$sJsonFile = str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-local';
81
-        				$base = self::_mergeAndGetConf($sJsonFile, $base);
82
-        			}
80
+						$sJsonFile = str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-local';
81
+						$base = self::_mergeAndGetConf($sJsonFile, $base);
82
+					}
83 83
 
84
-        			if (file_exists(str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-local')) {
84
+					if (file_exists(str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-local')) {
85 85
         				
86
-        				$sJsonFile = str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-local';
87
-        				$base = self::_mergeAndGetConf($sJsonFile, $base);
88
-        			}
86
+						$sJsonFile = str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-local';
87
+						$base = self::_mergeAndGetConf($sJsonFile, $base);
88
+					}
89 89
 
90
-        			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) {
90
+					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) {
91 91
         
92
-        				$sJsonFile = str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev';
93
-        				$base = self::_mergeAndGetConf($sJsonFile, $base);
94
-        			}
92
+						$sJsonFile = str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev';
93
+						$base = self::_mergeAndGetConf($sJsonFile, $base);
94
+					}
95 95
 
96
-        			if (file_exists(str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev') && getenv('DEV') == 1) {
96
+					if (file_exists(str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev') && getenv('DEV') == 1) {
97 97
         
98
-        				$sJsonFile = str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev';
99
-        				$base = self::_mergeAndGetConf($sJsonFile, $base);
100
-        			}
98
+						$sJsonFile = str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev';
99
+						$base = self::_mergeAndGetConf($sJsonFile, $base);
100
+					}
101 101
 
102
-        			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) {
102
+					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) {
103 103
         
104
-        				$sJsonFile = str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-prod';
105
-        				$base = self::_mergeAndGetConf($sJsonFile, $base);
106
-        			}
104
+						$sJsonFile = str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-prod';
105
+						$base = self::_mergeAndGetConf($sJsonFile, $base);
106
+					}
107 107
 
108
-        			if (file_exists(str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev') && getenv('PROD') == 1) {
108
+					if (file_exists(str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev') && getenv('PROD') == 1) {
109 109
         
110
-        				$sJsonFile = str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-prod';
111
-        				$base = self::_mergeAndGetConf($sJsonFile, $base);
112
-        			}
110
+						$sJsonFile = str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-prod';
111
+						$base = self::_mergeAndGetConf($sJsonFile, $base);
112
+					}
113 113
 
114
-        			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) {
114
+					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) {
115 115
         
116
-        				$sJsonFile = str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-pprod';
117
-        				$base = self::_mergeAndGetConf($sJsonFile, $base);
118
-        			}
116
+						$sJsonFile = str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-pprod';
117
+						$base = self::_mergeAndGetConf($sJsonFile, $base);
118
+					}
119 119
 
120
-        			if (file_exists(str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev') && getenv('PREPROD') == 1) {
120
+					if (file_exists(str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev') && getenv('PREPROD') == 1) {
121 121
         
122
-        				$sJsonFile = str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-pprod';
123
-        				$base = self::_mergeAndGetConf($sJsonFile, $base);
124
-        			}
122
+						$sJsonFile = str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-pprod';
123
+						$base = self::_mergeAndGetConf($sJsonFile, $base);
124
+					}
125 125
 
126
-        			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) {
126
+					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) {
127 127
         
128
-        				$sJsonFile = str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-rec';
129
-        				$base = self::_mergeAndGetConf($sJsonFile, $base);
130
-        			}
128
+						$sJsonFile = str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-rec';
129
+						$base = self::_mergeAndGetConf($sJsonFile, $base);
130
+					}
131 131
 
132
-        			if (file_exists(str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev') && getenv('RECETTE') == 1) {
132
+					if (file_exists(str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-dev') && getenv('RECETTE') == 1) {
133 133
         
134
-        				$sJsonFile = str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-rec';
135
-        				$base = self::_mergeAndGetConf($sJsonFile, $base);
136
-        			}
134
+						$sJsonFile = str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-rec';
135
+						$base = self::_mergeAndGetConf($sJsonFile, $base);
136
+					}
137 137
 
138
-        			if (file_exists(str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-local')) {
138
+					if (file_exists(str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-local')) {
139 139
         
140
-        				$sJsonFile = str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-local';
141
-        				$base = self::_mergeAndGetConf($sJsonFile, $base);
142
-        			}
140
+						$sJsonFile = str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf-local';
141
+						$base = self::_mergeAndGetConf($sJsonFile, $base);
142
+					}
143 143
 
144
-        			if (file_exists(str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf')) {
144
+					if (file_exists(str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf')) {
145 145
         
146
-        				$sJsonFile = str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf';
147
-        				$base = self::_mergeAndGetConf($sJsonFile, $base);
148
-        			}
146
+						$sJsonFile = str_replace('core', 'src'.DIRECTORY_SEPARATOR.$sPortal.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf';
147
+						$base = self::_mergeAndGetConf($sJsonFile, $base);
148
+					}
149 149
         
150
-        			$sJsonFile = str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf';
151
-        			$base = self::_mergeAndGetConf($sJsonFile, $base);
152
-			    }
153
-		    }
150
+					$sJsonFile = str_replace('core', 'conf', __DIR__).DIRECTORY_SEPARATOR.$sName.'.conf';
151
+					$base = self::_mergeAndGetConf($sJsonFile, $base);
152
+				}
153
+			}
154 154
 
155 155
 			if ($base === '') {
156 156
 				
@@ -185,10 +185,10 @@  discard block
 block discarded – undo
185 185
 	 */
186 186
 	public static function getBundleLocationName(string $sName): string
187 187
 	{
188
-	    $oConfig = self::get($sName, null, true);
188
+		$oConfig = self::get($sName, null, true);
189 189
 
190
-	    if (isset($oConfig->redirect)) { return $oConfig->redirect; }
191
-	    else { return PORTAL; }
190
+		if (isset($oConfig->redirect)) { return $oConfig->redirect; }
191
+		else { return PORTAL; }
192 192
 	}
193 193
 
194 194
 	/**
Please login to merge, or discard this patch.
bundles/core/Router.php 1 patch
Indentation   +106 added lines, -106 removed lines patch added patch discarded remove patch
@@ -82,8 +82,8 @@  discard block
 block discarded – undo
82 82
 	 */
83 83
 	public function __construct() 
84 84
 	{
85
-	    $oLogger = Debug::getInstance();
86
-	    $this->setLogger($oLogger);
85
+		$oLogger = Debug::getInstance();
86
+		$this->setLogger($oLogger);
87 87
 	}
88 88
 
89 89
 	/**
@@ -100,120 +100,120 @@  discard block
 block discarded – undo
100 100
 
101 101
 		if (Request::isHttpRequest()) {
102 102
         
103
-		    // Search if a Less file exists
104
-		    if (defined('LESS_ACTIVE') && LESS_ACTIVE === true) {
103
+			// Search if a Less file exists
104
+			if (defined('LESS_ACTIVE') && LESS_ACTIVE === true) {
105 105
 		        
106
-		        if (strstr($_SERVER['REQUEST_URI'], '.css')
107
-                    && file_exists(preg_replace('/\.css/', '.less', $_SERVER['REQUEST_URI']))) {
106
+				if (strstr($_SERVER['REQUEST_URI'], '.css')
107
+					&& file_exists(preg_replace('/\.css/', '.less', $_SERVER['REQUEST_URI']))) {
108 108
 		        
109
-		            Less::toCss($_SERVER['REQUEST_URI']);
110
-		            exit;
111
-		        }
112
-		    }
109
+					Less::toCss($_SERVER['REQUEST_URI']);
110
+					exit;
111
+				}
112
+			}
113 113
 		    
114
-		    // Search if a typescript file exists
115
-		    if (defined('TYPESCRIPT_ACTIVE') && TYPESCRIPT_ACTIVE === true) {
114
+			// Search if a typescript file exists
115
+			if (defined('TYPESCRIPT_ACTIVE') && TYPESCRIPT_ACTIVE === true) {
116 116
 		    
117
-		        if (strstr($_SERVER['REQUEST_URI'], '.js')
118
-		        && file_exists(preg_replace('/\.js/', '.ts', $_SERVER['REQUEST_URI']))) {
117
+				if (strstr($_SERVER['REQUEST_URI'], '.js')
118
+				&& file_exists(preg_replace('/\.js/', '.ts', $_SERVER['REQUEST_URI']))) {
119 119
 		    
120
-		            Typescript::toJs($_SERVER['REQUEST_URI']);
121
-		            exit;
122
-		        }
123
-		    }
120
+					Typescript::toJs($_SERVER['REQUEST_URI']);
121
+					exit;
122
+				}
123
+			}
124 124
 		    
125
-		    // Search public files in all plugins
126
-		    if ($_SERVER['REQUEST_URI'] !== '/') {
125
+			// Search public files in all plugins
126
+			if ($_SERVER['REQUEST_URI'] !== '/') {
127 127
 	
128
-    		    foreach (Config::get('Plugins')->list as $iKey => $sPlugin) {
128
+				foreach (Config::get('Plugins')->list as $iKey => $sPlugin) {
129 129
     		        
130
-    		        if (file_exists(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.$sPlugin.DIRECTORY_SEPARATOR.'public'.$_SERVER['REQUEST_URI'])) {
130
+					if (file_exists(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.$sPlugin.DIRECTORY_SEPARATOR.'public'.$_SERVER['REQUEST_URI'])) {
131 131
     		            
132
-    		            echo file_get_contents(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.$sPlugin.DIRECTORY_SEPARATOR.'public'.$_SERVER['REQUEST_URI']);
133
-                        exit;
134
-    		        }
135
-                    else if (strstr($_SERVER['REQUEST_URI'], '.css')
136
-		                && file_exists(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.$sPlugin.DIRECTORY_SEPARATOR.'public'.preg_replace('/\.css/', '.less', $_SERVER['REQUEST_URI']))) {
137
-
138
-		                Less::toCss(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.$sPlugin.DIRECTORY_SEPARATOR.'public'.preg_replace('/\.css/', '.less', $_SERVER['REQUEST_URI']));
139
-		                exit;
140
-                    }
141
-		            else if (strstr($_SERVER['REQUEST_URI'], '.js')
142
-		                && file_exists(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.$sPlugin.DIRECTORY_SEPARATOR.'public'.preg_replace('/\.js/', '.ts', $_SERVER['REQUEST_URI']))) {
143
-
144
-		                Typescript::toJs(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.$sPlugin.DIRECTORY_SEPARATOR.'public'.preg_replace('/\.js/', '.ts', $_SERVER['REQUEST_URI']));
145
-		                exit;
146
-		            }
147
-		        }
148
-	        }
132
+						echo file_get_contents(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.$sPlugin.DIRECTORY_SEPARATOR.'public'.$_SERVER['REQUEST_URI']);
133
+						exit;
134
+					}
135
+					else if (strstr($_SERVER['REQUEST_URI'], '.css')
136
+						&& file_exists(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.$sPlugin.DIRECTORY_SEPARATOR.'public'.preg_replace('/\.css/', '.less', $_SERVER['REQUEST_URI']))) {
137
+
138
+						Less::toCss(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.$sPlugin.DIRECTORY_SEPARATOR.'public'.preg_replace('/\.css/', '.less', $_SERVER['REQUEST_URI']));
139
+						exit;
140
+					}
141
+					else if (strstr($_SERVER['REQUEST_URI'], '.js')
142
+						&& file_exists(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.$sPlugin.DIRECTORY_SEPARATOR.'public'.preg_replace('/\.js/', '.ts', $_SERVER['REQUEST_URI']))) {
143
+
144
+						Typescript::toJs(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.$sPlugin.DIRECTORY_SEPARATOR.'public'.preg_replace('/\.js/', '.ts', $_SERVER['REQUEST_URI']));
145
+						exit;
146
+					}
147
+				}
148
+			}
149 149
 		    
150 150
 			foreach (Config::get('Route') as $sMultiHost => $oHost) {
151 151
 
152
-			    foreach (explode(',', $sMultiHost) as $sHost) {
152
+				foreach (explode(',', $sMultiHost) as $sHost) {
153 153
 
154
-    				if ((!strstr($sHost, '/') && $sHost == $_SERVER['HTTP_HOST']) || (strstr($sHost, '/')
155
-    					&& strstr($_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'], $sHost))) {
154
+					if ((!strstr($sHost, '/') && $sHost == $_SERVER['HTTP_HOST']) || (strstr($sHost, '/')
155
+						&& strstr($_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'], $sHost))) {
156 156
     
157
-    					$this->_oRoutes = $oHost;
157
+						$this->_oRoutes = $oHost;
158 158
 
159
-    					if (strstr($sHost, '/')
160
-    						&& strstr($_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'], $sHost)) {
159
+						if (strstr($sHost, '/')
160
+							&& strstr($_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'], $sHost)) {
161 161
 
162
-    						$this->_sBaseUri = preg_replace('#^[^/]+#', '', $sHost);
163
-    					}
162
+							$this->_sBaseUri = preg_replace('#^[^/]+#', '', $sHost);
163
+						}
164 164
     
165
-    					if (isset($oHost->location)) {
165
+						if (isset($oHost->location)) {
166 166
     
167
-    						header('Status: 301 Moved Permanently', false, 301);
168
-    	  					header('Location: '.$oHost->location);
169
-    	  					exit;
170
-    					}
171
-    					else if (preg_match('#getCss\?#', $_SERVER['REQUEST_URI'])) {
167
+							header('Status: 301 Moved Permanently', false, 301);
168
+		  					header('Location: '.$oHost->location);
169
+		  					exit;
170
+						}
171
+						else if (preg_match('#getCss\?#', $_SERVER['REQUEST_URI'])) {
172 172
     					    
173
-    					    foreach ($_GET as $sKey => $sValue) {
173
+							foreach ($_GET as $sKey => $sValue) {
174 174
 
175
-    					        if (file_exists(str_replace(DIRECTORY_SEPARATOR.'core', DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR, __DIR__).$sKey.'.css')) {
175
+								if (file_exists(str_replace(DIRECTORY_SEPARATOR.'core', DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR, __DIR__).$sKey.'.css')) {
176 176
     					            
177
-    					            echo file_get_contents(str_replace(DIRECTORY_SEPARATOR.'core', DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR, __DIR__).$sKey.'.css')."\n";
178
-    					        }
179
-    					    }
177
+									echo file_get_contents(str_replace(DIRECTORY_SEPARATOR.'core', DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR, __DIR__).$sKey.'.css')."\n";
178
+								}
179
+							}
180 180
     					    
181
-    					    exit;
182
-    					}
183
-    					else if (preg_match('#getJs\?#', $_SERVER['REQUEST_URI'])) {
181
+							exit;
182
+						}
183
+						else if (preg_match('#getJs\?#', $_SERVER['REQUEST_URI'])) {
184 184
     					    
185
-    					    foreach ($_GET as $sKey => $sValue) {
185
+							foreach ($_GET as $sKey => $sValue) {
186 186
 
187
-    					        if (file_exists(str_replace(DIRECTORY_SEPARATOR.'core', DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR, __DIR__).$sKey.'.js')) {
187
+								if (file_exists(str_replace(DIRECTORY_SEPARATOR.'core', DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR, __DIR__).$sKey.'.js')) {
188 188
     					            
189
-    					            echo file_get_contents(str_replace(DIRECTORY_SEPARATOR.'core', DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR, __DIR__).$sKey.'.js')."\n";
190
-    					        }
191
-    					    }
189
+									echo file_get_contents(str_replace(DIRECTORY_SEPARATOR.'core', DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR, __DIR__).$sKey.'.js')."\n";
190
+								}
191
+							}
192 192
     					    
193
-    					    exit;
194
-    					}
195
-    					else if (isset($oHost->routes)) {
193
+							exit;
194
+						}
195
+						else if (isset($oHost->routes)) {
196 196
     
197
-    						foreach($oHost->routes as $sKey => $oRoute) {
197
+							foreach($oHost->routes as $sKey => $oRoute) {
198 198
 
199
-    							$mReturn = $this->_route($oRoute, $_SERVER['REQUEST_URI']);
199
+								$mReturn = $this->_route($oRoute, $_SERVER['REQUEST_URI']);
200 200
 
201
-    							if ($mReturn === 403) {
201
+								if ($mReturn === 403) {
202 202
     
203
-    								$this->_getPage403();
204
-    							}
205
-    							else if ($mReturn == true) {
203
+									$this->_getPage403();
204
+								}
205
+								else if ($mReturn == true) {
206 206
     
207
-    								if (isset($oRoute->cache)) { $this->_checkCache($oRoute->cache); }
207
+									if (isset($oRoute->cache)) { $this->_checkCache($oRoute->cache); }
208 208
     
209
-    								return true;
210
-    							}							
211
-    						}
209
+									return true;
210
+								}							
211
+							}
212 212
     
213
-    						$this->_getPage404();
214
-    					}
215
-    				}
216
-			    }
213
+							$this->_getPage404();
214
+						}
215
+					}
216
+				}
217 217
 
218 218
 				//@todo fait l'erreur à chaque passage
219 219
 //				if ($sHost !== $_SERVER['HTTP_HOST']) {
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 //				}
228 228
 			}
229 229
 		}
230
-        else if (Request::isCliRequest()) {
230
+		else if (Request::isCliRequest()) {
231 231
 
232 232
 			if (isset($_SERVER['argv'])) { $aArguments = $_SERVER['argv']; }
233 233
 			else { $aArguments = $argv; }
@@ -235,15 +235,15 @@  discard block
 block discarded – undo
235 235
 			define('PORTAL', 'Batch');
236 236
 			set_include_path(get_include_path().PATH_SEPARATOR.'src'.PATH_SEPARATOR.PORTAL.PATH_SEPARATOR.'public');
237 237
 
238
-            if (!isset($aArguments[1]) && strstr($aArguments[0], '/phpunit')) {
238
+			if (!isset($aArguments[1]) && strstr($aArguments[0], '/phpunit')) {
239 239
 
240
-                $sBatchName = "phpunit";
241
-                $aArguments[0] = "bin/console";
242
-                $aArguments[1] = "phpunit";
243
-            }
244
-            else {
245
-                $sBatchName = $aArguments[1];
246
-            }
240
+				$sBatchName = "phpunit";
241
+				$aArguments[0] = "bin/console";
242
+				$aArguments[1] = "phpunit";
243
+			}
244
+			else {
245
+				$sBatchName = $aArguments[1];
246
+			}
247 247
 
248 248
 			if (isset(Config::get('Route')->batch->script->{$sBatchName})) {
249 249
 
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 						array_shift($aArguments);
286 286
 					}
287 287
 				}
288
-      		}
288
+	  		}
289 289
 
290 290
 			if (isset($oBatch->controller) && isset($oBatch->action)) {
291 291
 
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
 			foreach (Config::get('Route') as $sHost => $oHost) {
359 359
 
360 360
 				if ((!strstr($sHost, '/') && $sHost == $_SERVER['HTTP_HOST'])
361
-				    || (strstr($sHost, '/') && strstr($_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'], $sHost))) {
361
+					|| (strstr($sHost, '/') && strstr($_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'], $sHost))) {
362 362
 
363 363
 					$this->_oRoutes = $oHost->routes;
364 364
 
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
 
389 389
 		if (isset($oRoute->route)) {
390 390
 
391
-		    $sRoute = str_replace("*", ".*", $oRoute->route);
391
+			$sRoute = str_replace("*", ".*", $oRoute->route);
392 392
 
393 393
 			$sFinalRoute = preg_replace_callback(
394 394
 				'|\[/{0,1}:([a-zA-Z_]+)\]|',
@@ -464,8 +464,8 @@  discard block
 block discarded – undo
464 464
 
465 465
 			if (isset($oRoute->controller)) {
466 466
 
467
-			    define('PORTAL', preg_replace('/^\\\\Venus\\\\src\\\\([a-zA-Z0-9_]+)\\\\.+$/', '$1', $oRoute->controller));
468
-			    set_include_path(get_include_path().PATH_SEPARATOR.'src'.PATH_SEPARATOR.PORTAL.PATH_SEPARATOR.'public');
467
+				define('PORTAL', preg_replace('/^\\\\Venus\\\\src\\\\([a-zA-Z0-9_]+)\\\\.+$/', '$1', $oRoute->controller));
468
+				set_include_path(get_include_path().PATH_SEPARATOR.'src'.PATH_SEPARATOR.PORTAL.PATH_SEPARATOR.'public');
469 469
 			     
470 470
 				if (isset($oRoute->content_type)) {
471 471
 
@@ -519,7 +519,7 @@  discard block
 block discarded – undo
519 519
 						}
520 520
 						else {
521 521
 
522
-						    $this->_oLogger->warning('Error: Parameter '.$sName.' not exists!');
522
+							$this->_oLogger->warning('Error: Parameter '.$sName.' not exists!');
523 523
 							break;
524 524
 						}
525 525
 					}
@@ -545,10 +545,10 @@  discard block
 block discarded – undo
545 545
 			}
546 546
 			else if (isset($oRoute->template) && isset($oRoute->layout) && $oRoute->layout === true) {
547 547
 
548
-			    define('PORTAL', preg_replace('/^\\\\Venus\\\\src\\\\([a-zA-Z0-9_]+)\\\\.+$/', '$1', $oRoute->template));
549
-			    set_include_path(get_include_path().PATH_SEPARATOR.'src'.PATH_SEPARATOR.PORTAL.PATH_SEPARATOR.'public');
548
+				define('PORTAL', preg_replace('/^\\\\Venus\\\\src\\\\([a-zA-Z0-9_]+)\\\\.+$/', '$1', $oRoute->template));
549
+				set_include_path(get_include_path().PATH_SEPARATOR.'src'.PATH_SEPARATOR.PORTAL.PATH_SEPARATOR.'public');
550 550
 			    
551
-			    $oLayout = Vendor::getVendor('Apollina\Template', DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.PORTAL.DIRECTORY_SEPARATOR.'View'.DIRECTORY_SEPARATOR.'Layout.tpl');
551
+				$oLayout = Vendor::getVendor('Apollina\Template', DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.PORTAL.DIRECTORY_SEPARATOR.'View'.DIRECTORY_SEPARATOR.'Layout.tpl');
552 552
 
553 553
 				if (isset($oRoute->vars)) {
554 554
 
@@ -563,8 +563,8 @@  discard block
 block discarded – undo
563 563
 			}
564 564
 			else if (isset($oRoute->template)) {
565 565
 
566
-			    define('PORTAL', preg_replace('/^\\\\Venus\\\\src\\\\([a-zA-Z0-9_]+)\\\\.+$/', '$1', $oRoute->template));
567
-			    set_include_path(get_include_path().PATH_SEPARATOR.'src'.PATH_SEPARATOR.PORTAL.PATH_SEPARATOR.'public');
566
+				define('PORTAL', preg_replace('/^\\\\Venus\\\\src\\\\([a-zA-Z0-9_]+)\\\\.+$/', '$1', $oRoute->template));
567
+				set_include_path(get_include_path().PATH_SEPARATOR.'src'.PATH_SEPARATOR.PORTAL.PATH_SEPARATOR.'public');
568 568
 			    
569 569
 				$oTemplate = Vendor::getVendor('Apollina\Template', DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.PORTAL.DIRECTORY_SEPARATOR.'View'.DIRECTORY_SEPARATOR.$oRoute->template.'.tpl');
570 570
 
@@ -664,14 +664,14 @@  discard block
 block discarded – undo
664 664
 		
665 665
 		if (method_exists($oController, 'beforeExecuteRoute')) { 
666 666
 		    
667
-		    call_user_func_array(array($oController, 'beforeExecuteRoute'), array());
667
+			call_user_func_array(array($oController, 'beforeExecuteRoute'), array());
668 668
 		}
669 669
 
670 670
 		$mReturnController = call_user_func_array(array($oController, $sActionName), $aParams);
671 671
 
672 672
 		if (method_exists($oController, 'afterExecuteRoute')) { 
673 673
 		    
674
-		    call_user_func_array(array($oController, 'afterExecuteRoute'), array());
674
+			call_user_func_array(array($oController, 'afterExecuteRoute'), array());
675 675
 		}
676 676
 		
677 677
 		$mReturn = ob_get_clean();
@@ -811,6 +811,6 @@  discard block
 block discarded – undo
811 811
 	 */
812 812
 	public function setLogger(LoggerInterface $logger) {
813 813
 	    
814
-	    $this->_oLogger = $logger;
814
+		$this->_oLogger = $logger;
815 815
 	}
816 816
 }
Please login to merge, or discard this patch.
bundles/core/Controller.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -43,13 +43,13 @@  discard block
 block discarded – undo
43 43
 abstract class Controller extends Mother 
44 44
 {
45 45
 	
46
-    /**
47
-     * Cache to know if a model was initialize or not because we must initialize it just one time by script
48
-     * 
49
-     * @access private
50
-     * @var    array
51
-     */
52
-    private static $_aInitialize = array();
46
+	/**
47
+	 * Cache to know if a model was initialize or not because we must initialize it just one time by script
48
+	 * 
49
+	 * @access private
50
+	 * @var    array
51
+	 */
52
+	private static $_aInitialize = array();
53 53
     
54 54
 	/**
55 55
 	 * Constructor
@@ -95,11 +95,11 @@  discard block
 block discarded – undo
95 95
 		 */
96 96
 		if (method_exists(get_called_class(), 'initialize')) {
97 97
 		    
98
-		    if (!isset(self::$_aInitialize[get_called_class()])) { 
98
+			if (!isset(self::$_aInitialize[get_called_class()])) { 
99 99
 		        
100
-		        static::initialize();
101
-		        self::$_aInitialize[get_called_class()] = true;
102
-		    }
100
+				static::initialize();
101
+				self::$_aInitialize[get_called_class()] = true;
102
+			}
103 103
 		}
104 104
 		
105 105
 		/**
@@ -169,12 +169,12 @@  discard block
 block discarded – undo
169 169
 	 */
170 170
 	public function __get($mKey)
171 171
 	{
172
-	    if (isset($this->di) && property_exists($this, 'di')) {
172
+		if (isset($this->di) && property_exists($this, 'di')) {
173 173
 
174
-    	    $mDi = $this->di->get($mKey);
174
+			$mDi = $this->di->get($mKey);
175 175
 
176
-    		if (isset($mDi) && $mDi != false) { return $mDi; }
177
-	    }
176
+			if (isset($mDi) && $mDi != false) { return $mDi; }
177
+		}
178 178
 		
179 179
 		return parent::__get($mKey);
180 180
 	}
Please login to merge, or discard this patch.