Changeset 32435
- Timestamp:
- 04/02/11 18:45:04 (2 years ago)
- Files:
-
- branches/2.0/src/Symfony/Bundle/FrameworkBundle/Resources/views/Exception/exception.html.twig (modified) (1 diff)
- branches/2.0/src/Symfony/Bundle/FrameworkBundle/Resources/views/Exception/traces.html.twig (modified) (2 diffs)
- branches/2.0/src/Symfony/Component/Config/Exception (added)
- branches/2.0/src/Symfony/Component/Config/Exception/FileLoaderImportException.php (added)
- branches/2.0/src/Symfony/Component/Config/Loader/FileLoader.php (modified) (3 diffs)
- branches/2.0/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php (modified) (1 diff)
- branches/2.0/src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php (modified) (1 diff)
- branches/2.0/src/Symfony/Component/HttpKernel/HttpKernel.php (modified) (1 diff)
- branches/2.0/src/Symfony/Component/Routing/Loader/XmlFileLoader.php (modified) (1 diff)
- branches/2.0/src/Symfony/Component/Routing/Loader/YamlFileLoader.php (modified) (1 diff)
- branches/2.0/tests/Symfony/Tests/Component/DependencyInjection/Fixtures/xml/services4_bad_import.xml (added)
- branches/2.0/tests/Symfony/Tests/Component/DependencyInjection/Fixtures/yaml/services4_bad_import.yml (added)
- branches/2.0/tests/Symfony/Tests/Component/DependencyInjection/Loader/XmlFileLoaderTest.php (modified) (1 diff)
- branches/2.0/tests/Symfony/Tests/Component/DependencyInjection/Loader/YamlFileLoaderTest.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/2.0/src/Symfony/Bundle/FrameworkBundle/Resources/views/Exception/exception.html.twig
r32393 r32435 26 26 {% for i, previous in exception.previouses %} 27 27 <li> 28 {{ previous.class|abbr_class }} <a href="#traces_link_{{ i + 1 }}" onclick="toggle('traces_{{ i + 1 }}', 'traces'); ">»</a>28 {{ previous.class|abbr_class }} <a href="#traces_link_{{ i + 1 }}" onclick="toggle('traces_{{ i + 1 }}', 'traces'); switchIcons('icon_traces_{{ i + 1 }}_open', 'icon_traces_{{ i + 1 }}_close');">»</a> 29 29 </li> 30 30 {% endfor %} branches/2.0/src/Symfony/Bundle/FrameworkBundle/Resources/views/Exception/traces.html.twig
r32393 r32435 6 6 {% spaceless %} 7 7 <a href="#" onclick="toggle('traces_{{ position }}', 'traces'); switchIcons('icon_traces_{{ position }}_open', 'icon_traces_{{ position }}_close'); return false;"> 8 <img class="toggle" id="icon_traces_{{ position }}_close" alt="-" src="{{ asset('bundles/framework/images/blue_picto_less.gif') }}" style="visibility: {{ 0 == position? 'display' : 'hidden' }}" />9 <img class="toggle" id="icon_traces_{{ position }}_open" alt="+" src="{{ asset('bundles/framework/images/blue_picto_more.gif') }}" style="visibility: {{ 0 == position? 'hidden' : 'display' }}; margin-left: -18px" />8 <img class="toggle" id="icon_traces_{{ position }}_close" alt="-" src="{{ asset('bundles/framework/images/blue_picto_less.gif') }}" style="visibility: {{ 0 == count ? 'display' : 'hidden' }}" /> 9 <img class="toggle" id="icon_traces_{{ position }}_open" alt="+" src="{{ asset('bundles/framework/images/blue_picto_more.gif') }}" style="visibility: {{ 0 == count ? 'hidden' : 'display' }}; margin-left: -18px" /> 10 10 </a> 11 11 {% endspaceless %} … … 16 16 17 17 <a id="traces_link_{{ position }}"></a> 18 <ol class="traces list_exception" id="traces_{{ position }}" style="display: {{ 0 == position? 'block' : 'none' }}">18 <ol class="traces list_exception" id="traces_{{ position }}" style="display: {{ 0 == count ? 'block' : 'none' }}"> 19 19 {% for i, trace in exception.trace %} 20 20 <li> branches/2.0/src/Symfony/Component/Config/Loader/FileLoader.php
r32355 r32435 13 13 14 14 use Symfony\Component\Config\FileLocatorInterface; 15 use Symfony\Component\Config\Exception\FileLoaderImportException; 15 16 16 17 /** … … 52 53 * @return mixed 53 54 */ 54 public function import($resource, $type = null, $ignoreErrors = false )55 public function import($resource, $type = null, $ignoreErrors = false, $sourceResource = null) 55 56 { 56 57 try { … … 64 65 } catch (\Exception $e) { 65 66 if (!$ignoreErrors) { 66 throw $e; 67 // prevent embedded imports from nesting multiple exceptions 68 if ($e instanceof FileLoaderImportException) { 69 throw $e; 70 } 71 72 throw new FileLoaderImportException($resource, $sourceResource, null, $e); 67 73 } 68 74 } branches/2.0/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php
r32355 r32435 108 108 foreach ($imports as $import) { 109 109 $this->setCurrentDir(dirname($file)); 110 $this->import((string) $import['resource'], (Boolean) $import->getAttributeAsPhp('ignore-errors'));110 $this->import((string) $import['resource'], null, (Boolean) $import->getAttributeAsPhp('ignore-errors'), $file); 111 111 } 112 112 } branches/2.0/src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php
r32355 r32435 98 98 foreach ($content['imports'] as $import) { 99 99 $this->setCurrentDir(dirname($file)); 100 $this->import($import['resource'], isset($import['ignore_errors']) ? (Boolean) $import['ignore_errors'] : false);100 $this->import($import['resource'], null, isset($import['ignore_errors']) ? (Boolean) $import['ignore_errors'] : false, $file); 101 101 } 102 102 } branches/2.0/src/Symfony/Component/HttpKernel/HttpKernel.php
r32386 r32435 172 172 } 173 173 174 return $this->filterResponse($event->getResponse(), $request, $type); 174 try { 175 return $this->filterResponse($event->getResponse(), $request, $type); 176 } catch (\Exception $e) { 177 return $event->getResponse(); 178 } 175 179 } 176 180 branches/2.0/src/Symfony/Component/Routing/Loader/XmlFileLoader.php
r32355 r32435 58 58 $prefix = (string) $node->getAttribute('prefix'); 59 59 $this->setCurrentDir(dirname($path)); 60 $collection->addCollection($this->import($resource, ('' !== $type ? $type : null) ), $prefix);60 $collection->addCollection($this->import($resource, ('' !== $type ? $type : null), false, $file), $prefix); 61 61 break; 62 62 default: branches/2.0/src/Symfony/Component/Routing/Loader/YamlFileLoader.php
r32355 r32435 65 65 $prefix = isset($config['prefix']) ? $config['prefix'] : null; 66 66 $this->setCurrentDir(dirname($path)); 67 $collection->addCollection($this->import($config['resource'], $type ), $prefix);67 $collection->addCollection($this->import($config['resource'], $type, false, $file), $prefix); 68 68 } elseif (isset($config['pattern'])) { 69 69 $this->parseRoute($collection, $name, $config, $path); branches/2.0/tests/Symfony/Tests/Component/DependencyInjection/Loader/XmlFileLoaderTest.php
r32285 r32435 105 105 106 106 $this->assertEquals(array_keys($expected), array_keys($actual), '->load() imports and merges imported files'); 107 108 // Bad import throws no exception due to ignore_errors value. 109 $loader->load('services4_bad_import.xml'); 107 110 } 108 111 branches/2.0/tests/Symfony/Tests/Component/DependencyInjection/Loader/YamlFileLoaderTest.php
r32286 r32435 91 91 $expected = array('foo' => 'bar', 'values' => array(true, false), 'bar' => '%foo%', 'foo_bar' => new Reference('foo_bar'), 'mixedcase' => array('MixedCaseKey' => 'value'), 'imported_from_ini' => true, 'imported_from_xml' => true); 92 92 $this->assertEquals(array_keys($expected), array_keys($actual), '->load() imports and merges imported files'); 93 94 // Bad import throws no exception due to ignore_errors value. 95 $loader->load('services4_bad_import.yml'); 93 96 } 94 97