ixaya/manager 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

ixaya/manager

Composer 安装命令:

composer require ixaya/manager

包简介

An HMVC Framework, Superset of CodeIgniter

README 文档

README

HMVC Code Igniter based Framework for creating backends and complete websites

About this package

Ixaya Manager is a set of files, libraries, and modules that allows you to use Code Igniter to build a Backend with Login or a Complete Website if you prefer.

Features

  • CodeIgniter upgradeable through Composer (always use latest version)
  • Run the project (a webserver) using a shell script (no need to install Apache or Nginx during development (http://localhost:8000)
  • HMVC
  • Diferent folders for diferent modules: modules/admin, modules/frontned, etc.
  • Support for MySQL, PostgreSQL, MSSQL, Sqlite, or any database that is supported in CodeIgniter 3.
  • Different Database connection/technology per Model. (you can have a model that loads a Database from Postgres and another Model that loads a Database from MySQL.
  • Responsive Theme (SB Admin 2 Template for the Backend)
  • Login protected Admin module
  • Examples to create a REST API
  • Examples to send Native Apple Push Notifications or use Firebase for Android
  • Production Tested
  • try { } catch { } login for errors (an improvement over CodeIgniter's)
  • Secured Application Folder from Public.

How to Install

Requirements

  • PHP 8.1+
  • Composer

1. Install via Composer

composer require ixaya/manager

2. Scaffold your project

Copy the sample application structure from the package into your project root:

cp -r vendor/ixaya/manager/sample/. .

This gives you a complete working structure — controllers, models, views, config, and entry points — ready to customize.

3. Configure environment

cp .env.sample.dev .env
cp .env.sample.priv .env.priv

Open both files and fill in the required fields:

  • .env — general settings: app name, base URL, environment, database credentials, cache, mail.
  • .env.priv — sensitive secrets: API keys, tokens, private credentials. Never commit this file.

Suggested packages

Depending on the features you need, install one or more of the following:

Optional — core extensions:

composer require aws/aws-sdk-php        # AWS S3, Textract, Bedrock integration
composer require phpoffice/phpspreadsheet  # Excel export/import

Optional — WebSocket server:

composer require amphp/websocket-server  # Built-in WebSocket server
composer require amphp/redis             # Redis-backed WebSocket scaling
composer require amphp/log               # Structured logging for async services
composer require adhocore/jwt            # WebSocket authentication

PHP Validations

PHP Static Code Analysis

Run using PHPStan:

First time, install PHPStan:

composer require --dev phpstan/phpstan

Standard analysis:

./vendor/bin/phpstan analyse

With increased memory limit:

./vendor/bin/phpstan analyse --memory-limit=512M

Tip: Use the memory limit option if you encounter out-of-memory errors during analysis.

PHP Unit Testing

Run using PHPUnit

First time, install PHPUnit:

composer require --dev phpunit/phpunit

Run all tests:

./vendor/bin/phpunit

Run specific test file:

./vendor/bin/phpunit tests/Unit/ExampleTest.php

Run tests with verbose output:

./vendor/bin/phpunit --verbose

Run tests in specific group/category:

./vendor/bin/phpunit --group unit

Tip: Use --testdox flag for readable test output, or --stop-on-failure to halt execution on the first failed test.

PHP Code Formatting

Fix using PHP CS Fixer

*First time, install PHP CS Fixer:**

composer require --dev php-cs-fixer/shim

Fix code formatting:

./vendor/bin/php-cs-fixer fix

Dry run (preview changes without applying):

./vendor/bin/php-cs-fixer fix --dry-run

Dry run with diff (preview exact changes):

./vendor/bin/php-cs-fixer fix --dry-run --diff

Power user — pinned PHP version (macOS Homebrew):

/opt/homebrew/opt/php@8.3/bin/php /opt/homebrew/bin/php-cs-fixer fix

Docker Setup

This project can be run using Docker with different configurations for development and production environments.

Configuration Files

The project uses multiple Docker Compose files:

  • docker-compose.yml - Base configuration (shared settings)
  • docker-compose.dev.yml - Development overrides (code mounting, live changes)
  • docker-compose.prod.yml - Production overrides (no volumes, optimized)

Building and Running

Basic Setup (Base Configuration Only)

# Build
docker-compose build

# Start
docker-compose up -d

# Rebuild and start (if Dockerfile changed)
docker-compose up -d --build

# Stop
docker-compose down

Development Mode

Uses live code mounting - changes are reflected immediately without rebuilding.

# Start
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d app

Production Mode

Uses code copied into the image - requires rebuild for code changes.

# Start
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d app

Useful Commands

# View all logs
docker-compose logs -f

# View logs for specific service
docker-compose logs -f app

# Enter the app container
docker-compose exec app bash

MsgPack Support

This package can use MsgPack for faster cache and payload serialization. While the native PHP MsgPack extension (installed via pecl or system packages) offers the best performance, not all servers have it available.

Install the PHP MsgPack Fallback Library

Add the pure PHP implementation to your project, along the composer patcher:

composer require rybakit/msgpack
composer require cweagans/composer-patches

Apply the PHP 8.1+ Compatibility Patch

Add the following configuration to your root composer.json:

{
  ...
    "extra": {
        "patches": {
            "rybakit/msgpack": {
                "Fix PHP 8.1 chr() deprecation": "vendor/ixaya/manager/patches/msgpack-php81-fix.patch"
            }
        }
    }
  ...
}

Apply the Changes

Run the following command to install dependencies and apply patches:

composer install

Application Structure

Project Setup

We recommend creating a root folder named app and checking out the project inside it. The framework follows an HMVC (Hierarchical Model-View-Controller) architecture based on CodeIgniter.

Root Directory

app/
├── composer.json
├── application/
├── public/
├── private/
├── bin/
└── patches/

Public Directory

The public/ folder contains all publicly accessible files served by the web server.

public/
├── index.php                    # Application entry point
├── media/                       # User-uploaded files
└── assets/                      # Static assets organized by module
    └── {module}/
        ├── js/                  # JavaScript files
        ├── css/                 # Stylesheets
        ├── images/              # Images
        └── videos/              # Video files

Application Directory

The application/ folder contains the core application code and global resources.

application/
├── cache/                       # Application cache
├── config/                      # Application configuration files
├── controllers/                 # Global controllers
├── database/                    # Database configuration
├── helpers/                     # Global helper functions
├── hooks/                       # Global hooks
├── language/                    # Global language files
├── libraries/                   # Global libraries
├── migrations/                  # Database migrations
├── models/                      # Global models
├── modules/                     # HMVC modules (see below)
├── third_party/                 # Third-party libraries
└── views/                       # Global views

Modules (HMVC Structure)

The framework uses HMVC architecture, allowing you to organize code into self-contained modules. Each module can have its own MVC structure and resources.

application/modules/
└── {module}/
    ├── controllers/             # Module-specific controllers
    ├── models/                  # Module-specific models
    ├── migrations/              # Module-specific migrations
    ├── views/                   # Module-specific views
    ├── libraries/               # Module-specific libraries
    ├── helpers/                 # Module-specific helpers
    ├── language/                # Module-specific language files
    └── config/                  # Module-specific configuration

Benefits of HMVC:

  • Modularity: Each module is self-contained and reusable
  • Organization: Better code organization for large applications
  • Separation: Modules can be developed and tested independently
  • Scalability: Easy to add, remove, or replace modules

Example Module Structure:

application/modules/blog/
├── controllers/
│   ├── Blog.php
│   └── Admin.php
├── models/
│   └── Blog_model.php
├── views/
│   ├── index.php
│   └── detail.php
└── libraries/
    └── Blog_helper.php

Additional Directories

  • bin/ - Command-line scripts and utilities
  • private/ - Private files not accessible via web
  • patches/ - Compatibility patches for dependencies

ixaya/manager 适用场景与选型建议

ixaya/manager 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.91k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2018 年 04 月 08 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

  • 总下载量: 2.91k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 27
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 3
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-04-08