Subversion Repositories oidplus

Compare Revisions

No changes between revisions

Regard whitespace Rev 1415 → Rev 1416

/trunk/dev/ft_get_oid_data.inc.php
0,0 → 1,35
<?php
 
/*
* OIDplus 2.0
* Copyright 2019 - 2021 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.
*/
 
use ViaThinkSoft\OIDplus\OIDplus;
 
function ft_get_oid_data(string $oid) {
$url = OIDplus::baseConfig()->getValue('OIDINFO_API_URL') . '&oid='.urlencode($oid);
$options = array('http' => array('user_agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36'));
$context = stream_context_create($options);
$cont_json = @file_get_contents($url, false, $context);
if (!$cont_json) {
sleep(5);
$cont_json = @file_get_contents($url);
if (!$cont_json) throw new Exception("Cannot get info of OID $oid\n");
}
$data = json_decode($cont_json,true);
return $data;
}
 
/trunk/dev/generate_example_data_firebird
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/trunk/dev/generate_wellknown_country_firebird
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/trunk/dev/generate_wellknown_other_access
28,6 → 28,7
use ViaThinkSoft\OIDplus\OIDplus;
 
require_once __DIR__ . '/../includes/oidplus.inc.php';
require_once __DIR__ . '/ft_get_oid_data.inc.php';
 
OIDplus::init(false);
if (!OIDplus::baseConfig()->exists('OIDINFO_API_URL')) {
229,18 → 230,3
echo "\n";
}
echo "select '-- Generator \"generate_wellknown_other_access\" checksum ".dechex(crc32($check_sum))."';\n";
 
# ---
 
function ft_get_oid_data($oid) {
$url = OIDplus::baseConfig()->getValue('OIDINFO_API_URL') . '&oid='.urlencode($oid);
$cont_json = @file_get_contents($url);
if (!$cont_json) {
sleep(5);
$cont_json = @file_get_contents($url);
if (!$cont_json) return false;
}
$data = json_decode($cont_json,true);
 
return $data;
}
/trunk/dev/generate_wellknown_other_firebird
28,6 → 28,7
use ViaThinkSoft\OIDplus\OIDplus;
 
require_once __DIR__ . '/../includes/oidplus.inc.php';
require_once __DIR__ . '/ft_get_oid_data.inc.php';
 
OIDplus::init(false);
if (!OIDplus::baseConfig()->exists('OIDINFO_API_URL')) {
223,18 → 224,3
echo "\n";
}
echo '-- Generator "generate_wellknown_other_firebird" checksum '.dechex(crc32($check_sum))."\n";
 
# ---
 
function ft_get_oid_data($oid) {
$url = OIDplus::baseConfig()->getValue('OIDINFO_API_URL') . '&oid='.urlencode($oid);
$cont_json = @file_get_contents($url);
if (!$cont_json) {
sleep(5);
$cont_json = @file_get_contents($url);
if (!$cont_json) return false;
}
$data = json_decode($cont_json,true);
 
return $data;
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/trunk/dev/generate_wellknown_other_mssql
31,6 → 31,7
use ViaThinkSoft\OIDplus\OIDplus;
 
require_once __DIR__ . '/../includes/oidplus.inc.php';
require_once __DIR__ . '/ft_get_oid_data.inc.php';
 
OIDplus::init(false);
if (!OIDplus::baseConfig()->exists('OIDINFO_API_URL')) {
226,18 → 227,3
echo "\n";
}
echo '-- Generator "generate_wellknown_other_mssql" checksum '.dechex(crc32($check_sum))."\n";
 
# ---
 
function ft_get_oid_data($oid) {
$url = OIDplus::baseConfig()->getValue('OIDINFO_API_URL') . '&oid='.urlencode($oid);
$cont_json = @file_get_contents($url);
if (!$cont_json) {
sleep(5);
$cont_json = @file_get_contents($url);
if (!$cont_json) return false;
}
$data = json_decode($cont_json,true);
 
return $data;
}
/trunk/dev/generate_wellknown_other_mysql
28,6 → 28,7
use ViaThinkSoft\OIDplus\OIDplus;
 
require_once __DIR__ . '/../includes/oidplus.inc.php';
require_once __DIR__ . '/ft_get_oid_data.inc.php';
 
OIDplus::init(false);
if (!OIDplus::baseConfig()->exists('OIDINFO_API_URL')) {
223,18 → 224,3
echo "\n";
}
echo '-- Generator "generate_wellknown_other_mysql" checksum '.dechex(crc32($check_sum))."\n";
 
# ---
 
function ft_get_oid_data($oid) {
$url = OIDplus::baseConfig()->getValue('OIDINFO_API_URL') . '&oid='.urlencode($oid);
$cont_json = @file_get_contents($url);
if (!$cont_json) {
sleep(5);
$cont_json = @file_get_contents($url);
if (!$cont_json) return false;
}
$data = json_decode($cont_json,true);
 
return $data;
}
/trunk/dev/generate_wellknown_other_oracle
28,6 → 28,7
use ViaThinkSoft\OIDplus\OIDplus;
 
require_once __DIR__ . '/../includes/oidplus.inc.php';
require_once __DIR__ . '/ft_get_oid_data.inc.php';
 
OIDplus::init(false);
if (!OIDplus::baseConfig()->exists('OIDINFO_API_URL')) {
223,18 → 224,3
echo "\n";
}
echo '-- Generator "generate_wellknown_other_oracle" checksum '.dechex(crc32($check_sum))."\n";
 
# ---
 
function ft_get_oid_data($oid) {
$url = OIDplus::baseConfig()->getValue('OIDINFO_API_URL') . '&oid='.urlencode($oid);
$cont_json = @file_get_contents($url);
if (!$cont_json) {
sleep(5);
$cont_json = @file_get_contents($url);
if (!$cont_json) return false;
}
$data = json_decode($cont_json,true);
 
return $data;
}
/trunk/dev/generate_wellknown_other_pgsql
28,6 → 28,7
use ViaThinkSoft\OIDplus\OIDplus;
 
require_once __DIR__ . '/../includes/oidplus.inc.php';
require_once __DIR__ . '/ft_get_oid_data.inc.php';
 
OIDplus::init(false);
if (!OIDplus::baseConfig()->exists('OIDINFO_API_URL')) {
223,18 → 224,3
echo "\n";
}
echo '-- Generator "generate_wellknown_other_pgsql" checksum '.dechex(crc32($check_sum))."\n";
 
# ---
 
function ft_get_oid_data($oid) {
$url = OIDplus::baseConfig()->getValue('OIDINFO_API_URL') . '&oid='.urlencode($oid);
$cont_json = @file_get_contents($url);
if (!$cont_json) {
sleep(5);
$cont_json = @file_get_contents($url);
if (!$cont_json) return false;
}
$data = json_decode($cont_json,true);
 
return $data;
}
/trunk/dev/generate_wellknown_other_sqlite
28,6 → 28,7
use ViaThinkSoft\OIDplus\OIDplus;
 
require_once __DIR__ . '/../includes/oidplus.inc.php';
require_once __DIR__ . '/ft_get_oid_data.inc.php';
 
OIDplus::init(false);
if (!OIDplus::baseConfig()->exists('OIDINFO_API_URL')) {
229,18 → 230,3
echo "\n";
}
echo '-- Generator "generate_wellknown_other_sqlite" checksum '.dechex(crc32($check_sum))."\n";
 
# ---
 
function ft_get_oid_data($oid) {
$url = OIDplus::baseConfig()->getValue('OIDINFO_API_URL') . '&oid='.urlencode($oid);
$cont_json = @file_get_contents($url);
if (!$cont_json) {
sleep(5);
$cont_json = @file_get_contents($url);
if (!$cont_json) return false;
}
$data = json_decode($cont_json,true);
 
return $data;
}
/trunk/dev/oidinfo_add_missing
21,6 → 21,7
use ViaThinkSoft\OIDplus\OIDplus;
 
require_once __DIR__ . '/../includes/oidplus.inc.php';
require_once __DIR__ . '/ft_get_oid_data.inc.php';
 
OIDplus::init(false);
if (!OIDplus::baseConfig()->exists('OIDINFO_API_URL')) {
120,21 → 121,6
}
 
/**
* @param string $oid
* @return false|array
*/
function ft_get_oid_data(string $oid) {
$url = OIDplus::baseConfig()->getValue('OIDINFO_API_URL') . '&oid='.urlencode($oid);
$cont_json = @file_get_contents($url);
if (!$cont_json) {
sleep(5);
$cont_json = @file_get_contents($url);
if (!$cont_json) return false;
}
return json_decode($cont_json,true);
}
 
/**
* @param string $sql
* @param array|null $prep
* @return void