Skip to content

Commit

Permalink
[PropelBundle] Removed need for custom autoloader since Propel now su…
Browse files Browse the repository at this point in the history
…pports namespaces
  • Loading branch information
Francois Zaninotto authored and fabpot committed Jun 11, 2010
1 parent 075edbc commit ca00e20
Showing 1 changed file with 0 additions and 34 deletions.
34 changes: 0 additions & 34 deletions src/Symfony/Framework/PropelBundle/Command/BuildCommand.php
Expand Up @@ -52,40 +52,6 @@ protected function configure()
protected function execute(InputInterface $input, OutputInterface $output)
{
$this->callPhing('om');

foreach ($this->application->getKernel()->getBundles() as $bundle) {
$map = array();
if (is_dir($dir = $bundle->getPath().'/Model/map')) {
$finder = new Finder();
$files = $finder->files()->name('*TableMap.php')->followLinks()->in($dir);

foreach ($files as $file) {
$class = substr($file->getBasename(), 0, -12);

$map = array_merge($map, array(
$class => 'Model/'.$class.'.php',
$class.'Peer' => 'Model/'.$class.'Peer.php',
$class.'Query' => 'Model/'.$class.'Query.php',
'Base'.$class => 'Model/om/Base'.$class.'.php',
'Base'.$class.'Peer' => 'Model/om/Base'.$class.'Peer.php',
'Base'.$class.'Query' => 'Model/om/Base'.$class.'Query.php',
$class.'TableMap' => 'Model/map/'.$class.'TableMap.php',
));
}
}

if (!is_dir($bundle->getPath().'/Resources/config'))
{
mkdir($bundle->getPath().'/Resources/config', null, true);
}

if ($map)
{
file_put_contents($bundle->getPath().'/Resources/config/classmap.php', '<?php return '.var_export($map, true).';');
}
}

unlink($this->application->getKernel()->getCacheDir().'/propel_autoload.php');
}

protected function callPhing($taskName, $properties = array())
Expand Down

0 comments on commit ca00e20

Please sign in to comment.