Login | ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/oidinfo_api/trunk/oidinfo_example.phps
Revision: 8
Committed: Sat Nov 2 09:26:43 2019 UTC (5 months ago) by daniel-marschall
File size: 2688 byte(s)

File Contents

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