A PHP component/library.

v1.2.0 2025-07-14 13:57 UTC

This package is auto-updated.

Last update: 2025-07-14 13:59:35 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

# General
public function createFromPath(string $contentType, string $filePath, string $name): FileInterface; 

# CSV
public function createCSVFromPath(string $filePath, string $name): FileInterface;

# PDF
public function createPdfFromPath(string $filePath, string $name): FileInterface;
# General
public function createFromString(string $contentType, string $fileData, string $name): FileInterface;

# CSV
public function createCSVFromString(string $fileData, string $name): FileInterface;

# PDF
public function createPdfFromString(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