-
Notifications
You must be signed in to change notification settings - Fork 57
/
index.php
50 lines (44 loc) · 1.75 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
49
50
<?php
define("STORYTLR_VERSION","1.3.dev");
define("DATABASE_VERSION", "5");
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/api/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/storytlr.conf') &&
! 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();