@@ -1,16 +1,16 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * ESI DECODER |
|
| 4 | - * |
|
| 5 | - * This tool can be used to decode an ESI request. |
|
| 6 | - * You can just paste the whole ESI URL and push the button to decode it. |
|
| 7 | - * |
|
| 8 | - * Make sure you place this utility on a protected spot on your web server where only authorized users can use it. |
|
| 9 | - * |
|
| 10 | - * If the URLs you see in "varnishlog" or "varnishncsa" are not working because they are cut off, read this FAQ item: |
|
| 11 | - * https://github.com/nexcess/magento-turpentine/wiki/FAQ#im-using-varnishncsa-to-generate-logs-and-the-esi-urls-are-cut-off-how-do-i-get-the-full-url-in-the-logs |
|
| 12 | - * |
|
| 13 | - */ |
|
| 3 | + * ESI DECODER |
|
| 4 | + * |
|
| 5 | + * This tool can be used to decode an ESI request. |
|
| 6 | + * You can just paste the whole ESI URL and push the button to decode it. |
|
| 7 | + * |
|
| 8 | + * Make sure you place this utility on a protected spot on your web server where only authorized users can use it. |
|
| 9 | + * |
|
| 10 | + * If the URLs you see in "varnishlog" or "varnishncsa" are not working because they are cut off, read this FAQ item: |
|
| 11 | + * https://github.com/nexcess/magento-turpentine/wiki/FAQ#im-using-varnishncsa-to-generate-logs-and-the-esi-urls-are-cut-off-how-do-i-get-the-full-url-in-the-logs |
|
| 12 | + * |
|
| 13 | + */ |
|
| 14 | 14 | |
| 15 | 15 | $tries = 5; |
| 16 | 16 | $dir = dirname(__FILE__); |
@@ -56,7 +56,7 @@ |
||
| 56 | 56 | */ |
| 57 | 57 | public function renewFormKey() |
| 58 | 58 | { |
| 59 | - $this->setData('_form_key', Mage::helper('core')->getRandomString(16)); |
|
| 59 | + $this->setData('_form_key', Mage::helper('core')->getRandomString(16)); |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | /** |
@@ -21,19 +21,19 @@ |
||
| 21 | 21 | |
| 22 | 22 | class Nexcessnet_Turpentine_Block_Poll_ActivePoll extends Mage_Poll_Block_ActivePoll { |
| 23 | 23 | |
| 24 | - public function setTemplate($template) |
|
| 25 | - { |
|
| 26 | - if ((Mage::getConfig()->getModuleConfig('Mage_Poll')->is('active', 'true')) && |
|
| 27 | - (!Mage::getStoreConfig('advanced/modules_disable_output/Mage_Poll'))) |
|
| 28 | - { |
|
| 29 | - $this->_template = $template; |
|
| 30 | - $this->setPollTemplate('turpentine/ajax.phtml', 'poll'); |
|
| 31 | - $this->setPollTemplate('turpentine/ajax.phtml', 'results'); |
|
| 32 | - } |
|
| 33 | - else |
|
| 34 | - { |
|
| 35 | - // Mage_Poll is disabled, so do nothing |
|
| 36 | - } |
|
| 37 | - return $this; |
|
| 38 | - } |
|
| 24 | + public function setTemplate($template) |
|
| 25 | + { |
|
| 26 | + if ((Mage::getConfig()->getModuleConfig('Mage_Poll')->is('active', 'true')) && |
|
| 27 | + (!Mage::getStoreConfig('advanced/modules_disable_output/Mage_Poll'))) |
|
| 28 | + { |
|
| 29 | + $this->_template = $template; |
|
| 30 | + $this->setPollTemplate('turpentine/ajax.phtml', 'poll'); |
|
| 31 | + $this->setPollTemplate('turpentine/ajax.phtml', 'results'); |
|
| 32 | + } |
|
| 33 | + else |
|
| 34 | + { |
|
| 35 | + // Mage_Poll is disabled, so do nothing |
|
| 36 | + } |
|
| 37 | + return $this; |
|
| 38 | + } |
|
| 39 | 39 | } |
@@ -29,8 +29,7 @@ |
||
| 29 | 29 | $this->_template = $template; |
| 30 | 30 | $this->setPollTemplate('turpentine/ajax.phtml', 'poll'); |
| 31 | 31 | $this->setPollTemplate('turpentine/ajax.phtml', 'results'); |
| 32 | - } |
|
| 33 | - else |
|
| 32 | + } else |
|
| 34 | 33 | { |
| 35 | 34 | // Mage_Poll is disabled, so do nothing |
| 36 | 35 | } |
@@ -35,8 +35,7 @@ |
||
| 35 | 35 | $customTemplate = $this->_getCustomTemplateFilename(); |
| 36 | 36 | if ($customTemplate) { |
| 37 | 37 | $tplFile = $customTemplate; |
| 38 | - } |
|
| 39 | - else { |
|
| 38 | + } else { |
|
| 40 | 39 | $tplFile = $this->_getVclTemplateFilename(self::VCL_TEMPLATE_FILE); |
| 41 | 40 | } |
| 42 | 41 | $vcl = $this->_formatTemplate(file_get_contents($tplFile), |
@@ -110,8 +110,8 @@ |
||
| 110 | 110 | * @return string |
| 111 | 111 | */ |
| 112 | 112 | protected function _getVclTemplateFilename($baseFilename) { |
| 113 | - $extensionDir = Mage::getModuleDir('', 'Nexcessnet_Turpentine'); |
|
| 114 | - return sprintf('%s/misc/%s', $extensionDir, $baseFilename); |
|
| 113 | + $extensionDir = Mage::getModuleDir('', 'Nexcessnet_Turpentine'); |
|
| 114 | + return sprintf('%s/misc/%s', $extensionDir, $baseFilename); |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | /** |
@@ -148,8 +148,7 @@ |
||
| 148 | 148 | Mage::getStoreConfig('turpentine_varnish/servers/custom_vcl_template'), |
| 149 | 149 | array('root_dir' => Mage::getBaseDir()) |
| 150 | 150 | ); |
| 151 | - if (is_file($filePath)) { return $filePath; } |
|
| 152 | - else { return null; } |
|
| 151 | + if (is_file($filePath)) { return $filePath; } else { return null; } |
|
| 153 | 152 | } |
| 154 | 153 | |
| 155 | 154 | |
@@ -35,8 +35,7 @@ |
||
| 35 | 35 | $customTemplate = $this->_getCustomTemplateFilename(); |
| 36 | 36 | if ($customTemplate) { |
| 37 | 37 | $tplFile = $customTemplate; |
| 38 | - } |
|
| 39 | - else { |
|
| 38 | + } else { |
|
| 40 | 39 | $tplFile = $this->_getVclTemplateFilename(self::VCL_TEMPLATE_FILE); |
| 41 | 40 | } |
| 42 | 41 | $vcl = $this->_formatTemplate(file_get_contents($tplFile), |