src/CRUDlex/StreamedFileResponse.php
public function getStreamedFileFunction($file)
    {
        return function() use ($file) {
            set_time_limit(0);
            $handle = fopen($file, 'rb');
            if ($handle !== false) {
                $chunkSize = 1024 * 1024;
                while (!feof($handle)) {
                    $buffer = fread($handle, $chunkSize);
                    echo $buffer;
                    flush();
                }
                fclose($handle);
            }
        };
    }
public function getStreamedFileFunction($file)
    {
        return function() use ($file) {
            set_time_limit(0);
            $handle = fopen($file, 'rb');
            if ($handle !== false) {
                $chunkSize = 1024 * 1024;
                while (!feof($handle)) {
                    $buffer = fread($handle, $chunkSize);
                    echo $buffer;
                    flush();
                }
                fclose($handle);
            }
        };
    }
public function getStreamedFileFunction ( $ file ) { return function ( ) use ( $ file ) { set_time_limit ( 0 ) ; $ handle = fopen ( $ file , 'rb' ) ; if ( $ handle !== false ) { $ chunkSize = 1024 * 1024 ; while ( ! feof ( $ handle ) ) { $ buffer = fread ( $ handle , $ chunkSize ) ; echo $ buffer ; flush ( ) ; } fclose ( $ handle ) ; } } ; }
Generates a lambda which is streaming the given file to standard output.

@param string $file
the filename to stream

@return \Closure
the generated lambda
Generates a lambda which is streaming the given file to standard output .