diff --git a/app/Console/Commands/CheckDb.php b/app/Console/Commands/CheckDb.php deleted file mode 100644 index 31a846470dc1..000000000000 --- a/app/Console/Commands/CheckDb.php +++ /dev/null @@ -1,143 +0,0 @@ -LogMessage('Checking - V5_DB1'); - - foreach ($this->entities as $entity) { - $count_db_1 = $entity::on('db-ninja-01')->count(); - $count_db_2 = $entity::on('db-ninja-02a')->count(); - - $diff = $count_db_1 - $count_db_2; - - if ($diff != 0) { - $this->logMessage("{$entity} DB1: {$count_db_1} - DB2: {$count_db_2} - diff = {$diff}"); - } - } - - $this->LogMessage('Checking - V5_DB2'); - - foreach ($this->entities as $entity) { - $count_db_1 = $entity::on('db-ninja-02')->count(); - $count_db_2 = $entity::on('db-ninja-01a')->count(); - - $diff = $count_db_1 - $count_db_2; - - if ($diff != 0) { - $this->logMessage("{$entity} DB1: {$count_db_1} - DB2: {$count_db_2} - diff = {$diff}"); - } - } - } - - private function logMessage($str) - { - $str = date('Y-m-d h:i:s').' '.$str; - $this->info($str); - $this->log .= $str."\n"; - } -} diff --git a/app/Http/Middleware/SetWebDb.php b/app/Http/Middleware/SetWebDb.php index edf3993c906d..a86004841000 100644 --- a/app/Http/Middleware/SetWebDb.php +++ b/app/Http/Middleware/SetWebDb.php @@ -1,4 +1,13 @@ redis = \Illuminate\Support\Facades\Redis::connection('sentinel-cache'); + parent::__construct($limiter); /** @phpstan-ignore-line */ + + /** @phpstan-ignore-next-line */ + $this->redis = \Illuminate\Support\Facades\Redis::connection('sentinel-cache'); /** @phpstan-ignore-line */ } /** diff --git a/app/Models/Account.php b/app/Models/Account.php index 001b05100dcc..9a07d271c8b3 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -55,9 +55,9 @@ use Laracasts\Presenter\PresentableTrait; * @property string|null $referral_code * @property int|null $created_at * @property int|null $updated_at - * @property int $is_scheduler_running + * @property bool $is_scheduler_running * @property int|null $trial_duration - * @property int $is_onboarding + * @property bool $is_onboarding * @property object|null $onboarding * @property bool $is_migrated * @property string|null $platform diff --git a/composer.json b/composer.json index d188feead9a7..dc06712b3342 100644 --- a/composer.json +++ b/composer.json @@ -211,4 +211,4 @@ ], "minimum-stability": "dev", "prefer-stable": true -} +} \ No newline at end of file diff --git a/config/database.php b/config/database.php index da5827229278..1cfcfd61fde3 100644 --- a/config/database.php +++ b/config/database.php @@ -98,22 +98,6 @@ return [ 'options' => [], ], - 'db-ninja-01a' => [ - 'driver' => 'mysql', - 'host' => env('DB_HOST1', env('DB_HOST', '127.0.0.1')), - 'database' => env('DB_DATABASE2', env('DB_DATABASE', 'forge')), - 'username' => env('DB_USERNAME2', env('DB_USERNAME', 'forge')), - 'password' => env('DB_PASSWORD2', env('DB_PASSWORD', '')), - 'port' => env('DB_PORT1', env('DB_PORT', '3306')), - 'charset' => 'utf8mb4', - 'collation' => 'utf8mb4_unicode_ci', - 'prefix' => '', - 'prefix_indexes' => true, - 'strict' => env('DB_STRICT', false), - 'engine' => 'InnoDB ROW_FORMAT=DYNAMIC', - 'options' => [], - ], - 'db-ninja-02' => [ 'driver' => 'mysql', 'host' => env('DB_HOST2', env('DB_HOST', '127.0.0.1')), @@ -130,13 +114,13 @@ return [ 'options' => [], ], - 'db-ninja-02a' => [ + 'db-ninja-03' => [ 'driver' => 'mysql', - 'host' => env('DB_HOST2', env('DB_HOST', '127.0.0.1')), - 'database' => env('DB_DATABASE1', env('DB_DATABASE', 'forge')), - 'username' => env('DB_USERNAME1', env('DB_USERNAME', 'forge')), - 'password' => env('DB_PASSWORD1', env('DB_PASSWORD', '')), - 'port' => env('DB_PORT2', env('DB_PORT', '3306')), + 'host' => env('DB_HOST3', env('DB_HOST', '127.0.0.1')), + 'database' => env('DB_DATABASE3', env('DB_DATABASE', 'forge')), + 'username' => env('DB_USERNAME3', env('DB_USERNAME', 'forge')), + 'password' => env('DB_PASSWORD3', env('DB_PASSWORD', '')), + 'port' => env('DB_PORT3', env('DB_PORT', '3306')), 'charset' => 'utf8mb4', 'collation' => 'utf8mb4_unicode_ci', 'prefix' => '', diff --git a/phpstan.neon b/phpstan.neon index f0eab2441b2c..befa53f47f9e 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -6,6 +6,7 @@ parameters: level: 5 paths: - app + - Modules excludePaths: analyseAndScan: - 'vendor' @@ -16,6 +17,7 @@ parameters: - 'app/DataMapper/Analytics/*' - 'app/PaymentDrivers/Authorize/*' - 'app/PaymentDrivers/AuthorizePaymentDriver.php' + - 'app/Http/Middleware/ThrottleRequestsWithPredis.php' - 'app/Utils/Traits/*' universalObjectCratesClasses: - App\DataMapper\Tax\RuleInterface