Rev 1116 | Rev 1131 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1116 | Rev 1130 | ||
---|---|---|---|
Line 76... | Line 76... | ||
76 | $cache_id .= implode('',$plugin_versions); |
76 | $cache_id .= implode('',$plugin_versions); |
77 | return $cache_id; |
77 | return $cache_id; |
78 | } |
78 | } |
79 | 79 | ||
80 | /** |
80 | /** |
81 | * @param $noCache |
81 | * @param bool $noCache |
82 | * @return array[]|mixed|null |
82 | * @return array[]|mixed|null |
83 | * @throws \ViaThinkSoft\OIDplus\OIDplusException |
83 | * @throws \ViaThinkSoft\OIDplus\OIDplusException |
84 | */ |
84 | */ |
85 | public function readAll($noCache = false) { |
85 | public function readAll(bool $noCache = false) { |
86 | static $local_cache = null; |
86 | static $local_cache = null; |
87 | 87 | ||
88 | $cache_file = OIDplus::localpath().'/userdata/cache/frdl_alt_id.ser'; |
88 | $cache_file = OIDplus::localpath().'/userdata/cache/frdl_alt_id.ser'; |
89 | if ($noCache === false) { |
89 | if ($noCache === false) { |
90 | // Local cache (to save time for multiple calls during the same HTTP request) |
90 | // Local cache (to save time for multiple calls during the same HTTP request) |
Line 131... | Line 131... | ||
131 | 131 | ||
132 | return $data; |
132 | return $data; |
133 | } |
133 | } |
134 | 134 | ||
135 | /** |
135 | /** |
136 | * @param $id |
136 | * @param string $id |
137 | * @return array|mixed|string[] |
137 | * @return array|mixed|string[] |
138 | * @throws \ViaThinkSoft\OIDplus\OIDplusException |
138 | * @throws \ViaThinkSoft\OIDplus\OIDplusException |
139 | */ |
139 | */ |
140 | public function getAlternativesForQuery($id/* 1.3.6.1.4.1.37476.2.5.2.3.7 signature takes just 1 param!? , $noCache = false*/) { |
140 | public function getAlternativesForQuery(string $id/* 1.3.6.1.4.1.37476.2.5.2.3.7 signature takes just 1 param!? , $noCache = false*/) { |
141 | 141 | ||
142 | static $caches = array(); |
142 | static $caches = array(); |
143 | 143 | ||
144 | if(/*$noCache === false && */isset($caches[$id]) ){ |
144 | if(/*$noCache === false && */isset($caches[$id]) ){ |
145 | return $caches[$id]; |
145 | return $caches[$id]; |
Line 205... | Line 205... | ||
205 | public function tree_search(string $request) { |
205 | public function tree_search(string $request) { |
206 | return false; |
206 | return false; |
207 | } |
207 | } |
208 | 208 | ||
209 | /** |
209 | /** |
210 | * @param $id |
210 | * @param string $id |
211 | * @return false|mixed|string |
211 | * @return false|mixed|string |
212 | * @throws \ViaThinkSoft\OIDplus\OIDplusException |
212 | * @throws \ViaThinkSoft\OIDplus\OIDplusException |
213 | */ |
213 | */ |
214 | public function getCanonical($id){ |
214 | public function getCanonical(string $id){ |
215 | foreach($this->getAlternativesForQuery($id) as $alt){ |
215 | foreach($this->getAlternativesForQuery($id) as $alt){ |
216 | if (strpos($alt,':') !== false) { |
216 | if (strpos($alt,':') !== false) { |
217 | list($ns, $altIdRaw) = explode(':', $alt, 2); |
217 | list($ns, $altIdRaw) = explode(':', $alt, 2); |
218 | if($ns === 'oid'){ |
218 | if($ns === 'oid'){ |
219 | return $alt; |
219 | return $alt; |
Line 224... | Line 224... | ||
224 | return false; |
224 | return false; |
225 | } |
225 | } |
226 | 226 | ||
227 | /** |
227 | /** |
228 | * Implements interface 1.3.6.1.4.1.37476.2.5.2.3.4 |
228 | * Implements interface 1.3.6.1.4.1.37476.2.5.2.3.4 |
229 | * @param $id |
229 | * @param string $id |
230 | * @param $out |
230 | * @param array $out |
231 | * @return void |
231 | * @return void |
232 | * @throws \ViaThinkSoft\OIDplus\OIDplusException |
232 | * @throws \ViaThinkSoft\OIDplus\OIDplusException |
233 | */ |
233 | */ |
234 | public function whoisObjectAttributes($id, &$out) { |
234 | public function whoisObjectAttributes(string $id, array &$out) { |
235 | $xmlns = 'oidplus-frdlweb-altids-plugin'; |
235 | $xmlns = 'oidplus-frdlweb-altids-plugin'; |
236 | $xmlschema = 'urn:oid:1.3.6.1.4.1.37553.8.1.8.8.53354196964.641310544.1714020422'; |
236 | $xmlschema = 'urn:oid:1.3.6.1.4.1.37553.8.1.8.8.53354196964.641310544.1714020422'; |
237 | $xmlschemauri = OIDplus::webpath(__DIR__.'/altids.xsd',OIDplus::PATH_ABSOLUTE); |
237 | $xmlschemauri = OIDplus::webpath(__DIR__.'/altids.xsd',OIDplus::PATH_ABSOLUTE); |
238 | 238 | ||
239 | $handleShown = false; |
239 | $handleShown = false; |
Line 282... | Line 282... | ||
282 | } |
282 | } |
283 | } |
283 | } |
284 | 284 | ||
285 | /** |
285 | /** |
286 | * Implements interface 1.3.6.1.4.1.37476.2.5.2.3.4 |
286 | * Implements interface 1.3.6.1.4.1.37476.2.5.2.3.4 |
287 | * @param $email |
287 | * @param string $email |
288 | * @param $out |
288 | * @param array $out |
289 | * @return void |
289 | * @return void |
290 | */ |
290 | */ |
291 | public function whoisRaAttributes($email, &$out) { |
291 | public function whoisRaAttributes(string $email, array &$out) { |
292 | 292 | ||
293 | } |
293 | } |
294 | 294 | ||
295 | } |
295 | } |