'caches', 'name' => __('Cache'), 'desc' => __('Folders from cache directory'), ]; } protected function actions(): array { return [ new ActionDescriptor([ 'id' => 'delete', 'query' => __('delete "%s" cache directory'), 'success' => __('"%s" cache directory deleted'), 'error' => __('Failed to delete "%s" cache directory'), ]), new ActionDescriptor([ 'id' => 'empty', 'query' => __('empty "%s" cache directory'), 'success' => __('"%s" cache directory emptied'), 'error' => __('Failed to empty "%s" cache directory'), ]), ]; } public function distributed(): array { return ['cbfeed', 'cbtpl', 'dcrepo', 'versions']; } public function values(): array { return self::getDirs(DC_TPL_CACHE); } public function execute(string $action, string $ns): bool { if ($action == 'empty') { self::delDir(DC_TPL_CACHE, $ns, false); return true; } if ($action == 'delete') { self::delDir(DC_TPL_CACHE, $ns, true); return true; } return false; } }