Skip to content

Commit

Permalink
Merge pull request #218 from dotkernel/issue-198
Browse files Browse the repository at this point in the history
updated composer
  • Loading branch information
arhimede committed Feb 1, 2024
2 parents 5f18331 + 47b55c9 commit d9693df
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 65 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jobs:
- ubuntu-latest

php:
- "8.1"
- "8.2"
- "8.3"

steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cs-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jobs:
- ubuntu-latest

php:
- "8.1"
- "8.2"
- "8.3"

steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jobs:
- ubuntu-latest

php:
- "8.1"
- "8.2"
- "8.3"

steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jobs:
- ubuntu-latest

php:
- "8.1"
- "8.2"
- "8.3"

steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
61 changes: 31 additions & 30 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
9 changes: 0 additions & 9 deletions config/autoload/local.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -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,
],
],
],
];
32 changes: 11 additions & 21 deletions src/Admin/src/Service/AdminService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit d9693df

Please sign in to comment.