Subversion Repositories oidplus

Rev

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

Rev 1367 Rev 1416
Line 29... Line 29...
29
 */
29
 */
30
 
30
 
31
use ViaThinkSoft\OIDplus\OIDplus;
31
use ViaThinkSoft\OIDplus\OIDplus;
32
 
32
 
33
require_once __DIR__ . '/../includes/oidplus.inc.php';
33
require_once __DIR__ . '/../includes/oidplus.inc.php';
-
 
34
require_once __DIR__ . '/ft_get_oid_data.inc.php';
34
 
35
 
35
OIDplus::init(false);
36
OIDplus::init(false);
36
if (!OIDplus::baseConfig()->exists('OIDINFO_API_URL')) {
37
if (!OIDplus::baseConfig()->exists('OIDINFO_API_URL')) {
37
	die("OIDINFO_API_URL not available (API is currently not public)\n");
38
	die("OIDINFO_API_URL not available (API is currently not public)\n");
38
}
39
}
Line 224... Line 225...
224
		$check_sum .= $chunk;
225
		$check_sum .= $chunk;
225
	}
226
	}
226
	echo "\n";
227
	echo "\n";
227
}
228
}
228
echo '-- Generator "generate_wellknown_other_mssql" checksum '.dechex(crc32($check_sum))."\n";
229
echo '-- Generator "generate_wellknown_other_mssql" checksum '.dechex(crc32($check_sum))."\n";
229
 
-
 
230
# ---
-
 
231
 
-
 
232
function ft_get_oid_data($oid) {
-
 
233
	$url = OIDplus::baseConfig()->getValue('OIDINFO_API_URL') . '&oid='.urlencode($oid);
-
 
234
	$cont_json = @file_get_contents($url);
-
 
235
	if (!$cont_json) {
-
 
236
		sleep(5);
-
 
237
		$cont_json = @file_get_contents($url);
-
 
238
		if (!$cont_json) return false;
-
 
239
	}
-
 
240
	$data = json_decode($cont_json,true);
-
 
241
 
-
 
242
	return $data;
-
 
243
}
-