~ubuntu-branches/ubuntu/wily/symfony/wily

« back to all changes in this revision

Viewing changes to src/Symfony/Component/Routing/Loader/XmlFileLoader.php

  • Committer: Package Import Robot
  • Author(s): David Prévot, Fabien Potencier
  • Date: 2015-06-14 17:15:34 UTC
  • mfrom: (1.3.3)
  • Revision ID: package-import@ubuntu.com-20150614171534-h74z7c7x7hdhz3ra
Tags: 2.7.1+dfsg-1
[ Fabien Potencier ]
updated VERSION for 2.7.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
122
122
                throw new \InvalidArgumentException(sprintf('The <route> element in file "%s" cannot define both a "path" and a "pattern" attribute. Use only "path".', $path));
123
123
            }
124
124
 
125
 
            trigger_error(sprintf('The "pattern" option in file "%s" is deprecated since version 2.2 and will be removed in 3.0. Use the "path" option in the route definition instead.', $path), E_USER_DEPRECATED);
 
125
            @trigger_error(sprintf('The "pattern" option in file "%s" is deprecated since version 2.2 and will be removed in 3.0. Use the "path" option in the route definition instead.', $path), E_USER_DEPRECATED);
126
126
 
127
127
            $node->setAttribute('path', $node->getAttribute('pattern'));
128
128
            $node->removeAttribute('pattern');
133
133
 
134
134
        list($defaults, $requirements, $options, $condition) = $this->parseConfigs($node, $path);
135
135
 
 
136
        if (isset($requirements['_method'])) {
 
137
            if (0 === count($methods)) {
 
138
                $methods = explode('|', $requirements['_method']);
 
139
            }
 
140
 
 
141
            unset($requirements['_method']);
 
142
            @trigger_error(sprintf('The "_method" requirement of route "%s" in file "%s" is deprecated since version 2.2 and will be removed in 3.0. Use the "methods" attribute instead.', $id, $path), E_USER_DEPRECATED);
 
143
        }
 
144
 
 
145
        if (isset($requirements['_scheme'])) {
 
146
            if (0 === count($schemes)) {
 
147
                $schemes = explode('|', $requirements['_scheme']);
 
148
            }
 
149
 
 
150
            unset($requirements['_scheme']);
 
151
            @trigger_error(sprintf('The "_scheme" requirement of route "%s" in file "%s" is deprecated since version 2.2 and will be removed in 3.0. Use the "schemes" attribute instead.', $id, $path), E_USER_DEPRECATED);
 
152
        }
 
153
 
136
154
        $route = new Route($node->getAttribute('path'), $defaults, $requirements, $options, $node->getAttribute('host'), $schemes, $methods, $condition);
137
155
        $collection->add($id, $route);
138
156
    }