-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathclass_loader.inc
64 lines (55 loc) · 2.15 KB
/
class_loader.inc
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
59
60
61
62
63
64
<?php
/**
* @file
* Heisencache: class loader.
*
* @author: Frederic G. MARAND <fgm@osinet.fr>
*
* @copyright (c) 2013-2014 Ouest Systèmes Informatiques (OSInet).
*
* @license General Public License version 2 or later
*/
/**
* Load required files without using an autoloader.
*
* - When loading for unit tests, start by loading Drupal cache API.
*/
function heisencache_require() {
/* When running unit tests, we need to load cache.inc , otherwise it will be
included by the Drupal bootstrap process. */
if (defined('HEISENCACHE_DRUPAL_BASE')) {
$drupal_base = realpath(HEISENCACHE_DRUPAL_BASE);
if (empty($drupal_base)) {
throw new \Exception('Invalid HEISENCACHE_DRUPAL_BASE path.');
}
// Needed for the CACHE_* constants.
/** @noinspection PhpIncludeInspection */
require_once "$drupal_base/includes/bootstrap.inc";
// Needed for the Cache API.
/** @noinspection PhpIncludeInspection */
require_once "$drupal_base/includes/cache.inc";
}
else {
$drupal_base = NULL;
}
// Load cache-related classes.
require_once __DIR__ . "/src/Heisencache/EventSourceInterface.php";
require_once __DIR__ . "/src/Heisencache/EventSourceInterface.php";
require_once __DIR__ . "/src/Heisencache/EventSubscriberInterface.php";
require_once __DIR__ . "/src/Heisencache/BaseEventSubscriber.php";
require_once __DIR__ . "/src/Heisencache/EventSourceSubscriber.php";
require_once __DIR__ . "/src/Heisencache/EventEmitter.php";
require_once __DIR__ . "/src/Heisencache/Cache.php";
require_once __DIR__ . "/src/Heisencache/Config.php";
// Load basic subscribers.
require_once __DIR__ . "/src/Heisencache/DebugSubscriber.php";
require_once __DIR__ . "/src/Heisencache/MissSubscriber.php";
require_once __DIR__ . "/src/Heisencache/PerformanceSubscriber.php";
require_once __DIR__ . "/src/Heisencache/WriteSubscriber.php";
// Load writer subscribers.
require_once __DIR__ . "/src/Heisencache/BaseWriterSubscriber.php";
require_once __DIR__ . "/src/Heisencache/SqlWriterSubscriber.php";
require_once __DIR__ . "/src/Heisencache/WatchdogWriterSubscriber.php";
return $drupal_base;
}
heisencache_require();