Core/ContentWriter.php
- Package
- Default
\ContentWriter
- Author
- amatiushkin
Properties

\type $handler = nullnullDetails- Type
- \type

string $prefix = nullnullDetails- Type
- string
- See
- for details
Methods

createTempFile() : stringCreates temporary file in system temporary folder.
| Type | Description |
|---|---|
| string | path |

generateFileName(\type $name) : \typeCreates filename based on name and prefix.
| Name | Type | Description |
|---|---|---|
| $name | \type |
| Type | Description |
|---|---|
| \type |

getHandler() : resourceReturns file handler to temporary file It is the same kind as ones, which are returned by @see fopen()
| Type | Description |
|---|---|
| resource |

getUniqId() : stringReturns unique filename with prefix (if applicable) note: This method is not intented to generate unpredictable strings, even with very low likelihood it may happen with garbaged tmp folder.
| Type | Description |
|---|---|
| string |

isHandler() : booleanReturns true if this writer instance refers to file by stream reference
| Type | Description |
|---|---|
| boolean |

resetContent() : voidDeletes content, however everything else remains available This method is intented to use for better memory management

saveAsHandler() : voidWrites content into temporary file and returns open handler to it.
| Exception | Description |
|---|---|
| \SdkException |

saveFile(\type $dir, \type $name = null) : voidMoves file from temp location to specified folder and name
| Name | Type | Description |
|---|---|---|
| $dir | \type | |
| $name | \type | (option) if not speicifed it will be moved with temp name |
| Exception | Description |
|---|---|
| \SdkException |

saveTemp() : booleanWrites content into temporary file. It always creates new temp file.
| Type | Description |
|---|---|
| boolean |
| Exception | Description |
|---|---|
| \SdkException |