Completed
Push — master ( 39aba2...fd6aef )
by Angus
06:39 queued 01:12
created
application/config/constants.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -26,10 +26,10 @@  discard block
 block discarded – undo
26 26
 | always be used to set the mode correctly.
27 27
 |
28 28
 */
29
-defined('FILE_READ_MODE')  OR define('FILE_READ_MODE', 0644);
29
+defined('FILE_READ_MODE') OR define('FILE_READ_MODE', 0644);
30 30
 defined('FILE_WRITE_MODE') OR define('FILE_WRITE_MODE', 0666);
31
-defined('DIR_READ_MODE')   OR define('DIR_READ_MODE', 0755);
32
-defined('DIR_WRITE_MODE')  OR define('DIR_WRITE_MODE', 0755);
31
+defined('DIR_READ_MODE') OR define('DIR_READ_MODE', 0755);
32
+defined('DIR_WRITE_MODE') OR define('DIR_WRITE_MODE', 0755);
33 33
 
34 34
 /*
35 35
 |--------------------------------------------------------------------------
@@ -39,14 +39,14 @@  discard block
 block discarded – undo
39 39
 | These modes are used when working with fopen()/popen()
40 40
 |
41 41
 */
42
-defined('FOPEN_READ')                           OR define('FOPEN_READ', 'rb');
43
-defined('FOPEN_READ_WRITE')                     OR define('FOPEN_READ_WRITE', 'r+b');
44
-defined('FOPEN_WRITE_CREATE_DESTRUCTIVE')       OR define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care
42
+defined('FOPEN_READ') OR define('FOPEN_READ', 'rb');
43
+defined('FOPEN_READ_WRITE') OR define('FOPEN_READ_WRITE', 'r+b');
44
+defined('FOPEN_WRITE_CREATE_DESTRUCTIVE') OR define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care
45 45
 defined('FOPEN_READ_WRITE_CREATE_DESCTRUCTIVE') OR define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 'w+b'); // truncates existing file data, use with care
46
-defined('FOPEN_WRITE_CREATE')                   OR define('FOPEN_WRITE_CREATE', 'ab');
47
-defined('FOPEN_READ_WRITE_CREATE')              OR define('FOPEN_READ_WRITE_CREATE', 'a+b');
48
-defined('FOPEN_WRITE_CREATE_STRICT')            OR define('FOPEN_WRITE_CREATE_STRICT', 'xb');
49
-defined('FOPEN_READ_WRITE_CREATE_STRICT')       OR define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b');
46
+defined('FOPEN_WRITE_CREATE') OR define('FOPEN_WRITE_CREATE', 'ab');
47
+defined('FOPEN_READ_WRITE_CREATE') OR define('FOPEN_READ_WRITE_CREATE', 'a+b');
48
+defined('FOPEN_WRITE_CREATE_STRICT') OR define('FOPEN_WRITE_CREATE_STRICT', 'xb');
49
+defined('FOPEN_READ_WRITE_CREATE_STRICT') OR define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b');
50 50
 
51 51
 /*
52 52
 |--------------------------------------------------------------------------
@@ -73,20 +73,20 @@  discard block
 block discarded – undo
73 73
 |       http://tldp.org/LDP/abs/html/exitcodes.html
74 74
 |
75 75
 */
76
-defined('EXIT_SUCCESS')        OR define('EXIT_SUCCESS', 0); // no errors
77
-defined('EXIT_ERROR')          OR define('EXIT_ERROR', 1); // generic error
78
-defined('EXIT_CONFIG')         OR define('EXIT_CONFIG', 3); // configuration error
79
-defined('EXIT_UNKNOWN_FILE')   OR define('EXIT_UNKNOWN_FILE', 4); // file not found
80
-defined('EXIT_UNKNOWN_CLASS')  OR define('EXIT_UNKNOWN_CLASS', 5); // unknown class
76
+defined('EXIT_SUCCESS') OR define('EXIT_SUCCESS', 0); // no errors
77
+defined('EXIT_ERROR') OR define('EXIT_ERROR', 1); // generic error
78
+defined('EXIT_CONFIG') OR define('EXIT_CONFIG', 3); // configuration error
79
+defined('EXIT_UNKNOWN_FILE') OR define('EXIT_UNKNOWN_FILE', 4); // file not found
80
+defined('EXIT_UNKNOWN_CLASS') OR define('EXIT_UNKNOWN_CLASS', 5); // unknown class
81 81
 defined('EXIT_UNKNOWN_METHOD') OR define('EXIT_UNKNOWN_METHOD', 6); // unknown class member
82
-defined('EXIT_USER_INPUT')     OR define('EXIT_USER_INPUT', 7); // invalid user input
83
-defined('EXIT_DATABASE')       OR define('EXIT_DATABASE', 8); // database error
84
-defined('EXIT__AUTO_MIN')      OR define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code
85
-defined('EXIT__AUTO_MAX')      OR define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code
82
+defined('EXIT_USER_INPUT') OR define('EXIT_USER_INPUT', 7); // invalid user input
83
+defined('EXIT_DATABASE') OR define('EXIT_DATABASE', 8); // database error
84
+defined('EXIT__AUTO_MIN') OR define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code
85
+defined('EXIT__AUTO_MAX') OR define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code
86 86
 
87 87
 /***** TIMEAGO CONSTANTS *****/
88 88
 defined('TIMEAGO_MONTH') OR define('TIMEAGO_MONTH', strtotime('-1 month')); //1 month ago
89
-defined('TIMEAGO_WEEK')  OR define('TIMEAGO_WEEK', strtotime('-1 week')); //1 week ago
90
-defined('TIMEAGO_3DAY')  OR define('TIMEAGO_3DAY', strtotime('-3 day')); //3 days ago
89
+defined('TIMEAGO_WEEK') OR define('TIMEAGO_WEEK', strtotime('-1 week')); //1 week ago
90
+defined('TIMEAGO_3DAY') OR define('TIMEAGO_3DAY', strtotime('-3 day')); //3 days ago
91 91
 
92 92
 defined('USERSCRIPT_VERSION') OR define('USERSCRIPT_VERSION', '1.11.9'); //This is automatically set by a PHPStorm File Watcher
Please login to merge, or discard this patch.
public/index.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 // Maintenance Mode
40 40
 define('MAINTENANCE', FALSE);
41 41
 if(MAINTENANCE && PHP_SAPI !== 'cli') {
42
-	require_once __DIR__ . DIRECTORY_SEPARATOR . '../application/views/common/maintenance.php'; ## call view
42
+	require_once __DIR__.DIRECTORY_SEPARATOR.'../application/views/common/maintenance.php'; ## call view
43 43
 	exit();
44 44
 }
45 45
 
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
  * Different environments will require different levels of error reporting.
82 82
  * By default development will show errors but testing and live will hide them.
83 83
  */
84
-switch (ENVIRONMENT)
84
+switch(ENVIRONMENT)
85 85
 {
86 86
 	case 'development':
87 87
 		error_reporting(-1);
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 	case 'testing':
95 95
 	case 'production':
96 96
 		ini_set('display_errors', 0);
97
-		if (version_compare(PHP_VERSION, '5.3', '>='))
97
+		if(version_compare(PHP_VERSION, '5.3', '>='))
98 98
 		{
99 99
 			error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED);
100 100
 		}
@@ -212,12 +212,12 @@  discard block
 block discarded – undo
212 212
  */
213 213
 
214 214
 // Set the current directory correctly for CLI requests
215
-if (defined('STDIN'))
215
+if(defined('STDIN'))
216 216
 {
217 217
 	chdir(dirname(__FILE__));
218 218
 }
219 219
 
220
-if (($_temp = realpath($system_path)) !== FALSE)
220
+if(($_temp = realpath($system_path)) !== FALSE)
221 221
 {
222 222
 	$system_path = $_temp.DIRECTORY_SEPARATOR;
223 223
 }
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 }
233 233
 
234 234
 // Is the system path correct?
235
-if ( ! is_dir($system_path))
235
+if(!is_dir($system_path))
236 236
 {
237 237
 	header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
238 238
 	echo 'Your system folder path does not appear to be set correctly. Please open the following file and correct this: '.pathinfo(__FILE__, PATHINFO_BASENAME);
@@ -257,9 +257,9 @@  discard block
 block discarded – undo
257 257
 define('SYSDIR', basename(BASEPATH));
258 258
 
259 259
 // The path to the "application" directory
260
-if (is_dir($application_folder))
260
+if(is_dir($application_folder))
261 261
 {
262
-	if (($_temp = realpath($application_folder)) !== FALSE)
262
+	if(($_temp = realpath($application_folder)) !== FALSE)
263 263
 	{
264 264
 		$application_folder = $_temp;
265 265
 	}
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 		);
273 273
 	}
274 274
 }
275
-elseif (is_dir(BASEPATH.$application_folder.DIRECTORY_SEPARATOR))
275
+elseif(is_dir(BASEPATH.$application_folder.DIRECTORY_SEPARATOR))
276 276
 {
277 277
 	$application_folder = BASEPATH.strtr(
278 278
 			trim($application_folder, '/\\'),
@@ -290,13 +290,13 @@  discard block
 block discarded – undo
290 290
 define('APPPATH', $application_folder.DIRECTORY_SEPARATOR);
291 291
 
292 292
 // The path to the "views" directory
293
-if ( ! isset($view_folder[0]) && is_dir(APPPATH.'views'.DIRECTORY_SEPARATOR))
293
+if(!isset($view_folder[0]) && is_dir(APPPATH.'views'.DIRECTORY_SEPARATOR))
294 294
 {
295 295
 	$view_folder = APPPATH.'views';
296 296
 }
297
-elseif (is_dir($view_folder))
297
+elseif(is_dir($view_folder))
298 298
 {
299
-	if (($_temp = realpath($view_folder)) !== FALSE)
299
+	if(($_temp = realpath($view_folder)) !== FALSE)
300 300
 	{
301 301
 		$view_folder = $_temp;
302 302
 	}
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 		);
310 310
 	}
311 311
 }
312
-elseif (is_dir(APPPATH.$view_folder.DIRECTORY_SEPARATOR))
312
+elseif(is_dir(APPPATH.$view_folder.DIRECTORY_SEPARATOR))
313 313
 {
314 314
 	$view_folder = APPPATH.strtr(
315 315
 			trim($view_folder, '/\\'),
Please login to merge, or discard this patch.
_scripts/deploy.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -106,15 +106,15 @@  discard block
 block discarded – undo
106 106
 	)');
107 107
 });
108 108
 
109
-task('deploy:copy_files', function () {
109
+task('deploy:copy_files', function() {
110 110
 	$sharedPath = '{{deploy_path}}/shared';
111
-	foreach (get('copy_files') as $file) {
111
+	foreach(get('copy_files') as $file) {
112 112
 		$dirname = dirname(parse($file));
113 113
 		// Create dir of shared file
114
-		run("mkdir -p $sharedPath/" . $dirname);
114
+		run("mkdir -p $sharedPath/".$dirname);
115 115
 		// Check if shared file does not exist in shared.
116 116
 		// and file exist in release
117
-		if (!test("[ -f $sharedPath/$file ]") && test("[ -f {{release_path}}/$file ]")) {
117
+		if(!test("[ -f $sharedPath/$file ]") && test("[ -f {{release_path}}/$file ]")) {
118 118
 			// Copy file in shared dir if not present
119 119
 			run("cp -rv {{release_path}}/$file $sharedPath/$file");
120 120
 		}
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 	}
130 130
 });
131 131
 
132
-task('deploy:migrate_db', function () {
132
+task('deploy:migrate_db', function() {
133 133
 	// Migration is disabled by default on production, so we need to toggle it temporally.
134 134
 	run('( \
135 135
 		cd {{release_path}} && \
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 	)');
140 140
 });
141 141
 
142
-task('deploy:maintenance_enable', function () {
142
+task('deploy:maintenance_enable', function() {
143 143
 	//define('MAINTENANCE', FALSE);
144 144
 	run('( \
145 145
 		cd {{previous_release}} && \
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 		sed -i -r "s/(\'MAINTENANCE\',) FALSE/\1 TRUE/" public/index.php \
151 151
 	)');
152 152
 });
153
-task('deploy:maintenance_disable', function () {
153
+task('deploy:maintenance_disable', function() {
154 154
 	//define('MAINTENANCE', FALSE);
155 155
 	run('( \
156 156
 		cd {{release_path}} && \
Please login to merge, or discard this patch.