Completed
Push — master ( a1095d...66879a )
by Angus
03:23
created
_scripts/generate_foolslide.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 	private $className;
10 10
 
11 11
 	public function __construct() {
12
-		if(isset($_SERVER['argv']) && count($_SERVER['argv']) === 3){
12
+		if(isset($_SERVER['argv']) && count($_SERVER['argv']) === 3) {
13 13
 			$this->baseURL   = rtrim($_SERVER['argv'][1], '/');
14 14
 			$this->className = $_SERVER['argv'][2];
15 15
 
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 
30 30
 		$this->updateDocs();
31 31
 
32
-		$domain =  preg_replace('#^https?://(.*?)(?:/.*?)?$#', '$1', $this->baseURL);
32
+		$domain = preg_replace('#^https?://(.*?)(?:/.*?)?$#', '$1', $this->baseURL);
33 33
 		say("\nAdmin SQL:");
34 34
 		say("INSERT INTO `mangatracker_development`.`tracker_sites` (`id`, `site`, `site_class`, `status`, `use_custom`) VALUES (NULL, '{$domain}', '{$this->className}', 'enabled', 'Y');");
35 35
 		say("INSERT INTO `mangatracker_production`.`tracker_sites` (`id`, `site`, `site_class`, `status`, `use_custom`) VALUES (NULL, '{$domain}', '{$this->className}', 'enabled', 'Y');");
@@ -108,12 +108,12 @@  discard block
 block discarded – undo
108 108
 
109 109
 		//Update @updated
110 110
 		$currentDate = date("Y-m-d", time());
111
-		$baseFile = str_replace("@updated      {$matches[1]}","@updated      {$currentDate}", $baseFile);
111
+		$baseFile = str_replace("@updated      {$matches[1]}", "@updated      {$currentDate}", $baseFile);
112 112
 
113 113
 		//Update @version
114 114
 		$currentVersion = explode('.', $matches[2]);
115
-		$newVersion = "{$currentVersion[0]}.{$currentVersion[1]}.". (((int) $currentVersion[2]) + 1);
116
-		$baseFile = str_replace("@version      {$matches[2]}","@version      {$newVersion}", $baseFile);
115
+		$newVersion = "{$currentVersion[0]}.{$currentVersion[1]}.".(((int) $currentVersion[2]) + 1);
116
+		$baseFile = str_replace("@version      {$matches[2]}", "@version      {$newVersion}", $baseFile);
117 117
 
118 118
 		//Add @require
119 119
 		// @resource     fontAwesome
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_Model.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php declare(strict_types=1); defined('BASEPATH') OR exit('No direct script access allowed');
2 2
 
3 3
 include_once APPPATH.'models/Tracker/Tracker_Base_Model.php';
4
-foreach (glob(APPPATH.'models/Tracker/*.php') as $filename) {
4
+foreach(glob(APPPATH.'models/Tracker/*.php') as $filename) {
5 5
 	/** @noinspection PhpIncludeInspection */
6 6
 	include_once $filename;
7 7
 }
Please login to merge, or discard this patch.
application/models/User_Options_Model.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 			$query = $this->db->select('value_str, value_int')
201 201
 			                  ->from('user_options')
202 202
 			                  ->where('user_id', $userID)
203
-			                  ->where('name',    $option)
203
+			                  ->where('name', $option)
204 204
 			                  ->limit(1);
205 205
 			$data = $query->get()->row_array();
206 206
 		} else {
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 				$query = $this->db->select('value_str, value_int')
209 209
 				                  ->from('user_options')
210 210
 				                  ->where('user_id', $userID)
211
-				                  ->where('name',    $option)
211
+				                  ->where('name', $option)
212 212
 				                  ->limit(1);
213 213
 				$data = $query->get()->row_array();
214 214
 				$this->session->set_tempdata("option_{$option}", $data, 3600);
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
 			);
262 262
 			//FIXME: Get a better solution than str_replace for removing special characters
263 263
 			$elements = array();
264
-			foreach (array_values($this->options[$option]['valid_options']) as $valid_option) {
264
+			foreach(array_values($this->options[$option]['valid_options']) as $valid_option) {
265 265
 				$elements[$option.'_'.str_replace(',', '_', $valid_option)] = array_merge($base_attributes, array(
266 266
 					'value' => $valid_option
267 267
 				));
Please login to merge, or discard this patch.
application/models/History_Model.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
 			foreach($result as $row) {
58 58
 				$arrRow = [];
59 59
 
60
-				$arrRow['updated_at']  = $row->updated_at;
60
+				$arrRow['updated_at'] = $row->updated_at;
61 61
 
62 62
 				$newChapterData = $this->Tracker->sites->{$row->site_class}->getChapterData($row->title_url, $row->new_chapter);
63 63
 				$arrRow['new_chapter']      = "<a href=\"{$newChapterData['url']}\">{$newChapterData['number']}</a>";
Please login to merge, or discard this patch.
application/models/Tracker/Tracker_Sites_Model.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 
189 189
 			$ch = curl_init();
190 190
 			curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
191
-			curl_setopt($ch, CURLOPT_ENCODING , "gzip");
191
+			curl_setopt($ch, CURLOPT_ENCODING, "gzip");
192 192
 			//curl_setopt($ch, CURLOPT_VERBOSE, 1);
193 193
 			curl_setopt($ch, CURLOPT_HEADER, 1);
194 194
 
@@ -210,8 +210,8 @@  discard block
 block discarded – undo
210 210
 			curl_setopt($ch, CURLOPT_URL, $url);
211 211
 
212 212
 			if($isPost) {
213
-				curl_setopt($ch,CURLOPT_POST, count($postFields));
214
-				curl_setopt($ch,CURLOPT_POSTFIELDS, http_build_query($postFields));
213
+				curl_setopt($ch, CURLOPT_POST, count($postFields));
214
+				curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postFields));
215 215
 			}
216 216
 
217 217
 			$response = curl_exec($ch);
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 			$result = shell_exec('python '.APPPATH.'../_scripts/get_cloudflare_cookie.py '.escapeshellarg(json_encode($urlData)));
259 259
 			$cookieData = json_decode($result, TRUE);
260 260
 
261
-			$this->cache->save("cloudflare_{$this->site}", $cookieData['cookies'],  31536000 /* 1 year, or until we renew it */);
261
+			$this->cache->save("cloudflare_{$this->site}", $cookieData['cookies'], 31536000 /* 1 year, or until we renew it */);
262 262
 			log_message('debug', "Saving CloudFlare Cookies for {$this->site}");
263 263
 
264 264
 			$refresh = TRUE;
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 
317 317
 				$dom = new DOMDocument();
318 318
 				libxml_use_internal_errors(TRUE);
319
-				$dom->loadHTML('<?xml encoding="utf-8" ?>' . $data);
319
+				$dom->loadHTML('<?xml encoding="utf-8" ?>'.$data);
320 320
 				libxml_use_internal_errors(FALSE);
321 321
 
322 322
 				$xpath = new DOMXPath($dom);
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
 				if($nodes_title->length === 1) {
326 326
 					if($nodes_row->length === 1) {
327 327
 						$firstRow      = $nodes_row->item(0);
328
-						$nodes_latest  = $xpath->query($node_latest_string,  $firstRow);
328
+						$nodes_latest  = $xpath->query($node_latest_string, $firstRow);
329 329
 
330 330
 						if($node_chapter_string !== '') {
331 331
 							$nodes_chapter = $xpath->query($node_chapter_string, $firstRow);
@@ -541,7 +541,7 @@  discard block
 block discarded – undo
541 541
 	final private function _setSiteRateLimit(?int $rateLimit = NULL) : bool {
542 542
 		//We would just use increment(), but we can't set ttl with it...
543 543
 		$currentRateLimit = $rateLimit ?: $this->_getSiteRateLimit();
544
-		return $this->cache->save("{$this->site}_ratelimit", $currentRateLimit + 1,3600);
544
+		return $this->cache->save("{$this->site}_ratelimit", $currentRateLimit + 1, 3600);
545 545
 	}
546 546
 }
547 547
 
@@ -558,7 +558,7 @@  discard block
 block discarded – undo
558 558
 		$chapter_parts = explode('/', $chapter); //returns #LANG#/#VOLUME#/#CHAPTER#/#CHAPTER_EXTRA#(/#PAGE#/)
559 559
 		return [
560 560
 			'url'    => $this->getChapterURL($title_url, $chapter),
561
-			'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '') . "c{$chapter_parts[2]}" . (isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/
561
+			'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '')."c{$chapter_parts[2]}".(isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/
562 562
 		];
563 563
 	}
564 564
 	public function getChapterURL(string $title_url, string $chapter) : string {
@@ -742,9 +742,9 @@  discard block
 block discarded – undo
742 742
 
743 743
 							$dateString = str_replace('/', '-', trim($nodes_latest->item(0)->nodeValue)); //NOTE: We replace slashes here as it stops strtotime interpreting the date as US date format.
744 744
 							if($dateString == 'T') {
745
-								$dateString = date("Y-m-d",now());
745
+								$dateString = date("Y-m-d", now());
746 746
 							}
747
-							$titleData['last_updated'] = date("Y-m-d H:i:s", strtotime($dateString . ' 00:00'));
747
+							$titleData['last_updated'] = date("Y-m-d H:i:s", strtotime($dateString.' 00:00'));
748 748
 
749 749
 							$titleDataList[$title_url] = $titleData;
750 750
 						}
@@ -908,11 +908,11 @@  discard block
 block discarded – undo
908 908
 			""
909 909
 		);
910 910
 		if($data) {
911
-			$titleData['title'] = trim(preg_replace('/ Added on .*$/','', $data['nodes_title']->textContent));
911
+			$titleData['title'] = trim(preg_replace('/ Added on .*$/', '', $data['nodes_title']->textContent));
912 912
 			$titleData['latest_chapter'] = preg_replace('/^.*\/([0-9\.]+)$/', '$1', (string) $data['nodes_chapter']->getAttribute('href'));
913 913
 
914
-			$dateString = preg_replace('/^Added (?:on )?/', '',$data['nodes_latest']->textContent);
915
-			$titleData['last_updated'] =  date("Y-m-d H:i:s", strtotime($dateString));
914
+			$dateString = preg_replace('/^Added (?:on )?/', '', $data['nodes_latest']->textContent);
915
+			$titleData['last_updated'] = date("Y-m-d H:i:s", strtotime($dateString));
916 916
 		}
917 917
 		return (!empty($titleData) ? $titleData : NULL);
918 918
 	}
Please login to merge, or discard this patch.
application/models/Tracker/Tracker_Stats_Model.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
 				], FALSE)
29 29
 				->from('tracker_chapters')
30 30
 				->join('tracker_titles', 'tracker_titles.id = tracker_chapters.title_id', 'left')
31
-				->join('tracker_sites','tracker_titles.site_id = tracker_sites.id', 'left')
31
+				->join('tracker_sites', 'tracker_titles.site_id = tracker_sites.id', 'left')
32 32
 				->where('tracker_sites.status', 'enabled')
33 33
 				->group_by('tracker_chapters.title_id')
34 34
 				->having('count > 1')
Please login to merge, or discard this patch.
application/models/Tracker/Tracker_Admin_Model.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 		$query = $query->get();
78 78
 
79 79
 		if($query->num_rows() > 0) {
80
-			foreach ($query->result() as $row) {
80
+			foreach($query->result() as $row) {
81 81
 				$this->handleUpdate($row);
82 82
 			}
83 83
 		}
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 		$query = $query->get();
135 135
 
136 136
 		if($query->num_rows() > 0) {
137
-			foreach ($query->result() as $row) {
137
+			foreach($query->result() as $row) {
138 138
 				$this->handleUpdate($row);
139 139
 			}
140 140
 		}
@@ -209,10 +209,10 @@  discard block
 block discarded – undo
209 209
 		                  ->get();
210 210
 
211 211
 		$sites = $query->result_array();
212
-		foreach ($sites as $site) {
212
+		foreach($sites as $site) {
213 213
 			$siteClass = $this->sites->{$site['site_class']};
214 214
 			if($titleDataList = $siteClass->doCustomUpdate()) {
215
-				foreach ($titleDataList as $titleURL => $titleData) {
215
+				foreach($titleDataList as $titleURL => $titleData) {
216 216
 					$titleURL = (string) $titleURL; //Number only keys get converted to int for some reason, so we need to fix that.
217 217
 					print "> {$titleData['title']} <{$site['site_class']}>"; //Print this prior to doing anything so we can more easily find out if something went wrong
218 218
 					if(is_array($titleData) && !is_null($titleData['latest_chapter'])) {
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
 		$query = $this->db->select('tracker_titles.id, tracker_titles.title_url, tracker_sites.site_class')
256 256
 		                  ->from('tracker_titles')
257 257
 		                  ->join('tracker_sites', 'tracker_sites.id = tracker_titles.site_id', 'left')
258
-		                  ->where('tracker_titles.followed','N')
258
+		                  ->where('tracker_titles.followed', 'N')
259 259
 		                  ->where('tracker_titles !=', '255')
260 260
 		                  ->where('tracker_sites.status', 'enabled')
261 261
 		                  ->where('tracker_sites.use_custom', 'Y')
Please login to merge, or discard this patch.
application/models/Tracker/Tracker_Favourites_Model.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -14,8 +14,8 @@  discard block
 block discarded – undo
14 14
 			          tf.chapter, 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)))
@@ -50,8 +50,8 @@  discard block
 block discarded – undo
50 50
 			          tf.chapter, tf.updated_at', FALSE)
51 51
 			->from('tracker_favourites AS tf')
52 52
 			->join('tracker_chapters AS tc', 'tf.chapter_id = tc.id', 'left')
53
-			->join('tracker_titles AS tt',   'tc.title_id = tt.id',   'left')
54
-			->join('tracker_sites AS ts',    'tt.site_id = ts.id',    'left')
53
+			->join('tracker_titles AS tt', 'tc.title_id = tt.id', 'left')
54
+			->join('tracker_sites AS ts', 'tt.site_id = ts.id', 'left')
55 55
 			->where('tc.user_id', $this->User->id) //CHECK: Is this inefficient? Would it be better to have a user_id column in tracker_favourites?
56 56
 			->order_by('tf.id DESC')
57 57
 			->get();
Please login to merge, or discard this patch.