get uninstall pathes

@param String $name
@param String $directory
@return array
352550
protected function uninstallPathes($name, $directory = 'migrations')
    {
        $package = $this->manager->getAvailableExtensions()->findByName($name);

        if ($package === null) {
            return [];
        }

        $basePath = $package->getPath();

        return [
            "{$basePath}/resources/database/{$directory}/",
            "{$basePath}/resources/{$directory}/",
            "{$basePath}/src/{$directory}/",
        ];
    }
394237
public function directories($directory)
    {
        $directories = [];

        foreach (Finder::create()->in($directory)->directories()->depth(0)->sortByName() as $dir) {
            $directories[] = $dir->getPathname();
        }

        return $directories;
    }
1184112
protected function _joinPath($dir, $name) {
		$sql = 'SELECT id FROM '.$this->tbf.' WHERE parent_id="'.$dir.'" AND name="'.$this->db->real_escape_string($name).'"';

		if (($res = $this->query($sql)) && ($r = $res->fetch_assoc())) {
			$this->updateCache($r['id'], $this->_stat($r['id']));
			return $r['id'];
		}
		return -1;
	}
48845
public function move($directory, $name = null)
    {
        if (! is_dir($directory)) {
            if (false === @mkdir($directory, 0777, true)) {
                throw new \RuntimeException(sprintf('Unable to create the "%s" directory', $directory));
            }
        } elseif (! is_writable($directory)) {
            throw new \RuntimeException(sprintf('Unable to write in the "%s" directory', $directory));
        }

        $target = $directory.DIRECTORY_SEPARATOR.(null === $name ? $this->getBasename() : basename($name));

        if (! @rename($this->getPathname(), $target)) {
            $error = error_get_last();
            throw new \RuntimeException(sprintf('Could not move the file "%s" to "%s" (%s)', $this->getPathname(), $target, strip_tags($error['message'])));
        }

        chmod($target, 0666);

        return new File($target);
    }
223178
public function removeLibraryPath($directory)
	{
		if (($key = array_search($directory, $this->libraryPaths)) !== false) 
		{
		    unset($this->libraryPaths[$key]);
		}
	}
107299
public function uninstall($name)
    {
        if (!isset($this->items[$name]))
        {
            $this->load($name);
        }
        if (isset($this->items[$name]))
        {
            /** @var Eresus_Plugin $plugin */
            $plugin = $this->items[$name];
            $plugin->uninstall();
        }
        $item = Eresus_CMS::getLegacyKernel()->db->selectItem('plugins', "`name`='".$name."'");
        if (!is_null($item))
        {
            Eresus_CMS::getLegacyKernel()->db->delete('plugins', "`name`='".$name."'");
        }
        //$filename = filesRoot.'ext/'.$name.'.php';
        //if (file_exists($filename)) unlink($filename);
    }
673761
public function uninstall($name, $delete = false, $unmigrate = true, $unseed = true, $unpublish = true)
    {
        // Check if installed
        if (!$this->installed($name)) {
            throw new Exceptions\HookNotInstalledException("Hook [{$name}] is not installed.");
        }

        $hook = $this->hook($name);

        $hook->loadJson();

        event(new Events\UninstallingHook($hook));

        if ($this->enabled($name)) {
            event(new Events\DisablingHook($hook));

            // Some logic could later be placed here

            event(new Events\DisabledHook($hook));
        }

        if ($unseed) {
            $this->unseedHook($hook);
        }

        if ($unmigrate) {
            $this->unmigrateHook($hook);
        }

        if ($unpublish) {
            $this->unpublishHook($hook);
        }

        $this->runComposer([
            'command'  => 'remove',
            'packages' => [$name],
        ]);

        $hooks = $this->hooks()->where('name', '!=', $name);
        $this->hooks = $hooks;

        $this->remakeJson();

        event(new Events\UninstalledHook($name));

        if ($delete && $hook->isLocal()) {
            $this->filesystem->deleteDirectory(base_path("hooks/{$name}"));
        }
    }
1278110
protected function createHelper($name, $directory)
    {
        $file = $this->createDirectoryFor(
            $dir = $directory . DIRECTORY_SEPARATOR . "Helper",
            "$name.php"
        ) . "$name.php";

        $gen = new Lib\Generator\Helper($name, $this->namespace);
        // generate helper
        $this->createFile(
            $file,
            $gen->produce()
        );
        require_once $file;
        $this->sayInfo("$name helper has been created in $dir");
    }
1207882
public function files($directory)
    {
        $this->checkDirectory($directory);

        $disk = $this->disk();

        // TODO: Add a feature to exclude unwanted files.
        $files = array_map(function ($filePath) use ($disk, $directory) {
            return [
                'name'         => str_replace("$directory/", '', $filePath),
                'path'         => $filePath,
                'url'          => $disk->url($filePath),
                'mimetype'     => $disk->mimeType($filePath),
                'lastModified' => Carbon::createFromTimestamp($disk->lastModified($filePath))->toDateTimeString(),
                'visibility'   => $disk->getVisibility($filePath),
                'size'         => $disk->size($filePath),
            ];
        }, $disk->files($directory));

        return FileCollection::make($files)->exclude($this->getExcludedFiles());
    }
1039601
public function removeConfigPath($directory)
    {
        if (($key = array_search($directory, $this->configPaths)) !== false) 
        {
            unset($this->configPaths[$key]);
        }
    }
677763
public function uninstall($id)
    {
        $plugin = $this->getById($id);
        if (!$plugin) {
            return ['code' => -3, 'message' => 'Plugin not found'];
        }

        if (!$this->isInstalled($id)) {
            return ['code' => -4, 'message' => 'Plugin not installed'];
        }

        if ($this->isBuildIn($id)) {
            return ['code' => -5, 'message' => 'Can not uninstall build-in plugin'];
        }

        $ret = $plugin->uninstall();
        if ($ret['code'] !== 1) {
            return $ret;
        }

        $pluginIds = $this->getInstalledIds();
        $key = array_search($id, $pluginIds);
        if (false === $key) {
            return ['code' => -6, 'message' => 'Plugin not installed'];
        }
        unset($pluginIds[$key]);
        $this->setInstalledIds($pluginIds);

        $this->getEvents(true);

        return $ret;
    }
84857
function uninstalledVer(name, ver, dir) {
        var _child$spawnSync4 = _child_process2['default'].spawnSync(npmCommand, ['uninstall', ver.length === 0 ? name : name + '@' + ver], { cwd: dir });

        var error = _child$spawnSync4.error;

        if (error) throw error;
    }
250986
protected function _mkdir($path, $name) {
		$path = $path.DIRECTORY_SEPARATOR.$name;

		if (@mkdir($path)) {
			@chmod($path, $this->options['dirMode']);
			return $path;
		}

		return false;
	}
575147
private function getDirectories($dir, $directoryName = null)
    {
        $finder = new Finder();
        $finder->directories()->in($dir);

        if (null !== $directoryName) {
            $finder->name($directoryName);
        }

        if (iterator_count($finder) > 0) {
            return iterator_to_array($finder);
        }

        return false;
    }
109833
public function removeDirectory(string $directory)
    {
        $search = rtrim(strtr($directory, '\\', '/'), '/');

        return $this->setDirectories(array_filter($this->getDirectories(), function ($item) use ($search) {
            return rtrim(strtr($item, '\\', '/'), '/') !== $search;
        }));
    }
774806
public static function cleanDirectory(string $directory): bool
    {
        self::removeDirectory($directory);
        return self::createDirectory($directory);
    }
1137876
public function move($directory, $name = null)
    {
        $target = $this->getTargetFile($directory, $name);

        set_error_handler(function ($type, $msg) use (&$error) { $error = $msg; });
        $renamed = rename($this->getPathname(), $target);
        restore_error_handler();
        if (!$renamed) {
            throw new FileException(sprintf('Could not move the file "%s" to "%s" (%s)', $this->getPathname(), $target, strip_tags($error)));
        }

        @chmod($target, 0666 & ~umask());

        return $target;
    }