Subversion Repositories oidplus

Rev

Rev 511 | Rev 1167 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
247 daniel-mar 1
<?php
2
 
3
/*
4
 * OIDplus 2.0
511 daniel-mar 5
 * Copyright 2019 - 2021 Daniel Marschall, ViaThinkSoft
247 daniel-mar 6
 *
7
 * Licensed under the Apache License, Version 2.0 (the "License");
8
 * you may not use this file except in compliance with the License.
9
 * You may obtain a copy of the License at
10
 *
11
 *     http://www.apache.org/licenses/LICENSE-2.0
12
 *
13
 * Unless required by applicable law or agreed to in writing, software
14
 * distributed under the License is distributed on an "AS IS" BASIS,
15
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
 * See the License for the specific language governing permissions and
17
 * limitations under the License.
18
 */
374 daniel-mar 19
 
1050 daniel-mar 20
use ViaThinkSoft\OIDplus\OIDplus;
511 daniel-mar 21
 
294 daniel-mar 22
// Note: You can override these values in your userdata/baseconfig/config.inc.php file
247 daniel-mar 23
//       Do NOT edit this file, because your changes would get overwritten
24
//       by program updates!
25
 
26
// -----------------------------------------------------------------------------
27
 
28
/**
261 daniel-mar 29
  * LIMITS_MAX_OID_DEPTH
247 daniel-mar 30
  *
31
  * Example:
32
  *     OID 2.999.123.456 has a depth of 4.
33
  *
34
  * Default value:
35
  *     30
36
  *
37
  * Which value is realistic?
38
  *     In the oid-info.com database (April 2020), the greatest depth is 22.
39
  *
40
  * What would happen if you had OIDs with a higher arc size in your database?
41
  *     MySQL and MSSQL: The arcs after that maximum depth would not be sorted.
42
  *     PostgreSQL: No effects
43
  *
44
  * Note: This setting affects the performance of OIDplus, since it is used
45
  *       for sorting in MySQL and MSSQL (not in PostgreSQL).
46
  **/
261 daniel-mar 47
OIDplus::baseConfig()->setValue('LIMITS_MAX_OID_DEPTH', 30);
247 daniel-mar 48
 
49
// -----------------------------------------------------------------------------
50
 
51
/**
261 daniel-mar 52
  * LIMITS_MAX_ID_LENGTH
374 daniel-mar 53
  *
247 daniel-mar 54
  * Example:
55
  *     OID 2.999.123.456 has a length of 13 characters in dot notation.
56
  *     OIDplus adds the prefix "oid:" in front of every OID,
57
  *     so the overal length of the ID would be 17.
374 daniel-mar 58
  *
247 daniel-mar 59
  * Default value:
60
  *     255 digits (OIDs 251 digits)
374 daniel-mar 61
  *
247 daniel-mar 62
  * Which value is realistic?
63
  *     In the oid-info.com database (April 2020), the OID with the greatest size is 65 characters (dot notation)
374 daniel-mar 64
  *
247 daniel-mar 65
  * Maximal value:
66
  *     OIDs may only have a size of max 251 characters in dot notation.
67
  *     Reason: The field defintion of *_objects.oid is defined as varchar(255),
68
  *             and the OID will have the prefix 'oid:' (4 bytes).
69
  *     You can increase the limit by changing the field definition in the database.
70
  **/
261 daniel-mar 71
OIDplus::baseConfig()->setValue('LIMITS_MAX_ID_LENGTH', 255);
247 daniel-mar 72
 
73
// -----------------------------------------------------------------------------
74
 
75
/**
261 daniel-mar 76
  * LIMITS_MAX_OID_ARC_SIZE
247 daniel-mar 77
  *
78
  * Example:
79
  *     OID 2.999.123.456 has a max arc size of 3 digits.
80
  *
81
  * Default value:
82
  *     50 digits
83
  *
84
  * Minimal recommended value:
85
  *     The arc size should not be smaller than 39, because UUIDs (inside OID 2.25)
86
  *     have arcs up to 39 digits!
87
  *     In the oid-info.com database (April 2020), indeed, the greatest value 39.
88
  *
89
  * Maximal value:
90
  *     MySQL:
91
  *             Max value: 65 (limit by the DBMS)
92
  *             Reason: This is the limit of the "decimal" data type
93
  *             What would happen if you had OIDs with a higher arc size in your database?
94
  *                     The sorting will not work, because MySQL handles the cast like this:
95
  *                     cast('1234' as decimal(3)) = 999
96
  *     PostgreSQL:
97
  *             Max value: 131072 (limit by the DBMS)
98
  *             Reason: This is the limit for the "numeric" data type.
99
  *             What would happen if you had OIDs with a higher arc size in your database?
374 daniel-mar 100
  *                     OIDplus will STOP WORKING, because the SQL queries will fail due to the failed cast.
247 daniel-mar 101
  *     SQL Server:
102
  *             Max value: 512 (limit in function getOidArc)
103
  *             Reason: Since SQL Server does not support 128 bit integers (the limit of decimal is 38 digits),
104
  *                     the function getOidArc() needs to pad each arc with zeros,
105
  *                     returning a string that has to be sorted.
106
  *                     The data type varchar(512) is the return value type of getOidArc().
107
  *                     If you need more (which is unlikely), you can edit the definition of that function.
108
  *             What would happen if you had OIDs with a higher arc size in your database?
109
  *                     The sorting will not work, because SQL Server handles the cast like this:
110
  *                     select cast('1234' as varchar(3)) = '123'
111
  **/
261 daniel-mar 112
OIDplus::baseConfig()->setValue('LIMITS_MAX_OID_ARC_SIZE', 50);
247 daniel-mar 113
 
114
// -----------------------------------------------------------------------------
115
 
116
/**
261 daniel-mar 117
  * LIMITS_MAX_OID_ASN1_ID_LEN
247 daniel-mar 118
  *
119
  * Default value:
120
  *     255 characters
121
  *
122
  * Maximal value:
123
  *     255, as defined in the database fields *_asn1id.name
124
  *     You can change the database field definition if you really need more.
125
  **/
261 daniel-mar 126
OIDplus::baseConfig()->setValue('LIMITS_MAX_OID_ASN1_ID_LEN', 255);
247 daniel-mar 127
 
128
// -----------------------------------------------------------------------------
129
 
130
/**
261 daniel-mar 131
  * LIMITS_MAX_OID_UNICODE_LABEL_LEN
247 daniel-mar 132
  *
133
  * Default value:
374 daniel-mar 134
  *     255 bytes (UTF-8 encoded!)
247 daniel-mar 135
  *
136
  * Maximal value:
137
  *     255, as defined in the database fields *_iri.name
138
  *     You can change the database field definition if you really need more.
139
  **/
261 daniel-mar 140
OIDplus::baseConfig()->setValue('LIMITS_MAX_OID_UNICODE_LABEL_LEN', 255);
247 daniel-mar 141
 
142
// -----------------------------------------------------------------------------