From a4cfb4f8873e18e100ed089a7ccfed0b3e8603fc Mon Sep 17 00:00:00 2001 From: bidi Date: Thu, 1 Feb 2024 12:09:52 +0200 Subject: [PATCH 1/7] updated composer --- composer.json | 60 +++++++++++++++++++++++++-------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/composer.json b/composer.json index 4b6c5c45..0b0b92a2 100644 --- a/composer.json +++ b/composer.json @@ -27,42 +27,42 @@ } }, "require": { - "php": "~8.1.0 || ~8.2.0", + "php": "~8.1.0 || ~8.2.0 || ~8.3.0", "ext-gettext": "*", "dotkernel/dot-annotated-services": "^4.1.3", - "dotkernel/dot-cli": "^3.4.1", - "dotkernel/dot-controller": "^3.4.2", - "dotkernel/dot-data-fixtures": "^1.1.2", - "dotkernel/dot-errorhandler": "^3.3.1", - "dotkernel/dot-flashmessenger": "^3.4.1", - "dotkernel/dot-geoip": "^3.5.2", - "dotkernel/dot-helpers": "^3.4.1", - "dotkernel/dot-mail": "^4.1.0", - "dotkernel/dot-navigation": "^3.4.1", - "dotkernel/dot-rbac-guard": "^3.4.1", - "dotkernel/dot-session": "^5.4.1", - "dotkernel/dot-twigrenderer": "^3.4.1", - "dotkernel/dot-user-agent-sniffer": "^3.3.2", - "friendsofphp/proxy-manager-lts": "^1.0", - "laminas/laminas-component-installer": "^3.3.0", - "laminas/laminas-config-aggregator": "^1.13.0", - "laminas/laminas-i18n": "^2.23.0", - "laminas/laminas-math": "^3.6.0", - "mezzio/mezzio": "^3.17.0", - "mezzio/mezzio-authorization-rbac": "^1.6.0", - "mezzio/mezzio-cors": "^1.9.0", - "mezzio/mezzio-fastroute": "^3.10.0", - "ramsey/uuid-doctrine": "^1.8.2", - "roave/psr-container-doctrine": "^3.9.0" + "dotkernel/dot-cli": "^3.4.2", + "dotkernel/dot-controller": "^3.4.3", + "dotkernel/dot-data-fixtures": "^1.1.3", + "dotkernel/dot-errorhandler": "^3.3.2", + "dotkernel/dot-flashmessenger": "^3.4.2", + "dotkernel/dot-geoip": "^3.5.3", + "dotkernel/dot-helpers": "^3.4.2", + "dotkernel/dot-mail": "^4.1.1", + "dotkernel/dot-navigation": "^3.4.2", + "dotkernel/dot-rbac-guard": "^3.4.2", + "dotkernel/dot-session": "^5.4.2", + "dotkernel/dot-twigrenderer": "3.4.3", + "dotkernel/dot-user-agent-sniffer": "^3.3.3", + "friendsofphp/proxy-manager-lts": "^1.0.16", + "laminas/laminas-component-installer": "^3.4.0", + "laminas/laminas-config-aggregator": "^1.14.0", + "laminas/laminas-i18n": "^2.26.0", + "laminas/laminas-math": "^3.7.0", + "mezzio/mezzio": "^3.18.0", + "mezzio/mezzio-authorization-rbac": "^1.7.0", + "mezzio/mezzio-cors": "^1.11.1", + "mezzio/mezzio-fastroute": "^3.11.0", + "ramsey/uuid-doctrine": "^2.0.0", + "roave/psr-container-doctrine": "^4.1.0" }, "require-dev": { - "filp/whoops": "^2.15.3", + "filp/whoops": "^2.15.4", "laminas/laminas-coding-standard": "^2.5.0", - "laminas/laminas-development-mode": "^3.11.0", - "mezzio/mezzio-tooling": "^2.8.0", - "phpunit/phpunit": "^10.3.2", + "laminas/laminas-development-mode": "^3.12.0", + "mezzio/mezzio-tooling": "^2.9.0", + "phpunit/phpunit": "^10.5.9", "roave/security-advisories": "dev-latest", - "vimeo/psalm": "^5.15.0" + "vimeo/psalm": "^5.20.0" }, "autoload": { "psr-4": { From 5233c9dabe5264553956df29a66ddfd5808a283b Mon Sep 17 00:00:00 2001 From: bidi Date: Thu, 1 Feb 2024 12:15:51 +0200 Subject: [PATCH 2/7] updated readme, workflow files --- .github/workflows/codecov.yml | 1 + .github/workflows/cs-tests.yml | 1 + .github/workflows/run-tests.yml | 1 + .github/workflows/static-analysis.yml | 1 + README.md | 2 +- 5 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 5c128cbf..a618acdf 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -17,6 +17,7 @@ jobs: php: - "8.1" - "8.2" + - "8.3" steps: - name: Checkout diff --git a/.github/workflows/cs-tests.yml b/.github/workflows/cs-tests.yml index 2fc59a6d..66c0b3e7 100644 --- a/.github/workflows/cs-tests.yml +++ b/.github/workflows/cs-tests.yml @@ -17,6 +17,7 @@ jobs: php: - "8.1" - "8.2" + - "8.3" steps: - name: Checkout diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 39ee42c4..1b19f149 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -17,6 +17,7 @@ jobs: php: - "8.1" - "8.2" + - "8.3" steps: - name: Checkout diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 8ce4bdd4..1f2aaf0f 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -17,6 +17,7 @@ jobs: php: - "8.1" - "8.2" + - "8.3" steps: - name: Checkout diff --git a/README.md b/README.md index 1c3fc452..fc07c092 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ DotKernel web starter package suitable for admin applications. ![OSS Lifecycle](https://img.shields.io/osslifecycle/dotkernel/admin) -![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/admin/4.1.0) +![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/admin/4.3.0) [![GitHub issues](https://img.shields.io/github/issues/dotkernel/admin)](https://github.com/dotkernel/admin/issues) [![GitHub forks](https://img.shields.io/github/forks/dotkernel/admin)](https://github.com/dotkernel/admin/network) From 73c79dd707e8575adec013ae1cd85f87c01787f1 Mon Sep 17 00:00:00 2001 From: bidi Date: Thu, 1 Feb 2024 12:30:54 +0200 Subject: [PATCH 3/7] updated config --- config/autoload/local.php.dist | 9 --------- 1 file changed, 9 deletions(-) diff --git a/config/autoload/local.php.dist b/config/autoload/local.php.dist index 772a68d6..196b3497 100644 --- a/config/autoload/local.php.dist +++ b/config/autoload/local.php.dist @@ -40,14 +40,5 @@ return [ 'params' => $databases['default'], ], ], - 'configuration' => [ - 'orm_default' => [ - // it is recommended to disable doctrine cache on development - // just comment any type of cache you don't want to be applied on development - 'query_cache' => PhpFileCache::class, - 'metadata_cache' => PhpFileCache::class, - 'result_cache' => PhpFileCache::class, - ], - ], ], ]; From 2189e77fa398a03adaccd88924b071253a32c6b8 Mon Sep 17 00:00:00 2001 From: bidi Date: Thu, 1 Feb 2024 12:37:55 +0200 Subject: [PATCH 4/7] updated workflow files --- .github/workflows/codecov.yml | 1 - .github/workflows/cs-tests.yml | 1 - .github/workflows/run-tests.yml | 1 - .github/workflows/static-analysis.yml | 1 - 4 files changed, 4 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index a618acdf..e8ba6a0a 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -15,7 +15,6 @@ jobs: - ubuntu-latest php: - - "8.1" - "8.2" - "8.3" diff --git a/.github/workflows/cs-tests.yml b/.github/workflows/cs-tests.yml index 66c0b3e7..ccd3f74b 100644 --- a/.github/workflows/cs-tests.yml +++ b/.github/workflows/cs-tests.yml @@ -15,7 +15,6 @@ jobs: - ubuntu-latest php: - - "8.1" - "8.2" - "8.3" diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 1b19f149..7db2f86b 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -15,7 +15,6 @@ jobs: - ubuntu-latest php: - - "8.1" - "8.2" - "8.3" diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 1f2aaf0f..19023063 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -15,7 +15,6 @@ jobs: - ubuntu-latest php: - - "8.1" - "8.2" - "8.3" From afbeb451c3fa174069b1a4bf5a3df570ac1b1214 Mon Sep 17 00:00:00 2001 From: bidi Date: Thu, 1 Feb 2024 13:08:56 +0200 Subject: [PATCH 5/7] updated composer.json --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index 0b0b92a2..c6ce28c1 100644 --- a/composer.json +++ b/composer.json @@ -46,6 +46,7 @@ "friendsofphp/proxy-manager-lts": "^1.0.16", "laminas/laminas-component-installer": "^3.4.0", "laminas/laminas-config-aggregator": "^1.14.0", + "laminas/laminas-http": "^2.19.0", "laminas/laminas-i18n": "^2.26.0", "laminas/laminas-math": "^3.7.0", "mezzio/mezzio": "^3.18.0", From b47119e7cbd1c96648cac2d1781fb227f3c12cc9 Mon Sep 17 00:00:00 2001 From: bidi Date: Thu, 1 Feb 2024 13:30:55 +0200 Subject: [PATCH 6/7] issue fix --- composer.json | 2 +- src/Admin/src/Service/AdminService.php | 31 +++++++++----------------- 2 files changed, 12 insertions(+), 21 deletions(-) diff --git a/composer.json b/composer.json index c6ce28c1..3fe5079e 100644 --- a/composer.json +++ b/composer.json @@ -46,7 +46,6 @@ "friendsofphp/proxy-manager-lts": "^1.0.16", "laminas/laminas-component-installer": "^3.4.0", "laminas/laminas-config-aggregator": "^1.14.0", - "laminas/laminas-http": "^2.19.0", "laminas/laminas-i18n": "^2.26.0", "laminas/laminas-math": "^3.7.0", "mezzio/mezzio": "^3.18.0", @@ -60,6 +59,7 @@ "filp/whoops": "^2.15.4", "laminas/laminas-coding-standard": "^2.5.0", "laminas/laminas-development-mode": "^3.12.0", + "laminas/laminas-http": "^2.19.0", "mezzio/mezzio-tooling": "^2.9.0", "phpunit/phpunit": "^10.5.9", "roave/security-advisories": "dev-latest", diff --git a/src/Admin/src/Service/AdminService.php b/src/Admin/src/Service/AdminService.php index eda1cac6..eda5ce65 100644 --- a/src/Admin/src/Service/AdminService.php +++ b/src/Admin/src/Service/AdminService.php @@ -217,29 +217,20 @@ public function updateAdmin(Admin $admin, array $data): Admin public function logAdminVisit(array $serverParams, string $name): AdminLogin { $deviceData = $this->deviceService->getDetails($serverParams['HTTP_USER_AGENT']); - $deviceOs = ! empty($deviceData->getOs()) ? $deviceData->getOs() : null; - $deviceClient = ! empty($deviceData->getClient()) ? $deviceData->getClient() : null; + $deviceOs = ! empty($deviceData->getOs()->getName()) ? $deviceData->getOs() : null; + $deviceClient = ! empty($deviceData->getClient()->getName()) ? $deviceData->getClient() : null; $ipAddress = IpService::getUserIp($serverParams); - try { - $country = ! empty($this->locationService->getCountry($ipAddress)) ? - $this->locationService->getCountry($ipAddress)->getName() : ''; - } catch (AddressNotFoundException $e) { - $country = ''; - } - try { - $continent = ! empty($this->locationService->getContinent($ipAddress)) ? - $this->locationService->getContinent($ipAddress)->getName() : ''; - } catch (AddressNotFoundException $e) { - $continent = ''; - } - try { - $organization = ! empty($this->locationService->getOrganization($ipAddress)) ? - $this->locationService->getOrganization($ipAddress)->getName() : ''; - } catch (AddressNotFoundException $e) { - $organization = ''; - } + $country = ! empty($this->locationService->getCountry($ipAddress)->getName()) ? + $this->locationService->getCountry($ipAddress)->getName() : ''; + + $continent = ! empty($this->locationService->getContinent($ipAddress)->getName()) ? + $this->locationService->getContinent($ipAddress)->getName() : ''; + + $organization = ! empty($this->locationService->getOrganization($ipAddress)->getName()) ? + $this->locationService->getOrganization($ipAddress)->getName() : ''; + $deviceType = ! empty($deviceData->getType()) ? $deviceData->getType() : null; $deviceBrand = ! empty($deviceData->getBrand()) ? $deviceData->getBrand() : null; $deviceModel = ! empty($deviceData->getModel()) ? $deviceData->getModel() : null; From 47b55c98a900f3a6a31ccae12ba7216fbd6aa0b8 Mon Sep 17 00:00:00 2001 From: bidi Date: Thu, 1 Feb 2024 13:32:19 +0200 Subject: [PATCH 7/7] updated use --- src/Admin/src/Service/AdminService.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Admin/src/Service/AdminService.php b/src/Admin/src/Service/AdminService.php index eda5ce65..ad3f481c 100644 --- a/src/Admin/src/Service/AdminService.php +++ b/src/Admin/src/Service/AdminService.php @@ -20,7 +20,6 @@ use Frontend\Admin\Repository\AdminRepository; use Frontend\Admin\Repository\AdminRoleRepository; use Frontend\App\Service\IpService; -use GeoIp2\Exception\AddressNotFoundException; use function implode; use function is_string;