@@ -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. |
@@ -17,13 +17,13 @@ discard block |
||
| 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 |
||
| 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) { |
@@ -40,6 +40,6 @@ |
||
| 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 | } |
@@ -2,7 +2,7 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | (PHP_SAPI !== 'cli' || isset($_SERVER['HTTP_USER_AGENT'])) && die('CLI only.'); |
| 4 | 4 | |
| 5 | -chdir(__DIR__ . '/../'); //Just to make things easier, change dir to project root. |
|
| 5 | +chdir(__DIR__.'/../'); //Just to make things easier, change dir to project root. |
|
| 6 | 6 | |
| 7 | 7 | function setup() { |
| 8 | 8 | vendor_copy(); |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | chmod_files(); |
| 11 | 11 | |
| 12 | 12 | //Make sure .gitkeep file is recreated |
| 13 | - touch(getcwd() . '/application/tests/_ci_phpunit_test/.gitkeep'); |
|
| 13 | + touch(getcwd().'/application/tests/_ci_phpunit_test/.gitkeep'); |
|
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | /**********************************************************************************************************************/ |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | function chmod_files() { |
| 24 | - $directory = new RecursiveDirectoryIterator(getcwd() . '/application/config'); |
|
| 24 | + $directory = new RecursiveDirectoryIterator(getcwd().'/application/config'); |
|
| 25 | 25 | $flattened = new RecursiveIteratorIterator($directory); |
| 26 | 26 | |
| 27 | 27 | $files = new RegexIterator($flattened, '/^(.*\/)?(database|database_password|config|email|recaptcha|sites)\.php/'); |
@@ -38,10 +38,10 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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!'); |
@@ -14,8 +14,8 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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); |
@@ -39,7 +39,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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, '/\\'), |
@@ -106,15 +106,15 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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}} && \ |
@@ -10,7 +10,7 @@ |
||
| 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')?>. |
@@ -12,7 +12,7 @@ discard block |
||
| 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 |
||
| 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 | |