forked from benkeen/generatedata
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettingsFile.html
342 lines (323 loc) · 14.7 KB
/
settingsFile.html
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Data Generator</title>
<link href="assets/css/bootstrap.css" rel="stylesheet">
<link href="assets/css/bootstrap-responsive.css" rel="stylesheet">
<link href="assets/css/docs.css" rel="stylesheet">
<link href="lightbox/css/lightbox.css" rel="stylesheet">
<link href="assets/js/google-code-prettify/prettify.css" rel="stylesheet">
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container-fluid">
<ul class="nav">
<li id="mainTitle">
<button id="mobileNavLink" data-target=".nav-collapse" data-toggle="collapse" class="btn btn-navbar" type="button">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a href="index.html"></a>
</li>
<li>
<ul id="mainNav" class="nav">
<li class="active"><a href="index.html">User Doc</a></li>
<li class="dropdown">
<a href="developer.html" class="dropdown-toggle" data-toggle="dropdown">Developer Doc <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="developer.html">Introduction</a></li>
<li class="divider"></li>
<li class="nav-header">Module Types</li>
<li><a href="dataTypes.html">Data Types</a></li>
<li><a href="exportTypes.html">Export Types</a></li>
<li><a href="countryPlugins.html">Country Plugins</a></li>
<li class="divider"></li>
<li><a href="translations.html">Translations</a></li>
</ul>
</li>
<li><a href="api.html">API</a></li>
<li><a href="contribute.html">Contributing</a></li>
<li><a href="scriptsUsed.html">Scripts Used</a></li>
</ul>
<ul id="tabletNav" class="nav">
<li class="dropdown">
<a href="developer.html" class="dropdown-toggle" data-toggle="dropdown">Menu <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="index.html">User Documentation</a></li>
<li><a href="install.html">How to Install</a></li>
<li class="divider"></li>
<li class="nav-header">Developer Documentation</li>
<li><a href="developer.html">Introduction</a></li>
<li class="divider"></li>
<li class="nav-header">Module Types</li>
<li><a href="dataTypes.html">Data Types</a></li>
<li><a href="exportTypes.html">Export Types</a></li>
<li><a href="countryPlugins.html">Country Plugins</a></li>
<li class="divider"></li>
<li><a href="translations.html">Translations</a></li>
<li class="divider"></li>
<li><a href="contribute.html">How to Contribute / Contact Me</a></li>
<li><a href="scriptsUsed.html">Scripts Used</a></li>
</ul>
</li>
</ul>
<ul id="mobileNav" class="nav">
<li class="dropdown">
<div class="nav-collapse collapse">
<ul class="dropdown-menu">
<li><a href="index.html">User Documentation</a></li>
<li><a href="install.html">How to Install</a></li>
<li class="divider"></li>
<li class="nav-header">Developer Documentation</li>
<li><a href="developer.html">Introduction</a></li>
<li class="divider"></li>
<li class="nav-header">Module Types</li>
<li><a href="dataTypes.html">Data Types</a></li>
<li><a href="exportTypes.html">Export Types</a></li>
<li><a href="countryPlugins.html">Country Plugins</a></li>
<li class="divider"></li>
<li><a href="translations.html">Translations</a></li>
<li class="divider"></li>
<li><a href="contribute.html">How to Contribute / Contact Me</a></li>
<li><a href="scriptsUsed.html">Scripts Used</a></li>
</ul>
</div>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="span3" id="sidebar">
<ul id="userNav" class="nav">
<li><a href="#">User Documentation</a></li>
<li><a href="install.html">How to Install</a></li>
<li class="active">The settings.php file</li>
<li><a href="http://www.generatedata.com">Go to generatedata.com »</a></li>
</ul>
<ul id="githubLinks">
<li><a href="https://github.com/benkeen/generatedata/zipball/master">Download <strong>ZIP File</strong></a></li>
<li><a href="https://github.com/benkeen/generatedata/tarball/master">Download <strong>TAR Ball</strong></a></li>
<li><a href="https://github.com/benkeen/generatedata">View On <strong>GitHub</strong></a></li>
</ul>
<p class="projectMaintainer">
This project is maintained by<br />
Ben Keen <a href="https://twitter.com/#!/vancouverben">@vancouverben</a>
</p>
</div>
<div class="span9">
<section>
<h1>The settings.php file</h1>
<p>
As mentioned by the <a href="install.html">How to install</a> page, the installation script
automatically generates a <code>settings.php</code> file containing all the various custom settings
for your installation, like the MySQL database info.
</p>
<p>
What is <i>doesn't</i> mention is that you can add additional settings to further customize your
script beyond what's offered through the installation process. This table explains each option. The
required settings (listed first) are all automatically generated by the installation script.
</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Variable</th>
<th>Req/Opt</th>
<th>Type</th>
<th>Explanation</th>
</tr>
</thead>
<tbody>
<tr>
<td>$dbHostname</td>
<td><span class="label label-success">required</span></td>
<td>string</td>
<td>The name of the database hostname; often <code>localhost</code> for local installations</td>
</tr>
<tr>
<td>$dbName</td>
<td><span class="label label-success">required</span></td>
<td>string</td>
<td>The name of the database</td>
</tr>
<tr>
<td>$dbUsername</td>
<td><span class="label label-success">required</span></td>
<td>string</td>
<td>The username of the MySQL account that has access (read + write) to the database</td>
</tr>
<tr>
<td>$dbPassword</td>
<td><span class="label label-success">required</span></td>
<td>string</td>
<td>The MySQL password</td>
</tr>
<tr>
<td>$dbTablePrefix</td>
<td><span class="label label-success">required</span></td>
<td>string</td>
<td>Whatever prefix you want to use for your database tables. This is handy in
case you're using a single database for multiple applications; it ensures the tables are
all grouped and there are no conflicts</td>
</tr>
<tr>
<td>$encryptionSalt</td>
<td><span class="label label-success">required</span></td>
<td>string</td>
<td>
All passwords are encrypted in the database. This is the
<a href="http://ca3.php.net/manual/en/function.crypt.php" target="_blank">crypt()</a>
encryption salt; it should be 3 characters. Note: if you change this, any existing users will
no longer be able log in - they will need to reset their passwords in order to gain access.
</td>
</tr>
<tr>
<td>$errorReporting</td>
<td><span class="label label-info">optional</span></td>
<td>mixed</td>
<td>
Handy for debugging. This sets the default PHP
<a href="http://ca1.php.net/manual/en/function.error-reporting.php" target="_blank">error_reporting()</a>
setting, so you can see each and every error/warning/notice that occurs. Note: even when you
set this to <code>2047</code>, you shouldn't see any problems - we've tried to weed them all out.
So report a bug if you do see a problem.
</td>
</tr>
<tr>
<td>$maxGeneratedRows</td>
<td><span class="label label-info">optional</span></td>
<td>number</td>
<td>
The maximum number of rows that can be generated at a time.
</td>
</tr>
<tr>
<td>$defaultNumRows</td>
<td><span class="label label-info">optional</span></td>
<td>number</td>
<td>
The default number of rows to generate that appears in the Generator.
</td>
</tr>
<tr>
<td>$defaultLanguageFile</td>
<td><span class="label label-info">optional</span></td>
<td>string</td>
<td>
The default language file to use. Should be just "en" or "fr".
</td>
</tr>
<tr>
<td>$pluginSettings</td>
<td><span class="label label-info">optional</span></td>
<td>array</td>
<td>
<p>
Since the <code>settings.php</code> file is in the only place in your installation that
contains custom settings, plugins (Data Types and Export Types) that need to have custom
options need to store it there as well. Right now this $pluginSettings option is only needed
for the <code>Date</code> Data Type, to allow you to choose to generate "safe dates" (for
more info on that, see <a href="https://github.com/benkeen/generatedata/issues/246">this
github thread</a>).
</p>
<p>
The format of this setting is as follows. It's a bit verbose, but is fully extensible
down the road.
</p>
<pre class="prettyprint linenums">
$pluginSettings = array(
"dataType" => array(
"Date" => array(
"useSafeDates" => true
)
)
);
</pre>
<p>
The actual settings depend on the Data Type / Export Type.
</p>
</td>
</tr>
<tr>
<td>$maxDataSetHistorySize</td>
<td><span class="label label-info">optional</span></td>
<td>number</td>
<td>
Added in <b>3.2.1</b>. Every time you save a data set, it stores a history of changes. In the
user interface when you click on the Data Set icon it will show a <b>history</b> link
for each data set: that will list the history of changes made to that data set. This
setting lets you control the size of the history. Defaults to <code>200</code>.
</td>
</tr>
<tr>
<td>$apiEnabled</td>
<td><span class="label label-info">optional</span></td>
<td>boolean</td>
<td>
If you want to enable the REST API, this needs to be set to <code>true</code>. Check
out the <a href="api.html">API Documentation</a> for more info.
</td>
</tr>
<tr>
<td>$timeout</td>
<td><span class="label label-info">optional</span></td>
<td>integer</td>
<td>
This defaults to <b>300</b> (5 minutes). If you have a slow/busy CPU or are generating
really large amounts of data (or a combination of the two), the generation requests
can sometimes timeout. This setting lets you override the default value.
</td>
</tr>
</tbody>
</table>
</section>
</div>
</div>
</div>
<br />
<script src="assets/js/jquery.js"></script>
<script src="assets/js/google-code-prettify/prettify.js"></script>
<script src="assets/js/bootstrap-transition.js"></script>
<script src="assets/js/bootstrap-alert.js"></script>
<script src="assets/js/bootstrap-modal.js"></script>
<script src="assets/js/bootstrap-dropdown.js"></script>
<script src="assets/js/bootstrap-scrollspy.js"></script>
<script src="assets/js/bootstrap-tab.js"></script>
<script src="assets/js/bootstrap-tooltip.js"></script>
<script src="assets/js/bootstrap-popover.js"></script>
<script src="assets/js/bootstrap-button.js"></script>
<script src="assets/js/bootstrap-collapse.js"></script>
<script src="assets/js/bootstrap-carousel.js"></script>
<script src="assets/js/bootstrap-typeahead.js"></script>
<script src="assets/js/bootstrap-affix.js"></script>
<script src="lightbox/js/lightbox.js"></script>
<script>$(function() { prettyPrint(); });</script>
<footer>
<div class="container">
<div class="row">
<div class="span12">
</div>
</div>
</div>
</footer>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-41026944-1', 'benkeen.github.io');
ga('send', 'pageview');
</script>
</body>
</html>