summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Minz/Extension.php16
-rw-r--r--lib/Minz/ExtensionManager.php8
2 files changed, 3 insertions, 21 deletions
diff --git a/lib/Minz/Extension.php b/lib/Minz/Extension.php
index 78b8a2725..6b13f5a4e 100644
--- a/lib/Minz/Extension.php
+++ b/lib/Minz/Extension.php
@@ -3,7 +3,7 @@
/**
* The extension base class.
*/
-class Minz_Extension {
+abstract class Minz_Extension {
private $name;
private $entrypoint;
private $path;
@@ -31,11 +31,9 @@ class Minz_Extension {
* - version: a version for the current extension.
* - type: "system" or "user" (default).
*
- * It must not be redefined by child classes.
- *
* @param $meta_info contains information about the extension.
*/
- public function __construct($meta_info) {
+ final public function __construct($meta_info) {
$this->name = $meta_info['name'];
$this->entrypoint = $meta_info['entrypoint'];
$this->path = $meta_info['path'];
@@ -50,8 +48,6 @@ class Minz_Extension {
/**
* Used when installing an extension (e.g. update the database scheme).
*
- * It must be redefined by child classes.
- *
* @return true if the extension has been installed or a string explaining
* the problem.
*/
@@ -63,8 +59,6 @@ class Minz_Extension {
* Used when uninstalling an extension (e.g. revert the database scheme to
* cancel changes from install).
*
- * It must be redefined by child classes.
- *
* @return true if the extension has been uninstalled or a string explaining
* the problem.
*/
@@ -75,10 +69,8 @@ class Minz_Extension {
/**
* Call at the initialization of the extension (i.e. when the extension is
* enabled by the extension manager).
- *
- * It must be redefined by child classes.
*/
- public function init() {}
+ abstract public function init();
/**
* Set the current extension to enable.
@@ -115,8 +107,6 @@ class Minz_Extension {
/**
* Handle the configure action.
- *
- * It must be redefined by child classes.
*/
public function handleConfigureAction() {}
diff --git a/lib/Minz/ExtensionManager.php b/lib/Minz/ExtensionManager.php
index e24c6c30b..b2814e4a3 100644
--- a/lib/Minz/ExtensionManager.php
+++ b/lib/Minz/ExtensionManager.php
@@ -172,14 +172,6 @@ class Minz_ExtensionManager {
'` is not an instance of `Minz_Extension`');
return null;
}
- $reflector = new ReflectionClass($extension);
- $className = $reflector->getName();
- if ('Minz_Extension' === $reflector->getMethod('handleConfigureAction')->class ||
- 'Minz_Extension' === $reflector->getMethod('install')->class ||
- 'Minz_Extension' === $reflector->getMethod('init')->class ||
- 'Minz_Extension' === $reflector->getMethod('uninstall')->class) {
- Minz_Log::error("The '{$className}' extension class definition is deprecated. It will continue to work with the current version but will break in the future. The '{$className}' extension class needs to override the 'handleConfigurationAction' method, the 'install' method, the 'init' method, and the 'uninstall' method to work properly.");
- }
return $extension;
}