MDL-69548 core: Adding the ZipStream library

This allows downloading of zip files as a stream, and will be used by
the Download course content project (MDL-69540).
This commit is contained in:
Michael Hawkins
2020-09-18 10:03:22 +08:00
parent ab5d361c80
commit cfe02e4d3e
21 changed files with 2149 additions and 0 deletions
@@ -0,0 +1,22 @@
<?php
declare(strict_types=1);
namespace ZipStream\Exception;
use ZipStream\Exception;
/**
* This Exception gets invoked if `fread` fails on a stream.
*/
class StreamNotReadableException extends Exception
{
/**
* Constructor of the Exception
*
* @param string $fileName - The name of the file which the stream belongs to.
*/
public function __construct(string $fileName)
{
parent::__construct("The stream for $fileName could not be read.");
}
}