diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 5c128cbf..e8ba6a0a 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -15,8 +15,8 @@ jobs: - ubuntu-latest 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..ccd3f74b 100644 --- a/.github/workflows/cs-tests.yml +++ b/.github/workflows/cs-tests.yml @@ -15,8 +15,8 @@ jobs: - ubuntu-latest 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..7db2f86b 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -15,8 +15,8 @@ jobs: - ubuntu-latest 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..19023063 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -15,8 +15,8 @@ jobs: - ubuntu-latest 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) diff --git a/composer.json b/composer.json index 4b6c5c45..3fe5079e 100644 --- a/composer.json +++ b/composer.json @@ -27,42 +27,43 @@ } }, "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", + "laminas/laminas-http": "^2.19.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": { 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, - ], - ], ], ]; diff --git a/src/Admin/src/Service/AdminService.php b/src/Admin/src/Service/AdminService.php index eda1cac6..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; @@ -217,29 +216,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;