/** * Gets the URL to a path resource. * * @param string $path * @param mixed $parameters * @param mixed $referenceType * @return string */ public function getStatic($path, $parameters = [], $referenceType = UrlGenerator::ABSOLUTE_PATH) { $url = $this->file->getUrl($this->locator->get($path) ?: $path, $referenceType === self::BASE_PATH ? UrlGenerator::ABSOLUTE_PATH : $referenceType); if ($referenceType === self::BASE_PATH) { $url = substr($url, strlen($this->router->getRequest()->getBasePath())); } return $this->parseQuery($url, $parameters); }
/** * @param $uninstall * @return bool */ public function uninstall($uninstall) { foreach ((array) $uninstall as $name) { if (!($package = App::package($name))) { throw new \RuntimeException(__('Unable to find "%name%".', ['%name%' => $name])); } $this->disable($package); $this->trigger('uninstall', $this->loadScripts($package)); App::config('system')->remove('packages.' . $package->get('module')); if ($this->composer->isInstalled($package->getName())) { $this->composer->uninstall($package->getName()); } else { if (!($path = $package->get('path'))) { throw new \RuntimeException(__('Package path is missing.')); } $this->output->writeln(__("Removing package folder.")); $file = new Filesystem(); $file->delete($path); @rmdir(dirname($path)); } } }