Skip to content

Commit

Permalink
Added: Initial import of BcPageDataBundle
Browse files Browse the repository at this point in the history
  • Loading branch information
brookinsconsulting committed May 19, 2015
0 parents commit 4c609b5
Show file tree
Hide file tree
Showing 14 changed files with 916 additions and 0 deletions.
20 changes: 20 additions & 0 deletions BcPageDataBundle.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php
/**
* File containing the BcPageDataBundle class part of the BcPageDataBundle package.
*
* @copyright Copyright (C) Brookins Consulting. All rights reserved.
* @license For full copyright and license information view LICENSE and COPYRIGHT.md file distributed with this source code.
* @version //autogentag//
*/

namespace BrookinsConsulting\BcPageDataBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class BcPageDataBundle extends Bundle
{
/**
* @var string
*/
protected $name = "BcPageDataBundle";
}
17 changes: 17 additions & 0 deletions COPYRIGHT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Copyright © 1999 - 2015, Brookins Consulting (United States of America)
Copyright © 2013 - 2015, Think Creative (United States of America)

This file is part of BC Page Data.

BC Page Data is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

BC Page Data is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with BC Page Data in LICENSE. If not, see <http://www.gnu.org/licenses/>.
41 changes: 41 additions & 0 deletions DependencyInjection/BcPageDataConfiguration.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php
/**
* File containing the BcPageDataConfiguration class part of the BcPageDataBundle package.
*
* @copyright Copyright (C) Brookins Consulting. All rights reserved.
* @license For full copyright and license information view LICENSE and COPYRIGHT.md file distributed with this source code.
* @version //autogentag//
*/

namespace BrookinsConsulting\BcPageDataBundle\DependencyInjection;

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

class BcPageDataConfiguration implements ConfigurationInterface
{
/**
* Generates the configuration tree builder.
*
* @return \Symfony\Component\Config\Definition\Builder\TreeBuilder The tree builder
*/
public function getConfigTreeBuilder()
{
$TreeBuilder = new TreeBuilder();

$RootNode = $TreeBuilder->root( 'brookinsconsulting_page_data_persistence_options' );

$RootNode
->children()
->booleanNode( 'display_debug' )
->defaultFalse()
->isRequired()
->end()
->scalarNode( 'display_debug_level' )
->isRequired()
->end()
->end();

return $TreeBuilder;
}
}
59 changes: 59 additions & 0 deletions DependencyInjection/BcPageDataExtension.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?php
/**
* File containing the BcPageDataBundle class part of the BcPageDataBundle package.
*
* @copyright Copyright (C) Brookins Consulting. All rights reserved.
* @license For full copyright and license information view LICENSE and COPYRIGHT.md file distributed with this source code.
* @version //autogentag//
*/

namespace BrookinsConsulting\BcPageDataBundle\DependencyInjection;

use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\Resource\FileResource;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Loader;
use Symfony\Component\Yaml\Yaml;

/**
* 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 BcPageDataExtension extends Extension
{
/**
* Allow an extension to load the bundle configurations.
* Here we will load our bundle settings.
*
* @param Array $configurations
* @param ContainerBuilder $container
*/
public function load(array $configurations, ContainerBuilder $container)
{
$loader = new Loader\YamlFileLoader(
$container,
new FileLocator( __DIR__ . '/../Resources/config' )
);

$loader->load( 'services.yml' );

$configuration = new BcPageDataConfiguration();

$container->setParameter(
'page_data.config', $this->processConfiguration( $configuration, Yaml::parse(__DIR__ . '/../Resources/config/config.yml') )
);
}

/**
* Returns extension alias
*
* @return string
*/
public function getAlias()
{
return 'bc_page_data';
}
}
Loading

0 comments on commit 4c609b5

Please sign in to comment.