Skip to content

MelisCore

The platform core: backoffice shell, config tree, auth, rights, users, logs, events and the service layer every other module builds on. Package melisplatform/melis-core.

Purpose

MelisCore is the foundation module of Melis Platform. It provides the backoffice application shell, the MelisCoreConfig configuration tree that aggregates every module's app.*.php files, authentication and per-tool rights, user management, the logging subsystem, the dashboard (widgets), platform/environment handling, GDPR auto-delete, a micro-service auth endpoint, and the shared service/view-helper layer that the rest of the modules consume. Almost every other melisplatform/* module depends on it.

Enable it

MelisCore is a standard Laminas module. It is loaded by the skeleton's config/melis.module.load.php:

php
return [
    'MelisCore',
    // … other modules …
];

It must load early — most modules call its services. Its own composer requirements pull in melis-asset-manager, melis-composerdeploy and melis-dbdeploy, and it auto-loads the Laminas components it needs (Laminas\I18n, Laminas\Router, Laminas\Form, Laminas\Db, Laminas\Cache, …) via its config/module.load.php.

Key services

Registered as service_manager aliases in vendor/melisplatform/melis-core/config/module.config.php:

Service aliasRole
MelisCoreConfigThe config tree. Reads any aggregated app.* config by path with getItem('meliscore/datas/…'); getMelisKeys() / getMelisKeyData() resolve melisKeys; getItemPerPlatform(), getFormMergedAndOrdered().
MelisCoreAuthBackoffice authentication. getAuthRights() returns the logged-in user's rights XML.
MelisCoreRightsPer-tool access control. isAccessible($xmlRights, $sectionId, $itemId), getRightsValues($userId), createXmlRightsValues($userId, $datas).
MelisCoreUserUser helpers: getUserXmlRights(), isItemRightChecked(), getUserConnectionData(), getUserLastLoggedInDate().
MelisCoreDispatchFront/back plugin dispatch glue: dispatchPluginAction($e, $nameContainer, $nameVarSession, $controller, $vars).
MelisCoreToolThe backoffice tool helper used by tool controllers (columns, forms, modals, DataTable config, CSV export). See Create a tool.
MelisCoreLogServiceActivity log: logAction(), saveLog(), getLogList(), getLogType(), log-type translations.
MelisCoreDashboardServiceBuilds the backoffice dashboard from its registered plugins.
MelisCoreTranslationLoads/merges module translations.
MelisCoreFlashMessengerCross-request flash messages.
MelisCoreImageImage manipulation helper.
MelisCoreLostPassword / MelisCoreCreatePassword / MelisPasswordSettingsServiceLost-password flow, account creation links and password policy/history.
MelisCoreEmailSendingService / MelisCoreBOEmailServiceBackoffice email templates and sending.
ModulesService (MelisCoreModulesService)Lists/activates/deactivates platform modules.
MelisCorePlatformSchemeServicePlatform (environment) scheme handling.
MelisCoreGdprService / MelisCoreGdprAutoDeleteServiceGDPR data handling and scheduled auto-delete.
MelisCorePluginsService / MelisCoreDashboardPluginsServicePlugin and dashboard-plugin registration & rights.
MelisCoreCacheSystemServiceCache read/write helpers.
MelisCoreAnnouncementServiceBackoffice announcements: getLists(), saveAnnouncement(), deleteAnnouncement().
MelisGeneralService / MelisCoreFormServiceGeneral utilities and form building/merging.

An abstract factory (MelisCore\Factory\MelisAbstractFactory) and per-table aliases (MelisCoreTableUser, MelisCoreTableLog, …) are also registered.

Backoffice

MelisCore injects the top System section of the backoffice tool tree (config/app.toolstree.php, section melisKey meliscore_toolstree_section), including:

Tool (melisKey)ControllerPurpose
meliscore_tool_system_configMelisCore\Controller\MelisCoreOtherConfigSystem configuration.
meliscore_tool_user_module_managementMelisCore\Controller\ModulesActivate/deactivate & reorder modules.
meliscore_tool_platformMelisCore\Controller\PlatformsDeclare platforms/environments (local, pre-prod, prod).
meliscore_tool_emails_mngtMelisCore\Controller\EmailsManagementBackoffice email template management.
meliscore_tool_phpunitMelisCore\Controller\MelisPhpUnitToolRun module test suites.

User management is delivered through MelisCore\Controller\User / ToolUser (the Users tool), and GDPR auto-delete through MelisCore\Controller\MelisCoreGdprAutoDelete*. The dashboard is served by MelisCore\Controller\Dashboard / DashboardPlugins.

Dashboard plugins

MelisCore ships the dashboard (backoffice widget) framework and several built-in widgets, each with a config file under config/dashboard-plugins/:

MelisCoreDashboardAnnouncementPlugin, MelisCoreDashboardBubbleNewsMelisPlugin, MelisCoreDashboardBubbleUpdatesPlugin, MelisCoreDashboardBubbleNotificationsPlugin, MelisCoreDashboardBubbleChatPlugin, MelisCoreDashboardRecentUserActivityPlugin.

MelisCoreDashboardTemplatingPlugin is the base class every backoffice widget extends — see Plugins: templating & dashboard.

Front office

MelisCore is a backoffice/platform module, but it registers shared view helpers (in config/module.config.php under view_helpers) used across both offices:

View helperRole
MelisGenericTableRenders a generic data table.
MelisDataTableDataTables integration helper.
MelisModal / MelisModalInvokerBackoffice modal rendering/invocation.
MelisTextHelperText formatting/escaping helper.
MelisCoreHeadPluginHead-scripts/styles aggregation for the shell.
MelisDashboardDragDropZone / MelisCoreDashboardBubblePluginDashboard zone rendering.
getMelisSectionIconsResolves tool-tree section icons.
MelisFieldCollection / MelisFieldRowForm rendering helpers.

It also exposes a micro-service auth endpoint (routes microservice / microservice_list, controller MelisCore\Controller\MelisCoreMicroService) backed by melis_core_microservice_auth.

Database tables

Created by install/sql/setup_structure.sql and the deltas in install/dbdeploy/:

TableHolds
melis_core_userBackoffice users.
melis_core_user_roleUser roles / rights XML.
melis_core_user_connection_dateLogin history.
melis_core_user_password_historyPassword reuse history (policy).
melis_core_lost_password / melis_core_create_passwordPassword reset & account-creation tokens.
melis_core_langBackoffice languages.
melis_core_log / melis_core_log_type / melis_core_log_type_transActivity log + types & translations.
melis_core_platform / melis_core_platform_schemePlatforms (environments) and their schemes.
melis_core_dashboardsPer-user dashboard layout.
melis_pluginsRegistered plugins.
melis_core_announcementBackoffice announcements.
melis_core_bo_emails / melis_core_bo_emails_detailsBackoffice email templates.
melis_core_microservice_auth / melis_core_microservice_logsMicro-service auth & call logs.
melis_core_gdpr_delete_config / …_emails / …_emails_sent / …_emails_logs / …_emails_smtpGDPR auto-delete configuration & mail tracking.

Example

Read a config value, check a right and write a log entry from a controller:

php
$config  = $this->getServiceManager()->get('MelisCoreConfig');
$rights  = $this->getServiceManager()->get('MelisCoreRights');
$auth    = $this->getServiceManager()->get('MelisCoreAuth');
$logs    = $this->getServiceManager()->get('MelisCoreLogService');

$xmlRights = $auth->getAuthRights();
if ($rights->isAccessible($xmlRights, 'meliscore_toolstree_section', 'meliscore_tool_platform')) {
    $logs->logAction(/* … */);
}

Key files

ConcernPath
Module bootstrapvendor/melisplatform/melis-core/src/Module.php
Main config (services, controllers, view helpers, routes)vendor/melisplatform/melis-core/config/module.config.php
Backoffice tool treevendor/melisplatform/melis-core/config/app.toolstree.php
Interface / forms / emails configvendor/melisplatform/melis-core/config/app.interface.php, app.forms.php, app.emails.php
Dashboard plugin configsvendor/melisplatform/melis-core/config/dashboard-plugins/
Laminas components to loadvendor/melisplatform/melis-core/config/module.load.php
Servicesvendor/melisplatform/melis-core/src/Service/
Controllersvendor/melisplatform/melis-core/src/Controller/
Dashboard pluginsvendor/melisplatform/melis-core/src/Controller/DashboardPlugins/
Table gatewaysvendor/melisplatform/melis-core/src/Model/Tables/
View helpersvendor/melisplatform/melis-core/src/View/Helper/
Install SQL & deltasvendor/melisplatform/melis-core/install/sql/, install/dbdeploy/
Translationsvendor/melisplatform/melis-core/language/

See also the Module reference, Create a tool and Plugins.