src/Filesystem/Adapter/GridFS.php
protected function normalizeGridFSFile(MongoGridFSFile $file, $path = null)
	{
		$result = [
			'path' => \trim($path ?: $file->getFilename(), '/'),
			'type' => 'file',
			'size' => $file->getSize(),
			'timestamp' => $file->file['uploadDate']->sec,
		];

		$result['dirname'] = Util::dirname($result['path']);

		if (isset($file->file['metadata']) && !empty($file->file['metadata']['mimetype'])) {
			$result['mimetype'] = $file->file['metadata']['mimetype'];
		}

		return $result;
	}
protected function normalizeGridFSFile(MongoGridFSFile $file, $path = null)
	{
		$result = [
			'path' => \trim($path ?: $file->getFilename(), '/'),
			'type' => 'file',
			'size' => $file->getSize(),
			'timestamp' => $file->file['uploadDate']->sec,
		];

		$result['dirname'] = Util::dirname($result['path']);

		if (isset($file->file['metadata']) && !empty($file->file['metadata']['mimetype'])) {
			$result['mimetype'] = $file->file['metadata']['mimetype'];
		}

		return $result;
	}
protected function normalizeGridFSFile ( MongoGridFSFile $ file , $ path = null ) { $ result = [ 'path' => \ trim ( $ path ? : $ file -> getFilename ( ) , '/' ) , 'type' => 'file' , 'size' => $ file -> getSize ( ) , 'timestamp' => $ file -> file [ 'uploadDate' ] -> sec , ] ; $ result [ 'dirname' ] = Util :: dirname ( $ result [ 'path' ] ) ; if ( isset ( $ file -> file [ 'metadata' ] ) && ! empty ( $ file -> file [ 'metadata' ] [ 'mimetype' ] ) ) { $ result [ 'mimetype' ] = $ file -> file [ 'metadata' ] [ 'mimetype' ] ; } return $ result ; }
Normalize a MongoGridFs file to a response.

@param MongoGridFSFile $file
@param string          $path

@return array
Normalize a MongoGridFs file to a response .