Lines Matching refs:extension

3 namespace dokuwiki\plugin\extension;
78 $extension = Extension::createFromId($id);
79 if ($skipInstalled && $extension->isInstalled()) return;
80 $this->installExtension($extension);
88 * @param Extension $extension
91 public function installExtension(Extension $extension) argument
93 $url = $extension->getDownloadURL();
95 throw new Exception('error_nourl', [$extension->getId()]);
156 foreach ($extensions as $extension) {
158 if ($extension->isInstalled()) {
160 $this->processed[$extension->getId()] = self::STATUS_SKIPPED;
169 self::ensurePhpCompatibility($extension);
172 foreach ($extension->getDependencyList() as $id) {
174 if ($id == $extension->getId()) continue; // avoid circular dependencies
179 self::ensurePermissions($extension);
181 $extension->getCurrentDir(),
182 $extension->getInstallDir()
185 $extension->getManager()->storeUpdate($this->sourceUrl);
186 $this->removeDeletedFiles($extension);
187 $this->processed[$extension->getId()] = $status;
196 * @param Extension $extension
199 public function uninstall(Extension $extension) argument
201 if (!$extension->isInstalled()) {
202 throw new Exception('error_notinstalled', [$extension->getId()]);
205 if ($extension->isProtected()) {
206 throw new Exception('error_uninstall_protected', [$extension->getId()]);
209 self::ensurePermissions($extension);
211 $dependants = $extension->getDependants();
213 …throw new Exception('error_uninstall_dependants', [$extension->getId(), implode(', ', $dependants)…
216 if (!io_rmdir($extension->getInstallDir(), true)) {
217 throw new Exception('msg_delete_failed', [$extension->getId()]);
221 $this->processed[$extension->getId()] = self::STATUS_REMOVED;
229 public function enable(Extension $extension) argument
231 if ($extension->isTemplate()) throw new Exception('notimplemented');
232 … if (!$extension->isInstalled()) throw new Exception('error_notinstalled', [$extension->getId()]);
233 … if ($extension->isEnabled()) throw new Exception('error_alreadyenabled', [$extension->getId()]);
237 if (!$plugin_controller->enable($extension->getBase())) {
248 public function disable(Extension $extension) argument
250 if ($extension->isTemplate()) throw new Exception('notimplemented');
251 … if (!$extension->isInstalled()) throw new Exception('error_notinstalled', [$extension->getId()]);
252 … if (!$extension->isEnabled()) throw new Exception('error_alreadydisabled', [$extension->getId()]);
253 …if ($extension->isProtected()) throw new Exception('error_disable_protected', [$extension->getId()…
255 $dependants = $extension->getDependants();
257 …throw new Exception('error_disable_dependants', [$extension->getId(), implode(', ', $dependants)]);
262 if (!$plugin_controller->disable($extension->getBase())) {
333 public function removeDeletedFiles(Extension $extension) argument
335 $extensiondir = $extension->getInstallDir();
383 * @param Extension $extension
386 public static function ensurePhpCompatibility(Extension $extension) argument
388 $min = $extension->getMinimumPHPVersion();
390 throw new Exception('error_minphp', [$extension->getId(), $min, PHP_VERSION]);
393 $max = $extension->getMaximumPHPVersion();
395 throw new Exception('error_maxphp', [$extension->getId(), $max, PHP_VERSION]);
404 public static function ensurePermissions(Extension $extension) argument
406 $target = $extension->getInstallDir();
409 if ($extension->isBundled()) {
422 if ($extension->isTemplate()) throw new Exception('notplperms');