From 2246ca8b6685adcee470f460f7ca484ac52a10ed Mon Sep 17 00:00:00 2001 From: SmetDenis Date: Mon, 1 Apr 2024 21:59:02 +0400 Subject: [PATCH 01/13] Implement parallel processing functionality for CSV file validation In this commit, the parallel processing capability was added to improve performance when validating CSV files. The changes include updates to the workflow file and Dockerfile, adding support for a thread-safe version of PHP and the parallel extension. Also, a new dependency `hds-solutions/parallel-sdk` was included in the "composer.json" file, along with relevant changes in other files. --- .github/workflows/main.yml | 5 ++- .phan.php | 9 +++-- Dockerfile | 4 +-- composer.json | 13 +++++--- composer.lock | 67 +++++++++++++++++++++++++++++++++----- 5 files changed, 80 insertions(+), 18 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4dd7a50f..2ea9ce2e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -45,6 +45,9 @@ jobs: test-current-versions: name: Tests - Current runs-on: ubuntu-latest + strategy: + matrix: + ext-parallel: [ '', 'parallel' ] steps: - name: Checkout code uses: actions/checkout@v4 @@ -56,7 +59,7 @@ jobs: with: php-version: 8.3 coverage: xdebug - extensions: ast + extensions: ast, {{ matrix.ext-parallel }} - name: Build project run: make build --no-print-directory diff --git a/.phan.php b/.phan.php index bb249315..e767a30b 100644 --- a/.phan.php +++ b/.phan.php @@ -23,14 +23,17 @@ 'directory_list' => [ 'src', - 'vendor/jbzoo/ci-report-converter/src', - 'vendor/jbzoo/cli/src', 'vendor/jbzoo/data/src', + 'vendor/jbzoo/cli/src', 'vendor/jbzoo/utils/src', - 'vendor/league/csv/src', + 'vendor/jbzoo/ci-report-converter/src', + 'vendor/symfony/console', 'vendor/symfony/finder', + + 'vendor/league/csv/src', 'vendor/markrogoyski/math-php/src', 'vendor/respect/validation', + 'vendor/hds-solutions/parallel-sdk', ], ]); diff --git a/Dockerfile b/Dockerfile index e5cd65d4..2a32d95e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,11 +17,11 @@ COPY . /tmp RUN make build-version ######################################################################################## -FROM php:8.3-cli-alpine +FROM php:8.3-zts-alpine # Install PHP extensions ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ -RUN install-php-extensions opcache @composer +RUN install-php-extensions opcache parallel @composer # Install application # run `make build-version` before! diff --git a/composer.json b/composer.json index 39305c66..f8a1b4d8 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name" : "jbzoo/csv-blueprint", - "type" : "project", + "type" : "project", "description" : "CLI Utility for Validating and Generating CSV Files Based on Custom Rules. It ensures your data meets specified criteria, streamlining data management and integrity checks.", "license" : "MIT", "keywords" : [ @@ -28,9 +28,7 @@ "require" : { "php" : "^8.1", - "ext-mbstring" : "*", - "league/csv" : "^9.15.0", "jbzoo/data" : "^7.1.1", "jbzoo/cli" : "^7.2.2", "jbzoo/utils" : "^7.2.1", @@ -39,11 +37,14 @@ "symfony/yaml" : ">=6.4.3", "symfony/filesystem" : ">=6.4.3", "symfony/finder" : ">=6.4.0", + "symfony/polyfill-mbstring" : "^1.29.0", + + "league/csv" : "^9.15.0", "markrogoyski/math-php" : "^2.9.0", "respect/validation" : "^2.3.6", "giggsey/libphonenumber-for-php-lite" : "^8.13.33", "giggsey/locale" : "^2.5", - "symfony/polyfill-mbstring" : "^1.29.0" + "hds-solutions/parallel-sdk" : "^2.1.4" }, "require-dev" : { @@ -53,6 +54,10 @@ "fakerphp/faker" : "^1.23.1" }, + "suggest" : { + "ext-parallel" : "Parallel processing of CSV files for better performance" + }, + "bin" : ["csv-blueprint"], "autoload" : { diff --git a/composer.lock b/composer.lock index 4009a556..5fa0db8a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "36f97cb9f275e6a0d29b9241ab3084ca", + "content-hash" : "77174ecf96d9315e44afe847234f52fa", "packages": [ { "name": "bluepsyduck/symfony-process-manager", @@ -199,6 +199,58 @@ }, "time": "2023-11-01T17:19:48+00:00" }, + { + "name" : "hds-solutions/parallel-sdk", + "version" : "v2.1.4", + "source" : { + "type" : "git", + "url" : "https://github.com/hschimpf/parallel-sdk.git", + "reference" : "91a38540d1b0c8723fb064781d25bfcf9ce5ce17" + }, + "dist" : { + "type" : "zip", + "url" : "https://api.github.com/repos/hschimpf/parallel-sdk/zipball/91a38540d1b0c8723fb064781d25bfcf9ce5ce17", + "reference" : "91a38540d1b0c8723fb064781d25bfcf9ce5ce17", + "shasum" : "" + }, + "require" : { + "php" : ">=8.0" + }, + "require-dev" : { + "phpunit/phpunit" : "^9.6", + "roave/security-advisories" : "dev-latest", + "symfony/console" : "^6.0" + }, + "suggest" : { + "ext-parallel" : "Allows to run multi-threaded processes", + "symfony/console" : "Allows usage of a shared ProgressBar between the Workers" + }, + "type" : "library", + "autoload" : { + "files" : [ + "src/helpers.php" + ], + "psr-4" : { + "HDSSolutions\\Console\\Parallel\\" : "src/" + } + }, + "notification-url" : "https://packagist.org/downloads/", + "license" : [ + "GPL-3.0" + ], + "authors" : [ + { + "name" : "Hermann D. Schimpf", + "email" : "hschimpf@hds-solutions.net" + } + ], + "description" : "SDK to implement parallel php extension", + "support" : { + "issues" : "https://github.com/hschimpf/parallel-sdk/issues", + "source" : "https://github.com/hschimpf/parallel-sdk/tree/v2.1.4" + }, + "time" : "2024-03-27T17:42:48+00:00" + }, { "name": "jbzoo/ci-report-converter", "version": "7.2.1", @@ -7362,16 +7414,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.9.0", + "version" : "3.9.1", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "d63cee4890a8afaf86a22e51ad4d97c91dd4579b" + "reference" : "267a4405fff1d9c847134db3a3c92f1ab7f77909" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/d63cee4890a8afaf86a22e51ad4d97c91dd4579b", - "reference": "d63cee4890a8afaf86a22e51ad4d97c91dd4579b", + "url" : "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/267a4405fff1d9c847134db3a3c92f1ab7f77909", + "reference" : "267a4405fff1d9c847134db3a3c92f1ab7f77909", "shasum": "" }, "require": { @@ -7438,7 +7490,7 @@ "type": "open_collective" } ], - "time": "2024-02-16T15:06:51+00:00" + "time" : "2024-03-31T21:03:09+00:00" }, { "name": "symfony/config", @@ -8537,8 +8589,7 @@ "prefer-stable": true, "prefer-lowest": false, "platform": { - "php": "^8.1", - "ext-mbstring": "*" + "php" : "^8.1" }, "platform-dev": [], "plugin-api-version": "2.6.0" From c7c0fb299e940a3e3ece71534aeaec651b177c87 Mon Sep 17 00:00:00 2001 From: SmetDenis Date: Mon, 1 Apr 2024 22:01:56 +0400 Subject: [PATCH 02/13] Correct PHP syntax in Github workflow --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2ea9ce2e..fccf657c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -59,7 +59,7 @@ jobs: with: php-version: 8.3 coverage: xdebug - extensions: ast, {{ matrix.ext-parallel }} + extensions: ast, ${{ matrix.ext-parallel }} - name: Build project run: make build --no-print-directory From b2ff9083b2bfbda79201f7af33267771731df5f3 Mon Sep 17 00:00:00 2001 From: SmetDenis Date: Mon, 1 Apr 2024 22:05:21 +0400 Subject: [PATCH 03/13] Correct PHP syntax in Github workflow --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fccf657c..97f20c8f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -60,6 +60,8 @@ jobs: php-version: 8.3 coverage: xdebug extensions: ast, ${{ matrix.ext-parallel }} + env: + phpts: zts - name: Build project run: make build --no-print-directory From 22f7e98fbf47d8ae576fa19083e693ec2c25275e Mon Sep 17 00:00:00 2001 From: SmetDenis Date: Mon, 1 Apr 2024 22:07:24 +0400 Subject: [PATCH 04/13] Correct PHP syntax in Github workflow --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 97f20c8f..e86ba44f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -43,7 +43,7 @@ env: jobs: test-current-versions: - name: Tests - Current + name: Tests runs-on: ubuntu-latest strategy: matrix: @@ -61,7 +61,7 @@ jobs: coverage: xdebug extensions: ast, ${{ matrix.ext-parallel }} env: - phpts: zts + phpts: ts - name: Build project run: make build --no-print-directory From 105dd63d2ad63c0ed151e7b78770f64cf0c19817 Mon Sep 17 00:00:00 2001 From: SmetDenis Date: Mon, 1 Apr 2024 22:10:32 +0400 Subject: [PATCH 05/13] Correct PHP syntax in Github workflow --- .github/workflows/main.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e86ba44f..23bd443b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -56,6 +56,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 + id: setup-php with: php-version: 8.3 coverage: xdebug @@ -63,6 +64,18 @@ jobs: env: phpts: ts + - name: Print PHP version + run: echo ${{ steps.setup-php.outputs.php-version }} + + - name: Print PHP info + run: php -i + + - name: lscpu + run: lscpu + + - name: nproc + run: nproc + - name: Build project run: make build --no-print-directory From a47fb822fb960bb4d88cf4905fa8b4ee35df62e3 Mon Sep 17 00:00:00 2001 From: SmetDenis Date: Mon, 1 Apr 2024 22:10:54 +0400 Subject: [PATCH 06/13] Correct PHP syntax in Github workflow --- .github/workflows/main.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 23bd443b..e4a81900 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -76,6 +76,9 @@ jobs: - name: nproc run: nproc + - name: cpuinfo + run: cat /proc/cpuinfo + - name: Build project run: make build --no-print-directory From 92d9d376d4f3a29ada0279cf1474bd99df09b456 Mon Sep 17 00:00:00 2001 From: SmetDenis Date: Mon, 1 Apr 2024 22:15:55 +0400 Subject: [PATCH 07/13] More specifically, the commit removes unnecessary print and system information commands from the Github workflow's main.yml file, and also updates the 'phpts' environment variable from 'ts' to 'zts'. The changes aim at optimizing the workflow runs and reducing the noise in workflow logs. --- .github/workflows/main.yml | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e4a81900..5e0f89ba 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -62,22 +62,7 @@ jobs: coverage: xdebug extensions: ast, ${{ matrix.ext-parallel }} env: - phpts: ts - - - name: Print PHP version - run: echo ${{ steps.setup-php.outputs.php-version }} - - - name: Print PHP info - run: php -i - - - name: lscpu - run: lscpu - - - name: nproc - run: nproc - - - name: cpuinfo - run: cat /proc/cpuinfo + phpts: zts - name: Build project run: make build --no-print-directory From f45c3764aa8df2a7409473624227223d111d1bfb Mon Sep 17 00:00:00 2001 From: SmetDenis Date: Mon, 1 Apr 2024 22:21:02 +0400 Subject: [PATCH 08/13] Add support for parallel PHP extension The code changes include adding the requirement for the parallel PHP extension in the composer.json and composer.lock files. The updates also include bootstrap for the parallel extension in autoload.php and csv-blueprint.php. These modifications ensure better multi-threading --- composer.json | 1 + composer.lock | 5 +++-- csv-blueprint.php | 5 +++++ tests/autoload.php | 4 ++++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index f8a1b4d8..625e5774 100644 --- a/composer.json +++ b/composer.json @@ -28,6 +28,7 @@ "require" : { "php" : "^8.1", + "ext-parallel" : "*", "jbzoo/data" : "^7.1.1", "jbzoo/cli" : "^7.2.2", diff --git a/composer.lock b/composer.lock index 5fa0db8a..a5dcaf38 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash" : "77174ecf96d9315e44afe847234f52fa", + "content-hash" : "2a47c96533de876d47dd3ff5102a9dd6", "packages": [ { "name": "bluepsyduck/symfony-process-manager", @@ -8589,7 +8589,8 @@ "prefer-stable": true, "prefer-lowest": false, "platform": { - "php" : "^8.1" + "php" : "^8.1", + "ext-parallel" : "*" }, "platform-dev": [], "plugin-api-version": "2.6.0" diff --git a/csv-blueprint.php b/csv-blueprint.php index 24e800b3..5a474401 100644 --- a/csv-blueprint.php +++ b/csv-blueprint.php @@ -19,6 +19,11 @@ \define('PATH_ROOT', __DIR__); require_once __DIR__ . '/vendor/autoload.php'; +if (\extension_loaded('parallel')) { + // set the path to composer's autoloader + parallel\bootstrap(__DIR__ . '/vendor/autoload.php'); +} + // Fix for GitHub actions. See action.yml $_SERVER['argv'] = Utils::fixArgv($_SERVER['argv'] ?? []); $_SERVER['argc'] = \count($_SERVER['argv']); diff --git a/tests/autoload.php b/tests/autoload.php index 90acf384..9b7f3aac 100644 --- a/tests/autoload.php +++ b/tests/autoload.php @@ -23,3 +23,7 @@ echo 'Please execute "composer update" !' . \PHP_EOL; exit(1); } + +if (\extension_loaded('parallel')) { + parallel\bootstrap(__DIR__ . '/vendor/autoload.php'); +} From 629b8c0975835d1452e1299e01b687da9675e747 Mon Sep 17 00:00:00 2001 From: SmetDenis Date: Mon, 1 Apr 2024 22:25:15 +0400 Subject: [PATCH 09/13] Fix bootstrap call in PHP files and adjust README indentation This commit corrects the bootstrap function call under the parallel extension in both "tests/autoload.php" and "csv-blueprint.php" files to ensure proper functioning in PHP applications. Additionally, it improves the README file's readability by fixing the indentations in a section explaining the usage of "csv.header" in two different cases. --- csv-blueprint.php | 2 +- tests/autoload.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/csv-blueprint.php b/csv-blueprint.php index 5a474401..4eda5956 100644 --- a/csv-blueprint.php +++ b/csv-blueprint.php @@ -21,7 +21,7 @@ if (\extension_loaded('parallel')) { // set the path to composer's autoloader - parallel\bootstrap(__DIR__ . '/vendor/autoload.php'); + \parallel\bootstrap(__DIR__ . '/vendor/autoload.php'); } // Fix for GitHub actions. See action.yml diff --git a/tests/autoload.php b/tests/autoload.php index 9b7f3aac..4429d093 100644 --- a/tests/autoload.php +++ b/tests/autoload.php @@ -25,5 +25,5 @@ } if (\extension_loaded('parallel')) { - parallel\bootstrap(__DIR__ . '/vendor/autoload.php'); + \parallel\bootstrap(__DIR__ . '/vendor/autoload.php'); } From 70c1fd1736f8309b2e444caf65a2fd5dd5b08169 Mon Sep 17 00:00:00 2001 From: SmetDenis Date: Mon, 1 Apr 2024 22:36:11 +0400 Subject: [PATCH 10/13] Fix bootstrap call in PHP files and adjust README indentation This commit corrects the bootstrap function call under the parallel extension in both "tests/autoload.php" and "csv-blueprint.php" files to ensure proper functioning in PHP applications. Additionally, it improves the README file's readability by fixing the indentations in a section explaining the usage of "csv.header" in two different cases. --- composer.json | 1 - composer.lock | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 625e5774..f8a1b4d8 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,6 @@ "require" : { "php" : "^8.1", - "ext-parallel" : "*", "jbzoo/data" : "^7.1.1", "jbzoo/cli" : "^7.2.2", diff --git a/composer.lock b/composer.lock index a5dcaf38..5fa0db8a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash" : "2a47c96533de876d47dd3ff5102a9dd6", + "content-hash" : "77174ecf96d9315e44afe847234f52fa", "packages": [ { "name": "bluepsyduck/symfony-process-manager", @@ -8589,8 +8589,7 @@ "prefer-stable": true, "prefer-lowest": false, "platform": { - "php" : "^8.1", - "ext-parallel" : "*" + "php" : "^8.1" }, "platform-dev": [], "plugin-api-version": "2.6.0" From 8b960eea8263b4c8ba5fff0cd98e2d2b52367820 Mon Sep 17 00:00:00 2001 From: SmetDenis Date: Mon, 1 Apr 2024 22:37:05 +0400 Subject: [PATCH 11/13] Fix bootstrap call in PHP files and adjust README indentation This commit corrects the bootstrap function call under the parallel extension in both "tests/autoload.php" and "csv-blueprint.php" files to ensure proper functioning in PHP applications. Additionally, it improves the README file's readability by fixing the indentations in a section explaining the usage of "csv.header" in two different cases. --- tests/ReadmeTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/ReadmeTest.php b/tests/ReadmeTest.php index cc1adad2..3439406e 100644 --- a/tests/ReadmeTest.php +++ b/tests/ReadmeTest.php @@ -30,8 +30,8 @@ final class ReadmeTest extends TestCase '* Check that each row matches the number of columns.', '* With `strict_column_order` rule, you can check that the columns are in the correct order.', '* With `allow_extra_columns` rule, you can check that there are no extra columns in the CSV file.', - ' * If `csv.header: true`. Schema contains an unknown column `name` that is not found in the CSV file.', - ' * If `csv.header: false`. Compare the number of columns in the schema and the CSV file.', + ' * If `csv.header: true`. Schema contains an unknown column `name` that is not found in the CSV file.', + ' * If `csv.header: false`. Compare the number of columns in the schema and the CSV file.', ]; public function testCreateCsvHelp(): void From 85bf1e6b33e6ac505d1df74d16d8e764e5ade01a Mon Sep 17 00:00:00 2001 From: SmetDenis Date: Mon, 1 Apr 2024 22:41:41 +0400 Subject: [PATCH 12/13] Fix bootstrap call in PHP files and adjust README indentation This commit corrects the bootstrap function call under the parallel extension in both "tests/autoload.php" and "csv-blueprint.php" files to ensure proper functioning in PHP applications. Additionally, it improves the README file's readability by fixing the indentations in a section explaining the usage of "csv.header" in two different cases. --- composer.json | 3 +- composer.lock | 661 +++++++++++++++++++++++++++++++++++++------------- 2 files changed, 496 insertions(+), 168 deletions(-) diff --git a/composer.json b/composer.json index f8a1b4d8..e755db6f 100644 --- a/composer.json +++ b/composer.json @@ -44,7 +44,8 @@ "respect/validation" : "^2.3.6", "giggsey/libphonenumber-for-php-lite" : "^8.13.33", "giggsey/locale" : "^2.5", - "hds-solutions/parallel-sdk" : "^2.1.4" + "hds-solutions/parallel-sdk" : "^2.1.4", + "amphp/parallel" : "^1.4" }, "require-dev" : { diff --git a/composer.lock b/composer.lock index 5fa0db8a..ea90b964 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,501 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash" : "77174ecf96d9315e44afe847234f52fa", + "content-hash" : "393c8b70a4c8c91f5ad327f963bfdcfc", "packages": [ + { + "name" : "amphp/amp", + "version" : "v2.6.4", + "source" : { + "type" : "git", + "url" : "https://github.com/amphp/amp.git", + "reference" : "ded3d9be08f526089eb7ee8d9f16a9768f9dec2d" + }, + "dist" : { + "type" : "zip", + "url" : "https://api.github.com/repos/amphp/amp/zipball/ded3d9be08f526089eb7ee8d9f16a9768f9dec2d", + "reference" : "ded3d9be08f526089eb7ee8d9f16a9768f9dec2d", + "shasum" : "" + }, + "require" : { + "php" : ">=7.1" + }, + "require-dev" : { + "amphp/php-cs-fixer-config" : "dev-master", + "amphp/phpunit-util" : "^1", + "ext-json" : "*", + "jetbrains/phpstorm-stubs" : "^2019.3", + "phpunit/phpunit" : "^7 | ^8 | ^9", + "react/promise" : "^2", + "vimeo/psalm" : "^3.12" + }, + "type" : "library", + "extra" : { + "branch-alias" : { + "dev-master" : "2.x-dev" + } + }, + "autoload" : { + "files" : [ + "lib/functions.php", + "lib/Internal/functions.php" + ], + "psr-4" : { + "Amp\\" : "lib" + } + }, + "notification-url" : "https://packagist.org/downloads/", + "license" : [ + "MIT" + ], + "authors" : [ + { + "name" : "Daniel Lowrey", + "email" : "rdlowrey@php.net" + }, + { + "name" : "Aaron Piotrowski", + "email" : "aaron@trowski.com" + }, + { + "name" : "Bob Weinand", + "email" : "bobwei9@hotmail.com" + }, + { + "name" : "Niklas Keller", + "email" : "me@kelunik.com" + } + ], + "description" : "A non-blocking concurrency framework for PHP applications.", + "homepage" : "https://amphp.org/amp", + "keywords" : [ + "async", + "asynchronous", + "awaitable", + "concurrency", + "event", + "event-loop", + "future", + "non-blocking", + "promise" + ], + "support" : { + "irc" : "irc://irc.freenode.org/amphp", + "issues" : "https://github.com/amphp/amp/issues", + "source" : "https://github.com/amphp/amp/tree/v2.6.4" + }, + "funding" : [ + { + "url" : "https://github.com/amphp", + "type" : "github" + } + ], + "time" : "2024-03-21T18:52:26+00:00" + }, + { + "name" : "amphp/byte-stream", + "version" : "v1.8.1", + "source" : { + "type" : "git", + "url" : "https://github.com/amphp/byte-stream.git", + "reference" : "acbd8002b3536485c997c4e019206b3f10ca15bd" + }, + "dist" : { + "type" : "zip", + "url" : "https://api.github.com/repos/amphp/byte-stream/zipball/acbd8002b3536485c997c4e019206b3f10ca15bd", + "reference" : "acbd8002b3536485c997c4e019206b3f10ca15bd", + "shasum" : "" + }, + "require" : { + "amphp/amp" : "^2", + "php" : ">=7.1" + }, + "require-dev" : { + "amphp/php-cs-fixer-config" : "dev-master", + "amphp/phpunit-util" : "^1.4", + "friendsofphp/php-cs-fixer" : "^2.3", + "jetbrains/phpstorm-stubs" : "^2019.3", + "phpunit/phpunit" : "^6 || ^7 || ^8", + "psalm/phar" : "^3.11.4" + }, + "type" : "library", + "extra" : { + "branch-alias" : { + "dev-master" : "1.x-dev" + } + }, + "autoload" : { + "files" : [ + "lib/functions.php" + ], + "psr-4" : { + "Amp\\ByteStream\\" : "lib" + } + }, + "notification-url" : "https://packagist.org/downloads/", + "license" : [ + "MIT" + ], + "authors" : [ + { + "name" : "Aaron Piotrowski", + "email" : "aaron@trowski.com" + }, + { + "name" : "Niklas Keller", + "email" : "me@kelunik.com" + } + ], + "description" : "A stream abstraction to make working with non-blocking I/O simple.", + "homepage" : "http://amphp.org/byte-stream", + "keywords" : [ + "amp", + "amphp", + "async", + "io", + "non-blocking", + "stream" + ], + "support" : { + "irc" : "irc://irc.freenode.org/amphp", + "issues" : "https://github.com/amphp/byte-stream/issues", + "source" : "https://github.com/amphp/byte-stream/tree/v1.8.1" + }, + "funding" : [ + { + "url" : "https://github.com/amphp", + "type" : "github" + } + ], + "time" : "2021-03-30T17:13:30+00:00" + }, + { + "name" : "amphp/parallel", + "version" : "v1.4.3", + "source" : { + "type" : "git", + "url" : "https://github.com/amphp/parallel.git", + "reference" : "3aac213ba7858566fd83d38ccb85b91b2d652cb0" + }, + "dist" : { + "type" : "zip", + "url" : "https://api.github.com/repos/amphp/parallel/zipball/3aac213ba7858566fd83d38ccb85b91b2d652cb0", + "reference" : "3aac213ba7858566fd83d38ccb85b91b2d652cb0", + "shasum" : "" + }, + "require" : { + "amphp/amp" : "^2", + "amphp/byte-stream" : "^1.6.1", + "amphp/parser" : "^1", + "amphp/process" : "^1", + "amphp/serialization" : "^1", + "amphp/sync" : "^1.0.1", + "php" : ">=7.1" + }, + "require-dev" : { + "amphp/php-cs-fixer-config" : "dev-master", + "amphp/phpunit-util" : "^1.1", + "phpunit/phpunit" : "^8 || ^7" + }, + "type" : "library", + "autoload" : { + "files" : [ + "lib/Context/functions.php", + "lib/Sync/functions.php", + "lib/Worker/functions.php" + ], + "psr-4" : { + "Amp\\Parallel\\" : "lib" + } + }, + "notification-url" : "https://packagist.org/downloads/", + "license" : [ + "MIT" + ], + "authors" : [ + { + "name" : "Aaron Piotrowski", + "email" : "aaron@trowski.com" + }, + { + "name" : "Stephen Coakley", + "email" : "me@stephencoakley.com" + } + ], + "description" : "Parallel processing component for Amp.", + "homepage" : "https://github.com/amphp/parallel", + "keywords" : [ + "async", + "asynchronous", + "concurrent", + "multi-processing", + "multi-threading" + ], + "support" : { + "issues" : "https://github.com/amphp/parallel/issues", + "source" : "https://github.com/amphp/parallel/tree/v1.4.3" + }, + "funding" : [ + { + "url" : "https://github.com/amphp", + "type" : "github" + } + ], + "time" : "2023-03-23T08:04:23+00:00" + }, + { + "name" : "amphp/parser", + "version" : "v1.1.1", + "source" : { + "type" : "git", + "url" : "https://github.com/amphp/parser.git", + "reference" : "3cf1f8b32a0171d4b1bed93d25617637a77cded7" + }, + "dist" : { + "type" : "zip", + "url" : "https://api.github.com/repos/amphp/parser/zipball/3cf1f8b32a0171d4b1bed93d25617637a77cded7", + "reference" : "3cf1f8b32a0171d4b1bed93d25617637a77cded7", + "shasum" : "" + }, + "require" : { + "php" : ">=7.4" + }, + "require-dev" : { + "amphp/php-cs-fixer-config" : "^2", + "phpunit/phpunit" : "^9", + "psalm/phar" : "^5.4" + }, + "type" : "library", + "autoload" : { + "psr-4" : { + "Amp\\Parser\\" : "src" + } + }, + "notification-url" : "https://packagist.org/downloads/", + "license" : [ + "MIT" + ], + "authors" : [ + { + "name" : "Aaron Piotrowski", + "email" : "aaron@trowski.com" + }, + { + "name" : "Niklas Keller", + "email" : "me@kelunik.com" + } + ], + "description" : "A generator parser to make streaming parsers simple.", + "homepage" : "https://github.com/amphp/parser", + "keywords" : [ + "async", + "non-blocking", + "parser", + "stream" + ], + "support" : { + "issues" : "https://github.com/amphp/parser/issues", + "source" : "https://github.com/amphp/parser/tree/v1.1.1" + }, + "funding" : [ + { + "url" : "https://github.com/amphp", + "type" : "github" + } + ], + "time" : "2024-03-21T19:16:53+00:00" + }, + { + "name" : "amphp/process", + "version" : "v1.1.6", + "source" : { + "type" : "git", + "url" : "https://github.com/amphp/process.git", + "reference" : "2cd38052ddb200dcd73d34d8e06654dadb101e7c" + }, + "dist" : { + "type" : "zip", + "url" : "https://api.github.com/repos/amphp/process/zipball/2cd38052ddb200dcd73d34d8e06654dadb101e7c", + "reference" : "2cd38052ddb200dcd73d34d8e06654dadb101e7c", + "shasum" : "" + }, + "require" : { + "amphp/amp" : "^2", + "amphp/byte-stream" : "^1.4", + "php" : ">=7.1" + }, + "require-dev" : { + "amphp/php-cs-fixer-config" : "dev-master", + "amphp/phpunit-util" : "^1", + "phpunit/phpunit" : "^6" + }, + "type" : "library", + "autoload" : { + "files" : [ + "lib/functions.php" + ], + "psr-4" : { + "Amp\\Process\\" : "lib" + } + }, + "notification-url" : "https://packagist.org/downloads/", + "license" : [ + "MIT" + ], + "authors" : [ + { + "name" : "Bob Weinand", + "email" : "bobwei9@hotmail.com" + }, + { + "name" : "Aaron Piotrowski", + "email" : "aaron@trowski.com" + }, + { + "name" : "Niklas Keller", + "email" : "me@kelunik.com" + } + ], + "description" : "Asynchronous process manager.", + "homepage" : "https://github.com/amphp/process", + "support" : { + "issues" : "https://github.com/amphp/process/issues", + "source" : "https://github.com/amphp/process/tree/v1.1.6" + }, + "funding" : [ + { + "url" : "https://github.com/amphp", + "type" : "github" + } + ], + "time" : "2024-03-21T19:24:36+00:00" + }, + { + "name" : "amphp/serialization", + "version" : "v1.0.0", + "source" : { + "type" : "git", + "url" : "https://github.com/amphp/serialization.git", + "reference" : "693e77b2fb0b266c3c7d622317f881de44ae94a1" + }, + "dist" : { + "type" : "zip", + "url" : "https://api.github.com/repos/amphp/serialization/zipball/693e77b2fb0b266c3c7d622317f881de44ae94a1", + "reference" : "693e77b2fb0b266c3c7d622317f881de44ae94a1", + "shasum" : "" + }, + "require" : { + "php" : ">=7.1" + }, + "require-dev" : { + "amphp/php-cs-fixer-config" : "dev-master", + "phpunit/phpunit" : "^9 || ^8 || ^7" + }, + "type" : "library", + "autoload" : { + "files" : [ + "src/functions.php" + ], + "psr-4" : { + "Amp\\Serialization\\" : "src" + } + }, + "notification-url" : "https://packagist.org/downloads/", + "license" : [ + "MIT" + ], + "authors" : [ + { + "name" : "Aaron Piotrowski", + "email" : "aaron@trowski.com" + }, + { + "name" : "Niklas Keller", + "email" : "me@kelunik.com" + } + ], + "description" : "Serialization tools for IPC and data storage in PHP.", + "homepage" : "https://github.com/amphp/serialization", + "keywords" : [ + "async", + "asynchronous", + "serialization", + "serialize" + ], + "support" : { + "issues" : "https://github.com/amphp/serialization/issues", + "source" : "https://github.com/amphp/serialization/tree/master" + }, + "time" : "2020-03-25T21:39:07+00:00" + }, + { + "name" : "amphp/sync", + "version" : "v1.4.2", + "source" : { + "type" : "git", + "url" : "https://github.com/amphp/sync.git", + "reference" : "85ab06764f4f36d63b1356b466df6111cf4b89cf" + }, + "dist" : { + "type" : "zip", + "url" : "https://api.github.com/repos/amphp/sync/zipball/85ab06764f4f36d63b1356b466df6111cf4b89cf", + "reference" : "85ab06764f4f36d63b1356b466df6111cf4b89cf", + "shasum" : "" + }, + "require" : { + "amphp/amp" : "^2.2", + "php" : ">=7.1" + }, + "require-dev" : { + "amphp/php-cs-fixer-config" : "dev-master", + "amphp/phpunit-util" : "^1.1", + "phpunit/phpunit" : "^9 || ^8 || ^7" + }, + "type" : "library", + "autoload" : { + "files" : [ + "src/functions.php", + "src/ConcurrentIterator/functions.php" + ], + "psr-4" : { + "Amp\\Sync\\" : "src" + } + }, + "notification-url" : "https://packagist.org/downloads/", + "license" : [ + "MIT" + ], + "authors" : [ + { + "name" : "Aaron Piotrowski", + "email" : "aaron@trowski.com" + }, + { + "name" : "Stephen Coakley", + "email" : "me@stephencoakley.com" + } + ], + "description" : "Mutex, Semaphore, and other synchronization tools for Amp.", + "homepage" : "https://github.com/amphp/sync", + "keywords" : [ + "async", + "asynchronous", + "mutex", + "semaphore", + "synchronization" + ], + "support" : { + "issues" : "https://github.com/amphp/sync/issues", + "source" : "https://github.com/amphp/sync/tree/v1.4.2" + }, + "funding" : [ + { + "url" : "https://github.com/amphp", + "type" : "github" + } + ], + "time" : "2021-10-25T18:29:10+00:00" + }, { "name": "bluepsyduck/symfony-process-manager", "version": "1.3.3", @@ -2189,172 +2682,6 @@ } ], "packages-dev": [ - { - "name": "amphp/amp", - "version": "v2.6.4", - "source": { - "type": "git", - "url": "https://github.com/amphp/amp.git", - "reference": "ded3d9be08f526089eb7ee8d9f16a9768f9dec2d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/amphp/amp/zipball/ded3d9be08f526089eb7ee8d9f16a9768f9dec2d", - "reference": "ded3d9be08f526089eb7ee8d9f16a9768f9dec2d", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "amphp/php-cs-fixer-config": "dev-master", - "amphp/phpunit-util": "^1", - "ext-json": "*", - "jetbrains/phpstorm-stubs": "^2019.3", - "phpunit/phpunit": "^7 | ^8 | ^9", - "react/promise": "^2", - "vimeo/psalm": "^3.12" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.x-dev" - } - }, - "autoload": { - "files": [ - "lib/functions.php", - "lib/Internal/functions.php" - ], - "psr-4": { - "Amp\\": "lib" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Daniel Lowrey", - "email": "rdlowrey@php.net" - }, - { - "name": "Aaron Piotrowski", - "email": "aaron@trowski.com" - }, - { - "name": "Bob Weinand", - "email": "bobwei9@hotmail.com" - }, - { - "name": "Niklas Keller", - "email": "me@kelunik.com" - } - ], - "description": "A non-blocking concurrency framework for PHP applications.", - "homepage": "https://amphp.org/amp", - "keywords": [ - "async", - "asynchronous", - "awaitable", - "concurrency", - "event", - "event-loop", - "future", - "non-blocking", - "promise" - ], - "support": { - "irc": "irc://irc.freenode.org/amphp", - "issues": "https://github.com/amphp/amp/issues", - "source": "https://github.com/amphp/amp/tree/v2.6.4" - }, - "funding": [ - { - "url": "https://github.com/amphp", - "type": "github" - } - ], - "time": "2024-03-21T18:52:26+00:00" - }, - { - "name": "amphp/byte-stream", - "version": "v1.8.1", - "source": { - "type": "git", - "url": "https://github.com/amphp/byte-stream.git", - "reference": "acbd8002b3536485c997c4e019206b3f10ca15bd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/amphp/byte-stream/zipball/acbd8002b3536485c997c4e019206b3f10ca15bd", - "reference": "acbd8002b3536485c997c4e019206b3f10ca15bd", - "shasum": "" - }, - "require": { - "amphp/amp": "^2", - "php": ">=7.1" - }, - "require-dev": { - "amphp/php-cs-fixer-config": "dev-master", - "amphp/phpunit-util": "^1.4", - "friendsofphp/php-cs-fixer": "^2.3", - "jetbrains/phpstorm-stubs": "^2019.3", - "phpunit/phpunit": "^6 || ^7 || ^8", - "psalm/phar": "^3.11.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "files": [ - "lib/functions.php" - ], - "psr-4": { - "Amp\\ByteStream\\": "lib" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Aaron Piotrowski", - "email": "aaron@trowski.com" - }, - { - "name": "Niklas Keller", - "email": "me@kelunik.com" - } - ], - "description": "A stream abstraction to make working with non-blocking I/O simple.", - "homepage": "http://amphp.org/byte-stream", - "keywords": [ - "amp", - "amphp", - "async", - "io", - "non-blocking", - "stream" - ], - "support": { - "irc": "irc://irc.freenode.org/amphp", - "issues": "https://github.com/amphp/byte-stream/issues", - "source": "https://github.com/amphp/byte-stream/tree/v1.8.1" - }, - "funding": [ - { - "url": "https://github.com/amphp", - "type": "github" - } - ], - "time": "2021-03-30T17:13:30+00:00" - }, { "name": "composer/pcre", "version": "3.1.3", From c907e32657e6a95e711da340fd8ea3df1b6f5eb5 Mon Sep 17 00:00:00 2001 From: SmetDenis Date: Mon, 1 Apr 2024 22:42:45 +0400 Subject: [PATCH 13/13] Fix bootstrap call in PHP files and adjust README indentation This commit corrects the bootstrap function call under the parallel extension in both "tests/autoload.php" and "csv-blueprint.php" files to ensure proper functioning in PHP applications. Additionally, it improves the README file's readability by fixing the indentations in a section explaining the usage of "csv.header" in two different cases. --- tests/ReadmeTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/ReadmeTest.php b/tests/ReadmeTest.php index 3439406e..76dd2eab 100644 --- a/tests/ReadmeTest.php +++ b/tests/ReadmeTest.php @@ -30,8 +30,8 @@ final class ReadmeTest extends TestCase '* Check that each row matches the number of columns.', '* With `strict_column_order` rule, you can check that the columns are in the correct order.', '* With `allow_extra_columns` rule, you can check that there are no extra columns in the CSV file.', - ' * If `csv.header: true`. Schema contains an unknown column `name` that is not found in the CSV file.', - ' * If `csv.header: false`. Compare the number of columns in the schema and the CSV file.', + ' * If `csv.header: true`. Schema contains an unknown column `name` that is not found in the CSV file.', + ' * If `csv.header: false`. Compare the number of columns in the schema and the CSV file.', ]; public function testCreateCsvHelp(): void