Skip to content

Commit

Permalink
Split security into SecurityBundle
Browse files Browse the repository at this point in the history
  • Loading branch information
NoUseFreak committed Mar 27, 2015
1 parent 9d342d8 commit ff0a225
Show file tree
Hide file tree
Showing 13 changed files with 130 additions and 5 deletions.
1 change: 1 addition & 0 deletions app/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public function registerBundles()
new Clastic\MediaBundle\ClasticMediaBundle(),
new Clastic\TaxonomyBundle\ClasticTaxonomyBundle(),
new Clastic\BlockBundle\ClasticBlockBundle(),
new Clastic\SecurityBundle\ClasticSecurityBundle(),
);

if (in_array($this->getEnvironment(), array('dev', 'test'))) {
Expand Down
3 changes: 3 additions & 0 deletions src/Clastic/SecurityBundle/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
vendor/
composer.lock
phpunit.xml
13 changes: 13 additions & 0 deletions src/Clastic/SecurityBundle/ClasticSecurityBundle.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Clastic\SecurityBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class ClasticSecurityBundle extends Bundle
{
public function getParent()
{
return 'FOSUserBundle';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

namespace Clastic\SecurityBundle\DependencyInjection;

use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Loader;

/**
* This is the class that loads and manages your bundle configuration
*
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
*/
class ClasticSecurityExtension extends Extension
{
/**
* {@inheritdoc}
*/
public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
$this->processConfiguration($configuration, $configs);

$loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.xml');
}
}
29 changes: 29 additions & 0 deletions src/Clastic/SecurityBundle/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

namespace Clastic\SecurityBundle\DependencyInjection;

use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;

/**
* This is the class that validates and merges configuration from your app/config files
*
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
*/
class Configuration implements ConfigurationInterface
{
/**
* {@inheritdoc}
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$treeBuilder->root('clastic_security');

// Here you should define the parameters that are allowed to
// configure your bundle. See the documentation linked above for
// more information on that topic.

return $treeBuilder;
}
}
19 changes: 19 additions & 0 deletions src/Clastic/SecurityBundle/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2014-2015 Dries De Peuter

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
16 changes: 16 additions & 0 deletions src/Clastic/SecurityBundle/Resources/config/services.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" ?>

<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

<!--
<services>
<service id="clastic_security.example" class="Clastic\SecurityBundle\Example">
<argument type="service" id="service_id" />
<argument>plain_value</argument>
<argument>%parameter_name%</argument>
</service>
</services>
-->
</container>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* file that was distributed with this source code.
*/

namespace Clastic\BackofficeBundle\Tests\Functional;
namespace Clastic\SecurityeBundle\Tests\Functional;

use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;

Expand Down
20 changes: 20 additions & 0 deletions src/Clastic/SecurityBundle/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "clastic/security-bundle",
"description": "Clastic Security bundle",
"license": "MIT",
"authors": [
{
"name": "Dries De Peuter",
"email": "dries@nousefreak.be"
}
],
"require": {
"php": ">=5.3.3",
"clastic/core-bundle": "*",
"doctrine/user-bundle": "*"
},
"autoload": {
"psr-4": { "Clastic\\SecurityBundle\\": "" }
},
"minimum-stability": "dev"
}
4 changes: 0 additions & 4 deletions src/Clastic/UserBundle/ClasticUserBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,4 @@

class ClasticUserBundle extends Bundle
{
public function getParent()
{
return 'FOSUserBundle';
}
}

0 comments on commit ff0a225

Please sign in to comment.