Skip to content

Commit e22c07a

Browse files
committed
Initial commit
0 parents  commit e22c07a

File tree

7 files changed

+140
-0
lines changed

7 files changed

+140
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/vendor/
2+
/composer.lock
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
4+
namespace TheCodingMachine\TDBM\Bundle\DependencyInjection;
5+
6+
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
7+
use Symfony\Component\Config\Definition\ConfigurationInterface;
8+
9+
class Configuration implements ConfigurationInterface
10+
{
11+
public function getConfigTreeBuilder()
12+
{
13+
$treeBuilder = new TreeBuilder();
14+
$rootNode = $treeBuilder->root('tdbm');
15+
16+
$rootNode
17+
->children()
18+
->integerNode('dao_namespace')->end()
19+
->scalarNode('bean_namespace')->end()
20+
->end()
21+
;
22+
23+
return $treeBuilder;
24+
}
25+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
4+
namespace TheCodingMachine\TDBM\Bundle\DependencyInjection;
5+
6+
7+
use Symfony\Component\Config\FileLocator;
8+
use Symfony\Component\DependencyInjection\ContainerBuilder;
9+
use Symfony\Component\DependencyInjection\Extension\Extension;
10+
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
11+
12+
class TdbmExtension extends Extension
13+
{
14+
15+
/**
16+
* Loads a specific configuration.
17+
*
18+
* @throws \InvalidArgumentException When provided tag is not defined in this extension
19+
*/
20+
public function load(array $configs, ContainerBuilder $container)
21+
{
22+
$configuration = new Configuration();
23+
$config = $this->processConfiguration($configuration, $configs);
24+
25+
//$config = $this->processConfiguration($this->getConfiguration($config, $container), $config);
26+
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config/container'));
27+
$loader->load('tdbm.xml');
28+
29+
$definition = $container->getDefinition(\TheCodingMachine\TDBM\Configuration::class);
30+
$definition->replaceArgument(0, $config['bean_namespace']);
31+
$definition->replaceArgument(1, $config['dao_namespace']);
32+
}
33+
}

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# TDBM Symfony bundle
2+
3+
**Work in progress**
4+
5+
TDBM integration package for Symfony 4.
6+
7+
See See [TDBM - Symfony integration documentation](https://thecodingmachine.github.io/tdbm/doc/install_symfony.html)
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
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
6+
http://symfony.com/schema/dic/services/services-1.0.xsd"
7+
>
8+
9+
<services>
10+
<defaults autowire="true" autoconfigure="true" public="false" />
11+
12+
<service id="TheCodingMachine\TDBM\Configuration" class="TheCodingMachine\TDBM\Configuration">
13+
<argument></argument> <!-- will be filled in with tdbm.bean_namespace dynamically -->
14+
<argument></argument> <!-- will be filled in with tdbm.dao_namespace dynamically -->
15+
</service>
16+
17+
<service id="TheCodingMachine\TDBM\TDBMService" class="TheCodingMachine\TDBM\TDBMService" public="true">
18+
</service>
19+
</services>
20+
21+
</container>

TdbmBundle.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
4+
namespace TheCodingMachine\TDBM\Bundle;
5+
6+
7+
use Symfony\Component\HttpKernel\Bundle\Bundle;
8+
9+
class TdbmBundle extends Bundle
10+
{
11+
12+
}

composer.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name" : "thecodingmachine/tdbm-bundle",
3+
"description" : "A Symfony bundle for TDBM.",
4+
"keywords" : [
5+
"ORM",
6+
"persistence",
7+
"DAO",
8+
"bean",
9+
"model",
10+
"TDBM",
11+
"Symfony",
12+
"bundle"
13+
],
14+
"homepage" : "https://thecodingmachine.github.io/tdbm",
15+
"type" : "library",
16+
"license" : "MIT",
17+
"authors" : [{
18+
"name" : "David Négrier",
19+
"email" : "d.negrier@thecodingmachine.com",
20+
"homepage" : "http://mouf-php.com"
21+
}
22+
],
23+
"require" : {
24+
"php" : ">=7.1",
25+
"thecodingmachine/tdbm" : "^5.0",
26+
"doctrine/doctrine-bundle": "^1.9"
27+
},
28+
"autoload" : {
29+
"psr-4" : {
30+
"TheCodingMachine\\TDBM\\Bundle\\" : ""
31+
}
32+
},
33+
"extra": {
34+
"branch-alias": {
35+
"dev-master": "5.0.x-dev"
36+
}
37+
},
38+
"minimum-stability": "dev",
39+
"prefer-stable": true
40+
}

0 commit comments

Comments
 (0)