Subversion Repositories oidplus

Compare Revisions

No changes between revisions

Regard whitespace Rev 60 → Rev 61

/trunk/dev/oidinfo_compare
0,0 → 1,35
#!/usr/bin/php
<?php
 
require_once __DIR__ . '/../oidplus/includes/oidplus.inc.php';
 
OIDplus::init(true);
 
OIDplus::db()->set_charset("UTF8");
OIDplus::db()->query("SET NAMES 'utf8'");
 
define('ALL_OID_LIST', '/home/oidplus/all_oids.txt'); // contains all OIDs (non-public file)
define('DESIRED_ROOT', '1.3.6.1.4.1.37476');
 
# ---
 
exec("cat ".escapeshellarg(ALL_OID_LIST)." | sort | grep '^".DESIRED_ROOT."'", $out, $ec);
 
foreach ($out as $oid) {
$oid = trim($oid);
if ($oid == '') continue;
 
check_oid($oid);
}
 
function check_oid($oid) {
 
$res = mysql_query("select * from ".OIDPLUS_TABLENAME_PREFIX."objects where id = 'oid:$oid'");
$ok = mysql_num_rows($res) > 0;
 
if (!$ok) {
echo "Not existing: $oid\n";
}
}
 
echo "OK\n";
Property changes:
Added: svn:executable
+*
\ No newline at end of property