diff --git a/CHANGELOG.md b/CHANGELOG.md index a58f730..0e1ed3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ - **Requests:** Make Response Component extends from `Symfony\Component\HttpFoundation\Response` (dd001d2) - **Requests:** Make Request Component extends from `Symfony\Component\HttpFoundation\Request` (9cd715b) - **Torrent:** Per-add torrent edit (f06b342) +- **Torrents:** Allow search in user's favour (or you can say bookmark) (c0aa627) - **i18n:** Use symfony/translation and JSON format for locale (02cc251) - **layout:** Add anti-robots html meta tag (9c21e73) diff --git a/composer.json b/composer.json index 8e76152..965476b 100644 --- a/composer.json +++ b/composer.json @@ -33,6 +33,7 @@ "firebase/php-jwt": "^5.0", "league/plates": "^3.3", "mjohnson/decoda": "^6.12", + "nesbot/carbon": "^2.30", "phpmailer/phpmailer": "^6.0", "psr/log": "^1.1", "rhilip/bencode": "^1.0", @@ -63,3 +64,6 @@ }, "prefer-stable": true } +, + "prefer-stable": true +} diff --git a/composer.lock b/composer.lock index e6c1c9e..8f4c342 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "8a7226a2e2e3b8cd4cc95eed9548a8bf", + "content-hash": "bf5d53abcb005eca7960c0940c957927", "packages": [ { "name": "adhocore/cli", @@ -217,6 +217,76 @@ ], "time": "2019-01-16T04:52:14+00:00" }, + { + "name": "nesbot/carbon", + "version": "2.30.0", + "source": { + "type": "git", + "url": "https://github.com/briannesbitt/Carbon.git", + "reference": "912dff66d2690ca66abddb9b291a1df5f371d3b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/912dff66d2690ca66abddb9b291a1df5f371d3b4", + "reference": "912dff66d2690ca66abddb9b291a1df5f371d3b4", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": "^7.1.8 || ^8.0", + "symfony/translation": "^3.4 || ^4.0 || ^5.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.14 || ^3.0", + "kylekatarnls/multi-tester": "^1.1", + "phpmd/phpmd": "^2.8", + "phpstan/phpstan": "^0.11", + "phpunit/phpunit": "^7.5 || ^8.0", + "squizlabs/php_codesniffer": "^3.4" + }, + "bin": [ + "bin/carbon" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + }, + "laravel": { + "providers": [ + "Carbon\\Laravel\\ServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Carbon\\": "src/Carbon/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Brian Nesbitt", + "email": "brian@nesbot.com", + "homepage": "http://nesbot.com" + }, + { + "name": "kylekatarnls", + "homepage": "http://github.com/kylekatarnls" + } + ], + "description": "An API extension for DateTime that supports 281 different languages.", + "homepage": "http://carbon.nesbot.com", + "keywords": [ + "date", + "datetime", + "time" + ], + "time": "2020-02-07T15:25:46+00:00" + }, { "name": "phpmailer/phpmailer", "version": "v6.1.4", @@ -523,7 +593,7 @@ }, { "name": "symfony/config", - "version": "v4.4.3", + "version": "v4.4.4", "source": { "type": "git", "url": "https://github.com/symfony/config.git", @@ -587,7 +657,7 @@ }, { "name": "symfony/filesystem", - "version": "v5.0.3", + "version": "v5.0.4", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", @@ -637,16 +707,16 @@ }, { "name": "symfony/http-foundation", - "version": "v5.0.3", + "version": "v5.0.4", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "5dc0db5026f2b611cb8910a1f465e95eafd84c2e" + "reference": "2832d8cffc3a91df550ac42bcdce602f8c08be3e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/5dc0db5026f2b611cb8910a1f465e95eafd84c2e", - "reference": "5dc0db5026f2b611cb8910a1f465e95eafd84c2e", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/2832d8cffc3a91df550ac42bcdce602f8c08be3e", + "reference": "2832d8cffc3a91df550ac42bcdce602f8c08be3e", "shasum": "" }, "require": { @@ -688,11 +758,11 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2020-01-04T14:08:26+00:00" + "time": "2020-01-31T09:13:47+00:00" }, { "name": "symfony/mime", - "version": "v5.0.3", + "version": "v5.0.4", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", @@ -754,16 +824,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.13.1", + "version": "v1.14.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3" + "reference": "fbdeaec0df06cf3d51c93de80c7eb76e271f5a38" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", - "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/fbdeaec0df06cf3d51c93de80c7eb76e271f5a38", + "reference": "fbdeaec0df06cf3d51c93de80c7eb76e271f5a38", "shasum": "" }, "require": { @@ -775,7 +845,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.13-dev" + "dev-master": "1.14-dev" } }, "autoload": { @@ -808,26 +878,26 @@ "polyfill", "portable" ], - "time": "2019-11-27T13:56:44+00:00" + "time": "2020-01-13T11:15:53+00:00" }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.13.1", + "version": "v1.14.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "6f9c239e61e1b0c9229a28ff89a812dc449c3d46" + "reference": "6842f1a39cf7d580655688069a03dd7cd83d244a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/6f9c239e61e1b0c9229a28ff89a812dc449c3d46", - "reference": "6f9c239e61e1b0c9229a28ff89a812dc449c3d46", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/6842f1a39cf7d580655688069a03dd7cd83d244a", + "reference": "6842f1a39cf7d580655688069a03dd7cd83d244a", "shasum": "" }, "require": { "php": ">=5.3.3", "symfony/polyfill-mbstring": "^1.3", - "symfony/polyfill-php72": "^1.9" + "symfony/polyfill-php72": "^1.10" }, "suggest": { "ext-intl": "For best performance" @@ -835,7 +905,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.13-dev" + "dev-master": "1.14-dev" } }, "autoload": { @@ -870,20 +940,20 @@ "portable", "shim" ], - "time": "2019-11-27T13:56:44+00:00" + "time": "2020-01-17T12:01:36+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.13.1", + "version": "v1.14.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "7b4aab9743c30be783b73de055d24a39cf4b954f" + "reference": "34094cfa9abe1f0f14f48f490772db7a775559f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7b4aab9743c30be783b73de055d24a39cf4b954f", - "reference": "7b4aab9743c30be783b73de055d24a39cf4b954f", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/34094cfa9abe1f0f14f48f490772db7a775559f2", + "reference": "34094cfa9abe1f0f14f48f490772db7a775559f2", "shasum": "" }, "require": { @@ -895,7 +965,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.13-dev" + "dev-master": "1.14-dev" } }, "autoload": { @@ -929,20 +999,20 @@ "portable", "shim" ], - "time": "2019-11-27T14:18:11+00:00" + "time": "2020-01-13T11:15:53+00:00" }, { "name": "symfony/polyfill-php72", - "version": "v1.13.1", + "version": "v1.14.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "66fea50f6cb37a35eea048d75a7d99a45b586038" + "reference": "46ecacf4751dd0dc81e4f6bf01dbf9da1dc1dadf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/66fea50f6cb37a35eea048d75a7d99a45b586038", - "reference": "66fea50f6cb37a35eea048d75a7d99a45b586038", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/46ecacf4751dd0dc81e4f6bf01dbf9da1dc1dadf", + "reference": "46ecacf4751dd0dc81e4f6bf01dbf9da1dc1dadf", "shasum": "" }, "require": { @@ -951,7 +1021,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.13-dev" + "dev-master": "1.14-dev" } }, "autoload": { @@ -984,11 +1054,11 @@ "portable", "shim" ], - "time": "2019-11-27T13:56:44+00:00" + "time": "2020-01-13T11:15:53+00:00" }, { "name": "symfony/translation", - "version": "v4.4.3", + "version": "v4.4.4", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", diff --git a/framework/Component/I18n.php b/framework/Component/I18n.php index a6cda12..4cb0992 100644 --- a/framework/Component/I18n.php +++ b/framework/Component/I18n.php @@ -13,10 +13,10 @@ class I18n extends Component { - public $loader = []; - public $resources = []; + public array $loader = []; + public array $resources = []; - public $cacheDir = ''; + public string $cacheDir = ''; /** * Allowed language @@ -24,7 +24,7 @@ class I18n extends Component * * @var array */ - public $allowedLangSet = ['en', 'zh-CN']; + public array $allowedLangSet = ['en', 'zh-CN']; /** * Fallback language @@ -33,7 +33,7 @@ class I18n extends Component * * @var string */ - public $fallbackLang = 'en'; + public string $fallbackLang = 'en'; /** * Forced language @@ -41,15 +41,15 @@ class I18n extends Component * * @var string */ - public $forcedLang = null; + public ?string $forcedLang = null; /* * The following properties are only available after calling init(). */ - protected $_user_lang = null; + protected ?string $_user_lang = null; /** @var Translator */ - protected $_translator; + protected ?Translator $_translator; public function onRequestBefore() { @@ -85,7 +85,7 @@ public function onInitialize() * * @return string the user languages sorted by priority. */ - private function getUserLang() + public function getUserLang() { // Return Cache value if (!is_null($this->_user_lang)) { diff --git a/framework/Http/Request.php b/framework/Http/Request.php index b3a35b7..d94d20a 100644 --- a/framework/Http/Request.php +++ b/framework/Http/Request.php @@ -13,7 +13,7 @@ class Request extends HttpFoundationRequest implements Base\StaticInstanceInterf { use Base\StaticInstanceTrait, Base\ComponentTrait; - protected $_swoole_request; + protected \Swoole\Http\Request $_swoole_request; protected $_route = []; /** @@ -77,9 +77,6 @@ public function route($name = null, $default = null) return is_null($name) ? $this->_route : ($this->_route[$name] ?? $default); } - /** - * @return mixed - */ public function getSwooleRequest(): \Swoole\Http\Request { return $this->_swoole_request; diff --git a/framework/Validators/Validator.php b/framework/Validators/Validator.php index 4dee2e4..bc9f70d 100644 --- a/framework/Validators/Validator.php +++ b/framework/Validators/Validator.php @@ -28,17 +28,14 @@ class Validator extends BaseObject protected array $_autoload_from = []; /** @var array Input data */ - private $_input = []; - private $_file_input_name = []; + private array $_input = []; + private array $_file_input_name = []; - /** @var \Sirius\Validation\Validator */ - private $_validator; + private ?\Sirius\Validation\Validator $_validator; - /** @var array */ - private $_errors = []; + private array $_errors = []; - /** @var boolean */ - private $_success; + private bool $_success; public function onConstruct() { diff --git a/templates/user/details.php b/templates/user/details.php index a443391..0d6b473 100644 --- a/templates/user/details.php +++ b/templates/user/details.php @@ -33,9 +33,9 @@
-
Registration Time
getCreateAt() ?>
-
Last Login Time
getLastLoginAt() ?>
-
Last Access Time
getLastAccessAt() ?>
+
Registration Time
getCreateAt() ?> (getCreateAt())->locale(app()->i18n->getUserLang())->diffForHumans() ?>)
+
Last Login Time
getLastLoginAt() ?> (getLastLoginAt())->locale(app()->i18n->getUserLang())->diffForHumans() ?>)
+
Last Access Time
getLastAccessAt() ?> (getLastAccessAt())->locale(app()->i18n->getUserLang())->diffForHumans() ?>)
getLastUploadAt() > 0 or $user->getLastDownloadAt() or $user->getLastConnectAt() > 0): ?>
Last Tracker Time