Merge pull request #18 from osek666/patch-1

Hardcoded -2 fails when namespace is longer.
E.g. namespace="Sensio\Bundle\HelloBundle\Model"
This commit is contained in:
William DURAND 2011-07-05 04:57:07 -07:00
commit fc3b214fb0

View file

@ -58,7 +58,8 @@ abstract class PhingCommand extends ContainerAwareCommand
$schemas = $finder->files()->name('*schema.xml')->followLinks()->in($dir);
$parts = explode(DIRECTORY_SEPARATOR, realpath($bundle->getPath()));
$prefix = implode('.', array_slice($parts, 1, -2));
$length = count(explode('\\', $bundle->getNamespace())) * (-1);
$prefix = implode('.', array_slice($parts, 1, $length));
foreach ($schemas as $schema) {
$tempSchema = md5($schema).'_'.$schema->getBaseName();