<commit_before><?php
/**
 * LMLPHP Framework
 * Copyright (c) 2014 http://lmlphp.com All rights reserved.
 * Licensed ( http://mit-license.org/ )
 * Author: leiminglin <<EMAIL>>
 * 
 * A fully object-oriented PHP framework.
 * Keep it light, magnificent, lovely.
 * 
 * $id: $
 * 
 */

/**
function getRemoteLmlPhp(){
	$cache_filename = 'lml.min.php';
	$remotelib = 'http://pro8091d8.pic12.websiteonline.cn/upload/lmlphp-release-2014-08-27-v1.txt';
	if( file_exists( $cache_filename ) ) {
		$cachemtime = filemtime($cache_filename);
		if( $cachemtime + 86400 > time() ){
			require $cache_filename;
			return;
		}
		$header = get_headers($remotelib);
		foreach ($header as $k){
			if( preg_match('/^Last-Modified:/i', $k) ){
				$lastmtime = strtotime(preg_replace('/^Last-Modified:/i', '', $k));
				break;
			}
		}
		if( $lastmtime <= $cachemtime ){
			touch($cache_filename);
			require $cache_filename;
			return;
		}
	}
	$code = file_get_contents( $remotelib );
	file_put_contents($cache_filename, $code);
	eval('?>'.$code);
}
getRemoteLmlPhp();
*/

function lml($s='') {
	if($s == ''){
		return Lmlphp::getInstance();
	}else{
		return LmlDispatch::getInstance()->setWhat($s);
	}
}

/**
 * 
 * @author <EMAIL>
 *
 */
class Lmlphp {

	const appName = 'LMLPHP';
	const version = '1.0';
	private static $instance = '';
	private static $split = '';
	private static $filenamePrefix = 'debug_';
	private static $filenameSuffix = '.txt';
	private static $isOutDateInfo = true;
	private static $isOutSplit = true;
	private static $flags = FILE_APPEND;
	private static $resval;
	
	private $app;

	private function __construct(){}

	public static function getInstance(){
		if( self::$instance instanceof self ) {
			return self::$instance;
		}
		define('IS_CGI',substr(PHP_SAPI, 0,3)=='cgi' ? 1 : 0 );
		define('IS_WIN',strstr(PHP_OS, 'WIN') ? 1 : 0 );
		define('IS_CLI',PHP_SAPI=='cli'? 1 : 0);
		if( IS_WIN ){
			define('ENDL', "\r\n");
		}else{
			define('ENDL', "\n");
		}
		if( IS_CLI ){
			define('BR', "\n");
		}else {
			define('BR', "<br/>");
		}
		self::$split = str_pad('', 50, '-');
		return self::$instance = new self();
	}
	
	private static function init(){
		if(version_compare(PHP_VERSION,'5.4.0','<')) {
			ini_set('magic_quotes_runtime',0);
			define('MAGIC_QUOTES_GPC',get_magic_quotes_gpc()?true:false);
		}else{
			define('MAGIC_QUOTES_GPC',false);
		}
		if( MAGIC_QUOTES_GPC ){
			$_POST = self::deepStripSlashes($_POST);
			$_GET = self::deepStripSlashes($_GET);
			$_COOKIE = self::deepStripSlashes($_COOKIE);
		}
		$p = DIRECTORY_SEPARATOR;
		defined('PATH_PARAM') || define('PATH_PARAM', 'path');
		define('SCRIPT_DIR', realpath(dirname($_SERVER['SCRIPT_FILENAME'])));
		define('SCRIPT_PATH', SCRIPT_DIR.$p);
		if( !defined('APP_DIR') ){
			define('APP_DIR', SCRIPT_PATH.'App');
			$app_abs_dir = APP_DIR;
		}else{
			if(!is_dir(APP_DIR)){
				LmlUtils::mkdirDeep(APP_DIR);
			}
			$app_abs_dir = realpath(APP_DIR);
		}
		define('APP_PATH', $app_abs_dir.$p);
		defined('CONTENT_TYPE') || define('CONTENT_TYPE', 'text/html');
		defined('CHARSET') || define('CHARSET', 'utf-8');
		defined('MODULE_DIR_NAME') || define('MODULE_DIR_NAME', 'module');
		defined('MODEL_DIR_NAME') || define('MODEL_DIR_NAME', 'model');
		defined('LIB_DIR_NAME') || define('LIB_DIR_NAME', 'lib');
		defined('LOG_DIR_NAME') || define('LOG_DIR_NAME', 'log');
		defined('THEMES_DIR_NAME') || define('THEMES_DIR_NAME', 'themes');
		defined('DEFAULT_THEMES_NAME') || define('DEFAULT_THEMES_NAME', 'default');
		define('MODULE_PATH', APP_PATH.MODULE_DIR_NAME.$p);
		define('MODEL_PATH', APP_PATH.MODEL_DIR_NAME.$p);
		define('LIB_PATH', APP_PATH.LIB_DIR_NAME.$p);
		define('LOG_PATH', APP_PATH.LOG_DIR_NAME.$p);
		define('THEMES_PATH', APP_PATH.THEMES_DIR_NAME.$p);
		define('DEFAULT_THEME_PATH', THEMES_PATH.DEFAULT_THEMES_NAME.$p);
		define('WEB_PATH', preg_replace('/[^\/]+\.php$/', '', $_SERVER['SCRIPT_NAME']));
		if( defined('IS_REWRITE_ON') && !IS_REWRITE_ON ){<commit_msg>modify default_theme_name constant name<commit_after><?php
/**
 * LMLPHP Framework
 * Copyright (c) 2014 http://lmlphp.com All rights reserved.
 * Licensed ( http://mit-license.org/ )
 * Author: leiminglin <<EMAIL>>
 * 
 * A fully object-oriented PHP framework.
 * Keep it light, magnificent, lovely.
 * 
 * $id: $
 * 
 */

/**
function getRemoteLmlPhp(){
	$cache_filename = 'lml.min.php';
	$remotelib = 'http://pro8091d8.pic12.websiteonline.cn/upload/lmlphp-release-2014-08-27-v1.txt';
	if( file_exists( $cache_filename ) ) {
		$cachemtime = filemtime($cache_filename);
		if( $cachemtime + 86400 > time() ){
			require $cache_filename;
			return;
		}
		$header = get_headers($remotelib);
		foreach ($header as $k){
			if( preg_match('/^Last-Modified:/i', $k) ){
				$lastmtime = strtotime(preg_replace('/^Last-Modified:/i', '', $k));
				break;
			}
		}
		if( $lastmtime <= $cachemtime ){
			touch($cache_filename);
			require $cache_filename;
			return;
		}
	}
	$code = file_get_contents( $remotelib );
	file_put_contents($cache_filename, $code);
	eval('?>'.$code);
}
getRemoteLmlPhp();
*/

function lml($s='') {
	if($s == ''){
		return Lmlphp::getInstance();
	}else{
		return LmlDispatch::getInstance()->setWhat($s);
	}
}

/**
 * 
 * @author <EMAIL>
 *
 */
class Lmlphp {

	const appName = 'LMLPHP';
	const version = '1.0';
	private static $instance = '';
	private static $split = '';
	private static $filenamePrefix = 'debug_';
	private static $filenameSuffix = '.txt';
	private static $isOutDateInfo = true;
	private static $isOutSplit = true;
	private static $flags = FILE_APPEND;
	private static $resval;
	
	private $app;

	private function __construct(){}

	public static function getInstance(){
		if( self::$instance instanceof self ) {
			return self::$instance;
		}
		define('IS_CGI',substr(PHP_SAPI, 0,3)=='cgi' ? 1 : 0 );
		define('IS_WIN',strstr(PHP_OS, 'WIN') ? 1 : 0 );
		define('IS_CLI',PHP_SAPI=='cli'? 1 : 0);
		if( IS_WIN ){
			define('ENDL', "\r\n");
		}else{
			define('ENDL', "\n");
		}
		if( IS_CLI ){
			define('BR', "\n");
		}else {
			define('BR', "<br/>");
		}
		self::$split = str_pad('', 50, '-');
		return self::$instance = new self();
	}
	
	private static function init(){
		if(version_compare(PHP_VERSION,'5.4.0','<')) {
			ini_set('magic_quotes_runtime',0);
			define('MAGIC_QUOTES_GPC',get_magic_quotes_gpc()?true:false);
		}else{
			define('MAGIC_QUOTES_GPC',false);
		}
		if( MAGIC_QUOTES_GPC ){
			$_POST = self::deepStripSlashes($_POST);
			$_GET = self::deepStripSlashes($_GET);
			$_COOKIE = self::deepStripSlashes($_COOKIE);
		}
		$p = DIRECTORY_SEPARATOR;
		defined('PATH_PARAM') || define('PATH_PARAM', 'path');
		define('SCRIPT_DIR', realpath(dirname($_SERVER['SCRIPT_FILENAME'])));
		define('SCRIPT_PATH', SCRIPT_DIR.$p);
		if( !defined('APP_DIR') ){
			define('APP_DIR', SCRIPT_PATH.'App');
			$app_abs_dir = APP_DIR;
		}else{
			if(!is_dir(APP_DIR)){
				LmlUtils::mkdirDeep(APP_DIR);
			}
			$app_abs_dir = realpath(APP_DIR);
		}
		define('APP_PATH', $app_abs_dir.$p);
		defined('CONTENT_TYPE') || define('CONTENT_TYPE', 'text/html');
		defined('CHARSET') || define('CHARSET', 'utf-8');
		defined('MODULE_DIR_NAME') || define('MODULE_DIR_NAME', 'module');
		defined('MODEL_DIR_NAME') || define('MODEL_DIR_NAME', 'model');
		defined('LIB_DIR_NAME') || define('LIB_DIR_NAME', 'lib');
		defined('LOG_DIR_NAME') || define('LOG_DIR_NAME', 'log');
		defined('THEMES_DIR_NAME') || define('THEMES_DIR_NAME', 'themes');
		defined('DEFAULT_THEME_NAME') || define('DEFAULT_THEME_NAME', 'default');
		define('MODULE_PATH', APP_PATH.MODULE_DIR_NAME.$p);
		define('MODEL_PATH', APP_PATH.MODEL_DIR_NAME.$p);
		define('LIB_PATH', APP_PATH.LIB_DIR_NAME.$p);
		define('LOG_PATH', APP_PATH.LOG_DIR_NAME.$p);
		define('THEMES_PATH', APP_PATH.THEMES_DIR_NAME.$p);
		define('DEFAULT_THEME_PATH', THEMES_PATH.DEFAULT_THEME_NAME.$p);
		define('WEB_PATH', preg_replace('/[^\/]+\.php$/', '', $_SERVER['SCRIPT_NAME']));
		if( defined('IS_REWRITE_ON') && !IS_REWRITE_ON ){
{'fraction_non_alphanumeric': 0.19640838879819164, 'fraction_numerical': 0.010548788145171418, 'mean_word_length': 4.978978978978979, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3443905', 'n_tokens_mistral': 3344, 'n_tokens_neox': 3019, 'n_words': 495}