Upgrade to stable cookie dependency

This commit is contained in:
Franz Liedke 2015-06-03 10:17:59 +02:00
parent 3f90caaeb5
commit da83008bfc
3 changed files with 12 additions and 14 deletions

View File

@ -17,7 +17,7 @@
"intervention/image": "dev-master", "intervention/image": "dev-master",
"psr/http-message": "^1.0@dev", "psr/http-message": "^1.0@dev",
"nikic/fast-route": "dev-master", "nikic/fast-route": "dev-master",
"dflydev/fig-cookies": "0.0.*@dev" "dflydev/fig-cookies": "^1.0"
}, },
"require-dev": { "require-dev": {
"fzaninotto/faker": "1.4.0", "fzaninotto/faker": "1.4.0",

View File

@ -1,10 +1,10 @@
{ {
"_readme": [ "_readme": [
"This file locks the dependencies of your project to a known state", "This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"hash": "b4919da43ec6d4286a38b1b95b32ae31", "hash": "7565e9df531dc59fa898d68cf3d7d69e",
"packages": [ "packages": [
{ {
"name": "danielstjules/stringy", "name": "danielstjules/stringy",
@ -68,12 +68,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/dflydev/dflydev-fig-cookies.git", "url": "https://github.com/dflydev/dflydev-fig-cookies.git",
"reference": "adc6bab48d09585f67338e0d00695bf64a9ee2b8" "reference": "56133681a2d0055f110c1fa51b88c129bc6ce1c9"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/dflydev/dflydev-fig-cookies/zipball/adc6bab48d09585f67338e0d00695bf64a9ee2b8", "url": "https://api.github.com/repos/dflydev/dflydev-fig-cookies/zipball/56133681a2d0055f110c1fa51b88c129bc6ce1c9",
"reference": "adc6bab48d09585f67338e0d00695bf64a9ee2b8", "reference": "56133681a2d0055f110c1fa51b88c129bc6ce1c9",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -88,7 +88,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "0.0.x-dev" "dev-master": "1.0.x-dev"
} }
}, },
"autoload": { "autoload": {
@ -112,7 +112,7 @@
"psr-7", "psr-7",
"psr7" "psr7"
], ],
"time": "2015-06-02 19:02:56" "time": "2015-06-03 01:35:56"
}, },
{ {
"name": "doctrine/inflector", "name": "doctrine/inflector",
@ -2797,11 +2797,9 @@
"oyejorge/less.php": 20, "oyejorge/less.php": 20,
"intervention/image": 20, "intervention/image": 20,
"psr/http-message": 20, "psr/http-message": 20,
"nikic/fast-route": 20, "nikic/fast-route": 20
"dflydev/fig-cookies": 20
}, },
"prefer-stable": false, "prefer-stable": false,
"prefer-lowest": false,
"platform": { "platform": {
"php": ">=5.4.0" "php": ">=5.4.0"
}, },

View File

@ -1,6 +1,6 @@
<?php namespace Flarum\Forum\Actions; <?php namespace Flarum\Forum\Actions;
use Dflydev\FigCookies\FigCookies; use Dflydev\FigCookies\FigResponseCookies;
use Dflydev\FigCookies\SetCookie; use Dflydev\FigCookies\SetCookie;
use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ResponseInterface;
@ -9,7 +9,7 @@ trait WritesRememberCookie
protected function withRememberCookie(ResponseInterface $response, $token) protected function withRememberCookie(ResponseInterface $response, $token)
{ {
// Set a long-living cookie (two weeks) with the remember token // Set a long-living cookie (two weeks) with the remember token
return FigCookies::setResponseSetCookie( return FigResponseCookies::set(
$response, $response,
SetCookie::create('flarum_remember', $token)->withMaxAge(14 * 24 * 60 * 60) SetCookie::create('flarum_remember', $token)->withMaxAge(14 * 24 * 60 * 60)
); );
@ -18,7 +18,7 @@ trait WritesRememberCookie
protected function withForgetCookie(ResponseInterface $response) protected function withForgetCookie(ResponseInterface $response)
{ {
// Delete the cookie by setting it to an expiration date in the past // Delete the cookie by setting it to an expiration date in the past
return FigCookies::setResponseSetCookie( return FigResponseCookies::set(
$response, $response,
SetCookie::create('flarum_remember')->withMaxAge(-2628000) SetCookie::create('flarum_remember')->withMaxAge(-2628000)
); );