@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | |
3 | 3 | if(!extension_loaded('gd')) die('GD ext is required to run this!'); |
4 | 4 | |
@@ -9,7 +9,7 @@ discard block |
||
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 | |
@@ -92,12 +92,12 @@ discard block |
||
92 | 92 | |
93 | 93 | //Update @updated |
94 | 94 | $currentDate = date("Y-m-d", time()); |
95 | - $baseFile = str_replace("@updated {$matches[1]}","@updated {$currentDate}", $baseFile); |
|
95 | + $baseFile = str_replace("@updated {$matches[1]}", "@updated {$currentDate}", $baseFile); |
|
96 | 96 | |
97 | 97 | //Update @version |
98 | 98 | $currentVersion = explode('.', $matches[2]); |
99 | - $newVersion = "{$currentVersion[0]}.{$currentVersion[1]}.". (((int) $currentVersion[2]) + 1); |
|
100 | - $baseFile = str_replace("@version {$matches[2]}","@version {$newVersion}", $baseFile); |
|
99 | + $newVersion = "{$currentVersion[0]}.{$currentVersion[1]}.".(((int) $currentVersion[2]) + 1); |
|
100 | + $baseFile = str_replace("@version {$matches[2]}", "@version {$newVersion}", $baseFile); |
|
101 | 101 | |
102 | 102 | //Add site |
103 | 103 | $siteData = <<<EOT |
@@ -78,7 +78,7 @@ |
||
78 | 78 | //TEMP |
79 | 79 | $route['user/dashboard_beta'] = 'User/DashboardBeta'; |
80 | 80 | |
81 | -$route['api/internal/get_list'] = 'API/Internal/GetList'; |
|
81 | +$route['api/internal/get_list'] = 'API/Internal/GetList'; |
|
82 | 82 | $route['api/internal/get_list/(all|reading|on-hold|plan-to-read|(custom(?:1|2|3)))'] = 'API/Internal/GetList/index/$1'; |
83 | 83 | |
84 | 84 | $route['ajax/username_check']['post'] = 'Ajax/UsernameCheck'; //rate limited |
@@ -1,11 +1,11 @@ |
||
1 | -<?php declare(strict_types=1); defined('BASEPATH') or exit('No direct script access allowed'); |
|
1 | +<?php declare(strict_types = 1); defined('BASEPATH') or exit('No direct script access allowed'); |
|
2 | 2 | |
3 | 3 | //Because we can't autoload the cache driver with params - https://forum.codeigniter.com/thread-62217-post-319687.html#pid319687 |
4 | 4 | class Cacher { |
5 | 5 | protected $CI; |
6 | 6 | |
7 | 7 | public function __construct() { |
8 | - $this->CI =& get_instance(); //grab an instance of CI |
|
8 | + $this->CI = & get_instance(); //grab an instance of CI |
|
9 | 9 | $this->initiate_cache(); |
10 | 10 | } |
11 | 11 |
@@ -6,7 +6,7 @@ discard block |
||
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. |
@@ -18,10 +18,10 @@ discard block |
||
18 | 18 | |
19 | 19 | $this->global_data['theme'] = $this->User_Options->get('theme'); |
20 | 20 | $css_path = "css/main.{$this->User_Options->get('theme')}"; |
21 | - $this->global_data['complied_css_path'] = asset_url()."{$css_path}.".filemtime(APPPATH . "../public/assets/{$css_path}.css").".css"; |
|
21 | + $this->global_data['complied_css_path'] = asset_url()."{$css_path}.".filemtime(APPPATH."../public/assets/{$css_path}.css").".css"; |
|
22 | 22 | |
23 | 23 | $js_path = 'js/compiled.min'; |
24 | - $this->global_data['complied_js_path'] = asset_url()."{$js_path}.".filemtime(APPPATH . "../public/assets/{$js_path}.js").".js"; |
|
24 | + $this->global_data['complied_js_path'] = asset_url()."{$js_path}.".filemtime(APPPATH."../public/assets/{$js_path}.js").".js"; |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | public function _render_page(/*(array) $paths*/) : void { |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | $json = is_array($json_input) ? json_encode($json_input) : $json_input; |
46 | 46 | |
47 | 47 | $this->output->set_content_type('application/json', 'utf-8'); |
48 | - $this->_render_content($json,'json', $download, $filenamePrefix); |
|
48 | + $this->_render_content($json, 'json', $download, $filenamePrefix); |
|
49 | 49 | } |
50 | 50 | public function _render_content(string $content, string $filenameExt, bool $download = FALSE, string $filenamePrefix = 'tracker') : void { |
51 | 51 | if($download) { |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | // break; |
27 | 27 | |
28 | 28 | case 'html': |
29 | - $this->body_data['trackerData'] = $trackerData['series']; |
|
29 | + $this->body_data['trackerData'] = $trackerData['series']; |
|
30 | 30 | |
31 | 31 | $this->header_data['show_header'] = FALSE; |
32 | 32 | $this->footer_data['show_footer'] = FALSE; |
@@ -62,12 +62,12 @@ discard block |
||
62 | 62 | if($show_404) show_404(); |
63 | 63 | } |
64 | 64 | |
65 | - private function _walk_recursive_remove (array $array, callable $callback) : array { |
|
66 | - foreach ($array as $k => $v) { |
|
67 | - if (is_array($v)) { |
|
65 | + private function _walk_recursive_remove(array $array, callable $callback) : array { |
|
66 | + foreach($array as $k => $v) { |
|
67 | + if(is_array($v)) { |
|
68 | 68 | $array[$k] = $this->_walk_recursive_remove($v, $callback); |
69 | 69 | } else { |
70 | - if ($callback($v, $k)) { |
|
70 | + if($callback($v, $k)) { |
|
71 | 71 | unset($array[$k]); |
72 | 72 | } |
73 | 73 | } |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php declare(strict_types=1); defined('BASEPATH') OR exit('No direct script access allowed'); |
|
1 | +<?php declare(strict_types = 1); defined('BASEPATH') OR exit('No direct script access allowed'); |
|
2 | 2 | |
3 | 3 | /** |
4 | 4 | * Class Tracker_Sites_Model |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | |
154 | 154 | $ch = curl_init(); |
155 | 155 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
156 | - curl_setopt($ch, CURLOPT_ENCODING , "gzip"); |
|
156 | + curl_setopt($ch, CURLOPT_ENCODING, "gzip"); |
|
157 | 157 | //curl_setopt($ch, CURLOPT_VERBOSE, 1); |
158 | 158 | curl_setopt($ch, CURLOPT_HEADER, 1); |
159 | 159 | |
@@ -175,8 +175,8 @@ discard block |
||
175 | 175 | curl_setopt($ch, CURLOPT_URL, $url); |
176 | 176 | |
177 | 177 | if($isPost) { |
178 | - curl_setopt($ch,CURLOPT_POST, count($postFields)); |
|
179 | - curl_setopt($ch,CURLOPT_POSTFIELDS, http_build_query($postFields)); |
|
178 | + curl_setopt($ch, CURLOPT_POST, count($postFields)); |
|
179 | + curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postFields)); |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | $response = curl_exec($ch); |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | $result = shell_exec('python '.APPPATH.'../_scripts/get_cloudflare_cookie.py '.escapeshellarg(json_encode($urlData))); |
224 | 224 | $cookieData = json_decode($result, TRUE); |
225 | 225 | |
226 | - $this->cache->save("cloudflare_{$this->site}", $cookieData['cookies'], 31536000 /* 1 year, or until we renew it */); |
|
226 | + $this->cache->save("cloudflare_{$this->site}", $cookieData['cookies'], 31536000 /* 1 year, or until we renew it */); |
|
227 | 227 | log_message('debug', "Saving CloudFlare Cookies for {$this->site}"); |
228 | 228 | |
229 | 229 | $refresh = TRUE; |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | |
275 | 275 | $dom = new DOMDocument(); |
276 | 276 | libxml_use_internal_errors(TRUE); |
277 | - $dom->loadHTML('<?xml encoding="utf-8" ?>' . $data); |
|
277 | + $dom->loadHTML('<?xml encoding="utf-8" ?>'.$data); |
|
278 | 278 | libxml_use_internal_errors(FALSE); |
279 | 279 | |
280 | 280 | $xpath = new DOMXPath($dom); |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | $nodes_row = $xpath->query($node_row_string); |
283 | 283 | if($nodes_title->length === 1 && $nodes_row->length === 1) { |
284 | 284 | $firstRow = $nodes_row->item(0); |
285 | - $nodes_latest = $xpath->query($node_latest_string, $firstRow); |
|
285 | + $nodes_latest = $xpath->query($node_latest_string, $firstRow); |
|
286 | 286 | |
287 | 287 | if($node_chapter_string !== '') { |
288 | 288 | $nodes_chapter = $xpath->query($node_chapter_string, $firstRow); |
@@ -470,7 +470,7 @@ discard block |
||
470 | 470 | $chapter_parts = explode('/', $chapter); //returns #LANG#/#VOLUME#/#CHAPTER#/#CHAPTER_EXTRA#(/#PAGE#/) |
471 | 471 | return [ |
472 | 472 | 'url' => $this->getChapterURL($title_url, $chapter), |
473 | - 'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '') . "c{$chapter_parts[2]}" . (isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/ |
|
473 | + 'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '')."c{$chapter_parts[2]}".(isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/ |
|
474 | 474 | ]; |
475 | 475 | } |
476 | 476 | public function getChapterURL(string $title_url, string $chapter) : string { |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php declare(strict_types=1); defined('BASEPATH') OR exit('No direct script access allowed'); |
|
1 | +<?php declare(strict_types = 1); defined('BASEPATH') OR exit('No direct script access allowed'); |
|
2 | 2 | |
3 | 3 | class Tracker_List_Model extends Tracker_Base_Model { |
4 | 4 | public function __construct() { |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | ]; |
34 | 34 | } |
35 | 35 | if($result->num_rows() > 0) { |
36 | - foreach ($result->result() as $row) { |
|
36 | + foreach($result->result() as $row) { |
|
37 | 37 | $is_unread = intval(($row->latest_chapter == $row->ignore_chapter) || ($row->latest_chapter == $row->current_chapter) ? '1' : '0'); |
38 | 38 | $arr['series'][$row->category]['unread_count'] = (($arr['series'][$row->category]['unread_count'] ?? 0) + !$is_unread); |
39 | 39 | $data = [ |
@@ -89,8 +89,8 @@ discard block |
||
89 | 89 | $sortOrder = $this->User_Options->get('list_sort_order', $userID); |
90 | 90 | switch($this->User_Options->get('list_sort_type', $userID)) { |
91 | 91 | case 'unread': |
92 | - foreach (array_keys($arr['series']) as $category) { |
|
93 | - usort($arr['series'][$category]['manga'], function ($a, $b) use($sortOrder) { |
|
92 | + foreach(array_keys($arr['series']) as $category) { |
|
93 | + usort($arr['series'][$category]['manga'], function($a, $b) use($sortOrder) { |
|
94 | 94 | $a_text = strtolower("{$a['new_chapter_exists']} - {$a['title_data']['title']}"); |
95 | 95 | $b_text = strtolower("{$b['new_chapter_exists']} - {$b['title_data']['title']}"); |
96 | 96 | |
@@ -104,8 +104,8 @@ discard block |
||
104 | 104 | break; |
105 | 105 | |
106 | 106 | case 'unread_latest': |
107 | - foreach (array_keys($arr['series']) as $category) { |
|
108 | - usort($arr['series'][$category]['manga'], function ($a, $b) use($sortOrder) { |
|
107 | + foreach(array_keys($arr['series']) as $category) { |
|
108 | + usort($arr['series'][$category]['manga'], function($a, $b) use($sortOrder) { |
|
109 | 109 | $a_text = $a['new_chapter_exists']; |
110 | 110 | $b_text = $b['new_chapter_exists']; |
111 | 111 | |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | break; |
127 | 127 | |
128 | 128 | case 'alphabetical': |
129 | - foreach (array_keys($arr['series']) as $category) { |
|
129 | + foreach(array_keys($arr['series']) as $category) { |
|
130 | 130 | usort($arr['series'][$category]['manga'], function($a, $b) use($sortOrder) { |
131 | 131 | $a_text = strtolower("{$a['title_data']['title']}"); |
132 | 132 | $b_text = strtolower("{$b['title_data']['title']}"); |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | break; |
142 | 142 | |
143 | 143 | case 'my_status': |
144 | - foreach (array_keys($arr['series']) as $category) { |
|
144 | + foreach(array_keys($arr['series']) as $category) { |
|
145 | 145 | usort($arr['series'][$category]['manga'], function($a, $b) use($sortOrder) { |
146 | 146 | $a_text = strtolower("{$a['generated_current_data']['number']}"); |
147 | 147 | $b_text = strtolower("{$b['generated_current_data']['number']}"); |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | break; |
157 | 157 | |
158 | 158 | case 'latest': |
159 | - foreach (array_keys($arr['series']) as $category) { |
|
159 | + foreach(array_keys($arr['series']) as $category) { |
|
160 | 160 | usort($arr['series'][$category]['manga'], function($a, $b) use($sortOrder) { |
161 | 161 | $a_text = new DateTime("{$a['title_data']['last_updated']}"); |
162 | 162 | $b_text = new DateTime("{$b['title_data']['last_updated']}"); |
@@ -31,7 +31,7 @@ |
||
31 | 31 | |
32 | 32 | case 'csv': |
33 | 33 | $this->output->set_content_type('text/csv', 'utf-8'); |
34 | - $this->_render_content($this->Tracker->portation->arrayToCSVRecursive($historyData, 'Date/Time,Title,URL,Site,Status'), 'csv',TRUE, 'tracker-history'); |
|
34 | + $this->_render_content($this->Tracker->portation->arrayToCSVRecursive($historyData, 'Date/Time,Title,URL,Site,Status'), 'csv', TRUE, 'tracker-history'); |
|
35 | 35 | break; |
36 | 36 | |
37 | 37 | default: |
@@ -31,7 +31,7 @@ |
||
31 | 31 | |
32 | 32 | case 'csv': |
33 | 33 | $this->output->set_content_type('text/csv', 'utf-8'); |
34 | - $this->_render_content($this->Tracker->portation->arrayToCSVRecursive($favouriteData, 'Date/Time,Title,Manga URL,Site,Chapter,Chapter Number, Chapter URL'), 'csv',TRUE, 'tracker-favourite'); |
|
34 | + $this->_render_content($this->Tracker->portation->arrayToCSVRecursive($favouriteData, 'Date/Time,Title,Manga URL,Site,Chapter,Chapter Number, Chapter URL'), 'csv', TRUE, 'tracker-favourite'); |
|
35 | 35 | break; |
36 | 36 | |
37 | 37 | default: |