/var/www/vhosts/ihelp.ro/httpdocs/vendor/mirko-pagliai/php-thumber/src
NameSizeModeActions
Exception/-0755rm
TestSuite/-0755rm
ThumbCreator.php115400644editdlrm
ThumbManager.php33620644editdlrm
Edit: /var/www/vhosts/ihelp.ro/httpdocs/vendor/mirko-pagliai/php-thumber/src/ThumbManager.php (3362B)
concatenate(THUMBER_TARGET, $filename); Filesystem::instance()->remove(Exceptionist::isReadable($filename)); }); return count($filenames); } /** * Internal method to find thumbnails * @param string $pattern A pattern (a regexp, a glob, or a string) * @param bool $sort Whether results should be sorted * @return string[] Filenames */ protected function _find(string $pattern = '', bool $sort = false): array { $pattern = $pattern ?: sprintf('/[\d\w]{32}_[\d\w]{32}\.(%s)$/', implode('|', self::SUPPORTED_FORMATS)); $finder = (new Finder())->files()->name($pattern)->in(THUMBER_TARGET); return array_map(fn(SplFileInfo $file): string => $file->getFilename(), iterator_to_array($sort ? $finder->sortByName() : $finder)); } /** * Clears all thumbnails that have been generated from an image path * @param string $path Path of the original image * @return int Number of thumbnails deleted * @throws \Tools\Exception\NotReadableException */ public function clear(string $path): int { return $this->_clear($this->get($path)); } /** * Clears all thumbnails * @return int Number of thumbnails deleted * @throws \Tools\Exception\NotReadableException */ public function clearAll(): int { return $this->_clear($this->getAll()); } /** * Gets all thumbnails that have been generated from an image path * @param string $path Path of the original image * @param bool $sort Whether results should be sorted * @return string[] * @throws \Tools\Exception\NotReadableException */ public function get(string $path, bool $sort = false): array { $pattern = sprintf('/%s_[\d\w]{32}\.(%s)$/', md5(Exceptionist::isReadable($path)), implode('|', self::SUPPORTED_FORMATS)); return $this->_find($pattern, $sort); } /** * Gets all thumbnails * @param bool $sort Whether results should be sorted * @return string[] */ public function getAll(bool $sort = false): array { return $this->_find('', $sort); } }