str_replace('.' . $fileinfo['extension'], '', $fileinfo['filename']), 'path' => $dir, 'extension' => $fileinfo['extension'] ); return new Media($datas); } else { return false; } } public function getlistermedia($dir, $type = "all") { if ($handle = opendir($dir)) { $list = []; while (false !== ($entry = readdir($handle))) { if ($entry != "." && $entry != "..") { $media = $this->getmedia($entry, $dir); if($media != false) { $media->analyse(); if (in_array($type, self::MEDIA_TYPES)) { if ($media->type() == $type) { $list[] = $media; } } else { $list[] = $media; } } } } } return $list; } public function listfavicon() { $glob = Model::FAVICON_DIR . '*.png'; $faviconlist = glob($glob); $count = strlen(Model::FAVICON_DIR); $faviconlist = array_map(function($input) use($count) { return substr($input, $count); }, $faviconlist); return $faviconlist; } } ?>