定制 agendum/agendum-vtiger-adapter 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

agendum/agendum-vtiger-adapter

最新稳定版本:v0.1.5

Composer 安装命令:

composer require agendum/agendum-vtiger-adapter

包简介

An adapter to integrate Agendum with Vtiger CRM modules

README 文档

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.

统计信息

  • 总下载量: 19
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-10-28