anwargazi / ci-laravel-support
Native Laravel 8 runtime bridge for incrementally migrating CodeIgniter 3 applications.
Package info
github.com/anwar-gazi/CodeIgniter_Laravel_Bridge
pkg:composer/anwargazi/ci-laravel-support
Requires
- php: ~7.3.0
- cweagans/composer-patches: 1.7.3
- laravel/framework: 8.83.29
- league/commonmark: 1.4.3
Requires (Dev)
- phpunit/phpunit: ^9.5.8
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
anwargazi/ci-laravel-support lets a legacy CodeIgniter 3 application and a
real Laravel 8 application share one public front controller. It is designed
for route-by-route migrations where running a second PHP service or moving the
whole application at once is not practical.
Laravel-owned requests run Laravel's native HTTP kernel. Requests that are not owned by Laravel return to the original CodeIgniter bootstrap unchanged. Only one framework is booted for any request.
This is a bounded migration runtime. PHP 7.3, Laravel 8, and SwiftMailer are end-of-life. Read the security policy before production use.
Start here
| If you need to... | Read... |
|---|---|
| Understand the design and request flow | Architecture |
| Install the bridge in a CI3/Laravel host | Installation |
| Look up every configuration option | Configuration reference |
| Move an endpoint from CI3 to Laravel | Route migration guide |
| Develop or test this package | Development guide |
| Release, deploy, verify, or roll back | Deployment and operations |
| Diagnose a failure | Troubleshooting |
| Maintain the older CI-side helper layer | Legacy compatibility API |
| Review security exceptions | Security policy |
| Review release history | Changelog |
The documentation index provides role-based reading paths.
Runtime contract
- PHP: exactly
7.3.x; dependency resolution and tests target7.3.33. - Laravel Framework: exactly
8.83.29. league/commonmark: exactly1.4.3, with the supplied resource-limit patch.- One public front controller, virtual host, and PHP-FPM service.
- One framework booted per request.
- Separate Composer dependency trees for CI3 and Laravel are strongly recommended.
The service provider checks this contract whenever Laravel boots. A version change or missing patch marker fails closed.
How routing works
HTTP request
|
legacy index.php
|
dependency-free dispatcher
|
+-- checksummed manifest owns route --> Laravel HTTP kernel --> response
|
+-- route is not owned --------------> existing CI3 bootstrap
The dispatcher does not load Composer or either framework until it has matched
the request against a cached manifest. The manifest comes from Laravel's real
route collection, preserving path constraints, domains, schemes, methods, and
Laravel's 405 Method Not Allowed ownership behavior.
Minimal installation outline
- Place a standard Laravel 8 application beside the legacy CI3 application.
- Merge the host Composer fragment
into Laravel's
composer.jsonand copy both files frompatches/. - Resolve dependencies and verify the pinned runtime.
- Publish the bridge config and front-controller example.
- Add the dispatcher block at the very top of CI's
index.php. - Add native Laravel routes and compile the ownership manifest.
composer update --with-all-dependencies --no-interaction php artisan ci-bridge:verify-runtime php artisan vendor:publish --tag=ci-laravel-bridge-config php artisan vendor:publish --tag=ci-laravel-bridge-dispatcher php artisan route:clear php artisan ci-bridge:cache-routes
Follow the full installation guide before deployment.
Commands
| Command | Purpose |
|---|---|
php artisan ci-bridge:verify-runtime |
Verifies exact dependency versions and security patch markers. |
php artisan ci-bridge:cache-routes |
Atomically regenerates route ownership. |
php artisan ci-bridge:cache-routes --path=/absolute/file.php |
Uses a controlled alternate manifest path. |
composer test |
Runs PHPUnit and the dependency-free legacy regression suite. |
Important boundaries
- Laravel and CI3 do not automatically share containers, sessions, authentication, CSRF tokens, configuration, exception handling, or logs.
- Keep Laravel fallback routes disabled while CI3 owns any route.
- Regenerate the manifest after every route or route-provider change. A missing
or invalid manifest returns
503; the bridge never guesses. - The bridge does not provide cross-framework authentication. Build and test an application-specific handoff when Laravel must recognize a CI login.
- The legacy compatibility API is retained for old CI-side integrations; it is not part of the native Laravel request path.
Recommended layout
legacy-project/
|-- index.php # existing CI front controller + bridge prelude
|-- application/ # existing CI3 application
|-- system/ # existing CI3 framework
|-- vendor/ # legacy dependencies, if any
+-- laravel/ # standard Laravel 8 application
|-- artisan
|-- bootstrap/app.php
|-- bootstrap/cache/ci-laravel-owned-routes.php
|-- composer.json
|-- routes/routes_laravel.php
+-- vendor/
The web root remains the legacy application's entrypoint. The Laravel directory
is not a second site and does not require artisan serve.
Quick verification
composer install --no-interaction
composer test
composer check-platform-reqs
composer audit --locked
In a host application, test a Laravel route, a representative CI route, and an unsupported method on the Laravel URI. See the complete deployment checklist.
License
This project is source-available, not open-source software. The custom Personal and Non-Profit License permits personal use and modification, and non-profit redistribution under the same unmodified license. Every redistribution must provide prominent, publicly visible credit to the original developer. Professional or for-profit use requires prior written permission from Minhajul Anwar at minhaj.me.bd@gmail.com.
Developer contact
- Name: Minhajul Anwar
- Email: minhaj.me.bd@gmail.com
- Location: Bangladesh