Documentation

Globals extends ContainerAwareObject
in package

Global utils functions Helper Class

Table of Contents

Properties

$translators  : array<string|int, mixed>
$container  : ContainerInterface

Methods

__call()  : mixed
{@inheritdoc}
__construct()  : mixed
constructor
addQueueMessage()  : QueueMessage
adds message to queue
array2csv()  : string|false
gets csv string from array
blockedIpPage()  : Response
returns a blocked ip exception error page
checkPass()  : bool
checks password
containerCall()  : mixed
call method through container
containerMake()  : mixed
create object through container
csv2array()  : array<string|int, mixed>
gets csv contents as array
errorPage()  : Response
return an error page
exceptionJson()  : Response
returns an exception error json
exceptionPage()  : Response
returns a exception error page
exceptionXML()  : Response
returns an exception error xml
getApp()  : App
gets app object
getApplicationLogger()  : Manager
gets application_logger service
getAppRouteInfo()  : RouteInfo|null
gets route info
getAppWebsite()  : Website|null
gets current website
getAssets()  : Manager
gets assets manager
getCache()  : Manager
get cache manager
getContainer()  : ContainerInterface
gets container object
getCrudRouter()  : Crud
gets crud service
getDb()  : Database
gets db object
getDebugbar()  : StandardDebugBar
gets debugbar object
getEmptyRouteInfo()  : RouteInfo
gets an empty RouteInfo object
getEncodedPass()  : string
gets encoded version of password
getEnv()  : mixed
gets env variable
getEventManager()  : SharedEventEmitter
gets events manager service
getGoogleAuthenticator()  : PHPGangsta_GoogleAuthenticator
gets google authenticator service
getGuzzle()  : Client
gets guzzle service
getHtmlRenderer()  : HtmlPartsRenderer
gets html renderer service
getIcons()  : Icons
gets icons service
getImagine()  : Imagine
gets imagine service
getLog()  : Logger
gets log object
getMailer()  : Mailer
gets mailer service
getPdo()  : PDO
gets PDO object
getRedis()  : Manager
gets redis service
getRequest()  : Request
gets current request object
getRouters()  : array<string|int, mixed>
gets routers
getSchema()  : Schema
gets schema object
getSearch()  : Manager
gets search service
getSesMailer()  : SesClient
gets SES mailer service
getSiteData()  : SiteData
gets site data service
getSiteLanguagesSelectOptions()  : array<string|int, mixed>
gets site languages options for selects
getSmtpMailer()  : Swift_Mailer
gets SMTP mailer service
getTemplates()  : Engine
gets plates engine object
getToken()  : Token|null
gets Authorization token Object
getTokenHeader()  : string|null
gets Authorization token header
getTokenUserDataClaim()  : mixed
gets token data
getTranslator()  : Translator
gets translator
getUtils()  : Globals
gets global utils service
getWebhooksRouter()  : Webhooks
gets webhooks service
getWebRouter()  : Web
gets routing service
getWebsitesSelectOptions()  : array<string|int, mixed>
gets websites options for selects
getWrappedMailBody()  : string
getZip()  : Zip
gets zip service
httpRequest()  : mixed
executes an http request
logException()  : void
logs an exception
offlinePage()  : Response
returns a "site is offline" error page
queueContactFormMail()  : QueueMessage
queueInternalMail()  : QueueMessage
queueLinksFormMail()  : QueueMessage
randString()  : string
computes a random string
requestUrl()  : string|bool
executes an http request
translate()  : string
translates a string
getService()  : mixed
gets registered service
logRequestIfNeeded()  : void
logs request (if needed)
queueMail()  : QueueMessage

Properties

$translators

public static array<string|int, mixed> $translators = []

translators

Methods

__construct()

constructor

public __construct(ContainerInterface $container) : mixed
Parameters
$container : ContainerInterface

addQueueMessage()

adds message to queue

public addQueueMessage(string $queue_name, mixed $data) : QueueMessage
Parameters
$queue_name : string
$data : mixed
Tags
throws
BasicException
throws
DependencyException
throws
NotFoundException
Return values
QueueMessage

array2csv()

gets csv string from array

public array2csv(array<string|int, mixed> $data[, array<string|int, mixed> $header = [] ][, string $delimiter = ',' ][, string $enclosure = '"' ][, string $escape_char = "\" ]) : string|false
Parameters
$data : array<string|int, mixed>
$header : array<string|int, mixed> = []
$delimiter : string = ','
$enclosure : string = '"'
$escape_char : string = "\"
Return values
string|false

blockedIpPage()

returns a blocked ip exception error page

public blockedIpPage(Request $request[, RouteInfo|null $route_info = null ]) : Response
Parameters
$request : Request
$route_info : RouteInfo|null = null
Tags
throws
BasicException
throws
PhpfastcacheSimpleCacheException
throws
Throwable
throws
DependencyException
throws
NotFoundException
Return values
Response

checkPass()

checks password

public checkPass(string $pass, string $encoded_pass) : bool
Parameters
$pass : string
$encoded_pass : string
Return values
bool

containerCall()

call method through container

public containerCall(callable $callable[, array<string|int, mixed> $arguments = [] ]) : mixed
Parameters
$callable : callable
$arguments : array<string|int, mixed> = []

containerMake()

create object through container

public containerMake(string $className[, array<string|int, mixed> $arguments = [] ]) : mixed
Parameters
$className : string
$arguments : array<string|int, mixed> = []

csv2array()

gets csv contents as array

public csv2array(string $csvFile) : array<string|int, mixed>
Parameters
$csvFile : string
Return values
array<string|int, mixed>

errorPage()

return an error page

public errorPage(int $error_code, Request $request[, RouteInfo|null $route_info = null ][, array<string|int, mixed> $template_data = [] ][, null $template_name = null ]) : Response
Parameters
$error_code : int
$request : Request
$route_info : RouteInfo|null = null
$template_data : array<string|int, mixed> = []
$template_name : null = null
Tags
throws
BasicException
throws
DependencyException
throws
NotFoundException
throws
PhpfastcacheSimpleCacheException
throws
Throwable
Return values
Response

exceptionJson()

returns an exception error json

public exceptionJson(Exception $exception, Request $request) : Response
Parameters
$exception : Exception
$request : Request
Tags
throws
BasicException
throws
DependencyException
throws
NotFoundException
throws
PhpfastcacheSimpleCacheException
Return values
Response

exceptionPage()

returns a exception error page

public exceptionPage(Throwable $exception, Request $request[, RouteInfo|null $route_info = null ]) : Response
Parameters
$exception : Throwable
$request : Request
$route_info : RouteInfo|null = null
Tags
throws
BasicException
throws
DependencyException
throws
NotFoundException
throws
PhpfastcacheSimpleCacheException
throws
Throwable
Return values
Response

exceptionXML()

returns an exception error xml

public exceptionXML(Exception $exception, Request $request) : Response
Parameters
$exception : Exception
$request : Request
Tags
throws
BasicException
throws
DependencyException
throws
NotFoundException
throws
PhpfastcacheSimpleCacheException
Return values
Response

getContainer()

gets container object

public getContainer() : ContainerInterface
Return values
ContainerInterface

getDb()

gets db object

public getDb() : Database
Tags
throws
BasicException
Return values
Database

getDebugbar()

gets debugbar object

public getDebugbar() : StandardDebugBar
Tags
throws
BasicException
Return values
StandardDebugBar

getEmptyRouteInfo()

gets an empty RouteInfo object

public getEmptyRouteInfo() : RouteInfo
Tags
throws
DependencyException
throws
NotFoundException
Return values
RouteInfo

getEncodedPass()

gets encoded version of password

public getEncodedPass(string $pass[, string|null $salt = null ]) : string
Parameters
$pass : string
$salt : string|null = null
Tags
throws
BasicException
Return values
string

getEnv()

gets env variable

public getEnv(string $variable[, mixed $default = null ]) : mixed
Parameters
$variable : string
$default : mixed = null
Tags
throws
BasicException

getEventManager()

gets events manager service

public getEventManager() : SharedEventEmitter
Tags
throws
BasicException
Return values
SharedEventEmitter

getGoogleAuthenticator()

gets google authenticator service

public getGoogleAuthenticator() : PHPGangsta_GoogleAuthenticator
Tags
throws
BasicException
Return values
PHPGangsta_GoogleAuthenticator

getGuzzle()

gets guzzle service

public getGuzzle() : Client
Tags
throws
BasicException
Return values
Client

getIcons()

gets icons service

public getIcons() : Icons
Tags
throws
BasicException
Return values
Icons

getImagine()

gets imagine service

public getImagine() : Imagine
Tags
throws
BasicException
Return values
Imagine

getLog()

gets log object

public getLog() : Logger
Tags
throws
BasicException
Return values
Logger

getPdo()

gets PDO object

public getPdo() : PDO
Tags
throws
BasicException
Return values
PDO

getRequest()

gets current request object

public getRequest() : Request
Tags
throws
BasicException
Return values
Request

getRouters()

gets routers

public getRouters() : array<string|int, mixed>
Tags
throws
BasicException
Return values
array<string|int, mixed>

getSchema()

gets schema object

public getSchema() : Schema
Tags
throws
BasicException
Return values
Schema

getSesMailer()

gets SES mailer service

public getSesMailer() : SesClient
Tags
throws
BasicException
Return values
SesClient

getSiteLanguagesSelectOptions()

gets site languages options for selects

public getSiteLanguagesSelectOptions([int|null $website_id = null ]) : array<string|int, mixed>
Parameters
$website_id : int|null = null
Tags
throws
BasicException
throws
DependencyException
throws
NotFoundException
throws
PhpfastcacheSimpleCacheException
Return values
array<string|int, mixed>

getSmtpMailer()

gets SMTP mailer service

public getSmtpMailer() : Swift_Mailer
Tags
throws
BasicException
Return values
Swift_Mailer

getTemplates()

gets plates engine object

public getTemplates() : Engine
Tags
throws
BasicException
Return values
Engine

getToken()

gets Authorization token Object

public getToken() : Token|null
Return values
Token|null

getTokenHeader()

gets Authorization token header

public getTokenHeader() : string|null
Return values
string|null

getTokenUserDataClaim()

gets token data

public getTokenUserDataClaim() : mixed

getTranslator()

gets translator

public getTranslator([string|null $locale_code = null ]) : Translator
Parameters
$locale_code : string|null = null
Tags
throws
DependencyException
throws
NotFoundException
Return values
Translator

getWebsitesSelectOptions()

gets websites options for selects

public getWebsitesSelectOptions() : array<string|int, mixed>
Return values
array<string|int, mixed>

getWrappedMailBody()

public getWrappedMailBody(string $subject, string $mail_body[, string $template_name = 'generic' ]) : string
Parameters
$subject : string
$mail_body : string
$template_name : string = 'generic'
Tags
throws
BasicException
throws
Throwable
Return values
string

httpRequest()

executes an http request

public httpRequest(string $url[, string $method = 'GET' ][, array<string|int, mixed> $options = [] ]) : mixed
Parameters
$url : string
$method : string = 'GET'
$options : array<string|int, mixed> = []
Tags
throws
GuzzleException
throws
BasicException

logException()

logs an exception

public logException(Throwable $e[, string|null $prefix = null ][, Request|null $request = null ]) : void
Parameters
$e : Throwable
$prefix : string|null = null
$request : Request|null = null
Tags
throws
BasicException

offlinePage()

returns a "site is offline" error page

public offlinePage(Request $request[, RouteInfo|null $route_info = null ]) : Response
Parameters
$request : Request
$route_info : RouteInfo|null = null
Tags
throws
BasicException
throws
DependencyException
throws
NotFoundException
throws
PhpfastcacheSimpleCacheException
throws
Throwable
Return values
Response

queueContactFormMail()

public queueContactFormMail(string $from, string $to, string $subject, string $body) : QueueMessage
Parameters
$from : string
$to : string
$subject : string
$body : string
Tags
throws
BasicException
throws
DependencyException
throws
NotFoundException
throws
Throwable
Return values
QueueMessage

queueInternalMail()

public queueInternalMail(string $from, string $to, string $subject, string $body[, string $template_name = 'generic' ]) : QueueMessage
Parameters
$from : string
$to : string
$subject : string
$body : string
$template_name : string = 'generic'
Tags
throws
BasicException
throws
DependencyException
throws
NotFoundException
throws
Throwable
Return values
QueueMessage

queueLinksFormMail()

public queueLinksFormMail(string $from, string $to, string $subject, string $body) : QueueMessage
Parameters
$from : string
$to : string
$subject : string
$body : string
Tags
throws
BasicException
throws
DependencyException
throws
NotFoundException
throws
Throwable
Return values
QueueMessage

randString()

computes a random string

public randString([int $length = 10 ]) : string
Parameters
$length : int = 10
Return values
string

requestUrl()

executes an http request

public requestUrl(string $url[, string $method = 'GET' ][, array<string|int, mixed> $options = [] ]) : string|bool
Parameters
$url : string
$method : string = 'GET'
$options : array<string|int, mixed> = []
Tags
throws
Exception
throws
GuzzleException
Return values
string|bool

translate()

translates a string

public translate(string $string[, array<string|int, mixed> $params = [] ][, string|null $locale = null ]) : string
Parameters
$string : string
$params : array<string|int, mixed> = []
$locale : string|null = null
Tags
throws
BasicException
throws
DependencyException
throws
NotFoundException
Return values
string

getService()

gets registered service

protected getService(string $service_key) : mixed
Parameters
$service_key : string
Tags
throws
BasicException

logRequestIfNeeded()

logs request (if needed)

protected logRequestIfNeeded(mixed $status_code, Request $request) : void
Parameters
$status_code : mixed
$request : Request
Tags
throws
BasicException
throws
DependencyException
throws
NotFoundException
throws
PhpfastcacheSimpleCacheException

queueMail()

protected queueMail(string $from, string $to, string $subject, string $body, string $queue_name[, string $template_name = 'generic' ]) : QueueMessage
Parameters
$from : string
$to : string
$subject : string
$body : string
$queue_name : string
$template_name : string = 'generic'
Tags
throws
BasicException
throws
DependencyException
throws
NotFoundException
throws
Throwable
Return values
QueueMessage

        
On this page

Search results