Now all important places where plugins are loaded are guarded by a
try/except. We're catching Throwables here to be able to catch stuff
like syntax errors early on (otherwise they will only be caught by our
ErrorConverter much too late). This means that this change requires PHP
7.0 minimum!
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.
* psr2-pluginredux:
Minor optimizations in PluginController
Snake to Camel case fixes inn PluginController
Fix snake->camel case, doc blocks
minor code simplification
snake to camel case fixes in EventHandler
Move list of plugin types to plugin controller constant
Avoid accessing the evet system before it's intialized
Avoid processing events before the Event System is intiialized
isEnabled instead of isDisabled
removed get_directory() method from PluginController
fix type hints
moved plugin controller to Extension namespace
removed deleted file from autoloader
deprecated trigger_event() in favor of a static method on Event
First go at moving the plugin classes into their own namespace
I opted for ignoring the camel case funtion check not because the public hash_*
methods are widely used but because I find this style actually cleaner
in this case where the method name is auto-built from the hash type
name.
* master: (65 commits)
updated composer dependencies
Release preparation
translation update
do not disclose email or IP addresses of users through RSS
small fix
Make default encapsulation more readable and less duplicate.
Replace htmlspecialchars to hsc in core
Add the preview-bool for the cache file.
Add htmlspecialchars when showing $DATE_AT
#2021 broken links to W3C validators also dokuwiki and php are on https
made bin/wantedpage.php more flexible
doc abbreviation
Fix PHP Notices: Reduce error log noise
Create valid empty options
translation update
doc fix
translation update
using $options->getCmd to retrieve show-pages parameter
added option to wantedpages.php to show or not show pages where broken links occur
show pages where broken links occur: page_id => broken_link
...
* master: (70 commits)
Release preparation
translation update
do not disclose email or IP addresses of users through RSS
small fix
Make default encapsulation more readable and less duplicate.
Replace htmlspecialchars to hsc in core
Add the preview-bool for the cache file.
Add htmlspecialchars when showing $DATE_AT
#2021 broken links to W3C validators also dokuwiki and php are on https
made bin/wantedpage.php more flexible
doc abbreviation
Fix PHP Notices: Reduce error log noise
Create valid empty options
translation update
doc fix
translation update
using $options->getCmd to retrieve show-pages parameter
added option to wantedpages.php to show or not show pages where broken links occur
show pages where broken links occur: page_id => broken_link
clean extension names. fixes#2042
...
* master:
fix error in config manager caused by changes visibility
Continue if there are no attributes
avoid dependency tests being marked as risky
replaced some more each calls
remove deprecated each() call
test constructors need to call parent constructor
use dataprovider in password tests
removed deprecated blowfish class
replace some var keywords
translation update
PassHash.class.php: in case of brcrypt, use the most recent variant $2y$
translation update
Fix Typo in remote API (#1938)
translation update
translation update
translation update
use 403 response on bad logins. closes#1937
* master: (54 commits)
updated geshi
authpdo - use type safe comparison on passwords. fixes#1765
removed unneeded files from random_compat
Use cryptographically secure pseudo random number generator (CSPRNG)
translation update
translation update
translation update
translation update
translation update
or maybe I only now figured out the right travis config :-/
disable 7.1 testing completely
allow 7.1 failures until it's released #1682
DE translation for key 'protected'
Use 'Benachrichtigung' instead of 'Notifikation'
Fix spelling of some terms (lower to upper case)
DE translation for key: addUser_error_missing_pass
DE translation for keys: update_name, update_mail
translation update
translation update
Implemented interwiki substitution for external images (issue #1614).
...
We used to ship only parts of phpseclib in inc/phpseclib which made it a
little tricky to update. This replaces the library with a composer
installed version, making the rest of the library available to plugin
authors. It might fix a problem with PHP 7.1 as reported in #1682
(unconfirmed)
This introduces an autoloader for namespaces starting with plugin\*
This way, plugins can easily have additional classes auto loaded without
needing to register their own loader. A plugin\*\test\* namespace will
automatically be mapped to the _test directory of the plugin.
Autoloader should return true if it can handle the class so other registered autoloader don't execute.
require is faster than require_once and should be safe to use since the autoloader won't run if the class already exists
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.
This introduces an abstract base class that command line tools need to
inherit from. It provides a simple framework for registering accepted
command line options and provides commonly needed things like help
output and colored text.
Existing CLI scripts still need to be converted.