@@ -29,16 +29,16 @@ discard block |
||
29 | 29 | public static function read($sConfigFile, $sLibKey = '', $sAppKey = null) |
30 | 30 | { |
31 | 31 | $sConfigFile = realpath($sConfigFile); |
32 | - if(!extension_loaded('yaml')) |
|
32 | + if (!extension_loaded('yaml')) |
|
33 | 33 | { |
34 | 34 | throw new \Jaxon\Exception\Config\Yaml(jaxon_trans('config.errors.yaml.install')); |
35 | 35 | } |
36 | - if(!is_readable($sConfigFile)) |
|
36 | + if (!is_readable($sConfigFile)) |
|
37 | 37 | { |
38 | 38 | throw new \Jaxon\Exception\Config\File(jaxon_trans('config.errors.file.access', array('path' => $sConfigFile))); |
39 | 39 | } |
40 | 40 | $aConfigOptions = yaml_parse_file($sConfigFile); |
41 | - if(!is_array($aConfigOptions)) |
|
41 | + if (!is_array($aConfigOptions)) |
|
42 | 42 | { |
43 | 43 | throw new \Jaxon\Exception\Config\File(jaxon_trans('config.errors.file.content', array('path' => $sConfigFile))); |
44 | 44 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | // Setup the config options into the library. |
47 | 47 | $jaxon = jaxon(); |
48 | 48 | $jaxon->setOptions($aConfigOptions, $sLibKey); |
49 | - if(!is_string($sAppKey)) |
|
49 | + if (!is_string($sAppKey)) |
|
50 | 50 | { |
51 | 51 | return null; |
52 | 52 | } |
@@ -29,12 +29,12 @@ discard block |
||
29 | 29 | public static function read($sConfigFile, $sLibKey = '', $sAppKey = null) |
30 | 30 | { |
31 | 31 | $sConfigFile = realpath($sConfigFile); |
32 | - if(!is_readable($sConfigFile)) |
|
32 | + if (!is_readable($sConfigFile)) |
|
33 | 33 | { |
34 | 34 | throw new \Jaxon\Exception\Config\File(jaxon_trans('config.errors.file.access', array('path' => $sConfigFile))); |
35 | 35 | } |
36 | 36 | $aConfigOptions = include($sConfigFile); |
37 | - if(!is_array($aConfigOptions)) |
|
37 | + if (!is_array($aConfigOptions)) |
|
38 | 38 | { |
39 | 39 | throw new \Jaxon\Exception\Config\File(jaxon_trans('config.errors.file.content', array('path' => $sConfigFile))); |
40 | 40 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | // Setup the config options into the library. |
43 | 43 | $jaxon = jaxon(); |
44 | 44 | $jaxon->setOptions($aConfigOptions, $sLibKey); |
45 | - if(!is_string($sAppKey)) |
|
45 | + if (!is_string($sAppKey)) |
|
46 | 46 | { |
47 | 47 | return null; |
48 | 48 | } |
@@ -91,19 +91,19 @@ discard block |
||
91 | 91 | */ |
92 | 92 | public static function make($xValue) |
93 | 93 | { |
94 | - if($xValue instanceof Interfaces\Parameter) |
|
94 | + if ($xValue instanceof Interfaces\Parameter) |
|
95 | 95 | { |
96 | 96 | return $xValue; |
97 | 97 | } |
98 | - elseif(is_numeric($xValue)) |
|
98 | + elseif (is_numeric($xValue)) |
|
99 | 99 | { |
100 | 100 | return new Parameter(Jaxon::NUMERIC_VALUE, $xValue); |
101 | 101 | } |
102 | - elseif(is_string($xValue)) |
|
102 | + elseif (is_string($xValue)) |
|
103 | 103 | { |
104 | 104 | return new Parameter(Jaxon::QUOTED_VALUE, $xValue); |
105 | 105 | } |
106 | - elseif(is_bool($xValue)) |
|
106 | + elseif (is_bool($xValue)) |
|
107 | 107 | { |
108 | 108 | return new Parameter(Jaxon::BOOL_VALUE, $xValue); |
109 | 109 | } |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | { |
123 | 123 | $sJsCode = ''; |
124 | 124 | $sQuoteCharacter = "'"; |
125 | - switch($this->sType) |
|
125 | + switch ($this->sType) |
|
126 | 126 | { |
127 | 127 | case Jaxon::FORM_VALUES: |
128 | 128 | $sFormID = (string)$this->xValue; |
@@ -130,11 +130,11 @@ discard block |
||
130 | 130 | break; |
131 | 131 | case Jaxon::INPUT_VALUE: |
132 | 132 | $sInputID = (string)$this->xValue; |
133 | - $sJsCode = "jaxon.$(" . $sQuoteCharacter . $sInputID . $sQuoteCharacter . ").value"; |
|
133 | + $sJsCode = "jaxon.$(" . $sQuoteCharacter . $sInputID . $sQuoteCharacter . ").value"; |
|
134 | 134 | break; |
135 | 135 | case Jaxon::CHECKED_VALUE: |
136 | 136 | $sCheckedID = (string)$this->xValue; |
137 | - $sJsCode = "jaxon.$(" . $sQuoteCharacter . $sCheckedID . $sQuoteCharacter . ").checked"; |
|
137 | + $sJsCode = "jaxon.$(" . $sQuoteCharacter . $sCheckedID . $sQuoteCharacter . ").checked"; |
|
138 | 138 | break; |
139 | 139 | case Jaxon::ELEMENT_INNERHTML: |
140 | 140 | $sElementID = (string)$this->xValue; |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | $sJsCode = (string)$this->xValue; |
154 | 154 | break; |
155 | 155 | case Jaxon::JS_VALUE: |
156 | - if(is_array($this->xValue) || is_object($this->xValue)) |
|
156 | + if (is_array($this->xValue) || is_object($this->xValue)) |
|
157 | 157 | { |
158 | 158 | // Unable to use double quotes here because they cannot be handled on client side. |
159 | 159 | // So we are using simple quotes even if the Json standard recommends double quotes. |
@@ -94,20 +94,16 @@ discard block |
||
94 | 94 | if($xValue instanceof Interfaces\Parameter) |
95 | 95 | { |
96 | 96 | return $xValue; |
97 | - } |
|
98 | - elseif(is_numeric($xValue)) |
|
97 | + } elseif(is_numeric($xValue)) |
|
99 | 98 | { |
100 | 99 | return new Parameter(Jaxon::NUMERIC_VALUE, $xValue); |
101 | - } |
|
102 | - elseif(is_string($xValue)) |
|
100 | + } elseif(is_string($xValue)) |
|
103 | 101 | { |
104 | 102 | return new Parameter(Jaxon::QUOTED_VALUE, $xValue); |
105 | - } |
|
106 | - elseif(is_bool($xValue)) |
|
103 | + } elseif(is_bool($xValue)) |
|
107 | 104 | { |
108 | 105 | return new Parameter(Jaxon::BOOL_VALUE, $xValue); |
109 | - } |
|
110 | - else // if(is_array($xValue) || is_object($xValue)) |
|
106 | + } else // if(is_array($xValue) || is_object($xValue)) |
|
111 | 107 | { |
112 | 108 | return new Parameter(Jaxon::JS_VALUE, $xValue); |
113 | 109 | } |
@@ -158,8 +154,7 @@ discard block |
||
158 | 154 | // Unable to use double quotes here because they cannot be handled on client side. |
159 | 155 | // So we are using simple quotes even if the Json standard recommends double quotes. |
160 | 156 | $sJsCode = str_replace(['"'], ["'"], json_encode($this->xValue, JSON_HEX_APOS | JSON_HEX_QUOT)); |
161 | - } |
|
162 | - else |
|
157 | + } else |
|
163 | 158 | { |
164 | 159 | $sJsCode = (string)$this->xValue; |
165 | 160 | } |
@@ -51,11 +51,11 @@ discard block |
||
51 | 51 | |
52 | 52 | $this->sRequestedEvent = null; |
53 | 53 | |
54 | - if(isset($_GET['jxnevt'])) |
|
54 | + if (isset($_GET['jxnevt'])) |
|
55 | 55 | { |
56 | 56 | $this->sRequestedEvent = $_GET['jxnevt']; |
57 | 57 | } |
58 | - if(isset($_POST['jxnevt'])) |
|
58 | + if (isset($_POST['jxnevt'])) |
|
59 | 59 | { |
60 | 60 | $this->sRequestedEvent = $_POST['jxnevt']; |
61 | 61 | } |
@@ -80,19 +80,19 @@ discard block |
||
80 | 80 | */ |
81 | 81 | public function register($aArgs) |
82 | 82 | { |
83 | - if(count($aArgs) > 1) |
|
83 | + if (count($aArgs) > 1) |
|
84 | 84 | { |
85 | 85 | $sType = $aArgs[0]; |
86 | 86 | |
87 | - if($sType == Jaxon::BROWSER_EVENT) |
|
87 | + if ($sType == Jaxon::BROWSER_EVENT) |
|
88 | 88 | { |
89 | 89 | $sEvent = $aArgs[1]; |
90 | - if(!isset($this->aEvents[$sEvent])) |
|
90 | + if (!isset($this->aEvents[$sEvent])) |
|
91 | 91 | { |
92 | 92 | $xBrowserEvent = new \Jaxon\Support\BrowserEvent($sEvent); |
93 | - if(count($aArgs) > 2 && is_array($aArgs[2])) |
|
93 | + if (count($aArgs) > 2 && is_array($aArgs[2])) |
|
94 | 94 | { |
95 | - foreach($aArgs[2] as $sKey => $sValue) |
|
95 | + foreach ($aArgs[2] as $sKey => $sValue) |
|
96 | 96 | { |
97 | 97 | $xBrowserEvent->configure($sKey, $sValue); |
98 | 98 | } |
@@ -101,13 +101,13 @@ discard block |
||
101 | 101 | return $xBrowserEvent->generateRequest(); |
102 | 102 | } |
103 | 103 | } |
104 | - elseif($sType == Jaxon::EVENT_HANDLER) |
|
104 | + elseif ($sType == Jaxon::EVENT_HANDLER) |
|
105 | 105 | { |
106 | 106 | $sEvent = $aArgs[1]; |
107 | - if(isset($this->aEvents[$sEvent]) && isset($aArgs[2])) |
|
107 | + if (isset($this->aEvents[$sEvent]) && isset($aArgs[2])) |
|
108 | 108 | { |
109 | 109 | $xUserFunction = $aArgs[2]; |
110 | - if(!($xUserFunction instanceof \Jaxon\Request\Support\UserFunction)) |
|
110 | + if (!($xUserFunction instanceof \Jaxon\Request\Support\UserFunction)) |
|
111 | 111 | { |
112 | 112 | $xUserFunction = new \Jaxon\Request\Support\UserFunction($xUserFunction); |
113 | 113 | } |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | public function generateHash() |
130 | 130 | { |
131 | 131 | $sHash = ''; |
132 | - foreach($this->aEvents as $xEvent) |
|
132 | + foreach ($this->aEvents as $xEvent) |
|
133 | 133 | { |
134 | 134 | $sHash .= $xEvent->getName(); |
135 | 135 | } |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | public function getScript() |
145 | 145 | { |
146 | 146 | $sCode = ''; |
147 | - foreach($this->aEvents as $xEvent) |
|
147 | + foreach ($this->aEvents as $xEvent) |
|
148 | 148 | { |
149 | 149 | $sCode .= $xEvent->getScript(); |
150 | 150 | } |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | public function canProcessRequest() |
160 | 160 | { |
161 | 161 | // Check the validity of the event name |
162 | - if(($this->sRequestedEvent) && !$this->validateEvent($this->sRequestedEvent)) |
|
162 | + if (($this->sRequestedEvent) && !$this->validateEvent($this->sRequestedEvent)) |
|
163 | 163 | { |
164 | 164 | $this->sRequestedEvent = null; |
165 | 165 | } |
@@ -173,12 +173,12 @@ discard block |
||
173 | 173 | */ |
174 | 174 | public function processRequest() |
175 | 175 | { |
176 | - if(!$this->canProcessRequest()) |
|
176 | + if (!$this->canProcessRequest()) |
|
177 | 177 | return false; |
178 | 178 | |
179 | 179 | $aArgs = $this->getRequestManager()->process(); |
180 | 180 | |
181 | - if(array_key_exists($this->sRequestedEvent, $this->aEvents)) |
|
181 | + if (array_key_exists($this->sRequestedEvent, $this->aEvents)) |
|
182 | 182 | { |
183 | 183 | $this->aEvents[$this->sRequestedEvent]->fire($aArgs); |
184 | 184 | return true; |
@@ -100,8 +100,7 @@ discard block |
||
100 | 100 | $this->aEvents[$sEvent] = $xBrowserEvent; |
101 | 101 | return $xBrowserEvent->generateRequest(); |
102 | 102 | } |
103 | - } |
|
104 | - elseif($sType == Jaxon::EVENT_HANDLER) |
|
103 | + } elseif($sType == Jaxon::EVENT_HANDLER) |
|
105 | 104 | { |
106 | 105 | $sEvent = $aArgs[1]; |
107 | 106 | if(isset($this->aEvents[$sEvent]) && isset($aArgs[2])) |
@@ -173,8 +172,9 @@ discard block |
||
173 | 172 | */ |
174 | 173 | public function processRequest() |
175 | 174 | { |
176 | - if(!$this->canProcessRequest()) |
|
177 | - return false; |
|
175 | + if(!$this->canProcessRequest()) { |
|
176 | + return false; |
|
177 | + } |
|
178 | 178 | |
179 | 179 | $aArgs = $this->getRequestManager()->process(); |
180 | 180 |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | */ |
93 | 93 | public function __construct($xCallable) |
94 | 94 | { |
95 | - if(is_string($xCallable)) // Received a class name |
|
95 | + if (is_string($xCallable)) // Received a class name |
|
96 | 96 | { |
97 | 97 | $this->reflectionClass = new \ReflectionClass($xCallable); |
98 | 98 | $this->callableObject = null; |
@@ -118,12 +118,12 @@ discard block |
||
118 | 118 | */ |
119 | 119 | private function setCallable($xCallable = null) |
120 | 120 | { |
121 | - if($xCallable == null) |
|
121 | + if ($xCallable == null) |
|
122 | 122 | { |
123 | 123 | $xCallable = $this->reflectionClass->newInstance(); |
124 | 124 | } |
125 | 125 | // Save the Jaxon callable object into the user callable object |
126 | - if($this->reflectionClass->hasMethod('setJaxonCallable')) |
|
126 | + if ($this->reflectionClass->hasMethod('setJaxonCallable')) |
|
127 | 127 | { |
128 | 128 | $xCallable->setJaxonCallable($this); |
129 | 129 | } |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | */ |
138 | 138 | public function getRegisteredObject() |
139 | 139 | { |
140 | - if($this->callableObject == null) |
|
140 | + if ($this->callableObject == null) |
|
141 | 141 | { |
142 | 142 | $this->setCallable(); |
143 | 143 | } |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | // The class name without the namespace. |
166 | 166 | $name = $this->reflectionClass->getShortName(); |
167 | 167 | // Append the classpath to the name |
168 | - if(($this->classpath)) |
|
168 | + if (($this->classpath)) |
|
169 | 169 | { |
170 | 170 | $name = $this->classpath . '\\' . $name; |
171 | 171 | } |
@@ -212,16 +212,16 @@ discard block |
||
212 | 212 | public function getMethods() |
213 | 213 | { |
214 | 214 | $aReturn = array(); |
215 | - foreach($this->reflectionClass->getMethods(\ReflectionMethod::IS_PUBLIC) as $xMethod) |
|
215 | + foreach ($this->reflectionClass->getMethods(\ReflectionMethod::IS_PUBLIC) as $xMethod) |
|
216 | 216 | { |
217 | 217 | $sMethodName = $xMethod->getShortName(); |
218 | 218 | // Don't take magic __call, __construct, __destruct methods |
219 | - if(strlen($sMethodName) > 2 && substr($sMethodName, 0, 2) == '__') |
|
219 | + if (strlen($sMethodName) > 2 && substr($sMethodName, 0, 2) == '__') |
|
220 | 220 | { |
221 | 221 | continue; |
222 | 222 | } |
223 | 223 | // Don't take excluded methods |
224 | - if(in_array($sMethodName, $this->aProtectedMethods)) |
|
224 | + if (in_array($sMethodName, $this->aProtectedMethods)) |
|
225 | 225 | { |
226 | 226 | continue; |
227 | 227 | } |
@@ -242,37 +242,37 @@ discard block |
||
242 | 242 | public function configure($sMethod, $sName, $sValue) |
243 | 243 | { |
244 | 244 | // Set the namespace |
245 | - if($sName == 'namespace') |
|
245 | + if ($sName == 'namespace') |
|
246 | 246 | { |
247 | - if($sValue != '') |
|
247 | + if ($sValue != '') |
|
248 | 248 | $this->namespace = $sValue; |
249 | 249 | return; |
250 | 250 | } |
251 | 251 | // Set the classpath |
252 | - if($sName == 'classpath') |
|
252 | + if ($sName == 'classpath') |
|
253 | 253 | { |
254 | - if($sValue != '') |
|
254 | + if ($sValue != '') |
|
255 | 255 | $this->classpath = trim($sValue, '\\'); |
256 | 256 | return; |
257 | 257 | } |
258 | 258 | // Set the separator |
259 | - if($sName == 'separator') |
|
259 | + if ($sName == 'separator') |
|
260 | 260 | { |
261 | - if($sValue == '_' || $sValue == '.') |
|
261 | + if ($sValue == '_' || $sValue == '.') |
|
262 | 262 | $this->separator = $sValue; |
263 | 263 | return; |
264 | 264 | } |
265 | 265 | // Set the excluded methods |
266 | - if($sName == 'protected') |
|
266 | + if ($sName == 'protected') |
|
267 | 267 | { |
268 | - if(is_array($sValue)) |
|
268 | + if (is_array($sValue)) |
|
269 | 269 | $this->aProtectedMethods = array_merge($this->aProtectedMethods, $sValue); |
270 | - elseif(is_string($sValue)) |
|
270 | + elseif (is_string($sValue)) |
|
271 | 271 | $this->aProtectedMethods[] = $sValue; |
272 | 272 | return; |
273 | 273 | } |
274 | 274 | |
275 | - if(!isset($this->aConfiguration[$sMethod])) |
|
275 | + if (!isset($this->aConfiguration[$sMethod])) |
|
276 | 276 | { |
277 | 277 | $this->aConfiguration[$sMethod] = array(); |
278 | 278 | } |
@@ -293,16 +293,16 @@ discard block |
||
293 | 293 | |
294 | 294 | // Common options to be set on all methods |
295 | 295 | $aCommonConfig = array_key_exists('*', $this->aConfiguration) ? $this->aConfiguration['*'] : array(); |
296 | - foreach($this->reflectionClass->getMethods(\ReflectionMethod::IS_PUBLIC) as $xMethod) |
|
296 | + foreach ($this->reflectionClass->getMethods(\ReflectionMethod::IS_PUBLIC) as $xMethod) |
|
297 | 297 | { |
298 | 298 | $sMethodName = $xMethod->getShortName(); |
299 | 299 | // Don't export magic __call, __construct, __destruct methods |
300 | - if(strlen($sMethodName) > 0 && substr($sMethodName, 0, 2) == '__') |
|
300 | + if (strlen($sMethodName) > 0 && substr($sMethodName, 0, 2) == '__') |
|
301 | 301 | { |
302 | 302 | continue; |
303 | 303 | } |
304 | 304 | // Don't export "protected" methods |
305 | - if(in_array($sMethodName, $this->aProtectedMethods)) |
|
305 | + if (in_array($sMethodName, $this->aProtectedMethods)) |
|
306 | 306 | { |
307 | 307 | continue; |
308 | 308 | } |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | */ |
353 | 353 | public function call($sMethod, $aArgs) |
354 | 354 | { |
355 | - if(!$this->hasMethod($sMethod)) |
|
355 | + if (!$this->hasMethod($sMethod)) |
|
356 | 356 | return; |
357 | 357 | $reflectionMethod = $this->reflectionClass->getMethod($sMethod); |
358 | 358 | $callableObject = $this->getRegisteredObject(); |
@@ -92,12 +92,13 @@ discard block |
||
92 | 92 | */ |
93 | 93 | public function __construct($xCallable) |
94 | 94 | { |
95 | - if(is_string($xCallable)) // Received a class name |
|
95 | + if(is_string($xCallable)) { |
|
96 | + // Received a class name |
|
96 | 97 | { |
97 | 98 | $this->reflectionClass = new \ReflectionClass($xCallable); |
98 | - $this->callableObject = null; |
|
99 | 99 | } |
100 | - else // if(is_object($xCallable)) // Received a class instance |
|
100 | + $this->callableObject = null; |
|
101 | + } else // if(is_object($xCallable)) // Received a class instance |
|
101 | 102 | { |
102 | 103 | $this->reflectionClass = new \ReflectionClass(get_class($xCallable)); |
103 | 104 | $this->setCallable($xCallable); |
@@ -244,31 +245,35 @@ discard block |
||
244 | 245 | // Set the namespace |
245 | 246 | if($sName == 'namespace') |
246 | 247 | { |
247 | - if($sValue != '') |
|
248 | - $this->namespace = $sValue; |
|
248 | + if($sValue != '') { |
|
249 | + $this->namespace = $sValue; |
|
250 | + } |
|
249 | 251 | return; |
250 | 252 | } |
251 | 253 | // Set the classpath |
252 | 254 | if($sName == 'classpath') |
253 | 255 | { |
254 | - if($sValue != '') |
|
255 | - $this->classpath = trim($sValue, '\\'); |
|
256 | + if($sValue != '') { |
|
257 | + $this->classpath = trim($sValue, '\\'); |
|
258 | + } |
|
256 | 259 | return; |
257 | 260 | } |
258 | 261 | // Set the separator |
259 | 262 | if($sName == 'separator') |
260 | 263 | { |
261 | - if($sValue == '_' || $sValue == '.') |
|
262 | - $this->separator = $sValue; |
|
264 | + if($sValue == '_' || $sValue == '.') { |
|
265 | + $this->separator = $sValue; |
|
266 | + } |
|
263 | 267 | return; |
264 | 268 | } |
265 | 269 | // Set the excluded methods |
266 | 270 | if($sName == 'protected') |
267 | 271 | { |
268 | - if(is_array($sValue)) |
|
269 | - $this->aProtectedMethods = array_merge($this->aProtectedMethods, $sValue); |
|
270 | - elseif(is_string($sValue)) |
|
271 | - $this->aProtectedMethods[] = $sValue; |
|
272 | + if(is_array($sValue)) { |
|
273 | + $this->aProtectedMethods = array_merge($this->aProtectedMethods, $sValue); |
|
274 | + } elseif(is_string($sValue)) { |
|
275 | + $this->aProtectedMethods[] = $sValue; |
|
276 | + } |
|
272 | 277 | return; |
273 | 278 | } |
274 | 279 | |
@@ -352,8 +357,9 @@ discard block |
||
352 | 357 | */ |
353 | 358 | public function call($sMethod, $aArgs) |
354 | 359 | { |
355 | - if(!$this->hasMethod($sMethod)) |
|
356 | - return; |
|
360 | + if(!$this->hasMethod($sMethod)) { |
|
361 | + return; |
|
362 | + } |
|
357 | 363 | $reflectionMethod = $this->reflectionClass->getMethod($sMethod); |
358 | 364 | $callableObject = $this->getRegisteredObject(); |
359 | 365 | $this->getResponseManager()->append($reflectionMethod->invokeArgs($callableObject, $aArgs)); |
@@ -50,14 +50,14 @@ discard block |
||
50 | 50 | $sPrefix = trim((string)$sPrefix); |
51 | 51 | $nDepth = intval($nDepth); |
52 | 52 | // Check the max depth |
53 | - if($nDepth < 0 || $nDepth > 9) |
|
53 | + if ($nDepth < 0 || $nDepth > 9) |
|
54 | 54 | { |
55 | 55 | throw new \Jaxon\Exception\Config\Data(jaxon_trans('config.errors.data.depth', |
56 | 56 | array('key' => $sPrefix, 'depth' => $nDepth))); |
57 | 57 | } |
58 | - foreach($aOptions as $sName => $xOption) |
|
58 | + foreach ($aOptions as $sName => $xOption) |
|
59 | 59 | { |
60 | - if(is_int($sName)) |
|
60 | + if (is_int($sName)) |
|
61 | 61 | { |
62 | 62 | continue; |
63 | 63 | } |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | // Save the value of this option |
68 | 68 | $this->aOptions[$sFullName] = $xOption; |
69 | 69 | // Save the values of its sub-options |
70 | - if(is_array($xOption)) |
|
70 | + if (is_array($xOption)) |
|
71 | 71 | { |
72 | 72 | // Recursively read the options in the array |
73 | 73 | $this->_setOptions($xOption, $sFullName, $nDepth + 1); |
@@ -89,9 +89,9 @@ discard block |
||
89 | 89 | $aKeys = explode('.', (string)$sKeys); |
90 | 90 | foreach ($aKeys as $sKey) |
91 | 91 | { |
92 | - if(($sKey)) |
|
92 | + if (($sKey)) |
|
93 | 93 | { |
94 | - if(!array_key_exists($sKey, $aOptions) || !is_array($aOptions[$sKey])) |
|
94 | + if (!array_key_exists($sKey, $aOptions) || !is_array($aOptions[$sKey])) |
|
95 | 95 | { |
96 | 96 | throw new \Jaxon\Exception\Config\Data(jaxon_trans('config.errors.data.missing', array('key' => $sKeys))); |
97 | 97 | } |
@@ -139,13 +139,12 @@ discard block |
||
139 | 139 | $sPrefix = rtrim($sPrefix, '.') . '.'; |
140 | 140 | $sPrefixLen = strlen($sPrefix); |
141 | 141 | $aOptions = array(); |
142 | - foreach($this->aOptions as $sName => $xValue) |
|
142 | + foreach ($this->aOptions as $sName => $xValue) |
|
143 | 143 | { |
144 | - if(substr($sName, 0, $sPrefixLen) == $sPrefix) |
|
144 | + if (substr($sName, 0, $sPrefixLen) == $sPrefix) |
|
145 | 145 | { |
146 | 146 | $iNextDotPos = strpos($sName, '.', $sPrefixLen); |
147 | - $sOptionName = $iNextDotPos === false ? substr($sName, $sPrefixLen) : |
|
148 | - substr($sName, $sPrefixLen, $iNextDotPos - $sPrefixLen); |
|
147 | + $sOptionName = $iNextDotPos === false ? substr($sName, $sPrefixLen) : substr($sName, $sPrefixLen, $iNextDotPos - $sPrefixLen); |
|
149 | 148 | $aOptions[$sOptionName] = $sPrefix . $sOptionName; |
150 | 149 | } |
151 | 150 | } |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | // Verify the file extension |
130 | 130 | $xDefault = $this->xConfig->getOption('upload.default.types'); |
131 | 131 | $aAllowed = $this->xConfig->getOption('upload.files.' . $sName . '.types', $xDefault); |
132 | - if(is_array($aAllowed) && !in_array($aUploadedFile['type'], $aAllowed)) |
|
132 | + if (is_array($aAllowed) && !in_array($aUploadedFile['type'], $aAllowed)) |
|
133 | 133 | { |
134 | 134 | $this->sErrorMessage = $this->xTranslator->trans('errors.upload.type', $aUploadedFile); |
135 | 135 | return false; |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | // Verify the file extension |
138 | 138 | $xDefault = $this->xConfig->getOption('upload.default.extensions'); |
139 | 139 | $aAllowed = $this->xConfig->getOption('upload.files.' . $sName . '.extensions', $xDefault); |
140 | - if(is_array($aAllowed) && !in_array($aUploadedFile['extension'], $aAllowed)) |
|
140 | + if (is_array($aAllowed) && !in_array($aUploadedFile['extension'], $aAllowed)) |
|
141 | 141 | { |
142 | 142 | $this->sErrorMessage = $this->xTranslator->trans('errors.upload.extension', $aUploadedFile); |
143 | 143 | return false; |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | // Verify the max size |
146 | 146 | $xDefault = $this->xConfig->getOption('upload.default.max-size', 0); |
147 | 147 | $iSize = $this->xConfig->getOption('upload.files.' . $sName . '.max-size', $xDefault); |
148 | - if($iSize > 0 && $aUploadedFile['size'] > $iSize) |
|
148 | + if ($iSize > 0 && $aUploadedFile['size'] > $iSize) |
|
149 | 149 | { |
150 | 150 | $this->sErrorMessage = $this->xTranslator->trans('errors.upload.max-size', $aUploadedFile); |
151 | 151 | return false; |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | // Verify the min size |
154 | 154 | $xDefault = $this->xConfig->getOption('upload.default.min-size', 0); |
155 | 155 | $iSize = $this->xConfig->getOption('upload.files.' . $sName . '.min-size', $xDefault); |
156 | - if($iSize > 0 && $aUploadedFile['size'] < $iSize) |
|
156 | + if ($iSize > 0 && $aUploadedFile['size'] < $iSize) |
|
157 | 157 | { |
158 | 158 | $this->sErrorMessage = $this->xTranslator->trans('errors.upload.min-size', $aUploadedFile); |
159 | 159 | return false; |
@@ -121,7 +121,7 @@ |
||
121 | 121 | } |
122 | 122 | if(!array_key_exists($sLanguage, $this->aTranslations) || !array_key_exists($sText, $this->aTranslations[$sLanguage])) |
123 | 123 | { |
124 | - return $sText; |
|
124 | + return $sText; |
|
125 | 125 | } |
126 | 126 | $message = $this->aTranslations[$sLanguage][$sText]; |
127 | 127 | foreach($aPlaceHolders as $name => $value) |
@@ -55,11 +55,11 @@ discard block |
||
55 | 55 | */ |
56 | 56 | private function _loadTranslations($sLanguage, $sPrefix, array $aTranslations) |
57 | 57 | { |
58 | - foreach($aTranslations as $sName => $xTranslation) |
|
58 | + foreach ($aTranslations as $sName => $xTranslation) |
|
59 | 59 | { |
60 | 60 | $sName = trim($sName); |
61 | 61 | $sName = ($sPrefix) ? $sPrefix . '.' . $sName : $sName; |
62 | - if(!is_array($xTranslation)) |
|
62 | + if (!is_array($xTranslation)) |
|
63 | 63 | { |
64 | 64 | // Save this translation |
65 | 65 | $this->aTranslations[$sLanguage][$sName] = $xTranslation; |
@@ -82,17 +82,17 @@ discard block |
||
82 | 82 | */ |
83 | 83 | public function loadTranslations($sFilePath, $sLanguage) |
84 | 84 | { |
85 | - if(!file_exists($sFilePath)) |
|
85 | + if (!file_exists($sFilePath)) |
|
86 | 86 | { |
87 | 87 | return; |
88 | 88 | } |
89 | 89 | $aTranslations = require($sFilePath); |
90 | - if(!is_array($aTranslations)) |
|
90 | + if (!is_array($aTranslations)) |
|
91 | 91 | { |
92 | 92 | return; |
93 | 93 | } |
94 | 94 | // Load the translations |
95 | - if(!array_key_exists($sLanguage, $this->aTranslations)) |
|
95 | + if (!array_key_exists($sLanguage, $this->aTranslations)) |
|
96 | 96 | { |
97 | 97 | $this->aTranslations[$sLanguage] = []; |
98 | 98 | } |
@@ -111,20 +111,20 @@ discard block |
||
111 | 111 | public function trans($sText, array $aPlaceHolders = array(), $sLanguage = null) |
112 | 112 | { |
113 | 113 | $sText = trim((string)$sText); |
114 | - if(!$sLanguage) |
|
114 | + if (!$sLanguage) |
|
115 | 115 | { |
116 | 116 | $sLanguage = $this->xConfig->getOption('language'); |
117 | 117 | } |
118 | - if(!$sLanguage) |
|
118 | + if (!$sLanguage) |
|
119 | 119 | { |
120 | 120 | $sLanguage = $this->sDefaultLocale; |
121 | 121 | } |
122 | - if(!array_key_exists($sLanguage, $this->aTranslations) || !array_key_exists($sText, $this->aTranslations[$sLanguage])) |
|
122 | + if (!array_key_exists($sLanguage, $this->aTranslations) || !array_key_exists($sText, $this->aTranslations[$sLanguage])) |
|
123 | 123 | { |
124 | 124 | return $sText; |
125 | 125 | } |
126 | 126 | $message = $this->aTranslations[$sLanguage][$sText]; |
127 | - foreach($aPlaceHolders as $name => $value) |
|
127 | + foreach ($aPlaceHolders as $name => $value) |
|
128 | 128 | { |
129 | 129 | $message = str_replace(':' . $name, $value, $message); |
130 | 130 | } |
@@ -63,8 +63,7 @@ |
||
63 | 63 | { |
64 | 64 | // Save this translation |
65 | 65 | $this->aTranslations[$sLanguage][$sName] = $xTranslation; |
66 | - } |
|
67 | - else |
|
66 | + } else |
|
68 | 67 | { |
69 | 68 | // Recursively read the translations in the array |
70 | 69 | $this->_loadTranslations($sLanguage, $sName, $xTranslation); |
@@ -191,15 +191,6 @@ discard block |
||
191 | 191 | * - Jaxon::CALLABLE_OBJECT: an object who's methods are to be registered |
192 | 192 | * - Jaxon::BROWSER_EVENT: an event which will cause zero or more event handlers to be called |
193 | 193 | * - Jaxon::EVENT_HANDLER: register an event handler function. |
194 | - * @param mixed $sFunction | $objObject | $sEvent |
|
195 | - * When registering a function, this is the name of the function |
|
196 | - * When registering a callable object, this is the object being registered |
|
197 | - * When registering an event or event handler, this is the name of the event |
|
198 | - * @param mixed $sIncludeFile | $aCallOptions | $sEventHandler |
|
199 | - * When registering a function, this is the (optional) include file |
|
200 | - * When registering a callable object, this is an (optional) array |
|
201 | - * of call options for the functions being registered |
|
202 | - * When registering an event handler, this is the name of the function |
|
203 | 194 | * |
204 | 195 | * @return mixed |
205 | 196 | */ |
@@ -498,7 +489,7 @@ discard block |
||
498 | 489 | * @param string $sLibKey The key of the library options in the file |
499 | 490 | * @param string|null $sAppKey The key of the application options in the file |
500 | 491 | * |
501 | - * @return array |
|
492 | + * @return null|Utils\Config\Config |
|
502 | 493 | */ |
503 | 494 | public function readPhpConfigFile($sConfigFile, $sLibKey = '', $sAppKey = null) |
504 | 495 | { |
@@ -512,7 +503,7 @@ discard block |
||
512 | 503 | * @param string $sLibKey The key of the library options in the file |
513 | 504 | * @param string|null $sAppKey The key of the application options in the file |
514 | 505 | * |
515 | - * @return array |
|
506 | + * @return null|Utils\Config\Config |
|
516 | 507 | */ |
517 | 508 | public function readYamlConfigFile($sConfigFile, $sLibKey = '', $sAppKey = null) |
518 | 509 | { |
@@ -526,7 +517,7 @@ discard block |
||
526 | 517 | * @param string $sLibKey The key of the library options in the file |
527 | 518 | * @param string|null $sAppKey The key of the application options in the file |
528 | 519 | * |
529 | - * @return array |
|
520 | + * @return Utils\Config\Config|null |
|
530 | 521 | */ |
531 | 522 | public function readJsonConfigFile($sConfigFile, $sLibKey = '', $sAppKey = null) |
532 | 523 | { |
@@ -540,7 +531,7 @@ discard block |
||
540 | 531 | * @param string $sLibKey The key of the library options in the file |
541 | 532 | * @param string|null $sAppKey The key of the application options in the file |
542 | 533 | * |
543 | - * @return array |
|
534 | + * @return null|Utils\Config\Config |
|
544 | 535 | */ |
545 | 536 | public function readConfigFile($sConfigFile, $sLibKey = '', $sAppKey = null) |
546 | 537 | { |
@@ -568,7 +559,7 @@ discard block |
||
568 | 559 | * - 1000 thru 8999: User created plugins, typically, these plugins don't care about order |
569 | 560 | * - 9000 thru 9999: Plugins that generally need to be last or near the end of the plugin list |
570 | 561 | * |
571 | - * @param Plugin $xPlugin An instance of a plugin |
|
562 | + * @param Plugin\Plugin $xPlugin An instance of a plugin |
|
572 | 563 | * @param integer $nPriority The plugin priority, used to order the plugins |
573 | 564 | * |
574 | 565 | * @return void |
@@ -631,7 +622,7 @@ discard block |
||
631 | 622 | /** |
632 | 623 | * Check uploaded files validity and move them to the user dir |
633 | 624 | * |
634 | - * @return boolean |
|
625 | + * @return null|boolean |
|
635 | 626 | */ |
636 | 627 | public function saveUploadedFiles() |
637 | 628 | { |
@@ -614,7 +614,7 @@ discard block |
||
614 | 614 | $this->addViewNamespace('pagination', $sDirectory, '.php'); |
615 | 615 | } |
616 | 616 | |
617 | - /** |
|
617 | + /** |
|
618 | 618 | * Check if uploaded files are available |
619 | 619 | * |
620 | 620 | * @return boolean |
@@ -628,7 +628,7 @@ discard block |
||
628 | 628 | return $xUploadPlugin->canProcessRequest(); |
629 | 629 | } |
630 | 630 | |
631 | - /** |
|
631 | + /** |
|
632 | 632 | * Check uploaded files validity and move them to the user dir |
633 | 633 | * |
634 | 634 | * @return boolean |
@@ -214,8 +214,9 @@ discard block |
||
214 | 214 | { |
215 | 215 | $sEvent = $xArgs; |
216 | 216 | $xUserFunction = $aArgs[2]; |
217 | - if(!is_a($xUserFunction, 'Request\\Support\\UserFunction')) |
|
218 | - $xUserFunction = new Request\Support\UserFunction($xUserFunction); |
|
217 | + if(!is_a($xUserFunction, 'Request\\Support\\UserFunction')) { |
|
218 | + $xUserFunction = new Request\Support\UserFunction($xUserFunction); |
|
219 | + } |
|
219 | 220 | $this->aProcessingEvents[$sEvent] = $xUserFunction; |
220 | 221 | } |
221 | 222 | /*else |
@@ -328,8 +329,7 @@ discard block |
||
328 | 329 | try |
329 | 330 | { |
330 | 331 | $mResult = $this->getPluginManager()->processRequest(); |
331 | - } |
|
332 | - catch(Exception $e) |
|
332 | + } catch(Exception $e) |
|
333 | 333 | { |
334 | 334 | // An exception was thrown while processing the request. |
335 | 335 | // The request missed the corresponding handler function, |
@@ -346,8 +346,7 @@ discard block |
||
346 | 346 | { |
347 | 347 | $sEvent = self::PROCESSING_EVENT_INVALID; |
348 | 348 | $aParams = array($e->getMessage()); |
349 | - } |
|
350 | - else |
|
349 | + } else |
|
351 | 350 | { |
352 | 351 | $sEvent = self::PROCESSING_EVENT_ERROR; |
353 | 352 | $aParams = array($e); |
@@ -357,8 +356,7 @@ discard block |
||
357 | 356 | { |
358 | 357 | // Call the processing event |
359 | 358 | $this->aProcessingEvents[$sEvent]->call($aParams); |
360 | - } |
|
361 | - else |
|
359 | + } else |
|
362 | 360 | { |
363 | 361 | // The exception is not to be processed here. |
364 | 362 | throw $e; |
@@ -640,8 +638,7 @@ discard block |
||
640 | 638 | if(($xUploadPlugin = $this->getPluginManager()->getRequestPlugin(self::FILE_UPLOAD)) == null) |
641 | 639 | { |
642 | 640 | throw new Exception($this->trans('errors.upload.plugin')); |
643 | - } |
|
644 | - elseif(!$xUploadPlugin->canProcessRequest()) |
|
641 | + } elseif(!$xUploadPlugin->canProcessRequest()) |
|
645 | 642 | { |
646 | 643 | throw new Exception($this->trans('errors.upload.request')); |
647 | 644 | } |
@@ -649,8 +646,7 @@ discard block |
||
649 | 646 | $sKey = $xUploadPlugin->saveUploadedFiles(); |
650 | 647 | $sResponse = '{"code": "success", "upl": "' . $sKey . '"}'; |
651 | 648 | $return = true; |
652 | - } |
|
653 | - catch(Exception $e) |
|
649 | + } catch(Exception $e) |
|
654 | 650 | { |
655 | 651 | $sResponse = '{"code": "error", "msg": "' . addslashes($e->getMessage()) . '"}'; |
656 | 652 | $return = false; |
@@ -25,10 +25,6 @@ |
||
25 | 25 | |
26 | 26 | namespace Jaxon; |
27 | 27 | |
28 | -use Jaxon\Plugin\Manager as PluginManager; |
|
29 | -use Jaxon\Request\Manager as RequestManager; |
|
30 | -use Jaxon\Response\Manager as ResponseManager; |
|
31 | - |
|
32 | 28 | use Jaxon\Utils\URI; |
33 | 29 | use Exception; |
34 | 30 | use Closure; |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | 'core.prefix.event' => 'jaxon_event_', |
133 | 133 | // 'core.request.uri' => '', |
134 | 134 | 'core.request.mode' => 'asynchronous', |
135 | - 'core.request.method' => 'POST', // W3C: Method is case sensitive |
|
135 | + 'core.request.method' => 'POST', // W3C: Method is case sensitive |
|
136 | 136 | 'core.debug.on' => false, |
137 | 137 | 'core.debug.verbose' => false, |
138 | 138 | 'core.process.exit' => true, |
@@ -209,13 +209,13 @@ discard block |
||
209 | 209 | $aArgs = func_get_args(); |
210 | 210 | $nArgs = func_num_args(); |
211 | 211 | |
212 | - if(self::PROCESSING_EVENT == $sType) |
|
212 | + if (self::PROCESSING_EVENT == $sType) |
|
213 | 213 | { |
214 | - if($nArgs > 2) |
|
214 | + if ($nArgs > 2) |
|
215 | 215 | { |
216 | 216 | $sEvent = $xArgs; |
217 | 217 | $xUserFunction = $aArgs[2]; |
218 | - if(!is_a($xUserFunction, 'Request\\Support\\UserFunction')) |
|
218 | + if (!is_a($xUserFunction, 'Request\\Support\\UserFunction')) |
|
219 | 219 | $xUserFunction = new Request\Support\UserFunction($xUserFunction); |
220 | 220 | $this->aProcessingEvents[$sEvent] = $xUserFunction; |
221 | 221 | } |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | public function processRequest() |
302 | 302 | { |
303 | 303 | // Check to see if headers have already been sent out, in which case we can't do our job |
304 | - if(headers_sent($filename, $linenumber)) |
|
304 | + if (headers_sent($filename, $linenumber)) |
|
305 | 305 | { |
306 | 306 | echo $this->trans('errors.output.already-sent', array( |
307 | 307 | 'location' => $filename . ':' . $linenumber |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | } |
311 | 311 | |
312 | 312 | // Check if there is a plugin to process this request |
313 | - if(!$this->canProcessRequest()) |
|
313 | + if (!$this->canProcessRequest()) |
|
314 | 314 | { |
315 | 315 | return; |
316 | 316 | } |
@@ -319,18 +319,18 @@ discard block |
||
319 | 319 | $mResult = true; |
320 | 320 | |
321 | 321 | // Handle before processing event |
322 | - if(isset($this->aProcessingEvents[self::PROCESSING_EVENT_BEFORE])) |
|
322 | + if (isset($this->aProcessingEvents[self::PROCESSING_EVENT_BEFORE])) |
|
323 | 323 | { |
324 | 324 | $this->aProcessingEvents[self::PROCESSING_EVENT_BEFORE]->call(array(&$bEndRequest)); |
325 | 325 | } |
326 | 326 | |
327 | - if(!$bEndRequest) |
|
327 | + if (!$bEndRequest) |
|
328 | 328 | { |
329 | 329 | try |
330 | 330 | { |
331 | 331 | $mResult = $this->getPluginManager()->processRequest(); |
332 | 332 | } |
333 | - catch(Exception $e) |
|
333 | + catch (Exception $e) |
|
334 | 334 | { |
335 | 335 | // An exception was thrown while processing the request. |
336 | 336 | // The request missed the corresponding handler function, |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | $xResponseManager->debug($e->getMessage()); |
344 | 344 | $mResult = false; |
345 | 345 | |
346 | - if($e instanceof \Jaxon\Exception\Error) |
|
346 | + if ($e instanceof \Jaxon\Exception\Error) |
|
347 | 347 | { |
348 | 348 | $sEvent = self::PROCESSING_EVENT_INVALID; |
349 | 349 | $aParams = array($e->getMessage()); |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | $aParams = array($e); |
355 | 355 | } |
356 | 356 | |
357 | - if(isset($this->aProcessingEvents[$sEvent])) |
|
357 | + if (isset($this->aProcessingEvents[$sEvent])) |
|
358 | 358 | { |
359 | 359 | // Call the processing event |
360 | 360 | $this->aProcessingEvents[$sEvent]->call($aParams); |
@@ -367,7 +367,7 @@ discard block |
||
367 | 367 | } |
368 | 368 | } |
369 | 369 | // Clean the processing buffer |
370 | - if(($this->getOption('core.process.clean'))) |
|
370 | + if (($this->getOption('core.process.clean'))) |
|
371 | 371 | { |
372 | 372 | $er = error_reporting(0); |
373 | 373 | while (ob_get_level() > 0) |
@@ -377,10 +377,10 @@ discard block |
||
377 | 377 | error_reporting($er); |
378 | 378 | } |
379 | 379 | |
380 | - if($mResult === true) |
|
380 | + if ($mResult === true) |
|
381 | 381 | { |
382 | 382 | // Handle after processing event |
383 | - if(isset($this->aProcessingEvents[self::PROCESSING_EVENT_AFTER])) |
|
383 | + if (isset($this->aProcessingEvents[self::PROCESSING_EVENT_AFTER])) |
|
384 | 384 | { |
385 | 385 | $bEndRequest = false; |
386 | 386 | $this->aProcessingEvents[self::PROCESSING_EVENT_AFTER]->call(array($bEndRequest)); |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | |
390 | 390 | $this->getResponseManager()->printDebug(); |
391 | 391 | |
392 | - if(($this->getOption('core.process.exit'))) |
|
392 | + if (($this->getOption('core.process.exit'))) |
|
393 | 393 | { |
394 | 394 | $this->getResponseManager()->sendOutput(); |
395 | 395 | exit(); |
@@ -439,16 +439,16 @@ discard block |
||
439 | 439 | */ |
440 | 440 | public function getScript($bIncludeJs = false, $bIncludeCss = false) |
441 | 441 | { |
442 | - if(!$this->getOption('core.request.uri')) |
|
442 | + if (!$this->getOption('core.request.uri')) |
|
443 | 443 | { |
444 | 444 | $this->setOption('core.request.uri', URI::detect()); |
445 | 445 | } |
446 | 446 | $sCode = ''; |
447 | - if(($bIncludeCss)) |
|
447 | + if (($bIncludeCss)) |
|
448 | 448 | { |
449 | 449 | $sCode .= $this->getPluginManager()->getCss() . "\n"; |
450 | 450 | } |
451 | - if(($bIncludeJs)) |
|
451 | + if (($bIncludeJs)) |
|
452 | 452 | { |
453 | 453 | $sCode .= $this->getPluginManager()->getJs() . "\n"; |
454 | 454 | } |
@@ -546,7 +546,7 @@ discard block |
||
546 | 546 | public function readConfigFile($sConfigFile, $sLibKey = '', $sAppKey = null) |
547 | 547 | { |
548 | 548 | $sExt = pathinfo($sConfigFile, PATHINFO_EXTENSION); |
549 | - switch($sExt) |
|
549 | + switch ($sExt) |
|
550 | 550 | { |
551 | 551 | case 'php': |
552 | 552 | return $this->readPhpConfigFile($sConfigFile, $sLibKey, $sAppKey); |
@@ -622,7 +622,7 @@ discard block |
||
622 | 622 | */ |
623 | 623 | public function hasUploadedFiles() |
624 | 624 | { |
625 | - if(($xUploadPlugin = $this->getPluginManager()->getRequestPlugin(self::FILE_UPLOAD)) == null) |
|
625 | + if (($xUploadPlugin = $this->getPluginManager()->getRequestPlugin(self::FILE_UPLOAD)) == null) |
|
626 | 626 | { |
627 | 627 | return false; |
628 | 628 | } |
@@ -638,11 +638,11 @@ discard block |
||
638 | 638 | { |
639 | 639 | try |
640 | 640 | { |
641 | - if(($xUploadPlugin = $this->getPluginManager()->getRequestPlugin(self::FILE_UPLOAD)) == null) |
|
641 | + if (($xUploadPlugin = $this->getPluginManager()->getRequestPlugin(self::FILE_UPLOAD)) == null) |
|
642 | 642 | { |
643 | 643 | throw new Exception($this->trans('errors.upload.plugin')); |
644 | 644 | } |
645 | - elseif(!$xUploadPlugin->canProcessRequest()) |
|
645 | + elseif (!$xUploadPlugin->canProcessRequest()) |
|
646 | 646 | { |
647 | 647 | throw new Exception($this->trans('errors.upload.request')); |
648 | 648 | } |
@@ -651,14 +651,14 @@ discard block |
||
651 | 651 | $sResponse = '{"code": "success", "upl": "' . $sKey . '"}'; |
652 | 652 | $return = true; |
653 | 653 | } |
654 | - catch(Exception $e) |
|
654 | + catch (Exception $e) |
|
655 | 655 | { |
656 | 656 | $sResponse = '{"code": "error", "msg": "' . addslashes($e->getMessage()) . '"}'; |
657 | 657 | $return = false; |
658 | 658 | } |
659 | 659 | // Send the response back to the browser |
660 | 660 | echo '<script>var res = ', $sResponse, '; </script>'; |
661 | - if(($this->getOption('core.process.exit'))) |
|
661 | + if (($this->getOption('core.process.exit'))) |
|
662 | 662 | { |
663 | 663 | exit(); |
664 | 664 | } |
@@ -672,7 +672,7 @@ discard block |
||
672 | 672 | */ |
673 | 673 | public function getUploadedFiles() |
674 | 674 | { |
675 | - if(($xUploadPlugin = $this->getPluginManager()->getRequestPlugin(self::FILE_UPLOAD)) == null) |
|
675 | + if (($xUploadPlugin = $this->getPluginManager()->getRequestPlugin(self::FILE_UPLOAD)) == null) |
|
676 | 676 | { |
677 | 677 | return []; |
678 | 678 | } |
@@ -688,7 +688,7 @@ discard block |
||
688 | 688 | */ |
689 | 689 | public function setUploadFileFilter(Closure $fFileFilter) |
690 | 690 | { |
691 | - if(($xUploadPlugin = $this->getPluginManager()->getRequestPlugin(self::FILE_UPLOAD)) == null) |
|
691 | + if (($xUploadPlugin = $this->getPluginManager()->getRequestPlugin(self::FILE_UPLOAD)) == null) |
|
692 | 692 | { |
693 | 693 | return; |
694 | 694 | } |