Subversion Repositories oidplus

Rev

Rev 557 | Rev 1162 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
557 daniel-mar 1
#!/usr/bin/env php
54 daniel-mar 2
<?php
3
 
511 daniel-mar 4
/*
5
 * OIDplus 2.0
6
 * Copyright 2019 - 2021 Daniel Marschall, ViaThinkSoft
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
 
54 daniel-mar 21
require_once __DIR__ . '/../includes/oidplus.inc.php';
22
 
23
OIDplus::init(true);
24
 
25
# ---
26
 
27
#$cont = file_get_contents('https://oidplus.viathinksoft.com/oidplus_old/?action=list_all');
28
$cont = file_get_contents(__DIR__ . '/oidplus_1_with_token.html');
29
 
30
preg_match_all('@oid=\.(.+)">@ismU', $cont, $m);
31
foreach ($m[1] as $oid) {
32
	check_oid($oid);
33
}
34
 
1130 daniel-mar 35
/**
36
 * @param string $oid
37
 * @return void
38
 */
39
function check_oid(string $oid) {
54 daniel-mar 40
 
261 daniel-mar 41
	$res = OIDplus::db()->query("select * from ###objects where id = ?", array("oid:$oid"));
236 daniel-mar 42
	$ok = $res->num_rows() > 0;
54 daniel-mar 43
 
44
	if (!$ok) {
45
		echo "Not existing: $oid\n";
46
	}
47
}
48
 
49
echo "OK\n";