diff --git a/public_html/deployment/classes/rollout_base.class.php b/public_html/deployment/classes/rollout_base.class.php index fde105372f91d0e34784af8476cfecc1d769b5dd..f9369b8bb44e453a1e46ba224d5f1841c0fec92f 100644 --- a/public_html/deployment/classes/rollout_base.class.php +++ b/public_html/deployment/classes/rollout_base.class.php @@ -17,6 +17,13 @@ class rollout_base implements iRolloutplugin // --------------------------------------------------------------- // VARIABLES // --------------------------------------------------------------- + + /** + * Plugin name + * @var string + */ + protected string $_sPluginName = 'UNSET'; + /** * identifier for current plugin; it us used to find the current plugin * settings in the config structore for global and project based config @@ -82,6 +89,7 @@ class rollout_base implements iRolloutplugin * Constructor * initialize rollout plugin * @param array $aParams hash with those possible keys + * id string rollout plugin id in project config * lang string language, i.e. 'de' * phase string name of phase in a project * globalcfg array given global config $aConfig @@ -94,7 +102,8 @@ class rollout_base implements iRolloutplugin // set current plugin id - taken from plugin directory name above $oReflection = new ReflectionClass($this); - $this->_sPluginId = basename(dirname($oReflection->getFileName())); + $this->_sPluginName = basename(dirname($oReflection->getFileName())); + $this->_sPluginId = $aParams['id'] ?? 'UNSET'; // ----- init language if (isset($aParams['lang'])) { @@ -244,7 +253,7 @@ class rollout_base implements iRolloutplugin (isset($aVarinfos['ttl']) ? $aVarinfos['ttl'] : 60) ); if (!$aCallbackData) { - $aVarinfos['type'] = 'text'; + $aVarinfos['type'] = $aVarinfos['type'] ?? 'text'; } else { $aEffectiveConfig = $this->getConfig($sPhase); // echo $sKey.' ... '; print_r($aEffectiveConfig[$sVarname]); echo '<br>'; @@ -524,7 +533,7 @@ class rollout_base implements iRolloutplugin public function getDeployCommands(string $sPhase, bool $bMask = false): array { return [ - 'echo "ERROR: The method getDeployCommamds($sPhase) was not implemented in the rollout plugin [' . $this->getId() . ']"', + 'echo "ERROR: The method getDeployCommamds($sPhase) was not implemented in the rollout plugin [' . $this->_sPluginName . ']"', 'exit 1' ]; }