-
Notifications
You must be signed in to change notification settings - Fork 22
/
Bootstrap.php
58 lines (49 loc) · 1.14 KB
/
Bootstrap.php
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
/**
* DataTables PHP libraries.
*
* PHP libraries for DataTables and DataTables Editor.
*
* @author SpryMedia
* @copyright SpryMedia ( http://sprymedia.co.uk )
* @license http://editor.datatables.net/license DataTables Editor
*
* @see http://editor.datatables.net
*/
namespace DataTables;
// ensure included from DataTables.php
// this file must not be included when installed using composer
if (!defined('DATATABLES')) {
exit(1);
}
//
// Auto-loader
// Automatically loads DataTables classes - they are psr-4 compliant
//
spl_autoload_register(function ($class) {
$a = explode('\\', $class);
// Are we working in the DataTables namespace
if ($a[0] !== 'DataTables') {
return;
}
array_shift($a);
$className = array_pop($a);
$path = count($a) ?
implode('/', $a) . '/' :
'';
require __DIR__ . '/' . $path . $className . '.php';
});
//
// Configuration
// Load the database connection configuration options
//
if (!isset($sql_details)) {
include __DIR__ . '/config.php';
}
//
// Database connection
// Database connection is globally available
//
if (isset($sql_details)) {
$db = new Database($sql_details);
}