From e864549b43cbec5a0d6b43d2d2e49b763c7a7b5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Anne?= Date: Wed, 10 Nov 2021 09:13:39 +0100 Subject: [PATCH 1/5] GLPI 10.0 compatibility - Permit installation on GLPI 10.0.x - Use alternative way to silent errors - Fix showForm() signature - Use same PHP minimal version as GLPI core - Remove deprecated usage of integer display width - Use default GLPI charset/collation during install/update - Force database dynamic row format --- composer.json | 11 +- composer.lock | 830 +++++++++++++++++++++++++--------------- hook.php | 39 +- inc/barcode.class.php | 9 +- inc/config.class.php | 2 +- inc/functions_debug.php | 56 --- inc/profile.class.php | 12 +- setup.php | 4 +- 8 files changed, 558 insertions(+), 405 deletions(-) delete mode 100644 inc/functions_debug.php diff --git a/composer.json b/composer.json index f604075..93d2755 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "require": { - "php": "^7.2", + "php": ">=7.4", "cweagans/composer-patches": "^1.7", "deltalab/phpqrcode": "^1.1", "pear/image_barcode": "^1.1", @@ -8,20 +8,15 @@ "rospdf/pdf-php": "^0.12" }, "require-dev": { - "glpi-project/tools": "^0.3" + "glpi-project/tools": "^0.5" }, "config": { "optimize-autoloader": true, "platform": { - "php": "7.2.0" + "php": "7.4.0" }, "sort-packages": true }, - "autoload": { - "files": [ - "inc/functions_debug.php" - ] - }, "repositories": [ { "type": "package", diff --git a/composer.lock b/composer.lock index f14e5f9..5f49bb9 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e842652ebda75df66ca001c2542a1647", + "content-hash": "bc2b1e627c5a31ed964223a4a026a217", "packages": [ { "name": "cweagans/composer-patches", - "version": "1.7.1", + "version": "1.7.2", "source": { "type": "git", "url": "https://github.com/cweagans/composer-patches.git", - "reference": "9888dcc74993c030b75f3dd548bb5e20cdbd740c" + "reference": "e9969cfc0796e6dea9b4e52f77f18e1065212871" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cweagans/composer-patches/zipball/9888dcc74993c030b75f3dd548bb5e20cdbd740c", - "reference": "9888dcc74993c030b75f3dd548bb5e20cdbd740c", + "url": "https://api.github.com/repos/cweagans/composer-patches/zipball/e9969cfc0796e6dea9b4e52f77f18e1065212871", + "reference": "e9969cfc0796e6dea9b4e52f77f18e1065212871", "shasum": "" }, "require": { @@ -50,9 +50,9 @@ "description": "Provides a way to patch Composer packages.", "support": { "issues": "https://github.com/cweagans/composer-patches/issues", - "source": "https://github.com/cweagans/composer-patches/tree/1.7.1" + "source": "https://github.com/cweagans/composer-patches/tree/1.7.2" }, - "time": "2021-06-08T15:12:46+00:00" + "time": "2022-01-25T19:21:20+00:00" }, { "name": "deltalab/phpqrcode", @@ -220,16 +220,16 @@ }, { "name": "pear/pear", - "version": "v1.10.12", + "version": "v1.10.13", "source": { "type": "git", "url": "https://github.com/pear/pear-core.git", - "reference": "6162562db95379bcfa906b569ecd0c85d4ee7364" + "reference": "edb8e0cf49755b1c0528c46edaa0238c63cc4d47" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pear/pear-core/zipball/6162562db95379bcfa906b569ecd0c85d4ee7364", - "reference": "6162562db95379bcfa906b569ecd0c85d4ee7364", + "url": "https://api.github.com/repos/pear/pear-core/zipball/edb8e0cf49755b1c0528c46edaa0238c63cc4d47", + "reference": "edb8e0cf49755b1c0528c46edaa0238c63cc4d47", "shasum": "" }, "require": { @@ -315,7 +315,7 @@ "issues": "http://pear.php.net/bugs/search.php?cmd=display&package_name[]=PEAR", "source": "https://github.com/pear/PEAR" }, - "time": "2020-04-19T18:01:13+00:00" + "time": "2021-08-10T22:24:49+00:00" }, { "name": "pear/structures_graph", @@ -492,436 +492,473 @@ ], "packages-dev": [ { - "name": "dealerdirect/phpcodesniffer-composer-installer", - "version": "v0.7.1", + "name": "glpi-project/tools", + "version": "0.5.0", "source": { "type": "git", - "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", - "reference": "fe390591e0241955f22eb9ba327d137e501c771c" + "url": "https://github.com/glpi-project/tools.git", + "reference": "547739edc4d7992ad1061d26937b9a626631e6b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/fe390591e0241955f22eb9ba327d137e501c771c", - "reference": "fe390591e0241955f22eb9ba327d137e501c771c", + "url": "https://api.github.com/repos/glpi-project/tools/zipball/547739edc4d7992ad1061d26937b9a626631e6b7", + "reference": "547739edc4d7992ad1061d26937b9a626631e6b7", "shasum": "" }, "require": { - "composer-plugin-api": "^1.0 || ^2.0", - "php": ">=5.3", - "squizlabs/php_codesniffer": "^2.0 || ^3.0 || ^4.0" - }, - "require-dev": { - "composer/composer": "*", - "phpcompatibility/php-compatibility": "^9.0", - "sensiolabs/security-checker": "^4.1.0" - }, - "type": "composer-plugin", - "extra": { - "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" + "symfony/console": "^4.4 || ^5.0", + "twig/twig": "^3.3" }, + "bin": [ + "bin/extract-locales", + "bin/licence-headers-check", + "tools/plugin-release" + ], + "type": "library", "autoload": { "psr-4": { - "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Franck Nijhof", - "email": "franck.nijhof@dealerdirect.com", - "homepage": "http://www.frenck.nl", - "role": "Developer / IT Manager" + "Glpi\\": "src/" } - ], - "description": "PHP_CodeSniffer Standards Composer Installer Plugin", - "homepage": "http://www.dealerdirect.com", - "keywords": [ - "PHPCodeSniffer", - "PHP_CodeSniffer", - "code quality", - "codesniffer", - "composer", - "installer", - "phpcs", - "plugin", - "qa", - "quality", - "standard", - "standards", - "style guide", - "stylecheck", - "tests" - ], - "support": { - "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues", - "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer" - }, - "time": "2020-12-07T18:04:37+00:00" - }, - { - "name": "glpi-project/coding-standard", - "version": "0.9.0", - "source": { - "type": "git", - "url": "https://github.com/glpi-project/coding-standard.git", - "reference": "64938598fb7b1796bae0fae41210e562976fb892" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/glpi-project/coding-standard/zipball/64938598fb7b1796bae0fae41210e562976fb892", - "reference": "64938598fb7b1796bae0fae41210e562976fb892", - "shasum": "" }, - "require": { - "slevomat/coding-standard": "^7.0", - "squizlabs/php_codesniffer": "^3.6" - }, - "type": "library", "notification-url": "https://packagist.org/downloads/", "license": [ - "GPL-2.0-or-later" + "GPL-3.0-or-later" ], "authors": [ { "name": "Teclib'", "email": "glpi@teclib.com", - "homepage": "https://teclib.com" + "homepage": "http://teclib-group.com" } ], - "description": "GLPI PHP CodeSniffer Coding Standard", + "description": "Various tools for GLPI and its plugins", "keywords": [ - "codesniffer", "glpi", - "phpcs" + "plugins", + "tools" ], "support": { - "issues": "https://github.com/glpi-project/coding-standard/issues", - "source": "https://github.com/glpi-project/coding-standard" + "issues": "https://github.com/glpi-project/tools/issues", + "source": "https://github.com/glpi-project/tools" }, - "time": "2021-10-07T07:32:59+00:00" + "time": "2022-05-03T09:56:09+00:00" }, { - "name": "glpi-project/tools", - "version": "0.3.1", + "name": "psr/container", + "version": "1.1.2", "source": { "type": "git", - "url": "https://github.com/glpi-project/tools.git", - "reference": "d5f2aaa76e202d001e611aedeb00c9070069304f" + "url": "https://github.com/php-fig/container.git", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/glpi-project/tools/zipball/d5f2aaa76e202d001e611aedeb00c9070069304f", - "reference": "d5f2aaa76e202d001e611aedeb00c9070069304f", + "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", "shasum": "" }, "require": { - "glpi-project/coding-standard": "^0.9", - "symfony/console": "^4.4 || ^5.0" + "php": ">=7.4.0" }, - "bin": [ - "bin/licence-headers-check", - "tools/extract_template.sh", - "tools/plugin-release" - ], "type": "library", "autoload": { "psr-4": { - "Glpi\\": "src/" + "Psr\\Container\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "GPL-3.0-or-later" + "MIT" ], "authors": [ { - "name": "Teclib'", - "email": "glpi@teclib.com", - "homepage": "http://teclib-group.com" + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" } ], - "description": "Various tools for GLPI and its plugins", + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", "keywords": [ - "glpi", - "plugins", - "tools" + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" ], "support": { - "issues": "https://github.com/glpi-project/tools/issues", - "source": "https://github.com/glpi-project/tools" + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/1.1.2" }, - "time": "2021-10-28T13:23:26+00:00" + "time": "2021-11-05T16:50:12+00:00" }, { - "name": "phpstan/phpdoc-parser", - "version": "1.2.0", + "name": "symfony/console", + "version": "v5.4.8", "source": { "type": "git", - "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "dbc093d7af60eff5cd575d2ed761b15ed40bd08e" + "url": "https://github.com/symfony/console.git", + "reference": "ffe3aed36c4d60da2cf1b0a1cee6b8f2e5fa881b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/dbc093d7af60eff5cd575d2ed761b15ed40bd08e", - "reference": "dbc093d7af60eff5cd575d2ed761b15ed40bd08e", + "url": "https://api.github.com/repos/symfony/console/zipball/ffe3aed36c4d60da2cf1b0a1cee6b8f2e5fa881b", + "reference": "ffe3aed36c4d60da2cf1b0a1cee6b8f2e5fa881b", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "^1.9", + "symfony/polyfill-php80": "^1.16", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/string": "^5.1|^6.0" + }, + "conflict": { + "psr/log": ">=3", + "symfony/dependency-injection": "<4.4", + "symfony/dotenv": "<5.1", + "symfony/event-dispatcher": "<4.4", + "symfony/lock": "<4.4", + "symfony/process": "<4.4" + }, + "provide": { + "psr/log-implementation": "1.0|2.0" }, "require-dev": { - "php-parallel-lint/php-parallel-lint": "^1.2", - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^1.0", - "phpstan/phpstan-strict-rules": "^1.0", - "phpunit/phpunit": "^9.5", - "symfony/process": "^5.2" + "psr/log": "^1|^2", + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/event-dispatcher": "^4.4|^5.0|^6.0", + "symfony/lock": "^4.4|^5.0|^6.0", + "symfony/process": "^4.4|^5.0|^6.0", + "symfony/var-dumper": "^4.4|^5.0|^6.0" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" }, + "type": "library", "autoload": { "psr-4": { - "PHPStan\\PhpDocParser\\": [ - "src/" - ] - } + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "PHPDoc parser with support for nullable, intersection and generic types", + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command line", + "console", + "terminal" + ], "support": { - "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.2.0" + "source": "https://github.com/symfony/console/tree/v5.4.8" }, - "time": "2021-09-16T20:46:02+00:00" + "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": "2022-04-12T16:02:29+00:00" }, { - "name": "psr/container", - "version": "1.1.1", + "name": "symfony/deprecation-contracts", + "version": "v2.5.1", "source": { "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf" + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf", - "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66", + "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66", "shasum": "" }, "require": { - "php": ">=7.2.0" + "php": ">=7.1" }, "type": "library", - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" } }, + "autoload": { + "files": [ + "function.php" + ] + }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", "support": { - "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/1.1.1" + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.1" }, - "time": "2021-03-05T17:36:06+00:00" + "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": "2022-01-02T09:53:40+00:00" }, { - "name": "slevomat/coding-standard", - "version": "7.0.16", + "name": "symfony/polyfill-ctype", + "version": "v1.25.0", "source": { "type": "git", - "url": "https://github.com/slevomat/coding-standard.git", - "reference": "14c324b2f2f0072933036c2f3abaeda16a56dcd3" + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "30885182c981ab175d4d034db0f6f469898070ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/14c324b2f2f0072933036c2f3abaeda16a56dcd3", - "reference": "14c324b2f2f0072933036c2f3abaeda16a56dcd3", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab", + "reference": "30885182c981ab175d4d034db0f6f469898070ab", "shasum": "" }, "require": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7", - "php": "^7.1 || ^8.0", - "phpstan/phpdoc-parser": "^1.0.0", - "squizlabs/php_codesniffer": "^3.6.1" + "php": ">=7.1" }, - "require-dev": { - "phing/phing": "2.17.0", - "php-parallel-lint/php-parallel-lint": "1.3.1", - "phpstan/phpstan": "0.12.99", - "phpstan/phpstan-deprecation-rules": "0.12.6", - "phpstan/phpstan-phpunit": "0.12.22", - "phpstan/phpstan-strict-rules": "0.12.11", - "phpunit/phpunit": "7.5.20|8.5.5|9.5.10" - }, - "type": "phpcodesniffer-standard", + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", "extra": { "branch-alias": { - "dev-master": "7.x-dev" + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { + "files": [ + "bootstrap.php" + ], "psr-4": { - "SlevomatCodingStandard\\": "SlevomatCodingStandard" + "Symfony\\Polyfill\\Ctype\\": "" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.", + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], "support": { - "issues": "https://github.com/slevomat/coding-standard/issues", - "source": "https://github.com/slevomat/coding-standard/tree/7.0.16" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.25.0" }, "funding": [ { - "url": "https://github.com/kukulich", + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", "type": "github" }, { - "url": "https://tidelift.com/funding/github/packagist/slevomat/coding-standard", + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2021-10-22T06:56:51+00:00" + "time": "2021-10-20T20:35:02+00:00" }, { - "name": "squizlabs/php_codesniffer", - "version": "3.6.1", + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.25.0", "source": { "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "f268ca40d54617c6e06757f83f699775c9b3ff2e" + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "81b86b50cf841a64252b439e738e97f4a34e2783" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/f268ca40d54617c6e06757f83f699775c9b3ff2e", - "reference": "f268ca40d54617c6e06757f83f699775c9b3ff2e", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/81b86b50cf841a64252b439e738e97f4a34e2783", + "reference": "81b86b50cf841a64252b439e738e97f4a34e2783", "shasum": "" }, "require": { - "ext-simplexml": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": ">=5.4.0" + "php": ">=7.1" }, - "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + "suggest": { + "ext-intl": "For best performance" }, - "bin": [ - "bin/phpcs", - "bin/phpcbf" - ], "type": "library", "extra": { "branch-alias": { - "dev-master": "3.x-dev" + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Greg Sherwood", - "role": "lead" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", "keywords": [ - "phpcs", - "standards" + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" ], "support": { - "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", - "source": "https://github.com/squizlabs/PHP_CodeSniffer", - "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.25.0" }, - "time": "2021-10-11T04:00:11+00:00" + "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": "2021-11-23T21:10:46+00:00" }, { - "name": "symfony/console", - "version": "v4.4.33", + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.25.0", "source": { "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "8dbd23ef7a8884051482183ddee8d9061b5feed0" + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/8dbd23ef7a8884051482183ddee8d9061b5feed0", - "reference": "8dbd23ef7a8884051482183ddee8d9061b5feed0", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8", + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8", "shasum": "" }, "require": { - "php": ">=7.1.3", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.8", - "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.1|^2" - }, - "conflict": { - "psr/log": ">=3", - "symfony/dependency-injection": "<3.4", - "symfony/event-dispatcher": "<4.3|>=5", - "symfony/lock": "<4.4", - "symfony/process": "<3.3" - }, - "provide": { - "psr/log-implementation": "1.0|2.0" - }, - "require-dev": { - "psr/log": "^1|^2", - "symfony/config": "^3.4|^4.0|^5.0", - "symfony/dependency-injection": "^3.4|^4.0|^5.0", - "symfony/event-dispatcher": "^4.3", - "symfony/lock": "^4.4|^5.0", - "symfony/process": "^3.4|^4.0|^5.0", - "symfony/var-dumper": "^4.3|^5.0" + "php": ">=7.1" }, "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" + "ext-intl": "For best performance" }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, "autoload": { + "files": [ + "bootstrap.php" + ], "psr-4": { - "Symfony\\Component\\Console\\": "" + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" }, - "exclude-from-classmap": [ - "/Tests/" + "classmap": [ + "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", @@ -930,18 +967,26 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Eases the creation of beautiful and testable command line interfaces", + "description": "Symfony polyfill for intl's Normalizer class and related functions", "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], "support": { - "source": "https://github.com/symfony/console/tree/v4.4.33" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.25.0" }, "funding": [ { @@ -957,25 +1002,28 @@ "type": "tidelift" } ], - "time": "2021-10-25T16:36:08+00:00" + "time": "2021-02-19T12:13:01+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.23.1", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6" + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6", - "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825", + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825", "shasum": "" }, "require": { "php": ">=7.1" }, + "provide": { + "ext-mbstring": "*" + }, "suggest": { "ext-mbstring": "For best performance" }, @@ -990,12 +1038,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1021,7 +1069,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.25.0" }, "funding": [ { @@ -1037,20 +1085,20 @@ "type": "tidelift" } ], - "time": "2021-05-27T12:26:48+00:00" + "time": "2021-11-30T18:21:41+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.23.0", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010" + "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fba8933c384d6476ab14fb7b8526e5287ca7e010", - "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/cc5db0e22b3cb4111010e48785a97f670b350ca5", + "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5", "shasum": "" }, "require": { @@ -1067,12 +1115,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" - }, "files": [ "bootstrap.php" ], + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, "classmap": [ "Resources/stubs" ] @@ -1100,7 +1148,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.25.0" }, "funding": [ { @@ -1116,20 +1164,20 @@ "type": "tidelift" } ], - "time": "2021-02-19T12:13:01+00:00" + "time": "2021-06-05T21:20:04+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.23.1", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be" + "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be", - "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/4407588e0d3f1f52efb65fbe92babe41f37fe50c", + "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c", "shasum": "" }, "require": { @@ -1146,12 +1194,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, "files": [ "bootstrap.php" ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, "classmap": [ "Resources/stubs" ] @@ -1183,7 +1231,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.25.0" }, "funding": [ { @@ -1199,25 +1247,29 @@ "type": "tidelift" } ], - "time": "2021-07-28T13:41:28+00:00" + "time": "2022-03-04T08:16:47+00:00" }, { "name": "symfony/service-contracts", - "version": "v1.1.9", + "version": "v2.5.1", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "b776d18b303a39f56c63747bcb977ad4b27aca26" + "reference": "24d9dc654b83e91aa59f9d167b131bc3b5bea24c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/b776d18b303a39f56c63747bcb977ad4b27aca26", - "reference": "b776d18b303a39f56c63747bcb977ad4b27aca26", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/24d9dc654b83e91aa59f9d167b131bc3b5bea24c", + "reference": "24d9dc654b83e91aa59f9d167b131bc3b5bea24c", "shasum": "" }, "require": { - "php": ">=7.1.3", - "psr/container": "^1.0" + "php": ">=7.2.5", + "psr/container": "^1.1", + "symfony/deprecation-contracts": "^2.1|^3" + }, + "conflict": { + "ext-psr": "<1.1|>=2" }, "suggest": { "symfony/service-implementation": "" @@ -1225,7 +1277,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-main": "2.5-dev" }, "thanks": { "name": "symfony/contracts", @@ -1262,7 +1314,93 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v1.1.9" + "source": "https://github.com/symfony/service-contracts/tree/v2.5.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": "2022-03-13T20:07:29+00:00" + }, + { + "name": "symfony/string", + "version": "v5.4.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "3c061a76bff6d6ea427d85e12ad1bb8ed8cd43e8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/3c061a76bff6d6ea427d85e12ad1bb8ed8cd43e8", + "reference": "3c061a76bff6d6ea427d85e12ad1bb8ed8cd43e8", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php80": "~1.15" + }, + "conflict": { + "symfony/translation-contracts": ">=3.0" + }, + "require-dev": { + "symfony/error-handler": "^4.4|^5.0|^6.0", + "symfony/http-client": "^4.4|^5.0|^6.0", + "symfony/translation-contracts": "^1.1|^2", + "symfony/var-exporter": "^4.4|^5.0|^6.0" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "source": "https://github.com/symfony/string/tree/v5.4.8" }, "funding": [ { @@ -1278,7 +1416,83 @@ "type": "tidelift" } ], - "time": "2020-07-06T13:19:58+00:00" + "time": "2022-04-19T10:40:37+00:00" + }, + { + "name": "twig/twig", + "version": "v3.4.1", + "source": { + "type": "git", + "url": "https://github.com/twigphp/Twig.git", + "reference": "e939eae92386b69b49cfa4599dd9bead6bf4a342" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/e939eae92386b69b49cfa4599dd9bead6bf4a342", + "reference": "e939eae92386b69b49cfa4599dd9bead6bf4a342", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-ctype": "^1.8", + "symfony/polyfill-mbstring": "^1.3" + }, + "require-dev": { + "psr/container": "^1.0", + "symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Twig\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Twig Team", + "role": "Contributors" + }, + { + "name": "Armin Ronacher", + "email": "armin.ronacher@active-4.com", + "role": "Project Founder" + } + ], + "description": "Twig, the flexible, fast, and secure template language for PHP", + "homepage": "https://twig.symfony.com", + "keywords": [ + "templating" + ], + "support": { + "issues": "https://github.com/twigphp/Twig/issues", + "source": "https://github.com/twigphp/Twig/tree/v3.4.1" + }, + "funding": [ + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/twig/twig", + "type": "tidelift" + } + ], + "time": "2022-05-17T05:48:52+00:00" } ], "aliases": [], @@ -1287,11 +1501,11 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^7.2" + "php": ">=7.4" }, "platform-dev": [], "platform-overrides": { - "php": "7.2.0" + "php": "7.4.0" }, - "plugin-api-version": "2.1.0" + "plugin-api-version": "2.3.0" } diff --git a/hook.php b/hook.php index 273c051..2170550 100644 --- a/hook.php +++ b/hook.php @@ -82,16 +82,19 @@ function plugin_barcode_install() { $migration = new Migration(PLUGIN_BARCODE_VERSION); + $default_charset = DBConnection::getDefaultCharset(); + $default_collation = DBConnection::getDefaultCollation(); + if (!file_exists(GLPI_PLUGIN_DOC_DIR."/barcode")) { mkdir(GLPI_PLUGIN_DOC_DIR."/barcode"); } $migration->renameTable("glpi_plugin_barcode_config", "glpi_plugin_barcode_configs"); if (!$DB->tableExists("glpi_plugin_barcode_configs")) { $query = "CREATE TABLE `glpi_plugin_barcode_configs` ( - `id` int(11) NOT NULL auto_increment, - `type` varchar(20) collate utf8_unicode_ci default NULL, + `id` int NOT NULL auto_increment, + `type` varchar(20) default NULL, PRIMARY KEY (`ID`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; + ) ENGINE=InnoDB DEFAULT CHARSET={$default_charset} COLLATE={$default_collation} ROW_FORMAT=DYNAMIC;"; $DB->query($query) or die("error creating glpi_plugin_barcode_configs ". $DB->error()); $query = "INSERT INTO `glpi_plugin_barcode_configs` @@ -104,23 +107,23 @@ function plugin_barcode_install() { $migration->renameTable("glpi_plugin_barcode_config_type", "glpi_plugin_barcode_configs_types"); if (!$DB->tableExists("glpi_plugin_barcode_configs_types")) { $query = "CREATE TABLE `glpi_plugin_barcode_configs_types` ( - `id` int(11) NOT NULL auto_increment, - `type` varchar(20) collate utf8_unicode_ci default NULL, - `size` varchar(20) collate utf8_unicode_ci default NULL, - `orientation` varchar(9) collate utf8_unicode_ci default NULL, - `marginTop` int(11) NULL, - `marginBottom` int(11) NULL, - `marginLeft` int(11) NULL, - `marginRight` int(11) NULL, - `marginHorizontal` int(11) NULL, - `marginVertical` int(11) NULL, - `maxCodeWidth` int(11) NULL, - `maxCodeHeight` int(11) NULL, - `txtSize` int(11) NULL, - `txtSpacing` int(11) NULL, + `id` int NOT NULL auto_increment, + `type` varchar(20) default NULL, + `size` varchar(20) default NULL, + `orientation` varchar(9) default NULL, + `marginTop` int NULL, + `marginBottom` int NULL, + `marginLeft` int NULL, + `marginRight` int NULL, + `marginHorizontal` int NULL, + `marginVertical` int NULL, + `maxCodeWidth` int NULL, + `maxCodeHeight` int NULL, + `txtSize` int NULL, + `txtSpacing` int NULL, PRIMARY KEY (`ID`), UNIQUE (`type`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;"; + ) ENGINE=InnoDB DEFAULT CHARSET={$default_charset} COLLATE={$default_collation} ROW_FORMAT=DYNAMIC;"; $DB->query($query) or die("error creating glpi_plugin_barcode_configs_types ". $DB->error()); $query = "INSERT INTO `glpi_plugin_barcode_configs_types` diff --git a/inc/barcode.class.php b/inc/barcode.class.php index 216d5b7..c599578 100644 --- a/inc/barcode.class.php +++ b/inc/barcode.class.php @@ -434,13 +434,12 @@ function printPDF($p_params) { function create($p_code, $p_type, $p_ext) { //TODO : filtre sur le type if (!file_exists($this->docsPath.$p_code.'_'.$p_type.'.'.$p_ext)) { - plugin_barcode_disableDebug(); ob_start(); $barcode = new Image_Barcode(); - $resImg = imagepng($barcode->draw($p_code, $p_type, $p_ext, false)); - $img = ob_get_contents(); - ob_end_clean(); - plugin_barcode_reenableusemode(); + $resImg = @imagepng( + @$barcode->draw($p_code, $p_type, $p_ext, false) + ); + $img = ob_get_clean(); file_put_contents($this->docsPath.$p_code.'_'.$p_type.'.'.$p_ext, $img); if (!$resImg) { return false; diff --git a/inc/config.class.php b/inc/config.class.php index 69a3818..75097b3 100644 --- a/inc/config.class.php +++ b/inc/config.class.php @@ -53,7 +53,7 @@ function __construct() { - function showForm($p_type = null) { + function showForm($ID, array $options = []) { global $CFG_GLPI; $pbBarcode = new PluginBarcodeBarcode(); diff --git a/inc/functions_debug.php b/inc/functions_debug.php deleted file mode 100644 index 3455463..0000000 --- a/inc/functions_debug.php +++ /dev/null @@ -1,56 +0,0 @@ -. - - ------------------------------------------------------------------------ - - @package Plugin Barcode - @author David Durieux - @co-author - @copyright Copyright (c) 2009-2016 Barcode plugin Development team - @license AGPL License 3.0 or (at your option) any later version - http://www.gnu.org/licenses/agpl-3.0-standalone.html - @link https://forge.indepnet.net/projects/barscode - @since 2009 - - ------------------------------------------------------------------------ - */ - -function plugin_barcode_disableDebug() { - error_reporting(0); - set_error_handler("plugin_barcode_empty"); -} - -function plugin_barcode_reenableusemode() { - if ($_SESSION['glpi_use_mode'] == Session::DEBUG_MODE) { - ini_set('display_errors', 'On'); - error_reporting(E_ALL | E_STRICT); - set_error_handler("userErrorHandler"); - } -} - -function plugin_barcode_empty() {} - diff --git a/inc/profile.class.php b/inc/profile.class.php index 55563e3..54a707d 100644 --- a/inc/profile.class.php +++ b/inc/profile.class.php @@ -69,27 +69,25 @@ static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtem * * @return nothing **/ - function showForm($profiles_id = 0, $openform = true, $closeform = true) { + function showForm($ID, array $options = []) { echo "
"; - if (($canedit = Session::haveRightsOr(self::$rightname, [CREATE, UPDATE, PURGE])) - && $openform) { + if (($canedit = Session::haveRightsOr(self::$rightname, [CREATE, UPDATE, PURGE]))) { $profile = new Profile(); echo "
"; } $profile = new Profile(); - $profile->getFromDB($profiles_id); + $profile->getFromDB($ID); $rights = $this->getAllRights(); $profile->displayRightsChoiceMatrix($rights, ['canedit' => $canedit, 'default_class' => 'tab_bg_2', 'title' => __('Barcode', 'barcode') ]); - if ($canedit - && $closeform) { + if ($canedit) { echo "
"; - echo Html::hidden('id', ['value' => $profiles_id]); + echo Html::hidden('id', ['value' => $ID]); echo Html::submit(_sx('button', 'Save'), ['name' => 'update']); echo "
\n"; Html::closeForm(); diff --git a/setup.php b/setup.php index 0bbd818..512a9e2 100644 --- a/setup.php +++ b/setup.php @@ -42,9 +42,9 @@ define ("PLUGIN_BARCODE_VERSION", "2.6.2"); // Minimal GLPI version, inclusive -define('PLUGIN_BARCODE_MIN_GLPI', '9.5'); +define('PLUGIN_BARCODE_MIN_GLPI', '10.0.0'); // Maximum GLPI version, exclusive -define('PLUGIN_BARCODE_MAX_GLPI', '9.6'); +define('PLUGIN_BARCODE_MAX_GLPI', '10.0.99'); // Init the hooks of the plugins -Needed function plugin_init_barcode() { From a35c60e21c1d9859e5d1a5c44d824308974fe4d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Anne?= Date: Fri, 10 Dec 2021 13:49:25 +0100 Subject: [PATCH 2/5] Fix files mode --- AUTHORS.txt | 0 front/config.php | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 AUTHORS.txt mode change 100755 => 100644 front/config.php diff --git a/AUTHORS.txt b/AUTHORS.txt old mode 100755 new mode 100644 diff --git a/front/config.php b/front/config.php old mode 100755 new mode 100644 From da1423bdf99f390819ce9427407fa089bb8fb1ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Anne?= Date: Wed, 20 Apr 2022 13:12:16 +0200 Subject: [PATCH 3/5] Allow patch plugin in composer.json --- composer.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 93d2755..e2f06b8 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,10 @@ "platform": { "php": "7.4.0" }, - "sort-packages": true + "sort-packages": true, + "allow-plugins": { + "cweagans/composer-patches": true + } }, "repositories": [ { From c1ddec5fbf117b7244bb7196dc25d6559ddbcbb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Anne?= Date: Tue, 17 May 2022 11:47:05 +0200 Subject: [PATCH 4/5] Remove obsolete table name declaration; fixes PHP 8.2 warning --- inc/config.class.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/inc/config.class.php b/inc/config.class.php index 75097b3..2996bf1 100644 --- a/inc/config.class.php +++ b/inc/config.class.php @@ -47,12 +47,6 @@ class PluginBarcodeConfig extends CommonDBTM { static $rightname = 'plugin_barcode_config'; - function __construct() { - $this->table = "glpi_plugin_barcode_config"; - } - - - function showForm($ID, array $options = []) { global $CFG_GLPI; From 1d5c9b28aa04e26fcfe64012417a84ddce39f370 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Anne?= Date: Tue, 17 May 2022 12:08:30 +0200 Subject: [PATCH 5/5] Fix PHP 7.x / 8.x compatibility --- composer.json | 2 +- patch/fix-pear-image-barcode.patch | 135 ++++++++++++++++++++++++++++- 2 files changed, 135 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index e2f06b8..5c3c436 100644 --- a/composer.json +++ b/composer.json @@ -62,7 +62,7 @@ "extra": { "patches": { "pear/image_barcode": { - "Fix error due to assignation as reference from new operation": "./patch/fix-pear-image-barcode.patch" + "Fix PHP 7.x / 8.x compatibility": "./patch/fix-pear-image-barcode.patch" } } } diff --git a/patch/fix-pear-image-barcode.patch b/patch/fix-pear-image-barcode.patch index 6e7212f..fd6df96 100644 --- a/patch/fix-pear-image-barcode.patch +++ b/patch/fix-pear-image-barcode.patch @@ -9,4 +9,137 @@ if (isset($obj->_barcodeheight)) $obj->_barcodeheight = $height; if (isset($obj->_barwidth)) $obj->_barwidth = $barwidth; - +--- Image/Barcode/code128.php ++++ Image/Barcode/code128.php +@@ -42,9 +42,7 @@ + * @link http://pear.php.net/package/Image_Barcode + */ + +-require_once "Image/Barcode.php"; +- +-class Image_Barcode_code128 extends Image_Barcode ++class Image_Barcode_code128 + { + var $_type = 'code128'; + var $_barcodeheight = 60; +--- Image/Barcode/Code39.php ++++ Image/Barcode/Code39.php +@@ -25,8 +25,6 @@ + */ + + +-require_once "Image/Barcode.php"; +- + + if (!function_exists('str_split')) { + require_once 'PHP/Compat.php'; +@@ -47,7 +45,7 @@ + * @link http://pear.php.net/package/Image_Barcode + * @since Image_Barcode 0.5 + */ +-class Image_Barcode_Code39 extends Image_Barcode ++class Image_Barcode_Code39 + { + /** + * Barcode type +--- Image/Barcode/ean13.php ++++ Image/Barcode/ean13.php +@@ -23,8 +23,6 @@ + * @link http://pear.php.net/package/Image_Barcode + */ + +-require_once 'Image/Barcode.php'; +- + /** + * Image_Barcode_ean13 class + * +@@ -39,7 +37,7 @@ + * @link http://pear.php.net/package/Image_Barcode + * @since Image_Barcode 0.4 + */ +-class Image_Barcode_ean13 extends Image_Barcode ++class Image_Barcode_ean13 + { + /** + * Barcode type +--- Image/Barcode/ean8.php ++++ Image/Barcode/ean8.php +@@ -24,8 +24,6 @@ + * @link http://pear.php.net/package/Image_Barcode + */ + +-require_once 'Image/Barcode.php'; +- + /** + * Image_Barcode_ean8 class + * +@@ -40,7 +28,7 @@ + * @version Release: @package_version@ + * @link http://pear.php.net/package/Image_Barcode + */ +-class Image_Barcode_ean8 extends Image_Barcode ++class Image_Barcode_ean8 + { + /** + * Barcode type +--- Image/Barcode/int25.php ++++ Image/Barcode/int25.php +@@ -23,9 +23,6 @@ + * @link http://pear.php.net/package/Image_Barcode + */ + +-require_once "PEAR.php"; +-require_once "Image/Barcode.php"; +- + + /** + * Image_Barcode_int25 class +@@ -40,7 +37,7 @@ + * @version Release: @package_version@ + * @link http://pear.php.net/package/Image_Barcode + */ +-class Image_Barcode_int25 extends Image_Barcode ++class Image_Barcode_int25 + { + /** + * Barcode type +--- Image/Barcode/postnet.php ++++ Image/Barcode/postnet.php +@@ -36,8 +36,6 @@ + * density: 22 bars/inch = 8.66 bars/cm + */ + +-require_once 'Image/Barcode.php'; +- + + /** + * Image_Barcode_postnet class +@@ -52,7 +50,7 @@ + * @version CVS: $Id$ + * @link http://pear.php.net/package/Image_Barcode + */ +-class Image_Barcode_postnet extends Image_Barcode ++class Image_Barcode_postnet + { + /** + * Barcode type +--- Image/Barcode/upca.php ++++ Image/Barcode/upca.php +@@ -24,8 +24,6 @@ + * @link http://pear.php.net/package/Image_Barcode + */ + +-require_once 'Image/Barcode.php'; +- + /** + * Image_Barcode_upca class + * +@@ -47,7 +45,7 @@ + * @version Release: @package_version@ + * @link http://pear.php.net/package/Image_Barcode + */ +-class Image_Barcode_upca extends Image_Barcode ++class Image_Barcode_upca + { + /** + * Barcode type