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;
}