Merge remote branch 'ivanrey/master'
* ivanrey/master: BugFix reflClass is not always initialized getReflClass should be used instead since it initializes the variable if it's not set Better Exception Message BugFix: In windows environments it is necessary to replace backslash with forward slash in search string as well
This commit is contained in:
commit
7b87a6143a
@ -165,10 +165,11 @@ abstract class DoctrineCommand extends Command
|
||||
protected function findBasePathForBundle($bundle)
|
||||
{
|
||||
$path = str_replace('\\', '/', $bundle->getNamespace());
|
||||
$destination = str_replace('/'.$path, "", $bundle->getPath(), $c);
|
||||
$search = str_replace('\\','/',$bundle->getPath());
|
||||
$destination = str_replace('/'.$path, "", $search, $c);
|
||||
|
||||
if ($c != 1) {
|
||||
throw new \RuntimeException("Something went terribly wrong.");
|
||||
throw new \RuntimeException("Can't find base path for bundle. Path: $path , Destination: $destination");
|
||||
}
|
||||
|
||||
return $destination;
|
||||
|
@ -60,7 +60,7 @@ EOT
|
||||
$entityGenerator = $this->getEntityGenerator();
|
||||
|
||||
foreach ($metadatas as $metadata) {
|
||||
if ($filterEntity && $metadata->reflClass->getShortName() !== $filterEntity) {
|
||||
if ($filterEntity && $metadata->getReflClass()->getShortName() !== $filterEntity) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -109,10 +109,11 @@ abstract class DoctrineODMCommand extends Command
|
||||
protected function findBasePathForBundle($bundle)
|
||||
{
|
||||
$path = str_replace('\\', '/', $bundle->getNamespace());
|
||||
$destination = str_replace('/'.$path, "", $bundle->getPath(), $c);
|
||||
$search = str_replace('\\','/',$bundle->getPath());
|
||||
$destination = str_replace('/'.$path, "", $search, $c);
|
||||
|
||||
if ($c != 1) {
|
||||
throw new \RuntimeException("Something went terribly wrong.");
|
||||
throw new \RuntimeException("Can't find base path for bundle. Path: $path , Destination: $destination");
|
||||
}
|
||||
|
||||
return $destination;
|
||||
|
Reference in New Issue
Block a user