Commit 081f3242 authored by Darren Trethewey's avatar Darren Trethewey

Fix the repeat calling of getReservedKeywordsClass() that causes a...

Fix the repeat calling of getReservedKeywordsClass() that causes a considerable slow down when running lots of migrations.
parent e5377453
......@@ -106,6 +106,13 @@ abstract class AbstractPlatform
*/
protected $_eventManager;
/**
* Holds the KeywordList instance for the current platform.
*
* @var Doctrine\DBAL\Platforms\Keywords\KeywordList
*/
protected $_keywords;
/**
* Constructor.
*/
......@@ -2682,11 +2689,20 @@ abstract class AbstractPlatform
*/
final public function getReservedKeywordsList()
{
// Check for an existing instantiation of the keywords class.
if($this->keywords) {
return $this->keywords;
}
$class = $this->getReservedKeywordsClass();
$keywords = new $class;
if ( ! $keywords instanceof \Doctrine\DBAL\Platforms\Keywords\KeywordList) {
throw DBALException::notSupported(__METHOD__);
}
// Store the instance so it doesn't need to be generated on every request.
$this->keywords = $keywords;
return $keywords;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment