-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
kernel.php
60 lines (52 loc) · 1.68 KB
/
kernel.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
59
60
<?php
require __DIR__ . "/vendor/autoload.php";
if(file_exists(__DIR__ . "/.compiled")) {
foreach (glob(__DIR__ . "/.compiled/*.php") as $filename)
{
include $filename;
}
foreach (glob(__DIR__ . "/.compiled/*Out/*.php") as $filename)
{
include $filename;
}
foreach (glob(__DIR__ . "/.compiled/Edges/*.php") as $filename)
{
include $filename;
}
}
use Pho\Kernel\Kernel;
use PhoNetworksAutogenerated\User;
$dotenv = \Dotenv\Dotenv::createImmutable(__DIR__);
$dotenv->load();
$_grapho = \PhoNetworksAutogenerated\Graph::class;
$_user_params = ["admin", "123456"]; // password only
if(class_exists(\PhoNetworksAutogenerated\Twitter::class))
{
$_grapho = \PhoNetworksAutogenerated\Twitter::class;
}
elseif(class_exists(\PhoNetworksAutogenerated\Facebook::class))
{
$_grapho = \PhoNetworksAutogenerated\Facebook::class;
}
elseif(class_exists(\PhoNetworksAutogenerated\Site::class))
{
$_grapho = \PhoNetworksAutogenerated\Site::class;
$_user_params = ["the_founder", "x@y.org", "123456"];
}
$configs = array(
"services"=>array(
"database" => ["type" => getenv('DATABASE_TYPE'), "uri" => getenv('DATABASE_URI')],
"storage" => ["type" => getenv('STORAGE_TYPE'), "uri" => getenv("STORAGE_URI")],
"index" => ["type" => getenv('INDEX_TYPE'), "uri" => getenv('INDEX_URI')]
),
"default_objects" => array(
"graph" => $_grapho,
"founder" => User::class,
"actor" => User::class
)
);
$kernel = new \Pho\Kernel\Kernel($configs);
$founder = new \PhoNetworksAutogenerated\User($kernel, $kernel->space(), ...$_user_params);
$kernel->boot($founder);
//$founder = $kernel->founder();
//$graph = $kernel->graph();