#!/usr/bin/env php init(); $logger = getLogger($settings, 'console-'); require_once('inc/inc.Extension.php'); $application = new Application(); $application->add(new StatsCommand($settings, $logger, $translator)); $application->add(new AddfolderCommand($settings, $logger, $translator)); $application->add(new AdddocumentCommand($settings, $logger, $translator, $extmgr)); $application->add(new DeleteCommand($settings, $logger, $translator)); $application->add(new ClearcacheCommand($settings, $logger, $translator)); $application->add(new ListcacheCommand($settings, $logger, $translator)); $application->add(new ListextensionCommand($settings, $logger, $translator, $extmgr)); $application->add(new ConfigureextensionCommand($settings, $logger, $translator, $extmgr)); $application->add(new UploadextensionCommand($settings, $logger, $translator, $extmgr)); $application->add(new PackageextensionCommand($settings, $logger, $translator, $extmgr)); $application->add(new ReloadextensionCommand($settings, $logger, $translator, $extmgr)); $application->add(new CheckextensionCommand($settings, $logger, $translator, $extmgr)); $application->add(new RepositoryextensionCommand($settings, $logger, $translator, $extmgr)); $application->add(new UpdateextensionCommand($settings, $logger, $translator, $extmgr)); $application->add(new DownloadextensionCommand($settings, $logger, $translator, $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 --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