Skip to content

Instantly share code, notes, and snippets.

@GromNaN
Last active February 5, 2024 14:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GromNaN/37e661f2ff06735d8b93ff93b24f8257 to your computer and use it in GitHub Desktop.
Save GromNaN/37e661f2ff06735d8b93ff93b24f8257 to your computer and use it in GitHub Desktop.
Asynchronous Twig PHP
<?php
/**
* Demo ReactPHP application using Twig in yielding mode with an async function.
*/
namespace App;
use Exception;
use Psr\Http\Message\ServerRequestInterface;
use React\Http\HttpServer;
use React\Http\Message\Response;
use React\Socket\SocketServer;
use Twig\Environment;
use Twig\Loader\ArrayLoader;
use Twig\TwigFunction;
use function React\Async\async;
use function React\Async\delay;
require __DIR__ . '/vendor/autoload.php';
$twig = new Environment(
new ArrayLoader(['hello' => '{{ delay("Hello") }} {{ delay("World") }} !!']),
['use_yield' => true]
);
$twig->addFunction(new TwigFunction(
'delay',
function (string $text): string {
delay(random_int(1, 10) / 100);
return $text;
}
));
$http = new HttpServer(async(function (ServerRequestInterface $request) use ($twig) {
$body = $twig->render('hello');
if ($body !== 'Hello World !!') {
return new Response(500, [], 'ERROR: ' . $body);
}
return Response::plaintext($body);
}));
$http->on('error', function (Exception $e) {
echo $e;
});
$socket = new SocketServer('127.0.0.1:8080');
$http->listen($socket);
echo "Server running at http://127.0.0.1:8080" . PHP_EOL;
{
"require": {
"php": ">=8.2",
"react/async": "^4.2",
"react/http": "^1.9",
"twig/twig": "3.x-dev"
}
}
{"_readme":["This file locks the dependencies of your project to a known state","Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies","This file is @generated automatically"],"content-hash":"c44e27c670e971f377bb98a09003a949","packages":[{"name":"evenement/evenement","version":"v3.0.2","source":{"type":"git","url":"https://github.com/igorw/evenement.git","reference":"0a16b0d71ab13284339abb99d9d2bd813640efbc"},"dist":{"type":"zip","url":"https://api.github.com/repos/igorw/evenement/zipball/0a16b0d71ab13284339abb99d9d2bd813640efbc","reference":"0a16b0d71ab13284339abb99d9d2bd813640efbc","shasum":""},"require":{"php":">=7.0"},"require-dev":{"phpunit/phpunit":"^9 || ^6"},"type":"library","autoload":{"psr-4":{"Evenement\\":"src/"}},"notification-url":"https://packagist.org/downloads/","license":["MIT"],"authors":[{"name":"Igor Wiedler","email":"igor@wiedler.ch"}],"description":"Événement is a very simple event dispatching library for PHP","keywords":["event-dispatcher","event-emitter"],"support":{"issues":"https://github.com/igorw/evenement/issues","source":"https://github.com/igorw/evenement/tree/v3.0.2"},"time":"2023-08-08T05:53:35+00:00"},{"name":"fig/http-message-util","version":"1.1.5","source":{"type":"git","url":"https://github.com/php-fig/http-message-util.git","reference":"9d94dc0154230ac39e5bf89398b324a86f63f765"},"dist":{"type":"zip","url":"https://api.github.com/repos/php-fig/http-message-util/zipball/9d94dc0154230ac39e5bf89398b324a86f63f765","reference":"9d94dc0154230ac39e5bf89398b324a86f63f765","shasum":""},"require":{"php":"^5.3 || ^7.0 || ^8.0"},"suggest":{"psr/http-message":"The package containing the PSR-7 interfaces"},"type":"library","extra":{"branch-alias":{"dev-master":"1.1.x-dev"}},"autoload":{"psr-4":{"Fig\\Http\\Message\\":"src/"}},"notification-url":"https://packagist.org/downloads/","license":["MIT"],"authors":[{"name":"PHP-FIG","homepage":"https://www.php-fig.org/"}],"description":"Utility classes and constants for use with PSR-7 (psr/http-message)","keywords":["http","http-message","psr","psr-7","request","response"],"support":{"issues":"https://github.com/php-fig/http-message-util/issues","source":"https://github.com/php-fig/http-message-util/tree/1.1.5"},"time":"2020-11-24T22:02:12+00:00"},{"name":"psr/http-message","version":"1.1","source":{"type":"git","url":"https://github.com/php-fig/http-message.git","reference":"cb6ce4845ce34a8ad9e68117c10ee90a29919eba"},"dist":{"type":"zip","url":"https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba","reference":"cb6ce4845ce34a8ad9e68117c10ee90a29919eba","shasum":""},"require":{"php":"^7.2 || ^8.0"},"type":"library","extra":{"branch-alias":{"dev-master":"1.1.x-dev"}},"autoload":{"psr-4":{"Psr\\Http\\Message\\":"src/"}},"notification-url":"https://packagist.org/downloads/","license":["MIT"],"authors":[{"name":"PHP-FIG","homepage":"http://www.php-fig.org/"}],"description":"Common interface for HTTP messages","homepage":"https://github.com/php-fig/http-message","keywords":["http","http-message","psr","psr-7","request","response"],"support":{"source":"https://github.com/php-fig/http-message/tree/1.1"},"time":"2023-04-04T09:50:52+00:00"},{"name":"react/async","version":"v4.2.0","source":{"type":"git","url":"https://github.com/reactphp/async.git","reference":"7c3738e837b38c9513af44398b8c1b2b1be1fbbc"},"dist":{"type":"zip","url":"https://api.github.com/repos/reactphp/async/zipball/7c3738e837b38c9513af44398b8c1b2b1be1fbbc","reference":"7c3738e837b38c9513af44398b8c1b2b1be1fbbc","shasum":""},"require":{"php":">=8.1","react/event-loop":"^1.2","react/promise":"^3.0 || ^2.8 || ^1.2.1"},"require-dev":{"phpstan/phpstan":"1.10.39","phpunit/phpunit":"^9.6"},"type":"library","autoload":{"files":["src/functions_include.php"],"psr-4":{"React\\Async\\":"src/"}},"notification-url":"https://packagist.org/downloads/","license":["MIT"],"authors":[{"name":"Christian Lück","email":"christian@clue.engineering","homepage":"https://clue.engineering/"},{"name":"Cees-Jan Kiewiet","email":"reactphp@ceesjankiewiet.nl","homepage":"https://wyrihaximus.net/"},{"name":"Jan Sorgalla","email":"jsorgalla@gmail.com","homepage":"https://sorgalla.com/"},{"name":"Chris Boden","email":"cboden@gmail.com","homepage":"https://cboden.dev/"}],"description":"Async utilities and fibers for ReactPHP","keywords":["async","reactphp"],"support":{"issues":"https://github.com/reactphp/async/issues","source":"https://github.com/reactphp/async/tree/v4.2.0"},"funding":[{"url":"https://opencollective.com/reactphp","type":"open_collective"}],"time":"2023-11-22T16:43:46+00:00"},{"name":"react/cache","version":"v1.2.0","source":{"type":"git","url":"https://github.com/reactphp/cache.git","reference":"d47c472b64aa5608225f47965a484b75c7817d5b"},"dist":{"type":"zip","url":"https://api.github.com/repos/reactphp/cache/zipball/d47c472b64aa5608225f47965a484b75c7817d5b","reference":"d47c472b64aa5608225f47965a484b75c7817d5b","shasum":""},"require":{"php":">=5.3.0","react/promise":"^3.0 || ^2.0 || ^1.1"},"require-dev":{"phpunit/phpunit":"^9.5 || ^5.7 || ^4.8.35"},"type":"library","autoload":{"psr-4":{"React\\Cache\\":"src/"}},"notification-url":"https://packagist.org/downloads/","license":["MIT"],"authors":[{"name":"Christian Lück","email":"christian@clue.engineering","homepage":"https://clue.engineering/"},{"name":"Cees-Jan Kiewiet","email":"reactphp@ceesjankiewiet.nl","homepage":"https://wyrihaximus.net/"},{"name":"Jan Sorgalla","email":"jsorgalla@gmail.com","homepage":"https://sorgalla.com/"},{"name":"Chris Boden","email":"cboden@gmail.com","homepage":"https://cboden.dev/"}],"description":"Async, Promise-based cache interface for ReactPHP","keywords":["cache","caching","promise","reactphp"],"support":{"issues":"https://github.com/reactphp/cache/issues","source":"https://github.com/reactphp/cache/tree/v1.2.0"},"funding":[{"url":"https://opencollective.com/reactphp","type":"open_collective"}],"time":"2022-11-30T15:59:55+00:00"},{"name":"react/dns","version":"v1.12.0","source":{"type":"git","url":"https://github.com/reactphp/dns.git","reference":"c134600642fa615b46b41237ef243daa65bb64ec"},"dist":{"type":"zip","url":"https://api.github.com/repos/reactphp/dns/zipball/c134600642fa615b46b41237ef243daa65bb64ec","reference":"c134600642fa615b46b41237ef243daa65bb64ec","shasum":""},"require":{"php":">=5.3.0","react/cache":"^1.0 || ^0.6 || ^0.5","react/event-loop":"^1.2","react/promise":"^3.0 || ^2.7 || ^1.2.1"},"require-dev":{"phpunit/phpunit":"^9.6 || ^5.7 || ^4.8.36","react/async":"^4 || ^3 || ^2","react/promise-timer":"^1.9"},"type":"library","autoload":{"psr-4":{"React\\Dns\\":"src/"}},"notification-url":"https://packagist.org/downloads/","license":["MIT"],"authors":[{"name":"Christian Lück","email":"christian@clue.engineering","homepage":"https://clue.engineering/"},{"name":"Cees-Jan Kiewiet","email":"reactphp@ceesjankiewiet.nl","homepage":"https://wyrihaximus.net/"},{"name":"Jan Sorgalla","email":"jsorgalla@gmail.com","homepage":"https://sorgalla.com/"},{"name":"Chris Boden","email":"cboden@gmail.com","homepage":"https://cboden.dev/"}],"description":"Async DNS resolver for ReactPHP","keywords":["async","dns","dns-resolver","reactphp"],"support":{"issues":"https://github.com/reactphp/dns/issues","source":"https://github.com/reactphp/dns/tree/v1.12.0"},"funding":[{"url":"https://opencollective.com/reactphp","type":"open_collective"}],"time":"2023-11-29T12:41:06+00:00"},{"name":"react/event-loop","version":"v1.5.0","source":{"type":"git","url":"https://github.com/reactphp/event-loop.git","reference":"bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354"},"dist":{"type":"zip","url":"https://api.github.com/repos/reactphp/event-loop/zipball/bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354","reference":"bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354","shasum":""},"require":{"php":">=5.3.0"},"require-dev":{"phpunit/phpunit":"^9.6 || ^5.7 || ^4.8.36"},"suggest":{"ext-pcntl":"For signal handling support when using the StreamSelectLoop"},"type":"library","autoload":{"psr-4":{"React\\EventLoop\\":"src/"}},"notification-url":"https://packagist.org/downloads/","license":["MIT"],"authors":[{"name":"Christian Lück","email":"christian@clue.engineering","homepage":"https://clue.engineering/"},{"name":"Cees-Jan Kiewiet","email":"reactphp@ceesjankiewiet.nl","homepage":"https://wyrihaximus.net/"},{"name":"Jan Sorgalla","email":"jsorgalla@gmail.com","homepage":"https://sorgalla.com/"},{"name":"Chris Boden","email":"cboden@gmail.com","homepage":"https://cboden.dev/"}],"description":"ReactPHP's core reactor event loop that libraries can use for evented I/O.","keywords":["asynchronous","event-loop"],"support":{"issues":"https://github.com/reactphp/event-loop/issues","source":"https://github.com/reactphp/event-loop/tree/v1.5.0"},"funding":[{"url":"https://opencollective.com/reactphp","type":"open_collective"}],"time":"2023-11-13T13:48:05+00:00"},{"name":"react/http","version":"v1.9.0","source":{"type":"git","url":"https://github.com/reactphp/http.git","reference":"bb3154dbaf2dfe3f0467f956a05f614a69d5f1d0"},"dist":{"type":"zip","url":"https://api.github.com/repos/reactphp/http/zipball/bb3154dbaf2dfe3f0467f956a05f614a69d5f1d0","reference":"bb3154dbaf2dfe3f0467f956a05f614a69d5f1d0","shasum":""},"require":{"evenement/evenement":"^3.0 || ^2.0 || ^1.0","fig/http-message-util":"^1.1","php":">=5.3.0","psr/http-message":"^1.0","react/event-loop":"^1.2","react/promise":"^3 || ^2.3 || ^1.2.1","react/socket":"^1.12","react/stream":"^1.2","ringcentral/psr7":"^1.2"},"require-dev":{"clue/http-proxy-react":"^1.8","clue/reactphp-ssh-proxy":"^1.4","clue/socks-react":"^1.4","phpunit/phpunit":"^9.5 || ^5.7 || ^4.8.35","react/async":"^4 || ^3 || ^2","react/promise-stream":"^1.4","react/promise-timer":"^1.9"},"type":"library","autoload":{"psr-4":{"React\\Http\\":"src/"}},"notification-url":"https://packagist.org/downloads/","license":["MIT"],"authors":[{"name":"Christian Lück","email":"christian@clue.engineering","homepage":"https://clue.engineering/"},{"name":"Cees-Jan Kiewiet","email":"reactphp@ceesjankiewiet.nl","homepage":"https://wyrihaximus.net/"},{"name":"Jan Sorgalla","email":"jsorgalla@gmail.com","homepage":"https://sorgalla.com/"},{"name":"Chris Boden","email":"cboden@gmail.com","homepage":"https://cboden.dev/"}],"description":"Event-driven, streaming HTTP client and server implementation for ReactPHP","keywords":["async","client","event-driven","http","http client","http server","https","psr-7","reactphp","server","streaming"],"support":{"issues":"https://github.com/reactphp/http/issues","source":"https://github.com/reactphp/http/tree/v1.9.0"},"funding":[{"url":"https://opencollective.com/reactphp","type":"open_collective"}],"time":"2023-04-26T10:29:24+00:00"},{"name":"react/promise","version":"v3.1.0","source":{"type":"git","url":"https://github.com/reactphp/promise.git","reference":"e563d55d1641de1dea9f5e84f3cccc66d2bfe02c"},"dist":{"type":"zip","url":"https://api.github.com/repos/reactphp/promise/zipball/e563d55d1641de1dea9f5e84f3cccc66d2bfe02c","reference":"e563d55d1641de1dea9f5e84f3cccc66d2bfe02c","shasum":""},"require":{"php":">=7.1.0"},"require-dev":{"phpstan/phpstan":"1.10.39 || 1.4.10","phpunit/phpunit":"^9.6 || ^7.5"},"type":"library","autoload":{"files":["src/functions_include.php"],"psr-4":{"React\\Promise\\":"src/"}},"notification-url":"https://packagist.org/downloads/","license":["MIT"],"authors":[{"name":"Jan Sorgalla","email":"jsorgalla@gmail.com","homepage":"https://sorgalla.com/"},{"name":"Christian Lück","email":"christian@clue.engineering","homepage":"https://clue.engineering/"},{"name":"Cees-Jan Kiewiet","email":"reactphp@ceesjankiewiet.nl","homepage":"https://wyrihaximus.net/"},{"name":"Chris Boden","email":"cboden@gmail.com","homepage":"https://cboden.dev/"}],"description":"A lightweight implementation of CommonJS Promises/A for PHP","keywords":["promise","promises"],"support":{"issues":"https://github.com/reactphp/promise/issues","source":"https://github.com/reactphp/promise/tree/v3.1.0"},"funding":[{"url":"https://opencollective.com/reactphp","type":"open_collective"}],"time":"2023-11-16T16:21:57+00:00"},{"name":"react/socket","version":"v1.15.0","source":{"type":"git","url":"https://github.com/reactphp/socket.git","reference":"216d3aec0b87f04a40ca04f481e6af01bdd1d038"},"dist":{"type":"zip","url":"https://api.github.com/repos/reactphp/socket/zipball/216d3aec0b87f04a40ca04f481e6af01bdd1d038","reference":"216d3aec0b87f04a40ca04f481e6af01bdd1d038","shasum":""},"require":{"evenement/evenement":"^3.0 || ^2.0 || ^1.0","php":">=5.3.0","react/dns":"^1.11","react/event-loop":"^1.2","react/promise":"^3 || ^2.6 || ^1.2.1","react/stream":"^1.2"},"require-dev":{"phpunit/phpunit":"^9.6 || ^5.7 || ^4.8.36","react/async":"^4 || ^3 || ^2","react/promise-stream":"^1.4","react/promise-timer":"^1.10"},"type":"library","autoload":{"psr-4":{"React\\Socket\\":"src/"}},"notification-url":"https://packagist.org/downloads/","license":["MIT"],"authors":[{"name":"Christian Lück","email":"christian@clue.engineering","homepage":"https://clue.engineering/"},{"name":"Cees-Jan Kiewiet","email":"reactphp@ceesjankiewiet.nl","homepage":"https://wyrihaximus.net/"},{"name":"Jan Sorgalla","email":"jsorgalla@gmail.com","homepage":"https://sorgalla.com/"},{"name":"Chris Boden","email":"cboden@gmail.com","homepage":"https://cboden.dev/"}],"description":"Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP","keywords":["Connection","Socket","async","reactphp","stream"],"support":{"issues":"https://github.com/reactphp/socket/issues","source":"https://github.com/reactphp/socket/tree/v1.15.0"},"funding":[{"url":"https://opencollective.com/reactphp","type":"open_collective"}],"time":"2023-12-15T11:02:10+00:00"},{"name":"react/stream","version":"v1.3.0","source":{"type":"git","url":"https://github.com/reactphp/stream.git","reference":"6fbc9672905c7d5a885f2da2fc696f65840f4a66"},"dist":{"type":"zip","url":"https://api.github.com/repos/reactphp/stream/zipball/6fbc9672905c7d5a885f2da2fc696f65840f4a66","reference":"6fbc9672905c7d5a885f2da2fc696f65840f4a66","shasum":""},"require":{"evenement/evenement":"^3.0 || ^2.0 || ^1.0","php":">=5.3.8","react/event-loop":"^1.2"},"require-dev":{"clue/stream-filter":"~1.2","phpunit/phpunit":"^9.5 || ^5.7 || ^4.8.35"},"type":"library","autoload":{"psr-4":{"React\\Stream\\":"src/"}},"notification-url":"https://packagist.org/downloads/","license":["MIT"],"authors":[{"name":"Christian Lück","email":"christian@clue.engineering","homepage":"https://clue.engineering/"},{"name":"Cees-Jan Kiewiet","email":"reactphp@ceesjankiewiet.nl","homepage":"https://wyrihaximus.net/"},{"name":"Jan Sorgalla","email":"jsorgalla@gmail.com","homepage":"https://sorgalla.com/"},{"name":"Chris Boden","email":"cboden@gmail.com","homepage":"https://cboden.dev/"}],"description":"Event-driven readable and writable streams for non-blocking I/O in ReactPHP","keywords":["event-driven","io","non-blocking","pipe","reactphp","readable","stream","writable"],"support":{"issues":"https://github.com/reactphp/stream/issues","source":"https://github.com/reactphp/stream/tree/v1.3.0"},"funding":[{"url":"https://opencollective.com/reactphp","type":"open_collective"}],"time":"2023-06-16T10:52:11+00:00"},{"name":"ringcentral/psr7","version":"1.3.0","source":{"type":"git","url":"https://github.com/ringcentral/psr7.git","reference":"360faaec4b563958b673fb52bbe94e37f14bc686"},"dist":{"type":"zip","url":"https://api.github.com/repos/ringcentral/psr7/zipball/360faaec4b563958b673fb52bbe94e37f14bc686","reference":"360faaec4b563958b673fb52bbe94e37f14bc686","shasum":""},"require":{"php":">=5.3","psr/http-message":"~1.0"},"provide":{"psr/http-message-implementation":"1.0"},"require-dev":{"phpunit/phpunit":"~4.0"},"type":"library","extra":{"branch-alias":{"dev-master":"1.0-dev"}},"autoload":{"files":["src/functions_include.php"],"psr-4":{"RingCentral\\Psr7\\":"src/"}},"notification-url":"https://packagist.org/downloads/","license":["MIT"],"authors":[{"name":"Michael Dowling","email":"mtdowling@gmail.com","homepage":"https://github.com/mtdowling"}],"description":"PSR-7 message implementation","keywords":["http","message","stream","uri"],"support":{"source":"https://github.com/ringcentral/psr7/tree/master"},"time":"2018-05-29T20:21:04+00:00"},{"name":"symfony/deprecation-contracts","version":"v3.4.0","source":{"type":"git","url":"https://github.com/symfony/deprecation-contracts.git","reference":"7c3aff79d10325257a001fcf92d991f24fc967cf"},"dist":{"type":"zip","url":"https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf","reference":"7c3aff79d10325257a001fcf92d991f24fc967cf","shasum":""},"require":{"php":">=8.1"},"type":"library","extra":{"branch-alias":{"dev-main":"3.4-dev"},"thanks":{"name":"symfony/contracts","url":"https://github.com/symfony/contracts"}},"autoload":{"files":["function.php"]},"notification-url":"https://packagist.org/downloads/","license":["MIT"],"authors":[{"name":"Nicolas Grekas","email":"p@tchwork.com"},{"name":"Symfony Community","homepage":"https://symfony.com/contributors"}],"description":"A generic function and convention to trigger deprecation notices","homepage":"https://symfony.com","support":{"source":"https://github.com/symfony/deprecation-contracts/tree/v3.4.0"},"funding":[{"url":"https://symfony.com/sponsor","type":"custom"},{"url":"https://github.com/fabpot","type":"github"},{"url":"https://tidelift.com/funding/github/packagist/symfony/symfony","type":"tidelift"}],"time":"2023-05-23T14:45:45+00:00"},{"name":"symfony/polyfill-ctype","version":"v1.28.0","source":{"type":"git","url":"https://github.com/symfony/polyfill-ctype.git","reference":"ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb"},"dist":{"type":"zip","url":"https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb","reference":"ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb","shasum":""},"require":{"php":">=7.1"},"provide":{"ext-ctype":"*"},"suggest":{"ext-ctype":"For best performance"},"type":"library","extra":{"branch-alias":{"dev-main":"1.28-dev"},"thanks":{"name":"symfony/polyfill","url":"https://github.com/symfony/polyfill"}},"autoload":{"files":["bootstrap.php"],"psr-4":{"Symfony\\Polyfill\\Ctype\\":""}},"notification-url":"https://packagist.org/downloads/","license":["MIT"],"authors":[{"name":"Gert de Pagter","email":"BackEndTea@gmail.com"},{"name":"Symfony Community","homepage":"https://symfony.com/contributors"}],"description":"Symfony polyfill for ctype functions","homepage":"https://symfony.com","keywords":["compatibility","ctype","polyfill","portable"],"support":{"source":"https://github.com/symfony/polyfill-ctype/tree/v1.28.0"},"funding":[{"url":"https://symfony.com/sponsor","type":"custom"},{"url":"https://github.com/fabpot","type":"github"},{"url":"https://tidelift.com/funding/github/packagist/symfony/symfony","type":"tidelift"}],"time":"2023-01-26T09:26:14+00:00"},{"name":"symfony/polyfill-mbstring","version":"v1.28.0","source":{"type":"git","url":"https://github.com/symfony/polyfill-mbstring.git","reference":"42292d99c55abe617799667f454222c54c60e229"},"dist":{"type":"zip","url":"https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229","reference":"42292d99c55abe617799667f454222c54c60e229","shasum":""},"require":{"php":">=7.1"},"provide":{"ext-mbstring":"*"},"suggest":{"ext-mbstring":"For best performance"},"type":"library","extra":{"branch-alias":{"dev-main":"1.28-dev"},"thanks":{"name":"symfony/polyfill","url":"https://github.com/symfony/polyfill"}},"autoload":{"files":["bootstrap.php"],"psr-4":{"Symfony\\Polyfill\\Mbstring\\":""}},"notification-url":"https://packagist.org/downloads/","license":["MIT"],"authors":[{"name":"Nicolas Grekas","email":"p@tchwork.com"},{"name":"Symfony Community","homepage":"https://symfony.com/contributors"}],"description":"Symfony polyfill for the Mbstring extension","homepage":"https://symfony.com","keywords":["compatibility","mbstring","polyfill","portable","shim"],"support":{"source":"https://github.com/symfony/polyfill-mbstring/tree/v1.28.0"},"funding":[{"url":"https://symfony.com/sponsor","type":"custom"},{"url":"https://github.com/fabpot","type":"github"},{"url":"https://tidelift.com/funding/github/packagist/symfony/symfony","type":"tidelift"}],"time":"2023-07-28T09:04:16+00:00"},{"name":"symfony/polyfill-php80","version":"v1.28.0","source":{"type":"git","url":"https://github.com/symfony/polyfill-php80.git","reference":"6caa57379c4aec19c0a12a38b59b26487dcfe4b5"},"dist":{"type":"zip","url":"https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5","reference":"6caa57379c4aec19c0a12a38b59b26487dcfe4b5","shasum":""},"require":{"php":">=7.1"},"type":"library","extra":{"branch-alias":{"dev-main":"1.28-dev"},"thanks":{"name":"symfony/polyfill","url":"https://github.com/symfony/polyfill"}},"autoload":{"files":["bootstrap.php"],"psr-4":{"Symfony\\Polyfill\\Php80\\":""},"classmap":["Resources/stubs"]},"notification-url":"https://packagist.org/downloads/","license":["MIT"],"authors":[{"name":"Ion Bazan","email":"ion.bazan@gmail.com"},{"name":"Nicolas Grekas","email":"p@tchwork.com"},{"name":"Symfony Community","homepage":"https://symfony.com/contributors"}],"description":"Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions","homepage":"https://symfony.com","keywords":["compatibility","polyfill","portable","shim"],"support":{"source":"https://github.com/symfony/polyfill-php80/tree/v1.28.0"},"funding":[{"url":"https://symfony.com/sponsor","type":"custom"},{"url":"https://github.com/fabpot","type":"github"},{"url":"https://tidelift.com/funding/github/packagist/symfony/symfony","type":"tidelift"}],"time":"2023-01-26T09:26:14+00:00"},{"name":"twig/twig","version":"3.x-dev","source":{"type":"git","url":"https://github.com/twigphp/Twig.git","reference":"edf580814491bbfb212cf3a403b3841fdfc2281c"},"dist":{"type":"zip","url":"https://api.github.com/repos/twigphp/Twig/zipball/edf580814491bbfb212cf3a403b3841fdfc2281c","reference":"edf580814491bbfb212cf3a403b3841fdfc2281c","shasum":""},"require":{"php":">=7.2.5","symfony/deprecation-contracts":"^2.5|^3","symfony/polyfill-ctype":"^1.8","symfony/polyfill-mbstring":"^1.3","symfony/polyfill-php80":"^1.22"},"require-dev":{"psr/container":"^1.0|^2.0","symfony/phpunit-bridge":"^5.4.9|^6.4|^7.0"},"default-branch":true,"type":"library","autoload":{"files":["src/Resources/core.php","src/Resources/debug.php","src/Resources/escaper.php","src/Resources/string_loader.php"],"psr-4":{"Twig\\":"src/"}},"notification-url":"https://packagist.org/downloads/","license":["BSD-3-Clause"],"authors":[{"name":"Fabien Potencier","email":"fabien@symfony.com","homepage":"http://fabien.potencier.org","role":"Lead Developer"},{"name":"Twig Team","role":"Contributors"},{"name":"Armin Ronacher","email":"armin.ronacher@active-4.com","role":"Project Founder"}],"description":"Twig, the flexible, fast, and secure template language for PHP","homepage":"https://twig.symfony.com","keywords":["templating"],"support":{"issues":"https://github.com/twigphp/Twig/issues","source":"https://github.com/twigphp/Twig/tree/3.x"},"funding":[{"url":"https://github.com/fabpot","type":"github"},{"url":"https://tidelift.com/funding/github/packagist/twig/twig","type":"tidelift"}],"time":"2024-02-05T13:24:44+00:00"}],"packages-dev":[],"aliases":[],"minimum-stability":"stable","stability-flags":{"twig/twig":20},"prefer-stable":false,"prefer-lowest":false,"platform":{"php":">=8.2"},"platform-dev":[],"plugin-api-version":"2.6.0"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment