This repository has been archived by the owner on Jan 23, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
inc_config_example.php
104 lines (86 loc) · 3.84 KB
/
inc_config_example.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<?php
$aConfig["installer"] = false;
###############################################
$aConfig["encryption"]["key"] = ""; // example: "domain.com"
$aConfig["encryption"]["salt"] = ""; // example: "random string"
$aConfig["mobile"] = false;
###############################################
### ADMIN INFO ################################
// Info used to send when an error happens when debug is off
$aConfig["admin_info"] = array(); // array("name" => "", "email" => "");
###############################################
### OPTIONS ###################################
$aConfig["options"]["pear"] = "folder"; // PEAR file locations; server = packages installed on server, folder = packages sit with site in .pear
$aConfig["options"]["debug"] = true;
$aConfig["options"]["timezone"] = "America/Chicago";
$aConfig["options"]["formatDate"] = "F j, Y";
$aConfig["options"]["formatTime"] = "h:i a";
###############################################
### PEAR ######################################
# PEAR MDB2
# http://pear.php.net/MDB2/
$aConfig["database"]["type"] = "mysql";
$aConfig["database"]["host"] = "localhost";
$aConfig["database"]["username"] = "";
$aConfig["database"]["password"] = "";
$aConfig["database"]["database"] = "";
$aConfig["database"]["prefix"] = "cw_";
$aConfig["database"]["fetch"] = 2; // 1 = Ordered (0=>value,1=>value), 2 = Assoc (col=>value,col=>val), 3 = Object {col->value,col->value}
$aConfig["database"]["dsn"] = $aConfig["database"]["type"]."://".$aConfig["database"]["username"].":".$aConfig["database"]["password"]."@".$aConfig["database"]["host"]."/".$aConfig["database"]["database"];
$aConfig["database"]["options"] = array(
"quote_identifier" => true
);
# PEAR MAIL
# http://pear.php.net/mail/
$aConfig["mail"]["type"] = "mail"; // mail, sendmail, smtp
$aConfig["mail"]["params"] = array();
###############################################
### TEMPLATES #################################
# PHP Smarty Template Engine
# http://smarty.php.net/
$aConfig["smarty"]["dir"]["smarty"] = $site_root.".smarty/Smarty.class.php";
include($site_root."helpers/Mobile_Detect.php");
$oMobileDetect = new Mobile_Detect();
if($_GET["full"] == 1)
$_SESSION["site"] = "full";
if($_GET["mobile"] == 1)
$_SESSION["site"] = "mobile";
if($oMobileDetect->isMobile() && (empty($_SESSION["site"]) || $_SESSION["site"] == "mobile") && !$oMobileDetect->isIpad() && $aConfig["mobile"]) {
$aConfig["smarty"]["dir"]["templates"] = $site_root."views/mobile";
$aConfig["smarty"]["dir"]["compile"] = $site_root.".compiled/mobile";
} else {
$aConfig["smarty"]["dir"]["templates"] = $site_root."views";
$aConfig["smarty"]["dir"]["compile"] = $site_root.".compiled";
}
$aConfig["smarty"]["dir"]["cache"] = $site_root.".cache";
$aConfig["smarty"]["dir"]["plugins"] = array(
$site_root.".smarty/plugins/",
$site_root."components",
$site_root."components/html"
);
// Add plugin components
$oPlugins = dir($site_root."plugins");
while (false !== ($sPlugin = $oPlugins->read())) {
if(substr($sPlugin, 0, 1) != "." && is_dir($site_root."plugins/".$sPlugin."/components/"))
$aConfig["smarty"]["dir"]["plugins"][] = $site_root."plugins/".$sPlugin."/components/";
}
$oPlugins->close();
/* Caching */
$aConfig["smarty"]["cache"]["type"] = false;// false, 1 = 1 lifetime, 2 = lifetime per template;
$aConfig["smarty"]["cache"]["lifetime"] = 30;// -1 = never expire, 0 = always regenerate, seconds;
/* Filters */
$aConfig["smarty"]["filters"] = array(
"output" => array(
"move_to_head",
"move_to_footer"
),
"pre" => array(
),
"post" => array(
)
);
/* Settings */
$aConfig["smarty"]["subdirs"] = FALSE;//Potential Speed Boost on large sites while on
$aConfig["smarty"]["debug"] = FALSE;//Javascript popup of assigned variables
$aConfig["smarty"]["debug_ctrl"] = "URL";//NONE = No alt method, URL = "SMARTY_DEBUG" found in query string, ingnored when debug = true;
###############################################