end module activation
This commit is contained in:
@@ -53,9 +53,7 @@ class Module extends BaseAction implements EventSubscriberInterface
|
||||
}
|
||||
}
|
||||
|
||||
if ($module->isModified()) {
|
||||
$event->setModule($module);
|
||||
}
|
||||
$event->setModule($module);
|
||||
|
||||
$this->cacheClear();
|
||||
}
|
||||
|
||||
@@ -135,17 +135,19 @@ abstract class BaseModule extends ContainerAware
|
||||
}
|
||||
}
|
||||
|
||||
public function deployImageFolder(Module $module, $folderPath)
|
||||
public function deployImageFolder(Module $module, $folderPath, ConnectionInterface $con = null)
|
||||
{
|
||||
try {
|
||||
$directoryBrowser = new \DirectoryIterator($folderPath);
|
||||
} catch (\UnexpectedValueException $e) {
|
||||
throw $e;
|
||||
}
|
||||
if(null === $con) {
|
||||
$con = \Propel\Runtime\Propel::getConnection(
|
||||
ModuleImageTableMap::DATABASE_NAME
|
||||
);
|
||||
}
|
||||
|
||||
$con = \Propel\Runtime\Propel::getConnection(
|
||||
ModuleImageTableMap::DATABASE_NAME
|
||||
);
|
||||
|
||||
/* browse the directory */
|
||||
$imagePosition = 1;
|
||||
|
||||
@@ -66,7 +66,7 @@ class Cheque extends BaseModule implements PaymentModuleInterface
|
||||
/* insert the images from image folder if first module activation */
|
||||
$module = $this->getModuleModel();
|
||||
if(ModuleImageQuery::create()->filterByModule($module)->count() == 0) {
|
||||
$this->deployImageFolder($module, sprintf('%s/images', __DIR__));
|
||||
$this->deployImageFolder($module, sprintf('%s/images', __DIR__), $con);
|
||||
}
|
||||
|
||||
/* set module title */
|
||||
|
||||
Reference in New Issue
Block a user