PHP Класс Nexcessnet_Turpentine_Model_Varnish_Admin_Socket

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_VERSIONS VCL config versions, should match config select values
$_authSecret
$_host
$_port
$_private
$_timeout
$_varnishConn resource Varnish socket connection
$_version

Открытые методы

Метод Описание
__call ( string $name, array $args ) : array Provide simple Varnish methods
__construct ( array $options = [] ) auto-detect
getConnectionString ( ) : string Get the connection string for this socket (:)
getHost ( ) : string Get the set host for this instance
getPort ( ) : integer Get the port set for this instance
getVersion ( ) : string Find out what version mode we're running in
isConnected ( ) : boolean Check if we're connected to Varnish
quit ( ) Stop the Varnish instance
setAuthSecret ( string $authSecret = null ) Set the Varnish admin auth secret, use null to indicate there isn't one
setHost ( string $host ) Set the Varnish host name/ip to connect to
setPort ( integer $port ) Set the Varnish admin port
setTimeout ( integer $timeout ) Set the timeout to connect to the varnish instance
setVersion ( string $version ) Explicitly set the version of the varnish instance we're connecting to
start ( ) Start running the Varnish child
status ( ) : boolean Check if Varnish has a child running or not
stop ( ) Stop the running child (if it is running)

Защищенные методы

Метод Описание
_close ( ) Close the connection (if we're connected)
_command ( string $verb, integer $okCode = 200 ) : array [_command description]
_connect ( ) : boolean Establish a connection to the configured Varnish instance
_determineVersion ( string $bannerText )
_read ( ) : array Read a response from Varnish instance
_translateCommandMethod ( string $verb ) : string Handle v2.1 <> v3.0 command compatibility
_write ( string $data ) Write data to the Varnish instance, a newline is automatically appended

Описание методов

__call() публичный Метод

Methods provided: help [command] ping [timestamp] auth response banner stats vcl.load vcl.inline vcl.use vcl.discard vcl.list vcl.show param.show [-l] [] param.set purge.url purge [&& ]... purge.list
public __call ( string $name, array $args ) : array
$name string method name
$args array method args
Результат array

__construct() публичный Метод

auto-detect
public __construct ( array $options = [] )
$options array

_close() защищенный Метод

Close the connection (if we're connected)
protected _close ( )

_command() защищенный Метод

[_command description]
protected _command ( string $verb, integer $okCode = 200 ) : array
$verb string command name
$okCode integer code that indicates command was successful
Результат array

_connect() защищенный Метод

Establish a connection to the configured Varnish instance
protected _connect ( ) : boolean
Результат boolean

_determineVersion() защищенный Метод

protected _determineVersion ( string $bannerText )
$bannerText string

_read() защищенный Метод

Read a response from Varnish instance
protected _read ( ) : array
Результат array tuple of the response (code, text)

_translateCommandMethod() защищенный Метод

Handle v2.1 <> v3.0 command compatibility
protected _translateCommandMethod ( string $verb ) : string
$verb string command to check
Результат string

_write() защищенный Метод

Write data to the Varnish instance, a newline is automatically appended
protected _write ( string $data )
$data string data to write

getConnectionString() публичный Метод

Get the connection string for this socket (:)
public getConnectionString ( ) : string
Результат string

getHost() публичный Метод

Get the set host for this instance
public getHost ( ) : string
Результат string

getPort() публичный Метод

Get the port set for this instance
public getPort ( ) : integer
Результат integer

getVersion() публичный Метод

Find out what version mode we're running in
public getVersion ( ) : string
Результат string

isConnected() публичный Метод

Check if we're connected to Varnish
public isConnected ( ) : boolean
Результат boolean

quit() публичный Метод

Stop the Varnish instance
public quit ( )

setAuthSecret() публичный Метод

Set the Varnish admin auth secret, use null to indicate there isn't one
public setAuthSecret ( string $authSecret = null )
$authSecret string

setHost() публичный Метод

Set the Varnish host name/ip to connect to
public setHost ( string $host )
$host string hostname or ip

setPort() публичный Метод

Set the Varnish admin port
public setPort ( integer $port )
$port integer

setTimeout() публичный Метод

Set the timeout to connect to the varnish instance
public setTimeout ( integer $timeout )
$timeout integer

setVersion() публичный Метод

Explicitly set the version of the varnish instance we're connecting to
public setVersion ( string $version )
$version string version from $_VERSIONS

start() публичный Метод

Start running the Varnish child
public start ( )

status() публичный Метод

Check if Varnish has a child running or not
public status ( ) : boolean
Результат boolean

stop() публичный Метод

Stop the running child (if it is running)
public stop ( )

Описание свойств

$_VERSIONS защищенное статическое свойство

VCL config versions, should match config select values
protected static $_VERSIONS

$_authSecret защищенное свойство

protected $_authSecret

$_host защищенное свойство

protected $_host

$_port защищенное свойство

protected $_port

$_private защищенное свойство

protected $_private

$_timeout защищенное свойство

protected $_timeout

$_varnishConn защищенное свойство

Varnish socket connection
protected resource $_varnishConn
Результат resource

$_version защищенное свойство

protected $_version