Config
class Config implements ConfigInterface, Arrayable
This class contains Nginx Unit config data
Methods
Fill data if listeners key exists
Fill data if applications key exists
Fill data if routes key exists
Fill data if upstreams key exists
No description
Get listener by port
No description
No description
Get applications from config
Get application from config by name
Upload application to Nginx Unit
No description
Remove application from Nginx Unit.
Get routes from config
Get route from config by name
No description
No description
Get upstreams
Upload all upstreams from file to Nginx Unit
No description
Return access log if exists
Remove access log
Return config as array
Details
at line 55
__construct(object $data, UnitRequest $_unitRequest)
Constructor
at line 73
void
loadListeners(array $data)
Fill data if listeners key exists
at line 100
void
loadApplications(array $data)
Fill data if applications key exists
at line 148
void
loadRoutes(object $rawData)
Fill data if routes key exists
at line 168
void
loadUpstreams(array $data)
Fill data if upstreams key exists
at line 181
Listener|null
getListener(string $listener)
No description
at line 192
Listener|null
getListenerByPort(int $port)
Get listener by port
at line 206
bool
uploadListener(Listener $listener)
No description
at line 222
bool
uploadListenerFromFile(string $path, string $listener)
No description
at line 250
bool
removeListener(Listener $listener)
Remove listener
at line 263
array
getListeners()
No description
at line 273
array
getApplications()
Get applications from config
at line 284
ApplicationAbstract|null
getApplication($applicationName)
Get application from config by name
at line 289
bool
uploadApplication(ApplicationAbstract $application, string $name = '')
Upload application to Nginx Unit
at line 312
bool
uploadApplicationFromFile(string $path, string $name)
No description
at line 342
bool
removeApplication(ApplicationAbstract|string $application)
Remove application from Nginx Unit.
Cain receive application name or application object
at line 357
array
getRoutes()
Get routes from config
at line 368
Route|null
getRoute(string $routeName)
Get route from config by name
at line 376
bool
removeRoutes()
No description
at line 396
bool
removeRoute(Route|string $route)
No description
at line 408
array
getUpstreams()
Get upstreams
at line 417
bool
uploadUpstream(Upstream $upstream, string $name = '')
No description
at line 437
bool
uploadUpstreamsFromFile(string $path)
Upload all upstreams from file to Nginx Unit
at line 464
bool
setAccessLog($path, $format = null)
No description
at line 483
AccessLog|null
getAccessLog()
Return access log if exists
at line 490
bool
removeAccessLog()
Remove access log
at line 507
array
toArray()
Return config as array