-
Notifications
You must be signed in to change notification settings - Fork 15
/
config.sample.php
173 lines (146 loc) · 6.23 KB
/
config.sample.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
<?php
/**********************************************************************************************************************
* autoload and include path
*/
function autoload($class)
{
$file = str_replace(array('_', '\\'), '/', $class).'.php';
if ($fullpath = stream_resolve_include_path($file)) {
include $fullpath;
return true;
}
return false;
}
spl_autoload_register("autoload");
set_include_path(
implode(PATH_SEPARATOR, array(get_include_path())).PATH_SEPARATOR
.dirname(__FILE__) . '/lib/Epoch/src'.PATH_SEPARATOR //path to Epoch's src dir.
.dirname(__FILE__) . '/lib'.PATH_SEPARATOR
.dirname(__FILE__) . '/src'.PATH_SEPARATOR
);
require_once __DIR__ . '/vendor/autoload.php';
/**********************************************************************************************************************
* php related settings
*/
//Session life in seconds.
ini_set("session.gc_maxlifetime", 7200);
// Support third-party cookie to support chats on affiliate sites
// NOTE for DEV site without HTTPS set samesite to 'strict' or 'lax' and secure to false;
ini_set("session.cookie_samesite", 'none');
ini_set("session.cookie_secure", true);
ini_set('display_errors', 0);
error_reporting(0);
/**********************************************************************************************************************
* General settings
*/
/* Change this to the full base url of this instance.
*
* @param string - the full url to this instance.
*/
\UNL\VisitorChat\Controller::setURL('http://www.mysite.edu/'); //Training slash is required.
/* Change this to a directory where you want temporary files to be stored.
*
* @var string - absolute path to the temporary directory
*/
\UNL\VisitorChat\CacheableURL::$tmpDir = dirname(__FILE__) . "/tmp/"; //Must be writable
/* Configure the allowed domains
*
* @var array - an array of domains where chats are allowed to be started.
*/
\UNL\VisitorChat\Controller::$allowedDomains = array('mysite.edu', 'mysite2.org');
/* Configure the allowed chatbot domains
*
* @var array - an array of domains where chatbots are allowed to be started.
*/
\UNL\VisitorChat\Controller::$allowedChatbotDomains = array('mysite.edu');
/* Current environment of the chat service
* PRODUCTION - Live production.
* PHPT - Unit Testing environment
* DEV - Develop environment
* @var string - the current environment (PRODUCTION|PHPT|DEV)
*/
\UNL\VisitorChat\Controller::$environment = "PRODUCTION";
/* The refresh rate (operator and client)
* This describes the rate at with the js clients refresh in milliseconds.
*
* @var int - the number of milliseconds to refresh
*/
\UNL\VisitorChat\Controller::$refreshRate = 2000; //(every 2 seconds)
//TTL for pending chat requests
\UNL\VisitorChat\Controller::$chatRequestTimeout = 10000; //(10 seconds)
/* Set fallback URLs
* Conversations that fail to be answered will fall back to these sites.
*
* @var \ArrayIterator - an \ArrayIterator of sites.
*/
\UNL\VisitorChat\Controller::$fallbackURLs = new \ArrayIterator(array('http://ucommfairchild.unl.edu'));
//Set session key to prevent man in the middle attacks.
/* Session key
* Helps to prevent man in the middle attacks. It is important that you replace this value.
*
* @var string
*/
\UNL\VisitorChat\Controller::$sessionKey = "replace me"; //!REPLACE ME!
/* Caches routes (does not auto refresh cache)
*
* @var bool
*/
\UNL\VisitorChat\Controller::$cacheRoutes = false;
/* To cache and minimize or not to cache and minimize javascript and css output. That is the question.
*
* @var bool
*/
\UNL\VisitorChat\Asset\View::$cache = false;
/* A list of admins (via their UIDs). Admins can view all past conversations for all sites.
*
* @var array - an array of admins where the value is the uid of a user.
*/
\UNL\VisitorChat\Controller::$admins = array('s-mfairch4');
/**********************************************************************************************************************
* Email settings
*/
//List of email address to fall back to if no emails can be found for a url.
\UNL\VisitorChat\Conversation\Email::$fallbackEmails = array();
//Default from address
\UNL\VisitorChat\Conversation\Email::$default_from = '[email protected]';
//Default reply_to address
\UNL\VisitorChat\Conversation\Email::$default_reply_to = '[email protected]';
//Default subject
\UNL\VisitorChat\Conversation\Email::$default_subject = 'UNL Visitor Chat System';
/**********************************************************************************************************************
* Operator Registry settings (Required)
*
* If routing of chats is going to work, the system needs to know who is assigned to what site... thus we need
* a registry service.
*
* We have our own registry service here at UNL. You are welcome to use your own or make one.
* If you want to make your own, use the MockRegistryDriver class as a reference.
*/
//Uncomment to set the registry service to something other than the default.
#\UNL\VisitorChat\Controller::$registryService = new MockRegistryDriver();
//WDN Registry service url.
\UNL\VisitorChat\OperatorRegistry\WDN\Driver::$baseURI = "http://www1.unl.edu/wdn/registry/";
//WDN Registry driver cache timeout.
\UNL\VisitorChat\OperatorRegistry\WDN\Driver::$cacheTimeout = 18000; //seconds (5 hours)
/**********************************************************************************************************************
* Mail Service
*/
//Uncomment to set the mail service to something other than the default.
#\UNL\VisitorChat\Controller::$mailService = new MockMailDriver();
/**********************************************************************************************************************
* DB related settings
*/
\Epoch\Controller::setDbSettings(array(
'host' => 'localhost',
'user' => 'visitorchatapp',
'password' => 'visitorchatapp',
'dbname' => 'visitorchatapp'
));
// Site Notice
$siteNotice = new stdClass();
$siteNotice->display = false;
$siteNotice->noticePath = 'dcf-notice';
$siteNotice->containerID = 'dcf-main';
$siteNotice->type = 'dcf-notice-info';
$siteNotice->title = 'Maintenance Notice';
$siteNotice->message = 'We will be performing site maintenance on February 3rd from 4:30 to 5:00. The site may not be available during this time.';