A PHP component/library.

v1.1.0 2025-03-24 09:07 UTC

This package is auto-updated.

Last update: 2025-03-24 09:10:23 UTC


README

A PHP component/library for working with files.

Factory

Response\DownloadResponseFactory

public function createDownloadResponse(FileInterface $file): ResponseInterface 

Response\OutputResponseFactory

public function createOutputResponse(FileInterface $file): ResponseInterface

FileFactory

public function createFromPath(string $contentType, string $filePath, string $name): FileInterface 
public function createFromString(string $contentType, string $fileData, string $name): FileInterface 

Service

  • use case: database result to CSV.
  • to use with a static array: $iterator = new ArrayIterator($array);

CSV\DataCreatorService

public function createCsvDataFromIterator(Iterator $iterator, bool $useHeaderLine): string;

CSV\FileCreatorService

public function createCsvFileFromIterator(string $fileName, Iterator $iterator, bool $useHeaderLine): CSVFile 

Value object

Implement FileInterface.

File

CSVFile