1. Wuri Nugrahadi
  2. Tanur

Commits

Wuri Nugrahadi  committed 53728ea

Tanur v1.5 dengan CI 2.0.3 dan Doctrine.php 2.1.2

  • Participants
  • Parent commits ca4fb89
  • Branches default

Comments (0)

Files changed (213)

File application/.htaccess

View file
-<IfModule mod_rewrite.c>
-    RewriteEngine On
-    RewriteBase /
-
-    #Removes access to the system folder by users.
-    #Additionally this will allow you to create a System.php controller,
-    #previously this would not have been possible.
-    #'system' can be replaced if you have renamed your system folder.
-    RewriteCond %{REQUEST_URI} ^system.*
-    RewriteRule ^(.*)$ /index.php?/$1 [L]
-    
-    #When your application folder isn't in the system folder
-    #This snippet prevents user access to the application folder
-    #Submitted by: Fabdrol
-    #Rename 'application' to your applications folder name.
-    RewriteCond %{REQUEST_URI} ^application.*
-    RewriteRule ^(.*)$ /index.php?/$1 [L]
-
-    #Checks to see if the user is attempting to access a valid file,
-    #such as an image or css document, if this isn't true it sends the
-    #request to index.php
-    RewriteCond %{REQUEST_FILENAME} !-f
-    RewriteCond %{REQUEST_FILENAME} !-d
-    RewriteRule ^(.*)$ index.php?/$1 [L]
-</IfModule>
-
-<IfModule !mod_rewrite.c>
-    # If we don't have mod_rewrite installed, all 404's
-    # can be sent to index.php, and everything works as normal.
-    # Submitted by: ElliotHaughin
-
-    ErrorDocument 404 /index.php
-</IfModule>  
+Deny from all

File application/config/autoload.php

View file
 |
 */
 
-$autoload['packages'] = array(APPPATH.'third_party');
+$autoload['packages'] = array();
 
 
 /*
 |	$autoload['libraries'] = array('database', 'session', 'xmlrpc');
 */
 
-$autoload['libraries'] = array('doctrine', 'session');
+$autoload['libraries'] = array('doctrine');
 
 
 /*
 |	$autoload['helper'] = array('url', 'file');
 */
 
-$autoload['helper'] = array('url', 'form');
+$autoload['helper'] = array();
 
 
 /*

File application/config/config.php

View file
 | path to your installation.
 |
 */
-$config['base_url']	= "http://tanur.local/";
+$config['base_url']	= 'tanur.local';
 
 /*
 |--------------------------------------------------------------------------
 | variable so that it is blank.
 |
 */
-$config['index_page'] = "";
+$config['index_page'] = 'index.php';
 
 /*
 |--------------------------------------------------------------------------
 |--------------------------------------------------------------------------
 |
 | This item determines which server global should be used to retrieve the
-| URI string.  The default setting of "AUTO" works for most servers.
+| URI string.  The default setting of 'AUTO' works for most servers.
 | If your links do not seem to work, try one of the other delicious flavors:
 |
 | 'AUTO'			Default - auto detects
 | 'ORIG_PATH_INFO'	Uses the ORIG_PATH_INFO
 |
 */
-$config['uri_protocol']	= "AUTO";
+$config['uri_protocol']	= 'AUTO';
 
 /*
 |--------------------------------------------------------------------------
 | http://codeigniter.com/user_guide/general/urls.html
 */
 
-$config['url_suffix'] = "";
+$config['url_suffix'] = '';
 
 /*
 |--------------------------------------------------------------------------
 | than english.
 |
 */
-$config['language']	= "english";
+$config['language']	= 'english';
 
 /*
 |--------------------------------------------------------------------------
 | that require a character set to be provided.
 |
 */
-$config['charset'] = "UTF-8";
+$config['charset'] = 'UTF-8';
 
 /*
 |--------------------------------------------------------------------------
 | Enable/Disable System Hooks
 |--------------------------------------------------------------------------
 |
-| If you would like to use the "hooks" feature you must enable it by
+| If you would like to use the 'hooks' feature you must enable it by
 | setting this variable to TRUE (boolean).  See the user guide for details.
 |
 */
 | http://codeigniter.com/user_guide/general/creating_libraries.html
 |
 */
-$config['subclass_prefix'] = 'EM_';
+$config['subclass_prefix'] = 'MY_';
 
 
 /*
 |
 | Options are: TRUE or FALSE (boolean)
 |
-| The other items let you set the query string "words" that will
+| The other items let you set the query string 'words' that will
 | invoke your controllers and its functions:
 | example.com/index.php?c=controller&m=function
 |
 | MUST set an encryption key.  See the user guide for info.
 |
 */
-$config['encryption_key'] = 'ci_c#@Ge!-~';
+$config['encryption_key'] = '';
 
 /*
 |--------------------------------------------------------------------------
 | COOKIE data is encountered
 |
 */
-$config['global_xss_filtering'] = TRUE;
+$config['global_xss_filtering'] = FALSE;
 
 /*
 |--------------------------------------------------------------------------
 | 'csrf_cookie_name' = The cookie name
 | 'csrf_expire' = The number in seconds the token should expire.
 */
-$config['csrf_protection'] = TRUE;
+$config['csrf_protection'] = FALSE;
 $config['csrf_token_name'] = 'csrf_test_name';
 $config['csrf_cookie_name'] = 'csrf_cookie_name';
 $config['csrf_expire'] = 7200;
 | means you are prematurely outputting something to your browser. It could
 | even be a line of whitespace at the end of one of your scripts.  For
 | compression to work, nothing can be sent before the output buffer is called
-| by the output class.  Do not "echo" any values with compression enabled.
+| by the output class.  Do not 'echo' any values with compression enabled.
 |
 */
 $config['compress_output'] = FALSE;
 | Master Time Reference
 |--------------------------------------------------------------------------
 |
-| Options are "local" or "gmt".  This pref tells the system whether to use
-| your server's local time as the master "now" reference, or convert it to
-| GMT.  See the "date helper" page of the user guide for information
+| Options are 'local' or 'gmt'.  This pref tells the system whether to use
+| your server's local time as the master 'now' reference, or convert it to
+| GMT.  See the 'date helper' page of the user guide for information
 | regarding date handling.
 |
 */
 
 
 /* End of file config.php */
-/* Location: ./application/config/config.php */
+/* Location: ./application/config/config.php */

File application/config/database.php

View file
 |	['cachedir'] The path to the folder where cache files should be stored
 |	['char_set'] The character set used in communicating with the database
 |	['dbcollat'] The character collation used in communicating with the database
+|				 NOTE: For MySQL and MySQLi databases, this setting is only used
+| 				 as a backup if your server is running PHP < 5.2.3 or MySQL < 5.0.7.
+| 				 There is an incompatibility in PHP with mysql_real_escape_string() which
+| 				 can make your site vulnerable to SQL injection if you are using a
+| 				 multi-byte character set and are running versions lower than these.
+| 				 Sites using Latin-1 or UTF-8 database character set and collation are unaffected.
 |	['swap_pre'] A default table prefix that should be swapped with the dbprefix
 |	['autoinit'] Whether or not to automatically initialize the database.
 |	['stricton'] TRUE/FALSE - forces 'Strict Mode' connections
 $db['default']['hostname'] = 'localhost';
 $db['default']['username'] = 'nug';
 $db['default']['password'] = 'dini';
-$db['default']['database'] = 'proyek_tanur';
+$db['default']['database'] = 'ci_doctrine';
 $db['default']['dbdriver'] = 'mysql';
-$db['default']['dbprefix'] = 'mpu_';
+$db['default']['dbprefix'] = '';
 $db['default']['pconnect'] = TRUE;
 $db['default']['db_debug'] = TRUE;
 $db['default']['cache_on'] = FALSE;

File application/config/hooks.php

View file
 |
 */
 
-$hook['pre_system'] = array(
-	'function' => 'load_exceptions',
-	'filename' => 'uhoh.php',
-	'filepath' => 'hooks',
-);
+
 
 /* End of file hooks.php */
-/* Location: ./application/config/hooks.php */
+/* Location: ./application/config/hooks.php */

File application/config/mimes.php

View file
 
 $mimes = array(	'hqx'	=>	'application/mac-binhex40',
 				'cpt'	=>	'application/mac-compactpro',
-				'csv'	=>	array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel'),
+				'csv'	=>	array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel'),
 				'bin'	=>	'application/macbinary',
 				'dms'	=>	'application/octet-stream',
 				'lha'	=>	'application/octet-stream',

File application/config/routes.php

View file
 |
 */
 
-
-$route['default_controller'] = "home";
+$route['default_controller'] = "welcome";
 $route['404_override'] = '';
 
-$route['admin/(:any)/(:any)'] = '$1/admin/$2';
-$route['admin/(:any)'] = '$1/admin';
-
 
 /* End of file routes.php */
 /* Location: ./application/config/routes.php */

File application/controllers/.htaccess

-deny from all

File application/controllers/home.php

-<?php
-
-class Home extends EM_Controller {
-	### Extended CI_Controller /application/core/DI_Controller.php
-
- 
-	private static function makeRandomDateInclusive($startDate,$endDate){ 
-		return date("Y-m-d",strtotime("$startDate + ".rand(0,round((strtotime($endDate) - strtotime($startDate)) / (60 * 60 * 24)))." days"));
-	}
- 
-	function  __construct()  {
-		/* Inherit the CI_Controller construct because we're using a 
-		   custom controller with $this->em for Doctrine already set */
-		parent::__construct();
-	}
-            
-  function index() {
-		// To make a new user model!
-		// $user = new models/User;
-		
-		// Example Doctrine Queries
-		// $user = $this->em->find('models\User','1');
-		// $user = $this->em->getRepository('models\User')->find('1');
-		// $users = $this->em->getRepository('models\User')->findBy(array('username' => 'Gariasdkfjs', 'password' => 'asdfasdfasdf'));
-		
-		// create query
-		$users = $this->em->createQuery("select a from models\User a")->getResult();
-	
-		/* Now that we're changed the "username" column in the "user" table go ahead and grab it and pass it into our view for testing. */
-		// $message = "<h2 id='number_of_users'>Number of users " . count($users) . "</h2><br />";
-		$message = "";
-		
-		// Declare the $user variable as an object
-		$user = new models\User;
-	
-		// Treat print each user data
-		foreach ($users as $user) {
-			// $user_referrer = new models\User;
-			$user_referrer = $this->em->find('models\User',$user->getRefererID());
-			
-			$message .= "<div class='post'>\n"; // div post
-			
-			$message .= "<h2 class='title'><a href='#'>User " . $user->getUsername() . "</a></h2>";
-			$message .= "<p class='meta'>Posted by <a href='#'>" . $user->getUsername() . "</a> on " . $this::makeRandomDateInclusive('2009-04-01',date("Y-M-m")) . " &nbsp;&bull;&nbsp; <a href='#' class='comments'>Comments (" . rand(1,100) . ")</a> &nbsp;&bull;&nbsp; <a href='#' class='permalink'>Full article</a></p>";
-			
-			$message .= "<div class='entry' id='" . $user->getID() . "'>\n"; // div entry
-			$message .= "<p>"; // p
-			
-			// This adds a picture to the result message depending on the value of rand (random, 0 or 1)
-			if (rand(0,1)) {
-				$message .= "<img src='" . site_url() . "application/views/images/img05.jpg' width='143' height='143' alt='' class='alignleft border' />"; }
-			
-			$message .= "User <strong>" . $user->getUsername() . "</strong>";
-			
-			// only adds referrer if it exists, since referrer is set as not null in the models (not strictly required), there will be instances that this can be skipped entirely during registration.
-			if ($user_referrer){
-				$message .= " was reffered by  " . $user_referrer->getUsername() . ". He ";
-			}
-			
-			
-			$message .= "has an ID number autogenerated from the database with a value of " . $user->getId() . " and his email address is " . $user->getEmail() . ".</p>\n"; // end p
-			
-			$message .= "</div>\n";  // end entry
-			
-			$message .= "</div>\n";  // end post
-		}
-		
-		// The data to send to the view
-		$this->data['title'] = "Home";
-		$this->data['header'] = "Users";
-		$this->data['content'] = $message;
-				
-		// Load the view with the data
-		$this->load->view('home', $this->data);
-	}
-
-}

File application/controllers/login.php

-<?php
-
-class Login extends EM_Controller {
-	public function __construct() {
-		parent::__construct();
-		$this->load->helper(array('form','url'));
-	}
-	
-	// this is the default function
-	public function index() {
-		$this->data['title'] = "Login now!";
-		$this->load->view('login_form', $this->data);
-	}
-
-	// this function will recieve information from the login_form view.
-	public function submit() {
-		// Receive the post data
-		$posted_username = $this->input->post('username');
-		$posted_password = $this->input->post('password');
-
-		// Setup the Doctrine Query
-		$DQLquery = "select a from models\User a WHERE a.username = :username AND a.password = :password";
-		
-		// Serupt the query parameters
-		$query = $this->em->createQuery($DQLquery);
-		$query->setParameters(array(
-				'username' => $posted_username,
-				'password' => $posted_password,
-		)); 
-		
-		$this->data['content'] = "";
-		
-		// Get the array of models\User objects
-		$users = $query->getResult();
-		
-		if (count($users) == 1) {
-			$user = new models\User;
-			$user = $users[0];
-			
-			$this->data['content'] .= "<div class='post'>\n"; // div post
-			
-			$this->data['content'] .= "<h2 class='title'><a href='#'>Logged in " . $user->getUsername() . "</a></h2>";
-			$this->data['content'] .= "<p class='meta'>Posted by <a href='#'>" . $user->getUsername() . "</a> on " . '2009-04-01' . " &nbsp;&bull;&nbsp; <a href='#' class='comments'>Comments (" . rand(1,100) . ")</a> &nbsp;&bull;&nbsp; <a href='#' class='permalink'>Full article</a></p>";
-			
-			$this->data['content'] .= "<div class='entry' id='" . $user->getID() . "'>\n"; // div entry
-			$this->data['content'] .= "<p>"; // p
-			
-			$this->data['content'] .= "<p>Success!</p><br />\n";
-			$this->data['content'] .= "<p>Your username is " . $user->getUsername()  . "</p><br />\n";
-			$this->data['content'] .= "<p>Your email address is " . $user->getEmail()  . "</p><br />\n";
-			$this->data['content'] .= "<p>Your password is " . $user->getPassword() . "</p><br />\n";
-			$this->data['content'] .= "<p>Your facebook id is " . $user->getFacebookID() . "</p><br />\n";
-						
-			$this->data['content'] .= "</div>\n";  // end entry
-			
-			$this->data['content'] .= "</div>\n";  // end post
-			
-
-			$this->data['header'] = "Success";
-			$this->data['title'] = "Success";
-		} else {
-			$this->data['header'] = "Login Failed!";
-			$this->data['title'] = "Login Failed!";
-			
-			$this->data['content'] .= "<div class='post'>\n"; // div post
-			$this->data['content'] .= "<h2 class='title'><a href='#'>Login Failed</a></h2>";
-			$this->data['content'] .= "<div class='entry'>\n"; // div entry
-			$this->data['content'] .= "<p>Failed!</p><br />\n";
-			$this->data['content'] .= "</div>\n";  // end entry
-			$this->data['content'] .= "</div>\n";  // end post
-		}
-		
-		// $data['content'] .= $query . "<br />";
-		$this->load->view('login_success', $this->data);
-	}
-
-}

File application/controllers/signup.php

-<?php
-
-class Signup extends EM_Controller {
-
-	public function __construct() {
-		parent::__construct();
-		
-		$this->load->helper(array('form','url'));
-		$this->load->library('form_validation');
-
-	}
-
-	public function submit() {
-
-		if ($this->_submit_validate() === FALSE) {
-			$this->index();
-			return;
-		}
-		
-		$user = new models\User;
-		$user->setUsername($this->input->post('username'));
-		$user->setPassword($this->input->post('password'));
-		$user->setEmail($this->input->post('email'));	
-		$user->setRefererID(1);	
-		$user->setFacebookID($this->input->post('facebook_id'));	
-		
-		$this->em->persist($user);
-		$this->em->flush();
-		
-		$this->data['content'] = "<div class='post'>\n"; // div post
-		
-		$this->data['content'] .= "<h2 class='title'><a href='#'>Signedup " . $user->getUsername() . "</a></h2>";
-		$this->data['content'] .= "<p class='meta'>Posted by <a href='#'>" . $user->getUsername() . "</a> on " . '2009-04-01' . " &nbsp;&bull;&nbsp; <a href='#' class='comments'>Comments (" . rand(1,100) . ")</a> &nbsp;&bull;&nbsp; <a href='#' class='permalink'>Full article</a></p>";
-		
-		$this->data['content'] .= "<div class='entry' id='" . $user->getID() . "'>\n"; // div entry
-		$this->data['content'] .= "<p>"; // p
-		
-		$this->data['content'] .= "<p>Success!</p><br />\n";
-		$this->data['content'] .= "<p>Your username is " . $user->getUsername()  . "</p><br />\n";
-		$this->data['content'] .= "<p>Your email address is " . $user->getEmail()  . "</p><br />\n";
-		$this->data['content'] .= "<p>Your password is " . $user->getPassword() . "</p><br />\n";
-		$this->data['content'] .= "<p>Your facebook id is " . $user->getFacebookID() . "</p><br />\n";
-					
-		$this->data['content'] .= "</div>\n";  // end entry
-		
-		$this->data['content'] .= "</div>\n";  // end post
-		
-		// Prepare the header and the title
-		$this->data['title'] = "Success!";
-		$this->data['header'] = "Success!";
-		
-		$this->load->view('signup_success', $this->data);
-	}
-	
-	private function _submit_validate() {
-
-		// validation rules
-		$this->form_validation->set_rules('username', 'Username',
-			'required|alpha_numeric|min_length[6]|max_length[12]|unique[User.email]');
-
-		$this->form_validation->set_rules('password', 'Password',
-			'required|min_length[6]|max_length[12]');
-
-		$this->form_validation->set_rules('passconf', 'Confirm Password',
-			'required|matches[password]');
-
-		$this->form_validation->set_rules('email', 'E-mail',
-			'required|valid_email|unique[User.email]');
-			
-		$this->form_validation->set_rules('facebook_id', 'Your facebook ID',
-			'required');
-			
-		return $this->form_validation->run();
-
-	}
-	
-	public function index() {
-		$this->load->view('signup_form');
-	}
-
-}

File application/controllers/welcome.php

View file
 <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
 
-class Welcome extends EM_Controller {
+class Welcome extends CI_Controller {
 
-	function __construct()
+	/**
+	 * Index Page for this controller.
+	 *
+	 * Maps to the following URL
+	 * 		http://example.com/index.php/welcome
+	 *	- or -  
+	 * 		http://example.com/index.php/welcome/index
+	 *	- or -
+	 * Since this controller is set as the default controller in 
+	 * config/routes.php, it's displayed at http://example.com/
+	 *
+	 * So any other public methods not prefixed with an underscore will
+	 * map to /index.php/welcome/<method_name>
+	 * @see http://codeigniter.com/user_guide/general/urls.html
+	 */
+	public function index()
 	{
-		parent::__construct();
-	}
-
-	function index()
-	{
-		$data['title'] = "Welcome home!";
-		$data['message'] = "<h1>Welcome home!</h1>";
-		
-		$this->load->view('welcome_message', $data);
+		$this->load->view('welcome_message');
 	}
 }
 

File application/core/EM_Config.php

-<?php
-class EM_Config extends CI_Config
-{
-    /**
-     * Site URL
-     *
-     * Extended to allow a combination segment-based URLs and query strings when using the
-     * uri_protocol = PATH_INFO / enable_query_strings = TRUE configuration setting.
-     *
-     * @access  public
-     * @param   string  the URI string
-     * @return  string
-     */
-    function site_url($uri = '')
-    {
-        if ($uri == '')
-        {
-            if ($this->item('base_url') == '')
-            {
-                return $this->item('index_page');
-            }
-            else
-            {
-                return $this->slash_item('base_url').$this->item('index_page');
-            }
-        }
- 
-        if ($this->item('enable_query_strings') == FALSE OR $this->item('uri_protocol') == 'PATH_INFO')
-        {
-            if (is_array($uri))
-            {
-                $uri = implode('/', $uri);
-            }
- 
-            $suffix = ($this->item('url_suffix') == FALSE) ? '' : $this->item('url_suffix');
-            return $this->slash_item('base_url').$this->slash_item('index_page').trim($uri, '/').$suffix;
-        }
-        else
-        {
-            if (is_array($uri))
-            {
-                $i = 0;
-                $str = '';
-                foreach ($uri as $key => $val)
-                {
-                    $prefix = ($i == 0) ? '' : '&';
-                    $str .= $prefix.$key.'='.$val;
-                    $i++;
-                }
- 
-                $uri = $str;
-            }
- 
-            if ($this->item('base_url') == '')
-            {
-                return $this->item('index_page').'?'.$uri;
-            }
-            else
-            {
-                return $this->slash_item('base_url').$this->item('index_page').'?'.$uri;
-            }
-        }
-    }
-}

File application/core/EM_Controller.php

-<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
-
-## Extend CI_Controller to include Doctrine Entity Manager
-
-class  EM_Controller  extends  CI_Controller  {
-
-	public $em;
-	public $data;
-
-	function __construct()  {
-	
-		parent::__construct();
-		
-		
-		/* Initialize things you don't want to do over and over again in all your controllers. */
-		$this->data['footer']= "&copy; 2011";
-		$this->data['content']= "No content yet.";
-		$this->data['header']= "No header defined";
-		$this->data['title']= "Untitled";
-		
-		/* Instantiate Doctrine's Entity manage so we don't have to everytime we want to use Doctrine */
-		$this->em = $this->doctrine->em;
-		
-	}
-
-}
-
-/* End of file EM_Controller.php */
-/* location ./application/core/EM_Controller.php */

File application/core/EM_Exceptions.php

-<?php defined('BASEPATH') OR exit('No direct script access allowed');
-
-// To disable UhOh! simply change IN_PRODUCTION to TRUE.
-if ( ! defined('IN_PRODUCTION'))
-{
-	define('IN_PRODUCTION', FALSE);
-}
-
-/**
- * CodeIgniter UhOh!
- *
- * This is an extension on CI_Extensions that provides awesome error messages
- * with full backtraces and a view of the line with the error.  It is based
- * on Kohana v3 Error Handling.
- *
- * @package		CodeIgniter
- * @author		Dan Horrigan <http://dhorrigan.com>
- * @license		Apache License v2.0
- * @version		1.0
- */
-
-/**
- * This file contains some functions originally from Kohana.  They have been modified
- * to work with CodeIgniter.  Here is the obligatory Kohana license info:
- *
- * @copyright  (c) 2008-2009 Kohana Team
- * @license	   http://kohanaphp.com/license
- */
-
-/**
- * EM_Exceptions
- *
- * @subpackage	Exceptions
- */
-class EM_Exceptions extends CI_Exceptions
-{
-	/**
-	 * Some nice names for the error types
-	 */
-	public static $php_errors = array(
-		E_ERROR				 => 'Fatal Error',
-		E_USER_ERROR		 => 'User Error',
-		E_PARSE				 => 'Parse Error',
-		E_WARNING			 => 'Warning',
-		E_USER_WARNING		 => 'User Warning',
-		E_STRICT			 => 'Strict',
-		E_NOTICE			 => 'Notice',
-		E_RECOVERABLE_ERROR	 => 'Recoverable Error',
-	);
-	
-	/**
-	 * The Shutdown errors to show (all others will be ignored).
-	 */
-	public static $shutdown_errors = array(E_PARSE, E_ERROR, E_USER_ERROR, E_COMPILE_ERROR);
-	
-	/**
-	 * Construct
-	 *
-	 * Sets the error handlers.
-	 *
-	 * @access	public
-	 * @return	void
-	 */
-	public function __construct()
-	{
-		parent::__construct();
-		
-		// If we are in production, then lets dump out now.
-		if (IN_PRODUCTION)
-		{
-			return;
-		}
-		
-		//Set the Exception Handler
-		set_exception_handler(array('EM_Exceptions', 'exception_handler'));
-
-		// Set the Error Handler
-		set_error_handler(array('EM_Exceptions', 'error_handler'));
-
-		// Set the handler for shutdown to catch Parse errors
-		register_shutdown_function(array('EM_Exceptions', 'shutdown_handler'));
-
-		// This is a hack to set the default timezone if it isn't set. Not setting it causes issues.
-		date_default_timezone_set(date_default_timezone_get());
-	}
-
-	/**
-	 * Debug Path
-	 *
-	 * This makes nicer looking paths for the error output.
-	 *
-	 * @access	public
-	 * @param	string	$file
-	 * @return	string
-	 */
-	public static function debug_path($file)
-	{
-		if (strpos($file, APPPATH) === 0)
-		{
-			$file = 'APPPATH/'.substr($file, strlen(APPPATH));
-		}
-		elseif (strpos($file, SYSDIR) === 0)
-		{
-			$file = 'SYSDIR/'.substr($file, strlen(SYSDIR));
-		}
-		elseif (strpos($file, FCPATH) === 0)
-		{
-			$file = 'FCPATH/'.substr($file, strlen(FCPATH));
-		}
-
-		return $file;
-	}
-	
-	/**
-	 * Error Handler
-	 *
-	 * Converts all errors into ErrorExceptions. This handler
-	 * respects error_reporting settings.
-	 *
-	 * @access	public
-	 * @throws	ErrorException
-	 * @return	bool
-	 */
-	public static function error_handler($code, $error, $file = NULL, $line = NULL)
-	{
-		if (error_reporting() & $code)
-		{
-			// This error is not suppressed by current error reporting settings
-			// Convert the error into an ErrorException
-			self::exception_handler(new ErrorException($error, $code, 0, $file, $line));
-		}
-
-		// Do not execute the PHP error handler
-		return TRUE;
-	}
-
-	/**
-	 * Exception Handler
-	 *
-	 * Displays the error message, source of the exception, and the stack trace of the error.
-	 *
-	 * @access	public
-	 * @param	object	 exception object
-	 * @return	boolean
-	 */
-	public static function exception_handler(Exception $e)
-	{
-		try
-		{
-			// Get the exception information
-			$type	 = get_class($e);
-			$code	= $e->getCode();
-			$message = $e->getMessage();
-			$file	 = $e->getFile();
-			$line	 = $e->getLine();
-
-			// Create a text version of the exception
-			$error = self::exception_text($e);
-
-			// Log the error message
-			log_message('error', $error, TRUE);
-
-			// Get the exception backtrace
-			$trace = $e->getTrace();
-
-			if ($e instanceof ErrorException)
-			{
-				if (isset(self::$php_errors[$code]))
-				{
-					// Use the human-readable error name
-					$code = self::$php_errors[$code];
-				}
-
-				if (version_compare(PHP_VERSION, '5.3', '<'))
-				{
-					// Workaround for a bug in ErrorException::getTrace() that exists in
-					// all PHP 5.2 versions. @see http://bugs.php.net/bug.php?id=45895
-					for ($i = count($trace) - 1; $i > 0; --$i)
-					{
-						if (isset($trace[$i - 1]['args']))
-						{
-							// Re-position the args
-							$trace[$i]['args'] = $trace[$i - 1]['args'];
-
-							// Remove the args
-							unset($trace[$i - 1]['args']);
-						}
-					}
-				}
-			}
-			// Start an output buffer
-			ob_start();
-
-			// This will include the custom error file.
-			require APPPATH . 'errors/error_php_custom.php';
-
-			// Display the contents of the output buffer
-			echo ob_get_clean();
-
-			return TRUE;
-		}
-		catch (Exception $e)
-		{
-			// Clean the output buffer if one exists
-			ob_get_level() and ob_clean();
-
-			// Display the exception text
-			echo self::exception_text($e), "\n";
-
-			// Exit with an error status
-			exit(1);
-		}
-	}
-	
-	/**
-	 * Shutdown Handler
-	 *
-	 * Catches errors that are not caught by the error handler, such as E_PARSE.
-	 *
-	 * @access	public
-	 * @return	void
-	 */
-	public static function shutdown_handler()
-	{
-		$error = error_get_last();
-		if ($error = error_get_last() AND in_array($error['type'], self::$shutdown_errors))
-		{
-			// Clean the output buffer
-			ob_get_level() and ob_clean();
-
-			// Fake an exception for nice debugging
-			self::exception_handler(new ErrorException($error['message'], $error['type'], 0, $error['file'], $error['line']));
-
-			// Shutdown now to avoid a "death loop"
-			exit(1);
-		}
-	}
-	
-	/**
-	 * Exception Text
-	 *
-	 * Makes a nicer looking, 1 line extension.
-	 *
-	 * @access	public
-	 * @param	object	Exception
-	 * @return	string
-	 */
-	public static function exception_text(Exception $e)
-	{
-		return sprintf('%s [ %s ]: %s ~ %s [ %d ]',
-			get_class($e), $e->getCode(), strip_tags($e->getMessage()), $e->getFile(), $e->getLine());
-	}
-	
-	/**
-	 * Debug Source
-	 *
-	 * Returns an HTML string, highlighting a specific line of a file, with some
-	 * number of lines padded above and below.
-	 *
-	 * @access	public
-	 * @param	string	 file to open
-	 * @param	integer	 line number to highlight
-	 * @param	integer	 number of padding lines
-	 * @return	string	 source of file
-	 * @return	FALSE	 file is unreadable
-	 */
-	public static function debug_source($file, $line_number, $padding = 5)
-	{
-		if ( ! $file OR ! is_readable($file))
-		{
-			// Continuing will cause errors
-			return FALSE;
-		}
-
-		// Open the file and set the line position
-		$file = fopen($file, 'r');
-		$line = 0;
-
-		// Set the reading range
-		$range = array('start' => $line_number - $padding, 'end' => $line_number + $padding);
-
-		// Set the zero-padding amount for line numbers
-		$format = '% '.strlen($range['end']).'d';
-
-		$source = '';
-		while (($row = fgets($file)) !== FALSE)
-		{
-			// Increment the line number
-			if (++$line > $range['end'])
-				break;
-
-			if ($line >= $range['start'])
-			{
-				// Make the row safe for output
-				$row = htmlspecialchars($row, ENT_NOQUOTES);
-
-				// Trim whitespace and sanitize the row
-				$row = '<span class="number">'.sprintf($format, $line).'</span> '.$row;
-
-				if ($line === $line_number)
-				{
-					// Apply highlighting to this row
-					$row = '<span class="line highlight">'.$row.'</span>';
-				}
-				else
-				{
-					$row = '<span class="line">'.$row.'</span>';
-				}
-
-				// Add to the captured source
-				$source .= $row;
-			}
-		}
-
-		// Close the file
-		fclose($file);
-
-		return '<pre class="source"><code>'.$source.'</code></pre>';
-	}
-	
-	/**
-	 * Trace
-	 *
-	 * Returns an array of HTML strings that represent each step in the backtrace.
-	 *
-	 * @access	public
-	 * @param	string	path to debug
-	 * @return	string
-	 */
-	public static function trace(array $trace = NULL)
-	{
-		if ($trace === NULL)
-		{
-			// Start a new trace
-			$trace = debug_backtrace();
-		}
-
-		// Non-standard function calls
-		$statements = array('include', 'include_once', 'require', 'require_once');
-
-		$output = array();
-		foreach ($trace as $step)
-		{
-			if ( ! isset($step['function']))
-			{
-				// Invalid trace step
-				continue;
-			}
-
-			if (isset($step['file']) AND isset($step['line']))
-			{
-				// Include the source of this step
-				$source = self::debug_source($step['file'], $step['line']);
-			}
-
-			if (isset($step['file']))
-			{
-				$file = $step['file'];
-
-				if (isset($step['line']))
-				{
-					$line = $step['line'];
-				}
-			}
-
-			// function()
-			$function = $step['function'];
-
-			if (in_array($step['function'], $statements))
-			{
-				if (empty($step['args']))
-				{
-					// No arguments
-					$args = array();
-				}
-				else
-				{
-					// Sanitize the file path
-					$args = array($step['args'][0]);
-				}
-			}
-			elseif (isset($step['args']))
-			{
-				if (strpos($step['function'], '{closure}') !== FALSE)
-				{
-					// Introspection on closures in a stack trace is impossible
-					$params = NULL;
-				}
-				else
-				{
-					if (isset($step['class']))
-					{
-						if (method_exists($step['class'], $step['function']))
-						{
-							$reflection = new ReflectionMethod($step['class'], $step['function']);
-						}
-						else
-						{
-							$reflection = new ReflectionMethod($step['class'], '__call');
-						}
-					}
-					else
-					{
-						$reflection = new ReflectionFunction($step['function']);
-					}
-
-					// Get the function parameters
-					$params = $reflection->getParameters();
-				}
-
-				$args = array();
-
-				foreach ($step['args'] as $i => $arg)
-				{
-					if (isset($params[$i]))
-					{
-						// Assign the argument by the parameter name
-						$args[$params[$i]->name] = $arg;
-					}
-					else
-					{
-						// Assign the argument by number
-						$args[$i] = $arg;
-					}
-				}
-			}
-
-			if (isset($step['class']))
-			{
-				// Class->method() or Class::method()
-				$function = $step['class'].$step['type'].$step['function'];
-			}
-
-			$output[] = array(
-				'function' => $function,
-				'args'	   => isset($args)	 ? $args : NULL,
-				'file'	   => isset($file)	 ? $file : NULL,
-				'line'	   => isset($line)	 ? $line : NULL,
-				'source'   => isset($source) ? $source : NULL,
-			);
-
-			unset($function, $args, $file, $line, $source);
-		}
-
-		return $output;
-	}
-
-	/**
-	 * General Error Page
-	 *
-	 * This function takes an error message as input
-	 * (either as a string or an array) and displays
-	 * it using the specified template.
-	 *
-	 * @access	private
-	 * @param	string	the heading
-	 * @param	string	the message
-	 * @param	string	the template name
-	 * @return	string
-	 */
-	function show_error($heading, $message, $template = 'error_general', $status_code = 500)
-	{
-		// If we are in production, then lets dump out now.
-		if (IN_PRODUCTION)
-		{
-			return parent::show_error($heading, $message, $template, $status_code);
-		}
-		
-		if( ! headers_sent())
-		{
-			set_status_header($status_code);
-		}
-		$trace = debug_backtrace();
-		$file = NULL;
-		$line = NULL;
-		
-		$is_from_app = FALSE;
-		if(isset($trace[1]['file']) AND strpos($trace[1]['file'], APPPATH) === 0)
-		{
-			$is_from_app = !self::is_extension($trace[1]['file']);
-		}
-
-		// If the application called show_error, don't output a backtrace, just the error
-		if($is_from_app)
-		{
-			$message = '<p>'.implode('</p><p>', ( ! is_array($message)) ? array($message) : $message).'</p>';
-
-			if (ob_get_level() > $this->ob_level + 1)
-			{
-				ob_end_flush();	
-			}
-			ob_start();
-			include(APPPATH.'errors/'.$template.EXT);
-			$buffer = ob_get_contents();
-			ob_end_clean();
-			return $buffer;
-		}
-
-		$message = implode(' / ', ( ! is_array($message)) ? array($message) : $message);
-
-		// If the system called show_error, so lets find the actual file and line in application/ that caused it.
-		foreach($trace as $call)
-		{
-			if(isset($call['file']) AND strpos($call['file'], APPPATH) === 0 AND !self::is_extension($call['file']))
-			{
-				$file = $call['file'];
-				$line = $call['line'];
-				break;
-			}
-		}
-		unset($trace);
-
-		self::exception_handler(new ErrorException($message, E_ERROR, 0, $file, $line));
-		return;
-	}
-	
-	/**
-	 * Is Extension
-	 *
-	 * This checks to see if the file path is to a core extension.
-	 *
-	 * @access	private
-	 * @param	string	$file
-	 * @return	bool
-	 */
-	private static function is_extension($file)
-	{
-		foreach(array('libraries/', 'core/') as $folder)
-		{
-			if(strpos($file, APPPATH . $folder . config_item('subclass_prefix')) === 0)
-			{
-				return TRUE;
-			}
-		}
-		return FALSE;
-	}
-}
-
-/* End of file: EM_Exceptions.php */

File application/core/EM_Loader.php

-<?php (defined('BASEPATH')) OR exit('No direct script access allowed');
-
-/* load the MX_Loader class */
-require APPPATH."third_party/MX/Loader.php";
-
-class EM_Loader extends MX_Loader {}

File application/core/EM_Router.php

-<?php (defined('BASEPATH')) OR exit('No direct script access allowed');
-
-/* load the MX_Router class */
-require APPPATH."third_party/MX/Router.php";
-
-class EM_Router extends MX_Router {}

File application/doctrine

-#!/usr/bin/env php
-
-<?php
-
-include('doctrine.php');

File application/doctrine-cli.php

View file
+<?php
+
+// trailing slash is important!
+define('APPPATH', 'F:/~PHP/App/tanur1.5/application/');
+define('BASEPATH', APPPATH);
+define('ENVIRONMENT', 'development');
+
+require APPPATH.'libraries/Doctrine.php';
+
+$doctrine = new Doctrine();
+ 
+$helperSet = new \Symfony\Component\Console\Helper\HelperSet(array(
+    'db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($doctrine->em->getConnection()),
+    'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($doctrine->em)
+));
+
+$cli = new \Symfony\Component\Console\Application('Doctrine Command Line Interface (CodeIgniter integration by Joel Verhagen)', Doctrine\ORM\Version::VERSION);
+$cli->setCatchExceptions(true);
+$cli->setHelperSet($helperSet);
+$cli->addCommands(array(
+    // DBAL Commands
+    new \Doctrine\DBAL\Tools\Console\Command\RunSqlCommand(),
+    new \Doctrine\DBAL\Tools\Console\Command\ImportCommand(),
+ 
+    // ORM Commands
+    new \Doctrine\ORM\Tools\Console\Command\ClearCache\MetadataCommand(),
+    new \Doctrine\ORM\Tools\Console\Command\ClearCache\ResultCommand(),
+    new \Doctrine\ORM\Tools\Console\Command\ClearCache\QueryCommand(),
+    new \Doctrine\ORM\Tools\Console\Command\SchemaTool\CreateCommand(),
+    new \Doctrine\ORM\Tools\Console\Command\SchemaTool\UpdateCommand(),
+    new \Doctrine\ORM\Tools\Console\Command\SchemaTool\DropCommand(),
+    new \Doctrine\ORM\Tools\Console\Command\EnsureProductionSettingsCommand(),
+    new \Doctrine\ORM\Tools\Console\Command\ConvertDoctrine1SchemaCommand(),
+    new \Doctrine\ORM\Tools\Console\Command\GenerateRepositoriesCommand(),
+    new \Doctrine\ORM\Tools\Console\Command\GenerateEntitiesCommand(),
+    new \Doctrine\ORM\Tools\Console\Command\GenerateProxiesCommand(),
+    new \Doctrine\ORM\Tools\Console\Command\ConvertMappingCommand(),
+    new \Doctrine\ORM\Tools\Console\Command\RunDqlCommand(),
+    new \Doctrine\ORM\Tools\Console\Command\ValidateSchemaCommand(),
+ 
+));
+$cli->run();

File application/doctrine.php

-<?php
-
-define('APPPATH', dirname(__FILE__) . '/');
-define('BASEPATH', APPPATH . '/../system/');
-define('ENVIRONMENT', 'production');
-
-chdir(APPPATH . '/libraries');
-
-require_once 'Doctrine/Common/ClassLoader.php';
-
-$classLoader = new \Doctrine\Common\ClassLoader('Doctrine');
-$classLoader->register();
-
-$classLoader = new \Doctrine\Common\ClassLoader('Symfony', 'Doctrine');
-$classLoader->register();
-
-$configFile = getcwd() . '/Doctrine.php';
-
-$helperSet = null;
-if (file_exists($configFile)) {
-    if ( ! is_readable($configFile)) {
-        trigger_error(
-            'Configuration file [' . $configFile . '] does not have read permission.', E_ERROR
-        );
-    }
-
-    require $configFile;
-
-    foreach ($GLOBALS as $helperSetCandidate) {
-        if ($helperSetCandidate instanceof \Symfony\Component\Console\Helper\HelperSet) {
-            $helperSet = $helperSetCandidate;
-            break;
-        }
-    }
-}
-
-$doctrine = new Doctrine;
-$em = $doctrine->em;
-
-$helperSet = new \Symfony\Component\Console\Helper\HelperSet(array(
-    'db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em->getConnection()),
-    'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em)
-));
-
-\Doctrine\ORM\Tools\Console\ConsoleRunner::run($helperSet);

File application/errors/error_404.php

View file
-<html>
+<!DOCTYPE html>
+<html lang="en">
 <head>
 <title>404 Page Not Found</title>
 <style type="text/css">
 
+::selection{ background-color: #E13300; color: white; }
+::moz-selection{ background-color: #E13300; color: white; }
+::webkit-selection{ background-color: #E13300; color: white; }
+
 body {
-background-color:	#fff;
-margin:				40px;
-font-family:		Lucida Grande, Verdana, Sans-serif;
-font-size:			12px;
-color:				#000;
+	background-color: #fff;
+	margin: 40px;
+	font: 13px/20px normal Helvetica, Arial, sans-serif;
+	color: #4F5155;
 }
 
-#content  {
-border:				#999 1px solid;
-background-color:	#fff;
-padding:			20px 20px 12px 20px;
+a {
+	color: #003399;
+	background-color: transparent;
+	font-weight: normal;
 }
 
 h1 {
-font-weight:		normal;
-font-size:			14px;
-color:				#990000;
-margin:				0 0 4px 0;
+	color: #444;
+	background-color: transparent;
+	border-bottom: 1px solid #D0D0D0;
+	font-size: 19px;
+	font-weight: normal;
+	margin: 0 0 14px 0;
+	padding: 14px 15px 10px 15px;
+}
+
+code {
+	font-family: Consolas, Monaco, Courier New, Courier, monospace;
+	font-size: 12px;
+	background-color: #f9f9f9;
+	border: 1px solid #D0D0D0;
+	color: #002166;
+	display: block;
+	margin: 14px 0 14px 0;
+	padding: 12px 10px 12px 10px;
+}
+
+#container {
+	margin: 10px;
+	border: 1px solid #D0D0D0;
+	-webkit-box-shadow: 0 0 8px #D0D0D0;
+}
+
+p {
+	margin: 12px 15px 12px 15px;
 }
 </style>
 </head>
 <body>
-	<div id="content">
+	<div id="container">
 		<h1><?php echo $heading; ?></h1>
 		<?php echo $message; ?>
 	</div>

File application/errors/error_db.php

View file
-<html>
+<!DOCTYPE html>
+<html lang="en">
 <head>
 <title>Database Error</title>
 <style type="text/css">
 
+::selection{ background-color: #E13300; color: white; }
+::moz-selection{ background-color: #E13300; color: white; }
+::webkit-selection{ background-color: #E13300; color: white; }
+
 body {
-background-color:	#fff;
-margin:				40px;
-font-family:		Lucida Grande, Verdana, Sans-serif;
-font-size:			12px;
-color:				#000;
+	background-color: #fff;
+	margin: 40px;
+	font: 13px/20px normal Helvetica, Arial, sans-serif;
+	color: #4F5155;
 }
 
-#content  {
-border:				#999 1px solid;
-background-color:	#fff;
-padding:			20px 20px 12px 20px;
+a {
+	color: #003399;
+	background-color: transparent;
+	font-weight: normal;
 }
 
 h1 {
-font-weight:		normal;
-font-size:			14px;
-color:				#990000;
-margin:				0 0 4px 0;
+	color: #444;
+	background-color: transparent;
+	border-bottom: 1px solid #D0D0D0;
+	font-size: 19px;
+	font-weight: normal;
+	margin: 0 0 14px 0;
+	padding: 14px 15px 10px 15px;
+}
+
+code {
+	font-family: Consolas, Monaco, Courier New, Courier, monospace;
+	font-size: 12px;
+	background-color: #f9f9f9;
+	border: 1px solid #D0D0D0;
+	color: #002166;
+	display: block;
+	margin: 14px 0 14px 0;
+	padding: 12px 10px 12px 10px;
+}
+
+#container {
+	margin: 10px;
+	border: 1px solid #D0D0D0;
+	-webkit-box-shadow: 0 0 8px #D0D0D0;
+}
+
+p {
+	margin: 12px 15px 12px 15px;
 }
 </style>
 </head>
 <body>
-	<div id="content">
+	<div id="container">
 		<h1><?php echo $heading; ?></h1>
 		<?php echo $message; ?>
 	</div>

File application/errors/error_general.php

View file
-<html>
+<!DOCTYPE html>
+<html lang="en">
 <head>
 <title>Error</title>
 <style type="text/css">
 
+::selection{ background-color: #E13300; color: white; }
+::moz-selection{ background-color: #E13300; color: white; }
+::webkit-selection{ background-color: #E13300; color: white; }
+
 body {
-background-color:	#fff;
-margin:				40px;
-font-family:		Lucida Grande, Verdana, Sans-serif;
-font-size:			12px;
-color:				#000;
+	background-color: #fff;
+	margin: 40px;
+	font: 13px/20px normal Helvetica, Arial, sans-serif;
+	color: #4F5155;
 }
 
-#content  {
-border:				#999 1px solid;
-background-color:	#fff;
-padding:			20px 20px 12px 20px;
+a {
+	color: #003399;
+	background-color: transparent;
+	font-weight: normal;
 }
 
 h1 {
-font-weight:		normal;
-font-size:			14px;
-color:				#990000;
-margin:				0 0 4px 0;
+	color: #444;
+	background-color: transparent;
+	border-bottom: 1px solid #D0D0D0;
+	font-size: 19px;
+	font-weight: normal;
+	margin: 0 0 14px 0;
+	padding: 14px 15px 10px 15px;
+}
+
+code {
+	font-family: Consolas, Monaco, Courier New, Courier, monospace;
+	font-size: 12px;
+	background-color: #f9f9f9;
+	border: 1px solid #D0D0D0;
+	color: #002166;
+	display: block;
+	margin: 14px 0 14px 0;
+	padding: 12px 10px 12px 10px;
+}
+
+#container {
+	margin: 10px;
+	border: 1px solid #D0D0D0;
+	-webkit-box-shadow: 0 0 8px #D0D0D0;
+}
+
+p {
+	margin: 12px 15px 12px 15px;
 }
 </style>
 </head>
 <body>
-	<div id="content">
+	<div id="container">
 		<h1><?php echo $heading; ?></h1>
 		<?php echo $message; ?>
 	</div>

File application/errors/error_php_custom.php

-<?php
-// Unique error identifier
-$error_id = uniqid('error'); ?>
-	<style type="text/css">
-#exception_error {
-	background: #ddd;
-	font-size: 1em;
-	font-family:sans-serif;
-	text-align: left;
-	color: #333333;
-}
-#exception_error h1,
-#exception_error h2 {
-	margin: 0;
-	padding: 1em;
-	font-size: 1em;
-	font-weight: normal;
-	background: #911911;
-	color: #FFFFFF;
-}
-#exception_error h1 a,
-#exception_error h2 a {
-	color: #FFFFFF;
-}
-#exception_error h2 {
-	background: #666666;
-}
-#exception_error h3 {
-	margin: 0;
-	padding: 0.4em 0 0;
-	font-size: 1em;
-	font-weight: normal;
-}
-#exception_error p {
-	margin: 0;
-	padding: 0.2em 0;
-}
-#exception_error a {
-	color: #1b323b;
-}
-#exception_error pre {
-	overflow: auto;
-	white-space: pre-wrap;
-}
-#exception_error table {
-	width: 100%;
-	display: block;
-	margin: 0 0 0.4em;
-	padding: 0;
-	border-collapse: collapse;
-	background: #fff;
-}
-#exception_error table td {
-	border: solid 1px #ddd;
-	text-align: left;
-	vertical-align: top;
-	padding: 0.4em;
-}
-#exception_error div.content {
-	padding: 0.4em 1em 1em;
-	overflow: hidden;
-}
-#exception_error pre.source {
-	margin: 0 0 1em;
-	padding: 0.4em;
-	background: #fff;
-	border: dotted 1px #b7c680;
-	line-height: 1.2em;
-}
-#exception_error pre.source span.line {
-	display: block;
-}
-#exception_error pre.source span.highlight {
-	background: #f0eb96;
-}
-#exception_error pre.source span.line span.number {
-	color: #666;
-}
-#exception_error ol.trace {
-	display: block;
-	margin: 0 0 0 2em;
-	padding: 0;
-	list-style: decimal;
-}
-#exception_error ol.trace li {
-	margin: 0;
-	padding: 0;
-}
-.js .collapsed {
-	display: none;
-}
-</style>
-	<script type="text/javascript">
-	document.documentElement.className = 'js';
-function koggle(elem)
-{
-	elem = document.getElementById(elem);
-
-	if (elem.style && elem.style['display'])
-		// Only works with the "style" attr
-	var disp = elem.style['display'];
-	else if (elem.currentStyle)
-		// For MSIE, naturally
-	var disp = elem.currentStyle['display'];
-	else if (window.getComputedStyle)
-		// For most other browsers
-	var disp = document.defaultView.getComputedStyle(elem, null).getPropertyValue('display');
-
-	// Toggle the state of the "display" style
-	elem.style.display = disp == 'block' ? 'none' : 'block';
-	return false;
-}
-</script>
-
-<div id="exception_error">
-	<h1><span class="type"><?php echo $type ?> [ <?php echo $code ?> ]:</span> <span class="message"><?php echo $message ?></span></h1>
-	<div id="<?php echo $error_id ?>" class="content">
-		<p><span class="file"><?php echo EM_Exceptions::debug_path($file) ?> [ <?php echo $line ?> ]</span></p>
-		
-		<?php echo EM_Exceptions::debug_source($file, $line) ?>
-		
-		<ol class="trace">
-			<?php foreach (EM_Exceptions::trace($trace) as $i => $step): ?>
-			<li>
-				<p>
-					<span class="file">
-					<?php if ($step['file']): $source_id = $error_id.'source'.$i; ?>
-						<a href="#<?php echo $source_id ?>" onclick="return koggle('<?php echo $source_id ?>')"><?php echo EM_Exceptions::debug_path($step['file']) ?> [ <?php echo $step['line'] ?> ]</a>
-					<?php else: ?>
-						{<?php echo 'PHP internal call'; ?>}
-					<?php endif ?>
-					</span>
-					&raquo;
-					<?php echo $step['function'] ?>(<?php if ($step['args']): $args_id = $error_id.'args'.$i; ?><a href="#<?php echo $args_id ?>" onclick="return koggle('<?php echo $args_id ?>')"><?php echo 'arguments' ?></a><?php endif ?>)
-				</p>
-			<?php if (isset($args_id)): ?>
-				<div id="<?php echo $args_id ?>" class="collapsed">
-					<table cellspacing="0">
-					<?php foreach ($step['args'] as $name => $arg): ?>
-						<tr>
-							<td><code><?php echo $name ?></code></td>
-							<td><pre><?php echo print_r($arg, TRUE) ?></pre></td>
-						</tr>
-					<?php endforeach ?>
-					</table>
-				</div>
-			<?php endif ?>
-			<?php if (isset($source_id)): ?>
-				<pre id="<?php echo $source_id ?>" class="source collapsed"><code><?php echo $step['source'] ?></code></pre>
-			<?php endif ?>
-			</li>
-			<?php unset($args_id, $source_id); ?>
-			<?php endforeach ?>
-		</ol>
-	</div>
-
-	<h2><a href="#<?php echo $env_id = $error_id.'environment' ?>" onclick="return koggle('<?php echo $env_id ?>')"><?php echo 'Environment' ?></a></h2>
-	<div id="<?php echo $env_id ?>" class="content collapsed">
-	
-	<?php $included = get_included_files() ?>
-		<h3><a href="#<?php echo $env_id = $error_id.'environment_included' ?>" onclick="return koggle('<?php echo $env_id ?>')"><?php echo 'Included files' ?></a> (<?php echo count($included) ?>)</h3>
-		<div id="<?php echo $env_id ?>" class="collapsed">
-			<table cellspacing="0">
-			<?php foreach ($included as $file): ?>
-				<tr>
-					<td><code><?php echo EM_Exceptions::debug_path($file) ?></code></td>
-				</tr>
-			<?php endforeach ?>
-			</table>
-		</div>
-
-	<?php $included = get_loaded_extensions() ?>
-		<h3><a href="#<?php echo $env_id = $error_id.'environment_loaded' ?>" onclick="return koggle('<?php echo $env_id ?>')"><?php echo 'Loaded extensions' ?></a> (<?php echo count($included) ?>)</h3>
-		<div id="<?php echo $env_id ?>" class="collapsed">
-			<table cellspacing="0">
-			<?php foreach ($included as $file): ?>
-				<tr>
-					<td><code><?php echo EM_Exceptions::debug_path($file) ?></code></td>
-				</tr>
-			<?php endforeach ?>
-			</table>
-		</div>
-		
<