Initial commit
This commit is contained in:
commit
296bf30c6d
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
/composer.lock
|
||||
/vendor
|
21
composer.json
Normal file
21
composer.json
Normal 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/"
|
||||
}
|
||||
}
|
||||
}
|
29
src/DependencyInjection/Configuration.php
Normal file
29
src/DependencyInjection/Configuration.php
Normal 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;
|
||||
}
|
||||
}
|
28
src/DependencyInjection/NoccyLabsLprExtension.php
Normal file
28
src/DependencyInjection/NoccyLabsLprExtension.php
Normal 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
15
src/Lpr/LprService.php
Normal 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);
|
||||
}
|
||||
|
||||
}
|
9
src/NoccyLabsLprBundle.php
Normal file
9
src/NoccyLabsLprBundle.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace NoccyLabs\Bundle\LprBundle;
|
||||
|
||||
use Symfony\Component\HttpKernel\Bundle\Bundle;
|
||||
|
||||
class NoccyLabsLprBundle extends Bundle
|
||||
{
|
||||
}
|
6
src/Resources/config/services.yml
Normal file
6
src/Resources/config/services.yml
Normal 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%"]
|
Loading…
Reference in New Issue
Block a user