Nexcessnet_Turpentine_Model_Varnish_Configurator_Abstract::_vcl_acl PHP Method

_vcl_acl() protected method

Format a VCL ACL declaration
protected _vcl_acl ( string $name, array $hosts ) : string
$name string ACL name
$hosts array list of hosts to add to the ACL
return string
    protected function _vcl_acl($name, array $hosts)
    {
        $tpl = <<<EOS
acl {{name}} {
    {{hosts}}
}
EOS;
        $fmtHost = create_function('$h', 'return sprintf(\'"%s";\',$h);');
        $vars = array('name' => $name, 'hosts' => implode("\n    ", array_map($fmtHost, $hosts)));
        return $this->_formatTemplate($tpl, $vars);
    }