Advertisement
jayelkaake

Check if Magento Compiler is Enabled or Compiled

Jan 28th, 2015
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.85 KB | None | 0 0
  1.  
  2.     /**
  3.      * Checks if Magento has compiled files
  4.      * @return boolean true if any compiled files are found
  5.      */
  6.     public function isCompiled()
  7.     {
  8.         if (!Mage::helper('wf_customerbalance/version')->isBaseMageVersionAtLeast('1.4')) {
  9.             return false;
  10.         }
  11.  
  12.         $compiler = Mage::getModel('compiler/process');
  13.         if(!$compiler) {
  14.             return false;
  15.         }
  16.  
  17.         if($compiler->getCollectedFilesCount() == 0) {
  18.             return false;
  19.         }
  20.  
  21.         return true;
  22.     }
  23.  
  24.     /**
  25.      * Chekcs if the Magento compilation is enabled.
  26.      * @return boolean true if the Mangento compilation mode (compiler) is enabled
  27.      */
  28.     public function isCompilationEnabled()
  29.     {
  30.         if (!defined('COMPILER_INCLUDE_PATH')) {
  31.             return false;
  32.         }
  33.         return true;
  34.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement