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
$container
protected
ContainerInterface
$container
Methods
__call()
{@inheritdoc}
public
__call(string $name, mixed $arguments) : mixed
Parameters
- $name : string
- $arguments : mixed
Tags
__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
Return values
QueueMessagearray2csv()
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|falseblockedIpPage()
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
Return values
ResponsecheckPass()
checks password
public
checkPass(string $pass, string $encoded_pass) : bool
Parameters
- $pass : string
- $encoded_pass : string
Return values
boolcontainerCall()
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
Return values
ResponseexceptionJson()
returns an exception error json
public
exceptionJson(Exception $exception, Request $request) : Response
Parameters
- $exception : Exception
- $request : Request
Tags
Return values
ResponseexceptionPage()
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
Return values
ResponseexceptionXML()
returns an exception error xml
public
exceptionXML(Exception $exception, Request $request) : Response
Parameters
- $exception : Exception
- $request : Request
Tags
Return values
ResponsegetApp()
gets app object
public
getApp() : App
Tags
Return values
AppgetApplicationLogger()
gets application_logger service
public
getApplicationLogger() : Manager
Tags
Return values
ManagergetAppRouteInfo()
gets route info
public
getAppRouteInfo() : RouteInfo|null
Return values
RouteInfo|nullgetAppWebsite()
gets current website
public
getAppWebsite() : Website|null
Return values
Website|nullgetAssets()
gets assets manager
public
getAssets() : Manager
Tags
Return values
ManagergetCache()
get cache manager
public
getCache() : Manager
Tags
Return values
ManagergetContainer()
gets container object
public
getContainer() : ContainerInterface
Return values
ContainerInterfacegetCrudRouter()
gets crud service
public
getCrudRouter() : Crud
Tags
Return values
CrudgetDb()
gets db object
public
getDb() : Database
Tags
Return values
DatabasegetDebugbar()
gets debugbar object
public
getDebugbar() : StandardDebugBar
Tags
Return values
StandardDebugBargetEmptyRouteInfo()
gets an empty RouteInfo object
public
getEmptyRouteInfo() : RouteInfo
Tags
Return values
RouteInfogetEncodedPass()
gets encoded version of password
public
getEncodedPass(string $pass[, string|null $salt = null ]) : string
Parameters
- $pass : string
- $salt : string|null = null
Tags
Return values
stringgetEnv()
gets env variable
public
getEnv(string $variable[, mixed $default = null ]) : mixed
Parameters
- $variable : string
- $default : mixed = null
Tags
getEventManager()
gets events manager service
public
getEventManager() : SharedEventEmitter
Tags
Return values
SharedEventEmittergetGoogleAuthenticator()
gets google authenticator service
public
getGoogleAuthenticator() : PHPGangsta_GoogleAuthenticator
Tags
Return values
PHPGangsta_GoogleAuthenticatorgetGuzzle()
gets guzzle service
public
getGuzzle() : Client
Tags
Return values
ClientgetHtmlRenderer()
gets html renderer service
public
getHtmlRenderer() : HtmlPartsRenderer
Tags
Return values
HtmlPartsRenderergetIcons()
gets icons service
public
getIcons() : Icons
Tags
Return values
IconsgetImagine()
gets imagine service
public
getImagine() : Imagine
Tags
Return values
ImaginegetLog()
gets log object
public
getLog() : Logger
Tags
Return values
LoggergetMailer()
gets mailer service
public
getMailer() : Mailer
Tags
Return values
MailergetPdo()
gets PDO object
public
getPdo() : PDO
Tags
Return values
PDOgetRedis()
gets redis service
public
getRedis() : Manager
Tags
Return values
ManagergetRequest()
gets current request object
public
getRequest() : Request
Tags
Return values
RequestgetRouters()
gets routers
public
getRouters() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>getSchema()
gets schema object
public
getSchema() : Schema
Tags
Return values
SchemagetSearch()
gets search service
public
getSearch() : Manager
Tags
Return values
ManagergetSesMailer()
gets SES mailer service
public
getSesMailer() : SesClient
Tags
Return values
SesClientgetSiteData()
gets site data service
public
getSiteData() : SiteData
Tags
Return values
SiteDatagetSiteLanguagesSelectOptions()
gets site languages options for selects
public
getSiteLanguagesSelectOptions([int|null $website_id = null ]) : array<string|int, mixed>
Parameters
- $website_id : int|null = null
Tags
Return values
array<string|int, mixed>getSmtpMailer()
gets SMTP mailer service
public
getSmtpMailer() : Swift_Mailer
Tags
Return values
Swift_MailergetTemplates()
gets plates engine object
public
getTemplates() : Engine
Tags
Return values
EnginegetToken()
gets Authorization token Object
public
getToken() : Token|null
Return values
Token|nullgetTokenHeader()
gets Authorization token header
public
getTokenHeader() : string|null
Return values
string|nullgetTokenUserDataClaim()
gets token data
public
getTokenUserDataClaim() : mixed
getTranslator()
gets translator
public
getTranslator([string|null $locale_code = null ]) : Translator
Parameters
- $locale_code : string|null = null
Tags
Return values
TranslatorgetUtils()
gets global utils service
public
getUtils() : Globals
Tags
Return values
GlobalsgetWebhooksRouter()
gets webhooks service
public
getWebhooksRouter() : Webhooks
Tags
Return values
WebhooksgetWebRouter()
gets routing service
public
getWebRouter() : Web
Tags
Return values
WebgetWebsitesSelectOptions()
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
Return values
stringgetZip()
gets zip service
public
getZip() : Zip
Tags
Return values
ZiphttpRequest()
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
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
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
Return values
ResponsequeueContactFormMail()
public
queueContactFormMail(string $from, string $to, string $subject, string $body) : QueueMessage
Parameters
- $from : string
- $to : string
- $subject : string
- $body : string
Tags
Return values
QueueMessagequeueInternalMail()
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
Return values
QueueMessagequeueLinksFormMail()
public
queueLinksFormMail(string $from, string $to, string $subject, string $body) : QueueMessage
Parameters
- $from : string
- $to : string
- $subject : string
- $body : string
Tags
Return values
QueueMessagerandString()
computes a random string
public
randString([int $length = 10 ]) : string
Parameters
- $length : int = 10
Return values
stringrequestUrl()
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
Return values
string|booltranslate()
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
Return values
stringgetService()
gets registered service
protected
getService(string $service_key) : mixed
Parameters
- $service_key : string
Tags
logRequestIfNeeded()
logs request (if needed)
protected
logRequestIfNeeded(mixed $status_code, Request $request) : void
Parameters
- $status_code : mixed
- $request : Request
Tags
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'