Do not change DB prefix in RoboFile when it is set

[MAILPOET-2014]
This commit is contained in:
Jan Jakeš
2019-07-23 15:39:22 +02:00
committed by M. Shull
parent 11b166d018
commit 7198b40b19

View File

@@ -927,7 +927,9 @@ class RoboFile extends \Robo\Tasks {
private function createDoctrineEntityManager() {
define('ABSPATH', getenv('WP_ROOT') . '/');
\MailPoet\Config\Env::$db_prefix = '';
if (\MailPoet\Config\Env::$db_prefix === null) {
\MailPoet\Config\Env::$db_prefix = ''; // ensure some prefix is set
}
$configuration = (new \MailPoet\Doctrine\ConfigurationFactory(true))->createConfiguration();
$platform_class = \MailPoet\Doctrine\ConnectionFactory::PLATFORM_CLASS;
return \MailPoetVendor\Doctrine\ORM\EntityManager::create([