Write data directly to the process stdout. This is useful for streaming data to web clients without buffering in memory.
Note: Stdout is write-only—reading is not supported.
composer require flow-php/etl ~0.33.0 Read from various data sources.
Shape and optimize for your needs.
Store and secure in one of many available data sinks.
Write data directly to the process stdout. This is useful for streaming data to web clients without buffering in memory.
Note: Stdout is write-only—reading is not supported.
<?php
declare(strict_types=1);
use function Flow\Filesystem\DSL\{fstab, path, protocol};
require __DIR__ . '/vendor/autoload.php';
$outputStream = fstab()->for(protocol('stdout'))->writeTo(path('stdout://'));
$outputStream->append("Files List\n\n");
foreach (fstab()->for(protocol('file'))->list(path(__DIR__ . '/*')) as $file) {
$outputStream->append(($file->isFile() ? 'File' : 'Directory') . ': ' . $file->path->basename() . "\n");
}
$outputStream->close();