diff --git a/.github/workflows/autoloader.yml b/.github/workflows/autoloader.yml deleted file mode 100644 index 1a38b444ee..0000000000 --- a/.github/workflows/autoloader.yml +++ /dev/null @@ -1,43 +0,0 @@ -# SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors -# SPDX-License-Identifier: MIT -name: Autoload checker - -on: - pull_request: - push: - branches: - - main - - master - - stable* - -permissions: - contents: read - -jobs: - build: - runs-on: ubuntu-latest - - name: autoloader - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up php - uses: shivammathur/setup-php@v2 - with: - php-version: 8.1 - tools: composer - - - name: Set up PHPUnit - working-directory: composer - run: composer install && composer dump-autoload - - - name: Check difference to committed files - run: | - bash -c "[[ ! \"`git status --porcelain -- . ':!composer/composer/installed.php'`\" ]] || exit 1" - - - name: Show changes on failure - if: failure() - run: | - git status - git --no-pager diff diff --git a/.github/workflows/cypress-e2e.yml b/.github/workflows/cypress-e2e.yml index 38b38ac29b..8d582e730d 100644 --- a/.github/workflows/cypress-e2e.yml +++ b/.github/workflows/cypress-e2e.yml @@ -101,6 +101,11 @@ jobs: apc.enable_cli=on coverage: none + - name: Install composer dependencies + working-directory: apps/richdocuments + run: | + composer install + - name: Set up Nextcloud env: DB_PORT: 4444 diff --git a/composer.json b/composer.json index 7da3c52596..5a289b8357 100644 --- a/composer.json +++ b/composer.json @@ -6,11 +6,17 @@ "config": { "platform": { "php": "8.0" - } + }, + "allow-plugins": { + "bamarni/composer-bin-plugin": true + }, + "optimize-autoloader": true, + "autoloader-suffix": "Richdocuments" }, "require": { "ext-json": "*", - "ext-simplexml": "*" + "ext-simplexml": "*", + "mikehaertl/php-pdftk": "^0.13.1" }, "require-dev": { "roave/security-advisories": "dev-master", @@ -37,6 +43,11 @@ "cs:fix": "php-cs-fixer fix", "test:unit": "vendor/bin/phpunit -c tests/phpunit.xml" }, + "autoload" : { + "psr-4": { + "OCA\\Richdocuments\\": "./lib/" + } + }, "autoload-dev": { "psr-4": { "OCP\\": "vendor/nextcloud/ocp/OCP" diff --git a/composer.lock b/composer.lock index 906ee3914c..dd13432c09 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,148 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "617fdc6d05ba46bae40251a9bf668377", - "packages": [], + "content-hash": "b9e535f306965994d4f4027f6a38ab0b", + "packages": [ + { + "name": "mikehaertl/php-pdftk", + "version": "0.13.1", + "source": { + "type": "git", + "url": "https://github.com/mikehaertl/php-pdftk.git", + "reference": "3851b08c1027489e48387d7c14c27bc295d98239" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mikehaertl/php-pdftk/zipball/3851b08c1027489e48387d7c14c27bc295d98239", + "reference": "3851b08c1027489e48387d7c14c27bc295d98239", + "shasum": "" + }, + "require": { + "mikehaertl/php-shellcommand": "^1.6.3", + "mikehaertl/php-tmpfile": "^1.1.0", + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": ">4.0 <9.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "mikehaertl\\pdftk\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Haertl", + "email": "haertl.mike@gmail.com" + } + ], + "description": "A PDF conversion and form utility based on pdftk.", + "keywords": [ + "pdf", + "pdftk" + ], + "support": { + "issues": "https://github.com/mikehaertl/php-pdftk/issues", + "source": "https://github.com/mikehaertl/php-pdftk/tree/0.13.1" + }, + "time": "2023-11-03T16:06:08+00:00" + }, + { + "name": "mikehaertl/php-shellcommand", + "version": "1.7.0", + "source": { + "type": "git", + "url": "https://github.com/mikehaertl/php-shellcommand.git", + "reference": "e79ea528be155ffdec6f3bf1a4a46307bb49e545" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mikehaertl/php-shellcommand/zipball/e79ea528be155ffdec6f3bf1a4a46307bb49e545", + "reference": "e79ea528be155ffdec6f3bf1a4a46307bb49e545", + "shasum": "" + }, + "require": { + "php": ">= 5.3.0" + }, + "require-dev": { + "phpunit/phpunit": ">4.0 <=9.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "mikehaertl\\shellcommand\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Härtl", + "email": "haertl.mike@gmail.com" + } + ], + "description": "An object oriented interface to shell commands", + "keywords": [ + "shell" + ], + "support": { + "issues": "https://github.com/mikehaertl/php-shellcommand/issues", + "source": "https://github.com/mikehaertl/php-shellcommand/tree/1.7.0" + }, + "time": "2023-04-19T08:25:22+00:00" + }, + { + "name": "mikehaertl/php-tmpfile", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/mikehaertl/php-tmpfile.git", + "reference": "a5392bed91f67e2849a7cb24075d346468e1b1a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mikehaertl/php-tmpfile/zipball/a5392bed91f67e2849a7cb24075d346468e1b1a8", + "reference": "a5392bed91f67e2849a7cb24075d346468e1b1a8", + "shasum": "" + }, + "require-dev": { + "php": ">=5.3.0", + "phpunit/phpunit": ">4.0 <=9.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "mikehaertl\\tmp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Härtl", + "email": "haertl.mike@gmail.com" + } + ], + "description": "A convenience class for temporary files", + "keywords": [ + "files" + ], + "support": { + "issues": "https://github.com/mikehaertl/php-tmpfile/issues", + "source": "https://github.com/mikehaertl/php-tmpfile/tree/1.3.0" + }, + "time": "2024-10-14T16:12:48+00:00" + } + ], "packages-dev": [ { "name": "doctrine/instantiator", @@ -130,18 +270,64 @@ "abandoned": "php-parallel-lint/php-parallel-lint", "time": "2018-02-24T15:31:20+00:00" }, + { + "name": "kubawerlos/php-cs-fixer-custom-fixers", + "version": "v3.22.0", + "source": { + "type": "git", + "url": "https://github.com/kubawerlos/php-cs-fixer-custom-fixers.git", + "reference": "8701394f0c7cd450ac4fa577d24589122c1d5d5e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kubawerlos/php-cs-fixer-custom-fixers/zipball/8701394f0c7cd450ac4fa577d24589122c1d5d5e", + "reference": "8701394f0c7cd450ac4fa577d24589122c1d5d5e", + "shasum": "" + }, + "require": { + "ext-filter": "*", + "ext-tokenizer": "*", + "friendsofphp/php-cs-fixer": "^3.61.1", + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.6.4 || ^10.5.29" + }, + "type": "library", + "autoload": { + "psr-4": { + "PhpCsFixerCustomFixers\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kuba Werłos", + "email": "werlos@gmail.com" + } + ], + "description": "A set of custom fixers for PHP CS Fixer", + "support": { + "issues": "https://github.com/kubawerlos/php-cs-fixer-custom-fixers/issues", + "source": "https://github.com/kubawerlos/php-cs-fixer-custom-fixers/tree/v3.22.0" + }, + "time": "2024-08-16T20:44:35+00:00" + }, { "name": "myclabs/deep-copy", - "version": "1.12.0", + "version": "1.12.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c" + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", - "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/123267b2c49fbf30d78a7b2d333f6be754b94845", + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845", "shasum": "" }, "require": { @@ -180,7 +366,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.12.0" + "source": "https://github.com/myclabs/DeepCopy/tree/1.12.1" }, "funding": [ { @@ -188,23 +374,24 @@ "type": "tidelift" } ], - "time": "2024-06-12T14:39:25+00:00" + "time": "2024-11-08T17:47:46+00:00" }, { "name": "nextcloud/coding-standard", - "version": "v1.2.3", + "version": "v1.3.2", "source": { "type": "git", "url": "https://github.com/nextcloud/coding-standard.git", - "reference": "bc9c53a5306114b60c4363057aff9c2ed10a54da" + "reference": "9c719c4747fa26efc12f2e8b21c14a9a75c6ba6d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nextcloud/coding-standard/zipball/bc9c53a5306114b60c4363057aff9c2ed10a54da", - "reference": "bc9c53a5306114b60c4363057aff9c2ed10a54da", + "url": "https://api.github.com/repos/nextcloud/coding-standard/zipball/9c719c4747fa26efc12f2e8b21c14a9a75c6ba6d", + "reference": "9c719c4747fa26efc12f2e8b21c14a9a75c6ba6d", "shasum": "" }, "require": { + "kubawerlos/php-cs-fixer-custom-fixers": "^3.22", "php": "^7.3|^8.0", "php-cs-fixer/shim": "^3.17" }, @@ -227,9 +414,9 @@ "description": "Nextcloud coding standards for the php cs fixer", "support": { "issues": "https://github.com/nextcloud/coding-standard/issues", - "source": "https://github.com/nextcloud/coding-standard/tree/v1.2.3" + "source": "https://github.com/nextcloud/coding-standard/tree/v1.3.2" }, - "time": "2024-08-23T14:32:32+00:00" + "time": "2024-10-14T16:49:05+00:00" }, { "name": "nextcloud/ocp", @@ -237,12 +424,12 @@ "source": { "type": "git", "url": "https://github.com/nextcloud-deps/ocp.git", - "reference": "0f06163c4a82b06738270801308b45034062ee6e" + "reference": "850819a2bd061dca3c6a839d44bb6f22f188febc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nextcloud-deps/ocp/zipball/0f06163c4a82b06738270801308b45034062ee6e", - "reference": "0f06163c4a82b06738270801308b45034062ee6e", + "url": "https://api.github.com/repos/nextcloud-deps/ocp/zipball/850819a2bd061dca3c6a839d44bb6f22f188febc", + "reference": "850819a2bd061dca3c6a839d44bb6f22f188febc", "shasum": "" }, "require": { @@ -273,20 +460,20 @@ "issues": "https://github.com/nextcloud-deps/ocp/issues", "source": "https://github.com/nextcloud-deps/ocp/tree/stable30" }, - "time": "2025-01-21T00:42:15+00:00" + "time": "2025-01-27T08:38:56+00:00" }, { "name": "nikic/php-parser", - "version": "v5.1.0", + "version": "v5.4.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "683130c2ff8c2739f4822ff7ac5c873ec529abd1" + "reference": "447a020a1f875a434d62f2a401f53b82a396e494" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/683130c2ff8c2739f4822ff7ac5c873ec529abd1", - "reference": "683130c2ff8c2739f4822ff7ac5c873ec529abd1", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/447a020a1f875a434d62f2a401f53b82a396e494", + "reference": "447a020a1f875a434d62f2a401f53b82a396e494", "shasum": "" }, "require": { @@ -329,9 +516,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.1.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.4.0" }, - "time": "2024-07-01T20:03:41+00:00" + "time": "2024-12-30T11:07:19+00:00" }, { "name": "phar-io/manifest", @@ -453,16 +640,16 @@ }, { "name": "php-cs-fixer/shim", - "version": "v3.63.2", + "version": "v3.68.5", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/shim.git", - "reference": "f22bf5df6093c915b6fd0879637cc9b9a27eff36" + "reference": "4a0a5cfd39b0677017a85f0fc252d3e8a6a6c02c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/shim/zipball/f22bf5df6093c915b6fd0879637cc9b9a27eff36", - "reference": "f22bf5df6093c915b6fd0879637cc9b9a27eff36", + "url": "https://api.github.com/repos/PHP-CS-Fixer/shim/zipball/4a0a5cfd39b0677017a85f0fc252d3e8a6a6c02c", + "reference": "4a0a5cfd39b0677017a85f0fc252d3e8a6a6c02c", "shasum": "" }, "require": { @@ -499,9 +686,9 @@ "description": "A tool to automatically fix PHP code style", "support": { "issues": "https://github.com/PHP-CS-Fixer/shim/issues", - "source": "https://github.com/PHP-CS-Fixer/shim/tree/v3.63.2" + "source": "https://github.com/PHP-CS-Fixer/shim/tree/v3.68.5" }, - "time": "2024-08-28T10:48:27+00:00" + "time": "2025-01-30T17:01:41+00:00" }, { "name": "phpunit/php-code-coverage", @@ -824,16 +1011,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.20", + "version": "9.6.22", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "49d7820565836236411f5dc002d16dd689cde42f" + "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/49d7820565836236411f5dc002d16dd689cde42f", - "reference": "49d7820565836236411f5dc002d16dd689cde42f", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f80235cb4d3caa59ae09be3adf1ded27521d1a9c", + "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c", "shasum": "" }, "require": { @@ -844,11 +1031,11 @@ "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.12.0", + "myclabs/deep-copy": "^1.12.1", "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", "php": ">=7.3", - "phpunit/php-code-coverage": "^9.2.31", + "phpunit/php-code-coverage": "^9.2.32", "phpunit/php-file-iterator": "^3.0.6", "phpunit/php-invoker": "^3.1.1", "phpunit/php-text-template": "^2.0.4", @@ -907,7 +1094,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.20" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.22" }, "funding": [ { @@ -923,20 +1110,20 @@ "type": "tidelift" } ], - "time": "2024-07-10T11:45:39+00:00" + "time": "2024-12-05T13:48:26+00:00" }, { "name": "psalm/phar", - "version": "5.25.0", + "version": "5.26.1", "source": { "type": "git", "url": "https://github.com/psalm/phar.git", - "reference": "d42708449bd2d99ec6509924332fd94263974b20" + "reference": "8a38e7ad04499a0ccd2c506fd1da6fc01fff4547" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/psalm/phar/zipball/d42708449bd2d99ec6509924332fd94263974b20", - "reference": "d42708449bd2d99ec6509924332fd94263974b20", + "url": "https://api.github.com/repos/psalm/phar/zipball/8a38e7ad04499a0ccd2c506fd1da6fc01fff4547", + "reference": "8a38e7ad04499a0ccd2c506fd1da6fc01fff4547", "shasum": "" }, "require": { @@ -956,9 +1143,9 @@ "description": "Composer-based Psalm Phar", "support": { "issues": "https://github.com/psalm/phar/issues", - "source": "https://github.com/psalm/phar/tree/5.25.0" + "source": "https://github.com/psalm/phar/tree/5.26.1" }, - "time": "2024-06-19T20:02:02+00:00" + "time": "2024-09-09T16:22:43+00:00" }, { "name": "psr/clock", @@ -1167,23 +1354,23 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "f6f9a938afd75c2344952b0566983700829c7440" + "reference": "4245b3fe2b3efed28fc094928cfe3ae625f18243" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/f6f9a938afd75c2344952b0566983700829c7440", - "reference": "f6f9a938afd75c2344952b0566983700829c7440", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/4245b3fe2b3efed28fc094928cfe3ae625f18243", + "reference": "4245b3fe2b3efed28fc094928cfe3ae625f18243", "shasum": "" }, "conflict": { "3f/pygmentize": "<1.2", - "admidio/admidio": "<4.3.10", + "admidio/admidio": "<4.3.12", "adodb/adodb-php": "<=5.20.20|>=5.21,<=5.21.3", "aheinze/cockpit": "<2.2", - "aimeos/ai-admin-graphql": ">=2022.04.1,<2022.10.10|>=2023.04.1,<2023.10.6|>=2024.04.1,<2024.04.6", + "aimeos/ai-admin-graphql": ">=2022.04.1,<2022.10.10|>=2023.04.1,<2023.10.6|>=2024.04.1,<2024.07.2", "aimeos/ai-admin-jsonadm": "<2020.10.13|>=2021.04.1,<2021.10.6|>=2022.04.1,<2022.10.3|>=2023.04.1,<2023.10.4|==2024.04.1", "aimeos/ai-client-html": ">=2020.04.1,<2020.10.27|>=2021.04.1,<2021.10.22|>=2022.04.1,<2022.10.13|>=2023.04.1,<2023.10.15|>=2024.04.1,<2024.04.7", - "aimeos/ai-controller-frontend": "<2020.10.15|>=2021.04.1,<2021.10.8|>=2022.04.1,<2022.10.8|>=2023.04.1,<2023.10.9", + "aimeos/ai-controller-frontend": "<2020.10.15|>=2021.04.1,<2021.10.8|>=2022.04.1,<2022.10.8|>=2023.04.1,<2023.10.9|==2024.04.1", "aimeos/aimeos-core": ">=2022.04.1,<2022.10.17|>=2023.04.1,<2023.10.17|>=2024.04.1,<2024.04.7", "aimeos/aimeos-typo3": "<19.10.12|>=20,<20.10.5", "airesvsg/acf-to-rest-api": "<=3.1", @@ -1192,6 +1379,7 @@ "alextselegidis/easyappointments": "<1.5", "alterphp/easyadmin-extension-bundle": ">=1.2,<1.2.11|>=1.3,<1.3.1", "amazing/media2click": ">=1,<1.3.3", + "ameos/ameos_tarteaucitron": "<1.2.23", "amphp/artax": "<1.0.6|>=2,<2.0.6", "amphp/http": "<=1.7.2|>=2,<=2.1", "amphp/http-client": ">=4,<4.4", @@ -1217,6 +1405,7 @@ "azuracast/azuracast": "<0.18.3", "backdrop/backdrop": "<1.27.3|>=1.28,<1.28.2", "backpack/crud": "<3.4.9", + "backpack/filemanager": "<2.0.2|>=3,<3.0.9", "bacula-web/bacula-web": "<8.0.0.0-RC2-dev", "badaso/core": "<2.7", "bagisto/bagisto": "<2.1", @@ -1224,7 +1413,7 @@ "barrelstrength/sprout-forms": "<3.9", "barryvdh/laravel-translation-manager": "<0.6.2", "barzahlen/barzahlen-php": "<2.0.1", - "baserproject/basercms": "<5.0.9", + "baserproject/basercms": "<=5.1.1", "bassjobsen/bootstrap-3-typeahead": ">4.0.2", "bbpress/bbpress": "<2.6.5", "bcosca/fatfree": "<3.7.2", @@ -1255,7 +1444,7 @@ "cart2quote/module-quotation-encoded": ">=4.1.6,<=4.4.5|>=5,<5.4.4", "cartalyst/sentry": "<=2.1.6", "catfan/medoo": "<1.7.5", - "causal/oidc": "<2.1", + "causal/oidc": "<4", "cecil/cecil": "<7.47.1", "centreon/centreon": "<22.10.15", "cesnet/simplesamlphp-module-proxystatistics": "<3.1", @@ -1265,35 +1454,38 @@ "cockpit-hq/cockpit": "<2.7|==2.7", "codeception/codeception": "<3.1.3|>=4,<4.1.22", "codeigniter/framework": "<3.1.9", - "codeigniter4/framework": "<4.4.7", + "codeigniter4/framework": "<4.5.8", "codeigniter4/shield": "<1.0.0.0-beta8", "codiad/codiad": "<=2.8.4", "composer/composer": "<1.10.27|>=2,<2.2.24|>=2.3,<2.7.7", - "concrete5/concrete5": "<9.3.3", + "concrete5/concrete5": "<9.3.4", "concrete5/core": "<8.5.8|>=9,<9.1", "contao-components/mediaelement": ">=2.14.2,<2.21.1", "contao/comments-bundle": ">=2,<4.13.40|>=5.0.0.0-RC1-dev,<5.3.4", - "contao/contao": ">=3,<3.5.37|>=4,<4.4.56|>=4.5,<4.9.40|>=4.10,<4.11.7|>=4.13,<4.13.21|>=5.1,<5.1.4", + "contao/contao": "<=5.4.1", "contao/core": "<3.5.39", - "contao/core-bundle": "<4.13.40|>=5,<5.3.4", + "contao/core-bundle": "<4.13.49|>=5,<5.3.15|>=5.4,<5.4.3", "contao/listing-bundle": ">=3,<=3.5.30|>=4,<4.4.8", "contao/managed-edition": "<=1.5", "corveda/phpsandbox": "<1.3.5", "cosenary/instagram": "<=2.3", - "craftcms/cms": "<4.6.2|>=5.0.0.0-beta1,<=5.2.2", + "craftcms/cms": "<4.13.8|>=5,<5.5.5", "croogo/croogo": "<4", "cuyz/valinor": "<0.12", + "czim/file-handling": "<1.5|>=2,<2.3", "czproject/git-php": "<4.0.3", + "damienharper/auditor-bundle": "<5.2.6", "dapphp/securimage": "<3.6.6", "darylldoyle/safe-svg": "<1.9.10", "datadog/dd-trace": ">=0.30,<0.30.2", "datatables/datatables": "<1.10.10", "david-garcia/phpwhois": "<=4.3.1", "dbrisinajumi/d2files": "<1", - "dcat/laravel-admin": "<=2.1.3", + "dcat/laravel-admin": "<=2.1.3|==2.2.0.0-beta|==2.2.2.0-beta", "derhansen/fe_change_pwd": "<2.0.5|>=3,<3.0.3", "derhansen/sf_event_mgt": "<4.3.1|>=5,<5.1.1|>=7,<7.4", "desperado/xml-bundle": "<=0.1.7", + "dev-lancer/minecraft-motd-parser": "<=1.0.5", "devgroup/dotplant": "<2020.09.14-dev", "directmailteam/direct-mail": "<6.0.3|>=7,<7.0.3|>=8,<9.5.2", "doctrine/annotations": "<1.2.7", @@ -1305,11 +1497,12 @@ "doctrine/mongodb-odm": "<1.0.2", "doctrine/mongodb-odm-bundle": "<3.0.1", "doctrine/orm": ">=1,<1.2.4|>=2,<2.4.8|>=2.5,<2.5.1|>=2.8.3,<2.8.4", - "dolibarr/dolibarr": "<19.0.2", + "dolibarr/dolibarr": "<19.0.2|==21.0.0.0-beta", "dompdf/dompdf": "<2.0.4", "doublethreedigital/guest-entries": "<3.1.2", - "drupal/core": ">=6,<6.38|>=7,<7.96|>=8,<10.1.8|>=10.2,<10.2.2", - "drupal/drupal": ">=5,<5.11|>=6,<6.38|>=7,<7.80|>=8,<8.9.16|>=9,<9.1.12|>=9.2,<9.2.4", + "drupal/core": ">=6,<6.38|>=7,<7.102|>=8,<10.2.11|>=10.3,<10.3.9|>=11,<11.0.8", + "drupal/core-recommended": ">=7,<7.102|>=8,<10.2.11|>=10.3,<10.3.9|>=11,<11.0.8", + "drupal/drupal": ">=5,<5.11|>=6,<6.38|>=7,<7.102|>=8,<10.2.11|>=10.3,<10.3.9|>=11,<11.0.8", "duncanmcclean/guest-entries": "<3.1.2", "dweeves/magmi": "<=0.7.24", "ec-cube/ec-cube": "<2.4.4|>=2.11,<=2.17.1|>=3,<=3.0.18.0-patch4|>=4,<=4.1.2", @@ -1336,6 +1529,7 @@ "ezsystems/ezplatform-admin-ui": ">=1.3,<1.3.5|>=1.4,<1.4.6|>=1.5,<1.5.29|>=2.3,<2.3.26|>=3.3,<3.3.39", "ezsystems/ezplatform-admin-ui-assets": ">=4,<4.2.1|>=5,<5.0.1|>=5.1,<5.1.1", "ezsystems/ezplatform-graphql": ">=1.0.0.0-RC1-dev,<1.0.13|>=2.0.0.0-beta1,<2.3.12", + "ezsystems/ezplatform-http-cache": "<2.3.16", "ezsystems/ezplatform-kernel": "<1.2.5.1-dev|>=1.3,<1.3.35", "ezsystems/ezplatform-rest": ">=1.2,<=1.2.2|>=1.3,<1.3.8", "ezsystems/ezplatform-richtext": ">=2.3,<2.3.7.1-dev|>=3.3,<3.3.40", @@ -1345,13 +1539,16 @@ "ezsystems/ezpublish-legacy": "<=2017.12.7.3|>=2018.6,<=2019.03.5.1", "ezsystems/platform-ui-assets-bundle": ">=4.2,<4.2.3", "ezsystems/repository-forms": ">=2.3,<2.3.2.1-dev|>=2.5,<2.5.15", - "ezyang/htmlpurifier": "<4.1.1", + "ezyang/htmlpurifier": "<=4.2", "facade/ignition": "<1.16.15|>=2,<2.4.2|>=2.5,<2.5.2", "facturascripts/facturascripts": "<=2022.08", "fastly/magento2": "<1.2.26", "feehi/cms": "<=2.1.1", "feehi/feehicms": "<=2.1.1", "fenom/fenom": "<=2.12.1", + "filament/actions": ">=3.2,<3.2.123", + "filament/infolists": ">=3,<3.2.115", + "filament/tables": ">=3,<3.2.115", "filegator/filegator": "<7.8", "filp/whoops": "<2.1.13", "fineuploader/php-traditional-server": "<=1.2.2", @@ -1386,18 +1583,19 @@ "froxlor/froxlor": "<=2.2.0.0-RC3", "frozennode/administrator": "<=5.0.12", "fuel/core": "<1.8.1", - "funadmin/funadmin": "<=3.2|>=3.3.2,<=3.3.3", + "funadmin/funadmin": "<=5.0.2", "gaoming13/wechat-php-sdk": "<=1.10.2", "genix/cms": "<=1.1.11", "getformwork/formwork": "<1.13.1|==2.0.0.0-beta1", "getgrav/grav": "<1.7.46", - "getkirby/cms": "<4.1.1", + "getkirby/cms": "<=3.6.6.5|>=3.7,<=3.7.5.4|>=3.8,<=3.8.4.3|>=3.9,<=3.9.8.1|>=3.10,<=3.10.1|>=4,<=4.3", "getkirby/kirby": "<=2.5.12", "getkirby/panel": "<2.5.14", "getkirby/starterkit": "<=3.7.0.2", "gilacms/gila": "<=1.15.4", "gleez/cms": "<=1.3|==2", "globalpayments/php-sdk": "<2", + "goalgorilla/open_social": "<12.3.8|>=12.4,<12.4.5|>=13.0.0.0-alpha1,<13.0.0.0-alpha11", "gogentooss/samlbase": "<1.2.7", "google/protobuf": "<3.15", "gos/web-socket-bundle": "<1.10.4|>=2,<2.6.1|>=3,<3.3", @@ -1406,6 +1604,7 @@ "grumpydictator/firefly-iii": "<6.1.17", "gugoan/economizzer": "<=0.9.0.0-beta1", "guzzlehttp/guzzle": "<6.5.8|>=7,<7.4.5", + "guzzlehttp/oauth-subscriber": "<0.8.1", "guzzlehttp/psr7": "<1.9.1|>=2,<2.4.5", "haffner/jh_captcha": "<=2.1.3|>=3,<=3.0.2", "harvesthq/chosen": "<1.8.7", @@ -1417,11 +1616,12 @@ "hov/jobfair": "<1.0.13|>=2,<2.0.2", "httpsoft/http-message": "<1.0.12", "hyn/multi-tenant": ">=5.6,<5.7.2", - "ibexa/admin-ui": ">=4.2,<4.2.3|>=4.6.0.0-beta1,<4.6.9", + "ibexa/admin-ui": ">=4.2,<4.2.3|>=4.6,<4.6.14", "ibexa/core": ">=4,<4.0.7|>=4.1,<4.1.4|>=4.2,<4.2.3|>=4.5,<4.5.6|>=4.6,<4.6.2", "ibexa/fieldtype-richtext": ">=4.6,<4.6.10", "ibexa/graphql": ">=2.5,<2.5.31|>=3.3,<3.3.28|>=4.2,<4.2.3", - "ibexa/post-install": "<=1.0.4", + "ibexa/http-cache": ">=4.6,<4.6.14", + "ibexa/post-install": "<1.0.16|>=4.6,<4.6.14", "ibexa/solr": ">=4.5,<4.5.4", "ibexa/user": ">=4,<4.4.3", "icecoder/icecoder": "<=8.1", @@ -1438,11 +1638,12 @@ "in2code/femanager": "<5.5.3|>=6,<6.3.4|>=7,<7.2.3", "in2code/ipandlanguageredirect": "<5.1.2", "in2code/lux": "<17.6.1|>=18,<24.0.2", - "in2code/powermail": "<7.5|>=8,<8.5|>=9,<10.9|>=12,<12.4", + "in2code/powermail": "<7.5.1|>=8,<8.5.1|>=9,<10.9.1|>=11,<12.4.1", "innologi/typo3-appointments": "<2.0.6", "intelliants/subrion": "<4.2.2", "inter-mediator/inter-mediator": "==5.5", "ipl/web": "<0.10.1", + "islandora/crayfish": "<4.1", "islandora/islandora": ">=2,<2.4.1", "ivankristianto/phpwhois": "<=4.3", "jackalope/jackalope-doctrine-dbal": "<1.7.4", @@ -1450,6 +1651,7 @@ "james-heinrich/phpthumb": "<1.7.12", "jasig/phpcas": "<1.3.3", "jcbrand/converse.js": "<3.3.3", + "joelbutcher/socialstream": "<5.6|>=6,<6.2", "johnbillion/wp-crontrol": "<1.16.2", "joomla/application": "<1.0.13", "joomla/archive": "<1.1.12|>=2,<2.0.1", @@ -1468,26 +1670,30 @@ "kelvinmo/simplexrd": "<3.1.1", "kevinpapst/kimai2": "<1.16.7", "khodakhah/nodcms": "<=3", - "kimai/kimai": "<2.16", + "kimai/kimai": "<=2.20.1", "kitodo/presentation": "<3.2.3|>=3.3,<3.3.4", "klaviyo/magento2-extension": ">=1,<3", "knplabs/knp-snappy": "<=1.4.2", "kohana/core": "<3.3.3", - "krayin/laravel-crm": "<1.2.2", + "krayin/laravel-crm": "<=1.3", "kreait/firebase-php": ">=3.2,<3.8.1", "kumbiaphp/kumbiapp": "<=1.1.1", "la-haute-societe/tcpdf": "<6.2.22", "laminas/laminas-diactoros": "<2.18.1|==2.19|==2.20|==2.21|==2.22|==2.23|>=2.24,<2.24.2|>=2.25,<2.25.2", "laminas/laminas-form": "<2.17.1|>=3,<3.0.2|>=3.1,<3.1.1", "laminas/laminas-http": "<2.14.2", + "lara-zeus/artemis": ">=1,<=1.0.6", + "lara-zeus/dynamic-dashboard": ">=3,<=3.0.1", "laravel/fortify": "<1.11.1", - "laravel/framework": "<6.20.44|>=7,<7.30.6|>=8,<8.75", + "laravel/framework": "<6.20.45|>=7,<7.30.7|>=8,<8.83.28|>=9,<9.52.17|>=10,<10.48.23|>=11,<11.31", "laravel/laravel": ">=5.4,<5.4.22", + "laravel/pulse": "<1.3.1", + "laravel/reverb": "<1.4", "laravel/socialite": ">=1,<2.0.10", "latte/latte": "<2.10.8", "lavalite/cms": "<=9|==10.1", "lcobucci/jwt": ">=3.4,<3.4.6|>=4,<4.0.4|>=4.1,<4.1.5", - "league/commonmark": "<0.18.3", + "league/commonmark": "<2.6", "league/flysystem": "<1.1.4|>=2,<2.1.1", "league/oauth2-server": ">=8.3.2,<8.4.2|>=8.5,<8.5.3", "lexik/jwt-authentication-bundle": "<2.10.7|>=2.11,<2.11.3", @@ -1495,13 +1701,14 @@ "librenms/librenms": "<2017.08.18", "liftkit/database": "<2.13.2", "lightsaml/lightsaml": "<1.3.5", - "limesurvey/limesurvey": "<3.27.19", + "limesurvey/limesurvey": "<6.5.12", "livehelperchat/livehelperchat": "<=3.91", - "livewire/livewire": ">2.2.4,<2.2.6|>=3.3.5,<3.4.9", + "livewire/livewire": "<2.12.7|>=3.0.0.0-beta1,<3.5.2", "lms/routes": "<2.1.1", "localizationteam/l10nmgr": "<7.4|>=8,<8.7|>=9,<9.2", "luyadev/yii-helpers": "<1.2.1", - "magento/community-edition": "<2.4.5|==2.4.5|>=2.4.5.0-patch1,<2.4.5.0-patch8|==2.4.6|>=2.4.6.0-patch1,<2.4.6.0-patch6|==2.4.7", + "maestroerror/php-heic-to-jpg": "<1.0.5", + "magento/community-edition": "<2.4.5|==2.4.5|>=2.4.5.0-patch1,<2.4.5.0-patch10|==2.4.6|>=2.4.6.0-patch1,<2.4.6.0-patch8|>=2.4.7.0-beta1,<2.4.7.0-patch3", "magento/core": "<=1.9.4.5", "magento/magento1ce": "<1.9.4.3-dev", "magento/magento1ee": ">=1,<1.14.4.3-dev", @@ -1509,12 +1716,17 @@ "magneto/core": "<1.9.4.4-dev", "maikuolan/phpmussel": ">=1,<1.6", "mainwp/mainwp": "<=4.4.3.3", - "mantisbt/mantisbt": "<2.26.2", + "mantisbt/mantisbt": "<=2.26.3", "marcwillmann/turn": "<0.3.3", "matyhtf/framework": "<3.0.6", - "mautic/core": "<4.4.12|>=5.0.0.0-alpha,<5.0.4", + "mautic/core": "<4.4.13|>=5,<5.1.1", + "mautic/core-lib": ">=1.0.0.0-beta,<4.4.13|>=5.0.0.0-alpha,<5.1.1", + "maximebf/debugbar": "<1.19", "mdanter/ecc": "<2", - "mediawiki/core": "<1.36.2", + "mediawiki/abuse-filter": "<1.39.9|>=1.40,<1.41.3|>=1.42,<1.42.2", + "mediawiki/cargo": "<3.6.1", + "mediawiki/core": "<1.39.5|==1.40", + "mediawiki/data-transfer": ">=1.39,<1.39.11|>=1.41,<1.41.3|>=1.42,<1.42.2", "mediawiki/matomo": "<2.4.3", "mediawiki/semantic-media-wiki": "<4.0.2", "melisplatform/melis-asset-manager": "<5.0.1", @@ -1534,7 +1746,7 @@ "mojo42/jirafeau": "<4.4", "mongodb/mongodb": ">=1,<1.9.2", "monolog/monolog": ">=1.8,<1.12", - "moodle/moodle": "<4.3.5|>=4.4.0.0-beta,<4.4.1", + "moodle/moodle": "<4.3.8|>=4.4,<4.4.4", "mos/cimage": "<0.7.19", "movim/moxl": ">=0.8,<=0.10", "movingbytes/social-network": "<=1.2.1", @@ -1547,6 +1759,7 @@ "munkireport/softwareupdate": "<1.6", "mustache/mustache": ">=2,<2.14.1", "namshi/jose": "<2.2", + "nategood/httpful": "<1", "neoan3-apps/template": "<1.1.1", "neorazorx/facturascripts": "<2022.04", "neos/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.12|>=3.1,<3.1.10|>=3.2,<3.2.13|>=3.3,<3.3.13|>=4,<4.0.6", @@ -1554,10 +1767,12 @@ "neos/media-browser": "<7.3.19|>=8,<8.0.16|>=8.1,<8.1.11|>=8.2,<8.2.11|>=8.3,<8.3.9", "neos/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4|>=2.3,<3.0.20|>=3.1,<3.1.18|>=3.2,<3.2.14|>=3.3,<5.3.10|>=7,<7.0.9|>=7.1,<7.1.7|>=7.2,<7.2.6|>=7.3,<7.3.4|>=8,<8.0.2", "neos/swiftmailer": "<5.4.5", + "nesbot/carbon": "<2.72.6|>=3,<3.8.4", + "netcarver/textile": "<=4.1.2", "netgen/tagsbundle": ">=3.4,<3.4.11|>=4,<4.0.15", "nette/application": ">=2,<2.0.19|>=2.1,<2.1.13|>=2.2,<2.2.10|>=2.3,<2.3.14|>=2.4,<2.4.16|>=3,<3.0.6", "nette/nette": ">=2,<2.0.19|>=2.1,<2.1.13", - "nilsteampassnet/teampass": "<3.0.10", + "nilsteampassnet/teampass": "<3.1.3.1-dev", "nonfiction/nterchange": "<4.1.1", "notrinos/notrinos-erp": "<=0.7", "noumo/easyii": "<=0.9", @@ -1569,7 +1784,7 @@ "nzo/url-encryptor-bundle": ">=4,<4.3.2|>=5,<5.0.1", "october/backend": "<1.1.2", "october/cms": "<1.0.469|==1.0.469|==1.0.471|==1.1.1", - "october/october": "<=3.4.4", + "october/october": "<=3.6.4", "october/rain": "<1.0.472|>=1.1,<1.1.2", "october/system": "<1.0.476|>=1.1,<1.1.12|>=2,<2.2.34|>=3,<3.5.15", "omeka/omeka-s": "<4.0.3", @@ -1581,7 +1796,7 @@ "openmage/magento-lts": "<20.10.1", "opensolutions/vimbadmin": "<=3.0.15", "opensource-workshop/connect-cms": "<1.7.2|>=2,<2.3.2", - "orchid/platform": ">=9,<9.4.4|>=14.0.0.0-alpha4,<14.5", + "orchid/platform": ">=8,<14.43", "oro/calendar-bundle": ">=4.2,<=4.2.6|>=5,<=5.0.6|>=5.1,<5.1.1", "oro/commerce": ">=4.1,<5.0.11|>=5.1,<5.1.1", "oro/crm": ">=1.7,<1.7.4|>=3.1,<4.1.17|>=4.2,<4.2.7", @@ -1612,16 +1827,16 @@ "phenx/php-svg-lib": "<0.5.2", "php-censor/php-censor": "<2.0.13|>=2.1,<2.1.5", "php-mod/curl": "<2.3.2", - "phpbb/phpbb": "<3.2.10|>=3.3,<3.3.1", + "phpbb/phpbb": "<3.3.11", "phpems/phpems": ">=6,<=6.1.3", "phpfastcache/phpfastcache": "<6.1.5|>=7,<7.1.2|>=8,<8.0.7", "phpmailer/phpmailer": "<6.5", "phpmussel/phpmussel": ">=1,<1.6", - "phpmyadmin/phpmyadmin": "<5.2.1", - "phpmyfaq/phpmyfaq": "<3.2.5|==3.2.5", + "phpmyadmin/phpmyadmin": "<5.2.2", + "phpmyfaq/phpmyfaq": "<3.2.5|==3.2.5|>=3.2.10,<=4.0.1", "phpoffice/common": "<0.2.9", - "phpoffice/phpexcel": "<1.8", - "phpoffice/phpspreadsheet": "<1.16", + "phpoffice/phpexcel": "<1.8.1", + "phpoffice/phpspreadsheet": "<1.29.8|>=2,<2.1.7|>=2.2,<2.3.6|>=3,<3.8", "phpseclib/phpseclib": "<2.0.47|>=3,<3.0.36", "phpservermon/phpservermon": "<3.6", "phpsysinfo/phpsysinfo": "<3.4.3", @@ -1630,13 +1845,14 @@ "phpxmlrpc/extras": "<0.6.1", "phpxmlrpc/phpxmlrpc": "<4.9.2", "pi/pi": "<=2.5", - "pimcore/admin-ui-classic-bundle": "<=1.5.1", - "pimcore/customer-management-framework-bundle": "<4.0.6", + "pimcore/admin-ui-classic-bundle": "<1.5.4", + "pimcore/customer-management-framework-bundle": "<4.2.1", "pimcore/data-hub": "<1.2.4", + "pimcore/data-importer": "<1.8.9|>=1.9,<1.9.3", "pimcore/demo": "<10.3", "pimcore/ecommerce-framework-bundle": "<1.0.10", "pimcore/perspective-editor": "<1.5.1", - "pimcore/pimcore": "<11.2.4", + "pimcore/pimcore": "<11.2.4|>=11.4.2,<11.5.3", "pixelfed/pixelfed": "<0.11.11", "plotly/plotly.js": "<2.25.2", "pocketmine/bedrock-protocol": "<8.0.2", @@ -1650,6 +1866,7 @@ "prestashop/gamification": "<2.3.2", "prestashop/prestashop": "<8.1.6", "prestashop/productcomments": "<5.0.2", + "prestashop/ps_contactinfo": "<=3.3.2", "prestashop/ps_emailsubscription": "<2.6.1", "prestashop/ps_facetedsearch": "<3.4.1", "prestashop/ps_linklist": "<3.1", @@ -1657,13 +1874,13 @@ "processwire/processwire": "<=3.0.229", "propel/propel": ">=2.0.0.0-alpha1,<=2.0.0.0-alpha7", "propel/propel1": ">=1,<=1.7.1", - "pterodactyl/panel": "<1.11.6", + "pterodactyl/panel": "<1.11.8", "ptheofan/yii2-statemachine": ">=2.0.0.0-RC1-dev,<=2", "ptrofimov/beanstalk_console": "<1.7.14", "pubnub/pubnub": "<6.1", "pusher/pusher-php-server": "<2.2.1", "pwweb/laravel-core": "<=0.3.6.0-beta", - "pxlrbt/filament-excel": "<2.3.3", + "pxlrbt/filament-excel": "<1.1.14|>=2.0.0.0-alpha,<2.3.3", "pyrocms/pyrocms": "<=3.9.1", "qcubed/qcubed": "<=3.1.1", "quickapps/cms": "<=2.0.0.0-beta2", @@ -1674,7 +1891,7 @@ "rap2hpoutre/laravel-log-viewer": "<0.13", "react/http": ">=0.7,<1.9", "really-simple-plugins/complianz-gdpr": "<6.4.2", - "redaxo/source": "<=5.15.1", + "redaxo/source": "<5.18", "remdex/livehelperchat": "<4.29", "reportico-web/reportico": "<=8.1", "rhukster/dom-sanitizer": "<1.0.7", @@ -1686,11 +1903,12 @@ "s-cart/s-cart": "<6.9", "sabberworm/php-css-parser": ">=1,<1.0.1|>=2,<2.0.1|>=3,<3.0.1|>=4,<4.0.1|>=5,<5.0.9|>=5.1,<5.1.3|>=5.2,<5.2.1|>=6,<6.0.2|>=7,<7.0.4|>=8,<8.0.1|>=8.1,<8.1.1|>=8.2,<8.2.1|>=8.3,<8.3.1", "sabre/dav": ">=1.6,<1.7.11|>=1.8,<1.8.9", + "samwilson/unlinked-wikibase": "<1.39.6|>=1.40,<1.40.2|>=1.41,<1.41.1", "scheb/two-factor-bundle": "<3.26|>=4,<4.11", "sensiolabs/connect": "<4.2.3", "serluck/phpwhois": "<=4.2.6", "sfroemken/url_redirect": "<=1.2.1", - "sheng/yiicms": "<=1.2", + "sheng/yiicms": "<1.2.1", "shopware/core": "<=6.5.8.12|>=6.6,<=6.6.5", "shopware/platform": "<=6.5.8.12|>=6.6,<=6.6.5", "shopware/production": "<=6.3.5.2", @@ -1698,13 +1916,14 @@ "shopware/storefront": "<=6.4.8.1|>=6.5.8,<6.5.8.7-dev", "shopxo/shopxo": "<=6.1", "showdoc/showdoc": "<2.10.4", + "shuchkin/simplexlsx": ">=1.0.12,<1.1.13", "silverstripe-australia/advancedreports": ">=1,<=2", "silverstripe/admin": "<1.13.19|>=2,<2.1.8", "silverstripe/assets": ">=1,<1.11.1", "silverstripe/cms": "<4.11.3", "silverstripe/comments": ">=1.3,<3.1.1", "silverstripe/forum": "<=0.6.1|>=0.7,<=0.7.3", - "silverstripe/framework": "<5.2.16", + "silverstripe/framework": "<5.3.8", "silverstripe/graphql": ">=2,<2.0.5|>=3,<3.8.2|>=4,<4.3.7|>=5,<5.1.3", "silverstripe/hybridsessions": ">=1,<2.4.1|>=2.5,<2.5.1", "silverstripe/recipe-cms": ">=4.5,<4.5.3", @@ -1717,11 +1936,13 @@ "silverstripe/userforms": "<3|>=5,<5.4.2", "silverstripe/versioned-admin": ">=1,<1.11.1", "simple-updates/phpwhois": "<=1", - "simplesamlphp/saml2": "<1.10.6|>=2,<2.3.8|>=3,<3.1.4|==5.0.0.0-alpha12", + "simplesamlphp/saml2": "<4.6.14|==5.0.0.0-alpha12", + "simplesamlphp/saml2-legacy": "<4.6.14", "simplesamlphp/simplesamlphp": "<1.18.6", "simplesamlphp/simplesamlphp-module-infocard": "<1.0.1", "simplesamlphp/simplesamlphp-module-openid": "<1", "simplesamlphp/simplesamlphp-module-openidprovider": "<0.9", + "simplesamlphp/xml-common": "<1.20", "simplesamlphp/xml-security": "==1.6.11", "simplito/elliptic-php": "<1.0.6", "sitegeist/fluid-components": "<3.5", @@ -1730,24 +1951,27 @@ "slim/slim": "<2.6", "slub/slub-events": "<3.0.3", "smarty/smarty": "<4.5.3|>=5,<5.1.1", - "snipe/snipe-it": "<6.4.2", + "snipe/snipe-it": "<=7.0.13", "socalnick/scn-social-auth": "<1.15.2", "socialiteproviders/steam": "<1.1", - "spatie/browsershot": "<3.57.4", + "spatie/browsershot": "<5.0.3", "spatie/image-optimizer": "<1.7.3", + "spencer14420/sp-php-email-handler": "<1", "spipu/html2pdf": "<5.2.8", "spoon/library": "<1.4.1", "spoonity/tcpdf": "<6.2.22", "squizlabs/php_codesniffer": ">=1,<2.8.1|>=3,<3.0.1", "ssddanbrown/bookstack": "<24.05.1", - "statamic/cms": "<4.46|>=5.3,<5.6.2", + "starcitizentools/citizen-skin": ">=2.6.3,<2.31", + "starcitizentools/tabber-neue": ">=1.9.1,<2.7.2", + "statamic/cms": "<=5.16", "stormpath/sdk": "<9.9.99", "studio-42/elfinder": "<=2.1.64", "studiomitte/friendlycaptcha": "<0.1.4", "subhh/libconnect": "<7.0.8|>=8,<8.1", "sukohi/surpass": "<1", "sulu/form-bundle": ">=2,<2.5.3", - "sulu/sulu": "<1.6.44|>=2,<2.4.17|>=2.5,<2.5.13", + "sulu/sulu": "<1.6.44|>=2,<2.5.21|>=2.6,<2.6.5", "sumocoders/framework-user-bundle": "<1.4", "superbig/craft-audit": "<3.0.2", "swag/paypal": "<5.4.4", @@ -1769,7 +1993,8 @@ "symfony/error-handler": ">=4.4,<4.4.4|>=5,<5.0.4", "symfony/form": ">=2.3,<2.3.35|>=2.4,<2.6.12|>=2.7,<2.7.50|>=2.8,<2.8.49|>=3,<3.4.20|>=4,<4.0.15|>=4.1,<4.1.9|>=4.2,<4.2.1", "symfony/framework-bundle": ">=2,<2.3.18|>=2.4,<2.4.8|>=2.5,<2.5.2|>=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7|>=5.3.14,<5.3.15|>=5.4.3,<5.4.4|>=6.0.3,<6.0.4", - "symfony/http-foundation": ">=2,<2.8.52|>=3,<3.4.35|>=4,<4.2.12|>=4.3,<4.3.8|>=4.4,<4.4.7|>=5,<5.0.7", + "symfony/http-client": ">=4.3,<5.4.47|>=6,<6.4.15|>=7,<7.1.8", + "symfony/http-foundation": "<5.4.46|>=6,<6.4.14|>=7,<7.1.7", "symfony/http-kernel": ">=2,<4.4.50|>=5,<5.4.20|>=6,<6.0.20|>=6.1,<6.1.12|>=6.2,<6.2.6", "symfony/intl": ">=2.7,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", "symfony/maker-bundle": ">=1.27,<1.29.2|>=1.30,<1.31.1", @@ -1777,20 +2002,22 @@ "symfony/phpunit-bridge": ">=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", "symfony/polyfill": ">=1,<1.10", "symfony/polyfill-php55": ">=1,<1.10", + "symfony/process": "<5.4.46|>=6,<6.4.14|>=7,<7.1.7", "symfony/proxy-manager-bridge": ">=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", "symfony/routing": ">=2,<2.0.19", + "symfony/runtime": ">=5.3,<5.4.46|>=6,<6.4.14|>=7,<7.1.7", "symfony/security": ">=2,<2.7.51|>=2.8,<3.4.49|>=4,<4.4.24|>=5,<5.2.8", - "symfony/security-bundle": ">=2,<4.4.50|>=5,<5.4.20|>=6,<6.0.20|>=6.1,<6.1.12|>=6.2,<6.2.6", + "symfony/security-bundle": ">=2,<4.4.50|>=5,<5.4.20|>=6,<6.0.20|>=6.1,<6.1.12|>=6.2,<6.4.10|>=7,<7.0.10|>=7.1,<7.1.3", "symfony/security-core": ">=2.4,<2.6.13|>=2.7,<2.7.9|>=2.7.30,<2.7.32|>=2.8,<3.4.49|>=4,<4.4.24|>=5,<5.2.9", "symfony/security-csrf": ">=2.4,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", "symfony/security-guard": ">=2.8,<3.4.48|>=4,<4.4.23|>=5,<5.2.8", - "symfony/security-http": ">=2.3,<2.3.41|>=2.4,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.2.12|>=4.3,<4.3.8|>=4.4,<4.4.7|>=5,<5.0.7|>=5.1,<5.2.8|>=5.3,<5.3.2|>=5.4,<5.4.31|>=6,<6.3.8", + "symfony/security-http": ">=2.3,<2.3.41|>=2.4,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.2.12|>=4.3,<4.3.8|>=4.4,<4.4.7|>=5,<5.0.7|>=5.1,<5.2.8|>=5.3,<5.4.47|>=6,<6.4.15|>=7,<7.1.8", "symfony/serializer": ">=2,<2.0.11|>=4.1,<4.4.35|>=5,<5.3.12", - "symfony/symfony": ">=2,<4.4.51|>=5,<5.4.31|>=6,<6.3.8", + "symfony/symfony": "<5.4.47|>=6,<6.4.15|>=7,<7.1.8", "symfony/translation": ">=2,<2.0.17", "symfony/twig-bridge": ">=2,<4.4.51|>=5,<5.4.31|>=6,<6.3.8", "symfony/ux-autocomplete": "<2.11.2", - "symfony/validator": ">=2,<2.0.24|>=2.1,<2.1.12|>=2.2,<2.2.5|>=2.3,<2.3.3", + "symfony/validator": "<5.4.43|>=6,<6.4.11|>=7,<7.1.4", "symfony/var-exporter": ">=4.2,<4.2.12|>=4.3,<4.3.8", "symfony/web-profiler-bundle": ">=2,<2.3.19|>=2.4,<2.4.9|>=2.5,<2.5.4", "symfony/webhook": ">=6.3,<6.3.8", @@ -1800,39 +2027,48 @@ "t3g/svg-sanitizer": "<1.0.3", "t3s/content-consent": "<1.0.3|>=2,<2.0.2", "tastyigniter/tastyigniter": "<3.3", - "tcg/voyager": "<=1.4", - "tecnickcom/tcpdf": "<=6.7.4", + "tcg/voyager": "<=1.8", + "tecnickcom/tc-lib-pdf-font": "<2.6.4", + "tecnickcom/tcpdf": "<6.8", "terminal42/contao-tablelookupwizard": "<3.3.5", "thelia/backoffice-default-template": ">=2.1,<2.1.2", "thelia/thelia": ">=2.1,<2.1.3", "theonedemon/phpwhois": "<=4.2.5", "thinkcmf/thinkcmf": "<6.0.8", - "thorsten/phpmyfaq": "<3.2.2", + "thorsten/phpmyfaq": "<=4.0.1", "tikiwiki/tiki-manager": "<=17.1", "timber/timber": ">=0.16.6,<1.23.1|>=1.24,<1.24.1|>=2,<2.1", "tinymce/tinymce": "<7.2", "tinymighty/wiki-seo": "<1.2.2", "titon/framework": "<9.9.99", + "tltneon/lgsl": "<7", "tobiasbg/tablepress": "<=2.0.0.0-RC1", - "topthink/framework": "<6.0.17|>=6.1,<6.1.5|>=8,<8.0.4", + "topthink/framework": "<6.0.17|>=6.1,<=8.0.4", "topthink/think": "<=6.1.1", - "topthink/thinkphp": "<=3.2.3", + "topthink/thinkphp": "<=3.2.3|>=6.1.3,<=8.0.4", "torrentpier/torrentpier": "<=2.4.3", "tpwd/ke_search": "<4.0.3|>=4.1,<4.6.6|>=5,<5.0.2", - "tribalsystems/zenario": "<9.5.60602", + "tribalsystems/zenario": "<=9.7.61188", "truckersmp/phpwhois": "<=4.3.1", "ttskch/pagination-service-provider": "<1", "twbs/bootstrap": "<=3.4.1|>=4,<=4.6.2", - "twig/twig": "<1.44.7|>=2,<2.15.3|>=3,<3.4.3", + "twig/twig": "<3.11.2|>=3.12,<3.14.1|>=3.16,<3.19", "typo3/cms": "<9.5.29|>=10,<10.4.35|>=11,<11.5.23|>=12,<12.2", - "typo3/cms-backend": "<4.1.14|>=4.2,<4.2.15|>=4.3,<4.3.7|>=4.4,<4.4.4|>=7,<=7.6.50|>=8,<=8.7.39|>=9,<=9.5.24|>=10,<=10.4.13|>=11,<=11.1", - "typo3/cms-core": "<=8.7.56|>=9,<=9.5.47|>=10,<=10.4.44|>=11,<=11.5.36|>=12,<=12.4.14|>=13,<=13.1", + "typo3/cms-backend": "<4.1.14|>=4.2,<4.2.15|>=4.3,<4.3.7|>=4.4,<4.4.4|>=7,<=7.6.50|>=8,<=8.7.39|>=9,<=9.5.24|>=10,<10.4.46|>=11,<11.5.40|>=12,<12.4.21|>=13,<13.3.1", + "typo3/cms-belog": ">=10,<=10.4.47|>=11,<=11.5.41|>=12,<=12.4.24|>=13,<=13.4.2", + "typo3/cms-beuser": ">=10,<=10.4.47|>=11,<=11.5.41|>=12,<=12.4.24|>=13,<=13.4.2", + "typo3/cms-core": "<=8.7.56|>=9,<=9.5.48|>=10,<=10.4.47|>=11,<=11.5.41|>=12,<=12.4.24|>=13,<=13.4.2", + "typo3/cms-dashboard": ">=10,<=10.4.47|>=11,<=11.5.41|>=12,<=12.4.24|>=13,<=13.4.2", "typo3/cms-extbase": "<6.2.24|>=7,<7.6.8|==8.1.1", + "typo3/cms-extensionmanager": ">=10,<=10.4.47|>=11,<=11.5.41|>=12,<=12.4.24|>=13,<=13.4.2", "typo3/cms-fluid": "<4.3.4|>=4.4,<4.4.1", - "typo3/cms-form": ">=8,<=8.7.39|>=9,<=9.5.24|>=10,<=10.4.13|>=11,<=11.1", + "typo3/cms-form": ">=8,<=8.7.39|>=9,<=9.5.24|>=10,<=10.4.47|>=11,<=11.5.41|>=12,<=12.4.24|>=13,<=13.4.2", "typo3/cms-frontend": "<4.3.9|>=4.4,<4.4.5", - "typo3/cms-install": "<4.1.14|>=4.2,<4.2.16|>=4.3,<4.3.9|>=4.4,<4.4.5|>=12.2,<12.4.8", + "typo3/cms-indexed-search": ">=10,<=10.4.47|>=11,<=11.5.41|>=12,<=12.4.24|>=13,<=13.4.2", + "typo3/cms-install": "<4.1.14|>=4.2,<4.2.16|>=4.3,<4.3.9|>=4.4,<4.4.5|>=12.2,<12.4.8|==13.4.2", + "typo3/cms-lowlevel": ">=11,<=11.5.41", "typo3/cms-rte-ckeditor": ">=9.5,<9.5.42|>=10,<10.4.39|>=11,<11.5.30", + "typo3/cms-scheduler": ">=11,<=11.5.41", "typo3/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.12|>=3.1,<3.1.10|>=3.2,<3.2.13|>=3.3,<3.3.13|>=4,<4.0.6", "typo3/html-sanitizer": ">=1,<=1.5.2|>=2,<=2.1.3", "typo3/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4|>=2.3,<2.3.99|>=3,<3.0.20|>=3.1,<3.1.18|>=3.2,<3.2.14|>=3.3,<3.3.23|>=4,<4.0.17|>=4.1,<4.1.16|>=4.2,<4.2.12|>=4.3,<4.3.3", @@ -1841,7 +2077,8 @@ "typo3fluid/fluid": ">=2,<2.0.8|>=2.1,<2.1.7|>=2.2,<2.2.4|>=2.3,<2.3.7|>=2.4,<2.4.4|>=2.5,<2.5.11|>=2.6,<2.6.10", "ua-parser/uap-php": "<3.8", "uasoft-indonesia/badaso": "<=2.9.7", - "unisharp/laravel-filemanager": "<2.6.4", + "unisharp/laravel-filemanager": "<2.9.1", + "unopim/unopim": "<0.1.5", "userfrosting/userfrosting": ">=0.3.1,<4.6.3", "usmanhalalit/pixie": "<1.0.3|>=2,<2.0.2", "uvdesk/community-skeleton": "<=1.1.1", @@ -1872,9 +2109,11 @@ "wikimedia/parsoid": "<0.12.2", "willdurand/js-translation-bundle": "<2.1.1", "winter/wn-backend-module": "<1.2.4", + "winter/wn-cms-module": "<1.0.476|>=1.1,<1.1.11|>=1.2,<1.2.7", "winter/wn-dusk-plugin": "<2.1", "winter/wn-system-module": "<1.2.4", "wintercms/winter": "<=1.2.3", + "wireui/wireui": "<1.19.3|>=2,<2.1.3", "woocommerce/woocommerce": "<6.6|>=8.8,<8.8.5|>=8.9,<8.9.3", "wp-cli/wp-cli": ">=0.12,<2.5", "wp-graphql/wp-graphql": "<=1.14.5", @@ -1886,8 +2125,8 @@ "xataface/xataface": "<3", "xpressengine/xpressengine": "<3.0.15", "yab/quarx": "<2.4.5", - "yeswiki/yeswiki": "<4.1", - "yetiforce/yetiforce-crm": "<=6.4", + "yeswiki/yeswiki": "<=4.4.5", + "yetiforce/yetiforce-crm": "<6.5", "yidashi/yii2cmf": "<=2", "yii2mod/yii2-cms": "<1.9.2", "yiisoft/yii": "<1.1.29", @@ -1976,7 +2215,7 @@ "type": "tidelift" } ], - "time": "2024-08-28T08:05:44+00:00" + "time": "2025-01-30T18:06:22+00:00" }, { "name": "sebastian/cli-parser", diff --git a/composer/autoload.php b/composer/autoload.php index f2c62c505f..4995a7206d 100644 --- a/composer/autoload.php +++ b/composer/autoload.php @@ -1,25 +1,10 @@ =5.3.0" - }, - "require-dev": { - "phpunit/phpunit": ">4.0 <9.4" - }, - "type": "library", - "autoload": { - "psr-4": { - "mikehaertl\\pdftk\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Haertl", - "email": "haertl.mike@gmail.com" - } - ], - "description": "A PDF conversion and form utility based on pdftk.", - "keywords": [ - "pdf", - "pdftk" - ], - "support": { - "issues": "https://github.com/mikehaertl/php-pdftk/issues", - "source": "https://github.com/mikehaertl/php-pdftk/tree/0.13.1" - }, - "time": "2023-11-03T16:06:08+00:00" - }, - { - "name": "mikehaertl/php-shellcommand", - "version": "1.7.0", - "source": { - "type": "git", - "url": "https://github.com/mikehaertl/php-shellcommand.git", - "reference": "e79ea528be155ffdec6f3bf1a4a46307bb49e545" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mikehaertl/php-shellcommand/zipball/e79ea528be155ffdec6f3bf1a4a46307bb49e545", - "reference": "e79ea528be155ffdec6f3bf1a4a46307bb49e545", - "shasum": "" - }, - "require": { - "php": ">= 5.3.0" - }, - "require-dev": { - "phpunit/phpunit": ">4.0 <=9.4" - }, - "type": "library", - "autoload": { - "psr-4": { - "mikehaertl\\shellcommand\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Härtl", - "email": "haertl.mike@gmail.com" - } - ], - "description": "An object oriented interface to shell commands", - "keywords": [ - "shell" - ], - "support": { - "issues": "https://github.com/mikehaertl/php-shellcommand/issues", - "source": "https://github.com/mikehaertl/php-shellcommand/tree/1.7.0" - }, - "time": "2023-04-19T08:25:22+00:00" - }, - { - "name": "mikehaertl/php-tmpfile", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/mikehaertl/php-tmpfile.git", - "reference": "70a5b70b17bc0d9666388e6a551ecc93d0b40a10" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mikehaertl/php-tmpfile/zipball/70a5b70b17bc0d9666388e6a551ecc93d0b40a10", - "reference": "70a5b70b17bc0d9666388e6a551ecc93d0b40a10", - "shasum": "" - }, - "require-dev": { - "php": ">=5.3.0", - "phpunit/phpunit": ">4.0 <=9.4" - }, - "type": "library", - "autoload": { - "psr-4": { - "mikehaertl\\tmp\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Härtl", - "email": "haertl.mike@gmail.com" - } - ], - "description": "A convenience class for temporary files", - "keywords": [ - "files" - ], - "support": { - "issues": "https://github.com/mikehaertl/php-tmpfile/issues", - "source": "https://github.com/mikehaertl/php-tmpfile/tree/1.2.1" - }, - "time": "2021-03-01T18:26:25+00:00" - } - ], - "packages-dev": [], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": [], - "platform-dev": [], - "plugin-api-version": "2.6.0" -} diff --git a/composer/composer/ClassLoader.php b/composer/composer/ClassLoader.php deleted file mode 100644 index 7824d8f7ea..0000000000 --- a/composer/composer/ClassLoader.php +++ /dev/null @@ -1,579 +0,0 @@ - - * Jordi Boggiano - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Composer\Autoload; - -/** - * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. - * - * $loader = new \Composer\Autoload\ClassLoader(); - * - * // register classes with namespaces - * $loader->add('Symfony\Component', __DIR__.'/component'); - * $loader->add('Symfony', __DIR__.'/framework'); - * - * // activate the autoloader - * $loader->register(); - * - * // to enable searching the include path (eg. for PEAR packages) - * $loader->setUseIncludePath(true); - * - * In this example, if you try to use a class in the Symfony\Component - * namespace or one of its children (Symfony\Component\Console for instance), - * the autoloader will first look for the class under the component/ - * directory, and it will then fallback to the framework/ directory if not - * found before giving up. - * - * This class is loosely based on the Symfony UniversalClassLoader. - * - * @author Fabien Potencier - * @author Jordi Boggiano - * @see https://www.php-fig.org/psr/psr-0/ - * @see https://www.php-fig.org/psr/psr-4/ - */ -class ClassLoader -{ - /** @var \Closure(string):void */ - private static $includeFile; - - /** @var string|null */ - private $vendorDir; - - // PSR-4 - /** - * @var array> - */ - private $prefixLengthsPsr4 = array(); - /** - * @var array> - */ - private $prefixDirsPsr4 = array(); - /** - * @var list - */ - private $fallbackDirsPsr4 = array(); - - // PSR-0 - /** - * List of PSR-0 prefixes - * - * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2'))) - * - * @var array>> - */ - private $prefixesPsr0 = array(); - /** - * @var list - */ - private $fallbackDirsPsr0 = array(); - - /** @var bool */ - private $useIncludePath = false; - - /** - * @var array - */ - private $classMap = array(); - - /** @var bool */ - private $classMapAuthoritative = false; - - /** - * @var array - */ - private $missingClasses = array(); - - /** @var string|null */ - private $apcuPrefix; - - /** - * @var array - */ - private static $registeredLoaders = array(); - - /** - * @param string|null $vendorDir - */ - public function __construct($vendorDir = null) - { - $this->vendorDir = $vendorDir; - self::initializeIncludeClosure(); - } - - /** - * @return array> - */ - public function getPrefixes() - { - if (!empty($this->prefixesPsr0)) { - return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); - } - - return array(); - } - - /** - * @return array> - */ - public function getPrefixesPsr4() - { - return $this->prefixDirsPsr4; - } - - /** - * @return list - */ - public function getFallbackDirs() - { - return $this->fallbackDirsPsr0; - } - - /** - * @return list - */ - public function getFallbackDirsPsr4() - { - return $this->fallbackDirsPsr4; - } - - /** - * @return array Array of classname => path - */ - public function getClassMap() - { - return $this->classMap; - } - - /** - * @param array $classMap Class to filename map - * - * @return void - */ - public function addClassMap(array $classMap) - { - if ($this->classMap) { - $this->classMap = array_merge($this->classMap, $classMap); - } else { - $this->classMap = $classMap; - } - } - - /** - * Registers a set of PSR-0 directories for a given prefix, either - * appending or prepending to the ones previously set for this prefix. - * - * @param string $prefix The prefix - * @param list|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories - * - * @return void - */ - public function add($prefix, $paths, $prepend = false) - { - $paths = (array) $paths; - if (!$prefix) { - if ($prepend) { - $this->fallbackDirsPsr0 = array_merge( - $paths, - $this->fallbackDirsPsr0 - ); - } else { - $this->fallbackDirsPsr0 = array_merge( - $this->fallbackDirsPsr0, - $paths - ); - } - - return; - } - - $first = $prefix[0]; - if (!isset($this->prefixesPsr0[$first][$prefix])) { - $this->prefixesPsr0[$first][$prefix] = $paths; - - return; - } - if ($prepend) { - $this->prefixesPsr0[$first][$prefix] = array_merge( - $paths, - $this->prefixesPsr0[$first][$prefix] - ); - } else { - $this->prefixesPsr0[$first][$prefix] = array_merge( - $this->prefixesPsr0[$first][$prefix], - $paths - ); - } - } - - /** - * Registers a set of PSR-4 directories for a given namespace, either - * appending or prepending to the ones previously set for this namespace. - * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param list|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories - * - * @throws \InvalidArgumentException - * - * @return void - */ - public function addPsr4($prefix, $paths, $prepend = false) - { - $paths = (array) $paths; - if (!$prefix) { - // Register directories for the root namespace. - if ($prepend) { - $this->fallbackDirsPsr4 = array_merge( - $paths, - $this->fallbackDirsPsr4 - ); - } else { - $this->fallbackDirsPsr4 = array_merge( - $this->fallbackDirsPsr4, - $paths - ); - } - } elseif (!isset($this->prefixDirsPsr4[$prefix])) { - // Register directories for a new namespace. - $length = strlen($prefix); - if ('\\' !== $prefix[$length - 1]) { - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); - } - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = $paths; - } elseif ($prepend) { - // Prepend directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - $paths, - $this->prefixDirsPsr4[$prefix] - ); - } else { - // Append directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - $this->prefixDirsPsr4[$prefix], - $paths - ); - } - } - - /** - * Registers a set of PSR-0 directories for a given prefix, - * replacing any others previously set for this prefix. - * - * @param string $prefix The prefix - * @param list|string $paths The PSR-0 base directories - * - * @return void - */ - public function set($prefix, $paths) - { - if (!$prefix) { - $this->fallbackDirsPsr0 = (array) $paths; - } else { - $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; - } - } - - /** - * Registers a set of PSR-4 directories for a given namespace, - * replacing any others previously set for this namespace. - * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param list|string $paths The PSR-4 base directories - * - * @throws \InvalidArgumentException - * - * @return void - */ - public function setPsr4($prefix, $paths) - { - if (!$prefix) { - $this->fallbackDirsPsr4 = (array) $paths; - } else { - $length = strlen($prefix); - if ('\\' !== $prefix[$length - 1]) { - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); - } - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; - } - } - - /** - * Turns on searching the include path for class files. - * - * @param bool $useIncludePath - * - * @return void - */ - public function setUseIncludePath($useIncludePath) - { - $this->useIncludePath = $useIncludePath; - } - - /** - * Can be used to check if the autoloader uses the include path to check - * for classes. - * - * @return bool - */ - public function getUseIncludePath() - { - return $this->useIncludePath; - } - - /** - * Turns off searching the prefix and fallback directories for classes - * that have not been registered with the class map. - * - * @param bool $classMapAuthoritative - * - * @return void - */ - public function setClassMapAuthoritative($classMapAuthoritative) - { - $this->classMapAuthoritative = $classMapAuthoritative; - } - - /** - * Should class lookup fail if not found in the current class map? - * - * @return bool - */ - public function isClassMapAuthoritative() - { - return $this->classMapAuthoritative; - } - - /** - * APCu prefix to use to cache found/not-found classes, if the extension is enabled. - * - * @param string|null $apcuPrefix - * - * @return void - */ - public function setApcuPrefix($apcuPrefix) - { - $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; - } - - /** - * The APCu prefix in use, or null if APCu caching is not enabled. - * - * @return string|null - */ - public function getApcuPrefix() - { - return $this->apcuPrefix; - } - - /** - * Registers this instance as an autoloader. - * - * @param bool $prepend Whether to prepend the autoloader or not - * - * @return void - */ - public function register($prepend = false) - { - spl_autoload_register(array($this, 'loadClass'), true, $prepend); - - if (null === $this->vendorDir) { - return; - } - - if ($prepend) { - self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; - } else { - unset(self::$registeredLoaders[$this->vendorDir]); - self::$registeredLoaders[$this->vendorDir] = $this; - } - } - - /** - * Unregisters this instance as an autoloader. - * - * @return void - */ - public function unregister() - { - spl_autoload_unregister(array($this, 'loadClass')); - - if (null !== $this->vendorDir) { - unset(self::$registeredLoaders[$this->vendorDir]); - } - } - - /** - * Loads the given class or interface. - * - * @param string $class The name of the class - * @return true|null True if loaded, null otherwise - */ - public function loadClass($class) - { - if ($file = $this->findFile($class)) { - $includeFile = self::$includeFile; - $includeFile($file); - - return true; - } - - return null; - } - - /** - * Finds the path to the file where the class is defined. - * - * @param string $class The name of the class - * - * @return string|false The path if found, false otherwise - */ - public function findFile($class) - { - // class map lookup - if (isset($this->classMap[$class])) { - return $this->classMap[$class]; - } - if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { - return false; - } - if (null !== $this->apcuPrefix) { - $file = apcu_fetch($this->apcuPrefix.$class, $hit); - if ($hit) { - return $file; - } - } - - $file = $this->findFileWithExtension($class, '.php'); - - // Search for Hack files if we are running on HHVM - if (false === $file && defined('HHVM_VERSION')) { - $file = $this->findFileWithExtension($class, '.hh'); - } - - if (null !== $this->apcuPrefix) { - apcu_add($this->apcuPrefix.$class, $file); - } - - if (false === $file) { - // Remember that this class does not exist. - $this->missingClasses[$class] = true; - } - - return $file; - } - - /** - * Returns the currently registered loaders keyed by their corresponding vendor directories. - * - * @return array - */ - public static function getRegisteredLoaders() - { - return self::$registeredLoaders; - } - - /** - * @param string $class - * @param string $ext - * @return string|false - */ - private function findFileWithExtension($class, $ext) - { - // PSR-4 lookup - $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; - - $first = $class[0]; - if (isset($this->prefixLengthsPsr4[$first])) { - $subPath = $class; - while (false !== $lastPos = strrpos($subPath, '\\')) { - $subPath = substr($subPath, 0, $lastPos); - $search = $subPath . '\\'; - if (isset($this->prefixDirsPsr4[$search])) { - $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); - foreach ($this->prefixDirsPsr4[$search] as $dir) { - if (file_exists($file = $dir . $pathEnd)) { - return $file; - } - } - } - } - } - - // PSR-4 fallback dirs - foreach ($this->fallbackDirsPsr4 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { - return $file; - } - } - - // PSR-0 lookup - if (false !== $pos = strrpos($class, '\\')) { - // namespaced class name - $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) - . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); - } else { - // PEAR-like class name - $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; - } - - if (isset($this->prefixesPsr0[$first])) { - foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { - if (0 === strpos($class, $prefix)) { - foreach ($dirs as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { - return $file; - } - } - } - } - } - - // PSR-0 fallback dirs - foreach ($this->fallbackDirsPsr0 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { - return $file; - } - } - - // PSR-0 include paths. - if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { - return $file; - } - - return false; - } - - /** - * @return void - */ - private static function initializeIncludeClosure() - { - if (self::$includeFile !== null) { - return; - } - - /** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - * - * @param string $file - * @return void - */ - self::$includeFile = \Closure::bind(static function($file) { - include $file; - }, null, null); - } -} diff --git a/composer/composer/InstalledVersions.php b/composer/composer/InstalledVersions.php deleted file mode 100644 index 07b32ed6ef..0000000000 --- a/composer/composer/InstalledVersions.php +++ /dev/null @@ -1,362 +0,0 @@ - - * Jordi Boggiano - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Composer; - -use Composer\Autoload\ClassLoader; -use Composer\Semver\VersionParser; - -/** - * This class is copied in every Composer installed project and available to all - * - * See also https://getcomposer.org/doc/07-runtime.md#installed-versions - * - * To require its presence, you can require `composer-runtime-api ^2.0` - * - * @final - */ -class InstalledVersions -{ - /** - * @var mixed[]|null - * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}|array{}|null - */ - private static $installed; - - /** - * @var bool|null - */ - private static $canGetVendors; - - /** - * @var array[] - * @psalm-var array}> - */ - private static $installedByVendor = array(); - - /** - * Returns a list of all package names which are present, either by being installed, replaced or provided - * - * @return string[] - * @psalm-return list - */ - public static function getInstalledPackages() - { - $packages = array(); - foreach (self::getInstalled() as $installed) { - $packages[] = array_keys($installed['versions']); - } - - if (1 === \count($packages)) { - return $packages[0]; - } - - return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); - } - - /** - * Returns a list of all package names with a specific type e.g. 'library' - * - * @param string $type - * @return string[] - * @psalm-return list - */ - public static function getInstalledPackagesByType($type) - { - $packagesByType = array(); - - foreach (self::getInstalled() as $installed) { - foreach ($installed['versions'] as $name => $package) { - if (isset($package['type']) && $package['type'] === $type) { - $packagesByType[] = $name; - } - } - } - - return $packagesByType; - } - - /** - * Checks whether the given package is installed - * - * This also returns true if the package name is provided or replaced by another package - * - * @param string $packageName - * @param bool $includeDevRequirements - * @return bool - */ - public static function isInstalled($packageName, $includeDevRequirements = true) - { - foreach (self::getInstalled() as $installed) { - if (isset($installed['versions'][$packageName])) { - return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false; - } - } - - return false; - } - - /** - * Checks whether the given package satisfies a version constraint - * - * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: - * - * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') - * - * @param VersionParser $parser Install composer/semver to have access to this class and functionality - * @param string $packageName - * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package - * @return bool - */ - public static function satisfies(VersionParser $parser, $packageName, $constraint) - { - $constraint = $parser->parseConstraints((string) $constraint); - $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); - - return $provided->matches($constraint); - } - - /** - * Returns a version constraint representing all the range(s) which are installed for a given package - * - * It is easier to use this via isInstalled() with the $constraint argument if you need to check - * whether a given version of a package is installed, and not just whether it exists - * - * @param string $packageName - * @return string Version constraint usable with composer/semver - */ - public static function getVersionRanges($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - $ranges = array(); - if (isset($installed['versions'][$packageName]['pretty_version'])) { - $ranges[] = $installed['versions'][$packageName]['pretty_version']; - } - if (array_key_exists('aliases', $installed['versions'][$packageName])) { - $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); - } - if (array_key_exists('replaced', $installed['versions'][$packageName])) { - $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); - } - if (array_key_exists('provided', $installed['versions'][$packageName])) { - $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); - } - - return implode(' || ', $ranges); - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present - */ - public static function getVersion($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - if (!isset($installed['versions'][$packageName]['version'])) { - return null; - } - - return $installed['versions'][$packageName]['version']; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present - */ - public static function getPrettyVersion($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - if (!isset($installed['versions'][$packageName]['pretty_version'])) { - return null; - } - - return $installed['versions'][$packageName]['pretty_version']; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference - */ - public static function getReference($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - if (!isset($installed['versions'][$packageName]['reference'])) { - return null; - } - - return $installed['versions'][$packageName]['reference']; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. - */ - public static function getInstallPath($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @return array - * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool} - */ - public static function getRootPackage() - { - $installed = self::getInstalled(); - - return $installed[0]['root']; - } - - /** - * Returns the raw installed.php data for custom implementations - * - * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. - * @return array[] - * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} - */ - public static function getRawData() - { - @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); - - if (null === self::$installed) { - // only require the installed.php file if this file is loaded from its dumped location, - // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 - if (substr(__DIR__, -8, 1) !== 'C') { - self::$installed = include __DIR__ . '/installed.php'; - } else { - self::$installed = array(); - } - } - - return self::$installed; - } - - /** - * Returns the raw data of all installed.php which are currently loaded for custom implementations - * - * @return array[] - * @psalm-return list}> - */ - public static function getAllRawData() - { - return self::getInstalled(); - } - - /** - * Lets you reload the static array from another file - * - * This is only useful for complex integrations in which a project needs to use - * this class but then also needs to execute another project's autoloader in process, - * and wants to ensure both projects have access to their version of installed.php. - * - * A typical case would be PHPUnit, where it would need to make sure it reads all - * the data it needs from this class, then call reload() with - * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure - * the project in which it runs can then also use this class safely, without - * interference between PHPUnit's dependencies and the project's dependencies. - * - * @param array[] $data A vendor/composer/installed.php data set - * @return void - * - * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $data - */ - public static function reload($data) - { - self::$installed = $data; - self::$installedByVendor = array(); - } - - /** - * @return array[] - * @psalm-return list}> - */ - private static function getInstalled() - { - if (null === self::$canGetVendors) { - self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); - } - - $installed = array(); - $copiedLocalDir = false; - - if (self::$canGetVendors) { - foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { - if (isset(self::$installedByVendor[$vendorDir])) { - $installed[] = self::$installedByVendor[$vendorDir]; - } elseif (is_file($vendorDir.'/composer/installed.php')) { - /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ - $required = require $vendorDir.'/composer/installed.php'; - self::$installedByVendor[$vendorDir] = $required; - $installed[] = $required; - if (strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { - self::$installed = $required; - $copiedLocalDir = true; - } - } - } - } - - if (null === self::$installed) { - // only require the installed.php file if this file is loaded from its dumped location, - // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 - if (substr(__DIR__, -8, 1) !== 'C') { - /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ - $required = require __DIR__ . '/installed.php'; - self::$installed = $required; - } else { - self::$installed = array(); - } - } - - if (self::$installed !== array() && !$copiedLocalDir) { - $installed[] = self::$installed; - } - - return $installed; - } -} diff --git a/composer/composer/LICENSE b/composer/composer/LICENSE deleted file mode 100644 index f27399a042..0000000000 --- a/composer/composer/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - -Copyright (c) Nils Adermann, Jordi Boggiano - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - diff --git a/composer/composer/autoload_classmap.php b/composer/composer/autoload_classmap.php deleted file mode 100644 index 99384ca436..0000000000 --- a/composer/composer/autoload_classmap.php +++ /dev/null @@ -1,104 +0,0 @@ - $vendorDir . '/composer/InstalledVersions.php', - 'OCA\\Richdocuments\\AppConfig' => $baseDir . '/../lib/AppConfig.php', - 'OCA\\Richdocuments\\AppInfo\\Application' => $baseDir . '/../lib/AppInfo/Application.php', - 'OCA\\Richdocuments\\Backgroundjobs\\Cleanup' => $baseDir . '/../lib/Backgroundjobs/Cleanup.php', - 'OCA\\Richdocuments\\Backgroundjobs\\ObtainCapabilities' => $baseDir . '/../lib/Backgroundjobs/ObtainCapabilities.php', - 'OCA\\Richdocuments\\Capabilities' => $baseDir . '/../lib/Capabilities.php', - 'OCA\\Richdocuments\\Command\\ActivateConfig' => $baseDir . '/../lib/Command/ActivateConfig.php', - 'OCA\\Richdocuments\\Command\\ConvertToBigInt' => $baseDir . '/../lib/Command/ConvertToBigInt.php', - 'OCA\\Richdocuments\\Command\\InstallDefaultFonts' => $baseDir . '/../lib/Command/InstallDefaultFonts.php', - 'OCA\\Richdocuments\\Command\\UpdateEmptyTemplates' => $baseDir . '/../lib/Command/UpdateEmptyTemplates.php', - 'OCA\\Richdocuments\\Controller\\AssetsController' => $baseDir . '/../lib/Controller/AssetsController.php', - 'OCA\\Richdocuments\\Controller\\Attribute\\RestrictToWopiServer' => $baseDir . '/../lib/Controller/Attribute/RestrictToWopiServer.php', - 'OCA\\Richdocuments\\Controller\\DirectViewController' => $baseDir . '/../lib/Controller/DirectViewController.php', - 'OCA\\Richdocuments\\Controller\\DocumentAPIController' => $baseDir . '/../lib/Controller/DocumentAPIController.php', - 'OCA\\Richdocuments\\Controller\\DocumentController' => $baseDir . '/../lib/Controller/DocumentController.php', - 'OCA\\Richdocuments\\Controller\\DocumentTrait' => $baseDir . '/../lib/Controller/DocumentTrait.php', - 'OCA\\Richdocuments\\Controller\\FederationController' => $baseDir . '/../lib/Controller/FederationController.php', - 'OCA\\Richdocuments\\Controller\\MentionController' => $baseDir . '/../lib/Controller/MentionController.php', - 'OCA\\Richdocuments\\Controller\\OCSController' => $baseDir . '/../lib/Controller/OCSController.php', - 'OCA\\Richdocuments\\Controller\\SettingsController' => $baseDir . '/../lib/Controller/SettingsController.php', - 'OCA\\Richdocuments\\Controller\\TargetController' => $baseDir . '/../lib/Controller/TargetController.php', - 'OCA\\Richdocuments\\Controller\\TemplateFieldController' => $baseDir . '/../lib/Controller/TemplateFieldController.php', - 'OCA\\Richdocuments\\Controller\\TemplatesController' => $baseDir . '/../lib/Controller/TemplatesController.php', - 'OCA\\Richdocuments\\Controller\\WopiController' => $baseDir . '/../lib/Controller/WopiController.php', - 'OCA\\Richdocuments\\Db\\Asset' => $baseDir . '/../lib/Db/Asset.php', - 'OCA\\Richdocuments\\Db\\AssetMapper' => $baseDir . '/../lib/Db/AssetMapper.php', - 'OCA\\Richdocuments\\Db\\Direct' => $baseDir . '/../lib/Db/Direct.php', - 'OCA\\Richdocuments\\Db\\DirectMapper' => $baseDir . '/../lib/Db/DirectMapper.php', - 'OCA\\Richdocuments\\Db\\Wopi' => $baseDir . '/../lib/Db/Wopi.php', - 'OCA\\Richdocuments\\Db\\WopiMapper' => $baseDir . '/../lib/Db/WopiMapper.php', - 'OCA\\Richdocuments\\Events\\BeforeFederationRedirectEvent' => $baseDir . '/../lib/Events/BeforeFederationRedirectEvent.php', - 'OCA\\Richdocuments\\Events\\DocumentOpenedEvent' => $baseDir . '/../lib/Events/DocumentOpenedEvent.php', - 'OCA\\Richdocuments\\Exceptions\\ExpiredTokenException' => $baseDir . '/../lib/Exceptions/ExpiredTokenException.php', - 'OCA\\Richdocuments\\Exceptions\\UnknownTokenException' => $baseDir . '/../lib/Exceptions/UnknownTokenException.php', - 'OCA\\Richdocuments\\Helper' => $baseDir . '/../lib/Helper.php', - 'OCA\\Richdocuments\\Listener\\AddContentSecurityPolicyListener' => $baseDir . '/../lib/Listener/AddContentSecurityPolicyListener.php', - 'OCA\\Richdocuments\\Listener\\AddFeaturePolicyListener' => $baseDir . '/../lib/Listener/AddFeaturePolicyListener.php', - 'OCA\\Richdocuments\\Listener\\BeforeFetchPreviewListener' => $baseDir . '/../lib/Listener/BeforeFetchPreviewListener.php', - 'OCA\\Richdocuments\\Listener\\BeforeGetTemplatesListener' => $baseDir . '/../lib/Listener/BeforeGetTemplatesListener.php', - 'OCA\\Richdocuments\\Listener\\BeforeTemplateRenderedListener' => $baseDir . '/../lib/Listener/BeforeTemplateRenderedListener.php', - 'OCA\\Richdocuments\\Listener\\FileCreatedFromTemplateListener' => $baseDir . '/../lib/Listener/FileCreatedFromTemplateListener.php', - 'OCA\\Richdocuments\\Listener\\LoadAdditionalListener' => $baseDir . '/../lib/Listener/LoadAdditionalListener.php', - 'OCA\\Richdocuments\\Listener\\LoadViewerListener' => $baseDir . '/../lib/Listener/LoadViewerListener.php', - 'OCA\\Richdocuments\\Listener\\ReferenceListener' => $baseDir . '/../lib/Listener/ReferenceListener.php', - 'OCA\\Richdocuments\\Listener\\RegisterTemplateFileCreatorListener' => $baseDir . '/../lib/Listener/RegisterTemplateFileCreatorListener.php', - 'OCA\\Richdocuments\\Listener\\ShareLinkListener' => $baseDir . '/../lib/Listener/ShareLinkListener.php', - 'OCA\\Richdocuments\\Middleware\\WOPIMiddleware' => $baseDir . '/../lib/Middleware/WOPIMiddleware.php', - 'OCA\\Richdocuments\\Migration\\InstallDefaultFonts' => $baseDir . '/../lib/Migration/InstallDefaultFonts.php', - 'OCA\\Richdocuments\\Migration\\Version2060Date20200302131958' => $baseDir . '/../lib/Migration/Version2060Date20200302131958.php', - 'OCA\\Richdocuments\\Migration\\Version2060Date20200302132145' => $baseDir . '/../lib/Migration/Version2060Date20200302132145.php', - 'OCA\\Richdocuments\\Migration\\Version30704Date20200626072306' => $baseDir . '/../lib/Migration/Version30704Date20200626072306.php', - 'OCA\\Richdocuments\\Migration\\Version30709Date20201111104147' => $baseDir . '/../lib/Migration/Version30709Date20201111104147.php', - 'OCA\\Richdocuments\\Migration\\Version30717Date20210310164901' => $baseDir . '/../lib/Migration/Version30717Date20210310164901.php', - 'OCA\\Richdocuments\\Migration\\Version50200Date20211220212457' => $baseDir . '/../lib/Migration/Version50200Date20211220212457.php', - 'OCA\\Richdocuments\\Notification\\Notifier' => $baseDir . '/../lib/Notification/Notifier.php', - 'OCA\\Richdocuments\\PermissionManager' => $baseDir . '/../lib/PermissionManager.php', - 'OCA\\Richdocuments\\Preview\\EMF' => $baseDir . '/../lib/Preview/EMF.php', - 'OCA\\Richdocuments\\Preview\\MSExcel' => $baseDir . '/../lib/Preview/MSExcel.php', - 'OCA\\Richdocuments\\Preview\\MSWord' => $baseDir . '/../lib/Preview/MSWord.php', - 'OCA\\Richdocuments\\Preview\\OOXML' => $baseDir . '/../lib/Preview/OOXML.php', - 'OCA\\Richdocuments\\Preview\\Office' => $baseDir . '/../lib/Preview/Office.php', - 'OCA\\Richdocuments\\Preview\\OpenDocument' => $baseDir . '/../lib/Preview/OpenDocument.php', - 'OCA\\Richdocuments\\Preview\\Pdf' => $baseDir . '/../lib/Preview/Pdf.php', - 'OCA\\Richdocuments\\Reference\\OfficeTargetReferenceProvider' => $baseDir . '/../lib/Reference/OfficeTargetReferenceProvider.php', - 'OCA\\Richdocuments\\Service\\CachedRequestService' => $baseDir . '/../lib/Service/CachedRequestService.php', - 'OCA\\Richdocuments\\Service\\CapabilitiesService' => $baseDir . '/../lib/Service/CapabilitiesService.php', - 'OCA\\Richdocuments\\Service\\ConnectivityService' => $baseDir . '/../lib/Service/ConnectivityService.php', - 'OCA\\Richdocuments\\Service\\DemoService' => $baseDir . '/../lib/Service/DemoService.php', - 'OCA\\Richdocuments\\Service\\DiscoveryService' => $baseDir . '/../lib/Service/DiscoveryService.php', - 'OCA\\Richdocuments\\Service\\FederationService' => $baseDir . '/../lib/Service/FederationService.php', - 'OCA\\Richdocuments\\Service\\FileTargetService' => $baseDir . '/../lib/Service/FileTargetService.php', - 'OCA\\Richdocuments\\Service\\FontService' => $baseDir . '/../lib/Service/FontService.php', - 'OCA\\Richdocuments\\Service\\InitialStateService' => $baseDir . '/../lib/Service/InitialStateService.php', - 'OCA\\Richdocuments\\Service\\PdfService' => $baseDir . '/../lib/Service/PdfService.php', - 'OCA\\Richdocuments\\Service\\RemoteOptionsService' => $baseDir . '/../lib/Service/RemoteOptionsService.php', - 'OCA\\Richdocuments\\Service\\RemoteService' => $baseDir . '/../lib/Service/RemoteService.php', - 'OCA\\Richdocuments\\Service\\TemplateFieldService' => $baseDir . '/../lib/Service/TemplateFieldService.php', - 'OCA\\Richdocuments\\Service\\UserScopeService' => $baseDir . '/../lib/Service/UserScopeService.php', - 'OCA\\Richdocuments\\Settings\\Admin' => $baseDir . '/../lib/Settings/Admin.php', - 'OCA\\Richdocuments\\Settings\\Personal' => $baseDir . '/../lib/Settings/Personal.php', - 'OCA\\Richdocuments\\Settings\\Section' => $baseDir . '/../lib/Settings/Section.php', - 'OCA\\Richdocuments\\TemplateManager' => $baseDir . '/../lib/TemplateManager.php', - 'OCA\\Richdocuments\\Template\\CollaboraTemplateProvider' => $baseDir . '/../lib/Template/CollaboraTemplateProvider.php', - 'OCA\\Richdocuments\\TokenManager' => $baseDir . '/../lib/TokenManager.php', - 'OCA\\Richdocuments\\UploadException' => $baseDir . '/../lib/UploadException.php', - 'OCA\\Richdocuments\\WOPI\\Parser' => $baseDir . '/../lib/WOPI/Parser.php', - 'mikehaertl\\pdftk\\Command' => $vendorDir . '/mikehaertl/php-pdftk/src/Command.php', - 'mikehaertl\\pdftk\\DataFields' => $vendorDir . '/mikehaertl/php-pdftk/src/DataFields.php', - 'mikehaertl\\pdftk\\FdfFile' => $vendorDir . '/mikehaertl/php-pdftk/src/FdfFile.php', - 'mikehaertl\\pdftk\\InfoFields' => $vendorDir . '/mikehaertl/php-pdftk/src/InfoFields.php', - 'mikehaertl\\pdftk\\InfoFile' => $vendorDir . '/mikehaertl/php-pdftk/src/InfoFile.php', - 'mikehaertl\\pdftk\\Pdf' => $vendorDir . '/mikehaertl/php-pdftk/src/Pdf.php', - 'mikehaertl\\pdftk\\XfdfFile' => $vendorDir . '/mikehaertl/php-pdftk/src/XfdfFile.php', - 'mikehaertl\\shellcommand\\Command' => $vendorDir . '/mikehaertl/php-shellcommand/src/Command.php', - 'mikehaertl\\tmp\\File' => $vendorDir . '/mikehaertl/php-tmpfile/src/File.php', -); diff --git a/composer/composer/autoload_namespaces.php b/composer/composer/autoload_namespaces.php deleted file mode 100644 index 3f5c929625..0000000000 --- a/composer/composer/autoload_namespaces.php +++ /dev/null @@ -1,9 +0,0 @@ - array($vendorDir . '/mikehaertl/php-tmpfile/src'), - 'mikehaertl\\shellcommand\\' => array($vendorDir . '/mikehaertl/php-shellcommand/src'), - 'mikehaertl\\pdftk\\' => array($vendorDir . '/mikehaertl/php-pdftk/src'), - 'OCA\\Richdocuments\\' => array($baseDir . '/../lib'), -); diff --git a/composer/composer/autoload_real.php b/composer/composer/autoload_real.php deleted file mode 100644 index b1646a59d0..0000000000 --- a/composer/composer/autoload_real.php +++ /dev/null @@ -1,38 +0,0 @@ -register(true); - - return $loader; - } -} diff --git a/composer/composer/autoload_static.php b/composer/composer/autoload_static.php deleted file mode 100644 index 69c27e4de1..0000000000 --- a/composer/composer/autoload_static.php +++ /dev/null @@ -1,148 +0,0 @@ - - array ( - 'mikehaertl\\tmp\\' => 15, - 'mikehaertl\\shellcommand\\' => 24, - 'mikehaertl\\pdftk\\' => 17, - ), - 'O' => - array ( - 'OCA\\Richdocuments\\' => 18, - ), - ); - - public static $prefixDirsPsr4 = array ( - 'mikehaertl\\tmp\\' => - array ( - 0 => __DIR__ . '/..' . '/mikehaertl/php-tmpfile/src', - ), - 'mikehaertl\\shellcommand\\' => - array ( - 0 => __DIR__ . '/..' . '/mikehaertl/php-shellcommand/src', - ), - 'mikehaertl\\pdftk\\' => - array ( - 0 => __DIR__ . '/..' . '/mikehaertl/php-pdftk/src', - ), - 'OCA\\Richdocuments\\' => - array ( - 0 => __DIR__ . '/..' . '/../lib', - ), - ); - - public static $classMap = array ( - 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', - 'OCA\\Richdocuments\\AppConfig' => __DIR__ . '/..' . '/../lib/AppConfig.php', - 'OCA\\Richdocuments\\AppInfo\\Application' => __DIR__ . '/..' . '/../lib/AppInfo/Application.php', - 'OCA\\Richdocuments\\Backgroundjobs\\Cleanup' => __DIR__ . '/..' . '/../lib/Backgroundjobs/Cleanup.php', - 'OCA\\Richdocuments\\Backgroundjobs\\ObtainCapabilities' => __DIR__ . '/..' . '/../lib/Backgroundjobs/ObtainCapabilities.php', - 'OCA\\Richdocuments\\Capabilities' => __DIR__ . '/..' . '/../lib/Capabilities.php', - 'OCA\\Richdocuments\\Command\\ActivateConfig' => __DIR__ . '/..' . '/../lib/Command/ActivateConfig.php', - 'OCA\\Richdocuments\\Command\\ConvertToBigInt' => __DIR__ . '/..' . '/../lib/Command/ConvertToBigInt.php', - 'OCA\\Richdocuments\\Command\\InstallDefaultFonts' => __DIR__ . '/..' . '/../lib/Command/InstallDefaultFonts.php', - 'OCA\\Richdocuments\\Command\\UpdateEmptyTemplates' => __DIR__ . '/..' . '/../lib/Command/UpdateEmptyTemplates.php', - 'OCA\\Richdocuments\\Controller\\AssetsController' => __DIR__ . '/..' . '/../lib/Controller/AssetsController.php', - 'OCA\\Richdocuments\\Controller\\Attribute\\RestrictToWopiServer' => __DIR__ . '/..' . '/../lib/Controller/Attribute/RestrictToWopiServer.php', - 'OCA\\Richdocuments\\Controller\\DirectViewController' => __DIR__ . '/..' . '/../lib/Controller/DirectViewController.php', - 'OCA\\Richdocuments\\Controller\\DocumentAPIController' => __DIR__ . '/..' . '/../lib/Controller/DocumentAPIController.php', - 'OCA\\Richdocuments\\Controller\\DocumentController' => __DIR__ . '/..' . '/../lib/Controller/DocumentController.php', - 'OCA\\Richdocuments\\Controller\\DocumentTrait' => __DIR__ . '/..' . '/../lib/Controller/DocumentTrait.php', - 'OCA\\Richdocuments\\Controller\\FederationController' => __DIR__ . '/..' . '/../lib/Controller/FederationController.php', - 'OCA\\Richdocuments\\Controller\\MentionController' => __DIR__ . '/..' . '/../lib/Controller/MentionController.php', - 'OCA\\Richdocuments\\Controller\\OCSController' => __DIR__ . '/..' . '/../lib/Controller/OCSController.php', - 'OCA\\Richdocuments\\Controller\\SettingsController' => __DIR__ . '/..' . '/../lib/Controller/SettingsController.php', - 'OCA\\Richdocuments\\Controller\\TargetController' => __DIR__ . '/..' . '/../lib/Controller/TargetController.php', - 'OCA\\Richdocuments\\Controller\\TemplateFieldController' => __DIR__ . '/..' . '/../lib/Controller/TemplateFieldController.php', - 'OCA\\Richdocuments\\Controller\\TemplatesController' => __DIR__ . '/..' . '/../lib/Controller/TemplatesController.php', - 'OCA\\Richdocuments\\Controller\\WopiController' => __DIR__ . '/..' . '/../lib/Controller/WopiController.php', - 'OCA\\Richdocuments\\Db\\Asset' => __DIR__ . '/..' . '/../lib/Db/Asset.php', - 'OCA\\Richdocuments\\Db\\AssetMapper' => __DIR__ . '/..' . '/../lib/Db/AssetMapper.php', - 'OCA\\Richdocuments\\Db\\Direct' => __DIR__ . '/..' . '/../lib/Db/Direct.php', - 'OCA\\Richdocuments\\Db\\DirectMapper' => __DIR__ . '/..' . '/../lib/Db/DirectMapper.php', - 'OCA\\Richdocuments\\Db\\Wopi' => __DIR__ . '/..' . '/../lib/Db/Wopi.php', - 'OCA\\Richdocuments\\Db\\WopiMapper' => __DIR__ . '/..' . '/../lib/Db/WopiMapper.php', - 'OCA\\Richdocuments\\Events\\BeforeFederationRedirectEvent' => __DIR__ . '/..' . '/../lib/Events/BeforeFederationRedirectEvent.php', - 'OCA\\Richdocuments\\Events\\DocumentOpenedEvent' => __DIR__ . '/..' . '/../lib/Events/DocumentOpenedEvent.php', - 'OCA\\Richdocuments\\Exceptions\\ExpiredTokenException' => __DIR__ . '/..' . '/../lib/Exceptions/ExpiredTokenException.php', - 'OCA\\Richdocuments\\Exceptions\\UnknownTokenException' => __DIR__ . '/..' . '/../lib/Exceptions/UnknownTokenException.php', - 'OCA\\Richdocuments\\Helper' => __DIR__ . '/..' . '/../lib/Helper.php', - 'OCA\\Richdocuments\\Listener\\AddContentSecurityPolicyListener' => __DIR__ . '/..' . '/../lib/Listener/AddContentSecurityPolicyListener.php', - 'OCA\\Richdocuments\\Listener\\AddFeaturePolicyListener' => __DIR__ . '/..' . '/../lib/Listener/AddFeaturePolicyListener.php', - 'OCA\\Richdocuments\\Listener\\BeforeFetchPreviewListener' => __DIR__ . '/..' . '/../lib/Listener/BeforeFetchPreviewListener.php', - 'OCA\\Richdocuments\\Listener\\BeforeGetTemplatesListener' => __DIR__ . '/..' . '/../lib/Listener/BeforeGetTemplatesListener.php', - 'OCA\\Richdocuments\\Listener\\BeforeTemplateRenderedListener' => __DIR__ . '/..' . '/../lib/Listener/BeforeTemplateRenderedListener.php', - 'OCA\\Richdocuments\\Listener\\FileCreatedFromTemplateListener' => __DIR__ . '/..' . '/../lib/Listener/FileCreatedFromTemplateListener.php', - 'OCA\\Richdocuments\\Listener\\LoadAdditionalListener' => __DIR__ . '/..' . '/../lib/Listener/LoadAdditionalListener.php', - 'OCA\\Richdocuments\\Listener\\LoadViewerListener' => __DIR__ . '/..' . '/../lib/Listener/LoadViewerListener.php', - 'OCA\\Richdocuments\\Listener\\ReferenceListener' => __DIR__ . '/..' . '/../lib/Listener/ReferenceListener.php', - 'OCA\\Richdocuments\\Listener\\RegisterTemplateFileCreatorListener' => __DIR__ . '/..' . '/../lib/Listener/RegisterTemplateFileCreatorListener.php', - 'OCA\\Richdocuments\\Listener\\ShareLinkListener' => __DIR__ . '/..' . '/../lib/Listener/ShareLinkListener.php', - 'OCA\\Richdocuments\\Middleware\\WOPIMiddleware' => __DIR__ . '/..' . '/../lib/Middleware/WOPIMiddleware.php', - 'OCA\\Richdocuments\\Migration\\InstallDefaultFonts' => __DIR__ . '/..' . '/../lib/Migration/InstallDefaultFonts.php', - 'OCA\\Richdocuments\\Migration\\Version2060Date20200302131958' => __DIR__ . '/..' . '/../lib/Migration/Version2060Date20200302131958.php', - 'OCA\\Richdocuments\\Migration\\Version2060Date20200302132145' => __DIR__ . '/..' . '/../lib/Migration/Version2060Date20200302132145.php', - 'OCA\\Richdocuments\\Migration\\Version30704Date20200626072306' => __DIR__ . '/..' . '/../lib/Migration/Version30704Date20200626072306.php', - 'OCA\\Richdocuments\\Migration\\Version30709Date20201111104147' => __DIR__ . '/..' . '/../lib/Migration/Version30709Date20201111104147.php', - 'OCA\\Richdocuments\\Migration\\Version30717Date20210310164901' => __DIR__ . '/..' . '/../lib/Migration/Version30717Date20210310164901.php', - 'OCA\\Richdocuments\\Migration\\Version50200Date20211220212457' => __DIR__ . '/..' . '/../lib/Migration/Version50200Date20211220212457.php', - 'OCA\\Richdocuments\\Notification\\Notifier' => __DIR__ . '/..' . '/../lib/Notification/Notifier.php', - 'OCA\\Richdocuments\\PermissionManager' => __DIR__ . '/..' . '/../lib/PermissionManager.php', - 'OCA\\Richdocuments\\Preview\\EMF' => __DIR__ . '/..' . '/../lib/Preview/EMF.php', - 'OCA\\Richdocuments\\Preview\\MSExcel' => __DIR__ . '/..' . '/../lib/Preview/MSExcel.php', - 'OCA\\Richdocuments\\Preview\\MSWord' => __DIR__ . '/..' . '/../lib/Preview/MSWord.php', - 'OCA\\Richdocuments\\Preview\\OOXML' => __DIR__ . '/..' . '/../lib/Preview/OOXML.php', - 'OCA\\Richdocuments\\Preview\\Office' => __DIR__ . '/..' . '/../lib/Preview/Office.php', - 'OCA\\Richdocuments\\Preview\\OpenDocument' => __DIR__ . '/..' . '/../lib/Preview/OpenDocument.php', - 'OCA\\Richdocuments\\Preview\\Pdf' => __DIR__ . '/..' . '/../lib/Preview/Pdf.php', - 'OCA\\Richdocuments\\Reference\\OfficeTargetReferenceProvider' => __DIR__ . '/..' . '/../lib/Reference/OfficeTargetReferenceProvider.php', - 'OCA\\Richdocuments\\Service\\CachedRequestService' => __DIR__ . '/..' . '/../lib/Service/CachedRequestService.php', - 'OCA\\Richdocuments\\Service\\CapabilitiesService' => __DIR__ . '/..' . '/../lib/Service/CapabilitiesService.php', - 'OCA\\Richdocuments\\Service\\ConnectivityService' => __DIR__ . '/..' . '/../lib/Service/ConnectivityService.php', - 'OCA\\Richdocuments\\Service\\DemoService' => __DIR__ . '/..' . '/../lib/Service/DemoService.php', - 'OCA\\Richdocuments\\Service\\DiscoveryService' => __DIR__ . '/..' . '/../lib/Service/DiscoveryService.php', - 'OCA\\Richdocuments\\Service\\FederationService' => __DIR__ . '/..' . '/../lib/Service/FederationService.php', - 'OCA\\Richdocuments\\Service\\FileTargetService' => __DIR__ . '/..' . '/../lib/Service/FileTargetService.php', - 'OCA\\Richdocuments\\Service\\FontService' => __DIR__ . '/..' . '/../lib/Service/FontService.php', - 'OCA\\Richdocuments\\Service\\InitialStateService' => __DIR__ . '/..' . '/../lib/Service/InitialStateService.php', - 'OCA\\Richdocuments\\Service\\PdfService' => __DIR__ . '/..' . '/../lib/Service/PdfService.php', - 'OCA\\Richdocuments\\Service\\RemoteOptionsService' => __DIR__ . '/..' . '/../lib/Service/RemoteOptionsService.php', - 'OCA\\Richdocuments\\Service\\RemoteService' => __DIR__ . '/..' . '/../lib/Service/RemoteService.php', - 'OCA\\Richdocuments\\Service\\TemplateFieldService' => __DIR__ . '/..' . '/../lib/Service/TemplateFieldService.php', - 'OCA\\Richdocuments\\Service\\UserScopeService' => __DIR__ . '/..' . '/../lib/Service/UserScopeService.php', - 'OCA\\Richdocuments\\Settings\\Admin' => __DIR__ . '/..' . '/../lib/Settings/Admin.php', - 'OCA\\Richdocuments\\Settings\\Personal' => __DIR__ . '/..' . '/../lib/Settings/Personal.php', - 'OCA\\Richdocuments\\Settings\\Section' => __DIR__ . '/..' . '/../lib/Settings/Section.php', - 'OCA\\Richdocuments\\TemplateManager' => __DIR__ . '/..' . '/../lib/TemplateManager.php', - 'OCA\\Richdocuments\\Template\\CollaboraTemplateProvider' => __DIR__ . '/..' . '/../lib/Template/CollaboraTemplateProvider.php', - 'OCA\\Richdocuments\\TokenManager' => __DIR__ . '/..' . '/../lib/TokenManager.php', - 'OCA\\Richdocuments\\UploadException' => __DIR__ . '/..' . '/../lib/UploadException.php', - 'OCA\\Richdocuments\\WOPI\\Parser' => __DIR__ . '/..' . '/../lib/WOPI/Parser.php', - 'mikehaertl\\pdftk\\Command' => __DIR__ . '/..' . '/mikehaertl/php-pdftk/src/Command.php', - 'mikehaertl\\pdftk\\DataFields' => __DIR__ . '/..' . '/mikehaertl/php-pdftk/src/DataFields.php', - 'mikehaertl\\pdftk\\FdfFile' => __DIR__ . '/..' . '/mikehaertl/php-pdftk/src/FdfFile.php', - 'mikehaertl\\pdftk\\InfoFields' => __DIR__ . '/..' . '/mikehaertl/php-pdftk/src/InfoFields.php', - 'mikehaertl\\pdftk\\InfoFile' => __DIR__ . '/..' . '/mikehaertl/php-pdftk/src/InfoFile.php', - 'mikehaertl\\pdftk\\Pdf' => __DIR__ . '/..' . '/mikehaertl/php-pdftk/src/Pdf.php', - 'mikehaertl\\pdftk\\XfdfFile' => __DIR__ . '/..' . '/mikehaertl/php-pdftk/src/XfdfFile.php', - 'mikehaertl\\shellcommand\\Command' => __DIR__ . '/..' . '/mikehaertl/php-shellcommand/src/Command.php', - 'mikehaertl\\tmp\\File' => __DIR__ . '/..' . '/mikehaertl/php-tmpfile/src/File.php', - ); - - public static function getInitializer(ClassLoader $loader) - { - return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInitRichdocuments::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInitRichdocuments::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInitRichdocuments::$classMap; - - }, null, ClassLoader::class); - } -} diff --git a/composer/composer/installed.json b/composer/composer/installed.json deleted file mode 100644 index d8976c6367..0000000000 --- a/composer/composer/installed.json +++ /dev/null @@ -1,154 +0,0 @@ -{ - "packages": [ - { - "name": "mikehaertl/php-pdftk", - "version": "0.13.1", - "version_normalized": "0.13.1.0", - "source": { - "type": "git", - "url": "https://github.com/mikehaertl/php-pdftk.git", - "reference": "3851b08c1027489e48387d7c14c27bc295d98239" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mikehaertl/php-pdftk/zipball/3851b08c1027489e48387d7c14c27bc295d98239", - "reference": "3851b08c1027489e48387d7c14c27bc295d98239", - "shasum": "" - }, - "require": { - "mikehaertl/php-shellcommand": "^1.6.3", - "mikehaertl/php-tmpfile": "^1.1.0", - "php": ">=5.3.0" - }, - "require-dev": { - "phpunit/phpunit": ">4.0 <9.4" - }, - "time": "2023-11-03T16:06:08+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "mikehaertl\\pdftk\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Haertl", - "email": "haertl.mike@gmail.com" - } - ], - "description": "A PDF conversion and form utility based on pdftk.", - "keywords": [ - "pdf", - "pdftk" - ], - "support": { - "issues": "https://github.com/mikehaertl/php-pdftk/issues", - "source": "https://github.com/mikehaertl/php-pdftk/tree/0.13.1" - }, - "install-path": "../mikehaertl/php-pdftk" - }, - { - "name": "mikehaertl/php-shellcommand", - "version": "1.7.0", - "version_normalized": "1.7.0.0", - "source": { - "type": "git", - "url": "https://github.com/mikehaertl/php-shellcommand.git", - "reference": "e79ea528be155ffdec6f3bf1a4a46307bb49e545" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mikehaertl/php-shellcommand/zipball/e79ea528be155ffdec6f3bf1a4a46307bb49e545", - "reference": "e79ea528be155ffdec6f3bf1a4a46307bb49e545", - "shasum": "" - }, - "require": { - "php": ">= 5.3.0" - }, - "require-dev": { - "phpunit/phpunit": ">4.0 <=9.4" - }, - "time": "2023-04-19T08:25:22+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "mikehaertl\\shellcommand\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Härtl", - "email": "haertl.mike@gmail.com" - } - ], - "description": "An object oriented interface to shell commands", - "keywords": [ - "shell" - ], - "support": { - "issues": "https://github.com/mikehaertl/php-shellcommand/issues", - "source": "https://github.com/mikehaertl/php-shellcommand/tree/1.7.0" - }, - "install-path": "../mikehaertl/php-shellcommand" - }, - { - "name": "mikehaertl/php-tmpfile", - "version": "1.2.1", - "version_normalized": "1.2.1.0", - "source": { - "type": "git", - "url": "https://github.com/mikehaertl/php-tmpfile.git", - "reference": "70a5b70b17bc0d9666388e6a551ecc93d0b40a10" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mikehaertl/php-tmpfile/zipball/70a5b70b17bc0d9666388e6a551ecc93d0b40a10", - "reference": "70a5b70b17bc0d9666388e6a551ecc93d0b40a10", - "shasum": "" - }, - "require-dev": { - "php": ">=5.3.0", - "phpunit/phpunit": ">4.0 <=9.4" - }, - "time": "2021-03-01T18:26:25+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "mikehaertl\\tmp\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Härtl", - "email": "haertl.mike@gmail.com" - } - ], - "description": "A convenience class for temporary files", - "keywords": [ - "files" - ], - "support": { - "issues": "https://github.com/mikehaertl/php-tmpfile/issues", - "source": "https://github.com/mikehaertl/php-tmpfile/tree/1.2.1" - }, - "install-path": "../mikehaertl/php-tmpfile" - } - ], - "dev": true, - "dev-package-names": [] -} diff --git a/composer/composer/installed.json.license b/composer/composer/installed.json.license deleted file mode 100644 index 75a458e9c0..0000000000 --- a/composer/composer/installed.json.license +++ /dev/null @@ -1,2 +0,0 @@ -SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors -SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/composer/composer/installed.php b/composer/composer/installed.php deleted file mode 100644 index bd0356e90c..0000000000 --- a/composer/composer/installed.php +++ /dev/null @@ -1,50 +0,0 @@ - array( - 'name' => '__root__', - 'pretty_version' => 'dev-main', - 'version' => 'dev-main', - 'reference' => '67cd9227378fdf3e0d4385eb2e43a3612b88672a', - 'type' => 'library', - 'install_path' => __DIR__ . '/../', - 'aliases' => array(), - 'dev' => true, - ), - 'versions' => array( - '__root__' => array( - 'pretty_version' => 'dev-main', - 'version' => 'dev-main', - 'reference' => '67cd9227378fdf3e0d4385eb2e43a3612b88672a', - 'type' => 'library', - 'install_path' => __DIR__ . '/../', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'mikehaertl/php-pdftk' => array( - 'pretty_version' => '0.13.1', - 'version' => '0.13.1.0', - 'reference' => '3851b08c1027489e48387d7c14c27bc295d98239', - 'type' => 'library', - 'install_path' => __DIR__ . '/../mikehaertl/php-pdftk', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'mikehaertl/php-shellcommand' => array( - 'pretty_version' => '1.7.0', - 'version' => '1.7.0.0', - 'reference' => 'e79ea528be155ffdec6f3bf1a4a46307bb49e545', - 'type' => 'library', - 'install_path' => __DIR__ . '/../mikehaertl/php-shellcommand', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'mikehaertl/php-tmpfile' => array( - 'pretty_version' => '1.2.1', - 'version' => '1.2.1.0', - 'reference' => '70a5b70b17bc0d9666388e6a551ecc93d0b40a10', - 'type' => 'library', - 'install_path' => __DIR__ . '/../mikehaertl/php-tmpfile', - 'aliases' => array(), - 'dev_requirement' => false, - ), - ), -); diff --git a/composer/composer/platform_check.php b/composer/composer/platform_check.php deleted file mode 100644 index 7621d4ff97..0000000000 --- a/composer/composer/platform_check.php +++ /dev/null @@ -1,26 +0,0 @@ -= 50300)) { - $issues[] = 'Your Composer dependencies require a PHP version ">= 5.3.0". You are running ' . PHP_VERSION . '.'; -} - -if ($issues) { - if (!headers_sent()) { - header('HTTP/1.1 500 Internal Server Error'); - } - if (!ini_get('display_errors')) { - if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { - fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); - } elseif (!headers_sent()) { - echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; - } - } - trigger_error( - 'Composer detected issues in your platform: ' . implode(' ', $issues), - E_USER_ERROR - ); -} diff --git a/composer/mikehaertl/php-pdftk/.github/workflows/tests.yml b/composer/mikehaertl/php-pdftk/.github/workflows/tests.yml deleted file mode 100644 index b17b83cfd1..0000000000 --- a/composer/mikehaertl/php-pdftk/.github/workflows/tests.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Tests -on: pull_request -jobs: - phpunit: - name: PHP ${{ matrix.php }} - runs-on: ubuntu-latest - strategy: - matrix: - php: - - "5.3" - - "5.4" - - "5.5" - - "5.6" - - "7.0" - - "7.1" - - "7.2" - - "7.3" - - "7.4" - - "8.0" - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Install pdftk - run: | - cd /tmp - sudo wget http://mirrors.kernel.org/ubuntu/pool/universe/p/pdftk-java/pdftk-java_3.0.9-1_all.deb - sudo apt install -y -q ./pdftk-java_3.0.9-1_all.deb - pdftk --version - - - name: Install PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - tools: composer:v2 - - - name: Update composer - run: composer self-update - - - name: Get composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: Cache composer cache - uses: actions/cache@v2 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-composer- - - - name: Install composer packages - run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi - - - name: Run phpunit - run: vendor/bin/phpunit --color=always diff --git a/composer/mikehaertl/php-pdftk/LICENSE b/composer/mikehaertl/php-pdftk/LICENSE deleted file mode 100644 index 28dbb2a292..0000000000 --- a/composer/mikehaertl/php-pdftk/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Michael Härtl - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/composer/mikehaertl/php-pdftk/README.md b/composer/mikehaertl/php-pdftk/README.md deleted file mode 100644 index ba99281d49..0000000000 --- a/composer/mikehaertl/php-pdftk/README.md +++ /dev/null @@ -1,501 +0,0 @@ -php-pdftk -========= - -[![GitHub Tests](https://github.com/mikehaertl/php-pdftk/workflows/Tests/badge.svg)](https://github.com/mikehaertl/php-pdftk/actions) -[![Packagist Version](https://img.shields.io/packagist/v/mikehaertl/php-pdftk?label=version)](https://packagist.org/packages/mikehaertl/php-pdftk) -[![Packagist Downloads](https://img.shields.io/packagist/dt/mikehaertl/php-pdftk)](https://packagist.org/packages/mikehaertl/php-pdftk) -[![GitHub license](https://img.shields.io/github/license/mikehaertl/php-pdftk)](https://github.com/mikehaertl/php-pdftk/blob/master/LICENSE) -[![Packagist PHP Version Support](https://img.shields.io/packagist/php-v/mikehaertl/php-pdftk)](https://packagist.org/packages/mikehaertl/php-pdftk) - -A PDF conversion and form utility based on pdftk. - -## Features - -*php-pdftk* brings the full power of `pdftk` to PHP - and more. - - * Fill forms, either from a XFDF/FDF file or from a data array (UTF-8 safe for unflattened forms, requires pdftk 2.x !) - * Create XFDF or FDF files from PHP arrays (UTF-8 safe!) - * Create FDF files from filled PDF forms - * Combine pages from several PDF files into a new PDF file - * Split a PDF into one file per page - * Add background or overlay PDFs - * Read out meta data about PDF and form fields - * Set passwords and permissions - * Remove passwords - -## Requirements - - * The `pdftk` command must be installed and working on your system - * This library is written for pdftk 2.x versions. You should be able to use it with pdftk 1.x but not all methods will work there. - For details consult the man page of pdftk on your system. - * There is a [known issue](https://github.com/mikehaertl/php-pdftk/issues/150) - on Ubuntu if you installed the `pdftk` package from snap. This version has - no permission to write to the `/tmp` directory. You can either set another - temporay directory as described below or use another package. For Ubuntu - 18.10 there's also a `pdftk-java` package available via apt which should work - fine. You can also install this package on Ubuntu 18.04 if you download it - manually. Also check [this answer](https://askubuntu.com/a/1028983/175814) - on askubuntu. - -> **Note:** The pdftk version from the alternative PPA `ppa:malteworld/ppa` is -> no longer available. The author instead now points to his answer on askubuntu -> linked above. - -## Installation - -You should use [composer](https://getcomposer.org/) to install this library. - -``` -composer require mikehaertl/php-pdftk -``` - -## Examples - -### Create instance for PDF files - -There are several ways to tell the `Pdf` instance which file(s) it should use. -Some files may also require a password or need an alias to be used as a handle -in some operations (e.g. cat or shuffle). - -> **Note:** In version 2.x of pdftk a handle can be one or more upper case letters. - -```php -// Create an instance for a single file -$pdf = new Pdf('/path/to/form.pdf'); - -// Alternatively add files later. Handles are autogenerated in this case. -$pdf = new Pdf(); -$pdf->addFile('/path/to/file1.pdf'); -$pdf->addFile('/path/to/file2.pdf'); - -// Add files with own handle -$pdf = new Pdf(); -$pdf->addFile('/path/to/file1.pdf', 'A'); -$pdf->addFile('/path/to/file2.pdf', 'B'); -// Add file with handle and password -$pdf->addFile('/path/to/file3.pdf', 'C', 'secret*password'); - -// Shortcut to pass all files to the constructor -$pdf = new Pdf([ - 'A' => ['/path/to/file1.pdf', 'secret*password1'], - 'B' => ['/path/to/file2.pdf', 'secret*password2'], -]); -``` - -### Operations - -Please consult the `pdftk` man page for each operation to find out how each operation works -in detail and which options are available. - -For all operations you can either save the PDF locally through `saveAs($name)` or send it to the -browser with `send()`. If you pass a filename to `send($name)` the client browser will open a download -dialogue whereas without a filename it will usually display the PDF inline. - -**IMPORTANT: You can always only perform *one* of the following operations on a single PDF instance. -Below you can find a workaround if you need multiple operations.** - -#### Fill Form - -Fill a PDF form with data from a PHP array or an XFDF/FDF file. - -```php -use mikehaertl\pdftk\Pdf; - -// Fill form with data array -$pdf = new Pdf('/full/path/to/form.pdf'); -$result = $pdf->fillForm([ - 'name'=>'ÄÜÖ äüö мирано čárka', - 'nested.name' => 'valX', - ]) - ->needAppearances() - ->saveAs('filled.pdf'); - -// Always check for errors -if ($result === false) { - $error = $pdf->getError(); -} - -// Fill form from FDF -$pdf = new Pdf('form.pdf'); -$result = $pdf->fillForm('data.xfdf') - ->saveAs('filled.pdf'); -if ($result === false) { - $error = $pdf->getError(); -} -``` - -**Note:** When filling in UTF-8 data, you should always add the `needAppearances()` option. -This will make sure, that the PDF reader takes care of using the right fonts for rendering, -something that pdftk can't do for you. Also note that `flatten()` doesn't really work well -if you have special characters in your data. - -If you use `pdftk-java` >= 3.3.0 and the embedded font does not support UTF-8 -characters you can also replace it with a local font: - -```php -use mikehaertl\pdftk\Pdf; - -// Fill form with data array -$pdf = new Pdf('/full/path/to/form.pdf'); -$result = $pdf->fillForm($data) - ->replacementFont('/usr/share/fonts/dejavu/DejaVuSans.ttf') - ->saveAs('filled.pdf'); -``` - -#### Create a XFDF/FDF file from a PHP array - -This is a bonus feature that is not available from `pdftk`. - -```php -use mikehaertl\pdftk\XfdfFile; -use mikehaertl\pdftk\FdfFile; - -$xfdf = new XfdfFile(['name' => 'Jürgen мирано']); -$xfdf->saveAs('/path/to/data.xfdf'); - -$fdf = new FdfFile(['name' => 'Jürgen мирано']); -$fdf->saveAs('/path/to/data.fdf'); -``` - -#### Cat - -Assemble a PDF from pages from one or more PDF files. - -```php -use mikehaertl\pdftk\Pdf; - -// Extract pages 1-5 and 7,4,9 into a new file -$pdf = new Pdf('/path/to/my.pdf'); -$result = $pdf->cat(1, 5) - ->cat([7, 4, 9]) - ->saveAs('/path/to/new.pdf'); -if ($result === false) { - $error = $pdf->getError(); -} - -// Combine pages from several files -$pdf = new Pdf([ - 'A' => '/path/file1.pdf', // A is alias for file1.pdf - 'B' => ['/path/file2.pdf','pass**word'], // B is alias for file2.pdf - 'C' => ['/path/file3.pdf','secret**pw'], // C is alias for file3.pdf -]); -$result = $pdf->cat(1, 5, 'A') // pages 1-5 from A - ->cat(3, null, 'B') // page 3 from B - ->cat(7, 'end', 'B', null, 'east') // pages 7-end from B, rotated East - ->cat('end',3,'A','even') // even pages 3-end in reverse order from A - ->cat([2,3,7], 'C') // pages 2,3 and 7 from C - ->saveAs('/path/new.pdf'); -if ($result === false) { - $error = $pdf->getError(); -} -``` - -#### Shuffle - -Like `cat()` but create "*streams*" and fill the new PDF with one page from each -stream at a time. - -```php -use mikehaertl\pdftk\Pdf; - -$pdf = new Pdf([ - 'A' => '/path/file1.pdf', // A is alias for file1.pdf - 'B' => '/path/file2.pdf', // B is alias for file2.pdf -]); - -// new.pdf will have pages A1, B3, A2, B4, A3, B5, ... -$result = $pdf->shuffle(1, 5, 'A') // pages 1-5 from A - ->shuffle(3, 8, 'B') // pages 3-8 from B - ->saveAs('/path/new.pdf'); -if ($result === false) { - $error = $pdf->getError(); -} -``` - -#### Burst - -Split a PDF file into one file per page. - -```php -use mikehaertl\pdftk\Pdf; - -$pdf = new Pdf('/path/my.pdf'); -$result = $pdf->burst('/path/page_%d.pdf'); // Supply a printf() pattern -if ($result === false) { - $error = $pdf->getError(); -} -``` - -#### Add background PDF - -Add another PDF file as background. - -```php -use mikehaertl\pdftk\Pdf; - -// Set background from another PDF (first page repeated) -$pdf = new Pdf('/path/my.pdf'); -$result = $pdf->background('/path/back.pdf') - ->saveAs('/path/watermarked.pdf'); -if ($result === false) { - $error = $pdf->getError(); -} - -// Set background from another PDF (one page each) -$pdf = new Pdf('/path/my.pdf'); -$result = $pdf->multiBackground('/path/back_pages.pdf') - ->saveAs('/path/watermarked.pdf'); -if ($result === false) { - $error = $pdf->getError(); -} -``` - -#### Add overlay PDF - -Add another PDF file as overlay. - -```php -use mikehaertl\pdftk\Pdf; - -// Stamp with another PDF (first page repeated) -$pdf = new Pdf('/path/my.pdf'); -$result = $pdf->stamp('/path/overlay.pdf') - ->saveAs('/path/stamped.pdf'); -if ($result === false) { - $error = $pdf->getError(); -} - -// Stamp with another PDF (one page each) -$pdf = new Pdf('/path/my.pdf'); -$result = $pdf->multiStamp('/path/overlay_pages.pdf') - ->saveAs('/path/stamped.pdf'); -if ($result === false) { - $error = $pdf->getError(); -} -``` - -#### Attach Files - -Add file attachments to the document or to a specific page. - -```php -use mikehaertl\pdftk\Pdf; - -$files = [ - '/path/to/file1', - '/path/to/file2', -] - -// Add files at the document level -$pdf = new Pdf('/path/my.pdf'); -$result = $pdf->attachFiles($files) - ->saveAs('/path/withfiles.pdf'); -if ($result === false) { - $error = $pdf->getError(); -} - -// Add files to a specific page -$pdf = new Pdf('/path/my.pdf'); -$page = 7; -$result = $pdf->attachFiles($files, $page) - ->saveAs('/path/withfiles.pdf'); -if ($result === false) { - $error = $pdf->getError(); -} -``` -#### Unpack Files - -Copy file attachments from a PDF to the given directory. - -```php -use mikehaertl\pdftk\Pdf; - -$pdf = new Pdf('/path/my.pdf'); -$result = $pdf->unpackFiles('/path/to/dir'); -if ($result === false) { - $error = $pdf->getError(); -} -``` - -#### Generate FDF - -Create a FDF file from a given filled PDF form. - -```php -use mikehaertl\pdftk\Pdf; - -// Create FDF from PDF -$pdf = new Pdf('/path/form.pdf'); -$result = $pdf->generateFdfFile('/path/data.fdf'); -if ($result === false) { - $error = $pdf->getError(); -} -``` - -#### Get PDF data - -Read out metadata or form field information from a PDF file. - -```php -use mikehaertl\pdftk\Pdf; - -// Get data -$pdf = new Pdf('/path/my.pdf'); -$data = $pdf->getData(); -if ($data === false) { - $error = $pdf->getError(); -} - -// Get form data fields -$pdf = new Pdf('/path/my.pdf'); -$data = $pdf->getDataFields(); -if ($data === false) { - $error = $pdf->getError(); -} - -// Get data as string -echo $data; -$txt = (string) $data; -$txt = $data->__toString(); - -// Get data as array -$arr = (array) $data; -$arr = $data->__toArray(); -$field1 = $data[0]['Field1']; -``` - -#### How to perform more than one operation on a PDF - -As stated above, you can only perform one of the preceeding operations on a single PDF instance. -If you need more than one operation you can feed one `Pdf` instance into another: - -```php -use mikehaertl\pdftk\Pdf; - -// Extract pages 1-5 and 7,4,9 into a new file -$pdf = new Pdf('/path/my.pdf'); -$pdf->cat(1, 5) - ->cat([7, 4, 9]); - -// We now use the above PDF as source file for a new PDF -$pdf2 = new Pdf($pdf); -$result = $pdf2->fillForm(['name' => 'ÄÜÖ äüö мирано čárka']) - ->needAppearances() - ->saveAs('/path/filled.pdf'); -if ($result === false) { - $error = $pdf->getError(); -} -``` - -### Options - -You can combine the above operations with one or more of the following options. - -```php -use mikehaertl\pdftk\Pdf; - -$pdf = new Pdf('/path/my.pdf'); - -$result = $pdf->allow('AllFeatures') // Change permissions - ->flatten() // Merge form data into document (doesn't work well with UTF-8!) - ->compress($value) // Compress/Uncompress - ->keepId('first') // Keep first/last Id of combined files - ->dropXfa() // Drop newer XFA form from PDF - ->dropXmp() // Drop newer XMP data from PDF - ->needAppearances() // Make clients create appearance for form fields - ->setPassword($pw) // Set owner password - ->setUserPassword($pw) // Set user password - ->passwordEncryption(128) // Set password encryption strength - ->saveAs('new.pdf'); -if ($result === false) { - $error = $pdf->getError(); -} - -// Example: Fill PDF form and merge form data into PDF -// Fill form with data array -$result = $pdf = new Pdf('/path/form.pdf'); -$pdf->fillForm(['name' => 'My Name']) - ->flatten() - ->saveAs('/path/filled.pdf'); -if ($result === false) { - $error = $pdf->getError(); -} - -// Example: Remove password from a PDF -$pdf = new Pdf; -$result = $pdf->addFile('/path/my.pdf', null, 'some**password') - ->saveAs('/path/new.pdf'); -if ($result === false) { - $error = $pdf->getError(); -} -``` - -### Shell Command - -The class uses [php-shellcommand](https://github.com/mikehaertl/php-shellcommand) to execute -`pdftk`. You can pass `$options` for its `Command` class as second argument to the constructor: - -```php -use mikehaertl\pdftk\Pdf; - -$pdf = new Pdf('/path/my.pdf', [ - 'command' => '/some/other/path/to/pdftk', - // or on most Windows systems: - // 'command' => 'C:\Program Files (x86)\PDFtk\bin\pdftk.exe', - 'useExec' => true, // May help on Windows systems if execution fails -]); -``` - -#### Solve issues with UTF-8 characters in filenames or infofile content - -If you have files with UTF-8 encoded characters in their filename or if you -pass an infofile with such characters to `updateInfo()` you should supply the -correct locale when excuting `pdftk`. You can therefore add these options: - -```php -$pdf = new Pdf($file, [ - 'locale' => 'en_US.utf8', - 'procEnv' => [ - 'LANG' => 'en_US.utf-8', - ], -]); -``` - -> **Note:** You need to ensure that the locale you set here is available on -> your system. On Linux you can check with `locale -a` which locales are -> installed. [This article](https://wiki.archlinux.org/title/locale) explains -> the concept in more detail. - - - -### Temporary File - -Internally a temporary file is created via [php-tmpfile](https://github.com/mikehaertl/php-tmpfile). -You can also access that file directly, e.g. if you neither want to send or save the -file but only need the binary PDF content: - -```php -use mikehaertl\pdftk\Pdf; - -$pdf = new Pdf('/path/my.pdf'); -$result = $pdf->fillForm(['name' => 'My Name']) - ->execute(); -if ($result === false) { - $error = $pdf->getError(); -} -$content = file_get_contents( (string) $pdf->getTmpFile() ); -``` - -If you have permission issues you may have to set a directory where your -`pdftk` command can write to: - -```php -use mikehaertl\pdftk\Pdf; - -$pdf = new Pdf('/path/my.pdf'); -$pdf->tempDir = '/home/john/temp'; -``` - -## API - -Please consult the source files for a full documentation of each method. diff --git a/composer/mikehaertl/php-pdftk/composer.json b/composer/mikehaertl/php-pdftk/composer.json deleted file mode 100644 index 155ba17279..0000000000 --- a/composer/mikehaertl/php-pdftk/composer.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "mikehaertl/php-pdftk", - "description": "A PDF conversion and form utility based on pdftk.", - "keywords": ["pdf", "pdftk"], - "type": "library", - "license": "MIT", - "authors": [ - { - "name": "Michael Haertl", - "email": "haertl.mike@gmail.com" - } - ], - "require": { - "php": ">=5.3.0", - "mikehaertl/php-shellcommand": "^1.6.3", - "mikehaertl/php-tmpfile": "^1.1.0" - }, - "require-dev": { - "phpunit/phpunit": ">4.0 <9.4" - }, - "autoload": { - "psr-4": { - "mikehaertl\\pdftk\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "tests\\": "tests" - } - } -} diff --git a/composer/mikehaertl/php-pdftk/src/Command.php b/composer/mikehaertl/php-pdftk/src/Command.php deleted file mode 100644 index 0919e6b886..0000000000 --- a/composer/mikehaertl/php-pdftk/src/Command.php +++ /dev/null @@ -1,249 +0,0 @@ - - * @license http://www.opensource.org/licenses/MIT - */ -class Command extends BaseCommand -{ - /** - * @var string the pdftk binary - */ - protected $_command = 'pdftk'; - - /** - * @var array list of input files to process as array('name' => $filename, - * 'password' => $pw) indexed by handle - */ - protected $_files = array(); - - /** - * @var array list of command options, either strings or array with - * arguments to addArg() - */ - protected $_options = array(); - - /** - * @var string the operation to perform - */ - protected $_operation; - - /** - * @var string|array operation arguments, e.g. a list of page ranges or a - * filename or tmp file instance - */ - protected $_operationArgument = array(); - - /** - * @var bool whether to force escaping of the operation argument e.g. for - * filenames - */ - protected $_escapeOperationArgument = false; - - /** - * @param string $name the PDF file to add for processing - * @param string $handle one or more uppercase letters A..Z to reference - * this file later. - * @param string|null $password the owner (or user) password if any - * @return Command the command instance for method chaining - * @throws \Exception - */ - public function addFile($name, $handle, $password = null) - { - $this->checkExecutionStatus(); - $file = array( - 'name' => $name, - 'password' => $password, - ); - $this->_files[$handle] = $file; - return $this; - } - - /** - * @param string $option the pdftk option to add - * @param string|File|null $argument the argument to add, either string, - * File instance or null if none - * @param null|bool whether to escape the option. Default is null meaning - * use Command default setting. - * @return Command the command instance for method chaining - */ - public function addOption($option, $argument = null, $escape = null) - { - $this->_options[] = $argument === null ? $option : array($option, $argument, $escape); - return $this; - } - - /** - * @param string $operation the operation to perform - * @return Command the command instance for method chaining - */ - public function setOperation($operation) - { - $this->checkExecutionStatus(); - $this->_operation = $operation; - return $this; - } - - /** - * @return string|null the current operation or null if none set - */ - public function getOperation() - { - return $this->_operation; - } - - /** - * @param string $value the operation argument - * @param bool $escape whether to escape the operation argument - * @return Command the command instance for method chaining - */ - public function setOperationArgument($value, $escape = false) - { - $this->checkExecutionStatus(); - $this->_operationArgument = $value; - $this->_escapeOperationArgument = $escape; - return $this; - } - - /** - * @return string|array|null the current operation argument as string or - * array or null if none set - */ - public function getOperationArgument() - { - // Typecast to string in case we have a File instance as argument - return is_array($this->_operationArgument) ? $this->_operationArgument : (string) $this->_operationArgument; - } - - /** - * @return int the number of files added to the command - */ - public function getFileCount() - { - return count($this->_files); - } - - /** - * Add a page range as used by some operations - * - * @param int|string|array $start the start page number or an array of page - * numbers. If an array, the other arguments will be ignored. $start can - * also be bigger than $end for pages in reverse order. - * @param int|string|null $end the end page number or null for single page - * (or list if $start is an array) - * @param string|null $handle the handle of the file to use. Can be null if - * only a single file was added. - * @param string|null $qualifier the page number qualifier, either 'even' - * or 'odd' or null for none - * @param string $rotation the rotation to apply to the pages. - * @return Command the command instance for method chaining - */ - public function addPageRange($start, $end = null, $handle = null, $qualifier = null, $rotation = null) - { - $this->checkExecutionStatus(); - if (is_array($start)) { - if ($handle !== null) { - $start = array_map(function ($p) use ($handle) { - return $handle . $p; - }, $start); - } - $range = implode(' ', $start); - } else { - $range = $handle . $start; - if ($end) { - $range .= '-' . $end; - } - $range .= $qualifier . $rotation; - } - $this->_operationArgument[] = $range; - return $this; - } - - /** - * @param string|null $filename the filename to add as 'output' option or - * null if none - * @return bool whether the command was executed successfully - */ - public function execute($filename = null) - { - $this->checkExecutionStatus(); - $this->processInputFiles(); - $this->processOperation(); - $this->processOptions($filename); - return parent::execute(); - } - - /** - * Process input PDF files and create respective command arguments - */ - protected function processInputFiles() - { - $passwords = array(); - foreach ($this->_files as $handle => $file) { - $this->addArg($handle . '=', $file['name']); - if ($file['password'] !== null) { - $passwords[$handle] = $file['password']; - } - } - if ($passwords !== array()) { - $this->addArg('input_pw'); - foreach ($passwords as $handle => $password) { - $this->addArg($handle . '=', $password); - } - } - } - - /** - * Process options and create respective command arguments - * @param string|null $filename if provided an 'output' option will be - * added - */ - protected function processOptions($filename = null) - { - // output must be first option after operation - if ($filename !== null) { - $this->addArg('output', $filename, true); - } - foreach ($this->_options as $option) { - if (is_array($option)) { - $this->addArg($option[0], $option[1], $option[2]); - } else { - $this->addArg($option); - } - } - } - - /** - * Process opearation and create respective command arguments - */ - protected function processOperation() - { - if ($this->_operation !== null) { - $value = $this->_operationArgument ? $this->_operationArgument : null; - if ($value instanceof TmpFile) { - $value = (string) $value; - } - $this->addArg($this->_operation, $value, $this->_escapeOperationArgument); - } - } - - /** - * Ensure that the command was not exectued yet. Throws exception - * otherwise. - * @throws \Exception - */ - protected function checkExecutionStatus() - { - if ($this->getExecuted()) { - throw new \Exception('Operation was already executed'); - } - } -} diff --git a/composer/mikehaertl/php-pdftk/src/DataFields.php b/composer/mikehaertl/php-pdftk/src/DataFields.php deleted file mode 100644 index a5b40f74e0..0000000000 --- a/composer/mikehaertl/php-pdftk/src/DataFields.php +++ /dev/null @@ -1,166 +0,0 @@ - - * @author Michael Härtl - * @license http://www.opensource.org/licenses/MIT - */ -class DataFields extends ArrayObject -{ - private $_string; - private $_array; - - /** - * DataFields constructor. - * - * @param string $input - * @param int $flags - * @param string $iterator_class - */ - public function __construct($input = null, $flags = 0, $iterator_class = "ArrayIterator") - { - $this->_string = $input ?: ''; - $this->_array = self::parse($this->_string); - - return parent::__construct($this->_array, $flags, $iterator_class); - } - - /** - * @return string - */ - public function __toString() - { - return $this->_string; - } - - /** - * @return array - */ - public function __toArray() - { - return $this->_array; - } - - /** - * Parse the output of dump_data_fields into an array. - * - * The string to parse can either be a single block of `Xyz:value` lines - * or a set of such blocks, separated by and starting with `---`. - * - * - * Here's an example: - * - * ``` - * --- - * FieldType: Text - * FieldName: Text1 - * FieldFlags: 0 - * FieldValue: University of Missouri : Ray-Holland - * extended line value - * FieldValueDefault: University of Missouri : Ray-Holland - * extended line2 value - * FieldJustification: Left - * FieldMaxLength: 99 - * --- - * FieldType: Text - * FieldName: Text2 - * ... - * ... - * ``` - * - * @param $input the string to parse - * @return array the parsed result - */ - public static function parse($input) - { - if (strncmp('---', $input, 3) === 0) { - // Split blocks only if '---' is followed by 'FieldType' - $blocks = preg_split( - '/^---(\r\n|\n|\r)(?=FieldType:)/m', - substr($input, 3) - ); - return array_map('\mikehaertl\pdftk\DataFields::parseBlock', $blocks); - } else { - return self::parseBlock($input); - } - } - - /** - * Parses a block of this form: - * - * ``` - * Name1: Value1 - * Name2: Value2 - * Name3: Value3 - * ... - * ``` - * - * @param string $block the block to parse - * @return array the parsed block values indexed by respective names - */ - public static function parseBlock($block) - { - $data = array(); - $lines = preg_split("/(\r\n|\n|\r)/", trim($block)); - $continueKey = null; - foreach ($lines as $n => $line) { - if ($continueKey !== null) { - $data[$continueKey] .= "\n" . $line; - if (!self::lineContinues($lines, $n, $continueKey)) { - $continueKey = null; - } - } elseif (preg_match('/([^:]*): ?(.*)/', $line, $match)) { - $key = $match[1]; - $value = $match[2]; - // Convert multiple keys like 'FieldStateOption' or 'FieldValue' - // from Choice fields to array - if (isset($data[$key])) { - $data[$key] = (array) $data[$key]; - $data[$key][] = $value; - } else { - $data[$key] = $value; - } - if (self::lineContinues($lines, $n, $key)) { - $continueKey = $key; - } - } - } - return $data; - } - - /** - * Checks whether the value for the given line number continues on the next - * line, i.e. is a multiline string. - * - * This can be the case for 'FieldValue' and 'FieldValueDefault' keys. To - * find the end of the string we don't simply test for /^Field/, as this - * would also match multiline strings where a line starts with 'Field'. - * - * Instead we assume that the string is always followed by one of these - * keys: - * - * - 'FieldValue:' - * - 'FieldValueDefault:' - * - 'FieldJustification:' - * - * @param array $lines all lines of the block - * @param int $n the 0-based index of the current line - * @param string the key for the value. Only 'FieldValue' and - * 'FieldValueDefault' can span multiple lines - * @return bool whether the value continues in line n + 1 - */ - protected static function lineContinues($lines, $n, $key) - { - return - in_array($key, array('FieldValue', 'FieldValueDefault')) && - array_key_exists($n + 1, $lines) && - !preg_match('/^Field(Value|ValueDefault|Justification):/', $lines[$n + 1]); - } -} diff --git a/composer/mikehaertl/php-pdftk/src/FdfFile.php b/composer/mikehaertl/php-pdftk/src/FdfFile.php deleted file mode 100644 index 269ec0a8e1..0000000000 --- a/composer/mikehaertl/php-pdftk/src/FdfFile.php +++ /dev/null @@ -1,84 +0,0 @@ - - * @license http://www.opensource.org/licenses/MIT - */ -class FdfFile extends File -{ - // FDF file header - const FDF_HEADER = <<> >> -endobj -trailer -<> -%%EOF -FDF; - - /** - * Constructor - * - * @param array $data the form data as name => value - * @param string|null $suffix the optional suffix for the tmp file - * @param string|null $suffix the optional prefix for the tmp file. If null - * 'php_tmpfile_' is used. - * @param string|null $directory directory where the file should be - * created. Autodetected if not provided. - * @param string|null $encoding of the data. Default is 'UTF-8'. - */ - public function __construct($data, $suffix = null, $prefix = null, $directory = null, $encoding = 'UTF-8') - { - if ($directory === null) { - $directory = self::getTempDir(); - } - $suffix = '.fdf'; - $prefix = 'php_pdftk_fdf_'; - - $this->_fileName = tempnam($directory, $prefix); - $newName = $this->_fileName . $suffix; - rename($this->_fileName, $newName); - $this->_fileName = $newName; - - if (!function_exists('mb_convert_encoding')) { - throw new \Exception('MB extension required.'); - } - - $fields = ''; - foreach ($data as $key => $value) { - // Create UTF-16BE string encode as ASCII hex - // See http://blog.tremily.us/posts/PDF_forms/ - $utf16Value = mb_convert_encoding($value, 'UTF-16BE', $encoding); - - /* Also create UTF-16BE encoded key, this allows field names containing - * german umlauts and most likely many other "special" characters. - * See issue #17 (https://github.com/mikehaertl/php-pdftk/issues/17) - */ - $utf16Key = mb_convert_encoding($key, 'UTF-16BE', $encoding); - - // Escape parenthesis - $utf16Value = strtr($utf16Value, array('(' => '\\(', ')' => '\\)')); - $fields .= "<>\n"; - } - - // Use fwrite, since file_put_contents() messes around with character encoding - $fp = fopen($this->_fileName, 'w'); - fwrite($fp, self::FDF_HEADER); - fwrite($fp, $fields); - fwrite($fp, self::FDF_FOOTER); - fclose($fp); - } -} diff --git a/composer/mikehaertl/php-pdftk/src/InfoFields.php b/composer/mikehaertl/php-pdftk/src/InfoFields.php deleted file mode 100644 index 09f46556ee..0000000000 --- a/composer/mikehaertl/php-pdftk/src/InfoFields.php +++ /dev/null @@ -1,139 +0,0 @@ - - * @license http://www.opensource.org/licenses/MIT - */ -class InfoFields extends ArrayObject -{ - private $_string; - - private $_array; - - /** - * InfoFields constructor. - * - * @param string $input - * @param int $flags - * @param string $iterator_class - */ - public function __construct($input = null, $flags = 0, $iterator_class = "ArrayIterator") - { - $this->_string = $input ?: ''; - $this->_array = $this->parseData($this->_string); - - return parent::__construct($this->_array, $flags, $iterator_class); - } - - /** - * @return string - */ - public function __toString() - { - return $this->_string; - } - - /** - * @return array - */ - public function __toArray() - { - return $this->_array; - } - - /** - * Parse the output of dump_data into something usable. - * - * The expected string looks similar to this: - * - * InfoBegin - * InfoKey: Creator - * InfoValue: Adobe Acrobat Pro DC 15.0 - * InfoBegin - * InfoKey: Producer - * InfoValue: XYZ - * PdfID0: 1fdce9ed1153ab4c973334b512a67997 - * PdfID1: c7acc878cda02ad7bb401fa8080a8929 - * NumberOfPages: 11 - * BookmarkBegin - * BookmarkTitle: First bookmark - * BookmarkLevel: 1 - * BookmarkPageNumber: 1 - * BookmarkBegin - * BookmarkTitle: Second bookmark - * BookmarkLevel: 1 - * BookmarkPageNumber: 2 - * - * @param $dataString - * @return array - */ - private function parseData($dataString) - { - $output = array(); - foreach (explode(PHP_EOL, $dataString) as $line) { - $trimmedLine = trim($line); - // Parse blocks of the form: - // AbcBegin - // AbcData1: Value1 - // AbcData2: Value2 - // AbcBegin - // AbcData1: Value3 - // AbcData2: Value4 - // ... - if (preg_match('/^(\w+)Begin$/', $trimmedLine, $matches)) { - // Previous group ended - if any - so add it to output - if (!empty($group) && !empty($groupData)) { - $output[$group][] = $groupData; - } - // Now start next group - $group = $matches[1]; // Info, PageMedia, ... - if (!isset($output[$group])) { - $output[$group] = array(); - } - $groupData = array(); - continue; - } - if (!empty($group)) { - // Check for AbcData1: Value1 - if (preg_match("/^$group(\w+): ?(.*)$/", $trimmedLine, $matches)) { - $groupData[$matches[1]] = $matches[2]; - continue; - } else { - // Something else, so group ended - if (!empty($groupData)) { - $output[$group][] = $groupData; - $groupData = array(); - } - $group = null; - } - } - if (preg_match('/([^:]*): ?(.*)/', $trimmedLine, $matches)) { - $output[$matches[1]] = $matches[2]; - } - } - // There could be a final group left if it was not followed by another - // line in the loop - if (!empty($group) && !empty($groupData)) { - $output[$group][] = $groupData; - } - - // Info group is a list of ['Key' => 'x', 'Value' => 'y'], so - // convert it to ['x' => 'y', ...] - if (isset($output['Info'])) { - $data = array(); - foreach ($output['Info'] as $infoGroup) { - if (isset($infoGroup['Key'], $infoGroup['Value'])) { - $data[$infoGroup['Key']] = $infoGroup['Value']; - } - } - $output['Info'] = $data; - } - return $output; - } -} diff --git a/composer/mikehaertl/php-pdftk/src/InfoFile.php b/composer/mikehaertl/php-pdftk/src/InfoFile.php deleted file mode 100644 index 0325dfa817..0000000000 --- a/composer/mikehaertl/php-pdftk/src/InfoFile.php +++ /dev/null @@ -1,190 +0,0 @@ - - * @license http://www.opensource.org/licenses/MIT - */ -class InfoFile extends File -{ - /** - * @var string[] list of valid keys for the document information directory of - * the PDF. These will be converted into `InfoBegin... InfoKey... InvoValue` - * blocks on the output. - * - * See section 14.3.3 in https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/PDF32000_2008.pdf - */ - public static $documentInfoFields = array( - 'Title', - 'Author', - 'Subject', - 'Keywords', - 'Creator', - 'Producer', - 'CreationDate', - 'ModDate', - 'Trapped', - ); - - /** - * Constructor - * - * @param array|InfoFields $data the data in this format: - * ``` - * [ - * 'Info' => [ - * 'Title' => '...', - * 'Author' => '...', - * 'Subject' => '...', - * 'Keywords' => '...', - * 'Creator' => '...', - * 'Producer' => '...', - * 'CreationDate' => '...', - * 'ModDate' => '...', - * 'Trapped' => '...', - * ], - * 'Bookmark' => [ - * [ - * 'Title' => '...', - * 'Level' => ..., - * 'PageNumber' => ..., - * ], - * ], - * 'PageMedia' => [ ... ], - * 'PageLabel' => [ ... ], - * // ... - * ] - * ``` - * This is the same format as the InfoFields object that is returned - * by `getData()` if you cast it to an array. You can also pass such an - * (optionally modified) object as input. Some fields like 'NumberOfPages' - * or 'PdfID0' are ignored as those are not part of the PDF's metadata. - * All array elements are optional. - * @param string|null $suffix the optional suffix for the tmp file - * @param string|null $suffix the optional prefix for the tmp file. If null - * 'php_tmpfile_' is used. - * @param string|null $directory directory where the file should be - * created. Autodetected if not provided. - * @param string|null $encoding of the data. Default is 'UTF-8'. If the - * data has another encoding it will be converted to UTF-8. This requires - * the mbstring extension to be installed. - * @throws Exception on invalid data format or if mbstring extension is - * missing and data must be converted - */ - public function __construct($data, $suffix = null, $prefix = null, $directory = null, $encoding = 'UTF-8') - { - if ($suffix === null) { - $suffix = '.txt'; - } - if ($prefix === null) { - $prefix = 'php_pdftk_info_'; - } - if ($directory === null) { - $directory = self::getTempDir(); - } - - $tempName = tempnam($directory, $prefix); - $newName = $tempName . $suffix; - rename($tempName, $newName); - $this->_fileName = $newName; - - if ($encoding !== 'UTF-8' && !function_exists('mb_convert_encoding')) { - throw new Exception('mbstring extension required.'); - } - - $fields = ''; - $normalizedData = self::normalize($data); - - foreach ($normalizedData as $block => $items) { - $fields .= self::renderBlock($block, $items, $encoding); - } - - // Use fwrite, since file_put_contents() messes around with character encoding - $fp = fopen($this->_fileName, 'w'); - fwrite($fp, $fields); - fclose($fp); - } - - /** - * Normalize the input data - * - * This also converts data from the legacy format (<0.13.0) to the new - * input format described in the constructor. - * - * @param array $data the data to normalize - * @return array a normalized array in the format described in the constructor - */ - private static function normalize($data) - { - $normalized = array(); - foreach ($data as $key => $value) { - if (in_array($key, self::$documentInfoFields)) { - $normalized['Info'][$key] = $value; - } elseif (is_array($value)) { - if (!isset($normalized[$key])) { - $normalized[$key] = array(); - } - $normalized[$key] = array_merge($normalized[$key], $value); - } - } - return $normalized; - } - - /** - * Render a set of block fields - * - * @param string $block like 'Info', 'Bookmark', etc. - * @param array $items the field items to render - * @param string $encoding the encoding of the item data - * @return string the rendered fields - */ - private static function renderBlock($block, $items, $encoding) - { - $fields = ''; - foreach ($items as $key => $value) { - if ($block === 'Info') { - $fields .= self::renderField($block, $key, $value, $encoding, true); - } else { - $fields .= "{$block}Begin\n"; - foreach ($value as $subKey => $subValue) { - $fields .= self::renderField($block, $subKey, $subValue, $encoding, false); - } - } - } - return $fields; - } - - /** - * Render a field in a given input block - * - * @param string $prefix the prefix to use for the field - * @param string $key the field key - * @param string $value the field value - * @param string $encoding the endoding of key and value - * @param bool $isInfo whether it's an 'Info' field - * @return string the rendered field - */ - private static function renderField($prefix, $key, $value, $encoding, $isInfo) - { - if ($encoding !== 'UTF-8') { - $value = mb_convert_encoding($value, 'UTF-8', $encoding); - $key = mb_convert_encoding($key, 'UTF-8', $encoding); - $value = defined('ENT_XML1') ? htmlspecialchars($key, ENT_XML1, 'UTF-8') : htmlspecialchars($key); - $key = defined('ENT_XML1') ? htmlspecialchars($value, ENT_XML1, 'UTF-8') : htmlspecialchars($value); - } - if ($isInfo) { - return "InfoBegin\nInfoKey: $key\nInfoValue: $value\n"; - } else { - return "{$prefix}{$key}: $value\n"; - } - - } -} diff --git a/composer/mikehaertl/php-pdftk/src/Pdf.php b/composer/mikehaertl/php-pdftk/src/Pdf.php deleted file mode 100644 index f50ed8a6b7..0000000000 --- a/composer/mikehaertl/php-pdftk/src/Pdf.php +++ /dev/null @@ -1,749 +0,0 @@ - - * @license http://www.opensource.org/licenses/MIT - */ -class Pdf -{ - // The prefix for temporary files - const TMP_PREFIX = 'tmp_php_pdftk_'; - - /** - * @var bool whether to ignore any errors if some non-empty output file was - * still created. Default is false. - */ - public $ignoreWarnings = false; - - /** - * @var null|string an optional directory where temporary files should be - * created. If left empty the directory is autodetected. - */ - public $tempDir; - - /** - * @var File the temporary output file - */ - protected $_tmpFile; - - /** - * @var string the content type of the tmp output - */ - protected $_tmpOutputContentType = 'application/pdf'; - - /** - * @var Command the command instance that executes pdftk - */ - protected $_command; - - /** - * @var int a counter for autogenerated handles - */ - protected $_handle = 0; - - /** - * @var string the error message - */ - protected $_error = ''; - - /** - * @var string|null the output filename. If null (default) a tmp file is - * used as output. If false, no output option is added at all. - */ - protected $_output; - - /** - * @var string the PDF data as returned from getData() - */ - protected $_data; - protected $_data_utf8; - - /** - * @var DataFields the PDF form field data as returned from getDataFields() - */ - protected $_dataFields; - protected $_dataFields_utf8; - - /** - * @var Pdf[]|null if the input was an instance, we keep a reference here, - * so that it won't get unlinked before this object gets destroyed - */ - protected $_pdfs; - - /** - * @param string|Pdf|array $pdf a pdf filename or Pdf instance or an array - * of filenames/instances indexed by a handle. The array values can also - * be arrays of the form array($filename, $password) if some files are - * password protected. - * @param array $options Options to pass to set on the Command instance, - * e.g. the pdftk binary path - */ - public function __construct($pdf = null, $options = array()) - { - $command = $this->getCommand(); - if ($options !== array()) { - $command->setOptions($options); - } - if (is_string($pdf) || $pdf instanceof Pdf) { - $this->addFile($pdf); - } elseif (is_array($pdf)) { - foreach ($pdf as $handle => $file) { - if (is_array($file)) { - $this->addFile($file[0], $handle, $file[1]); - } else { - $this->addFile($file, $handle); - } - } - } - } - - /** - * @param string|Pdf $name the PDF filename or Pdf instance to add for - * processing - * @param string|null $handle one or more uppercase letters A..Z to - * reference this file later. If no handle is provided, an internal handle - * is autocreated, consuming the range Z..A - * @param string|null $password the owner (or user) password if any - * @return Pdf the pdf instance for method chaining - */ - public function addFile($name, $handle = null, $password = null) - { - if ($handle === null || is_numeric($handle)) { - $handle = $this->nextHandle(); - } - if ($name instanceof Pdf) { - // Keep a reference to the object to prevent unlinking - $this->_pdfs[] = $name; - if (!$name->getCommand()->getExecuted()) { - // @todo: Catch errors! - $name->execute(); - } - $name = (string) $name->getTmpFile(); - } - $this->getCommand()->addFile($name, $handle, $password); - return $this; - } - - /** - * Assemble (catenate) pages from the input files. - * - * Values for rotation are (in degrees): north: 0, east: 90, south: 180, - * west: 270, left: -90, right: +90, down: +180. left, right and down make - * relative adjustments to a page's rotation. Note: Older pdftk versions - * use N, E, S, W, L, R, and D instead. - * - * Example: - * - * $pdf = new Pdf; - * $pdf->addFile('file1.pdf', 'A') - * ->addFile('file2.pdf', 'B') - * ->cat(array(1,3),'B')) // pages 1 and 3 of file B - * ->cat(1, 5, 'A', 'odd') // pages 1, 3, 5 of file A - * ->cat('end', 5, 'B') // pages 5 to end of file B in reverse order - * ->cat(null, null, 'B', 'east') // All pages from file B rotated by 90 degree - * ->saveAs('out.pdf'); - * or - * $files = ['file1.pdf', 'file2.pdf', 'file3.pdf']; - * $pdf = new Pdf($files); - * $pdf->cat() // all files, all pages - * ->saveAs('out.pdf'); - * - * @param int|string|array|null $start the start page number or an array of page - * numbers. If an array, the other arguments will be ignored. $start can - * also be bigger than $end for pages in reverse order. If $start is null all - * pages of all files will be added. - * @param int|string|null $end the end page number or null for single page - * (or list if $start is an array) - * @param string|null $handle the handle of the file to use. Can be null if - * only a single file was added. - * @param string|null $qualifier the page number qualifier, either 'even' - * or 'odd' or null for none - * @param string $rotation the rotation to apply to the pages. - * @return Pdf the pdf instance for method chaining - */ - public function cat($start = null, $end = null, $handle = null, $qualifier = null, $rotation = null) - { - $this->getCommand() - ->setOperation('cat') - ->addPageRange($start, $end, $handle, $qualifier, $rotation); - return $this; - } - - /** - * Shuffle pages from the input files. - * - * This works the same as cat(), but each call to this method creates a - * "stream" of pages. The outfile will be assembled by adding one page from - * each stream at a time. - * - * Example: - * - * $pdf = new Pdf; - * $pdf1 = $pdf->addFile('file1.pdf'); - * $pdf->shuffle($pdf1, array(1,3,2)) - * ->shuffle($pdf1, array(4,5,9) - * ->saveAs('out.pdf'); - * - * This will give the page order 1, 4, 3, 5, 2, 9 in the out.pdf - * - * @param string $handle the handle of the input file to use - * @param int|array $start the start page number or an array of page - * numbers. - * @param int|null $end the end page number or null for single page (or - * list if $start is an array) - * @param string|null $qualifier the page number qualifier, either 'even' - * or 'odd' or null for none - * @param string $rotation the rotation to apply to the pages. See cat() - * for more details. - * @return Pdf the pdf instance for method chaining - */ - public function shuffle($start, $end = null, $handle = null, $qualifier = null, $rotation = null) - { - $this->getCommand() - ->setOperation('shuffle') - ->addPageRange($start, $end, $handle, $qualifier, $rotation); - return $this; - } - - /** - * Split the PDF document into pages - * - * @param string|null $filepattern the output name in sprintf format or - * null for default 'pg_%04d.pdf' - * @return bool whether the burst operation was successful - */ - public function burst($filepattern = null) - { - $this->constrainSingleFile(); - $this->getCommand()->setOperation('burst'); - $this->_output = $filepattern === null ? 'pg_%04d.pdf' : $filepattern; - return $this->execute(); - } - - /** - * Attach files to the PDF - * - * @param array $files the list of full paths to the files to attach - * @param string $toPage the page to add the attachment to. If omitted the - * files are attached at the document level. - * @return bool whether the operation was successful - */ - public function attachFiles($files, $toPage = null) - { - $this->constrainSingleFile(); - if ($toPage !== null) { - $files[] = 'to_page'; - $files[] = $toPage; - } - $this->getCommand() - ->setOperation('attach_files') - ->setOperationArgument($files, true); - return $this; - } - - /** - * Copy all attachments from the PDF to the given directory - * - * @param string|null $dir the output directory - * @return bool whether the operation was successful - */ - public function unpackFiles($dir = null) - { - $this->constrainSingleFile(); - $this->getCommand()->setOperation('unpack_files'); - $this->_output = $dir; - return $this->execute(); - } - - /** - * Generate the FDF file for a single PDF file. - * - * @param string $name name of the FDF file - * @return bool whether the pdf is generated successful - */ - public function generateFdfFile($name) - { - $this->constrainSingleFile(); - $this->getCommand()->setOperation('generate_fdf'); - $this->_output = $name; - return $this->execute(); - } - - /** - * Fill a PDF form - * - * @param string|array $data either a XFDF/FDF filename or an array with - * form field data (name => value) - * @param string $encoding the encoding of the data. Default is 'UTF-8'. - * @param bool $dropXfa whether to drop XFA forms (see dropXfa()). Default - * is true. - * @param string $format the file format to use for form filling when - * passing an array in `$data`. This can be `xfdf` or `fdf`. `xfdf` should - * give best results so you should not have to change the default. - * @return Pdf the pdf instance for method chaining - */ - public function fillForm($data, $encoding = 'UTF-8', $dropXfa = true, $format = 'xfdf') - { - $this->constrainSingleFile(); - if (is_array($data)) { - $className = '\mikehaertl\pdftk\\' . ($format === 'xfdf' ? 'XfdfFile' : 'FdfFile'); - $data = new $className($data, null, null, $this->tempDir, $encoding); - } - $this->getCommand() - ->setOperation('fill_form') - ->setOperationArgument($data, true); - - if ($dropXfa) { - $this->dropXfa(); - } - return $this; - } - - /** - * Update meta data of PDF - * - * @param string|array $data either a InfoFile filename or an array with - * form field data (name => value) - * @param string the encoding of the data. Default is 'UTF-8'. - * @return Pdf the pdf instance for method chaining - */ - public function updateInfo($data, $encoding = 'UTF-8') - { - $this->constrainSingleFile(); - if (is_array($data) || $data instanceof InfoFields) { - $data = new InfoFile($data, null, null, $this->tempDir, $encoding); - } - $this->getCommand() - ->setOperation($encoding == 'UTF-8' ? 'update_info_utf8' : 'update_info') - ->setOperationArgument($data, true); - - return $this; - } - - /** - * Apply a PDF as watermark to the background of a single PDF file. - * - * The PDF file must have a transparent background for the watermark to be - * visible. - * - * @param string $file name of the background PDF file. Only the first page - * is used. - * @return Pdf the pdf instance for method chaining - */ - public function background($file) - { - $this->constrainSingleFile(); - $this->getCommand() - ->setOperation('background') - ->setOperationArgument($file, true); - return $this; - } - - /** - * Apply multiple PDF pages as watermark to the corresponding pages of a - * single PDF file. - * - * If $file has fewer pages than the PDF file then the last page is - * repeated as background. - * - * @param string $file name of the background PDF file. - * @return Pdf the pdf instance for method chaining - */ - public function multiBackground($file) - { - $this->getCommand() - ->setOperation('multibackground') - ->setOperationArgument($file, true); - return $this; - } - - /** - * Add $file as overlay to a single PDF file. - * - * The $file should have a transparent background. - * - * @param string $file name of the PDF file to add as overlay. Only the - * first page is used. - * @return Pdf the pdf instance for method chaining - */ - public function stamp($file) - { - $this->constrainSingleFile(); - $this->getCommand() - ->setOperation('stamp') - ->setOperationArgument($file, true); - return $this; - } - - /** - * Add multiple pages from $file as overlay to the corresponding pages of a - * single PDF file. - * - * If $file has fewer pages than the PDF file then the last page is - * repeated as overlay. - * - * @param string $file name of the PDF file to add as overlay - * @return Pdf the pdf instance for method chaining - */ - public function multiStamp($file) - { - $this->getCommand() - ->setOperation('multistamp') - ->setOperationArgument($file, true); - return $this; - } - - /** - * @param bool $utf8 whether to dump the data UTF-8 encoded. Default is - * true. - * @return InfoFields|bool meta data about the PDF or false on failure - */ - public function getData($utf8 = true) - { - $property = $utf8 ? '_data_utf8' : '_data'; - if ($this->$property === null) { - $command = $this->getCommand(); - $command->setOperation($utf8 ? 'dump_data_utf8' : 'dump_data'); - if (!$command->execute()) { - $this->_error = $command->getError(); - return false; - } else { - $this->$property = new InfoFields(trim($command->getOutput())); - } - } - return $this->$property; - } - - /** - * @param bool $utf8 whether to dump the data UTF-8 encoded. Default is - * true. - * @return DataFields|bool data about the PDF form fields or false on - * failure - */ - public function getDataFields($utf8 = true) - { - $property = $utf8 ? '_dataFields_utf8' : '_dataFields'; - if ($this->$property === null) { - $command = $this->getCommand(); - $command->setOperation($utf8 ? 'dump_data_fields_utf8' : 'dump_data_fields'); - if (!$command->execute()) { - $this->_error = $command->getError(); - return false; - } else { - $this->$property = new DataFields(trim($command->getOutput())); - } - } - return $this->$property; - } - - /** - * Set PDF permissions - * - * - * @param string|null $permissions list of space separated permissions or - * null for none. The available permissions are Printing, DegradedPrinting, - * ModifyContents, Assembly, CopyContents, ScreenReaders, - * ModifyAnnotations, FillIn, AllFeatures. - * @return Pdf the pdf instance for method chaining - */ - public function allow($permissions = null) - { - $this->getCommand() - ->addOption('allow', $permissions, false); - return $this; - } - - /** - * Flatten the PDF form fields values into a single PDF file. - * - * @return Pdf the pdf instance for method chaining - */ - public function flatten() - { - $this->getCommand() - ->addOption('flatten'); - return $this; - } - - /** - * Restore/remove compression - * - * @param bool $compress whether to restore (default) or remove the - * compression - * @return Pdf the pdf instance for method chaining - */ - public function compress($compress = true) - { - $this->getCommand() - ->addOption($compress ? 'compress' : 'uncompress'); - return $this; - } - - /** - * When combining multiple PDFs, use either the first or last ID in the - * output. If not called, a new ID is created. - * - * @param string $id, either 'first' (default) or 'last' - * @return Pdf the pdf instance for method chaining - */ - public function keepId($id = 'first') - { - $this->getCommand() - ->addOption($id === 'first' ? 'keep_first_id' : 'keep_final_id'); - return $this; - } - - /** - * Set need_appearances flag in PDF - * - * This flag makes sure, that a PDF reader takes care of rendering form - * field content, even if it contains non ASCII characters. You should - * always use this option if you fill in forms e.g. with Unicode - * characters. You can't combine this option with flatten() though! - * - * @return Pdf the pdf instance for method chaining - */ - public function needAppearances() - { - $this->getCommand() - ->addOption('need_appearances'); - return $this; - } - - /** - * Drop XFA data from forms created with newer Acrobat. - * - * Newer PDF forms contain both, the newer XFA and the older AcroForm form - * fields. PDF readers can use both, but will prefer XFA if present. Since - * pdftk can only fill in AcroForm data you should always add this option - * when filling in forms with pdftk. - * - * @return Pdf the pdf instance for method chaining - */ - public function dropXfa() - { - $this->getCommand() - ->addOption('drop_xfa'); - return $this; - } - - /** - * Drop XMP meta data - * - * Newer PDFs can contain both, new style XMP data and old style info - * directory. PDF readers can use both, but will prefer XMP if present. - * Since pdftk can only update the info directory you should always add - * this option when updating PDF info. - * - * @return Pdf the pdf instance for method chaining - */ - public function dropXmp() - { - $this->getCommand() - ->addOption('drop_xmp'); - return $this; - } - - /** - * @param string $password the owner password to set on the output PDF - * @return Pdf the pdf instance for method chaining - */ - public function setPassword($password) - { - $this->getCommand() - ->addOption('owner_pw', $password, true); - return $this; - } - - /** - * @param string $password the user password to set on the output PDF - * @return Pdf the pdf instance for method chaining - */ - public function setUserPassword($password) - { - $this->getCommand() - ->addOption('user_pw', $password, true); - return $this; - } - - /** - * @param int $strength the password encryption strength. Default is 128 - * @return Pdf the pdf instance for method chaining - */ - public function passwordEncryption($strength = 128) - { - $this->getCommand() - ->addOption($strength == 128 ? 'encrypt_128bit' : 'encrypt_40bit'); - return $this; - } - - /** - * Replace embedded font with a local font when filling a form. - * - * This option is only available for pdftk-java >= 3.3.0. It is useful when - * filling a form with non-ASCII text that is not supported by the fonts - * included in the input PDF. - * - * @param string $fontName the path to the font or the name of a font family. - * @return Pdf the pdf instance for method chaining - */ - public function replacementFont($path) - { - $this->getCommand() - ->addOption('replacement_font', $path); - return $this; - } - - /** - * Execute the operation and save the output file - * - * @param string $name of output file - * @return bool whether the PDF could be processed and saved - */ - public function saveAs($name) - { - if (!$this->getCommand()->getExecuted() && !$this->execute()) { - return false; - } - $tmpFile = (string) $this->getTmpFile(); - if (!copy($tmpFile, $name)) { - $this->_error = "Could not copy PDF from tmp location '$tmpFile' to '$name'"; - return false; - } - return true; - } - - /** - * Send PDF to client, either inline or as download (triggers PDF creation) - * - * @param string|null $filename the filename to send. If empty, the PDF is - * streamed inline. - * @param bool $inline whether to force inline display of the PDF, even if - * filename is present. - * @param array $headers a list of additional HTTP headers to send in the - * response as an array. The array keys are the header names like - * 'Cache-Control' and the array values the header value strings to send. - * Each array value can also be another array of strings if the same header - * should be sent multiple times. This can also be used to override - * automatically created headers like 'Expires' or 'Content-Length'. To suppress - * automatically created headers, `false` can also be used as header value. - * @return bool whether PDF was created successfully - */ - public function send($filename = null, $inline = false, $headers = array()) - { - if (!$this->getCommand()->getExecuted() && !$this->execute()) { - return false; - } - $this->getTmpFile()->send($filename, $this->_tmpOutputContentType, $inline, $headers); - return true; - } - - /** - * Get the raw PDF contents (triggers PDF creation). - * - * @return string|bool the PDF content as a string or `false` if the PDF - * wasn't created successfully. - */ - public function toString() - { - if (!$this->getCommand()->getExecuted() && !$this->execute()) { - return false; - } - return file_get_contents($this->getTmpFile()->getFileName()); - } - - /** - * @return Command the command instance that executes pdftk - */ - public function getCommand() - { - if ($this->_command === null) { - $this->_command = new Command; - } - return $this->_command; - } - - /** - * @return File the temporary output file instance - */ - public function getTmpFile() - { - if ($this->_tmpFile === null) { - $this->_tmpFile = new File('', '.pdf', self::TMP_PREFIX, $this->tempDir); - } - return $this->_tmpFile; - } - - /** - * @return string the error message or an empty string if none - */ - public function getError() - { - return $this->_error; - } - - /** - * Execute the pdftk command and store the output file to a temporary - * location or $this->_output if set. You should probably never call this - * method unless you only need a temporary PDF file as result. - * - * @return bool whether the command was executed successfully - */ - public function execute() - { - $command = $this->getCommand(); - if ($command->getExecuted()) { - return false; - } - - if ($this->_output === false) { - $filename = null; - } else { - $filename = $this->_output ? $this->_output : (string) $this->getTmpFile(); - } - if (!$command->execute($filename)) { - $this->_error = $command->getError(); - if ($filename && !(file_exists($filename) && filesize($filename) !== 0 && $this->ignoreWarnings)) { - return false; - } - } - return true; - } - - /** - * Make sure, that only one file is present - */ - protected function constrainSingleFile() - { - if ($this->getCommand()->getFileCount() > 1) { - throw new \Exception('This operation can only process single files'); - } - } - - /** - * @return string the next handle in the series A, B, C, ... Z, AA, AB... - */ - protected function nextHandle() - { - // N.B. Multi-character handles are only available in pdftk 1.45+ - - $i = $this->_handle++; - $char = 'A'; - while ($i-- > 0) { - $char++; - } - - return $char; - } -} diff --git a/composer/mikehaertl/php-pdftk/src/XfdfFile.php b/composer/mikehaertl/php-pdftk/src/XfdfFile.php deleted file mode 100644 index c1be2d947b..0000000000 --- a/composer/mikehaertl/php-pdftk/src/XfdfFile.php +++ /dev/null @@ -1,233 +0,0 @@ - field value - * 'Firstname' => 'John', - * - * // Hierarchical/nested fields in dot notation - * 'Address.Street' => 'Some Street', - * 'Address.City' => 'Any City', - * - * // Multi value fields - * 'Pets' => ['Cat', 'Mouse'], - * ] - * ``` - * - * This will result in the following XML structure (header/footer omitted): - * - * ``` - * - * John - * - * - * - * Some Street - * - * - * Any City - * - * - * - * Cat - * Mouse - * - * ``` - * - * @author Tomas Holy - * @author Michael Härtl - * @license http://www.opensource.org/licenses/MIT - */ -class XfdfFile extends File -{ - // XFDF file header - const XFDF_HEADER = << - - - -FDF; - - // XFDF file footer - const XFDF_FOOTER = << - - -FDF; - - /** - * Constructor - * - * - * @param array $data the form data as name => value - * @param string|null $suffix the optional suffix for the tmp file - * @param string|null $prefix the optional prefix for the tmp file. If null - * 'php_tmpfile_' is used. - * @param string|null $directory directory where the file should be - * created. Autodetected if not provided. - * @param string|null $encoding of the data. Default is 'UTF-8'. - */ - public function __construct($data, $suffix = null, $prefix = null, $directory = null, $encoding = 'UTF-8') - { - if ($directory === null) { - $directory = self::getTempDir(); - } - if ($suffix === null) { - $suffix = '.xfdf'; - } - if ($prefix === null) { - $prefix = 'php_pdftk_xfdf_'; - } - - $tempfile = tempnam($directory, $prefix); - $this->_fileName = $tempfile . $suffix; - rename($tempfile, $this->_fileName); - - $fields = $this->parseData($data, $encoding); - $this->writeXml($fields); - } - - /** - * Parses an array of key/value data into a nested array structure. - * - * The data may use keys in dot notation (#55). Values can also be arrays in - * case of multi value fields (#148). To make both distinguishable in the - * result array keys that represent field names are prefixed with `_`. This - * also allows for numeric field names (#260). - * - * For example an array like this: - * - * ``` - * [ - * 'a' => 'value a', - * 'b.x' => 'value b.x', - * 'b.y' => 'value b.y', - * - * 'c.0' => 'val c.0', - * 'c.1' => 'val c.1', - * - * 'd' => ['m1', 'm2'], - * ] - * ``` - * - * Will become: - * - * ``` - * [ - * '_a' => 'value a', - * '_b' => [ - * '_x' => 'value b.x', - * '_y' => 'value b.y', - * ], - * '_c' => [ - * '_0' => 'value c.0', - * '_1' => 'value c.1', - * ], - * '_d' => [ - * // notice the missing underscore in the keys - * 0 => 'm1', - * 1 => 'm2', - * ], - * ] - * - * - * @param mixed $data the data to parse - * @param string the encoding of the data - * @return array the result array in UTF-8 encoding with dot keys converted - * to nested arrays - */ - protected function parseData($data, $encoding) - { - $result = array(); - foreach ($data as $key => $value) { - if ($encoding !== 'UTF-8' && function_exists('mb_convert_encoding')) { - $key = mb_convert_encoding($key, 'UTF-8', $encoding); - $value = mb_convert_encoding($value, 'UTF-8', $encoding); - } - if (strpos($key, '.') === false) { - $result['_' . $key] = $value; - } else { - $target = &$result; - $keyParts = explode('.', $key); - $lastPart = array_pop($keyParts); - foreach ($keyParts as $part) { - if (!isset($target['_' . $part])) { - $target['_' . $part] = array(); - } - $target = &$target['_' . $part]; - } - $target['_' . $lastPart] = $value; - } - } - return $result; - } - - /** - * Write the given fields to an XML file - * - * @param array $fields the fields in a nested array structure - */ - protected function writeXml($fields) - { - // Use fwrite, since file_put_contents() messes around with character encoding - $fp = fopen($this->_fileName, 'w'); - fwrite($fp, self::XFDF_HEADER); - $this->writeFields($fp, $fields); - fwrite($fp, self::XFDF_FOOTER); - fclose($fp); - } - - /** - * Write the fields to the given filepointer - * - * @param int $fp - * @param mixed[] $fields an array of field values as returned by - * `parseData()`. - */ - protected function writeFields($fp, $fields) - { - foreach ($fields as $key => $value) { - $key = $this->xmlEncode(substr($key,1)); - fwrite($fp, "\n"); - if (!is_array($value)) { - $value = array($value); - } - if (array_key_exists(0, $value)) { - // Numeric keys: single or multi-value field - foreach($value as $val) { - $val = $this->xmlEncode($val); - fwrite($fp, "$val\n"); - } - } else { - // String keys: nested/hierarchical fields - $this->writeFields($fp, $value); - } - fwrite($fp, "\n"); - } - } - - /** - * @param string|null $value the value to encode - * @return string|null the value correctly encoded for use in a XML document - */ - protected function xmlEncode($value) - { - if ($value === null) { - return null; - } - return defined('ENT_XML1') ? - htmlspecialchars($value, ENT_XML1, 'UTF-8') : - htmlspecialchars($value); - } -} diff --git a/composer/mikehaertl/php-shellcommand/.github/workflows/tests.yml b/composer/mikehaertl/php-shellcommand/.github/workflows/tests.yml deleted file mode 100644 index 94c02ab72e..0000000000 --- a/composer/mikehaertl/php-shellcommand/.github/workflows/tests.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Tests -on: pull_request -jobs: - phpunit: - name: PHP ${{ matrix.php }} - runs-on: ubuntu-latest - strategy: - matrix: - php: - - "5.3" - - "5.4" - - "5.5" - - "5.6" - - "7.0" - - "7.1" - - "7.2" - - "7.3" - - "7.4" - - "8.0" - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Install PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - tools: composer:v2 - - - name: Update composer - run: composer self-update - - - name: Get composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: Cache dependencies - uses: actions/cache@v2 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-composer- - - - name: Install composer packages - run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi - - - name: Run phpunit - run: vendor/bin/phpunit --color=always diff --git a/composer/mikehaertl/php-shellcommand/CHANGELOG.md b/composer/mikehaertl/php-shellcommand/CHANGELOG.md deleted file mode 100644 index c7c13e0008..0000000000 --- a/composer/mikehaertl/php-shellcommand/CHANGELOG.md +++ /dev/null @@ -1,102 +0,0 @@ -# CHANGELOG - -## 1.6.4 - - * Let getExecCommand() not cache the created command string - -## 1.6.3 - - * Include PHP 5.3 in version requirements - -## 1.6.2 - - * Add .gitattributes to reduce package size - -## 1.6.1 - - * Issue #44 Fix potential security issue with escaping shell args (@Kirill89 / https://snyk.io/) - -## 1.6.0 - - * Issue #24 Implement timeout feature - -## 1.5.0 - - * Issue #20 Refactor handling of stdin/stdou/sterr streams with proc_open(). - By default these streams now operate in non-blocking mode which should fix - many hanging issues that were caused when the command received/sent a lot of - input/output. This is the new default on Non-Windows systems (it's not - supported on Windows, though). To get the old behavior the nonBlockingMode - option can be set to false. - -## 1.4.1 - - * Allow command names with spaces on Windows (@Robindfuller ) - -## 1.4.0 - - * Allow stdin to be a stream or a file handle (@Arzaroth) - -## 1.3.0 - - * Add setStdIn() which allows to pipe an input string to the command (@martinqvistgard) - -## 1.2.5 - - * Issue #22 Fix execution of relative file paths on windows - -## 1.2.4 - - * Reverted changes for Issue #20 as this introduced BC breaking problems - -## 1.2.3 - - * Issue #20: Read stderr before stdout to avoid hanging processes - -## 1.2.2 - - * Issue #16: Command on different drive didn't work on windows - -## 1.2.1 - - * Issue #1: Command with spaces didn't work on windows - -## 1.2.0 - - * Add option to return untrimmed output and error - -## 1.1.0 - - * Issue #7: UTF-8 encoded arguments where truncated - -## 1.0.7 - - * Issue #6: Solve `proc_open()` pipe configuration for both, Windows / Linux - -## 1.0.6 - - * Undid `proc_open()` changes as it broke error capturing - -## 1.0.5 - - * Improve `proc_open()` pipe configuration - -## 1.0.4 - - * Add `$useExec` option to fix Windows issues (#3) - -## 1.0.3 - - * Add `getExecuted()` to find out execution status of the command - -## 1.0.2 - - * Add `$escape` parameter to `addArg()` to override escaping settings per call - -## 1.0.1 - - * Minor fixes - -## 1.0.0 - - * Initial release diff --git a/composer/mikehaertl/php-shellcommand/LICENSE b/composer/mikehaertl/php-shellcommand/LICENSE deleted file mode 100644 index c60edfb5a1..0000000000 --- a/composer/mikehaertl/php-shellcommand/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Michael Härtl - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/composer/mikehaertl/php-shellcommand/README.md b/composer/mikehaertl/php-shellcommand/README.md deleted file mode 100644 index eaa4039585..0000000000 --- a/composer/mikehaertl/php-shellcommand/README.md +++ /dev/null @@ -1,204 +0,0 @@ -php-shellcommand -================ - -[![GitHub Tests](https://github.com/mikehaertl/php-shellcommand/workflows/Tests/badge.svg)](https://github.com/mikehaertl/php-shellcommand/actions) -[![Packagist Version](https://img.shields.io/packagist/v/mikehaertl/php-shellcommand?label=version)](https://packagist.org/packages/mikehaertl/php-shellcommand) -[![Packagist Downloads](https://img.shields.io/packagist/dt/mikehaertl/php-shellcommand)](https://packagist.org/packages/mikehaertl/php-shellcommand) -[![GitHub license](https://img.shields.io/github/license/mikehaertl/php-shellcommand)](https://github.com/mikehaertl/php-shellcommand/blob/master/LICENSE) -[![Packagist PHP Version Support](https://img.shields.io/packagist/php-v/mikehaertl/php-shellcommand)](https://packagist.org/packages/mikehaertl/php-shellcommand) - -php-shellcommand provides a simple object oriented interface to execute shell commands. - -## Installing - -### Prerequisites - -Your php version must be `5.4` or later. - -### Installing with composer - -This package can be installed easily using composer. - -``` -composer require mikehaertl/php-shellcommand -``` - -## Features - - * Catches `stdOut`, `stdErr` and `exitCode` - * Handle argument escaping - * Pass environment vars and other options to `proc_open()` - * Pipe resources like files or streams into the command - * Timeout for execution - -## Examples - -### Basic Example - -```php -execute()) { - echo $command->getOutput(); -} else { - echo $command->getError(); - $exitCode = $command->getExitCode(); -} -``` - -### Advanced Features - -#### Add Arguments -```php -addArg('--name=', "d'Artagnan"); - -// Add argument with several values -// results in --keys key1 key2 -$command->addArg('--keys', ['key1','key2']); -``` - -### Pipe Input Into Command - -From string: -```php -setStdIn('{"foo": 0}'); -if (!$command->execute()) { - echo $command->getError(); -} else { - echo $command->getOutput(); -} -// Output: -// { -// "foo": 0 -// } -``` - -From file: -```php -setStdIn($fh); -if (!$command->execute()) { - echo $command->getError(); -} else { - echo $command->getOutput(); -} -fclose($fh); -``` -From URL: -```php -setStdIn($fh); -if (!$command->execute()) { - echo $command->getError(); -} else { - echo $command->getOutput(); -} -fclose($fh); -``` - -#### Set Command Instance Options -```php - '/usr/local/bin/mycommand', - - // Will be passed as environment variables to the command - 'procEnv' => [ - 'DEMOVAR' => 'demovalue' - ], - - // Will be passed as options to proc_open() - 'procOptions' => [ - 'bypass_shell' => true, - ], -]); -``` - -## API - -### Properties - - * `$escapeArgs`: Whether to escape any argument passed through `addArg()`. Default is `true`. - * `$escapeCommand`: Whether to escape the command passed to `setCommand()` or the constructor. - This is only useful if `$escapeArgs` is `false`. Default is `false`. - * `$useExec`: Whether to use `exec()` instead of `proc_open()`. This is a workaround for OS which - have problems with `proc_open()`. Default is `false`. - * `$captureStdErr`: Whether to capture stderr when `useExec` is set. This will try to redirect - the otherwhise unavailable `stderr` to `stdout`, so that both have the same content on error. - Default is `true`. - * `$procCwd`: The initial working dir passed to `proc_open()`. Default is `null` for current - PHP working dir. - * `$procEnv`: An array with environment variables to pass to `proc_open()`. Default is `null` for none. - * `$procOptions`: An array of `other_options` for `proc_open()`. Default is `null` for none. - * `$nonBlockingMode`: Whether to set the stdin/stdout/stderr streams to non-blocking - mode when `proc_open()` is used. This allows to have huge inputs/outputs - without making the process hang. The default is `null` which will enable - the feature on Non-Windows systems. Set it to `true` or `false` to manually - enable/disable it. Note that it doesn't work on Windows. - * `$timeout`: The time in seconds after which the command should be - terminated. This only works in non-blocking mode. Default is `null` which - means the process is never terminated. - * `$locale`: The locale to (temporarily) set with `setlocale()` before running the command. - This can be set to e.g. `en_US.UTF-8` if you have issues with UTF-8 encoded arguments. - -You can configure all these properties via an array that you pass in the constructor. You can also -pass `command`, `execCommand` and `args` as options. This will call the respective setter (`setCommand()`, -`setExecCommand()`, etc.). - -### Methods - - * `__construct($options = null)` - * `$options`: either a command string or an options array (see `setOptions()`) - * `__toString()`: The result from `getExecCommand()` - * `setOptions($options)`: Set command options - * `$options`: array of name => value options that should be applied to the object. - You can also pass options that use a setter, e.g. you can pass a `command` option which - will be passed to `setCommand().` - * `setCommand($command)`: Set command - * `$command`: The command or full command string to execute, like `gzip` or `gzip -d`. - You can still call `addArg()` to add more arguments to the command. If `$escapeCommand` was - set to `true`, the command gets escaped through `escapeshellcmd()`. - * `getCommand()`: The command that was set through `setCommand()` or passed to the constructor. - * `getExecCommand()`: The full command string to execute. - * `setArgs($args)`: Set argument as string - * `$args`: The command arguments as string. Note, that these will not get escaped. This - will overwrite the args added with `addArgs()`. - * `getArgs()`: The command arguments that where set through `setArgs()` or `addArg()`, as string - * `addArg($key, $value=null, $escape=null)`: Add argument with correct escaping - * `$key`: The argument key to add e.g. `--feature` or `--name=`. If the key does not end with - and `=`, the (optional) `$value` will be separated by a space. The key will get - escaped if `$escapeArgs` is `true`. - * `$value`: The optional argument value which will get escaped if `$escapeArgs` is `true`. - An array can be passed to add more than one value for a key, e.g. `addArg('--exclude', ['val1','val2'])` - which will create the option "--exclude 'val1' 'val2'". - * `$escape`: If set, this overrides the `$escapeArgs` setting and enforces escaping/no escaping - * `setStdIn()`: String or resource to supply to command via standard input. - This enables the same functionality as piping on the command line. It can - also be a resource like a file handle or a stream in which case its content - will be piped into the command like an input redirection. - * `getOutput()`: The command output as string. Empty if none. - * `getError()`: The error message, either stderr or internal message. Empty if no error. - * `getStdErr()`: The stderr output. Empty if none. - * `getExitCode()`: The exit code or `null` if command was not executed. - * `getExecuted()`: Whether the command was successfully executed. - * `getIsWindows()`: Whether we are on a Windows Owe are on a Windows OS - * `execute()`: Executes the command and returns `true` on success, `false` otherwhise. - -> **Note:** `getError()`, `getStdErr()` and `getOutput()` return the trimmed output. -> You can pass `false` to these methods if you need any possible line breaks at the end. diff --git a/composer/mikehaertl/php-shellcommand/composer.json b/composer/mikehaertl/php-shellcommand/composer.json deleted file mode 100644 index a638fca654..0000000000 --- a/composer/mikehaertl/php-shellcommand/composer.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "mikehaertl/php-shellcommand", - "description": "An object oriented interface to shell commands", - "keywords": ["shell"], - "license": "MIT", - "authors": [ - { - "name": "Michael Härtl", - "email": "haertl.mike@gmail.com" - } - ], - "require": { - "php": ">= 5.3.0" - }, - "require-dev": { - "phpunit/phpunit": ">4.0 <=9.4" - }, - "autoload": { - "psr-4": { - "mikehaertl\\shellcommand\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "tests\\": "tests" - } - } -} diff --git a/composer/mikehaertl/php-shellcommand/src/Command.php b/composer/mikehaertl/php-shellcommand/src/Command.php deleted file mode 100644 index 963ced9689..0000000000 --- a/composer/mikehaertl/php-shellcommand/src/Command.php +++ /dev/null @@ -1,568 +0,0 @@ -addArg('--name=', "d'Artagnan"); - * if ($command->execute()) { - * echo $command->getOutput(); - * } else { - * echo $command->getError(); - * $exitCode = $command->getExitCode(); - * } - * ``` - * - * @author Michael Härtl - * @license http://www.opensource.org/licenses/MIT - */ -class Command -{ - /** - * @var bool whether to escape any argument passed through `addArg()`. - * Default is `true`. - */ - public $escapeArgs = true; - - /** - * @var bool whether to escape the command passed to `setCommand()` or the - * constructor. This is only useful if `$escapeArgs` is `false`. Default - * is `false`. - */ - public $escapeCommand = false; - - /** - * @var bool whether to use `exec()` instead of `proc_open()`. This can be - * used on Windows system to workaround some quirks there. Note, that any - * errors from your command will be output directly to the PHP output - * stream. `getStdErr()` will also not work anymore and thus you also won't - * get the error output from `getError()` in this case. You also can't pass - * any environment variables to the command if this is enabled. Default is - * `false`. - */ - public $useExec = false; - - /** - * @var bool whether to capture stderr (2>&1) when `useExec` is true. This - * will try to redirect the stderr to stdout and provide the complete - * output of both in `getStdErr()` and `getError()`. Default is `true`. - */ - public $captureStdErr = true; - - /** - * @var string|null the initial working dir for `proc_open()`. Default is - * `null` for current PHP working dir. - */ - public $procCwd; - - /** - * @var array|null an array with environment variables to pass to - * `proc_open()`. Default is `null` for none. - */ - public $procEnv; - - /** - * @var array|null an array of other_options for `proc_open()`. Default is - * `null` for none. - */ - public $procOptions; - - /** - * @var bool|null whether to set the stdin/stdout/stderr streams to - * non-blocking mode when `proc_open()` is used. This allows to have huge - * inputs/outputs without making the process hang. The default is `null` - * which will enable the feature on Non-Windows systems. Set it to `true` - * or `false` to manually enable/disable it. It does not work on Windows. - */ - public $nonBlockingMode; - - /** - * @var int the time in seconds after which a command should be terminated. - * This only works in non-blocking mode. Default is `null` which means the - * process is never terminated. - */ - public $timeout; - - /** - * @var null|string the locale to temporarily set before calling - * `escapeshellargs()`. Default is `null` for none. - */ - public $locale; - - /** - * @var null|string|resource to pipe to standard input - */ - protected $_stdIn; - - /** - * @var string the command to execute - */ - protected $_command; - - /** - * @var array the list of command arguments - */ - protected $_args = array(); - - /** - * @var string the stdout output - */ - protected $_stdOut = ''; - - /** - * @var string the stderr output - */ - protected $_stdErr = ''; - - /** - * @var int the exit code - */ - protected $_exitCode; - - /** - * @var string the error message - */ - protected $_error = ''; - - /** - * @var bool whether the command was successfully executed - */ - protected $_executed = false; - - /** - * @param string|array $options either a command string or an options array - * @see setOptions - */ - public function __construct($options = null) - { - if (is_array($options)) { - $this->setOptions($options); - } elseif (is_string($options)) { - $this->setCommand($options); - } - } - - /** - * @param array $options array of name => value options (i.e. public - * properties) that should be applied to this object. You can also pass - * options that use a setter, e.g. you can pass a `fileName` option which - * will be passed to `setFileName()`. - * @throws \Exception on unknown option keys - * @return static for method chaining - */ - public function setOptions($options) - { - foreach ($options as $key => $value) { - if (property_exists($this, $key)) { - $this->$key = $value; - } else { - $method = 'set'.ucfirst($key); - if (method_exists($this, $method)) { - call_user_func(array($this,$method), $value); - } else { - throw new \Exception("Unknown configuration option '$key'"); - } - } - } - return $this; - } - - /** - * @param string $command the command or full command string to execute, - * like 'gzip' or 'gzip -d'. You can still call addArg() to add more - * arguments to the command. If `$escapeCommand` was set to true, the command - * gets escaped with `escapeshellcmd()`. - * @return static for method chaining - */ - public function setCommand($command) - { - if ($this->escapeCommand) { - $command = escapeshellcmd($command); - } - if ($this->getIsWindows()) { - // Make sure to switch to correct drive like "E:" first if we have - // a full path in command - if (isset($command[1]) && $command[1] === ':') { - $position = 1; - // Could be a quoted absolute path because of spaces. - // i.e. "C:\Program Files (x86)\file.exe" - } elseif (isset($command[2]) && $command[2] === ':') { - $position = 2; - } else { - $position = false; - } - - // Absolute path. If it's a relative path, let it slide. - if ($position) { - $command = sprintf( - $command[$position - 1] . ': && cd %s && %s', - escapeshellarg(dirname($command)), - escapeshellarg(basename($command)) - ); - } - } - $this->_command = $command; - return $this; - } - - /** - * @param string|resource $stdIn If set, the string will be piped to the - * command via standard input. This enables the same functionality as - * piping on the command line. It can also be a resource like a file - * handle or a stream in which case its content will be piped into the - * command like an input redirection. - * @return static for method chaining - */ - public function setStdIn($stdIn) { - $this->_stdIn = $stdIn; - return $this; - } - - /** - * @return string|null the command that was set through `setCommand()` or - * passed to the constructor. `null` if none. - */ - public function getCommand() - { - return $this->_command; - } - - /** - * @return string|bool the full command string to execute. If no command - * was set with `setCommand()` or passed to the constructor it will return - * `false`. - */ - public function getExecCommand() - { - $command = $this->getCommand(); - if (!$command) { - $this->_error = 'Could not locate any executable command'; - return false; - } - - $args = $this->getArgs(); - return $args ? $command.' '.$args : $command; - } - - /** - * @param string $args the command arguments as string like `'--arg1=value1 - * --arg2=value2'`. Note that this string will not get escaped. This will - * overwrite the args added with `addArgs()`. - * @return static for method chaining - */ - public function setArgs($args) - { - $this->_args = array($args); - return $this; - } - - /** - * @return string the command args that where set with `setArgs()` or added - * with `addArg()` separated by spaces. - */ - public function getArgs() - { - return implode(' ', $this->_args); - } - - /** - * @param string $key the argument key to add e.g. `--feature` or - * `--name=`. If the key does not end with `=`, the (optional) $value will - * be separated by a space. The key will get escaped if `$escapeArgs` is `true`. - * @param string|array|null $value the optional argument value which will - * get escaped if $escapeArgs is true. An array can be passed to add more - * than one value for a key, e.g. - * `addArg('--exclude', array('val1','val2'))` - * which will create the option - * `'--exclude' 'val1' 'val2'`. - * @param bool|null $escape if set, this overrides the `$escapeArgs` setting - * and enforces escaping/no escaping of keys and values - * @return static for method chaining - */ - public function addArg($key, $value = null, $escape = null) - { - $doEscape = $escape !== null ? $escape : $this->escapeArgs; - $useLocale = $doEscape && $this->locale !== null; - - if ($useLocale) { - $locale = setlocale(LC_CTYPE, 0); // Returns current locale setting - setlocale(LC_CTYPE, $this->locale); - } - if ($value === null) { - $this->_args[] = $doEscape ? escapeshellarg($key) : $key; - } else { - if (substr($key, -1) === '=') { - $separator = '='; - $argKey = substr($key, 0, -1); - } else { - $separator = ' '; - $argKey = $key; - } - $argKey = $doEscape ? escapeshellarg($argKey) : $argKey; - - if (is_array($value)) { - $params = array(); - foreach ($value as $v) { - $params[] = $doEscape ? escapeshellarg($v) : $v; - } - $this->_args[] = $argKey . $separator . implode(' ', $params); - } else { - $this->_args[] = $argKey . $separator . - ($doEscape ? escapeshellarg($value) : $value); - } - } - if ($useLocale) { - setlocale(LC_CTYPE, $locale); - } - - return $this; - } - - /** - * @param bool $trim whether to `trim()` the return value. The default is `true`. - * @param string $characters the list of characters to trim. The default - * is ` \t\n\r\0\v\f`. - * @return string the command output (stdout). Empty if none. - */ - public function getOutput($trim = true, $characters = " \t\n\r\0\v\f") - { - return $trim ? trim($this->_stdOut, $characters) : $this->_stdOut; - } - - /** - * @param bool $trim whether to `trim()` the return value. The default is `true`. - * @param string $characters the list of characters to trim. The default - * is ` \t\n\r\0\v\f`. - * @return string the error message, either stderr or an internal message. - * Empty string if none. - */ - public function getError($trim = true, $characters = " \t\n\r\0\v\f") - { - return $trim ? trim($this->_error, $characters) : $this->_error; - } - - /** - * @param bool $trim whether to `trim()` the return value. The default is `true`. - * @param string $characters the list of characters to trim. The default - * is ` \t\n\r\0\v\f`. - * @return string the stderr output. Empty if none. - */ - public function getStdErr($trim = true, $characters = " \t\n\r\0\v\f") - { - return $trim ? trim($this->_stdErr, $characters) : $this->_stdErr; - } - - /** - * @return int|null the exit code or null if command was not executed yet - */ - public function getExitCode() - { - return $this->_exitCode; - } - - /** - * @return string whether the command was successfully executed - */ - public function getExecuted() - { - return $this->_executed; - } - - /** - * Execute the command - * - * @return bool whether execution was successful. If `false`, error details - * can be obtained from `getError()`, `getStdErr()` and `getExitCode()`. - */ - public function execute() - { - $command = $this->getExecCommand(); - - if (!$command) { - return false; - } - - if ($this->useExec) { - $execCommand = $this->captureStdErr ? "$command 2>&1" : $command; - exec($execCommand, $output, $this->_exitCode); - $this->_stdOut = implode("\n", $output); - if ($this->_exitCode !== 0) { - $this->_stdErr = $this->_stdOut; - $this->_error = empty($this->_stdErr) ? 'Command failed' : $this->_stdErr; - return false; - } - } else { - $isInputStream = $this->_stdIn !== null && - is_resource($this->_stdIn) && - in_array(get_resource_type($this->_stdIn), array('file', 'stream')); - $isInputString = is_string($this->_stdIn); - $hasInput = $isInputStream || $isInputString; - $hasTimeout = $this->timeout !== null && $this->timeout > 0; - - $descriptors = array( - 1 => array('pipe','w'), - 2 => array('pipe', $this->getIsWindows() ? 'a' : 'w'), - ); - if ($hasInput) { - $descriptors[0] = array('pipe', 'r'); - } - - - // Issue #20 Set non-blocking mode to fix hanging processes - $nonBlocking = $this->nonBlockingMode === null ? - !$this->getIsWindows() : $this->nonBlockingMode; - - $startTime = $hasTimeout ? time() : 0; - $process = proc_open($command, $descriptors, $pipes, $this->procCwd, $this->procEnv, $this->procOptions); - - if (is_resource($process)) { - - if ($nonBlocking) { - stream_set_blocking($pipes[1], false); - stream_set_blocking($pipes[2], false); - if ($hasInput) { - $writtenBytes = 0; - $isInputOpen = true; - stream_set_blocking($pipes[0], false); - if ($isInputStream) { - stream_set_blocking($this->_stdIn, false); - } - } - - // Due to the non-blocking streams we now have to check in - // a loop if the process is still running. We also need to - // ensure that all the pipes are written/read alternately - // until there's nothing left to write/read. - $isRunning = true; - while ($isRunning) { - $status = proc_get_status($process); - $isRunning = $status['running']; - - // We first write to stdIn if we have an input. For big - // inputs it will only write until the input buffer of - // the command is full (the command may now wait that - // we read the output buffers - see below). So we may - // have to continue writing in another cycle. - // - // After everything is written it's safe to close the - // input pipe. - if ($isRunning && $hasInput && $isInputOpen) { - if ($isInputStream) { - $written = stream_copy_to_stream($this->_stdIn, $pipes[0], 16 * 1024, $writtenBytes); - if ($written === false || $written === 0) { - $isInputOpen = false; - fclose($pipes[0]); - } else { - $writtenBytes += $written; - } - } else { - if ($writtenBytes < strlen($this->_stdIn)) { - $writtenBytes += fwrite($pipes[0], substr($this->_stdIn, $writtenBytes)); - } else { - $isInputOpen = false; - fclose($pipes[0]); - } - } - } - - // Read out the output buffers because if they are full - // the command may block execution. We do this even if - // $isRunning is `false`, because there could be output - // left in the buffers. - // - // The latter is only an assumption and needs to be - // verified - but it does not hurt either and works as - // expected. - // - while (($out = fgets($pipes[1])) !== false) { - $this->_stdOut .= $out; - } - while (($err = fgets($pipes[2])) !== false) { - $this->_stdErr .= $err; - } - - $runTime = $hasTimeout ? time() - $startTime : 0; - if ($isRunning && $hasTimeout && $runTime >= $this->timeout) { - // Only send a SIGTERM and handle status in the next cycle - proc_terminate($process); - } - - if (!$isRunning) { - $this->_exitCode = $status['exitcode']; - if ($this->_exitCode !== 0 && empty($this->_stdErr)) { - if ($status['stopped']) { - $signal = $status['stopsig']; - $this->_stdErr = "Command stopped by signal $signal"; - } elseif ($status['signaled']) { - $signal = $status['termsig']; - $this->_stdErr = "Command terminated by signal $signal"; - } else { - $this->_stdErr = 'Command unexpectedly terminated without error message'; - } - } - fclose($pipes[1]); - fclose($pipes[2]); - proc_close($process); - } else { - // The command is still running. Let's wait some - // time before we start the next cycle. - usleep(10000); - } - } - } else { - if ($hasInput) { - if ($isInputStream) { - stream_copy_to_stream($this->_stdIn, $pipes[0]); - } elseif ($isInputString) { - fwrite($pipes[0], $this->_stdIn); - } - fclose($pipes[0]); - } - $this->_stdOut = stream_get_contents($pipes[1]); - $this->_stdErr = stream_get_contents($pipes[2]); - fclose($pipes[1]); - fclose($pipes[2]); - $this->_exitCode = proc_close($process); - } - - if ($this->_exitCode !== 0) { - $this->_error = $this->_stdErr ? - $this->_stdErr : - "Failed without error message: $command (Exit code: {$this->_exitCode})"; - return false; - } - } else { - $this->_error = "Could not run command $command"; - return false; - } - } - - $this->_executed = true; - - return true; - } - - /** - * @return bool whether we are on a Windows OS - */ - public function getIsWindows() - { - return strncasecmp(PHP_OS, 'WIN', 3)===0; - } - - /** - * @return string the current command string to execute - */ - public function __toString() - { - return (string) $this->getExecCommand(); - } -} diff --git a/composer/mikehaertl/php-tmpfile/.github/workflows/tests.yml b/composer/mikehaertl/php-tmpfile/.github/workflows/tests.yml deleted file mode 100644 index 94c02ab72e..0000000000 --- a/composer/mikehaertl/php-tmpfile/.github/workflows/tests.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Tests -on: pull_request -jobs: - phpunit: - name: PHP ${{ matrix.php }} - runs-on: ubuntu-latest - strategy: - matrix: - php: - - "5.3" - - "5.4" - - "5.5" - - "5.6" - - "7.0" - - "7.1" - - "7.2" - - "7.3" - - "7.4" - - "8.0" - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Install PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - tools: composer:v2 - - - name: Update composer - run: composer self-update - - - name: Get composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: Cache dependencies - uses: actions/cache@v2 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-composer- - - - name: Install composer packages - run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi - - - name: Run phpunit - run: vendor/bin/phpunit --color=always diff --git a/composer/mikehaertl/php-tmpfile/LICENSE b/composer/mikehaertl/php-tmpfile/LICENSE deleted file mode 100644 index 28dbb2a292..0000000000 --- a/composer/mikehaertl/php-tmpfile/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Michael Härtl - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/composer/mikehaertl/php-tmpfile/README.md b/composer/mikehaertl/php-tmpfile/README.md deleted file mode 100644 index 86d7b4a56b..0000000000 --- a/composer/mikehaertl/php-tmpfile/README.md +++ /dev/null @@ -1,64 +0,0 @@ -php-tmpfile -=========== - -[![GitHub Tests](https://github.com/mikehaertl/php-tmpfile/workflows/Tests/badge.svg)](https://github.com/mikehaertl/php-tmpfile/actions) -[![Packagist Version](https://img.shields.io/packagist/v/mikehaertl/php-tmpfile?label=version)](https://packagist.org/packages/mikehaertl/php-tmpfile) -[![Packagist Downloads](https://img.shields.io/packagist/dt/mikehaertl/php-tmpfile)](https://packagist.org/packages/mikehaertl/php-tmpfile) -[![GitHub license](https://img.shields.io/github/license/mikehaertl/php-tmpfile)](https://github.com/mikehaertl/php-tmpfile/blob/master/LICENSE) - -A convenience class for temporary files. - -## Features - - * Create temporary file with arbitrary content - * Delete file after use (can be disabled) - * Send file to client, either inline or with save dialog, optionally with custom HTTP headers - * Save file locally - -## Examples - -```php -send('home.html'); -// ... with custom content type (autodetected otherwhise) -$file->send('home.html', 'application/pdf'); -// ... for inline display (download dialog otherwhise) -$file->send('home.html', 'application/pdf', true); -// ... with custom headers -$file->send('home.html', 'application/pdf', true, [ - 'X-Header' => 'Example', -]); - -// save to disk -$file->saveAs('/dir/test.html'); - -// Access file name and directory -echo $file->getFileName(); -echo $file->getTempDir(); -``` - -If you want to keep the temporary file, e.g. for debugging, you can set the `$delete` property to false: - -```php -delete = false; -``` - -Default HTTP headers can also be added: -```php -send('home.html'); -``` diff --git a/composer/mikehaertl/php-tmpfile/composer.json b/composer/mikehaertl/php-tmpfile/composer.json deleted file mode 100644 index c28c46a3ec..0000000000 --- a/composer/mikehaertl/php-tmpfile/composer.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "mikehaertl/php-tmpfile", - "description": "A convenience class for temporary files", - "keywords": ["files"], - "license": "MIT", - "authors": [ - { - "name": "Michael Härtl", - "email": "haertl.mike@gmail.com" - } - ], - "require-dev": { - "php": ">=5.3.0", - "phpunit/phpunit": ">4.0 <=9.4" - }, - "autoload": { - "psr-4": { - "mikehaertl\\tmp\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "tests\\": "tests" - } - } -} diff --git a/composer/mikehaertl/php-tmpfile/src/File.php b/composer/mikehaertl/php-tmpfile/src/File.php deleted file mode 100644 index 2271260195..0000000000 --- a/composer/mikehaertl/php-tmpfile/src/File.php +++ /dev/null @@ -1,197 +0,0 @@ - - * @license http://www.opensource.org/licenses/MIT - */ -class File -{ - const DEFAULT_CONTENT_TYPE = 'application/octet-stream'; - - /** - * @var bool whether to delete the tmp file when it's no longer referenced - * or when the request ends. Default is `true`. - */ - public $delete = true; - - /** - * @var array the list of static default headers to send when `send()` is - * called as key/value pairs. - */ - public static $defaultHeaders = array( - 'Pragma' => 'public', - 'Expires' => 0, - 'Cache-Control' => 'must-revalidate, post-check=0, pre-check=0', - 'Content-Transfer-Encoding' => 'binary', - ); - - /** - * @var string the name of this file - */ - protected $_fileName; - - /** - * Constructor - * - * @param string $content the tmp file content - * @param string|null $suffix the optional suffix for the tmp file - * @param string|null $prefix the optional prefix for the tmp file. If null - * 'php_tmpfile_' is used. - * @param string|null $directory directory where the file should be - * created. Autodetected if not provided. - */ - public function __construct($content, $suffix = null, $prefix = null, $directory = null) - { - if ($directory === null) { - $directory = self::getTempDir(); - } - - if ($prefix === null) { - $prefix = 'php_tmpfile_'; - } - - $this->_fileName = tempnam($directory,$prefix); - if ($suffix !== null) { - $newName = $this->_fileName . $suffix; - rename($this->_fileName, $newName); - $this->_fileName = $newName; - } - file_put_contents($this->_fileName, $content); - } - - /** - * Delete tmp file on shutdown if `$delete` is `true` - */ - public function __destruct() - { - if ($this->delete && file_exists($this->_fileName)) { - unlink($this->_fileName); - } - } - - /** - * Send tmp file to client, either inline or as download - * - * @param string|null $filename the filename to send. If empty, the file is - * streamed inline. - * @param string|null $contentType the Content-Type header to send. If - * `null` the type is auto-detected and if that fails - * 'application/octet-stream' is used. - * @param bool $inline whether to force inline display of the file, even if - * filename is present. - * @param array $headers a list of additional HTTP headers to send in the - * response as an array. The array keys are the header names like - * 'Cache-Control' and the array values the header value strings to send. - * Each array value can also be another array of strings if the same header - * should be sent multiple times. This can also be used to override - * automatically created headers like 'Expires' or 'Content-Length'. To suppress - * automatically created headers, `false` can also be used as header value. - */ - public function send($filename = null, $contentType = null, $inline = false, $headers = array()) - { - $headers = array_merge(self::$defaultHeaders, $headers); - - if ($contentType !== null) { - $headers['Content-Type'] = $contentType; - } elseif (!isset($headers['Content-Type'])) { - $contentType = @mime_content_type($this->_filename); - if ($contentType === false) { - $contentType = self::DEFAULT_CONTENT_TYPE; - } - $headers['Content-Type'] = $contentType; - } - - if (!isset($headers['Content-Length'])) { - // #11 Undefined index: HTTP_USER_AGENT - $userAgent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ''; - - // #84: Content-Length leads to "network connection was lost" on iOS - $isIOS = preg_match('/i(phone|pad|pod)/i', $userAgent); - if (!$isIOS) { - $headers['Content-Length'] = filesize($this->_fileName); - } - } - - if (($filename !== null || $inline) && !isset($headers['Content-Disposition'])) { - $disposition = $inline ? 'inline' : 'attachment'; - $encodedFilename = rawurlencode($filename); - $headers['Content-Disposition'] = "$disposition; " . - "filename=\"$filename\"; " . - "filename*=UTF-8''$encodedFilename"; - } - - $this->sendHeaders($headers); - readfile($this->_fileName); - } - - /** - * @param string $name the name to save the file as - * @return bool whether the file could be saved - */ - public function saveAs($name) - { - return copy($this->_fileName, $name); - } - - /** - * @return string the full file name - */ - public function getFileName() - { - return $this->_fileName; - } - - /** - * @return string the path to the temp directory - */ - public static function getTempDir() - { - if (function_exists('sys_get_temp_dir')) { - return sys_get_temp_dir(); - } elseif ( - ($tmp = getenv('TMP')) || - ($tmp = getenv('TEMP')) || - ($tmp = getenv('TMPDIR')) - ) { - return realpath($tmp); - } else { - return '/tmp'; - } - } - - /** - * @return string the full file name - */ - public function __toString() - { - return $this->_fileName; - } - - /** - * Send the given list of headers - * - * @param array $headers the list of headers to send as key/value pairs. - * Value can either be a string or an array of strings to send the same - * header multiple times. - */ - protected function sendHeaders($headers) - { - foreach ($headers as $name => $value) { - if ($value === false) { - continue; - } - if (is_array($value)) { - foreach ($value as $v) { - header("$name: $v"); - } - } else { - header("$name: $value"); - } - } - } -} diff --git a/krankerl.toml b/krankerl.toml index 39210c65c8..e18bbcc4ec 100644 --- a/krankerl.toml +++ b/krankerl.toml @@ -1,7 +1,7 @@ [package] before_cmds = [ - "composer install --working-dir=composer/", - "composer dump --working-dir=composer/", + "composer install --no-dev", + "composer dump", "bash ./build/download-fonts.sh", "npm ci", "npm run build"