Completed
Branch master (a77cc1)
by Baris
03:02
created
bootstrap/application.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
     include_once _if(APPLICATION_PATH."configs/", "application.php")
31 31
 );
32 32
 
33
-$di->set('application', function () use ($appConfig) {
33
+$di->set('application', function() use ($appConfig) {
34 34
     return $appConfig;
35 35
 });
36 36
 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 |
75 75
 */
76 76
 
77
-$di->set('error', function () use ($appConfig) {
77
+$di->set('error', function() use ($appConfig) {
78 78
     return include_once _if(APPLICATION_PATH."configs/", "error.php");
79 79
 });	
80 80
 
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 
92 92
 if (PHP_SAPI !== 'cli') 
93 93
 {
94
-    $di->set('profiler', function () use ($profiler) {
94
+    $di->set('profiler', function() use ($profiler) {
95 95
         return $profiler;
96 96
     }); 
97 97
 
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 
110 110
 if (PHP_SAPI !== 'cli') 
111 111
 {
112
-    $di->set('console', function () use ($di) {
112
+    $di->set('console', function() use ($di) {
113 113
         $profiler = $di->get("profiler");
114 114
         $logger = new \Fabfuel\Prophiler\Adapter\Psr\Log\Logger($profiler);
115 115
         return $logger;
@@ -153,13 +153,13 @@  discard block
 block discarded – undo
153 153
 |
154 154
 */
155 155
 
156
-foreach ($appConfig->databases as $name => $dbConfig ) {
156
+foreach ($appConfig->databases as $name => $dbConfig) {
157 157
     $di->set($name, function() use ($dbConfig, $di){
158 158
         $className = $dbConfig["type"];
159
-        $database =  new $className($dbConfig["config"]->toArray());
160
-        if ( $di->has("profiler") ) {
159
+        $database = new $className($dbConfig["config"]->toArray());
160
+        if ($di->has("profiler")) {
161 161
             $eventsManager = new \Phalcon\Events\Manager();
162
-            $eventsManager->attach('db', \Fabfuel\Prophiler\Plugin\Phalcon\Db\AdapterPlugin::getInstance( $di->get("profiler") ) );
162
+            $eventsManager->attach('db', \Fabfuel\Prophiler\Plugin\Phalcon\Db\AdapterPlugin::getInstance($di->get("profiler")));
163 163
             $database->setEventsManager($eventsManager);
164 164
         }
165 165
         $database->connect();
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 });
189 189
 
190 190
 //Setup the cache service
191
-$di->set('cache', function(){
191
+$di->set('cache', function() {
192 192
     return include_once _if(APPLICATION_PATH."services/", "cache.php");
193 193
 });
194 194
 
@@ -204,12 +204,12 @@  discard block
 block discarded – undo
204 204
 |
205 205
 */
206 206
 
207
-$di->set('response', function(){
207
+$di->set('response', function() {
208 208
     return new \Phalcon\Http\Response();
209 209
 });
210 210
 
211 211
 //Setup the email service
212
-$di->set('email', function(){
212
+$di->set('email', function() {
213 213
     return include_once _if(APPLICATION_PATH."services/", "email.php");
214 214
 });
215 215
 
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 |
225 225
 */
226 226
 
227
-$di->set('assets', function () {
227
+$di->set('assets', function() {
228 228
     $assetManager = new \Phalcon\Assets\Manager();
229 229
     return $assetManager;
230 230
 }, true);
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
 
275 275
 if (PHP_SAPI !== 'cli') 
276 276
 {
277
-    $di->set('url', function () use ($appConfig) {
277
+    $di->set('url', function() use ($appConfig) {
278 278
         $url = new \Phalcon\Mvc\Url();
279 279
         if (!is_null($appConfig->base_url))
280 280
             $url->setBaseUri($appConfig->base_url);
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
 |
293 293
 */
294 294
 
295
-$di->set('crypt', function () use ($appConfig) {
295
+$di->set('crypt', function() use ($appConfig) {
296 296
     $crypt = new \Phalcon\Crypt();
297 297
     //Type of cipher algoritm
298 298
     $crypt->setCipher($appConfig->cipher);
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
 //TODO: there can be many file in en folder.
325 325
 $di->set('language', function() use ($appConfig) {
326 326
     $defaultLanguage = $appConfig->default_language;
327
-    $fileName = APPLICATION_PATH."resources/languages/{$defaultLanguage}/{$defaultLanguage}.php";;        
327
+    $fileName = APPLICATION_PATH."resources/languages/{$defaultLanguage}/{$defaultLanguage}.php"; ;        
328 328
     if (file_exists($fileName)) {
329 329
         $messages = include_once $fileName;
330 330
     } else {
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
     |
387 387
     */
388 388
 
389
-    $di->set('router', function () use ($appConfig) {
389
+    $di->set('router', function() use ($appConfig) {
390 390
         $router = new \Phalcon\Mvc\Router\Annotations(false);
391 391
         $router->setUriSource(\Phalcon\Mvc\Router::URI_SOURCE_GET_URL); 
392 392
         $router->setUriSource(\Phalcon\Mvc\Router::URI_SOURCE_SERVER_REQUEST_URI);
@@ -464,10 +464,10 @@  discard block
 block discarded – undo
464 464
     $arguments['task'] = $appConfig->default_task;
465 465
     $arguments['action'] = $appConfig->default_action;
466 466
 
467
-    if ( isset( $_SERVER['argv'][1] ) AND strpos($argv[1], "@") !== FALSE  ) {
467
+    if (isset($_SERVER['argv'][1]) AND strpos($argv[1], "@") !== FALSE) {
468 468
         $itemNumber = 0;
469 469
         $allArguments = explode("@", $argv[1]);
470
-        if ( count($allArguments) === 2 )
470
+        if (count($allArguments) === 2)
471 471
         {
472 472
             $itemNumber = 1;
473 473
         }
@@ -480,8 +480,8 @@  discard block
 block discarded – undo
480 480
 
481 481
     $arguments['params'] = array();
482 482
 
483
-    foreach($_SERVER['argv'] as $k => $arg) {
484
-        if($k >= 2) {
483
+    foreach ($_SERVER['argv'] as $k => $arg) {
484
+        if ($k >= 2) {
485 485
             $arguments['params'][] = $arg;
486 486
         }
487 487
     }
@@ -495,7 +495,7 @@  discard block
 block discarded – undo
495 495
     //Handle the request
496 496
     $output = $application->handle()->getContent();
497 497
 
498
-    if ( $appConfig->debug ) 
498
+    if ($appConfig->debug) 
499 499
     {
500 500
         $toolbar = new \Fabfuel\Prophiler\Toolbar($profiler);
501 501
         $toolbar->addDataCollector(new \Fabfuel\Prophiler\DataCollector\Request());
@@ -504,10 +504,10 @@  discard block
 block discarded – undo
504 504
     }
505 505
 
506 506
     // HTML Minification
507
-    if ( $appConfig->html_minify ) {
508
-        ob_start( function() use ($output) {
509
-            $search = array( '/\>[^\S ]+/s', '/[^\S ]+\</s', '/(\s)+/s' );
510
-            $replace = array( '>', '<', '\\1' );
507
+    if ($appConfig->html_minify) {
508
+        ob_start(function() use ($output) {
509
+            $search = array('/\>[^\S ]+/s', '/[^\S ]+\</s', '/(\s)+/s');
510
+            $replace = array('>', '<', '\\1');
511 511
             $buffer = preg_replace($search, $replace, $output);
512 512
             return $buffer;
513 513
         });
Please login to merge, or discard this patch.
bootstrap/autoload.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -8,8 +8,8 @@  discard block
 block discarded – undo
8 8
  */
9 9
 
10 10
 # Global function for getting included file name
11
-function _if($folderName, $fileName, $enviroment = null ) {
12
-	if ( is_null($enviroment) )
11
+function _if($folderName, $fileName, $enviroment = null) {
12
+	if (is_null($enviroment))
13 13
 		$enviroment = "ENVIRONMENT";
14 14
 	$file = "{$folderName}{$enviroment}/{$fileName}";
15 15
     if (!file_exists($file)) {
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 	echo "<pre>";
26 26
 	var_dump($object);
27 27
 	echo "</pre>";
28
-	if ( $isDie ) {
28
+	if ($isDie) {
29 29
 		die();
30 30
 	}
31 31
 }
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 }
41 41
 
42 42
 # ROOT PATH is defined.
43
-define("ROOT_PATH", realpath( __DIR__."/../") );
43
+define("ROOT_PATH", realpath(__DIR__."/../"));
44 44
 
45 45
 # The FactoryDefault Dependency Injector automatically registers the right services providing a full-stack framework
46 46
 if (PHP_SAPI === 'cli') {
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     include_once _if(__DIR__."/", "paths.php", "")
54 54
 );
55 55
 
56
-$di->set('path', function () use ($pathConfigs) {
56
+$di->set('path', function() use ($pathConfigs) {
57 57
     return $pathConfigs;
58 58
 });
59 59
 
@@ -64,18 +64,18 @@  discard block
 block discarded – undo
64 64
 
65 65
 $configurationName = null;
66 66
 if (PHP_SAPI === 'cli') {    
67
-	if ( isset( $_SERVER['argv'][1] ) AND strpos($argv[1], "@") !== FALSE  ) {
67
+	if (isset($_SERVER['argv'][1]) AND strpos($argv[1], "@") !== FALSE) {
68 68
 		$arguments = explode("@", $argv[1]);
69 69
 		$configurationName = $arguments[0];
70 70
 	}
71 71
 } else {
72
-	if ( isset( $_SERVER['SERVER_NAME'] ) ) {
72
+	if (isset($_SERVER['SERVER_NAME'])) {
73 73
 		$configurationName = $_SERVER['SERVER_NAME'];
74 74
 	}
75 75
 }
76 76
 
77
-if ( !isset($applicationRouting->routing->$configurationName->name) ) {
78
-	if ( isset( $applicationRouting->routing->default->name ) ) {
77
+if (!isset($applicationRouting->routing->$configurationName->name)) {
78
+	if (isset($applicationRouting->routing->default->name)) {
79 79
 		$applicationName = $applicationRouting->routing->default->name;
80 80
 	} else {
81 81
 		_d("Solution routing configuration is failed. Please check your application route configurations");
@@ -96,11 +96,11 @@  discard block
 block discarded – undo
96 96
 | 
97 97
 */
98 98
 
99
-define("SOLUTION_PATH", 	$pathConfigs->solution_path );
100
-define("STORAGE_PATH", 		$pathConfigs->storage_path );
101
-define("APPLICATION_PATH", 	$pathConfigs->solution_path.APPLICATION_NAME."/" );
102
-define("PUBLIC_PATH", 		$pathConfigs->public_path );
103
-define("VENDOR_PATH", 		$pathConfigs->vendor_path );
99
+define("SOLUTION_PATH", $pathConfigs->solution_path);
100
+define("STORAGE_PATH", $pathConfigs->storage_path);
101
+define("APPLICATION_PATH", $pathConfigs->solution_path.APPLICATION_NAME."/");
102
+define("PUBLIC_PATH", $pathConfigs->public_path);
103
+define("VENDOR_PATH", $pathConfigs->vendor_path);
104 104
 
105 105
 /*
106 106
 |--------------------------------------------------------------------------
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 | 
112 112
 */
113 113
 
114
-if ( !is_dir( APPLICATION_PATH ) ) 
114
+if (!is_dir(APPLICATION_PATH)) 
115 115
 	_d("There is no application called \"".APPLICATION_NAME."\" in your apps folder.");
116 116
 
117 117
 /*
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 | loading of any our classes "manually". Feels great to relax.
126 126
 */
127 127
 
128
-if ( !is_file( VENDOR_PATH.'autoload.php' ) ) {
128
+if (!is_file(VENDOR_PATH.'autoload.php')) {
129 129
 	_d("There is no autoload.php in your \"".VENDOR_PATH."\". Please update your vendor folder.");
130 130
 } else {
131 131
 	require VENDOR_PATH.'autoload.php';
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 
145 145
 if (PHP_SAPI !== 'cli') 
146 146
 {
147
-	$profiler 	= new \Fabfuel\Prophiler\Profiler();
147
+	$profiler = new \Fabfuel\Prophiler\Profiler();
148 148
 
149 149
 	$profiler->addAggregator(new \Fabfuel\Prophiler\Aggregator\Database\QueryAggregator());
150 150
 	$profiler->addAggregator(new \Fabfuel\Prophiler\Aggregator\Cache\CacheAggregator());
Please login to merge, or discard this patch.
apps/default.app/configs/application.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -25,10 +25,10 @@  discard block
 block discarded – undo
25 25
 	|
26 26
 	*/
27 27
 
28
-	'databases' => array (
29
-		'db1' => array (
28
+	'databases' => array(
29
+		'db1' => array(
30 30
 	        'type' => '\Phalcon\Db\Adapter\Pdo\Mysql',
31
-	        'config' => array (
31
+	        'config' => array(
32 32
 	        	'host' => '127.0.0.1',
33 33
 				'port' => 3306,
34 34
 		        'username' => 'root',
@@ -257,9 +257,9 @@  discard block
 block discarded – undo
257 257
 	*/
258 258
 
259 259
 	'paths' => array(
260
-		APPLICATION_PATH . 'controllers/',
261
-        APPLICATION_PATH . 'models/',
262
-        APPLICATION_PATH . 'tasks/'
260
+		APPLICATION_PATH.'controllers/',
261
+        APPLICATION_PATH.'models/',
262
+        APPLICATION_PATH.'tasks/'
263 263
     ),
264 264
 
265 265
 	/*
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 	*/
286 286
 
287 287
 	'classes' => array(
288
-		"ModelTrait"         => APPLICATION_PATH . "traits/ModelTraits.php"
288
+		"ModelTrait"         => APPLICATION_PATH."traits/ModelTraits.php"
289 289
     ),
290 290
 
291 291
 	/*
Please login to merge, or discard this patch.
apps/default.app/configs/error.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
 use Whoops\Handler\PrettyPageHandler;
15 15
 use Whoops\Handler\PlainTextHandler;
16 16
 
17
-$run     = new Whoops\Run;
17
+$run = new Whoops\Run;
18 18
 if (PHP_SAPI === 'cli') 
19 19
 	$handler = new PlainTextHandler;
20 20
 else
Please login to merge, or discard this patch.
apps/default.app/configs/views.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
             '.volt' => array(
6 6
                   'type' => '\Phalcon\Mvc\View\Engine\Volt',
7 7
                   'options' => array(
8
-                        'compiledPath' => STORAGE_PATH . 'framework/views/',
8
+                        'compiledPath' => STORAGE_PATH.'framework/views/',
9 9
                         'compiledSeparator' => '_',
10 10
                         'compiledExtension' => '.compiled',
11 11
                         'stat' => true
Please login to merge, or discard this patch.