input->getUint('cron_id', 0); $key = $app->input->getString('cronkey', ''); $this->cronModel = VBOMvcModel::getInstance('cronjob'); $this->cron = $this->cronModel->getItem($id_cron); // Dispatch the cron job by injecting the cron key within the // configuration array, in order to make sure that the execution // of the job has been requested by a reliable caller. // Enable the debug mode to catch the output buffering and disable // the strict model to allow the execution of unpublished jobs. $this->response = $this->cronModel->dispatch($id_cron, [ 'key' => $key, 'debug' => true, 'strict' => false, ]); if ($this->response === false) { // an error has occurred $error = $this->cronModel->getError(); if (!$error instanceof Exception) { // wrap error message in an exception for a better ease of use $error = new Exception($error ?: 'Error', 500); } // terminate session with an error VBOHttpDocument::getInstance($app)->close($error->getCode(), $error->getMessage()); } parent::display(); } }