Rev 88 | Rev 236 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
54 | daniel-mar | 1 | #!/usr/bin/php |
2 | <?php |
||
3 | |||
4 | require_once __DIR__ . '/../includes/oidplus.inc.php'; |
||
5 | |||
6 | OIDplus::init(true); |
||
7 | |||
8 | # --- |
||
9 | |||
10 | #$cont = file_get_contents('https://oidplus.viathinksoft.com/oidplus_old/?action=list_all'); |
||
11 | $cont = file_get_contents(__DIR__ . '/oidplus_1_with_token.html'); |
||
12 | |||
13 | preg_match_all('@oid=\.(.+)">@ismU', $cont, $m); |
||
14 | foreach ($m[1] as $oid) { |
||
15 | check_oid($oid); |
||
16 | } |
||
17 | |||
18 | function check_oid($oid) { |
||
19 | |||
150 | daniel-mar | 20 | $res = OIDplus::db()->query("select * from ".OIDPLUS_TABLENAME_PREFIX."objects where id = ?", array("oid:$oid")); |
77 | daniel-mar | 21 | $ok = OIDplus::db()->num_rows($res) > 0; |
54 | daniel-mar | 22 | |
23 | if (!$ok) { |
||
24 | echo "Not existing: $oid\n"; |
||
25 | } |
||
26 | } |
||
27 | |||
28 | echo "OK\n"; |