Most date manip is done by MySQL queries, so goodbye Carbon.

This commit is contained in:
flash 2018-10-03 00:43:04 +02:00
parent f01a6d5372
commit 2dbe78f626
4 changed files with 7 additions and 134 deletions

View file

@ -11,7 +11,6 @@
"ext-bcmath": "*", "ext-bcmath": "*",
"ext-mbstring": "*", "ext-mbstring": "*",
"twig/twig": "~2.4", "twig/twig": "~2.4",
"nesbot/carbon": "~1.22",
"swiftmailer/swiftmailer": "~6.0", "swiftmailer/swiftmailer": "~6.0",
"erusev/parsedown": "~1.6", "erusev/parsedown": "~1.6",
"geoip2/geoip2": "~2.0", "geoip2/geoip2": "~2.0",

136
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "8d8235975900b7eff2b22be94207cfe1", "content-hash": "eecb2be3db098c1aae02a69d52791f7d",
"packages": [ "packages": [
{ {
"name": "composer/ca-bundle", "name": "composer/ca-bundle",
@ -118,16 +118,16 @@
}, },
{ {
"name": "egulias/email-validator", "name": "egulias/email-validator",
"version": "2.1.5", "version": "2.1.6",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/egulias/EmailValidator.git", "url": "https://github.com/egulias/EmailValidator.git",
"reference": "54859fabea8b3beecbb1a282888d5c990036b9e3" "reference": "0578b32b30b22de3e8664f797cf846fc9246f786"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/egulias/EmailValidator/zipball/54859fabea8b3beecbb1a282888d5c990036b9e3", "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/0578b32b30b22de3e8664f797cf846fc9246f786",
"reference": "54859fabea8b3beecbb1a282888d5c990036b9e3", "reference": "0578b32b30b22de3e8664f797cf846fc9246f786",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -171,7 +171,7 @@
"validation", "validation",
"validator" "validator"
], ],
"time": "2018-08-16T20:49:45+00:00" "time": "2018-09-25T20:47:26+00:00"
}, },
{ {
"name": "erusev/parsedown", "name": "erusev/parsedown",
@ -434,61 +434,6 @@
"homepage": "https://github.com/maxmind/web-service-common-php", "homepage": "https://github.com/maxmind/web-service-common-php",
"time": "2018-02-12T22:31:54+00:00" "time": "2018-02-12T22:31:54+00:00"
}, },
{
"name": "nesbot/carbon",
"version": "1.33.0",
"source": {
"type": "git",
"url": "https://github.com/briannesbitt/Carbon.git",
"reference": "55667c1007a99e82030874b1bb14d24d07108413"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/55667c1007a99e82030874b1bb14d24d07108413",
"reference": "55667c1007a99e82030874b1bb14d24d07108413",
"shasum": ""
},
"require": {
"php": ">=5.3.9",
"symfony/translation": "~2.6 || ~3.0 || ~4.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "~2",
"phpunit/phpunit": "^4.8.35 || ^5.7"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Carbon\\Laravel\\ServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Brian Nesbitt",
"email": "brian@nesbot.com",
"homepage": "http://nesbot.com"
}
],
"description": "A simple API extension for DateTime.",
"homepage": "http://carbon.nesbot.com",
"keywords": [
"date",
"datetime",
"time"
],
"time": "2018-08-07T08:39:47+00:00"
},
{ {
"name": "psr/log", "name": "psr/log",
"version": "1.0.2", "version": "1.0.2",
@ -712,75 +657,6 @@
], ],
"time": "2018-08-06T14:22:27+00:00" "time": "2018-08-06T14:22:27+00:00"
}, },
{
"name": "symfony/translation",
"version": "v4.1.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/translation.git",
"reference": "fa2182669f7983b7aa5f1a770d053f79f0ef144f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/translation/zipball/fa2182669f7983b7aa5f1a770d053f79f0ef144f",
"reference": "fa2182669f7983b7aa5f1a770d053f79f0ef144f",
"shasum": ""
},
"require": {
"php": "^7.1.3",
"symfony/polyfill-mbstring": "~1.0"
},
"conflict": {
"symfony/config": "<3.4",
"symfony/dependency-injection": "<3.4",
"symfony/yaml": "<3.4"
},
"require-dev": {
"psr/log": "~1.0",
"symfony/config": "~3.4|~4.0",
"symfony/console": "~3.4|~4.0",
"symfony/dependency-injection": "~3.4|~4.0",
"symfony/finder": "~2.8|~3.0|~4.0",
"symfony/intl": "~3.4|~4.0",
"symfony/yaml": "~3.4|~4.0"
},
"suggest": {
"psr/log-implementation": "To use logging capability in translator",
"symfony/config": "",
"symfony/yaml": ""
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.1-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Translation\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Translation Component",
"homepage": "https://symfony.com",
"time": "2018-08-07T12:45:11+00:00"
},
{ {
"name": "twig/extensions", "name": "twig/extensions",
"version": "v1.5.2", "version": "v1.5.2",

View file

@ -1,5 +1,4 @@
<?php <?php
use Carbon\Carbon;
use Misuzu\Application; use Misuzu\Application;
use Misuzu\Database; use Misuzu\Database;
@ -315,7 +314,7 @@ MSG;
} }
user_session_start($userId, $sessionKey); user_session_start($userId, $sessionKey);
$cookieLife = Carbon::now()->addMonth()->timestamp; $cookieLife = strtotime(user_session_current('expires_on'));
set_cookie_m('uid', $userId, $cookieLife); set_cookie_m('uid', $userId, $cookieLife);
set_cookie_m('sid', $sessionKey, $cookieLife); set_cookie_m('sid', $sessionKey, $cookieLife);

View file

@ -1,7 +1,6 @@
<?php <?php
namespace Misuzu; namespace Misuzu;
use Carbon\Carbon;
use UnexpectedValueException; use UnexpectedValueException;
use InvalidArgumentException; use InvalidArgumentException;
use Swift_Mailer; use Swift_Mailer;