app/code/community/Nexcessnet/Turpentine/Model/Varnish/Configurator/Version4.php
protected function _vcl_director($name, $backendOptions) {
        $tpl = <<<EOS
{{backends}}
EOS;
        if ('admin' == $name && 'yes_admin' == Mage::getStoreConfig('turpentine_vcl/backend/load_balancing')) {
            $backendNodes = Mage::helper('turpentine/data')->cleanExplode(PHP_EOL,
                Mage::getStoreConfig('turpentine_vcl/backend/backend_nodes_admin'));
            $probeUrl = Mage::getStoreConfig('turpentine_vcl/backend/backend_probe_url_admin');
            $prefix = 'admin';
        } else {
            $backendNodes = Mage::helper('turpentine/data')->cleanExplode(PHP_EOL,
                Mage::getStoreConfig('turpentine_vcl/backend/backend_nodes'));
            $probeUrl = Mage::getStoreConfig('turpentine_vcl/backend/backend_probe_url');

            if ('admin' == $name) {
                $prefix = 'admin';
            } else {
                $prefix = '';
            }
        }

        $backends = '';
        $number = 0;
        foreach ($backendNodes as $backendNode) {
            $parts = explode(':', $backendNode, 2);
            $host = (empty($parts[0])) ? '127.0.0.1' : $parts[0];
            $port = (empty($parts[1])) ? '80' : $parts[1];
            $backends .= $this->_vcl_director_backend($host, $port, $prefix.$number, $probeUrl, $backendOptions);

            $number++;
        }
        $vars = array(
            'name' => $name,
            'backends' => $backends
        );
        return $this->_formatTemplate($tpl, $vars);
    }
protected function _vcl_director($name, $backendOptions) {
        $tpl = <<<EOS
{{backends}}
EOS;
        if ('admin' == $name && 'yes_admin' == Mage::getStoreConfig('turpentine_vcl/backend/load_balancing')) {
            $backendNodes = Mage::helper('turpentine/data')->cleanExplode(PHP_EOL,
                Mage::getStoreConfig('turpentine_vcl/backend/backend_nodes_admin'));
            $probeUrl = Mage::getStoreConfig('turpentine_vcl/backend/backend_probe_url_admin');
            $prefix = 'admin';
        } else {
            $backendNodes = Mage::helper('turpentine/data')->cleanExplode(PHP_EOL,
                Mage::getStoreConfig('turpentine_vcl/backend/backend_nodes'));
            $probeUrl = Mage::getStoreConfig('turpentine_vcl/backend/backend_probe_url');

            if ('admin' == $name) {
                $prefix = 'admin';
            } else {
                $prefix = '';
            }
        }

        $backends = '';
        $number = 0;
        foreach ($backendNodes as $backendNode) {
            $parts = explode(':', $backendNode, 2);
            $host = (empty($parts[0])) ? '127.0.0.1' : $parts[0];
            $port = (empty($parts[1])) ? '80' : $parts[1];
            $backends .= $this->_vcl_director_backend($host, $port, $prefix.$number, $probeUrl, $backendOptions);

            $number++;
        }
        $vars = array(
            'name' => $name,
            'backends' => $backends
        );
        return $this->_formatTemplate($tpl, $vars);
    }
protected function _vcl_director ( $ name , $ backendOptions ) { $ tpl =  <<<EOS
{{backends}}
EOS ; if ( 'admin' == $ name && 'yes_admin' == Mage :: getStoreConfig ( 'turpentine_vcl/backend/load_balancing' ) ) { $ backendNodes = Mage :: helper ( 'turpentine/data' ) -> cleanExplode ( PHP_EOL , Mage :: getStoreConfig ( 'turpentine_vcl/backend/backend_nodes_admin' ) ) ; $ probeUrl = Mage :: getStoreConfig ( 'turpentine_vcl/backend/backend_probe_url_admin' ) ; $ prefix = 'admin' ; } else { $ backendNodes = Mage :: helper ( 'turpentine/data' ) -> cleanExplode ( PHP_EOL , Mage :: getStoreConfig ( 'turpentine_vcl/backend/backend_nodes' ) ) ; $ probeUrl = Mage :: getStoreConfig ( 'turpentine_vcl/backend/backend_probe_url' ) ; if ( 'admin' == $ name ) { $ prefix = 'admin' ; } else { $ prefix = '' ; } } $ backends = '' ; $ number = 0 ; foreach ( $ backendNodes as $ backendNode ) { $ parts = explode ( ':' , $ backendNode , 2 ) ; $ host = ( empty ( $ parts [ 0 ] ) ) ? '127.0.0.1' : $ parts [ 0 ] ; $ port = ( empty ( $ parts [ 1 ] ) ) ? '80' : $ parts [ 1 ] ; $ backends .= $ this -> _vcl_director_backend ( $ host , $ port , $ prefix . $ number , $ probeUrl , $ backendOptions ) ; $ number ++ ; } $ vars = array ( 'name' => $ name , 'backends' => $ backends ) ; return $ this -> _formatTemplate ( $ tpl , $ vars ) ; }
Format a VCL director declaration, for load balancing

@param string $name           name of the director, also used to select config settings
@param array  $backendOptions options for each backend
@return string
Format a VCL director declaration for load balancing