Writer
Writes stuff to the filesystem.
Constructors / Destructors
| Returns | Signature and Description |
|---|---|
void | __construct()Creates a new Writer. |
Instance Methods
| Returns | Signature and Description |
|---|---|
void | copy(, )Copies a file from one place to another. |
void | mkdir()Creates a directory; does nothing if path already exists |
Awaitable<mixed> | write(, )Writes a file. |
Method Details
__construct
public function
__construct(LoggerInterface $logger)Creates a new Writer.
| Name | Type | Description |
|---|---|---|
$logger | LoggerInterface | The logger |
copy
public function
copy(string $source, string $destination)Copies a file from one place to another.
| Name | Type | Description |
|---|---|---|
$source | string | The source file |
$destination | string | The destination |
mkdir
public function
mkdir(string $path)Creates a directory; does nothing if path already exists
| Name | Type | Description |
|---|---|---|
$path | string | The path to create |
| Type | Conditions |
|---|---|
IoException | if anything goes wrong or if $path is a file |
write
public function
write(string $filename, XHPRoot $contents)Writes a file.
| Name | Type | Description |
|---|---|---|
$filename | string | The file to write |
$contents | XHPRoot | The contents to export |
| Type | Description |
|---|---|
Awaitable<mixed> |
| Type | Conditions |
|---|---|
IoException | if anything goes wrong |