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();
|
$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 {
|
try {
|
||||||
$directoryBrowser = new \DirectoryIterator($folderPath);
|
$directoryBrowser = new \DirectoryIterator($folderPath);
|
||||||
} catch (\UnexpectedValueException $e) {
|
} catch (\UnexpectedValueException $e) {
|
||||||
throw $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 */
|
/* browse the directory */
|
||||||
$imagePosition = 1;
|
$imagePosition = 1;
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ class Cheque extends BaseModule implements PaymentModuleInterface
|
|||||||
/* insert the images from image folder if first module activation */
|
/* insert the images from image folder if first module activation */
|
||||||
$module = $this->getModuleModel();
|
$module = $this->getModuleModel();
|
||||||
if(ModuleImageQuery::create()->filterByModule($module)->count() == 0) {
|
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 */
|
/* set module title */
|
||||||
|
|||||||
Reference in New Issue
Block a user