Skip to content

Commit b617359

Browse files
committed
create extension
1 parent fc7e9f8 commit b617359

File tree

7 files changed

+53
-11
lines changed

7 files changed

+53
-11
lines changed

DevgineDemoBundle.php

-9
This file was deleted.

composer.json

+9-2
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,24 @@
77
"require": {
88
"php": ">=8.1",
99
"symfony/console": "^6.1",
10-
"symfony/http-kernel": "^6.1"
10+
"symfony/http-kernel": "^6.1",
11+
"symfony/dependency-injection": "^6.1",
12+
"symfony/config": "^6.1"
1113
},
1214
"license": "MIT",
1315
"autoload": {
1416
"psr-4": {
15-
"Devgine\\Demo\\": ""
17+
"Devgine\\Demo\\": "src/"
1618
},
1719
"exclude-from-classmap": [
1820
"/Tests/"
1921
]
2022
},
23+
"autoload-dev": {
24+
"psr-4": {
25+
"Devgine\\Demo\\Tests\\": "tests/"
26+
}
27+
},
2128
"authors": [
2229
{
2330
"name": "Yosri BAHRI",
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
namespace Devgine\Demo\DependencyInjection;
4+
5+
use Symfony\Component\Console\Application;
6+
use Symfony\Component\DependencyInjection\ContainerBuilder;
7+
use Symfony\Component\DependencyInjection\Extension\Extension;
8+
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
9+
use Symfony\Component\Config\FileLocator;
10+
11+
class DevgineDemoExtension extends Extension
12+
{
13+
public function load(array $configs, ContainerBuilder $container)
14+
{
15+
$loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
16+
17+
if (class_exists(Application::class)) {
18+
$loader->load('console.xml');
19+
}
20+
}
21+
}

src/DevgineDemoBundle.php

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
namespace Devgine\Demo;
4+
5+
use Symfony\Component\DependencyInjection\ContainerBuilder;
6+
use Symfony\Component\HttpKernel\Bundle\AbstractBundle;
7+
8+
class DevgineDemoBundle extends AbstractBundle
9+
{
10+
}

src/Resources/config/console.xml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" ?>
2+
3+
<container xmlns="http://symfony.com/schema/dic/services"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
6+
7+
<services>
8+
<service id="devgine_demo.hello_console" class="Lexik\Bundle\JWTAuthenticationBundle\Command\CheckConfigCommand">
9+
<tag name="console.command" command="devgine:demo:hello" />
10+
</service>
11+
</services>
12+
13+
</container>

0 commit comments

Comments
 (0)