-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathFramework.php
More file actions
executable file
·40 lines (38 loc) · 1.37 KB
/
Copy pathFramework.php
File metadata and controls
executable file
·40 lines (38 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
/**
* Create a constant that represents the namespace separator.
* This is used throughout the application, like the dispatcer.
*/
if( !defined( 'NAMESPACE_SEPARATOR' ) )
define( 'NAMESPACE_SEPARATOR', '\\' );
/*
* Disable error reporting as soon as the framework is loaded.
* Can be overwritten by loading WebLab_Exception::reporting in the configuration file
* and defining the key Error.reporting in the configuration file.
*/
error_reporting( 0 );
/**
* Initialisation of the WebLab Framework.
*
* @author Jorgen Evens <jorgen@wlab.be>
* @package WebLab
*
*/
/**
* Autoloader, loads the classes for u.
* This is the default, if you wish to override this behaviour you should register an AddIn.
*
* @param string $className The class to load
*/
function __autoload( $className )
{
// Handle namespaces as directories.
$className = strtr( $className, NAMESPACE_SEPARATOR, DIRECTORY_SEPARATOR );
$error_report = error_reporting();
$c = preg_replace( '#_(_*)#', '/$1', $className ) . '.php';
$c = strtr( $c, '/', DIRECTORY_SEPARATOR );
error_reporting( $error_report & ( E_ALL ^ E_WARNING ) );
$result = !!include_once( $c );
error_reporting( $error_report );
return $result;
}