* logging:
added JavaScript based filter mechanism
added logging configuration
replaced out calls to dbglog with new Logger calls
added convenience methods to log to our default facilities
added logviwer admin plugin
added log dir to git
central logging mechanism
Log facitlities can now be disabled. By default only debug is disabled.
It might make sense to by default disable deprecated as well?
Debug logging is now independend of the allowdebug method. allowdebug
was often used in two ways: for displaying errors directly to the user
and for logging to the debug log. Now it only controls the former.
This introduces a logger mechanism and a new data/log directory. This is
a first proof of concept. It's built on top of the new global error
handling mechanism
Things to discuss:
* should we adopt PSR-3 somehow? if yes, how and should plugins be able
to drop-in other psr3 loggers?
* how to configure which facilities shall be logged?
* should we implement a log deletion feature?
* is the log format sensible?
* should we implement a log viewer admin plugin?
* should logging trigger events (it should maybe replace the
deprecation event)
As described in
https://github.com/dwp-forge/columns/issues/5#issuecomment-638467603
sometime the Lexer constants have not been (auto)loaded when a syntax plugin
is invoked (I'm not sure why).
In general PSR2 discourages a mix of main code and function/class setup
with the call to define() being considered main code.
This patch moves these the define calls to a separate new file, solving
both of the above problems.
These are not all our defines. Instead I focused on the ones that are
ENUM-like.
In the future we should think about what defines can be replaced by
class constants and what other define() calls should be moved.
In #3069 the internal structure of messages was accidentally changed to
be numeric. This reintroduces the proper string constants.
I thought about keeping the integers and do the mapping in
html_msgarea() but some plugins rely on inspecting the global $MSG so I
don't want to change it.
* utf8refactor:
replaced deprecated utf8 functions
formatting cleanup
mark old utf8 functions deprecated
Some cleanup for the UTF-8 stuff
Moved all utf8 methods to their own namespaced classes
Create separate table files for UTF-8 handling
* master: (34 commits)
fix color for noninstalled extensions
show disabled extensions in gray
warn about inaccessible repo api
bugfix: access check was never cached
First go on a CLI component for the extension manager
use strict type comparison
translation update
translation update
fix #dokuwiki__sitetools current item not in highlight due to Greebo change
authplain: Add tests for group retrieval
authplain: Add a simple method for retrieving user groups
translation update
Negative string offsets are allowed in PHP 7.1+ only
improve memory check output
fix and test php_to_byte() related to #2756#2556
translation update
translation update
translation update
translation update
translation update
...
Instead of writing our own magic getters and setters for all variables
that used to be public, this adds a trait that does that in a generic
way.
This trait was copied from MediaWiki and adjusted to DokuWiki.
The original author seems to be @tgr Tisza Gergő
The downside of this trait is that the properties keep their
(potentially undesired) name. While that could be fixed within the
helper, that might add unnecessary complexity. The name can change when
support is dropped.
This protects against the current commit being packed and not available
as an object and against zlib not being available.
More information about commits being packed and thus not available can
be found here: https://git-scm.com/book/en/v2/Git-Internals-Packfiles
Currently, getVersion() shows the date when the HEAD of the local git
repository was last changed, not the date of the current commit. This
commit fixes that behavior.
* master:
🐛 (Draft) Fix exception when actually viewing a draft of a page
💡(Draft): Add doc block for constructor
✅ Add unittest for deleteUsers remote API call
fix remote API call dokuwiki.deleteUsers
translation update
🏗 Use json for the response to dw_locktimer
✨(dw_locktimer) plugins may reuse to add fields and callbacks
💄 (editor) draft status is semantically not part of the toolbar
🏗 Create new Draft class and move draft handling there
translation update
correctly avoid notice in init.
avoid creating expensive stacktrace in dbg_deprecated()
add method to EventHandler to check if an event is actually handled
introduce INFO_DEPRECATION_LOG event
This adds an event to dbg_deprecated(). This allows plugins to handle
deprecation warnings. One example would be @cosmocode/dokuwiki-plugin-sentry
One thing I don't like, but don't know how to avaoid is that this
function used to abort super early when $conf['allowdebug'] wasn't set.
However for the sentry plugin you probably would want logs, but still do
not show any debugging to end users (which allow debug would do).
So now the backtrace is always built, the event triggered and then
everything is sent to dbglog() which may simply throw everything away.
Suggestions on how to improve this welcome.
There is no need for this check, since these files should not have any
main code that is executed on direct call.
Fixes PSR1.Files.SideEffects.FoundWithSymbols
If SSL is not supported, a HTTP request will be made. In the log the request type will be indicated, but on the frontend no additional message would be shown (I think it's better to notify admins about non-SSL situations, but currently when this fetch encounter error, no error message will be shown, so it's better not to add any warning).
DokuWiki assumes that the server's time is correct. Especially page
revisions and cache handling depend on correct time. If that's not the
case it can lead to problems later (as mentioned in #1644).
This patch adds a very simple time check using the Date response header
from the DokuWiki server to our do=check mechanism.
In an older version of PHP a file_exists() call would issue a warning
when the file did not exist. This was fixed in later PHP releases. Since
we require PHP 5.3 now, there's no need to supress any error here
anymore. This might even give a minor performance boost.
The existing logic for messages.txt requires some valid update
response (ending in %) to the messages update check before it clears
the current messages.
However update.dokuwiki.org appears to return an empty string response
if everything is up to date. (ie http://update.dokuwiki.org/check/46.1 )
As a result if there are update messages in messages.txt they don't
automatically go away after updating to the current version. The only
time they change is when a newer release comes out. The upgrade plugin
has logic in it to force a re-download of messages.txt, but currently
this just re-downloads the old update messages.
This change explicitly allows for "" as a valid "no messages"
indicator (distinct from false, which is the HTTP error indicator.)
This introduces a new dbg_deprecated() function which allows for easy
marking of deprecated functions. Each call is logged to the debuglog
when debuggin is enabled.