From 683462ef71995819f6e1cf736b0dab3933620519 Mon Sep 17 00:00:00 2001 From: flashwave Date: Fri, 21 Jul 2023 16:12:08 +0000 Subject: [PATCH] Just use Composer for DeviceDetector. It was initially my goal to lessen use of Composer, but given I just switched to using NPM packages for asset compilation, it's a little bit silly to try and keep that going. --- .gitmodules | 6 --- composer.json | 3 +- composer.lock | 121 +++++++++++++++++++++++++++++++++++++++++++- lib/device-detector | 1 - lib/spyc | 1 - misuzu.php | 5 -- 6 files changed, 122 insertions(+), 15 deletions(-) delete mode 160000 lib/device-detector delete mode 160000 lib/spyc diff --git a/.gitmodules b/.gitmodules index 7330f9f..525bff2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,3 @@ [submodule "lib/index"] path = lib/index url = https://git.flash.moe/flash/index.git -[submodule "lib/device-detector"] - path = lib/device-detector - url = https://github.com/matomo-org/device-detector.git -[submodule "lib/spyc"] - path = lib/spyc - url = https://github.com/mustangostang/spyc.git diff --git a/composer.json b/composer.json index 9d1735c..e580552 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,8 @@ "twig/twig": "^3.0", "erusev/parsedown": "~1.6", "chillerlan/php-qrcode": "^4.3", - "symfony/mailer": "^6.0" + "symfony/mailer": "^6.0", + "matomo/device-detector": "^6.1" }, "autoload": { "classmap": [ diff --git a/composer.lock b/composer.lock index af75351..e291cec 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": "d757fc71803876a28a7434df1fa5edf1", + "content-hash": "7081b9554d73c42e8288c5dd252f3096", "packages": [ { "name": "chillerlan/php-qrcode", @@ -342,6 +342,125 @@ }, "time": "2019-12-30T22:54:17+00:00" }, + { + "name": "matomo/device-detector", + "version": "6.1.3", + "source": { + "type": "git", + "url": "https://github.com/matomo-org/device-detector.git", + "reference": "3e0fac7e77f3faadc3858fea9f5fa7efeb9cf239" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/matomo-org/device-detector/zipball/3e0fac7e77f3faadc3858fea9f5fa7efeb9cf239", + "reference": "3e0fac7e77f3faadc3858fea9f5fa7efeb9cf239", + "shasum": "" + }, + "require": { + "mustangostang/spyc": "*", + "php": "^7.2|^8.0" + }, + "replace": { + "piwik/device-detector": "self.version" + }, + "require-dev": { + "matthiasmullie/scrapbook": "^1.4.7", + "mayflower/mo4-coding-standard": "^v8.0.0", + "phpstan/phpstan": "^0.12.52", + "phpunit/phpunit": "^8.5.8", + "psr/cache": "^1.0.1", + "psr/simple-cache": "^1.0.1", + "symfony/yaml": "^5.1.7" + }, + "suggest": { + "doctrine/cache": "Can directly be used for caching purpose", + "ext-yaml": "Necessary for using the Pecl YAML parser" + }, + "type": "library", + "autoload": { + "psr-4": { + "DeviceDetector\\": "" + }, + "exclude-from-classmap": [ + "Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "The Matomo Team", + "email": "hello@matomo.org", + "homepage": "https://matomo.org/team/" + } + ], + "description": "The Universal Device Detection library, that parses User Agents and detects devices (desktop, tablet, mobile, tv, cars, console, etc.), clients (browsers, media players, mobile apps, feed readers, libraries, etc), operating systems, devices, brands and models.", + "homepage": "https://matomo.org", + "keywords": [ + "devicedetection", + "parser", + "useragent" + ], + "support": { + "forum": "https://forum.matomo.org/", + "issues": "https://github.com/matomo-org/device-detector/issues", + "source": "https://github.com/matomo-org/matomo", + "wiki": "https://dev.matomo.org/" + }, + "time": "2023-06-06T11:58:07+00:00" + }, + { + "name": "mustangostang/spyc", + "version": "0.6.3", + "source": { + "type": "git", + "url": "git@github.com:mustangostang/spyc.git", + "reference": "4627c838b16550b666d15aeae1e5289dd5b77da0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mustangostang/spyc/zipball/4627c838b16550b666d15aeae1e5289dd5b77da0", + "reference": "4627c838b16550b666d15aeae1e5289dd5b77da0", + "shasum": "" + }, + "require": { + "php": ">=5.3.1" + }, + "require-dev": { + "phpunit/phpunit": "4.3.*@dev" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.5.x-dev" + } + }, + "autoload": { + "files": [ + "Spyc.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "mustangostang", + "email": "vlad.andersen@gmail.com" + } + ], + "description": "A simple YAML loader/dumper class for PHP", + "homepage": "https://github.com/mustangostang/spyc/", + "keywords": [ + "spyc", + "yaml", + "yml" + ], + "time": "2019-09-10T13:16:29+00:00" + }, { "name": "psr/container", "version": "2.0.2", diff --git a/lib/device-detector b/lib/device-detector deleted file mode 160000 index 3e0fac7..0000000 --- a/lib/device-detector +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3e0fac7e77f3faadc3858fea9f5fa7efeb9cf239 diff --git a/lib/spyc b/lib/spyc deleted file mode 160000 index 4627c83..0000000 --- a/lib/spyc +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4627c838b16550b666d15aeae1e5289dd5b77da0 diff --git a/misuzu.php b/misuzu.php index f8c7e30..2bf2ab1 100644 --- a/misuzu.php +++ b/misuzu.php @@ -29,12 +29,7 @@ Environment::setDebug(MSZ_DEBUG); mb_internal_encoding('utf-8'); date_default_timezone_set('utc'); -// Third party libraries require_once MSZ_ROOT . '/vendor/autoload.php'; -require_once MSZ_LIBRARIES . '/spyc/Spyc.php'; // dependency for device-detector -require_once MSZ_LIBRARIES . '/device-detector/autoload.php'; - -// Procedural components require_once MSZ_ROOT . '/utility.php'; require_once MSZ_SOURCE . '/perms.php'; require_once MSZ_SOURCE . '/manage.php';