mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-11-27 18:10:42 +00:00
running hooks can be prevented by setting env var SEEDDMS_NO_EXTENSION_HOOKS
This commit is contained in:
parent
4e236cf896
commit
b647e6e000
|
|
@ -62,12 +62,26 @@ $application->add(new RepositoryextensionCommand($settings, $logger, $translator
|
|||
$application->add(new UpdateextensionCommand($settings, $logger, $translator, $extmgr));
|
||||
$application->add(new DownloadextensionCommand($settings, $logger, $translator, $extmgr));
|
||||
|
||||
if(isset($GLOBALS['SEEDDMS_HOOKS']['console'])) {
|
||||
foreach($GLOBALS['SEEDDMS_HOOKS']['console'] as $hookObj) {
|
||||
if (method_exists($hookObj, 'addCommand')) {
|
||||
$hookObj->addCommand($application, ['settings'=>$settings, 'logger'=>$logger, 'translator'=>$translator, 'extmgr'=>$extmgr]);
|
||||
/* If extension are not compatible with the current version of
|
||||
* SeedDMS anymore, calling the hooks may fail and exit this
|
||||
* script. Hence there no change to even disable an extension with
|
||||
* `utils/console ext:configure --name <extname> --disable`
|
||||
* In such a case the last resort is to set the environment variable
|
||||
* SEEDDMS_NO_EXTENSION_HOOKS to any value, which will prevent calling
|
||||
* any hooks.
|
||||
*/
|
||||
if (false === getenv('SEEDDMS_NO_EXTENSION_HOOKS')) {
|
||||
if (isset($GLOBALS['SEEDDMS_HOOKS']['console'])) {
|
||||
foreach ($GLOBALS['SEEDDMS_HOOKS']['console'] as $hookObj) {
|
||||
if (method_exists($hookObj, 'addCommand')) {
|
||||
$hookObj->addCommand($application, ['settings'=>$settings, 'logger'=>$logger, 'translator'=>$translator, 'extmgr'=>$extmgr]);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo "NOT RUNNING HOOKS\n\n";
|
||||
}
|
||||
|
||||
$application->run();
|
||||
|
||||
// vim: ts=4 sw=4 expandtab
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user