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

v0.1.5 2025-11-20 16:36 UTC

This package is not auto-updated.

Last update: 2025-11-20 16:36:53 UTC


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_SessionAgendum_Session
  • Vtiger_WebUIAgendum_WebUI
  • Vtiger_ResponseAgendum_Response
  • Vtiger_LoaderAgendum_Loader
  • Vtiger_RequestAgendum_Request
  • Vtiger_Base_ModelAgendum_Base_Model
  • Vtiger_ViewerAgendum_Viewer
  • Vtiger_Language_HandlerAgendum_Language_Handler
  • Vtiger_ThemeAgendum_Theme
  • Vtiger_CacheAgendum_Cache
  • Vtiger_EntryPointAgendum_EntryPoint
  • Vtiger_Cache_ConnectorAgendum_Cache_Connector
  • Vtiger_Cache_Connector_MemoryAgendum_Cache_Connector_Memory
  • Vtiger_JavaScriptAgendum_JavaScript
  • Vtiger_ControllerAgendum_Controller
  • Vtiger_Action_ControllerAgendum_Action_Controller
  • Vtiger_View_ControllerAgendum_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:

  1. The environment variable VTIGER_ADAPTER_TESTING is set to 'true'
  2. The library is running in its own development environment (not as a third-party dependency)
  3. 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.