There was a global statement missing? This seems to have to been
broken in one of the recent merges.
Tests have been cleaned up but not changes in logic.
It seems that the dataProvider generator runs before the rest of the
test suite, resulting in a wrong modification timestamp being read.
It's unclear why this happens on Github only.
This breaks up the humongous functions from feed.php into multiple
classes. To keep compatibility with existing Plugin events, the basic
principle of how the feed is assembled has not been changed:
* depending on the given mode and other options lose arrays of items are
gathered
* these items are then converted (again based on the various options)
into proper FeedItems
* the FeedItems are then added to the Feed
The conversion from loosely typed item data to something more structured
is now done by the FeedItemProcessor classes. Some very basic tests have
been added. It does not cover erverything but covers more than before
(which was nothing).
Manual testing before merging this is highly recommended. I am not
confident that I ported over everything correctly.
No new features have been added, but especially media support could and
should be improved in the future.
When a basedir could not be detected, the default previously was '.'
resulting in a valid but weird URL (http://example.com/./doku.php). We
now default to an empty dir, resulting in a more sensible URL of
http://example.com/doku.php
This should not matter in real web server setups but will be in effect
while testing.
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.
When using named parameters, you can expect to be able to leave out any
optional parameter and have it take it's default, even when you specify
another "later" parameter. Luckily we already know all the defaults from
reflection anyway.
This introduces a new DocBlock parser to properly generate API
specifications. It also introduces the concept of Response classes to
better specify the response format.
This is still very much in progress.
Since PHP7.4 has no primitive type hints and PHP native methods have no
accessible docblocks, we can not use a native function for testing
(types always come back as string).
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.