From 79df48fa80bbed3631b907a068e2fd2d1ec029fa Mon Sep 17 00:00:00 2001 From: neo Date: Mon, 27 Jan 2025 09:26:41 +0100 Subject: [PATCH 1/3] ADD: PHP CS Fixer --- .gitignore | 1 + .php-cs-fixer.dist.php | 53 + CONTRIBUTING.md | 7 + composer.json | 9 +- composer.lock | 2546 ++++++++++++++++++++++++++++++++++++++++ 5 files changed, 2614 insertions(+), 2 deletions(-) create mode 100644 .php-cs-fixer.dist.php create mode 100644 composer.lock diff --git a/.gitignore b/.gitignore index 1fe1b00e..531cd966 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .idea/ node_modules/ +vendor/ diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php new file mode 100644 index 00000000..4315e983 --- /dev/null +++ b/.php-cs-fixer.dist.php @@ -0,0 +1,53 @@ +in(__DIR__) + ->path([ + 'mapBuilder/', + 'mapBuilderAdmin/', + ]) +; + +return (new PhpCsFixer\Config()) + ->setRules([ + '@PSR2' => true, + '@Symfony' => true, + '@PhpCsFixer' => true, + 'array_syntax' => array('syntax'=>'long'), + 'method_argument_space'=> ['on_multiline' => 'ensure_fully_multiline'], + 'new_with_braces'=> true, + 'no_whitespace_in_blank_line'=> true, + 'no_whitespace_before_comma_in_array'=> true, + 'no_useless_return' => true, + 'no_unneeded_final_method'=> false, + 'no_unset_cast' => false, + 'no_leading_import_slash'=> true, + 'no_leading_namespace_whitespace'=> true, + 'no_extra_blank_lines'=> true, + 'no_empty_statement'=> true, + 'no_empty_comment'=> true, + 'object_operator_without_whitespace' => true, + 'ordered_class_elements' => false, + 'phpdoc_var_without_name' => true, + 'phpdoc_types' => true, + 'phpdoc_trim_consecutive_blank_line_separation' => true, + 'phpdoc_no_useless_inheritdoc' => true, + 'phpdoc_no_empty_return' => true, + 'phpdoc_add_missing_param_annotation' => true, + 'protected_to_private' => false, + 'semicolon_after_instruction' => true, + 'short_scalar_cast' => true, + 'simplified_null_return' => false, + 'simple_to_complex_string_variable' => false, + 'standardize_not_equals' => true, + 'standardize_increment' => true, + 'whitespace_after_comma_in_array' => true, + 'yoda_style'=>array( + 'always_move_variable' => false, + 'equal' => false, + 'identical' => false, + 'less_and_greater' => null, + ) + ]) + ->setFinder($finder) + ; diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 640e012e..119ee347 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,17 +2,24 @@ ## Testing with linters +Before the next part, you must have installed the dependencies with `npm install` and `composer install` at the project root. Before the next part, you must have installed the dependencies with `npm install` at the project root. ### StyleLint for CSS +If you want to see all your issues on the PHP code without fixing it, you If you want to see all your issues on the CSS code without fixing it, you can run the following command: + ```bash +composer cs-check npm run stylelint-check ``` + If you want to fix the issues automatically, you can run the following command: + ```bash +composer cs-fix npm run stylelint-fix ``` _Note : The command `npm run stylelint-fix` may not fix all the issues and print them on the screen. diff --git a/composer.json b/composer.json index 75ff11cf..16baee76 100644 --- a/composer.json +++ b/composer.json @@ -11,8 +11,6 @@ "email": "nboisteault@3liz.com" } ], - "require": { - }, "minimum-stability": "stable", "extra" : { "jelix" : { @@ -33,5 +31,12 @@ } } } + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.68" + }, + "scripts": { + "cs-fix": "./vendor/bin/php-cs-fixer fix", + "cs-check": "./vendor/bin/php-cs-fixer fix --dry-run --diff" } } diff --git a/composer.lock b/composer.lock new file mode 100644 index 00000000..4e7eda94 --- /dev/null +++ b/composer.lock @@ -0,0 +1,2546 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "dc3fb2b52d852a3e67de1822566b711d", + "packages": [], + "packages-dev": [ + { + "name": "clue/ndjson-react", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/clue/reactphp-ndjson.git", + "reference": "392dc165fce93b5bb5c637b67e59619223c931b0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/clue/reactphp-ndjson/zipball/392dc165fce93b5bb5c637b67e59619223c931b0", + "reference": "392dc165fce93b5bb5c637b67e59619223c931b0", + "shasum": "" + }, + "require": { + "php": ">=5.3", + "react/stream": "^1.2" + }, + "require-dev": { + "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35", + "react/event-loop": "^1.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Clue\\React\\NDJson\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering" + } + ], + "description": "Streaming newline-delimited JSON (NDJSON) parser and encoder for ReactPHP.", + "homepage": "https://github.com/clue/reactphp-ndjson", + "keywords": [ + "NDJSON", + "json", + "jsonlines", + "newline", + "reactphp", + "streaming" + ], + "support": { + "issues": "https://github.com/clue/reactphp-ndjson/issues", + "source": "https://github.com/clue/reactphp-ndjson/tree/v1.3.0" + }, + "funding": [ + { + "url": "https://clue.engineering/support", + "type": "custom" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2022-12-23T10:58:28+00:00" + }, + { + "name": "composer/pcre", + "version": "3.3.2", + "source": { + "type": "git", + "url": "https://github.com/composer/pcre.git", + "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/pcre/zipball/b2bed4734f0cc156ee1fe9c0da2550420d99a21e", + "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0" + }, + "conflict": { + "phpstan/phpstan": "<1.11.10" + }, + "require-dev": { + "phpstan/phpstan": "^1.12 || ^2", + "phpstan/phpstan-strict-rules": "^1 || ^2", + "phpunit/phpunit": "^8 || ^9" + }, + "type": "library", + "extra": { + "phpstan": { + "includes": [ + "extension.neon" + ] + }, + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Pcre\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", + "keywords": [ + "PCRE", + "preg", + "regex", + "regular expression" + ], + "support": { + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/3.3.2" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-11-12T16:29:46+00:00" + }, + { + "name": "composer/semver", + "version": "3.4.3", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.11", + "symfony/phpunit-bridge": "^3 || ^7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.4.3" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-09-19T14:15:21+00:00" + }, + { + "name": "composer/xdebug-handler", + "version": "3.0.5", + "source": { + "type": "git", + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6c1925561632e83d60a44492e0b344cf48ab85ef", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef", + "shasum": "" + }, + "require": { + "composer/pcre": "^1 || ^2 || ^3", + "php": "^7.2.5 || ^8.0", + "psr/log": "^1 || ^2 || ^3" + }, + "require-dev": { + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Composer\\XdebugHandler\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" + } + ], + "description": "Restarts a process without Xdebug.", + "keywords": [ + "Xdebug", + "performance" + ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/3.0.5" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-05-06T16:37:16+00:00" + }, + { + "name": "evenement/evenement", + "version": "v3.0.2", + "source": { + "type": "git", + "url": "https://github.com/igorw/evenement.git", + "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/igorw/evenement/zipball/0a16b0d71ab13284339abb99d9d2bd813640efbc", + "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc", + "shasum": "" + }, + "require": { + "php": ">=7.0" + }, + "require-dev": { + "phpunit/phpunit": "^9 || ^6" + }, + "type": "library", + "autoload": { + "psr-4": { + "Evenement\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + } + ], + "description": "Événement is a very simple event dispatching library for PHP", + "keywords": [ + "event-dispatcher", + "event-emitter" + ], + "support": { + "issues": "https://github.com/igorw/evenement/issues", + "source": "https://github.com/igorw/evenement/tree/v3.0.2" + }, + "time": "2023-08-08T05:53:35+00:00" + }, + { + "name": "fidry/cpu-core-counter", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/theofidry/cpu-core-counter.git", + "reference": "8520451a140d3f46ac33042715115e290cf5785f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/8520451a140d3f46ac33042715115e290cf5785f", + "reference": "8520451a140d3f46ac33042715115e290cf5785f", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "fidry/makefile": "^0.2.0", + "fidry/php-cs-fixer-config": "^1.1.2", + "phpstan/extension-installer": "^1.2.0", + "phpstan/phpstan": "^1.9.2", + "phpstan/phpstan-deprecation-rules": "^1.0.0", + "phpstan/phpstan-phpunit": "^1.2.2", + "phpstan/phpstan-strict-rules": "^1.4.4", + "phpunit/phpunit": "^8.5.31 || ^9.5.26", + "webmozarts/strict-phpunit": "^7.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Fidry\\CpuCoreCounter\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Théo FIDRY", + "email": "theo.fidry@gmail.com" + } + ], + "description": "Tiny utility to get the number of CPU cores.", + "keywords": [ + "CPU", + "core" + ], + "support": { + "issues": "https://github.com/theofidry/cpu-core-counter/issues", + "source": "https://github.com/theofidry/cpu-core-counter/tree/1.2.0" + }, + "funding": [ + { + "url": "https://github.com/theofidry", + "type": "github" + } + ], + "time": "2024-08-06T10:04:20+00:00" + }, + { + "name": "friendsofphp/php-cs-fixer", + "version": "v3.68.1", + "source": { + "type": "git", + "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", + "reference": "b9db2b2ea3cdba7201067acee46f984ef2397cff" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/b9db2b2ea3cdba7201067acee46f984ef2397cff", + "reference": "b9db2b2ea3cdba7201067acee46f984ef2397cff", + "shasum": "" + }, + "require": { + "clue/ndjson-react": "^1.0", + "composer/semver": "^3.4", + "composer/xdebug-handler": "^3.0.3", + "ext-filter": "*", + "ext-json": "*", + "ext-tokenizer": "*", + "fidry/cpu-core-counter": "^1.2", + "php": "^7.4 || ^8.0", + "react/child-process": "^0.6.5", + "react/event-loop": "^1.0", + "react/promise": "^2.0 || ^3.0", + "react/socket": "^1.0", + "react/stream": "^1.0", + "sebastian/diff": "^4.0 || ^5.1 || ^6.0", + "symfony/console": "^5.4 || ^6.4 || ^7.0", + "symfony/event-dispatcher": "^5.4 || ^6.4 || ^7.0", + "symfony/filesystem": "^5.4 || ^6.4 || ^7.0", + "symfony/finder": "^5.4 || ^6.4 || ^7.0", + "symfony/options-resolver": "^5.4 || ^6.4 || ^7.0", + "symfony/polyfill-mbstring": "^1.31", + "symfony/polyfill-php80": "^1.31", + "symfony/polyfill-php81": "^1.31", + "symfony/process": "^5.4 || ^6.4 || ^7.2", + "symfony/stopwatch": "^5.4 || ^6.4 || ^7.0" + }, + "require-dev": { + "facile-it/paraunit": "^1.3.1 || ^2.4", + "infection/infection": "^0.29.8", + "justinrainbow/json-schema": "^5.3 || ^6.0", + "keradus/cli-executor": "^2.1", + "mikey179/vfsstream": "^1.6.12", + "php-coveralls/php-coveralls": "^2.7", + "php-cs-fixer/accessible-object": "^1.1", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.5", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.5", + "phpunit/phpunit": "^9.6.22 || ^10.5.40 || ^11.5.2", + "symfony/var-dumper": "^5.4.48 || ^6.4.15 || ^7.2.0", + "symfony/yaml": "^5.4.45 || ^6.4.13 || ^7.2.0" + }, + "suggest": { + "ext-dom": "For handling output formats in XML", + "ext-mbstring": "For handling non-UTF8 characters." + }, + "bin": [ + "php-cs-fixer" + ], + "type": "application", + "autoload": { + "psr-4": { + "PhpCsFixer\\": "src/" + }, + "exclude-from-classmap": [ + "src/Fixer/Internal/*" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Dariusz Rumiński", + "email": "dariusz.ruminski@gmail.com" + } + ], + "description": "A tool to automatically fix PHP code style", + "keywords": [ + "Static code analysis", + "fixer", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.68.1" + }, + "funding": [ + { + "url": "https://github.com/keradus", + "type": "github" + } + ], + "time": "2025-01-17T09:20:36+00:00" + }, + { + "name": "psr/container", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.2" + }, + "time": "2021-11-05T16:47:00+00:00" + }, + { + "name": "psr/event-dispatcher", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\EventDispatcher\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Standard interfaces for event handling.", + "keywords": [ + "events", + "psr", + "psr-14" + ], + "support": { + "issues": "https://github.com/php-fig/event-dispatcher/issues", + "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" + }, + "time": "2019-01-08T18:20:26+00:00" + }, + { + "name": "psr/log", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/3.0.2" + }, + "time": "2024-09-11T13:17:53+00:00" + }, + { + "name": "react/cache", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/cache.git", + "reference": "d47c472b64aa5608225f47965a484b75c7817d5b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/cache/zipball/d47c472b64aa5608225f47965a484b75c7817d5b", + "reference": "d47c472b64aa5608225f47965a484b75c7817d5b", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "react/promise": "^3.0 || ^2.0 || ^1.1" + }, + "require-dev": { + "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Async, Promise-based cache interface for ReactPHP", + "keywords": [ + "cache", + "caching", + "promise", + "reactphp" + ], + "support": { + "issues": "https://github.com/reactphp/cache/issues", + "source": "https://github.com/reactphp/cache/tree/v1.2.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2022-11-30T15:59:55+00:00" + }, + { + "name": "react/child-process", + "version": "v0.6.6", + "source": { + "type": "git", + "url": "https://github.com/reactphp/child-process.git", + "reference": "1721e2b93d89b745664353b9cfc8f155ba8a6159" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/child-process/zipball/1721e2b93d89b745664353b9cfc8f155ba8a6159", + "reference": "1721e2b93d89b745664353b9cfc8f155ba8a6159", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.0", + "react/event-loop": "^1.2", + "react/stream": "^1.4" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/socket": "^1.16", + "sebastian/environment": "^5.0 || ^3.0 || ^2.0 || ^1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\ChildProcess\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Event-driven library for executing child processes with ReactPHP.", + "keywords": [ + "event-driven", + "process", + "reactphp" + ], + "support": { + "issues": "https://github.com/reactphp/child-process/issues", + "source": "https://github.com/reactphp/child-process/tree/v0.6.6" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2025-01-01T16:37:48+00:00" + }, + { + "name": "react/dns", + "version": "v1.13.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/dns.git", + "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/dns/zipball/eb8ae001b5a455665c89c1df97f6fb682f8fb0f5", + "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "react/cache": "^1.0 || ^0.6 || ^0.5", + "react/event-loop": "^1.2", + "react/promise": "^3.2 || ^2.7 || ^1.2.1" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/async": "^4.3 || ^3 || ^2", + "react/promise-timer": "^1.11" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Dns\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Async DNS resolver for ReactPHP", + "keywords": [ + "async", + "dns", + "dns-resolver", + "reactphp" + ], + "support": { + "issues": "https://github.com/reactphp/dns/issues", + "source": "https://github.com/reactphp/dns/tree/v1.13.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2024-06-13T14:18:03+00:00" + }, + { + "name": "react/event-loop", + "version": "v1.5.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/event-loop.git", + "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/event-loop/zipball/bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354", + "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" + }, + "suggest": { + "ext-pcntl": "For signal handling support when using the StreamSelectLoop" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\EventLoop\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "ReactPHP's core reactor event loop that libraries can use for evented I/O.", + "keywords": [ + "asynchronous", + "event-loop" + ], + "support": { + "issues": "https://github.com/reactphp/event-loop/issues", + "source": "https://github.com/reactphp/event-loop/tree/v1.5.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2023-11-13T13:48:05+00:00" + }, + { + "name": "react/promise", + "version": "v3.2.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/promise.git", + "reference": "8a164643313c71354582dc850b42b33fa12a4b63" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/promise/zipball/8a164643313c71354582dc850b42b33fa12a4b63", + "reference": "8a164643313c71354582dc850b42b33fa12a4b63", + "shasum": "" + }, + "require": { + "php": ">=7.1.0" + }, + "require-dev": { + "phpstan/phpstan": "1.10.39 || 1.4.10", + "phpunit/phpunit": "^9.6 || ^7.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "React\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "A lightweight implementation of CommonJS Promises/A for PHP", + "keywords": [ + "promise", + "promises" + ], + "support": { + "issues": "https://github.com/reactphp/promise/issues", + "source": "https://github.com/reactphp/promise/tree/v3.2.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2024-05-24T10:39:05+00:00" + }, + { + "name": "react/socket", + "version": "v1.16.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/socket.git", + "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/socket/zipball/23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", + "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.0", + "react/dns": "^1.13", + "react/event-loop": "^1.2", + "react/promise": "^3.2 || ^2.6 || ^1.2.1", + "react/stream": "^1.4" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/async": "^4.3 || ^3.3 || ^2", + "react/promise-stream": "^1.4", + "react/promise-timer": "^1.11" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Socket\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP", + "keywords": [ + "Connection", + "Socket", + "async", + "reactphp", + "stream" + ], + "support": { + "issues": "https://github.com/reactphp/socket/issues", + "source": "https://github.com/reactphp/socket/tree/v1.16.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2024-07-26T10:38:09+00:00" + }, + { + "name": "react/stream", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/stream.git", + "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/stream/zipball/1e5b0acb8fe55143b5b426817155190eb6f5b18d", + "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.8", + "react/event-loop": "^1.2" + }, + "require-dev": { + "clue/stream-filter": "~1.2", + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Stream\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Event-driven readable and writable streams for non-blocking I/O in ReactPHP", + "keywords": [ + "event-driven", + "io", + "non-blocking", + "pipe", + "reactphp", + "readable", + "stream", + "writable" + ], + "support": { + "issues": "https://github.com/reactphp/stream/issues", + "source": "https://github.com/reactphp/stream/tree/v1.4.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2024-06-11T12:45:25+00:00" + }, + { + "name": "sebastian/diff", + "version": "6.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/b4ccd857127db5d41a5b676f24b51371d76d8544", + "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/6.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T04:53:05+00:00" + }, + { + "name": "symfony/console", + "version": "v7.2.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/fefcc18c0f5d0efe3ab3152f15857298868dc2c3", + "reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/polyfill-mbstring": "~1.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/string": "^6.4|^7.0" + }, + "conflict": { + "symfony/dependency-injection": "<6.4", + "symfony/dotenv": "<6.4", + "symfony/event-dispatcher": "<6.4", + "symfony/lock": "<6.4", + "symfony/process": "<6.4" + }, + "provide": { + "psr/log-implementation": "1.0|2.0|3.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/event-dispatcher": "^6.4|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/lock": "^6.4|^7.0", + "symfony/messenger": "^6.4|^7.0", + "symfony/process": "^6.4|^7.0", + "symfony/stopwatch": "^6.4|^7.0", + "symfony/var-dumper": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command-line", + "console", + "terminal" + ], + "support": { + "source": "https://github.com/symfony/console/tree/v7.2.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-12-11T03:49:26+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.5.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.5-dev" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-25T14:20:29+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v7.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "910c5db85a5356d0fea57680defec4e99eb9c8c1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/910c5db85a5356d0fea57680defec4e99eb9c8c1", + "reference": "910c5db85a5356d0fea57680defec4e99eb9c8c1", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/event-dispatcher-contracts": "^2.5|^3" + }, + "conflict": { + "symfony/dependency-injection": "<6.4", + "symfony/service-contracts": "<2.5" + }, + "provide": { + "psr/event-dispatcher-implementation": "1.0", + "symfony/event-dispatcher-implementation": "2.0|3.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/error-handler": "^6.4|^7.0", + "symfony/expression-language": "^6.4|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/stopwatch": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/event-dispatcher/tree/v7.2.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-25T14:21:43+00:00" + }, + { + "name": "symfony/event-dispatcher-contracts", + "version": "v3.5.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher-contracts.git", + "reference": "7642f5e970b672283b7823222ae8ef8bbc160b9f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/7642f5e970b672283b7823222ae8ef8bbc160b9f", + "reference": "7642f5e970b672283b7823222ae8ef8bbc160b9f", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/event-dispatcher": "^1" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.5-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\EventDispatcher\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to dispatching event", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.5.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-25T14:20:29+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v7.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/b8dce482de9d7c9fe2891155035a7248ab5c7fdb", + "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8" + }, + "require-dev": { + "symfony/process": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides basic utilities for the filesystem", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/filesystem/tree/v7.2.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-10-25T15:15:23+00:00" + }, + { + "name": "symfony/finder", + "version": "v7.2.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "87a71856f2f56e4100373e92529eed3171695cfb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/87a71856f2f56e4100373e92529eed3171695cfb", + "reference": "87a71856f2f56e4100373e92529eed3171695cfb", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "symfony/filesystem": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Finds files and directories via an intuitive fluent interface", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/v7.2.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-12-30T19:00:17+00:00" + }, + { + "name": "symfony/options-resolver", + "version": "v7.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/options-resolver.git", + "reference": "7da8fbac9dcfef75ffc212235d76b2754ce0cf50" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/7da8fbac9dcfef75ffc212235d76b2754ce0cf50", + "reference": "7da8fbac9dcfef75ffc212235d76b2754ce0cf50", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\OptionsResolver\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an improved replacement for the array_replace PHP function", + "homepage": "https://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ], + "support": { + "source": "https://github.com/symfony/options-resolver/tree/v7.2.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-11-20T11:17:29+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.31.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638", + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.31.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", + "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.31.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.31.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "3833d7255cc303546435cb650316bff708a1c75c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c", + "reference": "3833d7255cc303546435cb650316bff708a1c75c", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.31.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.31.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341", + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.31.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, + { + "name": "symfony/polyfill-php81", + "version": "v1.31.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", + "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php81/tree/v1.31.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, + { + "name": "symfony/process", + "version": "v7.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "d34b22ba9390ec19d2dd966c40aa9e8462f27a7e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/d34b22ba9390ec19d2dd966c40aa9e8462f27a7e", + "reference": "d34b22ba9390ec19d2dd966c40aa9e8462f27a7e", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Executes commands in sub-processes", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/process/tree/v7.2.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-11-06T14:24:19+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v3.5.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/e53260aabf78fb3d63f8d79d69ece59f80d5eda0", + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/container": "^1.1|^2.0", + "symfony/deprecation-contracts": "^2.5|^3" + }, + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.5-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + }, + "exclude-from-classmap": [ + "/Test/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v3.5.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-25T14:20:29+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v7.2.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "e46690d5b9d7164a6d061cab1e8d46141b9f49df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/e46690d5b9d7164a6d061cab1e8d46141b9f49df", + "reference": "e46690d5b9d7164a6d061cab1e8d46141b9f49df", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/service-contracts": "^2.5|^3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides a way to profile code", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/stopwatch/tree/v7.2.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-12-18T14:28:33+00:00" + }, + { + "name": "symfony/string", + "version": "v7.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/446e0d146f991dde3e73f45f2c97a9faad773c82", + "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/translation-contracts": "<2.5" + }, + "require-dev": { + "symfony/emoji": "^7.1", + "symfony/error-handler": "^6.4|^7.0", + "symfony/http-client": "^6.4|^7.0", + "symfony/intl": "^6.4|^7.0", + "symfony/translation-contracts": "^2.5|^3.0", + "symfony/var-exporter": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "source": "https://github.com/symfony/string/tree/v7.2.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-11-13T13:31:26+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [], + "plugin-api-version": "2.6.0" +} From 2c54c82b38ae173ac17c46f7454f3d78b3bed03e Mon Sep 17 00:00:00 2001 From: neo Date: Mon, 27 Jan 2025 16:00:46 +0100 Subject: [PATCH 2/3] UPDATE: Apply PHP CS Fixer --- mapBuilder/classes/listBaseLayer.class.php | 72 ++-- mapBuilder/classes/listRepositories.class.php | 52 ++- .../classes/mapBuilderView.listener.php | 63 ++-- mapBuilder/controllers/default.classic.php | 137 ++++---- mapBuilder/controllers/mapcontext.classic.php | 118 ++++--- mapBuilder/install/conf/mapBuilder.ini.php | 2 +- mapBuilder/install/configure.php | 18 +- mapBuilder/install/install.php | 26 +- mapBuilder/install/install_1_6.php | 30 +- mapBuilder/install/upgrade.php | 24 +- mapBuilder/install/upgrade_acl.php | 33 +- mapBuilder/install/upgrade_createtable.php | 27 +- .../install/upgrade_toggleattributetable.php | 25 +- mapBuilder/zones/list_mapcontext.zone.php | 98 +++--- .../mapBuilderAdminConfig.listener.php | 31 +- .../controllers/config.classic.php | 325 +++++++++--------- .../controllers/default.classic.php | 30 +- mapBuilderAdmin/install/configure.php | 25 +- mapBuilderAdmin/install/install.php | 27 +- mapBuilderAdmin/install/install_1_6.php | 22 +- 20 files changed, 612 insertions(+), 573 deletions(-) diff --git a/mapBuilder/classes/listBaseLayer.class.php b/mapBuilder/classes/listBaseLayer.class.php index 702a5101..5d7278f5 100644 --- a/mapBuilder/classes/listBaseLayer.class.php +++ b/mapBuilder/classes/listBaseLayer.class.php @@ -1,41 +1,39 @@ -formId = $id; - - $this->data = array( - 'osmMapnik' => 'OSM Mapnik', - 'osmStadiaMapsToner' => 'OSM StadiaMaps Toner', - 'bingStreets' => 'Bing Streets', - 'bingSatellite' => 'Bing Satellite', - 'bingHybrid' => 'Bing Hybrid', - 'ignStreets' => 'IGN Streets', - 'ignSatellite' => 'IGN Satellite', - 'ignCadastral' => 'IGN Cadastral', - 'emptyBaselayer' => jLocale::get('view~dictionnary.baselayer.empty.title') - ); - } - - public function getData($form) - { - return ($this->data); - } - - public function getLabel($key) - { - if(isset($this->data[$key])) - return $this->data[$key]; - else - return null; - } - + protected $formId = 0; + + protected $data = array(); + + public function __construct($id) + { + $this->formId = $id; + + $this->data = array( + 'osmMapnik' => 'OSM Mapnik', + 'osmStadiaMapsToner' => 'OSM StadiaMaps Toner', + 'bingStreets' => 'Bing Streets', + 'bingSatellite' => 'Bing Satellite', + 'bingHybrid' => 'Bing Hybrid', + 'ignStreets' => 'IGN Streets', + 'ignSatellite' => 'IGN Satellite', + 'ignCadastral' => 'IGN Cadastral', + 'emptyBaselayer' => jLocale::get('view~dictionnary.baselayer.empty.title'), + ); + } + + public function getData($form) + { + return $this->data; + } + + public function getLabel($key) + { + if (isset($this->data[$key])) { + return $this->data[$key]; + } + + return null; + } } -?> \ No newline at end of file diff --git a/mapBuilder/classes/listRepositories.class.php b/mapBuilder/classes/listRepositories.class.php index b5b466b5..9b0e71fc 100644 --- a/mapBuilder/classes/listRepositories.class.php +++ b/mapBuilder/classes/listRepositories.class.php @@ -1,40 +1,38 @@ -formId = $id; + public function __construct($id) + { + $this->formId = $id; - $repositories = array(); + $repositories = array(); - foreach (lizmap::getRepositoryList() as $repositoryName) { - $repository = lizmap::getRepository($repositoryName); - if( jAcl2::check('lizmap.repositories.view', $repository->getKey() )){ - $repositories[$repository->getKey()] = $repository->getData('label'); + foreach (lizmap::getRepositoryList() as $repositoryName) { + $repository = lizmap::getRepository($repositoryName); + if (jAcl2::check('lizmap.repositories.view', $repository->getKey())) { + $repositories[$repository->getKey()] = $repository->getData('label'); + } } - } - $this->data = $repositories; - } + $this->data = $repositories; + } - public function getData($form) - { - return ($this->data); - } + public function getData($form) + { + return $this->data; + } - public function getLabel($key) - { - if(isset($this->data[$key])) - return $this->data[$key]; - else - return null; - } + public function getLabel($key) + { + if (isset($this->data[$key])) { + return $this->data[$key]; + } + return null; + } } -?> \ No newline at end of file diff --git a/mapBuilder/classes/mapBuilderView.listener.php b/mapBuilder/classes/mapBuilderView.listener.php index fed7d1d8..3e635062 100644 --- a/mapBuilder/classes/mapBuilderView.listener.php +++ b/mapBuilder/classes/mapBuilderView.listener.php @@ -1,10 +1,15 @@ 2.0, lizmap 3.7+ - $proj4 = new \proj4php\Proj4php(); - $sourceProj = new \proj4php\Proj('EPSG:4326', $proj4); - $destProj = new \proj4php\Proj('EPSG:3857', $proj4); + $proj4 = new proj4php\Proj4php(); + $sourceProj = new Proj('EPSG:4326', $proj4); + $destProj = new Proj('EPSG:3857', $proj4); } - $extentArraySource = explode(",", $readConfigPath['extent']); + $extentArraySource = explode(',', $readConfigPath['extent']); // Is extent valid ? - if(count($extentArraySource) == 4 && $extentArraySource === array_filter($extentArraySource, 'is_numeric')){ + if (count($extentArraySource) == 4 && $extentArraySource === array_filter($extentArraySource, 'is_numeric')) { // Cast as float $extentArraySource = array_map('floatval', $extentArraySource); // Handle WGS84 bounds - if (class_exists('proj4phpPoint') ) { // lizmap 3.6 - $sourceMinPt = new \proj4phpPoint(max($extentArraySource[0], -180.0), max($extentArraySource[1], -85.06)); - $sourceMaxPt = new \proj4phpPoint(min($extentArraySource[2], 180.0), min($extentArraySource[3], 85.06)); + if (class_exists('proj4phpPoint')) { // lizmap 3.6 + $sourceMinPt = new proj4phpPoint(max($extentArraySource[0], -180.0), max($extentArraySource[1], -85.06)); + $sourceMaxPt = new proj4phpPoint(min($extentArraySource[2], 180.0), min($extentArraySource[3], 85.06)); } else { // proj4php >2.0, lizmap 3.7+ - $sourceMinPt = new \proj4php\Point(max($extentArraySource[0], -180.0), max($extentArraySource[1], -85.06)); - $sourceMaxPt = new \proj4php\Point(min($extentArraySource[2], 180.0), min($extentArraySource[3], 85.06)); + $sourceMinPt = new Point(max($extentArraySource[0], -180.0), max($extentArraySource[1], -85.06)); + $sourceMaxPt = new Point(min($extentArraySource[2], 180.0), min($extentArraySource[3], 85.06)); } + try { - $destMinPt = $proj4->transform($sourceProj,$destProj,$sourceMinPt); - $destMaxPt = $proj4->transform($sourceProj,$destProj,$sourceMaxPt); + $destMinPt = $proj4->transform($sourceProj, $destProj, $sourceMinPt); + $destMaxPt = $proj4->transform($sourceProj, $destProj, $sourceMaxPt); - $extent = implode(", ", array( $destMinPt->x, $destMinPt->y, $destMaxPt->x, $destMaxPt->y )); + $extent = implode(', ', array($destMinPt->x, $destMinPt->y, $destMaxPt->x, $destMaxPt->y)); } catch (Exception $e) { // Max extent in EPSG:3857 - $extent = "-20026376.39,-20048966.10,20026376.39,20048966.10"; + $extent = '-20026376.39,-20048966.10,20026376.39,20048966.10'; } - }else{ - jMessage::add(jLocale::get("mapBuilder~default.extent.value.error"), 'error'); - $extent = jLocale::get("mapBuilder~default.extent.value.error"); + } else { + jMessage::add(jLocale::get('mapBuilder~default.extent.value.error'), 'error'); + $extent = jLocale::get('mapBuilder~default.extent.value.error'); } } - + $illustration = jApp::urlBasePath().'themes/'.jApp::config()->theme.'/css/img/250x250_mappemonde.jpg'; jClasses::inc('lizmapMainViewItem'); @@ -80,7 +87,7 @@ function onmainviewGetMaps ($event) { '_map_builder_rep', 'map' ); - $event->add( $mrep ); + $event->add($mrep); } } } diff --git a/mapBuilder/controllers/default.classic.php b/mapBuilder/controllers/default.classic.php index b72e75c7..05027360 100644 --- a/mapBuilder/controllers/default.classic.php +++ b/mapBuilder/controllers/default.classic.php @@ -1,39 +1,40 @@ getResponse('redirect'); - $rep->action = 'view~default:index'; - jMessage::add(jLocale::get('view~default.repository.access.denied'), 'error'); - return $rep; + if (!jAcl2::check('mapBuilder.access')) { + $rep = $this->getResponse('redirect'); + $rep->action = 'view~default:index'; + jMessage::add(jLocale::get('view~default.repository.access.denied'), 'error'); + + return $rep; } - $rep = $this->getResponse('html', true);// true désactive le template général + $rep = $this->getResponse('html', true); // true désactive le template général $configFile = jApp::varconfigPath('mapBuilder.ini.php'); if (!file_exists($configFile)) { $rep = $this->getResponse('basichtml', true); $rep->addContent('

MapBuilder is not configured correctly. Its configuration file is missing.

'); + return $rep; } // Get lizmap services $services = lizmap::getServices(); - $title = jLocale::get('mapBuilder~default.app.name');; + $title = jLocale::get('mapBuilder~default.app.name'); $rep->title = $title; $rep->favicon = jApp::urlBasePath().'assets/favicon/favicon.ico'; @@ -55,22 +56,22 @@ function index() { // Pass some configuration options to the web page through javascript var $lizUrls = array( - "basepath" => jApp::urlBasePath(), - "config" => jUrl::get('lizmap~service:getProjectConfig'), - "wms" => jUrl::get('lizmap~service:index'), - "media" => jUrl::get('view~media:getMedia'), - "mapcontext_add" => jUrl::get('mapBuilder~mapcontext:add'), - "mapcontext_delete" => jUrl::get('mapBuilder~mapcontext:delete'), - "mapcontext_get" => jUrl::get('mapBuilder~mapcontext:get') + 'basepath' => jApp::urlBasePath(), + 'config' => jUrl::get('lizmap~service:getProjectConfig'), + 'wms' => jUrl::get('lizmap~service:index'), + 'media' => jUrl::get('view~media:getMedia'), + 'mapcontext_add' => jUrl::get('mapBuilder~mapcontext:add'), + 'mapcontext_delete' => jUrl::get('mapBuilder~mapcontext:delete'), + 'mapcontext_get' => jUrl::get('mapBuilder~mapcontext:get'), ); // Load lizUrls before mapbuilder. Webpack public path needs it - $rep->addJSCode("var lizUrls = ".json_encode($lizUrls).";", true); + $rep->addJSCode('var lizUrls = '.json_encode($lizUrls).';', true); $rep->addJSLink(jApp::urlBasePath().'mapBuilder/js/mapbuilder.js'); // Read mapBuilder configuration - $readConfigPath = parse_ini_file($configFile, True); + $readConfigPath = parse_ini_file($configFile, true); // Build repository + project tree for FancyTree $nestedTree = array(); @@ -78,33 +79,33 @@ function index() { $repositoryList = array(); // Get selected repository from ini file if set - if(array_key_exists('repository', $readConfigPath) && !is_null(lizmap::getRepository($readConfigPath['repository']))){ + if (array_key_exists('repository', $readConfigPath) && !is_null(lizmap::getRepository($readConfigPath['repository']))) { $repositoryList[] = $readConfigPath['repository']; - }else{ + } else { $repositoryList = lizmap::getRepositoryList(); } foreach ($repositoryList as $repositoryName) { $repository = lizmap::getRepository($repositoryName); - if( jAcl2::check('lizmap.repositories.view', $repository->getKey() )){ + if (jAcl2::check('lizmap.repositories.view', $repository->getKey())) { $projects = $repository->getProjects(); $projectArray = array(); foreach ($projects as $project) { - $projectArray[] = [ - "title" => $project->getData('title'), // deprecated, use getTitle() for lizmap >=3.5 - "folder" => true, - "lazy" => true, - "repository" => $repositoryName, - "project" => $project->getKey() - ]; + $projectArray[] = array( + 'title' => $project->getData('title'), // deprecated, use getTitle() for lizmap >=3.5 + 'folder' => true, + 'lazy' => true, + 'repository' => $repositoryName, + 'project' => $project->getKey(), + ); } - $nestedTree[] = [ - "title" => $repository->getData('label'), // deprecated, use getLabel() for lizmap >=3.5 - "folder" => true, - "children" => $projectArray - ]; + $nestedTree[] = array( + 'title' => $repository->getData('label'), // deprecated, use getLabel() for lizmap >=3.5 + 'folder' => true, + 'children' => $projectArray, + ); } } @@ -112,11 +113,11 @@ function index() { $rep->addJSCode('var mapBuilder = {"layerStoreTree": '.json_encode($nestedTree).'};'); // Get original extent from ini file if set - if(array_key_exists('extent', $readConfigPath)){ - $rep->addJSCode("mapBuilder.extent = [".$readConfigPath['extent']."];"); + if (array_key_exists('extent', $readConfigPath)) { + $rep->addJSCode('mapBuilder.extent = ['.$readConfigPath['extent'].'];'); } // Get base layer from ini file if set - if(array_key_exists('baseLayer', $readConfigPath)){ + if (array_key_exists('baseLayer', $readConfigPath)) { $rep->addJSCode("mapBuilder.baseLayer = '".$readConfigPath['baseLayer']."';"); jClasses::inc('mapBuilder~listBaseLayer'); @@ -125,7 +126,7 @@ function index() { $userListBaseLayer = explode(',', $readConfigPath['baseLayer']); foreach ($listBaseLayer as $key => $value) { - if(!in_array($key, $userListBaseLayer)){ + if (!in_array($key, $userListBaseLayer)) { unset($listBaseLayer[$key]); } } @@ -133,43 +134,45 @@ function index() { $rep->body->assign('baseLayer', $listBaseLayer); } // Get default base layer from ini file if set - if(array_key_exists('baseLayerDefault', $readConfigPath)){ + if (array_key_exists('baseLayerDefault', $readConfigPath)) { $rep->body->assign('baseLayerDefault', $readConfigPath['baseLayerDefault']); } // Get base layer key from ini file if set - if(array_key_exists('baseLayerKeyOSMCycleMap', $readConfigPath)){ + if (array_key_exists('baseLayerKeyOSMCycleMap', $readConfigPath)) { $rep->addJSCode("mapBuilder.baseLayerKeyOSMCycleMap = '".$readConfigPath['baseLayerKeyOSMCycleMap']."';"); } // Get base layer key from ini file if set - if(array_key_exists('baseLayerKeyBing', $readConfigPath)){ + if (array_key_exists('baseLayerKeyBing', $readConfigPath)) { $rep->addJSCode("mapBuilder.baseLayerKeyBing = '".$readConfigPath['baseLayerKeyBing']."';"); } // Get base layer key from ini file if set - if(array_key_exists('baseLayerKeyIGN', $readConfigPath)){ + if (array_key_exists('baseLayerKeyIGN', $readConfigPath)) { $rep->addJSCode("mapBuilder.baseLayerKeyIGN = '".$readConfigPath['baseLayerKeyIGN']."';"); } // Get attributeTableTool key from ini file if set - if(array_key_exists('attributeTableTool', $readConfigPath)){ + if (array_key_exists('attributeTableTool', $readConfigPath)) { $rep->body->assign('attributeTableTool', $readConfigPath['attributeTableTool']); } // Get locales $lang = $this->param('lang'); - if(!$lang) - $lang = jLocale::getCurrentLang().'_'.jLocale::getCurrentCountry(); + if (!$lang) { + $lang = jLocale::getCurrentLang().'_'.jLocale::getCurrentCountry(); + } $data = array(); $path = jApp::getModulePath('mapBuilder').'locales/en_US/dictionary.UTF-8.properties'; - if(file_exists($path)){ - $lines = file($path); - foreach ($lines as $lineNumber => $lineContent){ - if(!empty($lineContent) and $lineContent != '\n'){ - $exp = explode('=', trim($lineContent)); - if(!empty($exp[0])) - $data[$exp[0]] = jLocale::get('mapBuilder~dictionary.'.$exp[0], null, $lang); + if (file_exists($path)) { + $lines = file($path); + foreach ($lines as $lineNumber => $lineContent) { + if (!empty($lineContent) and $lineContent != '\n') { + $exp = explode('=', trim($lineContent)); + if (!empty($exp[0])) { + $data[$exp[0]] = jLocale::get('mapBuilder~dictionary.'.$exp[0], null, $lang); + } + } } - } } $rep->addJSCode('var lizDict = '.json_encode($data).';'); @@ -179,7 +182,7 @@ function index() { $rep->body->assign('allowUserAccountRequests', $services->allowUserAccountRequests); // Add Google Analytics ID - if($services->googleAnalyticsID != '' && preg_match("/^UA-\d+-\d+$/", $services->googleAnalyticsID) == 1 ) { + if ($services->googleAnalyticsID != '' && preg_match('/^UA-\\d+-\\d+$/', $services->googleAnalyticsID) == 1) { $rep->body->assign('googleAnalyticsID', $services->googleAnalyticsID); } @@ -189,9 +192,9 @@ function index() { $rep->body->assignZone('LIST_MAPCONTEXT', 'list_mapcontext'); // Override default theme with color set in admin panel - if($cssContent = jFile::read(jApp::varPath('lizmap-theme-config/') . 'theme.css') ){ - $css = ''; - $rep->addHeadContent($css); + if ($cssContent = jFile::read(jApp::varPath('lizmap-theme-config/').'theme.css')) { + $css = ''; + $rep->addHeadContent($css); } return $rep; diff --git a/mapBuilder/controllers/mapcontext.classic.php b/mapBuilder/controllers/mapcontext.classic.php index afabe9f1..ed9130c1 100644 --- a/mapBuilder/controllers/mapcontext.classic.php +++ b/mapBuilder/controllers/mapcontext.classic.php @@ -1,32 +1,31 @@ getResponse('htmlfragment'); // Make sure that it is a POST request. - if(strcasecmp($_SERVER['REQUEST_METHOD'], 'POST') != 0){ + if (strcasecmp($_SERVER['REQUEST_METHOD'], 'POST') != 0) { throw new Exception('Request method must be POST!'); } // Check name - $name = filter_var( $this->param('name'), FILTER_SANITIZE_STRING ); - if( empty($name) ){ + $name = filter_var($this->param('name'), FILTER_SANITIZE_STRING); + if (empty($name)) { jMessage::add('Please give a name', 'error'); - }else{ + } else { $dao = jDao::get('mapBuilder~mapcontext'); $record = jDao::createRecord('mapBuilder~mapcontext'); @@ -36,36 +35,36 @@ function add() { // Access control $record->is_public = false; - if(jAcl2::check('mapBuilder.mapcontext.public.manage')){ + if (jAcl2::check('mapBuilder.mapcontext.public.manage')) { $record->is_public = $this->param('is_public'); } $record->mapcontext = $this->param('mapcontext'); // Save the new mapcontext - $id = Null; - try{ + $id = null; + + try { $id = $dao->insert($record); - }catch(Exception $e){ - jLog::log( 'Error while inserting the mapcontext'); - jLog::log( $e->getMessage()); - jMessage::add( 'Error while inserting the mapcontext', 'error' ); + } catch (Exception $e) { + jLog::log('Error while inserting the mapcontext'); + jLog::log($e->getMessage()); + jMessage::add('Error while inserting the mapcontext', 'error'); } } $rep->addContent(jZone::get('list_mapcontext')); + return $rep; } - /* - * Delete mapcontext by id - * - */ - function delete(){ + // Delete mapcontext by id + public function delete() + { $rep = $this->getResponse('htmlfragment'); // Make sure that it is a POST request. - if(strcasecmp($_SERVER['REQUEST_METHOD'], 'POST') != 0){ + if (strcasecmp($_SERVER['REQUEST_METHOD'], 'POST') != 0) { throw new Exception('Request method must be POST!'); } @@ -79,19 +78,19 @@ function delete(){ // Conditions to get the mapcontext $daomc = jDao::get('mapBuilder~mapcontext'); $conditions = jDao::createConditions(); - $conditions->addCondition('login','=',$usr_login); - $conditions->addCondition('id','=',$id); + $conditions->addCondition('login', '=', $usr_login); + $conditions->addCondition('id', '=', $id); $mcCount = $daomc->countBy($conditions); - if( $mcCount != 1 ){ + if ($mcCount != 1) { jMessage::add('You can\'t delete this map context or it doesn\'t exist', 'error'); - }else{ - try{ + } else { + try { $daomc->delete($id); - }catch(Exception $e){ - jLog::log( 'Error while deleting the mapcontext'); - jLog::log( $e->getMessage()); - jMessage::add( 'Error while deleting the mapcontext', 'error' ); + } catch (Exception $e) { + jLog::log('Error while deleting the mapcontext'); + jLog::log($e->getMessage()); + jMessage::add('Error while deleting the mapcontext', 'error'); } } @@ -100,11 +99,9 @@ function delete(){ return $rep; } - /* - * Get mapcontext by id - * - */ - function get(){ + // Get mapcontext by id + public function get() + { // Get user $juser = jAuth::getUserSession(); @@ -116,27 +113,28 @@ function get(){ // Conditions to get the bookmark $daomc = jDao::get('mapBuilder~mapcontext'); $conditions = jDao::createConditions(); - $conditions->addCondition('id','=',$id); + $conditions->addCondition('id', '=', $id); // Get map context if saved by logged user or public ones $conditions->startGroup('OR'); - $conditions->addCondition('login','=',$usr_login); - $conditions->addCondition('is_public','=',true); + $conditions->addCondition('login', '=', $usr_login); + $conditions->addCondition('is_public', '=', true); $conditions->endGroup(); $mcCount = $daomc->countBy($conditions); - if( $mcCount != 1 ){ - jMessage::add('You don\'t have access to this map context or it doesn\'t exist' , 'error'); + if ($mcCount != 1) { + jMessage::add('You don\'t have access to this map context or it doesn\'t exist', 'error'); + return $this->error(); - }else{ - $mcList = $daomc->findBy($conditions); - $mcParams = array(); - foreach( $mcList as $mc ){ - $mcParams = json_decode(htmlspecialchars_decode($mc->mapcontext,ENT_QUOTES )); - } - $rep = $this->getResponse('json'); - $rep->data = $mcParams; - return $rep; } - } + $mcList = $daomc->findBy($conditions); + $mcParams = array(); + foreach ($mcList as $mc) { + $mcParams = json_decode(htmlspecialchars_decode($mc->mapcontext, ENT_QUOTES)); + } + $rep = $this->getResponse('json'); + $rep->data = $mcParams; + return $rep; + + } } diff --git a/mapBuilder/install/conf/mapBuilder.ini.php b/mapBuilder/install/conf/mapBuilder.ini.php index e360142b..09ad3b22 100644 --- a/mapBuilder/install/conf/mapBuilder.ini.php +++ b/mapBuilder/install/conf/mapBuilder.ini.php @@ -1,4 +1,4 @@ -; +; ;for security reasons , don't remove or modify the first line ;; if you want the map builder to display only one repository, put its id here. Leave blank to get all repositories. diff --git a/mapBuilder/install/configure.php b/mapBuilder/install/configure.php index b2a37f29..7cee2e00 100644 --- a/mapBuilder/install/configure.php +++ b/mapBuilder/install/configure.php @@ -1,28 +1,30 @@ copyDirectoryContent('../www/css', \jApp::wwwPath('mapBuilder/css')); - $helpers->copyDirectoryContent('../www/js/dist', \jApp::wwwPath('mapBuilder/js')); + $helpers->copyDirectoryContent('../www/css', jApp::wwwPath('mapBuilder/css')); + $helpers->copyDirectoryContent('../www/js/dist', jApp::wwwPath('mapBuilder/js')); } } diff --git a/mapBuilder/install/install.php b/mapBuilder/install/install.php index b5547ff3..e447deb9 100644 --- a/mapBuilder/install/install.php +++ b/mapBuilder/install/install.php @@ -1,22 +1,26 @@ copyDirectoryContent('conf', \jApp::varconfigPath()); + $helpers->copyDirectoryContent('conf', jApp::varconfigPath()); // Add mapcontext table $helpers->database()->useDbProfile('jauth'); diff --git a/mapBuilder/install/install_1_6.php b/mapBuilder/install/install_1_6.php index 8ece2eea..db1537bb 100644 --- a/mapBuilder/install/install_1_6.php +++ b/mapBuilder/install/install_1_6.php @@ -1,19 +1,21 @@ copyDirectoryContent('../www/css', jApp::wwwPath('mapBuilder/css')); $this->copyDirectoryContent('../www/js/dist', jApp::wwwPath('mapBuilder/js')); @@ -29,15 +31,15 @@ function install() { } // Set ACL - if ($this->firstExec('acl2') ) { + if ($this->firstExec('acl2')) { $this->useDbProfile('auth'); // Add rights group - jAcl2DbManager::addSubjectGroup ('mapBuilder.subject.group', 'mapBuilder~default.acl.subject.group.name'); + jAcl2DbManager::addSubjectGroup('mapBuilder.subject.group', 'mapBuilder~default.acl.subject.group.name'); // Add right subject - jAcl2DbManager::addSubject( 'mapBuilder.access', 'mapBuilder~default.acl.subject.access.name', 'mapBuilder.subject.group'); - jAcl2DbManager::addSubject( 'mapBuilder.mapcontext.public.manage', 'mapBuilder~default.acl.subject.mapcontext.public.manage', 'mapBuilder.subject.group'); + jAcl2DbManager::addSubject('mapBuilder.access', 'mapBuilder~default.acl.subject.access.name', 'mapBuilder.subject.group'); + jAcl2DbManager::addSubject('mapBuilder.mapcontext.public.manage', 'mapBuilder~default.acl.subject.mapcontext.public.manage', 'mapBuilder.subject.group'); // Add rights on group admins jAcl2DbManager::addRight('admins', 'mapBuilder.access'); diff --git a/mapBuilder/install/upgrade.php b/mapBuilder/install/upgrade.php index 64a0acc7..70f72545 100644 --- a/mapBuilder/install/upgrade.php +++ b/mapBuilder/install/upgrade.php @@ -1,16 +1,20 @@ copyDirectoryContent('../www/css', jApp::wwwPath('mapBuilder/css'), true); $helpers->copyDirectoryContent('../www/js/dist', jApp::wwwPath('mapBuilder/js'), true); diff --git a/mapBuilder/install/upgrade_acl.php b/mapBuilder/install/upgrade_acl.php index 4c8b497a..e9ae189c 100644 --- a/mapBuilder/install/upgrade_acl.php +++ b/mapBuilder/install/upgrade_acl.php @@ -1,30 +1,31 @@ firstExec('acl2') ) { + public function install() + { + if ($this->firstExec('acl2')) { $this->useDbProfile('auth'); // Add rights group - jAcl2DbManager::addSubjectGroup ('mapBuilder.subject.group', 'mapBuilder~default.acl.subject.group.name'); + jAcl2DbManager::addSubjectGroup('mapBuilder.subject.group', 'mapBuilder~default.acl.subject.group.name'); // Add right subject - jAcl2DbManager::addSubject( 'mapBuilder.access', 'mapBuilder~default.acl.subject.access.name', 'mapBuilder.subject.group'); - jAcl2DbManager::addSubject( 'mapBuilder.mapcontext.public.manage', 'mapBuilder~default.acl.subject.mapcontext.public.manage', 'mapBuilder.subject.group'); + jAcl2DbManager::addSubject('mapBuilder.access', 'mapBuilder~default.acl.subject.access.name', 'mapBuilder.subject.group'); + jAcl2DbManager::addSubject('mapBuilder.mapcontext.public.manage', 'mapBuilder~default.acl.subject.mapcontext.public.manage', 'mapBuilder.subject.group'); // Add rights on group admins jAcl2DbManager::addRight('admins', 'mapBuilder.access'); diff --git a/mapBuilder/install/upgrade_createtable.php b/mapBuilder/install/upgrade_createtable.php index b84ce0ce..f0ba82c9 100644 --- a/mapBuilder/install/upgrade_createtable.php +++ b/mapBuilder/install/upgrade_createtable.php @@ -1,23 +1,24 @@ firstDbExec() ) { + if ($this->firstDbExec()) { $this->useDbProfile('jauth'); $this->execSQLScript('sql/mapcontext'); } diff --git a/mapBuilder/install/upgrade_toggleattributetable.php b/mapBuilder/install/upgrade_toggleattributetable.php index 52ab55ff..33eb35e8 100644 --- a/mapBuilder/install/upgrade_toggleattributetable.php +++ b/mapBuilder/install/upgrade_toggleattributetable.php @@ -1,21 +1,22 @@ setValue('attributeTableTool', 'true'); diff --git a/mapBuilder/zones/list_mapcontext.zone.php b/mapBuilder/zones/list_mapcontext.zone.php index c6d529b8..a4dcd5c6 100644 --- a/mapBuilder/zones/list_mapcontext.zone.php +++ b/mapBuilder/zones/list_mapcontext.zone.php @@ -1,52 +1,54 @@ login; - $loggedUser = false; - - // Get user mapcontexts - if($usr_login){ - $loggedUser = true; - - $daomc = jDao::get('mapBuilder~mapcontext'); - $conditions = jDao::createConditions(); - $conditions->addCondition('login','=',$usr_login); - $mcOwnList = $daomc->findBy($conditions); - $mcOwnCount = $daomc->countBy($conditions); - - $this->_tpl->assign('mcOwnList',$mcOwnList); - $this->_tpl->assign('mcOwnCount',$mcOwnCount); - } - - // Get public mapcontexts - $daomc = jDao::get('mapBuilder~mapcontext'); - $conditions = jDao::createConditions(); - // Don't display logged user map context twice - if($usr_login){ - $conditions->addCondition('login','!=',$usr_login); - } - $conditions->addCondition('is_public','=',true); - $mcSharedList = $daomc->findBy($conditions); - $mcSharedCount = $daomc->countBy($conditions); - - // Get html content - $this->_tpl->assign('loggedUser',$loggedUser); - $this->_tpl->assign('mcSharedList',$mcSharedList); - $this->_tpl->assign('mcSharedCount',$mcSharedCount); - } +class list_mapcontextZone extends jZone +{ + protected $_tplname = 'list_mapcontext'; + + protected function _prepareTpl() + { + // Get user + $juser = jAuth::getUserSession(); + $usr_login = $juser->login; + $loggedUser = false; + + // Get user mapcontexts + if ($usr_login) { + $loggedUser = true; + + $daomc = jDao::get('mapBuilder~mapcontext'); + $conditions = jDao::createConditions(); + $conditions->addCondition('login', '=', $usr_login); + $mcOwnList = $daomc->findBy($conditions); + $mcOwnCount = $daomc->countBy($conditions); + + $this->_tpl->assign('mcOwnList', $mcOwnList); + $this->_tpl->assign('mcOwnCount', $mcOwnCount); + } + + // Get public mapcontexts + $daomc = jDao::get('mapBuilder~mapcontext'); + $conditions = jDao::createConditions(); + // Don't display logged user map context twice + if ($usr_login) { + $conditions->addCondition('login', '!=', $usr_login); + } + $conditions->addCondition('is_public', '=', true); + $mcSharedList = $daomc->findBy($conditions); + $mcSharedCount = $daomc->countBy($conditions); + + // Get html content + $this->_tpl->assign('loggedUser', $loggedUser); + $this->_tpl->assign('mcSharedList', $mcSharedList); + $this->_tpl->assign('mcSharedCount', $mcSharedCount); + } } diff --git a/mapBuilderAdmin/classes/mapBuilderAdminConfig.listener.php b/mapBuilderAdmin/classes/mapBuilderAdminConfig.listener.php index f9db9ccf..ece62582 100644 --- a/mapBuilderAdmin/classes/mapBuilderAdminConfig.listener.php +++ b/mapBuilderAdmin/classes/mapBuilderAdminConfig.listener.php @@ -1,21 +1,24 @@ childItems[] = new masterAdminMenuItem( - 'mapBuilderAdmin_configuration', - jLocale::get("mapBuilderAdmin~admin.menu.configuration.label"), - jUrl::get('mapBuilderAdmin~config:index'), 122 - ); + // Child for the configuration of mapBuilder + $bloc->childItems[] = new masterAdminMenuItem( + 'mapBuilderAdmin_configuration', + jLocale::get('mapBuilderAdmin~admin.menu.configuration.label'), + jUrl::get('mapBuilderAdmin~config:index'), + 122 + ); - // Add the bloc - $event->add($bloc); + // Add the bloc + $event->add($bloc); + } } - } } diff --git a/mapBuilderAdmin/controllers/config.classic.php b/mapBuilderAdmin/controllers/config.classic.php index 98e9576f..eb2c6a25 100644 --- a/mapBuilderAdmin/controllers/config.classic.php +++ b/mapBuilderAdmin/controllers/config.classic.php @@ -1,178 +1,197 @@ array( 'jacl2.right'=>'mapBuilder.access'), - 'modify' => array( 'jacl2.right'=>'lizmap.admin.services.update'), - 'edit' => array( 'jacl2.right'=>'lizmap.admin.services.update'), - 'save' => array( 'jacl2.right'=>'lizmap.admin.services.update'), - 'validate' => array( 'jacl2.right'=>'lizmap.admin.services.update') - ); - - private $ini = null; - - function __construct( $request ) { - parent::__construct( $request ); + * mapBuilder administration. + * + * @author 3liz + * @copyright 2019-2020 3liz + * + * @see https://3liz.com + * + * @license Mozilla Public License : http://www.mozilla.org/MPL/ + */ +class configCtrl extends jController +{ + // Configure access via jacl2 rights management + public $pluginParams = array( + '*' => array('jacl2.right' => 'mapBuilder.access'), + 'modify' => array('jacl2.right' => 'lizmap.admin.services.update'), + 'edit' => array('jacl2.right' => 'lizmap.admin.services.update'), + 'save' => array('jacl2.right' => 'lizmap.admin.services.update'), + 'validate' => array('jacl2.right' => 'lizmap.admin.services.update'), + ); + + private $ini; + + public function __construct($request) + { + parent::__construct($request); $monfichier = jApp::varconfigPath('mapBuilder.ini.php'); - $this->ini = new \Jelix\IniFile\IniModifier($monfichier); + $this->ini = new IniModifier($monfichier); } - /** - * mapBuilder administration - */ - function index() { - $rep = $this->getResponse('html'); - - // Create the form - $form = jForms::create('mapBuilderAdmin~config'); - - // Set form data values - foreach ( $form->getControls() as $ctrl ) { - if ( $ctrl->type != 'submit' ){ - $val = $this->ini->getValue( $ctrl->ref); - if( $ctrl->ref == 'baseLayer' ){ - $val = explode(',', $val); + /** + * mapBuilder administration. + */ + public function index() + { + $rep = $this->getResponse('html'); + + // Create the form + $form = jForms::create('mapBuilderAdmin~config'); + + // Set form data values + foreach ($form->getControls() as $ctrl) { + if ($ctrl->type != 'submit') { + $val = $this->ini->getValue($ctrl->ref); + if ($ctrl->ref == 'baseLayer') { + $val = explode(',', $val); + } + $form->setData($ctrl->ref, $val); + } } - $form->setData( $ctrl->ref, $val ); - } + + $tpl = new jTpl(); + $tpl->assign('form', $form); + $rep->body->assign('MAIN', $tpl->fetch('config_view')); + + return $rep; } - $tpl = new jTpl(); - $tpl->assign( 'form', $form ); - $rep->body->assign('MAIN', $tpl->fetch('config_view')); - - return $rep; - } - - /** - * Modification of the configuration. - * @return Redirect to the form display action. - */ - public function modify(){ - // Create the form - $form = jForms::create('mapBuilderAdmin~config'); - - // Set form data values - foreach ( $form->getControls() as $ctrl ) { - if ( $ctrl->type != 'submit' ){ - $val = $this->ini->getValue( $ctrl->ref); - if( $ctrl->ref == 'baseLayer' ){ - $val = explode(',', $val); - } - $form->setData( $ctrl->ref, $val ); + /** + * Modification of the configuration. + * + * @return Redirect to the form display action + */ + public function modify() + { + // Create the form + $form = jForms::create('mapBuilderAdmin~config'); + + // Set form data values + foreach ($form->getControls() as $ctrl) { + if ($ctrl->type != 'submit') { + $val = $this->ini->getValue($ctrl->ref); + if ($ctrl->ref == 'baseLayer') { + $val = explode(',', $val); + } + $form->setData($ctrl->ref, $val); + } } - } - // redirect to the form display action - $rep= $this->getResponse("redirect"); - $rep->action="mapBuilderAdmin~config:edit"; - return $rep; - } - - /** - * Display the form to modify the config. - * @return Display the form. - */ - public function edit(){ - $rep = $this->getResponse('html'); - - // Get the form - $form = jForms::get('mapBuilderAdmin~config'); - - if ( !$form ) { - // redirect to default page - jMessage::add('error in edit'); - $rep = $this->getResponse('redirect'); - $rep->action ='mapBuilderAdmin~config:index'; - return $rep; - } - // Display form - $tpl = new jTpl(); - $tpl->assign('form', $form); - $rep->body->assign('MAIN', $tpl->fetch('mapBuilderAdmin~config_edit')); - return $rep; - } - - /** - * Save the data for the config. - * @return Redirect to the index. - */ - function save(){ - $form = jForms::get('mapBuilderAdmin~config'); - - // token - $token = $this->param('__JFORMS_TOKEN__'); - if( !$token ){ - // redirection vers la page d'erreur - $rep= $this->getResponse("redirect"); - $rep->action="mapBuilderAdmin~config:index"; - return $rep; - } + // redirect to the form display action + $rep = $this->getResponse('redirect'); + $rep->action = 'mapBuilderAdmin~config:edit'; - // If the form is not defined, redirection - if( !$form ){ - $rep= $this->getResponse("redirect"); - $rep->action="mapBuilderAdmin~config:index"; - return $rep; + return $rep; } - // Set the other form data from the request data - $form->initFromRequest(); + /** + * Display the form to modify the config. + * + * @return Display the form + */ + public function edit() + { + $rep = $this->getResponse('html'); + + // Get the form + $form = jForms::get('mapBuilderAdmin~config'); + + if (!$form) { + // redirect to default page + jMessage::add('error in edit'); + $rep = $this->getResponse('redirect'); + $rep->action = 'mapBuilderAdmin~config:index'; + + return $rep; + } + // Display form + $tpl = new jTpl(); + $tpl->assign('form', $form); + $rep->body->assign('MAIN', $tpl->fetch('mapBuilderAdmin~config_edit')); - // Check the form - if ( !$form->check() ) { - // Errors : redirection to the display action - $rep = $this->getResponse('redirect'); - $rep->action='mapBuilderAdmin~config:edit'; - $rep->params['errors']= "1"; - return $rep; + return $rep; } - // Save the data - foreach ( $form->getControls() as $ctrl ) { - if ( $ctrl->type != 'submit' ){ - $val = $form->getData( $ctrl->ref ); - if( $ctrl->ref == 'baseLayer' ){ - $val = implode(',', $val); + /** + * Save the data for the config. + * + * @return Redirect to the index + */ + public function save() + { + $form = jForms::get('mapBuilderAdmin~config'); + + // token + $token = $this->param('__JFORMS_TOKEN__'); + if (!$token) { + // redirection vers la page d'erreur + $rep = $this->getResponse('redirect'); + $rep->action = 'mapBuilderAdmin~config:index'; + + return $rep; } - $this->ini->setValue( $ctrl->ref, $val); - } - } - $this->ini->save(); - // Redirect to the validation page - $rep= $this->getResponse("redirect"); - $rep->action="mapBuilderAdmin~config:validate"; + // If the form is not defined, redirection + if (!$form) { + $rep = $this->getResponse('redirect'); + $rep->action = 'mapBuilderAdmin~config:index'; - return $rep; - } + return $rep; + } - /** - * Validate the data for the config : destroy form and redirect. - * @return Redirect to the index. - */ - function validate(){ + // Set the other form data from the request data + $form->initFromRequest(); - // Destroy the form - if($form = jForms::get('mapBuilderAdmin~config')){ - jForms::destroy('mapBuilderAdmin~config'); + // Check the form + if (!$form->check()) { + // Errors : redirection to the display action + $rep = $this->getResponse('redirect'); + $rep->action = 'mapBuilderAdmin~config:edit'; + $rep->params['errors'] = '1'; + + return $rep; + } + + // Save the data + foreach ($form->getControls() as $ctrl) { + if ($ctrl->type != 'submit') { + $val = $form->getData($ctrl->ref); + if ($ctrl->ref == 'baseLayer') { + $val = implode(',', $val); + } + $this->ini->setValue($ctrl->ref, $val); + } + } + $this->ini->save(); + + // Redirect to the validation page + $rep = $this->getResponse('redirect'); + $rep->action = 'mapBuilderAdmin~config:validate'; + + return $rep; } - // Redirect to the index - $rep= $this->getResponse("redirect"); - $rep->action="mapBuilderAdmin~config:index"; + /** + * Validate the data for the config : destroy form and redirect. + * + * @return Redirect to the index + */ + public function validate() + { + + // Destroy the form + if ($form = jForms::get('mapBuilderAdmin~config')) { + jForms::destroy('mapBuilderAdmin~config'); + } + + // Redirect to the index + $rep = $this->getResponse('redirect'); + $rep->action = 'mapBuilderAdmin~config:index'; - return $rep; - } + return $rep; + } } diff --git a/mapBuilderAdmin/controllers/default.classic.php b/mapBuilderAdmin/controllers/default.classic.php index 9ca40ee0..c185bb9e 100644 --- a/mapBuilderAdmin/controllers/default.classic.php +++ b/mapBuilderAdmin/controllers/default.classic.php @@ -1,21 +1,17 @@ getResponse('html'); - return $rep; +/** + * @author your name + * @copyright 2018-2020 3liz + * + * @see http://3liz.com + * + * @license Mozilla Public License : http://www.mozilla.org/MPL/ + */ +class defaultCtrl extends jController +{ + public function index() + { + return $this->getResponse('html'); } } - diff --git a/mapBuilderAdmin/install/configure.php b/mapBuilderAdmin/install/configure.php index 488cbe51..ae936d92 100644 --- a/mapBuilderAdmin/install/configure.php +++ b/mapBuilderAdmin/install/configure.php @@ -1,24 +1,26 @@ havingName( 'admin', array( - new MapInclude('urls.xml') + new MapInclude('urls.xml'), ) - ) - ; - } - - public function configure(ConfigurationHelpers $helpers) - { - + ); } + public function configure(ConfigurationHelpers $helpers) {} } diff --git a/mapBuilderAdmin/install/install.php b/mapBuilderAdmin/install/install.php index c86ca028..96296554 100644 --- a/mapBuilderAdmin/install/install.php +++ b/mapBuilderAdmin/install/install.php @@ -1,20 +1,21 @@ entryPoint->getEpId() == 'admin') { $localConfigIni = $this->entryPoint->localConfigIni->getMaster(); From 4a3b3ae3376ad3f87797544bccac0b847f60a79b Mon Sep 17 00:00:00 2001 From: neo Date: Mon, 27 Jan 2025 16:51:41 +0100 Subject: [PATCH 3/3] FIX: workflows readme ... --- .github/workflows/test-lint-php-cs-fixer.yml | 19 +++++++++++++++++++ .php-cs-fixer.dist.php | 6 ++++++ CONTRIBUTING.md | 19 +++++++++++++++---- mapBuilder/controllers/default.classic.php | 2 +- mapBuilder/controllers/mapcontext.classic.php | 8 ++++++-- 5 files changed, 47 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/test-lint-php-cs-fixer.yml diff --git a/.github/workflows/test-lint-php-cs-fixer.yml b/.github/workflows/test-lint-php-cs-fixer.yml new file mode 100644 index 00000000..310254d4 --- /dev/null +++ b/.github/workflows/test-lint-php-cs-fixer.yml @@ -0,0 +1,19 @@ +name: PHP-CS-Fixer 🐘 🔍 + +on: + push: + pull_request: + +jobs: + eslint: + name: "PHP CS Fixer 🔍" + runs-on: ubuntu-latest + steps: + + - uses: actions/checkout@v4 + + - name: Install modules + run: composer install + + - name: Run PHP-CS-Fixer + run: composer cs-check diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 4315e983..91924c7b 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -6,8 +6,14 @@ 'mapBuilder/', 'mapBuilderAdmin/', ]) + ->notPath([ + 'tests/', + ]) ; +// CS Rules should match with Lizmap Web Client ones +// https://github.com/3liz/lizmap-web-client/blob/master/.php-cs-fixer.dist.php + return (new PhpCsFixer\Config()) ->setRules([ '@PSR2' => true, diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 119ee347..5b90a1ab 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,23 +3,19 @@ ## Testing with linters Before the next part, you must have installed the dependencies with `npm install` and `composer install` at the project root. -Before the next part, you must have installed the dependencies with `npm install` at the project root. ### StyleLint for CSS -If you want to see all your issues on the PHP code without fixing it, you If you want to see all your issues on the CSS code without fixing it, you can run the following command: ```bash -composer cs-check npm run stylelint-check ``` If you want to fix the issues automatically, you can run the following command: ```bash -composer cs-fix npm run stylelint-fix ``` _Note : The command `npm run stylelint-fix` may not fix all the issues and print them on the screen. @@ -35,3 +31,18 @@ ignoreFiles: [ "...", ], ``` + +### PHP CS Fixer for PHP + +If you want to see all your issues on the PHP code without fixing it, you +can run the following command: + +```bash +composer cs-check +``` + +If you want to fix the issues automatically, you can run the following command: + +```bash +composer cs-fix +``` diff --git a/mapBuilder/controllers/default.classic.php b/mapBuilder/controllers/default.classic.php index 05027360..092da217 100644 --- a/mapBuilder/controllers/default.classic.php +++ b/mapBuilder/controllers/default.classic.php @@ -182,7 +182,7 @@ public function index() $rep->body->assign('allowUserAccountRequests', $services->allowUserAccountRequests); // Add Google Analytics ID - if ($services->googleAnalyticsID != '' && preg_match('/^UA-\\d+-\\d+$/', $services->googleAnalyticsID) == 1) { + if ($services->googleAnalyticsID != '' && preg_match('/^UA-\d+-\d+$/', $services->googleAnalyticsID) == 1) { $rep->body->assign('googleAnalyticsID', $services->googleAnalyticsID); } diff --git a/mapBuilder/controllers/mapcontext.classic.php b/mapBuilder/controllers/mapcontext.classic.php index ed9130c1..11e72169 100644 --- a/mapBuilder/controllers/mapcontext.classic.php +++ b/mapBuilder/controllers/mapcontext.classic.php @@ -10,7 +10,9 @@ */ class mapcontextCtrl extends jController { - // Add a mapcontext + /** + * Add a mapcontext. + */ public function add() { @@ -57,7 +59,9 @@ public function add() return $rep; } - // Delete mapcontext by id + /** + * Delete mapcontext by id. + */ public function delete() {