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


\type $handler = null
null
Details- Type
- \type


string $prefix = null
null
Details- Type
- string
- See
- for details
Methods


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


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


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


getUniqId() : string
Returns 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() : boolean
Returns true if this writer instance refers to file by stream reference
Type | Description |
---|---|
boolean |


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


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


saveFile(\type $dir, \type $name = null) : void
Moves 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() : boolean
Writes content into temporary file. It always creates new temp file.
Type | Description |
---|---|
boolean |
Exception | Description |
---|---|
\SdkException |