@sensiolabs sensiolabs.com
@sensiolabs sensiolabs.com
@sensiolabs sensiolabs.com
Legacy
Zend1
Home made
framework
Procedural PHP
LegacyWrapper
Symfony 4
API
User
Product
Stock
Stock
Supporte: symfony1.4 / symfony1.5 / CodeIgniter
et custom kernel
Symfony3 cherche un controller
qui match la request
HTTP Request
Si aucune route Sf3, on passe la main au legacy pour faire le même travail
/**
* @param GetResponseEvent $event
*
* @return GetResponseEvent
*/
public function onKernelRequest(GetResponseEvent $event)
{
try {
$this->routerListener->onKernelRequest($event);
} catch (NotFoundHttpException $e) {
// Log ...
$response = $this->legacyKernel->handle($event->getRequest(),
$event->getRequestType(), true);
if ($response->getStatusCode() !== 404) {
$event->setResponse($response);
return $event;
}
}
}
class Symfony10Kernel extends LegacyKernel
{
/** @var ContainerInterface */
private $container;
public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = true)
{
$context = $this->setUpContext($request);
ob_start();
// Dispatch request
try {
$context->getController()->dispatch();
} catch (\sfStopException $e) {
} catch (\Exception $e) {
throw $e;
} finally {
$context->shutdown();
}
$stdout = ob_get_contents();
ob_end_clean();
return $this->convertResponse($context->getResponse(), $stdout);
}
// ...
}
// \sfContext
# app/config/config.yml
theodo_evolution_legacy_wrapper:
root_dir: %kernel.root_dir%/../legacy
kernel:
id: legacy.kernel.symfony10
options:
application: frontend
environment: '%kernel.environment%'
debug: '%kernel.debug%'
Lecture de session: TheodoEvolutionSessionBundle
Authentification:
PreAuthenticatedListener custom
Authentification géré par l'application legacy
@sensiolabs sensiolabs.com
@sensiolabs sensiolabs.com
Single Purpose Aggregation Operations
Aggregation Pipeline
Map-Reduce