@@ 83-98 (lines=16) @@ | ||
80 | * @param bool $mustSortModules |
|
81 | * @return bool |
|
82 | */ |
|
83 | public function import(Module $module, $mustSortModules = true) |
|
84 | { |
|
85 | $this->log(sprintf('<info>Starting installation of %s</info>', $module->getPackage())); |
|
86 | ||
87 | if (!$this->importModule($module)) { |
|
88 | $this->log(sprintf('<error>An error occurred during the installation of %s</error>', $module->getPackage())); |
|
89 | return false; |
|
90 | } |
|
91 | ||
92 | if(!$this->installModule($module, $mustSortModules)){ |
|
93 | $this->rollbackImport($module); |
|
94 | return false; |
|
95 | } |
|
96 | ||
97 | return true; |
|
98 | } |
|
99 | ||
100 | /** |
|
101 | * @param Module $module |
|
@@ 105-120 (lines=16) @@ | ||
102 | * @param bool $mustSortModules |
|
103 | * @return bool |
|
104 | */ |
|
105 | public function update(Module $module, $mustSortModules = true) |
|
106 | { |
|
107 | $this->log(sprintf('<info>Updating %s</info>', $module->getPackage())); |
|
108 | ||
109 | if (!$this->updateModule($module)) { |
|
110 | $this->log(sprintf('<error>An error occurred during the update of %s</error>', $module->getPackage())); |
|
111 | return false; |
|
112 | } |
|
113 | ||
114 | if(!$this->installModule($module, $mustSortModules)){ //todo if dependencies are removed, we need to clean them. |
|
115 | $this->log(sprintf('<error>An error occurred. You need to clean your modules. Try to remove "%s" and re-install it.</error>', $module->getPackage())); |
|
116 | return false; |
|
117 | } |
|
118 | ||
119 | return true; |
|
120 | } |
|
121 | ||
122 | /** |
|
123 | * @param Module $module |