Skip to content

Commit

Permalink
Fixes #3005 Namespace our dependencies to prevent conflicts (#3008)
Browse files Browse the repository at this point in the history
Using Mozart strategy.
  • Loading branch information
remyperona authored Aug 25, 2020
1 parent 5fc6b7f commit cfe483d
Show file tree
Hide file tree
Showing 55 changed files with 5,854 additions and 56 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ before_install:
if [[ -f composer.lock ]] ; then
rm composer.lock
fi
- composer remove --dev phpstan/phpstan szepeviktor/phpstan-wordpress
- composer remove --dev --no-scripts phpstan/phpstan szepeviktor/phpstan-wordpress coenjacobs/mozart
install:
- composer install --prefer-dist --no-interaction
- composer install --prefer-dist --no-interaction --no-scripts
before_script:
- |
if [[ ! -z "$WP_VERSION" ]] ; then
Expand All @@ -59,6 +59,7 @@ before_script:
script:
- |
if [[ "$WP_TRAVISCI" == "phpcs" ]]; then
vendor/bin/phpcs --config-set installed_paths ../../phpcompatibility/phpcompatibility-paragonie,../../phpcompatibility/phpcompatibility-wp,../../wp-coding-standards/wpcs,../../phpcompatibility/php-compatibility
composer phpcs
elif [[ "$WP_TRAVISCI" == "phpstan" ]]; then
composer require --dev szepeviktor/phpstan-wordpress
Expand Down
36 changes: 29 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,32 +35,34 @@
],
"require": {
"php": ">=5.6.0",
"wp-media/background-processing": "^1.3",
"composer/installers": "~1.0",
"container-interop/container-interop": "1.2.0",
"matthiasmullie/minify": "1.3.*",
"monolog/monolog": "^1.0",
"wp-media/rocket-lazyload-common": "^2"
"psr/container": "^1.0"
},
"require-dev": {
"php": "^5.6 || ^7",
"brain/monkey": "^2.0",
"coenjacobs/mozart": "0.6.0-beta-3",
"dealerdirect/phpcodesniffer-composer-installer": "^0.5.0",
"mikey179/vfsstream": "^1.6",
"mobiledetect/mobiledetectlib": "^2.8",
"phpcompatibility/phpcompatibility-wp": "^2.0",
"phpstan/phpstan": "^0.12.3",
"phpunit/phpunit": "^5.7 || ^7",
"roave/security-advisories": "dev-master",
"szepeviktor/phpstan-wordpress": "^0.5.0",
"woocommerce/woocommerce": "^3.8",
"wp-coding-standards/wpcs": "^2",
"wp-media/background-processing": "^1.3",
"wp-media/rocket-lazyload-common": "^2",
"wp-media/phpunit": "^1.0",
"wp-media/wp-imagify-partner": "^1.0",
"wpackagist-plugin/amp": "^1.1.4",
"wpackagist-plugin/hummingbird-performance": "2.0.1",
"wpackagist-plugin/pdf-embedder": "^4.6",
"wpackagist-plugin/simple-custom-css": "^4.0.3",
"wpackagist-plugin/spinupwp": "^1.1",
"wpackagist-plugin/wp-smushit": "^3.0",
"wpackagist-plugin/pdf-embedder": "^4.6"
"wpackagist-plugin/wp-smushit": "^3.0"
},
"autoload": {
"classmap": [
Expand All @@ -84,6 +86,18 @@
"extra": {
"installer-paths": {
"vendor/{$vendor}/{$name}/": ["type:wordpress-plugin"]
},
"mozart": {
"dep_namespace": "WP_Rocket\\Dependencies\\",
"dep_directory": "/inc/Dependencies/",
"classmap_directory": "/inc/classes/dependencies/",
"classmap_prefix": "WP_Rocket_",
"packages": [
"mobiledetect/mobiledetectlib",
"wp-media/background-processing",
"wp-media/rocket-lazyload-common",
"wp-media/wp-imagify-partner"
]
}
},
"replace": {
Expand Down Expand Up @@ -138,6 +152,14 @@
"install-codestandards": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin::run",
"phpcs": "phpcs --basepath=.",
"phpcs-changed": "./bin/phpcs-changed.sh",
"phpcs:fix": "phpcbf"
"phpcs:fix": "phpcbf",
"post-install-cmd": [
"\"vendor/bin/mozart\" compose",
"composer dump-autoload"
],
"post-update-cmd": [
"\"vendor/bin/mozart\" compose",
"composer dump-autoload"
]
}
}
Loading

0 comments on commit cfe483d

Please sign in to comment.