Subversion Repositories oidinfo_api

Rev

Rev 2 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2 Rev 8
Line 1... Line 1...
1
<?php
1
<?php
2
 
2
 
-
 
3
/*
-
 
4
 * OID-Info.com API for PHP
-
 
5
 * Copyright 2019 Daniel Marschall, ViaThinkSoft
-
 
6
 * Version 2019-11-01
-
 
7
 *
-
 
8
 * Licensed under the Apache License, Version 2.0 (the "License");
-
 
9
 * you may not use this file except in compliance with the License.
-
 
10
 * You may obtain a copy of the License at
-
 
11
 *
-
 
12
 *     http://www.apache.org/licenses/LICENSE-2.0
-
 
13
 *
-
 
14
 * Unless required by applicable law or agreed to in writing, software
-
 
15
 * distributed under the License is distributed on an "AS IS" BASIS,
-
 
16
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-
 
17
 * See the License for the specific language governing permissions and
-
 
18
 * limitations under the License.
-
 
19
 */
-
 
20
 
3
require_once __DIR__ . '/oidinfo_api.inc.phps';
21
require_once __DIR__ . '/oidinfo_api.inc.phps';
4
 
22
 
5
$oa = new OIDInfoAPI();
23
$oa = new OIDInfoAPI();
6
 
24
 
7
$oa->loadIllegalityRuleFile('oid_illegality_rules');
25
$oa->loadIllegalityRuleFile('oid_illegality_rules');
Line 11... Line 29...
11
assert($oa->illegalOID('2.999') === false);
29
assert($oa->illegalOID('2.999') === false);
12
assert($oa->illegalOID('3') === true);
30
assert($oa->illegalOID('3') === true);
13
assert($oa->illegalOID('1') === false);
31
assert($oa->illegalOID('1') === false);
14
assert($oa->illegalOID('1.0.16') === true);
32
assert($oa->illegalOID('1.0.16') === true);
15
assert($oa->illegalOID('1.2.6.0') === true); // 1.2.6 is illegal -> 1.2.6.0 too
33
assert($oa->illegalOID('1.2.6.0') === true); // 1.2.6 is illegal -> 1.2.6.0 too
-
 
34
assert($oa->illegalOID('2.25.340282366920938463463374607431768211455') === false);
-
 
35
assert($oa->illegalOID('2.25.340282366920938463463374607431768211456') === true);
16
 
36
 
17
assert($oa->strictCheckSyntax('0', false, true) === true);
37
assert($oa->strictCheckSyntax('0', false, true) === true);
18
assert($oa->strictCheckSyntax('1', false, true) === true);
38
assert($oa->strictCheckSyntax('1', false, true) === true);
19
assert($oa->strictCheckSyntax('(requesting)', false, true) === false);
39
assert($oa->strictCheckSyntax('(requesting)', false, true) === false);