Add a simple utility class that can be used to find media files (video and archives) from a directory tree.
9 lines
1.4 KiB
PHP
9 lines
1.4 KiB
PHP
<?php
|
|
|
|
class DownloadDispatcher_Utility_MediaFilesIterator extends FilterIterator {
|
|
public function accept() {
|
|
return preg_match('/(?<!\.sample)\.(?:avi|ogm|m4v|mkv|mov|mp4|mpg|srt|rar)$/i', $this->current()->getFilename());
|
|
}
|
|
}
|
|
|
|
?>
|