Firebase
in package
[$firebase = $this->core->loadClass('Firebase');] Class to facilitate Firebase integration
Table of Contents
Properties
- $error : mixed
- $errorMsg : mixed
- $_baseURI : mixed
- $_curlHandler : mixed
- $_timeout : mixed
- $_token : mixed
- $core : mixed
Methods
- __construct() : mixed
- Constructor
- closeCurlHandler() : void
- Closing the CURL handler
- delete() : array<string|int, mixed>
- Deletes data from Firebase HTTP 204: Ok
- get() : array<string|int, mixed>
- Reading data from Firebase HTTP 200: Ok
- initCurlHandler() : void
- Initializing the CURL handler
- push() : array<string|int, mixed>
- Pushing data into Firebase with a POST request HTTP 200: Ok
- set() : array<string|int, mixed>
- Writing data into Firebase with a PUT request HTTP 200: Ok
- setBaseURI() : void
- Sets Base URI, ex: http://yourcompany.firebase.com/youruser
- setTimeOut() : void
- Sets REST call timeout in seconds
- setToken() : void
- Sets Token
- update() : array<string|int, mixed>
- Updating data into Firebase with a PATH request HTTP 200: Ok
- _getCurlHandler() : resource
- Returns with Initialized CURL Handler
- _getJsonPath() : string
- Returns with the normalized JSON absolute path
- _writeData() : mixed
- addError() : mixed
Properties
$error
public
mixed
$error
= \false
$errorMsg
public
mixed
$errorMsg
= []
$_baseURI
private
mixed
$_baseURI
$_curlHandler
private
mixed
$_curlHandler
$_timeout
private
mixed
$_timeout
$_token
private
mixed
$_token
$core
private
mixed
$core
Methods
__construct()
Constructor
public
__construct(Core7 &$core[, mixed $config = [] ]) : mixed
Parameters
- $core : Core7
- $config : mixed = []
closeCurlHandler()
Closing the CURL handler
public
closeCurlHandler() : void
delete()
Deletes data from Firebase HTTP 204: Ok
public
delete(string $path[, array<string|int, mixed> $options = array() ]) : array<string|int, mixed>
Parameters
- $path : string
-
Path
- $options : array<string|int, mixed> = array()
-
Options
Return values
array<string|int, mixed> —Response
get()
Reading data from Firebase HTTP 200: Ok
public
get(string $path[, array<string|int, mixed> $options = array() ]) : array<string|int, mixed>
Parameters
- $path : string
-
Path
- $options : array<string|int, mixed> = array()
-
Options
Return values
array<string|int, mixed> —Response
initCurlHandler()
Initializing the CURL handler
public
initCurlHandler() : void
push()
Pushing data into Firebase with a POST request HTTP 200: Ok
public
push(string $path, mixed $data[, array<string|int, mixed> $options = array() ]) : array<string|int, mixed>
Parameters
- $path : string
-
Path
- $data : mixed
-
Data
- $options : array<string|int, mixed> = array()
-
Options
Return values
array<string|int, mixed> —Response
set()
Writing data into Firebase with a PUT request HTTP 200: Ok
public
set(string $path, mixed $data[, array<string|int, mixed> $options = array() ]) : array<string|int, mixed>
Parameters
- $path : string
-
Path
- $data : mixed
-
Data
- $options : array<string|int, mixed> = array()
-
Options
Return values
array<string|int, mixed> —Response
setBaseURI()
Sets Base URI, ex: http://yourcompany.firebase.com/youruser
public
setBaseURI(string $baseURI) : void
Parameters
- $baseURI : string
-
Base URI
setTimeOut()
Sets REST call timeout in seconds
public
setTimeOut(int $seconds) : void
Parameters
- $seconds : int
-
Seconds to timeout
setToken()
Sets Token
public
setToken(string $token) : void
Parameters
- $token : string
-
Token
update()
Updating data into Firebase with a PATH request HTTP 200: Ok
public
update(string $path, mixed $data[, array<string|int, mixed> $options = array() ]) : array<string|int, mixed>
Parameters
- $path : string
-
Path
- $data : mixed
-
Data
- $options : array<string|int, mixed> = array()
-
Options
Return values
array<string|int, mixed> —Response
_getCurlHandler()
Returns with Initialized CURL Handler
private
_getCurlHandler(string $path, string $mode[, array<string|int, mixed> $options = array() ]) : resource
Parameters
- $path : string
-
Path
- $mode : string
-
Mode
- $options : array<string|int, mixed> = array()
-
Options
Return values
resource —Curl Handler
_getJsonPath()
Returns with the normalized JSON absolute path
private
_getJsonPath(string $path[, array<string|int, mixed> $options = array() ]) : string
Parameters
- $path : string
-
Path
- $options : array<string|int, mixed> = array()
-
Options
Return values
string_writeData()
private
_writeData(mixed $path, mixed $data[, mixed $method = 'PUT' ][, mixed $options = array() ]) : mixed
Parameters
- $path : mixed
- $data : mixed
- $method : mixed = 'PUT'
- $options : mixed = array()
addError()
private
addError(mixed $msg) : mixed
Parameters
- $msg : mixed