19 declare(strict_types=1);
    43     public function call(array $options): string
    45         $curl = curl_init($this->config->getServerAddress());
    46         curl_setopt($curl, CURLOPT_HEADER, 
false);
    47         curl_setopt($curl, CURLOPT_RETURNTRANSFER, 
true);
    48         curl_setopt($curl, CURLOPT_HTTPHEADER, array(
"Content-type: application/json"));
    49         curl_setopt($curl, CURLOPT_POST, 
true);
    50         curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($options, JSON_THROW_ON_ERROR));
    51         curl_setopt($curl, CURLOPT_TIMEOUT, $this->config->getServerTimeout());
    54         $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE);
    57         if ($status !== 200) {
    58             $lines = explode(
"\n", $response);
    59             if (isset($lines[1])) {
 __construct(ilMathJaxConfig $config)
Constructor. 
 
Global Mathjax configuration. 
 
Class for calling theMathJax server The server calls use cURL, if the extension is loaded...
 
call(array $options)
Call the mathjax server.