<commit_before><?php
define('MOEPRESS_VERSION', '1.1');

/**
 * MoePress Mini
 *
 * A multi-level controller PHP framework
 *
 * @version 1.1
 * @update 2014-09-06
 * @since 2013-10-06
 * @author <EMAIL>
 * @documentation http://www.cosify.com/work/moepress-mini
 *
 */
class MoePress
{
	static public $MP = NULL;			// MoePress Instance
	static public $config = array();	// global config (via config.php)
	
	protected $base_path = '';
	protected $model_path = '';
	protected $view_path  = '';
	protected $library_path = '';
	
	private $ob_level = null;			// to be used when load views
	private $loaded_files = array(		// to ensure files not being loaded twice
		'model' => array(),
		'library' => array()
	);
	
	public $site_url = '';				// current site's URL
	public $current_url = '';			// current URL
	public $data = array();				// variables used in views
	
	protected $argc = array();			// the limitation of the number of controller's arguments
	
	
	/**
	 * Init Controller
	 * DO NOT call this method more than ONCE.
	 *
	 * @version 2013-10-09
	 */
	public function __init()
	{
		// init file path
		$this->base_path = rtrim(getcwd(), '/') . '/';
		$this->model_path = $this->base_path . 'model/';
		$this->view_path = $this->base_path . 'view/';
		$this->library_path = $this->base_path . 'library/';
		
		// URLs
		$s = empty($_SERVER['HTTPS']) ? '' : ($_SERVER['HTTPS'] == 'n') ? 's' : '';
		$sp = strtolower($_SERVER['SERVER_PROTOCOL']);
		$protocol = substr($sp, 0, strpos($sp, '/')) . $s;
		$port = $_SERVER['SERVER_PORT']=='80' ? '' : ':'.$_SERVER['SERVER_PORT'];
		$url = $protocol . '://' . $_SERVER['SERVER_NAME'] . $port . '/';
		
		$this->site_url = $url;
		if (MoePress::$config['base_uri']) {
			$this->site_url .= trim(MoePress::$config['base_uri'], '/') . '/';
		}
		$this->current_url = $url . ltrim($_SERVER['REQUEST_URI'], '/');
	}
	

	/**
	 * Load view
	 *
	 * @version 2013-10-06<commit_msg>Change site_url from SERVER_NAME to HTTP_HOST<commit_after><?php
define('MOEPRESS_VERSION', '1.1.1');

/**
 * MoePress Mini
 *
 * A multi-level controller PHP framework
 *
 * @version 1.1.1
 * @update 2014-10-12
 * @since 2013-10-06
 * @author Cos<EMAIL>.<EMAIL>
 * @documentation http://www.cosify.com/work/moepress-mini
 *
 */
class MoePress
{
	static public $MP = NULL;			// MoePress Instance
	static public $config = array();	// global config (via config.php)
	
	protected $base_path = '';
	protected $model_path = '';
	protected $view_path  = '';
	protected $library_path = '';
	
	private $ob_level = null;			// to be used when load views
	private $loaded_files = array(		// to ensure files not being loaded twice
		'model' => array(),
		'library' => array()
	);
	
	public $site_url = '';				// current site's URL
	public $current_url = '';			// current URL
	public $data = array();				// variables used in views
	
	protected $argc = array();			// the limitation of the number of controller's arguments
	
	
	/**
	 * Init Controller
	 * DO NOT call this method more than ONCE.
	 *
	 * @version 2014-10-12
	 */
	public function __init()
	{
		// init file path
		$this->base_path = rtrim(getcwd(), '/') . '/';
		$this->model_path = $this->base_path . 'model/';
		$this->view_path = $this->base_path . 'view/';
		$this->library_path = $this->base_path . 'library/';
		
		// URLs
		$s = empty($_SERVER['HTTPS']) ? '' : ($_SERVER['HTTPS'] == 'n') ? 's' : '';
		$sp = strtolower($_SERVER['SERVER_PROTOCOL']);
		$protocol = substr($sp, 0, strpos($sp, '/')) . $s;
		$port = $_SERVER['SERVER_PORT']=='80' ? '' : ':'.$_SERVER['SERVER_PORT'];
		$url = $protocol . '://' . $_SERVER['HTTP_HOST'] . $port . '/';
		
		$this->site_url = $url;
		if (MoePress::$config['base_uri']) {
			$this->site_url .= trim(MoePress::$config['base_uri'], '/') . '/';
		}
		$this->current_url = $url . ltrim($_SERVER['REQUEST_URI'], '/');
	}
	

	/**
	 * Load view
	 *
	 * @version 2013-10-06
{'fraction_non_alphanumeric': 0.20072146354032466, 'fraction_numerical': 0.02061324400927596, 'mean_word_length': 3.2333696837513632, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 30, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '4453823', 'n_tokens_mistral': 1520, 'n_tokens_neox': 1355, 'n_words': 316}