[ticket/13303] Speed up migration dependency calculation.

PHPBB3-13303
This commit is contained in:
Cesar G 2014-11-06 19:02:52 -08:00
parent a1b58d05d1
commit 95140bb724

View file

@ -58,6 +58,13 @@ class migrator
*/ */
protected $migrations = array(); protected $migrations = array();
/**
* Array of migrations that have been determined to be fulfillable
*
* @var array
*/
protected $fulfillable_migrations = array();
/** /**
* 'name,' 'class,' and 'state' of the last migration run * 'name,' 'class,' and 'state' of the last migration run
* *
@ -653,7 +660,7 @@ class migrator
*/ */
public function unfulfillable($name) public function unfulfillable($name)
{ {
if (isset($this->migration_state[$name])) if (isset($this->migration_state[$name]) || isset($this->fulfillable_migrations[$name]))
{ {
return false; return false;
} }
@ -674,6 +681,7 @@ class migrator
return $unfulfillable; return $unfulfillable;
} }
} }
$this->fulfillable_migrations[$name] = true;
return false; return false;
} }