From 251fbe48cac3bfd757699e5727af7a7de141da01 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sun, 21 Jun 2020 15:30:39 +0200 Subject: [PATCH] Add generator meta with the current version --- classes/Config.php | 12 +++++ composer.json | 1 + composer.lock | 108 ++++++++++++++++++++++++++++++++++++++++- templates/inc/head.tpl | 5 +- 4 files changed, 123 insertions(+), 3 deletions(-) diff --git a/classes/Config.php b/classes/Config.php index 337192a..d95e212 100644 --- a/classes/Config.php +++ b/classes/Config.php @@ -9,6 +9,8 @@ namespace Alltube; use Alltube\Exception\ConfigException; use Alltube\Library\Downloader; use Jawira\CaseConverter\CaseConverterException; +use Jean85\PrettyVersions; +use PackageVersions\Versions; use Symfony\Component\ErrorHandler\Debug; use Symfony\Component\Yaml\Yaml; use Jawira\CaseConverter\Convert; @@ -332,4 +334,14 @@ class Config $this->avconvVerbosity ); } + + /** + * @return string + */ + public function getAppVersion() + { + $version = PrettyVersions::getVersion(Versions::ROOT_PACKAGE_NAME); + + return $version->getPrettyVersion(); + } } diff --git a/composer.json b/composer.json index a5122bb..530604a 100644 --- a/composer.json +++ b/composer.json @@ -12,6 +12,7 @@ "barracudanetworks/archivestream-php": "^1.0", "ffmpeg/ffmpeg": "^4.1", "jawira/case-converter": "^3.4", + "jean85/pretty-package-versions": "^1.3", "mathmarques/smarty-view": "^1.1", "npm-asset/open-sans-fontface": "^1.4", "rinvex/countries": "^6.1", diff --git a/composer.lock b/composer.lock index b612219..90c8d5a 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": "03b37b613f8ae3881395adf1cbc72b67", + "content-hash": "4468e4da3c9a9626c997b0da8be455ae", "packages": [ { "name": "anam/phantomjs-linux-x86-binary", @@ -150,6 +150,61 @@ ], "time": "2018-08-10T13:58:33+00:00" }, + { + "name": "composer/package-versions-deprecated", + "version": "1.8.1", + "source": { + "type": "git", + "url": "https://github.com/composer/package-versions-deprecated.git", + "reference": "b9805885293f3957ee0dd42616ac6915c4ac9a4b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/b9805885293f3957ee0dd42616ac6915c4ac9a4b", + "reference": "b9805885293f3957ee0dd42616ac6915c4ac9a4b", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.1.0 || ^2.0", + "php": "^7" + }, + "replace": { + "ocramius/package-versions": "1.8.99" + }, + "require-dev": { + "composer/composer": "^1.9.3 || ^2.0@dev", + "ext-zip": "^1.13", + "phpunit/phpunit": "^6.5 || ^7" + }, + "type": "composer-plugin", + "extra": { + "class": "PackageVersions\\Installer", + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "PackageVersions\\": "src/PackageVersions" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be" + } + ], + "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", + "time": "2020-06-19T07:59:31+00:00" + }, { "name": "ffmpeg/ffmpeg", "version": "4.1.4", @@ -409,6 +464,57 @@ ], "time": "2019-12-15T14:31:43+00:00" }, + { + "name": "jean85/pretty-package-versions", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/Jean85/pretty-package-versions.git", + "reference": "e3517fb11b67e798239354fe8213927d012ad8f9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/e3517fb11b67e798239354fe8213927d012ad8f9", + "reference": "e3517fb11b67e798239354fe8213927d012ad8f9", + "shasum": "" + }, + "require": { + "composer/package-versions-deprecated": "^1.8.0", + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Jean85\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Alessandro Lai", + "email": "alessandro.lai85@gmail.com" + } + ], + "description": "A wrapper for ocramius/package-versions to get pretty versions strings", + "keywords": [ + "composer", + "package", + "release", + "versions" + ], + "time": "2020-04-24T14:19:45+00:00" + }, { "name": "mathmarques/smarty-view", "version": "1.1.2", diff --git a/templates/inc/head.tpl b/templates/inc/head.tpl index 00a98c8..7b2f3d4 100644 --- a/templates/inc/head.tpl +++ b/templates/inc/head.tpl @@ -2,7 +2,7 @@ - + {if isset($description)} @@ -19,7 +19,8 @@ - + +