Nexcessnet_Turpentine_Model_Varnish_Configurator_Abstract::getAllowedHostsRegex PHP Method

getAllowedHostsRegex() public method

ex: base_url: example.com path_regex: (example.com|example.net)
public getAllowedHostsRegex ( ) : string
return string
    public function getAllowedHostsRegex()
    {
        $hosts = array();
        foreach (Mage::app()->getStores() as $store) {
            $hosts[] = parse_url($store->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB, false), PHP_URL_HOST);
        }
        $hosts = array_values(array_unique($hosts));
        $pattern = '(' . implode('|', array_map("preg_quote", $hosts)) . ')';
        return $pattern;
    }