Skip to content

Commit

Permalink
Enable 2.0 framework support
Browse files Browse the repository at this point in the history
  • Loading branch information
kpicaza committed Jul 3, 2023
1 parent d61b4c6 commit 44b752e
Show file tree
Hide file tree
Showing 14 changed files with 82 additions and 76 deletions.
38 changes: 11 additions & 27 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,27 @@
"name": "kpicaza"
}
],
"repositories": [
{
"type": "git",
"url": "https://github.com/antidot-framework/psr11-monolog"
}
],
"require": {
"php": ">=8.1",
"php": "~8.1.0 || ~8.2.0",
"ext-json": "*",
"antidot-fw/cli": "^1.1.0",
"antidot-fw/container": "^0.1.5",
"antidot-fw/cli": "^2.0",
"antidot-fw/container": "^2.0",
"antidot-fw/event-dispatcher": "^2.1",
"antidot-fw/framework": "2.0.0BETA1",
"antidot-fw/logger": "^1.1.0",
"antidot-fw/monolog-react-handler": "^0.1",
"antidot-fw/runtime": "^0.2",
"antidot-fw/symfony-config-translator": "^1.1.0",
"antidot-fw/yaml-config-provider": "^0.1.0",
"react/async": "@dev",
"symfony/runtime": "^5.3",
"wshafer/psr11-monolog": "@dev"
"antidot-fw/framework": "^2.0",
"antidot-fw/logger": "^2.0",
"antidot-fw/runtime": "^2.0",
"laminas/laminas-config-aggregator": "^1.13"
},
"require-dev": {
"antidot-fw/dev-tools": "^0.1.1",
"filp/whoops": "^2.5",
"antidot-fw/dev-tools": "^2.0",
"franzl/whoops-middleware": "^2.0",
"laminas/laminas-component-installer": "^2.6",
"laminas/laminas-component-installer": "^3.2",
"phpro/grumphp": "~1.0",
"phpstan/phpstan": "^1.2",
"phpunit/phpunit": "^9.2",
"roave/security-advisories": "dev-master",
"squizlabs/php_codesniffer": "^3.4",
"symfony/var-dumper": "^5.1"
"symfony/var-dumper": "^5.1 || ^6.0"
},
"autoload": {
"psr-4": {
Expand Down Expand Up @@ -80,12 +68,8 @@
"antidot-fw/doctrine",
"antidot-fw/message-queue",
"antidot-fw/no-floc-middleware",
"antidot-fw/session",
"antidot-fw/cli",
"antidot-fw/phug-template-renderer",
"antidot-fw/event-dispatcher",
"antidot-fw/symfony-config-translator",
"wshafer/psr11-monolog"
"antidot-fw/event-dispatcher"
]
}
}
Expand Down
2 changes: 1 addition & 1 deletion config/cli-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
declare(strict_types=1);

use Laminas\ConfigAggregator\ArrayProvider;
use Antidot\SymfonyConfigTranslator\Container\Config\ConfigAggregator;
use Laminas\ConfigAggregator\ConfigAggregator;

$config = require __DIR__ . '/config.php';
$cliConfig['services'] = $config['console']['services'] ?? [];
Expand Down
5 changes: 1 addition & 4 deletions config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
declare(strict_types=1);

use Antidot\DevTools\Container\Config\ConfigProvider as DevToolsConfigProvider;
use Antidot\SymfonyConfigTranslator\Container\Config\ConfigAggregator;
use Antidot\Yaml\YamlConfigProvider;
use Laminas\ConfigAggregator\ArrayProvider;
use Laminas\ConfigAggregator\ConfigAggregator;
use Laminas\ConfigAggregator\PhpFileProvider;

// To enable or disable caching, set the `ConfigAggregator::ENABLE_CACHE` boolean in
Expand All @@ -17,7 +16,6 @@
$aggregator = new ConfigAggregator([
\Antidot\Framework\Config\ConfigProvider::class,
\Antidot\Runtime\Config\ConfigProvider::class,
\WShafer\PSR11MonoLog\ConfigProvider::class,
\Antidot\Logger\Container\Config\ConfigProvider::class,
\Antidot\Event\Container\Config\ConfigProvider::class,
\Antidot\Cli\Container\Config\ConfigProvider::class,
Expand All @@ -33,7 +31,6 @@ class_exists(DevToolsConfigProvider::class) ? DevToolsConfigProvider::class : fn
// - `*.local.yaml`
// - `*.dev.yaml`
new PhpFileProvider(realpath(__DIR__).'/services/{{,*.}prod,{,*.}local,{,*.}dev}.php'),
new YamlConfigProvider(realpath(__DIR__).'/services/{{,*.}prod,{,*.}local,{,*.}dev}.yaml'),
new ArrayProvider($cacheConfig),
], $cacheConfig['config_cache_path']);

Expand Down
9 changes: 9 additions & 0 deletions config/services/dependencies.dev.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

declare(strict_types=1);

return [
'debug' => true,
'config_cache_enabled' => false,
'log_level' => 'DEBUG',
];
9 changes: 9 additions & 0 deletions config/services/dependencies.dev.php.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

declare(strict_types=1);

return [
'debug' => true,
'config_cache_enabled' => false,
'log_level' => 'DEBUG',
];
8 changes: 0 additions & 8 deletions config/services/dependencies.dev.yaml.dist

This file was deleted.

42 changes: 42 additions & 0 deletions config/services/dependencies.prod.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

declare(strict_types=1);

use App\Handler\HomePage;
use App\Handler\SomeMiddleware;
use App\Command\SomeCommandExample;
use App\Event\SomeEvent;
use App\EventListener\SomeEventListener;

return [
// Config
'debug' => false,
'config_cache_enabled' => true,
'log_level' => 'WARNING',
'server' => [
'workers' => 4,
'host' => '0.0.0.0',
'port' => 3000,
],
// Dependencies
'services' => [
HomePage::class => HomePage::class,
SomeMiddleware::class => SomeMiddleware::class,
SomeEventListener::class => SomeEventListener::class,
],
'app-events' => [
'event-listeners' => [
SomeEvent::class => [
SomeEventListener::class,
],
],
],
'console' => [
'commands' => [
'my:custom:command' => SomeCommandExample::class,
],
'services' => [
SomeCommandExample::class => SomeCommandExample::class,
],
],
];
26 changes: 0 additions & 26 deletions config/services/dependencies.prod.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions router/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
declare(strict_types=1);

use Antidot\Framework\Application;
use App\Application\Http\Handler\HomePage;
use App\Application\Http\Handler\SomeMiddleware;
use App\Handler\HomePage;
use App\Handler\SomeMiddleware;
use Psr\Container\ContainerInterface;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace App\Application\Command;
namespace App\Command;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace App\Application\Event;
namespace App\Event;

use Antidot\Event\Event;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

declare(strict_types=1);

namespace App\Application\EventListener;
namespace App\EventListener;

use App\Application\Event\SomeEvent;
use Psr\Log\LoggerInterface;

use App\Event\SomeEvent;
use function sprintf;

final class SomeEventListener
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

declare(strict_types=1);

namespace App\Application\Http\Handler;
namespace App\Handler;

use App\Application\Event\SomeEvent;
use Psr\EventDispatcher\EventDispatcherInterface;
use Psr\Http\Message\ResponseFactoryInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
use App\Event\SomeEvent;

final class HomePage implements RequestHandlerInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace App\Application\Http\Handler;
namespace App\Handler;

use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
Expand Down

0 comments on commit 44b752e

Please sign in to comment.