Subversion Repositories oidplus

Rev

Rev 1162 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1162 Rev 1416
Line 19... Line 19...
19
 */
19
 */
20
 
20
 
21
use ViaThinkSoft\OIDplus\OIDplus;
21
use ViaThinkSoft\OIDplus\OIDplus;
22
 
22
 
23
require_once __DIR__ . '/../includes/oidplus.inc.php';
23
require_once __DIR__ . '/../includes/oidplus.inc.php';
-
 
24
require_once __DIR__ . '/ft_get_oid_data.inc.php';
24
 
25
 
25
OIDplus::init(false);
26
OIDplus::init(false);
26
if (!OIDplus::baseConfig()->exists('OIDINFO_API_URL')) {
27
if (!OIDplus::baseConfig()->exists('OIDINFO_API_URL')) {
27
	die("OIDINFO_API_URL not available (API is currently not public)\n");
28
	die("OIDINFO_API_URL not available (API is currently not public)\n");
28
}
29
}
Line 118... Line 119...
118
	sql_execute("insert into ###objects (id, parent, title, description, ra_email, created, updated) values (?, ?, ?, ?, ?, ?, ?)",
119
	sql_execute("insert into ###objects (id, parent, title, description, ra_email, created, updated) values (?, ?, ?, ?, ?, ?, ?)",
119
		array("oid:$oid", "oid:$parent", $title, $description, $ra_email, $created, $updated));
120
		array("oid:$oid", "oid:$parent", $title, $description, $ra_email, $created, $updated));
120
}
121
}
121
 
122
 
122
/**
123
/**
123
 * @param string $oid
-
 
124
 * @return false|array
-
 
125
 */
-
 
126
function ft_get_oid_data(string $oid) {
-
 
127
	$url = OIDplus::baseConfig()->getValue('OIDINFO_API_URL') . '&oid='.urlencode($oid);
-
 
128
	$cont_json = @file_get_contents($url);
-
 
129
	if (!$cont_json) {
-
 
130
		sleep(5);
-
 
131
                $cont_json = @file_get_contents($url);
-
 
132
                if (!$cont_json) return false;
-
 
133
	}
-
 
134
	return json_decode($cont_json,true);
-
 
135
}
-
 
136
 
-
 
137
/**
-
 
138
 * @param string $sql
124
 * @param string $sql
139
 * @param array|null $prep
125
 * @param array|null $prep
140
 * @return void
126
 * @return void
141
 */
127
 */
142
function sql_execute(string $sql, array $prep=null) {
128
function sql_execute(string $sql, array $prep=null) {