| 1 |
<?php |
| 2 |
|
| 3 |
namespace Shellbox\Command; |
| 4 |
|
| 5 |
use Shellbox\Multipart\MultipartReader; |
| 6 |
use Shellbox\ShellboxError; |
| 7 |
|
| 8 |
/** |
| 9 |
* An OutputFile which carries its contents for eventual retrieval. |
| 10 |
* |
| 11 |
* @since 4.1.0 |
| 12 |
*/ |
| 13 |
abstract class OutputFileWithContents extends OutputFile { |
| 14 |
|
| 15 |
/** |
| 16 |
* Copy from the specified source path to the registered destination |
| 17 |
* location, which may be either a string or a path outside the working |
| 18 |
* directory. |
| 19 |
* |
| 20 |
* @internal |
| 21 |
* @param string $sourcePath |
| 22 |
*/ |
| 23 |
abstract public function copyFromFile( $sourcePath ); |
| 24 |
|
| 25 |
/** |
| 26 |
* Get the contents of the output file from its final destination. This |
| 27 |
* should be called after copyFromFile() or readFromMultipart(). It will |
| 28 |
* throw if the file is not readable. |
| 29 |
* |
| 30 |
* @internal |
| 31 |
* @return string |
| 32 |
* @throws ShellboxError |
| 33 |
*/ |
| 34 |
abstract public function getContents(); |
| 35 |
|
| 36 |
/** |
| 37 |
* Copy from the MultipartReader to the registered destination location. |
| 38 |
* The MultipartReader must be at the appropriate place in the input stream. |
| 39 |
* Used by the client. |
| 40 |
* |
| 41 |
* @internal |
| 42 |
* @param MultipartReader $multipartReader |
| 43 |
*/ |
| 44 |
abstract public function readFromMultipart( MultipartReader $multipartReader ); |
| 45 |
|
| 46 |
} |