Skip to content

Commit

Permalink
Make changes backwards compatible
Browse files Browse the repository at this point in the history
This should give people that are currently using this functionality time
to update their code.
  • Loading branch information
micgro42 committed Aug 14, 2018
1 parent 075ea52 commit 5d3f7ae
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions helper/actionscript.php
Expand Up @@ -32,6 +32,13 @@ public function run($fields, $thanks, $argv) {
$classFragment = substr($scriptName, 0, strpos($scriptName, '.'));
$className = 'helper_plugin_bureaucracy_handler_' . $classFragment;

$deprecatedClassName = 'bureaucracy_handler_' . $classFragment;
if (!class_exists($className) && class_exists($deprecatedClassName)) {
msg("Please change this script's class-name to <code>$className</code>.
Your current scheme <code>$deprecatedClassName</code> is deprecated and will stop working in the future.", 2);
$className = $deprecatedClassName;
}

/** @var dokuwiki\plugin\bureaucracy\interfaces\bureaucracy_handler_interface $handler */
$handler = new $className;

Expand Down

0 comments on commit 5d3f7ae

Please sign in to comment.