-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
43 lines (30 loc) · 1005 Bytes
/
index.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
<?php
$start_time = microtime(true);
define('APP_DIR', dirname(__FILE__));
use IconicCodes\LightFramework\LightFramework;
include "vendor/autoload.php";
$light = new LightFramework('config', 'autoload', '__');
echo '<h1> With Defer </h1>';
$light->defer(2, function() use ($start_time) {
echo '1 Called at at:' . microtime(true) . '<br>';
});
$light->defer(1, function() use ($start_time) {
echo '2 Called at at:' . microtime(true) . '<br>';
echo __->getModule('demo')->doSomeThing('Hello, World!');
});
echo '0 Called at:' . microtime(true) . '<br>';
$light->init();
$light->setConfig('app.username', 'Icon');
var_dump($light->getConfig('app.key'));
var_dump($light->getConfig('app.username'));
class Demo {
public $x;
public $y;
function __construct($x, $y) {
$this->x = $x;
$this->y = $y;
}
public function doSomeThing($message = "Hi!") {
return '<br>' . $message . ': ' . (intval($this->x) + intval($this->y)) . '<br>';
}
}