示例#1
0
文件: targets.php 项目: extend/wee
 public function getTargetFunctions($bGetParentTargets = false)
 {
     if ($bGetParentTargets) {
         return parent::getTargetFunctions();
     }
     static $aFunc = array('multi' => '"Windows NT" == ":1"', 'os' => 'php_uname("s") == ":1"', 'extver' => 'phpversion(":1") == ":2"');
     return $aFunc;
 }
示例#2
0
 /**
 	Cache-aware configuration loading.
 
 	If a cache file is available, load directly the configuration array from the cache.
 	Otherwise, create a weeConfigFile object, retrieve the configuration as an array,
 	save that array into a cache file and return it.
 
 	No cached data is loaded if DEBUG or NO_CACHE is defined.
 
 	@param $sFilename The configuration file's filename.
 	@param $sCacheFilename The configuration file's cache filename.
 	@return array The configuration data that has been loaded.
 */
 public static function cachedLoad($sFilename, $sCacheFilename)
 {
     $bCacheEnabled = !(defined('DEBUG') || defined('NO_CACHE'));
     // Load from the cache if possible
     if ($bCacheEnabled && is_readable($sCacheFilename)) {
         return require $sCacheFilename;
     }
     // Delete the cache file if it exists and DEBUG or NO_CACHE is enabled.
     // This eases the transition from one mode to another without having to clean-up files manually.
     if (is_file($sCacheFilename)) {
         unlink($sCacheFilename);
     }
     // Load the configuration file
     $oConfigFile = new weeConfigFile($sFilename);
     $aConfig = $oConfigFile->toArray();
     // Configuration file has been loaded, cache it for later if possible
     if ($bCacheEnabled && is_writable(dirname($sCacheFilename))) {
         file_put_contents($sCacheFilename, '<?php return ' . var_export($aConfig, true) . ';');
         chmod($sCacheFilename, 0600);
     }
     return $aConfig;
 }
示例#3
0
文件: include.php 项目: extend/wee
 public function getIncludeFilename($sPath)
 {
     return parent::getIncludeFilename($sPath);
 }
示例#4
0
文件: index.php 项目: extend/wee
// define('NO_CACHE', 1);
// The following string will be used as salt to enhance protection when using some of the
// session and cookie-related features in the framework. Do NOT use the default value.
// define('MAGIC_STRING', 'This is a magic string used to salt various hash throughout the framework.');
/*
	CONFIGURATION ENDS HERE. BOOTSTRAP CODE FOLLOWS.

	You shouldn't need to edit past this point unless you have very specific needs.
*/
// Load Web:Extend
define('ALLOW_INCLUSION', 1);
require 'wee/wee.php';
require 'wee/weexlib.php';
// Load the configuration and create the default application object.
try {
    $aConfig = weeConfigFile::cachedLoad(WEE_CONF_FILE, WEE_CONF_CACHE);
} catch (FileNotFoundException $e) {
    // The configuration file doesn't exist. Stop here and display a friendly message.
    if (defined('WEE_CLI')) {
        echo _WT('The configuration file was not found.') . "\n" . _WT('Please consult the documentation for more information.') . "\n";
    } else {
        if (defined('DEBUG')) {
            FirePHP::getInstance(true)->fb($e);
        }
        header('HTTP/1.0 500 Internal Server Error');
        require ROOT_PATH . 'res/wee/noconfig.htm';
    }
    exit;
}
weeApplication::setSharedInstance(new weeApplication($aConfig));
unset($aConfig);
示例#5
0
文件: parse.php 项目: extend/wee
 public function parseLine($sLine)
 {
     parent::parseLine($sLine);
 }