This repository has been archived by the owner on Dec 15, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sf.php
75 lines (55 loc) · 2.24 KB
/
sf.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
61
62
<?php
/**
*
* sfcms.php of stayfront (sfcms)
*
* stayfront cms is a fast, optimized but versitile CMS
*
*/
$time_start = microtime(true);
require("sf-config.php");
/*
*
* Include the file(s) needed to provide the basis for the staycms framework
*
*
*/
require("$include_path/core/cms.inc.php");
//include file containing primary cms extention class
require($include_path . "/extention/primary/$primary_extention/" . $primary_extention . ".inc.php");
//serialize name of primary extention class
$ext = "sfcms_" . $primary_extention;
//load primary extention class
$cms = new $ext();
//load any/all addons
if(isset($addon_toload)) if(is_array($addon_toload))
foreach($addon_toload as $addon_name) {
//see if file exists
if (is_readable($include_path . "/extention/addon/$addon_name/" . $addon_name . ".inc.php")) {
//include file with expected to have addon class definition
require($include_path . "/extention/addon/$addon_name/" . $addon_name . ".inc.php");
//serialize name of addon extention class
$clsname = "sfaddon_$addon_name";
$addon = new $clsname();
//see if class is extention of sfaddon
if (is_a($addon,"sfaddon")) {
//load the module
if (is_readable($include_path . "/extention/addon/$addon_name/load.inc.php")) {
require($include_path . "/extention/addon/$addon_name/load.inc.php");
} else {
if ($show_sferrors) $cms->fail("addon","could not load '$addon_name'");
$cms->fail("to see details here set show_sferrors = true in sf-config.php");
}
} else {
//throw a "fail"
if ($show_sferrors) $cms->fail("addon","'$clsname' not class sfaddon in '$addon_name'");
$cms->fail("to see details here set show_sferrors = true in sf-config.php");
}
} else/*-end addon exists-*/{
if ($show_sferrors) $cms->fail("addon","'$addon_name' does not exist and/or cannot be read");
$cms->fail("to see details here set show_sferrors = true in sf-config.php");
}
} /*-end addon loop-*/
//load the primary extention
if (is_readable($include_path . "/extention/primary/$primary_extention/load.inc.php"))
require($include_path . "/extention/primary/$primary_extention/load.inc.php");