forked from rgarcia/generatedata
-
Notifications
You must be signed in to change notification settings - Fork 0
/
library.php
65 lines (49 loc) · 1.81 KB
/
library.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
<?php
/*------------------------------------------------------------------------------------------------*\
library.php
-----------
The main settings & code for the script.
\*------------------------------------------------------------------------------------------------*/
$g_default_language = "en";
// MySQL database settings
$g_table_prefix = "gd_"; // if you change this, you'll need to update the database tables too
$g_db_hostname = "";
$g_db_username = "";
$g_db_password = "";
$g_db_name = "";
$g_show_save_panel = true;
$g_version = "2.3.9";
$g_max_generated_rows = 10000;
// ------------------------------------------------------------------------------------------------
error_reporting(2047);
$folder = dirname(__FILE__);
require_once("$folder/code/accounts.php");
require_once("$folder/code/countries.php");
require_once("$folder/code/database.php");
require_once("$folder/code/data_types.php");
require_once("$folder/code/general.php");
require_once("$folder/code/generator.php");
require_once("$folder/code/translations.php");
require_once("$folder/code/smarty/Smarty.class.php");
// now sort out the language choice. This allows us to pass the chosen language via the query string. As
// such, we put in a few safeguards against hacking attempts
if (!isset($_SESSION["gd"]))
$_SESSION["gd"] = array();
$g_language = (isset($_SESSION["gd"]["language"])) ? $_SESSION["gd"]["language"] : $g_default_language;
if (isset($_GET["lang"]))
{
$lang = strip_tags($_GET["lang"]);
$lang = preg_replace("/\W/", "", $lang);
$g_language = $lang;
}
$_SESSION["gd"]["language"] = $g_language;
if (!is_file("$folder/lang/$g_language.php"))
$g_language = $g_default_language;
require_once("$folder/lang/$g_language.php");
// ordered!
$g_field_groups = array(
"human_data",
"text",
"other"
);
$link = gd_db_connect();