History log of /dokuwiki/inc/Remote/Api.php (Results 1 – 25 of 30)
Revision Date Author Comments
# b5284271 09-Jan-2024 Andreas Gohr <andi@splitbrain.org>

API: add backward compatibility to API Version 11

This adds legacy support for the old API calls. This is mostly untested
but should work. Returns might not be 100% compatible in all cases but I
did

API: add backward compatibility to API Version 11

This adds legacy support for the old API calls. This is mostly untested
but should work. Returns might not be 100% compatible in all cases but I
did my best to return the same things as before.

This will be removed in the future of course and is just to not
completely break any API usage immeadiately.

show more ...


# d48c2b25 07-Jan-2024 Andreas Gohr <andi@splitbrain.org>

API: code style fixes


# 12b99753 07-Jan-2024 Andreas Gohr <andi@splitbrain.org>

fix XMLRPC server tests

We test against the MockAPICore now since the tests are meant to ensure
the general functionality of accepting XML and correctly calling
APICalls works, not that the API retu

fix XMLRPC server tests

We test against the MockAPICore now since the tests are meant to ensure
the general functionality of accepting XML and correctly calling
APICalls works, not that the API returns the right things (this is
tested in the ApiCore tests).
Since we no longer use dates but always integers, we no longer need to
handle that.

show more ...


# d1f06eb4 06-Jan-2024 Andreas Gohr <andi@splitbrain.org>

API: ApiCore tests fixed and extended


# b433b69e 05-Jan-2024 Andreas Gohr <andi@splitbrain.org>

API: remove file and date transformations

We always deal with timestamps or base64 now. Removing some of the magic
makes everything less complex.

Only affected plugin is confmanager, which needs an

API: remove file and date transformations

We always deal with timestamps or base64 now. Removing some of the magic
makes everything less complex.

Only affected plugin is confmanager, which needs an update.

show more ...


# e4e3d439 05-Jan-2024 Andreas Gohr <andi@splitbrain.org>

moved OpenAPI generator to correct namespace

added missing doc blocks


# 6cce3332 05-Jan-2024 Andreas Gohr <andi@splitbrain.org>

Reworked API definition

This cleans up the API:

* no more compatibility with obsolete wiki API
* no more difference between wiki.* and dokuwiki.* calls -> core.*
* use of optional parameters avoids

Reworked API definition

This cleans up the API:

* no more compatibility with obsolete wiki API
* no more difference between wiki.* and dokuwiki.* calls -> core.*
* use of optional parameters avoids double definitions
* use Response objects for complex results
* always use named primitives as input
* major cleanup of docblock descriptions

show more ...


# 1468a128 01-Dec-2023 Andreas Gohr <andi@splitbrain.org>

Fix first set of API tests


# 42e66c7a 30-Nov-2023 Andreas Gohr <andi@splitbrain.org>

First go at refactoring the API mechanisms

This introduces an ApiCall class that wraps around the actual method
that produces the result. This replaces various loose array structures
that provided t

First go at refactoring the API mechanisms

This introduces an ApiCall class that wraps around the actual method
that produces the result. This replaces various loose array structures
that provided the meta information before.

The ApiCall streamlines the aggregation of meta information between core
and plugin methods. Now all data is produced by Reflection based
introspection. Certain aspects can be overridden if needed. See
ApiCore::getRemoteInfo() for examples

This change removes the _getMethods() method from remote plugins and
introduces a getMethods() method. The two are NOT compatible as the
latter now returns a list of ApiCalls. However when looking at the
existing plugins, it seems that _getMethods() was nearly 100% obsolete
with the Reflection based default implementation. So most plugins will
not be affected at all. Some might now export one or two more methods
than before because of poor visibility settings (eg. not declaring
private/protected methods as such).

This change removes the RPC_CALL_ADD hook. Only a single plugin ever
implemented it. I'm not sure what this hook was supposed to do anyway.
Being able to declare arbitrarily named API endpoints seems wrong to me
anyway.

The new ApiCall now also supports passing named instead of positional
parameters. This will open up a new opportunity to get a proper openapi
spec running.

Next step is fixing the tests.

show more ...


# a70eeb2f 28-Nov-2023 Andreas Gohr <andi@splitbrain.org>

Merge pull request #3961 from dokuwiki/jsonrpc

Add JSON based alternative to XMLRPC


# 6c16a3a9 14-Sep-2023 fiwswe <fiwswe@fwml.de>

Use str_starts_with/str_ends_with


# d4f83172 31-Aug-2023 Andreas Gohr <andi@splitbrain.org>

code style: line breaks


# 51ee2399 30-Aug-2023 Gerrit Uitslag <klapinklapin@gmail.com>

update some plugin classes in phpdocs, reformatting


# a19c9aa0 30-Aug-2023 Gerrit Uitslag <klapinklapin@gmail.com>

recover comments in list


# 899eedfd 29-Aug-2023 Andreas Gohr <andi@splitbrain.org>

relax instance check in remoteAPI loading

This broke tests. Ideally an Interface should be defined that both the
real APICore and the TestPlugin implement.


# 104a3b7c 29-Aug-2023 Andreas Gohr <andi@splitbrain.org>

Apply rector fixes to inc/Remote


# d2e112c0 27-Apr-2023 Andreas Gohr <andi@splitbrain.org>

fix line length issue


# f657e5d0 27-Apr-2023 Andreas Gohr <andi@splitbrain.org>

Add JSON based alternative to XMLRPC

XMLRPC is a rather outdated and old-fashioned protocol not much in use
anymore. Developers prefer simpler, JSON based APIs.

This adds a new "JSONRPC" API. Basic

Add JSON based alternative to XMLRPC

XMLRPC is a rather outdated and old-fashioned protocol not much in use
anymore. Developers prefer simpler, JSON based APIs.

This adds a new "JSONRPC" API. Basically it exposes exactly the same
method calls as the XMLRPC API but using JSON instead of XML. It's not a
classical REST API, but should be just as easy to use for developers.

Here is an example call using CURL:

curl http://localhost/dokuwiki/lib/exe/jsonrpc.phs \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $token" \
-d '["wiki"]'

Please note that the above uses the token auth implemented in #2432.
Authentication via basic auth or cookies would work as well.

show more ...


# ec34bb30 19-Oct-2022 Andreas Gohr <andi@splitbrain.org>

Update core code to make use of sexplode()

This makes use of our own explode mechanism everywhere were we expect a
fixed number of results.


# e6a9d76f 30-Sep-2020 Syntaxseed <825423+syntaxseed@users.noreply.github.com>

Method names with leading double underscore are reserved by PHP.


# f7acdb5e 16-Feb-2021 Andreas Gohr <andi@splitbrain.org>

fix method handling for RPC_CALL_ADD

This event seems not to be used by any plugin, which explains why this
bug hasn't surfaced yet. Access is always checked against a full method
name in the form o

fix method handling for RPC_CALL_ADD

This event seems not to be used by any plugin, which explains why this
bug hasn't surfaced yet. Access is always checked against a full method
name in the form of plugin.<pluginname>.<method> Such a full method was
not passed when using an event as described in the documentation.

show more ...


# 056bf31f 06-Feb-2021 Damien Regad <dregad@mantisbt.org>

Fix various errors in PHPUnit tests on PHP 8


# 6d7829a7 03-Mar-2020 Phy <git@phy25.com>

add alternative support for PHP not throwing ArgumentCountError in remote/APi

PHP 5.6 and 7.0 won't throw ArgumentCountError. In this case, we use
set_error_handler on E_WARNING and throw exceptions

add alternative support for PHP not throwing ArgumentCountError in remote/APi

PHP 5.6 and 7.0 won't throw ArgumentCountError. In this case, we use
set_error_handler on E_WARNING and throw exceptions if it's about argument
missing.

show more ...


# e1215f13 03-Mar-2020 Phy <git@phy25.com>

catch ArgumentCountError and return XML error message for remoteAPI, fixes #2545

This is caused by a PHP 7.1 change:
https://www.php.net/manual/en/migration71.incompatible.php
#migration71.incompati

catch ArgumentCountError and return XML error message for remoteAPI, fixes #2545

This is caused by a PHP 7.1 change:
https://www.php.net/manual/en/migration71.incompatible.php
#migration71.incompatible.too-few-arguments-exception

Previously call_user_func_array will make those missing arguments
to NULL without throwing an exception.

show more ...


# 27f63a23 21-May-2019 Andreas Gohr <andi@splitbrain.org>

some more PSR2 cleanup

mostly overlong lines and more exclude patterns


12