使用composer下载一个七牛云的Laravel扩展包:composer require itbdw/laravel-storage-qiniu,但是composer报错。
[ComposerDownloaderTransportException]
Your configuration does not allow connection to http://packagist.phpcomposer.com. See https://getcomposer.org/doc/06-config.md#secure-http for details.
网上找到解决办法,记录一下:
解决方法是设置一个本地或全局的composer配置:
composer config secure-http false
全局设置:
composer config -g secure-http false
意义是默认禁用https请求,就可以了。
有时候composer install/update的时候会报错:
[ComposerDownloaderTransportException]
Your configuration does not allow connection to http://ooxx/xxoo.git. See https://getcomposer.org/doc/06-config.md#secure-http for details.
解决方法是设置一个本地或全局的composer配置:
composer config secure-http false
全局设置:
composer config -g secure-http false
意义是默认禁用https请求,就可以了
查看laravel版本 php artisan --version
5.2.26<使用版本
主要更新内容.
默认web全局中间件,
受影响内容(seesion)
csrf验证(postman 模拟post提交的时候会报错)
session(return back()->with('msg','xxx'))
配置
还记得在一开始讲环境配置那一章讲的App Key的内容吗?
Encryption就是拿App Key作为基础进行加密运算,同样借由App Key还可以进行逆向解密。 App Key一定要合理设置,否则加密就不安全了。 命令行生成app key:
php artisan key:generate
加密和解密
$encryptedValue = Crypt::encrypt('Hello World');
$decrypted = Crypt::decrypt($encryptedValue);
//'Hello World'