From 1cfc159f1abbc389615bb24f89e71a6fb0dc5b7b Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Tue, 9 Apr 2013 14:56:26 +0200 Subject: [PATCH] Un-deprecated Object::add_extension() non-LSB usage (fixes #1710) Its usage is too common to force-remove it just for a shortcut. We still recommend adding extensions through YAML of course. --- core/Object.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/core/Object.php b/core/Object.php index e36333e2c..e5130c4e0 100755 --- a/core/Object.php +++ b/core/Object.php @@ -450,8 +450,13 @@ abstract class Object { * @param string $extension Subclass of {@link Extension} with optional parameters * as a string, e.g. "Versioned" or "Translatable('Param')" */ - public static function add_extension($extension) { - $class = get_called_class(); + public static function add_extension($classOrExtension, $extension = null) { + if(func_num_args() > 1) { + $class = $classOrExtension; + } else { + $class = get_called_class(); + $extension = $classOrExtension; + } if(!preg_match('/^([^(]*)/', $extension, $matches)) { return false;