DBServer::executeScript PHP Method

executeScript() public method

Executes script
public executeScript ( array $script, Scalr_Messaging_Msg_ExecScript $msg ) : void
$script array Script settings
$msg Scalr_Messaging_Msg_ExecScript Scalarizr message
return void
    public function executeScript(array $script, Scalr_Messaging_Msg_ExecScript $msg)
    {
        $itm = new stdClass();
        $itm->asynchronous = $script['issync'] == 1 ? '0' : '1';
        $itm->timeout = $script['timeout'];
        if ($script['body']) {
            $itm->name = $script['name'];
            $itm->body = $script['body'];
        } else {
            $itm->path = $script['path'];
            if ($msg->eventName == 'Manual') {
                $itm->name = "local-" . crc32($script['path']) . mt_rand(100, 999);
            }
        }
        $itm->executionId = $script['execution_id'];
        $msg->scripts = [$itm];
        $msg->setGlobalVariables($this, true);
        $this->SendMessage($msg, false, true);
    }