Skip to content

Commit 6180f6b

Browse files
authored
add initial remote capabilty
1 parent 6beadf0 commit 6180f6b

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

remote.php

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
3+
use dokuwiki\Extension\RemotePlugin;
4+
5+
class remote_plugin_farmer extends RemotePlugin {
6+
/** @var helper_plugin_farmer hlp */
7+
protected $helper;
8+
9+
/**
10+
* remote_plugin_struct constructor.
11+
*/
12+
public function __construct()
13+
{
14+
parent::__construct();
15+
16+
$this->helper = plugin_load('helper', 'farmer');
17+
}
18+
19+
public function getHostname() {
20+
return $this->helper->getConfig()['base']['farmhost'];
21+
}
22+
23+
public function getBaseDomain() {
24+
return $this->helper->getConfig()['base']['basedomain'];
25+
}
26+
27+
public function listAnimals() {
28+
return $this->helper->getAllAnimals();
29+
}
30+
31+
public function listAnimalUrls() {
32+
foreach($this->helper->getAllAnimals() as $animal) {
33+
$animalUrls[] = $this->helper->getAnimalURL($animal);
34+
}
35+
return $animalUrls;
36+
}
37+
}

0 commit comments

Comments
 (0)