Subversion Repositories oidinfo_api

Rev

Rev 2 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2 Rev 8
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
$oa->addSimplePingProvider('viathinksoft.de:49500');
24
$oa->addSimplePingProvider('viathinksoft.de:49500');
7
 
25
 
8
echo $oa->xmlAddHeader('hello', 'world', 'test@example.com');
26
echo $oa->xmlAddHeader('hello', 'world', 'test@example.com');
9
 
27
 
10
$params['allow_html'] = true; // Allow HTML in <description> and <information>
28
$params['allow_html'] = true; // Allow HTML in <description> and <information>
11
$params['allow_illegal_email'] = true; // It should be enabled, because the creator could have used some kind of human-readable anti-spam technique
29
$params['allow_illegal_email'] = true; // It should be enabled, because the creator could have used some kind of human-readable anti-spam technique
12
$params['soft_correct_behavior'] = OIDInfoAPI::SOFT_CORRECT_BEHAVIOR_NONE;
30
$params['soft_correct_behavior'] = OIDInfoAPI::SOFT_CORRECT_BEHAVIOR_NONE;
13
$params['do_online_check'] = false; // Flag to disable this online check, because it generates a lot of traffic and runtime.
31
$params['do_online_check'] = false; // Flag to disable this online check, because it generates a lot of traffic and runtime.
14
$params['do_illegality_check'] = false;
32
$params['do_illegality_check'] = false;
15
$params['do_simpleping_check'] = false;
33
$params['do_simpleping_check'] = false;
16
$params['auto_extract_name'] = '';
34
$params['auto_extract_name'] = '';
17
$params['auto_extract_url'] = '';
35
$params['auto_extract_url'] = '';
18
$params['always_output_comment'] = false; // Do not output comment if there was an error (e.g. OID already existing)
36
$params['always_output_comment'] = false; // Do not output comment if there was an error (e.g. OID already existing)
19
$params['creation_allowed_check'] = false;
37
$params['creation_allowed_check'] = false;
20
$params['tolerant_htmlentities'] = true;
38
$params['tolerant_htmlentities'] = true;
21
$params['ignore_xhtml_light'] = false;
39
$params['ignore_xhtml_light'] = false;
22
 
40
 
23
$elements['synonymous-identifier'] = ''; // string or array
41
$elements['synonymous-identifier'] = ''; // string or array
24
$elements['description'] = '';
42
$elements['description'] = '';
25
$elements['information'] = '';
43
$elements['information'] = '';
26
 
44
 
27
$elements['first-registrant']['first-name'] = '';
45
$elements['first-registrant']['first-name'] = '';
28
$elements['first-registrant']['last-name'] = '';
46
$elements['first-registrant']['last-name'] = '';
29
$elements['first-registrant']['address'] = '';
47
$elements['first-registrant']['address'] = '';
30
$elements['first-registrant']['email'] = '';
48
$elements['first-registrant']['email'] = '';
31
$elements['first-registrant']['phone'] = '';
49
$elements['first-registrant']['phone'] = '';
32
$elements['first-registrant']['fax'] = '';
50
$elements['first-registrant']['fax'] = '';
33
$elements['first-registrant']['creation-date'] = '';
51
$elements['first-registrant']['creation-date'] = '';
34
 
52
 
35
$elements['current-registrant']['first-name'] = '';
53
$elements['current-registrant']['first-name'] = '';
36
$elements['current-registrant']['last-name'] = '';
54
$elements['current-registrant']['last-name'] = '';
37
$elements['current-registrant']['address'] = '';
55
$elements['current-registrant']['address'] = '';
38
$elements['current-registrant']['email'] = '';
56
$elements['current-registrant']['email'] = '';
39
$elements['current-registrant']['phone'] = '';
57
$elements['current-registrant']['phone'] = '';
40
$elements['current-registrant']['fax'] = '';
58
$elements['current-registrant']['fax'] = '';
41
$elements['current-registrant']['modification-date'] = '';
59
$elements['current-registrant']['modification-date'] = '';
42
 
60
 
43
$oid = '2.999';
61
$oid = '2.999';
44
echo $oa->createXMLEntry($oid, $elements, $params, $comment='hello');
62
echo $oa->createXMLEntry($oid, $elements, $params, $comment='hello');
45
 
63
 
46
$oid = '2.999.1';
64
$oid = '2.999.1';
47
echo $oa->createXMLEntry($oid, $elements, $params, $comment='hello');
65
echo $oa->createXMLEntry($oid, $elements, $params, $comment='hello');
48
 
66
 
49
echo $oa->xmlAddFooter();
67
echo $oa->xmlAddFooter();
50
 
68