forked from eschnou/storytlr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
48 lines (42 loc) · 1.63 KB
/
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
44
45
46
47
48
<?php
define("STORYTLR_VERSION","1.0.2");
define("DATABASE_VERSION", "1");
define("AUTO_INSTALL", true);
define("AUTO_UPGRADE", true);
// Update after deployment for location of non-public files
$root = dirname(__FILE__);
set_include_path(
$root . '/protected/application' . PATH_SEPARATOR
. $root . '/protected/application/admin/models' . PATH_SEPARATOR
. $root . '/protected/application/public/models' . PATH_SEPARATOR
. $root . '/protected/application/pages/models' . PATH_SEPARATOR
. $root . '/protected/application/widgets/models' . PATH_SEPARATOR
. $root . '/protected/library' . PATH_SEPARATOR
. $root . '/protected/library/Feedcreator' . PATH_SEPARATOR
. $root . '/protected/library/htmLawed' . PATH_SEPARATOR
. get_include_path()
);
// Run the install stuff if configuration is missing
if( AUTO_INSTALL &&
! file_exists( $root . '/protected/config/config.ini') &&
! file_exists( '/etc/storytlr/config.ini')) {
$template = array();
ob_start();
$template['title'] = require_once( $root . '/protected/install/install.php' );
$template['content'] = ob_get_contents();
ob_end_clean();
require_once( $root . '/protected/install/template.phtml' );
exit();
}
if( AUTO_UPGRADE &&
! file_exists( $root . '/protected/install/database/version')
|| trim(file_get_contents($root . '/protected/install/database/version')) != DATABASE_VERSION) {
ob_start();
$template['title'] = require_once( $root . '/protected/install/upgrade.php' );
$template['content'] = ob_get_contents();
ob_end_clean();
require_once( $root . '/protected/install/template.phtml' );
exit();
}
require_once 'Bootstrap.php';
Bootstrap::run();