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()]);
97 $this->installFromUrl($url, $extension->getBase());
153 foreach ($extensions as $extension) {
155 if ($extension->isInstalled()) {
157 $this->processed[$extension->getId()] = self::STATUS_SKIPPED;
166 self::ensurePhpCompatibility($extension);
169 foreach ($extension->getDependencyList() as $id) {
171 if ($id == $extension->getId()) continue; // avoid circular dependencies
176 self::ensurePermissions($extension);
178 $extension->getCurrentDir(),
179 $extension->getInstallDir()
182 $extension->getManager()->storeUpdate($this->sourceUrl);
183 $this->removeDeletedFiles($extension);
184 $this->processed[$extension->getId()] = $status;
193 * @param Extension $extension
196 public function uninstall(Extension $extension) argument
198 if (!$extension->isInstalled()) {
199 throw new Exception('error_notinstalled', [$extension->getId()]);
202 if ($extension->isProtected()) {
203 throw new Exception('error_uninstall_protected', [$extension->getId()]);
206 self::ensurePermissions($extension);
208 $dependants = $extension->getDependants();
210 …throw new Exception('error_uninstall_dependants', [$extension->getId(), implode(', ', $dependants)…
213 if (!io_rmdir($extension->getInstallDir(), true)) {
214 throw new Exception('msg_delete_failed', [$extension->getId()]);
218 $this->processed[$extension->getId()] = self::STATUS_REMOVED;
226 public function enable(Extension $extension) argument
228 if ($extension->isTemplate()) throw new Exception('notimplemented');
229 … if (!$extension->isInstalled()) throw new Exception('error_notinstalled', [$extension->getId()]);
230 … if ($extension->isEnabled()) throw new Exception('error_alreadyenabled', [$extension->getId()]);
234 if (!$plugin_controller->enable($extension->getBase())) {
245 public function disable(Extension $extension) argument
247 if ($extension->isTemplate()) throw new Exception('notimplemented');
248 … if (!$extension->isInstalled()) throw new Exception('error_notinstalled', [$extension->getId()]);
249 … if (!$extension->isEnabled()) throw new Exception('error_alreadydisabled', [$extension->getId()]);
250 …if ($extension->isProtected()) throw new Exception('error_disable_protected', [$extension->getId()…
252 $dependants = $extension->getDependants();
254 …throw new Exception('error_disable_dependants', [$extension->getId(), implode(', ', $dependants)]);
259 if (!$plugin_controller->disable($extension->getBase())) {
330 public function removeDeletedFiles(Extension $extension) argument
332 $extensiondir = $extension->getInstallDir();
380 * @param Extension $extension
383 public static function ensurePhpCompatibility(Extension $extension) argument
385 $min = $extension->getMinimumPHPVersion();
387 throw new Exception('error_minphp', [$extension->getId(), $min, PHP_VERSION]);
390 $max = $extension->getMaximumPHPVersion();
392 throw new Exception('error_maxphp', [$extension->getId(), $max, PHP_VERSION]);
401 public static function ensurePermissions(Extension $extension) argument
403 $target = $extension->getInstallDir();
406 if ($extension->isBundled()) {
419 if ($extension->isTemplate()) throw new Exception('notplperms');