PHP Class Nexcessnet_Turpentine_Model_Varnish_Admin_Socket

Afficher le fichier Open project: nexcess/magento-turpentine Class Usage Examples

Protected Properties

Свойство Type Description
$_VERSIONS VCL config versions, should match config select values
$_authSecret
$_host
$_port
$_private
$_timeout
$_varnishConn resource Varnish socket connection
$_version

Méthodes publiques

Méthode Description
__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)

Méthodes protégées

Méthode Description
_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

Method Details

__call() public méthode

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
Résultat array

__construct() public méthode

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

_close() protected méthode

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

_command() protected méthode

[_command description]
protected _command ( string $verb, integer $okCode = 200 ) : array
$verb string command name
$okCode integer code that indicates command was successful
Résultat array

_connect() protected méthode

Establish a connection to the configured Varnish instance
protected _connect ( ) : boolean
Résultat boolean

_determineVersion() protected méthode

protected _determineVersion ( string $bannerText )
$bannerText string

_read() protected méthode

Read a response from Varnish instance
protected _read ( ) : array
Résultat array tuple of the response (code, text)

_translateCommandMethod() protected méthode

Handle v2.1 <> v3.0 command compatibility
protected _translateCommandMethod ( string $verb ) : string
$verb string command to check
Résultat string

_write() protected méthode

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

getConnectionString() public méthode

Get the connection string for this socket (:)
public getConnectionString ( ) : string
Résultat string

getHost() public méthode

Get the set host for this instance
public getHost ( ) : string
Résultat string

getPort() public méthode

Get the port set for this instance
public getPort ( ) : integer
Résultat integer

getVersion() public méthode

Find out what version mode we're running in
public getVersion ( ) : string
Résultat string

isConnected() public méthode

Check if we're connected to Varnish
public isConnected ( ) : boolean
Résultat boolean

quit() public méthode

Stop the Varnish instance
public quit ( )

setAuthSecret() public méthode

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

setHost() public méthode

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

setPort() public méthode

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

setTimeout() public méthode

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

setVersion() public méthode

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

start() public méthode

Start running the Varnish child
public start ( )

status() public méthode

Check if Varnish has a child running or not
public status ( ) : boolean
Résultat boolean

stop() public méthode

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

Property Details

$_VERSIONS protected_oe static_oe property

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

$_authSecret protected_oe property

protected $_authSecret

$_host protected_oe property

protected $_host

$_port protected_oe property

protected $_port

$_private protected_oe property

protected $_private

$_timeout protected_oe property

protected $_timeout

$_varnishConn protected_oe property

Varnish socket connection
protected resource $_varnishConn
Résultat resource

$_version protected_oe property

protected $_version