tomgrohl / laravel4-php71-encrypter Goto Github PK
View Code? Open in Web Editor NEWLaravel 4.2 Encrypter for PHP 7.1+
License: MIT License
Laravel 4.2 Encrypter for PHP 7.1+
License: MIT License
Laravel will automatically alias its own encrypter here: https://github.com/laravel/framework/blob/4.2/src/Illuminate/Foundation/Application.php#L1116, which it needs e.g. here https://github.com/laravel/framework/blob/4.2/src/Illuminate/Foundation/Application.php#L658. Without overridding this, I run into strange issues like e.g. unit tests failing in my project. I don't know if there's a clean way of overridding this though.
I configured my main app (call it core) which is laravel 4.2 which handles login for all my other apps(also laravel 4.2) too to use the package.
I realized that the other apps which I had not yet configured to AES-256-CBC were still being able to decrypt the session.
I am using your package because I wanted to connect a laravel 5.4 app to use the session from the core but it is also not working.
My session is saved in the database.
Hello, I have the following error after complete all steps and test my App.
Could you help me, please?
Argument 2 passed to Illuminate\Cookie\Guard::__construct() must be an instance of Illuminate\Encryption\Encrypter, instance of Tomgrohl\Laravel\Encryption\Encrypter given
In composer.json:
"tomgrohl/laravel4-php71-encrypter": "^2.0@dev"
PHP Version: 5.6.30
Thanks!
I believe you have the argument order backwards: https://github.com/tomgrohl/laravel4-php71-encrypter/blob/1.1/src/Tomgrohl/Laravel/Encryption/EncryptionServiceProvider.php#L31. It should be
$this->app->alias('encrypter', Encrypter::class);
Commit fdc3b4a removes the extending of Laravel Encrypter.
I executed this on a real live situation and got (I really don't understand why, seems like somehow strict_types are enabled globally by the ISP, really strange):
[EDIT] This happens on PHP 7.1.6
If you use the composer statement
composer require tomgrohl/laravel4-php71-encrypter
You get the 2.0@dev version which causes the error below as reported by @hugossvoboda in this ticket, which you have quite rightly answer.
issue in Cookie\Guard::__construct() after complete all steps
May I suggest changing the line this, to avoid this issue in the future
composer require tomgrohl/laravel4-php71-encrypter:1.1.*
Sorry for posting as an issue, but I'm unable to get this to work, I'm still just seeing "Mcrypt PHP extension required."
I've added this package and updated composer. I added the provider and changed the cypher but no dice.. I even tried the steps at https://medium.com/@ysbilgin/running-laravel-4-2-project-on-php-7-3-or-7-4-b18e41caa0b
PHP version - 7.4.4
composer.json -
"require": {
"laravel/framework": "4.2.22",
"tomgrohl/laravel4-php71-encrypter": "^1.1"
},
I've tried adding extension=mcrypt.so to my php.ini even.
Any suggestions one what I might be mssing?
Using your encryptor solved my problems with webserver access, but any cli call to artisan still gives me 'Mcrypt PHP extension required.' Is there a workaround for that?
Hello there,
could this be made run with PHP 7.2 as well?
thanks...
If you set the cipher to be AES-256-CBC and update the key so that it has 32 characters, then the code in https://github.com/tomgrohl/laravel4-php71-encrypter/blob/1.1/src/Tomgrohl/Laravel/Encryption/EncryptionServiceProvider.php#L18 will throw an exception since you're calling new Encrypter()
without setting the cipher. I suggest changing the logic to this to fix this problem:
if ($app['config']->has('app.cipher')) {
$encrypter = new Encrypter(
$app['config']['app.key'],
$app['config']['app.cipher']
);
} else {
$encrypter = new Encrypter($app['config']['app.key']);
}
I want my project to be run on both PHP 5.6 and newer versions of php, but this package requires PHP 7.1. Does it really necessary?
Edit: Or at least it should run on PHP 7.0.
I'm getting this error.
Type error: Argument 2 passed to Illuminate\Cookie\Guard::__construct() must be an instance of Illuminate\Encryption\Encrypter, instance of Tomgrohl\Laravel\Encryption\Encrypter given
Can anyone help me?
Hi thank's for the encrypter. How can i integrate this and make it work with my website (Laravel 4.2) hosted online on Hostinger ? i'm beginner
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.