mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-12 06:18:52 +00:00
[ticket/13770] Fix tests
PHPBB3-13770
This commit is contained in:
parent
549fe66d90
commit
02af9385a1
3 changed files with 61 additions and 51 deletions
|
@ -96,21 +96,19 @@ set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handle
|
|||
$phpbb_class_loader_ext = new \phpbb\class_loader('\\', "{$phpbb_root_path}ext/", $phpEx);
|
||||
$phpbb_class_loader_ext->register();
|
||||
|
||||
\Symfony\Component\Debug\Debug::enable(E_ALL);
|
||||
|
||||
// Set up container
|
||||
/*try
|
||||
{*/
|
||||
try
|
||||
{
|
||||
$phpbb_container_builder = new \phpbb\di\container_builder($phpbb_root_path, $phpEx);
|
||||
$phpbb_container = $phpbb_container_builder->with_config($phpbb_config_php_file)->get_container();
|
||||
/*}
|
||||
}
|
||||
catch (InvalidArgumentException $e)
|
||||
{
|
||||
trigger_error(
|
||||
'The requested environment ' . PHPBB_ENVIRONMENT . ' is not available.',
|
||||
E_USER_ERROR
|
||||
);
|
||||
}*/
|
||||
}
|
||||
|
||||
$phpbb_class_loader->set_cache($phpbb_container->get('cache.driver'));
|
||||
$phpbb_class_loader_ext->set_cache($phpbb_container->get('cache.driver'));
|
||||
|
|
|
@ -117,11 +117,10 @@ $phpbb_class_loader_ext->register();
|
|||
// Set up container
|
||||
$phpbb_config_php_file = new \phpbb\config_php_file($phpbb_root_path, $phpEx);
|
||||
$phpbb_container_builder = new \phpbb\di\container_builder($phpbb_root_path, $phpEx);
|
||||
$phpbb_container = $phpbb_container_builder
|
||||
$phpbb_container_builder
|
||||
->without_extensions()
|
||||
->without_cache()
|
||||
->without_compiled_container()
|
||||
->get_container()
|
||||
;
|
||||
|
||||
$other_config_path = $phpbb_root_path . 'install/update/new/config/';
|
||||
|
|
|
@ -21,6 +21,7 @@ use Symfony\Component\DependencyInjection\Dumper\PhpDumper;
|
|||
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
|
||||
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
|
||||
use Symfony\Component\EventDispatcher\DependencyInjection\RegisterListenersPass;
|
||||
use Symfony\Component\Filesystem\Exception\IOException;
|
||||
use Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass;
|
||||
|
||||
class container_builder
|
||||
|
@ -130,10 +131,9 @@ class container_builder
|
|||
{
|
||||
require($config_cache->getPath());
|
||||
$this->container = new \phpbb_cache_container();
|
||||
|
||||
return $this->container;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$this->container_extensions = array(new extension\core($this->get_config_path()));
|
||||
|
||||
if ($this->use_extensions)
|
||||
|
@ -173,6 +173,12 @@ class container_builder
|
|||
$this->dump_container($config_cache);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->compile_container && $this->config_php_file)
|
||||
{
|
||||
$this->container->set('config.php', $this->config_php_file);
|
||||
}
|
||||
|
||||
return $this->container;
|
||||
}
|
||||
|
@ -393,6 +399,8 @@ class container_builder
|
|||
* @param ConfigCache $cache The config cache
|
||||
*/
|
||||
protected function dump_container($cache)
|
||||
{
|
||||
try
|
||||
{
|
||||
$dumper = new PhpDumper($this->container);
|
||||
$cached_container_dump = $dumper->dump(array(
|
||||
|
@ -402,6 +410,11 @@ class container_builder
|
|||
|
||||
$cache->write($cached_container_dump, $this->container->getResources());
|
||||
}
|
||||
catch (IOException $e)
|
||||
{
|
||||
// Don't fail if the cache isn't writeable
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the ContainerBuilder object
|
||||
|
|
Loading…
Add table
Reference in a new issue