summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGerrit Uitslag <klapinklapin@gmail.com>2014-10-02 14:55:24 +0200
committerGerrit Uitslag <klapinklapin@gmail.com>2014-10-02 14:55:24 +0200
commit7e8500eea1e53b1de0e0f70400664afa442cd08d (patch)
tree4dd246a9b26f930fc7cbfef76116320dcbe77aaf /lib
parente3710957c6b7e12293805a15d0624be7c7054092 (diff)
downloadrpg-7e8500eea1e53b1de0e0f70400664afa442cd08d.tar.gz
rpg-7e8500eea1e53b1de0e0f70400664afa442cd08d.tar.bz2
PHPDocs and some improvements
Diffstat (limited to 'lib')
-rw-r--r--lib/exe/xmlrpc.php5
-rw-r--r--lib/plugins/admin.php14
-rw-r--r--lib/plugins/authplain/_test/escaping.test.php5
-rw-r--r--lib/plugins/config/settings/config.class.php2
-rw-r--r--lib/plugins/extension/admin.php6
-rw-r--r--lib/plugins/extension/helper/repository.php6
-rw-r--r--lib/plugins/extension/lang/en/lang.php3
-rw-r--r--lib/plugins/extension/lang/nl/lang.php2
8 files changed, 32 insertions, 11 deletions
diff --git a/lib/exe/xmlrpc.php b/lib/exe/xmlrpc.php
index 3a878ebe4..61a68281f 100644
--- a/lib/exe/xmlrpc.php
+++ b/lib/exe/xmlrpc.php
@@ -23,6 +23,11 @@ class dokuwiki_xmlrpc_server extends IXR_Server {
$this->IXR_Server();
}
+ /**
+ * @param string $methodname
+ * @param array $args
+ * @return IXR_Error|mixed
+ */
function call($methodname, $args){
try {
$result = $this->remote->call($methodname, $args);
diff --git a/lib/plugins/admin.php b/lib/plugins/admin.php
index 9a1fb9fdc..d063af612 100644
--- a/lib/plugins/admin.php
+++ b/lib/plugins/admin.php
@@ -14,6 +14,10 @@ if(!defined('DOKU_INC')) die();
*/
class DokuWiki_Admin_Plugin extends DokuWiki_Plugin {
+ /**
+ * @param string $language language code
+ * @return string
+ */
function getMenuText($language) {
$menutext = $this->getLang('menu');
if (!$menutext) {
@@ -23,10 +27,14 @@ class DokuWiki_Admin_Plugin extends DokuWiki_Plugin {
return $menutext;
}
+ /**
+ * @return int
+ */
function getMenuSort() {
return 1000;
}
+
function handle() {
trigger_error('handle() not implemented in '.get_class($this), E_USER_WARNING);
}
@@ -35,10 +43,16 @@ class DokuWiki_Admin_Plugin extends DokuWiki_Plugin {
trigger_error('html() not implemented in '.get_class($this), E_USER_WARNING);
}
+ /**
+ * @return bool
+ */
function forAdminOnly() {
return true;
}
+ /**
+ * @return array
+ */
function getTOC(){
return array();
}
diff --git a/lib/plugins/authplain/_test/escaping.test.php b/lib/plugins/authplain/_test/escaping.test.php
index cd5294157..5cf631508 100644
--- a/lib/plugins/authplain/_test/escaping.test.php
+++ b/lib/plugins/authplain/_test/escaping.test.php
@@ -12,10 +12,11 @@
* @group plugins
*/
class helper_plugin_authplain_escaping_test extends DokuWikiTest {
-
+
protected $pluginsEnabled = array('authplain');
+ /** @var auth_plugin_authplain */
protected $auth;
-
+
protected function reloadUsers() {
/* auth caches data loaded from file, but recreated object forces reload */
$this->auth = new auth_plugin_authplain();
diff --git a/lib/plugins/config/settings/config.class.php b/lib/plugins/config/settings/config.class.php
index cbf6ea452..590631dae 100644
--- a/lib/plugins/config/settings/config.class.php
+++ b/lib/plugins/config/settings/config.class.php
@@ -570,7 +570,7 @@ if (!class_exists('setting')) {
/**
* Returns caution
*
- * @return bool|string caution string, otherwise false for invalid caution
+ * @return false|string caution string, otherwise false for invalid caution
*/
public function caution() {
if (!empty($this->_caution)) {
diff --git a/lib/plugins/extension/admin.php b/lib/plugins/extension/admin.php
index 99c74848b..de4992937 100644
--- a/lib/plugins/extension/admin.php
+++ b/lib/plugins/extension/admin.php
@@ -75,10 +75,10 @@ class admin_plugin_extension extends DokuWiki_Admin_Plugin {
case 'uninstall':
$extension->setExtension($extname);
$status = $extension->uninstall();
- if($status !== true) {
- msg($status, -1);
- } else {
+ if($status) {
msg(sprintf($this->getLang('msg_delete_success'), hsc($extension->getDisplayName())), 1);
+ } else {
+ msg(sprintf($this->getLang('msg_delete_failed'), hsc($extension->getDisplayName())), -1);
}
break;
case 'enable';
diff --git a/lib/plugins/extension/helper/repository.php b/lib/plugins/extension/helper/repository.php
index 6ffe89eb7..5dc2707cf 100644
--- a/lib/plugins/extension/helper/repository.php
+++ b/lib/plugins/extension/helper/repository.php
@@ -32,7 +32,7 @@ class helper_plugin_extension_repository extends DokuWiki_Plugin {
$request_needed = false;
foreach ($list as $name) {
$cache = new cache('##extension_manager##'.$name, '.repo');
- $result = null;
+
if (!isset($this->loaded_extensions[$name]) && $this->hasAccess() && !$cache->useCache(array('age' => 3600 * 24))) {
$this->loaded_extensions[$name] = true;
$request_data['ext'][] = $name;
@@ -64,7 +64,7 @@ class helper_plugin_extension_repository extends DokuWiki_Plugin {
public function hasAccess() {
if ($this->has_access === null) {
$cache = new cache('##extension_manager###hasAccess', '.repo');
- $result = null;
+
if (!$cache->useCache(array('age' => 3600 * 24, 'purge'=>1))) {
$httpclient = new DokuHTTPClient();
$httpclient->timeout = 5;
@@ -91,7 +91,7 @@ class helper_plugin_extension_repository extends DokuWiki_Plugin {
*/
public function getData($name) {
$cache = new cache('##extension_manager##'.$name, '.repo');
- $result = null;
+
if (!isset($this->loaded_extensions[$name]) && $this->hasAccess() && !$cache->useCache(array('age' => 3600 * 24))) {
$this->loaded_extensions[$name] = true;
$httpclient = new DokuHTTPClient();
diff --git a/lib/plugins/extension/lang/en/lang.php b/lib/plugins/extension/lang/en/lang.php
index 72c9b9e2d..4da41a2fd 100644
--- a/lib/plugins/extension/lang/en/lang.php
+++ b/lib/plugins/extension/lang/en/lang.php
@@ -69,7 +69,8 @@ $lang['status_bundled'] = 'bundled';
$lang['msg_enabled'] = 'Plugin %s enabled';
$lang['msg_disabled'] = 'Plugin %s disabled';
-$lang['msg_delete_success'] = 'Extension uninstalled';
+$lang['msg_delete_success'] = 'Extension %s uninstalled';
+$lang['msg_delete_failed'] = 'Uninstalling Extension %s failed';
$lang['msg_template_install_success'] = 'Template %s installed successfully';
$lang['msg_template_update_success'] = 'Template %s updated successfully';
$lang['msg_plugin_install_success'] = 'Plugin %s installed successfully';
diff --git a/lib/plugins/extension/lang/nl/lang.php b/lib/plugins/extension/lang/nl/lang.php
index a54924e93..f75f78121 100644
--- a/lib/plugins/extension/lang/nl/lang.php
+++ b/lib/plugins/extension/lang/nl/lang.php
@@ -63,7 +63,7 @@ $lang['status_template'] = 'template';
$lang['status_bundled'] = 'Gebundeld';
$lang['msg_enabled'] = 'Plugin %s ingeschakeld';
$lang['msg_disabled'] = 'Plugin %s uitgeschakeld';
-$lang['msg_delete_success'] = 'Uitbreiding gedeinstalleerd';
+$lang['msg_delete_success'] = 'Uitbreiding %s gedeinstalleerd';
$lang['msg_template_install_success'] = 'Template %s werd succesvol geïnstalleerd';
$lang['msg_template_update_success'] = 'Template %s werd succesvol geüpdatet';
$lang['msg_plugin_install_success'] = 'Plugin %s werd succesvol geïnstalleerd';