mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 18:48:51 +02:00
Updating Symfony lib and dependencies:
Package operations: 2 installs, 23 updates, 0 removals - Updating psr/log (1.1.0 => 1.1.2) - Updating symfony/debug (v3.4.30 => v3.4.35) - Updating symfony/console (v3.4.30 => v3.4.35) - Updating symfony/dotenv (v3.4.30 => v3.4.35) - Updating symfony/routing (v3.4.30 => v3.4.35) - Updating symfony/finder (v3.4.30 => v3.4.35) - Updating symfony/filesystem (v3.4.30 => v3.4.35) - Installing symfony/polyfill-util (v1.12.0) - Installing symfony/polyfill-php56 (v1.12.0) - Updating symfony/http-foundation (v3.4.30 => v3.4.35) - Updating symfony/event-dispatcher (v3.4.30 => v3.4.35) - Updating symfony/http-kernel (v3.4.30 => v3.4.35) - Updating symfony/config (v3.4.30 => v3.4.35) - Updating symfony/dependency-injection (v3.4.30 => v3.4.35) - Updating symfony/class-loader (v3.4.30 => v3.4.35) - Updating symfony/cache (v3.4.30 => v3.4.35) - Updating symfony/framework-bundle (v3.4.30 => v3.4.35) - Updating twig/twig (v1.42.2 => v1.42.4) - Updating symfony/twig-bridge (v3.4.30 => v3.4.35) - Updating symfony/twig-bundle (v3.4.30 => v3.4.35) - Updating symfony/yaml (v3.4.30 => v3.4.35) - Updating symfony/stopwatch (v3.4.30 => v3.4.35) - Updating symfony/var-dumper (v3.4.30 => v3.4.35) - Updating symfony/web-profiler-bundle (v3.4.30 => v3.4.35) - Updating symfony/css-selector (v3.4.30 => v3.4.35)
This commit is contained in:
@@ -19,6 +19,7 @@ use Symfony\Component\HttpKernel\Profiler\Profiler;
|
||||
use Twig\Environment;
|
||||
use Twig\Error\LoaderError;
|
||||
use Twig\Loader\ExistsLoaderInterface;
|
||||
use Twig\Loader\SourceContextLoaderInterface;
|
||||
|
||||
/**
|
||||
* ExceptionController.
|
||||
@@ -118,17 +119,22 @@ class ExceptionController
|
||||
protected function templateExists($template)
|
||||
{
|
||||
$loader = $this->twig->getLoader();
|
||||
if ($loader instanceof ExistsLoaderInterface) {
|
||||
return $loader->exists($template);
|
||||
|
||||
if (1 === Environment::MAJOR_VERSION && !$loader instanceof ExistsLoaderInterface) {
|
||||
try {
|
||||
if ($loader instanceof SourceContextLoaderInterface) {
|
||||
$loader->getSourceContext($template);
|
||||
} else {
|
||||
$loader->getSource($template);
|
||||
}
|
||||
|
||||
return true;
|
||||
} catch (LoaderError $e) {
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
$loader->getSource($template);
|
||||
|
||||
return true;
|
||||
} catch (LoaderError $e) {
|
||||
}
|
||||
|
||||
return false;
|
||||
return $loader->exists($template);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,8 +78,7 @@ class RouterController
|
||||
/**
|
||||
* Returns the routing traces associated to the given request.
|
||||
*
|
||||
* @param RequestDataCollector $request
|
||||
* @param string $method
|
||||
* @param string $method
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
|
||||
@@ -64,9 +64,7 @@ class WebProfilerExtension extends Extension
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the base path for the XSD files.
|
||||
*
|
||||
* @return string The XSD base path
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getXsdValidationBasePath()
|
||||
{
|
||||
|
||||
@@ -42,8 +42,7 @@ class TemplateManager
|
||||
/**
|
||||
* Gets the template name for a given panel.
|
||||
*
|
||||
* @param Profile $profile
|
||||
* @param string $panel
|
||||
* @param string $panel
|
||||
*
|
||||
* @return mixed
|
||||
*
|
||||
@@ -118,21 +117,22 @@ class TemplateManager
|
||||
protected function templateExists($template)
|
||||
{
|
||||
$loader = $this->twig->getLoader();
|
||||
if ($loader instanceof ExistsLoaderInterface) {
|
||||
return $loader->exists($template);
|
||||
}
|
||||
|
||||
try {
|
||||
if ($loader instanceof SourceContextLoaderInterface || method_exists($loader, 'getSourceContext')) {
|
||||
$loader->getSourceContext($template);
|
||||
} else {
|
||||
$loader->getSource($template);
|
||||
if (1 === Environment::MAJOR_VERSION && !$loader instanceof ExistsLoaderInterface) {
|
||||
try {
|
||||
if ($loader instanceof SourceContextLoaderInterface) {
|
||||
$loader->getSourceContext($template);
|
||||
} else {
|
||||
$loader->getSource($template);
|
||||
}
|
||||
|
||||
return true;
|
||||
} catch (LoaderError $e) {
|
||||
}
|
||||
|
||||
return true;
|
||||
} catch (LoaderError $e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
return $loader->exists($template);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
{% set text %}
|
||||
<div class="sf-toolbar-info-piece">
|
||||
<b>Locale</b>
|
||||
<b>Default locale</b>
|
||||
<span class="sf-toolbar-status">
|
||||
{{ collector.locale|default('-') }}
|
||||
</span>
|
||||
@@ -73,7 +73,7 @@
|
||||
<div class="metrics">
|
||||
<div class="metric">
|
||||
<span class="value">{{ collector.locale|default('-') }}</span>
|
||||
<span class="label">Locale</span>
|
||||
<span class="label">Default locale</span>
|
||||
</div>
|
||||
<div class="metric">
|
||||
<span class="value">{{ collector.fallbackLocales|join(', ')|default('-') }}</span>
|
||||
@@ -152,7 +152,7 @@
|
||||
</div>
|
||||
{% else %}
|
||||
{% block fallback_messages %}
|
||||
{{ helper.render_table(messages_fallback) }}
|
||||
{{ helper.render_table(messages_fallback, true) }}
|
||||
{% endblock %}
|
||||
{% endif %}
|
||||
</div>
|
||||
@@ -185,11 +185,14 @@
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% macro render_table(messages) %}
|
||||
{% macro render_table(messages, is_fallback) %}
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Locale</th>
|
||||
{% if is_fallback %}
|
||||
<th>Fallback locale</th>
|
||||
{% endif %}
|
||||
<th>Domain</th>
|
||||
<th>Times used</th>
|
||||
<th>Message ID</th>
|
||||
@@ -200,6 +203,9 @@
|
||||
{% for message in messages %}
|
||||
<tr>
|
||||
<td class="font-normal text-small nowrap">{{ message.locale }}</td>
|
||||
{% if is_fallback %}
|
||||
<td class="font-normal text-small nowrap">{{ message.fallbackLocale|default('-') }}</td>
|
||||
{% endif %}
|
||||
<td class="font-normal text-small text-bold nowrap">{{ message.domain }}</td>
|
||||
<td class="font-normal text-small nowrap">{{ message.count }}</td>
|
||||
<td>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
Sfjs.load(
|
||||
'sfwdt{{ token }}',
|
||||
'{{ path("_wdt", { "token": token }) }}',
|
||||
'{{ path("_wdt", { "token": token })|escape('js') }}',
|
||||
function(xhr, el) {
|
||||
|
||||
/* Evaluate embedded scripts inside the toolbar */
|
||||
|
||||
@@ -98,9 +98,7 @@ class ProfilerControllerTest extends TestCase
|
||||
->expects($this->exactly(2))
|
||||
->method('loadProfile')
|
||||
->willReturnCallback(function ($token) {
|
||||
if ('found' == $token) {
|
||||
return new Profile($token);
|
||||
}
|
||||
return 'found' == $token ? new Profile($token) : null;
|
||||
})
|
||||
;
|
||||
|
||||
|
||||
@@ -15,6 +15,8 @@ use Symfony\Bundle\WebProfilerBundle\Profiler\TemplateManager;
|
||||
use Symfony\Bundle\WebProfilerBundle\Tests\TestCase;
|
||||
use Symfony\Component\HttpKernel\Profiler\Profile;
|
||||
use Twig\Environment;
|
||||
use Twig\Loader\LoaderInterface;
|
||||
use Twig\Loader\SourceContextLoaderInterface;
|
||||
|
||||
/**
|
||||
* Test for TemplateManager class.
|
||||
@@ -53,11 +55,9 @@ class TemplateManagerTest extends TestCase
|
||||
$this->templateManager = new TemplateManager($profiler, $twigEnvironment, $templates);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
|
||||
*/
|
||||
public function testGetNameOfInvalidTemplate()
|
||||
{
|
||||
$this->expectException('Symfony\Component\HttpKernel\Exception\NotFoundHttpException');
|
||||
$this->templateManager->getName(new Profile('token'), 'notexistingpanel');
|
||||
}
|
||||
|
||||
@@ -126,11 +126,16 @@ class TemplateManagerTest extends TestCase
|
||||
->method('loadTemplate')
|
||||
->willReturn('loadedTemplate');
|
||||
|
||||
if (interface_exists('Twig\Loader\SourceContextLoaderInterface')) {
|
||||
$loader = $this->getMockBuilder('Twig\Loader\SourceContextLoaderInterface')->getMock();
|
||||
if (Environment::MAJOR_VERSION > 1) {
|
||||
$loader = $this->createMock(LoaderInterface::class);
|
||||
$loader
|
||||
->expects($this->any())
|
||||
->method('exists')
|
||||
->willReturn(true);
|
||||
} else {
|
||||
$loader = $this->getMockBuilder('Twig\Loader\LoaderInterface')->getMock();
|
||||
$loader = $this->createMock(SourceContextLoaderInterface::class);
|
||||
}
|
||||
|
||||
$this->twigEnvironment->expects($this->any())->method('getLoader')->willReturn($loader);
|
||||
|
||||
return $this->twigEnvironment;
|
||||
|
||||
Reference in New Issue
Block a user