Development

Changeset 32435

You must first sign up to be able to contribute.

Changeset 32435

Show
Ignore:
Timestamp:
04/02/11 18:45:04 (4 years ago)
Author:
fabien
Message:

Merge branch 'master' of git://github.com/symfony/symfony

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/2.0/src/Symfony/Bundle/FrameworkBundle/Resources/views/Exception/exception.html.twig

    r32393 r32435  
    2626                            {% for i, previous in exception.previouses %} 
    2727                                <li> 
    28                                     {{ previous.class|abbr_class }} <a href="#traces_link_{{ i + 1 }}" onclick="toggle('traces_{{ i + 1 }}', 'traces');">&raquo;</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');">&raquo;</a> 
    2929                                </li> 
    3030                            {% endfor %} 
  • branches/2.0/src/Symfony/Bundle/FrameworkBundle/Resources/views/Exception/traces.html.twig

    r32393 r32435  
    66            {% spaceless %} 
    77            <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" /> 
    1010            </a> 
    1111            {% endspaceless %} 
     
    1616 
    1717    <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' }}"> 
    1919        {% for i, trace in exception.trace %} 
    2020            <li> 
  • branches/2.0/src/Symfony/Component/Config/Loader/FileLoader.php

    r32355 r32435  
    1313 
    1414use Symfony\Component\Config\FileLocatorInterface; 
     15use Symfony\Component\Config\Exception\FileLoaderImportException; 
    1516 
    1617/** 
     
    5253     * @return mixed 
    5354     */ 
    54     public function import($resource, $type = null, $ignoreErrors = false
     55    public function import($resource, $type = null, $ignoreErrors = false, $sourceResource = null
    5556    { 
    5657        try { 
     
    6465        } catch (\Exception $e) { 
    6566            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); 
    6773            } 
    6874        } 
  • branches/2.0/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php

    r32355 r32435  
    108108        foreach ($imports as $import) { 
    109109            $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); 
    111111        } 
    112112    } 
  • branches/2.0/src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php

    r32355 r32435  
    9898        foreach ($content['imports'] as $import) { 
    9999            $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); 
    101101        } 
    102102    } 
  • branches/2.0/src/Symfony/Component/HttpKernel/HttpKernel.php

    r32386 r32435  
    172172        } 
    173173 
    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        } 
    175179    } 
    176180 
  • branches/2.0/src/Symfony/Component/Routing/Loader/XmlFileLoader.php

    r32355 r32435  
    5858                    $prefix = (string) $node->getAttribute('prefix'); 
    5959                    $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); 
    6161                    break; 
    6262                default: 
  • branches/2.0/src/Symfony/Component/Routing/Loader/YamlFileLoader.php

    r32355 r32435  
    6565                $prefix = isset($config['prefix']) ? $config['prefix'] : null; 
    6666                $this->setCurrentDir(dirname($path)); 
    67                 $collection->addCollection($this->import($config['resource'], $type), $prefix); 
     67                $collection->addCollection($this->import($config['resource'], $type, false, $file), $prefix); 
    6868            } elseif (isset($config['pattern'])) { 
    6969                $this->parseRoute($collection, $name, $config, $path); 
  • branches/2.0/tests/Symfony/Tests/Component/DependencyInjection/Loader/XmlFileLoaderTest.php

    r32285 r32435  
    105105 
    106106        $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'); 
    107110    } 
    108111 
  • branches/2.0/tests/Symfony/Tests/Component/DependencyInjection/Loader/YamlFileLoaderTest.php

    r32286 r32435  
    9191        $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); 
    9292        $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'); 
    9396    } 
    9497