Constants.php 3.76 KB
Newer Older
1
2
3
4
5
6
7
8
<?php
/**
 * Created by PhpStorm.
 * User: crose
 * Date: 1/1/16
 * Time: 8:35 PM
 */

Carsten  Rose's avatar
Carsten Rose committed
9
10
const QFQ_INI = "qfq.ini";  // QFQ configuration file: db access

11
12
13
const FORM_LOAD = 'form_load';
const FORM_SAVE = 'form_save';

14
15
16
17
18
19
// Sanatize Classifier
const SANATIZE_ALNUMX = "alnumx";
const SANATIZE_DIGIT = "digit";
const SANATIZE_ALL = "all";
const SANATIZE_DEFAULT = SANATIZE_DIGIT;

20
21
22
23
24
25
// dbQuerySimple
const ROW_REGULAR = "regular";
const ROW_IMPLODE_ALL = "implode_all";
const ROW_EXACT_1 = "exact_1";
const ROW_EMPTY_IS_OK = "empty_is_ok";

26
27
// QFQ Error Codes
const ERROR_UNKNOW_SANATIZE_CLASS = 1001;
28
const ERROR_OPEN_DATABASE = 1002;
29
const ERROR_CODE_SHOULD_NOT_HAPPEN = 1003;
Carsten  Rose's avatar
Carsten Rose committed
30
const ERROR_VALUE_ALREADY_CODPIED = 1004;
31
// 1005
Carsten  Rose's avatar
Carsten Rose committed
32
const ERROR_MISSING_FORM_NAME = 1006;
33
const ERROR_IN_SQL_STATEMENT = 1007;
Carsten  Rose's avatar
Carsten Rose committed
34
const ERROR_READ_FILE = 1008;
35

36
37
38
39
40
41
42
43
// DB Errors
//const ERROR_DB_QUERY_SIMPLE = 2000;
const ERROR_DB_GENERIC_CHECK = 2001;
const ERROR_DB_TOO_FEW_ROWS = 2002;
const ERROR_DB_TOO_MANY_ROWS = 2003;
//
// Store Names: Identifier
//
44
45
const STORE_FORM = "F";  // form, still not saved in database
const STORE_SIP = "S"; // SIP
Carsten  Rose's avatar
Carsten Rose committed
46
const STORE_RECORD = "R"; // selected record from primary table.
47
const STORE_TABLE_DEFINITION = "T"; // table definition in database of primary table
48
const STORE_CLIENT = "C"; // Client: POST variable, if not found: GET variable
Carsten  Rose's avatar
Carsten Rose committed
49
const STORE_T3_BODYTEXT = "B"; // Typo3 > Page content record > bodytext
50
const STORE_ZERO = "0"; // value: 0, might helpfull if variable is empty but used in an SQL statement, which might produce a SQL error otherwise if substituted with an empty string
Carsten  Rose's avatar
Carsten Rose committed
51
const STORE_SYSTEM = "Y"; // various system values like db connection credentials
52
53
const STORE_DEF_FORM = "O"; // Store for the Form defition. 1:1 copy of the record from table 'form'
const STORE_DEF_FORM_ELEMENT = "E"; // Store for the FormEelements. 1:1 copy of the record from table 'formelement'
54

55
const USE_STORE_DEFAULT = "FSRT";
56

57
58
59
60
//
// Store: Definitions
//

Carsten  Rose's avatar
Carsten Rose committed
61
// URL variables
62
63
64
65
66
67
68
69
const CLIENT_FORM = 'form';
const CLIENT_SIP = 's';
const CLIENT_RECORD_ID = 'r ';
const CLIENT_KEY_SEM_ID = 'keySemId';
const CLIENT_KEY_SEM_ID_USER = 'keySemIdUser';
const CLIENT_PAGE_ID = 'pageId';
const CLIENT_PAGE_TYPE = 'pageType';
const CLIENT_PAGE_LANGUAGE = 'pageLanguage';
Carsten  Rose's avatar
Carsten Rose committed
70

71
72
73
const CLIENT_GET_SIP = 'getSip';
const CLIENT_POST_SIP = 'postSip';

Carsten  Rose's avatar
Carsten Rose committed
74
75
76
// T3 Bodytext Keywords
const T3_BODYTEXT_FORM = CLIENT_FORM;
const T3_BODYTEXT_DEBUG_LOAD = 'debugLoad';
77
78
79
80
81
82
83
84
const T3_BODYTEXT_DEBUG_SAVE = 'debugSave';

// System
const SYSTEM_DBUSER = 'DBUSER';
const SYSTEM_DBSERVER = 'DBSERVER';
const SYSTEM_DBPW = 'DBPW';
const SYSTEM_DB = 'DB';
const SYSTEM_TESTDB = 'TESTDB';
85
86
87
const SYSTEM_SESSIONNAME = 'SESSIONNAME';
const SYSTEM_DBH = 'dataBaseHandle';

88
89
90
91
92
93
94
// die folgenden Elemente sind vermutlich nicht noetig, wenn Store Klassen gloable Vars benutzt.
//const SYSTEM_FORM_DEF = 'formDefinition'; // Type: SANATIZE_ALNUMX / AssocArray. Final form to process. Useful for error reporting.
//const SYSTEM_FORM_ELEMENT_DEF = 'formElementDefinition'; // Type: SANATIZE_ALL / AssocArray. Formelement which are processed at the moment. Useful for error reporting.
//const SYSTEM_FORM_ELEMENT_FIELD = 'formElementField'; // Type: SANATIZE_ALNUMX / String. Fieldname of processed Formelement. Useful for error reporting.
const SYSTEM_SQL_RAW = 'sqlRaw';  // Type: SANATIZE_ALL / String. SQL Query (before substitute). Useful for error reporting.
const SYSTEM_SQL_FINAL = 'sqlFinal'; //  Type: SANATIZE_ALL / String. SQL Query (after substitute). Useful for error reporting.
const SYSTEM_SQL_COUNT = 'sqlCount'; //  Type: SANATIZE_DIGIT / Int.Number of rows in SQL ResultSet. Useful for error reporting.
95
96

// FORM - copy from table 'form' of processed form
97
//const DEF_FORM_NAME = CLIENT_FORM;
98
99

// FORMELEMENT - copy of all formElements of processed form
100
//const DEF_FORM_ELEMENT_ID = 'id';