Subversion Repositories oidplus

Compare Revisions

Regard whitespace Rev 246 → Rev 247

/trunk/includes/limits.inc.php
0,0 → 1,145
<?php
 
/*
* OIDplus 2.0
* Copyright 2020 Daniel Marschall, ViaThinkSoft
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Note: You can override these values in your config.inc.php file
// Do NOT edit this file, because your changes would get overwritten
// by program updates!
 
// -----------------------------------------------------------------------------
 
/**
* OIDPLUS_MAX_OID_DEPTH
*
* Example:
* OID 2.999.123.456 has a depth of 4.
*
* Default value:
* 30
*
* Which value is realistic?
* In the oid-info.com database (April 2020), the greatest depth is 22.
*
* What would happen if you had OIDs with a higher arc size in your database?
* MySQL and MSSQL: The arcs after that maximum depth would not be sorted.
* PostgreSQL: No effects
*
* Note: This setting affects the performance of OIDplus, since it is used
* for sorting in MySQL and MSSQL (not in PostgreSQL).
**/
if (!defined('OIDPLUS_MAX_OID_DEPTH'))
define('OIDPLUS_MAX_OID_DEPTH', 30);
 
// -----------------------------------------------------------------------------
 
/**
* OIDPLUS_MAX_ID_LENGTH
*
* Example:
* OID 2.999.123.456 has a length of 13 characters in dot notation.
* OIDplus adds the prefix "oid:" in front of every OID,
* so the overal length of the ID would be 17.
*
* Default value:
* 255 digits (OIDs 251 digits)
*
* Which value is realistic?
* In the oid-info.com database (April 2020), the OID with the greatest size is 65 characters (dot notation)
*
* Maximal value:
* OIDs may only have a size of max 251 characters in dot notation.
* Reason: The field defintion of *_objects.oid is defined as varchar(255),
* and the OID will have the prefix 'oid:' (4 bytes).
* You can increase the limit by changing the field definition in the database.
**/
if (!defined('OIDPLUS_MAX_ID_LENGTH'))
define('OIDPLUS_MAX_ID_LENGTH', 255);
 
// -----------------------------------------------------------------------------
 
/**
* OIDPLUS_MAX_OID_ARC_SIZE
*
* Example:
* OID 2.999.123.456 has a max arc size of 3 digits.
*
* Default value:
* 50 digits
*
* Minimal recommended value:
* The arc size should not be smaller than 39, because UUIDs (inside OID 2.25)
* have arcs up to 39 digits!
* In the oid-info.com database (April 2020), indeed, the greatest value 39.
*
* Maximal value:
* MySQL:
* Max value: 65 (limit by the DBMS)
* Reason: This is the limit of the "decimal" data type
* What would happen if you had OIDs with a higher arc size in your database?
* The sorting will not work, because MySQL handles the cast like this:
* cast('1234' as decimal(3)) = 999
* PostgreSQL:
* Max value: 131072 (limit by the DBMS)
* Reason: This is the limit for the "numeric" data type.
* What would happen if you had OIDs with a higher arc size in your database?
* OIDplus will STOP WORKING, because the SQL queries will fail due to the failed cast.
* SQL Server:
* Max value: 512 (limit in function getOidArc)
* Reason: Since SQL Server does not support 128 bit integers (the limit of decimal is 38 digits),
* the function getOidArc() needs to pad each arc with zeros,
* returning a string that has to be sorted.
* The data type varchar(512) is the return value type of getOidArc().
* If you need more (which is unlikely), you can edit the definition of that function.
* What would happen if you had OIDs with a higher arc size in your database?
* The sorting will not work, because SQL Server handles the cast like this:
* select cast('1234' as varchar(3)) = '123'
**/
if (!defined('OIDPLUS_MAX_OID_ARC_SIZE'))
define('OIDPLUS_MAX_OID_ARC_SIZE', 50);
 
// -----------------------------------------------------------------------------
 
/**
* OIDPLUS_MAX_OID_ASN1_ID_LEN
*
* Default value:
* 255 characters
*
* Maximal value:
* 255, as defined in the database fields *_asn1id.name
* You can change the database field definition if you really need more.
**/
if (!defined('OIDPLUS_MAX_OID_ASN1_ID_LEN'))
define('OIDPLUS_MAX_OID_ASN1_ID_LEN', 255);
 
// -----------------------------------------------------------------------------
 
/**
* OIDPLUS_MAX_OID_UNICODE_LABEL_LEN
*
* Default value:
* 255 bytes (UTF-8 encoded!)
*
* Maximal value:
* 255, as defined in the database fields *_iri.name
* You can change the database field definition if you really need more.
**/
if (!defined('OIDPLUS_MAX_OID_UNICODE_LABEL_LEN'))
define('OIDPLUS_MAX_OID_UNICODE_LABEL_LEN', 255);
 
// -----------------------------------------------------------------------------