webservco / file
A PHP component/library.
v0.8.0
2024-06-22 15:13 UTC
Requires
- php: ^8.3
- psr/http-factory: ^1
- psr/http-message: ^2
Requires (Dev)
- pds/skeleton: ^1
- phan/phan: ^5
- php-parallel-lint/php-console-highlighter: ^1
- php-parallel-lint/php-parallel-lint: ^1
- phpcompatibility/php-compatibility: ^9
- phpmd/phpmd: ^2
- phpstan/phpstan: ^1
- phpstan/phpstan-phpunit: ^1
- phpstan/phpstan-strict-rules: ^1
- phpunit/phpunit: ^10
- slevomat/coding-standard: ^8
- squizlabs/php_codesniffer: ^3
- vimeo/psalm: ^5
- webservco/coding-standards: ^0
- webservco/component-common: ^0
README
A PHP component/library for working with files.
Factory
Response\DownloadResponseFactory
public function createDownloadResponse(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
.