Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Extend docs to let composer handle the bypass. #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,16 @@ In the `app/config/app.php` file, register the `LaravelOpensslEncryptionServiceP
One more thing ...

Currently, Laravel 4 checks if the PHP **mcrypt** extension is loaded and die if it is not !
So, to complete the installation, we have to bypass this check.
But unfortunately, this check is done in the `Illuminate\Foundation\start.php` script, at the heart of the framework bootstrap process.

To bypass the check, change the `start.php` script in the `vendor\laravel\framework\src\Illuminate\Foundation` folder as follow.

if ( false and ! extension_loaded('mcrypt'))
{
die('Laravel requires the Mcrypt PHP extension.'.PHP_EOL);

exit(1);
}
So, to complete the installation, we have to bypass this check. Add the following code to your `composer.json` file to let the `post-install-cmd` handle this:
```json
"scripts": {
"post-install-cmd": [
"sed -i.bak 's/MCRYPT_RIJNDAEL_128/null/' vendor/laravel/framework/src/Illuminate/Encryption/Encrypter.php",
"sed -i.bak 's/MCRYPT_MODE_CBC/null/' vendor/laravel/framework/src/Illuminate/Encryption/Encrypter.php",
"sed -i.bak 's/echo/\\/\\/echo/' vendor/laravel/framework/src/Illuminate/Foundation/start.php",
"sed -i.bak 's/exit/\\/\\/exit/' vendor/laravel/framework/src/Illuminate/Foundation/start.php",
"php artisan optimize"
],
...
},
```