Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions Controller/AS2Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@


use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;
use TechData\AS2SecureBundle\Services\AS2;

/**
* Description of AS2Controller
*
* @author wpigott
*/
class AS2Controller
class AS2Controller extends Controller
{

/**
Expand All @@ -27,6 +29,12 @@ function __construct(AS2 $as2Service)

public function inboundAction(Request $request)
{
$this->as2Service->handleRequest($request);
try {
$this->as2Service->handleRequest($request);
return new Response('',200);
}
catch (\Exception $exception ) {
return new Response('',500);
}
}
}
22 changes: 16 additions & 6 deletions DependencyInjection/CompilerPass/PartnerProviderCompilerPass.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Created by PhpStorm.
* User: westin
Expand All @@ -13,14 +14,23 @@
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;


/**
* Class PartnerProviderCompilerPass
*
* @package TechData\AS2SecureBundle\DependencyInjection\CompilerPass
*/
class PartnerProviderCompilerPass implements CompilerPassInterface
{
/**
* @param ContainerBuilder $container
*/
public function process(ContainerBuilder $container)
{
// Get the reference for the service
$reference = new Reference($container->getParameter('tech_data_as2_secure.partner_provider.service_id'));

// Add to the partner factory
$container->getDefinition('tech_data_as2_secure.factory.partner')->setArguments(array($reference));
$partnerProviderResolver = $container->getDefinition('tech_data_as2_secure.partner_provider.resolver');
foreach ($container->findTaggedServiceIds('tech_data_as2_partner') as $serviceId => $tags) {
$partnerProviderResolver->addMethodCall(
'add', [new Reference($serviceId)]
);
}
}
}
}
9 changes: 5 additions & 4 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
/**
* 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}
* To learn more see
* {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
*/
class Configuration implements ConfigurationInterface
{
Expand All @@ -18,12 +19,12 @@ class Configuration implements ConfigurationInterface
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('tech_data_as2_secure');

$rootNode = $treeBuilder->root('tech_data_as2_secure');
// 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;
}
}
6 changes: 3 additions & 3 deletions DependencyInjection/TechDataAS2SecureExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ class TechDataAS2SecureExtension extends Extension
public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);

$loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$config = $this->processConfiguration($configuration, $configs);
$loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$loader->load('services.xml');
}
}
2 changes: 1 addition & 1 deletion Events/Error.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
*/
class Error extends Event
{
const EVENT = 'ERROR';
const EVENT = 'as2.error';
}
54 changes: 42 additions & 12 deletions Events/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,47 +11,77 @@
*/
class Log extends Event
{

const EVENT = 'LOG';

/**
*
*/
const EVENT = 'as2.log';
/**
*
*/
const TYPE_INFO = 'INFO';
/**
*
*/
const TYPE_WARN = 'WARN';
/**
*
*/
const TYPE_ERROR = 'ERROR';


/**
* @var
*/
private $message;
/**
* @var
*/
private $type;


/**
* Log constructor.
*
* @param $type
* @param $message
*/
function __construct($type, $message)
{
$this->type = $type;
$this->type = $type;
$this->message = $message;
}




/**
* @return mixed
*/
public function getMessage()
{
return $this->message;
}


/**
* @param $message
*/
public function setMessage($message)
{
$this->message = $message;
}

/**
* @return mixed
*/
public function getType()
{
return $this->type;
}

/**
* @param mixed $type
*/
public function setType($type)
{
$this->type = $type;
}


}
Loading