PHP version >= 7.2
- posix
- pnctl
- sockets
- openssl
- posix_shm
- sysvmsg
Server and execution environment information.
Array (
"SERVER_NAME"=>"syfy-host.com",
"REMOTE_ADDR"=>"192.168.1.24",
"PROTOCOL"=>"HTTP/1.1",
"REQUEST_TYPE"=>"GET",
"REQUEST_URI"=>"/",
"REQUEST_TIME"=>1569808779,
"HTTP_HEADERS"=> Array (
"Accept-Encoding"=>"gzip, deflate, br",
"User-Agent"=>"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:72.0) Gecko/20100101 Firefox/72.0"
),
"__SRV"=>Object(__SRV)
"__IPC"=>Object(__IPC),
"__EVENTS"=>Object(__EVENTS)
)
HTTP POST variables. An associative array of variables passed to the current script via the HTTP POST method when using application/x-www-form-urlencoded or multipart/form-data as the HTTP Content-Type in the request.
Array (
"key"=>"value",
"bar"=>"foo"
)
HTTP GET variables. An associative array of variables passed to the current script via the URL parameters (aka. query string). Note that the array is not only populated for GET requests, but rather for all requests with a query string.
Array (
"key"=>"value",
"bar"=>"foo"
)
Send a raw HTTP body
Example:
$_SERVER['__SRV']->setContent("Hello World!");
Send a raw HTTP header
Example:
$_SERVER['__SRV']->header("Location: http://www.example.com/");
Send HTTP status
Example:
$_SERVER['__SRV']->status(200,'OK');
Check variable in shared memory
Example:
$_SERVER['__IPC']->isset('bar');
Returns a variable from shared memory
Example:
$_SERVER['__IPC']->get('bar');
Inserts or updates a variable in shared memory
Example:
$_SERVER['__IPC']->set('bar','foo');
Send a message to a message queue
Example:
$_SERVER['IPC']->send(1,'hello');
Receive a message from a message queue
Example:
$_SERVER['__IPC']->recv(1);
Add new event
Example:
$_SERVER['__EVENTS']->add('bar','/path/to/file.php',[
'object'=>'cron',
'method'=>'init',
'params'=>[]
]);
Add timer to event
Example:
$_SERVER['__EVENTS']->addTimer('bar',5,true);
Get event information
Example:
$_SERVER['__EVENTS']->get('bar');
Remove event
Example:
$_SERVER['__EVENTS']->remove('bar');