Location: PHPKode > projects > Mocovie web framework > mocovi/library/autoload/Mocovi.php
<?php
/**
 *  Copyright (C) 2010  Kai Dorschner
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @author Kai Dorschner <the-hide@address.com>
 * @copyright Copyright 2010, Kai Dorschner
 * @license http://www.gnu.org/licenses/gpl.html GPLv3
 * @package mocovi
 */

class Mocovi
{
	const version = '0.9.7'; // Versioning scheme: maior.minor[.micro[.maintenance]]

	public static $namespace = 'http://mocovi.de/schema/xmlfs1.0';

	/**
	* Set Exception Handler as global Error Handler
	*/
	public static function errorHandler($errornumber, $message, $file = '', $line = -1)
	{
		throw new ErrorException
			( $message
			, $errornumber
			, 1 // $severity
			, $file
			, $line
			);
	}
	/*
		Constants:
		E_ERROR
		E_PARSE
		E_CORE_ERROR
		E_CORE_WARNING
		E_COMPILE_ERROR
		E_COMPILE_WARNING
		E_STRICT
	*/

	/*
	@deprecated
	public static function requirePHPVersion($v)
	{
		if(version_compare(PHP_VERSION, $v) < 0)
			throw new MvcException('Sorry, PHP Version '.$v.' or higher is required.');
	}
	*/

	public static function buildPath($path, $file)
	{
		return sprintf($GLOBALS['pathformat'], $GLOBALS['basepath'], $GLOBALS['linkprefix'], $path.$file, $GLOBALS['media']);
	}

	/**
	 * Returns the value of a global variable.
	 *
	 * This method is supposed to be used in XSLT files to make PHP variables accessible.
	 *
	 * @access public
	 * @static
	 * @param String $key Associative key in the PHP $GLOBALS array.
	 * @return mixed Variable value
	 */
	public static function getGlobal($key)
	{
		return $GLOBALS[$key];
	}
}
/*
	Version History:

	0.9.4
	========
	2011-04-29 13:48:17 Had a compatibility problem with Windows - solved [krnl]
	2011-04-29 13:48:17 Had a compatibility problem with Mac - solved [krnl]
	2011-04-13 15:13:25 Updated settings to make mocovi Windows compliant. [krnl]
	2011-04-07 19:55:08 Modified backend interface / interaction. Options are now activated via click. [krnl]
	2011-03-13 01:17:00 I optimized the client determination script. mocovi now loads the "mobi" view only if available. [krnl]
	2011-03-11 23:55:06 Improved URL rewriting in .htaccess and html.xsl, file extension is now optional. [krnl]
	2011-03-11 00:22:34 Improved dbreader, removed Zend dependency and used original MySQLi class from PHP [krnl]

	0.9.3
	========
	2011-03-10 02:03:24 Added database functionalities. [krnl]
	2011-03-09 04:32:39 Extracted a Control::load(); method from Control::run(); and put some anchors in both methods (_beforeLoad, _beforeCreateNode, _beforeLoadChilds, etc.). [krnl]
	2011-03-09 01:50:12 Added jQuery-like Control::find($controlname) method to find children in any hierarchical depth. [krnl]

	0.9.2
	========
	6:13 PM 2/9/2011 - Added form, input and formreceiver controls. Established dependencies between them. [krnl]
	6:13 PM 2/9/2011 - /mocovi/backend now contains a graphical editor for the XML filesystem. [krnl]
	6:13 PM 2/9/2011 - Improved model handling. It's now a real reference to the filesystem. All elements can now be compared for equality. [krnl]

	0.9.1
	========
	11:15 AM 9/21/2010 - .htaccess file added to .zip package (this was lost in the last version) [krnl]
	11:15 AM 9/21/2010 - Translation Class made a mistake with "all"-token-fallback. [krnl]
	06:29 PM 9/20/2010 - Added filesystem-based Multi-Domain support [krnl]

	0.9.0
	========
	11:39 PM 9/8/2010 - With this release you are able to nest controls into texts (as well as inline in the filesystem as in the translations too) [krnl]
	11:39 PM 9/8/2010 - Updated textnode control it's now calls "inline" [krnl]
	11:59 PM 2/9/2010 - Improved Control behaviour. It's now DomNode compliant. [krnl]

	0.8.59
	========
	1:52 PM 8/17/2010 - Added Mocovi::getGlobal(); method to make PHP global variables accessible in XSLT. [krnl]
	6:18 PM 8/16/2010 - Optimized execution of mocovi. It's now able to be run in a subfolder. [krnl]

	0.8.58
	========
	9:20 PM 5/24/2010 - Started to create protected_control (User Authentication). [krnl]
	21:57 30.04.2010 - Modified /mocovi/library/precheck.php and deprecated $GLOBALS['domain']. [krnl]
	21:37 30.04.2010 - fixed encoding problem in twitter_control [krnl]
	13:30 01.05.2010 - Revised node processing in MvcFactory::build(), Control::run(), ::createNode() and affected Control-inheritances. [krnl]
	13:58 01.05.2010 - Added Control::replaceChild() [krnl]

	0.8.57
	========
	18:59 24.04.2010 - Deleted some PHP5.3 specific Exception packing in feedreader_control [krnl]
	18:25 24.04.2010 - Fixed a bug in feedreader_control. Encoding Problems and unescaped entities both fixed with htmlspecialchars(); [krnl]
	12:18 24.04.2010 - Created method Mocovi::errorHandler(); and therefor deleted function mvcErrorHandler(); [krnl]
	11:45 24.04.2010 - Changed Class MocoviVersion to Mocovi and added this Version History here [krnl]
	11:26 24.04.2010 - Controls catch their own exceptions and wrap them into error_controls [krnl]
	11:00 24.04.2010 - Added new method Framework::required(String $fw); to set that a specific framework is required. Throws an Exception if not [krnl]

	0.8.56
	========
	20.04.2010 - Page settings excluded into settings.php, so index.php is now generic [krnl]
*/
Return current item: Mocovie web framework