-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
36 lines (25 loc) · 799 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
<?php
define('APP_ROOT', getcwd());
require 'vendor/autoload.php';
require 'backend/TleSource.php';
Twig_Autoloader::register();
// specify where to look for templates
$loader = new Twig_Loader_Filesystem('view');
// initialize Twig environment
// $twig = new Twig_Environment($loader);
$twig = new Twig_Environment($loader, array(
'autoescape' => false
));
$twig->addFilter('var_dump', new Twig_Filter_Function('var_dump'));
// load template
$template = $twig->loadTemplate('index.html.twig');
if(!class_exists('Memcache')) {
$satelliteList = array('ISS (ZARYA)');
} else {
$tleSource = new TleSource();
$satelliteList = $tleSource->getSatelliteList();
}
echo $template->render(array(
'satelliteList' => $satelliteList,
'satelliteCount' => count($satelliteList),
));