コード例 #1
0
 /**
  * Get all thumbnail names previously generated for this file
  * @param string|bool $archiveName Name of an archive file, default false
  * @return array first element is the base dir, then files in that base dir.
  */
 function getThumbnails($archiveName = false)
 {
     if ($archiveName) {
         $dir = $this->getArchiveThumbPath($archiveName);
     } else {
         $dir = $this->getThumbPath();
     }
     $backend = $this->repo->getBackend();
     $files = array($dir);
     $iterator = $backend->getFileList(array('dir' => $dir));
     foreach ($iterator as $file) {
         $files[] = $file;
     }
     return $files;
 }
コード例 #2
0
ファイル: LocalFile.php プロジェクト: nahoj/mediawiki_ynh
	/**
	 * Get all thumbnail names previously generated for this file
	 * @param string|bool $archiveName Name of an archive file, default false
	 * @return array first element is the base dir, then files in that base dir.
	 */
	function getThumbnails( $archiveName = false ) {
		if ( $archiveName ) {
			$dir = $this->getArchiveThumbPath( $archiveName );
		} else {
			$dir = $this->getThumbPath();
		}

		$backend = $this->repo->getBackend();
		$files = array( $dir );
		try {
			$iterator = $backend->getFileList( array( 'dir' => $dir ) );
			foreach ( $iterator as $file ) {
				$files[] = $file;
			}
		} catch ( FileBackendError $e ) {} // suppress (bug 54674)

		return $files;
	}