-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcore.php
52 lines (41 loc) · 1.66 KB
/
core.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
<?php
/**
* Template System
*
* Each feature is organized as a set of state and functions in a namespace, like
* `tangible\template_system`. A class of the same name is used to reference shared
* state as a static property.
*
* Previously, a module defined a global function like `tangible_loop` to access a
* singleton, and was assigned to a variable in the local scope such as `$loop`.
* This pattern is deprecated and will be gradually replaced.
*/
namespace tangible;
use tangible\framework;
class template_system {
static $state;
static $system; // tangible_template_system()
static $loop; // tangible_loop()
static $logic; // tangible_logic()
static $html; // tangible_template()
}
template_system::$state = (object) [
'version' => '20250226', // Automatically updated with npm run version
'path' => __DIR__,
'url' => framework\module_url( __FILE__ ),
];
template_system::$system = $plugin = $system; // From /admin/system
require_once __DIR__ . '/logic/module.php';
template_system::$logic = $logic = require_once __DIR__ . '/modules/logic-v1/index.php';
template_system::$loop = $loop = require_once __DIR__ . '/loop/index.php';
template_system::$html = $html = require_once __DIR__ . '/language/index.php';
// Workaround for circular dependency
\Tangible\Loop\BaseLoop::$html = $html;
require_once __DIR__ . '/modules/index.php';
require_once __DIR__ . '/integrations/index.php';
// Features that depend on above modules
require_once __DIR__ . '/admin/index.php';
require_once __DIR__ . '/editor/index.php';
require_once __DIR__ . '/content/index.php';
require_once __DIR__ . '/form/index.php';
require_once __DIR__ . '/view/index.php';