Completed
Push — master ( ff3b8a...09a521 )
by Angus
02:39
created
application/core/MY_Controller.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
 	protected $footer_data = array();
7 7
 	public    $global_data = array();
8 8
 
9
-	public function __construct(){
9
+	public function __construct() {
10 10
 		parent::__construct();
11 11
 
12 12
 		//FIXME: This is pretty much a phpUnit hack. Without it phpUnit fails here. We need a proper way to fake user/admin testing.
@@ -17,13 +17,13 @@  discard block
 block discarded – undo
17 17
 
18 18
 		$this->global_data['theme'] = $this->User_Options->get('theme');
19 19
 		if(ENVIRONMENT === 'production') {
20
-			$this->global_data['compiled_css_path'] = function () {
20
+			$this->global_data['compiled_css_path'] = function() {
21 21
 				$css_path = "css/main.{$this->global_data['theme']}";
22
-				return asset_url() . $css_path . '.' . filemtime(APPPATH . "../public/assets/{$css_path}.css") . '.css';
22
+				return asset_url().$css_path.'.'.filemtime(APPPATH."../public/assets/{$css_path}.css").'.css';
23 23
 			};
24 24
 
25 25
 			$js_path = 'js/compiled.min';
26
-			$this->global_data['compiled_js_path'] = asset_url() . $js_path . '.' . filemtime(APPPATH . "../public/assets/{$js_path}.js") . '.js';
26
+			$this->global_data['compiled_js_path'] = asset_url().$js_path.'.'.filemtime(APPPATH."../public/assets/{$js_path}.js").'.js';
27 27
 		}
28 28
 	}
29 29
 
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 		$json = is_array($json_input) ? json_encode($json_input) : $json_input;
55 55
 
56 56
 		$this->output->set_content_type('application/json', 'utf-8');
57
-		$this->_render_content($json ?? '{}','json', $download, $filenamePrefix);
57
+		$this->_render_content($json ?? '{}', 'json', $download, $filenamePrefix);
58 58
 	}
59 59
 	public function _render_content(string $content, string $filenameExt, bool $download = FALSE, string $filenamePrefix = 'tracker') : void {
60 60
 		if($download) {
Please login to merge, or discard this patch.
application/config/email.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,6 +40,6 @@
 block discarded – undo
40 40
 
41 41
 $config['dsn'] = TRUE;
42 42
 
43
-if(file_exists(APPPATH . 'config/_secure/email.php')) {
44
-	include APPPATH . 'config/_secure/email.php'; //CI BUG: For some odd reason, this isn't picked up by MY_Config. Possibly due to MY_Config not being loaded yet?
43
+if(file_exists(APPPATH.'config/_secure/email.php')) {
44
+	include APPPATH.'config/_secure/email.php'; //CI BUG: For some odd reason, this isn't picked up by MY_Config. Possibly due to MY_Config not being loaded yet?
45 45
 }
Please login to merge, or discard this patch.
_scripts/SpritesheetGenerator.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -38,10 +38,10 @@  discard block
 block discarded – undo
38 38
 		imagealphablending($sheetImage, FALSE);
39 39
 		imagesavealpha($sheetImage, TRUE);
40 40
 
41
-		imagefill($sheetImage,0,0,0x7fff0000);
41
+		imagefill($sheetImage, 0, 0, 0x7fff0000);
42 42
 
43 43
 		$x = 0;
44
-		foreach ($this->fileList as $filename) {
44
+		foreach($this->fileList as $filename) {
45 45
 			$iconImage = imagecreatefrompng("{$this->iconFolder}/{$filename}");
46 46
 			imagealphablending($iconImage, TRUE);
47 47
 
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 			$x++;
53 53
 		}
54 54
 
55
-		imagepng($sheetImage, ASSET_FOLDER . "/img/{$this->type}s.png");
55
+		imagepng($sheetImage, ASSET_FOLDER."/img/{$this->type}s.png");
56 56
 		say('Updated spritesheet!');
57 57
 	}
58 58
 	private function generateLESS(string $filename, int $dst_x) : void {
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 				"	.sprite();\n".
79 79
 				"	background: url('../../img/{$this->type}s.@{cache-version}.png') no-repeat;\n\n".
80 80
 				"	{$newIconLESS}\n".
81
-				"} //end sprite-{$this->type}",$oldLESS);
81
+				"} //end sprite-{$this->type}", $oldLESS);
82 82
 
83 83
 			file_put_contents($icons_file, $newLESS);
84 84
 			say('Updated LESS!');
Please login to merge, or discard this patch.
application/models/Tracker/Tracker_Favourites_Model.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -14,8 +14,8 @@  discard block
 block discarded – undo
14 14
 			          tf.chapter, tf.page, tf.updated_at', FALSE)
15 15
 			->from('tracker_favourites AS tf')
16 16
 			->join('tracker_chapters AS tc', 'tf.chapter_id = tc.id', 'left')
17
-			->join('tracker_titles AS tt',   'tc.title_id = tt.id',   'left')
18
-			->join('tracker_sites AS ts',    'tt.site_id = ts.id',    'left')
17
+			->join('tracker_titles AS tt', 'tc.title_id = tt.id', 'left')
18
+			->join('tracker_sites AS ts', 'tt.site_id = ts.id', 'left')
19 19
 			->where('tc.user_id', $this->User->id) //CHECK: Is this inefficient? Would it be better to have a user_id column in tracker_favourites?
20 20
 			->order_by('tf.id DESC')
21 21
 			->limit($rowsPerPage, ($rowsPerPage * ($page - 1)))
@@ -57,8 +57,8 @@  discard block
 block discarded – undo
57 57
 			          tf.chapter, tf.page, tf.updated_at', FALSE)
58 58
 			->from('tracker_favourites AS tf')
59 59
 			->join('tracker_chapters AS tc', 'tf.chapter_id = tc.id', 'left')
60
-			->join('tracker_titles AS tt',   'tc.title_id = tt.id',   'left')
61
-			->join('tracker_sites AS ts',    'tt.site_id = ts.id',    'left')
60
+			->join('tracker_titles AS tt', 'tc.title_id = tt.id', 'left')
61
+			->join('tracker_sites AS ts', 'tt.site_id = ts.id', 'left')
62 62
 			->where('tc.user_id', $this->User->id) //CHECK: Is this inefficient? Would it be better to have a user_id column in tracker_favourites?
63 63
 			->order_by('tf.id DESC')
64 64
 			->get();
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 
146 146
 						if($isSuccess) {
147 147
 							$success = array(
148
-								'status' => 'Unfavourited' . ($page ? " page {$page}" : ''),
148
+								'status' => 'Unfavourited'.($page ? " page {$page}" : ''),
149 149
 								'bool'   => TRUE
150 150
 							);
151 151
 							$this->History->userRemoveFavourite((int) $idCQueryRow->id, $chapter);
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 
168 168
 					if($isSuccess) {
169 169
 						$success = array(
170
-							'status' => 'Favourited' . ($page ? " page {$page}" : ''),
170
+							'status' => 'Favourited'.($page ? " page {$page}" : ''),
171 171
 							'bool'   => TRUE
172 172
 						);
173 173
 						$this->History->userAddFavourite((int) $idCQueryRow->id, $chapter);
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.
application/views/ReportIssue.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
 		<?=form_input($form_url)?>
11 11
 	</div>
12 12
 
13
-	<?=form_input('website','', ['id' => 'website'])?>
13
+	<?=form_input('website', '', ['id' => 'website'])?>
14 14
 
15 15
 	<?=validation_errors()?><?=($issue_submitted ? 'Issue successfully submitted' : "")?>
16 16
 	<button type="submit" class="btn btn-primary">Submit</button> | Alternatively, post an issue on our <?=anchor('https://github.com/DakuTree/manga-tracker/issues/new', 'Github page')?>.
Please login to merge, or discard this patch.
application/controllers/ReportIssue.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 		$this->header_data['page']  = 'report-issue';
13 13
 
14 14
 		$this->form_validation->set_rules('issue_description', 'Description', 'required|max_length[1000]');
15
-		$this->form_validation->set_rules('issue_url',         'URL',         'valid_url');
15
+		$this->form_validation->set_rules('issue_url', 'URL', 'valid_url');
16 16
 
17 17
 
18 18
 		$this->body_data['issue_submitted'] = FALSE;
@@ -21,9 +21,9 @@  discard block
 block discarded – undo
21 21
 
22 22
 			if(!empty($this->input->post('website'))) {
23 23
 				$this->body_data['issue_submitted'] = FALSE;
24
-				log_message('error', 'Bot attempting to spam report issue form: "' . $this->input->post('issue_description') . '"');
24
+				log_message('error', 'Bot attempting to spam report issue form: "'.$this->input->post('issue_description').'"');
25 25
 			} else {
26
-				$this->body_data['issue_submitted'] = $this->Tracker->issue->report('USERID:' . $this->User->id . ' ||| ' . $this->input->post('issue_description'), NULL, $this->input->post('issue_url'));
26
+				$this->body_data['issue_submitted'] = $this->Tracker->issue->report('USERID:'.$this->User->id.' ||| '.$this->input->post('issue_description'), NULL, $this->input->post('issue_url'));
27 27
 			}
28 28
 		}
29 29
 
Please login to merge, or discard this patch.
application/models/Tracker/Tracker_Admin_Model.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -79,8 +79,8 @@  discard block
 block discarded – undo
79 79
 		if($query->num_rows() > 0) {
80 80
 			$hardRateLimit  = 500; //This is to avoid any possible IP bans by cache breaking again.
81 81
 			$siteRateLimits = [];
82
-			foreach ($query->result() as $row) {
83
-				if(!array_key_exists($row->site_class,$siteRateLimits)) {
82
+			foreach($query->result() as $row) {
83
+				if(!array_key_exists($row->site_class, $siteRateLimits)) {
84 84
 					$siteRateLimits[$row->site_class] = 0;
85 85
 				}
86 86
 
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 		$query = $query->get();
149 149
 
150 150
 		if($query->num_rows() > 0) {
151
-			foreach ($query->result() as $row) {
151
+			foreach($query->result() as $row) {
152 152
 				$this->handleUpdate($row);
153 153
 			}
154 154
 		}
@@ -226,10 +226,10 @@  discard block
 block discarded – undo
226 226
 		                  ->get();
227 227
 
228 228
 		$sites = $query->result_array();
229
-		foreach ($sites as $site) {
229
+		foreach($sites as $site) {
230 230
 			$siteClass = $this->sites->{$site['site_class']};
231 231
 			if($titleDataList = $siteClass->doCustomUpdate()) {
232
-				foreach ($titleDataList as $titleURL => $titleData) {
232
+				foreach($titleDataList as $titleURL => $titleData) {
233 233
 					$titleURL = (string) $titleURL; //Number only keys get converted to int for some reason, so we need to fix that.
234 234
 					print "> {$titleData['title']} <{$site['site_class']}>"; //Print this prior to doing anything so we can more easily find out if something went wrong
235 235
 					if(is_array($titleData) && !is_null($titleData['latest_chapter'])) {
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 		$query = $this->db->select('tracker_titles.id, tracker_titles.title_url, tracker_sites.site_class')
273 273
 		                  ->from('tracker_titles')
274 274
 		                  ->join('tracker_sites', 'tracker_sites.id = tracker_titles.site_id', 'left')
275
-		                  ->where('tracker_titles.followed','N')
275
+		                  ->where('tracker_titles.followed', 'N')
276 276
 		                  ->where('tracker_titles !=', '255')
277 277
 		                  ->where('tracker_sites.status', 'enabled')
278 278
 		                  ->where('tracker_sites.use_custom', 'Y')
Please login to merge, or discard this patch.
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', '0.0.0'); //This is automatically updated on deployment.
Please login to merge, or discard this patch.