Airship\Cabin\Bridge\Blueprint\Skyport::removeMotif PHP Method

removeMotif() protected method

Remove a motif
protected removeMotif ( array $info ) : string
$info array
return string
    protected function removeMotif(array $info) : string
    {
        $ret = '';
        foreach (\glob(ROOT . '/Cabin/*') as $cabinDir) {
            if (!\is_dir($cabinDir)) {
                continue;
            }
            $cabin = \Airship\path_to_filename($cabinDir);
            // The cache file has a combined
            $pathInfo = $this->getMotifPath($cabin, $info);
            if (empty($pathInfo)) {
                continue;
            }
            $ret .= "\tRemoving motif from {$cabin}.\n";
            list($key, $path) = $pathInfo;
            $this->deleteMotifFromCabin($cabin, $key);
            if (\is_dir(ROOT . '/Motifs/' . $path)) {
                $ret .= \shell_exec('rm -rf ' . \escapeshellarg(ROOT . '/Motifs/' . $path));
                \clearstatcache();
            }
            if (\is_link(ROOT . '/Cabin/' . $cabin . '/Lens/motif/' . $key)) {
                \unlink(ROOT . '/Cabin/' . $cabin . '/Lens/motif/' . $key);
            }
        }
        return $ret;
    }