Core_Out_File
extends Core_Out
in package
File core out
$oCore_Out_File = new Core_Out_File();
$oCore_Out_File
->filePath(CMS_FOLDER . 'file.txt')
->open()
->write('content 1')
->write('content 2')
->write('content 3')
->close();
Tags
Table of Contents
Properties
- $_allowedProperties : array<string|int, mixed>
- Allowed object properties
- $_handler : resource
- File handler
- $_propertiesValues : array<string|int, mixed>
- Properties values
- $_unlimitedProperties : bool
- Object has unlimited number of properties
Methods
- __construct() : mixed
- Constructor.
- addAllowedProperties() : self
- Add additional allowed properties
- addAllowedProperty() : self
- Add additional allowed property
- close() : self
- Close file
- open() : self
- Open file
- set() : self
- Run when writing data to inaccessible properties
- setUnlimitedProperties() : self
- Set unlimitedProperties
- write() : self
- Write content into file
Properties
$_allowedProperties
Allowed object properties
protected
array<string|int, mixed>
$_allowedProperties
= array('filePath')
$_handler
File handler
protected
resource
$_handler
= \NULL
$_propertiesValues
Properties values
protected
array<string|int, mixed>
$_propertiesValues
= array()
$_unlimitedProperties
Object has unlimited number of properties
protected
bool
$_unlimitedProperties
= \FALSE
Methods
__construct()
Constructor.
public
__construct() : mixed
addAllowedProperties()
Add additional allowed properties
public
addAllowedProperties(array<string|int, mixed> $array) : self
Parameters
- $array : array<string|int, mixed>
-
array of properties' names
Return values
selfaddAllowedProperty()
Add additional allowed property
public
addAllowedProperty(string $property) : self
Parameters
- $property : string
-
property name
Return values
selfclose()
Close file
public
close() : self
Return values
selfopen()
Open file
public
open() : self
Return values
selfset()
Run when writing data to inaccessible properties
public
set(string $property, string $value) : self
Parameters
- $property : string
-
property name
- $value : string
-
property value
Return values
selfsetUnlimitedProperties()
Set unlimitedProperties
public
setUnlimitedProperties([bool $value = TRUE ]) : self
Parameters
- $value : bool = TRUE
-
default TRUR
Return values
selfwrite()
Write content into file
public
write(string $content) : self
Parameters
- $content : string
-
content