@@ -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: |
@@ -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_Favourites_Model extends Tracker_Base_Model { |
| 4 | 4 | public function __construct() { |
@@ -14,8 +14,8 @@ discard block |
||
| 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 |
||
| 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(); |
@@ -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 | //http://english.stackexchange.com/a/141735 |
| 4 | 4 | class Tracker_Portation_Model extends Tracker_Base_Model { |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | $arr = []; |
| 63 | 63 | if($query->num_rows() > 0) { |
| 64 | - foreach ($query->result() as $row) { |
|
| 64 | + foreach($query->result() as $row) { |
|
| 65 | 65 | $arr[$row->category][] = [ |
| 66 | 66 | 'site' => $row->site, |
| 67 | 67 | 'title_url' => $row->title_url, |
@@ -94,15 +94,15 @@ discard block |
||
| 94 | 94 | $enclosure_esc = preg_quote($enclosure, '/'); |
| 95 | 95 | |
| 96 | 96 | $output = array(); |
| 97 | - foreach ($fields as $field) { |
|
| 98 | - if ($field === NULL && $nullToMysqlNull) { |
|
| 97 | + foreach($fields as $field) { |
|
| 98 | + if($field === NULL && $nullToMysqlNull) { |
|
| 99 | 99 | $output[] = 'NULL'; |
| 100 | 100 | continue; |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | // Enclose fields containing $delimiter, $enclosure or whitespace |
| 104 | - if ($encloseAll || preg_match("/(?:${delimiter_esc}|${enclosure_esc}|\s)/", $field)) { |
|
| 105 | - $output[] = $enclosure . str_replace($enclosure, $enclosure . $enclosure, $field) . $enclosure; |
|
| 104 | + if($encloseAll || preg_match("/(?:${delimiter_esc}|${enclosure_esc}|\s)/", $field)) { |
|
| 105 | + $output[] = $enclosure.str_replace($enclosure, $enclosure.$enclosure, $field).$enclosure; |
|
| 106 | 106 | } else { |
| 107 | 107 | $output[] = $field; |
| 108 | 108 | } |
@@ -116,10 +116,10 @@ discard block |
||
| 116 | 116 | $csvArr[] = $headers; |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | - foreach ($fields as $field) { |
|
| 120 | - $csvArr[] = $this->arrayToCSV($field, $delimiter, $enclosure,$encloseAll,$nullToMysqlNull); |
|
| 119 | + foreach($fields as $field) { |
|
| 120 | + $csvArr[] = $this->arrayToCSV($field, $delimiter, $enclosure, $encloseAll, $nullToMysqlNull); |
|
| 121 | 121 | } |
| 122 | 122 | |
| 123 | - return implode(PHP_EOL,$csvArr); |
|
| 123 | + return implode(PHP_EOL, $csvArr); |
|
| 124 | 124 | } |
| 125 | 125 | } |
@@ -64,7 +64,7 @@ |
||
| 64 | 64 | print "Testing site\n"; |
| 65 | 65 | switch($type) { |
| 66 | 66 | case 'update': |
| 67 | - if(!is_null($extra )) { |
|
| 67 | + if(!is_null($extra)) { |
|
| 68 | 68 | print_r($this->Tracker->sites->{$site}->getTitleData($extra)); |
| 69 | 69 | } |
| 70 | 70 | break; |
@@ -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 { |
@@ -675,9 +675,9 @@ discard block |
||
| 675 | 675 | |
| 676 | 676 | $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. |
| 677 | 677 | if($dateString == 'T') { |
| 678 | - $dateString = date("Y-m-d",now()); |
|
| 678 | + $dateString = date("Y-m-d", now()); |
|
| 679 | 679 | } |
| 680 | - $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime($dateString . ' 00:00')); |
|
| 680 | + $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime($dateString.' 00:00')); |
|
| 681 | 681 | |
| 682 | 682 | $titleDataList[$title_url] = $titleData; |
| 683 | 683 | } |
@@ -139,4 +139,4 @@ |
||
| 139 | 139 | 'History_Model' => 'History' |
| 140 | 140 | ); |
| 141 | 141 | |
| 142 | -require_once APPPATH . '../vendor/erusev/parsedown/Parsedown.php'; |
|
| 142 | +require_once APPPATH.'../vendor/erusev/parsedown/Parsedown.php'; |
|
@@ -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 | |
@@ -29,7 +29,7 @@ discard block |
||
| 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');"); |
@@ -97,12 +97,12 @@ discard block |
||
| 97 | 97 | |
| 98 | 98 | //Update @updated |
| 99 | 99 | $currentDate = date("Y-m-d", time()); |
| 100 | - $baseFile = str_replace("@updated {$matches[1]}","@updated {$currentDate}", $baseFile); |
|
| 100 | + $baseFile = str_replace("@updated {$matches[1]}", "@updated {$currentDate}", $baseFile); |
|
| 101 | 101 | |
| 102 | 102 | //Update @version |
| 103 | 103 | $currentVersion = explode('.', $matches[2]); |
| 104 | - $newVersion = "{$currentVersion[0]}.{$currentVersion[1]}.". (((int) $currentVersion[2]) + 1); |
|
| 105 | - $baseFile = str_replace("@version {$matches[2]}","@version {$newVersion}", $baseFile); |
|
| 104 | + $newVersion = "{$currentVersion[0]}.{$currentVersion[1]}.".(((int) $currentVersion[2]) + 1); |
|
| 105 | + $baseFile = str_replace("@version {$matches[2]}", "@version {$newVersion}", $baseFile); |
|
| 106 | 106 | |
| 107 | 107 | //Add site |
| 108 | 108 | $siteData = <<<EOT |
@@ -1,4 +1,4 @@ |
||
| 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_Issue_Model extends Tracker_Base_Model { |
| 4 | 4 | public function __construct() { |