1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-06 13:16:45 +02:00

feat(core): add expression language service

This commit is contained in:
Awilum
2022-05-26 23:19:14 +03:00
parent 508abcd2a8
commit 37fd79e816
3 changed files with 16 additions and 2 deletions

View File

@@ -60,10 +60,10 @@
"filp/whoops": "^2.14.5",
"symfony/console": "^5.4.8",
"symfony/var-exporter": "^5.4.8",
"symfony/expression-language": "^5.4.8",
"thermage/thermage": "^0.19.0",
"colinodell/json5": "^2.2.2",
"netcarver/textile": "^3.7",
"chriskonnertz/string-calc": "^1.0"
"netcarver/textile": "^3.7"
},
"suggest": {
"ext-zend-opcache": "Recommended for better performance",

View File

@@ -47,6 +47,7 @@ use Slim\Psr7\Factory\StreamFactory;
use Slim\Psr7\Response;
use Slim\Psr7\Stream;
use Symfony\Component\Yaml\Yaml as SymfonyYaml;
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
use Flextype\Middlewares\WhoopsMiddleware;
use Flextype\Console\FlextypeConsole;
@@ -203,6 +204,9 @@ if (registry()->get('flextype.settings.router.cache')) {
app()->getRouteCollector()->setCacheFile(PATH['tmp'] . '/routes/routes.php');
}
// Add Expression Service
container()->set('expression', new ExpressionLanguage());
// Add Session Service
container()->set('session', new Session());

View File

@@ -34,6 +34,16 @@ if (! function_exists('container')) {
}
}
if (! function_exists('expression')) {
/**
* Get Flextype Expression Service.
*/
function expression()
{
return flextype()->container()->get('expression');
}
}
if (! function_exists('console')) {
/**
* Get Flextype Console Service.