@@ -108,7 +108,7 @@ |
||
| 108 | 108 | */ |
| 109 | 109 | public function isRuleValid(string $ruleName) : bool { |
| 110 | 110 | $isValid = FALSE; |
| 111 | - if(is_string($ruleName) && $this->has_rule($ruleName)){ |
|
| 111 | + if(is_string($ruleName) && $this->has_rule($ruleName)) { |
|
| 112 | 112 | $isValid = !array_key_exists($ruleName, $this->error_array()); |
| 113 | 113 | } |
| 114 | 114 | return $isValid; |
@@ -43,8 +43,7 @@ discard block |
||
| 43 | 43 | public function valid_password(string $password) : bool { |
| 44 | 44 | if(!($isValid = $this->min_length($password, $this->CI->config->item('min_password_length', 'ion_auth')))) { |
| 45 | 45 | $this->set_message('valid_password', 'The password is too short!'); |
| 46 | - } |
|
| 47 | - elseif(!($isValid = $this->max_length($password, $this->CI->config->item('max_password_length', 'ion_auth')))) { |
|
| 46 | + } elseif(!($isValid = $this->max_length($password, $this->CI->config->item('max_password_length', 'ion_auth')))) { |
|
| 48 | 47 | $this->set_message('valid_password', 'The password is too long!'); |
| 49 | 48 | } |
| 50 | 49 | return $isValid; |
@@ -108,7 +107,7 @@ discard block |
||
| 108 | 107 | */ |
| 109 | 108 | public function isRuleValid(string $ruleName) : bool { |
| 110 | 109 | $isValid = FALSE; |
| 111 | - if(is_string($ruleName) && $this->has_rule($ruleName)){ |
|
| 110 | + if(is_string($ruleName) && $this->has_rule($ruleName)) { |
|
| 112 | 111 | $isValid = !array_key_exists($ruleName, $this->error_array()); |
| 113 | 112 | } |
| 114 | 113 | return $isValid; |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php defined('BASEPATH') OR exit('No direct script access allowed'); |
|
| 1 | +<?php defined('BASEPATH') or exit('No direct script access allowed'); |
|
| 2 | 2 | |
| 3 | 3 | include APPPATH.'config/database.php'; //CI doesn't do this by default? |
| 4 | 4 | |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php defined('BASEPATH') OR exit('No direct script access allowed'); |
|
| 1 | +<?php defined('BASEPATH') or exit('No direct script access allowed'); |
|
| 2 | 2 | |
| 3 | 3 | class MY_Security extends CI_Security { |
| 4 | 4 | public $verified = TRUE; |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php defined('BASEPATH') OR exit('No direct script access allowed'); |
|
| 1 | +<?php defined('BASEPATH') or exit('No direct script access allowed'); |
|
| 2 | 2 | |
| 3 | 3 | include APPPATH.'config/database.php'; //CI doesn't do this by default? |
| 4 | 4 | |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php defined('BASEPATH') OR exit('No direct script access allowed'); |
|
| 1 | +<?php defined('BASEPATH') or exit('No direct script access allowed'); |
|
| 2 | 2 | |
| 3 | 3 | include APPPATH.'config/database.php'; //CI doesn't do this by default? |
| 4 | 4 | |
@@ -9,7 +9,9 @@ |
||
| 9 | 9 | $this->header_data['title'] = 'Index'; |
| 10 | 10 | $this->header_data['page'] = 'index'; |
| 11 | 11 | |
| 12 | - if($this->User->logged_in()) redirect('user/dashboard'); |
|
| 12 | + if($this->User->logged_in()) { |
|
| 13 | + redirect('user/dashboard'); |
|
| 14 | + } |
|
| 13 | 15 | $this->_render_page('FrontPage'); |
| 14 | 16 | } |
| 15 | 17 | } |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php defined('BASEPATH') OR exit('No direct script access allowed'); |
|
| 1 | +<?php defined('BASEPATH') or exit('No direct script access allowed'); |
|
| 2 | 2 | |
| 3 | 3 | class FrontPage extends User_Controller { |
| 4 | 4 | public function __construct() { |
@@ -6,7 +6,9 @@ |
||
| 6 | 6 | */ |
| 7 | 7 | namespace Deployer; |
| 8 | 8 | |
| 9 | -if(basename(getcwd()) !== 'manga-tracker') die('Bad CWD: Call from manga-tracker with dep -f=_scripts/deploy.php deploy'); |
|
| 9 | +if(basename(getcwd()) !== 'manga-tracker') { |
|
| 10 | + die('Bad CWD: Call from manga-tracker with dep -f=_scripts/deploy.php deploy'); |
|
| 11 | +} |
|
| 10 | 12 | |
| 11 | 13 | require 'recipe/cachetool.php'; //requires deployer/recipes |
| 12 | 14 | require 'recipe/codeigniter.php'; |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | set('git_tty', FALSE); |
| 22 | 22 | |
| 23 | 23 | // Fix bug on windows |
| 24 | -set('ssh_multiplexing', false); |
|
| 24 | +set('ssh_multiplexing', FALSE); |
|
| 25 | 25 | |
| 26 | 26 | set('clear_paths', [ |
| 27 | 27 | '.docker', |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | // Writable dirs by web server |
| 44 | 44 | add('writable_dirs', []); |
| 45 | 45 | |
| 46 | -set('allow_anonymous_stats', false); |
|
| 46 | +set('allow_anonymous_stats', FALSE); |
|
| 47 | 47 | |
| 48 | 48 | // Hosts |
| 49 | 49 | host('trackr.moe') |
@@ -120,15 +120,15 @@ discard block |
||
| 120 | 120 | )'); |
| 121 | 121 | }); |
| 122 | 122 | |
| 123 | -task('deploy:copy_files', function () { |
|
| 123 | +task('deploy:copy_files', function() { |
|
| 124 | 124 | $sharedPath = '{{deploy_path}}/shared'; |
| 125 | - foreach (get('copy_files') as $file) { |
|
| 125 | + foreach(get('copy_files') as $file) { |
|
| 126 | 126 | $dirname = dirname(parse($file)); |
| 127 | 127 | // Create dir of shared file |
| 128 | - runS("mkdir -p $sharedPath/" . $dirname); |
|
| 128 | + runS("mkdir -p $sharedPath/".$dirname); |
|
| 129 | 129 | // Check if shared file does not exist in shared. |
| 130 | 130 | // and file exist in release |
| 131 | - if (!test("[ -f $sharedPath/$file ]") && test("[ -f {{release_path}}/$file ]")) { |
|
| 131 | + if(!test("[ -f $sharedPath/$file ]") && test("[ -f {{release_path}}/$file ]")) { |
|
| 132 | 132 | // Copy file in shared dir if not present |
| 133 | 133 | runS("cp -rv {{release_path}}/$file $sharedPath/$file"); |
| 134 | 134 | } |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | } |
| 144 | 144 | }); |
| 145 | 145 | |
| 146 | -task('deploy:migrate_db', function () { |
|
| 146 | +task('deploy:migrate_db', function() { |
|
| 147 | 147 | // Migration is disabled by default on production, so we need to toggle it temporally. |
| 148 | 148 | runS('( \ |
| 149 | 149 | cd {{release_path}} && \ |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | )'); |
| 154 | 154 | }); |
| 155 | 155 | |
| 156 | -task('deploy:maintenance_enable', function () { |
|
| 156 | +task('deploy:maintenance_enable', function() { |
|
| 157 | 157 | //define('MAINTENANCE', FALSE); |
| 158 | 158 | runS('( \ |
| 159 | 159 | cd {{previous_release}} && \ |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | sed -i -r "s/(\'MAINTENANCE\',) FALSE/\1 TRUE/" public/index.php \ |
| 165 | 165 | )'); |
| 166 | 166 | }); |
| 167 | -task('deploy:maintenance_disable', function () { |
|
| 167 | +task('deploy:maintenance_disable', function() { |
|
| 168 | 168 | //define('MAINTENANCE', FALSE); |
| 169 | 169 | runS('( \ |
| 170 | 170 | cd {{release_path}} && \ |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php defined('BASEPATH') OR exit('No direct script access allowed'); |
|
| 1 | +<?php defined('BASEPATH') or exit('No direct script access allowed'); |
|
| 2 | 2 | |
| 3 | 3 | class Dashboard extends Auth_Controller { |
| 4 | 4 | public function __construct() { |
@@ -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!'); |