-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added: Initial import of BcPageDataBundle
- Loading branch information
0 parents
commit 4c609b5
Showing
14 changed files
with
916 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/>. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; | ||
} | ||
} |
Oops, something went wrong.