Subversion Repositories oidinfo_api

Compare Revisions

No changes between revisions

Regard whitespace Rev 23 → Rev 24

/trunk/README.md
0,0 → 1,17
 
# oid-info.com API for PHP
 
## Introduction
 
[oid-info.com](http://oid-info.com/) is a public repository for Object Identifiers (OIDs). This API is available in PHP and can be used in web-interfaces (Apache module, cgi-bin, etc.) but can also be used in command line tools written in PHP (on Linux with shebang `#!/usr/bin/php`) .
 
The majority of the functions provided by this API helps developers in creating XML files which can be uploaded to the OID repository to add multiple OIDs, but the API also contains other helpful utilities related to OIDs, UUIDs and the OID repository in general. The XML generation can be useful for Registration Authorities (RAs) that want to deliver their assignments to oid-info.com , but also for people who want to support the OID repository by adding OIDs from public sources. The XML files generated by these API functions are conform with the [XML schema of oid-info.com](http://www.oid-info.com/oid.xsd) and can be uploaded [here](http://www.oid-info.com/submit.htm) - you will also find more information about the XML submission at these pages.
 
An example of a XML generation code can be found here: [oidinfo_example.phps](https://misc.daniel-marschall.de/oid-repository/api/oidinfo_example.phps)
 
The API is licensed under the terms of the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0) and was written by [Daniel Marschall](http://www.daniel-marschall.de/).
 
## Documentation
 
See the full docuimentation in the **index.html** file
 
Property changes:
Added: svn:mime-type
+text/markdown
\ No newline at end of property
/trunk/index.html
19,7 → 19,7
 
<h1>oid-info.com API for PHP</h1>
 
<p><i>12 March 2019</i></p>
<p><i>24 November 2021</i></p>
 
<h2>Introduction</h2>
 
/trunk/oidinfo_api.inc.phps
3,7 → 3,7
/*
* OID-Info.com API for PHP
* Copyright 2019-2021 Daniel Marschall, ViaThinkSoft
* Version 2021-06-19
* Version 2021-11-24
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
179,6 → 179,8
}
 
public function softCorrectEMail($email, $params) {
$params = $this->init_params($params);
 
$email = str_replace(' ', '', $email);
$email = str_replace('&', '@', $email);
$email = str_replace('(at)', '@', $email);
195,6 → 197,8
}
 
public function softCorrectPhone($phone, $params) {
$params = $this->init_params($params);
 
// TODO: if no "+", add "+1" , but only if address is in USA
// TODO: or use param to fixate country if it is not known
/*
258,6 → 262,8
const OIDINFO_CORRECT_DESC_DISALLOW_ENDING_DOT = 2;
 
public function correctDesc($desc, $params, $ending_dot_policy=self::OIDINFO_CORRECT_DESC_OPTIONAL_ENDING_DOT, $enforce_xhtml_light=false) {
$params = $this->init_params($params);
 
$desc = trim($desc);
 
$desc = preg_replace('@<!\\[CDATA\\[(.+)\\]\\]>@ismU', '\\1', $desc);
485,7 → 491,7
 
echo $oa->createXMLEntry($oid, $elements, $params, $comment);
*/
public function createXMLEntry($oid, $elements, $params, $comment='') {
private function init_params($params) {
// Backward compatibility
if (!isset($params['do_csv_check'])) $params['do_simpleping_check'] = true;
 
503,6 → 509,11
if (!isset($params['tolerant_htmlentities'])) $params['tolerant_htmlentities'] = true;
if (!isset($params['ignore_xhtml_light'])) $params['ignore_xhtml_light'] = false;
 
return $params;
}
public function createXMLEntry($oid, $elements, $params, $comment='') {
$params = $this->init_params($params);
 
$out = '';
if (!empty($comment)) $out .= "\t\t<!-- $comment -->\n";