PHPackages                             vitexsoftware/multiflexi-core - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. vitexsoftware/multiflexi-core

ActiveLibrary

vitexsoftware/multiflexi-core
=============================

v2.9.3(2mo ago)11.2k↑120%1[3 PRs](https://github.com/VitexSoftware/php-vitexsoftware-multiflexi-core/pulls)6MITPHPCI failing

Since Aug 10Pushed 2w ago1 watchersCompare

[ Source](https://github.com/VitexSoftware/php-vitexsoftware-multiflexi-core)[ Packagist](https://packagist.org/packages/vitexsoftware/multiflexi-core)[ RSS](/packages/vitexsoftware-multiflexi-core/feed)WikiDiscussions main Synced 2w ago

READMEChangelogDependencies (13)Versions (11)Used By (6)

php-vitexsoftware-multiflexi-core
=================================

[](#php-vitexsoftware-multiflexi-core)

[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](LICENSE)[![Packaging: deb](https://camo.githubusercontent.com/f13146ae97ec879055641c65cc6a70e46536dc8eda0f51f2bda5ca20ba1e73a6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7061636b6167696e672d2e6465622d7265643f6c6f676f3d64656269616e266c6f676f436f6c6f723d7768697465)](https://camo.githubusercontent.com/f13146ae97ec879055641c65cc6a70e46536dc8eda0f51f2bda5ca20ba1e73a6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7061636b6167696e672d2e6465622d7265643f6c6f676f3d64656269616e266c6f676f436f6c6f723d7768697465)

MultiFlexi's Core classes

[![MultiFlexi-Chan](multiflexi-chan.png?raw=true)](multiflexi-chan.png?raw=true)

Core Classes Overview
---------------------

[](#core-classes-overview)

The MultiFlexi core provides a rich set of PHP classes for managing flexible, multi-tenant application environments. Below is a summary of the main classes organized by their functional areas:

### Core Base Classes

[](#core-base-classes)

- **Engine**: Base class for database-backed entities, providing common ORM and data management functionality
- **DBEngine**: Extended Engine with advanced database operations, DataTables integration, and web UI support
- **CommonAction**: Base class for all Action classes that perform automated tasks and integrations
- **CommonExecutor**: Base class for job execution environments

### Entity Management

[](#entity-management)

- **Company, CompanyApp, CompanyEnv, CompanyJob**: Manage company profiles, their assigned applications, environments, and job scheduling
- **Application**: Represents an application within the MultiFlexi platform, including configuration and metadata
- **User**: Manages user accounts, authentication, and permissions
- **Customer**: Handles customer relationship management

### Job Execution &amp; Scheduling

[](#job-execution--scheduling)

- **Job**: Core job entity with execution tracking and status management
- **Runner**: Executes jobs using various execution environments
- **RunTemplate**: Templates for job execution with parameter substitution
- **RunTplCreds**: Manages credential assignment for job templates
- **Scheduler**: Handles job scheduling and timing
- **ScheduleLister**: Lists and manages scheduled jobs

### Action System

[](#action-system)

Actions extend `CommonAction` and provide automated integrations and workflows:

- **ToDo**: Creates task items from job outputs with smart priority assignment
- **WebHook**: HTTP webhook notifications and integrations
- **Github**: GitHub repository interactions and automation
- **Zabbix**: Zabbix monitoring system integration
- **RedmineIssue**: Redmine issue tracking integration
- **TriggerJenkins**: Jenkins CI/CD pipeline triggering
- **LaunchJob**: Launches other MultiFlexi jobs
- **CustomCommand**: Executes custom shell commands
- **Sleep**: Introduces delays in job workflows
- **Stop**: Stops job execution
- **Reschedule**: Reschedules jobs with new timing

### Credential Management

[](#credential-management)

- **Credential**: Secure credential storage with encryption
- **CredentialType**: Base class for credential type definitions
- **CredentialConfigFields**: Dynamic configuration for credential types
- **CredentialProtoType**: Prototype pattern for credential implementations
- **Credata**: Manages credential data records

#### Debian Packaging Note

[](#debian-packaging-note)

On Debian-based systems, the autoloader explicitly includes classes only from directories where additional packages can add or remove classes (for example, Action, Env, Executor, and CredentialProtoType classes provided by add-on packages like `multiflexi-abraflexi`). This ensures those classes are present in `get_declared_classes()` even before they are referenced, while keeping the rest of the namespaces lazy-loaded.

#### Built-in Credential Types

[](#built-in-credential-types)

- **SQLServer**: Microsoft SQL Server database
- **FioBank**: Fio Bank API integration
- **EnvFile**: Environment file credential provider

Other credential types ship as separate add-on packages, each with its own `CredentialProtoType` class and test suite:

- **AbraFlexi** — [`multiflexi-abraflexi`](https://github.com/VitexSoftware/multiflexi-abraflexi)
- **RaiffeisenBank** — [`multiflexi-raiffeisenbank`](https://github.com/VitexSoftware/multiflexi-raiffeisenbank)
- **Csas** — [`multiflexi-csas`](https://github.com/VitexSoftware/multiflexi-csas)
- **VaultWarden**/Bitwarden — [`multiflexi-vaultwarden`](https://github.com/VitexSoftware/multiflexi-vaultwarden)
- **mServer** — `multiflexi-mserver`
- **Office365**/Microsoft 365 — [`multiflexi-microsoft365`](https://github.com/VitexSoftware/multiflexi-microsoft365)
- **DatabaseConnection** — [`multiflexi-database-connection`](https://github.com/VitexSoftware/multiflexi-database-connection)

### Execution Environments

[](#execution-environments)

- **Native**: Direct local execution
- **Docker**: Docker container execution
- **Podman**: Podman container execution
- **Kubernetes**: Kubernetes cluster execution
- **Azure**: Azure cloud execution

### Configuration System

[](#configuration-system)

- **ConfigField**: Individual configuration field definitions
- **ConfigFields**: Collections of configuration fields
- **ConfigFieldWithHelper**: Configuration fields with helper text and validation
- **Configuration**: Application configuration management
- **ModConfig**: Module-specific configuration
- **Environmentor**: Environment variable management

### Logging &amp; Monitoring

[](#logging--monitoring)

- **Logger**: Centralized logging with multiple backends
- **LogToSQL**: Database logging backend
- **LogToZabbix**: Zabbix monitoring integration
- **Zabbix**: Complete Zabbix monitoring namespace with metrics and alerting

### Event Processing

[](#event-processing)

- **EventSource**: Represents an external webhook adapter database connection to poll for changes
- **EventRule**: Maps incoming change events (evidence + operation) to MultiFlexi RunTemplates with env variable mapping

### Utility Classes

[](#utility-classes)

- **Token**: Authentication token management
- **Topic, Topics, TopicManager**: Topic-based messaging and categorization
- **FileStore**: File storage and retrieval operations
- **Requirement**: Dependency and requirement management
- **platformCompany, platformServer**: Platform-specific integrations

All classes follow PSR-12 coding standards, include comprehensive docblocks, and are well-tested with PHPUnit. Internationalization is supported via the i18n library, and all user-facing strings are translatable.

For more details, see the source code in the `src/MultiFlexi/` directory and the corresponding unit tests in `tests/src/MultiFlexi/`.

### MultiFlexi

[](#multiflexi)

multiflexi-core is heart of [MultiFlexi](https://multiflexi.eu) suite. See the full list of ready-to-run applications within the MultiFlexi platform on the [application list page](https://www.multiflexi.eu/apps.php).

[![MultiFlexi](https://github.com/VitexSoftware/MultiFlexi/raw/main/doc/multiflexi-app.svg)](https://www.multiflexi.eu/)

Architecture &amp; Usage
------------------------

[](#architecture--usage)

### Framework Architecture

[](#framework-architecture)

MultiFlexi follows a modular architecture with clear separation of concerns:

- **Engine-based ORM**: All database entities extend `Engine` or `DBEngine` for consistent data access patterns
- **Action-based Integrations**: Actions extend `CommonAction` to provide reusable automation components
- **Credential Management**: Secure, typed credential system with provider-specific implementations
- **Multi-tenant Design**: Complete isolation between companies with shared infrastructure
- **Extensible Execution**: Support for multiple execution environments (Docker, Kubernetes, Azure, etc.)

### Creating Custom Actions

[](#creating-custom-actions)

To create a custom action, extend the `CommonAction` base class:

```
