Nexcessnet_Turpentine_Model_Varnish_Configurator_Abstract::_vcl_get_probe PHP Method

_vcl_get_probe() protected method

Format a VCL probe declaration to put in backend which is in director
protected _vcl_get_probe ( string $probeUrl ) : string
$probeUrl string URL to check if backend is up
return string
    protected function _vcl_get_probe($probeUrl)
    {
        $urlParts = parse_url($probeUrl);
        if (empty($urlParts)) {
            // Malformed URL
            return '';
        } else {
            $tpl = <<<EOS
            .probe = {
                .request =
                    "GET {{probe_path}} HTTP/1.1"
                    "Host: {{probe_host}}"
                    "Connection: close";
            }
EOS;
            $vars = array('probe_host' => $urlParts['host'], 'probe_path' => $urlParts['path']);
            return $this->_formatTemplate($tpl, $vars);
        }
    }