mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-31 03:29:23 +02:00
Merge pull request #4236 from Nicofuma/ticket/13616
[ticket/13616] Uses symfony/proxy-manager-bridge to lazy load twig lexer
This commit is contained in:
commit
4c257d47a6
@ -443,6 +443,13 @@
|
|||||||
<delete file="${dir}/vendor/symfony/http-kernel/README.md" />
|
<delete file="${dir}/vendor/symfony/http-kernel/README.md" />
|
||||||
<delete file="${dir}/vendor/symfony/http-kernel/phpunit.xml.dist" />
|
<delete file="${dir}/vendor/symfony/http-kernel/phpunit.xml.dist" />
|
||||||
|
|
||||||
|
<delete dir="${dir}/vendor/symfony/proxy-manager-bridge/.git" />
|
||||||
|
<delete dir="${dir}/vendor/symfony/proxy-manager-bridge/Tests" />
|
||||||
|
<delete file="${dir}/vendor/symfony/proxy-manager-bridge/.gitignore" />
|
||||||
|
<delete file="${dir}/vendor/symfony/proxy-manager-bridge/CHANGELOG.md" />
|
||||||
|
<delete file="${dir}/vendor/symfony/proxy-manager-bridge/README.md" />
|
||||||
|
<delete file="${dir}/vendor/symfony/proxy-manager-bridge/phpunit.xml.dist" />
|
||||||
|
|
||||||
<delete dir="${dir}/vendor/symfony/routing/.git" />
|
<delete dir="${dir}/vendor/symfony/routing/.git" />
|
||||||
<delete dir="${dir}/vendor/symfony/routing/Tests" />
|
<delete dir="${dir}/vendor/symfony/routing/Tests" />
|
||||||
<delete file="${dir}/vendor/symfony/routing/.gitignore" />
|
<delete file="${dir}/vendor/symfony/routing/.gitignore" />
|
||||||
@ -473,6 +480,15 @@
|
|||||||
<delete file="${dir}/vendor/twig/twig/CHANGELOG" />
|
<delete file="${dir}/vendor/twig/twig/CHANGELOG" />
|
||||||
<delete file="${dir}/vendor/twig/twig/phpunit.xml.dist" />
|
<delete file="${dir}/vendor/twig/twig/phpunit.xml.dist" />
|
||||||
<delete file="${dir}/vendor/twig/twig/README.rst" />
|
<delete file="${dir}/vendor/twig/twig/README.rst" />
|
||||||
|
|
||||||
|
<delete file="${dir}/vendor/zendframework/zend-code/CONTRIBUTING.md" />
|
||||||
|
<delete file="${dir}/vendor/zendframework/zend-code/README.md" />
|
||||||
|
|
||||||
|
<delete file="${dir}/vendor/zendframework/zend-eventmanager/CONTRIBUTING.md" />
|
||||||
|
<delete file="${dir}/vendor/zendframework/zend-eventmanager/README.md" />
|
||||||
|
|
||||||
|
<delete file="${dir}/vendor/zendframework/zend-stdlib/CONTRIBUTING.md" />
|
||||||
|
<delete file="${dir}/vendor/zendframework/zend-stdlib/README.md" />
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="clean-diff-dir">
|
<target name="clean-diff-dir">
|
||||||
|
@ -68,6 +68,8 @@ $phpbb_container = $phpbb_container_builder->get_container();
|
|||||||
$phpbb_container->get('request')->enable_super_globals();
|
$phpbb_container->get('request')->enable_super_globals();
|
||||||
require($phpbb_root_path . 'includes/compatibility_globals.' . $phpEx);
|
require($phpbb_root_path . 'includes/compatibility_globals.' . $phpEx);
|
||||||
|
|
||||||
|
register_compatibility_globals();
|
||||||
|
|
||||||
/* @var $user \phpbb\user */
|
/* @var $user \phpbb\user */
|
||||||
$user = $phpbb_container->get('user');
|
$user = $phpbb_container->get('user');
|
||||||
$user->data['user_id'] = ANONYMOUS;
|
$user->data['user_id'] = ANONYMOUS;
|
||||||
|
@ -134,6 +134,8 @@ $phpbb_class_loader_ext->set_cache($phpbb_container->get('cache.driver'));
|
|||||||
|
|
||||||
require($phpbb_root_path . 'includes/compatibility_globals.' . $phpEx);
|
require($phpbb_root_path . 'includes/compatibility_globals.' . $phpEx);
|
||||||
|
|
||||||
|
register_compatibility_globals();
|
||||||
|
|
||||||
// Add own hook handler
|
// Add own hook handler
|
||||||
require($phpbb_root_path . 'includes/hooks/index.' . $phpEx);
|
require($phpbb_root_path . 'includes/hooks/index.' . $phpEx);
|
||||||
$phpbb_hook = new phpbb_hook(array('exit_handler', 'phpbb_user_session_handler', 'append_sid', array('template', 'display')));
|
$phpbb_hook = new phpbb_hook(array('exit_handler', 'phpbb_user_session_handler', 'append_sid', array('template', 'display')));
|
||||||
|
@ -43,6 +43,7 @@
|
|||||||
"symfony/finder": "2.8.*",
|
"symfony/finder": "2.8.*",
|
||||||
"symfony/http-foundation": "2.8.*",
|
"symfony/http-foundation": "2.8.*",
|
||||||
"symfony/http-kernel": "2.8.*",
|
"symfony/http-kernel": "2.8.*",
|
||||||
|
"symfony/proxy-manager-bridge": "2.8.*",
|
||||||
"symfony/routing": "2.8.*",
|
"symfony/routing": "2.8.*",
|
||||||
"symfony/twig-bridge": "2.8.*",
|
"symfony/twig-bridge": "2.8.*",
|
||||||
"symfony/yaml": "2.8.*",
|
"symfony/yaml": "2.8.*",
|
||||||
@ -64,5 +65,10 @@
|
|||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-master": "3.2.x-dev"
|
"dev-master": "3.2.x-dev"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"config": {
|
||||||
|
"platform": {
|
||||||
|
"php": "5.4"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
280
phpBB/composer.lock
generated
280
phpBB/composer.lock
generated
@ -4,8 +4,8 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"hash": "9cbb41222e71eb86e0ef9118baafc691",
|
"hash": "b82925c74b2b12ce589973243a9fab68",
|
||||||
"content-hash": "03a990fa2d088c89afe4824d2d53e873",
|
"content-hash": "fee6d87604f3053b51c0947ded841cfe",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "bantu/ini-get-wrapper",
|
"name": "bantu/ini-get-wrapper",
|
||||||
@ -401,6 +401,69 @@
|
|||||||
],
|
],
|
||||||
"time": "2015-08-21 11:40:30"
|
"time": "2015-08-21 11:40:30"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "ocramius/proxy-manager",
|
||||||
|
"version": "1.0.2",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/Ocramius/ProxyManager.git",
|
||||||
|
"reference": "57e9272ec0e8deccf09421596e0e2252df440e11"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/Ocramius/ProxyManager/zipball/57e9272ec0e8deccf09421596e0e2252df440e11",
|
||||||
|
"reference": "57e9272ec0e8deccf09421596e0e2252df440e11",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=5.3.3",
|
||||||
|
"zendframework/zend-code": ">2.2.5,<3.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"ext-phar": "*",
|
||||||
|
"phpunit/phpunit": "~4.0",
|
||||||
|
"squizlabs/php_codesniffer": "1.5.*"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"ocramius/generated-hydrator": "To have very fast object to array to object conversion for ghost objects",
|
||||||
|
"zendframework/zend-json": "To have the JsonRpc adapter (Remote Object feature)",
|
||||||
|
"zendframework/zend-soap": "To have the Soap adapter (Remote Object feature)",
|
||||||
|
"zendframework/zend-stdlib": "To use the hydrator proxy",
|
||||||
|
"zendframework/zend-xmlrpc": "To have the XmlRpc adapter (Remote Object feature)"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "2.0.x-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-0": {
|
||||||
|
"ProxyManager\\": "src"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Marco Pivetta",
|
||||||
|
"email": "ocramius@gmail.com",
|
||||||
|
"homepage": "http://ocramius.github.com/"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "A library providing utilities to generate, instantiate and generally operate with Object Proxies",
|
||||||
|
"homepage": "https://github.com/Ocramius/ProxyManager",
|
||||||
|
"keywords": [
|
||||||
|
"aop",
|
||||||
|
"lazy loading",
|
||||||
|
"proxy",
|
||||||
|
"proxy pattern",
|
||||||
|
"service proxies"
|
||||||
|
],
|
||||||
|
"time": "2015-08-09 04:28:19"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "paragonie/random_compat",
|
"name": "paragonie/random_compat",
|
||||||
"version": "v1.2.2",
|
"version": "v1.2.2",
|
||||||
@ -1341,6 +1404,60 @@
|
|||||||
],
|
],
|
||||||
"time": "2016-01-20 09:13:37"
|
"time": "2016-01-20 09:13:37"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "symfony/proxy-manager-bridge",
|
||||||
|
"version": "v2.8.4",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/symfony/proxy-manager-bridge.git",
|
||||||
|
"reference": "713ed53cf1da3f41288c608d2d0ddb44d6b07304"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/symfony/proxy-manager-bridge/zipball/713ed53cf1da3f41288c608d2d0ddb44d6b07304",
|
||||||
|
"reference": "713ed53cf1da3f41288c608d2d0ddb44d6b07304",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"ocramius/proxy-manager": "~0.4|~1.0|~2.0",
|
||||||
|
"php": ">=5.3.9",
|
||||||
|
"symfony/dependency-injection": "~2.8|~3.0.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"symfony/config": "~2.3|~3.0.0"
|
||||||
|
},
|
||||||
|
"type": "symfony-bridge",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "2.8-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Symfony\\Bridge\\ProxyManager\\": ""
|
||||||
|
},
|
||||||
|
"exclude-from-classmap": [
|
||||||
|
"/Tests/"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Fabien Potencier",
|
||||||
|
"email": "fabien@symfony.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Symfony Community",
|
||||||
|
"homepage": "https://symfony.com/contributors"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Symfony ProxyManager Bridge",
|
||||||
|
"homepage": "https://symfony.com",
|
||||||
|
"time": "2016-03-04 07:54:35"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/routing",
|
"name": "symfony/routing",
|
||||||
"version": "v2.8.3",
|
"version": "v2.8.3",
|
||||||
@ -1606,6 +1723,160 @@
|
|||||||
"templating"
|
"templating"
|
||||||
],
|
],
|
||||||
"time": "2016-01-25 21:22:18"
|
"time": "2016-01-25 21:22:18"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "zendframework/zend-code",
|
||||||
|
"version": "2.5.1",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/zendframework/zend-code.git",
|
||||||
|
"reference": "5d998f261ec2a55171c71da57a11622745680153"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/zendframework/zend-code/zipball/5d998f261ec2a55171c71da57a11622745680153",
|
||||||
|
"reference": "5d998f261ec2a55171c71da57a11622745680153",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=5.3.23",
|
||||||
|
"zendframework/zend-eventmanager": "~2.5"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"doctrine/common": ">=2.1",
|
||||||
|
"fabpot/php-cs-fixer": "1.7.*",
|
||||||
|
"phpunit/phpunit": "~4.0",
|
||||||
|
"zendframework/zend-stdlib": "~2.5",
|
||||||
|
"zendframework/zend-version": "~2.5"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"doctrine/common": "Doctrine\\Common >=2.1 for annotation features",
|
||||||
|
"zendframework/zend-stdlib": "Zend\\Stdlib component"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "2.5-dev",
|
||||||
|
"dev-develop": "2.6-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Zend\\Code\\": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"BSD-3-Clause"
|
||||||
|
],
|
||||||
|
"description": "provides facilities to generate arbitrary code using an object oriented interface",
|
||||||
|
"homepage": "https://github.com/zendframework/zend-code",
|
||||||
|
"keywords": [
|
||||||
|
"code",
|
||||||
|
"zf2"
|
||||||
|
],
|
||||||
|
"time": "2015-06-03 15:31:59"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "zendframework/zend-eventmanager",
|
||||||
|
"version": "2.5.1",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/zendframework/zend-eventmanager.git",
|
||||||
|
"reference": "d94a16039144936f107f906896349900fd634443"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/zendframework/zend-eventmanager/zipball/d94a16039144936f107f906896349900fd634443",
|
||||||
|
"reference": "d94a16039144936f107f906896349900fd634443",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=5.3.23",
|
||||||
|
"zendframework/zend-stdlib": "~2.5"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"fabpot/php-cs-fixer": "1.7.*",
|
||||||
|
"phpunit/phpunit": "~4.0"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "2.5-dev",
|
||||||
|
"dev-develop": "2.6-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Zend\\EventManager\\": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"BSD-3-Clause"
|
||||||
|
],
|
||||||
|
"homepage": "https://github.com/zendframework/zend-eventmanager",
|
||||||
|
"keywords": [
|
||||||
|
"eventmanager",
|
||||||
|
"zf2"
|
||||||
|
],
|
||||||
|
"time": "2015-06-03 15:32:01"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "zendframework/zend-stdlib",
|
||||||
|
"version": "2.5.1",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/zendframework/zend-stdlib.git",
|
||||||
|
"reference": "cc8e90a60dd5d44b9730b77d07b97550091da1ae"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/cc8e90a60dd5d44b9730b77d07b97550091da1ae",
|
||||||
|
"reference": "cc8e90a60dd5d44b9730b77d07b97550091da1ae",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=5.3.23"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"fabpot/php-cs-fixer": "1.7.*",
|
||||||
|
"phpunit/phpunit": "~4.0",
|
||||||
|
"zendframework/zend-config": "~2.5",
|
||||||
|
"zendframework/zend-eventmanager": "~2.5",
|
||||||
|
"zendframework/zend-filter": "~2.5",
|
||||||
|
"zendframework/zend-inputfilter": "~2.5",
|
||||||
|
"zendframework/zend-serializer": "~2.5",
|
||||||
|
"zendframework/zend-servicemanager": "~2.5"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"zendframework/zend-eventmanager": "To support aggregate hydrator usage",
|
||||||
|
"zendframework/zend-filter": "To support naming strategy hydrator usage",
|
||||||
|
"zendframework/zend-serializer": "Zend\\Serializer component",
|
||||||
|
"zendframework/zend-servicemanager": "To support hydrator plugin manager usage"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "2.5-dev",
|
||||||
|
"dev-develop": "2.6-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Zend\\Stdlib\\": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"BSD-3-Clause"
|
||||||
|
],
|
||||||
|
"homepage": "https://github.com/zendframework/zend-stdlib",
|
||||||
|
"keywords": [
|
||||||
|
"stdlib",
|
||||||
|
"zf2"
|
||||||
|
],
|
||||||
|
"time": "2015-06-03 15:32:03"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"packages-dev": [
|
"packages-dev": [
|
||||||
@ -3003,5 +3274,8 @@
|
|||||||
"platform": {
|
"platform": {
|
||||||
"php": ">=5.4,<7.1"
|
"php": ">=5.4,<7.1"
|
||||||
},
|
},
|
||||||
"platform-dev": []
|
"platform-dev": [],
|
||||||
|
"platform-overrides": {
|
||||||
|
"php": "5.4"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,14 +8,16 @@ services:
|
|||||||
- '@config'
|
- '@config'
|
||||||
- '@filesystem'
|
- '@filesystem'
|
||||||
- '@path_helper'
|
- '@path_helper'
|
||||||
- '@service_container'
|
|
||||||
- '%core.template.cache_path%'
|
- '%core.template.cache_path%'
|
||||||
- '@ext.manager'
|
- '@ext.manager'
|
||||||
- '@template.twig.loader'
|
- '@template.twig.loader'
|
||||||
- []
|
- []
|
||||||
|
calls:
|
||||||
|
- [setLexer, ['@template.twig.lexer']]
|
||||||
|
|
||||||
template.twig.lexer:
|
template.twig.lexer:
|
||||||
class: phpbb\template\twig\lexer
|
class: phpbb\template\twig\lexer
|
||||||
|
lazy: true
|
||||||
arguments:
|
arguments:
|
||||||
- '@template.twig.environment'
|
- '@template.twig.environment'
|
||||||
|
|
||||||
|
@ -81,11 +81,12 @@ services:
|
|||||||
- '@config'
|
- '@config'
|
||||||
- '@filesystem'
|
- '@filesystem'
|
||||||
- '@path_helper'
|
- '@path_helper'
|
||||||
- '@service_container'
|
|
||||||
- '%core.template.cache_path%'
|
- '%core.template.cache_path%'
|
||||||
- null
|
- null
|
||||||
- '@template.twig.loader'
|
- '@template.twig.loader'
|
||||||
- []
|
- []
|
||||||
|
calls:
|
||||||
|
- [setLexer, ['@template.twig.lexer']]
|
||||||
|
|
||||||
console.exception_subscriber:
|
console.exception_subscriber:
|
||||||
class: phpbb\console\exception_subscriber
|
class: phpbb\console\exception_subscriber
|
||||||
|
@ -154,7 +154,6 @@ class bbcode
|
|||||||
$phpbb_container->get('config'),
|
$phpbb_container->get('config'),
|
||||||
$phpbb_container->get('filesystem'),
|
$phpbb_container->get('filesystem'),
|
||||||
$phpbb_container->get('path_helper'),
|
$phpbb_container->get('path_helper'),
|
||||||
$phpbb_container,
|
|
||||||
$phpbb_container->getParameter('core.cache_dir'),
|
$phpbb_container->getParameter('core.cache_dir'),
|
||||||
$phpbb_container->get('ext.manager'),
|
$phpbb_container->get('ext.manager'),
|
||||||
new \phpbb\template\twig\loader(
|
new \phpbb\template\twig\loader(
|
||||||
|
@ -75,5 +75,3 @@ function register_compatibility_globals()
|
|||||||
/* @var $template \phpbb\template\template */
|
/* @var $template \phpbb\template\template */
|
||||||
$template = $phpbb_container->get('template');
|
$template = $phpbb_container->get('template');
|
||||||
}
|
}
|
||||||
|
|
||||||
register_compatibility_globals();
|
|
||||||
|
@ -639,7 +639,6 @@ class messenger
|
|||||||
$phpbb_container->get('config'),
|
$phpbb_container->get('config'),
|
||||||
$phpbb_container->get('filesystem'),
|
$phpbb_container->get('filesystem'),
|
||||||
$phpbb_container->get('path_helper'),
|
$phpbb_container->get('path_helper'),
|
||||||
$phpbb_container,
|
|
||||||
$phpbb_container->getParameter('core.cache_dir'),
|
$phpbb_container->getParameter('core.cache_dir'),
|
||||||
$phpbb_container->get('ext.manager'),
|
$phpbb_container->get('ext.manager'),
|
||||||
new \phpbb\template\twig\loader(
|
new \phpbb\template\twig\loader(
|
||||||
|
@ -14,6 +14,8 @@
|
|||||||
namespace phpbb\di;
|
namespace phpbb\di;
|
||||||
|
|
||||||
use phpbb\filesystem\filesystem;
|
use phpbb\filesystem\filesystem;
|
||||||
|
use Symfony\Bridge\ProxyManager\LazyProxy\Instantiator\RuntimeInstantiator;
|
||||||
|
use Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper\ProxyDumper;
|
||||||
use Symfony\Component\Config\ConfigCache;
|
use Symfony\Component\Config\ConfigCache;
|
||||||
use Symfony\Component\Config\FileLocator;
|
use Symfony\Component\Config\FileLocator;
|
||||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||||
@ -460,7 +462,10 @@ class container_builder
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
$dumper = new PhpDumper($this->container);
|
$dumper = new PhpDumper($this->container);
|
||||||
|
$proxy_dumper = new ProxyDumper();
|
||||||
|
$dumper->setProxyDumper($proxy_dumper);
|
||||||
|
|
||||||
$cached_container_dump = $dumper->dump(array(
|
$cached_container_dump = $dumper->dump(array(
|
||||||
'class' => 'phpbb_cache_container',
|
'class' => 'phpbb_cache_container',
|
||||||
'base_class' => 'Symfony\\Component\\DependencyInjection\\ContainerBuilder',
|
'base_class' => 'Symfony\\Component\\DependencyInjection\\ContainerBuilder',
|
||||||
@ -483,6 +488,7 @@ class container_builder
|
|||||||
protected function create_container(array $extensions)
|
protected function create_container(array $extensions)
|
||||||
{
|
{
|
||||||
$container = new ContainerBuilder(new ParameterBag($this->get_core_parameters()));
|
$container = new ContainerBuilder(new ParameterBag($this->get_core_parameters()));
|
||||||
|
$container->setProxyInstantiator(new RuntimeInstantiator());
|
||||||
|
|
||||||
$extensions_alias = array();
|
$extensions_alias = array();
|
||||||
|
|
||||||
|
@ -24,6 +24,8 @@ use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
|||||||
*/
|
*/
|
||||||
class core extends Extension
|
class core extends Extension
|
||||||
{
|
{
|
||||||
|
const TWIG_OPTIONS_POSITION = 6;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Config path
|
* Config path
|
||||||
* @var string
|
* @var string
|
||||||
@ -71,7 +73,7 @@ class core extends Extension
|
|||||||
|
|
||||||
// Set the Twig options if defined in the environment
|
// Set the Twig options if defined in the environment
|
||||||
$definition = $container->getDefinition('template.twig.environment');
|
$definition = $container->getDefinition('template.twig.environment');
|
||||||
$twig_environment_options = $definition->getArgument(7);
|
$twig_environment_options = $definition->getArgument(static::TWIG_OPTIONS_POSITION);
|
||||||
if ($config['twig']['debug'])
|
if ($config['twig']['debug'])
|
||||||
{
|
{
|
||||||
$twig_environment_options['debug'] = true;
|
$twig_environment_options['debug'] = true;
|
||||||
@ -81,8 +83,8 @@ class core extends Extension
|
|||||||
$twig_environment_options['auto_reload'] = true;
|
$twig_environment_options['auto_reload'] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Replace the 8th argument, the options passed to the environment
|
// Replace the 7th argument, the options passed to the environment
|
||||||
$definition->replaceArgument(7, $twig_environment_options);
|
$definition->replaceArgument(static::TWIG_OPTIONS_POSITION, $twig_environment_options);
|
||||||
|
|
||||||
if ($config['twig']['enable_debug_extension'])
|
if ($config['twig']['enable_debug_extension'])
|
||||||
{
|
{
|
||||||
|
@ -183,6 +183,9 @@ class container_factory
|
|||||||
|
|
||||||
// Get compatibilty globals and constants
|
// Get compatibilty globals and constants
|
||||||
$this->update_helper->include_file('includes/compatibility_globals.' . $this->php_ext);
|
$this->update_helper->include_file('includes/compatibility_globals.' . $this->php_ext);
|
||||||
|
|
||||||
|
register_compatibility_globals();
|
||||||
|
|
||||||
$this->update_helper->include_file('includes/constants.' . $this->php_ext);
|
$this->update_helper->include_file('includes/constants.' . $this->php_ext);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -50,20 +50,18 @@ class environment extends \Twig_Environment
|
|||||||
* @param \phpbb\config\config $phpbb_config The phpBB configuration
|
* @param \phpbb\config\config $phpbb_config The phpBB configuration
|
||||||
* @param \phpbb\filesystem\filesystem $filesystem
|
* @param \phpbb\filesystem\filesystem $filesystem
|
||||||
* @param \phpbb\path_helper $path_helper phpBB path helper
|
* @param \phpbb\path_helper $path_helper phpBB path helper
|
||||||
* @param \Symfony\Component\DependencyInjection\ContainerInterface $container The dependency injection container
|
|
||||||
* @param string $cache_path The path to the cache directory
|
* @param string $cache_path The path to the cache directory
|
||||||
* @param \phpbb\extension\manager $extension_manager phpBB extension manager
|
* @param \phpbb\extension\manager $extension_manager phpBB extension manager
|
||||||
* @param \Twig_LoaderInterface $loader Twig loader interface
|
* @param \Twig_LoaderInterface $loader Twig loader interface
|
||||||
* @param array $options Array of options to pass to Twig
|
* @param array $options Array of options to pass to Twig
|
||||||
*/
|
*/
|
||||||
public function __construct(\phpbb\config\config $phpbb_config, \phpbb\filesystem\filesystem $filesystem, \phpbb\path_helper $path_helper, \Symfony\Component\DependencyInjection\ContainerInterface $container, $cache_path, \phpbb\extension\manager $extension_manager = null, \Twig_LoaderInterface $loader = null, $options = array())
|
public function __construct(\phpbb\config\config $phpbb_config, \phpbb\filesystem\filesystem $filesystem, \phpbb\path_helper $path_helper, $cache_path, \phpbb\extension\manager $extension_manager = null, \Twig_LoaderInterface $loader = null, $options = array())
|
||||||
{
|
{
|
||||||
$this->phpbb_config = $phpbb_config;
|
$this->phpbb_config = $phpbb_config;
|
||||||
|
|
||||||
$this->filesystem = $filesystem;
|
$this->filesystem = $filesystem;
|
||||||
$this->phpbb_path_helper = $path_helper;
|
$this->phpbb_path_helper = $path_helper;
|
||||||
$this->extension_manager = $extension_manager;
|
$this->extension_manager = $extension_manager;
|
||||||
$this->container = $container;
|
|
||||||
|
|
||||||
$this->phpbb_root_path = $this->phpbb_path_helper->get_phpbb_root_path();
|
$this->phpbb_root_path = $this->phpbb_path_helper->get_phpbb_root_path();
|
||||||
$this->web_root_path = $this->phpbb_path_helper->get_web_root_path();
|
$this->web_root_path = $this->phpbb_path_helper->get_web_root_path();
|
||||||
@ -77,24 +75,9 @@ class environment extends \Twig_Environment
|
|||||||
'autoescape' => false,
|
'autoescape' => false,
|
||||||
), $options);
|
), $options);
|
||||||
|
|
||||||
return parent::__construct($loader, $options);
|
parent::__construct($loader, $options);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function getLexer()
|
|
||||||
{
|
|
||||||
if (null === $this->lexer)
|
|
||||||
{
|
|
||||||
$this->lexer = $this->container->get('template.twig.lexer');
|
|
||||||
$this->lexer->set_environment($this);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->lexer;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the list of enabled phpBB extensions
|
* Get the list of enabled phpBB extensions
|
||||||
*
|
*
|
||||||
|
@ -111,7 +111,6 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case
|
|||||||
$this->config,
|
$this->config,
|
||||||
$this->filesystem,
|
$this->filesystem,
|
||||||
$this->phpbb_path_helper,
|
$this->phpbb_path_helper,
|
||||||
$container,
|
|
||||||
$cache_path,
|
$cache_path,
|
||||||
null,
|
null,
|
||||||
$loader,
|
$loader,
|
||||||
@ -123,7 +122,7 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
$this->template = new phpbb\template\twig\twig($this->phpbb_path_helper, $this->config, $context, $twig, $cache_path, $this->user, array(new \phpbb\template\twig\extension($context, $this->user)));
|
$this->template = new phpbb\template\twig\twig($this->phpbb_path_helper, $this->config, $context, $twig, $cache_path, $this->user, array(new \phpbb\template\twig\extension($context, $this->user)));
|
||||||
$container->set('template.twig.lexer', new \phpbb\template\twig\lexer($twig));
|
$twig->setLexer(new \phpbb\template\twig\lexer($twig));
|
||||||
|
|
||||||
$this->extension_manager = new phpbb_mock_extension_manager(
|
$this->extension_manager = new phpbb_mock_extension_manager(
|
||||||
dirname(__FILE__) . '/',
|
dirname(__FILE__) . '/',
|
||||||
|
@ -65,7 +65,6 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
|
|||||||
$this->config,
|
$this->config,
|
||||||
$filesystem,
|
$filesystem,
|
||||||
$phpbb_path_helper,
|
$phpbb_path_helper,
|
||||||
$container,
|
|
||||||
$cache_path,
|
$cache_path,
|
||||||
null,
|
null,
|
||||||
$loader,
|
$loader,
|
||||||
@ -112,7 +111,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
|
|||||||
$this->user = new \phpbb\user($lang, '\phpbb\datetime');
|
$this->user = new \phpbb\user($lang, '\phpbb\datetime');
|
||||||
|
|
||||||
$this->template = new phpbb\template\twig\twig($phpbb_path_helper, $this->config, $context, $twig, $cache_path, $this->user, array(new \phpbb\template\twig\extension($context, $this->user)));
|
$this->template = new phpbb\template\twig\twig($phpbb_path_helper, $this->config, $context, $twig, $cache_path, $this->user, array(new \phpbb\template\twig\extension($context, $this->user)));
|
||||||
$container->set('template.twig.lexer', new \phpbb\template\twig\lexer($twig));
|
$twig->setLexer(new \phpbb\template\twig\lexer($twig));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Should fail from missing composer.json
|
// Should fail from missing composer.json
|
||||||
|
@ -64,7 +64,6 @@ class phpbb_template_allfolder_test extends phpbb_template_template_test_case
|
|||||||
$config,
|
$config,
|
||||||
$filesystem,
|
$filesystem,
|
||||||
$path_helper,
|
$path_helper,
|
||||||
$container,
|
|
||||||
$cache_path,
|
$cache_path,
|
||||||
$this->extension_manager,
|
$this->extension_manager,
|
||||||
$loader,
|
$loader,
|
||||||
@ -76,7 +75,7 @@ class phpbb_template_allfolder_test extends phpbb_template_template_test_case
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
$this->template = new \phpbb\template\twig\twig($path_helper, $config, $context, $twig, $cache_path, $this->user, array(new \phpbb\template\twig\extension($context, $this->user)), $this->extension_manager);
|
$this->template = new \phpbb\template\twig\twig($path_helper, $config, $context, $twig, $cache_path, $this->user, array(new \phpbb\template\twig\extension($context, $this->user)), $this->extension_manager);
|
||||||
$container->set('template.twig.lexer', new \phpbb\template\twig\lexer($twig));
|
$twig->setLexer(new \phpbb\template\twig\lexer($twig));
|
||||||
|
|
||||||
$this->template_path = $this->test_path . '/templates';
|
$this->template_path = $this->test_path . '/templates';
|
||||||
$this->ext_template_path = 'tests/extension/ext/vendor4/bar/styles/all/template';
|
$this->ext_template_path = 'tests/extension/ext/vendor4/bar/styles/all/template';
|
||||||
|
@ -158,7 +158,6 @@ Zeta test event in all',
|
|||||||
$config,
|
$config,
|
||||||
$filesystem,
|
$filesystem,
|
||||||
$path_helper,
|
$path_helper,
|
||||||
$container,
|
|
||||||
$cache_path,
|
$cache_path,
|
||||||
$this->extension_manager,
|
$this->extension_manager,
|
||||||
$loader,
|
$loader,
|
||||||
@ -170,7 +169,7 @@ Zeta test event in all',
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
$this->template = new \phpbb\template\twig\twig($path_helper, $config, $context, $twig, $cache_path, $this->user, array(new \phpbb\template\twig\extension($context, $this->user)), $this->extension_manager);
|
$this->template = new \phpbb\template\twig\twig($path_helper, $config, $context, $twig, $cache_path, $this->user, array(new \phpbb\template\twig\extension($context, $this->user)), $this->extension_manager);
|
||||||
$container->set('template.twig.lexer', new \phpbb\template\twig\lexer($twig));
|
$twig->setLexer(new \phpbb\template\twig\lexer($twig));
|
||||||
|
|
||||||
$this->template->set_custom_style(((!empty($style_names)) ? $style_names : 'silver'), array($this->template_path));
|
$this->template->set_custom_style(((!empty($style_names)) ? $style_names : 'silver'), array($this->template_path));
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,6 @@ class phpbb_template_template_includecss_test extends phpbb_template_template_te
|
|||||||
$config,
|
$config,
|
||||||
$filesystem,
|
$filesystem,
|
||||||
$this->phpbb_path_helper,
|
$this->phpbb_path_helper,
|
||||||
$container,
|
|
||||||
$cache_path,
|
$cache_path,
|
||||||
null,
|
null,
|
||||||
$loader,
|
$loader,
|
||||||
@ -80,7 +79,7 @@ class phpbb_template_template_includecss_test extends phpbb_template_template_te
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
$container->set('template.twig.lexer', new \phpbb\template\twig\lexer($twig));
|
$twig->setLexer(new \phpbb\template\twig\lexer($twig));
|
||||||
$this->template->set_custom_style('tests', array($this->template_path, $this->parent_template_path));
|
$this->template->set_custom_style('tests', array($this->template_path, $this->parent_template_path));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,7 +102,6 @@ class phpbb_template_template_test_case extends phpbb_test_case
|
|||||||
$config,
|
$config,
|
||||||
$filesystem,
|
$filesystem,
|
||||||
$path_helper,
|
$path_helper,
|
||||||
$container,
|
|
||||||
$cache_path,
|
$cache_path,
|
||||||
null,
|
null,
|
||||||
$loader,
|
$loader,
|
||||||
@ -114,7 +113,7 @@ class phpbb_template_template_test_case extends phpbb_test_case
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
$this->template = new phpbb\template\twig\twig($path_helper, $config, $context, $twig, $cache_path, $this->user, array(new \phpbb\template\twig\extension($context, $this->user)));
|
$this->template = new phpbb\template\twig\twig($path_helper, $config, $context, $twig, $cache_path, $this->user, array(new \phpbb\template\twig\extension($context, $this->user)));
|
||||||
$container->set('template.twig.lexer', new \phpbb\template\twig\lexer($twig));
|
$twig->setLexer(new \phpbb\template\twig\lexer($twig));
|
||||||
$this->template->set_custom_style('tests', $this->template_path);
|
$this->template->set_custom_style('tests', $this->template_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,7 +45,6 @@ class phpbb_template_template_test_case_with_tree extends phpbb_template_templat
|
|||||||
$config,
|
$config,
|
||||||
$filesystem,
|
$filesystem,
|
||||||
$this->phpbb_path_helper,
|
$this->phpbb_path_helper,
|
||||||
$container,
|
|
||||||
$cache_path,
|
$cache_path,
|
||||||
null,
|
null,
|
||||||
$loader,
|
$loader,
|
||||||
@ -57,7 +56,7 @@ class phpbb_template_template_test_case_with_tree extends phpbb_template_templat
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
$this->template = new phpbb\template\twig\twig($this->phpbb_path_helper, $config, $context, $twig, $cache_path, $this->user, array(new \phpbb\template\twig\extension($context, $this->user)));
|
$this->template = new phpbb\template\twig\twig($this->phpbb_path_helper, $config, $context, $twig, $cache_path, $this->user, array(new \phpbb\template\twig\extension($context, $this->user)));
|
||||||
$container->set('template.twig.lexer', new \phpbb\template\twig\lexer($twig));
|
$twig->setLexer(new \phpbb\template\twig\lexer($twig));
|
||||||
$this->template->set_custom_style('tests', array($this->template_path, $this->parent_template_path));
|
$this->template->set_custom_style('tests', array($this->template_path, $this->parent_template_path));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -384,9 +384,18 @@ class phpbb_functional_test_case extends phpbb_test_case
|
|||||||
@unlink($phpbb_root_path . 'cache/install_lock');
|
@unlink($phpbb_root_path . 'cache/install_lock');
|
||||||
}
|
}
|
||||||
|
|
||||||
global $phpbb_container, $cache, $phpbb_dispatcher, $request, $user, $auth, $db, $config, $phpbb_log, $symfony_request, $phpbb_filesystem, $phpbb_path_helper, $phpbb_extension_manager, $template;
|
global $phpbb_container;
|
||||||
$phpbb_container->reset();
|
$phpbb_container->reset();
|
||||||
unset($phpbb_container, $cache, $phpbb_dispatcher, $request, $user, $auth, $db, $config, $phpbb_log, $symfony_request, $phpbb_filesystem, $phpbb_path_helper, $phpbb_extension_manager, $template);
|
|
||||||
|
$blacklist = ['phpbb_class_loader_mock', 'phpbb_class_loader_ext', 'phpbb_class_loader'];
|
||||||
|
|
||||||
|
foreach (array_keys($GLOBALS) as $key)
|
||||||
|
{
|
||||||
|
if (is_object($GLOBALS[$key]) && !in_array($key, $blacklist, true))
|
||||||
|
{
|
||||||
|
unset($GLOBALS[$key]);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function install_ext($extension)
|
public function install_ext($extension)
|
||||||
|
@ -256,9 +256,18 @@ class phpbb_ui_test_case extends phpbb_test_case
|
|||||||
@unlink($phpbb_root_path . 'cache/install_lock');
|
@unlink($phpbb_root_path . 'cache/install_lock');
|
||||||
}
|
}
|
||||||
|
|
||||||
global $phpbb_container, $cache, $phpbb_dispatcher, $request, $user, $auth, $db, $config, $phpbb_log, $symfony_request, $phpbb_filesystem, $phpbb_path_helper, $phpbb_extension_manager, $template;
|
global $phpbb_container;
|
||||||
$phpbb_container->reset();
|
$phpbb_container->reset();
|
||||||
unset($phpbb_container, $cache, $phpbb_dispatcher, $request, $user, $auth, $db, $config, $phpbb_log, $symfony_request, $phpbb_filesystem, $phpbb_path_helper, $phpbb_extension_manager, $template);
|
|
||||||
|
$blacklist = ['phpbb_class_loader_mock', 'phpbb_class_loader_ext', 'phpbb_class_loader'];
|
||||||
|
|
||||||
|
foreach (array_keys($GLOBALS) as $key)
|
||||||
|
{
|
||||||
|
if (is_object($GLOBALS[$key]) && !in_array($key, $blacklist, true))
|
||||||
|
{
|
||||||
|
unset($GLOBALS[$key]);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static protected function get_db()
|
static protected function get_db()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user