Changeset 30266
- Timestamp:
- 07/16/10 20:45:07 (3 years ago)
- Files:
-
- branches/2.0/src/Symfony/Bundle/DoctrineMongoDBBundle/DependencyInjection/MongoDBExtension.php (modified) (1 diff)
- branches/2.0/src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/application/xml/Kernel.php (modified) (2 diffs)
- branches/2.0/src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/application/yaml/Kernel.php (modified) (2 diffs)
- branches/2.0/src/Symfony/Components/BrowserKit/Client.php (modified) (1 diff)
- branches/2.0/src/Symfony/Components/Console/Input/InputDefinition.php (modified) (1 diff)
- branches/2.0/src/Symfony/Components/DependencyInjection/Dumper/PhpDumper.php (modified) (1 diff)
- branches/2.0/src/Symfony/Framework/Bundle/Bundle.php (modified) (2 diffs)
- branches/2.0/src/Symfony/Framework/bootstrap.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/2.0/src/Symfony/Bundle/DoctrineMongoDBBundle/DependencyInjection/MongoDBExtension.php
r30263 r30266 39 39 public function mongodbLoad($config, ContainerBuilder $container) 40 40 { 41 $loader = new XmlFileLoader($container, __DIR__.'/../Resources/config');42 $loader->load($this->resources['mongodb']);43 44 41 if (!$container->hasDefinition('doctrine.odm.mongodb.document_manager')) { 42 $loader = new XmlFileLoader($container, __DIR__.'/../Resources/config'); 43 $loader->load($this->resources['mongodb']); 45 44 46 45 $container->setParameter('doctrine.odm.mongodb.mapping_dirs', $this->findBundleSubpaths('Resources/config/doctrine/metadata', $container)); branches/2.0/src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/application/xml/Kernel.php
r30181 r30266 6 6 use Symfony\Components\DependencyInjection\Loader\XmlFileLoader as ContainerLoader; 7 7 use Symfony\Components\Routing\Loader\XmlFileLoader as RoutingLoader; 8 use Symfony\Components\DependencyInjection\ContainerBuilder; 8 9 9 10 use Symfony\Framework\Bundle\KernelBundle; … … 51 52 public function registerContainerConfiguration() 52 53 { 53 $loader = new ContainerLoader($this->getBundleDirs()); 54 $container = new ContainerBuilder(); 55 $loader = new ContainerLoader($container, $this->getBundleDirs()); 56 $loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.xml'); 54 57 55 return $ loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.xml');58 return $container; 56 59 } 57 60 branches/2.0/src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/application/yaml/Kernel.php
r30181 r30266 6 6 use Symfony\Components\DependencyInjection\Loader\YamlFileLoader as ContainerLoader; 7 7 use Symfony\Components\Routing\Loader\YamlFileLoader as RoutingLoader; 8 use Symfony\Components\DependencyInjection\ContainerBuilder; 8 9 9 10 use Symfony\Framework\Bundle\KernelBundle; … … 51 52 public function registerContainerConfiguration() 52 53 { 53 $loader = new ContainerLoader($this->getBundleDirs()); 54 $container = new ContainerBuilder(); 55 $loader = new ContainerLoader($container, $this->getBundleDirs()); 56 $loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml'); 54 57 55 return $ loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');58 return $container; 56 59 } 57 60 branches/2.0/src/Symfony/Components/BrowserKit/Client.php
r29950 r30266 177 177 * @param string $uri The URI to fetch 178 178 * @param array $parameters The Request parameters 179 * @param array $headers The headers180 179 * @param array $files The files 181 * @param array $server The server parameters 180 * @param array $server The server parameters (HTTP headers are referenced with a HTTP_ prefix as PHP does) 182 181 * @param Boolean $changeHistory Whether to update the history or not (only used internally for back(), forward(), and reload()) 183 182 * 184 183 * @return Symfony\Components\DomCrawler\Crawler 185 184 */ 186 public function request($method, $uri, array $parameters = array(), array $ headers = array(), array $files = array(), array $server = array(), $changeHistory = true)185 public function request($method, $uri, array $parameters = array(), array $files = array(), array $server = array(), $changeHistory = true) 187 186 { 188 187 $uri = $this->getAbsoluteUri($uri); branches/2.0/src/Symfony/Components/Console/Input/InputDefinition.php
r29558 r30266 68 68 public function setArguments($arguments = array()) 69 69 { 70 $this->arguments = array(); 71 $this->requiredCount = 0; 72 $this->hasOptional = false; 70 $this->arguments = array(); 71 $this->requiredCount = 0; 72 $this->hasOptional = false; 73 $this->hasAnArrayArgument = false; 73 74 $this->addArguments($arguments); 74 75 } branches/2.0/src/Symfony/Components/DependencyInjection/Dumper/PhpDumper.php
r30263 r30266 87 87 { 88 88 $class = $this->dumpValue($definition->getClass()); 89 90 if (0 === strpos($class, "'") && !preg_match('/^\'[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*\'$/', $class)) { 91 throw new \InvalidArgumentException(sprintf('"%s" is not a valid class name.', $class)); 92 } 89 93 90 94 $arguments = array(); branches/2.0/src/Symfony/Framework/Bundle/Bundle.php
r30263 r30266 123 123 public function registerCommands(Application $application) 124 124 { 125 if (! is_dir($dir =$this->getPath().'/Command')) {125 if (!$dir = realpath($this->getPath().'/Command')) { 126 126 return; 127 127 } … … 130 130 $finder->files()->name('*Command.php')->in($dir); 131 131 132 $prefix = $this->namespacePrefix.'\\'.$this->name.'\\Command \\';132 $prefix = $this->namespacePrefix.'\\'.$this->name.'\\Command'; 133 133 foreach ($finder as $file) { 134 $r = new \ReflectionClass($prefix. basename($file, '.php'));134 $r = new \ReflectionClass($prefix.strtr($file->getPath(), array($dir => '', '/' => '\\')).'\\'.basename($file, '.php')); 135 135 if ($r->isSubclassOf('Symfony\\Components\\Console\\Command\\Command') && !$r->isAbstract()) { 136 136 $application->addCommand($r->newInstance()); branches/2.0/src/Symfony/Framework/bootstrap.php
r30263 r30266 76 76 public function registerCommands(Application $application) 77 77 { 78 if (! is_dir($dir =$this->getPath().'/Command')) {78 if (!$dir = realpath($this->getPath().'/Command')) { 79 79 return; 80 80 } … … 83 83 $finder->files()->name('*Command.php')->in($dir); 84 84 85 $prefix = $this->namespacePrefix.'\\'.$this->name.'\\Command \\';85 $prefix = $this->namespacePrefix.'\\'.$this->name.'\\Command'; 86 86 foreach ($finder as $file) { 87 $r = new \ReflectionClass($prefix. basename($file, '.php'));87 $r = new \ReflectionClass($prefix.strtr($file->getPath(), array($dir => '', '/' => '\\')).'\\'.basename($file, '.php')); 88 88 if ($r->isSubclassOf('Symfony\\Components\\Console\\Command\\Command') && !$r->isAbstract()) { 89 89 $application->addCommand($r->newInstance());