diff --git a/composer.json b/composer.json index ccf5d749b..4a26ba956 100644 --- a/composer.json +++ b/composer.json @@ -58,8 +58,7 @@ "phpunit/php-code-coverage": "^9.2", "phpunit/phpunit": "^9.3", "slevomat/coding-standard": "^7.0", - "squizlabs/php_codesniffer": "^3.5", - "symfony/var-exporter": "^5.4" + "squizlabs/php_codesniffer": "^3.5" }, "config": { "sort-packages": true, diff --git a/composer.lock b/composer.lock index 1a78969ad..3042e95e4 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "a8fcdbe293cf508305b9865ac9821da4", + "content-hash": "2e4a876ba583ea7b5ddf4bebd46c0262", "packages": [ { "name": "evenement/evenement", @@ -4775,79 +4775,6 @@ }, "time": "2021-12-12T21:44:58+00:00" }, - { - "name": "symfony/var-exporter", - "version": "v5.4.21", - "source": { - "type": "git", - "url": "https://github.com/symfony/var-exporter.git", - "reference": "be74908a6942fdd331554b3cec27ff41b45ccad4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/var-exporter/zipball/be74908a6942fdd331554b3cec27ff41b45ccad4", - "reference": "be74908a6942fdd331554b3cec27ff41b45ccad4", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.16" - }, - "require-dev": { - "symfony/var-dumper": "^4.4.9|^5.0.9|^6.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\VarExporter\\": "" - }, - "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": "Allows exporting any serializable PHP data structure to plain PHP code", - "homepage": "https://symfony.com", - "keywords": [ - "clone", - "construct", - "export", - "hydrate", - "instantiate", - "serialize" - ], - "support": { - "source": "https://github.com/symfony/var-exporter/tree/v5.4.21" - }, - "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": "2023-02-21T19:46:44+00:00" - }, { "name": "theseer/tokenizer", "version": "1.2.1", diff --git a/docs/recipe/magento2.md b/docs/recipe/magento2.md index a3dcbc17c..72bbb6993 100644 --- a/docs/recipe/magento2.md +++ b/docs/recipe/magento2.md @@ -115,7 +115,7 @@ The magento2 recipe is based on the [common](/docs/recipe/common.md) recipe. ## Configuration ### static_content_locales -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L26) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L25) By default setup:static-content:deploy uses `en_US`. To change that, simply put `set('static_content_locales', 'en_US de_DE');` @@ -127,7 +127,7 @@ in you deployer script. ### magento_themes -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L43) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L42) You can also set the themes to run against. By default it'll deploy all themes - `add('magento_themes', ['Magento/luma', 'Magento/backend']);` @@ -151,14 +151,14 @@ set('magento_themes', [ ### static_deploy_options -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L48) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L47) Static content deployment options, e.g. '--no-parent' ### split_static_deployment -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L51) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L50) Deploy frontend and adminhtml together as default @@ -168,7 +168,7 @@ false ### static_content_locales_backend -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L54) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L53) Use the default languages for the backend as default @@ -178,7 +178,7 @@ Use the default languages for the backend as default ### magento_themes_backend -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L58) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L57) backend themes to deploy. Only used if split_static_deployment=true This setting supports the same options/structure as [magento_themes](/docs/recipe/magento2.md#magento_themes) @@ -189,7 +189,7 @@ This setting supports the same options/structure as [magento_themes](/docs/recip ### static_content_jobs -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L64) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L63) Also set the number of conccurent jobs to run. The default is 1 Update using: `set('static_content_jobs', '1');` @@ -200,7 +200,7 @@ Update using: `set('static_content_jobs', '1');` ### content_version -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L66) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L65) @@ -210,7 +210,7 @@ return time(); ### magento_dir -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L71) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L70) Magento directory relative to repository root. Use "." (default) if it is not located in a subdirectory @@ -220,7 +220,7 @@ Magento directory relative to repository root. Use "." (default) if it is not lo ### shared_files -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L74) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L73) Overrides [shared_files](/docs/recipe/deploy/shared.md#shared_files) from `recipe/deploy/shared.php`. @@ -235,7 +235,7 @@ Overrides [shared_files](/docs/recipe/deploy/shared.md#shared_files) from `recip ### shared_dirs -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L78) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L77) Overrides [shared_dirs](/docs/recipe/deploy/shared.md#shared_dirs) from `recipe/deploy/shared.php`. @@ -261,7 +261,7 @@ Overrides [shared_dirs](/docs/recipe/deploy/shared.md#shared_dirs) from `recipe/ ### writable_dirs -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L93) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L92) Overrides [writable_dirs](/docs/recipe/deploy/writable.md#writable_dirs) from `recipe/deploy/writable.php`. @@ -279,7 +279,7 @@ Overrides [writable_dirs](/docs/recipe/deploy/writable.md#writable_dirs) from `r ### clear_paths -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L100) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L99) Overrides [clear_paths](/docs/recipe/deploy/clear_paths.md#clear_paths) from `recipe/deploy/clear_paths.php`. @@ -298,7 +298,7 @@ Overrides [clear_paths](/docs/recipe/deploy/clear_paths.md#clear_paths) from `re ### bin/magento -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L109) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L108) @@ -308,7 +308,7 @@ Overrides [clear_paths](/docs/recipe/deploy/clear_paths.md#clear_paths) from `re ### magento_version -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L111) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L110) @@ -321,7 +321,7 @@ return $matches[0] ?? '2.0'; ### config_import_needed -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L118) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L117) :::info Autogenerated @@ -332,7 +332,7 @@ The value of this configuration is autogenerated on access. ### database_upgrade_needed -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L132) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L131) :::info Autogenerated @@ -343,7 +343,7 @@ The value of this configuration is autogenerated on access. ### enable_zerodowntime -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L147) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L146) Deploy without setting maintenance mode if possible @@ -353,7 +353,7 @@ true ### artifact_file -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L333) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L332) The file the artifact is saved to @@ -363,7 +363,7 @@ The file the artifact is saved to ### artifact_dir -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L336) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L335) The directory the artifact is saved in @@ -373,7 +373,7 @@ The directory the artifact is saved in ### artifact_excludes_file -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L340) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L339) Points to a file with a list of files to exclude from packaging. The format is as with the `tar --exclude-from=[file]` option @@ -384,7 +384,7 @@ The format is as with the `tar --exclude-from=[file]` option ### build_from_repo -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L343) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L342) If set to true, the artifact is built from a clean copy of the project repository instead of the current working directory @@ -394,7 +394,7 @@ false ### repository -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L346) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L345) Overrides [repository](/docs/recipe/common.md#repository) from `recipe/common.php`. @@ -406,7 +406,7 @@ null ### artifact_path -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L349) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L348) The relative path to the artifact file. If the directory does not exist, it will be created @@ -419,7 +419,7 @@ return get('artifact_dir') . '/' . get('artifact_file'); ### bin/tar -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L357) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L356) The location of the tar command. On MacOS you should have installed gtar, as it supports the required settings :::info Autogenerated @@ -430,14 +430,14 @@ The value of this configuration is autogenerated on access. ### additional_shared_files -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L429) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L428) Array of shared files that will be added to the default shared_files without overriding ### additional_shared_dirs -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L431) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L430) Array of shared directories that will be added to the default shared_dirs without overriding @@ -447,7 +447,7 @@ Array of shared directories that will be added to the default shared_dirs withou ## Tasks ### magento:compile -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L157) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L156) Compiles magento di. @@ -459,7 +459,7 @@ e.g. ### magento:deploy:assets -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L183) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L182) Deploys assets. @@ -486,7 +486,7 @@ in `app/etc/config.php`, e.g.: ### magento:deploy:assets:adminhtml -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L199) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L198) Deploys assets for backend only. @@ -494,7 +494,7 @@ Deploys assets for backend only. ### magento:deploy:assets:frontend -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L204) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L203) Deploys assets for frontend only. @@ -502,7 +502,7 @@ Deploys assets for frontend only. ### magento:sync:content_version -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L252) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L251) Syncs content version. @@ -510,7 +510,7 @@ Syncs content version. ### magento:maintenance:enable -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L262) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L261) Enables maintenance mode. @@ -518,7 +518,7 @@ Enables maintenance mode. ### magento:maintenance:disable -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L268) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L267) Disables maintenance mode. @@ -526,7 +526,7 @@ Disables maintenance mode. ### magento:maintenance:enable-if-needed -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L274) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L273) Set maintenance mode if needed. @@ -534,7 +534,7 @@ Set maintenance mode if needed. ### magento:config:import -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L281) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L280) Config Import. @@ -542,7 +542,7 @@ Config Import. ### magento:upgrade:db -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L290) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L289) Upgrades magento database. @@ -550,7 +550,7 @@ Upgrades magento database. ### magento:cache:flush -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L299) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L298) Flushes Magento Cache. @@ -558,7 +558,7 @@ Flushes Magento Cache. ### deploy:magento -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L304) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L303) Magento2 deployment operations. @@ -575,7 +575,7 @@ This task is group task which contains next tasks: ### magento:build -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L314) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L313) Magento2 build operations. @@ -588,7 +588,7 @@ This task is group task which contains next tasks: ### deploy -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L320) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L319) Deploys your project. @@ -604,7 +604,7 @@ This task is group task which contains next tasks: ### artifact:package -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L368) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L367) Packages all relevant files in an artifact. @@ -612,7 +612,7 @@ Packages all relevant files in an artifact. ### artifact:upload -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L378) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L377) Uploads artifact in release folder for extraction. @@ -620,7 +620,7 @@ Uploads artifact in release folder for extraction. ### artifact:extract -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L383) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L382) Extracts artifact in release path. @@ -628,7 +628,7 @@ Extracts artifact in release path. ### build:remove-generated -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L389) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L388) Clears generated files prior to building. @@ -636,7 +636,7 @@ Clears generated files prior to building. ### build:prepare -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L394) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L393) Prepare local artifact build. @@ -644,7 +644,7 @@ Prepare local artifact build. ### artifact:build -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L419) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L418) Builds an artifact. @@ -661,7 +661,7 @@ This task is group task which contains next tasks: ### deploy:additional-shared -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L435) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L434) Adds additional files and dirs to the list of shared files and dirs. @@ -669,7 +669,7 @@ Adds additional files and dirs to the list of shared files and dirs. ### magento:set_cache_prefix -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L450) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L449) Update cache id_prefix. @@ -683,7 +683,7 @@ after('deploy:magento', 'magento:cleanup_cache_prefix'); ### magento:cleanup_cache_prefix -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L490) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L489) Cleanup cache id_prefix env files. @@ -691,7 +691,7 @@ After successful deployment, move the tmp_env.php file to env.php ready for next ### artifact:prepare -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L500) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L499) Prepares an artifact on the target server. @@ -711,7 +711,7 @@ This task is group task which contains next tasks: ### artifact:finish -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L513) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L512) Executes the tasks after artifact is released. @@ -726,7 +726,7 @@ This task is group task which contains next tasks: ### artifact:deploy -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L522) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L521) Actually releases the artifact deployment. diff --git a/recipe/magento2.php b/recipe/magento2.php index d4cb26f96..09c1b12d9 100644 --- a/recipe/magento2.php +++ b/recipe/magento2.php @@ -8,7 +8,6 @@ use Deployer\Exception\GracefulShutdownException; use Deployer\Exception\RunException; use Deployer\Host\Host; -use Symfony\Component\VarExporter\VarExporter; const CONFIG_IMPORT_NEEDED_EXIT_CODE = 2; const DB_UPDATE_NEEDED_EXIT_CODE = 2; @@ -471,7 +470,7 @@ function magentoDeployAssetsSplit(string $area) $envConfigArray['cache']['frontend']['page_cache']['id_prefix'] = $prefixUpdate; //Generate configuration array as string - $envConfigStr = '