@@ -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__); |
@@ -231,16 +231,16 @@ |
||
| 231 | 231 | * @param string|object $model |
| 232 | 232 | * @return string |
| 233 | 233 | */ |
| 234 | - public function getModelName( $model ) { |
|
| 235 | - if( is_object( $model ) ) { |
|
| 236 | - $model = get_class( $model ); |
|
| 234 | + public function getModelName($model) { |
|
| 235 | + if (is_object($model)) { |
|
| 236 | + $model = get_class($model); |
|
| 237 | 237 | } |
| 238 | 238 | // This guess may work if the extension uses its lowercased name as model group name. |
| 239 | - $result = strtolower( preg_replace( |
|
| 240 | - '~^[^_]+_([^_]+)_Model_(.+)$~', '$1/$2', $model ) ); |
|
| 239 | + $result = strtolower(preg_replace( |
|
| 240 | + '~^[^_]+_([^_]+)_Model_(.+)$~', '$1/$2', $model )); |
|
| 241 | 241 | // This check is not expensive because the answer should come from Magento's classNameCache |
| 242 | 242 | $checkModel = Mage::getConfig()->getModelClassName($result); |
| 243 | - if ( 'Mage_' == substr($checkModel,0,5) && !class_exists($result) ) { |
|
| 243 | + if ('Mage_' == substr($checkModel, 0, 5) && ! class_exists($result)) { |
|
| 244 | 244 | // Fallback to full model name. |
| 245 | 245 | $result = $model; |
| 246 | 246 | } |