georgechitechi/upgrader
Composer 安装命令:
composer require georgechitechi/upgrader
包简介
A tool to upgrade CodeIgniter 3 projects to CodeIgniter 4
README 文档
README
This package helps you upgrade your CodeIgniter 3 projects to CodeIgniter 4. It handles the migration of your project structure, namespaces, and various CodeIgniter-specific components.
Installation
Install the package in your CodeIgniter 3 project:
composer require georgechitechi/upgrader
Usage
Simply run the upgrade command from your CI3 project directory:
vendor/bin/ci-upgrade
The upgrader will:
- Use your current directory as the source
- Create a backup of your entire project
- Download the latest CI4 and set it up
- Migrate all your code to CI4 format
- Place the upgraded project in a new directory
vendor/bin/ci-upgrade upgrade
If you want to upgrade a different CI3 project, you can specify the path:
vendor/bin/ci-upgrade upgrade --path=/path/to/other/ci3/project
What Gets Upgraded
The upgrader handles the following aspects of the migration:
-
Project Structure
- Downloads latest CI4 installation
- Creates proper directory structure
- Creates a backup of your original project
-
Controllers
- Adds namespaces
- Updates class extensions
- Updates method visibility
- Converts CI3 syntax to CI4
-
Models
- Adds namespaces
- Updates class extensions
- Updates method visibility
- Adds CI4 model properties
-
Views
- Migrates to the new location
- Updates echo syntax
- Updates form helper syntax
- Updates URL helper syntax
-
Configuration
- Converts config arrays to classes
- Updates config file structure
- Migrates database configuration
- Sets up environment file
-
Routes
- Updates routing syntax
- Migrates to the new routing system
-
Helpers and Libraries
- Adds namespaces
- Updates file locations
- Updates syntax to CI4 standards
-
Composer Configuration
- Creates/updates composer.json
- Sets up autoloading
- Preserves existing dependencies
After Upgrade
Your upgraded project will be in a new directory next to your current project.
The original project will remain untouched, and a backup will be created with the suffix _backup_YYYY-MM-DD_HH-ii-ss.
Important Notes
- Always commit your changes before running the upgrader
- Review the upgraded code manually to ensure everything works as expected
- Some manual adjustments might be needed after the upgrade
- Test your application thoroughly after the upgrade
Manual Steps After Upgrade
- Review and update any third-party libraries
- Update any custom helpers or libraries that might need adjustments
- Test all forms and file uploads
- Update any custom database queries
- Review and update any session handling
- Test all AJAX calls and responses
Known Limitations
- Custom libraries might need manual adjustment
- Complex routing configurations might need review
- Database queries might need updates for compatibility
- Session handling might need manual updates
- Custom hooks will need manual migration
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Author
George Chitechi
License
MIT License
georgechitechi/upgrader 适用场景与选型建议
georgechitechi/upgrader 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 22 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 03 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 georgechitechi/upgrader 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 georgechitechi/upgrader 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 22
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 12
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-03-05