-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(platform): added integrations for PHP 8.1 + added support for Sy…
…mfony 6
- Loading branch information
Rastusik
committed
Jul 27, 2022
1 parent
12a24d6
commit 368f99e
Showing
25 changed files
with
414 additions
and
155 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
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
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
37 changes: 37 additions & 0 deletions
37
src/Bridge/Symfony/Bundle/DependencyInjection/CompilerPass/SessionStorageListenerPass.php
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,37 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace K911\Swoole\Bridge\Symfony\Bundle\DependencyInjection\CompilerPass; | ||
|
||
use K911\Swoole\Bridge\Symfony\HttpFoundation\Session\SessionCookieEventListener; | ||
use K911\Swoole\Server\Session\StorageInterface; | ||
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; | ||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
use Symfony\Component\DependencyInjection\Definition; | ||
use Symfony\Component\DependencyInjection\Reference; | ||
|
||
final class SessionStorageListenerPass implements CompilerPassInterface | ||
{ | ||
public function process(ContainerBuilder $container): void | ||
{ | ||
if (!$container->hasAlias('session.storage.factory')) { | ||
return; | ||
} | ||
|
||
$factoryAlias = $container->getAlias('session.storage.factory'); | ||
|
||
if ('swoole_bundle.session.table_storage_factory' !== (string) $factoryAlias) { | ||
return; | ||
} | ||
|
||
$cookieListenerDef = new Definition(SessionCookieEventListener::class); | ||
$cookieListenerDef->setPublic(false); | ||
$cookieListenerDef->setArgument('$requestStack', new Reference('request_stack')); | ||
$cookieListenerDef->setArgument('$dispatcher', new Reference('event_dispatcher')); | ||
$cookieListenerDef->setArgument('$swooleStorage', new Reference(StorageInterface::class)); | ||
$cookieListenerDef->setArgument('$sessionOptions', $container->getParameter('session.storage.options')); | ||
$cookieListenerDef->addTag('kernel.event_subscriber'); | ||
$container->setDefinition(SessionCookieEventListener::class, $cookieListenerDef); | ||
} | ||
} |
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
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
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
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
Oops, something went wrong.