Current file: htdocs/app/code/community/ArtsOnIT/OfflineMaintenance/Controller/Router/Standard.php
Legend: executed not executed dead code

  Coverage
  Classes Functions / Methods Lines
Total
0.00%0.00%
0.00% 0 / 1
0.00%0.00%
0.00% 0 / 1 CRAP
4.55%4.55%
4.55% 1 / 22
 
ArtsOnIT_OfflineMaintenance_Controller_Router_Standard
0.00%0.00%
0.00% 0 / 1
0.00%0.00%
0.00% 0 / 1
4.55%4.55%
4.55% 1 / 22
 match(Zend_Controller_Request_Http $request)
0.00%0.00%
0.00% 0 / 1 20
0.00%0.00%
0.00% 0 / 21


       1                 : <?php                                                                                                                                                                                                                          
       2                 : /*                                                                                                                                                                                                                             
       3                 :  * Magento ArtsOnIt Offline Maintenance Page                                                                                                                                                                                   
       4                 :  *                                                                                                                                                                                                                             
       5                 :  * @category   ArtsOnIt                                                                                                                                                                                                        
       6                 :  * @package    Mage_OfflineMaintenance                                                                                                                                                                                         
       7                 :  * @copyright  Copyright (c) 2009 ArtsOn.IT (http://www.ArtsOn.it)                                                                                                                                                             
       8                 :  * @author     Calore Luca Erico (l.calore@ArtsOn.it)                                                                                                                                                                          
       9                 :   *@licence     www.artson.it/licence/magento/omp                                                                                                                                                                              
      10                 :  */                                                                                                                                                                                                                            
      11                 : class ArtsOnIT_OfflineMaintenance_Controller_Router_Standard extends Mage_Core_Controller_Varien_Router_Standard                                                                                                               
      12               1 : {                                                                                                                                                                                                                              
      13                 :                                                                                                                                                                                                                                
      14                 :     public function match(Zend_Controller_Request_Http $request)                                                                                                                                                               
      15                 :     {                                                                                                                                                                                                                          
      16                 :                                                                                                                                                                                                                                
      17               0 :         $storeenabled = Mage::getStoreConfig('offlineMaintenance/settings/enabled', $request->getStoreCodeFromPath());                                                                                                         
      18                 :         if ($storeenabled)                                                                                                                                                                                                     
      19               0 :         {                                                                                                                                                                                                                      
      20               0 :             Mage::getSingleton('core/session', array('name' => 'adminhtml'));                                                                                                                                                  
      21               0 :             if (!Mage::getSingleton('admin/session')->isLoggedIn())                                                                                                                                                            
      22               0 :             {                                                                                                                                                                                                                  
      23               0 :                 Mage::getSingleton('core/session', array('name' => 'front'));                                                                                                                                                  
      24                 :                                                                                                                                                                                                                                
      25               0 :                 $front = $this->getFront();                                                                                                                                                                                    
      26               0 :                 $response = $front->getResponse();                                                                                                                                                                             
      27               0 :                 $response->setHeader('HTTP/1.1','503 Service Temporarily Unavailable');                                                                                                                                        
      28               0 :                 $response->setHeader('Status','503 Service Temporarily Unavailable');                                                                                                                                          
      29               0 :                 $response->setHeader('Retry-After','5000');                                                                                                                                                                    
      30                 :                                                                                                                                                                                                                                
      31               0 :                 $response->setBody(html_entity_decode( Mage::getStoreConfig('offlineMaintenance/settings/message', $request->getStoreCodeFromPath()), ENT_QUOTES, "utf-8" ));             $response->sendHeaders();            
      32               0 :                 $response->outputBody();                                                                                                                                                                                       
      33                 :                                                                                                                                                                                                                                
      34               0 :                 exit;                                                                                                                                                                                                          
      35                 :             }                                                                                                                                                                                                                  
      36                 :             else                                                                                                                                                                                                               
      37                 :             {                                                                                                                                                                                                                  
      38               0 :                 $showreminder = Mage::getStoreConfig('offlineMaintenance/settings/showreminder', $request->getStoreCodeFromPath());                                                                                            
      39                 :                 if ($showreminder)                                                                                                                                                                                             
      40               0 :                 {                                                                                                                                                                                                              
      41               0 :                     $front = $this->getFront();                                                                                                                                                                                
      42               0 :                     $response = $front->getResponse()->appendBody('<div style="height:12px; background:red; color: white; position:relative; width:100%;padding:3px; z-index:100000;text-trasform:capitalize;">Offline</div>');
      43               0 :                 }                                                                                                                                                                                                              
      44                 :             }                                                                                                                                                                                                                  
      45               0 :         }                                                                                                                                                                                                                      
      46               0 :         return parent::match($request);                                                                                                                                                                                        
      47                 :                                                                                                                                                                                                                                
      48                 :     }                                                                                                                                                                                                                          
      49                 :                                                                                                                                                                                                                                
      50                 :                                                                                                                                                                                                                                
      51                 :                                                                                                                                                                                                                                

Generated by PHP_CodeCoverage 1.0.4 using PHP 5.3.4 and PHPUnit 3.5.13 at Tue Jul 5 9:07:16 UTC 2011.