From f49667906017fa4aa13786255b301d0729b92156 Mon Sep 17 00:00:00 2001 From: Marc Ole Bulling Date: Thu, 14 Jan 2021 20:46:49 +0100 Subject: [PATCH] Added escpos-php library --- composer.json | 3 +- composer.lock | 239 ++++++++++++++------------------ helpers/PrerequisiteChecker.php | 2 +- 3 files changed, 104 insertions(+), 140 deletions(-) diff --git a/composer.json b/composer.json index 22b5f6fa..dbdc3cfe 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,8 @@ "eluceo/ical": "^0.16.0", "erusev/parsedown": "^1.7", "gumlet/php-image-resize": "^1.9", - "ezyang/htmlpurifier": "^4.13" + "ezyang/htmlpurifier": "^4.13", + "mike42/escpos-php": "^3.0" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index 2fd1ca61..2a9ccd11 100644 --- a/composer.lock +++ b/composer.lock @@ -1,10 +1,10 @@ { "_readme": [ "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#installing-dependencies", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "6155c0eb959bd8118ce2aabce7fd8a6a", + "content-hash": "471e23edacb0f4338b5e6920d6e6f0c0", "packages": [ { "name": "doctrine/inflector", @@ -86,20 +86,6 @@ "issues": "https://github.com/doctrine/inflector/issues", "source": "https://github.com/doctrine/inflector/tree/1.4.x" }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finflector", - "type": "tidelift" - } - ], "time": "2020-05-29T07:19:59+00:00" }, { @@ -828,6 +814,104 @@ }, "time": "2019-06-20T13:13:59+00:00" }, + { + "name": "mike42/escpos-php", + "version": "v3.0", + "source": { + "type": "git", + "url": "https://github.com/mike42/escpos-php.git", + "reference": "dcb569a123d75f9f6a4a927aae7625ca6b7fdcf3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mike42/escpos-php/zipball/dcb569a123d75f9f6a4a927aae7625ca6b7fdcf3", + "reference": "dcb569a123d75f9f6a4a927aae7625ca6b7fdcf3", + "shasum": "" + }, + "require": { + "ext-intl": "*", + "ext-json": "*", + "ext-zlib": "*", + "mike42/gfx-php": "^0.6", + "php": ">=7.0.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.5", + "squizlabs/php_codesniffer": "^3.3" + }, + "suggest": { + "ext-gd": "Used for image printing if present.", + "ext-imagick": "Will be used for image printing if present. Required for PDF printing or use of custom fonts." + }, + "type": "library", + "autoload": { + "psr-4": { + "Mike42\\": "src/Mike42" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Billington", + "email": "michael.billington@gmail.com" + } + ], + "description": "PHP receipt printer library for use with ESC/POS-compatible thermal and impact printers", + "homepage": "https://github.com/mike42/escpos-php", + "keywords": [ + "Epson", + "barcode", + "escpos", + "printer", + "receipt-printer" + ], + "time": "2019-10-13T06:27:43+00:00" + }, + { + "name": "mike42/gfx-php", + "version": "v0.6", + "source": { + "type": "git", + "url": "https://github.com/mike42/gfx-php.git", + "reference": "ed9ded2a9298e4084a9c557ab74a89b71e43dbdb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mike42/gfx-php/zipball/ed9ded2a9298e4084a9c557ab74a89b71e43dbdb", + "reference": "ed9ded2a9298e4084a9c557ab74a89b71e43dbdb", + "shasum": "" + }, + "require": { + "php": ">=7.0.0" + }, + "require-dev": { + "phpbench/phpbench": "@dev", + "phpunit/phpunit": "^6.5", + "squizlabs/php_codesniffer": "^3.3.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "Mike42\\": "src/Mike42" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-2.1-or-later" + ], + "authors": [ + { + "name": "Michael Billington", + "email": "michael.billington@gmail.com" + } + ], + "description": "The pure PHP graphics library", + "homepage": "https://github.com/mike42/gfx-php", + "time": "2019-10-05T02:44:33+00:00" + }, { "name": "morris/lessql", "version": "v0.4.1", @@ -962,16 +1046,6 @@ "issues": "https://github.com/briannesbitt/Carbon/issues", "source": "https://github.com/briannesbitt/Carbon" }, - "funding": [ - { - "url": "https://opencollective.com/Carbon", - "type": "open_collective" - }, - { - "url": "https://tidelift.com/funding/github/packagist/nesbot/carbon", - "type": "tidelift" - } - ], "time": "2020-12-17T20:55:32+00:00" }, { @@ -1181,12 +1255,6 @@ "issues": "https://github.com/PHP-DI/Invoker/issues", "source": "https://github.com/PHP-DI/Invoker/tree/2.2.0" }, - "funding": [ - { - "url": "https://github.com/mnapoli", - "type": "github" - } - ], "time": "2020-10-12T12:15:50+00:00" }, { @@ -1253,16 +1321,6 @@ "issues": "https://github.com/PHP-DI/PHP-DI/issues", "source": "https://github.com/PHP-DI/PHP-DI/tree/6.3.0" }, - "funding": [ - { - "url": "https://github.com/mnapoli", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/php-di/php-di", - "type": "tidelift" - } - ], "time": "2020-10-12T14:39:15+00:00" }, { @@ -2041,16 +2099,6 @@ "source": "https://github.com/slimphp/Slim", "wiki": "https://github.com/slimphp/Slim/wiki" }, - "funding": [ - { - "url": "https://opencollective.com/slimphp", - "type": "open_collective" - }, - { - "url": "https://tidelift.com/funding/github/packagist/slim/slim", - "type": "tidelift" - } - ], "time": "2020-12-01T19:41:22+00:00" }, { @@ -2106,20 +2154,6 @@ "support": { "source": "https://github.com/symfony/debug/tree/v4.4.18" }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-12-10T16:34:26+00:00" }, { @@ -2167,20 +2201,6 @@ "support": { "source": "https://github.com/symfony/finder/tree/v4.4.18" }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-12-08T16:59:59+00:00" }, { @@ -2247,20 +2267,6 @@ "support": { "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.20.0" }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-10-23T14:02:19+00:00" }, { @@ -2330,20 +2336,6 @@ "support": { "source": "https://github.com/symfony/polyfill-php80/tree/v1.20.0" }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-10-23T14:02:19+00:00" }, { @@ -2423,20 +2415,6 @@ "support": { "source": "https://github.com/symfony/translation/tree/v5.2.1" }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-12-08T17:03:37+00:00" }, { @@ -2501,20 +2479,6 @@ "support": { "source": "https://github.com/symfony/translation-contracts/tree/v2.3.0" }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-09-28T13:05:58+00:00" } ], @@ -2527,6 +2491,5 @@ "platform": { "php": ">=7.4" }, - "platform-dev": [], - "plugin-api-version": "2.0.0" + "platform-dev": [] } diff --git a/helpers/PrerequisiteChecker.php b/helpers/PrerequisiteChecker.php index 7c0b628b..37f6b370 100644 --- a/helpers/PrerequisiteChecker.php +++ b/helpers/PrerequisiteChecker.php @@ -4,7 +4,7 @@ class ERequirementNotMet extends Exception { } -const REQUIRED_PHP_EXTENSIONS = ['fileinfo', 'pdo_sqlite', 'gd', 'ctype']; +const REQUIRED_PHP_EXTENSIONS = ['fileinfo', 'pdo_sqlite', 'gd', 'ctype', 'json', 'intl', 'zlib']; const REQUIRED_SQLITE_VERSION = '3.9.0'; class PrerequisiteChecker