Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

improve performance while loading DatabaseMap #112

Merged
merged 1 commit into from

2 participants

@havvg
Collaborator

When using multiple DataLoader (e.g. we are using the DataWiper and the YamlDataLoader in our testsuite), it's not required to load the files multiple times, when the DBMap is already available.

@willdurand willdurand merged commit c666ae7 into propelorm:master
@willdurand
Owner

Nice, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 2, 2012
  1. @havvg
This page is out of date. Refresh to see the latest.
Showing with 8 additions and 6 deletions.
  1. +8 −6 DataFixtures/AbstractDataHandler.php
View
14 DataFixtures/AbstractDataHandler.php
@@ -63,14 +63,16 @@ protected function loadMapBuilders($connectionName = null)
$this->dbMap = Propel::getDatabaseMap($connectionName);
- $finder = new Finder();
- $files = $finder->files()->name('*TableMap.php')->in($this->getRootDir() . '/../')->exclude('Tests');
+ if (0 === count($this->dbMap->getTables())) {
+ $finder = new Finder();
+ $files = $finder->files()->name('*TableMap.php')->in($this->getRootDir() . '/../')->exclude('Tests');
- foreach ($files as $file) {
- $class = $this->guessFullClassName($file->getRelativePath(), basename($file, '.php'));
+ foreach ($files as $file) {
+ $class = $this->guessFullClassName($file->getRelativePath(), basename($file, '.php'));
- if (null !== $class) {
- $this->dbMap->addTableFromMapClass($class);
+ if (null !== $class) {
+ $this->dbMap->addTableFromMapClass($class);
+ }
}
}
}
Something went wrong with that request. Please try again.