diff --git a/app/Console/Commands/PostUpdate.php b/app/Console/Commands/PostUpdate.php index 00cce48d61..fb6a014613 100644 --- a/app/Console/Commands/PostUpdate.php +++ b/app/Console/Commands/PostUpdate.php @@ -52,8 +52,14 @@ class PostUpdate extends Command nlog("finished migrating"); - exec('vendor/bin/composer install --no-dev -o'); + $output = []; + exec('vendor/bin/composer install --no-dev -o', $output); + + info(print_r($output,1)); + + nlog($output); + nlog("finished running composer install "); diff --git a/app/DataMapper/Analytics/DbQuery.php b/app/DataMapper/Analytics/DbQuery.php index f903923262..e802c64c4f 100644 --- a/app/DataMapper/Analytics/DbQuery.php +++ b/app/DataMapper/Analytics/DbQuery.php @@ -45,10 +45,11 @@ class DbQuery * * @var string */ - public $string_metric5 = 'uri'; + public $string_metric5 = 'method'; - public $string_metric6 = 'uri'; + public $string_metric6 = 'url'; + public $string_metric7 = 'ip_address'; /** * The counter * set to 1. @@ -59,10 +60,11 @@ class DbQuery public $double_metric2 = 1; - public function __construct($string_metric5, $string_metric6, $int_metric1, $double_metric2) { + public function __construct($string_metric5, $string_metric6, $int_metric1, $double_metric2, $string_metric7) { $this->int_metric1 = $int_metric1; $this->string_metric5 = $string_metric5; $this->string_metric6 = $string_metric6; $this->double_metric2 = $double_metric2; + $this->string_metric7 = $string_metric7; } } diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index 08747f9c24..1882fffce1 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -343,7 +343,7 @@ class LoginController extends BaseController } }); - return $this->listResponse($cu); + return $this->timeConstrainedResponse($cu); } } @@ -384,7 +384,7 @@ class LoginController extends BaseController } }); - return $this->listResponse($cu); + return $this->timeConstrainedResponse($cu); } return response() diff --git a/app/Http/Controllers/BaseController.php b/app/Http/Controllers/BaseController.php index 5ec9add2ec..aec442c9c1 100644 --- a/app/Http/Controllers/BaseController.php +++ b/app/Http/Controllers/BaseController.php @@ -219,7 +219,7 @@ class BaseController extends Controller }, 'company.company_gateways' => function ($query) use ($user) { - $query->whereNotNull('updated_at'); + $query->whereNotNull('updated_at')->with('gateway'); if(!$user->isAdmin()) $query->where('company_gateways.user_id', $user->id); @@ -402,7 +402,7 @@ class BaseController extends Controller }, 'company.company_gateways' => function ($query) use ($user) { - $query->whereNotNull('created_at'); + $query->whereNotNull('created_at')->with('gateway'); if(!$user->isAdmin()) $query->where('company_gateways.user_id', $user->id); diff --git a/app/Http/Controllers/MigrationController.php b/app/Http/Controllers/MigrationController.php index ceb5394d98..8506f5159f 100644 --- a/app/Http/Controllers/MigrationController.php +++ b/app/Http/Controllers/MigrationController.php @@ -345,14 +345,14 @@ class MigrationController extends BaseController return; } - try { + // try { // StartMigration::dispatch(base_path("storage/app/public/$migration_file"), $user, $fresh_company)->delay(now()->addSeconds(5)); nlog("starting migration job"); nlog($migration_file); StartMigration::dispatch($migration_file, $user, $fresh_company); - } catch (\Exception $e) { - nlog($e->getMessage()); - } + // } catch (\Exception $e) { + // nlog($e->getMessage()); + // } } return response()->json([ diff --git a/app/Http/Middleware/QueryLogging.php b/app/Http/Middleware/QueryLogging.php index 034c13b237..4af610dcc6 100644 --- a/app/Http/Middleware/QueryLogging.php +++ b/app/Http/Middleware/QueryLogging.php @@ -55,9 +55,9 @@ class QueryLogging nlog($request->method().' - '.$request->url().": $count queries - ".$time); // if($count > 50) - //nlog($queries); + nlog($queries); - LightLogs::create(new DbQuery($request->method(), $request->url(), $count, $time)) + LightLogs::create(new DbQuery($request->method(), $request->url(), $count, $time, request()->ip())) ->batch(); } diff --git a/app/Jobs/Util/Import.php b/app/Jobs/Util/Import.php index a50b64db93..907dad3236 100644 --- a/app/Jobs/Util/Import.php +++ b/app/Jobs/Util/Import.php @@ -192,15 +192,6 @@ class Import implements ShouldQueue $array = json_decode(file_get_contents($this->file_path), 1); $data = $array['data']; - - // disable some functionality here: - // 1. disable update_products - - $update_product_state = $this->company->update_products; - - $this->company->update_products = false; - $this->company->save(); - foreach ($this->available_imports as $import) { if (! array_key_exists($import, $data)) { //throw new ResourceNotAvailableForMigration("Resource {$key} is not available for migration."); @@ -220,9 +211,7 @@ class Import implements ShouldQueue // $this->fixClientBalances(); $check_data = CheckCompanyData::dispatchNow($this->company, md5(time())); - //reset functionality here - $this->company->update_products = $update_product_state; - $this->company->save(); + try{ Mail::to($this->user->email, $this->user->name()) diff --git a/composer.lock b/composer.lock index 66898315b8..312ec342a0 100644 --- a/composer.lock +++ b/composer.lock @@ -51,16 +51,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.178.9", + "version": "3.179.0", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "89710500988a8a7d77f1282fcf6a1d0ad8297eaf" + "reference": "59b0ceab1dfafa7c606ee8b940a42dc66921d11f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/89710500988a8a7d77f1282fcf6a1d0ad8297eaf", - "reference": "89710500988a8a7d77f1282fcf6a1d0ad8297eaf", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/59b0ceab1dfafa7c606ee8b940a42dc66921d11f", + "reference": "59b0ceab1dfafa7c606ee8b940a42dc66921d11f", "shasum": "" }, "require": { @@ -135,9 +135,9 @@ "support": { "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", "issues": "https://github.com/aws/aws-sdk-php/issues", - "source": "https://github.com/aws/aws-sdk-php/tree/3.178.9" + "source": "https://github.com/aws/aws-sdk-php/tree/3.179.0" }, - "time": "2021-04-23T18:28:02+00:00" + "time": "2021-04-28T18:14:15+00:00" }, { "name": "bacon/bacon-qr-code", @@ -723,20 +723,21 @@ }, { "name": "composer/composer", - "version": "2.0.12", + "version": "2.0.13", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "6c12ce263da71641903e399c3ce8ecb08fd375fb" + "reference": "986e8b86b7b570632ad0a905c3726c33dd4c0efb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/6c12ce263da71641903e399c3ce8ecb08fd375fb", - "reference": "6c12ce263da71641903e399c3ce8ecb08fd375fb", + "url": "https://api.github.com/repos/composer/composer/zipball/986e8b86b7b570632ad0a905c3726c33dd4c0efb", + "reference": "986e8b86b7b570632ad0a905c3726c33dd4c0efb", "shasum": "" }, "require": { "composer/ca-bundle": "^1.0", + "composer/metadata-minifier": "^1.0", "composer/semver": "^3.0", "composer/spdx-licenses": "^1.2", "composer/xdebug-handler": "^1.1", @@ -800,7 +801,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/composer/issues", - "source": "https://github.com/composer/composer/tree/2.0.12" + "source": "https://github.com/composer/composer/tree/2.0.13" }, "funding": [ { @@ -816,7 +817,76 @@ "type": "tidelift" } ], - "time": "2021-04-01T08:14:59+00:00" + "time": "2021-04-27T11:11:08+00:00" + }, + { + "name": "composer/metadata-minifier", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/composer/metadata-minifier.git", + "reference": "c549d23829536f0d0e984aaabbf02af91f443207" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/metadata-minifier/zipball/c549d23829536f0d0e984aaabbf02af91f443207", + "reference": "c549d23829536f0d0e984aaabbf02af91f443207", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "composer/composer": "^2", + "phpstan/phpstan": "^0.12.55", + "symfony/phpunit-bridge": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\MetadataMinifier\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Small utility library that handles metadata minification and expansion.", + "keywords": [ + "composer", + "compression" + ], + "support": { + "issues": "https://github.com/composer/metadata-minifier/issues", + "source": "https://github.com/composer/metadata-minifier/tree/1.0.0" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2021-04-07T13:37:33+00:00" }, { "name": "composer/semver", @@ -1984,16 +2054,16 @@ }, { "name": "google/apiclient-services", - "version": "v0.170.0", + "version": "v0.172.0", "source": { "type": "git", "url": "https://github.com/googleapis/google-api-php-client-services.git", - "reference": "b45ddc3d82b2c8f328d869d55db88c1885d898ee" + "reference": "85e8a9f0062a9e1aba3cdc0f499968bc8de78b7d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/b45ddc3d82b2c8f328d869d55db88c1885d898ee", - "reference": "b45ddc3d82b2c8f328d869d55db88c1885d898ee", + "url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/85e8a9f0062a9e1aba3cdc0f499968bc8de78b7d", + "reference": "85e8a9f0062a9e1aba3cdc0f499968bc8de78b7d", "shasum": "" }, "require": { @@ -2019,9 +2089,9 @@ ], "support": { "issues": "https://github.com/googleapis/google-api-php-client-services/issues", - "source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.170.0" + "source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.172.0" }, - "time": "2021-04-20T20:34:12+00:00" + "time": "2021-04-27T16:21:24+00:00" }, { "name": "google/auth", @@ -2306,16 +2376,16 @@ }, { "name": "guzzlehttp/psr7", - "version": "1.8.1", + "version": "1.8.2", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "35ea11d335fd638b5882ff1725228b3d35496ab1" + "reference": "dc960a912984efb74d0a90222870c72c87f10c91" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/35ea11d335fd638b5882ff1725228b3d35496ab1", - "reference": "35ea11d335fd638b5882ff1725228b3d35496ab1", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/dc960a912984efb74d0a90222870c72c87f10c91", + "reference": "dc960a912984efb74d0a90222870c72c87f10c91", "shasum": "" }, "require": { @@ -2375,9 +2445,9 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/1.8.1" + "source": "https://github.com/guzzle/psr7/tree/1.8.2" }, - "time": "2021-03-21T16:25:00+00:00" + "time": "2021-04-26T09:17:50+00:00" }, { "name": "hashids/hashids", @@ -2758,16 +2828,16 @@ }, { "name": "laravel/framework", - "version": "v8.38.0", + "version": "v8.40.0", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "26a73532c54d2c090692bf2e3e64e449669053ba" + "reference": "a654897ad7f97aea9d7ef292803939798c4a02a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/26a73532c54d2c090692bf2e3e64e449669053ba", - "reference": "26a73532c54d2c090692bf2e3e64e449669053ba", + "url": "https://api.github.com/repos/laravel/framework/zipball/a654897ad7f97aea9d7ef292803939798c4a02a4", + "reference": "a654897ad7f97aea9d7ef292803939798c4a02a4", "shasum": "" }, "require": { @@ -2922,7 +2992,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-04-20T13:50:21+00:00" + "time": "2021-04-28T14:38:56+00:00" }, { "name": "laravel/slack-notification-channel", @@ -3124,16 +3194,16 @@ }, { "name": "laravel/ui", - "version": "v3.2.0", + "version": "v3.2.1", "source": { "type": "git", "url": "https://github.com/laravel/ui.git", - "reference": "a1f82c6283c8373ea1958b8a27c3d5c98cade351" + "reference": "e2478cd0342a92ec1c8c77422553bda8ee004fd0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/ui/zipball/a1f82c6283c8373ea1958b8a27c3d5c98cade351", - "reference": "a1f82c6283c8373ea1958b8a27c3d5c98cade351", + "url": "https://api.github.com/repos/laravel/ui/zipball/e2478cd0342a92ec1c8c77422553bda8ee004fd0", + "reference": "e2478cd0342a92ec1c8c77422553bda8ee004fd0", "shasum": "" }, "require": { @@ -3175,10 +3245,9 @@ "ui" ], "support": { - "issues": "https://github.com/laravel/ui/issues", - "source": "https://github.com/laravel/ui/tree/v3.2.0" + "source": "https://github.com/laravel/ui/tree/v3.2.1" }, - "time": "2021-01-06T19:20:22+00:00" + "time": "2021-04-27T18:17:41+00:00" }, { "name": "league/commonmark", @@ -3821,16 +3890,16 @@ }, { "name": "livewire/livewire", - "version": "v2.4.3", + "version": "v2.4.4", "source": { "type": "git", "url": "https://github.com/livewire/livewire.git", - "reference": "69575f50bb7f8a49a41f9bd6bd16c73a6ef4fda3" + "reference": "33101c83b75728651b9e668a4559f97def7c9138" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/livewire/livewire/zipball/69575f50bb7f8a49a41f9bd6bd16c73a6ef4fda3", - "reference": "69575f50bb7f8a49a41f9bd6bd16c73a6ef4fda3", + "url": "https://api.github.com/repos/livewire/livewire/zipball/33101c83b75728651b9e668a4559f97def7c9138", + "reference": "33101c83b75728651b9e668a4559f97def7c9138", "shasum": "" }, "require": { @@ -3881,7 +3950,7 @@ "description": "A front-end framework for Laravel.", "support": { "issues": "https://github.com/livewire/livewire/issues", - "source": "https://github.com/livewire/livewire/tree/v2.4.3" + "source": "https://github.com/livewire/livewire/tree/v2.4.4" }, "funding": [ { @@ -3889,7 +3958,7 @@ "type": "github" } ], - "time": "2021-04-16T14:27:45+00:00" + "time": "2021-04-28T15:31:15+00:00" }, { "name": "maennchen/zipstream-php", @@ -10454,16 +10523,16 @@ }, { "name": "brianium/paratest", - "version": "v6.2.0", + "version": "v6.3.0", "source": { "type": "git", "url": "https://github.com/paratestphp/paratest.git", - "reference": "9a94366983ce32c7724fc92e3b544327d4adb9be" + "reference": "268d5b2b4237c0abf76c4aa9633ad8580be01e1e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paratestphp/paratest/zipball/9a94366983ce32c7724fc92e3b544327d4adb9be", - "reference": "9a94366983ce32c7724fc92e3b544327d4adb9be", + "url": "https://api.github.com/repos/paratestphp/paratest/zipball/268d5b2b4237c0abf76c4aa9633ad8580be01e1e", + "reference": "268d5b2b4237c0abf76c4aa9633ad8580be01e1e", "shasum": "" }, "require": { @@ -10472,28 +10541,28 @@ "ext-reflection": "*", "ext-simplexml": "*", "php": "^7.3 || ^8.0", - "phpunit/php-code-coverage": "^9.2.5", + "phpunit/php-code-coverage": "^9.2.6", "phpunit/php-file-iterator": "^3.0.5", "phpunit/php-timer": "^5.0.3", - "phpunit/phpunit": "^9.5.1", + "phpunit/phpunit": "^9.5.4", "sebastian/environment": "^5.1.3", - "symfony/console": "^4.4 || ^5.2", - "symfony/process": "^4.4 || ^5.2" + "symfony/console": "^4.4.21 || ^5.2.6", + "symfony/process": "^4.4.21 || ^5.2.4" }, "require-dev": { - "doctrine/coding-standard": "^8.2.0", - "ekino/phpstan-banned-code": "^0.3.1", + "doctrine/coding-standard": "^9.0.0", + "ekino/phpstan-banned-code": "^0.4.0", "ergebnis/phpstan-rules": "^0.15.3", "ext-posix": "*", - "infection/infection": "^0.20.2", - "phpstan/phpstan": "^0.12.70", + "infection/infection": "^0.21.5", + "phpstan/phpstan": "^0.12.84", "phpstan/phpstan-deprecation-rules": "^0.12.6", - "phpstan/phpstan-phpunit": "^0.12.17", + "phpstan/phpstan-phpunit": "^0.12.18", "phpstan/phpstan-strict-rules": "^0.12.9", - "squizlabs/php_codesniffer": "^3.5.8", - "symfony/filesystem": "^5.2.2", + "squizlabs/php_codesniffer": "^3.6.0", + "symfony/filesystem": "^5.2.6", "thecodingmachine/phpstan-strict-rules": "^0.12.1", - "vimeo/psalm": "^4.4.1" + "vimeo/psalm": "^4.7.1" }, "bin": [ "bin/paratest" @@ -10514,8 +10583,12 @@ { "name": "Brian Scaturro", "email": "scaturrob@gmail.com", - "homepage": "http://brianscaturro.com", - "role": "Lead" + "role": "Developer" + }, + { + "name": "Filippo Tessarotto", + "email": "zoeslam@gmail.com", + "role": "Developer" } ], "description": "Parallel testing for PHP", @@ -10528,9 +10601,19 @@ ], "support": { "issues": "https://github.com/paratestphp/paratest/issues", - "source": "https://github.com/paratestphp/paratest/tree/v6.2.0" + "source": "https://github.com/paratestphp/paratest/tree/v6.3.0" }, - "time": "2021-01-29T15:25:31+00:00" + "funding": [ + { + "url": "https://github.com/sponsors/Slamdunk", + "type": "github" + }, + { + "url": "https://paypal.me/filippotessarotto", + "type": "paypal" + } + ], + "time": "2021-04-27T09:24:27+00:00" }, { "name": "composer/package-versions-deprecated", @@ -11158,16 +11241,16 @@ }, { "name": "filp/whoops", - "version": "2.12.0", + "version": "2.12.1", "source": { "type": "git", "url": "https://github.com/filp/whoops.git", - "reference": "d501fd2658d55491a2295ff600ae5978eaad7403" + "reference": "c13c0be93cff50f88bbd70827d993026821914dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filp/whoops/zipball/d501fd2658d55491a2295ff600ae5978eaad7403", - "reference": "d501fd2658d55491a2295ff600ae5978eaad7403", + "url": "https://api.github.com/repos/filp/whoops/zipball/c13c0be93cff50f88bbd70827d993026821914dd", + "reference": "c13c0be93cff50f88bbd70827d993026821914dd", "shasum": "" }, "require": { @@ -11217,7 +11300,7 @@ ], "support": { "issues": "https://github.com/filp/whoops/issues", - "source": "https://github.com/filp/whoops/tree/2.12.0" + "source": "https://github.com/filp/whoops/tree/2.12.1" }, "funding": [ { @@ -11225,7 +11308,7 @@ "type": "github" } ], - "time": "2021-03-30T12:00:00+00:00" + "time": "2021-04-25T12:00:00+00:00" }, { "name": "friendsofphp/php-cs-fixer", @@ -13932,16 +14015,16 @@ }, { "name": "vimeo/psalm", - "version": "4.7.0", + "version": "4.7.1", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "d4377c0baf3ffbf0b1ec6998e8d1be2a40971005" + "reference": "cd53e047a58f71f646dd6bf45476076ab07b5d44" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/d4377c0baf3ffbf0b1ec6998e8d1be2a40971005", - "reference": "d4377c0baf3ffbf0b1ec6998e8d1be2a40971005", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/cd53e047a58f71f646dd6bf45476076ab07b5d44", + "reference": "cd53e047a58f71f646dd6bf45476076ab07b5d44", "shasum": "" }, "require": { @@ -13949,7 +14032,7 @@ "amphp/byte-stream": "^1.5", "composer/package-versions-deprecated": "^1.8.0", "composer/semver": "^1.4 || ^2.0 || ^3.0", - "composer/xdebug-handler": "^1.1", + "composer/xdebug-handler": "^1.1 || ^2.0", "dnoegel/php-xdg-base-dir": "^0.1.1", "ext-dom": "*", "ext-json": "*", @@ -14031,9 +14114,9 @@ ], "support": { "issues": "https://github.com/vimeo/psalm/issues", - "source": "https://github.com/vimeo/psalm/tree/4.7.0" + "source": "https://github.com/vimeo/psalm/tree/4.7.1" }, - "time": "2021-03-29T03:54:38+00:00" + "time": "2021-04-25T21:26:25+00:00" }, { "name": "webmozart/path-util",