agendum / agendum-vtiger-adapter
An adapter to integrate Agendum with Vtiger CRM modules
Installs: 19
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/agendum/agendum-vtiger-adapter
Requires
- php: ^8.0
Requires (Dev)
- pestphp/pest: ^2.0
- phpstan/phpstan: ^1.0
README
A PHP library that provides backward compatibility for Vtiger modules running on Agendum CRM platform.
Overview
This adapter library enables legacy Vtiger modules to work seamlessly with Agendum CRM by providing class mapping between the old Vtiger naming convention (Vtiger_*) and the new Agendum naming convention (Agendum_*).
Why Install This Library?
When migrating from Vtiger CRM to Agendum CRM, existing modules may fail to load because they reference classes using the old Vtiger_* naming convention. Agendum CRM has modernized these class names to use the Agendum_* prefix.
This library solves this compatibility issue by:
- Creating empty wrapper classes that extend their Agendum equivalents
- Maintaining the original
Vtiger_*class names for backward compatibility - Allowing legacy modules to run without modification on Agendum instances
Supported Classes
The library provides compatibility mappings for the following core classes:
Vtiger_Session→Agendum_SessionVtiger_WebUI→Agendum_WebUIVtiger_Response→Agendum_ResponseVtiger_Loader→Agendum_LoaderVtiger_Request→Agendum_RequestVtiger_Base_Model→Agendum_Base_ModelVtiger_Viewer→Agendum_ViewerVtiger_Language_Handler→Agendum_Language_HandlerVtiger_Theme→Agendum_ThemeVtiger_Cache→Agendum_CacheVtiger_EntryPoint→Agendum_EntryPointVtiger_Cache_Connector→Agendum_Cache_ConnectorVtiger_Cache_Connector_Memory→Agendum_Cache_Connector_MemoryVtiger_JavaScript→Agendum_JavaScriptVtiger_Controller→Agendum_ControllerVtiger_Action_Controller→Agendum_Action_ControllerVtiger_View_Controller→Agendum_View_Controller
Installation
Install via Composer:
composer require agendum/vtiger-adapter
Production Setup
For production use, add the following to your composer.json autoload section:
{
"autoload": {
"files": [
"vendor/agendum/vtiger-adapter/src/autoload.php"
]
}
}
Then regenerate the autoloader:
composer dump-autoload
Usage
Once installed, the adapter classes are automatically available. Legacy Vtiger modules will be able to find and use the Vtiger_* classes, which seamlessly extend their modern Agendum_* counterparts.
No code changes are required in your existing modules - they will continue to work as expected.
Testing Environment
For testing purposes, this library includes conditional mock classes that are only activated when:
- The environment variable
VTIGER_ADAPTER_TESTINGis set to'true' - The library is running in its own development environment (not as a third-party dependency)
- The required Agendum classes don't already exist
Important Security Note
⚠️ The mock classes are ONLY activated in this specific project's testing environment. They will never interfere with third-party projects that install this library as a dependency. The mocks are conditionally loaded based on:
- Detection of the specific project directory name
- Explicit testing environment variable (
VTIGER_ADAPTER_TESTING=true) - Verification that parent classes don't exist
This ensures that when deployed in production Agendum environments or installed as a dependency, only the real adapter functionality is active.
Development
To run tests locally:
# Install dependencies composer install # Run tests with environment variable VTIGER_ADAPTER_TESTING=true ./vendor/bin/pest # Or export it for your session export VTIGER_ADAPTER_TESTING=true ./vendor/bin/pest
License
To be defined. Final license terms will clarify compatibility with the Vtiger CRM Public License 1.1 for derivative portions of the work.