\Hazaar\Warlock
Server
Summary
Methods Properties Constants
run
$tv
No constants
Properties
$client_lookup
$client_lookup
$clients
$clients
$config
$config
$eventQueue
$eventQueue
Static
$instance
$instance
SERVER INSTANCE
$jobQueue
$jobQueue
$master
$master
$pid
$pid
Current process id
$pidfile
$pidfile
Current process id file
$procs
$procs
JOBS & SERVICES
$protocol
$protocol
$rrd
$rrd
$rrdfile
$rrdfile
$running
$running
$services
$services
$shutdown
$shutdown
$silent
$silent
$sockets
$sockets
$start
$start
Epoch of when Warlock was started
$stats
$stats
$tags
$tags
Job tags
$time
$time
Epoch of the last time stuff was processed
$tv
$tv
Default select() timeout
$waitQueue
$waitQueue
QUEUES
Methods
__construct()
__construct($silent = false)

Parameters

$silent

No description

__destruct()
__destruct()
addClient()
addClient($id, $socket, $uid = null)

Parameters

$id

No description

$socket

No description

$uid

No description

bootstrap()
bootstrap()
cancelJob()
cancelJob($job_id)

Parameters

$job_id

No description

checkClients()
checkClients()
checkRequestURL()
checkRequestURL($url)

Parameters

$url

No description

commandCancel()
commandCancel($resource, $client, $job_id)

Parameters

$resource

No description

$client

No description

$job_id

No description

commandDelay()
commandDelay($resource, $client, $command)

Parameters

$resource

No description

$client

No description

$command

No description

commandDisable()
commandDisable($resource, $client, $name)

Parameters

$resource

No description

$client

No description

$name

No description

commandEnable()
commandEnable($resource, $client, $name)

Parameters

$resource

No description

$client

No description

$name

No description

commandKill()
commandKill($resource, $client, $payload)

Parameters

$resource

No description

$client

No description

$payload

No description

commandLog()
commandLog($resource, $client, $payload)

Parameters

$resource

No description

$client

No description

$payload

No description

commandSchedule()
commandSchedule($resource, $client, $command)

Parameters

$resource

No description

$client

No description

$command

No description

commandService()
commandService($resource, $client, $name)

Parameters

$resource

No description

$client

No description

$name

No description

commandSignal()
commandSignal($resource, $client, $payload)

Parameters

$resource

No description

$client

No description

$payload

No description

commandSpawn()
commandSpawn($resource, $client, $payload)

Parameters

$resource

No description

$client

No description

$payload

No description

commandStatus()
commandStatus($resource, $client, $payload = null)

Parameters

$resource

No description

$client

No description

$payload

No description

commandStop()
commandStop($resource, $client)

Parameters

$resource

No description

$client

No description

commandSubscribe()
commandSubscribe($resource, $client, $event_id, $filter = null)

Parameters

$resource

No description

$client

No description

$event_id

No description

$filter

No description

commandSync()
commandSync($resource, $client, $payload)

Parameters

$resource

No description

$client

No description

$payload

No description

commandTrigger()
commandTrigger($resource, $client, $event_id, $data, $echo_client = true)

Parameters

$resource

No description

$client

No description

$event_id

No description

$data

No description

$echo_client

No description

commandUnsubscribe()
commandUnsubscribe($resource, $client, $event_id)

Parameters

$resource

No description

$client

No description

$event_id

No description

disconnect()
disconnect($socket)

Parameters

$socket

No description

fieldExists()
fieldExists($search, $array)

Parameters

$search

No description

$array

No description

filterEvent()
filterEvent($event, $filter = null) : bool
Tests whether a event should be filtered.

Returns TRUE if the event should be filtered (skipped), and FALSE if the event should be processed.

Parameters

$eventstring

The event to check.

$filterArray

The filter rule to test against.

Returns

\Hazaar\Warlock\bool

Returns TRUE if the event should be filtered (skipped), and FALSE if the event should be processed.

getClient()
getClient($socket)

Parameters

$socket

No description

getFieldValue()
getFieldValue($search, $array)

Parameters

$search

No description

$array

No description

getJobId()
getJobId()
getJobStatus()
getJobStatus($job_id)

Parameters

$job_id

No description

getStatus()
getStatus($full = true)

Parameters

$full

No description

httpResponse()
httpResponse($code, $body = null, $headers = Array ( ) )

Parameters

$code

No description

$body

No description

$headers

No description

initiateHandshake()
initiateHandshake($socket, $request)

Parameters

$socket

No description

$request

No description

isRunning()
isRunning()
ping()
ping($resource)

Parameters

$resource

No description

processClient()
processClient($socket)

Parameters

$socket

No description

processCommand()
processCommand($resource, $client, $command, $payload, $time)

Parameters

$resource

No description

$client

No description

$command

No description

$payload

No description

$time

No description

processEventQueue()
processEventQueue($client, $event_id, $filter = null) : boolean

This method is executed when a client connects to see if there are any events waiting in the event queue that the client has not yet seen. If there are, the first event found is sent to the client, marked as seen and then processing stops.

Parameters

$client\Hazaar\Warlock\SocketClient

No description

$event_idstring

No description

$filterArray

No description

Returns

boolean
processFrame()
processFrame($frameBuffer, $client)

Parameters

$frameBuffer

No description

$client\Hazaar\Warlock\SocketClient

No description

processJobs()
processJobs()
processSubscriptionQueue()
processSubscriptionQueue($event_id, $trigger_id = null) : boolean

This method is executed when a event is triggered. It is responsible for sending events to clients that are waiting for the event and marking them as seen by the client.

Parameters

$event_idstring

No description

$trigger_idstring

No description

Returns

boolean
queueCleanup()
queueCleanup()
removeClient()
removeClient($socket) : bool
Removes a client from a socket.

Because a client can have multiple socket connections (in legacy mode) this removes the client reference for that socket. Once there are no more references left the client is completely removed.

Parameters

$socket

No description

Returns

\Hazaar\Warlock\bool
run()
run()
runtimePath()
runtimePath($suffix = null, $create_dir = false) : string
Returns the application runtime directory

The runtime directory is a place where HazaarMVC will keep files that it needs to create during normal operation. For example, socket files for background scheduler communication, cached views, and backend applications.

Tags

Since

1.0.0

Parameters

$suffix

No description

$create_dir

No description

Returns

string

The path to the runtime directory

scheduleJob()
scheduleJob($when, $function, $application, $tag = null, $overwrite = false)

Parameters

$when

No description

$function

No description

$application

No description

$tag

No description

$overwrite

No description

send()
send($resource, $command, $payload = null, $is_legacy = false)

Parameters

$resource

No description

$command

No description

$payload

No description

$is_legacy

No description

sendAdminEvent()
sendAdminEvent($command, $data = Array ( ) , $force_queue = false)

Parameters

$command

No description

$data

No description

$force_queue

No description

serviceDisable()
serviceDisable($name)

Parameters

$name

No description

serviceEnable()
serviceEnable($name, $options = null)

Parameters

$name

No description

$options

No description

setJobStatus()
setJobStatus($job_id, $status)

Parameters

$job_id

No description

$status

No description

shutdown()
shutdown($timeout = 0)

Parameters

$timeout

No description

subscribe()
subscribe($resource, $client, $event_id, $filter)

Parameters

$resource

No description

$client

No description

$event_id

No description

$filter

No description

unsubscribe()
unsubscribe($client, $event_id = null, $resource = null)

Parameters

$client

No description

$event_id

No description

$resource

No description

write()
write($resource, $frame, $is_legacy = false)

Parameters

$resource

No description

$frame

No description

$is_legacy

No description