-
Notifications
You must be signed in to change notification settings - Fork 0
/
cli.php
executable file
·48 lines (44 loc) · 969 Bytes
/
cli.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
#!/usr/bin/php -n
<?php
/**
* libvector3d
*
* Git: <https://git.eliteheberg.fr/younishd/libvector3d>
* Author: YouniS Bensalah <younis.bensalah@riseup.net> <http://younishd.fr>
* License: This program is under a MIT License.
*/
/** List of modules to load at start. */
$MODULES = array(
'interpreter.php',
'point.php',
'vector.php',
'path.php',
'plan.php',
'sphere.php',
'matrix.php',
'distance.php',
'determinant.php'
);
/** Preload function loading all modules from $MODULES. */
function preload()
{
global $MODULES;
foreach ($MODULES as $mod) {
if (file_exists($mod)) {
echo "Loading module $mod...\n";
include_once $mod;
}
else {
die("Error: Module $mod not found.\n");
}
}
}
/** Main program. */
function main()
{
preload();
$interpreter = new Interpreter();
$interpreter->hello();
$interpreter->bye();
}
main();