Download the PHP package ci2lara/codeigniter_migration without Composer
On this page you can find all versions of the php package ci2lara/codeigniter_migration. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package codeigniter_migration
CodeigniterMigration To Laravel
CodeigniterMigration is a package to integrate an already started Codeigniter-Session in Laravel 5.
Requirements
- Laravel >= 5
- PHP >=5.3
- Codeigniter 2.x (not tested with 3.x)
The package includes ServiceProvider and Facade for easy Laravel integration. This is particularly useful if you want to slowly migrate legacy code to laravel and Codeigniter is still responsible for the Login & Authentication. You can read out the Userdata-Values of the current Codeigniter-session (via cookie-handling).
Installation
Require this package with composer:
After updating composer (composer update), add the ServiceProvider to the providers array in config/app.php
Service Provider
In your app config, add the CodeigniterServiceProvider
to the providers array.
Facade
You have to use the facade, add it to the aliases array in your app config
Configuration (e.g. CI-Cookie-Name)
Copy the package config to your local config with the publish command:
To change the configuration, uncomment the values (e.g. sess_table_name or sess_cookie_name) in the new config/ci_session.php
Set up the Middleware to read the session
You should only use unencrypted cookies in codeigniter - so Laravel can directly access to the cookie. Because of security-reasons you have to allow Laravel to use this unencrypted Cookie.
Change the following Line in your app/Http/Kernel.php in the "$middleware"-Array
to
The Package-Middleware only disable the Cookie-Encryption for the configured Cookie-Name only (Default: ci_session, see config/ci_session.php)
Access to the Codeigniter Session in Laravel 5
Shortly: CodeigniterSession::getUserData()
e.g.
Access to some Project-Config-Variables or CI-Config-Variables
You can expand your CI-Code
e.g. in your CodeIgniter-Login-Handling
In Laravel you can simply access with the following code:
Try it out
Contributing
Contributions to the CodeigniterMigration are welcome. Please note the following guidelines before submiting your pull request.
- Follow PSR-2 coding standards.
License
CodeigniterMigration is licensed under the MIT License.
Copyright 2015 [Andreas Schwinger]