Initial commit

This commit is contained in:
Chris 2017-10-31 18:01:17 +01:00
commit 296bf30c6d
8 changed files with 113 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/composer.lock
/vendor

3
README.md Normal file
View File

@ -0,0 +1,3 @@
noccylabs/lpr-bundle
====================

21
composer.json Normal file
View File

@ -0,0 +1,21 @@
{
"name": "noccylabs/lpr-bundle",
"description": "Integrate noccylabs/lpr with Symfony 3",
"type": "bundle",
"license": "GPL-3.0",
"authors": [
{
"name": "Christopher Vagnetoft",
"email": "cvagnetoft@gmail.com"
}
],
"require": {
"noccylabs/lpr": "@dev",
"symfony/symfony": ">3.0"
},
"autoload": {
"psr-4": {
"NoccyLabs\\Bundle\\LprBundle\\": "src/"
}
}
}

View File

@ -0,0 +1,29 @@
<?php
namespace NoccyLabs\Bundle\LprBundle\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/configuration.html}
*/
class Configuration implements ConfigurationInterface
{
/**
* {@inheritdoc}
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('noccy_labs_lpr');
// 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;
}
}

View File

@ -0,0 +1,28 @@
<?php
namespace NoccyLabs\Bundle\LprBundle\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.
*
* @link http://symfony.com/doc/current/cookbook/bundles/extension.html
*/
class NoccyLabsLprExtension extends Extension
{
/**
* {@inheritdoc}
*/
public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.yml');
}
}

15
src/Lpr/LprService.php Normal file
View File

@ -0,0 +1,15 @@
<?php
namespace NoccyLabs\Bundle\LprBundle\Lpr;
use NoccyLabs\Lpr\PrintJob;
class LprService
{
public function createPrintJob($document)
{
return new PrintJob($document);
}
}

View File

@ -0,0 +1,9 @@
<?php
namespace NoccyLabs\Bundle\LprBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class NoccyLabsLprBundle extends Bundle
{
}

View File

@ -0,0 +1,6 @@
services:
lpr.service:
class: NoccyLabs\Bundle\LprBundle\Lpr\LprService
# noccy_labs_lpr.example:
# class: NoccyLabs\Bundle\LprBundle\Example
# arguments: ["@service_id", "plain_value", "%parameter%"]