承接 aivopro/composer 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

aivopro/composer

Composer 安装命令:

composer require aivopro/composer

包简介

AiVoPro Composer plugin - Enhanced custom installer for plugins/themes with advanced asset management

README 文档

README

AiVoPro Composer Plugin - Enhanced custom installer for plugins/themes with advanced asset management.

License: MIT PHP Version

🚀 Installation

composer require oaranha/aivopro-composer

✨ Features

  • 🎯 Custom installer for aivopro-plugin and aivopro-theme package types
  • 📦 Automatic copying of public assets to the webroot
  • 🧹 Automatic cleanup of public assets on uninstall
  • 🌐 Support for glob patterns
  • 🎨 Flexible target path resolution
  • 💾 File mapping storage for safe removal

📋 Public Files Configuration

AiVoPro plugins can define public files/directories that should be copied to the webroot during installation. This is configured in the package's composer.json under extra.public.

Basic Syntax

{
  "extra": {
    "public": [
      "path/to/file.js",
      "path/to/directory",
      {
        "source": "source/path",
        "target": "target/path"
      }
    ]
  }
}

Target Path Resolution

The target path follows "Model A" where target is ALWAYS the final destination path:

Target Format Description Result
"file.js" Package dir + target public/e/{vendor}/{pkg}/file.js
"/file.js" Webroot + target public/file.js
"." Package dir + source basename public/e/{vendor}/{pkg}/{basename}
"/." or "/" Webroot + source basename public/{basename}
null (omitted) Package dir + source basename public/e/{vendor}/{pkg}/{basename}
"dir/*" Glob: contents copied to target Contents copied to target directory

📚 Usage Examples

1️⃣ Legacy String Format (preserves full path)

{
  "extra": {
    "public": [
      "widget/dist/index.html",
      "widget/dist/styles.css"
    ]
  }
}

Result:

  • widget/dist/index.htmlpublic/e/{vendor}/{pkg}/widget/dist/index.html
  • widget/dist/styles.csspublic/e/{vendor}/{pkg}/widget/dist/styles.css

2️⃣ Copy to Package Directory (no leading /)

{
  "extra": {
    "public": [
      {
        "source": "widget/dist/sdk.js",
        "target": "sdk.js"
      },
      {
        "source": "assets",
        "target": "static"
      }
    ]
  }
}

Result:

  • widget/dist/sdk.jspublic/e/{vendor}/{pkg}/sdk.js
  • assets/public/e/{vendor}/{pkg}/static/

3️⃣ Copy to Webroot (leading /)

{
  "extra": {
    "public": [
      {
        "source": "widget/dist/sdk.js",
        "target": "/sdk.js"
      },
      {
        "source": "assets",
        "target": "/static/assets"
      }
    ]
  }
}

Result:

  • widget/dist/sdk.jspublic/sdk.js
  • assets/public/static/assets/

4️⃣ Using Basename Shortcuts (. and /.)

{
  "extra": {
    "public": [
      {
        "source": "widget/dist",
        "target": "."
      },
      {
        "source": "widget/dist",
        "target": "/."
      },
      {
        "source": "widget/dist"
      }
    ]
  }
}

Result:

  • "."public/e/{vendor}/{pkg}/dist/ (package dir + basename)
  • "/."public/dist/ (webroot + basename)
  • No target → public/e/{vendor}/{pkg}/dist/ (same as ".")

5️⃣ Glob Patterns (copy contents)

{
  "extra": {
    "public": [
      {
        "source": "widget/dist/*",
        "target": "/assets"
      }
    ]
  }
}

Result:

  • Contents of widget/dist/ (e.g., index.html, css/, js/) → public/assets/
  • Files become public/assets/index.html, public/assets/css/..., etc.

⚙️ Environment Variables

Variable Description Default
PUBLIC_DIR Custom webroot path public

Example:

export PUBLIC_DIR="web"
composer install

📦 Package Types

This plugin handles the following package types:

  • aivopro-plugin - Installed to public/content/plugins/{vendor}/{package}
  • aivopro-theme - Installed to public/content/plugins/{vendor}/{package}

You can customize the installation path in your root composer.json:

{
  "extra": {
    "paths": {
      "extensions": "custom/path/to/extensions/"
    }
  }
}

🔧 Development

Quality Assurance

# Run all checks
composer analyse

# Individual tools
composer phpstan      # Static analysis
composer phpcs        # Code style check
composer phpmd        # Mess detection
composer unit-test    # Unit tests

# Fix code style issues
composer fix

Testing

# Run tests
composer unit-test

# Generate coverage report
composer code-coverage

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

👤 Author

A.Aranha

Made with ❤️ for the AiVoPro ecosystem

aivopro/composer 适用场景与选型建议

aivopro/composer 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 01 月 20 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「installer」 「plugin」 「composer」 「aivopro」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 aivopro/composer 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 aivopro/composer 我们能提供哪些服务?
定制开发 / 二次开发

基于 aivopro/composer 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-20