http://blog.chinaunix.net/uid-26559452-id-3093121.html
$cd shell
$ls
abstract.php compiler.php indexer.php log.php
$php -f compiler.php help
Usage: php -f compiler.php --[options]
state Show Compilation State
compile Run Compilation Process
clear Disable Compiler include path and Remove compiled files
enable Enable Compiler include path
disable Disable Compiler include path
help This help
$php -f compiler.php state
Compiler Status:Disabled
Compilation State: Not Compiled
Collected Files Count: 0
Compiled Scopes Count: 0
$php -f compiler.php compile
Compilation successfully finished
$php -f compiler.php state
Compiler Status: Enabled
Compilation State: Compiled
Collected Files Count: 6000
Compiled Scopes Count: 4
$php -f compiler.php disable
Compiler include path disabled
$php -f compiler.php state
Compiler Status:Disabled
Compilation State: Compiled
Collected Files Count: 6000
Compiled Scopes Count: 4
$php -f compiler.php enable
Compiler include path enabled
$php -f compiler.php state
Compiler Status: Enabled
Compilation State: Compiled
Collected Files Count: 6000
Compiled Scopes Count: 4
$php -f compiler.php clear
Compilation successfully cleared
$php -f compiler.php state
Compiler Status:Disabled
Compilation State: Not Compiled
Collected Files Count: 0
Compiled Scopes Count: 0
define('COMPILER_INCLUDE_PATH', dirname(__FILE__).DIRECTORY_SEPARATOR.'src');
#define('COMPILER_INCLUDE_PATH', dirname(__FILE__).DIRECTORY_SEPARATOR.'src');
Mage::register('original_include_path', get_include_path());// 保存當前的include_path
if (defined('COMPILER_INCLUDE_PATH')){// 如果設置爲編譯模式
$appPath = COMPILER_INCLUDE_PATH;
set_include_path($appPath . PS . Mage::registry('original_include_path'));// 添加includes/src爲include_path
include_once "Mage_Core_functions.php";
include_once "Varien_Autoload.php";
} else {// 沒有設置爲編譯模式
$paths[]= BP . DS .'app'. DS .'code'. DS .'local';
$paths[]= BP . DS .'app'. DS .'code'. DS .'community';
$paths[]= BP . DS .'app'. DS .'code'. DS .'core';
$paths[]= BP . DS .'lib';
$appPath = implode(PS, $paths);
set_include_path($appPath . PS . Mage::registry('original_include_path'));// 添加以上四個目錄爲include_path
include_once "Mage/Core/functions.php";
include_once "Varien/Autoload.php";
}