◆ __construct()
ILIAS\components\WOPI\Discovery\Crawler::__construct |
( |
| ) |
|
Definition at line 42 of file Crawler.php.
44 $this->crawl_actions = [
45 ActionTarget::VIEW->value,
46 ActionTarget::EMBED_VIEW->value,
47 ActionTarget::EDIT->value,
48 ActionTarget::EMBED_EDIT->value,
49 ActionTarget::CONVERT->value,
◆ crawl()
ILIAS\components\WOPI\Discovery\Crawler::crawl |
( |
URI |
$discovery_url | ) |
|
Definition at line 73 of file Crawler.php.
References null, and ILIAS\components\WOPI\Discovery\Crawler\validate().
75 if (!$this->
validate($discovery_url)) {
81 foreach ($this->xml_app_elements as $app) {
83 foreach ($app->action as $action) {
84 $action_name = $action[
'name'] ??
null;
85 $action_ext = $action[
'ext'] ??
null;
86 $action_urlsrc = $action[
'urlsrc'] ??
null;
87 $target_text = isset($action[
'targetext']) ? (string) $action[
'targetext'] : null;
91 if (!$action_ext instanceof \SimpleXMLElement) {
94 if (!$action_urlsrc instanceof \SimpleXMLElement) {
98 if (!in_array((
string) $action_name, $this->crawl_actions,
true)) {
102 $uri_string = rtrim((
string) $action_urlsrc,
'?');
104 $uri = explode(
'?', $uri_string);
105 $uri_string = $uri[0];
108 (
string) $action_name,
109 (
string) $action_ext,
110 new URI($uri_string),
115 if ($actions === []) {
119 $app_name = $app[
'name'] ??
null;
120 if ($app_name === null) {
123 $app_fav_icon_url = $app[
'favIconUrl'] ??
null;
128 $app_fav_icon_url === null ? null :
new URI((
string) $app_fav_icon_url)
131 return new Apps($apps);
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
validate(URI $discovery_url)
◆ validate()
ILIAS\components\WOPI\Discovery\Crawler::validate |
( |
URI |
$discovery_url | ) |
|
Definition at line 53 of file Crawler.php.
References null.
Referenced by ILIAS\components\WOPI\Discovery\Crawler\crawl().
56 $this->content = file_get_contents((
string) $discovery_url) ?:
null;
57 if ($this->content ===
null) {
61 $this->discovery = simplexml_load_string($this->content) ?:
null;
62 if ($this->discovery ===
null) {
65 $this->xml_app_elements = $this->discovery->xpath(self::XPATH);
67 return is_array($this->xml_app_elements);
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
◆ $content
string ILIAS\components\WOPI\Discovery\Crawler::$content = null |
|
private |
◆ $crawl_actions
array ILIAS\components\WOPI\Discovery\Crawler::$crawl_actions = [] |
|
private |
◆ $discovery
SimpleXMLElement ILIAS\components\WOPI\Discovery\Crawler::$discovery = null |
|
private |
◆ $xml_app_elements
array ILIAS\components\WOPI\Discovery\Crawler::$xml_app_elements = null |
|
private |
◆ XPATH
const ILIAS\components\WOPI\Discovery\Crawler::XPATH = '/wopi-discovery/net-zone/app' |
|
private |
The documentation for this class was generated from the following file: