From 70d3a1e61ef925d0947d3ffe2a097007dd64ea5a Mon Sep 17 00:00:00 2001 From: Mriyam Tamuli Date: Wed, 7 Feb 2018 20:15:29 +0530 Subject: [PATCH 0001/1044] WP-CLI clone at e683d394f89ce923eac2227e655a01fa0255f925 --- .editorconfig | 23 + .gitattributes | 3 + .github/ISSUE_TEMPLATE | 41 + .github/PULL_REQUEST_TEMPLATE | 16 + .github/SUPPORT.md | 6 + .gitignore | 11 + .mailmap | 234 + .travis.yml | 69 + CONTRIBUTING.md | 10 + LICENSE | 21 + README.md | 200 + VERSION | 1 + bin/wp | 45 + bin/wp.bat | 2 + ci/behat-tags.php | 85 + ci/deploy.sh | 56 + ci/prepare.sh | 40 + ci/sniff.sh | 6 + ci/test.sh | 11 + composer.json | 94 + composer.lock | 3870 +++++++++++++++++ features/aliases.feature | 405 ++ features/bootstrap.feature | 358 ++ features/bootstrap/FeatureContext.php | 942 ++++ features/bootstrap/support.php | 200 + features/cli-bash-completion.feature | 299 ++ features/cli-info.feature | 49 + features/cli.feature | 214 + features/command.feature | 1668 +++++++ features/config.feature | 539 +++ features/extra/no-mail.php | 7 + features/flags.feature | 297 ++ features/formatter.feature | 155 + features/framework.feature | 362 ++ features/help.feature | 1018 +++++ features/hook.feature | 73 + features/make-phar.feature | 28 + features/prompt.feature | 90 + features/runcommand.feature | 304 ++ features/runner.feature | 21 + features/skip-plugins.feature | 116 + features/skip-themes.feature | 152 + features/steps.feature | 59 + features/steps/given.php | 219 + features/steps/then.php | 237 + features/steps/when.php | 54 + features/utils-wp.feature | 734 ++++ features/validation.feature | 48 + php/WP_CLI/AutoloadSplitter.php | 33 + php/WP_CLI/Autoloader.php | 177 + php/WP_CLI/Bootstrap/AutoloaderStep.php | 96 + php/WP_CLI/Bootstrap/BootstrapState.php | 56 + php/WP_CLI/Bootstrap/BootstrapStep.php | 22 + php/WP_CLI/Bootstrap/ConfigureRunner.php | 27 + .../Bootstrap/DeclareAbstractBaseCommand.php | 26 + php/WP_CLI/Bootstrap/DeclareMainClass.php | 26 + .../Bootstrap/DefineProtectedCommands.php | 57 + .../Bootstrap/IncludeBundledAutoloader.php | 37 + .../Bootstrap/IncludeFallbackAutoloader.php | 35 + .../Bootstrap/IncludeFrameworkAutoloader.php | 50 + .../Bootstrap/IncludePackageAutoloader.php | 57 + .../Bootstrap/InitializeColorization.php | 27 + php/WP_CLI/Bootstrap/InitializeLogger.php | 47 + php/WP_CLI/Bootstrap/LaunchRunner.php | 27 + php/WP_CLI/Bootstrap/LoadDispatcher.php | 26 + php/WP_CLI/Bootstrap/LoadRequiredCommand.php | 62 + php/WP_CLI/Bootstrap/LoadUtilityFunctions.php | 26 + .../Bootstrap/RegisterDeferredCommands.php | 52 + .../Bootstrap/RegisterFrameworkCommands.php | 42 + php/WP_CLI/Bootstrap/RunnerInstance.php | 32 + php/WP_CLI/Completions.php | 166 + php/WP_CLI/ComposerIO.php | 39 + php/WP_CLI/Configurator.php | 361 ++ php/WP_CLI/Dispatcher/CommandAddition.php | 58 + php/WP_CLI/Dispatcher/CommandFactory.php | 221 + php/WP_CLI/Dispatcher/CommandNamespace.php | 50 + php/WP_CLI/Dispatcher/CompositeCommand.php | 307 ++ php/WP_CLI/Dispatcher/RootCommand.php | 59 + php/WP_CLI/Dispatcher/Subcommand.php | 451 ++ php/WP_CLI/DocParser.php | 197 + php/WP_CLI/ExitException.php | 5 + php/WP_CLI/Extractor.php | 223 + php/WP_CLI/Fetchers/Base.php | 56 + php/WP_CLI/FileCache.php | 333 ++ php/WP_CLI/Formatter.php | 361 ++ php/WP_CLI/Iterators/CSV.php | 78 + php/WP_CLI/Iterators/Exception.php | 6 + php/WP_CLI/Iterators/Query.php | 130 + php/WP_CLI/Iterators/Table.php | 94 + php/WP_CLI/Iterators/Transform.php | 26 + php/WP_CLI/Loggers/Base.php | 81 + php/WP_CLI/Loggers/Execution.php | 81 + php/WP_CLI/Loggers/Quiet.php | 57 + php/WP_CLI/Loggers/Regular.php | 82 + php/WP_CLI/NoOp.php | 18 + php/WP_CLI/PackageManagerEventSubscriber.php | 52 + php/WP_CLI/Process.php | 136 + php/WP_CLI/ProcessRun.php | 68 + php/WP_CLI/Runner.php | 1725 ++++++++ php/WP_CLI/SynopsisParser.php | 165 + php/WP_CLI/SynopsisValidator.php | 181 + php/WP_CLI/UpgraderSkin.php | 60 + php/WP_CLI/WpHttpCacheManager.php | 132 + php/boot-fs.php | 18 + php/boot-phar.php | 15 + php/bootstrap.php | 77 + php/class-wp-cli-command.php | 12 + php/class-wp-cli.php | 1273 ++++++ php/commands/cli.php | 3 + php/commands/help.php | 240 + php/commands/src/CLI_Command.php | 624 +++ php/config-spec.php | 117 + php/dispatcher.php | 20 + php/utils-wp.php | 373 ++ php/utils.php | 1453 +++++++ php/wp-cli.php | 23 + php/wp-settings-cli.php | 450 ++ phpcs.xml.dist | 43 + phpunit.xml.dist | 11 + templates/man-params.mustache | 19 + templates/man.mustache | 28 + templates/plugin-status.mustache | 6 + templates/theme-status.mustache | 5 + templates/versions.mustache | 4 + tests/bootstrap.php | 20 + .../commandfactory-doc_comment-class-win.php | 70 + .../data/commandfactory-doc_comment-class.php | 70 + ...ommandfactory-doc_comment-function-win.php | 19 + .../commandfactory-doc_comment-function.php | 19 + tests/data/expand_globs/bar.ab1 | 0 tests/data/expand_globs/bar.ab2 | 0 tests/data/expand_globs/baz.ab1 | 0 tests/data/expand_globs/baz.ac1 | 0 tests/data/expand_globs/baz.efg2 | 0 tests/data/expand_globs/foo.ab1 | 0 tests/data/expand_globs/foo.ab2 | 0 tests/data/expand_globs/foo.efg1 | 0 tests/data/expand_globs/foo.efg2 | 0 tests/phpunit6-compat.php | 19 + tests/test-arg-validation.php | 64 + tests/test-autoload-splitter.php | 65 + tests/test-behat-tags.php | 133 + tests/test-bundled-commands.php | 43 + tests/test-commandfactory.php | 418 ++ tests/test-configurator.php | 65 + tests/test-doc-parser.php | 200 + tests/test-extractor.php | 274 ++ tests/test-file-cache.php | 84 + tests/test-help.php | 117 + tests/test-logging.php | 113 + tests/test-process.php | 29 + tests/test-search-replace.php | 86 + tests/test-synopsis.php | 185 + tests/test-utils.php | 733 ++++ tests/test-wp-cli.php | 24 + tests/test-wp-version-compare.php | 78 + utils/amp-paths.txt | 5 + utils/auto-composer-update.sh | 50 + utils/contrib-list.php | 205 + utils/find-php | 19 + utils/get-package-require-from-composer.php | 23 + utils/make-phar-spec.php | 37 + utils/make-phar.php | 308 ++ utils/test-phar-download | 11 + utils/update-phar | 50 + utils/wp-cli-rpm.spec | 50 + utils/wp-cli-updatedeb.sh | 113 + utils/wp-cli-updaterpm.sh | 110 + utils/wp-completion.bash | 23 + 169 files changed, 29337 insertions(+) create mode 100644 .editorconfig create mode 100644 .gitattributes create mode 100644 .github/ISSUE_TEMPLATE create mode 100644 .github/PULL_REQUEST_TEMPLATE create mode 100644 .github/SUPPORT.md create mode 100644 .gitignore create mode 100644 .mailmap create mode 100644 .travis.yml create mode 100644 CONTRIBUTING.md create mode 100644 LICENSE create mode 100644 README.md create mode 100644 VERSION create mode 100755 bin/wp create mode 100755 bin/wp.bat create mode 100644 ci/behat-tags.php create mode 100755 ci/deploy.sh create mode 100755 ci/prepare.sh create mode 100755 ci/sniff.sh create mode 100755 ci/test.sh create mode 100644 composer.json create mode 100644 composer.lock create mode 100644 features/aliases.feature create mode 100644 features/bootstrap.feature create mode 100644 features/bootstrap/FeatureContext.php create mode 100644 features/bootstrap/support.php create mode 100644 features/cli-bash-completion.feature create mode 100644 features/cli-info.feature create mode 100644 features/cli.feature create mode 100644 features/command.feature create mode 100644 features/config.feature create mode 100644 features/extra/no-mail.php create mode 100644 features/flags.feature create mode 100644 features/formatter.feature create mode 100644 features/framework.feature create mode 100644 features/help.feature create mode 100644 features/hook.feature create mode 100644 features/make-phar.feature create mode 100644 features/prompt.feature create mode 100644 features/runcommand.feature create mode 100644 features/runner.feature create mode 100644 features/skip-plugins.feature create mode 100644 features/skip-themes.feature create mode 100644 features/steps.feature create mode 100644 features/steps/given.php create mode 100644 features/steps/then.php create mode 100644 features/steps/when.php create mode 100644 features/utils-wp.feature create mode 100644 features/validation.feature create mode 100644 php/WP_CLI/AutoloadSplitter.php create mode 100644 php/WP_CLI/Autoloader.php create mode 100644 php/WP_CLI/Bootstrap/AutoloaderStep.php create mode 100644 php/WP_CLI/Bootstrap/BootstrapState.php create mode 100644 php/WP_CLI/Bootstrap/BootstrapStep.php create mode 100644 php/WP_CLI/Bootstrap/ConfigureRunner.php create mode 100644 php/WP_CLI/Bootstrap/DeclareAbstractBaseCommand.php create mode 100644 php/WP_CLI/Bootstrap/DeclareMainClass.php create mode 100644 php/WP_CLI/Bootstrap/DefineProtectedCommands.php create mode 100644 php/WP_CLI/Bootstrap/IncludeBundledAutoloader.php create mode 100644 php/WP_CLI/Bootstrap/IncludeFallbackAutoloader.php create mode 100644 php/WP_CLI/Bootstrap/IncludeFrameworkAutoloader.php create mode 100644 php/WP_CLI/Bootstrap/IncludePackageAutoloader.php create mode 100644 php/WP_CLI/Bootstrap/InitializeColorization.php create mode 100644 php/WP_CLI/Bootstrap/InitializeLogger.php create mode 100644 php/WP_CLI/Bootstrap/LaunchRunner.php create mode 100644 php/WP_CLI/Bootstrap/LoadDispatcher.php create mode 100644 php/WP_CLI/Bootstrap/LoadRequiredCommand.php create mode 100644 php/WP_CLI/Bootstrap/LoadUtilityFunctions.php create mode 100644 php/WP_CLI/Bootstrap/RegisterDeferredCommands.php create mode 100644 php/WP_CLI/Bootstrap/RegisterFrameworkCommands.php create mode 100644 php/WP_CLI/Bootstrap/RunnerInstance.php create mode 100644 php/WP_CLI/Completions.php create mode 100644 php/WP_CLI/ComposerIO.php create mode 100644 php/WP_CLI/Configurator.php create mode 100644 php/WP_CLI/Dispatcher/CommandAddition.php create mode 100644 php/WP_CLI/Dispatcher/CommandFactory.php create mode 100644 php/WP_CLI/Dispatcher/CommandNamespace.php create mode 100644 php/WP_CLI/Dispatcher/CompositeCommand.php create mode 100644 php/WP_CLI/Dispatcher/RootCommand.php create mode 100644 php/WP_CLI/Dispatcher/Subcommand.php create mode 100644 php/WP_CLI/DocParser.php create mode 100644 php/WP_CLI/ExitException.php create mode 100644 php/WP_CLI/Extractor.php create mode 100644 php/WP_CLI/Fetchers/Base.php create mode 100644 php/WP_CLI/FileCache.php create mode 100644 php/WP_CLI/Formatter.php create mode 100644 php/WP_CLI/Iterators/CSV.php create mode 100644 php/WP_CLI/Iterators/Exception.php create mode 100644 php/WP_CLI/Iterators/Query.php create mode 100644 php/WP_CLI/Iterators/Table.php create mode 100644 php/WP_CLI/Iterators/Transform.php create mode 100644 php/WP_CLI/Loggers/Base.php create mode 100644 php/WP_CLI/Loggers/Execution.php create mode 100644 php/WP_CLI/Loggers/Quiet.php create mode 100644 php/WP_CLI/Loggers/Regular.php create mode 100644 php/WP_CLI/NoOp.php create mode 100644 php/WP_CLI/PackageManagerEventSubscriber.php create mode 100644 php/WP_CLI/Process.php create mode 100644 php/WP_CLI/ProcessRun.php create mode 100644 php/WP_CLI/Runner.php create mode 100644 php/WP_CLI/SynopsisParser.php create mode 100644 php/WP_CLI/SynopsisValidator.php create mode 100644 php/WP_CLI/UpgraderSkin.php create mode 100644 php/WP_CLI/WpHttpCacheManager.php create mode 100644 php/boot-fs.php create mode 100644 php/boot-phar.php create mode 100644 php/bootstrap.php create mode 100644 php/class-wp-cli-command.php create mode 100644 php/class-wp-cli.php create mode 100644 php/commands/cli.php create mode 100644 php/commands/help.php create mode 100644 php/commands/src/CLI_Command.php create mode 100644 php/config-spec.php create mode 100644 php/dispatcher.php create mode 100644 php/utils-wp.php create mode 100644 php/utils.php create mode 100644 php/wp-cli.php create mode 100644 php/wp-settings-cli.php create mode 100644 phpcs.xml.dist create mode 100644 phpunit.xml.dist create mode 100644 templates/man-params.mustache create mode 100644 templates/man.mustache create mode 100644 templates/plugin-status.mustache create mode 100644 templates/theme-status.mustache create mode 100644 templates/versions.mustache create mode 100644 tests/bootstrap.php create mode 100644 tests/data/commandfactory-doc_comment-class-win.php create mode 100644 tests/data/commandfactory-doc_comment-class.php create mode 100644 tests/data/commandfactory-doc_comment-function-win.php create mode 100644 tests/data/commandfactory-doc_comment-function.php create mode 100644 tests/data/expand_globs/bar.ab1 create mode 100644 tests/data/expand_globs/bar.ab2 create mode 100644 tests/data/expand_globs/baz.ab1 create mode 100644 tests/data/expand_globs/baz.ac1 create mode 100644 tests/data/expand_globs/baz.efg2 create mode 100644 tests/data/expand_globs/foo.ab1 create mode 100644 tests/data/expand_globs/foo.ab2 create mode 100644 tests/data/expand_globs/foo.efg1 create mode 100644 tests/data/expand_globs/foo.efg2 create mode 100644 tests/phpunit6-compat.php create mode 100644 tests/test-arg-validation.php create mode 100644 tests/test-autoload-splitter.php create mode 100644 tests/test-behat-tags.php create mode 100644 tests/test-bundled-commands.php create mode 100644 tests/test-commandfactory.php create mode 100644 tests/test-configurator.php create mode 100644 tests/test-doc-parser.php create mode 100644 tests/test-extractor.php create mode 100644 tests/test-file-cache.php create mode 100644 tests/test-help.php create mode 100644 tests/test-logging.php create mode 100644 tests/test-process.php create mode 100644 tests/test-search-replace.php create mode 100644 tests/test-synopsis.php create mode 100644 tests/test-utils.php create mode 100644 tests/test-wp-cli.php create mode 100644 tests/test-wp-version-compare.php create mode 100644 utils/amp-paths.txt create mode 100755 utils/auto-composer-update.sh create mode 100644 utils/contrib-list.php create mode 100755 utils/find-php create mode 100644 utils/get-package-require-from-composer.php create mode 100644 utils/make-phar-spec.php create mode 100644 utils/make-phar.php create mode 100755 utils/test-phar-download create mode 100755 utils/update-phar create mode 100644 utils/wp-cli-rpm.spec create mode 100755 utils/wp-cli-updatedeb.sh create mode 100755 utils/wp-cli-updaterpm.sh create mode 100644 utils/wp-completion.bash diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..8ccb6afe7 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,23 @@ +# This file is for unifying the coding style for different editors and IDEs +# editorconfig.org + +# WordPress Coding Standards +# http://make.wordpress.org/core/handbook/coding-standards/ + +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +indent_style = tab +indent_size = 4 + +[*.{json,yml,feature}] +indent_style = space +indent_size = 2 + +[composer.json] +indent_style = space +indent_size = 4 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..97cb2461f --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +# Auto detect text files and perform EOL normalization +* text=auto eol=lf +tests/data/*-win.php eol=crlf diff --git a/.github/ISSUE_TEMPLATE b/.github/ISSUE_TEMPLATE new file mode 100644 index 000000000..f6706f740 --- /dev/null +++ b/.github/ISSUE_TEMPLATE @@ -0,0 +1,41 @@ + diff --git a/.github/PULL_REQUEST_TEMPLATE b/.github/PULL_REQUEST_TEMPLATE new file mode 100644 index 000000000..291a4a188 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE @@ -0,0 +1,16 @@ + diff --git a/.github/SUPPORT.md b/.github/SUPPORT.md new file mode 100644 index 000000000..46928e312 --- /dev/null +++ b/.github/SUPPORT.md @@ -0,0 +1,6 @@ +Support +======= + +Hi there, + +GitHub issues are meant for enhancement requests and specific, reproducible bugs, not for general support questions. For support options, please review https://wp-cli.org/#support diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..1e0014bbc --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +.DS_Store +config.yml +PHAR_BUILD_VERSION +/cache +/packages +/vendor +/*.phar +/phpunit.xml.dist +/codesniffer +/PHP_Codesniffer-VariableAnalysis +.*.swp diff --git a/.mailmap b/.mailmap new file mode 100644 index 000000000..5c94560fc --- /dev/null +++ b/.mailmap @@ -0,0 +1,234 @@ +2ndkauboy +Akeda Bagus +Alex Mills +Anant Shrivastava +Andreas Heigl +andreascreten +Andrew Patton +andyexeter +BA +bartaakos +bendoh +Bernhard Kau +Bobby Walters +BoiteAWeb +boonebgorges +Borek Bernard +borekb +Brad Parbs +Brandon Kraft +Brian MacKinney +builtbylane +c10b10 +c10b10 +Chris Montgomery +clemens-tolboom +conatus +Corey Worrell +ctayloroomphinc +cyberhobo +daithi-coombes +dangardner +Daniel Bachhuber +danielbachhuber +danielbachhuber +danielbachhuber +Dave Leach +dd32 +dlh01 +drrobotnik +Duncan Brown +dwightjack +Eduardo Alencar +eliorivero +Enrico Sorcinelli +ericandrewlewis +ericmann +ernilambar +erwanlr +eugeneware +Evan Mattson +Fabian Isele +francescolaffi +Frank Staude +Frankie Jarrett +future500 +Gary Jones +Geo +getsource +Gilbert Pellegrom +glebis +goldenapples +goldenapples +Grant McInnes +Greg Anderson +hideokamoto +Hidetaka Okamoto +hina +hinoue-work +Hiroshi Urabe +Ian Dunn +itsananderson +j3lamp +jacobischwartz +Jakub Juszczak +Jan Voráček +Japh +Jeff Gould +jeichorn +Jeremy Pry +jghazally +jghazally +Jim Reevior +jmslbam +John Blackbourn +johnbillion +johnpbloch +johnpbloch +jonathanbardo +Jorge A. Torres +Josh Eaton +joshbetz +joshlevinson +joshstoik1 +Joshua Priddle +JQ +jtsternberg +KDoole +Keanan Koppenhaver +Keith Grennan +Kevin Doole +Kevinlearynet +kidfiction +lackingpenguin +leewillis77 +lkwdwrd +Marc Addeo +Marco +marcoceppi +Mark Jaquith +Mark Kimsal +Mark McEver +matiskay +mattes +mattheu +MattiaG +mbovel +mboynes +mgburns +mgburns +Mihail Minkov +Mike Pretzlaw +mikey dubs +milesj +MiteshShah +miya0001 +Morgan Estes +mpeshev +mwilliamson +mwilliamson +mwithheld +nacin +Nate Wright +navitronic +nb +Ned Zimmerman +nickdaugherty +nikhilc@bsf.io +nikolay +nikolay +Nilambar Sharma +Nilambar Sharma +nschoenholtz +nullvariable +nyordanov +ocean90 +oknoway +om4james +om4james +oneumyvakin +Otto Kekäläinen +ozh +Patrick Karjala +Pete Nelson +pete@petenelson.com +Peter J. Herrel +phh +Pippin Williamson +QWp6t +Rachel Baker +Radu Dan +Rahul Prajapati +Rarst +robertboloc +Robin Schneider +rodrigoprimo +rodrigoprimo +Roel Veldhuizen +roelveldhuizen +roelven +Ross Hattori +Ryan Hoover +Ryan McCue +Ryan Williams +ryanduff +santagada +sboisvert +scribu +scribu +sebastiaandegeus +Shinichi Nishikawa +sibprogrammer +simonwheatley +smhmic +soulou +spacedmonkey +SpikesDivZero +spuriousdata +Stephen Beemsterboer +Stephen Edgar +Stephen Harris +Stephen Harris +Stephen Harris +Steve Grunwell +Steve Grunwell +Steve Grunwell +Steve Persch +Steven K Word +stianlik +Stéphane HULARD +svaj +Svetoslav Marinov (Slavi) +szepeviktor +taupecat +tddewey +thisislawatts +tiagohillebrandt +tlovett1 +tolgap +tollmanz +tollmanz +toszcze +tott +Travis Northcutt +trepmal +Tristan Penman +twisty +twratajczak +Utkarsh Patel +Veered +veganista +Ville Vuorenmaa +voldemortensen +Wendell Júnior +Wes Moberly +Wes Moberly +westonruter +westonruter +William Turrell +willmot +wojsmol +wopr42 +yivi +yivi +ziz diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..ad37613da --- /dev/null +++ b/.travis.yml @@ -0,0 +1,69 @@ +sudo: false +dist: trusty + +language: php +php: 7.1 + +env: + global: + - WP_CLI_BIN_DIR=/tmp/wp-cli-phar + +before_script: + - export PATH="$HOME/.composer/vendor/bin:$PATH" + - ./ci/prepare.sh + +jobs: + include: + - stage: sniff + script: ./ci/sniff.sh + env: BUILD=sniff + - stage: test + script: ./ci/test.sh + php: 7.2 + env: WP_VERSION=latest + - stage: test + script: ./ci/test.sh + php: 7.1 + env: WP_VERSION=latest + - stage: test + script: ./ci/test.sh + php: 7.0 + env: WP_VERSION=latest + - stage: test + script: ./ci/test.sh + php: 5.6 + env: WP_VERSION=latest + - stage: test + script: ./ci/test.sh + php: 5.6 + env: WP_VERSION=trunk + - stage: test + script: ./ci/test.sh + php: 5.6 + env: WP_VERSION=latest BUILD=git WP_CLI_BIN_DIR='' + - stage: test + script: ./ci/test.sh + php: 5.6 + env: WP_VERSION=3.7.11 + - stage: test + script: ./ci/test.sh + php: 5.3 + dist: precise + env: WP_VERSION=3.7.11 + - stage: deploy + env: DEPLOY_BRANCH=master + script: ./ci/deploy.sh + +cache: + directories: + - $HOME/.composer/cache + +branches: + only: + - master + - /^release-.+$/ + +notifications: + email: + on_success: never + on_failure: change diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..f340617cb --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,10 @@ +Contributing +============ + +Welcome and thanks! + +We appreciate you taking the initiative to contribute to WP-CLI. It’s because of you, and the community around you, that WP-CLI is such a great project. + +**Contributing isn’t limited to just code.** We encourage you to contribute in the way that best fits your abilities, by writing tutorials, giving a demo at your local meetup, helping other users with their support questions, or revising our documentation. + +Read through our [contributing guidelines in the handbook](https://make.wordpress.org/cli/handbook/contributing/) for a thorough introduction to how you can get involved. Following these guidelines helps to communicate that you respect the time of other contributors on the project. In turn, they’ll do their best to reciprocate that respect when working with you, across timezones and around the world. diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..e56e9341d --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (C) 2011-2017 WP-CLI Development Group (https://github.com/wp-cli/wp-cli/contributors) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 000000000..190592ef2 --- /dev/null +++ b/README.md @@ -0,0 +1,200 @@ +WP-CLI +====== + +[WP-CLI](https://wp-cli.org/) is the command-line interface for [WordPress](https://wordpress.org/). You can update plugins, configure multisite installs and much more, without using a web browser. + +Ongoing maintenance is made possible by: + + + +The current stable release is [version 1.5.0](https://make.wordpress.org/cli/2018/01/31/version-1-5-0-released/). For announcements, follow [@wpcli on Twitter](https://twitter.com/wpcli) or [sign up for email updates](https://make.wordpress.org/cli/subscribe/). [Check out the roadmap](https://make.wordpress.org/cli/handbook/roadmap/) for an overview of what's planned for upcoming releases. + +[![Build Status](https://travis-ci.org/wp-cli/wp-cli.svg?branch=master)](https://travis-ci.org/wp-cli/wp-cli) [![Dependency Status](https://gemnasium.com/badges/github.com/wp-cli/wp-cli.svg)](https://gemnasium.com/github.com/wp-cli/wp-cli) [![Average time to resolve an issue](https://isitmaintained.com/badge/resolution/wp-cli/wp-cli.svg)](https://isitmaintained.com/project/wp-cli/wp-cli "Average time to resolve an issue") [![Percentage of issues still open](https://isitmaintained.com/badge/open/wp-cli/wp-cli.svg)](https://isitmaintained.com/project/wp-cli/wp-cli "Percentage of issues still open") + +Quick links: [Using](#using) | [Installing](#installing) | [Support](#support) | [Extending](#extending) | [Contributing](#contributing) | [Credits](#credits) + +## Using + +WP-CLI provides a command-line interface for many actions you might perform in the WordPress admin. For instance, `wp plugin install --activate` ([doc](https://developer.wordpress.org/cli/commands/plugin/install/)) lets you install and activate a WordPress plugin: + +```bash +$ wp plugin install user-switching --activate +Installing User Switching (1.0.9) +Downloading install package from https://downloads.wordpress.org/plugin/user-switching.1.0.9.zip... +Unpacking the package... +Installing the plugin... +Plugin installed successfully. +Activating 'user-switching'... +Plugin 'user-switching' activated. +Success: Installed 1 of 1 plugins. +``` + +WP-CLI also includes commands for many things you can't do in the WordPress admin. For example, `wp transient delete --all` ([doc](https://developer.wordpress.org/cli/commands/transient/delete/)) lets you delete one or all transients: + +```bash +$ wp transient delete --all +Success: 34 transients deleted from the database. +``` + +For a more complete introduction to using WP-CLI, read the [Quick Start guide](https://make.wordpress.org/cli/handbook/quick-start/). Or, catch up with [shell friends](https://make.wordpress.org/cli/handbook/shell-friends/) to learn about helpful command line utilities. + +Already feel comfortable with the basics? Jump into the [complete list of commands](https://developer.wordpress.org/cli/commands/) for detailed information on managing themes and plugins, importing and exporting data, performing database search-replace operations and more. + +## Installing + +Downloading the Phar file is our recommended installation method for most users. Should you need, see also our documentation on [alternative installation methods](https://make.wordpress.org/cli/handbook/installing/). + +Before installing WP-CLI, please make sure your environment meets the minimum requirements: + +- UNIX-like environment (OS X, Linux, FreeBSD, Cygwin); limited support in Windows environment +- PHP 5.3.29 or later +- WordPress 3.7 or later. Versions older than the latest WordPress release may have degraded functionality + +Once you've verified requirements, download the [wp-cli.phar](https://raw.github.com/wp-cli/builds/gh-pages/phar/wp-cli.phar) file using `wget` or `curl`: + +```bash +curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar +``` + +Next, check the Phar file to verify that it's working: + +```bash +php wp-cli.phar --info +``` + +To use WP-CLI from the command line by typing `wp`, make the file executable and move it to somewhere in your PATH. For example: + +```bash +chmod +x wp-cli.phar +sudo mv wp-cli.phar /usr/local/bin/wp +``` + +If WP-CLI was installed successfully, you should see something like this when you run `wp --info`: + +```bash +$ wp --info +OS: Darwin 16.7.0 Darwin Kernel Version 16.7.0: Thu Jan 11 22:59:40 PST 2018; root:xnu-3789.73.8~1/RELEASE_X86_64 x86_64 +Shell: /bin/zsh +PHP binary: /usr/local/bin/php +PHP version: 7.0.22 +php.ini used: /etc/local/etc/php/7.0/php.ini +WP-CLI root dir: /home/wp-cli/.wp-cli +WP-CLI vendor dir: /home/wp-cli/.wp-cli/vendor +WP-CLI packages dir: /home/wp-cli/.wp-cli/packages/ +WP-CLI global config: /home/wp-cli/.wp-cli/config.yml +WP-CLI project config: +WP-CLI version: 1.5.0 +``` + +### Updating + +You can update WP-CLI with `wp cli update` ([doc](https://developer.wordpress.org/cli/commands/cli/update/)), or by repeating the installation steps. + +If WP-CLI is owned by root or another system user, you'll need to run `sudo wp cli update`. + +Want to live life on the edge? Run `wp cli update --nightly` to use the latest nightly build of WP-CLI. The nightly build is more or less stable enough for you to use in your development environment, and always includes the latest and greatest WP-CLI features. + +### Tab completions + +WP-CLI also comes with a tab completion script for Bash and ZSH. Just download [wp-completion.bash](https://raw.githubusercontent.com/wp-cli/wp-cli/master/utils/wp-completion.bash) and source it from `~/.bash_profile`: + +```bash +source /FULL/PATH/TO/wp-completion.bash +``` + +Don't forget to run `source ~/.bash_profile` afterwards. + +If using zsh for your shell, you may need to load and start `bashcompinit` before sourcing. Put the following in your `.zshrc`: + +```bash +autoload bashcompinit +bashcompinit +source /FULL/PATH/TO/wp-completion.bash +``` + +## Support + +WP-CLI's maintainers and contributors have limited availability to address general support questions. The [current version of WP-CLI](https://make.wordpress.org/cli/handbook/roadmap/) is the only officially supported version. + +When looking for support, please first search for your question in these venues: + +* [Common issues and their fixes](https://make.wordpress.org/cli/handbook/common-issues/) +* [WP-CLI handbook](https://make.wordpress.org/cli/handbook/) +* [Open or closed issues in the WP-CLI GitHub organization](https://github.com/issues?utf8=%E2%9C%93&q=sort%3Aupdated-desc+org%3Awp-cli+is%3Aissue) +* [Threads tagged 'WP-CLI' in the WordPress.org support forum](https://wordpress.org/support/topic-tag/wp-cli/) +* [Questions tagged 'WP-CLI' in the WordPress StackExchange](https://wordpress.stackexchange.com/questions/tagged/wp-cli) + +If you didn't find an answer in one of the venues above, you can: + +* Join the `#cli` channel in the [WordPress.org Slack](https://make.wordpress.org/chat/) to chat with whomever might be available at the time. This option is best for quick questions. +* [Post a new thread](https://wordpress.org/support/forum/wp-advanced/#new-post) in the WordPress.org support forum and tag it 'WP-CLI' so it's seen by the community. + +GitHub issues are meant for tracking enhancements to and bugs of existing commands, not general support. Before submitting a bug report, please [review our best practices](https://make.wordpress.org/cli/handbook/bug-reports/) to help ensure your issue is addressed in a timely manner. + +Please do not ask support questions on Twitter. Twitter isn't an acceptable venue for support because: 1) it's hard to hold conversations in under 140 characters, and 2) Twitter isn't a place where someone with your same question can search for an answer in a prior conversation. + +Remember, libre != gratis; the open source license grants you the freedom to use and modify, but not commitments of other people's time. Please be respectful, and set your expectations accordingly. + +## Extending + +A **command** is the atomic unit of WP-CLI functionality. `wp plugin install` ([doc](https://developer.wordpress.org/cli/commands/plugin/install/)) is one command. `wp plugin activate` ([doc](https://developer.wordpress.org/cli/commands/plugin/activate/)) is another. + +WP-CLI supports registering any callable class, function, or closure as a command. It reads usage details from the callback's PHPdoc. `WP_CLI::add_command()` ([doc](https://make.wordpress.org/cli/handbook/internal-api/wp-cli-add-command/)) is used for both internal and third-party command registration. + +```php +/** + * Delete an option from the database. + * + * Returns an error if the option didn't exist. + * + * ## OPTIONS + * + * + * : Key for the option. + * + * ## EXAMPLES + * + * $ wp option delete my_option + * Success: Deleted 'my_option' option. + */ +$delete_option_cmd = function( $args ) { + list( $key ) = $args; + + if ( ! delete_option( $key ) ) { + WP_CLI::error( "Could not delete '$key' option. Does it exist?" ); + } else { + WP_CLI::success( "Deleted '$key' option." ); + } +}; +WP_CLI::add_command( 'option delete', $delete_option_cmd ); +``` + +WP-CLI comes with dozens of commands. It's easier than it looks to create a custom WP-CLI command. Read the [commands cookbook](https://make.wordpress.org/cli/handbook/commands-cookbook/) to learn more. Browse the [internal API docs](https://make.wordpress.org/cli/handbook/internal-api/) to discover a variety of helpful functions you can use in your custom WP-CLI command. + +## Contributing + +We appreciate you taking the initiative to contribute to WP-CLI. It’s because of you, and the community around you, that WP-CLI is such a great project. + +**Contributing isn’t limited to just code.** We encourage you to contribute in the way that best fits your abilities, by writing tutorials, giving a demo at your local meetup, helping other users with their support questions, or revising our documentation. + +Read through our [contributing guidelines in the handbook](https://make.wordpress.org/cli/handbook/contributing/) for a thorough introduction to how you can get involved. Following these guidelines helps to communicate that you respect the time of other contributors on the project. In turn, they’ll do their best to reciprocate that respect when working with you, across timezones and around the world. + +## Leadership + +WP-CLI has two project maintainers: [danielbachhuber](https://github.com/danielbachhuber) and [schlessera](http://github.com/schlessera). + +On occasion, we [grant write access to contributors](https://make.wordpress.org/cli/handbook/committers-credo/) who have demonstrated, over a period of time, that they are capable and invested in moving the project forward. + +Read the [governance document in the handbook](https://make.wordpress.org/cli/handbook/governance/) for more operational details about the project. + +## Credits + +Besides the libraries defined in [composer.json](composer.json), we have used code or ideas from the following projects: + +* [Drush](https://github.com/drush-ops/drush) for... a lot of things +* [wpshell](https://code.trac.wordpress.org/browser/wpshell) for `wp shell` +* [Regenerate Thumbnails](https://wordpress.org/plugins/regenerate-thumbnails/) for `wp media regenerate` +* [Search-Replace-DB](https://github.com/interconnectit/Search-Replace-DB) for `wp search-replace` +* [WordPress-CLI-Exporter](https://github.com/Automattic/WordPress-CLI-Exporter) for `wp export` +* [WordPress-CLI-Importer](https://github.com/Automattic/WordPress-CLI-Importer) for `wp import` +* [wordpress-plugin-tests](https://github.com/benbalter/wordpress-plugin-tests/) for `wp scaffold plugin-tests` diff --git a/VERSION b/VERSION new file mode 100644 index 000000000..fbffcdf95 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +2.0.0-alpha diff --git a/bin/wp b/bin/wp new file mode 100755 index 000000000..053e24227 --- /dev/null +++ b/bin/wp @@ -0,0 +1,45 @@ +#!/usr/bin/env sh +# +# This wrapper script has been adapted from the equivalent drush wrapper +# and 99.9% of all credit should go to the authors of that project: +# http://drupal.org/project/drush +# And 0.09% to the author of this project: +# https://github.com/88mph/wpadmin/blob/master/wpadmin.php + +# Get the absolute path of this executable +ORIGDIR="$(pwd)" +SELF_PATH="$(cd -P -- "$(dirname -- "$0")" && pwd -P)" && SELF_PATH="$SELF_PATH/$(basename -- "$0")" + +# Resolve symlinks - this is the equivalent of "readlink -f", but also works with non-standard OS X readlink. +while [ -h "$SELF_PATH" ]; do + # 1) cd to directory of the symlink + # 2) cd to the directory of where the symlink points + # 3) Get the pwd + # 4) Append the basename + DIR="$(dirname -- "$SELF_PATH")" + SYM="$(readlink "$SELF_PATH")" + SELF_PATH="$(cd "$DIR" && cd "$(dirname -- "$SYM")" && pwd)/$(basename -- "$SYM")" +done +cd "$ORIGDIR" + +if [ ! -z "$WP_CLI_PHP" ] ; then + # Use the WP_CLI_PHP environment variable if it is available. + php="$WP_CLI_PHP" +else + # Default to using the php that we find on the PATH. + # Note that we need the full path to php here for Dreamhost, which behaves oddly. See http://drupal.org/node/662926 + php="`which php`" +fi + +# Build the path to the root PHP file +SCRIPT_PATH="$(dirname "$SELF_PATH")/../php/boot-fs.php" +case $("$php" -r "echo PHP_OS;") in + WINNT*) + SCRIPT_PATH="$(cygpath -w -a -- "$SCRIPT_PATH")" ;; +esac + +# Pass in the path to php so that wp-cli knows which one +# to use if it re-launches itself to run other commands. +export WP_CLI_PHP_USED="$php" + +exec "$php" $WP_CLI_PHP_ARGS "$SCRIPT_PATH" "$@" diff --git a/bin/wp.bat b/bin/wp.bat new file mode 100755 index 000000000..59f953440 --- /dev/null +++ b/bin/wp.bat @@ -0,0 +1,2 @@ +@ECHO OFF +php "%~dp0../php/boot-fs.php" %* \ No newline at end of file diff --git a/ci/behat-tags.php b/ci/behat-tags.php new file mode 100644 index 000000000..f65fb7d75 --- /dev/null +++ b/ci/behat-tags.php @@ -0,0 +1,85 @@ +=' ) + ); +} else { + // But make sure @less-than-wp tags always exist for those special cases. (Note: @less-than-wp-latest etc won't work and shouldn't be used). + $wp_version_reqs = array_merge( $wp_version_reqs, version_tags( 'less-than-wp', '9999', '>=' ) ); +} + +$skip_tags = array_merge( + $wp_version_reqs, + version_tags( 'require-php', PHP_VERSION, '<' ), + version_tags( 'less-than-php', PHP_VERSION, '>=' ) // Note: this was '>' prior to WP-CLI 1.5.0 but the change is unlikely to cause BC issues as usually compared against major.minor only. +); + +# Skip Github API tests if `GITHUB_TOKEN` not available because of rate limiting. See https://github.com/wp-cli/wp-cli/issues/1612 +if ( ! getenv( 'GITHUB_TOKEN' ) ) { + $skip_tags[] = '@github-api'; +} + +# Skip tests known to be broken. +$skip_tags[] = '@broken'; + +# Require PHP extension, eg 'imagick'. +function extension_tags() { + $extension_tags = array(); + exec( "grep '@require-extension-[A-Za-z_]*' -h -o features/*.feature | uniq", $extension_tags ); + + $skip_tags = array(); + + $substr_start = strlen( '@require-extension-' ); + foreach ( $extension_tags as $tag ) { + $extension = substr( $tag, $substr_start ); + if ( ! extension_loaded( $extension ) ) { + $skip_tags[] = $tag; + } + } + + return $skip_tags; +} + +$skip_tags = array_merge( $skip_tags, extension_tags() ); + +if ( !empty( $skip_tags ) ) { + echo '--tags=~' . implode( '&&~', $skip_tags ); +} + diff --git a/ci/deploy.sh b/ci/deploy.sh new file mode 100755 index 000000000..c1a785543 --- /dev/null +++ b/ci/deploy.sh @@ -0,0 +1,56 @@ +#!/bin/bash + +# called by Travis CI + +if [[ "false" != "$TRAVIS_PULL_REQUEST" ]]; then + echo "Not deploying pull requests." + exit +fi + +if [ -z $DEPLOY_BRANCH ]; then + echo "Skipping deployment as DEPLOY_BRANCH is not set" + exit +fi + +if [[ "$TRAVIS_BRANCH" != "$DEPLOY_BRANCH" ]] && [[ ! "$TRAVIS_BRANCH" == "release-"* ]]; then + echo "Skipping deployment as '$TRAVIS_BRANCH' is not a deploy branch." + exit +fi + +# Turn off command traces while dealing with the private key +set +x + +# Get the encrypted private key from the repo settings +echo $WP_CLI_REPO_DEPLOY_KEY | base64 --decode > ~/.ssh/id_rsa +chmod 600 ~/.ssh/id_rsa + +# anyone can read the build log, so it MUST NOT contain any sensitive data +set -x + +# add github's public key +echo "|1|qPmmP7LVZ7Qbpk7AylmkfR0FApQ=|WUy1WS3F4qcr3R5Sc728778goPw= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==" >> ~/.ssh/known_hosts + +git clone git@github.com:wp-cli/builds.git +mv PHAR_BUILD_VERSION builds/phar/NIGHTLY_VERSION +cd builds + +git config user.name "Travis CI" +git config user.email "travis@travis-ci.org" +git config push.default "current" + +if [[ "$TRAVIS_BRANCH" == "release-"* ]]; then + fname="phar/wp-cli-release.phar" +else + fname="phar/wp-cli-nightly.phar" +fi + +mv /tmp/wp-cli-phar/wp $fname +chmod -x $fname + +md5sum $fname | cut -d ' ' -f 1 > $fname.md5 +sha512sum $fname | cut -d ' ' -f 1 > $fname.sha512 + +git add $fname $fname.md5 $fname.sha512 phar/NIGHTLY_VERSION +git commit -m "phar build: $TRAVIS_REPO_SLUG@$TRAVIS_COMMIT" + +git push diff --git a/ci/prepare.sh b/ci/prepare.sh new file mode 100755 index 000000000..650100d8f --- /dev/null +++ b/ci/prepare.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +# called by Travis CI + +set -ex + +WP_CLI_BIN_DIR=${WP_CLI_BIN_DIR-/tmp/wp-cli-phar} + +# Disable XDebug to speed up Composer and test suites. +if [ -f ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini ]; then + phpenv config-rm xdebug.ini +else + echo "xdebug.ini does not exist" +fi + +composer install --no-interaction --prefer-source + +CLI_VERSION=$(head -n 1 VERSION) +if [[ $CLI_VERSION == *"-alpha"* ]] +then + GIT_HASH=$(git rev-parse HEAD) + GIT_SHORT_HASH=${GIT_HASH:0:7} + CLI_VERSION="$CLI_VERSION-$GIT_SHORT_HASH" +fi + +# the Behat test suite will pick up the executable found in $WP_CLI_BIN_DIR +if [[ $BUILD == 'git' || $BUILD == 'sniff' ]] +then + echo $CLI_VERSION > VERSION +else + mkdir -p $WP_CLI_BIN_DIR + php -dphar.readonly=0 utils/make-phar.php wp-cli.phar --quiet --version=$CLI_VERSION + mv wp-cli.phar $WP_CLI_BIN_DIR/wp + chmod +x $WP_CLI_BIN_DIR/wp +fi + +echo $CLI_VERSION > PHAR_BUILD_VERSION + +mysql -e 'CREATE DATABASE wp_cli_test;' -uroot +mysql -e 'GRANT ALL PRIVILEGES ON wp_cli_test.* TO "wp_cli_test"@"localhost" IDENTIFIED BY "password1"' -uroot diff --git a/ci/sniff.sh b/ci/sniff.sh new file mode 100755 index 000000000..2c0ec7720 --- /dev/null +++ b/ci/sniff.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +set -ex + +# Run CodeSniffer +vendor/bin/phpcs diff --git a/ci/test.sh b/ci/test.sh new file mode 100755 index 000000000..a1aba1863 --- /dev/null +++ b/ci/test.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +set -ex + +# Run the unit tests +phpunit + +BEHAT_TAGS=$(php ci/behat-tags.php) + +# Run the functional tests +vendor/bin/behat --format progress $BEHAT_TAGS --strict diff --git a/composer.json b/composer.json new file mode 100644 index 000000000..0949d2b78 --- /dev/null +++ b/composer.json @@ -0,0 +1,94 @@ +{ + "name": "wp-cli/wp-cli", + "description": "The command line interface for WordPress", + "keywords": [ "cli", "wordpress" ], + "homepage": "https://wp-cli.org", + "license": "MIT", + "support": { + "issues": "https://github.com/wp-cli/wp-cli/issues", + "source": "https://github.com/wp-cli/wp-cli", + "docs": "https://make.wordpress.org/cli/handbook/" + }, + "bin": [ + "bin/wp.bat", "bin/wp" + ], + "config": { + "platform": { + "php": "5.3.29" + }, + "sort-packages": true + }, + "minimum-stability": "dev", + "prefer-stable": true, + "require": { + "php": ">=5.3.29", + "composer/composer": "^1.2.0", + "composer/semver": "~1.0", + "justinrainbow/json-schema": "~5.2.5", + "mustache/mustache": "~2.4", + "ramsey/array_column": "~1.1", + "rmccue/requests": "~1.6", + "symfony/config": "^2.7|^3.0", + "symfony/console": "^2.7|^3.0", + "symfony/debug": "^2.7|^3.0", + "symfony/dependency-injection": "^2.7|^3.0", + "symfony/event-dispatcher": "^2.7|^3.0", + "symfony/filesystem": "^2.7|^3.0", + "symfony/finder": "^2.7|^3.0", + "symfony/process": "^2.1|^3.0", + "symfony/translation": "^2.7|^3.0", + "symfony/yaml": "^2.7|^3.0", + "wp-cli/autoload-splitter": "^0.1.5", + "wp-cli/cache-command": "^1.0", + "wp-cli/checksum-command": "^1.0", + "wp-cli/config-command": "^1.0", + "wp-cli/core-command": "^1.0", + "wp-cli/cron-command": "^1.0", + "wp-cli/db-command": "^1.0", + "wp-cli/embed-command": "^1.0", + "wp-cli/entity-command": "^1.0", + "wp-cli/eval-command": "^1.0", + "wp-cli/export-command": "^1.0", + "wp-cli/extension-command": "^1.0", + "wp-cli/import-command": "^1.0", + "wp-cli/language-command": "^1.0", + "wp-cli/media-command": "^1.0", + "wp-cli/mustangostang-spyc": "^0.6.3", + "wp-cli/package-command": "^1.0", + "wp-cli/php-cli-tools": "~0.11.2", + "wp-cli/rewrite-command": "^1.0", + "wp-cli/role-command": "^1.0", + "wp-cli/scaffold-command": "^1.0", + "wp-cli/search-replace-command": "^1.0", + "wp-cli/server-command": "^1.0", + "wp-cli/shell-command": "^1.0", + "wp-cli/super-admin-command": "^1.0", + "wp-cli/widget-command": "^1.0" + }, + "require-dev": { + "behat/behat": "2.5.*", + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3", + "phpunit/phpunit": "3.7.*", + "roave/security-advisories": "dev-master", + "wimg/php-compatibility": "^8.0", + "wp-coding-standards/wpcs": "^0.13.1" + }, + "suggest": { + "psy/psysh": "Enhanced `wp shell` functionality" + }, + "autoload": { + "psr-0": { "WP_CLI": "php" }, + "psr-4": { "": "php/commands/src" } + }, + "extra": { + "branch-alias": { + "dev-master": "1.5.x-dev" + }, + "autoload-splitter": { + "splitter-logic": "WP_CLI\\AutoloadSplitter", + "splitter-location": "php/WP_CLI/AutoloadSplitter.php", + "split-target-prefix-true": "autoload_commands", + "split-target-prefix-false": "autoload_framework" + } + } +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 000000000..96e350934 --- /dev/null +++ b/composer.lock @@ -0,0 +1,3870 @@ +{ + "_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#composer-lock-the-lock-file", + "This file is @generated automatically" + ], + "content-hash": "36f8e11f5ba78726579607300deee9a7", + "packages": [ + { + "name": "composer/ca-bundle", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/composer/ca-bundle.git", + "reference": "943b2c4fcad1ef178d16a713c2468bf7e579c288" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/943b2c4fcad1ef178d16a713c2468bf7e579c288", + "reference": "943b2c4fcad1ef178d16a713c2468bf7e579c288", + "shasum": "" + }, + "require": { + "ext-openssl": "*", + "ext-pcre": "*", + "php": "^5.3.2 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35", + "psr/log": "^1.0", + "symfony/process": "^2.5 || ^3.0 || ^4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\CaBundle\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", + "keywords": [ + "cabundle", + "cacert", + "certificate", + "ssl", + "tls" + ], + "time": "2017-11-29T09:37:33+00:00" + }, + { + "name": "composer/composer", + "version": "1.5.6", + "source": { + "type": "git", + "url": "https://github.com/composer/composer.git", + "reference": "4f7f9c12753ec43f1e4629e2a71cabe81f2a4eab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/composer/zipball/4f7f9c12753ec43f1e4629e2a71cabe81f2a4eab", + "reference": "4f7f9c12753ec43f1e4629e2a71cabe81f2a4eab", + "shasum": "" + }, + "require": { + "composer/ca-bundle": "^1.0", + "composer/semver": "^1.0", + "composer/spdx-licenses": "^1.0", + "justinrainbow/json-schema": "^3.0 || ^4.0 || ^5.0", + "php": "^5.3.2 || ^7.0", + "psr/log": "^1.0", + "seld/cli-prompt": "^1.0", + "seld/jsonlint": "^1.4", + "seld/phar-utils": "^1.0", + "symfony/console": "^2.7 || ^3.0", + "symfony/filesystem": "^2.7 || ^3.0", + "symfony/finder": "^2.7 || ^3.0", + "symfony/process": "^2.7 || ^3.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.5 || ^5.0.5", + "phpunit/phpunit-mock-objects": "^2.3 || ^3.0" + }, + "suggest": { + "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages", + "ext-zip": "Enabling the zip extension allows you to unzip archives", + "ext-zlib": "Allow gzip compression of HTTP requests" + }, + "bin": [ + "bin/composer" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.5-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\": "src/Composer" + } + }, + "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" + } + ], + "description": "Composer helps you declare, manage and install dependencies of PHP projects, ensuring you have the right stack everywhere.", + "homepage": "https://getcomposer.org/", + "keywords": [ + "autoload", + "dependency", + "package" + ], + "time": "2017-12-18T11:09:18+00:00" + }, + { + "name": "composer/semver", + "version": "1.4.2", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/c7cb9a2095a074d131b65a8a0cd294479d785573", + "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.5 || ^5.0.5", + "phpunit/phpunit-mock-objects": "2.3.0 || ^3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.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" + ], + "time": "2016-08-30T16:08:34+00:00" + }, + { + "name": "composer/spdx-licenses", + "version": "1.1.6", + "source": { + "type": "git", + "url": "https://github.com/composer/spdx-licenses.git", + "reference": "2603a0d7ddc00a015deb576fa5297ca43dee6b1c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/2603a0d7ddc00a015deb576fa5297ca43dee6b1c", + "reference": "2603a0d7ddc00a015deb576fa5297ca43dee6b1c", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.5 || ^5.0.5", + "phpunit/phpunit-mock-objects": "2.3.0 || ^3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Spdx\\": "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": "SPDX licenses list and validation library.", + "keywords": [ + "license", + "spdx", + "validator" + ], + "time": "2017-04-03T19:08:52+00:00" + }, + { + "name": "justinrainbow/json-schema", + "version": "5.2.6", + "source": { + "type": "git", + "url": "https://github.com/justinrainbow/json-schema.git", + "reference": "d283e11b6e14c6f4664cf080415c4341293e5bbd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/d283e11b6e14c6f4664cf080415c4341293e5bbd", + "reference": "d283e11b6e14c6f4664cf080415c4341293e5bbd", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.1", + "json-schema/json-schema-test-suite": "1.2.0", + "phpunit/phpunit": "^4.8.22" + }, + "bin": [ + "bin/validate-json" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "JsonSchema\\": "src/JsonSchema/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bruno Prieto Reis", + "email": "bruno.p.reis@gmail.com" + }, + { + "name": "Justin Rainbow", + "email": "justin.rainbow@gmail.com" + }, + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + }, + { + "name": "Robert Schönthal", + "email": "seroscho@googlemail.com" + } + ], + "description": "A library to validate a json schema.", + "homepage": "https://github.com/justinrainbow/json-schema", + "keywords": [ + "json", + "schema" + ], + "time": "2017-10-21T13:15:38+00:00" + }, + { + "name": "mustache/mustache", + "version": "v2.12.0", + "source": { + "type": "git", + "url": "https://github.com/bobthecow/mustache.php.git", + "reference": "fe8fe72e9d580591854de404cc59a1b83ca4d19e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/bobthecow/mustache.php/zipball/fe8fe72e9d580591854de404cc59a1b83ca4d19e", + "reference": "fe8fe72e9d580591854de404cc59a1b83ca4d19e", + "shasum": "" + }, + "require": { + "php": ">=5.2.4" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "~1.11", + "phpunit/phpunit": "~3.7|~4.0|~5.0" + }, + "type": "library", + "autoload": { + "psr-0": { + "Mustache": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Justin Hileman", + "email": "justin@justinhileman.info", + "homepage": "http://justinhileman.com" + } + ], + "description": "A Mustache implementation in PHP.", + "homepage": "https://github.com/bobthecow/mustache.php", + "keywords": [ + "mustache", + "templating" + ], + "time": "2017-07-11T12:54:05+00:00" + }, + { + "name": "nb/oxymel", + "version": "v0.1.0", + "source": { + "type": "git", + "url": "https://github.com/nb/oxymel.git", + "reference": "cbe626ef55d5c4cc9b5e6e3904b395861ea76e3c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nb/oxymel/zipball/cbe626ef55d5c4cc9b5e6e3904b395861ea76e3c", + "reference": "cbe626ef55d5c4cc9b5e6e3904b395861ea76e3c", + "shasum": "" + }, + "require": { + "php": ">=5.2.4" + }, + "type": "library", + "autoload": { + "psr-0": { + "Oxymel": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nikolay Bachiyski", + "email": "nb@nikolay.bg", + "homepage": "http://extrapolate.me/" + } + ], + "description": "A sweet XML builder", + "homepage": "https://github.com/nb/oxymel", + "keywords": [ + "xml" + ], + "time": "2013-02-24T15:01:54+00:00" + }, + { + "name": "psr/log", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2016-10-10T12:19:37+00:00" + }, + { + "name": "ramsey/array_column", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/ramsey/array_column.git", + "reference": "f8e52eb28e67eb50e613b451dd916abcf783c1db" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/array_column/zipball/f8e52eb28e67eb50e613b451dd916abcf783c1db", + "reference": "f8e52eb28e67eb50e613b451dd916abcf783c1db", + "shasum": "" + }, + "require-dev": { + "jakub-onderka/php-parallel-lint": "0.8.*", + "phpunit/phpunit": "~4.5", + "satooshi/php-coveralls": "0.6.*", + "squizlabs/php_codesniffer": "~2.2" + }, + "type": "library", + "autoload": { + "files": [ + "src/array_column.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ben Ramsey", + "homepage": "http://benramsey.com" + } + ], + "description": "Provides functionality for array_column() to projects using PHP earlier than version 5.5.", + "homepage": "https://github.com/ramsey/array_column", + "keywords": [ + "array", + "array_column", + "column" + ], + "time": "2015-03-20T22:07:39+00:00" + }, + { + "name": "rmccue/requests", + "version": "v1.7.0", + "source": { + "type": "git", + "url": "https://github.com/rmccue/Requests.git", + "reference": "87932f52ffad70504d93f04f15690cf16a089546" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/rmccue/Requests/zipball/87932f52ffad70504d93f04f15690cf16a089546", + "reference": "87932f52ffad70504d93f04f15690cf16a089546", + "shasum": "" + }, + "require": { + "php": ">=5.2" + }, + "require-dev": { + "requests/test-server": "dev-master" + }, + "type": "library", + "autoload": { + "psr-0": { + "Requests": "library/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "ISC" + ], + "authors": [ + { + "name": "Ryan McCue", + "homepage": "http://ryanmccue.info" + } + ], + "description": "A HTTP library written in PHP, for human beings.", + "homepage": "http://github.com/rmccue/Requests", + "keywords": [ + "curl", + "fsockopen", + "http", + "idna", + "ipv6", + "iri", + "sockets" + ], + "time": "2016-10-13T00:11:37+00:00" + }, + { + "name": "seld/cli-prompt", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/cli-prompt.git", + "reference": "a19a7376a4689d4d94cab66ab4f3c816019ba8dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/cli-prompt/zipball/a19a7376a4689d4d94cab66ab4f3c816019ba8dd", + "reference": "a19a7376a4689d4d94cab66ab4f3c816019ba8dd", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Seld\\CliPrompt\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be" + } + ], + "description": "Allows you to prompt for user input on the command line, and optionally hide the characters they type", + "keywords": [ + "cli", + "console", + "hidden", + "input", + "prompt" + ], + "time": "2017-03-18T11:32:45+00:00" + }, + { + "name": "seld/jsonlint", + "version": "1.6.2", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/jsonlint.git", + "reference": "7a30649c67ee0d19faacfd9fa2cfb6cc032d9b19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/7a30649c67ee0d19faacfd9fa2cfb6cc032d9b19", + "reference": "7a30649c67ee0d19faacfd9fa2cfb6cc032d9b19", + "shasum": "" + }, + "require": { + "php": "^5.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.5" + }, + "bin": [ + "bin/jsonlint" + ], + "type": "library", + "autoload": { + "psr-4": { + "Seld\\JsonLint\\": "src/Seld/JsonLint/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "JSON Linter", + "keywords": [ + "json", + "linter", + "parser", + "validator" + ], + "time": "2017-11-30T15:34:22+00:00" + }, + { + "name": "seld/phar-utils", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/phar-utils.git", + "reference": "7009b5139491975ef6486545a39f3e6dad5ac30a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/7009b5139491975ef6486545a39f3e6dad5ac30a", + "reference": "7009b5139491975ef6486545a39f3e6dad5ac30a", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Seld\\PharUtils\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be" + } + ], + "description": "PHAR file format utilities, for when PHP phars you up", + "keywords": [ + "phra" + ], + "time": "2015-10-13T18:44:15+00:00" + }, + { + "name": "symfony/config", + "version": "v2.8.32", + "source": { + "type": "git", + "url": "https://github.com/symfony/config.git", + "reference": "f4f3f1d7090c464434bbbc3e8aa2b41149c59196" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/config/zipball/f4f3f1d7090c464434bbbc3e8aa2b41149c59196", + "reference": "f4f3f1d7090c464434bbbc3e8aa2b41149c59196", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/filesystem": "~2.3|~3.0.0" + }, + "require-dev": { + "symfony/yaml": "~2.7|~3.0.0" + }, + "suggest": { + "symfony/yaml": "To use the yaml reference dumper" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Config\\": "" + }, + "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": "Symfony Config Component", + "homepage": "https://symfony.com", + "time": "2017-11-07T11:56:23+00:00" + }, + { + "name": "symfony/console", + "version": "v2.8.32", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "46270f1ca44f08ebc134ce120fd2c2baf5fd63de" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/46270f1ca44f08ebc134ce120fd2c2baf5fd63de", + "reference": "46270f1ca44f08ebc134ce120fd2c2baf5fd63de", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/debug": "^2.7.2|~3.0.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/event-dispatcher": "~2.1|~3.0.0", + "symfony/process": "~2.1|~3.0.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "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": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2017-11-29T09:33:18+00:00" + }, + { + "name": "symfony/debug", + "version": "v2.8.32", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "e72a0340dc2e273b3c4398d8eef9157ba51d8b95" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/e72a0340dc2e273b3c4398d8eef9157ba51d8b95", + "reference": "e72a0340dc2e273b3c4398d8eef9157ba51d8b95", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "psr/log": "~1.0" + }, + "conflict": { + "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + }, + "require-dev": { + "symfony/class-loader": "~2.2|~3.0.0", + "symfony/http-kernel": "~2.3.24|~2.5.9|^2.6.2|~3.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Debug\\": "" + }, + "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": "Symfony Debug Component", + "homepage": "https://symfony.com", + "time": "2017-11-19T19:05:05+00:00" + }, + { + "name": "symfony/dependency-injection", + "version": "v2.8.32", + "source": { + "type": "git", + "url": "https://github.com/symfony/dependency-injection.git", + "reference": "d3e81e5402c38500770eb5595d78a6d85ea9e412" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/d3e81e5402c38500770eb5595d78a6d85ea9e412", + "reference": "d3e81e5402c38500770eb5595d78a6d85ea9e412", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "conflict": { + "symfony/expression-language": "<2.6" + }, + "require-dev": { + "symfony/config": "~2.2|~3.0.0", + "symfony/expression-language": "~2.6|~3.0.0", + "symfony/yaml": "~2.3.42|~2.7.14|~2.8.7|~3.0.7" + }, + "suggest": { + "symfony/config": "", + "symfony/expression-language": "For using expressions in service container configuration", + "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", + "symfony/yaml": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\DependencyInjection\\": "" + }, + "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": "Symfony DependencyInjection Component", + "homepage": "https://symfony.com", + "time": "2017-11-23T11:13:33+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v2.8.32", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "b59aacf238fadda50d612c9de73b74751872a903" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b59aacf238fadda50d612c9de73b74751872a903", + "reference": "b59aacf238fadda50d612c9de73b74751872a903", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "^2.0.5|~3.0.0", + "symfony/dependency-injection": "~2.6|~3.0.0", + "symfony/expression-language": "~2.6|~3.0.0", + "symfony/stopwatch": "~2.3|~3.0.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "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": "Symfony EventDispatcher Component", + "homepage": "https://symfony.com", + "time": "2017-11-05T15:25:56+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v2.8.32", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "15ceb6736a9eebd0d99f9e05a62296ab6ce1cf2b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/15ceb6736a9eebd0d99f9e05a62296ab6ce1cf2b", + "reference": "15ceb6736a9eebd0d99f9e05a62296ab6ce1cf2b", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "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": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "time": "2017-11-19T18:39:05+00:00" + }, + { + "name": "symfony/finder", + "version": "v2.8.32", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "efeceae6a05a9b2fcb3391333f1d4a828ff44ab8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/efeceae6a05a9b2fcb3391333f1d4a828ff44ab8", + "reference": "efeceae6a05a9b2fcb3391333f1d4a828ff44ab8", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "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": "Symfony Finder Component", + "homepage": "https://symfony.com", + "time": "2017-11-05T15:25:56+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.6.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296", + "reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.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": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2017-10-11T12:05:26+00:00" + }, + { + "name": "symfony/process", + "version": "v2.8.32", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "d25449e031f600807949aab7cadbf267712f4eee" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/d25449e031f600807949aab7cadbf267712f4eee", + "reference": "d25449e031f600807949aab7cadbf267712f4eee", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "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": "Symfony Process Component", + "homepage": "https://symfony.com", + "time": "2017-11-05T15:25:56+00:00" + }, + { + "name": "symfony/translation", + "version": "v2.8.32", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation.git", + "reference": "0c63d56516c4c4c323228ca6348eadb7c91b1daf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation/zipball/0c63d56516c4c4c323228ca6348eadb7c91b1daf", + "reference": "0c63d56516c4c4c323228ca6348eadb7c91b1daf", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/config": "<2.7" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~2.8", + "symfony/intl": "~2.7.25|^2.8.18|~3.2.5", + "symfony/yaml": "~2.2|~3.0.0" + }, + "suggest": { + "psr/log": "To use logging capability in translator", + "symfony/config": "", + "symfony/yaml": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Translation\\": "" + }, + "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": "Symfony Translation Component", + "homepage": "https://symfony.com", + "time": "2017-11-07T14:08:47+00:00" + }, + { + "name": "symfony/yaml", + "version": "v2.8.32", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "968ef42161e4bc04200119da473077f9e7015128" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/968ef42161e4bc04200119da473077f9e7015128", + "reference": "968ef42161e4bc04200119da473077f9e7015128", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "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": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2017-11-29T09:33:18+00:00" + }, + { + "name": "wp-cli/autoload-splitter", + "version": "v0.1.5", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/autoload-splitter.git", + "reference": "fb4302da26390811d2631c62b42b75976d224bb8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/autoload-splitter/zipball/fb4302da26390811d2631c62b42b75976d224bb8", + "reference": "fb4302da26390811d2631c62b42b75976d224bb8", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.1" + }, + "type": "composer-plugin", + "extra": { + "class": "WP_CLI\\AutoloadSplitter\\ComposerPlugin" + }, + "autoload": { + "psr-4": { + "WP_CLI\\AutoloadSplitter\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Alain Schlesser", + "email": "alain.schlesser@gmail.com", + "homepage": "https://www.alainschlesser.com" + } + ], + "description": "Composer plugin for splitting a generated autoloader into two distinct parts.", + "homepage": "https://wp-cli.org", + "time": "2017-08-03T08:40:17+00:00" + }, + { + "name": "wp-cli/cache-command", + "version": "v1.0.6", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/cache-command.git", + "reference": "d82cba9effa198f17847dce5771c8fb20c443ffa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/cache-command/zipball/d82cba9effa198f17847dce5771c8fb20c443ffa", + "reference": "d82cba9effa198f17847dce5771c8fb20c443ffa", + "shasum": "" + }, + "require-dev": { + "behat/behat": "~2.5", + "wp-cli/wp-cli": "*" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "cache", + "cache add", + "cache decr", + "cache delete", + "cache flush", + "cache get", + "cache incr", + "cache replace", + "cache set", + "cache type", + "transient", + "transient delete", + "transient get", + "transient set", + "transient type" + ] + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "cache-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Bachhuber", + "email": "daniel@runcommand.io", + "homepage": "https://runcommand.io" + } + ], + "description": "Manages object and transient caches.", + "homepage": "https://github.com/wp-cli/cache-command", + "time": "2017-12-14T19:21:19+00:00" + }, + { + "name": "wp-cli/checksum-command", + "version": "v1.0.8", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/checksum-command.git", + "reference": "360c0c658242919e9a74ba06917fd8a691484174" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/checksum-command/zipball/360c0c658242919e9a74ba06917fd8a691484174", + "reference": "360c0c658242919e9a74ba06917fd8a691484174", + "shasum": "" + }, + "require-dev": { + "behat/behat": "~2.5", + "wp-cli/wp-cli": "^1.5" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "core verify-checksums", + "plugin verify-checksums" + ] + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "checksum-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Bachhuber", + "email": "daniel@runcommand.io", + "homepage": "https://runcommand.io" + } + ], + "description": "Verifies file integrity by comparing to published checksums.", + "homepage": "https://github.com/wp-cli/checksum-command", + "time": "2018-01-29T16:56:18+00:00" + }, + { + "name": "wp-cli/config-command", + "version": "v1.1.8", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/config-command.git", + "reference": "4e44b3fab9e1ddb8f91e3189b27354ff4ae141ad" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/config-command/zipball/4e44b3fab9e1ddb8f91e3189b27354ff4ae141ad", + "reference": "4e44b3fab9e1ddb8f91e3189b27354ff4ae141ad", + "shasum": "" + }, + "require": { + "wp-cli/wp-config-transformer": "^1.2" + }, + "require-dev": { + "behat/behat": "~2.5", + "wp-cli/wp-cli": "*" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "config", + "config delete", + "config create", + "config get", + "config has", + "config list", + "config path", + "config set" + ] + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "config-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Bachhuber", + "email": "daniel@runcommand.io", + "homepage": "https://runcommand.io" + }, + { + "name": "Alain Schlesser", + "email": "alain.schlesser@gmail.com", + "homepage": "https://www.alainschlesser.com" + } + ], + "description": "Generates and reads the wp-config.php file.", + "homepage": "https://github.com/wp-cli/config-command", + "time": "2018-01-30T14:12:41+00:00" + }, + { + "name": "wp-cli/core-command", + "version": "v1.0.9", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/core-command.git", + "reference": "0e825668d2c060c40ec1d7debbee94bc08eec9b3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/core-command/zipball/0e825668d2c060c40ec1d7debbee94bc08eec9b3", + "reference": "0e825668d2c060c40ec1d7debbee94bc08eec9b3", + "shasum": "" + }, + "require-dev": { + "behat/behat": "~2.5", + "wp-cli/wp-cli": "*" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "core", + "core check-update", + "core download", + "core install", + "core is-installed", + "core multisite-convert", + "core multisite-install", + "core update", + "core update-db", + "core version" + ] + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "core-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Bachhuber", + "email": "daniel@runcommand.io", + "homepage": "https://runcommand.io" + } + ], + "description": "Downloads, installs, updates, and manages a WordPress installation.", + "homepage": "https://github.com/wp-cli/core-command", + "time": "2018-01-30T06:57:10+00:00" + }, + { + "name": "wp-cli/cron-command", + "version": "v1.0.5", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/cron-command.git", + "reference": "9da7e36e8f9c14cb171a3c5204cba2865e0ed7ef" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/cron-command/zipball/9da7e36e8f9c14cb171a3c5204cba2865e0ed7ef", + "reference": "9da7e36e8f9c14cb171a3c5204cba2865e0ed7ef", + "shasum": "" + }, + "require-dev": { + "behat/behat": "~2.5", + "wp-cli/wp-cli": "*" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "cron", + "cron test", + "cron event", + "cron event delete", + "cron event list", + "cron event run", + "cron event schedule", + "cron schedule", + "cron schedule list" + ] + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "cron-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Bachhuber", + "email": "daniel@runcommand.io", + "homepage": "https://runcommand.io" + } + ], + "description": "Tests, runs, and deletes WP-Cron events; manages WP-Cron schedules.", + "homepage": "https://github.com/wp-cli/cron-command", + "time": "2017-12-08T15:09:54+00:00" + }, + { + "name": "wp-cli/db-command", + "version": "v1.3.3", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/db-command.git", + "reference": "7d361a15ffe34dfc9d798a81208fe61b8a2f049a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/db-command/zipball/7d361a15ffe34dfc9d798a81208fe61b8a2f049a", + "reference": "7d361a15ffe34dfc9d798a81208fe61b8a2f049a", + "shasum": "" + }, + "require-dev": { + "behat/behat": "~2.5", + "wp-cli/wp-cli": "^1.5" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "db", + "db create", + "db drop", + "db reset", + "db check", + "db optimize", + "db prefix", + "db repair", + "db cli", + "db query", + "db export", + "db import", + "db search", + "db tables", + "db size" + ] + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "db-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Bachhuber", + "email": "daniel@runcommand.io", + "homepage": "https://runcommand.io" + } + ], + "description": "Performs basic database operations using credentials stored in wp-config.php.", + "homepage": "https://github.com/wp-cli/db-command", + "time": "2018-01-29T02:30:16+00:00" + }, + { + "name": "wp-cli/embed-command", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/embed-command.git", + "reference": "81319d4243a8dfe096389bf54cdc4fc3dec53497" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/embed-command/zipball/81319d4243a8dfe096389bf54cdc4fc3dec53497", + "reference": "81319d4243a8dfe096389bf54cdc4fc3dec53497", + "shasum": "" + }, + "require-dev": { + "behat/behat": "~2.5", + "wp-cli/wp-cli": "^1.5" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "embed", + "embed fetch", + "embed provider list", + "embed provider match", + "embed handler list", + "embed cache clear", + "embed cache find", + "embed cache trigger" + ] + }, + "autoload": { + "psr-4": { + "WP_CLI\\Embeds\\": "src/" + }, + "files": [ + "embed-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Pascal Birchler", + "homepage": "https://pascalbirchler.com/" + } + ], + "description": "Inspects oEmbed providers, clears embed cache, and more.", + "homepage": "https://github.com/wp-cli/embed-command", + "time": "2018-01-22T21:26:48+00:00" + }, + { + "name": "wp-cli/entity-command", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/entity-command.git", + "reference": "035b74ea16912f5b14db7d28036a6d123eb90547" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/entity-command/zipball/035b74ea16912f5b14db7d28036a6d123eb90547", + "reference": "035b74ea16912f5b14db7d28036a6d123eb90547", + "shasum": "" + }, + "require-dev": { + "behat/behat": "~2.5", + "phpunit/phpunit": "^4.8", + "wp-cli/wp-cli": "^1.5" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "comment", + "comment approve", + "comment count", + "comment create", + "comment delete", + "comment exists", + "comment generate", + "comment get", + "comment list", + "comment meta", + "comment meta add", + "comment meta delete", + "comment meta get", + "comment meta list", + "comment meta patch", + "comment meta pluck", + "comment meta update", + "comment recount", + "comment spam", + "comment status", + "comment trash", + "comment unapprove", + "comment unspam", + "comment untrash", + "comment update", + "menu", + "menu create", + "menu delete", + "menu item", + "menu item add-custom", + "menu item add-post", + "menu item add-term", + "menu item delete", + "menu item list", + "menu item update", + "menu list", + "menu location", + "menu location assign", + "menu location list", + "menu location remove", + "network meta", + "network meta add", + "network meta delete", + "network meta get", + "network meta list", + "network meta patch", + "network meta pluck", + "network meta update", + "option", + "option add", + "option delete", + "option get", + "option list", + "option patch", + "option pluck", + "option update", + "post", + "post create", + "post delete", + "post edit", + "post generate", + "post get", + "post list", + "post meta", + "post meta add", + "post meta delete", + "post meta get", + "post meta list", + "post meta patch", + "post meta pluck", + "post meta update", + "post term", + "post term add", + "post term list", + "post term remove", + "post term set", + "post update", + "post-type", + "post-type get", + "post-type list", + "site", + "site activate", + "site archive", + "site create", + "site deactivate", + "site delete", + "site empty", + "site list", + "site mature", + "site option", + "site private", + "site public", + "site spam", + "site unarchive", + "site unmature", + "site unspam", + "taxonomy", + "taxonomy get", + "taxonomy list", + "term", + "term create", + "term delete", + "term generate", + "term get", + "term list", + "term meta", + "term meta add", + "term meta delete", + "term meta get", + "term meta list", + "term meta patch", + "term meta pluck", + "term meta update", + "term recount", + "term update", + "user", + "user add-cap", + "user add-role", + "user create", + "user delete", + "user generate", + "user get", + "user import-csv", + "user list", + "user list-caps", + "user meta", + "user meta add", + "user meta delete", + "user meta get", + "user meta list", + "user meta patch", + "user meta pluck", + "user meta update", + "user remove-cap", + "user remove-role", + "user reset-password", + "user session", + "user session destroy", + "user session list", + "user set-role", + "user spam", + "user term", + "user term add", + "user term list", + "user term remove", + "user term set", + "user unspam", + "user update" + ] + }, + "autoload": { + "psr-4": { + "": "src/", + "WP_CLI\\": "src/WP_CLI" + }, + "files": [ + "entity-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Bachhuber", + "email": "daniel@runcommand.io", + "homepage": "https://runcommand.io" + } + ], + "description": "Manage WordPress core entities.", + "homepage": "https://github.com/wp-cli/entity-command", + "time": "2018-01-29T15:10:05+00:00" + }, + { + "name": "wp-cli/eval-command", + "version": "v1.0.5", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/eval-command.git", + "reference": "9640d40ab28cd86590396f08f8c382e659f57321" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/eval-command/zipball/9640d40ab28cd86590396f08f8c382e659f57321", + "reference": "9640d40ab28cd86590396f08f8c382e659f57321", + "shasum": "" + }, + "require": { + "wp-cli/wp-cli": "*" + }, + "require-dev": { + "behat/behat": "~2.5" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "eval", + "eval-file" + ] + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "eval-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Bachhuber", + "email": "daniel@runcommand.io", + "homepage": "https://runcommand.io" + } + ], + "description": "Executes arbitrary PHP code or files.", + "homepage": "https://github.com/wp-cli/eval-command", + "time": "2017-12-08T14:33:34+00:00" + }, + { + "name": "wp-cli/export-command", + "version": "v1.0.6", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/export-command.git", + "reference": "4ae43d370ed6ed0cffd166dd84cfc6c8c2f3f633" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/export-command/zipball/4ae43d370ed6ed0cffd166dd84cfc6c8c2f3f633", + "reference": "4ae43d370ed6ed0cffd166dd84cfc6c8c2f3f633", + "shasum": "" + }, + "require": { + "nb/oxymel": "~0.1.0" + }, + "require-dev": { + "behat/behat": "~2.5", + "wp-cli/wp-cli": "^1.5" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "export" + ] + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "export-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Bachhuber", + "email": "daniel@runcommand.io", + "homepage": "https://runcommand.io" + } + ], + "description": "Exports WordPress content to a WXR file.", + "homepage": "https://github.com/wp-cli/export-command", + "time": "2018-01-29T02:33:05+00:00" + }, + { + "name": "wp-cli/extension-command", + "version": "v1.1.9", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/extension-command.git", + "reference": "dfacef02b88baed07058c88064afd582f4150a97" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/extension-command/zipball/dfacef02b88baed07058c88064afd582f4150a97", + "reference": "dfacef02b88baed07058c88064afd582f4150a97", + "shasum": "" + }, + "require-dev": { + "behat/behat": "~2.5", + "wp-cli/wp-cli": "*" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "plugin", + "plugin activate", + "plugin deactivate", + "plugin delete", + "plugin get", + "plugin install", + "plugin is-installed", + "plugin list", + "plugin path", + "plugin search", + "plugin status", + "plugin toggle", + "plugin uninstall", + "plugin update", + "theme", + "theme activate", + "theme delete", + "theme disable", + "theme enable", + "theme get", + "theme install", + "theme is-installed", + "theme list", + "theme mod", + "theme mod get", + "theme mod set", + "theme mod remove", + "theme path", + "theme search", + "theme status", + "theme update" + ] + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "extension-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Bachhuber", + "email": "daniel@runcommand.io", + "homepage": "https://runcommand.io" + } + ], + "description": "Manages plugins and themes, including installs, activations, and updates.", + "homepage": "https://github.com/wp-cli/extension-command", + "time": "2018-01-30T11:13:57+00:00" + }, + { + "name": "wp-cli/import-command", + "version": "v1.0.6", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/import-command.git", + "reference": "d2c21d590a1bfae6ac4e289a0b57fb1870b5990c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/import-command/zipball/d2c21d590a1bfae6ac4e289a0b57fb1870b5990c", + "reference": "d2c21d590a1bfae6ac4e289a0b57fb1870b5990c", + "shasum": "" + }, + "require": { + "wp-cli/wp-cli": "*" + }, + "require-dev": { + "behat/behat": "~2.5" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "import" + ] + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "import-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Bachhuber", + "email": "daniel@runcommand.io", + "homepage": "https://runcommand.io" + } + ], + "description": "Imports content from a given WXR file.", + "homepage": "https://github.com/wp-cli/import-command", + "time": "2017-12-08T15:13:36+00:00" + }, + { + "name": "wp-cli/language-command", + "version": "v1.0.6", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/language-command.git", + "reference": "2a3d1ce5a722a4d70809619a065087aa933f6209" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/language-command/zipball/2a3d1ce5a722a4d70809619a065087aa933f6209", + "reference": "2a3d1ce5a722a4d70809619a065087aa933f6209", + "shasum": "" + }, + "require-dev": { + "behat/behat": "~2.5", + "wp-cli/wp-cli": "*" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "commands": [ + "language", + "language core", + "language core activate", + "language core install", + "language core list", + "language core uninstall", + "language core update" + ], + "bundled": true + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "language-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Bachhuber", + "email": "daniel@runcommand.io", + "homepage": "https://runcommand.io" + } + ], + "description": "Installs, activates, and manages language packs.", + "homepage": "https://github.com/wp-cli/language-command", + "time": "2017-12-08T17:50:26+00:00" + }, + { + "name": "wp-cli/media-command", + "version": "v1.1.4", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/media-command.git", + "reference": "7f8664ba722505446b3ef3dbc6717e8e7f20265c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/media-command/zipball/7f8664ba722505446b3ef3dbc6717e8e7f20265c", + "reference": "7f8664ba722505446b3ef3dbc6717e8e7f20265c", + "shasum": "" + }, + "require-dev": { + "behat/behat": "~2.5", + "wp-cli/wp-cli": "^1.5" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "media", + "media import", + "media regenerate", + "media image-size" + ] + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "media-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Bachhuber", + "email": "daniel@runcommand.io", + "homepage": "https://runcommand.io" + } + ], + "description": "Imports files as attachments, regenerates thumbnails, or lists registered image sizes.", + "homepage": "https://github.com/wp-cli/media-command", + "time": "2018-01-29T02:17:56+00:00" + }, + { + "name": "wp-cli/mustangostang-spyc", + "version": "0.6.3", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/spyc.git", + "reference": "6aa0b4da69ce9e9a2c8402dab8d43cf32c581cc7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/spyc/zipball/6aa0b4da69ce9e9a2c8402dab8d43cf32c581cc7", + "reference": "6aa0b4da69ce9e9a2c8402dab8d43cf32c581cc7", + "shasum": "" + }, + "require": { + "php": ">=5.3.1" + }, + "require-dev": { + "phpunit/phpunit": "4.3.*@dev" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.5.x-dev" + } + }, + "autoload": { + "psr-4": { + "Mustangostang\\": "src/" + }, + "files": [ + "includes/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "mustangostang", + "email": "vlad.andersen@gmail.com" + } + ], + "description": "A simple YAML loader/dumper class for PHP (WP-CLI fork)", + "homepage": "https://github.com/mustangostang/spyc/", + "time": "2017-04-25T11:26:20+00:00" + }, + { + "name": "wp-cli/package-command", + "version": "v1.0.11", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/package-command.git", + "reference": "b0f0e59a1d174c80bd11833b2f4a650d835d7a29" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/package-command/zipball/b0f0e59a1d174c80bd11833b2f4a650d835d7a29", + "reference": "b0f0e59a1d174c80bd11833b2f4a650d835d7a29", + "shasum": "" + }, + "require": { + "composer/composer": "^1.2.0" + }, + "require-dev": { + "behat/behat": "~2.5", + "wp-cli/wp-cli": "^1.5" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "package", + "package browse", + "package install", + "package list", + "package update", + "package uninstall" + ] + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "package-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Bachhuber", + "email": "daniel@runcommand.io", + "homepage": "https://runcommand.io" + } + ], + "description": "Lists, installs, and removes WP-CLI packages.", + "homepage": "https://github.com/wp-cli/package-command", + "time": "2018-01-29T02:32:25+00:00" + }, + { + "name": "wp-cli/php-cli-tools", + "version": "v0.11.8", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/php-cli-tools.git", + "reference": "363c75349f5dde561e0b416dd00f7aaa76fa2c27" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/php-cli-tools/zipball/363c75349f5dde561e0b416dd00f7aaa76fa2c27", + "reference": "363c75349f5dde561e0b416dd00f7aaa76fa2c27", + "shasum": "" + }, + "require": { + "php": ">= 5.3.0" + }, + "type": "library", + "autoload": { + "psr-0": { + "cli": "lib/" + }, + "files": [ + "lib/cli/cli.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "James Logsdon", + "email": "jlogsdon@php.net", + "role": "Developer" + }, + { + "name": "Daniel Bachhuber", + "email": "daniel@handbuilt.co", + "role": "Maintainer" + } + ], + "description": "Console utilities for PHP", + "homepage": "http://github.com/wp-cli/php-cli-tools", + "keywords": [ + "cli", + "console" + ], + "time": "2017-10-12T21:50:48+00:00" + }, + { + "name": "wp-cli/rewrite-command", + "version": "v1.0.5", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/rewrite-command.git", + "reference": "6b1695887e289ffad14c8f4ea86b5f1d92757408" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/rewrite-command/zipball/6b1695887e289ffad14c8f4ea86b5f1d92757408", + "reference": "6b1695887e289ffad14c8f4ea86b5f1d92757408", + "shasum": "" + }, + "require-dev": { + "behat/behat": "~2.5", + "wp-cli/wp-cli": "*" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "commands": [ + "rewrite", + "rewrite flush", + "rewrite list", + "rewrite structure" + ], + "bundled": true + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "rewrite-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Bachhuber", + "email": "daniel@runcommand.io", + "homepage": "https://runcommand.io" + } + ], + "description": "Lists or flushes the site's rewrite rules, updates the permalink structure.", + "homepage": "https://github.com/wp-cli/rewrite-command", + "time": "2017-12-08T17:51:04+00:00" + }, + { + "name": "wp-cli/role-command", + "version": "v1.0.5", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/role-command.git", + "reference": "be7f8ea91922864d0c75e45953fbe41d44bebb25" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/role-command/zipball/be7f8ea91922864d0c75e45953fbe41d44bebb25", + "reference": "be7f8ea91922864d0c75e45953fbe41d44bebb25", + "shasum": "" + }, + "require-dev": { + "behat/behat": "~2.5", + "wp-cli/wp-cli": "*" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "commands": [ + "role", + "role create", + "role delete", + "role exists", + "role list", + "role reset", + "cap", + "cap add", + "cap list", + "cap remove" + ], + "bundled": true + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "role-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Bachhuber", + "email": "daniel@runcommand.io", + "homepage": "https://runcommand.io" + } + ], + "description": "Adds, removes, lists, and resets roles and capabilities.", + "homepage": "https://github.com/wp-cli/role-command", + "time": "2017-12-08T17:51:40+00:00" + }, + { + "name": "wp-cli/scaffold-command", + "version": "v1.1.2", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/scaffold-command.git", + "reference": "a7ef51b2abd88a2ecb17ecdf7aaad92da37d1eb7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/scaffold-command/zipball/a7ef51b2abd88a2ecb17ecdf7aaad92da37d1eb7", + "reference": "a7ef51b2abd88a2ecb17ecdf7aaad92da37d1eb7", + "shasum": "" + }, + "require-dev": { + "behat/behat": "~2.5", + "wp-cli/wp-cli": "^1.5" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "scaffold", + "scaffold _s", + "scaffold block", + "scaffold child-theme", + "scaffold plugin", + "scaffold plugin-tests", + "scaffold post-type", + "scaffold taxonomy", + "scaffold theme-tests" + ] + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "scaffold-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Bachhuber", + "email": "daniel@runcommand.io", + "homepage": "https://runcommand.io" + } + ], + "description": "Generates code for post types, taxonomies, blocks, plugins, child themes, etc.", + "homepage": "https://github.com/wp-cli/scaffold-command", + "time": "2018-01-29T02:29:34+00:00" + }, + { + "name": "wp-cli/search-replace-command", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/search-replace-command.git", + "reference": "c688e51b35bb87b26a3de308287d6a30cda78e44" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/search-replace-command/zipball/c688e51b35bb87b26a3de308287d6a30cda78e44", + "reference": "c688e51b35bb87b26a3de308287d6a30cda78e44", + "shasum": "" + }, + "require-dev": { + "behat/behat": "~2.5", + "wp-cli/wp-cli": "^1.5" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "search-replace" + ] + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "search-replace-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Bachhuber", + "email": "daniel@runcommand.io", + "homepage": "https://runcommand.io" + } + ], + "description": "Searches/replaces strings in the database.", + "homepage": "https://github.com/wp-cli/search-replace-command", + "time": "2018-01-29T06:27:32+00:00" + }, + { + "name": "wp-cli/server-command", + "version": "v1.0.9", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/server-command.git", + "reference": "6192e6d7becd07e4c11a8f1560655c73a3b3526a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/server-command/zipball/6192e6d7becd07e4c11a8f1560655c73a3b3526a", + "reference": "6192e6d7becd07e4c11a8f1560655c73a3b3526a", + "shasum": "" + }, + "require": { + "wp-cli/wp-cli": "*" + }, + "require-dev": { + "behat/behat": "~2.5" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "commands": [ + "server" + ], + "bundled": true + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "server-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Bachhuber", + "email": "daniel@runcommand.io", + "homepage": "https://runcommand.io" + } + ], + "description": "Launches PHP's built-in web server for a specific WordPress installation.", + "homepage": "https://github.com/wp-cli/server-command", + "time": "2017-12-14T20:06:24+00:00" + }, + { + "name": "wp-cli/shell-command", + "version": "v1.0.5", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/shell-command.git", + "reference": "507603a8994d984b6c4d5bd26e31ede6d9cce37e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/shell-command/zipball/507603a8994d984b6c4d5bd26e31ede6d9cce37e", + "reference": "507603a8994d984b6c4d5bd26e31ede6d9cce37e", + "shasum": "" + }, + "require": { + "wp-cli/wp-cli": "*" + }, + "require-dev": { + "behat/behat": "~2.5" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "commands": [ + "shell" + ], + "bundled": true + }, + "autoload": { + "psr-4": { + "": "src/", + "WP_CLI\\": "src/WP_CLI" + }, + "files": [ + "shell-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Bachhuber", + "email": "daniel@runcommand.io", + "homepage": "https://runcommand.io" + } + ], + "description": "Opens an interactive PHP console for running and testing PHP code.", + "homepage": "https://github.com/wp-cli/shell-command", + "time": "2017-12-08T16:03:53+00:00" + }, + { + "name": "wp-cli/super-admin-command", + "version": "v1.0.6", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/super-admin-command.git", + "reference": "2982d2e6514dbb318561d72d0577746a3a37181e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/super-admin-command/zipball/2982d2e6514dbb318561d72d0577746a3a37181e", + "reference": "2982d2e6514dbb318561d72d0577746a3a37181e", + "shasum": "" + }, + "require-dev": { + "behat/behat": "~2.5", + "wp-cli/wp-cli": "*" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "commands": [ + "super-admin", + "super-admin add", + "super-admin list", + "super-admin remove" + ], + "bundled": true + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "super-admin-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Bachhuber", + "email": "daniel@runcommand.io", + "homepage": "https://runcommand.io" + } + ], + "description": "Lists, adds, or removes super admin users on a multisite installation.", + "homepage": "https://github.com/wp-cli/super-admin-command", + "time": "2017-12-08T17:43:53+00:00" + }, + { + "name": "wp-cli/widget-command", + "version": "v1.0.5", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/widget-command.git", + "reference": "657e0f77d80c892f8f72f90a3a25112c254386df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/widget-command/zipball/657e0f77d80c892f8f72f90a3a25112c254386df", + "reference": "657e0f77d80c892f8f72f90a3a25112c254386df", + "shasum": "" + }, + "require-dev": { + "behat/behat": "~2.5", + "wp-cli/wp-cli": "*" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "commands": [ + "widget", + "widget add", + "widget deactivate", + "widget delete", + "widget list", + "widget move", + "widget reset", + "widget update", + "sidebar", + "sidebar list" + ], + "bundled": true + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "widget-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Bachhuber", + "email": "daniel@runcommand.io", + "homepage": "https://runcommand.io" + } + ], + "description": "Adds, moves, and removes widgets; lists sidebars.", + "homepage": "https://github.com/wp-cli/widget-command", + "time": "2017-12-08T17:45:57+00:00" + }, + { + "name": "wp-cli/wp-config-transformer", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/wp-config-transformer.git", + "reference": "535007c241ea8425a8840cdb2fa0d395010a0f1c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/wp-config-transformer/zipball/535007c241ea8425a8840cdb2fa0d395010a0f1c", + "reference": "535007c241ea8425a8840cdb2fa0d395010a0f1c", + "shasum": "" + }, + "require": { + "php": ">=5.3.29" + }, + "require-dev": { + "composer/composer": "^1.5.6", + "phpunit/phpunit": "^6.5.5", + "wp-coding-standards/wpcs": "^0.14.0" + }, + "type": "library", + "autoload": { + "files": [ + "src/WPConfigTransformer.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frankie Jarrett", + "email": "fjarrett@gmail.com" + } + ], + "description": "Programmatically edit a wp-config.php file.", + "time": "2018-01-27T11:50:22+00:00" + } + ], + "packages-dev": [ + { + "name": "behat/behat", + "version": "v2.5.5", + "source": { + "type": "git", + "url": "https://github.com/Behat/Behat.git", + "reference": "c1e48826b84669c97a1efa78459aedfdcdcf2120" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Behat/Behat/zipball/c1e48826b84669c97a1efa78459aedfdcdcf2120", + "reference": "c1e48826b84669c97a1efa78459aedfdcdcf2120", + "shasum": "" + }, + "require": { + "behat/gherkin": "~2.3.0", + "php": ">=5.3.1", + "symfony/config": "~2.3", + "symfony/console": "~2.0", + "symfony/dependency-injection": "~2.0", + "symfony/event-dispatcher": "~2.0", + "symfony/finder": "~2.0", + "symfony/translation": "~2.3", + "symfony/yaml": "~2.0" + }, + "require-dev": { + "phpunit/phpunit": "~3.7.19" + }, + "suggest": { + "behat/mink-extension": "for integration with Mink testing framework", + "behat/symfony2-extension": "for integration with Symfony2 web framework", + "behat/yii-extension": "for integration with Yii web framework" + }, + "bin": [ + "bin/behat" + ], + "type": "library", + "autoload": { + "psr-0": { + "Behat\\Behat": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + } + ], + "description": "Scenario-oriented BDD framework for PHP 5.3", + "homepage": "http://behat.org/", + "keywords": [ + "BDD", + "Behat", + "Symfony2" + ], + "time": "2015-06-01T09:37:55+00:00" + }, + { + "name": "behat/gherkin", + "version": "v2.3.5", + "source": { + "type": "git", + "url": "https://github.com/Behat/Gherkin.git", + "reference": "2b33963da5525400573560c173ab5c9c057e1852" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Behat/Gherkin/zipball/2b33963da5525400573560c173ab5c9c057e1852", + "reference": "2b33963da5525400573560c173ab5c9c057e1852", + "shasum": "" + }, + "require": { + "php": ">=5.3.1", + "symfony/finder": "~2.0" + }, + "require-dev": { + "symfony/config": "~2.0", + "symfony/translation": "~2.0", + "symfony/yaml": "~2.0" + }, + "suggest": { + "symfony/config": "If you want to use Config component to manage resources", + "symfony/translation": "If you want to use Symfony2 translations adapter", + "symfony/yaml": "If you want to parse features, represented in YAML files" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-develop": "2.2-dev" + } + }, + "autoload": { + "psr-0": { + "Behat\\Gherkin": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + } + ], + "description": "Gherkin DSL parser for PHP 5.3", + "homepage": "http://behat.org/", + "keywords": [ + "BDD", + "Behat", + "DSL", + "Symfony2", + "parser" + ], + "time": "2013-10-15T11:22:17+00:00" + }, + { + "name": "dealerdirect/phpcodesniffer-composer-installer", + "version": "v0.4.4", + "source": { + "type": "git", + "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", + "reference": "2e41850d5f7797cbb1af7b030d245b3b24e63a08" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/2e41850d5f7797cbb1af7b030d245b3b24e63a08", + "reference": "2e41850d5f7797cbb1af7b030d245b3b24e63a08", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0", + "php": "^5.3|^7", + "squizlabs/php_codesniffer": "*" + }, + "require-dev": { + "composer/composer": "*", + "wimg/php-compatibility": "^8.0" + }, + "suggest": { + "dealerdirect/qa-tools": "All the PHP QA tools you'll need" + }, + "type": "composer-plugin", + "extra": { + "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" + }, + "autoload": { + "psr-4": { + "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Franck Nijhof", + "email": "f.nijhof@dealerdirect.nl", + "homepage": "http://workingatdealerdirect.eu", + "role": "Developer" + } + ], + "description": "PHP_CodeSniffer Standards Composer Installer Plugin", + "homepage": "http://workingatdealerdirect.eu", + "keywords": [ + "PHPCodeSniffer", + "PHP_CodeSniffer", + "code quality", + "codesniffer", + "composer", + "installer", + "phpcs", + "plugin", + "qa", + "quality", + "standard", + "standards", + "style guide", + "stylecheck", + "tests" + ], + "time": "2017-12-06T16:27:17+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "1.2.18", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "fe2466802556d3fe4e4d1d58ffd3ccfd0a19be0b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/fe2466802556d3fe4e4d1d58ffd3ccfd0a19be0b", + "reference": "fe2466802556d3fe4e4d1d58ffd3ccfd0a19be0b", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "phpunit/php-file-iterator": ">=1.3.0@stable", + "phpunit/php-text-template": ">=1.2.0@stable", + "phpunit/php-token-stream": ">=1.1.3,<1.3.0" + }, + "require-dev": { + "phpunit/phpunit": "3.7.*@dev" + }, + "suggest": { + "ext-dom": "*", + "ext-xdebug": ">=2.0.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "PHP/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "time": "2014-09-02T10:13:14+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "time": "2017-11-27T13:52:08+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2017-02-26T11:10:40+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "1.2.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "ad4e1e23ae01b483c16f600ff1bebec184588e32" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/ad4e1e23ae01b483c16f600ff1bebec184588e32", + "reference": "ad4e1e23ae01b483c16f600ff1bebec184588e32", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + }, + "autoload": { + "classmap": [ + "PHP/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2014-03-03T05:10:30+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "3.7.38", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "38709dc22d519a3d1be46849868aa2ddf822bcf6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/38709dc22d519a3d1be46849868aa2ddf822bcf6", + "reference": "38709dc22d519a3d1be46849868aa2ddf822bcf6", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-dom": "*", + "ext-json": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-spl": "*", + "php": ">=5.3.3", + "phpunit/php-code-coverage": "~1.2", + "phpunit/php-file-iterator": "~1.3", + "phpunit/php-text-template": "~1.1", + "phpunit/php-timer": "~1.0", + "phpunit/phpunit-mock-objects": "~1.2", + "symfony/yaml": "~2.0" + }, + "require-dev": { + "pear-pear.php.net/pear": "1.9.4" + }, + "suggest": { + "phpunit/php-invoker": "~1.1" + }, + "bin": [ + "composer/bin/phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.7.x-dev" + } + }, + "autoload": { + "classmap": [ + "PHPUnit/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "", + "../../symfony/yaml/" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "http://www.phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "time": "2014-10-17T09:04:17+00:00" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "1.2.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "5794e3c5c5ba0fb037b11d8151add2a07fa82875" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/5794e3c5c5ba0fb037b11d8151add2a07fa82875", + "reference": "5794e3c5c5ba0fb037b11d8151add2a07fa82875", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "phpunit/php-text-template": ">=1.1.1@stable" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "autoload": { + "classmap": [ + "PHPUnit/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "time": "2013-01-13T10:24:48+00:00" + }, + { + "name": "roave/security-advisories", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/Roave/SecurityAdvisories.git", + "reference": "0703d860f83775029738dc4a519301e8e3d81853" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/0703d860f83775029738dc4a519301e8e3d81853", + "reference": "0703d860f83775029738dc4a519301e8e3d81853", + "shasum": "" + }, + "conflict": { + "adodb/adodb-php": "<5.20.6", + "amphp/artax": "<1.0.6|>=2,<2.0.6", + "aws/aws-sdk-php": ">=3,<3.2.1", + "bugsnag/bugsnag-laravel": ">=2,<2.0.2", + "cakephp/cakephp": ">=1.3,<1.3.18|>=2,<2.4.99|>=2.5,<2.5.99|>=2.6,<2.6.12|>=2.7,<2.7.6|>=3,<3.0.15|>=3.1,<3.1.4", + "cart2quote/module-quotation": ">=4.1.6,<=4.4.5|>=5,<5.4.4", + "cartalyst/sentry": "<=2.1.6", + "codeigniter/framework": "<=3.0.6", + "composer/composer": "<=1.0.0-alpha11", + "contao-components/mediaelement": ">=2.14.2,<2.21.1", + "contao/core": ">=2,<3.5.31", + "contao/core-bundle": ">=4,<4.4.8", + "contao/listing-bundle": ">=4,<4.4.8", + "doctrine/annotations": ">=1,<1.2.7", + "doctrine/cache": ">=1,<1.3.2|>=1.4,<1.4.2", + "doctrine/common": ">=2,<2.4.3|>=2.5,<2.5.1", + "doctrine/dbal": ">=2,<2.0.8|>=2.1,<2.1.2", + "doctrine/doctrine-bundle": "<1.5.2", + "doctrine/doctrine-module": "<=0.7.1", + "doctrine/mongodb-odm": ">=1,<1.0.2", + "doctrine/mongodb-odm-bundle": ">=2,<3.0.1", + "doctrine/orm": ">=2,<2.4.8|>=2.5,<2.5.1", + "dompdf/dompdf": ">=0.6,<0.6.2", + "drupal/core": ">=8,<8.3.7", + "drupal/drupal": ">=8,<8.3.7", + "ezsystems/ezpublish-legacy": ">=5.3,<5.3.12.2|>=5.4,<5.4.10.1|>=2017.8,<2017.8.1.1", + "firebase/php-jwt": "<2", + "friendsofsymfony/rest-bundle": ">=1.2,<1.2.2", + "friendsofsymfony/user-bundle": ">=1.2,<1.3.5", + "gree/jose": "<=2.2", + "gregwar/rst": "<1.0.3", + "guzzlehttp/guzzle": ">=6,<6.2.1|>=4.0.0-rc2,<4.2.4|>=5,<5.3.1", + "illuminate/auth": ">=4,<4.0.99|>=4.1,<4.1.26", + "illuminate/database": ">=4,<4.0.99|>=4.1,<4.1.29", + "joomla/session": "<1.3.1", + "laravel/framework": ">=4,<4.0.99|>=4.1,<4.1.29", + "laravel/socialite": ">=1,<1.0.99|>=2,<2.0.10", + "magento/magento1ce": ">=1.5.0.1,<1.9.3.2", + "magento/magento1ee": ">=1.9,<1.14.3.2", + "magento/magento2ce": ">=2,<2.2", + "monolog/monolog": ">=1.8,<1.12", + "namshi/jose": "<2.2", + "onelogin/php-saml": "<2.10.4", + "oro/crm": ">=1.7,<1.7.4", + "oro/platform": ">=1.7,<1.7.4", + "phpmailer/phpmailer": ">=5,<5.2.24", + "phpunit/phpunit": ">=4.8.19,<4.8.28|>=5.0.10,<5.6.3", + "phpxmlrpc/extras": "<6.0.1", + "pusher/pusher-php-server": "<2.2.1", + "sabre/dav": ">=1.6,<1.6.99|>=1.7,<1.7.11|>=1.8,<1.8.9", + "shopware/shopware": "<5.2.25", + "silverstripe/cms": ">=3,<=3.0.11|>=3.1,<3.1.11", + "silverstripe/forum": "<=0.6.1|>=0.7,<=0.7.3", + "silverstripe/framework": ">=3,<3.3", + "silverstripe/userforms": "<3", + "simplesamlphp/saml2": "<1.8.1|>=1.9,<1.9.1|>=1.10,<1.10.3|>=2,<2.3.3", + "simplesamlphp/simplesamlphp": "<1.14.16", + "simplesamlphp/simplesamlphp-module-infocard": "<1.0.1", + "socalnick/scn-social-auth": "<1.15.2", + "squizlabs/php_codesniffer": ">=1,<2.8.1", + "swiftmailer/swiftmailer": ">=4,<5.4.5", + "symfony/dependency-injection": ">=2,<2.0.17", + "symfony/form": ">=2.3,<2.3.35|>=2.4,<2.6.12|>=2.7,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", + "symfony/framework-bundle": ">=2,<2.3.18|>=2.4,<2.4.8|>=2.5,<2.5.2", + "symfony/http-foundation": ">=2,<2.3.27|>=2.4,<2.5.11|>=2.6,<2.6.6", + "symfony/http-kernel": ">=2,<2.3.29|>=2.4,<2.5.12|>=2.6,<2.6.8", + "symfony/intl": ">=2.7,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", + "symfony/routing": ">=2,<2.0.19", + "symfony/security": ">=2,<2.0.25|>=2.1,<2.1.13|>=2.2,<2.2.9|>=2.3,<2.3.37|>=2.4,<2.6.13|>=2.7,<2.7.9|>=2.7.30,<2.7.32|>=2.8.23,<2.8.25|>=3.2.10,<3.2.12|>=3.3.3,<3.3.5", + "symfony/security-core": ">=2.4,<2.6.13|>=2.7,<2.7.9|>=2.7.30,<2.7.32|>=2.8,<2.8.6|>=2.8.23,<2.8.25|>=3,<3.0.6|>=3.2.10,<3.2.12|>=3.3.3,<3.3.5", + "symfony/security-csrf": ">=2.7,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", + "symfony/security-http": ">=2.3,<2.3.41|>=2.4,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", + "symfony/serializer": ">=2,<2.0.11", + "symfony/symfony": ">=2,<2.3.41|>=2.4,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", + "symfony/translation": ">=2,<2.0.17", + "symfony/validator": ">=2,<2.0.24|>=2.1,<2.1.12|>=2.2,<2.2.5|>=2.3,<2.3.3", + "symfony/web-profiler-bundle": ">=2,<2.3.19|>=2.4,<2.4.9|>=2.5,<2.5.4", + "symfony/yaml": ">=2,<2.0.22|>=2.1,<2.1.7", + "thelia/backoffice-default-template": ">=2.1,<2.1.2", + "thelia/thelia": ">=2.1.0-beta1,<2.1.3|>=2.1,<2.1.2", + "twig/twig": "<1.20", + "typo3/cms": ">=6.2,<6.2.30|>=7,<7.6.22|>=8,<8.7.5", + "typo3/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.10|>=3.1,<3.1.7|>=3.2,<3.2.7|>=3.3,<3.3.5", + "typo3/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4", + "willdurand/js-translation-bundle": "<2.1.1", + "yiisoft/yii": ">=1.1.14,<1.1.15", + "yiisoft/yii2": "<2.0.5", + "yiisoft/yii2-bootstrap": "<2.0.4", + "yiisoft/yii2-dev": "<2.0.4", + "yiisoft/yii2-gii": "<2.0.4", + "yiisoft/yii2-jui": "<2.0.4", + "zendframework/zend-cache": ">=2.4,<2.4.8|>=2.5,<2.5.3", + "zendframework/zend-captcha": ">=2,<2.4.9|>=2.5,<2.5.2", + "zendframework/zend-crypt": ">=2,<2.4.9|>=2.5,<2.5.2", + "zendframework/zend-db": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.10|>=2.3,<2.3.5", + "zendframework/zend-diactoros": ">=1,<1.0.4", + "zendframework/zend-form": ">=2,<2.2.7|>=2.3,<2.3.1", + "zendframework/zend-http": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.3,<2.3.8|>=2.4,<2.4.1", + "zendframework/zend-json": ">=2.1,<2.1.6|>=2.2,<2.2.6", + "zendframework/zend-ldap": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.8|>=2.3,<2.3.3", + "zendframework/zend-mail": ">=2,<2.4.11|>=2.5,<2.7.2", + "zendframework/zend-navigation": ">=2,<2.2.7|>=2.3,<2.3.1", + "zendframework/zend-session": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.9|>=2.3,<2.3.4", + "zendframework/zend-validator": ">=2.3,<2.3.6", + "zendframework/zend-view": ">=2,<2.2.7|>=2.3,<2.3.1", + "zendframework/zend-xmlrpc": ">=2.1,<2.1.6|>=2.2,<2.2.6", + "zendframework/zendframework": ">=2,<2.4.11|>=2.5,<2.5.1", + "zendframework/zendframework1": "<1.12.20", + "zendframework/zendopenid": ">=2,<2.0.2", + "zendframework/zendxml": ">=1,<1.0.1", + "zetacomponents/mail": "<1.8.2", + "zf-commons/zfc-user": "<1.2.2", + "zfcampus/zf-apigility-doctrine": ">=1,<1.0.3", + "zfr/zfr-oauth2-server-module": "<0.1.2" + }, + "type": "metapackage", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "role": "maintainer" + } + ], + "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", + "time": "2017-12-24T19:52:27+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "2.9.1", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/dcbed1074f8244661eecddfc2a675430d8d33f62", + "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "bin": [ + "scripts/phpcs", + "scripts/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "classmap": [ + "CodeSniffer.php", + "CodeSniffer/CLI.php", + "CodeSniffer/Exception.php", + "CodeSniffer/File.php", + "CodeSniffer/Fixer.php", + "CodeSniffer/Report.php", + "CodeSniffer/Reporting.php", + "CodeSniffer/Sniff.php", + "CodeSniffer/Tokens.php", + "CodeSniffer/Reports/", + "CodeSniffer/Tokenizers/", + "CodeSniffer/DocGenerators/", + "CodeSniffer/Standards/AbstractPatternSniff.php", + "CodeSniffer/Standards/AbstractScopeSniff.php", + "CodeSniffer/Standards/AbstractVariableSniff.php", + "CodeSniffer/Standards/IncorrectPatternException.php", + "CodeSniffer/Standards/Generic/Sniffs/", + "CodeSniffer/Standards/MySource/Sniffs/", + "CodeSniffer/Standards/PEAR/Sniffs/", + "CodeSniffer/Standards/PSR1/Sniffs/", + "CodeSniffer/Standards/PSR2/Sniffs/", + "CodeSniffer/Standards/Squiz/Sniffs/", + "CodeSniffer/Standards/Zend/Sniffs/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "http://www.squizlabs.com/php-codesniffer", + "keywords": [ + "phpcs", + "standards" + ], + "time": "2017-05-22T02:43:20+00:00" + }, + { + "name": "wimg/php-compatibility", + "version": "8.0.1", + "source": { + "type": "git", + "url": "https://github.com/wimg/PHPCompatibility.git", + "reference": "4c4385fb891dff0501009670f988d4fe36785249" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wimg/PHPCompatibility/zipball/4c4385fb891dff0501009670f988d4fe36785249", + "reference": "4c4385fb891dff0501009670f988d4fe36785249", + "shasum": "" + }, + "require": { + "php": ">=5.3", + "squizlabs/php_codesniffer": "^2.2 || ^3.0.2" + }, + "conflict": { + "squizlabs/php_codesniffer": "2.6.2" + }, + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.1" + }, + "type": "phpcodesniffer-standard", + "autoload": { + "psr-4": { + "PHPCompatibility\\": "PHPCompatibility/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0" + ], + "authors": [ + { + "name": "Wim Godden", + "role": "lead" + } + ], + "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP version compatibility.", + "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", + "keywords": [ + "compatibility", + "phpcs", + "standards" + ], + "time": "2017-08-07T19:39:05+00:00" + }, + { + "name": "wp-coding-standards/wpcs", + "version": "0.13.1", + "source": { + "type": "git", + "url": "https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git", + "reference": "1f64b1a0b5b789822d0303436ee4e30e0135e4dc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/zipball/1f64b1a0b5b789822d0303436ee4e30e0135e4dc", + "reference": "1f64b1a0b5b789822d0303436ee4e30e0135e4dc", + "shasum": "" + }, + "require": { + "php": ">=5.3", + "squizlabs/php_codesniffer": "^2.9.0 || ^3.0.2" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.1" + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Contributors", + "homepage": "https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/graphs/contributors" + } + ], + "description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions", + "keywords": [ + "phpcs", + "standards", + "wordpress" + ], + "time": "2017-08-05T16:08:58+00:00" + } + ], + "aliases": [], + "minimum-stability": "dev", + "stability-flags": { + "roave/security-advisories": 20 + }, + "prefer-stable": true, + "prefer-lowest": false, + "platform": { + "php": ">=5.3.29" + }, + "platform-dev": [], + "platform-overrides": { + "php": "5.3.29" + } +} diff --git a/features/aliases.feature b/features/aliases.feature new file mode 100644 index 000000000..22569faea --- /dev/null +++ b/features/aliases.feature @@ -0,0 +1,405 @@ +Feature: Create shortcuts to specific WordPress installs + + Scenario: Alias for a path to a specific WP install + Given a WP installation in 'foo' + And I run `mkdir bar` + And a wp-cli.yml file: + """ + @foo: + path: foo + """ + + When I try `wp core is-installed` + Then STDERR should contain: + """ + Error: This does not seem to be a WordPress install. + """ + And the return code should be 1 + + When I run `wp @foo core is-installed` + Then the return code should be 0 + + When I run `cd bar; wp @foo core is-installed` + Then the return code should be 0 + + Scenario: Error when invalid alias provided + Given an empty directory + + When I try `wp @test option get home` + Then STDERR should be: + """ + Error: Alias '@test' not found. + """ + + Scenario: Provide suggestion when invalid alias is provided + Given an empty directory + And a wp-cli.yml file: + """ + @test2: + path: foo + """ + + When I try `wp @test option get home` + Then STDERR should be: + """ + Error: Alias '@test' not found. + Did you mean '@test2'? + """ + + Scenario: Treat global params as local when included in alias + Given a WP installation in 'foo' + And a wp-cli.yml file: + """ + @foo: + path: foo + """ + + When I run `wp @foo option get home` + Then STDOUT should be: + """ + http://example.com + """ + + When I try `wp @foo option get home --path=foo` + Then STDERR should contain: + """ + Parameter errors: + """ + And STDERR should contain: + """ + unknown --path parameter + """ + + When I run `wp @foo eval 'echo get_current_user_id();' --user=admin` + Then STDOUT should be: + """ + 1 + """ + + Given a wp-cli.yml file: + """ + @foo: + path: foo + user: admin + """ + + When I run `wp @foo eval 'echo get_current_user_id();'` + Then STDOUT should be: + """ + 1 + """ + + When I try `wp @foo eval 'echo get_current_user_id();' --user=admin` + Then STDERR should contain: + """ + Parameter errors: + """ + And STDERR should contain: + """ + unknown --user parameter + """ + + Scenario: Support global params specific to the WordPress install, not WP-CLI generally + Given a WP installation in 'foo' + And a wp-cli.yml file: + """ + @foo: + path: foo + debug: true + """ + + When I run `wp @foo option get home` + Then STDOUT should be: + """ + http://example.com + """ + And STDERR should be empty + + Scenario: List available aliases + Given an empty directory + And a wp-cli.yml file: + """ + @foo: + path: foo + """ + + When I run `wp eval --skip-wordpress 'echo realpath( getenv( "RUN_DIR" ) );'` + Then save STDOUT as {TEST_DIR} + + When I run `wp cli alias` + Then STDOUT should be YAML containing: + """ + @all: Run command against every registered alias. + @foo: + path: {TEST_DIR}/foo + """ + + When I run `wp cli aliases` + Then STDOUT should be YAML containing: + """ + @all: Run command against every registered alias. + @foo: + path: {TEST_DIR}/foo + """ + + When I run `wp cli alias --format=json` + Then STDOUT should be JSON containing: + """ + {"@all":"Run command against every registered alias.","@foo":{"path":"{TEST_DIR}/foo"}} + """ + + Scenario: Defining a project alias completely overrides a global alias + Given a WP installation in 'foo' + And a config.yml file: + """ + @foo: + path: foo + """ + + When I run `WP_CLI_CONFIG_PATH=config.yml wp @foo option get home` + Then STDOUT should be: + """ + http://example.com + """ + + Given a wp-cli.yml file: + """ + @foo: + path: none-existent-install + """ + When I try `WP_CLI_CONFIG_PATH=config.yml wp @foo option get home` + Then STDERR should contain: + """ + Error: This does not seem to be a WordPress install. + """ + + Scenario: Use a group of aliases to run a command against multiple installs + Given a WP installation in 'foo' + And a WP install in 'bar' + And a wp-cli.yml file: + """ + @both: + - @foo + - @bar + @invalid: + - @foo + - @baz + @foo: + path: foo + @bar: + path: bar + """ + + When I run `wp @foo option update home 'http://apple.com'` + And I run `wp @foo option get home` + Then STDOUT should contain: + """ + http://apple.com + """ + + When I run `wp @bar option update home 'http://google.com'` + And I run `wp @bar option get home` + Then STDOUT should contain: + """ + http://google.com + """ + + When I try `wp @invalid option get home` + Then STDERR should be: + """ + Error: Group '@invalid' contains one or more invalid aliases: @baz + """ + + When I run `wp @both option get home` + Then STDOUT should be: + """ + @foo + http://apple.com + @bar + http://google.com + """ + + When I run `wp @both option get home --quiet` + Then STDOUT should be: + """ + http://apple.com + http://google.com + """ + + Scenario: Register '@all' alias for running on one or more aliases + Given a WP installation in 'foo' + And a WP install in 'bar' + And a wp-cli.yml file: + """ + @foo: + path: foo + @bar: + path: bar + """ + + When I run `wp @foo option update home 'http://apple.com'` + And I run `wp @foo option get home` + Then STDOUT should contain: + """ + http://apple.com + """ + + When I run `wp @bar option update home 'http://google.com'` + And I run `wp @bar option get home` + Then STDOUT should contain: + """ + http://google.com + """ + + When I run `wp @all option get home` + Then STDOUT should be: + """ + @foo + http://apple.com + @bar + http://google.com + """ + + When I run `wp @all option get home --quiet` + Then STDOUT should be: + """ + http://apple.com + http://google.com + """ + + Scenario: Don't register '@all' when its already set + Given a WP installation in 'foo' + And a WP install in 'bar' + And a wp-cli.yml file: + """ + @all: + path: foo + @bar: + path: bar + """ + + When I run `wp @all option get home | wc -l | tr -d ' '` + Then STDOUT should be: + """ + 1 + """ + + Scenario: Error when '@all' is used without aliases defined + Given an empty directory + + When I try `wp @all option get home` + Then STDERR should be: + """ + Error: Cannot use '@all' when no aliases are registered. + """ + + Scenario: Alias for a subsite of a multisite install + Given a WP multisite subdomain installation + And a wp-cli.yml file: + """ + url: example.com + @subsite: + url: subsite.example.com + """ + + When I run `wp site create --slug=subsite` + Then STDOUT should not be empty + + When I run `wp option get siteurl` + Then STDOUT should be: + """ + http://example.com + """ + + When I run `wp @subsite option get siteurl` + Then STDOUT should be: + """ + http://subsite.example.com + """ + + When I try `wp @subsite option get siteurl --url=subsite.example.com` + Then STDERR should be: + """ + Error: Parameter errors: + unknown --url parameter + """ + + Scenario: Global parameters should be passed to grouped aliases + Given a WP installation in 'foo' + And a WP install in 'bar' + And a wp-cli.yml file: + """ + @foo: + path: foo + @bar: + path: bar + @foobar: + - @foo + - @bar + """ + + When I try `wp core is-installed --allow-root --debug` + Then STDERR should contain: + """ + Error: This does not seem to be a WordPress install. + """ + And STDERR should contain: + """ + core is-installed --allow-root --debug + """ + And the return code should be 1 + + When I try `wp @foo core is-installed --allow-root --debug` + Then the return code should be 0 + And STDERR should contain: + """ + @foo core is-installed --allow-root --debug + """ + + When I try `cd bar; wp @bar core is-installed --allow-root --debug` + Then the return code should be 0 + And STDERR should contain: + """ + @bar core is-installed --allow-root --debug + """ + + When I try `wp @foobar core is-installed --allow-root --debug` + Then the return code should be 0 + And STDERR should contain: + """ + @foobar core is-installed --allow-root --debug + """ + And STDERR should contain: + """ + @foo core is-installed --allow-root --debug + """ + And STDERR should contain: + """ + @bar core is-installed --allow-root --debug + """ + + Scenario Outline: Check that proc_open() and proc_close() aren't disabled for grouped aliases + Given a WP installation in 'foo' + And a WP install in 'bar' + And a wp-cli.yml file: + """ + @foo: + path: foo + @bar: + path: bar + @foobar: + - @foo + - @bar + """ + + When I try `{INVOKE_WP_CLI_WITH_PHP_ARGS--ddisable_functions=} @foobar core is-installed` + Then STDERR should contain: + """ + Error: Cannot do 'group alias': The PHP functions `proc_open()` and/or `proc_close()` are disabled + """ + And the return code should be 1 + + Examples: + | func | + | proc_open | + | proc_close | diff --git a/features/bootstrap.feature b/features/bootstrap.feature new file mode 100644 index 000000000..8869736a8 --- /dev/null +++ b/features/bootstrap.feature @@ -0,0 +1,358 @@ +Feature: Bootstrap WP-CLI + + @require-opcache-save-comments + Scenario: Basic Composer stack + Given an empty directory + And a composer.json file: + """ + { + "name": "wp-cli/composer-test", + "type": "project", + "require": { + "wp-cli/wp-cli": "1.1.0" + } + } + """ + # Note: Composer outputs messages to stderr. + And I run `composer install --no-interaction 2>&1` + + When I run `vendor/bin/wp cli version` + Then STDOUT should contain: + """ + WP-CLI 1.1.0 + """ + + Scenario: Composer stack with override requirement before WP-CLI + Given an empty directory + And a composer.json file: + """ + { + "name": "wp-cli/composer-test", + "type": "project", + "minimum-stability": "dev", + "prefer-stable": true, + "repositories": [ + { + "type": "path", + "url": "./cli-override-command", + "options": { + "symlink": false + } + } + ], + "require": { + "wp-cli/cli-override-command": "*", + "wp-cli/wp-cli": "dev-master" + } + } + """ + And a cli-override-command/cli.php file: + """ + 'before_wp_load' ) ); + """ + And a cli-override-command/src/CLI_Command.php file: + """ + &1` + + When I run `vendor/bin/wp cli version` + Then STDOUT should contain: + """ + Success: WP-Override-CLI + """ + + Scenario: Override command bundled with current source + + Given an empty directory + And a cli-override-command/cli.php file: + """ + 'before_wp_load' ) ); + """ + And a cli-override-command/src/CLI_Command.php file: + """ + &1` + + When I run `wp cli version` + Then STDOUT should contain: + """ + WP-CLI + """ + + When I run `wp --require=cli-override-command/cli.php cli version` + Then STDOUT should contain: + """ + WP-Override-CLI + """ + + Scenario: Override command bundled with freshly built PHAR + + Given an empty directory + And a new Phar with the same version + And a cli-override-command/cli.php file: + """ + 'before_wp_load' ) ); + """ + And a cli-override-command/src/CLI_Command.php file: + """ + &1` + + When I run `{PHAR_PATH} cli version` + Then STDOUT should contain: + """ + WP-CLI + """ + + When I run `{PHAR_PATH} --require=cli-override-command/cli.php cli version` + Then STDOUT should contain: + """ + WP-Override-CLI + """ + + Scenario: Composer stack with both WordPress and wp-cli as dependencies (command line) + Given a WP installation with Composer + And a dependency on current wp-cli + When I run `vendor/bin/wp option get blogname` + Then STDOUT should contain: + """ + WP CLI Site with both WordPress and wp-cli as Composer dependencies + """ + + @require-php-5.4 + Scenario: Composer stack with both WordPress and wp-cli as dependencies (web) + Given a WP installation with Composer + And a dependency on current wp-cli + And a PHP built-in web server to serve 'wordpress' + Then the HTTP status code should be 200 + + Scenario: Composer stack with both WordPress and wp-cli as dependencies and a custom vendor directory + Given a WP installation with Composer and a custom vendor directory 'vendor-custom' + And a dependency on current wp-cli + Then the vendor-custom/autoload_commands.php file should exist + Then the vendor-custom/autoload_framework.php file should exist + When I run `vendor-custom/bin/wp option get blogname` + Then STDOUT should contain: + """ + WP CLI Site with both WordPress and wp-cli as Composer dependencies + """ + + Scenario: Setting an environment variable passes the value through + Given an empty directory + And WP files + And a database + And a env-var.php file: + """ + autoload->files ) ) { + $contents = 'require:' . PHP_EOL; + foreach( $composer->autoload->files as $file ) { + $contents .= ' - ' . dirname( dirname( dirname( __FILE__ ) ) ) . '/' . $file . PHP_EOL; + } + @mkdir( sys_get_temp_dir() . '/wp-cli-package-test/' ); + $project_config = sys_get_temp_dir() . '/wp-cli-package-test/config.yml'; + file_put_contents( $project_config, $contents ); + putenv( 'WP_CLI_CONFIG_PATH=' . $project_config ); + } + } +// Inside WP-CLI +} else { + require_once __DIR__ . '/../../php/utils.php'; + require_once __DIR__ . '/../../php/WP_CLI/Process.php'; + require_once __DIR__ . '/../../php/WP_CLI/ProcessRun.php'; + if ( file_exists( __DIR__ . '/../../vendor/autoload.php' ) ) { + require_once __DIR__ . '/../../vendor/autoload.php'; + } else if ( file_exists( __DIR__ . '/../../../../autoload.php' ) ) { + require_once __DIR__ . '/../../../../autoload.php'; + } +} + +/** + * Features context. + */ +class FeatureContext extends BehatContext implements ClosuredContextInterface { + + /** + * The current working directory for scenarios that have a "Given a WP installation" or "Given an empty directory" step. Variable RUN_DIR. Lives until the end of the scenario. + */ + private static $run_dir; + + /** + * Where WordPress core is downloaded to for caching, and which is copied to RUN_DIR during a "Given a WP installation" step. Lives until manually deleted. + */ + private static $cache_dir; + + /** + * The directory that holds the install cache, and which is copied to RUN_DIR during a "Given a WP installation" step. Recreated on each suite run. + */ + private static $install_cache_dir; + + /** + * The directory that the WP-CLI cache (WP_CLI_CACHE_DIR, normally "$HOME/.wp-cli/cache") is set to on a "Given an empty cache" step. + * Variable SUITE_CACHE_DIR. Lives until the end of the scenario (or until another "Given an empty cache" step within the scenario). + */ + private static $suite_cache_dir; + + /** + * Where the current WP-CLI source repository is copied to for Composer-based tests with a "Given a dependency on current wp-cli" step. + * Variable COMPOSER_LOCAL_REPOSITORY. Lives until the end of the suite. + */ + private static $composer_local_repository; + + /** + * The test database settings. All but `dbname` can be set via environment variables. The database is dropped at the start of each scenario and created on a "Given a WP installation" step. + */ + private static $db_settings = array( + 'dbname' => 'wp_cli_test', + 'dbuser' => 'wp_cli_test', + 'dbpass' => 'password1', + 'dbhost' => '127.0.0.1', + ); + + /** + * Array of background process ids started by the current scenario. Used to terminate them at the end of the scenario. + */ + private $running_procs = array(); + + /** + * Array of variables available as {VARIABLE_NAME}. Some are always set: CORE_CONFIG_SETTINGS, SRC_DIR, CACHE_DIR, WP_VERSION-version-latest. + * Some are step-dependent: RUN_DIR, SUITE_CACHE_DIR, COMPOSER_LOCAL_REPOSITORY, PHAR_PATH. One is set on use: INVOKE_WP_CLI_WITH_PHP_ARGS-args. + * Scenarios can define their own variables using "Given save" steps. Variables are reset for each scenario. + */ + public $variables = array(); + + /** + * The current feature file and scenario line number as '.'. Used in RUN_DIR and SUITE_CACHE_DIR directory names. Set at the start of each scenario. + */ + private static $temp_dir_infix; + + /** + * Settings and variables for WP_CLI_TEST_LOG_RUN_TIMES run time logging. + */ + private static $log_run_times; // Whether to log run times - WP_CLI_TEST_LOG_RUN_TIMES env var. Set on `@BeforeScenario'. + private static $suite_start_time; // When the suite started, set on `@BeforeScenario'. + private static $output_to; // Where to output log - stdout|error_log. Set on `@BeforeSuite`. + private static $num_top_processes; // Number of processes/methods to output by longest run times. Set on `@BeforeSuite`. + private static $num_top_scenarios; // Number of scenarios to output by longest run times. Set on `@BeforeSuite`. + + private static $scenario_run_times = array(); // Scenario run times (top `self::$num_top_scenarios` only). + private static $scenario_count = 0; // Scenario count, incremented on `@AfterScenario`. + private static $proc_method_run_times = array(); // Array of run time info for proc methods, keyed by method name and arg, each a 2-element array containing run time and run count. + + /** + * Get the environment variables required for launched `wp` processes + */ + private static function get_process_env_variables() { + // Ensure we're using the expected `wp` binary + $bin_dir = getenv( 'WP_CLI_BIN_DIR' ) ?: realpath( __DIR__ . '/../../bin' ); + $vendor_dir = realpath( __DIR__ . '/../../vendor/bin' ); + $path_separator = Utils\is_windows() ? ';' : ':'; + $env = array( + 'PATH' => $bin_dir . $path_separator . $vendor_dir . $path_separator . getenv( 'PATH' ), + 'BEHAT_RUN' => 1, + 'HOME' => sys_get_temp_dir() . '/wp-cli-home', + ); + if ( $config_path = getenv( 'WP_CLI_CONFIG_PATH' ) ) { + $env['WP_CLI_CONFIG_PATH'] = $config_path; + } + if ( $term = getenv( 'TERM' ) ) { + $env['TERM'] = $term; + } + if ( $php_args = getenv( 'WP_CLI_PHP_ARGS' ) ) { + $env['WP_CLI_PHP_ARGS'] = $php_args; + } + if ( $php_used = getenv( 'WP_CLI_PHP_USED' ) ) { + $env['WP_CLI_PHP_USED'] = $php_used; + } + if ( $php = getenv( 'WP_CLI_PHP' ) ) { + $env['WP_CLI_PHP'] = $php; + } + if ( $travis_build_dir = getenv( 'TRAVIS_BUILD_DIR' ) ) { + $env['TRAVIS_BUILD_DIR'] = $travis_build_dir; + } + if ( $github_token = getenv( 'GITHUB_TOKEN' ) ) { + $env['GITHUB_TOKEN'] = $github_token; + } + return $env; + } + + /** + * We cache the results of `wp core download` to improve test performance. + * Ideally, we'd cache at the HTTP layer for more reliable tests. + */ + private static function cache_wp_files() { + $wp_version_suffix = ( $wp_version = getenv( 'WP_VERSION' ) ) ? "-$wp_version" : ''; + self::$cache_dir = sys_get_temp_dir() . '/wp-cli-test-core-download-cache' . $wp_version_suffix; + + if ( is_readable( self::$cache_dir . '/wp-config-sample.php' ) ) + return; + + $cmd = Utils\esc_cmd( 'wp core download --force --path=%s', self::$cache_dir ); + if ( $wp_version ) { + $cmd .= Utils\esc_cmd( ' --version=%s', $wp_version ); + } + Process::create( $cmd, null, self::get_process_env_variables() )->run_check(); + } + + /** + * @BeforeSuite + */ + public static function prepare( SuiteEvent $event ) { + // Test performance statistics - useful for detecting slow tests. + if ( self::$log_run_times = getenv( 'WP_CLI_TEST_LOG_RUN_TIMES' ) ) { + self::log_run_times_before_suite( $event ); + } + + $result = Process::create( 'wp cli info', null, self::get_process_env_variables() )->run_check(); + echo PHP_EOL; + echo $result->stdout; + echo PHP_EOL; + self::cache_wp_files(); + $result = Process::create( Utils\esc_cmd( 'wp core version --path=%s', self::$cache_dir ) , null, self::get_process_env_variables() )->run_check(); + echo 'WordPress ' . $result->stdout; + echo PHP_EOL; + + // Remove install cache if any (not setting the static var). + $wp_version_suffix = ( $wp_version = getenv( 'WP_VERSION' ) ) ? "-$wp_version" : ''; + $install_cache_dir = sys_get_temp_dir() . '/wp-cli-test-core-install-cache' . $wp_version_suffix; + if ( file_exists( $install_cache_dir ) ) { + self::remove_dir( $install_cache_dir ); + } + } + + /** + * @AfterSuite + */ + public static function afterSuite( SuiteEvent $event ) { + if ( self::$composer_local_repository ) { + self::remove_dir( self::$composer_local_repository ); + self::$composer_local_repository = null; + } + + if ( self::$log_run_times ) { + self::log_run_times_after_suite( $event ); + } + } + + /** + * @BeforeScenario + */ + public function beforeScenario( $event ) { + if ( self::$log_run_times ) { + self::log_run_times_before_scenario( $event ); + } + + $this->variables['SRC_DIR'] = realpath( __DIR__ . '/../..' ); + + // Used in the names of the RUN_DIR and SUITE_CACHE_DIR directories. + self::$temp_dir_infix = null; + if ( $file = self::get_event_file( $event, $line ) ) { + self::$temp_dir_infix = basename( $file ) . '.' . $line; + } + } + + /** + * @AfterScenario + */ + public function afterScenario( $event ) { + + if ( self::$run_dir ) { + // remove altered WP install, unless there's an error + if ( $event->getResult() < 4 ) { + self::remove_dir( self::$run_dir ); + } + self::$run_dir = null; + } + + // Remove WP-CLI package directory if any. Set to `wp package path` by package-command and scaffold-package-command features, and by cli-info.feature. + if ( isset( $this->variables['PACKAGE_PATH'] ) ) { + self::remove_dir( $this->variables['PACKAGE_PATH'] ); + } + + // Remove SUITE_CACHE_DIR if any. + if ( self::$suite_cache_dir ) { + self::remove_dir( self::$suite_cache_dir ); + self::$suite_cache_dir = null; + } + + // Remove any background processes. + foreach ( $this->running_procs as $proc ) { + $status = proc_get_status( $proc ); + self::terminate_proc( $status['pid'] ); + } + + if ( self::$log_run_times ) { + self::log_run_times_after_scenario( $event ); + } + } + + /** + * Terminate a process and any of its children. + */ + private static function terminate_proc( $master_pid ) { + + $output = `ps -o ppid,pid,command | grep $master_pid`; + + foreach ( explode( PHP_EOL, $output ) as $line ) { + if ( preg_match( '/^\s*(\d+)\s+(\d+)/', $line, $matches ) ) { + $parent = $matches[1]; + $child = $matches[2]; + + if ( $parent == $master_pid ) { + self::terminate_proc( $child ); + } + } + } + + if ( ! posix_kill( (int) $master_pid, 9 ) ) { + $errno = posix_get_last_error(); + // Ignore "No such process" error as that's what we want. + if ( 3 /*ESRCH*/ !== $errno ) { + throw new RuntimeException( posix_strerror( $errno ) ); + } + } + } + + /** + * Create a temporary WP_CLI_CACHE_DIR. Exposed as SUITE_CACHE_DIR in "Given an empty cache" step. + */ + public static function create_cache_dir() { + if ( self::$suite_cache_dir ) { + self::remove_dir( self::$suite_cache_dir ); + } + self::$suite_cache_dir = sys_get_temp_dir() . '/' . uniqid( 'wp-cli-test-suite-cache-' . self::$temp_dir_infix . '-', TRUE ); + mkdir( self::$suite_cache_dir ); + return self::$suite_cache_dir; + } + + /** + * Initializes context. + * Every scenario gets its own context object. + * + * @param array $parameters context parameters (set them up through behat.yml) + */ + public function __construct( array $parameters ) { + if ( getenv( 'WP_CLI_TEST_DBUSER' ) ) { + self::$db_settings['dbuser'] = getenv( 'WP_CLI_TEST_DBUSER' ); + } + + if ( false !== getenv( 'WP_CLI_TEST_DBPASS' ) ) { + self::$db_settings['dbpass'] = getenv( 'WP_CLI_TEST_DBPASS' ); + } + + if ( getenv( 'WP_CLI_TEST_DBHOST' ) ) { + self::$db_settings['dbhost'] = getenv( 'WP_CLI_TEST_DBHOST' ); + } + + $this->drop_db(); + $this->set_cache_dir(); + $this->variables['CORE_CONFIG_SETTINGS'] = Utils\assoc_args_to_str( self::$db_settings ); + } + + public function getStepDefinitionResources() { + return glob( __DIR__ . '/../steps/*.php' ); + } + + public function getHookDefinitionResources() { + return array(); + } + + /** + * Replace standard {VARIABLE_NAME} variables and the special {INVOKE_WP_CLI_WITH_PHP_ARGS-args} and {WP_VERSION-version-latest} variables. + * Note that standard variable names can only contain uppercase letters, digits and underscores and cannot begin with a digit. + */ + public function replace_variables( $str ) { + if ( false !== strpos( $str, '{INVOKE_WP_CLI_WITH_PHP_ARGS-' ) ) { + $str = $this->replace_invoke_wp_cli_with_php_args( $str ); + } + $str = preg_replace_callback( '/\{([A-Z_][A-Z_0-9]*)\}/', array( $this, 'replace_var' ), $str ); + if ( false !== strpos( $str, '{WP_VERSION-' ) ) { + $str = $this->replace_wp_versions( $str ); + } + return $str; + } + + /** + * Substitute {INVOKE_WP_CLI_WITH_PHP_ARGS-args} variables. + */ + private function replace_invoke_wp_cli_with_php_args( $str ) { + static $phar_path = null, $shell_path = null; + + if ( null === $phar_path ) { + $phar_path = false; + $phar_begin = '#!/usr/bin/env php'; + $phar_begin_len = strlen( $phar_begin ); + if ( ( $bin_dir = getenv( 'WP_CLI_BIN_DIR' ) ) && file_exists( $bin_dir . '/wp' ) && $phar_begin === file_get_contents( $bin_dir . '/wp', false, null, 0, $phar_begin_len ) ) { + $phar_path = $bin_dir . '/wp'; + } else { + $src_dir = dirname( dirname( __DIR__ ) ); + $bin_path = $src_dir . '/bin/wp'; + $vendor_bin_path = $src_dir . '/vendor/bin/wp'; + if ( file_exists( $bin_path ) && is_executable( $bin_path ) ) { + $shell_path = $bin_path; + } elseif ( file_exists( $vendor_bin_path ) && is_executable( $vendor_bin_path ) ) { + $shell_path = $vendor_bin_path; + } else { + $shell_path = 'wp'; + } + } + } + + $str = preg_replace_callback( '/{INVOKE_WP_CLI_WITH_PHP_ARGS-([^}]*)}/', function ( $matches ) use ( $phar_path, $shell_path ) { + return $phar_path ? "php {$matches[1]} {$phar_path}" : ( 'WP_CLI_PHP_ARGS=' . escapeshellarg( $matches[1] ) . ' ' . $shell_path ); + }, $str ); + + return $str; + } + + /** + * Replace variables callback. + */ + private function replace_var( $matches ) { + $cmd = $matches[0]; + + foreach ( array_slice( $matches, 1 ) as $key ) { + $cmd = str_replace( '{' . $key . '}', $this->variables[ $key ], $cmd ); + } + + return $cmd; + } + + /** + * Substitute {WP_VERSION-version-latest} variables. + */ + private function replace_wp_versions( $str ) { + static $wp_versions = null; + if ( null === $wp_versions ) { + $wp_versions = array(); + + $response = Requests::get( 'https://api.wordpress.org/core/version-check/1.7/', null, array( 'timeout' => 30 ) ); + if ( 200 === $response->status_code && ( $body = json_decode( $response->body ) ) && is_object( $body ) && isset( $body->offers ) && is_array( $body->offers ) ) { + // Latest version alias. + $wp_versions["{WP_VERSION-latest}"] = count( $body->offers ) ? $body->offers[0]->version : ''; + foreach ( $body->offers as $offer ) { + $sub_ver = preg_replace( '/(^[0-9]+\.[0-9]+)\.[0-9]+$/', '$1', $offer->version ); + $sub_ver_key = "{WP_VERSION-{$sub_ver}-latest}"; + + $main_ver = preg_replace( '/(^[0-9]+)\.[0-9]+$/', '$1', $sub_ver ); + $main_ver_key = "{WP_VERSION-{$main_ver}-latest}"; + + if ( ! isset( $wp_versions[ $main_ver_key ] ) ) { + $wp_versions[ $main_ver_key ] = $offer->version; + } + if ( ! isset( $wp_versions[ $sub_ver_key ] ) ) { + $wp_versions[ $sub_ver_key ] = $offer->version; + } + } + } + } + return strtr( $str, $wp_versions ); + } + + /** + * Get the file and line number for the current behat event. + */ + private static function get_event_file( $event, &$line ) { + if ( method_exists( $event, 'getScenario' ) ) { + $scenario_feature = $event->getScenario(); + } elseif ( method_exists( $event, 'getFeature' ) ) { + $scenario_feature = $event->getFeature(); + } elseif ( method_exists( $event, 'getOutline' ) ) { + $scenario_feature = $event->getOutline(); + } else { + return null; + } + $line = $scenario_feature->getLine(); + return $scenario_feature->getFile(); + } + + /** + * Create the RUN_DIR directory, unless already set for this scenario. + */ + public function create_run_dir() { + if ( !isset( $this->variables['RUN_DIR'] ) ) { + self::$run_dir = $this->variables['RUN_DIR'] = sys_get_temp_dir() . '/' . uniqid( 'wp-cli-test-run-' . self::$temp_dir_infix . '-', TRUE ); + mkdir( $this->variables['RUN_DIR'] ); + } + } + + public function build_phar( $version = 'same' ) { + $this->variables['PHAR_PATH'] = $this->variables['RUN_DIR'] . '/' . uniqid( "wp-cli-build-", TRUE ) . '.phar'; + + // Test running against a package installed as a WP-CLI dependency + // WP-CLI installed as a project dependency + $make_phar_path = __DIR__ . '/../../../../../utils/make-phar.php'; + if ( ! file_exists( $make_phar_path ) ) { + // Test running against WP-CLI proper + $make_phar_path = __DIR__ . '/../../utils/make-phar.php'; + if ( ! file_exists( $make_phar_path ) ) { + // WP-CLI as a dependency of this project + $make_phar_path = __DIR__ . '/../../vendor/wp-cli/wp-cli/utils/make-phar.php'; + } + } + + $this->proc( Utils\esc_cmd( + 'php -dphar.readonly=0 %1$s %2$s --version=%3$s && chmod +x %2$s', + $make_phar_path, + $this->variables['PHAR_PATH'], + $version + ) )->run_check(); + } + + public function download_phar( $version = 'same' ) { + if ( 'same' === $version ) { + $version = WP_CLI_VERSION; + } + + $download_url = sprintf( + 'https://github.com/wp-cli/wp-cli/releases/download/v%1$s/wp-cli-%1$s.phar', + $version + ); + + $this->variables['PHAR_PATH'] = $this->variables['RUN_DIR'] . '/' + . uniqid( 'wp-cli-download-', true ) + . '.phar'; + + Process::create( Utils\esc_cmd( + 'curl -sSfL %1$s > %2$s && chmod +x %2$s', + $download_url, + $this->variables['PHAR_PATH'] + ) )->run_check(); + } + + /** + * CACHE_DIR is a cache for downloaded test data such as images. Lives until manually deleted. + */ + private function set_cache_dir() { + $path = sys_get_temp_dir() . '/wp-cli-test-cache'; + if ( ! file_exists( $path ) ) { + mkdir( $path ); + } + $this->variables['CACHE_DIR'] = $path; + } + + /** + * Run a MySQL command with `$db_settings`. + * + * @param string $sql_cmd Command to run. + * @param array $assoc_args Optional. Associative array of options. Default empty. + * @param bool $add_database Optional. Whether to add dbname to the $sql_cmd. Default false. + */ + private static function run_sql( $sql_cmd, $assoc_args = array(), $add_database = false ) { + $default_assoc_args = array( + 'host' => self::$db_settings['dbhost'], + 'user' => self::$db_settings['dbuser'], + 'pass' => self::$db_settings['dbpass'], + ); + if ( $add_database ) { + $sql_cmd .= ' ' . escapeshellarg( self::$db_settings['dbname'] ); + } + $start_time = microtime( true ); + Utils\run_mysql_command( $sql_cmd, array_merge( $assoc_args, $default_assoc_args ) ); + if ( self::$log_run_times ) { + self::log_proc_method_run_time( 'run_sql ' . $sql_cmd, $start_time ); + } + } + + public function create_db() { + $dbname = self::$db_settings['dbname']; + self::run_sql( 'mysql --no-defaults', array( 'execute' => "CREATE DATABASE IF NOT EXISTS $dbname" ) ); + } + + public function drop_db() { + $dbname = self::$db_settings['dbname']; + self::run_sql( 'mysql --no-defaults', array( 'execute' => "DROP DATABASE IF EXISTS $dbname" ) ); + } + + public function proc( $command, $assoc_args = array(), $path = '' ) { + if ( !empty( $assoc_args ) ) + $command .= Utils\assoc_args_to_str( $assoc_args ); + + $env = self::get_process_env_variables(); + if ( isset( $this->variables['SUITE_CACHE_DIR'] ) ) { + $env['WP_CLI_CACHE_DIR'] = $this->variables['SUITE_CACHE_DIR']; + } + + if ( isset( $this->variables['RUN_DIR'] ) ) { + $cwd = "{$this->variables['RUN_DIR']}/{$path}"; + } else { + $cwd = null; + } + + return Process::create( $command, $cwd, $env ); + } + + /** + * Start a background process. Will automatically be closed when the tests finish. + */ + public function background_proc( $cmd ) { + $descriptors = array( + 0 => STDIN, + 1 => array( 'pipe', 'w' ), + 2 => array( 'pipe', 'w' ), + ); + + $proc = proc_open( $cmd, $descriptors, $pipes, $this->variables['RUN_DIR'], self::get_process_env_variables() ); + + sleep(1); + + $status = proc_get_status( $proc ); + + if ( !$status['running'] ) { + $stderr = is_resource( $pipes[2] ) ? ( ': ' . stream_get_contents( $pipes[2] ) ) : ''; + throw new RuntimeException( sprintf( "Failed to start background process '%s'%s.", $cmd, $stderr ) ); + } else { + $this->running_procs[] = $proc; + } + } + + public function move_files( $src, $dest ) { + rename( $this->variables['RUN_DIR'] . "/$src", $this->variables['RUN_DIR'] . "/$dest" ); + } + + /** + * Remove a directory (recursive). + */ + public static function remove_dir( $dir ) { + Process::create( Utils\esc_cmd( 'rm -rf %s', $dir ) )->run_check(); + } + + /** + * Copy a directory (recursive). Destination directory must exist. + */ + public static function copy_dir( $src_dir, $dest_dir ) { + Process::create( Utils\esc_cmd( "cp -r %s/* %s", $src_dir, $dest_dir ) )->run_check(); + } + + public function add_line_to_wp_config( &$wp_config_code, $line ) { + $token = "/* That's all, stop editing!"; + + $wp_config_code = str_replace( $token, "$line\n\n$token", $wp_config_code ); + } + + public function download_wp( $subdir = '' ) { + $dest_dir = $this->variables['RUN_DIR'] . "/$subdir"; + + if ( $subdir ) { + mkdir( $dest_dir ); + } + + self::copy_dir( self::$cache_dir, $dest_dir ); + + // disable emailing + mkdir( $dest_dir . '/wp-content/mu-plugins' ); + copy( __DIR__ . '/../extra/no-mail.php', $dest_dir . '/wp-content/mu-plugins/no-mail.php' ); + } + + public function create_config( $subdir = '', $extra_php = false ) { + $params = self::$db_settings; + + // Replaces all characters that are not alphanumeric or an underscore into an underscore. + $params['dbprefix'] = $subdir ? preg_replace( '#[^a-zA-Z\_0-9]#', '_', $subdir ) : 'wp_'; + + $params['skip-salts'] = true; + + if( false !== $extra_php ) { + $params['extra-php'] = $extra_php; + } + + $config_cache_path = ''; + if ( self::$install_cache_dir ) { + $config_cache_path = self::$install_cache_dir . '/config_' . md5( implode( ':', $params ) . ':subdir=' . $subdir ); + $run_dir = '' !== $subdir ? ( $this->variables['RUN_DIR'] . "/$subdir" ) : $this->variables['RUN_DIR']; + } + + if ( $config_cache_path && file_exists( $config_cache_path ) ) { + copy( $config_cache_path, $run_dir . '/wp-config.php' ); + } else { + $this->proc( 'wp config create', $params, $subdir )->run_check(); + if ( $config_cache_path && file_exists( $run_dir . '/wp-config.php' ) ) { + copy( $run_dir . '/wp-config.php', $config_cache_path ); + } + } + } + + public function install_wp( $subdir = '' ) { + $wp_version_suffix = ( $wp_version = getenv( 'WP_VERSION' ) ) ? "-$wp_version" : ''; + self::$install_cache_dir = sys_get_temp_dir() . '/wp-cli-test-core-install-cache' . $wp_version_suffix; + if ( ! file_exists( self::$install_cache_dir ) ) { + mkdir( self::$install_cache_dir ); + } + + $subdir = $this->replace_variables( $subdir ); + + $this->create_db(); + $this->create_run_dir(); + $this->download_wp( $subdir ); + $this->create_config( $subdir ); + + $install_args = array( + 'url' => 'http://example.com', + 'title' => 'WP CLI Site', + 'admin_user' => 'admin', + 'admin_email' => 'admin@example.com', + 'admin_password' => 'password1', + 'skip-email' => true, + ); + + $install_cache_path = ''; + if ( self::$install_cache_dir ) { + $install_cache_path = self::$install_cache_dir . '/install_' . md5( implode( ':', $install_args ) . ':subdir=' . $subdir ); + $run_dir = '' !== $subdir ? ( $this->variables['RUN_DIR'] . "/$subdir" ) : $this->variables['RUN_DIR']; + } + + if ( $install_cache_path && file_exists( $install_cache_path ) ) { + self::copy_dir( $install_cache_path, $run_dir ); + self::run_sql( 'mysql --no-defaults', array( 'execute' => "source {$install_cache_path}.sql" ), true /*add_database*/ ); + } else { + $this->proc( 'wp core install', $install_args, $subdir )->run_check(); + if ( $install_cache_path ) { + mkdir( $install_cache_path ); + self::dir_diff_copy( $run_dir, self::$cache_dir, $install_cache_path ); + self::run_sql( 'mysqldump --no-defaults', array( 'result-file' => "{$install_cache_path}.sql" ), true /*add_database*/ ); + } + } + } + + public function install_wp_with_composer( $vendor_directory = 'vendor' ) { + $this->create_run_dir(); + $this->create_db(); + + $yml_path = $this->variables['RUN_DIR'] . "/wp-cli.yml"; + file_put_contents( $yml_path, 'path: wordpress' ); + + $this->composer_command( 'init --name="wp-cli/composer-test" --type="project" --no-interaction' ); + $this->composer_command( 'config vendor-dir ' . $vendor_directory ); + $this->composer_command( 'require johnpbloch/wordpress --optimize-autoloader --no-interaction' ); + + $config_extra_php = "require_once dirname(__DIR__) . '/" . $vendor_directory . "/autoload.php';"; + $this->create_config( 'wordpress', $config_extra_php ); + + $install_args = array( + 'url' => 'http://localhost:8080', + 'title' => 'WP CLI Site with both WordPress and wp-cli as Composer dependencies', + 'admin_user' => 'admin', + 'admin_email' => 'admin@example.com', + 'admin_password' => 'password1', + 'skip-email' => true, + ); + + $this->proc( 'wp core install', $install_args )->run_check(); + } + + public function composer_add_wp_cli_local_repository() { + if ( ! self::$composer_local_repository ) { + self::$composer_local_repository = sys_get_temp_dir() . '/' . uniqid( "wp-cli-composer-local-", TRUE ); + mkdir( self::$composer_local_repository ); + + $env = self::get_process_env_variables(); + $src = isset( $env['TRAVIS_BUILD_DIR'] ) ? $env['TRAVIS_BUILD_DIR'] : realpath( __DIR__ . '/../../' ); + + self::copy_dir( $src, self::$composer_local_repository . '/' ); + self::remove_dir( self::$composer_local_repository . '/.git' ); + self::remove_dir( self::$composer_local_repository . '/vendor' ); + } + $dest = self::$composer_local_repository . '/'; + $this->composer_command( "config repositories.wp-cli '{\"type\": \"path\", \"url\": \"$dest\", \"options\": {\"symlink\": false}}'" ); + $this->variables['COMPOSER_LOCAL_REPOSITORY'] = self::$composer_local_repository; + } + + public function composer_require_current_wp_cli() { + $this->composer_add_wp_cli_local_repository(); + $this->composer_command( 'require wp-cli/wp-cli:dev-master --optimize-autoloader --no-interaction' ); + } + + public function start_php_server( $subdir = '' ) { + $dir = $this->variables['RUN_DIR'] . '/'; + if ( $subdir ) { + $dir .= trim( $subdir, '/' ) . '/'; + } + $cmd = Utils\esc_cmd( '%s -S %s -t %s -c %s %s', + Utils\get_php_binary(), + 'localhost:8080', + $dir, + get_cfg_var( 'cfg_file_path' ), + $this->variables['RUN_DIR'] . '/vendor/wp-cli/server-command/router.php' + ); + $this->background_proc( $cmd ); + } + + private function composer_command($cmd) { + if ( !isset( $this->variables['COMPOSER_PATH'] ) ) { + $this->variables['COMPOSER_PATH'] = exec('which composer'); + } + $this->proc( $this->variables['COMPOSER_PATH'] . ' ' . $cmd )->run_check(); + } + + /** + * Initialize run time logging. + */ + private static function log_run_times_before_suite( $event ) { + self::$suite_start_time = microtime( true ); + + Process::$log_run_times = true; + + $travis = getenv( 'TRAVIS' ); + + // Default output settings. + self::$output_to = 'stdout'; + self::$num_top_processes = $travis ? 10 : 40; + self::$num_top_scenarios = $travis ? 10 : 20; + + // Allow setting of above with "WP_CLI_TEST_LOG_RUN_TIMES=[,][,]" formatted env var. + if ( preg_match( '/^(stdout|error_log)?(,[0-9]+)?(,[0-9]+)?$/i', self::$log_run_times, $matches ) ) { + if ( isset( $matches[1] ) ) { + self::$output_to = strtolower( $matches[1] ); + } + if ( isset( $matches[2] ) ) { + self::$num_top_processes = max( (int) substr( $matches[2], 1 ), 1 ); + } + if ( isset( $matches[3] ) ) { + self::$num_top_scenarios = max( (int) substr( $matches[3], 1 ), 1 ); + } + } + } + + /** + * Record the start time of the scenario into the `$scenario_run_times` array. + */ + private static function log_run_times_before_scenario( $event ) { + if ( $scenario_key = self::get_scenario_key( $event ) ) { + self::$scenario_run_times[ $scenario_key ] = -microtime( true ); + } + } + + /** + * Save the run time of the scenario into the `$scenario_run_times` array. Only the top `self::$num_top_scenarios` are kept. + */ + private static function log_run_times_after_scenario( $event ) { + if ( $scenario_key = self::get_scenario_key( $event ) ) { + self::$scenario_run_times[ $scenario_key ] += microtime( true ); + self::$scenario_count++; + if ( count( self::$scenario_run_times ) > self::$num_top_scenarios ) { + arsort( self::$scenario_run_times ); + array_pop( self::$scenario_run_times ); + } + } + } + + /** + * Copy files in updated directory that are not in source directory to copy directory. ("Incremental backup".) + * Note: does not deal with changed files (ie does not compare file contents for changes), for speed reasons. + * + * @param string $upd_dir The directory to search looking for files/directories not in `$src_dir`. + * @param string $src_dir The directory to be compared to `$upd_dir`. + * @param string $cop_dir Where to copy any files/directories in `$upd_dir` but not in `$src_dir` to. + */ + private static function dir_diff_copy( $upd_dir, $src_dir, $cop_dir ) { + if ( false === ( $files = scandir( $upd_dir ) ) ) { + $error = error_get_last(); + throw new \RuntimeException( sprintf( "Failed to open updated directory '%s': %s. " . __FILE__ . ':' . __LINE__, $upd_dir, $error['message'] ) ); + } + foreach ( array_diff( $files, array( '.', '..' ) ) as $file ) { + $upd_file = $upd_dir . '/' . $file; + $src_file = $src_dir . '/' . $file; + $cop_file = $cop_dir . '/' . $file; + if ( ! file_exists( $src_file ) ) { + if ( is_dir( $upd_file ) ) { + if ( ! file_exists( $cop_file ) && ! mkdir( $cop_file, 0777, true /*recursive*/ ) ) { + $error = error_get_last(); + throw new \RuntimeException( sprintf( "Failed to create copy directory '%s': %s. " . __FILE__ . ':' . __LINE__, $cop_file, $error['message'] ) ); + } + self::copy_dir( $upd_file, $cop_file ); + } else { + if ( ! copy( $upd_file, $cop_file ) ) { + $error = error_get_last(); + throw new \RuntimeException( sprintf( "Failed to copy '%s' to '%s': %s. " . __FILE__ . ':' . __LINE__, $upd_file, $cop_file, $error['message'] ) ); + } + } + } elseif ( is_dir( $upd_file ) ) { + self::dir_diff_copy( $upd_file, $src_file, $cop_file ); + } + } + } + + /** + * Get the scenario key used for `$scenario_run_times` array. + * Format " :", eg "core-command core-update.feature:221". + */ + private static function get_scenario_key( $event ) { + $scenario_key = ''; + if ( $file = self::get_event_file( $event, $line ) ) { + $scenario_grandparent = Utils\basename( dirname( dirname( $file ) ) ); + $scenario_key = $scenario_grandparent . ' ' . Utils\basename( $file ) . ':' . $line; + } + return $scenario_key; + } + + /** + * Print out stats on the run times of processes and scenarios. + */ + private static function log_run_times_after_suite( $event ) { + + $suite = ''; + if ( self::$scenario_run_times ) { + // Grandparent directory is first part of key. + $keys = array_keys( self::$scenario_run_times ); + $suite = substr( $keys[0], 0, strpos( $keys[0], ' ' ) ); + } + + $run_from = Utils\basename( dirname( dirname( __DIR__ ) ) ); + + // Format same as Behat, if have minutes. + $fmt = function ( $time ) { + $mins = floor( $time / 60 ); + return round( $time, 3 ) . ( $mins ? ( ' (' . $mins . 'm' . round( $time - ( $mins * 60 ), 3 ) . 's)' ) : '' ); + }; + + $time = microtime( true ) - self::$suite_start_time; + + $log = PHP_EOL . str_repeat( '(', 80 ) . PHP_EOL; + + // Process and proc method run times. + $run_times = array_merge( Process::$run_times, self::$proc_method_run_times ); + + list( $ptime, $calls ) = array_reduce( $run_times, function ( $carry, $item ) { + return array( $carry[0] + $item[0], $carry[1] + $item[1] ); + }, array( 0, 0 ) ); + + $overhead = $time - $ptime; + $pct = round( ( $overhead / $time ) * 100 ); + $unique = count( $run_times ); + + $log .= sprintf( + PHP_EOL . "Total process run time %s (tests %s, overhead %.3f %d%%), calls %d (%d unique) for '%s' run from '%s'" . PHP_EOL, + $fmt( $ptime ), $fmt( $time ), $overhead, $pct, $calls, $unique, $suite, $run_from + ); + + uasort( $run_times, function ( $a, $b ) { + return $a[0] === $b[0] ? 0 : ( $a[0] < $b[0] ? 1 : -1 ); // Reverse sort. + } ); + + $tops = array_slice( $run_times, 0, self::$num_top_processes, true ); + + $log .= PHP_EOL . "Top " . self::$num_top_processes . " process run times for '$suite'"; + $log .= PHP_EOL . implode( PHP_EOL, array_map( function ( $k, $v, $i ) { + return sprintf( ' %3d. %7.3f %3d %s', $i + 1, round( $v[0], 3 ), $v[1], $k ); + }, array_keys( $tops ), $tops, array_keys( array_keys( $tops ) ) ) ) . PHP_EOL; + + // Scenario run times. + arsort( self::$scenario_run_times ); + + $tops = array_slice( self::$scenario_run_times, 0, self::$num_top_scenarios, true ); + + $log .= PHP_EOL . "Top " . self::$num_top_scenarios . " (of " . self::$scenario_count . ") scenario run times for '$suite'"; + $log .= PHP_EOL . implode( PHP_EOL, array_map( function ( $k, $v, $i ) { + return sprintf( ' %3d. %7.3f %s', $i + 1, round( $v, 3 ), substr( $k, strpos( $k, ' ' ) + 1 ) ); + }, array_keys( $tops ), $tops, array_keys( array_keys( $tops ) ) ) ) . PHP_EOL; + + $log .= PHP_EOL . str_repeat( ')', 80 ); + + if ( 'error_log' === self::$output_to ) { + error_log( $log ); + } else { + echo PHP_EOL . $log; + } + } + + /** + * Log the run time of a proc method (one that doesn't use Process but does (use a function that does) a `proc_open()`). + */ + private static function log_proc_method_run_time( $key, $start_time ) { + $run_time = microtime( true ) - $start_time; + if ( ! isset( self::$proc_method_run_times[ $key ] ) ) { + self::$proc_method_run_times[ $key ] = array( 0, 0 ); + } + self::$proc_method_run_times[ $key ][0] += $run_time; + self::$proc_method_run_times[ $key ][1]++; + } + +} diff --git a/features/bootstrap/support.php b/features/bootstrap/support.php new file mode 100644 index 000000000..6aa17c6c3 --- /dev/null +++ b/features/bootstrap/support.php @@ -0,0 +1,200 @@ + $value ) { + if ( ! compareContents( $value, $actual->$name ) ) + return false; + } + } else if ( is_array( $expected ) ) { + foreach ( $expected as $key => $value ) { + if ( ! compareContents( $value, $actual[$key] ) ) + return false; + } + } else { + return $expected === $actual; + } + + return true; +} + +/** + * Compare two strings containing JSON to ensure that @a $actualJson contains at + * least what the JSON string @a $expectedJson contains. + * + * @return whether or not @a $actualJson contains @a $expectedJson + * @retval true @a $actualJson contains @a $expectedJson + * @retval false @a $actualJson does not contain @a $expectedJson + * + * @param[in] $actualJson the JSON string to be tested + * @param[in] $expectedJson the expected JSON string + * + * Examples: + * expected: {'a':1,'array':[1,3,5]} + * + * 1 ) + * actual: {'a':1,'b':2,'c':3,'array':[1,2,3,4,5]} + * return: true + * + * 2 ) + * actual: {'b':2,'c':3,'array':[1,2,3,4,5]} + * return: false + * element 'a' is missing from the root object + * + * 3 ) + * actual: {'a':0,'b':2,'c':3,'array':[1,2,3,4,5]} + * return: false + * the value of element 'a' is not 1 + * + * 4 ) + * actual: {'a':1,'b':2,'c':3,'array':[1,2,4,5]} + * return: false + * the contents of 'array' does not include 3 + */ +function checkThatJsonStringContainsJsonString( $actualJson, $expectedJson ) { + $actualValue = json_decode( $actualJson ); + $expectedValue = json_decode( $expectedJson ); + + if ( !$actualValue ) { + return false; + } + + return compareContents( $expectedValue, $actualValue ); +} + +/** + * Compare two strings to confirm $actualCSV contains $expectedCSV + * Both strings are expected to have headers for their CSVs. + * $actualCSV must match all data rows in $expectedCSV + * + * @param string A CSV string + * @param array A nested array of values + * @return bool Whether $actualCSV contains $expectedCSV + */ +function checkThatCsvStringContainsValues( $actualCSV, $expectedCSV ) { + $actualCSV = array_map( 'str_getcsv', explode( PHP_EOL, $actualCSV ) ); + + if ( empty( $actualCSV ) ) + return false; + + // Each sample must have headers + $actualHeaders = array_values( array_shift( $actualCSV ) ); + $expectedHeaders = array_values( array_shift( $expectedCSV ) ); + + // Each expectedCSV must exist somewhere in actualCSV in the proper column + $expectedResult = 0; + foreach ( $expectedCSV as $expected_row ) { + $expected_row = array_combine( $expectedHeaders, $expected_row ); + foreach ( $actualCSV as $actual_row ) { + + if ( count( $actualHeaders ) != count( $actual_row ) ) + continue; + + $actual_row = array_intersect_key( array_combine( $actualHeaders, $actual_row ), $expected_row ); + if ( $actual_row == $expected_row ) + $expectedResult++; + } + } + + return $expectedResult >= count( $expectedCSV ); +} + +/** + * Compare two strings containing YAML to ensure that @a $actualYaml contains at + * least what the YAML string @a $expectedYaml contains. + * + * @return whether or not @a $actualYaml contains @a $expectedJson + * @retval true @a $actualYaml contains @a $expectedJson + * @retval false @a $actualYaml does not contain @a $expectedJson + * + * @param[in] $actualYaml the YAML string to be tested + * @param[in] $expectedYaml the expected YAML string + */ +function checkThatYamlStringContainsYamlString( $actualYaml, $expectedYaml ) { + $actualValue = Mustangostang\Spyc::YAMLLoad( $actualYaml ); + $expectedValue = Mustangostang\Spyc::YAMLLoad( $expectedYaml ); + + if ( !$actualValue ) { + return false; + } + + return compareContents( $expectedValue, $actualValue ); +} + diff --git a/features/cli-bash-completion.feature b/features/cli-bash-completion.feature new file mode 100644 index 000000000..f442d4c92 --- /dev/null +++ b/features/cli-bash-completion.feature @@ -0,0 +1,299 @@ +Feature: `wp cli completions` tasks + + Scenario: Bash Completion without wp-cli.yml + Given an empty directory + + When I run `wp cli completions --line="wp " --point=100` + Then STDOUT should contain: + """ + plugin + """ + And STDOUT should contain: + """ + server + """ + And STDERR should be empty + And the return code should be 0 + + When I run `wp cli completions --line="wp co" --point=100` + Then STDOUT should contain: + """ + comment + """ + And STDOUT should contain: + """ + core + """ + And STDERR should be empty + And the return code should be 0 + + When I run `wp cli completions --line="wp core " --point=100` + Then STDOUT should contain: + """ + install + """ + And STDOUT should contain: + """ + update + """ + And STDERR should be empty + And the return code should be 0 + + When I run `wp cli completions --line="wp help " --point=100` + Then STDOUT should contain: + """ + rewrite + """ + And STDOUT should contain: + """ + media + """ + And STDERR should be empty + And the return code should be 0 + + When I run `wp cli completions --line="wp help language core " --point=100` + Then STDOUT should contain: + """ + install + """ + And STDOUT should contain: + """ + update + """ + And STDERR should be empty + And the return code should be 0 + + When I run `wp cli completions --line="wp core" --point=100` + Then STDOUT should contain: + """ + core + """ + And STDERR should be empty + And the return code should be 0 + + When I run `wp cli completions --line="wp core " --point=100` + Then STDOUT should contain: + """ + download + """ + And STDERR should be empty + And the return code should be 0 + + When I run `wp cli completions --line='wp bogus-comand ' --point=100` + Then STDOUT should be empty + + When I run `wp cli completions --line='wp eva' --point=100` + Then STDOUT should contain: + """ + eval + """ + And STDOUT should contain: + """ + eval-file + """ + + When I run `wp cli completions --line='wp config create --dbname=' --point=100` + Then STDOUT should be empty + + When I run `wp cli completions --line='wp config create --dbname=foo ' --point=100` + Then STDOUT should not contain: + """ + --dbname= + """ + And STDOUT should contain: + """ + --extra-php + """ + + When I run `wp cli completions --line='wp media import ' --point=100` + Then STDOUT should contain: + """ + + """ + + Scenario: Bash Completion with SSH aliases + Given an empty directory + And a wp-cli.yml file: + """ + @example: + ssh: example.com + """ + + When I run `wp cli completions --line="wp " --point=100` + Then STDOUT should contain: + """ + @example + """ + And STDOUT should contain: + """ + plugin + """ + And STDOUT should contain: + """ + server + """ + And STDERR should be empty + And the return code should be 0 + + When I run `wp cli completions --line="wp @e" --point=100` + Then STDOUT should contain: + """ + @example + """ + And STDERR should be empty + And the return code should be 0 + + When I run `wp cli completions --line="wp @example " --point=100` + Then STDOUT should not contain: + """ + @example + """ + And STDOUT should contain: + """ + core + """ + And STDOUT should contain: + """ + eval + """ + And STDERR should be empty + And the return code should be 0 + + When I run `wp cli completions --line="wp @example plugin " --point=100` + Then STDOUT should contain: + """ + list + """ + And STDERR should be empty + And the return code should be 0 + + When I run `wp cli completions --line="wp help language core " --point=100` + Then STDOUT should contain: + """ + install + """ + And STDOUT should contain: + """ + update + """ + And STDERR should be empty + And the return code should be 0 + + When I run `wp cli completions --line="wp help " --point=100` + Then STDOUT should not contain: + """ + @example + """ + And STDOUT should contain: + """ + post-type + """ + And STDERR should be empty + And the return code should be 0 + + When I run `wp cli completions --line="wp help core" --point=100` + Then STDOUT should contain: + """ + core + """ + And STDERR should be empty + And the return code should be 0 + + When I run `wp cli completions --line="wp help core " --point=100` + Then STDOUT should contain: + """ + download + """ + And STDERR should be empty + And the return code should be 0 + + Scenario: Bash Completion for global parameters + Given an empty directory + + When I run `wp cli completions --line="wp plugin list " --point=100` + Then STDOUT should contain: + """ + --path= + """ + And STDOUT should contain: + """ + --ssh= + """ + And STDOUT should contain: + """ + --http= + """ + And STDOUT should contain: + """ + --url= + """ + And STDOUT should contain: + """ + --user= + """ + And STDOUT should contain: + """ + --skip-plugins= + """ + And STDOUT should contain: + """ + --skip-themes= + """ + And STDOUT should contain: + """ + --skip-packages + """ + And STDOUT should contain: + """ + --require= + """ + And STDOUT should contain: + """ + --color + """ + And STDOUT should contain: + """ + --no-color + """ + And STDOUT should contain: + """ + --debug= + """ + And STDOUT should contain: + """ + --prompt= + """ + And STDOUT should contain: + """ + --quiet + """ + And STDOUT should not contain: + """ + --skip-packages= + """ + And STDOUT should not contain: + """ + --color= + """ + And STDOUT should not contain: + """ + --quiet= + """ + And STDERR should be empty + And the return code should be 0 + + When I run `wp cli completions --line="wp plugin list --path --p" --point=100` + Then STDOUT should contain: + """ + --prompt= + """ + Then STDOUT should not contain: + """ + --path + """ + + When I run `wp cli completions --line="wp plugin list --no-color" --point=100` + Then STDOUT should not contain: + """ + --no-color + """ diff --git a/features/cli-info.feature b/features/cli-info.feature new file mode 100644 index 000000000..09918b2df --- /dev/null +++ b/features/cli-info.feature @@ -0,0 +1,49 @@ +Feature: Review CLI information + + Background: + When I run `wp package path` + Then save STDOUT as {PACKAGE_PATH} + + Scenario: Get the path to the packages directory + Given an empty directory + And a non-existent {PACKAGE_PATH} directory + + When I run `wp cli info --format=json` + Then STDOUT should be JSON containing: + """ + {"wp_cli_packages_dir_path":null} + """ + + When I run `wp package install danielbachhuber/wp-cli-reset-post-date-command` + Then STDERR should be empty + + When I run `wp cli info --format=json` + Then STDOUT should be JSON containing: + """ + {"wp_cli_packages_dir_path":"{PACKAGE_PATH}"} + """ + + When I run `wp cli info` + Then STDOUT should contain: + """ + WP-CLI packages dir: + """ + + Scenario: Packages directory path should be slashed correctly + When I run `WP_CLI_PACKAGES_DIR=/foo wp package path` + Then STDOUT should be: + """ + /foo/ + """ + + When I run `WP_CLI_PACKAGES_DIR=/foo/ wp package path` + Then STDOUT should be: + """ + /foo/ + """ + + When I run `WP_CLI_PACKAGES_DIR=/foo\\ wp package path` + Then STDOUT should be: + """ + /foo/ + """ diff --git a/features/cli.feature b/features/cli.feature new file mode 100644 index 000000000..0d7d38e93 --- /dev/null +++ b/features/cli.feature @@ -0,0 +1,214 @@ +Feature: `wp cli` tasks + + Scenario: Ability to detect a WP-CLI registered command + Given a WP installation + + When I run `wp package install wp-cli/scaffold-package-command` + When I run `wp cli has-command scaffold package` + Then the return code should be 0 + + When I run `wp package uninstall wp-cli/scaffold-package-command` + When I try `wp cli has-command scaffold package` + Then the return code should be 1 + + Scenario: Ability to detect a command which is registered by plugin + Given a WP installation + And a wp-content/mu-plugins/test-cli.php file: + """ + + """ + + When I run `wp cap --help` + Then STDOUT should contain: + """ + wp cap + """ + + When I run `wp comment --help` + Then STDOUT should contain: + """ + wp comment + """ + + When I run `wp config --help` + Then STDOUT should contain: + """ + wp config + """ + + When I run `wp core --help` + Then STDOUT should contain: + """ + wp core + """ + + When I run `wp cron --help` + Then STDOUT should contain: + """ + wp cron + """ + + When I run `wp cron` + Then STDOUT should contain: + """ + usage: wp cron event + or: wp cron schedule + or: wp cron test + """ + + When I run `wp db --help` + Then STDOUT should contain: + """ + wp db + """ + + When I run `wp db` + Then STDOUT should contain: + """ + or: wp db cli + """ + + When I run `wp eval --help` + Then STDOUT should contain: + """ + wp eval + """ + + When I run `wp eval-file --help` + Then STDOUT should contain: + """ + wp eval-file [...] + """ + + When I run `wp export --help` + Then STDOUT should contain: + """ + wp export [--dir=] + """ + + When I run `wp help --help` + Then STDOUT should contain: + """ + wp help [...] + """ + + When I run `wp import --help` + Then STDOUT should contain: + """ + wp import ... --authors= + """ + + When I run `wp language --help` + Then STDOUT should contain: + """ + wp language + """ + + When I run `wp media --help` + Then STDOUT should contain: + """ + wp media + """ + + When I run `wp media` + Then STDOUT should contain: + """ + or: wp media regenerate + """ + + When I run `wp menu --help` + Then STDOUT should contain: + """ + wp menu + """ + + When I run `wp network --help` + Then STDOUT should contain: + """ + wp network + """ + + When I run `wp option --help` + Then STDOUT should contain: + """ + wp option + """ + + When I run `wp package --help` + Then STDOUT should contain: + """ + wp package + """ + + When I run `wp package` + Then STDOUT should contain: + """ + or: wp package install + """ + + When I run `wp plugin --help` + Then STDOUT should contain: + """ + wp plugin + """ + + When I run `wp post --help` + Then STDOUT should contain: + """ + wp post + """ + + When I run `wp post-type --help` + Then STDOUT should contain: + """ + wp post-type + """ + + When I run `wp rewrite --help` + Then STDOUT should contain: + """ + wp rewrite + """ + + When I run `wp role --help` + Then STDOUT should contain: + """ + wp role + """ + + When I run `wp scaffold --help` + Then STDOUT should contain: + """ + wp scaffold + """ + + When I run `wp search-replace --help` + Then STDOUT should contain: + """ + wp search-replace + """ + + When I run `wp server --help` + Then STDOUT should contain: + """ + wp server [--host=] + """ + + When I run `wp shell --help` + Then STDOUT should contain: + """ + wp shell [--basic] + """ + + When I run `wp sidebar --help` + Then STDOUT should contain: + """ + wp sidebar + """ + + When I run `wp site --help` + Then STDOUT should contain: + """ + wp site + """ + + When I run `wp super-admin --help` + Then STDOUT should contain: + """ + wp super-admin + """ + + When I run `wp taxonomy --help` + Then STDOUT should contain: + """ + wp taxonomy + """ + + When I run `wp term --help` + Then STDOUT should contain: + """ + wp term + """ + + When I run `wp theme --help` + Then STDOUT should contain: + """ + wp theme + """ + + When I run `wp transient --help` + Then STDOUT should contain: + """ + wp transient + """ + + When I run `wp user --help` + Then STDOUT should contain: + """ + wp user + """ + + When I run `wp widget --help` + Then STDOUT should contain: + """ + wp widget + """ + + Scenario: Invalid class is specified for a command + Given an empty directory + And a custom-cmd.php file: + """ + + * : An awesome message to display + * + * @when before_wp_load + */ + $foo = function( $args ) { + WP_CLI::success( $args[0] ); + }; + WP_CLI::add_command( 'foo', $foo ); + """ + + When I run `wp --require=custom-cmd.php help` + Then STDOUT should contain: + """ + foo + """ + + When I run `wp --require=custom-cmd.php help foo` + Then STDOUT should contain: + """ + My awesome closure command + """ + + When I try `wp --require=custom-cmd.php foo bar --burrito` + Then STDERR should contain: + """ + unknown --burrito parameter + """ + + When I run `wp --require=custom-cmd.php foo bar` + Then STDOUT should contain: + """ + Success: bar + """ + + Scenario: Use a function as a command + Given an empty directory + And a custom-cmd.php file: + """ + + * : An awesome message to display + * + * @when before_wp_load + */ + function foo( $args ) { + WP_CLI::success( $args[0] ); + } + WP_CLI::add_command( 'foo', 'foo' ); + """ + + When I run `wp --require=custom-cmd.php help` + Then STDOUT should contain: + """ + foo + """ + + When I run `wp --require=custom-cmd.php help foo` + Then STDOUT should contain: + """ + My awesome function command + """ + + When I try `wp --require=custom-cmd.php foo bar --burrito` + Then STDERR should contain: + """ + unknown --burrito parameter + """ + + When I run `wp --require=custom-cmd.php foo bar` + Then STDOUT should contain: + """ + Success: bar + """ + + Scenario: Use a class method as a command + Given an empty directory + And a custom-cmd.php file: + """ + prefix = $prefix; + } + /** + * My awesome class method command + * + * + * : An awesome message to display + * + * @when before_wp_load + */ + function foo( $args ) { + WP_CLI::success( $this->prefix . ':' . $args[0] ); + } + } + $foo = new Foo_Class( 'boo' ); + WP_CLI::add_command( 'foo', array( $foo, 'foo' ) ); + """ + + When I run `wp --require=custom-cmd.php help` + Then STDOUT should contain: + """ + foo + """ + + When I run `wp --require=custom-cmd.php help foo` + Then STDOUT should contain: + """ + My awesome class method command + """ + + When I try `wp --require=custom-cmd.php foo bar --burrito` + Then STDERR should contain: + """ + unknown --burrito parameter + """ + + When I run `wp --require=custom-cmd.php foo bar` + Then STDOUT should contain: + """ + Success: boo:bar + """ + + Scenario: Use a class method as a command + Given an empty directory + And a custom-cmd.php file: + """ + + * : An awesome message to display + * + * @when before_wp_load + */ + function foo( $args ) { + WP_CLI::success( $args[0] ); + } + } + WP_CLI::add_command( 'foo', array( 'Foo_Class', 'foo' ) ); + """ + + When I run `wp --require=custom-cmd.php help` + Then STDOUT should contain: + """ + foo + """ + + When I run `wp --require=custom-cmd.php help foo` + Then STDOUT should contain: + """ + My awesome class method command + """ + + When I try `wp --require=custom-cmd.php foo bar --burrito` + Then STDERR should contain: + """ + unknown --burrito parameter + """ + + When I run `wp --require=custom-cmd.php foo bar` + Then STDOUT should contain: + """ + Success: bar + """ + + Scenario: Use class with __invoke() passed as object + Given an empty directory + And a custom-cmd.php file: + """ + message = $message; + } + + /** + * My awesome class method command + * + * @when before_wp_load + */ + function __invoke( $args ) { + WP_CLI::success( $this->message ); + } + } + $foo = new Foo_Class( 'bar' ); + WP_CLI::add_command( 'instantiated-command', $foo ); + """ + + When I run `wp --require=custom-cmd.php instantiated-command` + Then STDOUT should contain: + """ + bar + """ + And STDERR should be empty + + Scenario: Use an invalid class method as a command + Given an empty directory + And a custom-cmd.php file: + """ + + * : An awesome message to display + * + * @when before_wp_load + */ + function foo( $args ) { + WP_CLI::success( $args[0] ); + } + } + $foo = new Foo_Class; + WP_CLI::add_command( 'bar', array( $foo, 'bar' ) ); + """ + + When I try `wp --require=custom-cmd.php bar` + Then STDERR should contain: + """ + Error: Callable ["Foo_Class","bar"] does not exist, and cannot be registered as `wp bar`. + """ + + Scenario: Register a synopsis for a given command + Given an empty directory + And a custom-cmd.php file: + """ + 'My awesome function command', + 'when' => 'before_wp_load', + 'synopsis' => array( + array( + 'type' => 'positional', + 'name' => 'message', + 'description' => 'An awesome message to display', + 'optional' => false, + 'options' => array( 'hello', 'goodbye' ), + ), + array( + 'type' => 'assoc', + 'name' => 'apple', + 'description' => 'A type of fruit.', + 'optional' => false, + ), + array( + 'type' => 'assoc', + 'name' => 'meal', + 'description' => 'A type of meal.', + 'optional' => true, + 'default' => 'breakfast', + 'options' => array( 'breakfast', 'lunch', 'dinner' ), + ), + ), + ) ); + """ + And a wp-cli.yml file: + """ + require: + - custom-cmd.php + """ + + When I try `wp foo` + Then STDOUT should contain: + """ + usage: wp foo --apple= [--meal=] + """ + And STDERR should be empty + And the return code should be 1 + + When I run `wp help foo` + Then STDOUT should contain: + """ + My awesome function command + """ + And STDOUT should contain: + """ + SYNOPSIS + """ + And STDOUT should contain: + """ + wp foo --apple= [--meal=] + """ + And STDOUT should contain: + """ + OPTIONS + """ + And STDOUT should contain: + """ + + An awesome message to display + --- + options: + - hello + - goodbye + --- + """ + And STDOUT should contain: + """ + [--meal=] + A type of meal. + --- + default: breakfast + options: + - breakfast + - lunch + - dinner + --- + """ + + When I try `wp foo nana --apple=fuji` + Then STDERR should contain: + """ + Error: Invalid value specified for positional arg. + """ + + When I try `wp foo hello --apple=fuji --meal=snack` + Then STDERR should contain: + """ + Invalid value specified for 'meal' (A type of meal.) + """ + + When I run `wp foo hello --apple=fuji` + Then STDOUT should be: + """ + Message is: hello + Success: breakfast + """ + + When I run `wp foo hello --apple=fuji --meal=dinner` + Then STDOUT should be: + """ + Message is: hello + Success: dinner + """ + + Scenario: Register a synopsis that supports multiple positional arguments + Given an empty directory + And a test-cmd.php file: + """ + 'before_wp_load', + 'synopsis' => array( + array( + 'type' => 'positional', + 'name' => 'arg', + 'repeating' => true, + ), + ), + )); + """ + And a wp-cli.yml file: + """ + require: + - test-cmd.php + """ + + When I run `wp foo bar` + Then STDOUT should be: + """ + 1 + """ + + When I run `wp foo bar burrito` + Then STDOUT should be: + """ + 2 + """ + + Scenario: Register a synopsis that requires a flag + Given an empty directory + And a test-cmd.php file: + """ + 'before_wp_load', + 'synopsis' => array( + array( + 'type' => 'flag', + 'name' => 'honk', + 'optional' => true, + ), + ), + )); + """ + And a wp-cli.yml file: + """ + require: + - test-cmd.php + """ + + When I run `wp foo` + Then STDOUT should be: + """ + nohonk + """ + + When I run `wp foo --honk` + Then STDOUT should be: + """ + honked + """ + + When I run `wp foo --honk=1` + Then STDOUT should be: + """ + honked + """ + + When I run `wp foo --no-honk` + Then STDOUT should be: + """ + nohonk + """ + + When I run `wp foo --honk=0` + Then STDOUT should be: + """ + nohonk + """ + + # Note treats "false" as true. + When I run `wp foo --honk=false` + Then STDOUT should be: + """ + honked + """ + + Scenario: Register a longdesc for a given command + Given an empty directory + And a custom-cmd.php file: + """ + 'My awesome function command', + 'when' => 'before_wp_load', + 'longdesc' => '## EXAMPLES ' . PHP_EOL . PHP_EOL . ' # Run the custom foo command', + ) ); + """ + And a wp-cli.yml file: + """ + require: + - custom-cmd.php + """ + + When I run `wp help foo` + Then STDOUT should contain: + """ + NAME + + wp foo + + DESCRIPTION + + My awesome function command + + SYNOPSIS + + wp foo + + EXAMPLES + + # Run the custom foo command + + GLOBAL PARAMETERS + + """ + + # With synopsis, appended. + Given a hello-command.php file: + """ + 'Prints a greeting.', + 'synopsis' => array( + array( + 'type' => 'positional', + 'name' => 'name', + 'description' => 'Name of person to greet.', + 'optional' => false, + 'repeating' => false, + ), + array( + 'type' => 'assoc', + 'name' => 'type', + 'optional' => true, + 'default' => 'success', + 'options' => array( 'success', 'error' ), + ), + array( + 'type' => 'flag', + 'name' => 'honk', + 'optional' => true, + ), + ), + 'when' => 'after_wp_load', + 'longdesc' => "\r\n## EXAMPLES\n\n# Say hello to Newman\nwp example hello Newman\nSuccess: Hello, Newman!", + ) ); + """ + + When I run `wp --require=hello-command.php help example hello` + Then STDOUT should contain: + """ + NAME + + wp example hello + + DESCRIPTION + + Prints a greeting. + + SYNOPSIS + + wp example hello [--type=] [--honk] + + OPTIONS + + + Name of person to greet. + + [--type=] + --- + default: success + options: + - success + - error + --- + + [--honk] + + EXAMPLES + + # Say hello to Newman + wp example hello Newman + Success: Hello, Newman! + + GLOBAL PARAMETERS + + """ + + Scenario: Register a command with default and accepted arguments. + Given an empty directory + And a test-cmd.php file: + """ + ] + * : This is the bar argument. + * --- + * default: burrito + * --- + * + * [...] + * : This is where you buy burritos. + * --- + * options: + * - left_coast_siesta + * - cha cha cha + * --- + * + * [--burrito=] + * : This is the burrito argument. + * --- + * options: + * - beans + * - veggies + * --- + * + * @when before_wp_load + */ + $foo = function( $args, $assoc_args ) { + $out = array( + 'bar' => isset( $args[0] ) ? $args[0] : '', + 'shop' => isset( $args[1] ) ? $args[1] : '', + 'burrito' => isset( $assoc_args['burrito'] ) ? $assoc_args['burrito'] : '', + ); + WP_CLI::print_value( $out, array( 'format' => 'yaml' ) ); + }; + WP_CLI::add_command( 'foo', $foo ); + """ + + When I run `wp --require=test-cmd.php foo --help` + Then STDOUT should contain: + """ + [] + This is the bar argument. + --- + default: burrito + --- + """ + And STDOUT should contain: + """ + [--burrito=] + This is the burrito argument. + --- + options: + - beans + - veggies + --- + """ + + When I run `wp --require=test-cmd.php foo` + Then STDOUT should be YAML containing: + """ + bar: burrito + shop: + burrito: + """ + And STDERR should be empty + + When I run `wp --require=test-cmd.php foo ''` + Then STDOUT should be YAML containing: + """ + bar: + shop: + burrito: + """ + And STDERR should be empty + + When I run `wp --require=test-cmd.php foo apple --burrito=veggies` + Then STDOUT should be YAML containing: + """ + bar: apple + shop: + burrito: veggies + """ + And STDERR should be empty + + When I try `wp --require=test-cmd.php foo apple --burrito=meat` + Then STDERR should contain: + """ + Error: Parameter errors: + Invalid value specified for 'burrito' (This is the burrito argument.) + """ + + When I try `wp --require=test-cmd.php foo apple --burrito=''` + Then STDERR should contain: + """ + Error: Parameter errors: + Invalid value specified for 'burrito' (This is the burrito argument.) + """ + + When I try `wp --require=test-cmd.php foo apple taco_del_mar` + Then STDERR should contain: + """ + Error: Invalid value specified for positional arg. + """ + + When I try `wp --require=test-cmd.php foo apple 'cha cha cha' taco_del_mar` + Then STDERR should contain: + """ + Error: Invalid value specified for positional arg. + """ + + When I run `wp --require=test-cmd.php foo apple 'cha cha cha'` + Then STDOUT should be YAML containing: + """ + bar: apple + shop: cha cha cha + burrito: + """ + And STDERR should be empty + + Scenario: Register a command with default and accepted arguments, part two + Given an empty directory + And a test-cmd.php file: + """ + ] + * : This is the bar argument. + * --- + * options: + * - beans + * - veggies + * --- + * + * @when before_wp_load + */ + $foo = function( $args, $assoc_args ) { + $out = array( + 'burrito' => isset( $args[0] ) ? $args[0] : '', + ); + WP_CLI::print_value( $out, array( 'format' => 'yaml' ) ); + }; + WP_CLI::add_command( 'foo', $foo ); + """ + + When I run `wp --require=test-cmd.php foo` + Then STDOUT should be YAML containing: + """ + burrito: + """ + And STDERR should be empty + + When I run `wp --require=test-cmd.php foo beans` + Then STDOUT should be YAML containing: + """ + burrito: beans + """ + And STDERR should be empty + + When I try `wp --require=test-cmd.php foo apple` + Then STDERR should be: + """ + Error: Invalid value specified for positional arg. + """ + + Scenario: Removing a subcommand should remove it from the index + Given an empty directory + And a remove-comment.php file: + """ + remove_subcommand( 'comment' ); + } ); + """ + + When I run `wp` + Then STDOUT should contain: + """ + Creates, updates, deletes, and moderates comments. + """ + + When I run `wp --require=remove-comment.php` + Then STDOUT should not contain: + """ + Creates, updates, deletes, and moderates comments. + """ + + Scenario: before_invoke should call subcommands + Given an empty directory + And a call-invoke.php file: + """ + function() { + WP_CLI::success( 'before invoke' ); + }, 'after_invoke' => function() { + WP_CLI::success( 'after invoke' ); + }); + WP_CLI::add_command( 'before invoke', $before_invoke, $before_invoke_args ); + WP_CLI::add_command( 'before-invoke', $before_invoke, $before_invoke_args ); + """ + + When I run `wp --require=call-invoke.php before invoke` + Then STDOUT should contain: + """ + Success: before invoke + Success: Invoked + Success: after invoke + """ + + When I run `wp --require=call-invoke.php before-invoke` + Then STDOUT should contain: + """ + Success: before invoke + Success: Invoked + Success: after invoke + """ + + Scenario: Default arguments should respect wp-cli.yml + Given a WP installation + And a wp-cli.yml file: + """ + post list: + format: count + """ + + When I run `wp post list` + Then STDOUT should be a number + + Scenario: Use class passed as object + Given an empty directory + And a custom-cmd.php file: + """ + message = $message; + } + + /** + * My awesome class method command + * + * @when before_wp_load + */ + function message( $args ) { + WP_CLI::success( $this->message ); + } + } + $foo = new Foo_Class( 'bar' ); + WP_CLI::add_command( 'instantiated-command', $foo ); + """ + + When I run `wp --require=custom-cmd.php instantiated-command message` + Then STDOUT should contain: + """ + bar + """ + And STDERR should be empty + + Scenario: WP-CLI suggests matching commands when user entry contains typos + Given a WP installation + + When I try `wp clu` + Then STDERR should contain: + """ + Did you mean 'cli'? + """ + + When I try `wp cli nfo` + Then STDERR should contain: + """ + Did you mean 'info'? + """ + + When I try `wp cli beyondlevenshteinthreshold` + Then STDERR should not contain: + """ + Did you mean + """ + + Scenario: WP-CLI suggests matching parameters when user entry contains typos + Given an empty directory + + When I try `wp cli info --quie` + Then STDERR should contain: + """ + Did you mean '--quiet'? + """ + + When I try `wp cli info --forma=json` + Then STDERR should contain: + """ + Did you mean '--format'? + """ + + Scenario: Adding a command can be aborted through the hooks system + Given an empty directory + And a abort-add-command.php file: + """ + abort( 'Testing hooks.' ); + } ); + + WP_CLI::add_command( 'test-command-1', function () {} ); + WP_CLI::add_command( 'test-command-2', function () {} ); + """ + + When I try `wp --require=abort-add-command.php` + Then STDOUT should contain: + """ + test-command-1 + """ + And STDOUT should not contain: + """ + test-command-2 + """ + And STDERR should be: + """ + Warning: Aborting the addition of the command 'test-command-2' with reason: Testing hooks.. + """ + And the return code should be 0 + + Scenario: Adding a command can depend on a previous command having been added before + Given an empty directory + And a add-dependent-command.php file: + """ + other/subdir/index.php` + And I run `wp core is-installed` from 'other/subdir' + Then STDOUT should be empty + + Scenario: Nested installs + Given a WP installation + And a WP install in 'foo' + And a wp-cli.yml file: + """ + """ + + When I run `wp --info` from 'foo' + Then STDOUT should not contain: + """ + wp-cli.yml + """ + + Scenario: Disabled commands + Given a WP installation + And a config.yml file: + """ + disabled_commands: + - eval-file + - core multisite-convert + """ + + When I run `WP_CLI_CONFIG_PATH=config.yml wp` + Then STDOUT should not contain: + """ + eval-file + """ + + When I try `WP_CLI_CONFIG_PATH=config.yml wp help eval-file` + Then STDERR should be: + """ + Error: The 'eval-file' command has been disabled from the config file. + """ + + When I run `WP_CLI_CONFIG_PATH=config.yml wp core` + Then STDOUT should not contain: + """ + or: wp core multisite-convert + """ + + When I run `WP_CLI_CONFIG_PATH=config.yml wp help core` + Then STDOUT should not contain: + """ + multisite-convert + """ + + When I try `WP_CLI_CONFIG_PATH=config.yml wp core multisite-convert` + Then STDERR should contain: + """ + command has been disabled + """ + + When I try `WP_CLI_CONFIG_PATH=config.yml wp help core multisite-convert` + Then STDERR should contain: + """ + Error: The 'core multisite-convert' command has been disabled from the config file. + """ + + Scenario: 'core config' parameters + Given an empty directory + And WP files + And a wp-cli.yml file: + """ + core config: + dbname: wordpress + dbuser: root + extra-php: | + define( 'WP_DEBUG', true ); + define( 'WP_POST_REVISIONS', 50 ); + """ + + When I run `wp core config --skip-check` + And I run `grep WP_POST_REVISIONS wp-config.php` + Then STDOUT should not be empty + + Scenario: Persist positional parameters when defined in a config + Given a WP installation + And a wp-cli.yml file: + """ + user create: + - examplejoe + - joe@example.com + user_pass: joe + role: administrator + """ + + When I run `wp user create` + Then STDOUT should not be empty + + When I run `wp user get examplejoe --field=roles` + Then STDOUT should contain: + """ + administrator + """ + + When I try `wp user create examplejane` + Then STDERR should be: + """ + Error: Sorry, that email address is already used! + """ + + When I run `wp user create examplejane jane@example.com` + Then STDOUT should not be empty + + When I run `wp user get examplejane --field=roles` + Then STDOUT should contain: + """ + administrator + """ + + Scenario: Command-specific configs + Given a WP installation + And a wp-cli.yml file: + """ + eval: + foo: bar + post list: + format: count + """ + + # Arbitrary values should be passed, without warnings + When I run `wp eval 'echo json_encode( $assoc_args );'` + Then STDOUT should be JSON containing: + """ + {"foo": "bar"} + """ + + # CLI args should trump config values + When I run `wp post list` + Then STDOUT should be a number + When I run `wp post list --format=json` + Then STDOUT should not be a number + + Scenario: Required files should not be loaded twice + Given an empty directory + And a custom-file.php file: + """ + 'before_wp_load' ) ); + """ + And a config.yml file: + """ + test-cmd: + foo: bar + apple: banana + apple: banana + """ + And a wp-cli.yml file: + """ + _: + merge: true + test-cmd: + bar: burrito + apple: apple + apple: apple + """ + + When I run `wp --require=test-cmd.php test-cmd` + Then STDOUT should be JSON containing: + """ + {"bar":"burrito","apple":"apple"} + """ + When I run `WP_CLI_CONFIG_PATH=config.yml wp --require=test-cmd.php test-cmd` + Then STDOUT should be JSON containing: + """ + {"foo":"bar","apple":"apple","bar":"burrito"} + """ + + Given a wp-cli.yml file: + """ + _: + merge: false + test-cmd: + bar: burrito + apple: apple + apple: apple + """ + When I run `WP_CLI_CONFIG_PATH=config.yml wp --require=test-cmd.php test-cmd` + Then STDOUT should be JSON containing: + """ + {"bar":"burrito","apple":"apple"} + """ + + Scenario: Config inheritance from local to project + Given an empty directory + And a test-cmd.php file: + """ + 'before_wp_load' ) ); + """ + And a wp-cli.yml file: + """ + test-cmd: + foo: bar + apple: banana + apple: banana + """ + + When I run `wp --require=test-cmd.php test-cmd` + Then STDOUT should be JSON containing: + """ + {"foo":"bar","apple":"banana"} + """ + + Given a wp-cli.local.yml file: + """ + _: + inherit: wp-cli.yml + merge: true + test-cmd: + bar: burrito + apple: apple + apple: apple + """ + + When I run `wp --require=test-cmd.php test-cmd` + Then STDOUT should be JSON containing: + """ + {"foo":"bar","apple":"apple","bar":"burrito"} + """ + + Given a wp-cli.local.yml file: + """ + test-cmd: + bar: burrito + apple: apple + apple: apple + """ + + When I run `wp --require=test-cmd.php test-cmd` + Then STDOUT should be JSON containing: + """ + {"bar":"burrito","apple":"apple"} + """ + + @require-wp-3.9 + Scenario: WordPress install with local dev DOMAIN_CURRENT_SITE + Given a WP multisite installation + And a local-dev.php file: + """ + ` to override. + """ + + When I run `wp option get home --url=example.com` + Then STDOUT should be: + """ + http://example.com + """ diff --git a/features/extra/no-mail.php b/features/extra/no-mail.php new file mode 100644 index 000000000..de7a42272 --- /dev/null +++ b/features/extra/no-mail.php @@ -0,0 +1,7 @@ +` matches an existing site. + """ + + Scenario: Quiet run + Given a WP installation + + When I try `wp non-existing-command --quiet` + Then the return code should be 1 + And STDERR should be: + """ + Error: 'non-existing-command' is not a registered wp command. See 'wp help' for available commands. + """ + + Scenario: Debug run + Given a WP installation + + When I try `wp eval 'echo CONST_WITHOUT_QUOTES;'` + Then STDOUT should be: + """ + CONST_WITHOUT_QUOTES + """ + And STDERR should contain: + """ + Use of undefined constant CONST_WITHOUT_QUOTES + """ + And the return code should be 0 + + When I try `wp eval 'echo CONST_WITHOUT_QUOTES;' --debug` + Then the return code should be 0 + And STDOUT should be: + """ + CONST_WITHOUT_QUOTES + """ + And STDERR should contain: + """ + Use of undefined constant CONST_WITHOUT_QUOTES + """ + + Scenario: Setting the WP user + Given a WP installation + + When I run `wp eval 'echo (int) is_user_logged_in();'` + Then STDOUT should be: + """ + 0 + """ + + When I run `wp --user=admin eval 'echo wp_get_current_user()->user_login;'` + Then STDOUT should be: + """ + admin + """ + + When I run `wp --user=admin@example.com eval 'echo wp_get_current_user()->user_login;'` + Then STDOUT should be: + """ + admin + """ + + When I try `wp --user=non-existing-user eval 'echo wp_get_current_user()->user_login;'` + Then the return code should be 1 + And STDERR should be: + """ + Error: Invalid user ID, email or login: 'non-existing-user' + """ + + Scenario: Using a custom logger + Given an empty directory + And a custom-logger.php file: + """ + ] + * : URL passed to the callback. + */ + $cmd_test = function( $args, $assoc_args ) { + $url = WP_CLI::get_runner()->config['url'] ? ' ' . WP_CLI::get_runner()->config['url'] : ''; + WP_CLI::log( 'global:' . $url ); + $url = isset( $assoc_args['url'] ) ? ' ' . $assoc_args['url'] : ''; + WP_CLI::log( 'local:' . $url ); + }; + WP_CLI::add_command( 'cmd-test', $cmd_test ); + """ + And a wp-cli.yml file: + """ + require: + - cmd.php + """ + + When I run `wp cmd-test --url=foo.dev` + Then STDOUT should be: + """ + global: foo.dev + local: + """ + + When I run `WP_CLI_STRICT_ARGS_MODE=1 wp cmd-test --url=foo.dev` + Then STDOUT should be: + """ + global: + local: foo.dev + """ + + When I run `WP_CLI_STRICT_ARGS_MODE=1 wp --url=bar.dev cmd-test --url=foo.dev` + Then STDOUT should be: + """ + global: bar.dev + local: foo.dev + """ + + Scenario: Using --http= requires wp-cli/restful + Given an empty directory + + When I try `wp --http=foo.dev` + Then STDERR should be: + """ + Error: RESTful WP-CLI needs to be installed. Try 'wp package install wp-cli/restful'. + """ + + Scenario: Strict args mode should be passed on to ssh + When I try `WP_CLI_STRICT_ARGS_MODE=1 wp --debug --ssh=/ --version` + Then STDERR should contain: + """ + Running SSH command: ssh -q '' -T 'WP_CLI_STRICT_ARGS_MODE=1 wp + """ + + Scenario: SSH flag should support changing directories + When I try `wp --debug --ssh=wordpress:/my/path --version` + Then STDERR should contain: + """ + Running SSH command: ssh -q 'wordpress' -T 'cd '\''/my/path'\''; wp + """ + + Scenario: SSH flag should support Docker + When I try `wp --debug --ssh=docker:user@wordpress --version` + Then STDERR should contain: + """ + Running SSH command: docker exec --user 'user' 'wordpress' sh -c + """ diff --git a/features/formatter.feature b/features/formatter.feature new file mode 100644 index 000000000..fa8a9908a --- /dev/null +++ b/features/formatter.feature @@ -0,0 +1,155 @@ +Feature: Format output + + Scenario: Format output as YAML + Given an empty directory + And a output-yaml.php file: + """ + + * : Type of output. + * + * [--fields=] + * : Limit output to particular fields + * + * @when before_wp_load + */ + $output_yaml = function( $args, $assoc_args ) { + $items = array( + array( + 'label' => 'Foo', + 'slug' => 'foo', + ), + array( + 'label' => 'Bar', + 'slug' => 'bar', + ), + ); + $format_args = array( 'format' => 'yaml' ); + if ( isset( $assoc_args['fields'] ) ) { + $format_args['fields'] = explode( ',', $assoc_args['fields'] ); + } else { + $format_args['fields'] = array( 'label', 'slug' ); + } + $formatter = new \WP_CLI\Formatter( $format_args ); + if ( 'all' === $args[0] ) { + $formatter->display_items( $items ); + } else if ( 'single' === $args[0] ) { + $formatter->display_item( $items[0] ); + } + }; + WP_CLI::add_command( 'yaml', $output_yaml ); + """ + + When I run `wp --require=output-yaml.php yaml all` + Then STDOUT should be YAML containing: + """ + --- + - + label: Foo + slug: foo + - + label: Bar + slug: bar + """ + + When I run `wp --require=output-yaml.php yaml all --fields=label` + Then STDOUT should be YAML containing: + """ + --- + - + label: Foo + - + label: Bar + """ + And STDOUT should not contain: + """ + slug: bar + """ + + When I run `wp --require=output-yaml.php yaml single` + Then STDOUT should be YAML containing: + """ + --- + label: Foo + slug: foo + """ + + Scenario: Format data in RTL language + Given an empty directory + And a file.php file: + """ + 1, + 'language' => 'Afrikaans', + 'is_rtl' => 0, + ), + array( + 'id' => 2, + 'language' => 'العَرَبِيَّة‎‎', + 'is_rtl' => 1, + ), + array( + 'id' => 3, + 'language' => 'English', + 'is_rtl' => 0, + ), + ); + $assoc_args = array( 'format' => 'csv' ); + $formatter = new WP_CLI\Formatter( $assoc_args, array( 'id', 'language', 'is_rtl' ) ); + $formatter->display_items( $items ); + """ + + When I run `wp eval-file file.php --skip-wordpress` + Then STDOUT should be CSV containing: + | id | language | is_rtl | + | 1 | Afrikaans | 0 | + | 2 | العَرَبِيَّة‎‎ | 1 | + | 3 | English | 0 | + + Scenario: Padding for pre-colorized tables + Given an empty directory + And a file.php file: + """ + ] + * : Render output in a particular format. + * --- + * default: table + * options: + * - table + * --- + * + * @when before_wp_load + */ + $fake_command = function( $args, $assoc_args ) { + Colors::enable( true ); + $items = array( + array( 'package' => Colors::colorize( '%ygaa/gaa-kabes%n' ), 'version' => 'dev-master', 'result' => Colors::colorize( "%r\xf0\x9f\x9b\x87%n" ) ), + array( 'package' => Colors::colorize( '%ygaa/gaa-log%n' ), 'version' => '*', 'result' => Colors::colorize( "%g\xe2\x9c\x94%n" ) ), + array( 'package' => Colors::colorize( '%ygaa/gaa-nonsense%n' ), 'version' => 'v3.0.11', 'result' => Colors::colorize( "%r\xf0\x9f\x9b\x87%n" ) ), + array( 'package' => Colors::colorize( '%ygaa/gaa-100%%new%n' ), 'version' => 'v100%new', 'result' => Colors::colorize( "%g\xe2\x9c\x94%n" ) ), + ); + $formatter = new \WP_CLI\Formatter( $assoc_args, array( 'package', 'version', 'result' ) ); + $formatter->display_items( $items, array( true, false, true ) ); + }; + WP_CLI::add_command( 'fake', $fake_command ); + """ + + When I run `wp --require=file.php fake` + Then STDOUT should be a table containing rows: + | package | version | result | + | gaa/gaa-kabes | dev-master | 🛇 | + | gaa/gaa-log | * | ✔ | + | gaa/gaa-nonsense | v3.0.11 | 🛇 | + | gaa/gaa-100%new | v100%new | ✔ | diff --git a/features/framework.feature b/features/framework.feature new file mode 100644 index 000000000..9908eb71e --- /dev/null +++ b/features/framework.feature @@ -0,0 +1,362 @@ +Feature: Load WP-CLI + + Scenario: A plugin calling wp_signon() shouldn't fatal + Given a WP installation + And I run `wp user create testuser test@example.org --user_pass=testuser` + And a wp-content/mu-plugins/test.php file: + """ + 'testuser', 'user_password' => 'testuser' ) ); + }); + """ + + When I run `wp option get home` + Then STDOUT should not be empty + + Scenario: A command loaded before WordPress then calls WordPress to load + Given a WP installation + And a custom-cmd.php file: + """ + load_wordpress(); + if ( function_exists( 'update_option' ) ) { + WP_CLI::log( 'WordPress loaded!' ); + } + WP_CLI::get_runner()->load_wordpress(); + WP_CLI::log( 'load_wordpress() can safely be called twice.' ); + } + + } + WP_CLI::add_command( 'load-wordpress', 'Load_WordPress_Command_Class' ); + """ + + When I run `wp --require=custom-cmd.php load-wordpress` + Then STDOUT should be: + """ + WordPress not loaded. + WordPress loaded! + load_wordpress() can safely be called twice. + """ + + Scenario: A command loaded before WordPress then calls WordPress to load, but WP doesn't exist + Given an empty directory + And a custom-cmd.php file: + """ + load_wordpress(); + if ( function_exists( 'update_option' ) ) { + WP_CLI::log( 'WordPress loaded!' ); + } + WP_CLI::get_runner()->load_wordpress(); + WP_CLI::log( 'load_wordpress() can safely be called twice.' ); + } + + } + WP_CLI::add_command( 'load-wordpress', 'Load_WordPress_Command_Class' ); + """ + + When I try `wp --require=custom-cmd.php load-wordpress` + Then STDOUT should be: + """ + WordPress not loaded. + """ + And STDERR should contain: + """ + Error: This does not seem to be a WordPress install. + """ + + Scenario: Globalize global variables in wp-config.php + Given an empty directory + And WP files + And a wp-config-extra.php file: + """ + $redis_server = 'foo'; + """ + + When I run `wp core config {CORE_CONFIG_SETTINGS} --extra-php < wp-config-extra.php` + Then the wp-config.php file should contain: + """ + $redis_server = 'foo'; + """ + + When I run `wp db create` + And I run `wp core install --url='localhost:8001' --title='Test' --admin_user=wpcli --admin_email=admin@example.com --admin_password=1` + Then STDOUT should not be empty + + When I run `wp eval 'echo $GLOBALS["redis_server"];'` + Then STDOUT should be: + """ + foo + """ + + Scenario: Use a custom error code with WP_CLI::error() + Given an empty directory + And a exit-normal.php file: + """ + 'before_wp_load' ) ); + """ + + When I run `wp --require=my-command.php my-command bar` + Then STDOUT should be: + """ + bar + """ + And STDERR should be empty + + Scenario: WP-CLI sets $table_prefix appropriately on multisite + Given a WP multisite installation + And I run `wp site create --slug=first` + + When I run `wp eval 'global $table_prefix; echo $table_prefix;'` + Then STDOUT should be: + """ + wp_ + """ + + When I run `wp eval 'global $blog_id; echo $blog_id;'` + Then STDOUT should be: + """ + 1 + """ + + When I run `wp --url=example.com/first eval 'global $table_prefix; echo $table_prefix;'` + Then STDOUT should be: + """ + wp_2_ + """ + + When I run `wp --url=example.com/first eval 'global $blog_id; echo $blog_id;'` + Then STDOUT should be: + """ + 2 + """ + + Scenario: Don't apply set_url_scheme because it will always be incorrect + Given a WP multisite installation + And I run `wp option update siteurl https://example.com` + + When I run `wp option get siteurl` + Then STDOUT should be: + """ + https://example.com + """ + + When I run `wp site list --field=url` + Then STDOUT should be: + """ + https://example.com/ + """ + + Scenario: Show error message when site isn't found and there aren't additional prefixes. + Given a WP installation + And I run `wp db reset --yes` + + When I try `wp option get home` + Then STDERR should be: + """ + Error: The site you have requested is not installed. + Run `wp core install` to create database tables. + """ + And STDOUT should be empty + + Scenario: Show potential table prefixes when site isn't found, single site. + Given a WP installation + And "$table_prefix = 'wp_';" replaced with "$table_prefix = 'cli_';" in the wp-config.php file + + When I try `wp option get home` + Then STDERR should be: + """ + Error: The site you have requested is not installed. + Your table prefix is 'cli_'. Found install with table prefix: wp_. + Or, run `wp core install` to create database tables. + """ + And STDOUT should be empty + + # Use try to cater for wp-db errors in old WPs. + When I try `wp core install --url=example.com --title=example --admin_user=wpcli --admin_email=wpcli@example.com` + Then STDOUT should contain: + """ + Success: + """ + And the return code should be 0 + + Given "$table_prefix = 'cli_';" replaced with "$table_prefix = 'test_';" in the wp-config.php file + + When I try `wp option get home` + Then STDERR should be: + """ + Error: The site you have requested is not installed. + Your table prefix is 'test_'. Found installs with table prefix: cli_, wp_. + Or, run `wp core install` to create database tables. + """ + And STDOUT should be empty + + @require-wp-3.9 + Scenario: Display a more helpful error message when site can't be found + Given a WP multisite installation + And "define( 'DOMAIN_CURRENT_SITE', 'example.com' );" replaced with "define( 'DOMAIN_CURRENT_SITE', 'example.org' );" in the wp-config.php file + + When I try `wp option get home` + Then STDERR should be: + """ + Error: Site 'example.org/' not found. Verify DOMAIN_CURRENT_SITE matches an existing site or use `--url=` to override. + """ + + When I try `wp option get home --url=example.io` + Then STDERR should be: + """ + Error: Site 'example.io' not found. Verify `--url=` matches an existing site. + """ + + Given "define( 'DOMAIN_CURRENT_SITE', 'example.org' );" replaced with " " in the wp-config.php file + + When I run `cat wp-config.php` + Then STDOUT should not contain: + """ + DOMAIN_CURRENT_SITE + """ + + When I try `wp option get home` + Then STDERR should be: + """ + Error: Site not found. Define DOMAIN_CURRENT_SITE in 'wp-config.php' or use `--url=` to override. + """ + + When I try `wp option get home --url=example.io` + Then STDERR should be: + """ + Error: Site 'example.io' not found. Verify `--url=` matches an existing site. + """ + + Scenario: Don't show 'sitecategories' table unless global terms are enabled + Given a WP multisite installation + + When I run `wp db tables` + Then STDOUT should not contain: + """ + wp_sitecategories + """ + + When I run `wp db tables --network` + Then STDOUT should not contain: + """ + wp_sitecategories + """ diff --git a/features/help.feature b/features/help.feature new file mode 100644 index 000000000..74753b28f --- /dev/null +++ b/features/help.feature @@ -0,0 +1,1018 @@ +Feature: Get help about WP-CLI commands + + Scenario: Help for internal commands + Given an empty directory + + When I run `wp help` + Then STDOUT should contain: + """ + Run 'wp help ' to get more information on a specific command. + + """ + And STDERR should be empty + + When I run `wp help core` + Then STDOUT should contain: + """ + wp core + """ + And STDERR should be empty + + When I run `wp help core download` + Then STDOUT should contain: + """ + wp core download + """ + And STDERR should be empty + + When I run `wp help help` + Then STDOUT should contain: + """ + wp help + """ + And STDERR should be empty + + When I run `wp help help` + Then STDOUT should contain: + """ + GLOBAL PARAMETERS + """ + And STDERR should be empty + + When I run `wp post list --post_type=post --posts_per_page=5 --help` + Then STDOUT should contain: + """ + wp post list + """ + And STDERR should be empty + + # Prior to WP 4.3 widgets & others used PHP 4 style constructors and prior to WP 3.9 wpdb used the mysql extension which can all lead (depending on PHP version) to PHP Deprecated notices. + @require-wp-4.3 + Scenario: Help for internal commands with WP + Given a WP installation + + When I run `wp help` + Then STDOUT should contain: + """ + Run 'wp help ' to get more information on a specific command. + + """ + And STDERR should be empty + + When I run `wp help core` + Then STDOUT should contain: + """ + wp core + """ + And STDERR should be empty + + When I run `wp help core download` + Then STDOUT should contain: + """ + wp core download + """ + And STDERR should be empty + + When I run `wp help help` + Then STDOUT should contain: + """ + wp help + """ + And STDERR should be empty + + When I run `wp help help` + Then STDOUT should contain: + """ + GLOBAL PARAMETERS + """ + And STDERR should be empty + + Scenario: Help when WordPress is downloaded but not installed + Given an empty directory + + When I run `wp core download` + And I run `wp help config create` + Then STDOUT should contain: + """ + wp config create + """ + And STDERR should be empty + + When I run `wp config create {CORE_CONFIG_SETTINGS}` + And I run `wp help core install` + Then STDOUT should contain: + """ + wp core install + """ + And STDERR should be empty + + When I run `wp help core is-installed` + Then STDOUT should contain: + """ + wp core is-installed + """ + And STDERR should be empty + + When I run `wp help core` + Then STDOUT should contain: + """ + wp core + """ + And STDERR should be empty + + When I run `wp help config` + Then STDOUT should contain: + """ + wp config + """ + And STDERR should be empty + + When I run `wp help db` + Then STDOUT should contain: + """ + wp db + """ + And STDERR should be empty + + When I try `wp help non-existent-command` + Then the return code should be 1 + And STDERR should be: + """ + Warning: Can’t select database. We were able to connect to the database server (which means your username and password is okay) but not able to select the `wp_cli_test` database. + Error: 'non-existent-command' is not a registered wp command. See 'wp help' for available commands. + """ + And STDOUT should be empty + + # Bug: if `WP_DEBUG` (or `WP_DEBUG_DISPLAY') is defined falsey than a db error won't be trapped. + Given a define-wp-debug-false.php file: + """ + ] + * : 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456 + * + * [--eighty-one=] + * : 123456789 123456789 123456789 123456789 123456789 123456789 123456789 1234567 + * + * [--forty=] + * : 123456789 123456789 123456789 123456 + * + * [--forty-one=] + * : 123456789 123456789 123456789 1234567 + * + * ## EXAMPLES + * + * # Re-generate only the thumbnails of "large" image size for all images. + * $ wp media regenerate --image_size=large + * Do you really want to regenerate the "large" image size for all images? [y/n] y + * Found 3 images to regenerate. + * 1/3 Regenerated "large" thumbnail for "Yoogest Image Ever, Really" (ID 9999). + * 2/3 No "large" thumbnail regeneration needed for "Snowflake" (ID 9998). + * 3/3 Regenerated "large" thumbnail for "Even Yooger than the Yoogest Image Ever, Really" (ID 9997). + * Success: Regenerated 3 of 3 images. + * + * # 6 initial spaces + 74 = 80; 6 + 75 = 81 + * # 123456789 123456789 123456789 123456789 123456789 123456789 123456789 1234 + * # 123456789 123456789 123456789 123456789 123456789 123456789 123456789 12345 + * + * # 6 initial spaces + 34 = 40; 6 + 35 = 41 + * # 123456789 123456789 123456789 1234 + * # 123456789 123456789 123456789 12345 + * + */ + function my_command() {} + } + + WP_CLI::add_command( 'test-wordwrap', 'Test_Wordwrap' ); + """ + And I run `wp plugin activate test-cli` + + When I run `COLUMNS=80 wp help test-wordwrap my_command` + Then STDOUT should contain: + """ + 123456789 123456789 123456789 123456789 123456789 123456789 123456789 12345678 + + """ + And STDOUT should contain: + """ + [--skip-delete] + Skip deletion of the original thumbnails. If your thumbnails are linked from + sources outside your control, it's likely best to leave them around. + Defaults to false. + + """ + And STDOUT should contain: + """ + [--eighty=] + 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456 + + """ + And STDOUT should contain: + """ + [--eighty-one=] + 123456789 123456789 123456789 123456789 123456789 123456789 123456789 + 1234567 + + """ + And STDOUT should contain: + """ + # Re-generate only the thumbnails of "large" image size for all images. + $ wp media regenerate --image_size=large + Do you really want to regenerate the "large" image size for all images? + [y/n] y + Found 3 images to regenerate. + 1/3 Regenerated "large" thumbnail for "Yoogest Image Ever, Really" (ID + 9999). + 2/3 No "large" thumbnail regeneration needed for "Snowflake" (ID 9998). + 3/3 Regenerated "large" thumbnail for "Even Yooger than the Yoogest Image + Ever, Really" (ID 9997). + Success: Regenerated 3 of 3 images. + + """ + And STDOUT should contain: + """ + # 123456789 123456789 123456789 123456789 123456789 123456789 123456789 1234 + # 123456789 123456789 123456789 123456789 123456789 123456789 123456789 + 12345 + """ + And STDOUT should contain: + """ + --url= + Pretend request came from given URL. In multisite, this argument is how + the target site is specified. + + """ + And STDERR should be empty + + When I run `COLUMNS=80 wp help test-wordwrap my_command | awk '{print length, $0}' | sort -nr | head -1 | cut -f1 -d" "` + Then STDOUT should be: + """ + 80 + """ + + When I run `TERM=vt100 COLUMNS=40 wp help test-wordwrap my_command` + Then STDOUT should contain: + """ + 123456789 123456789 123456789 + 123456789 123456789 123456789 + 123456789 12345678 + + """ + And STDOUT should contain: + """ + [--skip-delete] + Skip deletion of the original + thumbnails. If your thumbnails are + linked from sources outside your + control, it's likely best to leave + them around. Defaults to false. + + """ + And STDOUT should contain: + """ + [--forty=] + 123456789 123456789 123456789 123456 + + """ + And STDOUT should contain: + """ + [--forty-one=] + 123456789 123456789 123456789 + 1234567 + + """ + And STDOUT should contain: + """ + # Re-generate only the thumbnails of + "large" image size for all images. + $ wp media regenerate + --image_size=large + Do you really want to regenerate the + "large" image size for all images? + [y/n] y + Found 3 images to regenerate. + 1/3 Regenerated "large" thumbnail + for "Yoogest Image Ever, Really" (ID + 9999). + 2/3 No "large" thumbnail + regeneration needed for "Snowflake" + (ID 9998). + 3/3 Regenerated "large" thumbnail + for "Even Yooger than the Yoogest + Image Ever, Really" (ID 9997). + Success: Regenerated 3 of 3 images. + + """ + And STDOUT should contain: + """ + # 123456789 123456789 123456789 1234 + # 123456789 123456789 123456789 + 12345 + """ + And STDOUT should contain: + """ + --url= + Pretend request came from given + URL. In multisite, this argument + is how the target site is + specified. + + """ + And STDERR should be empty + + When I run `TERM=vt100 COLUMNS=40 wp help test-wordwrap my_command | sed '/\-\-ssh/d' | awk '{print length, $0}' | sort -nr | head -1 | cut -f1 -d" "` + Then STDOUT should be: + """ + 40 + """ + + When I run `TERM=vt100 COLUMNS=1000 wp help test-wordwrap my_command` + Then STDOUT should contain: + """ + [--skip-delete] + Skip deletion of the original thumbnails. If your thumbnails are linked from sources outside your control, it's likely best to leave them around. Defaults to false. + + """ + And STDOUT should contain: + """ + # Re-generate only the thumbnails of "large" image size for all images. + $ wp media regenerate --image_size=large + Do you really want to regenerate the "large" image size for all images? [y/n] y + Found 3 images to regenerate. + 1/3 Regenerated "large" thumbnail for "Yoogest Image Ever, Really" (ID 9999). + 2/3 No "large" thumbnail regeneration needed for "Snowflake" (ID 9998). + 3/3 Regenerated "large" thumbnail for "Even Yooger than the Yoogest Image Ever, Really" (ID 9997). + Success: Regenerated 3 of 3 images. + + """ + And STDOUT should contain: + """ + --url= + Pretend request came from given URL. In multisite, this argument is how the target site is specified. + + """ + And STDERR should be empty + + Scenario: Help for commands with subcommands should wordwrap well + Given a WP installation + And a wp-content/plugins/test-cli/command.php file: + """ + + */ + public function __invoke( $args, $assoc_args ) {} + } + + WP_CLI::add_command( 'reference-link', 'WP_CLI_Foo_Bar_Command' ); + """ + And a wp-cli.yml file: + """ + require: + - command.php + """ + + When I run `TERM=vt100 COLUMNS=80 wp help reference-link` + Then STDOUT should contain: + """ + This is a [reference link][1]. + Also, there is a [second link][2]. + They should be displayed nicely! + + --- + [1] https://wordpress.org/ + [2] http://wp-cli.org/ + """ + + When I run `wp help role` + Then STDOUT should contain: + """ + See references for [Roles and Capabilities][1] and [WP User class][2]. + + --- + [1] https://codex.wordpress.org/Roles_and_Capabilities + [2] https://codex.wordpress.org/Class_Reference/WP_User + """ + + Scenario: Very long description for top-level command which has reference link display well + Given a WP installation + And a command.php file: + """ + + */ + public function __invoke( $args, $assoc_args ) {} + } + + WP_CLI::add_command( 'reference-link', 'WP_CLI_Foo_Bar_Command' ); + """ + And a wp-cli.yml file: + """ + require: + - command.php + """ + + When I run `TERM=vt100 COLUMNS=80 wp help reference-link` + Then STDOUT should contain: + """ + This is a [reference link][1]. Also, there is a [second link][2]. They should + be displayed nicely! Wow! This is a very, very long description. + + --- + [1] https://wordpress.org/ + [2] http://wp-cli.org/ + """ + + When I run `TERM=vt100 COLUMNS=60 wp help reference-link` + Then STDOUT should contain: + """ + This is a [reference link][1]. Also, there is a [second + link][2]. They should be displayed nicely! Wow! This is a + very, very long description. + + --- + [1] https://wordpress.org/ + [2] http://wp-cli.org/ + """ + + Scenario Outline: Check that proc_open() and proc_close() aren't disabled for help pager + Given an empty directory + When I try `{INVOKE_WP_CLI_WITH_PHP_ARGS--ddisable_functions=} help --debug` + Then STDERR should contain: + """ + Warning: check_proc_available() failed in pass_through_pager(). + """ + And the return code should be 0 + + Examples: + | func | + | proc_open | + | proc_close | diff --git a/features/hook.feature b/features/hook.feature new file mode 100644 index 000000000..f94191381 --- /dev/null +++ b/features/hook.feature @@ -0,0 +1,73 @@ +Feature: Tests `WP_CLI::add_hook()` + + Scenario: Add callback to the `before_invoke` + Given a WP installation + And a before-invoke.php file: + """ + + * : An positional arg. + * + * [--flag1=] + * : An optional flag + * + * [--flag2=] + * : An optional flag + * + * @when before_wp_load + */ + WP_CLI::add_command( 'foobar', function( $_, $assoc_args ) { + WP_CLI::line( 'arg: ' . $_[0] ); + WP_CLI::line( 'flag1: ' . $assoc_args['flag1'] ); + } ); + """ + And a wp-cli.yml file: + """ + require: + - command-foobar.php + """ + + When I run `echo 'bar' | wp foobar foo --prompt=flag1` + Then the return code should be 0 + And STDERR should be empty + And STDOUT should contain: + """ + arg: foo + """ + And STDOUT should contain: + """ + flag1: bar + """ diff --git a/features/runcommand.feature b/features/runcommand.feature new file mode 100644 index 000000000..20e88c990 --- /dev/null +++ b/features/runcommand.feature @@ -0,0 +1,304 @@ +Feature: Run a WP-CLI command + + Background: + Given an empty directory + And a command.php file: + """ + + * : Command to run, quoted. + * + * [--launch] + * : Launch a new process for the command. + * + * [--exit_error] + * : Exit on error. + * + * [--return[=]] + * : Capture and return output. + * + * [--parse=] + * : Parse returned output as a particular format. + */ + WP_CLI::add_command( 'run', function( $args, $assoc_args ){ + $ret = WP_CLI::runcommand( $args[0], $assoc_args ); + $ret = is_object( $ret ) ? (array) $ret : $ret; + WP_CLI::log( 'returned: ' . var_export( $ret, true ) ); + }); + """ + And a wp-cli.yml file: + """ + user: admin + require: + - command.php + """ + And a config.yml file: + """ + user get: + 0: admin + field: user_email + """ + + Scenario Outline: Run a WP-CLI command and render output + Given a WP installation + + When I run `wp run 'option get home'` + Then STDOUT should be: + """ + http://example.com + returned: NULL + """ + And STDERR should be empty + And the return code should be 0 + + When I run `wp run 'eval "echo wp_get_current_user()->user_login . PHP_EOL;"'` + Then STDOUT should be: + """ + admin + returned: NULL + """ + And STDERR should be empty + And the return code should be 0 + + When I run `WP_CLI_CONFIG_PATH=config.yml wp run 'user get'` + Then STDOUT should be: + """ + admin@example.com + returned: NULL + """ + And STDERR should be empty + And the return code should be 0 + + Examples: + | flag | + | --no-launch | + | --launch | + + Scenario Outline: Run a WP-CLI command and capture output + Given a WP installation + + When I run `wp run --return 'option get home'` + Then STDOUT should be: + """ + returned: 'http://example.com' + """ + And STDERR should be empty + And the return code should be 0 + + When I run `wp --return run 'eval "echo wp_get_current_user()->user_login . PHP_EOL;"'` + Then STDOUT should be: + """ + returned: 'admin' + """ + And STDERR should be empty + And the return code should be 0 + + When I run `wp --return=stderr run 'eval "echo wp_get_current_user()->user_login . PHP_EOL;"'` + Then STDOUT should be: + """ + returned: '' + """ + And STDERR should be empty + And the return code should be 0 + + When I run `wp --return=return_code run 'eval "echo wp_get_current_user()->user_login . PHP_EOL;"'` + Then STDOUT should be: + """ + returned: 0 + """ + And STDERR should be empty + And the return code should be 0 + + When I run `wp --return=all run 'eval "echo wp_get_current_user()->user_login . PHP_EOL;"'` + Then STDOUT should be: + """ + returned: array ( + 'stdout' => 'admin', + 'stderr' => '', + 'return_code' => 0, + ) + """ + And STDERR should be empty + And the return code should be 0 + + When I run `WP_CLI_CONFIG_PATH=config.yml wp --return run 'user get'` + Then STDOUT should be: + """ + returned: 'admin@example.com' + """ + And STDERR should be empty + And the return code should be 0 + + Examples: + | flag | + | --no-launch | + | --launch | + + Scenario Outline: Use 'parse=json' to parse JSON output + Given a WP installation + + When I run `wp run --return --parse=json 'user get admin --fields=user_login,user_email --format=json'` + Then STDOUT should be: + """ + returned: array ( + 'user_login' => 'admin', + 'user_email' => 'admin@example.com', + ) + """ + + Examples: + | flag | + | --no-launch | + | --launch | + + Scenario Outline: Exit on error by default + Given a WP installation + + When I try `wp run 'eval "WP_CLI::error( var_export( get_current_user_id(), true ) );"'` + Then STDOUT should be empty + And STDERR should be: + """ + Error: 1 + """ + And the return code should be 1 + + Examples: + | flag | + | --no-launch | + | --launch | + + Scenario Outline: Override erroring on exit + Given a WP installation + + When I try `wp run --no-exit_error --return=all 'eval "WP_CLI::error( var_export( get_current_user_id(), true ) );"'` + Then STDOUT should be: + """ + returned: array ( + 'stdout' => '', + 'stderr' => 'Error: 1', + 'return_code' => 1, + ) + """ + And STDERR should be empty + And the return code should be 0 + + When I run `wp --no-exit_error run 'option pluck foo$bar barfoo'` + Then STDOUT should be: + """ + returned: NULL + """ + And STDERR should be empty + And the return code should be 0 + + Examples: + | flag | + | --no-launch | + | --launch | + + Scenario Outline: Output using echo and log, success, warning and error + Given a WP installation + + # Note WP_CLI::error() terminates eval processing so needs to be last. + When I run `wp run --no-exit_error --return=all 'eval "WP_CLI::log( '\'log\'' ); echo '\'echo\''; WP_CLI::success( '\'success\'' ); WP_CLI::error( '\'error\'' );"'` + Then STDOUT should be: + """ + returned: array ( + 'stdout' => 'log + echoSuccess: success', + 'stderr' => 'Error: error', + 'return_code' => 1, + ) + """ + And STDERR should be empty + And the return code should be 0 + + When I run `wp run --no-exit_error --return=all 'eval "echo '\'echo\''; WP_CLI::log( '\'log\'' ); WP_CLI::warning( '\'warning\''); WP_CLI::success( '\'success\'' );"'` + Then STDOUT should be: + """ + returned: array ( + 'stdout' => 'echolog + Success: success', + 'stderr' => 'Warning: warning', + 'return_code' => 0, + ) + """ + And STDERR should be empty + And the return code should be 0 + + Examples: + | flag | + | --no-launch | + | --launch | + + Scenario Outline: Installed packages work as expected + Given a WP installation + + When I run `wp package install wp-cli/scaffold-package-command` + Then STDERR should be empty + + When I run `wp run 'help scaffold package'` + Then STDOUT should contain: + """ + wp scaffold package + """ + And STDERR should be empty + + Examples: + | flag | + | --no-launch | + | --launch | + + Scenario Outline: Persists global parameters when supplied interactively + Given a WP installation in 'foo' + + When I run `wp --path=foo run 'rewrite structure "archives/%post_id%/" --path=foo'` + Then STDOUT should be: + """ + Success: Rewrite rules flushed. + Success: Rewrite structure set. + returned: NULL + """ + And STDERR should be empty + And the return code should be 0 + + Examples: + | flag | + | --no-launch | + | --launch | + + Scenario Outline: Apply backwards compat conversions + Given a WP installation + + When I run `wp run 'term url category 1'` + Then STDOUT should be: + """ + http://example.com/?cat=1 + returned: NULL + """ + And STDERR should be empty + And the return code should be 0 + + Examples: + | flag | + | --no-launch | + | --launch | + + Scenario Outline: Check that proc_open() and proc_close() aren't disabled for launch + Given a WP install + + When I try `{INVOKE_WP_CLI_WITH_PHP_ARGS--ddisable_functions=} --launch run 'option get home'` + Then STDERR should contain: + """ + Error: Cannot do 'launch option': The PHP functions `proc_open()` and/or `proc_close()` are disabled + """ + And the return code should be 1 + + Examples: + | func | + | proc_open | + | proc_close | diff --git a/features/runner.feature b/features/runner.feature new file mode 100644 index 000000000..4fcb5ae50 --- /dev/null +++ b/features/runner.feature @@ -0,0 +1,21 @@ +Feature: Runner WP-CLI + + Scenario: Path argument should be slashed correctly + When I try `wp no-such-command --path=/foo --debug` + Then STDERR should contain: + """ + ABSPATH defined: /foo/ + """ + + When I try `wp no-such-command --path=/foo/ --debug` + Then STDERR should contain: + """ + ABSPATH defined: /foo/ + """ + + When I try `wp no-such-command --path=/foo\\ --debug` + Then STDERR should contain: + """ + ABSPATH defined: /foo/ + """ + diff --git a/features/skip-plugins.feature b/features/skip-plugins.feature new file mode 100644 index 000000000..433749628 --- /dev/null +++ b/features/skip-plugins.feature @@ -0,0 +1,116 @@ +Feature: Skipping plugins + + Scenario: Skipping plugins via global flag + Given a WP installation + And I run `wp plugin activate hello akismet` + + When I run `wp eval 'var_export( defined("AKISMET_VERSION") );var_export( function_exists( "hello_dolly" ) );'` + Then STDOUT should be: + """ + truetrue + """ + + # The specified plugin should be skipped + When I run `wp --skip-plugins=akismet eval 'var_export( defined("AKISMET_VERSION") );'` + Then STDOUT should be: + """ + false + """ + + # The specified plugin should still show up as an active plugin + When I run `wp --skip-plugins=akismet plugin status akismet` + Then STDOUT should contain: + """ + Status: Active + """ + + # The un-specified plugin should continue to be loaded + When I run `wp --skip-plugins=akismet eval 'var_export( defined("AKISMET_VERSION") );var_export( function_exists( "hello_dolly" ) );'` + Then STDOUT should be: + """ + falsetrue + """ + + # Can specify multiple plugins to skip + When I try `wp eval --skip-plugins=hello,akismet 'echo hello_dolly();'` + Then STDERR should contain: + """ + Call to undefined function hello_dolly() + """ + + # No plugins should be loaded when --skip-plugins doesn't have a value + When I run `wp --skip-plugins eval 'var_export( defined("AKISMET_VERSION") );var_export( function_exists( "hello_dolly" ) );'` + Then STDOUT should be: + """ + falsefalse + """ + + Scenario: Skipping multiple plugins via config file + Given a WP installation + And a wp-cli.yml file: + """ + skip-plugins: + - hello + - akismet + """ + + When I run `wp plugin activate hello` + And I try `wp eval 'echo hello_dolly();'` + Then STDERR should contain: + """ + Call to undefined function hello_dolly() + """ + + Scenario: Skipping all plugins via config file + Given a WP installation + And a wp-cli.yml file: + """ + skip-plugins: true + """ + + When I run `wp plugin activate hello` + And I try `wp eval 'echo hello_dolly();'` + Then STDERR should contain: + """ + Call to undefined function hello_dolly() + """ + + Scenario: Skip network active plugins + Given a WP multisite installation + + When I try `wp plugin deactivate akismet hello` + Then STDERR should be: + """ + Warning: Plugin 'akismet' isn't active. + Warning: Plugin 'hello' isn't active. + """ + And STDOUT should be: + """ + Success: Plugins already deactivated. + """ + And the return code should be 0 + + When I run `wp plugin activate --network akismet hello` + And I run `wp eval 'var_export( defined("AKISMET_VERSION") );var_export( function_exists( "hello_dolly" ) );'` + Then STDOUT should be: + """ + truetrue + """ + + When I run `wp --skip-plugins eval 'var_export( defined("AKISMET_VERSION") );var_export( function_exists( "hello_dolly" ) );'` + Then STDOUT should be: + """ + falsefalse + """ + + When I run `wp --skip-plugins=akismet eval 'var_export( defined("AKISMET_VERSION") );var_export( function_exists( "hello_dolly" ) );'` + Then STDOUT should be: + """ + falsetrue + """ + + When I run `wp --skip-plugins=hello eval 'var_export( defined("AKISMET_VERSION") );var_export( function_exists( "hello_dolly" ) );'` + Then STDOUT should be: + """ + truefalse + """ diff --git a/features/skip-themes.feature b/features/skip-themes.feature new file mode 100644 index 000000000..eb54988ce --- /dev/null +++ b/features/skip-themes.feature @@ -0,0 +1,152 @@ +Feature: Skipping themes + + Scenario: Skipping themes via global flag + Given a WP installation + And I run `wp theme install classic` + And I run `wp theme install default --activate` + + When I run `wp eval 'var_export( function_exists( "kubrick_head" ) );'` + Then STDOUT should be: + """ + true + """ + And STDERR should be empty + + # The specified theme should be skipped + When I run `wp --skip-themes=default eval 'var_export( function_exists( "kubrick_head" ) );'` + Then STDOUT should be: + """ + false + """ + And STDERR should be empty + + # All themes should be skipped + When I run `wp --skip-themes eval 'var_export( function_exists( "kubrick_head" ) );'` + Then STDOUT should be: + """ + false + """ + And STDERR should be empty + + # Skip another theme + When I run `wp --skip-themes=classic eval 'var_export( function_exists( "kubrick_head" ) );'` + Then STDOUT should be: + """ + true + """ + And STDERR should be empty + + # The specified theme should still show up as an active theme + When I run `wp --skip-themes theme status default` + Then STDOUT should contain: + """ + Active + """ + And STDERR should be empty + + # Skip several themes + When I run `wp --skip-themes=classic,default eval 'var_export( function_exists( "kubrick_head" ) );'` + Then STDOUT should be: + """ + false + """ + And STDERR should be empty + + Scenario: Skip parent and child themes + Given a WP installation + And I run `wp theme install jolene biker` + + When I run `wp theme activate jolene` + When I run `wp eval 'var_export( function_exists( "jolene_setup" ) );'` + Then STDOUT should be: + """ + true + """ + And STDERR should be empty + + When I run `wp --skip-themes=jolene eval 'var_export( function_exists( "jolene_setup" ) );'` + Then STDOUT should be: + """ + false + """ + And STDERR should be empty + + When I run `wp theme activate biker` + When I run `wp eval 'var_export( function_exists( "jolene_setup" ) );'` + Then STDOUT should be: + """ + true + """ + And STDERR should be empty + + When I run `wp eval 'var_export( function_exists( "biker_setup" ) );'` + Then STDOUT should be: + """ + true + """ + And STDERR should be empty + + When I run `wp --skip-themes=biker eval 'var_export( function_exists( "jolene_setup" ) );'` + Then STDOUT should be: + """ + false + """ + And STDERR should be empty + + When I run `wp --skip-themes=biker eval 'var_export( function_exists( "biker_setup" ) );'` + Then STDOUT should be: + """ + false + """ + And STDERR should be empty + + When I run `wp --skip-themes=biker eval 'echo get_template_directory();'` + Then STDOUT should contain: + """ + wp-content/themes/jolene + """ + And STDERR should be empty + + When I run `wp --skip-themes=biker eval 'echo get_stylesheet_directory();'` + Then STDOUT should contain: + """ + wp-content/themes/biker + """ + And STDERR should be empty + + Scenario: Skipping multiple themes via config file + Given a WP installation + And a wp-cli.yml file: + """ + skip-themes: + - classic + - default + """ + And I run `wp theme install classic --activate` + And I run `wp theme install default` + + # The classic theme should show up as an active theme + When I run `wp theme status` + Then STDOUT should contain: + """ + A classic + """ + And STDERR should be empty + + # The default theme should show up as an installed theme + When I run `wp theme status` + Then STDOUT should contain: + """ + I default + """ + And STDERR should be empty + + And I run `wp theme activate default` + + # The default theme should be skipped + When I run `wp eval 'var_export( function_exists( "kubrick_head" ) );'` + Then STDOUT should be: + """ + false + """ + And STDERR should be empty diff --git a/features/steps.feature b/features/steps.feature new file mode 100644 index 000000000..97c5048a1 --- /dev/null +++ b/features/steps.feature @@ -0,0 +1,59 @@ +Feature: Make sure "Given", "When", "Then" steps work as expected + + Scenario: Variable names can only contain uppercase letters, digits and underscores and cannot begin with a digit. + + When I run `echo value` + And save STDOUT as {VARIABLE_NAME} + And save STDOUT as {V} + And save STDOUT as {_VARIABLE_NAME_STARTING_WITH_UNDERSCORE} + And save STDOUT as {_} + And save STDOUT as {VARIABLE_NAME_WITH_DIGIT_2} + And save STDOUT as {V2} + And save STDOUT as {_2} + And save STDOUT as {2_VARIABLE_NAME_STARTING_WITH_DIGIT} + And save STDOUT as {2} + And save STDOUT as {VARIABLE_NAME_WITH_lowercase} + And save STDOUT as {v} + # Note this would give behat "undefined step" message as "save" step uses "\w+" + #And save STDOUT as {VARIABLE_NAME_WITH_PERCENT_%} + + When I run `echo {VARIABLE_NAME}` + Then STDOUT should match /^value$/ + And STDOUT should be: + """ + value + """ + + When I run `echo {V}` + Then STDOUT should match /^value$/ + + When I run `echo {_VARIABLE_NAME_STARTING_WITH_UNDERSCORE}` + Then STDOUT should match /^value$/ + + When I run `echo {_}` + Then STDOUT should match /^value$/ + + When I run `echo {VARIABLE_NAME_WITH_DIGIT_2}` + Then STDOUT should match /^value$/ + + When I run `echo {V2}` + Then STDOUT should match /^value$/ + + When I run `echo {_2}` + Then STDOUT should match /^value$/ + + When I run `echo {2_VARIABLE_NAME_STARTING_WITH_DIGIT}` + Then STDOUT should match /^\{2_VARIABLE_NAME_STARTING_WITH_DIGIT}$/ + And STDOUT should contain: + """ + { + """ + + When I run `echo {2}` + Then STDOUT should match /^\{2}$/ + + When I run `echo {VARIABLE_NAME_WITH_lowercase}` + Then STDOUT should match /^\{VARIABLE_NAME_WITH_lowercase}$/ + + When I run `echo {v}` + Then STDOUT should match /^\{v}$/ diff --git a/features/steps/given.php b/features/steps/given.php new file mode 100644 index 000000000..3e501c2c7 --- /dev/null +++ b/features/steps/given.php @@ -0,0 +1,219 @@ +Given( '/^an empty directory$/', + function ( $world ) { + $world->create_run_dir(); + } +); + +$steps->Given( '/^an? (empty|non-existent) ([^\s]+) directory$/', + function ( $world, $empty_or_nonexistent, $dir ) { + $dir = $world->replace_variables( $dir ); + if ( ! WP_CLI\Utils\is_path_absolute( $dir ) ) { + $dir = $world->variables['RUN_DIR'] . "/$dir"; + } + if ( 0 !== strpos( $dir, sys_get_temp_dir() ) ) { + throw new RuntimeException( sprintf( "Attempted to delete directory '%s' that is not in the temp directory '%s'. " . __FILE__ . ':' . __LINE__, $dir, sys_get_temp_dir() ) ); + } + $world->remove_dir( $dir ); + if ( 'empty' === $empty_or_nonexistent ) { + mkdir( $dir, 0777, true /*recursive*/ ); + } + } +); + +$steps->Given( '/^an empty cache/', + function ( $world ) { + $world->variables['SUITE_CACHE_DIR'] = FeatureContext::create_cache_dir(); + } +); + +$steps->Given( '/^an? ([^\s]+) file:$/', + function ( $world, $path, PyStringNode $content ) { + $content = (string) $content . "\n"; + $full_path = $world->variables['RUN_DIR'] . "/$path"; + $dir = dirname( $full_path ); + if ( ! file_exists( $dir ) ) { + mkdir( $dir, 0777, true /*recursive*/ ); + } + file_put_contents( $full_path, $content ); + } +); + +$steps->Given( '/^"([^"]+)" replaced with "([^"]+)" in the ([^\s]+) file$/', function( $world, $search, $replace, $path ) { + $full_path = $world->variables['RUN_DIR'] . "/$path"; + $contents = file_get_contents( $full_path ); + $contents = str_replace( $search, $replace, $contents ); + file_put_contents( $full_path, $contents ); +}); + +$steps->Given( '/^WP files$/', + function ( $world ) { + $world->download_wp(); + } +); + +$steps->Given( '/^wp-config\.php$/', + function ( $world ) { + $world->create_config(); + } +); + +$steps->Given( '/^a database$/', + function ( $world ) { + $world->create_db(); + } +); + +$steps->Given( '/^a WP (install|installation)$/', + function ( $world ) { + $world->install_wp(); + } +); + +$steps->Given( "/^a WP (install|installation) in '([^\s]+)'$/", + function ( $world, $_, $subdir ) { + $world->install_wp( $subdir ); + } +); + +$steps->Given( '/^a WP (install|installation) with Composer$/', + function ( $world ) { + $world->install_wp_with_composer(); + } +); + +$steps->Given( "/^a WP (install|installation) with Composer and a custom vendor directory '([^\s]+)'$/", + function ( $world, $_, $vendor_directory ) { + $world->install_wp_with_composer( $vendor_directory ); + } +); + +$steps->Given( '/^a WP multisite (subdirectory|subdomain)?\s?(install|installation)$/', + function ( $world, $type = 'subdirectory' ) { + $world->install_wp(); + $subdomains = ! empty( $type ) && 'subdomain' === $type ? 1 : 0; + $world->proc( 'wp core install-network', array( 'title' => 'WP CLI Network', 'subdomains' => $subdomains ) )->run_check(); + } +); + +$steps->Given( '/^these installed and active plugins:$/', + function( $world, $stream ) { + $plugins = implode( ' ', array_map( 'trim', explode( PHP_EOL, (string)$stream ) ) ); + $world->proc( "wp plugin install $plugins --activate" )->run_check(); + } +); + +$steps->Given( '/^a custom wp-content directory$/', + function ( $world ) { + $wp_config_path = $world->variables['RUN_DIR'] . "/wp-config.php"; + + $wp_config_code = file_get_contents( $wp_config_path ); + + $world->move_files( 'wp-content', 'my-content' ); + $world->add_line_to_wp_config( $wp_config_code, + "define( 'WP_CONTENT_DIR', dirname(__FILE__) . '/my-content' );" ); + + $world->move_files( 'my-content/plugins', 'my-plugins' ); + $world->add_line_to_wp_config( $wp_config_code, + "define( 'WP_PLUGIN_DIR', __DIR__ . '/my-plugins' );" ); + + file_put_contents( $wp_config_path, $wp_config_code ); + } +); + +$steps->Given( '/^download:$/', + function ( $world, TableNode $table ) { + foreach ( $table->getHash() as $row ) { + $path = $world->replace_variables( $row['path'] ); + if ( file_exists( $path ) ) { + // assume it's the same file and skip re-download + continue; + } + + Process::create( \WP_CLI\Utils\esc_cmd( 'curl -sSL %s > %s', $row['url'], $path ) )->run_check(); + } + } +); + +$steps->Given( '/^save (STDOUT|STDERR) ([\'].+[^\'])?\s?as \{(\w+)\}$/', + function ( $world, $stream, $output_filter, $key ) { + + $stream = strtolower( $stream ); + + if ( $output_filter ) { + $output_filter = '/' . trim( str_replace( '%s', '(.+[^\b])', $output_filter ), "' " ) . '/'; + if ( false !== preg_match( $output_filter, $world->result->$stream, $matches ) ) + $output = array_pop( $matches ); + else + $output = ''; + } else { + $output = $world->result->$stream; + } + $world->variables[ $key ] = trim( $output, "\n" ); + } +); + +$steps->Given( '/^a new Phar with (?:the same version|version "([^"]+)")$/', + function ( $world, $version = 'same' ) { + $world->build_phar( $version ); + } +); + +$steps->Given( '/^a downloaded Phar with (?:the same version|version "([^"]+)")$/', + function ( $world, $version = 'same' ) { + $world->download_phar( $version ); + } +); + +$steps->Given( '/^save the (.+) file ([\'].+[^\'])?as \{(\w+)\}$/', + function ( $world, $filepath, $output_filter, $key ) { + $full_file = file_get_contents( $world->replace_variables( $filepath ) ); + + if ( $output_filter ) { + $output_filter = '/' . trim( str_replace( '%s', '(.+[^\b])', $output_filter ), "' " ) . '/'; + if ( false !== preg_match( $output_filter, $full_file, $matches ) ) + $output = array_pop( $matches ); + else + $output = ''; + } else { + $output = $full_file; + } + $world->variables[ $key ] = trim( $output, "\n" ); + } +); + +$steps->Given('/^a misconfigured WP_CONTENT_DIR constant directory$/', + function($world) { + $wp_config_path = $world->variables['RUN_DIR'] . "/wp-config.php"; + + $wp_config_code = file_get_contents( $wp_config_path ); + + $world->add_line_to_wp_config( $wp_config_code, + "define( 'WP_CONTENT_DIR', '' );" ); + + file_put_contents( $wp_config_path, $wp_config_code ); + } +); + +$steps->Given( '/^a dependency on current wp-cli$/', + function ( $world ) { + $world->composer_require_current_wp_cli(); + } +); + +$steps->Given( '/^a PHP built-in web server$/', + function ( $world ) { + $world->start_php_server(); + } +); + +$steps->Given( "/^a PHP built-in web server to serve '([^\s]+)'$/", + function ( $world, $subdir ) { + $world->start_php_server( $subdir ); + } +); diff --git a/features/steps/then.php b/features/steps/then.php new file mode 100644 index 000000000..21589e737 --- /dev/null +++ b/features/steps/then.php @@ -0,0 +1,237 @@ +Then( '/^the return code should( not)? be (\d+)$/', + function ( $world, $not, $return_code ) { + if ( ( ! $not && $return_code != $world->result->return_code ) || ( $not && $return_code == $world->result->return_code ) ) { + throw new RuntimeException( $world->result ); + } + } +); + +$steps->Then( '/^(STDOUT|STDERR) should (be|contain|not contain):$/', + function ( $world, $stream, $action, PyStringNode $expected ) { + + $stream = strtolower( $stream ); + + $expected = $world->replace_variables( (string) $expected ); + + checkString( $world->result->$stream, $expected, $action, $world->result ); + } +); + +$steps->Then( '/^(STDOUT|STDERR) should be a number$/', + function ( $world, $stream ) { + + $stream = strtolower( $stream ); + + assertNumeric( trim( $world->result->$stream, "\n" ) ); + } +); + +$steps->Then( '/^(STDOUT|STDERR) should not be a number$/', + function ( $world, $stream ) { + + $stream = strtolower( $stream ); + + assertNotNumeric( trim( $world->result->$stream, "\n" ) ); + } +); + +$steps->Then( '/^STDOUT should be a table containing rows:$/', + function ( $world, TableNode $expected ) { + $output = $world->result->stdout; + $actual_rows = explode( "\n", rtrim( $output, "\n" ) ); + + $expected_rows = array(); + foreach ( $expected->getRows() as $row ) { + $expected_rows[] = $world->replace_variables( implode( "\t", $row ) ); + } + + compareTables( $expected_rows, $actual_rows, $output ); + } +); + +$steps->Then( '/^STDOUT should end with a table containing rows:$/', + function ( $world, TableNode $expected ) { + $output = $world->result->stdout; + $actual_rows = explode( "\n", rtrim( $output, "\n" ) ); + + $expected_rows = array(); + foreach ( $expected->getRows() as $row ) { + $expected_rows[] = $world->replace_variables( implode( "\t", $row ) ); + } + + $start = array_search( $expected_rows[0], $actual_rows ); + + if ( false === $start ) + throw new \Exception( $world->result ); + + compareTables( $expected_rows, array_slice( $actual_rows, $start ), $output ); + } +); + +$steps->Then( '/^STDOUT should be JSON containing:$/', + function ( $world, PyStringNode $expected ) { + $output = $world->result->stdout; + $expected = $world->replace_variables( (string) $expected ); + + if ( !checkThatJsonStringContainsJsonString( $output, $expected ) ) { + throw new \Exception( $world->result ); + } +}); + +$steps->Then( '/^STDOUT should be a JSON array containing:$/', + function ( $world, PyStringNode $expected ) { + $output = $world->result->stdout; + $expected = $world->replace_variables( (string) $expected ); + + $actualValues = json_decode( $output ); + $expectedValues = json_decode( $expected ); + + $missing = array_diff( $expectedValues, $actualValues ); + if ( !empty( $missing ) ) { + throw new \Exception( $world->result ); + } +}); + +$steps->Then( '/^STDOUT should be CSV containing:$/', + function ( $world, TableNode $expected ) { + $output = $world->result->stdout; + + $expected_rows = $expected->getRows(); + foreach ( $expected as &$row ) { + foreach ( $row as &$value ) { + $value = $world->replace_variables( $value ); + } + } + + if ( ! checkThatCsvStringContainsValues( $output, $expected_rows ) ) + throw new \Exception( $world->result ); + } +); + +$steps->Then( '/^STDOUT should be YAML containing:$/', + function ( $world, PyStringNode $expected ) { + $output = $world->result->stdout; + $expected = $world->replace_variables( (string) $expected ); + + if ( !checkThatYamlStringContainsYamlString( $output, $expected ) ) { + throw new \Exception( $world->result ); + } +}); + +$steps->Then( '/^(STDOUT|STDERR) should be empty$/', + function ( $world, $stream ) { + + $stream = strtolower( $stream ); + + if ( !empty( $world->result->$stream ) ) { + throw new \Exception( $world->result ); + } + } +); + +$steps->Then( '/^(STDOUT|STDERR) should not be empty$/', + function ( $world, $stream ) { + + $stream = strtolower( $stream ); + + if ( '' === rtrim( $world->result->$stream, "\n" ) ) { + throw new Exception( $world->result ); + } + } +); + +$steps->Then( '/^(STDOUT|STDERR) should be a version string (<|<=|>|>=|==|=|!=|<>) ([+\w.{}-]+)$/', + function ( $world, $stream, $operator, $goal_ver ) { + $goal_ver = $world->replace_variables( $goal_ver ); + $stream = strtolower( $stream ); + if ( false === version_compare( trim( $world->result->$stream, "\n" ), $goal_ver, $operator ) ) { + throw new Exception( $world->result ); + } + } +); + +$steps->Then( '/^the (.+) (file|directory) should (exist|not exist|be:|contain:|not contain:)$/', + function ( $world, $path, $type, $action, $expected = null ) { + $path = $world->replace_variables( $path ); + + // If it's a relative path, make it relative to the current test dir + if ( '/' !== $path[0] ) + $path = $world->variables['RUN_DIR'] . "/$path"; + + if ( 'file' == $type ) { + $test = 'file_exists'; + } else if ( 'directory' == $type ) { + $test = 'is_dir'; + } + + switch ( $action ) { + case 'exist': + if ( ! $test( $path ) ) { + throw new Exception( "$path doesn't exist." ); + } + break; + case 'not exist': + if ( $test( $path ) ) { + throw new Exception( "$path exists." ); + } + break; + default: + if ( ! $test( $path ) ) { + throw new Exception( "$path doesn't exist." ); + } + $action = substr( $action, 0, -1 ); + $expected = $world->replace_variables( (string) $expected ); + if ( 'file' == $type ) { + $contents = file_get_contents( $path ); + } else if ( 'directory' == $type ) { + $files = glob( rtrim( $path, '/' ) . '/*' ); + foreach( $files as &$file ) { + $file = str_replace( $path . '/', '', $file ); + } + $contents = implode( PHP_EOL, $files ); + } + checkString( $contents, $expected, $action ); + } + } +); + +$steps->Then( '/^the contents of the (.+) file should match (((\/.+\/)|(#.+#))([a-z]+)?)$/', + function ( $world, $path, $expected ) { + $path = $world->replace_variables( $path ); + // If it's a relative path, make it relative to the current test dir + if ( '/' !== $path[0] ) { + $path = $world->variables['RUN_DIR'] . "/$path"; + } + $contents = file_get_contents( $path ); + assertRegExp( $expected, $contents ); + } +); + +$steps->Then( '/^(STDOUT|STDERR) should match (((\/.+\/)|(#.+#))([a-z]+)?)$/', + function ( $world, $stream, $expected ) { + $stream = strtolower( $stream ); + assertRegExp( $expected, $world->result->$stream ); + } +); + +$steps->Then( '/^an email should (be sent|not be sent)$/', function( $world, $expected ) { + if ( 'be sent' === $expected ) { + assertNotEquals( 0, $world->email_sends ); + } else if ( 'not be sent' === $expected ) { + assertEquals( 0, $world->email_sends ); + } else { + throw new Exception( 'Invalid expectation' ); + } +}); + +$steps->Then( '/^the HTTP status code should be (\d+)$/', + function ( $world, $return_code ) { + $response = \Requests::request( 'http://localhost:8080' ); + assertEquals( $return_code, $response->status_code ); + } +); diff --git a/features/steps/when.php b/features/steps/when.php new file mode 100644 index 000000000..d23aa0e66 --- /dev/null +++ b/features/steps/when.php @@ -0,0 +1,54 @@ + 'run_check_stderr', + 'try' => 'run' + ); + $method = $map[ $mode ]; + + return $proc->$method(); +} + +function capture_email_sends( $stdout ) { + $stdout = preg_replace( '#WP-CLI test suite: Sent email to.+\n?#', '', $stdout, -1, $email_sends ); + return array( $stdout, $email_sends ); +} + +$steps->When( '/^I launch in the background `([^`]+)`$/', + function ( $world, $cmd ) { + $world->background_proc( $cmd ); + } +); + +$steps->When( '/^I (run|try) `([^`]+)`$/', + function ( $world, $mode, $cmd ) { + $cmd = $world->replace_variables( $cmd ); + $world->result = invoke_proc( $world->proc( $cmd ), $mode ); + list( $world->result->stdout, $world->email_sends ) = capture_email_sends( $world->result->stdout ); + } +); + +$steps->When( "/^I (run|try) `([^`]+)` from '([^\s]+)'$/", + function ( $world, $mode, $cmd, $subdir ) { + $cmd = $world->replace_variables( $cmd ); + $world->result = invoke_proc( $world->proc( $cmd, array(), $subdir ), $mode ); + list( $world->result->stdout, $world->email_sends ) = capture_email_sends( $world->result->stdout ); + } +); + +$steps->When( '/^I (run|try) the previous command again$/', + function ( $world, $mode ) { + if ( !isset( $world->result ) ) + throw new \Exception( 'No previous command.' ); + + $proc = Process::create( $world->result->command, $world->result->cwd, $world->result->env ); + $world->result = invoke_proc( $proc, $mode ); + list( $world->result->stdout, $world->email_sends ) = capture_email_sends( $world->result->stdout ); + } +); + diff --git a/features/utils-wp.feature b/features/utils-wp.feature new file mode 100644 index 000000000..c71ddb903 --- /dev/null +++ b/features/utils-wp.feature @@ -0,0 +1,734 @@ +Feature: Utilities that depend on WordPress code + + Scenario: Clear WP cache + Given a WP install + And a test.php file: + """ + cache ) . ',' . isset( $wp_object_cache->group_ops ) . ',' . isset( $wp_object_cache->stats ) . ',' . isset( $wp_object_cache->memcache_debug ) . "\n"; + WP_CLI\Utils\wp_clear_object_cache(); + echo empty( $wp_object_cache->cache ) . ',' . isset( $wp_object_cache->group_ops ) . ',' . isset( $wp_object_cache->stats ) . ',' . isset( $wp_object_cache->memcache_debug ) . "\n"; + } ); + """ + + When I run `wp post create --post_title="Foo Bar" --porcelain` + And I run `wp --require=test.php eval ''` + Then STDOUT should be: + """ + ,,, + 1,,, + """ + + Scenario: Get WP table names for single site install + Given a WP install + And I run `wp db query "CREATE TABLE xx_wp_posts ( id int );"` + And I run `wp db query "CREATE TABLE wp_xx_posts ( id int );"` + And I run `wp db query "CREATE TABLE wp_posts_xx ( id int );"` + And I run `wp db query "CREATE TABLE wp_categories ( id int );"` + And a table_names.php file: + """ + ...] + * : List tables based on wildcard search, e.g. 'wp_*_options' or 'wp_post?'. + * + * [--scope=] + * : Can be all, global, ms_global, blog, or old tables. Defaults to all. + * + * [--network] + * : List all the tables in a multisite install. Overrides --scope=. + * + * [--all-tables-with-prefix] + * : List all tables that match the table prefix even if not registered on $wpdb. Overrides --network. + * + * [--all-tables] + * : List all tables in the database, regardless of the prefix, and even if not registered on $wpdb. Overrides --all-tables-with-prefix. + */ + function test_wp_get_table_names( $args, $assoc_args ) { + if ( $tables = WP_CLI\Utils\wp_get_table_names( $args, $assoc_args ) ) { + echo implode( PHP_EOL, $tables ) . PHP_EOL; + } + } + WP_CLI::add_command( 'get_table_names', 'test_wp_get_table_names' ); + """ + + When I run `wp --require=table_names.php get_table_names` + Then STDOUT should contain: + """ + wp_commentmeta + wp_comments + wp_links + wp_options + wp_postmeta + wp_posts + wp_term_relationships + wp_term_taxonomy + """ + # Leave out wp_termmeta for old WP compat. + And STDOUT should contain: + """ + wp_terms + wp_usermeta + wp_users + """ + And save STDOUT as {DEFAULT_STDOUT} + + When I run `wp --require=table_names.php get_table_names --scope=all` + Then STDOUT should be: + """ + {DEFAULT_STDOUT} + """ + + When I run `wp --require=table_names.php get_table_names --scope=blog` + Then STDOUT should contain: + """ + wp_commentmeta + wp_comments + wp_links + wp_options + wp_postmeta + wp_posts + wp_term_relationships + wp_term_taxonomy + """ + # Leave out wp_termmeta for old WP compat. + And STDOUT should contain: + """ + wp_terms + """ + + When I run `wp --require=table_names.php get_table_names --scope=global` + Then STDOUT should be: + """ + wp_usermeta + wp_users + """ + + When I run `wp --require=table_names.php get_table_names --scope=ms_global` + Then STDOUT should be empty + + When I run `wp --require=table_names.php get_table_names --scope=old` + Then STDOUT should be: + """ + wp_categories + """ + + When I run `wp --require=table_names.php get_table_names --network` + Then STDOUT should be: + """ + {DEFAULT_STDOUT} + """ + + When I run `wp --require=table_names.php get_table_names --all-tables-with-prefix` + Then STDOUT should contain: + """ + wp_categories + wp_commentmeta + wp_comments + wp_links + wp_options + wp_postmeta + wp_posts + wp_posts_xx + wp_term_relationships + wp_term_taxonomy + """ + # Leave out wp_termmeta for old WP compat. + And STDOUT should contain: + """ + wp_terms + wp_usermeta + wp_users + wp_xx_posts + """ + + When I run `wp --require=table_names.php get_table_names --all-tables` + Then STDOUT should contain: + """ + wp_categories + wp_commentmeta + wp_comments + wp_links + wp_options + wp_postmeta + wp_posts + wp_posts_xx + wp_term_relationships + wp_term_taxonomy + """ + # Leave out wp_termmeta for old WP compat. + And STDOUT should contain: + """ + wp_terms + wp_usermeta + wp_users + wp_xx_posts + xx_wp_posts + """ + + When I run `wp --require=table_names.php get_table_names '*_posts'` + Then STDOUT should be: + """ + wp_posts + """ + + When I run `wp --require=table_names.php get_table_names 'wp_post*'` + Then STDOUT should be: + """ + wp_postmeta + wp_posts + """ + + When I run `wp --require=table_names.php get_table_names 'wp*osts'` + Then STDOUT should be: + """ + wp_posts + """ + + When I run `wp --require=table_names.php get_table_names '*_posts' --scope=blog` + Then STDOUT should be: + """ + wp_posts + """ + + When I try `wp --require=table_names.php get_table_names '*_posts' --scope=global` + Then STDERR should be: + """ + Error: Couldn't find any tables matching: *_posts + """ + And STDOUT should be empty + + When I run `wp --require=table_names.php get_table_names '*_posts' --network` + Then STDOUT should be: + """ + wp_posts + """ + + When I run `wp --require=table_names.php get_table_names '*_posts' --all-tables-with-prefix` + Then STDOUT should be: + """ + wp_posts + wp_xx_posts + """ + + When I run `wp --require=table_names.php get_table_names '*wp_posts' --all-tables-with-prefix` + Then STDOUT should be: + """ + wp_posts + """ + + When I run `wp --require=table_names.php get_table_names 'wp_post*' --all-tables-with-prefix` + Then STDOUT should be: + """ + wp_postmeta + wp_posts + wp_posts_xx + """ + + When I run `wp --require=table_names.php get_table_names 'wp*osts' --all-tables-with-prefix` + Then STDOUT should be: + """ + wp_posts + wp_xx_posts + """ + + When I run `wp --require=table_names.php get_table_names '*_posts' --all-tables` + Then STDOUT should be: + """ + wp_posts + wp_xx_posts + xx_wp_posts + """ + + When I run `wp --require=table_names.php get_table_names '*wp_posts' --all-tables` + Then STDOUT should be: + """ + wp_posts + xx_wp_posts + """ + + When I run `wp --require=table_names.php get_table_names 'wp_post*' --all-tables` + Then STDOUT should be: + """ + wp_postmeta + wp_posts + wp_posts_xx + """ + + When I run `wp --require=table_names.php get_table_names 'wp*osts' --all-tables` + Then STDOUT should be: + """ + wp_posts + wp_xx_posts + """ + + When I try `wp --require=table_names.php get_table_names non_existent_table` + Then STDERR should be: + """ + Error: Couldn't find any tables matching: non_existent_table + """ + And STDOUT should be empty + + When I run `wp --require=table_names.php get_table_names wp_posts non_existent_table` + Then STDOUT should be: + """ + wp_posts + """ + + When I run `wp --require=table_names.php get_table_names wp_posts non_existent_table 'wp_?ption*'` + Then STDOUT should be: + """ + wp_options + wp_posts + """ + + Scenario: Get WP table names for multisite install + Given a WP multisite install + And I run `wp db query "CREATE TABLE xx_wp_posts ( id int );"` + And I run `wp db query "CREATE TABLE xx_wp_2_posts ( id int );"` + And I run `wp db query "CREATE TABLE wp_xx_posts ( id int );"` + And I run `wp db query "CREATE TABLE wp_2_xx_posts ( id int );"` + And I run `wp db query "CREATE TABLE wp_posts_xx ( id int );"` + And I run `wp db query "CREATE TABLE wp_2_posts_xx ( id int );"` + And I run `wp db query "CREATE TABLE wp_categories ( id int );"` + And I run `wp db query "CREATE TABLE wp_sitecategories ( id int );"` + And a table_names.php file: + """ + ...] + * : List tables based on wildcard search, e.g. 'wp_*_options' or 'wp_post?'. + * + * [--scope=] + * : Can be all, global, ms_global, blog, or old tables. Defaults to all. + * + * [--network] + * : List all the tables in a multisite install. Overrides --scope=. + * + * [--all-tables-with-prefix] + * : List all tables that match the table prefix even if not registered on $wpdb. Overrides --network. + * + * [--all-tables] + * : List all tables in the database, regardless of the prefix, and even if not registered on $wpdb. Overrides --all-tables-with-prefix. + */ + function test_wp_get_table_names( $args, $assoc_args ) { + if ( $tables = WP_CLI\Utils\wp_get_table_names( $args, $assoc_args ) ) { + echo implode( PHP_EOL, $tables ) . PHP_EOL; + } + } + WP_CLI::add_command( 'get_table_names', 'test_wp_get_table_names' ); + """ + + # With no subsite. + When I run `wp --require=table_names.php get_table_names` + Then STDOUT should contain: + """ + wp_blog_versions + wp_blogs + wp_commentmeta + wp_comments + wp_links + wp_options + wp_postmeta + wp_posts + wp_registration_log + wp_signups + wp_site + wp_sitemeta + wp_term_relationships + wp_term_taxonomy + """ + # Leave out wp_termmeta for old WP compat. + And STDOUT should contain: + """ + wp_terms + wp_usermeta + wp_users + """ + And save STDOUT as {DEFAULT_STDOUT} + + When I run `wp --require=table_names.php get_table_names --scope=all` + Then STDOUT should be: + """ + {DEFAULT_STDOUT} + """ + + When I run `wp --require=table_names.php get_table_names --scope=blog` + Then STDOUT should contain: + """ + wp_commentmeta + wp_comments + wp_links + wp_options + wp_postmeta + wp_posts + wp_term_relationships + wp_term_taxonomy + """ + # Leave out wp_termmeta for old WP compat. + And STDOUT should contain: + """ + wp_terms + """ + + When I run `wp --require=table_names.php get_table_names --scope=global` + Then STDOUT should be: + """ + wp_blog_versions + wp_blogs + wp_registration_log + wp_signups + wp_site + wp_sitemeta + wp_usermeta + wp_users + """ + And save STDOUT as {GLOBAL_STDOUT} + + When I run `wp --require=table_names.php get_table_names --scope=ms_global` + Then STDOUT should be: + """ + wp_blog_versions + wp_blogs + wp_registration_log + wp_signups + wp_site + wp_sitemeta + """ + + When I run `wp --require=table_names.php get_table_names --scope=old` + Then STDOUT should be: + """ + wp_categories + """ + + When I run `wp --require=table_names.php get_table_names --network` + Then STDOUT should be: + """ + {DEFAULT_STDOUT} + """ + + # With subsite. + Given I run `wp site create --slug=foo` + When I run `wp --require=table_names.php get_table_names` + Then STDOUT should be: + """ + {DEFAULT_STDOUT} + """ + + When I run `wp --require=table_names.php get_table_names --url=example.com/foo --scope=blog` + Then STDOUT should contain: + """ + wp_2_commentmeta + wp_2_comments + wp_2_links + wp_2_options + wp_2_postmeta + wp_2_posts + wp_2_term_relationships + wp_2_term_taxonomy + """ + # Leave out wp_2_termmeta for old WP compat. + And STDOUT should contain: + """ + wp_2_terms + """ + And save STDOUT as {SUBSITE_BLOG_STDOUT} + + When I run `wp --require=table_names.php get_table_names --url=example.com/foo` + Then STDOUT should be: + """ + {SUBSITE_BLOG_STDOUT} + {GLOBAL_STDOUT} + """ + + When I run `wp --require=table_names.php get_table_names --network` + Then STDOUT should be: + """ + {SUBSITE_BLOG_STDOUT} + {DEFAULT_STDOUT} + """ + And save STDOUT as {NETWORK_STDOUT} + + When I run `wp --require=table_names.php get_table_names --network --url=example.com/foo` + Then STDOUT should be: + """ + {NETWORK_STDOUT} + """ + + When I run `wp --require=table_names.php get_table_names --all-tables-with-prefix` + Then STDOUT should contain: + """ + wp_2_commentmeta + wp_2_comments + wp_2_links + wp_2_options + wp_2_postmeta + wp_2_posts + wp_2_posts_xx + wp_2_term_relationships + wp_2_term_taxonomy + """ + # Leave out wp_2_termmeta for old WP compat. + And STDOUT should contain: + """ + wp_2_terms + wp_2_xx_posts + wp_blog_versions + wp_blogs + wp_categories + wp_commentmeta + wp_comments + wp_links + wp_options + wp_postmeta + wp_posts + wp_posts_xx + wp_registration_log + wp_signups + wp_site + wp_sitecategories + wp_sitemeta + wp_term_relationships + wp_term_taxonomy + """ + # Leave out wp_termmeta for old WP compat. + And STDOUT should contain: + """ + wp_terms + wp_usermeta + wp_users + wp_xx_posts + """ + And save STDOUT as {ALL_TABLES_WITH_PREFIX_STDOUT} + + # Network overriden by all-tables-with-prefix. + When I run `wp --require=table_names.php get_table_names --all-tables-with-prefix --network` + Then STDOUT should contain: + """ + {ALL_TABLES_WITH_PREFIX_STDOUT} + """ + + When I run `wp --require=table_names.php get_table_names --all-tables` + Then STDOUT should be: + """ + {ALL_TABLES_WITH_PREFIX_STDOUT} + xx_wp_2_posts + xx_wp_posts + """ + And save STDOUT as {ALL_TABLES_STDOUT} + + # Network overriden by all-tables. + When I run `wp --require=table_names.php get_table_names --all-tables --network` + Then STDOUT should be: + """ + {ALL_TABLES_STDOUT} + """ + + When I run `wp --require=table_names.php get_table_names '*_posts'` + Then STDOUT should be: + """ + wp_posts + """ + + When I run `wp --require=table_names.php get_table_names '*_posts' --network` + Then STDOUT should be: + """ + wp_2_posts + wp_posts + """ + + When I run `wp --require=table_names.php get_table_names 'wp_post*'` + Then STDOUT should be: + """ + wp_postmeta + wp_posts + """ + + When I run `wp --require=table_names.php get_table_names 'wp_post*' --network` + Then STDOUT should be: + """ + wp_postmeta + wp_posts + """ + + When I run `wp --require=table_names.php get_table_names 'wp*osts'` + Then STDOUT should be: + """ + wp_posts + """ + + When I run `wp --require=table_names.php get_table_names 'wp*osts' --network` + Then STDOUT should be: + """ + wp_2_posts + wp_posts + """ + + When I run `wp --require=table_names.php get_table_names '*_posts' --scope=blog` + Then STDOUT should be: + """ + wp_posts + """ + + When I run `wp --require=table_names.php get_table_names '*_posts' --scope=blog --network` + Then STDOUT should be: + """ + wp_2_posts + wp_posts + """ + + When I try `wp --require=table_names.php get_table_names '*_posts' --scope=global` + Then STDERR should be: + """ + Error: Couldn't find any tables matching: *_posts + """ + And STDOUT should be empty + + # Note: BC change 1.5.0, network does not override scope. + When I try `wp --require=table_names.php get_table_names '*_posts' --scope=global --network` + Then STDERR should be: + """ + Error: Couldn't find any tables matching: *_posts + """ + And STDOUT should be empty + + When I run `wp --require=table_names.php get_table_names '*_posts' --all-tables-with-prefix` + Then STDOUT should be: + """ + wp_2_posts + wp_2_xx_posts + wp_posts + wp_xx_posts + """ + + When I run `wp --require=table_names.php get_table_names 'wp_post*' --all-tables-with-prefix` + Then STDOUT should be: + """ + wp_postmeta + wp_posts + wp_posts_xx + """ + + When I run `wp --require=table_names.php get_table_names 'wp*osts' --all-tables-with-prefix` + Then STDOUT should be: + """ + wp_2_posts + wp_2_xx_posts + wp_posts + wp_xx_posts + """ + + When I run `wp --require=table_names.php get_table_names '*_posts' --all-tables` + Then STDOUT should be: + """ + wp_2_posts + wp_2_xx_posts + wp_posts + wp_xx_posts + xx_wp_2_posts + xx_wp_posts + """ + + When I run `wp --require=table_names.php get_table_names '*wp_posts' --all-tables` + Then STDOUT should be: + """ + wp_posts + xx_wp_posts + """ + + When I run `wp --require=table_names.php get_table_names 'wp_post*' --all-tables` + Then STDOUT should be: + """ + wp_postmeta + wp_posts + wp_posts_xx + """ + + When I run `wp --require=table_names.php get_table_names 'wp*osts' --all-tables` + Then STDOUT should be: + """ + wp_2_posts + wp_2_xx_posts + wp_posts + wp_xx_posts + """ + + When I try `wp --require=table_names.php get_table_names non_existent_table` + Then STDERR should be: + """ + Error: Couldn't find any tables matching: non_existent_table + """ + And STDOUT should be empty + + When I run `wp --require=table_names.php get_table_names wp_posts non_existent_table` + Then STDOUT should be: + """ + wp_posts + """ + + When I run `wp --require=table_names.php get_table_names wp_posts non_existent_table 'wp_?ption*'` + Then STDOUT should be: + """ + wp_options + wp_posts + """ + + When I run `wp --require=table_names.php get_table_names wp_posts non_existent_table 'wp_*ption?'` + Then STDOUT should be: + """ + wp_options + wp_posts + """ + + When I run `wp --require=table_names.php get_table_names wp_posts non_existent_table 'wp_*ption?' --network` + Then STDOUT should be: + """ + wp_2_options + wp_options + wp_posts + """ + + Given an enable_sitecategories.php file: + """ + unregister(); + } + + /** + * Registers the autoload callback with the SPL autoload system. + */ + public function register() { + spl_autoload_register( array( $this, 'autoload' ) ); + } + + /** + * Unregisters the autoload callback with the SPL autoload system. + */ + public function unregister() { + spl_autoload_unregister( array( $this, 'autoload' ) ); + } + + /** + * Add a specific namespace structure with our custom autoloader. + * + * @param string $root Root namespace name. + * @param string $base_dir Directory containing the class files. + * @param string $prefix Prefix to be added before the class. + * @param string $suffix Suffix to be added after the class. + * @param boolean $lowercase Whether the class should be changed to + * lowercase. + * @param boolean $underscores Whether the underscores should be changed to + * hyphens. + * + * @return self + */ + public function add_namespace( + $root, + $base_dir, + $prefix = '', + $suffix = '.php', + $lowercase = false, + $underscores = false + ) { + $this->namespaces[] = array( + 'root' => $this->normalize_root( (string) $root ), + 'base_dir' => $this->add_trailing_slash( (string) $base_dir ), + 'prefix' => (string) $prefix, + 'suffix' => (string) $suffix, + 'lowercase' => (bool) $lowercase, + 'underscores' => (bool) $underscores, + ); + + return $this; + } + + /** + * The autoload function that gets registered with the SPL Autoloader + * system. + * + * @param string $class The class that got requested by the spl_autoloader. + */ + public function autoload( $class ) { + + // Iterate over namespaces to find a match. + foreach ( $this->namespaces as $namespace ) { + + // Move on if the object does not belong to the current namespace. + if ( 0 !== strpos( $class, $namespace['root'] ) ) { + continue; + } + + // Remove namespace root level to correspond with root filesystem, and + // replace the namespace separator "\" by the system-dependent directory separator. + $filename = str_replace( + array( $namespace['root'], '\\' ), array( '', DIRECTORY_SEPARATOR ), + $class + ); + + // Remove a leading backslash from the class name. + $filename = $this->remove_leading_backslash( $filename ); + + // Change to lower case if requested. + if ( $namespace['lowercase'] ) { + $filename = strtolower( $filename ); + } + + // Change underscores into hyphens if requested. + if ( $namespace['underscores'] ) { + $filename = str_replace( '_', '-', $filename ); + } + + // Add base_dir, prefix and suffix. + $filepath = $namespace['base_dir'] + . $namespace['prefix'] + . $filename + . $namespace['suffix']; + + // Throw an exception if the file does not exist or is not readable. + if ( is_readable( $filepath ) ) { + require_once $filepath; + } + } + } + + /** + * Normalize a namespace root. + * + * @param string $root Namespace root that needs to be normalized. + * + * @return string Normalized namespace root. + */ + protected function normalize_root( $root ) { + $root = $this->remove_leading_backslash( $root ); + + return $this->add_trailing_backslash( $root ); + } + + /** + * Remove a leading backslash from a string. + * + * @param string $string String to remove the leading backslash from. + * + * @return string Modified string. + */ + protected function remove_leading_backslash( $string ) { + return ltrim( $string, '\\' ); + } + + /** + * Make sure a string ends with a trailing backslash. + * + * @param string $string String to check the trailing backslash of. + * + * @return string Modified string. + */ + protected function add_trailing_backslash( $string ) { + return rtrim( $string, '\\' ) . '\\'; + } + + /** + * Make sure a string ends with a trailing slash. + * + * @param string $string String to check the trailing slash of. + * + * @return string Modified string. + */ + protected function add_trailing_slash( $string ) { + return rtrim( $string, '/\\' ) . '/'; + } +} diff --git a/php/WP_CLI/Bootstrap/AutoloaderStep.php b/php/WP_CLI/Bootstrap/AutoloaderStep.php new file mode 100644 index 000000000..4818771ed --- /dev/null +++ b/php/WP_CLI/Bootstrap/AutoloaderStep.php @@ -0,0 +1,96 @@ +state = $state; + + $found_autoloader = false; + $autoloader_paths = $this->get_autoloader_paths(); + + if ( false === $autoloader_paths ) { + // Skip this autoloading step. + return $state; + } + + foreach ( $autoloader_paths as $autoloader_path ) { + if ( is_readable( $autoloader_path ) ) { + try { + require $autoloader_path; + $found_autoloader = true; + } catch ( \Exception $exception ) { + \WP_CLI::warning( + "Failed to load autoloader '{$autoloader_path}'. Reason: " + . $exception->getMessage() + ); + } + } + } + + if ( ! $found_autoloader ) { + $this->handle_failure(); + } + + return $this->state; + } + + /** + * Get the name of the custom vendor folder as set in `composer.json`. + * + * @return string|false Name of the custom vendor folder or false if none. + */ + protected function get_custom_vendor_folder() { + $maybe_composer_json = WP_CLI_ROOT . '/../../../composer.json'; + if ( ! is_readable( $maybe_composer_json ) ) { + return false; + } + + $composer = json_decode( file_get_contents( $maybe_composer_json ) ); + + if ( ! empty( $composer->config ) + && ! empty( $composer->config->{'vendor-dir'} ) + ) { + return $composer->config->{'vendor-dir'}; + } + + return false; + } + + /** + * Handle the failure to find an autoloader. + * + * @return void + */ + protected function handle_failure() { } + + /** + * Get the autoloader paths to scan for an autoloader. + * + * @return string[]|false Array of strings with autoloader paths, or false + * to skip. + */ + abstract protected function get_autoloader_paths(); +} diff --git a/php/WP_CLI/Bootstrap/BootstrapState.php b/php/WP_CLI/Bootstrap/BootstrapState.php new file mode 100644 index 000000000..bc7def0d0 --- /dev/null +++ b/php/WP_CLI/Bootstrap/BootstrapState.php @@ -0,0 +1,56 @@ +state ) + ? $this->state[ $key ] + : $fallback; + } + + /** + * Set the state value for a given key. + * + * @param string $key Key to set the state for. + * @param mixed $value Value to set the state for the given key to. + * + * @return void + */ + // @codingStandardsIgnoreLine + public function setValue( $key, $value ) { + $this->state[ $key ] = $value; + } +} diff --git a/php/WP_CLI/Bootstrap/BootstrapStep.php b/php/WP_CLI/Bootstrap/BootstrapStep.php new file mode 100644 index 000000000..ed9f57872 --- /dev/null +++ b/php/WP_CLI/Bootstrap/BootstrapStep.php @@ -0,0 +1,22 @@ +init_config(); + + return $state; + } +} diff --git a/php/WP_CLI/Bootstrap/DeclareAbstractBaseCommand.php b/php/WP_CLI/Bootstrap/DeclareAbstractBaseCommand.php new file mode 100644 index 000000000..5daced232 --- /dev/null +++ b/php/WP_CLI/Bootstrap/DeclareAbstractBaseCommand.php @@ -0,0 +1,26 @@ +get_protected_commands(); + $current_command = $this->get_current_command(); + + foreach ( $commands as $command ) { + if ( 0 === strpos( $current_command, $command ) ) { + $state->setValue( BootstrapState::IS_PROTECTED_COMMAND, true ); + } + } + + return $state; + } + + /** + * Get the list of protected commands. + * + * @return array + */ + private function get_protected_commands() { + return array( + 'cli info', + 'package', + ); + } + + /** + * Get the current command as a string. + * + * @return string Current command to be executed. + */ + private function get_current_command() { + $runner = new RunnerInstance(); + + return implode( ' ', (array) $runner()->arguments ); + } +} diff --git a/php/WP_CLI/Bootstrap/IncludeBundledAutoloader.php b/php/WP_CLI/Bootstrap/IncludeBundledAutoloader.php new file mode 100644 index 000000000..5d0b6e048 --- /dev/null +++ b/php/WP_CLI/Bootstrap/IncludeBundledAutoloader.php @@ -0,0 +1,37 @@ +get_custom_vendor_folder() ) { + array_unshift( + $autoloader_paths, + WP_CLI_ROOT . '/../../../' . $custom_vendor . '/autoload_commands.php' + ); + } + + return $autoloader_paths; + } +} diff --git a/php/WP_CLI/Bootstrap/IncludeFallbackAutoloader.php b/php/WP_CLI/Bootstrap/IncludeFallbackAutoloader.php new file mode 100644 index 000000000..cccd6faed --- /dev/null +++ b/php/WP_CLI/Bootstrap/IncludeFallbackAutoloader.php @@ -0,0 +1,35 @@ +get_custom_vendor_folder() ) { + array_unshift( + $autoloader_paths, + WP_CLI_ROOT . '/../../../' . $custom_vendor . '/autoload.php' + ); + } + + return $autoloader_paths; + } +} diff --git a/php/WP_CLI/Bootstrap/IncludeFrameworkAutoloader.php b/php/WP_CLI/Bootstrap/IncludeFrameworkAutoloader.php new file mode 100644 index 000000000..b463560bf --- /dev/null +++ b/php/WP_CLI/Bootstrap/IncludeFrameworkAutoloader.php @@ -0,0 +1,50 @@ +get_custom_vendor_folder() ) { + array_unshift( + $autoloader_paths, + WP_CLI_ROOT . '/../../../' . $custom_vendor . '/autoload_framework.php' + ); + } + + return $autoloader_paths; + } + + /** + * Handle the failure to find an autoloader. + * + * @return void + */ + protected function handle_failure() { + fwrite( + STDERR, + "Internal error: Can't find Composer autoloader.\nTry running: composer install\n" + ); + exit( 3 ); + } +} diff --git a/php/WP_CLI/Bootstrap/IncludePackageAutoloader.php b/php/WP_CLI/Bootstrap/IncludePackageAutoloader.php new file mode 100644 index 000000000..141839145 --- /dev/null +++ b/php/WP_CLI/Bootstrap/IncludePackageAutoloader.php @@ -0,0 +1,57 @@ +state->getValue( BootstrapState::IS_PROTECTED_COMMAND, $fallback = false ) ) { + return false; + } + + $runner = new RunnerInstance(); + $skip_packages = $runner()->config['skip-packages']; + if ( true === $skip_packages ) { + \WP_CLI::debug( 'Skipped loading packages.', 'bootstrap' ); + + return false; + } + + $autoloader_path = $runner()->get_packages_dir_path() . 'vendor/autoload.php'; + + if ( is_readable( $autoloader_path ) ) { + \WP_CLI::debug( + 'Loading packages from: ' . $autoloader_path, + 'bootstrap' + ); + + return array( + $autoloader_path, + ); + } + + return false; + } + + /** + * Handle the failure to find an autoloader. + * + * @return void + */ + protected function handle_failure() { + \WP_CLI::debug( 'No package autoload found to load.', 'bootstrap' ); + } +} diff --git a/php/WP_CLI/Bootstrap/InitializeColorization.php b/php/WP_CLI/Bootstrap/InitializeColorization.php new file mode 100644 index 000000000..3d0483992 --- /dev/null +++ b/php/WP_CLI/Bootstrap/InitializeColorization.php @@ -0,0 +1,27 @@ +init_colorization(); + + return $state; + } +} diff --git a/php/WP_CLI/Bootstrap/InitializeLogger.php b/php/WP_CLI/Bootstrap/InitializeLogger.php new file mode 100644 index 000000000..9915b37d3 --- /dev/null +++ b/php/WP_CLI/Bootstrap/InitializeLogger.php @@ -0,0 +1,47 @@ +declare_loggers(); + $runner = new RunnerInstance(); + $runner()->init_logger(); + + return $state; + } + + /** + * Load the class declarations for the loggers. + */ + private function declare_loggers() { + $logger_dir = WP_CLI_ROOT . '/php/WP_CLI/Loggers'; + $iterator = new \DirectoryIterator( $logger_dir ); + + // Make sure the base class is declared first. + include_once "$logger_dir/Base.php"; + + foreach ( $iterator as $filename ) { + if ( '.php' !== substr( $filename, - 4 ) ) { + continue; + } + + include_once "$logger_dir/$filename"; + } + } +} diff --git a/php/WP_CLI/Bootstrap/LaunchRunner.php b/php/WP_CLI/Bootstrap/LaunchRunner.php new file mode 100644 index 000000000..d85831db1 --- /dev/null +++ b/php/WP_CLI/Bootstrap/LaunchRunner.php @@ -0,0 +1,27 @@ +start(); + + return $state; + } +} diff --git a/php/WP_CLI/Bootstrap/LoadDispatcher.php b/php/WP_CLI/Bootstrap/LoadDispatcher.php new file mode 100644 index 000000000..48aa0d08c --- /dev/null +++ b/php/WP_CLI/Bootstrap/LoadDispatcher.php @@ -0,0 +1,26 @@ +` option. + * + * @package WP_CLI\Bootstrap + */ +final class LoadRequiredCommand implements BootstrapStep { + + /** + * Process this single bootstrapping step. + * + * @param BootstrapState $state Contextual state to pass into the step. + * + * @return BootstrapState Modified state to pass to the next step. + */ + public function process( BootstrapState $state ) { + if ( $state->getValue( BootstrapState::IS_PROTECTED_COMMAND, $fallback = false ) ) { + return $state; + } + + $runner = new RunnerInstance(); + if ( ! isset( $runner()->config['require'] ) ) { + return $state; + } + + foreach ( $runner()->config['require'] as $path ) { + if ( ! file_exists( $path ) ) { + $context = ''; + $required_files = $runner()->get_required_files(); + foreach ( array( 'global', 'project', 'runtime' ) as $scope ) { + if ( in_array( $path, $required_files[ $scope ], true ) ) { + switch ( $scope ) { + case 'global': + $context = ' (from global ' . Utils\basename( $runner()->get_global_config_path() ) . ')'; + break; + case 'project': + $context = ' (from project\'s ' . Utils\basename( $runner()->get_project_config_path() ) . ')'; + break; + case 'runtime': + $context = ' (from runtime argument)'; + break; + } + break; + } + } + WP_CLI::error( sprintf( "Required file '%s' doesn't exist%s.", Utils\basename( $path ), $context ) ); + } + Utils\load_file( $path ); + WP_CLI::debug( 'Required file from config: ' . $path, 'bootstrap' ); + } + + return $state; + } +} diff --git a/php/WP_CLI/Bootstrap/LoadUtilityFunctions.php b/php/WP_CLI/Bootstrap/LoadUtilityFunctions.php new file mode 100644 index 000000000..185eb61c5 --- /dev/null +++ b/php/WP_CLI/Bootstrap/LoadUtilityFunctions.php @@ -0,0 +1,26 @@ +add_deferred_commands(); + + // Process deferred command additions for commands added through + // plugins. + \WP_CLI::add_hook( + 'find_command_to_run_pre', + array( $this, 'add_deferred_commands' ) + ); + + return $state; + } + + /** + * Add deferred commands that are still waiting to be processed. + */ + public function add_deferred_commands() { + $deferred_additions = \WP_CLI::get_deferred_additions(); + + foreach ( $deferred_additions as $name => $addition ) { + \WP_CLI::add_command( + $name, + $addition['callable'], + $addition['args'] + ); + } + } +} diff --git a/php/WP_CLI/Bootstrap/RegisterFrameworkCommands.php b/php/WP_CLI/Bootstrap/RegisterFrameworkCommands.php new file mode 100644 index 000000000..2020f3fdd --- /dev/null +++ b/php/WP_CLI/Bootstrap/RegisterFrameworkCommands.php @@ -0,0 +1,42 @@ +getMessage() + ); + } + } + + return $state; + } +} diff --git a/php/WP_CLI/Bootstrap/RunnerInstance.php b/php/WP_CLI/Bootstrap/RunnerInstance.php new file mode 100644 index 000000000..dceddb99b --- /dev/null +++ b/php/WP_CLI/Bootstrap/RunnerInstance.php @@ -0,0 +1,32 @@ +words = explode( ' ', $line ); + + // first word is always `wp` + array_shift( $this->words ); + + // last word is either empty or an incomplete subcommand + $this->cur_word = end( $this->words ); + if ( '' !== $this->cur_word && ! preg_match( '/^\-/', $this->cur_word ) ) { + array_pop( $this->words ); + } + + $is_alias = false; + $is_help = false; + if ( ! empty( $this->words[0] ) && preg_match( '/^@/', $this->words[0] ) ) { + array_shift( $this->words ); + // `wp @al` is false, but `wp @all ` is true. + if ( count( $this->words ) ) { + $is_alias = true; + } + } elseif ( ! empty( $this->words[0] ) && 'help' === $this->words[0] ) { + array_shift( $this->words ); + $is_help = true; + } + + $r = $this->get_command( $this->words ); + if ( ! is_array( $r ) ) { + return; + } + + list( $command, $args, $assoc_args ) = $r; + + $spec = SynopsisParser::parse( $command->get_synopsis() ); + + foreach ( $spec as $arg ) { + if ( 'positional' === $arg['type'] && 'file' === $arg['name'] ) { + $this->add( ' ' ); + return; + } + } + + if ( $command->can_have_subcommands() ) { + // add completion when command is `wp` and alias isn't set. + if ( 'wp' === $command->get_name() && false === $is_alias && false == $is_help ) { + $aliases = \WP_CLI::get_configurator()->get_aliases(); + foreach ( $aliases as $name => $_ ) { + $this->add( "$name " ); + } + } + foreach ( $command->get_subcommands() as $name => $_ ) { + $this->add( "$name " ); + } + } else { + foreach ( $spec as $arg ) { + if ( in_array( $arg['type'], array( 'flag', 'assoc' ) ) ) { + if ( isset( $assoc_args[ $arg['name'] ] ) ) { + continue; + } + + $opt = "--{$arg['name']}"; + + if ( 'flag' === $arg['type'] ) { + $opt .= ' '; + } elseif ( ! $arg['value']['optional'] ) { + $opt .= '='; + } + + $this->add( $opt ); + } + } + + foreach ( $this->get_global_parameters() as $param => $runtime ) { + if ( isset( $assoc_args[ $param ] ) ) { + continue; + } + + $opt = "--{$param}"; + + if ( '' === $runtime || ! is_string( $runtime ) ) { + $opt .= ' '; + } else { + $opt .= '='; + } + + $this->add( $opt ); + } + } + + } + + private function get_command( $words ) { + $positional_args = $assoc_args = array(); + + foreach ( $words as $arg ) { + if ( preg_match( '|^--([^=]+)=?|', $arg, $matches ) ) { + $assoc_args[ $matches[1] ] = true; + } else { + $positional_args[] = $arg; + } + } + + $r = \WP_CLI::get_runner()->find_command_to_run( $positional_args ); + if ( ! is_array( $r ) && array_pop( $positional_args ) == $this->cur_word ) { + $r = \WP_CLI::get_runner()->find_command_to_run( $positional_args ); + } + + if ( ! is_array( $r ) ) { + return $r; + } + + list( $command, $args ) = $r; + + return array( $command, $args, $assoc_args ); + } + + private function get_global_parameters() { + $params = array(); + foreach ( \WP_CLI::get_configurator()->get_spec() as $key => $details ) { + if ( false === $details['runtime'] ) { + continue; + } + + if ( isset( $details['deprecated'] ) ) { + continue; + } + + if ( isset( $details['hidden'] ) ) { + continue; + } + $params[ $key ] = $details['runtime']; + + // Add additional option like `--[no-]color`. + if ( true === $details['runtime'] ) { + $params[ 'no-' . $key ] = ''; + } + } + + return $params; + } + + private function add( $opt ) { + if ( '' !== $this->cur_word ) { + if ( 0 !== strpos( $opt, $this->cur_word ) ) { + return; + } + } + + $this->opts[] = $opt; + } + + public function render() { + foreach ( $this->opts as $opt ) { + \WP_CLI::line( $opt ); + } + } +} diff --git a/php/WP_CLI/ComposerIO.php b/php/WP_CLI/ComposerIO.php new file mode 100644 index 000000000..91bb6c0ba --- /dev/null +++ b/php/WP_CLI/ComposerIO.php @@ -0,0 +1,39 @@ +]+)>#', '$1$2', $message ); + WP_CLI::log( strip_tags( trim( $message ) ) ); + } + +} diff --git a/php/WP_CLI/Configurator.php b/php/WP_CLI/Configurator.php new file mode 100644 index 000000000..3e6c569e2 --- /dev/null +++ b/php/WP_CLI/Configurator.php @@ -0,0 +1,361 @@ +spec = include $path; + + $defaults = array( + 'runtime' => false, + 'file' => false, + 'synopsis' => '', + 'default' => null, + 'multiple' => false, + ); + + foreach ( $this->spec as $key => &$details ) { + $details = array_merge( $defaults, $details ); + + $this->config[ $key ] = $details['default']; + } + } + + /** + * Get declared configuration values as an array. + * + * @return array + */ + public function to_array() { + return array( $this->config, $this->extra_config ); + } + + /** + * Get configuration specification, i.e. list of accepted keys. + * + * @return array + */ + public function get_spec() { + return $this->spec; + } + + /** + * Get any aliases defined in config files. + * + * @return array + */ + public function get_aliases() { + if ( $runtime_alias = getenv( 'WP_CLI_RUNTIME_ALIAS' ) ) { + $returned_aliases = array(); + foreach ( json_decode( $runtime_alias, true ) as $key => $value ) { + if ( preg_match( '#' . self::ALIAS_REGEX . '#', $key ) ) { + $returned_aliases[ $key ] = array(); + foreach ( self::$alias_spec as $i ) { + if ( isset( $value[ $i ] ) ) { + $returned_aliases[ $key ][ $i ] = $value[ $i ]; + } + } + } + } + return $returned_aliases; + } + + return $this->aliases; + } + + /** + * Splits a list of arguments into positional, associative and config. + * + * @param array(string) + * @return array(array) + */ + public function parse_args( $arguments ) { + list( $positional_args, $mixed_args, $global_assoc, $local_assoc ) = self::extract_assoc( $arguments ); + list( $assoc_args, $runtime_config ) = $this->unmix_assoc_args( $mixed_args, $global_assoc, $local_assoc ); + return array( $positional_args, $assoc_args, $runtime_config ); + } + + /** + * Splits positional args from associative args. + * + * @param array + * @return array(array) + */ + public static function extract_assoc( $arguments ) { + $positional_args = $assoc_args = $global_assoc = $local_assoc = array(); + + foreach ( $arguments as $arg ) { + $positional_arg = $assoc_arg = null; + + if ( preg_match( '|^--no-([^=]+)$|', $arg, $matches ) ) { + $assoc_arg = array( $matches[1], false ); + } elseif ( preg_match( '|^--([^=]+)$|', $arg, $matches ) ) { + $assoc_arg = array( $matches[1], true ); + } elseif ( preg_match( '|^--([^=]+)=(.*)|s', $arg, $matches ) ) { + $assoc_arg = array( $matches[1], $matches[2] ); + } else { + $positional = $arg; + } + + if ( ! is_null( $assoc_arg ) ) { + $assoc_args[] = $assoc_arg; + if ( count( $positional_args ) ) { + $local_assoc[] = $assoc_arg; + } else { + $global_assoc[] = $assoc_arg; + } + } elseif ( ! is_null( $positional ) ) { + $positional_args[] = $positional; + } + } + + return array( $positional_args, $assoc_args, $global_assoc, $local_assoc ); + } + + /** + * Separate runtime parameters from command-specific parameters. + * + * @param array $mixed_args + * @return array + */ + private function unmix_assoc_args( $mixed_args, $global_assoc = array(), $local_assoc = array() ) { + $assoc_args = $runtime_config = array(); + + if ( getenv( 'WP_CLI_STRICT_ARGS_MODE' ) ) { + foreach ( $global_assoc as $tmp ) { + list( $key, $value ) = $tmp; + if ( isset( $this->spec[ $key ] ) && false !== $this->spec[ $key ]['runtime'] ) { + $this->assoc_arg_to_runtime_config( $key, $value, $runtime_config ); + } + } + foreach ( $local_assoc as $tmp ) { + $assoc_args[ $tmp[0] ] = $tmp[1]; + } + } else { + foreach ( $mixed_args as $tmp ) { + list( $key, $value ) = $tmp; + + if ( isset( $this->spec[ $key ] ) && false !== $this->spec[ $key ]['runtime'] ) { + $this->assoc_arg_to_runtime_config( $key, $value, $runtime_config ); + } else { + $assoc_args[ $key ] = $value; + } + } + } + + return array( $assoc_args, $runtime_config ); + } + + /** + * Handle turning an $assoc_arg into a runtime arg. + */ + private function assoc_arg_to_runtime_config( $key, $value, &$runtime_config ) { + $details = $this->spec[ $key ]; + if ( isset( $details['deprecated'] ) ) { + fwrite( STDERR, "WP-CLI: The --{$key} global parameter is deprecated. {$details['deprecated']}\n" ); + } + + if ( $details['multiple'] ) { + $runtime_config[ $key ][] = $value; + } else { + $runtime_config[ $key ] = $value; + } + } + + /** + * Load a YAML file of parameters into scope. + * + * @param string $path Path to YAML file. + */ + public function merge_yml( $path, $current_alias = null ) { + $yaml = self::load_yml( $path ); + if ( ! empty( $yaml['_']['inherit'] ) ) { + $this->merge_yml( $yaml['_']['inherit'], $current_alias ); + } + // Prepare the base path for absolutized alias paths + $yml_file_dir = $path ? dirname( $path ) : false; + foreach ( $yaml as $key => $value ) { + if ( preg_match( '#' . self::ALIAS_REGEX . '#', $key ) ) { + $this->aliases[ $key ] = array(); + $is_alias = false; + foreach ( self::$alias_spec as $i ) { + if ( isset( $value[ $i ] ) ) { + if ( 'path' === $i && ! isset( $value['ssh'] ) ) { + self::absolutize( $value[ $i ], $yml_file_dir ); + } + $this->aliases[ $key ][ $i ] = $value[ $i ]; + $is_alias = true; + } + } + // If it's not an alias, it might be a group of aliases + if ( ! $is_alias && is_array( $value ) ) { + $alias_group = array(); + foreach ( $value as $i => $k ) { + if ( preg_match( '#' . self::ALIAS_REGEX . '#', $k ) ) { + $alias_group[] = $k; + } + } + $this->aliases[ $key ] = $alias_group; + } + } elseif ( ! isset( $this->spec[ $key ] ) || false === $this->spec[ $key ]['file'] ) { + if ( isset( $this->extra_config[ $key ] ) + && ! empty( $yaml['_']['merge'] ) + && is_array( $this->extra_config[ $key ] ) + && is_array( $value ) ) { + $this->extra_config[ $key ] = array_merge( $this->extra_config[ $key ], $value ); + } else { + $this->extra_config[ $key ] = $value; + } + } elseif ( $this->spec[ $key ]['multiple'] ) { + self::arrayify( $value ); + $this->config[ $key ] = array_merge( $this->config[ $key ], $value ); + } else { + if ( $current_alias && in_array( $key, self::$alias_spec, true ) ) { + continue; + } + $this->config[ $key ] = $value; + } + } + } + + /** + * Merge an array of values into the configurator config. + * + * @param array $config + */ + public function merge_array( $config ) { + foreach ( $this->spec as $key => $details ) { + if ( false !== $details['runtime'] && isset( $config[ $key ] ) ) { + $value = $config[ $key ]; + + if ( 'require' == $key ) { + $value = \WP_CLI\Utils\expand_globs( $value ); + } + + if ( $details['multiple'] ) { + self::arrayify( $value ); + $this->config[ $key ] = array_merge( $this->config[ $key ], $value ); + } else { + $this->config[ $key ] = $value; + } + } + } + } + + /** + * Load values from a YAML file. + * + * @param string $yml_file Path to the YAML file + * @return array $config Declared configuration values + */ + private static function load_yml( $yml_file ) { + if ( ! $yml_file ) { + return array(); + } + + $config = Spyc::YAMLLoad( $yml_file ); + + // Make sure config-file-relative paths are made absolute. + $yml_file_dir = dirname( $yml_file ); + + if ( isset( $config['path'] ) ) { + self::absolutize( $config['path'], $yml_file_dir ); + } + + if ( isset( $config['require'] ) ) { + self::arrayify( $config['require'] ); + $config['require'] = \WP_CLI\Utils\expand_globs( $config['require'] ); + foreach ( $config['require'] as &$path ) { + self::absolutize( $path, $yml_file_dir ); + } + } + + // Backwards compat + // 'core config' -> 'config create' + if ( isset( $config['core config'] ) ) { + $config['config create'] = $config['core config']; + unset( $config['core config'] ); + } + // 'checksum core' -> 'core verify-checksums' + if ( isset( $config['checksum core'] ) ) { + $config['core verify-checksums'] = $config['checksum core']; + unset( $config['checksum core'] ); + } + // 'checksum plugin' -> 'plugin verify-checksums' + if ( isset( $config['checksum plugin'] ) ) { + $config['plugin verify-checksums'] = $config['checksum plugin']; + unset( $config['checksum plugin'] ); + } + + return $config; + } + + /** + * Conform a variable to an array. + * + * @param mixed $val A string or an array + */ + private static function arrayify( &$val ) { + $val = (array) $val; + } + + /** + * Make a path absolute. + * + * @param string $path Path to file. + * @param string $base Base path to prepend. + */ + private static function absolutize( &$path, $base ) { + if ( ! empty( $path ) && ! \WP_CLI\Utils\is_path_absolute( $path ) ) { + $path = $base . DIRECTORY_SEPARATOR . $path; + } + } + +} diff --git a/php/WP_CLI/Dispatcher/CommandAddition.php b/php/WP_CLI/Dispatcher/CommandAddition.php new file mode 100644 index 000000000..0a51c4d29 --- /dev/null +++ b/php/WP_CLI/Dispatcher/CommandAddition.php @@ -0,0 +1,58 @@ +abort = true; + $this->reason = (string) $reason; + } + + /** + * Check whether the command addition was aborted. + * + * @return bool + */ + public function was_aborted() { + return $this->abort; + } + + /** + * Get the reason as to why the addition was aborted. + * + * @return string + */ + public function get_reason() { + return $this->reason; + } +} diff --git a/php/WP_CLI/Dispatcher/CommandFactory.php b/php/WP_CLI/Dispatcher/CommandFactory.php new file mode 100644 index 000000000..50af3ee28 --- /dev/null +++ b/php/WP_CLI/Dispatcher/CommandFactory.php @@ -0,0 +1,221 @@ +getMethod( $callable[1] ) + ); + } else { + $reflection = new \ReflectionClass( $callable ); + if ( $reflection->isSubclassOf( '\WP_CLI\Dispatcher\CommandNamespace' ) ) { + $command = self::create_namespace( $parent, $name, $callable ); + } elseif ( $reflection->hasMethod( '__invoke' ) ) { + $class = is_object( $callable ) ? $callable : $reflection->name; + $command = self::create_subcommand( + $parent, $name, array( $class, '__invoke' ), + $reflection->getMethod( '__invoke' ) + ); + } else { + $command = self::create_composite_command( $parent, $name, $callable ); + } + } + + return $command; + } + + /** + * Clear the file contents cache. + */ + public static function clear_file_contents_cache() { + self::$file_contents = array(); + } + + /** + * Create a new Subcommand instance. + * + * @param mixed $parent The new command's parent Composite command + * @param string $name Represents how the command should be invoked + * @param mixed $callable A callable function or closure, or class name and method + * @param object $reflection Reflection instance, for doc parsing + * @param string $class A subclass of WP_CLI_Command + * @param string $method Class method to be called upon invocation. + */ + private static function create_subcommand( $parent, $name, $callable, $reflection ) { + $doc_comment = self::get_doc_comment( $reflection ); + $docparser = new \WP_CLI\DocParser( $doc_comment ); + + if ( is_array( $callable ) ) { + if ( ! $name ) { + $name = $docparser->get_tag( 'subcommand' ); + } + + if ( ! $name ) { + $name = $reflection->name; + } + } + if ( ! $doc_comment ) { + \WP_CLI::debug( null === $doc_comment ? "Failed to get doc comment for {$name}." : "No doc comment for {$name}.", 'commandfactory' ); + } + + $when_invoked = function ( $args, $assoc_args ) use ( $callable ) { + if ( is_array( $callable ) ) { + $callable[0] = is_object( $callable[0] ) ? $callable[0] : new $callable[0]; + call_user_func( array( $callable[0], $callable[1] ), $args, $assoc_args ); + } else { + call_user_func( $callable, $args, $assoc_args ); + } + }; + + return new Subcommand( $parent, $name, $docparser, $when_invoked ); + } + + /** + * Create a new Composite command instance. + * + * @param mixed $parent The new command's parent Root or Composite command + * @param string $name Represents how the command should be invoked + * @param mixed $callable + */ + private static function create_composite_command( $parent, $name, $callable ) { + $reflection = new \ReflectionClass( $callable ); + $doc_comment = self::get_doc_comment( $reflection ); + if ( ! $doc_comment ) { + \WP_CLI::debug( null === $doc_comment ? "Failed to get doc comment for {$name}." : "No doc comment for {$name}.", 'commandfactory' ); + } + $docparser = new \WP_CLI\DocParser( $doc_comment ); + + $container = new CompositeCommand( $parent, $name, $docparser ); + + foreach ( $reflection->getMethods() as $method ) { + if ( ! self::is_good_method( $method ) ) { + continue; + } + + $class = is_object( $callable ) ? $callable : $reflection->name; + $subcommand = self::create_subcommand( $container, false, array( $class, $method->name ), $method ); + + $subcommand_name = $subcommand->get_name(); + + $container->add_subcommand( $subcommand_name, $subcommand ); + } + + return $container; + } + + /** + * Create a new command namespace instance. + * + * @param mixed $parent The new namespace's parent Root or Composite command. + * @param string $name Represents how the command should be invoked + * @param mixed $callable + */ + private static function create_namespace( $parent, $name, $callable ) { + $reflection = new \ReflectionClass( $callable ); + $doc_comment = self::get_doc_comment( $reflection ); + if ( ! $doc_comment ) { + \WP_CLI::debug( null === $doc_comment ? "Failed to get doc comment for {$name}." : "No doc comment for {$name}.", 'commandfactory' ); + } + $docparser = new \WP_CLI\DocParser( $doc_comment ); + + return new CommandNamespace( $parent, $name, $docparser ); + } + + /** + * Check whether a method is actually callable. + * + * @param ReflectionMethod $method + * @return bool + */ + private static function is_good_method( $method ) { + return $method->isPublic() && ! $method->isStatic() && 0 !== strpos( $method->getName(), '__' ); + } + + /** + * Gets the document comment. Caters for PHP directive `opcache.save comments` being disabled. + * + * @param ReflectionMethod|ReflectionClass|ReflectionFunction $reflection Reflection instance. + * @return string|false|null Doc comment string if any, false if none (same as `Reflection*::getDocComment()`), null if error. + */ + private static function get_doc_comment( $reflection ) { + $doc_comment = $reflection->getDocComment(); + + if ( false !== $doc_comment || ! ( ini_get( 'opcache.enable_cli' ) && ! ini_get( 'opcache.save_comments' ) ) ) { + // Either have doc comment, or no doc comment and save comments enabled - standard situation. + if ( ! getenv( 'WP_CLI_TEST_GET_DOC_COMMENT' ) ) { + return $doc_comment; + } + } + + $filename = $reflection->getFileName(); + + if ( isset( self::$file_contents[ $filename ] ) ) { + $contents = self::$file_contents[ $filename ]; + } elseif ( is_readable( $filename ) && ( $contents = file_get_contents( $filename ) ) ) { + self::$file_contents[ $filename ] = $contents = explode( "\n", $contents ); + } else { + \WP_CLI::debug( "Could not read contents for filename '{$filename}'.", 'commandfactory' ); + return null; + } + + return self::extract_last_doc_comment( implode( "\n", array_slice( $contents, 0, $reflection->getStartLine() ) ) ); + } + + /** + * Returns the last doc comment if any in `$content`. + * + * @param string $content The content, which should end at the class or function declaration. + * @return string|bool The last doc comment if any, or false if none. + */ + private static function extract_last_doc_comment( $content ) { + $content = trim( $content ); + $comment_end_pos = strrpos( $content, '*/' ); + if ( false === $comment_end_pos ) { + return false; + } + // Make sure comment end belongs to this class/function. + if ( preg_match_all( '/(?:^|[\s;}])(?:class|function)\s+/', substr( $content, $comment_end_pos + 2 ), $dummy /*needed for PHP 5.3*/ ) > 1 ) { + return false; + } + $content = substr( $content, 0, $comment_end_pos + 2 ); + if ( false === ( $comment_start_pos = strrpos( $content, '/**' ) ) || $comment_start_pos + 2 === $comment_end_pos ) { + return false; + } + // Make sure comment start belongs to this comment end. + if ( false !== ( $comment_end2_pos = strpos( substr( $content, $comment_start_pos ), '*/' ) ) && $comment_start_pos + $comment_end2_pos < $comment_end_pos ) { + return false; + } + // Allow for '/**' within doc comment. + $subcontent = substr( $content, 0, $comment_start_pos ); + while ( false !== ( $comment_start2_pos = strrpos( $subcontent, '/**' ) ) && false === strpos( $subcontent, '*/', $comment_start2_pos ) ) { + $comment_start_pos = $comment_start2_pos; + $subcontent = substr( $subcontent, 0, $comment_start_pos ); + } + return substr( $content, $comment_start_pos, $comment_end_pos + 2 ); + } +} diff --git a/php/WP_CLI/Dispatcher/CommandNamespace.php b/php/WP_CLI/Dispatcher/CommandNamespace.php new file mode 100644 index 000000000..569d1ca5a --- /dev/null +++ b/php/WP_CLI/Dispatcher/CommandNamespace.php @@ -0,0 +1,50 @@ +get_subcommands(); + + $i = 0; + $count = 0; + + foreach ( $methods as $name => $subcommand ) { + $prefix = ( 0 == $i++ ) ? 'usage: ' : ' or: '; + + if ( \WP_CLI::get_runner()->is_command_disabled( $subcommand ) ) { + continue; + } + + \WP_CLI::line( $subcommand->get_usage( $prefix ) ); + $count++; + } + + $cmd_name = implode( ' ', array_slice( get_path( $this ), 1 ) ); + $message = $count > 0 + ? "See 'wp help $cmd_name ' for more information on a specific command." + : "The namespace $cmd_name does not contain any usable commands in the current context."; + + \WP_CLI::line(); + \WP_CLI::line( $message ); + + } +} diff --git a/php/WP_CLI/Dispatcher/CompositeCommand.php b/php/WP_CLI/Dispatcher/CompositeCommand.php new file mode 100644 index 000000000..3ebff40f1 --- /dev/null +++ b/php/WP_CLI/Dispatcher/CompositeCommand.php @@ -0,0 +1,307 @@ +parent = $parent; + + $this->name = $name; + + $this->shortdesc = $docparser->get_shortdesc(); + $this->longdesc = $docparser->get_longdesc(); + $this->docparser = $docparser; + + $when_to_invoke = $docparser->get_tag( 'when' ); + if ( $when_to_invoke ) { + \WP_CLI::get_runner()->register_early_invoke( $when_to_invoke, $this ); + } + } + + /** + * Get the parent composite (or root) command + * + * @return mixed + */ + public function get_parent() { + return $this->parent; + } + + /** + * Add a named subcommand to this composite command's + * set of contained subcommands. + * + * @param string $name Represents how subcommand should be invoked + * @param \WP_CLI\Dispatcher\Subcommand + */ + public function add_subcommand( $name, $command ) { + $this->subcommands[ $name ] = $command; + } + + /** + * Remove a named subcommand from this composite command's set of contained + * subcommands + * + * @param string $name Represents how subcommand should be invoked + */ + public function remove_subcommand( $name ) { + if ( isset( $this->subcommands[ $name ] ) ) { + unset( $this->subcommands[ $name ] ); + } + } + + + /** + * Composite commands always contain subcommands. + * + * @return true + */ + public function can_have_subcommands() { + return true; + } + + /** + * Get the subcommands contained by this composite + * command. + * + * @return array + */ + public function get_subcommands() { + ksort( $this->subcommands ); + + return $this->subcommands; + } + + /** + * Get the name of this composite command. + * + * @return string + */ + public function get_name() { + return $this->name; + } + + /** + * Get the short description for this composite + * command. + * + * @return string + */ + public function get_shortdesc() { + return $this->shortdesc; + } + + /** + * Set the short description for this composite command. + * + * @param string + */ + public function set_shortdesc( $shortdesc ) { + $this->shortdesc = Utils\normalize_eols( $shortdesc ); + } + + /** + * Get the long description for this composite + * command. + * + * @return string + */ + public function get_longdesc() { + return $this->longdesc . $this->get_global_params(); + } + + /** + * Set the long description for this composite command + * + * @param string + */ + public function set_longdesc( $longdesc ) { + $this->longdesc = Utils\normalize_eols( $longdesc ); + } + + /** + * Get the synopsis for this composite command. + * As a collection of subcommands, the composite + * command is only intended to invoke those + * subcommands. + * + * @return string + */ + public function get_synopsis() { + return ''; + } + + /** + * Get the usage for this composite command. + * + * @return string + */ + public function get_usage( $prefix ) { + return sprintf( + '%s%s %s', + $prefix, + implode( ' ', get_path( $this ) ), + $this->get_synopsis() + ); + } + + /** + * Show the usage for all subcommands contained + * by the composite command. + */ + public function show_usage() { + $methods = $this->get_subcommands(); + + $i = 0; + + foreach ( $methods as $name => $subcommand ) { + $prefix = ( 0 == $i++ ) ? 'usage: ' : ' or: '; + + if ( \WP_CLI::get_runner()->is_command_disabled( $subcommand ) ) { + continue; + } + + \WP_CLI::line( $subcommand->get_usage( $prefix ) ); + } + + $cmd_name = implode( ' ', array_slice( get_path( $this ), 1 ) ); + + \WP_CLI::line(); + \WP_CLI::line( "See 'wp help $cmd_name ' for more information on a specific command." ); + } + + /** + * When a composite command is invoked, it shows usage + * docs for its subcommands. + * + * @param array $args + * @param array $assoc_args + * @param array $extra_args + */ + public function invoke( $args, $assoc_args, $extra_args ) { + $this->show_usage(); + } + + /** + * Given supplied arguments, find a contained + * subcommand + * + * @param array $args + * @return \WP_CLI\Dispatcher\Subcommand|false + */ + public function find_subcommand( &$args ) { + $name = array_shift( $args ); + + $subcommands = $this->get_subcommands(); + + if ( ! isset( $subcommands[ $name ] ) ) { + $aliases = self::get_aliases( $subcommands ); + + if ( isset( $aliases[ $name ] ) ) { + $name = $aliases[ $name ]; + } + } + + if ( ! isset( $subcommands[ $name ] ) ) { + return false; + } + + return $subcommands[ $name ]; + } + + /** + * Get any registered aliases for this composite command's + * subcommands. + * + * @param array $subcommands + * @return array + */ + private static function get_aliases( $subcommands ) { + $aliases = array(); + + foreach ( $subcommands as $name => $subcommand ) { + $alias = $subcommand->get_alias(); + if ( $alias ) { + $aliases[ $alias ] = $name; + } + } + + return $aliases; + } + + /** + * Composite commands can only be known by one name. + * + * @return false + */ + public function get_alias() { + return false; + } + + /*** + * Get the list of global parameters + * + * @param string $root_command whether to include or not root command specific description + * @return string + */ + protected function get_global_params( $root_command = false ) { + $binding = array(); + $binding['root_command'] = $root_command; + + if ( ! $this->can_have_subcommands() || ( is_object( $this->parent ) && get_class( $this->parent ) == 'WP_CLI\Dispatcher\CompositeCommand' ) ) { + $binding['is_subcommand'] = true; + } + + foreach ( \WP_CLI::get_configurator()->get_spec() as $key => $details ) { + if ( false === $details['runtime'] ) { + continue; + } + + if ( isset( $details['deprecated'] ) ) { + continue; + } + + if ( isset( $details['hidden'] ) ) { + continue; + } + + if ( true === $details['runtime'] ) { + $synopsis = "--[no-]$key"; + } else { + $synopsis = "--$key" . $details['runtime']; + } + + $binding['parameters'][] = array( + 'synopsis' => $synopsis, + 'desc' => $details['desc'], + ); + } + + if ( $this->get_subcommands() ) { + $binding['has_subcommands'] = true; + } + + return Utils\mustache_render( 'man-params.mustache', $binding ); + } +} + diff --git a/php/WP_CLI/Dispatcher/RootCommand.php b/php/WP_CLI/Dispatcher/RootCommand.php new file mode 100644 index 000000000..0ecb3c816 --- /dev/null +++ b/php/WP_CLI/Dispatcher/RootCommand.php @@ -0,0 +1,59 @@ +parent = false; + + $this->name = 'wp'; + + $this->shortdesc = 'Manage WordPress through the command-line.'; + } + + /** + * Get the human-readable long description. + * + * @return string + */ + public function get_longdesc() { + return $this->get_global_params( true ); + } + + /** + * Find a subcommand registered on the root + * command. + * + * @param array $args + * @return \WP_CLI\Dispatcher\Subcommand|false + */ + public function find_subcommand( &$args ) { + $command = array_shift( $args ); + + Utils\load_command( $command ); + + if ( ! isset( $this->subcommands[ $command ] ) ) { + return false; + } + + return $this->subcommands[ $command ]; + } + + /** + * Get all registered subcommands. + * + * @return array + */ + public function get_subcommands() { + return parent::get_subcommands(); + } +} + diff --git a/php/WP_CLI/Dispatcher/Subcommand.php b/php/WP_CLI/Dispatcher/Subcommand.php new file mode 100644 index 000000000..3aa01f286 --- /dev/null +++ b/php/WP_CLI/Dispatcher/Subcommand.php @@ -0,0 +1,451 @@ +when_invoked = $when_invoked; + + $this->alias = $docparser->get_tag( 'alias' ); + + $this->synopsis = $docparser->get_synopsis(); + if ( ! $this->synopsis && $this->longdesc ) { + $this->synopsis = self::extract_synopsis( $this->longdesc ); + } + } + + /** + * Extract the synopsis from PHPdoc string. + * + * @param string $longdesc Command docs via PHPdoc + * @return string + */ + private static function extract_synopsis( $longdesc ) { + preg_match_all( '/(.+?)[\r\n]+:/', $longdesc, $matches ); + return implode( ' ', $matches[1] ); + } + + /** + * Subcommands can't have subcommands because they + * represent code to be executed. + * + * @return bool + */ + public function can_have_subcommands() { + return false; + } + + /** + * Get the synopsis string for this subcommand. + * A synopsis defines what runtime arguments are + * expected, useful to humans and argument validation. + * + * @return string + */ + public function get_synopsis() { + return $this->synopsis; + } + + /** + * Set the synopsis string for this subcommand. + * + * @param string + */ + public function set_synopsis( $synopsis ) { + $this->synopsis = $synopsis; + } + + /** + * If an alias is set, grant access to it. + * Aliases permit subcommands to be instantiated + * with a secondary identity. + * + * @return string + */ + public function get_alias() { + return $this->alias; + } + + /** + * Print the usage details to the end user. + * + * @param string $prefix + */ + public function show_usage( $prefix = 'usage: ' ) { + \WP_CLI::line( $this->get_usage( $prefix ) ); + } + + /** + * Get the usage of the subcommand as a formatted string. + * + * @param string $prefix + * @return string + */ + public function get_usage( $prefix ) { + return sprintf( + '%s%s %s', + $prefix, + implode( ' ', get_path( $this ) ), + $this->get_synopsis() + ); + } + + /** + * Wrapper for CLI Tools' prompt() method. + * + * @param string $question + * @param string $default + * @return string|false + */ + private function prompt( $question, $default ) { + + $question .= ': '; + if ( function_exists( 'readline' ) ) { + return readline( $question ); + } + + echo $question; + + $ret = stream_get_line( STDIN, 1024, "\n" ); + if ( Utils\is_windows() && "\r" === substr( $ret, -1 ) ) { + $ret = substr( $ret, 0, -1 ); + } + return $ret; + } + + /** + * Interactively prompt the user for input + * based on defined synopsis and passed arguments. + * + * @param array $args + * @param array $assoc_args + * @return array + */ + private function prompt_args( $args, $assoc_args ) { + + $synopsis = $this->get_synopsis(); + + if ( ! $synopsis ) { + return array( $args, $assoc_args ); + } + + $spec = array_filter( + \WP_CLI\SynopsisParser::parse( $synopsis ), + function( $spec_arg ) { + return in_array( $spec_arg['type'], array( 'generic', 'positional', 'assoc', 'flag' ) ); + } + ); + + $spec = array_values( $spec ); + + $prompt_args = WP_CLI::get_config( 'prompt' ); + if ( true !== $prompt_args ) { + $prompt_args = explode( ',', $prompt_args ); + } + + // 'positional' arguments are positional (aka zero-indexed) + // so $args needs to be reset before prompting for new arguments + $args = array(); + foreach ( $spec as $key => $spec_arg ) { + + // When prompting for specific arguments (e.g. --prompt=user_pass), + // ignore all arguments that don't match. + if ( is_array( $prompt_args ) ) { + if ( 'assoc' !== $spec_arg['type'] ) { + continue; + } + if ( ! in_array( $spec_arg['name'], $prompt_args, true ) ) { + continue; + } + } + + $current_prompt = ( $key + 1 ) . '/' . count( $spec ) . ' '; + $default = $spec_arg['optional'] ? '' : false; + + // 'generic' permits arbitrary key=value (e.g. [--=] ) + if ( 'generic' == $spec_arg['type'] ) { + + list( $key_token, $value_token ) = explode( '=', $spec_arg['token'] ); + + $repeat = false; + do { + if ( ! $repeat ) { + $key_prompt = $current_prompt . $key_token; + } else { + $key_prompt = str_repeat( ' ', strlen( $current_prompt ) ) . $key_token; + } + + $key = $this->prompt( $key_prompt, $default ); + if ( false === $key ) { + return array( $args, $assoc_args ); + } + + if ( $key ) { + $key_prompt_count = strlen( $key_prompt ) - strlen( $value_token ) - 1; + $value_prompt = str_repeat( ' ', $key_prompt_count ) . '=' . $value_token; + + $value = $this->prompt( $value_prompt, $default ); + if ( false === $value ) { + return array( $args, $assoc_args ); + } + + $assoc_args[ $key ] = $value; + + $repeat = true; + } else { + $repeat = false; + } + } while ( $repeat ); + + } else { + + $prompt = $current_prompt . $spec_arg['token']; + if ( 'flag' == $spec_arg['type'] ) { + $prompt .= ' (Y/n)'; + } + + $response = $this->prompt( $prompt, $default ); + if ( false === $response ) { + return array( $args, $assoc_args ); + } + + if ( $response ) { + switch ( $spec_arg['type'] ) { + case 'positional': + if ( $spec_arg['repeating'] ) { + $response = explode( ' ', $response ); + } else { + $response = array( $response ); + } + $args = array_merge( $args, $response ); + break; + case 'assoc': + $assoc_args[ $spec_arg['name'] ] = $response; + break; + case 'flag': + if ( 'Y' == strtoupper( $response ) ) { + $assoc_args[ $spec_arg['name'] ] = true; + } + break; + } + } + } + } + + return array( $args, $assoc_args ); + } + + /** + * Validate the supplied arguments to the command. + * Throws warnings or errors if arguments are missing + * or invalid. + * + * @param array $args + * @param array $assoc_args + * @param array $extra_args + * @return array list of invalid $assoc_args keys to unset + */ + private function validate_args( $args, $assoc_args, $extra_args ) { + $synopsis = $this->get_synopsis(); + if ( ! $synopsis ) { + return array( array(), $args, $assoc_args, $extra_args ); + } + + $validator = new \WP_CLI\SynopsisValidator( $synopsis ); + + $cmd_path = implode( ' ', get_path( $this ) ); + foreach ( $validator->get_unknown() as $token ) { + \WP_CLI::warning( + sprintf( + 'The `%s` command has an invalid synopsis part: %s', + $cmd_path, + $token + ) + ); + } + + if ( ! $validator->enough_positionals( $args ) ) { + $this->show_usage(); + exit( 1 ); + } + + $unknown_positionals = $validator->unknown_positionals( $args ); + if ( ! empty( $unknown_positionals ) ) { + \WP_CLI::error( + 'Too many positional arguments: ' . + implode( ' ', $unknown_positionals ) + ); + } + + $synopsis_spec = \WP_CLI\SynopsisParser::parse( $synopsis ); + $i = 0; + $errors = array( + 'fatal' => array(), + 'warning' => array(), + ); + $mock_doc = array( $this->get_shortdesc(), '' ); + $mock_doc = array_merge( $mock_doc, explode( "\n", $this->get_longdesc() ) ); + $mock_doc = '/**' . PHP_EOL . '* ' . implode( PHP_EOL . '* ', $mock_doc ) . PHP_EOL . '*/'; + $docparser = new \WP_CLI\DocParser( $mock_doc ); + foreach ( $synopsis_spec as $spec ) { + if ( 'positional' === $spec['type'] ) { + $spec_args = $docparser->get_arg_args( $spec['name'] ); + if ( ! isset( $args[ $i ] ) ) { + if ( isset( $spec_args['default'] ) ) { + $args[ $i ] = $spec_args['default']; + } + } + if ( isset( $spec_args['options'] ) ) { + if ( ! empty( $spec['repeating'] ) ) { + do { + if ( isset( $args[ $i ] ) && ! in_array( $args[ $i ], $spec_args['options'] ) ) { + \WP_CLI::error( 'Invalid value specified for positional arg.' ); + } + $i++; + } while ( isset( $args[ $i ] ) ); + } else { + if ( isset( $args[ $i ] ) && ! in_array( $args[ $i ], $spec_args['options'] ) ) { + \WP_CLI::error( 'Invalid value specified for positional arg.' ); + } + } + } + $i++; + } elseif ( 'assoc' === $spec['type'] ) { + $spec_args = $docparser->get_param_args( $spec['name'] ); + if ( ! isset( $assoc_args[ $spec['name'] ] ) && ! isset( $extra_args[ $spec['name'] ] ) ) { + if ( isset( $spec_args['default'] ) ) { + $assoc_args[ $spec['name'] ] = $spec_args['default']; + } + } + if ( isset( $assoc_args[ $spec['name'] ] ) && isset( $spec_args['options'] ) ) { + if ( ! in_array( $assoc_args[ $spec['name'] ], $spec_args['options'] ) ) { + $errors['fatal'][ $spec['name'] ] = "Invalid value specified for '{$spec['name']}'"; + } + } + } + } + + list( $returned_errors, $to_unset ) = $validator->validate_assoc( + array_merge( \WP_CLI::get_config(), $extra_args, $assoc_args ) + ); + foreach ( array( 'fatal', 'warning' ) as $error_type ) { + $errors[ $error_type ] = array_merge( $errors[ $error_type ], $returned_errors[ $error_type ] ); + } + + if ( 'help' !== $this->name ) { + foreach ( $validator->unknown_assoc( $assoc_args ) as $key ) { + $suggestion = Utils\get_suggestion( + $key, + $this->get_parameters( $synopsis_spec ), + $threshold = 2 + ); + + $errors['fatal'][] = sprintf( + 'unknown --%s parameter%s', + $key, + ! empty( $suggestion ) ? PHP_EOL . "Did you mean '--{$suggestion}'?" : '' + ); + } + } + + if ( ! empty( $errors['fatal'] ) ) { + $out = 'Parameter errors:'; + foreach ( $errors['fatal'] as $key => $error ) { + $out .= "\n {$error}"; + if ( $desc = $docparser->get_param_desc( $key ) ) { + $out .= " ({$desc})"; + } + } + + \WP_CLI::error( $out ); + } + + array_map( '\\WP_CLI::warning', $errors['warning'] ); + + return array( $to_unset, $args, $assoc_args, $extra_args ); + } + + /** + * Invoke the subcommand with the supplied arguments. + * Given a --prompt argument, interactively request input + * from the end user. + * + * @param array $args + * @param array $assoc_args + */ + public function invoke( $args, $assoc_args, $extra_args ) { + static $prompted_once = false; + if ( \WP_CLI::get_config( 'prompt' ) && ! $prompted_once ) { + list( $_args, $assoc_args ) = $this->prompt_args( $args, $assoc_args ); + $args = array_merge( $args, $_args ); + $prompted_once = true; + } + + $extra_positionals = array(); + foreach ( $extra_args as $k => $v ) { + if ( is_numeric( $k ) ) { + if ( ! isset( $args[ $k ] ) ) { + $extra_positionals[ $k ] = $v; + } + unset( $extra_args[ $k ] ); + } + } + $args += $extra_positionals; + + list( $to_unset, $args, $assoc_args, $extra_args ) = $this->validate_args( $args, $assoc_args, $extra_args ); + + foreach ( $to_unset as $key ) { + unset( $assoc_args[ $key ] ); + } + + $path = get_path( $this->get_parent() ); + $parent = implode( ' ', array_slice( $path, 1 ) ); + $cmd = $this->name; + if ( $parent ) { + WP_CLI::do_hook( "before_invoke:{$parent}" ); + $cmd = $parent . ' ' . $cmd; + } + WP_CLI::do_hook( "before_invoke:{$cmd}" ); + + call_user_func( $this->when_invoked, $args, array_merge( $extra_args, $assoc_args ) ); + + if ( $parent ) { + WP_CLI::do_hook( "after_invoke:{$parent}" ); + } + WP_CLI::do_hook( "after_invoke:{$cmd}" ); + } + + /** + * Get an array of parameter names, by merging the command-specific and the + * global parameters. + * + * @param array $spec Optional. Specification of the current command. + * + * @return array Array of parameter names + */ + private function get_parameters( $spec = array() ) { + $local_parameters = array_column( $spec, 'name' ); + $global_parameters = array_column( + WP_CLI\SynopsisParser::parse( $this->get_global_params() ), + 'name' + ); + + return array_unique( array_merge( $local_parameters, $global_parameters ) ); + } +} + diff --git a/php/WP_CLI/DocParser.php b/php/WP_CLI/DocParser.php new file mode 100644 index 000000000..303f0b8e6 --- /dev/null +++ b/php/WP_CLI/DocParser.php @@ -0,0 +1,197 @@ +docComment = self::remove_decorations( $docComment ); + } + + /** + * Remove unused cruft from PHPdoc comment. + * + * @param string $comment PHPdoc comment. + * @return string + */ + private static function remove_decorations( $comment ) { + $comment = preg_replace( '|^/\*\*[\r\n]+|', '', $comment ); + $comment = preg_replace( '|\n[\t ]*\*/$|', '', $comment ); + $comment = preg_replace( '|^[\t ]*\* ?|m', '', $comment ); + + return $comment; + } + + /** + * Get the command's short description (e.g. summary). + * + * @return string + */ + public function get_shortdesc() { + if ( ! preg_match( '|^([^@][^\n]+)\n*|', $this->docComment, $matches ) ) { + return ''; + } + + return $matches[1]; + } + + /** + * Get the command's full description + * + * @return string + */ + public function get_longdesc() { + $shortdesc = $this->get_shortdesc(); + if ( ! $shortdesc ) { + return ''; + } + + $longdesc = substr( $this->docComment, strlen( $shortdesc ) ); + + $lines = array(); + foreach ( explode( "\n", $longdesc ) as $line ) { + if ( 0 === strpos( $line, '@' ) ) { + break; + } + + $lines[] = $line; + } + $longdesc = trim( implode( $lines, "\n" ) ); + + return $longdesc; + } + + /** + * Get the value for a given tag (e.g. "@alias" or "@subcommand") + * + * @param string $name Name for the tag, without '@' + * @return string + */ + public function get_tag( $name ) { + if ( preg_match( '|^@' . $name . '\s+([a-z-_0-9]+)|m', $this->docComment, $matches ) ) { + return $matches[1]; + } + + return ''; + } + + /** + * Get the command's synopsis. + * + * @return string + */ + public function get_synopsis() { + if ( ! preg_match( '|^@synopsis\s+(.+)|m', $this->docComment, $matches ) ) { + return ''; + } + + return $matches[1]; + } + + /** + * Get the description for a given argument. + * + * @param string $name Argument's doc name. + * @return string + */ + public function get_arg_desc( $name ) { + + if ( preg_match( "/\[?<{$name}>.+\n: (.+?)(\n|$)/", $this->docComment, $matches ) ) { + return $matches[1]; + } + + return ''; + + } + + /** + * Get the arguments for a given argument. + * + * @param string $name Argument's doc name. + * @return mixed|null + */ + public function get_arg_args( $name ) { + return $this->get_arg_or_param_args( "/^\[?<{$name}>.*/" ); + } + + /** + * Get the description for a given parameter. + * + * @param string $key Parameter's key. + * @return string + */ + public function get_param_desc( $key ) { + + if ( preg_match( "/\[?--{$key}=.+\n: (.+?)(\n|$)/", $this->docComment, $matches ) ) { + return $matches[1]; + } + + return ''; + } + + /** + * Get the arguments for a given parameter. + * + * @param string $key Parameter's key. + * @return mixed|null + */ + public function get_param_args( $key ) { + return $this->get_arg_or_param_args( "/^\[?--{$key}=.*/" ); + } + + /** + * Get the args for an arg or param + * + * @param string $regex Pattern to match against + * @return array|null Interpreted YAML document, or null. + */ + private function get_arg_or_param_args( $regex ) { + $bits = explode( "\n", $this->docComment ); + $within_arg = $within_doc = false; + $document = array(); + foreach ( $bits as $bit ) { + if ( preg_match( $regex, $bit ) ) { + $within_arg = true; + } + + if ( $within_arg && $within_doc && '---' === $bit ) { + $within_doc = false; + } + + if ( $within_arg && ! $within_doc && '---' === $bit ) { + $within_doc = true; + } + + if ( $within_doc ) { + $document[] = $bit; + } + + if ( $within_arg && '' === $bit ) { + $within_arg = false; + break; + } + } + + if ( $document ) { + return Spyc::YAMLLoadString( implode( "\n", $document ) ); + } + return null; + } + +} diff --git a/php/WP_CLI/ExitException.php b/php/WP_CLI/ExitException.php new file mode 100644 index 000000000..8a86dc3e0 --- /dev/null +++ b/php/WP_CLI/ExitException.php @@ -0,0 +1,5 @@ +open( $zipfile ); + if ( true === $res ) { + $tempdir = implode( + DIRECTORY_SEPARATOR, + array( + dirname( $zipfile ), + Utils\basename( $zipfile, '.zip' ), + $zip->getNameIndex( 0 ), + ) + ); + + $zip->extractTo( dirname( $tempdir ) ); + $zip->close(); + + self::copy_overwrite_files( $tempdir, $dest ); + self::rmdir( dirname( $tempdir ) ); + } else { + throw new \Exception( sprintf( "ZipArchive failed to unzip '%s': %s.", $zipfile, self::zip_error_msg( $res ) ) ); + } + } + + /** + * Extract a tarball to a specific destination. + * + * @param string $tarball + * @param string $dest + */ + private static function extract_tarball( $tarball, $dest ) { + + if ( class_exists( 'PharData' ) ) { + try { + $phar = new PharData( $tarball ); + $tempdir = implode( + DIRECTORY_SEPARATOR, + array( + dirname( $tarball ), + Utils\basename( $tarball, '.tar.gz' ), + $phar->getFilename(), + ) + ); + + $phar->extractTo( dirname( $tempdir ), null, true ); + + self::copy_overwrite_files( $tempdir, $dest ); + + self::rmdir( dirname( $tempdir ) ); + return; + } catch ( \Exception $e ) { + WP_CLI::warning( "PharData failed, falling back to 'tar xz' (" . $e->getMessage() . ')' ); + // Fall through to trying `tar xz` below + } + } + // Note: directory must exist for tar --directory to work. + $cmd = Utils\esc_cmd( 'tar xz --strip-components=1 --directory=%s -f %s', $dest, $tarball ); + $process_run = WP_CLI::launch( $cmd, false /*exit_on_error*/, true /*return_detailed*/ ); + if ( 0 !== $process_run->return_code ) { + throw new \Exception( sprintf( 'Failed to execute `%s`: %s.', $cmd, self::tar_error_msg( $process_run ) ) ); + } + } + + /** + * Copy files from source directory to destination directory. Source directory must exist. + * + * @param string $source + * @param string $dest + */ + public static function copy_overwrite_files( $source, $dest ) { + $iterator = new RecursiveIteratorIterator( + new RecursiveDirectoryIterator( $source, RecursiveDirectoryIterator::SKIP_DOTS ), + RecursiveIteratorIterator::SELF_FIRST + ); + + $error = 0; + + if ( ! is_dir( $dest ) ) { + mkdir( $dest, 0777, true ); + } + + foreach ( $iterator as $item ) { + + $dest_path = $dest . DIRECTORY_SEPARATOR . $iterator->getSubPathName(); + + if ( $item->isDir() ) { + if ( ! is_dir( $dest_path ) ) { + mkdir( $dest_path ); + } + } else { + if ( file_exists( $dest_path ) && is_writable( $dest_path ) ) { + copy( $item, $dest_path ); + } elseif ( ! file_exists( $dest_path ) ) { + copy( $item, $dest_path ); + } else { + $error = 1; + WP_CLI::warning( "Unable to copy '" . $iterator->getSubPathName() . "' to current directory." ); + } + } + } + + if ( $error ) { + throw new \Exception( 'There was an error overwriting existing files.' ); + } + } + + /** + * Delete all files and directories recursively from directory. Directory must exist. + * + * @param string $dir + */ + public static function rmdir( $dir ) { + $files = new RecursiveIteratorIterator( + new RecursiveDirectoryIterator( $dir, RecursiveDirectoryIterator::SKIP_DOTS ), + RecursiveIteratorIterator::CHILD_FIRST + ); + + foreach ( $files as $fileinfo ) { + $todo = $fileinfo->isDir() ? 'rmdir' : 'unlink'; + $todo( $fileinfo->getRealPath() ); + } + rmdir( $dir ); + } + + /** + * Return formatted ZipArchive error message from error code. + * + * @param int $error_code + * @return string + */ + public static function zip_error_msg( $error_code ) { + // From https://github.com/php/php-src/blob/php-5.3.0/ext/zip/php_zip.c#L2623-L2646 + static $zip_err_msgs = array( + ZipArchive::ER_OK => 'No error', + ZipArchive::ER_MULTIDISK => 'Multi-disk zip archives not supported', + ZipArchive::ER_RENAME => 'Renaming temporary file failed', + ZipArchive::ER_CLOSE => 'Closing zip archive failed', + ZipArchive::ER_SEEK => 'Seek error', + ZipArchive::ER_READ => 'Read error', + ZipArchive::ER_WRITE => 'Write error', + ZipArchive::ER_CRC => 'CRC error', + ZipArchive::ER_ZIPCLOSED => 'Containing zip archive was closed', + ZipArchive::ER_NOENT => 'No such file', + ZipArchive::ER_EXISTS => 'File already exists', + ZipArchive::ER_OPEN => 'Can\'t open file', + ZipArchive::ER_TMPOPEN => 'Failure to create temporary file', + ZipArchive::ER_ZLIB => 'Zlib error', + ZipArchive::ER_MEMORY => 'Malloc failure', + ZipArchive::ER_CHANGED => 'Entry has been changed', + ZipArchive::ER_COMPNOTSUPP => 'Compression method not supported', + ZipArchive::ER_EOF => 'Premature EOF', + ZipArchive::ER_INVAL => 'Invalid argument', + ZipArchive::ER_NOZIP => 'Not a zip archive', + ZipArchive::ER_INTERNAL => 'Internal error', + ZipArchive::ER_INCONS => 'Zip archive inconsistent', + ZipArchive::ER_REMOVE => 'Can\'t remove file', + ZipArchive::ER_DELETED => 'Entry has been deleted', + ); + + if ( isset( $zip_err_msgs[ $error_code ] ) ) { + return sprintf( '%s (%d)', $zip_err_msgs[ $error_code ], $error_code ); + } + return $error_code; + } + + /** + * Return formatted error message from ProcessRun of tar command. + * + * @param Processrun $process_run + * @return string + */ + public static function tar_error_msg( $process_run ) { + $stderr = trim( $process_run->stderr ); + if ( false !== ( $nl_pos = strpos( $stderr, "\n" ) ) ) { + $stderr = trim( substr( $stderr, 0, $nl_pos ) ); + } + if ( $stderr ) { + return sprintf( '%s (%d)', $stderr, $process_run->return_code ); + } + return $process_run->return_code; + } +} diff --git a/php/WP_CLI/Fetchers/Base.php b/php/WP_CLI/Fetchers/Base.php new file mode 100644 index 000000000..639efe103 --- /dev/null +++ b/php/WP_CLI/Fetchers/Base.php @@ -0,0 +1,56 @@ +get( $arg ); + + if ( ! $item ) { + \WP_CLI::error( sprintf( $this->msg, $arg ) ); + } + + return $item; + } + + /** + * @param array The raw CLI arguments + * @return array The list of found items + */ + public function get_many( $args ) { + $items = array(); + + foreach ( $args as $arg ) { + $item = $this->get( $arg ); + + if ( $item ) { + $items[] = $item; + } else { + \WP_CLI::warning( sprintf( $this->msg, $arg ) ); + } + } + + return $items; + } +} + diff --git a/php/WP_CLI/FileCache.php b/php/WP_CLI/FileCache.php new file mode 100644 index 000000000..ff7da5214 --- /dev/null +++ b/php/WP_CLI/FileCache.php @@ -0,0 +1,333 @@ + + * Jordi Boggiano + */ + +namespace WP_CLI; + +use Symfony\Component\Finder\Finder; + +/** + * Reads/writes to a filesystem cache + */ +class FileCache { + + /** + * @var string cache path + */ + protected $root; + /** + * @var bool + */ + protected $enabled = true; + /** + * @var int files time to live + */ + protected $ttl; + /** + * @var int max total size + */ + protected $maxSize; + /** + * @var string key allowed chars (regex class) + */ + protected $whitelist; + + /** + * @param string $cacheDir location of the cache + * @param int $ttl cache files default time to live (expiration) + * @param int $maxSize max total cache size + * @param string $whitelist List of characters that are allowed in path names (used in a regex character class) + */ + public function __construct( $cacheDir, $ttl, $maxSize, $whitelist = 'a-z0-9._-' ) { + $this->root = Utils\trailingslashit( $cacheDir ); + $this->ttl = (int) $ttl; + $this->maxSize = (int) $maxSize; + $this->whitelist = $whitelist; + + if ( ! $this->ensure_dir_exists( $this->root ) ) { + $this->enabled = false; + } + + } + + /** + * Cache is enabled + * + * @return bool + */ + public function is_enabled() { + return $this->enabled; + } + + /** + * Cache root + * + * @return string + */ + public function get_root() { + return $this->root; + } + + + /** + * Check if a file is in cache and return its filename + * + * @param string $key cache key + * @param int $ttl time to live + * @return bool|string filename or false + */ + public function has( $key, $ttl = null ) { + if ( ! $this->enabled ) { + return false; + } + + $filename = $this->filename( $key ); + + if ( ! file_exists( $filename ) ) { + return false; + } + + // use ttl param or global ttl + if ( null === $ttl ) { + $ttl = $this->ttl; + } elseif ( $this->ttl > 0 ) { + $ttl = min( (int) $ttl, $this->ttl ); + } else { + $ttl = (int) $ttl; + } + + // + if ( $ttl > 0 && filemtime( $filename ) + $ttl < time() ) { + if ( $this->ttl > 0 && $ttl >= $this->ttl ) { + unlink( $filename ); + } + return false; + } + + return $filename; + } + + /** + * Write to cache file + * + * @param string $key cache key + * @param string $contents file contents + * @return bool + */ + public function write( $key, $contents ) { + $filename = $this->prepare_write( $key ); + + if ( $filename ) { + return file_put_contents( $filename, $contents ) && touch( $filename ); + } + + return false; + } + + /** + * Read from cache file + * + * @param string $key cache key + * @param int $ttl time to live + * @return bool|string file contents or false + */ + public function read( $key, $ttl = null ) { + $filename = $this->has( $key, $ttl ); + + if ( $filename ) { + return file_get_contents( $filename ); + } + + return false; + } + + /** + * Copy a file into the cache + * + * @param string $key cache key + * @param string $source source filename + * @return bool + */ + public function import( $key, $source ) { + $filename = $this->prepare_write( $key ); + + if ( $filename ) { + return copy( $source, $filename ) && touch( $filename ); + } + + return false; + } + + /** + * Copy a file out of the cache + * + * @param string $key cache key + * @param string $target target filename + * @param int $ttl time to live + * @return bool + */ + public function export( $key, $target, $ttl = null ) { + $filename = $this->has( $key, $ttl ); + + if ( $filename ) { + return copy( $filename, $target ); + } + + return false; + } + + /** + * Remove file from cache + * + * @param string $key cache key + * @return bool + */ + public function remove( $key ) { + if ( ! $this->enabled ) { + return false; + } + + $filename = $this->filename( $key ); + + if ( file_exists( $filename ) ) { + return unlink( $filename ); + } + + return false; + } + + /** + * Clean cache based on time to live and max size + * + * @return bool + */ + public function clean() { + if ( ! $this->enabled ) { + return false; + } + + $ttl = $this->ttl; + $maxSize = $this->maxSize; + + // unlink expired files + if ( $ttl > 0 ) { + try { + $expire = new \DateTime(); + } catch ( \Exception $e ) { + \WP_CLI::error( $e->getMessage() ); + } + $expire->modify( '-' . $ttl . ' seconds' ); + + $finder = $this->get_finder()->date( 'until ' . $expire->format( 'Y-m-d H:i:s' ) ); + foreach ( $finder as $file ) { + unlink( $file->getRealPath() ); + } + } + + // unlink older files if max cache size is exceeded + if ( $maxSize > 0 ) { + $files = array_reverse( iterator_to_array( $this->get_finder()->sortByAccessedTime()->getIterator() ) ); + $total = 0; + + foreach ( $files as $file ) { + if ( $total + $file->getSize() <= $maxSize ) { + $total += $file->getSize(); + } else { + unlink( $file->getRealPath() ); + } + } + } + + return true; + } + + /** + * Ensure directory exists + * + * @param string $dir directory + * @return bool + */ + protected function ensure_dir_exists( $dir ) { + if ( ! is_dir( $dir ) ) { + if ( ! @mkdir( $dir, 0777, true ) ) { // @codingStandardsIgnoreLine + $error = error_get_last(); + \WP_CLI::warning( sprintf( "Failed to create directory '%s': %s.", $dir, $error['message'] ) ); + return false; + } + } + + return true; + } + + /** + * Prepare cache write + * + * @param string $key cache key + * @return bool|string filename or false + */ + protected function prepare_write( $key ) { + if ( ! $this->enabled ) { + return false; + } + + $filename = $this->filename( $key ); + + if ( ! $this->ensure_dir_exists( dirname( $filename ) ) ) { + return false; + } + + return $filename; + } + + /** + * Validate cache key + * + * @param string $key cache key + * @return string relative filename + */ + protected function validate_key( $key ) { + $url_parts = parse_url( $key ); + if ( ! empty( $url_parts['scheme'] ) ) { // is url + $parts = array( 'misc' ); + $parts[] = $url_parts['scheme'] . '-' . $url_parts['host'] . + ( empty( $url_parts['port'] ) ? '' : '-' . $url_parts['port'] ); + $parts[] = substr( $url_parts['path'], 1 ) . + ( empty( $url_parts['query'] ) ? '' : '-' . $url_parts['query'] ); + } else { + $key = str_replace( '\\', '/', $key ); + $parts = explode( '/', ltrim( $key ) ); + } + + $parts = preg_replace( "#[^{$this->whitelist}]#i", '-', $parts ); + + return implode( '/', $parts ); + } + + /** + * Filename from key + * + * @param string $key + * @return string filename + */ + protected function filename( $key ) { + return $this->root . $this->validate_key( $key ); + } + + /** + * Get a Finder that iterates in cache root only the files + * + * @return Finder + */ + protected function get_finder() { + return Finder::create()->in( $this->root )->files(); + } +} diff --git a/php/WP_CLI/Formatter.php b/php/WP_CLI/Formatter.php new file mode 100644 index 000000000..21707b15e --- /dev/null +++ b/php/WP_CLI/Formatter.php @@ -0,0 +1,361 @@ + 'table', + 'fields' => $fields, + 'field' => null, + ); + + foreach ( array( 'format', 'fields', 'field' ) as $key ) { + if ( isset( $assoc_args[ $key ] ) ) { + $format_args[ $key ] = $assoc_args[ $key ]; + unset( $assoc_args[ $key ] ); + } + } + + if ( ! is_array( $format_args['fields'] ) ) { + $format_args['fields'] = explode( ',', $format_args['fields'] ); + } + + $format_args['fields'] = array_map( 'trim', $format_args['fields'] ); + + $this->args = $format_args; + $this->prefix = $prefix; + } + + /** + * Magic getter for arguments. + * + * @param string $key + * @return mixed + */ + public function __get( $key ) { + return $this->args[ $key ]; + } + + /** + * Display multiple items according to the output arguments. + * + * @param array $items + * @param bool|array $ascii_pre_colorized Optional. A boolean or an array of booleans to pass to `format()` if items in the table are pre-colorized. Default false. + */ + public function display_items( $items, $ascii_pre_colorized = false ) { + if ( $this->args['field'] ) { + $this->show_single_field( $items, $this->args['field'] ); + } else { + if ( in_array( $this->args['format'], array( 'csv', 'json', 'table' ) ) ) { + $item = is_array( $items ) && ! empty( $items ) ? array_shift( $items ) : false; + if ( $item && ! empty( $this->args['fields'] ) ) { + foreach ( $this->args['fields'] as &$field ) { + $field = $this->find_item_key( $item, $field ); + } + array_unshift( $items, $item ); + } + } + + if ( in_array( $this->args['format'], array( 'table', 'csv' ) ) ) { + if ( is_object( $items ) && is_a( $items, 'Iterator' ) ) { + $items = \WP_CLI\Utils\iterator_map( $items, array( $this, 'transform_item_values_to_json' ) ); + } else { + $items = array_map( array( $this, 'transform_item_values_to_json' ), $items ); + } + } + + $this->format( $items, $ascii_pre_colorized ); + } + } + + /** + * Display a single item according to the output arguments. + * + * @param mixed $item + * @param bool|array $ascii_pre_colorized Optional. A boolean or an array of booleans to pass to `show_multiple_fields()` if the item in the table is pre-colorized. Default false. + */ + public function display_item( $item, $ascii_pre_colorized = false ) { + if ( isset( $this->args['field'] ) ) { + $item = (object) $item; + $key = $this->find_item_key( $item, $this->args['field'] ); + $value = $item->$key; + if ( in_array( $this->args['format'], array( 'table', 'csv' ) ) && ( is_object( $value ) || is_array( $value ) ) ) { + $value = json_encode( $value ); + } + \WP_CLI::print_value( + $value, + array( + 'format' => $this->args['format'], + ) + ); + } else { + $this->show_multiple_fields( $item, $this->args['format'], $ascii_pre_colorized ); + } + } + + /** + * Format items according to arguments. + * + * @param array $items + * @param bool|array $ascii_pre_colorized Optional. A boolean or an array of booleans to pass to `show_table()` if items in the table are pre-colorized. Default false. + */ + private function format( $items, $ascii_pre_colorized = false ) { + $fields = $this->args['fields']; + + switch ( $this->args['format'] ) { + case 'count': + if ( ! is_array( $items ) ) { + $items = iterator_to_array( $items ); + } + echo count( $items ); + break; + + case 'ids': + if ( ! is_array( $items ) ) { + $items = iterator_to_array( $items ); + } + echo implode( ' ', $items ); + break; + + case 'table': + self::show_table( $items, $fields, $ascii_pre_colorized ); + break; + + case 'csv': + \WP_CLI\Utils\write_csv( STDOUT, $items, $fields ); + break; + + case 'json': + case 'yaml': + $out = array(); + foreach ( $items as $item ) { + $out[] = \WP_CLI\Utils\pick_fields( $item, $fields ); + } + + if ( 'json' === $this->args['format'] ) { + if ( defined( 'JSON_PARTIAL_OUTPUT_ON_ERROR' ) ) { + echo json_encode( $out, JSON_PARTIAL_OUTPUT_ON_ERROR ); + } else { + echo json_encode( $out ); + } + } elseif ( 'yaml' === $this->args['format'] ) { + echo Spyc::YAMLDump( $out, 2, 0 ); + } + break; + + default: + \WP_CLI::error( 'Invalid format: ' . $this->args['format'] ); + } + } + + /** + * Show a single field from a list of items. + * + * @param array Array of objects to show fields from + * @param string The field to show + */ + private function show_single_field( $items, $field ) { + $key = null; + $values = array(); + + foreach ( $items as $item ) { + $item = (object) $item; + + if ( null === $key ) { + $key = $this->find_item_key( $item, $field ); + } + + if ( 'json' == $this->args['format'] ) { + $values[] = $item->$key; + } else { + \WP_CLI::print_value( + $item->$key, + array( + 'format' => $this->args['format'], + ) + ); + } + } + + if ( 'json' == $this->args['format'] ) { + echo json_encode( $values ); + } + } + + /** + * Find an object's key. + * If $prefix is set, a key with that prefix will be prioritized. + * + * @param object $item + * @param string $field + * @return string $key + */ + private function find_item_key( $item, $field ) { + foreach ( array( $field, $this->prefix . '_' . $field ) as $maybe_key ) { + if ( ( is_object( $item ) && ( property_exists( $item, $maybe_key ) || isset( $item->$maybe_key ) ) ) || ( is_array( $item ) && array_key_exists( $maybe_key, $item ) ) ) { + $key = $maybe_key; + break; + } + } + + if ( ! isset( $key ) ) { + \WP_CLI::error( "Invalid field: $field." ); + } + + return $key; + } + + /** + * Show multiple fields of an object. + * + * @param object|array $data Data to display + * @param string $format Format to display the data in + * @param bool|array $ascii_pre_colorized Optional. A boolean or an array of booleans to pass to `show_table()` if the item in the table is pre-colorized. Default false. + */ + private function show_multiple_fields( $data, $format, $ascii_pre_colorized = false ) { + + $true_fields = array(); + foreach ( $this->args['fields'] as $field ) { + $true_fields[] = $this->find_item_key( $data, $field ); + } + + foreach ( $data as $key => $value ) { + if ( ! in_array( $key, $true_fields ) ) { + if ( is_array( $data ) ) { + unset( $data[ $key ] ); + } elseif ( is_object( $data ) ) { + unset( $data->$key ); + } + } + } + + switch ( $format ) { + + case 'table': + case 'csv': + $rows = $this->assoc_array_to_rows( $data ); + $fields = array( 'Field', 'Value' ); + if ( 'table' == $format ) { + self::show_table( $rows, $fields, $ascii_pre_colorized ); + } elseif ( 'csv' == $format ) { + \WP_CLI\Utils\write_csv( STDOUT, $rows, $fields ); + } + break; + + case 'yaml': + case 'json': + \WP_CLI::print_value( + $data, + array( + 'format' => $format, + ) + ); + break; + + default: + \WP_CLI::error( 'Invalid format: ' . $format ); + break; + + } + + } + + /** + * Show items in a \cli\Table. + * + * @param array $items + * @param array $fields + * @param bool|array $ascii_pre_colorized Optional. A boolean or an array of booleans to pass to `Table::setAsciiPreColorized()` if items in the table are pre-colorized. Default false. + */ + private static function show_table( $items, $fields, $ascii_pre_colorized = false ) { + $table = new \cli\Table(); + + $enabled = \cli\Colors::shouldColorize(); + if ( $enabled ) { + \cli\Colors::disable( true ); + } + + $table->setAsciiPreColorized( $ascii_pre_colorized ); + $table->setHeaders( $fields ); + + foreach ( $items as $item ) { + $table->addRow( array_values( \WP_CLI\Utils\pick_fields( $item, $fields ) ) ); + } + + foreach ( $table->getDisplayLines() as $line ) { + \WP_CLI::line( $line ); + } + + if ( $enabled ) { + \cli\Colors::enable( true ); + } + } + + /** + * Format an associative array as a table. + * + * @param array $fields Fields and values to format + * @return array $rows + */ + private function assoc_array_to_rows( $fields ) { + $rows = array(); + + foreach ( $fields as $field => $value ) { + + if ( ! is_string( $value ) ) { + $value = json_encode( $value ); + } + + $rows[] = (object) array( + 'Field' => $field, + 'Value' => $value, + ); + } + + return $rows; + } + + /** + * Transforms objects and arrays to JSON as necessary + * + * @param mixed $item + * @return mixed + */ + public function transform_item_values_to_json( $item ) { + foreach ( $this->args['fields'] as $field ) { + $true_field = $this->find_item_key( $item, $field ); + $value = is_object( $item ) ? $item->$true_field : $item[ $true_field ]; + if ( is_array( $value ) || is_object( $value ) ) { + if ( is_object( $item ) ) { + $item->$true_field = json_encode( $value ); + } elseif ( is_array( $item ) ) { + $item[ $true_field ] = json_encode( $value ); + } + } + } + return $item; + } + +} diff --git a/php/WP_CLI/Iterators/CSV.php b/php/WP_CLI/Iterators/CSV.php new file mode 100644 index 000000000..c90f079f0 --- /dev/null +++ b/php/WP_CLI/Iterators/CSV.php @@ -0,0 +1,78 @@ +filePointer = fopen( $filename, 'rb' ); + if ( ! $this->filePointer ) { + \WP_CLI::error( sprintf( 'Could not open file: %s', $filename ) ); + } + + $this->delimiter = $delimiter; + } + + public function rewind() { + rewind( $this->filePointer ); + + $this->columns = fgetcsv( $this->filePointer, self::ROW_SIZE, $this->delimiter ); + + $this->currentIndex = -1; + $this->next(); + } + + public function current() { + return $this->currentElement; + } + + public function key() { + return $this->currentIndex; + } + + public function next() { + $this->currentElement = false; + + while ( true ) { + $str = fgets( $this->filePointer ); + + if ( false === $str ) { + break; + } + + $row = str_getcsv( $str, $this->delimiter ); + + $element = array(); + foreach ( $this->columns as $i => $key ) { + if ( isset( $row[ $i ] ) ) { + $element[ $key ] = $row[ $i ]; + } + } + + if ( ! empty( $element ) ) { + $this->currentElement = $element; + $this->currentIndex++; + + break; + } + } + } + + public function valid() { + return is_array( $this->currentElement ); + } +} + diff --git a/php/WP_CLI/Iterators/Exception.php b/php/WP_CLI/Iterators/Exception.php new file mode 100644 index 000000000..e7320e077 --- /dev/null +++ b/php/WP_CLI/Iterators/Exception.php @@ -0,0 +1,6 @@ + + * foreach( new Iterators\Query( 'SELECT * FROM users', 100 ) as $user ) { + * tickle( $user ); + * } + * + * + * @param string $query The query as a string. It shouldn't include any LIMIT clauses + * @param number $chunk_size How many rows to retrieve at once; default value is 500 (optional) + */ + public function __construct( $query, $chunk_size = 500 ) { + $this->query = $query; + + $this->count_query = preg_replace( '/^.*? FROM /', 'SELECT COUNT(*) FROM ', $query, 1, $replacements ); + if ( 1 !== $replacements ) { + $this->count_query = ''; + } + + $this->chunk_size = $chunk_size; + + $this->db = $GLOBALS['wpdb']; + } + + /** + * Reduces the offset when the query row count shrinks + * + * In cases where the iterated rows are being updated such that they will no + * longer be returned by the original query, the offset must be reduced to + * iterate over all remaining rows. + */ + private function adjust_offset_for_shrinking_result_set() { + if ( empty( $this->count_query ) ) { + return; + } + + $row_count = $this->db->get_var( $this->count_query ); + + if ( $row_count < $this->row_count ) { + $this->offset -= $this->row_count - $row_count; + } + + $this->row_count = $row_count; + } + + private function load_items_from_db() { + $this->adjust_offset_for_shrinking_result_set(); + + $query = $this->query . sprintf( ' LIMIT %d OFFSET %d', $this->chunk_size, $this->offset ); + $this->results = $this->db->get_results( $query ); + + if ( ! $this->results ) { + if ( $this->db->last_error ) { + throw new Exception( 'Database error: ' . $this->db->last_error ); + } + + return false; + } + + $this->offset += $this->chunk_size; + return true; + } + + public function current() { + return $this->results[ $this->index_in_results ]; + } + + public function key() { + return $this->global_index; + } + + public function next() { + $this->index_in_results++; + $this->global_index++; + } + + public function rewind() { + $this->results = array(); + $this->global_index = 0; + $this->index_in_results = 0; + $this->offset = 0; + $this->depleted = false; + } + + public function valid() { + if ( $this->depleted ) { + return false; + } + + if ( ! isset( $this->results[ $this->index_in_results ] ) ) { + $items_loaded = $this->load_items_from_db(); + + if ( ! $items_loaded ) { + $this->rewind(); + $this->depleted = true; + return false; + } + + $this->index_in_results = 0; + } + + return true; + } +} + diff --git a/php/WP_CLI/Iterators/Table.php b/php/WP_CLI/Iterators/Table.php new file mode 100644 index 000000000..f3ee71757 --- /dev/null +++ b/php/WP_CLI/Iterators/Table.php @@ -0,0 +1,94 @@ + + * foreach( new Iterators\Table( array( 'table' => $wpdb->posts, 'fields' => array( 'ID', 'post_content' ) ) ) as $post ) { + * count_words_for( $post->ID, $post->post_content ); + * } + * + * + * + * foreach( new Iterators\Table( array( 'table' => $wpdb->posts, 'where' => 'ID = 8 OR post_status = "publish"' ) ) as $post ) { + * … + * } + * + * + * + * foreach( new PostIterator( array( 'table' => $wpdb->posts, 'where' => array( 'post_status' => 'publish', 'post_date_gmt BETWEEN x AND y' ) ) ) as $post ) { + * … + * } + * + * + * + * @param array $args Supported arguments: + * table – the name of the database table + * fields – an array of columns to get from the table, '*' is a valid value and the default + * where – conditions for filtering rows. Supports two formats: + * = string – this will be the where clause + * = array – each element is treated as a condition if it's positional, or as column => value if + * it's a key/value pair. In the latter case the value is automatically quoted and escaped + * append - add arbitrary extra SQL + */ + public function __construct( $args = array() ) { + $defaults = array( + 'fields' => '*', + 'where' => array(), + 'append' => '', + 'table' => null, + 'chunk_size' => 500, + ); + $table = $args['table']; + $args = array_merge( $defaults, $args ); + + $fields = self::build_fields( $args['fields'] ); + $conditions = self::build_where_conditions( $args['where'] ); + $where_sql = $conditions ? " WHERE $conditions" : ''; + $query = "SELECT $fields FROM `$table` $where_sql {$args['append']}"; + + parent::__construct( $query, $args['chunk_size'] ); + } + + private static function build_fields( $fields ) { + if ( '*' === $fields ) { + return $fields; + } + + return implode( + ', ', + array_map( + function ( $v ) { + return "`$v`"; + }, + $fields + ) + ); + } + + private static function build_where_conditions( $where ) { + global $wpdb; + if ( is_array( $where ) ) { + $conditions = array(); + foreach ( $where as $key => $value ) { + if ( is_array( $value ) ) { + $conditions[] = $key . ' IN (' . esc_sql( implode( ',', $value ) ) . ')'; + } elseif ( is_numeric( $key ) ) { + $conditions[] = $value; + } else { + $conditions[] = $key . $wpdb->prepare( ' = %s', $value ); + } + } + $where = implode( ' AND ', $conditions ); + } + return $where; + } +} + diff --git a/php/WP_CLI/Iterators/Transform.php b/php/WP_CLI/Iterators/Transform.php new file mode 100644 index 000000000..ec1030f65 --- /dev/null +++ b/php/WP_CLI/Iterators/Transform.php @@ -0,0 +1,26 @@ +transformers[] = $fn; + } + + public function current() { + $value = parent::current(); + + foreach ( $this->transformers as $fn ) { + $value = call_user_func( $fn, $value ); + } + + return $value; + } +} + diff --git a/php/WP_CLI/Loggers/Base.php b/php/WP_CLI/Loggers/Base.php new file mode 100644 index 000000000..cd5f478c8 --- /dev/null +++ b/php/WP_CLI/Loggers/Base.php @@ -0,0 +1,81 @@ +get_runner()->config['debug']; + if ( ! $debug ) { + return; + } + if ( true !== $debug && $group !== $debug ) { + return; + } + $time = round( microtime( true ) - ( defined( 'WP_CLI_START_MICROTIME' ) ? WP_CLI_START_MICROTIME : $start_time ), 3 ); + $prefix = 'Debug'; + if ( $group && true === $debug ) { + $prefix = 'Debug (' . $group . ')'; + } + $this->_line( "$message ({$time}s)", $prefix, '%B', STDERR ); + } + + /** + * Write a string to a resource. + * + * @param resource $handle Commonly STDOUT or STDERR. + * @param string $str Message to write. + */ + protected function write( $handle, $str ) { + fwrite( $handle, $str ); + } + + /** + * Output one line of message to a resource. + * + * @param string $message Message to write. + * @param string $label Prefix message with a label. + * @param string $color Colorize label with a given color. + * @param resource $handle Resource to write to. Defaults to STDOUT. + */ + protected function _line( $message, $label, $color, $handle = STDOUT ) { + if ( class_exists( 'cli\Colors' ) ) { + $label = \cli\Colors::colorize( "$color$label:%n", $this->in_color ); + } else { + $label = "$label:"; + } + $this->write( $handle, "$label $message\n" ); + } + +} diff --git a/php/WP_CLI/Loggers/Execution.php b/php/WP_CLI/Loggers/Execution.php new file mode 100644 index 000000000..a95c141b5 --- /dev/null +++ b/php/WP_CLI/Loggers/Execution.php @@ -0,0 +1,81 @@ +write( STDERR, \WP_CLI::colorize( "%RError:%n\n$message\n" ) ); + $this->write( STDERR, \WP_CLI::colorize( "%R---------%n\n\n" ) ); + } + + /** + * Write a string to a resource. + * + * @param resource $handle Commonly STDOUT or STDERR. + * @param string $str Message to write. + */ + protected function write( $handle, $str ) { + switch ( $handle ) { + case STDOUT: + $this->stdout .= $str; + break; + case STDERR: + $this->stderr .= $str; + break; + } + } + + /** + * Starts output buffering, using a callback to capture output from `echo`, `print`, `printf` (which write to the output buffer 'php://output' rather than STDOUT). + */ + public function ob_start() { + // To ensure sequential output, give a chunk size of 1 (or 2 if PHP < 5.4 as 1 was a special value meaning a 4KB chunk) to `ob_start()`, so that each write gets flushed immediately. + ob_start( array( $this, 'ob_start_callback' ), version_compare( PHP_VERSION, '5.4.0', '<' ) ? 2 : 1 ); + } + + /** + * Callback for `ob_start()`. + * + * @param string $str String to write. + * @return string Returns zero-length string so nothing gets written to the output buffer. + */ + public function ob_start_callback( $str ) { + $this->write( STDOUT, $str ); + return ''; + } + + /** + * To match `ob_start() above. Does an `ob_end_flush()`. + */ + public function ob_end() { + ob_end_flush(); + } +} diff --git a/php/WP_CLI/Loggers/Quiet.php b/php/WP_CLI/Loggers/Quiet.php new file mode 100644 index 000000000..e8de7be82 --- /dev/null +++ b/php/WP_CLI/Loggers/Quiet.php @@ -0,0 +1,57 @@ +write( STDERR, \WP_CLI::colorize( "%RError:%n $message\n" ) ); + } + + /** + * Similar to error( $message ), but outputs $message in a red box + * + * @param array $message Message to write. + */ + public function error_multi_line( $message_lines ) { + $message = implode( "\n", $message_lines ); + + $this->write( STDERR, \WP_CLI::colorize( "%RError:%n\n$message\n" ) ); + $this->write( STDERR, \WP_CLI::colorize( "%R---------%n\n\n" ) ); + } +} diff --git a/php/WP_CLI/Loggers/Regular.php b/php/WP_CLI/Loggers/Regular.php new file mode 100644 index 000000000..e5e420bd6 --- /dev/null +++ b/php/WP_CLI/Loggers/Regular.php @@ -0,0 +1,82 @@ +in_color = $in_color; + } + + /** + * Write an informational message to STDOUT. + * + * @param string $message Message to write. + */ + public function info( $message ) { + $this->write( STDOUT, $message . "\n" ); + } + + /** + * Write a success message, prefixed with "Success: ". + * + * @param string $message Message to write. + */ + public function success( $message ) { + $this->_line( $message, 'Success', '%G' ); + } + + /** + * Write a warning message to STDERR, prefixed with "Warning: ". + * + * @param string $message Message to write. + */ + public function warning( $message ) { + $this->_line( $message, 'Warning', '%C', STDERR ); + } + + /** + * Write an message to STDERR, prefixed with "Error: ". + * + * @param string $message Message to write. + */ + public function error( $message ) { + $this->_line( $message, 'Error', '%R', STDERR ); + } + + /** + * Similar to error( $message ), but outputs $message in a red box + * + * @param array $message Message to write. + */ + public function error_multi_line( $message_lines ) { + // convert tabs to four spaces, as some shells will output the tabs as variable-length + $message_lines = array_map( + function( $line ) { + return str_replace( "\t", ' ', $line ); + }, + $message_lines + ); + + $longest = max( array_map( 'strlen', $message_lines ) ); + + // write an empty line before the message + $empty_line = \cli\Colors::colorize( '%w%1 ' . str_repeat( ' ', $longest ) . ' %n' ); + $this->write( STDERR, "\n\t$empty_line\n" ); + + foreach ( $message_lines as $line ) { + $padding = str_repeat( ' ', $longest - strlen( $line ) ); + $line = \cli\Colors::colorize( "%w%1 $line $padding%n" ); + $this->write( STDERR, "\t$line\n" ); + } + + // write an empty line after the message + $this->write( STDERR, "\t$empty_line\n\n" ); + } +} diff --git a/php/WP_CLI/NoOp.php b/php/WP_CLI/NoOp.php new file mode 100644 index 000000000..4ac48c4a3 --- /dev/null +++ b/php/WP_CLI/NoOp.php @@ -0,0 +1,18 @@ + 'pre_install', + PackageEvents::POST_PACKAGE_INSTALL => 'post_install', + ); + } + + public static function pre_install( PackageEvent $event ) { + $operation_message = $event->getOperation()->__toString(); + WP_CLI::log( ' - ' . $operation_message ); + } + + public static function post_install( PackageEvent $event ) { + + $operation = $event->getOperation(); + $reason = $operation->getReason(); + if ( $reason instanceof Rule ) { + + switch ( $reason->getReason() ) { + + case Rule::RULE_PACKAGE_CONFLICT: + case Rule::RULE_PACKAGE_SAME_NAME: + case Rule::RULE_PACKAGE_REQUIRES: + $composer_error = $reason->getPrettyString( $event->getPool() ); + break; + + } + + if ( ! empty( $composer_error ) ) { + WP_CLI::log( sprintf( ' - Warning: %s', $composer_error ) ); + } + } + + } + +} diff --git a/php/WP_CLI/Process.php b/php/WP_CLI/Process.php new file mode 100644 index 000000000..584f679b9 --- /dev/null +++ b/php/WP_CLI/Process.php @@ -0,0 +1,136 @@ + STDIN, + 1 => array( 'pipe', 'w' ), + 2 => array( 'pipe', 'w' ), + ); + + /** + * @var bool Whether to log run time info or not. + */ + public static $log_run_times = false; + + /** + * @var array Array of process run time info, keyed by process command, each a 2-element array containing run time and run count. + */ + public static $run_times = array(); + + /** + * @param string $command Command to execute. + * @param string $cwd Directory to execute the command in. + * @param array $env Environment variables to set when running the command. + * + * @return Process + */ + public static function create( $command, $cwd = null, $env = array() ) { + $proc = new self; + + $proc->command = $command; + $proc->cwd = $cwd; + $proc->env = $env; + + return $proc; + } + + private function __construct() {} + + /** + * Run the command. + * + * @return ProcessRun + */ + public function run() { + $start_time = microtime( true ); + + $proc = Utils\proc_open_compat( $this->command, self::$descriptors, $pipes, $this->cwd, $this->env ); + + $stdout = stream_get_contents( $pipes[1] ); + fclose( $pipes[1] ); + + $stderr = stream_get_contents( $pipes[2] ); + fclose( $pipes[2] ); + + $return_code = proc_close( $proc ); + + $run_time = microtime( true ) - $start_time; + + if ( self::$log_run_times ) { + if ( ! isset( self::$run_times[ $this->command ] ) ) { + self::$run_times[ $this->command ] = array( 0, 0 ); + } + self::$run_times[ $this->command ][0] += $run_time; + self::$run_times[ $this->command ][1]++; + } + + return new ProcessRun( + array( + 'stdout' => $stdout, + 'stderr' => $stderr, + 'return_code' => $return_code, + 'command' => $this->command, + 'cwd' => $this->cwd, + 'env' => $this->env, + 'run_time' => $run_time, + ) + ); + } + + /** + * Run the command, but throw an Exception on error. + * + * @return ProcessRun + */ + public function run_check() { + $r = $this->run(); + + // $r->STDERR is incorrect, but kept incorrect for backwards-compat + if ( $r->return_code || ! empty( $r->STDERR ) ) { + throw new \RuntimeException( $r ); + } + + return $r; + } + + /** + * Run the command, but throw an Exception on error. + * Same as `run_check()` above, but checks the correct stderr. + * + * @return ProcessRun + */ + public function run_check_stderr() { + $r = $this->run(); + + if ( $r->return_code || ! empty( $r->stderr ) ) { + throw new \RuntimeException( $r ); + } + + return $r; + } +} diff --git a/php/WP_CLI/ProcessRun.php b/php/WP_CLI/ProcessRun.php new file mode 100644 index 000000000..96b4c80b6 --- /dev/null +++ b/php/WP_CLI/ProcessRun.php @@ -0,0 +1,68 @@ + $value ) { + $this->$key = $value; + } + } + + /** + * Return properties of executed command as a string. + * + * @return string + */ + public function __toString() { + $out = "$ $this->command\n"; + $out .= "$this->stdout\n$this->stderr"; + $out .= "cwd: $this->cwd\n"; + $out .= "run time: $this->run_time\n"; + $out .= "exit status: $this->return_code"; + + return $out; + } + +} diff --git a/php/WP_CLI/Runner.php b/php/WP_CLI/Runner.php new file mode 100644 index 000000000..a9618fd72 --- /dev/null +++ b/php/WP_CLI/Runner.php @@ -0,0 +1,1725 @@ +$key; + } + + /** + * Register a command for early invocation, generally before WordPress loads. + * + * @param string $when Named execution hook + * @param WP_CLI\Dispatcher\Subcommand $command + */ + public function register_early_invoke( $when, $command ) { + $this->_early_invoke[ $when ][] = array_slice( Dispatcher\get_path( $command ), 1 ); + } + + /** + * Perform the early invocation of a command. + * + * @param string $when Named execution hook + */ + private function do_early_invoke( $when ) { + if ( ! isset( $this->_early_invoke[ $when ] ) ) { + return; + } + + // Search the value of @when from the command method. + $real_when = ''; + $r = $this->find_command_to_run( $this->arguments ); + if ( is_array( $r ) ) { + list( $command, $final_args, $cmd_path ) = $r; + + foreach ( $this->_early_invoke as $_when => $_path ) { + foreach ( $_path as $cmd ) { + if ( $cmd === $cmd_path ) { + $real_when = $_when; + } + } + } + } + + foreach ( $this->_early_invoke[ $when ] as $path ) { + if ( $this->cmd_starts_with( $path ) ) { + if ( empty( $real_when ) || ( $real_when && $real_when === $when ) ) { + $this->_run_command_and_exit(); + } + } + } + } + + /** + * Get the path to the global configuration YAML file. + * + * @return string|false + */ + public function get_global_config_path() { + + if ( getenv( 'WP_CLI_CONFIG_PATH' ) ) { + $config_path = getenv( 'WP_CLI_CONFIG_PATH' ); + $this->_global_config_path_debug = 'Using global config from WP_CLI_CONFIG_PATH env var: ' . $config_path; + } else { + $config_path = Utils\get_home_dir() . '/.wp-cli/config.yml'; + $this->_global_config_path_debug = 'Using default global config: ' . $config_path; + } + + if ( is_readable( $config_path ) ) { + return $config_path; + } + + $this->_global_config_path_debug = 'No readable global config found'; + + return false; + } + + /** + * Get the path to the project-specific configuration + * YAML file. + * wp-cli.local.yml takes priority over wp-cli.yml. + * + * @return string|false + */ + public function get_project_config_path() { + $config_files = array( + 'wp-cli.local.yml', + 'wp-cli.yml', + ); + + // Stop looking upward when we find we have emerged from a subdirectory + // install into a parent install + $project_config_path = Utils\find_file_upward( + $config_files, + getcwd(), + function ( $dir ) { + static $wp_load_count = 0; + $wp_load_path = $dir . DIRECTORY_SEPARATOR . 'wp-load.php'; + if ( file_exists( $wp_load_path ) ) { + ++ $wp_load_count; + } + return $wp_load_count > 1; + } + ); + + $this->_project_config_path_debug = 'No project config found'; + + if ( ! empty( $project_config_path ) ) { + $this->_project_config_path_debug = 'Using project config: ' . $project_config_path; + } + + return $project_config_path; + } + + /** + * Get the path to the packages directory + * + * @return string + */ + public function get_packages_dir_path() { + if ( getenv( 'WP_CLI_PACKAGES_DIR' ) ) { + $packages_dir = Utils\trailingslashit( getenv( 'WP_CLI_PACKAGES_DIR' ) ); + } else { + $packages_dir = Utils\get_home_dir() . '/.wp-cli/packages/'; + } + return $packages_dir; + } + + /** + * Attempts to find the path to the WP install inside index.php + * + * @param string $index_path + * @return string|false + */ + private static function extract_subdir_path( $index_path ) { + $index_code = file_get_contents( $index_path ); + + if ( ! preg_match( '|^\s*require\s*\(?\s*(.+?)/wp-blog-header\.php([\'"])|m', $index_code, $matches ) ) { + return false; + } + + $wp_path_src = $matches[1] . $matches[2]; + $wp_path_src = Utils\replace_path_consts( $wp_path_src, $index_path ); + $wp_path = eval( "return $wp_path_src;" ); + + if ( ! Utils\is_path_absolute( $wp_path ) ) { + $wp_path = dirname( $index_path ) . "/$wp_path"; + } + + return $wp_path; + } + + /** + * Find the directory that contains the WordPress files. + * Defaults to the current working dir. + * + * @return string An absolute path + */ + private function find_wp_root() { + if ( ! empty( $this->config['path'] ) ) { + $path = $this->config['path']; + if ( ! Utils\is_path_absolute( $path ) ) { + $path = getcwd() . '/' . $path; + } + + return $path; + } + + if ( $this->cmd_starts_with( array( 'core', 'download' ) ) ) { + return getcwd(); + } + + $dir = getcwd(); + + while ( is_readable( $dir ) ) { + if ( file_exists( "$dir/wp-load.php" ) ) { + return $dir; + } + + if ( file_exists( "$dir/index.php" ) ) { + if ( $path = self::extract_subdir_path( "$dir/index.php" ) ) { + return $path; + } + } + + $parent_dir = dirname( $dir ); + if ( empty( $parent_dir ) || $parent_dir === $dir ) { + break; + } + $dir = $parent_dir; + } + } + + /** + * Set WordPress root as a given path. + * + * @param string $path + */ + private static function set_wp_root( $path ) { + define( 'ABSPATH', Utils\trailingslashit( $path ) ); + WP_CLI::debug( 'ABSPATH defined: ' . ABSPATH, 'bootstrap' ); + + $_SERVER['DOCUMENT_ROOT'] = realpath( $path ); + } + + /** + * Guess which URL context WP-CLI has been invoked under. + * + * @param array $assoc_args + * @return string|false + */ + private static function guess_url( $assoc_args ) { + if ( isset( $assoc_args['blog'] ) ) { + $assoc_args['url'] = $assoc_args['blog']; + } + + if ( isset( $assoc_args['url'] ) ) { + $url = $assoc_args['url']; + if ( true === $url ) { + WP_CLI::warning( 'The --url parameter expects a value.' ); + } + } + + if ( isset( $url ) ) { + return $url; + } + + return false; + } + + private function cmd_starts_with( $prefix ) { + return array_slice( $this->arguments, 0, count( $prefix ) ) === $prefix; + } + + /** + * Given positional arguments, find the command to execute. + * + * @param array $args + * @return array|string Command, args, and path on success; error message on failure + */ + public function find_command_to_run( $args ) { + $command = \WP_CLI::get_root_command(); + + WP_CLI::do_hook( 'find_command_to_run_pre' ); + + $cmd_path = array(); + + while ( ! empty( $args ) && $command->can_have_subcommands() ) { + $cmd_path[] = $args[0]; + $full_name = implode( ' ', $cmd_path ); + + $subcommand = $command->find_subcommand( $args ); + + if ( ! $subcommand ) { + if ( count( $cmd_path ) > 1 ) { + $child = array_pop( $cmd_path ); + $parent_name = implode( ' ', $cmd_path ); + $suggestion = $this->get_subcommand_suggestion( $child, $command ); + return sprintf( + "'%s' is not a registered subcommand of '%s'. See 'wp help %s' for available subcommands.%s", + $child, + $parent_name, + $parent_name, + ! empty( $suggestion ) ? PHP_EOL . "Did you mean '{$suggestion}'?" : '' + ); + } + + $suggestion = $this->get_subcommand_suggestion( $full_name, $command ); + + return sprintf( + "'%s' is not a registered wp command. See 'wp help' for available commands.%s", + $full_name, + ! empty( $suggestion ) ? PHP_EOL . "Did you mean '{$suggestion}'?" : '' + ); + } + + if ( $this->is_command_disabled( $subcommand ) ) { + return sprintf( + "The '%s' command has been disabled from the config file.", + $full_name + ); + } + + $command = $subcommand; + } + + return array( $command, $args, $cmd_path ); + } + + /** + * Find the WP-CLI command to run given arguments, and invoke it. + * + * @param array $args Positional arguments including command name + * @param array $assoc_args Associative arguments for the command. + * @param array $options Configuration options for the function. + */ + public function run_command( $args, $assoc_args = array(), $options = array() ) { + if ( ! empty( $options['back_compat_conversions'] ) ) { + list( $args, $assoc_args ) = self::back_compat_conversions( $args, $assoc_args ); + } + $r = $this->find_command_to_run( $args ); + if ( is_string( $r ) ) { + WP_CLI::error( $r ); + } + + list( $command, $final_args, $cmd_path ) = $r; + + $name = implode( ' ', $cmd_path ); + + $extra_args = array(); + + if ( isset( $this->extra_config[ $name ] ) ) { + $extra_args = $this->extra_config[ $name ]; + } + + WP_CLI::debug( 'Running command: ' . $name, 'bootstrap' ); + try { + $command->invoke( $final_args, $assoc_args, $extra_args ); + } catch ( WP_CLI\Iterators\Exception $e ) { + WP_CLI::error( $e->getMessage() ); + } + } + + /** + * Show synopsis if the called command is a composite command + */ + public function show_synopsis_if_composite_command() { + $r = $this->find_command_to_run( $this->arguments ); + if ( is_array( $r ) ) { + list( $command ) = $r; + + if ( $command->can_have_subcommands() ) { + $command->show_usage(); + exit; + } + } + } + + private function _run_command_and_exit( $help_exit_warning = '' ) { + $this->show_synopsis_if_composite_command(); + $this->run_command( $this->arguments, $this->assoc_args ); + if ( $this->cmd_starts_with( array( 'help' ) ) ) { + // Help couldn't find the command so exit with suggestion. + $suggestion_or_disabled = $this->find_command_to_run( array_slice( $this->arguments, 1 ) ); + if ( is_string( $suggestion_or_disabled ) ) { + if ( $help_exit_warning ) { + WP_CLI::warning( $help_exit_warning ); + } + WP_CLI::error( $suggestion_or_disabled ); + } + // Should never get here. + } + exit; + } + + /** + * Perform a command against a remote server over SSH (or a container using + * scheme of "docker" or "docker-compose"). + * + * @param string $connection_string Passed connection string. + * @return void + */ + private function run_ssh_command( $connection_string ) { + + WP_CLI::do_hook( 'before_ssh' ); + + $bits = Utils\parse_ssh_url( $connection_string ); + + $pre_cmd = getenv( 'WP_CLI_SSH_PRE_CMD' ); + if ( $pre_cmd ) { + $pre_cmd = rtrim( $pre_cmd, ';' ) . '; '; + } + if ( ! empty( $bits['path'] ) ) { + $pre_cmd .= 'cd ' . escapeshellarg( $bits['path'] ) . '; '; + } + + $env_vars = ''; + if ( getenv( 'WP_CLI_STRICT_ARGS_MODE' ) ) { + $env_vars .= 'WP_CLI_STRICT_ARGS_MODE=1 '; + } + + $wp_binary = 'wp'; + $wp_args = array_slice( $GLOBALS['argv'], 1 ); + + if ( $this->alias && ! empty( $wp_args[0] ) && $this->alias === $wp_args[0] ) { + array_shift( $wp_args ); + $runtime_alias = array(); + foreach ( $this->aliases[ $this->alias ] as $key => $value ) { + if ( 'ssh' === $key ) { + continue; + } + $runtime_alias[ $key ] = $value; + } + if ( ! empty( $runtime_alias ) ) { + $encoded_alias = json_encode( + array( + $this->alias => $runtime_alias, + ) + ); + $wp_binary = "WP_CLI_RUNTIME_ALIAS='{$encoded_alias}' {$wp_binary} {$this->alias}"; + } + } + + foreach ( $wp_args as $k => $v ) { + if ( preg_match( '#--ssh=#', $v ) ) { + unset( $wp_args[ $k ] ); + } + } + + $wp_command = $pre_cmd . $env_vars . $wp_binary . ' ' . implode( ' ', array_map( 'escapeshellarg', $wp_args ) ); + $escaped_command = $this->generate_ssh_command( $bits, $wp_command ); + + passthru( $escaped_command, $exit_code ); + if ( 255 === $exit_code ) { + WP_CLI::error( 'Cannot connect over SSH using provided configuration.', 255 ); + } else { + exit( $exit_code ); + } + } + + /** + * Generate a shell command from the parsed connection string. + * + * @param array $bits Parsed connection string. + * @param string $wp_command WP-CLI command to run. + * @return string + */ + private function generate_ssh_command( $bits, $wp_command ) { + $escaped_command = ''; + + // Set default values. + foreach ( array( 'scheme', 'user', 'host', 'port', 'path' ) as $bit ) { + if ( ! isset( $bits[ $bit ] ) ) { + $bits[ $bit ] = null; + } + + WP_CLI::debug( 'SSH ' . $bit . ': ' . $bits[ $bit ], 'bootstrap' ); + } + + $is_tty = function_exists( 'posix_isatty' ) && posix_isatty( STDOUT ); + + if ( 'docker' === $bits['scheme'] ) { + $command = 'docker exec %s%s%s sh -c %s'; + + $escaped_command = sprintf( + $command, + $bits['user'] ? '--user ' . escapeshellarg( $bits['user'] ) . ' ' : '', + $is_tty ? '-t ' : '', + escapeshellarg( $bits['host'] ), + escapeshellarg( $wp_command ) + ); + } + + if ( 'docker-compose' === $bits['scheme'] ) { + $command = 'docker-compose exec %s%s%s sh -c %s'; + + $escaped_command = sprintf( + $command, + $bits['user'] ? '--user ' . escapeshellarg( $bits['user'] ) . ' ' : '', + $is_tty ? '' : '-T ', + escapeshellarg( $bits['host'] ), + escapeshellarg( $wp_command ) + ); + } + + // Vagrant ssh-config. + if ( 'vagrant' === $bits['scheme'] ) { + $command = 'vagrant ssh -c %s %s'; + + $escaped_command = sprintf( + $command, + escapeshellarg( $wp_command ), + escapeshellarg( $bits['host'] ) + ); + } + + // Default scheme is SSH. + if ( 'ssh' === $bits['scheme'] || null === $bits['scheme'] ) { + $command = 'ssh -q %s%s %s %s'; + + if ( $bits['user'] ) { + $bits['host'] = $bits['user'] . '@' . $bits['host']; + } + + $escaped_command = sprintf( + $command, + $bits['port'] ? '-p ' . (int) $bits['port'] . ' ' : '', + escapeshellarg( $bits['host'] ), + $is_tty ? '-t' : '-T', + escapeshellarg( $wp_command ) + ); + } + + WP_CLI::debug( 'Running SSH command: ' . $escaped_command, 'bootstrap' ); + + return $escaped_command; + } + + /** + * Check whether a given command is disabled by the config + * + * @return bool + */ + public function is_command_disabled( $command ) { + $path = implode( ' ', array_slice( \WP_CLI\Dispatcher\get_path( $command ), 1 ) ); + return in_array( $path, $this->config['disabled_commands'] ); + } + + /** + * Returns wp-config.php code, skipping the loading of wp-settings.php + * + * @return string + */ + public function get_wp_config_code() { + $wp_config_path = Utils\locate_wp_config(); + + $wp_config_code = explode( "\n", file_get_contents( $wp_config_path ) ); + + $found_wp_settings = false; + + $lines_to_run = array(); + + foreach ( $wp_config_code as $line ) { + if ( preg_match( '/^\s*require.+wp-settings\.php/', $line ) ) { + $found_wp_settings = true; + continue; + } + + $lines_to_run[] = $line; + } + + if ( ! $found_wp_settings ) { + WP_CLI::error( 'Strange wp-config.php file: wp-settings.php is not loaded directly.' ); + } + + $source = implode( "\n", $lines_to_run ); + $source = Utils\replace_path_consts( $source, $wp_config_path ); + return preg_replace( '|^\s*\<\?php\s*|', '', $source ); + } + + /** + * Transparently convert deprecated syntaxes + * + * @param array $args + * @param array $assoc_args + * @return array + */ + private static function back_compat_conversions( $args, $assoc_args ) { + $top_level_aliases = array( + 'sql' => 'db', + 'blog' => 'site', + ); + if ( count( $args ) > 0 ) { + foreach ( $top_level_aliases as $old => $new ) { + if ( $old == $args[0] ) { + $args[0] = $new; + break; + } + } + } + + // *-meta -> * meta + if ( ! empty( $args ) && preg_match( '/(post|comment|user|network)-meta/', $args[0], $matches ) ) { + array_shift( $args ); + array_unshift( $args, 'meta' ); + array_unshift( $args, $matches[1] ); + } + + // core (multsite-)install --admin_name= -> --admin_user= + if ( count( $args ) > 0 && 'core' == $args[0] && isset( $assoc_args['admin_name'] ) ) { + $assoc_args['admin_user'] = $assoc_args['admin_name']; + unset( $assoc_args['admin_name'] ); + } + + // core config -> config create + if ( array( 'core', 'config' ) == array_slice( $args, 0, 2 ) ) { + list( $args[0], $args[1] ) = array( 'config', 'create' ); + } + // core language -> language core + if ( array( 'core', 'language' ) == array_slice( $args, 0, 2 ) ) { + list( $args[0], $args[1] ) = array( 'language', 'core' ); + } + + // checksum core -> core verify-checksums + if ( array( 'checksum', 'core' ) == array_slice( $args, 0, 2 ) ) { + list( $args[0], $args[1] ) = array( 'core', 'verify-checksums' ); + } + + // checksum plugin -> plugin verify-checksums + if ( array( 'checksum', 'plugin' ) == array_slice( $args, 0, 2 ) ) { + list( $args[0], $args[1] ) = array( 'plugin', 'verify-checksums' ); + } + + // site create --site_id= -> site create --network_id= + if ( count( $args ) >= 2 && 'site' === $args[0] && 'create' === $args[1] && isset( $assoc_args['site_id'] ) ) { + $assoc_args['network_id'] = $assoc_args['site_id']; + unset( $assoc_args['site_id'] ); + } + + // {plugin|theme} update-all -> {plugin|theme} update --all + if ( count( $args ) > 1 && in_array( $args[0], array( 'plugin', 'theme' ) ) + && 'update-all' === $args[1] + ) { + $args[1] = 'update'; + $assoc_args['all'] = true; + } + + // transient delete-expired -> transient delete --expired + if ( count( $args ) > 1 && 'transient' === $args[0] && 'delete-expired' === $args[1] ) { + $args[1] = 'delete'; + $assoc_args['expired'] = true; + } + + // transient delete-all -> transient delete --all + if ( count( $args ) > 1 && 'transient' === $args[0] && 'delete-all' === $args[1] ) { + $args[1] = 'delete'; + $assoc_args['all'] = true; + } + + // plugin scaffold -> scaffold plugin + if ( array( 'plugin', 'scaffold' ) == array_slice( $args, 0, 2 ) ) { + list( $args[0], $args[1] ) = array( $args[1], $args[0] ); + } + + // foo --help -> help foo + if ( isset( $assoc_args['help'] ) ) { + array_unshift( $args, 'help' ); + unset( $assoc_args['help'] ); + } + + // {post|user} list --ids -> {post|user} list --format=ids + if ( count( $args ) > 1 && in_array( $args[0], array( 'post', 'user' ) ) + && 'list' === $args[1] + && isset( $assoc_args['ids'] ) + ) { + $assoc_args['format'] = 'ids'; + unset( $assoc_args['ids'] ); + } + + // --json -> --format=json + if ( isset( $assoc_args['json'] ) ) { + $assoc_args['format'] = 'json'; + unset( $assoc_args['json'] ); + } + + // --{version|info} -> cli {version|info} + if ( empty( $args ) ) { + $special_flags = array( 'version', 'info' ); + foreach ( $special_flags as $key ) { + if ( isset( $assoc_args[ $key ] ) ) { + $args = array( 'cli', $key ); + unset( $assoc_args[ $key ] ); + break; + } + } + } + + // (post|comment|site|term) url --> (post|comment|site|term) list --*__in --field=url + if ( count( $args ) >= 2 && in_array( $args[0], array( 'post', 'comment', 'site', 'term' ) ) && 'url' === $args[1] ) { + switch ( $args[0] ) { + case 'post': + $post_ids = array_slice( $args, 2 ); + $args = array( 'post', 'list' ); + $assoc_args['post__in'] = implode( ',', $post_ids ); + $assoc_args['post_type'] = 'any'; + $assoc_args['orderby'] = 'post__in'; + $assoc_args['field'] = 'url'; + break; + case 'comment': + $comment_ids = array_slice( $args, 2 ); + $args = array( 'comment', 'list' ); + $assoc_args['comment__in'] = implode( ',', $comment_ids ); + $assoc_args['orderby'] = 'comment__in'; + $assoc_args['field'] = 'url'; + break; + case 'site': + $site_ids = array_slice( $args, 2 ); + $args = array( 'site', 'list' ); + $assoc_args['site__in'] = implode( ',', $site_ids ); + $assoc_args['field'] = 'url'; + break; + case 'term': + $taxonomy = ''; + if ( isset( $args[2] ) ) { + $taxonomy = $args[2]; + } + $term_ids = array_slice( $args, 3 ); + $args = array( 'term', 'list', $taxonomy ); + $assoc_args['include'] = implode( ',', $term_ids ); + $assoc_args['orderby'] = 'include'; + $assoc_args['field'] = 'url'; + break; + } + } + + // config get --[global|constant]= --> config get --type=constant|variable + // config get --> config list + if ( count( $args ) === 2 + && 'config' === $args[0] + && 'get' === $args[1] ) { + if ( isset( $assoc_args['global'] ) ) { + $name = $assoc_args['global']; + $type = 'variable'; + unset( $assoc_args['global'] ); + } elseif ( isset( $assoc_args['constant'] ) ) { + $name = $assoc_args['constant']; + $type = 'constant'; + unset( $assoc_args['constant'] ); + } + if ( ! empty( $name ) && ! empty( $type ) ) { + $args[] = $name; + $assoc_args['type'] = $type; + } else { + // We had a 'config get' without a '', so assume 'list' was wanted. + $args[1] = 'list'; + } + } + + return array( $args, $assoc_args ); + } + + /** + * Whether or not the output should be rendered in color + * + * @return bool + */ + public function in_color() { + return $this->colorize; + } + + public function init_colorization() { + if ( 'auto' === $this->config['color'] ) { + $this->colorize = ( ! \WP_CLI\Utils\isPiped() && ! \WP_CLI\Utils\is_windows() ); + } else { + $this->colorize = $this->config['color']; + } + } + + public function init_logger() { + if ( $this->config['quiet'] ) { + $logger = new \WP_CLI\Loggers\Quiet; + } else { + $logger = new \WP_CLI\Loggers\Regular( $this->in_color() ); + } + + WP_CLI::set_logger( $logger ); + } + + public function get_required_files() { + return $this->_required_files; + } + + /** + * Do WordPress core files exist? + * + * @return bool + */ + private function wp_exists() { + return file_exists( ABSPATH . 'wp-includes/version.php' ); + } + + /** + * Are WordPress core files readable? + * + * @return bool + */ + private function wp_is_readable() { + return is_readable( ABSPATH . 'wp-includes/version.php' ); + } + + private function check_wp_version() { + $wp_exists = $this->wp_exists(); + $wp_is_readable = $this->wp_is_readable(); + if ( ! $wp_exists || ! $wp_is_readable ) { + $this->show_synopsis_if_composite_command(); + // If the command doesn't exist use as error. + $args = $this->cmd_starts_with( array( 'help' ) ) ? array_slice( $this->arguments, 1 ) : $this->arguments; + $suggestion_or_disabled = $this->find_command_to_run( $args ); + if ( is_string( $suggestion_or_disabled ) ) { + if ( ! preg_match( '/disabled from the config file.$/', $suggestion_or_disabled ) ) { + WP_CLI::warning( "No WordPress install found. If the command '" . implode( ' ', $args ) . "' is in a plugin or theme, pass --path=`path/to/wordpress`." ); + } + WP_CLI::error( $suggestion_or_disabled ); + } + + if ( $wp_exists && ! $wp_is_readable ) { + WP_CLI::error( + 'It seems, the WordPress core files do not have the proper file permissions.' + ); + } + WP_CLI::error( + "This does not seem to be a WordPress install.\n" . + 'Pass --path=`path/to/wordpress` or run `wp core download`.' + ); + } + + global $wp_version; + include ABSPATH . 'wp-includes/version.php'; + + $minimum_version = '3.7'; + + // @codingStandardsIgnoreStart + if ( version_compare( $wp_version, $minimum_version, '<' ) ) { + WP_CLI::error( + "WP-CLI needs WordPress $minimum_version or later to work properly. " . + "The version currently installed is $wp_version.\n" . + 'Try running `wp core download --force`.' + ); + } + // @codingStandardsIgnoreEnd + } + + public function init_config() { + $configurator = \WP_CLI::get_configurator(); + + $argv = array_slice( $GLOBALS['argv'], 1 ); + + $this->alias = null; + if ( ! empty( $argv[0] ) && preg_match( '#' . Configurator::ALIAS_REGEX . '#', $argv[0], $matches ) ) { + $this->alias = array_shift( $argv ); + } + + // File config + { + $this->global_config_path = $this->get_global_config_path(); + $this->project_config_path = $this->get_project_config_path(); + + $configurator->merge_yml( $this->global_config_path, $this->alias ); + $config = $configurator->to_array(); + $this->_required_files['global'] = $config[0]['require']; + $configurator->merge_yml( $this->project_config_path, $this->alias ); + $config = $configurator->to_array(); + $this->_required_files['project'] = $config[0]['require']; + } + + // Runtime config and args + { + list( $args, $assoc_args, $this->runtime_config ) = $configurator->parse_args( $argv ); + + list( $this->arguments, $this->assoc_args ) = self::back_compat_conversions( + $args, $assoc_args + ); + + $configurator->merge_array( $this->runtime_config ); + } + + list( $this->config, $this->extra_config ) = $configurator->to_array(); + $this->aliases = $configurator->get_aliases(); + if ( count( $this->aliases ) && ! isset( $this->aliases['@all'] ) ) { + $this->aliases = array_reverse( $this->aliases ); + $this->aliases['@all'] = 'Run command against every registered alias.'; + $this->aliases = array_reverse( $this->aliases ); + } + $this->_required_files['runtime'] = $this->config['require']; + } + + private function check_root() { + if ( $this->config['allow-root'] ) { + return; # they're aware of the risks! + } + if ( count( $this->arguments ) >= 2 && 'cli' === $this->arguments[0] && in_array( $this->arguments[1], array( 'update', 'info' ), true ) ) { + return; # make it easier to update root-owned copies + } + if ( ! function_exists( 'posix_geteuid' ) ) { + return; # posix functions not available + } + if ( posix_geteuid() !== 0 ) { + return; # not root + } + + WP_CLI::error( + "YIKES! It looks like you're running this as root. You probably meant to " . + "run this as the user that your WordPress install exists under.\n" . + "\n" . + "If you REALLY mean to run this as root, we won't stop you, but just " . + 'bear in mind that any code on this site will then have full control of ' . + "your server, making it quite DANGEROUS.\n" . + "\n" . + "If you'd like to continue as root, please run this again, adding this " . + "flag: --allow-root\n" . + "\n" . + "If you'd like to run it as the user that this site is under, you can " . + "run the following to become the respective user:\n" . + "\n" . + " sudo -u USER -i -- wp \n" . + "\n" + ); + } + + private function run_alias_group( $aliases ) { + Utils\check_proc_available( 'group alias' ); + + $php_bin = escapeshellarg( Utils\get_php_binary() ); + + $script_path = $GLOBALS['argv'][0]; + + if ( getenv( 'WP_CLI_CONFIG_PATH' ) ) { + $config_path = getenv( 'WP_CLI_CONFIG_PATH' ); + } else { + $config_path = Utils\get_home_dir() . '/.wp-cli/config.yml'; + } + $config_path = escapeshellarg( $config_path ); + + foreach ( $aliases as $alias ) { + WP_CLI::log( $alias ); + $args = implode( ' ', array_map( 'escapeshellarg', $this->arguments ) ); + $assoc_args = Utils\assoc_args_to_str( $this->assoc_args ); + $runtime_config = Utils\assoc_args_to_str( $this->runtime_config ); + $full_command = "WP_CLI_CONFIG_PATH={$config_path} {$php_bin} {$script_path} {$alias} {$args}{$assoc_args}{$runtime_config}"; + $proc = Utils\proc_open_compat( $full_command, array( STDIN, STDOUT, STDERR ), $pipes ); + proc_close( $proc ); + } + } + + private function set_alias( $alias ) { + $orig_config = $this->config; + $alias_config = $this->aliases[ $this->alias ]; + $this->config = array_merge( $orig_config, $alias_config ); + foreach ( $alias_config as $key => $_ ) { + if ( isset( $orig_config[ $key ] ) && ! is_null( $orig_config[ $key ] ) ) { + $this->assoc_args[ $key ] = $orig_config[ $key ]; + } + } + } + + public function start() { + + // Enable PHP error reporting to stderr if testing. Will need to be re-enabled after WP loads. + if ( getenv( 'BEHAT_RUN' ) ) { + $this->enable_error_reporting(); + } + + WP_CLI::debug( $this->_global_config_path_debug, 'bootstrap' ); + WP_CLI::debug( $this->_project_config_path_debug, 'bootstrap' ); + WP_CLI::debug( 'argv: ' . implode( ' ', $GLOBALS['argv'] ), 'bootstrap' ); + + $this->check_root(); + if ( $this->alias ) { + if ( '@all' === $this->alias && ! isset( $this->aliases['@all'] ) ) { + WP_CLI::error( "Cannot use '@all' when no aliases are registered." ); + } + + if ( '@all' === $this->alias && is_string( $this->aliases['@all'] ) ) { + $aliases = array_keys( $this->aliases ); + $k = array_search( '@all', $aliases ); + unset( $aliases[ $k ] ); + $this->run_alias_group( $aliases ); + exit; + } + + if ( ! array_key_exists( $this->alias, $this->aliases ) ) { + $error_msg = "Alias '{$this->alias}' not found."; + $suggestion = Utils\get_suggestion( $this->alias, array_keys( $this->aliases ), $threshold = 2 ); + if ( $suggestion ) { + $error_msg .= PHP_EOL . "Did you mean '{$suggestion}'?"; + } + WP_CLI::error( $error_msg ); + } + // Numerically indexed means a group of aliases + if ( isset( $this->aliases[ $this->alias ][0] ) ) { + $group_aliases = $this->aliases[ $this->alias ]; + $all_aliases = array_keys( $this->aliases ); + if ( $diff = array_diff( $group_aliases, $all_aliases ) ) { + WP_CLI::error( "Group '{$this->alias}' contains one or more invalid aliases: " . implode( ', ', $diff ) ); + } + $this->run_alias_group( $group_aliases ); + exit; + } + + $this->set_alias( $this->alias ); + } + + if ( empty( $this->arguments ) ) { + $this->arguments[] = 'help'; + } + + // Protect 'cli info' from most of the runtime, + // except when the command will be run over SSH + if ( 'cli' === $this->arguments[0] && ! empty( $this->arguments[1] ) && 'info' === $this->arguments[1] && ! $this->config['ssh'] ) { + $this->_run_command_and_exit(); + } + + if ( isset( $this->config['http'] ) && ! class_exists( '\WP_REST_CLI\Runner' ) ) { + WP_CLI::error( "RESTful WP-CLI needs to be installed. Try 'wp package install wp-cli/restful'." ); + } + + if ( $this->config['ssh'] ) { + $this->run_ssh_command( $this->config['ssh'] ); + return; + } + + // Handle --path parameter + self::set_wp_root( $this->find_wp_root() ); + + // First try at showing man page - if help command and either haven't found 'version.php' or 'wp-config.php' (so won't be loading WP & adding commands) or help on subcommand. + if ( $this->cmd_starts_with( array( 'help' ) ) + && ( ! $this->wp_exists() + || ! Utils\locate_wp_config() + || count( $this->arguments ) > 2 + ) ) { + $this->auto_check_update(); + $this->run_command( $this->arguments, $this->assoc_args ); + // Help didn't exit so failed to find the command at this stage. + } + + // Handle --url parameter + $url = self::guess_url( $this->config ); + if ( $url ) { + \WP_CLI::set_url( $url ); + } + + $this->do_early_invoke( 'before_wp_load' ); + + $this->check_wp_version(); + + if ( $this->cmd_starts_with( array( 'config', 'create' ) ) ) { + $this->_run_command_and_exit(); + } + + if ( ! Utils\locate_wp_config() ) { + WP_CLI::error( + "'wp-config.php' not found.\n" . + 'Either create one manually or use `wp config create`.' + ); + } + + if ( $this->cmd_starts_with( array( 'core', 'is-installed' ) ) + || $this->cmd_starts_with( array( 'core', 'update-db' ) ) ) { + define( 'WP_INSTALLING', true ); + } + + if ( + count( $this->arguments ) >= 2 && + 'core' === $this->arguments[0] && + in_array( $this->arguments[1], array( 'install', 'multisite-install' ) ) + ) { + define( 'WP_INSTALLING', true ); + + // We really need a URL here + if ( ! isset( $_SERVER['HTTP_HOST'] ) ) { + $url = 'http://example.com'; + \WP_CLI::set_url( $url ); + } + + if ( 'multisite-install' == $this->arguments[1] ) { + // need to fake some globals to skip the checks in wp-includes/ms-settings.php + $url_parts = Utils\parse_url( $url ); + self::fake_current_site_blog( $url_parts ); + + if ( ! defined( 'COOKIEHASH' ) ) { + define( 'COOKIEHASH', md5( $url_parts['host'] ) ); + } + } + } + + if ( $this->cmd_starts_with( array( 'import' ) ) ) { + define( 'WP_LOAD_IMPORTERS', true ); + define( 'WP_IMPORTING', true ); + } + + if ( $this->cmd_starts_with( array( 'cron', 'event', 'run' ) ) ) { + define( 'DOING_CRON', true ); + } + + $this->load_wordpress(); + + $this->_run_command_and_exit(); + + } + + /** + * Load WordPress, if it hasn't already been loaded + */ + public function load_wordpress() { + static $wp_cli_is_loaded; + // Globals not explicitly globalized in WordPress + global $site_id, $wpdb, $public, $current_site, $current_blog, $path, $shortcode_tags; + + if ( ! empty( $wp_cli_is_loaded ) ) { + return; + } + + $wp_cli_is_loaded = true; + + WP_CLI::debug( 'Begin WordPress load', 'bootstrap' ); + WP_CLI::do_hook( 'before_wp_load' ); + + $this->check_wp_version(); + + $wp_config_path = Utils\locate_wp_config(); + if ( ! $wp_config_path ) { + WP_CLI::error( + "'wp-config.php' not found.\n" . + 'Either create one manually or use `wp config create`.' + ); + } + + WP_CLI::debug( 'wp-config.php path: ' . $wp_config_path, 'bootstrap' ); + WP_CLI::do_hook( 'before_wp_config_load' ); + + // Load wp-config.php code, in the global scope + $wp_cli_original_defined_vars = get_defined_vars(); + eval( $this->get_wp_config_code() ); + foreach ( get_defined_vars() as $key => $var ) { + if ( array_key_exists( $key, $wp_cli_original_defined_vars ) || 'wp_cli_original_defined_vars' === $key ) { + continue; + } + global ${$key}; + ${$key} = $var; + } + + $this->maybe_update_url_from_domain_constant(); + WP_CLI::do_hook( 'after_wp_config_load' ); + $this->do_early_invoke( 'after_wp_config_load' ); + + // Prevent error notice from wp_guess_url() when core isn't installed + if ( $this->cmd_starts_with( array( 'core', 'is-installed' ) ) + && ! defined( 'COOKIEHASH' ) ) { + define( 'COOKIEHASH', md5( 'wp-cli' ) ); + } + + // Load WP-CLI utilities + require WP_CLI_ROOT . '/php/utils-wp.php'; + + // Set up WordPress bootstrap actions and filters + $this->setup_bootstrap_hooks(); + + // Load Core, mu-plugins, plugins, themes etc. + if ( Utils\wp_version_compare( '4.6-alpha-37575', '>=' ) ) { + if ( $this->cmd_starts_with( array( 'help' ) ) ) { + // Hack: define `WP_DEBUG` and `WP_DEBUG_DISPLAY` to get `wpdb::bail()` to `wp_die()`. + if ( ! defined( 'WP_DEBUG' ) ) { + define( 'WP_DEBUG', true ); + } + if ( ! defined( 'WP_DEBUG_DISPLAY' ) ) { + define( 'WP_DEBUG_DISPLAY', true ); + } + } + require ABSPATH . 'wp-settings.php'; + } else { + require WP_CLI_ROOT . '/php/wp-settings-cli.php'; + } + + // Fix memory limit. See http://core.trac.wordpress.org/ticket/14889 + ini_set( 'memory_limit', -1 ); + + // Load all the admin APIs, for convenience + require ABSPATH . 'wp-admin/includes/admin.php'; + + add_filter( + 'filesystem_method', + function() { + return 'direct'; + }, + 99 + ); + + // Re-enable PHP error reporting to stderr if testing. + if ( getenv( 'BEHAT_RUN' ) ) { + $this->enable_error_reporting(); + } + + WP_CLI::debug( 'Loaded WordPress', 'bootstrap' ); + WP_CLI::do_hook( 'after_wp_load' ); + + } + + private static function fake_current_site_blog( $url_parts ) { + global $current_site, $current_blog; + + if ( ! isset( $url_parts['path'] ) ) { + $url_parts['path'] = '/'; + } + + $current_site = (object) array( + 'id' => 1, + 'blog_id' => 1, + 'domain' => $url_parts['host'], + 'path' => $url_parts['path'], + 'cookie_domain' => $url_parts['host'], + 'site_name' => 'Fake Site', + ); + + $current_blog = (object) array( + 'blog_id' => 1, + 'site_id' => 1, + 'domain' => $url_parts['host'], + 'path' => $url_parts['path'], + 'public' => '1', + 'archived' => '0', + 'mature' => '0', + 'spam' => '0', + 'deleted' => '0', + 'lang_id' => '0', + ); + } + + /** + * Called after wp-config.php is eval'd, to potentially reset `--url` + */ + private function maybe_update_url_from_domain_constant() { + if ( ! empty( $this->config['url'] ) || ! empty( $this->config['blog'] ) ) { + return; + } + + if ( defined( 'DOMAIN_CURRENT_SITE' ) ) { + $url = DOMAIN_CURRENT_SITE; + if ( defined( 'PATH_CURRENT_SITE' ) ) { + $url .= PATH_CURRENT_SITE; + } + \WP_CLI::set_url( $url ); + } + } + + /** + * Set up hooks meant to run during the WordPress bootstrap process + */ + private function setup_bootstrap_hooks() { + + if ( $this->config['skip-plugins'] ) { + $this->setup_skip_plugins_filters(); + } + + if ( $this->config['skip-themes'] ) { + WP_CLI::add_wp_hook( 'setup_theme', array( $this, 'action_setup_theme_wp_cli_skip_themes' ), 999 ); + } + + if ( $this->cmd_starts_with( array( 'help' ) ) ) { + // Try to trap errors on help. + $help_handler = array( $this, 'help_wp_die_handler' ); // Avoid any cross PHP version issues by not using $this in anon function. + WP_CLI::add_wp_hook( + 'wp_die_handler', + function () use ( $help_handler ) { + return $help_handler; + } + ); + } else { + WP_CLI::add_wp_hook( + 'wp_die_handler', + function() { + return '\WP_CLI\Utils\wp_die_handler'; + } + ); + } + + // Prevent code from performing a redirect + WP_CLI::add_wp_hook( 'wp_redirect', 'WP_CLI\\Utils\\wp_redirect_handler' ); + + WP_CLI::add_wp_hook( + 'nocache_headers', + function( $headers ) { + // WordPress might be calling nocache_headers() because of a dead db + global $wpdb; + if ( ! empty( $wpdb->error ) ) { + Utils\wp_die_handler( $wpdb->error ); + } + // Otherwise, WP might be calling nocache_headers() because WP isn't installed + Utils\wp_not_installed(); + return $headers; + } + ); + + // ALTERNATE_WP_CRON might trigger a redirect, which we can't handle + if ( defined( 'ALTERNATE_WP_CRON' ) && ALTERNATE_WP_CRON ) { + WP_CLI::add_wp_hook( + 'muplugins_loaded', + function() { + remove_action( 'init', 'wp_cron' ); + } + ); + } + + // Get rid of warnings when converting single site to multisite + if ( defined( 'WP_INSTALLING' ) && $this->is_multisite() ) { + $values = array( + 'ms_files_rewriting' => null, + 'active_sitewide_plugins' => array(), + '_site_transient_update_core' => null, + '_site_transient_update_themes' => null, + '_site_transient_update_plugins' => null, + 'WPLANG' => '', + ); + foreach ( $values as $key => $value ) { + WP_CLI::add_wp_hook( + "pre_site_option_$key", + function () use ( $values, $key ) { + return $values[ $key ]; + } + ); + } + } + + // Always permit operations against sites, regardless of status + WP_CLI::add_wp_hook( 'ms_site_check', '__return_true' ); + + // Always permit operations against WordPress, regardless of maintenance mode + WP_CLI::add_wp_hook( + 'enable_maintenance_mode', + function() { + return false; + } + ); + + // Use our own debug mode handling instead of WP core + WP_CLI::add_wp_hook( + 'enable_wp_debug_mode_checks', + function( $ret ) { + Utils\wp_debug_mode(); + return false; + } + ); + + // Never load advanced-cache.php drop-in when WP-CLI is operating + WP_CLI::add_wp_hook( + 'enable_loading_advanced_cache_dropin', + function() { + return false; + } + ); + + // In a multisite install, die if unable to find site given in --url parameter + if ( $this->is_multisite() ) { + $run_on_site_not_found = false; + if ( $this->cmd_starts_with( array( 'cache', 'flush' ) ) ) { + $run_on_site_not_found = 'cache flush'; + } + if ( $this->cmd_starts_with( array( 'search-replace' ) ) ) { + // Table-specified + // Bits: search-replace [...] + // Or not against a specific blog + if ( count( $this->arguments ) > 3 + || ! empty( $this->assoc_args['network'] ) + || ! empty( $this->assoc_args['all-tables'] ) + || ! empty( $this->assoc_args['all-tables-with-prefix'] ) ) { + $run_on_site_not_found = 'search-replace'; + } + } + if ( $run_on_site_not_found + && Utils\wp_version_compare( '4.0', '>=' ) ) { + WP_CLI::add_wp_hook( + 'ms_site_not_found', + function() use ( $run_on_site_not_found ) { + // esc_sql() isn't yet loaded, but needed. + if ( 'search-replace' === $run_on_site_not_found ) { + require_once ABSPATH . WPINC . '/formatting.php'; + } + // PHP 5.3 compatible implementation of _run_command_and_exit(). + $runner = WP_CLI::get_runner(); + $runner->run_command( $runner->arguments, $runner->assoc_args ); + exit; + }, + 1 + ); + } + WP_CLI::add_wp_hook( + 'ms_site_not_found', + function( $current_site, $domain, $path ) { + $url = $domain . $path; + $message = $url ? "Site '{$url}' not found." : 'Site not found.'; + $has_param = isset( WP_CLI::get_runner()->config['url'] ); + $has_const = defined( 'DOMAIN_CURRENT_SITE' ); + $explanation = ''; + if ( $has_param ) { + $explanation = 'Verify `--url=` matches an existing site.'; + } else { + $explanation = "Define DOMAIN_CURRENT_SITE in 'wp-config.php' or use `--url=` to override."; + + if ( $has_const ) { + $explanation = 'Verify DOMAIN_CURRENT_SITE matches an existing site or use `--url=` to override.'; + } + } + if ( $explanation ) { + $message .= ' ' . $explanation; + } + WP_CLI::error( $message ); + }, + 10, + 3 + ); + } + + // The APC cache is not available on the command-line, so bail, to prevent cache poisoning + WP_CLI::add_wp_hook( + 'muplugins_loaded', + function() { + if ( $GLOBALS['_wp_using_ext_object_cache'] && class_exists( 'APC_Object_Cache' ) ) { + WP_CLI::warning( 'Running WP-CLI while the APC object cache is activated can result in cache corruption.' ); + WP_CLI::confirm( 'Given the consequences, do you wish to continue?' ); + } + }, + 0 + ); + + // Handle --user parameter + if ( ! defined( 'WP_INSTALLING' ) ) { + $config = $this->config; + WP_CLI::add_wp_hook( + 'init', + function() use ( $config ) { + if ( isset( $config['user'] ) ) { + $fetcher = new \WP_CLI\Fetchers\User; + $user = $fetcher->get_check( $config['user'] ); + wp_set_current_user( $user->ID ); + } else { + add_action( 'init', 'kses_remove_filters', 11 ); + } + }, + 0 + ); + } + + // Avoid uncaught exception when using wp_mail() without defined $_SERVER['SERVER_NAME'] + WP_CLI::add_wp_hook( + 'wp_mail_from', + function( $from_email ) { + if ( 'wordpress@' === $from_email ) { + $sitename = strtolower( parse_url( site_url(), PHP_URL_HOST ) ); + if ( substr( $sitename, 0, 4 ) == 'www.' ) { + $sitename = substr( $sitename, 4 ); + } + $from_email = 'wordpress@' . $sitename; + } + return $from_email; + } + ); + + // Don't apply set_url_scheme in get_site_url() + WP_CLI::add_wp_hook( + 'site_url', + function( $url, $path, $scheme, $blog_id ) { + if ( empty( $blog_id ) || ! is_multisite() ) { + $url = get_option( 'siteurl' ); + } else { + switch_to_blog( $blog_id ); + $url = get_option( 'siteurl' ); + restore_current_blog(); + } + if ( $path && is_string( $path ) ) { + $url .= '/' . ltrim( $path, '/' ); + } + return $url; + }, + 0, + 4 + ); + + } + + /** + * Set up the filters to skip the loaded plugins + */ + private function setup_skip_plugins_filters() { + $wp_cli_filter_active_plugins = function( $plugins ) { + $skipped_plugins = WP_CLI::get_runner()->config['skip-plugins']; + if ( true === $skipped_plugins ) { + return array(); + } + if ( ! is_array( $plugins ) ) { + return $plugins; + } + foreach ( $plugins as $a => $b ) { + // active_sitewide_plugins stores plugin name as the key. + if ( false !== strpos( current_filter(), 'active_sitewide_plugins' ) && Utils\is_plugin_skipped( $a ) ) { + unset( $plugins[ $a ] ); + // active_plugins stores plugin name as the value. + } elseif ( false !== strpos( current_filter(), 'active_plugins' ) && Utils\is_plugin_skipped( $b ) ) { + unset( $plugins[ $a ] ); + } + } + // Reindex because active_plugins expects a numeric index. + if ( false !== strpos( current_filter(), 'active_plugins' ) ) { + $plugins = array_values( $plugins ); + } + return $plugins; + }; + + $hooks = array( + 'pre_site_option_active_sitewide_plugins', + 'site_option_active_sitewide_plugins', + 'pre_option_active_plugins', + 'option_active_plugins', + ); + foreach ( $hooks as $hook ) { + WP_CLI::add_wp_hook( $hook, $wp_cli_filter_active_plugins, 999 ); + } + WP_CLI::add_wp_hook( + 'plugins_loaded', + function() use ( $hooks, $wp_cli_filter_active_plugins ) { + foreach ( $hooks as $hook ) { + remove_filter( $hook, $wp_cli_filter_active_plugins, 999 ); + } + }, + 0 + ); + } + + /** + * Set up the filters to skip the loaded theme + */ + public function action_setup_theme_wp_cli_skip_themes() { + $wp_cli_filter_active_theme = function( $value ) { + $skipped_themes = WP_CLI::get_runner()->config['skip-themes']; + if ( true === $skipped_themes ) { + return ''; + } + if ( ! is_array( $skipped_themes ) ) { + $skipped_themes = explode( ',', $skipped_themes ); + } + + $checked_value = $value; + // Always check against the stylesheet value + // This ensures a child theme can be skipped when template differs + if ( false !== stripos( current_filter(), 'option_template' ) ) { + $checked_value = get_option( 'stylesheet' ); + } + + if ( '' === $checked_value || in_array( $checked_value, $skipped_themes ) ) { + return ''; + } + return $value; + }; + $hooks = array( + 'pre_option_template', + 'option_template', + 'pre_option_stylesheet', + 'option_stylesheet', + ); + foreach ( $hooks as $hook ) { + add_filter( $hook, $wp_cli_filter_active_theme, 999 ); + } + // Clean up after the TEMPLATEPATH and STYLESHEETPATH constants are defined + WP_CLI::add_wp_hook( + 'after_setup_theme', + function() use ( $hooks, $wp_cli_filter_active_theme ) { + foreach ( $hooks as $hook ) { + remove_filter( $hook, $wp_cli_filter_active_theme, 999 ); + } + }, + 0 + ); + } + + /** + * Whether or not this WordPress install is multisite. + * + * For use after wp-config.php has loaded, but before the rest of WordPress + * is loaded. + */ + private function is_multisite() { + if ( defined( 'MULTISITE' ) ) { + return MULTISITE; + } + + if ( defined( 'SUBDOMAIN_INSTALL' ) || defined( 'VHOST' ) || defined( 'SUNRISE' ) ) { + return true; + } + + return false; + } + + /** + * Error handler for `wp_die()` when the command is help to try to trap errors (db connection failure in particular) during WordPress load. + */ + public function help_wp_die_handler( $message ) { + $help_exit_warning = 'Error during WordPress load.'; + if ( $message instanceof \WP_Error ) { + $help_exit_warning = WP_CLI\Utils\wp_clean_error_message( $message->get_error_message() ); + } elseif ( is_string( $message ) ) { + $help_exit_warning = WP_CLI\Utils\wp_clean_error_message( $message ); + } + $this->_run_command_and_exit( $help_exit_warning ); + } + + /** + * Check whether there's a WP-CLI update available, and suggest update if so. + */ + private function auto_check_update() { + + // `wp cli update` only works with Phars at this time. + if ( ! Utils\inside_phar() ) { + return; + } + + $existing_phar = realpath( $_SERVER['argv'][0] ); + // Phar needs to be writable to be easily updateable. + if ( ! is_writable( $existing_phar ) || ! is_writable( dirname( $existing_phar ) ) ) { + return; + } + + // Only check for update when a human is operating. + if ( ! function_exists( 'posix_isatty' ) || ! posix_isatty( STDOUT ) ) { + return; + } + + // Allow hosts and other providers to disable automatic check update. + if ( getenv( 'WP_CLI_DISABLE_AUTO_CHECK_UPDATE' ) ) { + return; + } + + // Permit configuration of number of days between checks. + $days_between_checks = getenv( 'WP_CLI_AUTO_CHECK_UPDATE_DAYS' ); + if ( false === $days_between_checks ) { + $days_between_checks = 1; + } + + $cache = WP_CLI::get_cache(); + $cache_key = 'wp-cli-update-check'; + // Bail early on the first check, so we don't always check on an unwritable cache. + if ( ! $cache->has( $cache_key ) ) { + $cache->write( $cache_key, time() ); + return; + } + + // Bail if last check is still within our update check time period. + $last_check = (int) $cache->read( $cache_key ); + if ( time() - ( 24 * 60 * 60 * $days_between_checks ) < $last_check ) { + return; + } + + // In case the operation fails, ensure the timestamp has been updated. + $cache->write( $cache_key, time() ); + + // Check whether any updates are available. + ob_start(); + WP_CLI::run_command( + array( 'cli', 'check-update' ), + array( + 'format' => 'count', + ) + ); + $count = ob_get_clean(); + if ( ! $count ) { + return; + } + + // Looks like an update is available, so let's prompt to update. + WP_CLI::run_command( array( 'cli', 'update' ) ); + // If the Phar was replaced, we can't proceed with the original process. + exit; + } + + /** + * Get a suggestion on similar (sub)commands when the user entered an + * unknown (sub)command. + * + * @param string $entry User entry that didn't match an + * existing command. + * @param CompositeCommand $root_command Root command to start search for + * suggestions at. + * + * @return string Suggestion that fits the user entry, or an empty string. + */ + private function get_subcommand_suggestion( $entry, CompositeCommand $root_command = null ) { + $commands = array(); + $this->enumerate_commands( $root_command ?: \WP_CLI::get_root_command(), $commands ); + + return Utils\get_suggestion( $entry, $commands, $threshold = 2 ); + } + + /** + * Recursive method to enumerate all known commands. + * + * @param CompositeCommand $command Composite command to recurse over. + * @param array $list Reference to list accumulating results. + * @param string $parent Parent command to use as prefix. + */ + private function enumerate_commands( CompositeCommand $command, array &$list, $parent = '' ) { + foreach ( $command->get_subcommands() as $subcommand ) { + /** @var CompositeCommand $subcommand */ + $command_string = empty( $parent ) + ? $subcommand->get_name() + : "{$parent} {$subcommand->get_name()}"; + + $list[] = $command_string; + + $this->enumerate_commands( $subcommand, $list, $command_string ); + } + } + + /** + * Enables (almost) full PHP error reporting to stderr. + */ + private function enable_error_reporting() { + if ( E_ALL !== error_reporting() ) { + // Don't enable E_DEPRECATED as old versions of WP use PHP 4 style constructors and the mysql extension. + error_reporting( E_ALL & ~E_DEPRECATED ); + } + ini_set( 'display_errors', 'stderr' ); + } +} diff --git a/php/WP_CLI/SynopsisParser.php b/php/WP_CLI/SynopsisParser.php new file mode 100644 index 000000000..515eebfad --- /dev/null +++ b/php/WP_CLI/SynopsisParser.php @@ -0,0 +1,165 @@ +..." + * into [ optional=>false, type=>positional, repeating=>true, name=>object-id ] + */ +class SynopsisParser { + + /** + * @param string A synopsis + * @return array List of parameters + */ + public static function parse( $synopsis ) { + $tokens = array_filter( preg_split( '/[\s\t]+/', $synopsis ) ); + + $params = array(); + foreach ( $tokens as $token ) { + $param = self::classify_token( $token ); + + // Some types of parameters shouldn't be mandatory + if ( isset( $param['optional'] ) && ! $param['optional'] ) { + if ( 'flag' === $param['type'] || ( 'assoc' === $param['type'] && $param['value']['optional'] ) ) { + $param['type'] = 'unknown'; + } + } + + $param['token'] = $token; + $params[] = $param; + } + + return $params; + } + + /** + * @param array A structured synopsis + * @return string Rendered synopsis + */ + public static function render( $synopsis ) { + if ( ! is_array( $synopsis ) ) { + return ''; + } + $bits = array( + 'positional' => '', + 'assoc' => '', + 'generic' => '', + 'flag' => '', + ); + foreach ( $bits as $key => &$value ) { + foreach ( $synopsis as $arg ) { + if ( empty( $arg['type'] ) + || $key !== $arg['type'] ) { + continue; + } + + if ( empty( $arg['name'] ) && 'generic' !== $arg['type'] ) { + continue; + } + + if ( 'positional' === $key ) { + $rendered_arg = "<{$arg['name']}>"; + } elseif ( 'assoc' === $key ) { + $arg_value = isset( $arg['value']['name'] ) ? $arg['value']['name'] : $arg['name']; + $rendered_arg = "--{$arg['name']}=<{$arg_value}>"; + } elseif ( 'generic' === $key ) { + $rendered_arg = '--='; + } elseif ( 'flag' === $key ) { + $rendered_arg = "--{$arg['name']}"; + } + if ( ! empty( $arg['repeating'] ) ) { + $rendered_arg = "{$rendered_arg}..."; + } + if ( ! empty( $arg['optional'] ) ) { + $rendered_arg = "[{$rendered_arg}]"; + } + $value .= "{$rendered_arg} "; + } + } + $rendered = ''; + foreach ( $bits as $v ) { + if ( ! empty( $v ) ) { + $rendered .= $v; + } + } + return rtrim( $rendered, ' ' ); + } + + /** + * Classify argument attributes based on its syntax. + * + * @param string $token + * @return array $param + */ + private static function classify_token( $token ) { + $param = array(); + + list( $param['optional'], $token ) = self::is_optional( $token ); + list( $param['repeating'], $token ) = self::is_repeating( $token ); + + $p_name = '([a-z-_0-9]+)'; + $p_value = '([a-zA-Z-_|,0-9]+)'; + + if ( '--=' === $token ) { + $param['type'] = 'generic'; + } elseif ( preg_match( "/^<($p_value)>$/", $token, $matches ) ) { + $param['type'] = 'positional'; + $param['name'] = $matches[1]; + } elseif ( preg_match( "/^--(?:\\[no-\\])?$p_name/", $token, $matches ) ) { + $param['name'] = $matches[1]; + + $value = substr( $token, strlen( $matches[0] ) ); + + // substr returns false <= PHP 5.6, and '' PHP 7+ + if ( false === $value || '' === $value ) { + $param['type'] = 'flag'; + } else { + $param['type'] = 'assoc'; + + list( $param['value']['optional'], $value ) = self::is_optional( $value ); + + if ( preg_match( "/^=<$p_value>$/", $value, $matches ) ) { + $param['value']['name'] = $matches[1]; + } else { + $param = array( + 'type' => 'unknown', + ); + } + } + } else { + $param['type'] = 'unknown'; + } + + return $param; + } + + /** + * An optional parameter is surrounded by square brackets. + * + * @param string $token + * @return array + */ + private static function is_optional( $token ) { + if ( '[' == substr( $token, 0, 1 ) && ']' == substr( $token, -1 ) ) { + return array( true, substr( $token, 1, -1 ) ); + } + + return array( false, $token ); + } + + /** + * A repeating parameter is followed by an ellipsis. + * + * @param string $token + * @return array + */ + private static function is_repeating( $token ) { + if ( '...' === substr( $token, -3 ) ) { + return array( true, substr( $token, 0, -3 ) ); + } + + return array( false, $token ); + } +} diff --git a/php/WP_CLI/SynopsisValidator.php b/php/WP_CLI/SynopsisValidator.php new file mode 100644 index 000000000..11614bf96 --- /dev/null +++ b/php/WP_CLI/SynopsisValidator.php @@ -0,0 +1,181 @@ +spec = SynopsisParser::parse( $synopsis ); + } + + /** + * Get any unknown arguments. + * + * @return array + */ + public function get_unknown() { + return array_column( + $this->query_spec( + array( + 'type' => 'unknown', + ) + ), 'token' + ); + } + + /** + * Check whether there are enough positional arguments. + * + * @param array $args Positional arguments. + * @return bool + */ + public function enough_positionals( $args ) { + $positional = $this->query_spec( + array( + 'type' => 'positional', + 'optional' => false, + ) + ); + + return count( $args ) >= count( $positional ); + } + + /** + * Check for any unknown positionals. + * + * @param array $args Positional arguments. + * @return array + */ + public function unknown_positionals( $args ) { + $positional_repeating = $this->query_spec( + array( + 'type' => 'positional', + 'repeating' => true, + ) + ); + + // At least one positional supports as many as possible. + if ( ! empty( $positional_repeating ) ) { + return array(); + } + + $positional = $this->query_spec( + array( + 'type' => 'positional', + 'repeating' => false, + ) + ); + + return array_slice( $args, count( $positional ) ); + } + + /** + * Check that all required keys are present and that they have values. + * + * @param array $assoc_args Parameters passed to command. + * @return array + */ + public function validate_assoc( $assoc_args ) { + $assoc_spec = $this->query_spec( + array( + 'type' => 'assoc', + ) + ); + + $errors = array( + 'fatal' => array(), + 'warning' => array(), + ); + + $to_unset = array(); + + foreach ( $assoc_spec as $param ) { + $key = $param['name']; + + if ( ! isset( $assoc_args[ $key ] ) ) { + if ( ! $param['optional'] ) { + $errors['fatal'][ $key ] = "missing --$key parameter"; + } + } else { + if ( true === $assoc_args[ $key ] && ! $param['value']['optional'] ) { + $error_type = ( ! $param['optional'] ) ? 'fatal' : 'warning'; + $errors[ $error_type ][ $key ] = "--$key parameter needs a value"; + + $to_unset[] = $key; + } + } + } + + return array( $errors, $to_unset ); + } + + /** + * Check whether there are unknown parameters supplied. + * + * @param array $assoc_args Parameters passed to command. + * @return array|false + */ + public function unknown_assoc( $assoc_args ) { + $generic = $this->query_spec( + array( + 'type' => 'generic', + ) + ); + + if ( count( $generic ) ) { + return array(); + } + + $known_assoc = array(); + + foreach ( $this->spec as $param ) { + if ( in_array( $param['type'], array( 'assoc', 'flag' ) ) ) { + $known_assoc[] = $param['name']; + } + } + + return array_diff( array_keys( $assoc_args ), $known_assoc ); + } + + /** + * Filters a list of associative arrays, based on a set of key => value arguments. + * + * @param array $args An array of key => value arguments to match against + * @param string $operator + * @return array + */ + private function query_spec( $args, $operator = 'AND' ) { + $operator = strtoupper( $operator ); + $count = count( $args ); + $filtered = array(); + + foreach ( $this->spec as $key => $to_match ) { + $matched = 0; + foreach ( $args as $m_key => $m_value ) { + if ( array_key_exists( $m_key, $to_match ) && $m_value == $to_match[ $m_key ] ) { + $matched++; + } + } + + if ( ( 'AND' == $operator && $matched == $count ) + || ( 'OR' == $operator && $matched > 0 ) + || ( 'NOT' == $operator && 0 == $matched ) ) { + $filtered[ $key ] = $to_match; + } + } + + return $filtered; + } + +} diff --git a/php/WP_CLI/UpgraderSkin.php b/php/WP_CLI/UpgraderSkin.php new file mode 100644 index 000000000..f9e0deaa0 --- /dev/null +++ b/php/WP_CLI/UpgraderSkin.php @@ -0,0 +1,60 @@ +upgrader->strings[ $error ] ) ) { + $error = $this->upgrader->strings[ $error ]; + } + + // TODO: show all errors, not just the first one + \WP_CLI::warning( $error ); + } + + public function feedback( $string ) { + + if ( 'parent_theme_prepare_install' === $string ) { + \WP_CLI::get_http_cache_manager()->whitelist_package( $this->api->download_link, 'theme', $this->api->slug, $this->api->version ); + } + + if ( isset( $this->upgrader->strings[ $string ] ) ) { + $string = $this->upgrader->strings[ $string ]; + } + + if ( strpos( $string, '%' ) !== false ) { + $args = func_get_args(); + $args = array_splice( $args, 1 ); + if ( ! empty( $args ) ) { + $string = vsprintf( $string, $args ); + } + } + + if ( empty( $string ) ) { + return; + } + + $string = str_replace( '…', '...', strip_tags( $string ) ); + $string = html_entity_decode( $string, ENT_QUOTES, get_bloginfo( 'charset' ) ); + + \WP_CLI::log( $string ); + } +} + diff --git a/php/WP_CLI/WpHttpCacheManager.php b/php/WP_CLI/WpHttpCacheManager.php new file mode 100644 index 000000000..4fff0aa86 --- /dev/null +++ b/php/WP_CLI/WpHttpCacheManager.php @@ -0,0 +1,132 @@ +cache = $cache; + + // hook into wp http api + add_filter( 'pre_http_request', array( $this, 'filter_pre_http_request' ), 10, 3 ); + add_filter( 'http_response', array( $this, 'filter_http_response' ), 10, 3 ); + } + + /** + * short circuit wp http api with cached file + */ + public function filter_pre_http_request( $response, $args, $url ) { + // check if whitelisted + if ( ! isset( $this->whitelist[ $url ] ) ) { + return $response; + } + // check if downloading + if ( 'GET' !== $args['method'] || empty( $args['filename'] ) ) { + return $response; + } + // check cache and export to designated location + $filename = $this->cache->has( $this->whitelist[ $url ]['key'], $this->whitelist[ $url ]['ttl'] ); + if ( $filename ) { + WP_CLI::log( sprintf( 'Using cached file \'%s\'...', $filename ) ); + if ( copy( $filename, $args['filename'] ) ) { + // simulate successful download response + return array( + 'response' => array( + 'code' => 200, + 'message' => 'OK', + ), + 'filename' => $args['filename'], + ); + } + + WP_CLI::error( sprintf( 'Error copying cached file %s to %s', $filename, $url ) ); + } + return $response; + } + + + /** + * cache wp http api downloads + * + * @param array $response + * @param array $args + * @param string $url + */ + public function filter_http_response( $response, $args, $url ) { + // check if whitelisted + if ( ! isset( $this->whitelist[ $url ] ) ) { + return $response; + } + // check if downloading + if ( 'GET' !== $args['method'] || empty( $args['filename'] ) ) { + return $response; + } + // check if download was successful + if ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) { + return $response; + } + // cache downloaded file + $this->cache->import( $this->whitelist[ $url ]['key'], $response['filename'] ); + return $response; + } + + /** + * whitelist a package url + * + * @param string $url + * @param string $group package group (themes, plugins, ...) + * @param string $slug package slug + * @param string $version package version + * @param int $ttl + */ + public function whitelist_package( $url, $group, $slug, $version, $ttl = null ) { + $ext = pathinfo( parse_url( $url, PHP_URL_PATH ), PATHINFO_EXTENSION ); + $key = "$group/$slug-$version.$ext"; + $this->whitelist_url( $url, $key, $ttl ); + wp_update_plugins(); + } + + /** + * whitelist a url + * + * @param string $url + * @param string $key + * @param int $ttl + */ + public function whitelist_url( $url, $key = null, $ttl = null ) { + $key = $key ? : $url; + $this->whitelist[ $url ] = compact( 'key', 'ttl' ); + } + + /** + * check if url is whitelisted + * + * @param string $url + * @return bool + */ + public function is_whitelisted( $url ) { + return isset( $this->whitelist[ $url ] ); + } + +} diff --git a/php/boot-fs.php b/php/boot-fs.php new file mode 100644 index 000000000..f1cfc5900 --- /dev/null +++ b/php/boot-fs.php @@ -0,0 +1,18 @@ +add_namespace( + 'WP_CLI\Bootstrap', + WP_CLI_ROOT . '/php/WP_CLI/Bootstrap' + )->register(); +} + +/** + * Initialize and return the bootstrap state to pass from step to step. + * + * @return BootstrapState + */ +function initialize_bootstrap_state() { + return new BootstrapState(); +} + +/** + * Process the bootstrapping steps. + * + * Loops over each of the provided steps, instantiates it and then calls its + * `process()` method. + */ +function bootstrap() { + prepare_bootstrap(); + $state = initialize_bootstrap_state(); + + foreach ( get_bootstrap_steps() as $step ) { + /** @var \WP_CLI\Bootstrap\BootstrapStep $step_instance */ + $step_instance = new $step(); + $state = $step_instance->process( $state ); + } +} diff --git a/php/class-wp-cli-command.php b/php/class-wp-cli-command.php new file mode 100644 index 000000000..0cccc51a4 --- /dev/null +++ b/php/class-wp-cli-command.php @@ -0,0 +1,12 @@ +clean(); + } + ); + } + } + + return $cache; + } + + /** + * Set the context in which WP-CLI should be run + */ + public static function set_url( $url ) { + WP_CLI::debug( 'Set URL: ' . $url, 'bootstrap' ); + $url_parts = Utils\parse_url( $url ); + self::set_url_params( $url_parts ); + } + + private static function set_url_params( $url_parts ) { + $f = function( $key ) use ( $url_parts ) { + return \WP_CLI\Utils\get_flag_value( $url_parts, $key, '' ); + }; + + if ( isset( $url_parts['host'] ) ) { + if ( isset( $url_parts['scheme'] ) && 'https' === strtolower( $url_parts['scheme'] ) ) { + $_SERVER['HTTPS'] = 'on'; + } + + $_SERVER['HTTP_HOST'] = $url_parts['host']; + if ( isset( $url_parts['port'] ) ) { + $_SERVER['HTTP_HOST'] .= ':' . $url_parts['port']; + } + + $_SERVER['SERVER_NAME'] = $url_parts['host']; + } + + $_SERVER['REQUEST_URI'] = $f( 'path' ) . ( isset( $url_parts['query'] ) ? '?' . $url_parts['query'] : '' ); + $_SERVER['SERVER_PORT'] = \WP_CLI\Utils\get_flag_value( $url_parts, 'port', '80' ); + $_SERVER['QUERY_STRING'] = $f( 'query' ); + } + + /** + * @return WpHttpCacheManager + */ + public static function get_http_cache_manager() { + static $http_cacher; + + if ( ! $http_cacher ) { + $http_cacher = new WpHttpCacheManager( self::get_cache() ); + } + + return $http_cacher; + } + + /** + * Colorize a string for output. + * + * Yes, you too can change the color of command line text. For instance, + * here's how `WP_CLI::success()` colorizes "Success: " + * + * ``` + * WP_CLI::colorize( "%GSuccess:%n " ) + * ``` + * + * Uses `\cli\Colors::colorize()` to transform color tokens to display + * settings. Choose from the following tokens (and note 'reset'): + * + * * %y => ['color' => 'yellow'], + * * %g => ['color' => 'green'], + * * %b => ['color' => 'blue'], + * * %r => ['color' => 'red'], + * * %p => ['color' => 'magenta'], + * * %m => ['color' => 'magenta'], + * * %c => ['color' => 'cyan'], + * * %w => ['color' => 'grey'], + * * %k => ['color' => 'black'], + * * %n => ['color' => 'reset'], + * * %Y => ['color' => 'yellow', 'style' => 'bright'], + * * %G => ['color' => 'green', 'style' => 'bright'], + * * %B => ['color' => 'blue', 'style' => 'bright'], + * * %R => ['color' => 'red', 'style' => 'bright'], + * * %P => ['color' => 'magenta', 'style' => 'bright'], + * * %M => ['color' => 'magenta', 'style' => 'bright'], + * * %C => ['color' => 'cyan', 'style' => 'bright'], + * * %W => ['color' => 'grey', 'style' => 'bright'], + * * %K => ['color' => 'black', 'style' => 'bright'], + * * %N => ['color' => 'reset', 'style' => 'bright'], + * * %3 => ['background' => 'yellow'], + * * %2 => ['background' => 'green'], + * * %4 => ['background' => 'blue'], + * * %1 => ['background' => 'red'], + * * %5 => ['background' => 'magenta'], + * * %6 => ['background' => 'cyan'], + * * %7 => ['background' => 'grey'], + * * %0 => ['background' => 'black'], + * * %F => ['style' => 'blink'], + * * %U => ['style' => 'underline'], + * * %8 => ['style' => 'inverse'], + * * %9 => ['style' => 'bright'], + * * %_ => ['style' => 'bright'] + * + * @access public + * @category Output + * + * @param string $string String to colorize for output, with color tokens. + * @return string Colorized string. + */ + public static function colorize( $string ) { + return \cli\Colors::colorize( $string, self::get_runner()->in_color() ); + } + + /** + * Schedule a callback to be executed at a certain point. + * + * Hooks conceptually are very similar to WordPress actions. WP-CLI hooks + * are typically called before WordPress is loaded. + * + * WP-CLI hooks include: + * + * * `before_add_command:` - Before the command is added. + * * `after_add_command:` - After the command was added. + * * `before_invoke:` - Just before a command is invoked. + * * `after_invoke:` - Just after a command is invoked. + * * `find_command_to_run_pre` - Just before WP-CLI finds the command to run. + * * `before_wp_load` - Just before the WP load process begins. + * * `before_wp_config_load` - After wp-config.php has been located. + * * `after_wp_config_load` - After wp-config.php has been loaded into scope. + * * `after_wp_load` - Just after the WP load process has completed. + * + * WP-CLI commands can create their own hooks with `WP_CLI::do_hook()`. + * + * If additional arguments are passed through the `WP_CLI::do_hook()` call, + * these will be passed on to the callback provided by `WP_CLI::add_hook()`. + * + * ``` + * # `wp network meta` confirms command is executing in multisite context. + * WP_CLI::add_command( 'network meta', 'Network_Meta_Command', array( + * 'before_invoke' => function () { + * if ( !is_multisite() ) { + * WP_CLI::error( 'This is not a multisite install.' ); + * } + * } + * ) ); + * ``` + * + * @access public + * @category Registration + * + * @param string $when Identifier for the hook. + * @param mixed $callback Callback to execute when hook is called. + * @return null + */ + public static function add_hook( $when, $callback ) { + if ( array_key_exists( $when, self::$hooks_passed ) ) { + call_user_func_array( $callback, (array) self::$hooks_passed[ $when ] ); + } + + self::$hooks[ $when ][] = $callback; + } + + /** + * Execute callbacks registered to a given hook. + * + * See `WP_CLI::add_hook()` for details on WP-CLI's internal hook system. + * Commands can provide and call their own hooks. + * + * @access public + * @category Registration + * + * @param string $when Identifier for the hook. + * @param mixed ... Optional. Arguments that will be passed onto the + * callback provided by `WP_CLI::add_hook()`. + * @return null + */ + public static function do_hook( $when ) { + $args = func_num_args() > 1 + ? array_slice( func_get_args(), 1 ) + : array(); + + self::$hooks_passed[ $when ] = $args; + + if ( ! isset( self::$hooks[ $when ] ) ) { + return; + } + + foreach ( self::$hooks[ $when ] as $callback ) { + call_user_func_array( $callback, $args ); + } + } + + /** + * Add a callback to a WordPress action or filter. + * + * `add_action()` without needing access to `add_action()`. If WordPress is + * already loaded though, you should use `add_action()` (and `add_filter()`) + * instead. + * + * @access public + * @category Registration + * + * @param string $tag Named WordPress action or filter. + * @param mixed $function_to_add Callable to execute when the action or filter is evaluated. + * @param integer $priority Priority to add the callback as. + * @param integer $accepted_args Number of arguments to pass to callback. + * @return true + */ + public static function add_wp_hook( $tag, $function_to_add, $priority = 10, $accepted_args = 1 ) { + global $wp_filter, $merged_filters; + + if ( function_exists( 'add_filter' ) ) { + add_filter( $tag, $function_to_add, $priority, $accepted_args ); + } else { + $idx = self::wp_hook_build_unique_id( $tag, $function_to_add, $priority ); + $wp_filter[ $tag ][ $priority ][ $idx ] = array( + 'function' => $function_to_add, + 'accepted_args' => $accepted_args, + ); + unset( $merged_filters[ $tag ] ); + } + + return true; + } + + /** + * Build Unique ID for storage and retrieval. + * + * Essentially _wp_filter_build_unique_id() without needing access to _wp_filter_build_unique_id() + */ + private static function wp_hook_build_unique_id( $tag, $function, $priority ) { + global $wp_filter; + static $filter_id_count = 0; + + if ( is_string( $function ) ) { + return $function; + } + + if ( is_object( $function ) ) { + // Closures are currently implemented as objects + $function = array( $function, '' ); + } else { + $function = (array) $function; + } + + if ( is_object( $function[0] ) ) { + // Object Class Calling + if ( function_exists( 'spl_object_hash' ) ) { + return spl_object_hash( $function[0] ) . $function[1]; + } + + $obj_idx = get_class( $function[0] ) . $function[1]; + if ( ! isset( $function[0]->wp_filter_id ) ) { + if ( false === $priority ) { + return false; + } + $obj_idx .= isset( $wp_filter[ $tag ][ $priority ] ) ? count( (array) $wp_filter[ $tag ][ $priority ] ) : $filter_id_count; + $function[0]->wp_filter_id = $filter_id_count; + ++$filter_id_count; + } else { + $obj_idx .= $function[0]->wp_filter_id; + } + + return $obj_idx; + } + + if ( is_string( $function[0] ) ) { + // Static Calling + return $function[0] . '::' . $function[1]; + } + } + + /** + * Register a command to WP-CLI. + * + * WP-CLI supports using any callable class, function, or closure as a + * command. `WP_CLI::add_command()` is used for both internal and + * third-party command registration. + * + * Command arguments are parsed from PHPDoc by default, but also can be + * supplied as an optional third argument during registration. + * + * ``` + * # Register a custom 'foo' command to output a supplied positional param. + * # + * # $ wp foo bar --append=qux + * # Success: bar qux + * + * /** + * * My awesome closure command + * * + * * + * * : An awesome message to display + * * + * * --append= + * * : An awesome message to append to the original message. + * * + * * @when before_wp_load + * *\/ + * $foo = function( $args, $assoc_args ) { + * WP_CLI::success( $args[0] . ' ' . $assoc_args['append'] ); + * }; + * WP_CLI::add_command( 'foo', $foo ); + * ``` + * + * @access public + * @category Registration + * + * @param string $name Name for the command (e.g. "post list" or "site empty"). + * @param callable $callable Command implementation as a class, function or closure. + * @param array $args { + * Optional. An associative array with additional registration parameters. + * + * @type callable $before_invoke Callback to execute before invoking the command. + * @type callable $after_invoke Callback to execute after invoking the command. + * @type string $shortdesc Short description (80 char or less) for the command. + * @type string $longdesc Description of arbitrary length for examples, etc. + * @type string $synopsis The synopsis for the command (string or array). + * @type string $when Execute callback on a named WP-CLI hook (e.g. before_wp_load). + * @type bool $is_deferred Whether the command addition had already been deferred. + * } + * @return true True on success, false if deferred, hard error if registration failed. + */ + public static function add_command( $name, $callable, $args = array() ) { + // Bail immediately if the WP-CLI executable has not been run. + if ( ! defined( 'WP_CLI' ) ) { + return false; + } + + $valid = false; + if ( is_callable( $callable ) ) { + $valid = true; + } elseif ( is_string( $callable ) && class_exists( (string) $callable ) ) { + $valid = true; + } elseif ( is_object( $callable ) ) { + $valid = true; + } + if ( ! $valid ) { + if ( is_array( $callable ) ) { + $callable[0] = is_object( $callable[0] ) ? get_class( $callable[0] ) : $callable[0]; + $callable = array( $callable[0], $callable[1] ); + } + WP_CLI::error( sprintf( 'Callable %s does not exist, and cannot be registered as `wp %s`.', json_encode( $callable ), $name ) ); + } + + $addition = new Dispatcher\CommandAddition(); + self::do_hook( "before_add_command:{$name}", $addition ); + + if ( $addition->was_aborted() ) { + WP_CLI::warning( "Aborting the addition of the command '{$name}' with reason: {$addition->get_reason()}." ); + return false; + } + + foreach ( array( 'before_invoke', 'after_invoke' ) as $when ) { + if ( isset( $args[ $when ] ) ) { + self::add_hook( "{$when}:{$name}", $args[ $when ] ); + } + } + + $path = preg_split( '/\s+/', $name ); + + $leaf_name = array_pop( $path ); + $full_path = $path; + + $command = self::get_root_command(); + + while ( ! empty( $path ) ) { + $subcommand_name = $path[0]; + $parent = implode( ' ', $path ); + $subcommand = $command->find_subcommand( $path ); + + // Parent not found. Defer addition or create an empty container as + // needed. + if ( ! $subcommand ) { + if ( isset( $args['is_deferred'] ) && $args['is_deferred'] ) { + $subcommand = new Dispatcher\CompositeCommand( + $command, + $subcommand_name, + new \WP_CLI\DocParser( '' ) + ); + $command->add_subcommand( $subcommand_name, $subcommand ); + } else { + self::defer_command_addition( + $name, + $parent, + $callable, + $args + ); + + return false; + } + } + + $command = $subcommand; + } + + $leaf_command = Dispatcher\CommandFactory::create( $leaf_name, $callable, $command ); + + if ( $leaf_command instanceof Dispatcher\CommandNamespace && array_key_exists( $leaf_name, $command->get_subcommands() ) ) { + return false; + } + + if ( ! $command->can_have_subcommands() ) { + throw new Exception( + sprintf( + "'%s' can't have subcommands.", + implode( ' ' , Dispatcher\get_path( $command ) ) + ) + ); + } + + if ( isset( $args['shortdesc'] ) ) { + $leaf_command->set_shortdesc( $args['shortdesc'] ); + } + + if ( isset( $args['longdesc'] ) ) { + $leaf_command->set_longdesc( $args['longdesc'] ); + } + + if ( isset( $args['synopsis'] ) ) { + if ( is_string( $args['synopsis'] ) ) { + $leaf_command->set_synopsis( $args['synopsis'] ); + } elseif ( is_array( $args['synopsis'] ) ) { + $synopsis = \WP_CLI\SynopsisParser::render( $args['synopsis'] ); + $leaf_command->set_synopsis( $synopsis ); + $long_desc = ''; + $bits = explode( ' ', $synopsis ); + foreach ( $args['synopsis'] as $key => $arg ) { + $long_desc .= $bits[ $key ] . "\n"; + if ( ! empty( $arg['description'] ) ) { + $long_desc .= ': ' . $arg['description'] . "\n"; + } + $yamlify = array(); + foreach ( array( 'default', 'options' ) as $key ) { + if ( isset( $arg[ $key ] ) ) { + $yamlify[ $key ] = $arg[ $key ]; + } + } + if ( ! empty( $yamlify ) ) { + $long_desc .= Spyc::YAMLDump( $yamlify ); + $long_desc .= '---' . "\n"; + } + $long_desc .= "\n"; + } + if ( ! empty( $long_desc ) ) { + $long_desc = rtrim( $long_desc, "\r\n" ); + $long_desc = '## OPTIONS' . "\n\n" . $long_desc; + if ( ! empty( $args['longdesc'] ) ) { + $long_desc .= "\n\n" . ltrim( $args['longdesc'], "\r\n" ); + } + $leaf_command->set_longdesc( $long_desc ); + } + } + } + + if ( isset( $args['when'] ) ) { + self::get_runner()->register_early_invoke( $args['when'], $leaf_command ); + } + + $command->add_subcommand( $leaf_name, $leaf_command ); + + self::do_hook( "after_add_command:{$name}" ); + return true; + } + + /** + * Defer command addition for a sub-command if the parent command is not yet + * registered. + * + * @param string $name Name for the sub-command. + * @param string $parent Name for the parent command. + * @param string $callable Command implementation as a class, function or closure. + * @param array $args Optional. See `WP_CLI::add_command()` for details. + */ + private static function defer_command_addition( $name, $parent, $callable, $args = array() ) { + $args['is_deferred'] = true; + self::$deferred_additions[ $name ] = array( + 'parent' => $parent, + 'callable' => $callable, + 'args' => $args, + ); + self::add_hook( + "after_add_command:$parent", + function () use ( $name ) { + $deferred_additions = WP_CLI::get_deferred_additions(); + + if ( ! array_key_exists( $name, $deferred_additions ) ) { + return; + } + + $callable = $deferred_additions[ $name ]['callable']; + $args = $deferred_additions[ $name ]['args']; + WP_CLI::remove_deferred_addition( $name ); + + WP_CLI::add_command( $name, $callable, $args ); + } + ); + } + + /** + * Get the list of outstanding deferred command additions. + * + * @return array Array of outstanding command additions. + */ + public static function get_deferred_additions() { + return self::$deferred_additions; + } + + /** + * Remove a command addition from the list of outstanding deferred additions. + */ + public static function remove_deferred_addition( $name ) { + if ( ! array_key_exists( $name, self::$deferred_additions ) ) { + WP_CLI::warning( "Trying to remove a non-existent command addition '{$name}'." ); + } + + unset( self::$deferred_additions[ $name ] ); + } + + /** + * Display informational message without prefix, and ignore `--quiet`. + * + * Message is written to STDOUT. `WP_CLI::log()` is typically recommended; + * `WP_CLI::line()` is included for historical compat. + * + * @access public + * @category Output + * + * @param string $message Message to display to the end user. + * @return null + */ + public static function line( $message = '' ) { + echo $message . "\n"; + } + + /** + * Display informational message without prefix. + * + * Message is written to STDOUT, or discarded when `--quiet` flag is supplied. + * + * ``` + * # `wp cli update` lets user know of each step in the update process. + * WP_CLI::log( sprintf( 'Downloading from %s...', $download_url ) ); + * ``` + * + * @access public + * @category Output + * + * @param string $message Message to write to STDOUT. + */ + public static function log( $message ) { + self::$logger->info( $message ); + } + + /** + * Display success message prefixed with "Success: ". + * + * Success message is written to STDOUT. + * + * Typically recommended to inform user of successful script conclusion. + * + * ``` + * # wp rewrite flush expects 'rewrite_rules' option to be set after flush. + * flush_rewrite_rules( \WP_CLI\Utils\get_flag_value( $assoc_args, 'hard' ) ); + * if ( ! get_option( 'rewrite_rules' ) ) { + * WP_CLI::warning( "Rewrite rules are empty." ); + * } else { + * WP_CLI::success( 'Rewrite rules flushed.' ); + * } + * ``` + * + * @access public + * @category Output + * + * @param string $message Message to write to STDOUT. + * @return null + */ + public static function success( $message ) { + self::$logger->success( $message ); + } + + /** + * Display debug message prefixed with "Debug: " when `--debug` is used. + * + * Debug message is written to STDERR, and includes script execution time. + * + * Helpful for optionally showing greater detail when needed. Used throughout + * WP-CLI bootstrap process for easier debugging and profiling. + * + * ``` + * # Called in `WP_CLI\Runner::set_wp_root()`. + * private static function set_wp_root( $path ) { + * define( 'ABSPATH', Utils\trailingslashit( $path ) ); + * WP_CLI::debug( 'ABSPATH defined: ' . ABSPATH ); + * $_SERVER['DOCUMENT_ROOT'] = realpath( $path ); + * } + * + * # Debug details only appear when `--debug` is used. + * # $ wp --debug + * # [...] + * # Debug: ABSPATH defined: /srv/www/wordpress-develop.dev/src/ (0.225s) + * ``` + * + * @access public + * @category Output + * + * @param string $message Message to write to STDERR. + * @param string $group Organize debug message to a specific group. + * @return null + */ + public static function debug( $message, $group = false ) { + self::$logger->debug( self::error_to_string( $message ), $group ); + } + + /** + * Display warning message prefixed with "Warning: ". + * + * Warning message is written to STDERR. + * + * Use instead of `WP_CLI::debug()` when script execution should be permitted + * to continue. + * + * ``` + * # `wp plugin activate` skips activation when plugin is network active. + * $status = $this->get_status( $plugin->file ); + * // Network-active is the highest level of activation status + * if ( 'active-network' === $status ) { + * WP_CLI::warning( "Plugin '{$plugin->name}' is already network active." ); + * continue; + * } + * ``` + * + * @access public + * @category Output + * + * @param string $message Message to write to STDERR. + * @return null + */ + public static function warning( $message ) { + self::$logger->warning( self::error_to_string( $message ) ); + } + + /** + * Display error message prefixed with "Error: " and exit script. + * + * Error message is written to STDERR. Defaults to halting script execution + * with return code 1. + * + * Use `WP_CLI::warning()` instead when script execution should be permitted + * to continue. + * + * ``` + * # `wp cache flush` considers flush failure to be a fatal error. + * if ( false === wp_cache_flush() ) { + * WP_CLI::error( 'The object cache could not be flushed.' ); + * } + * ``` + * + * @access public + * @category Output + * + * @param string|WP_Error $message Message to write to STDERR. + * @param boolean|integer $exit True defaults to exit(1). + * @return null + */ + public static function error( $message, $exit = true ) { + if ( ! isset( self::get_runner()->assoc_args['completions'] ) ) { + self::$logger->error( self::error_to_string( $message ) ); + } + + $return_code = false; + if ( true === $exit ) { + $return_code = 1; + } elseif ( is_int( $exit ) && $exit >= 1 ) { + $return_code = $exit; + } + + if ( $return_code ) { + if ( self::$capture_exit ) { + throw new ExitException( null, $return_code ); + } + exit( $return_code ); + } + } + + /** + * Halt script execution with a specific return code. + * + * Permits script execution to be overloaded by `WP_CLI::runcommand()` + * + * @access public + * @category Output + * + * @param integer $return_code + */ + public static function halt( $return_code ) { + if ( self::$capture_exit ) { + throw new ExitException( null, $return_code ); + } + exit( $return_code ); + } + + /** + * Display a multi-line error message in a red box. Doesn't exit script. + * + * Error message is written to STDERR. + * + * @access public + * @category Output + * + * @param array $message Multi-line error message to be displayed. + */ + public static function error_multi_line( $message_lines ) { + if ( ! isset( self::get_runner()->assoc_args['completions'] ) && is_array( $message_lines ) ) { + self::$logger->error_multi_line( array_map( array( __CLASS__, 'error_to_string' ), $message_lines ) ); + } + } + + /** + * Ask for confirmation before running a destructive operation. + * + * If 'y' is provided to the question, the script execution continues. If + * 'n' or any other response is provided to the question, script exits. + * + * ``` + * # `wp db drop` asks for confirmation before dropping the database. + * + * WP_CLI::confirm( "Are you sure you want to drop the database?", $assoc_args ); + * ``` + * + * @access public + * @category Input + * + * @param string $question Question to display before the prompt. + * @param array $assoc_args Skips prompt if 'yes' is provided. + */ + public static function confirm( $question, $assoc_args = array() ) { + if ( ! \WP_CLI\Utils\get_flag_value( $assoc_args, 'yes' ) ) { + fwrite( STDOUT, $question . ' [y/n] ' ); + + $answer = strtolower( trim( fgets( STDIN ) ) ); + + if ( 'y' != $answer ) { + exit; + } + } + } + + /** + * Read value from a positional argument or from STDIN. + * + * @param array $args The list of positional arguments. + * @param int $index At which position to check for the value. + * + * @return string + */ + public static function get_value_from_arg_or_stdin( $args, $index ) { + if ( isset( $args[ $index ] ) ) { + $raw_value = $args[ $index ]; + } else { + // We don't use file_get_contents() here because it doesn't handle + // Ctrl-D properly, when typing in the value interactively. + $raw_value = ''; + while ( ( $line = fgets( STDIN ) ) !== false ) { + $raw_value .= $line; + } + } + + return $raw_value; + } + + /** + * Read a value, from various formats. + * + * @access public + * @category Input + * + * @param mixed $value + * @param array $assoc_args + */ + public static function read_value( $raw_value, $assoc_args = array() ) { + if ( \WP_CLI\Utils\get_flag_value( $assoc_args, 'format' ) === 'json' ) { + $value = json_decode( $raw_value, true ); + if ( null === $value ) { + WP_CLI::error( sprintf( 'Invalid JSON: %s', $raw_value ) ); + } + } else { + $value = $raw_value; + } + + return $value; + } + + /** + * Display a value, in various formats + * + * @param mixed $value Value to display. + * @param array $assoc_args Arguments passed to the command, determining format. + */ + public static function print_value( $value, $assoc_args = array() ) { + if ( \WP_CLI\Utils\get_flag_value( $assoc_args, 'format' ) === 'json' ) { + $value = json_encode( $value ); + } elseif ( \WP_CLI\Utils\get_flag_value( $assoc_args, 'format' ) === 'yaml' ) { + $value = Spyc::YAMLDump( $value, 2, 0 ); + } elseif ( is_array( $value ) || is_object( $value ) ) { + $value = var_export( $value ); + } + + echo $value . "\n"; + } + + /** + * Convert a wp_error into a string + * + * @param mixed $errors + * @return string + */ + public static function error_to_string( $errors ) { + if ( is_string( $errors ) ) { + return $errors; + } + + // Only json_encode() the data when it needs it + $render_data = function( $data ) { + if ( is_array( $data ) || is_object( $data ) ) { + return json_encode( $data ); + } + + return '"' . $data . '"'; + }; + + if ( is_object( $errors ) && is_a( $errors, 'WP_Error' ) ) { + foreach ( $errors->get_error_messages() as $message ) { + if ( $errors->get_error_data() ) { + return $message . ' ' . $render_data( $errors->get_error_data() ); + } + + return $message; + } + } + } + + /** + * Launch an arbitrary external process that takes over I/O. + * + * ``` + * # `wp core download` falls back to the `tar` binary when PharData isn't available + * if ( ! class_exists( 'PharData' ) ) { + * $cmd = "tar xz --strip-components=1 --directory=%s -f $tarball"; + * WP_CLI::launch( Utils\esc_cmd( $cmd, $dest ) ); + * return; + * } + * ``` + * + * @access public + * @category Execution + * + * @param string $command External process to launch. + * @param boolean $exit_on_error Whether to exit if the command returns an elevated return code. + * @param boolean $return_detailed Whether to return an exit status (default) or detailed execution results. + * @return int|ProcessRun The command exit status, or a ProcessRun object for full details. + */ + public static function launch( $command, $exit_on_error = true, $return_detailed = false ) { + Utils\check_proc_available( 'launch' ); + + $proc = Process::create( $command ); + $results = $proc->run(); + + if ( -1 == $results->return_code ) { + self::warning( "Spawned process returned exit code {$results->return_code}, which could be caused by a custom compiled version of PHP that uses the --enable-sigchild option." ); + } + + if ( $results->return_code && $exit_on_error ) { + exit( $results->return_code ); + } + + if ( $return_detailed ) { + return $results; + } + + return $results->return_code; + } + + /** + * Run a WP-CLI command in a new process reusing the current runtime arguments. + * + * Use `WP_CLI::runcommand()` instead, which is easier to use and works better. + * + * Note: While this command does persist a limited set of runtime arguments, + * it *does not* persist environment variables. Practically speaking, WP-CLI + * packages won't be loaded when using WP_CLI::launch_self() because the + * launched process doesn't have access to the current process $HOME. + * + * @access public + * @category Execution + * + * @param string $command WP-CLI command to call. + * @param array $args Positional arguments to include when calling the command. + * @param array $assoc_args Associative arguments to include when calling the command. + * @param bool $exit_on_error Whether to exit if the command returns an elevated return code. + * @param bool $return_detailed Whether to return an exit status (default) or detailed execution results. + * @param array $runtime_args Override one or more global args (path,url,user,allow-root) + * @return int|ProcessRun The command exit status, or a ProcessRun instance + */ + public static function launch_self( $command, $args = array(), $assoc_args = array(), $exit_on_error = true, $return_detailed = false, $runtime_args = array() ) { + $reused_runtime_args = array( + 'path', + 'url', + 'user', + 'allow-root', + ); + + foreach ( $reused_runtime_args as $key ) { + if ( isset( $runtime_args[ $key ] ) ) { + $assoc_args[ $key ] = $runtime_args[ $key ]; + } elseif ( $value = self::get_runner()->config[ $key ] ) { + $assoc_args[ $key ] = $value; + } + } + + $php_bin = escapeshellarg( Utils\get_php_binary() ); + + $script_path = $GLOBALS['argv'][0]; + + if ( getenv( 'WP_CLI_CONFIG_PATH' ) ) { + $config_path = getenv( 'WP_CLI_CONFIG_PATH' ); + } else { + $config_path = Utils\get_home_dir() . '/.wp-cli/config.yml'; + } + $config_path = escapeshellarg( $config_path ); + + $args = implode( ' ', array_map( 'escapeshellarg', $args ) ); + $assoc_args = \WP_CLI\Utils\assoc_args_to_str( $assoc_args ); + + $full_command = "WP_CLI_CONFIG_PATH={$config_path} {$php_bin} {$script_path} {$command} {$args} {$assoc_args}"; + + return self::launch( $full_command, $exit_on_error, $return_detailed ); + } + + /** + * Get the path to the PHP binary used when executing WP-CLI. + * + * Environment values permit specific binaries to be indicated. + * + * Note: moved to Utils, left for BC. + * + * @access public + * @category System + * + * @return string + */ + public static function get_php_binary() { + return Utils\get_php_binary(); + } + + /** + * Get values of global configuration parameters. + * + * Provides access to `--path=`, `--url=`, and other values of + * the [global configuration parameters](https://wp-cli.org/config/). + * + * ``` + * WP_CLI::log( 'The --url= value is: ' . WP_CLI::get_config( 'url' ) ); + * ``` + * + * @access public + * @category Input + * + * @param string $key Get value for a specific global configuration parameter. + * @return mixed + */ + public static function get_config( $key = null ) { + if ( null === $key ) { + return self::get_runner()->config; + } + + if ( ! isset( self::get_runner()->config[ $key ] ) ) { + self::warning( "Unknown config option '$key'." ); + return null; + } + + return self::get_runner()->config[ $key ]; + } + + /** + * Run a WP-CLI command. + * + * Launches a new child process to run a specified WP-CLI command. + * Optionally: + * + * * Run the command in an existing process. + * * Prevent halting script execution on error. + * * Capture and return STDOUT, or full details about command execution. + * * Parse JSON output if the command rendered it. + * + * ``` + * $options = array( + * 'return' => true, // Return 'STDOUT'; use 'all' for full object. + * 'parse' => 'json', // Parse captured STDOUT to JSON array. + * 'launch' => false, // Reuse the current process. + * 'exit_error' => true, // Halt script execution on error. + * ); + * $plugins = WP_CLI::runcommand( 'plugin list --format=json', $options ); + * ``` + * + * @access public + * @category Execution + * + * @param string $command WP-CLI command to run, including arguments. + * @param array $options Configuration options for command execution. + * @return mixed + */ + public static function runcommand( $command, $options = array() ) { + $defaults = array( + 'launch' => true, // Launch a new process, or reuse the existing. + 'exit_error' => true, // Exit on error by default. + 'return' => false, // Capture and return output, or render in realtime. + 'parse' => false, // Parse returned output as a particular format. + ); + $options = array_merge( $defaults, $options ); + $launch = $options['launch']; + $exit_error = $options['exit_error']; + $return = $options['return']; + $parse = $options['parse']; + $retval = null; + if ( $launch ) { + Utils\check_proc_available( 'launch option' ); + + $descriptors = array( + 0 => STDIN, + 1 => STDOUT, + 2 => STDERR, + ); + + if ( $return ) { + $descriptors = array( + 0 => STDIN, + 1 => array( 'pipe', 'w' ), + 2 => array( 'pipe', 'w' ), + ); + } + + $php_bin = escapeshellarg( Utils\get_php_binary() ); + $script_path = $GLOBALS['argv'][0]; + + // Persist runtime arguments unless they've been specified otherwise. + $configurator = \WP_CLI::get_configurator(); + $argv = array_slice( $GLOBALS['argv'], 1 ); + list( $_, $_, $runtime_config ) = $configurator->parse_args( $argv ); + foreach ( $runtime_config as $k => $v ) { + if ( preg_match( "|^--{$k}=?$|", $command ) ) { + unset( $runtime_config[ $k ] ); + } + } + $runtime_config = Utils\assoc_args_to_str( $runtime_config ); + + $runcommand = "{$php_bin} {$script_path} {$runtime_config} {$command}"; + + $proc = Utils\proc_open_compat( $runcommand, $descriptors, $pipes, getcwd() ); + + if ( $return ) { + $stdout = stream_get_contents( $pipes[1] ); + fclose( $pipes[1] ); + $stderr = stream_get_contents( $pipes[2] ); + fclose( $pipes[2] ); + } + $return_code = proc_close( $proc ); + if ( -1 == $return_code ) { + self::warning( 'Spawned process returned exit code -1, which could be caused by a custom compiled version of PHP that uses the --enable-sigchild option.' ); + } elseif ( $return_code && $exit_error ) { + exit( $return_code ); + } + if ( true === $return || 'stdout' === $return ) { + $retval = trim( $stdout ); + } elseif ( 'stderr' === $return ) { + $retval = trim( $stderr ); + } elseif ( 'return_code' === $return ) { + $retval = $return_code; + } elseif ( 'all' === $return ) { + $retval = (object) array( + 'stdout' => trim( $stdout ), + 'stderr' => trim( $stderr ), + 'return_code' => $return_code, + ); + } + } else { + $configurator = self::get_configurator(); + $argv = Utils\parse_str_to_argv( $command ); + list( $args, $assoc_args, $runtime_config ) = $configurator->parse_args( $argv ); + if ( $return ) { + $existing_logger = self::$logger; + self::$logger = new WP_CLI\Loggers\Execution; + self::$logger->ob_start(); + } + if ( ! $exit_error ) { + self::$capture_exit = true; + } + try { + self::get_runner()->run_command( + $args, $assoc_args, array( + 'back_compat_conversions' => true, + ) + ); + $return_code = 0; + } catch ( ExitException $e ) { + $return_code = $e->getCode(); + } + if ( $return ) { + $execution_logger = self::$logger; + $execution_logger->ob_end(); + self::$logger = $existing_logger; + $stdout = $execution_logger->stdout; + $stderr = $execution_logger->stderr; + if ( true === $return || 'stdout' === $return ) { + $retval = trim( $stdout ); + } elseif ( 'stderr' === $return ) { + $retval = trim( $stderr ); + } elseif ( 'return_code' === $return ) { + $retval = $return_code; + } elseif ( 'all' === $return ) { + $retval = (object) array( + 'stdout' => trim( $stdout ), + 'stderr' => trim( $stderr ), + 'return_code' => $return_code, + ); + } + } + if ( ! $exit_error ) { + self::$capture_exit = false; + } + } + if ( ( true === $return || 'stdout' === $return ) + && 'json' === $parse ) { + $retval = json_decode( $retval, true ); + } + return $retval; + } + + /** + * Run a given command within the current process using the same global + * parameters. + * + * Use `WP_CLI::runcommand()` instead, which is easier to use and works better. + * + * To run a command using a new process with the same global parameters, + * use WP_CLI::launch_self(). To run a command using a new process with + * different global parameters, use WP_CLI::launch(). + * + * ``` + * ob_start(); + * WP_CLI::run_command( array( 'cli', 'cmd-dump' ) ); + * $ret = ob_get_clean(); + * ``` + * + * @access public + * @category Execution + * + * @param array $args Positional arguments including command name. + * @param array $assoc_args + */ + public static function run_command( $args, $assoc_args = array() ) { + self::get_runner()->run_command( $args, $assoc_args ); + } + + + + // DEPRECATED STUFF + + public static function add_man_dir() { + trigger_error( 'WP_CLI::add_man_dir() is deprecated. Add docs inline.', E_USER_WARNING ); + } + + // back-compat + public static function out( $str ) { + fwrite( STDOUT, $str ); + } + + // back-compat + // @codingStandardsIgnoreLine + public static function addCommand( $name, $class ) { + trigger_error( + sprintf( + 'wp %s: %s is deprecated. use WP_CLI::add_command() instead.', + $name, __FUNCTION__ + ), E_USER_WARNING + ); + self::add_command( $name, $class ); + } +} diff --git a/php/commands/cli.php b/php/commands/cli.php new file mode 100644 index 000000000..e1abb4937 --- /dev/null +++ b/php/commands/cli.php @@ -0,0 +1,3 @@ +...] + * : Get help on a specific command. + * + * ## EXAMPLES + * + * # get help for `core` command + * wp help core + * + * # get help for `core download` subcommand + * wp help core download + */ + public function __invoke( $args, $assoc_args ) { + $r = WP_CLI::get_runner()->find_command_to_run( $args ); + + if ( is_array( $r ) ) { + list( $command ) = $r; + + self::show_help( $command ); + exit; + } + } + + private static function show_help( $command ) { + $out = self::get_initial_markdown( $command ); + + // Remove subcommands if in columns - will wordwrap separately. + $subcommands = ''; + $column_subpattern = '[ \t]+[^\t]+\t+'; + if ( preg_match( '/(^## SUBCOMMANDS[^\n]*\n+' . $column_subpattern . '.+?)(?:^##|\z)/ms', $out, $matches, PREG_OFFSET_CAPTURE ) ) { + $subcommands = $matches[1][0]; + $subcommands_header = "## SUBCOMMANDS\n"; + $out = substr_replace( $out, $subcommands_header, $matches[1][1], strlen( $subcommands ) ); + } + + $out .= self::parse_reference_links( $command->get_longdesc() ); + + // definition lists + $out = preg_replace_callback( '/([^\n]+)\n: (.+?)(\n\n|$)/s', array( __CLASS__, 'rewrap_param_desc' ), $out ); + + // Ensure lines with no leading whitespace that aren't section headers are indented. + $out = preg_replace( '/^((?! |\t|##).)/m', "\t$1", $out ); + + $tab = str_repeat( ' ', 2 ); + + // Need to de-tab for wordwrapping to work properly. + $out = str_replace( "\t", $tab, $out ); + + $wordwrap_width = \cli\Shell::columns(); + + // Wordwrap with indent. + $out = preg_replace_callback( + '/^( *)([^\n]+)\n/m', + function ( $matches ) use ( $wordwrap_width ) { + return $matches[1] . str_replace( "\n", "\n{$matches[1]}", wordwrap( $matches[2], $wordwrap_width - strlen( $matches[1] ) ) ) . "\n"; + }, + $out + ); + + if ( $subcommands ) { + // Wordwrap with column indent. + $subcommands = preg_replace_callback( + '/^(' . $column_subpattern . ')([^\n]+)\n/m', + function ( $matches ) use ( $wordwrap_width, $tab ) { + // Need to de-tab for wordwrapping to work properly. + $matches[1] = str_replace( "\t", $tab, $matches[1] ); + $matches[2] = str_replace( "\t", $tab, $matches[2] ); + $padding_len = strlen( $matches[1] ); + $padding = str_repeat( ' ', $padding_len ); + return $matches[1] . str_replace( "\n", "\n$padding", wordwrap( $matches[2], $wordwrap_width - $padding_len ) ) . "\n"; + }, + $subcommands + ); + + // Put subcommands back. + $out = str_replace( $subcommands_header, $subcommands, $out ); + } + + // section headers + $out = preg_replace( '/^## ([A-Z ]+)/m', WP_CLI::colorize( '%9\1%n' ), $out ); + + self::pass_through_pager( $out ); + } + + private static function rewrap_param_desc( $matches ) { + $param = $matches[1]; + $desc = self::indent( "\t\t", $matches[2] ); + return "\t$param\n$desc\n\n"; + } + + private static function indent( $whitespace, $text ) { + $lines = explode( "\n", $text ); + foreach ( $lines as &$line ) { + $line = $whitespace . $line; + } + return implode( $lines, "\n" ); + } + + private static function pass_through_pager( $out ) { + + if ( ! Utils\check_proc_available( null /*context*/, true /*return*/ ) ) { + WP_CLI::debug( 'Warning: check_proc_available() failed in pass_through_pager().', 'help' ); + return $out; + } + + if ( false === ( $pager = getenv( 'PAGER' ) ) ) { + $pager = Utils\is_windows() ? 'more' : 'less -r'; + } + + // For Windows 7 need to set code page to something other than Unicode (65001) to get around "Not enough memory." error with `more.com` on PHP 7.1+. + if ( 'more' === $pager && defined( 'PHP_WINDOWS_VERSION_MAJOR' ) && PHP_WINDOWS_VERSION_MAJOR < 10 && function_exists( 'sapi_windows_cp_set' ) ) { + // Note will also apply to Windows 8 (see http://msdn.microsoft.com/en-us/library/windows/desktop/ms724832.aspx) but probably harmless anyway. + $cp = getenv( 'WP_CLI_WINDOWS_CODE_PAGE' ) ?: 1252; // Code page 1252 is the most used so probably the most compat. + sapi_windows_cp_set( $cp ); // `sapi_windows_cp_set()` introduced PHP 7.1. + } + + // convert string to file handle + $fd = fopen( 'php://temp', 'r+b' ); + fwrite( $fd, $out ); + rewind( $fd ); + + $descriptorspec = array( + 0 => $fd, + 1 => STDOUT, + 2 => STDERR, + ); + + return proc_close( Utils\proc_open_compat( $pager, $descriptorspec, $pipes ) ); + } + + private static function get_initial_markdown( $command ) { + $name = implode( ' ', Dispatcher\get_path( $command ) ); + + $binding = array( + 'name' => $name, + 'shortdesc' => $command->get_shortdesc(), + ); + + $binding['synopsis'] = "$name " . $command->get_synopsis(); + + $alias = $command->get_alias(); + if ( $alias ) { + $binding['alias'] = $alias; + } + + if ( $command->can_have_subcommands() ) { + $binding['has-subcommands']['subcommands'] = self::render_subcommands( $command ); + } + + return Utils\mustache_render( 'man.mustache', $binding ); + } + + private static function render_subcommands( $command ) { + $subcommands = array(); + foreach ( $command->get_subcommands() as $subcommand ) { + + if ( WP_CLI::get_runner()->is_command_disabled( $subcommand ) ) { + continue; + } + + $subcommands[ $subcommand->get_name() ] = $subcommand->get_shortdesc(); + } + + $max_len = self::get_max_len( array_keys( $subcommands ) ); + + $lines = array(); + foreach ( $subcommands as $name => $desc ) { + $lines[] = str_pad( $name, $max_len ) . "\t\t\t" . $desc; + } + + return $lines; + } + + private static function get_max_len( $strings ) { + $max_len = 0; + foreach ( $strings as $str ) { + $len = strlen( $str ); + if ( $len > $max_len ) { + $max_len = $len; + } + } + + return $max_len; + } + + /** + * Parse reference links from longdescription. + * + * @param string $longdesc The longdescription from the `$command->get_longdesc()`. + * @return string The longdescription which has links as footnote. + */ + private static function parse_reference_links( $longdesc ) { + $description = ''; + foreach ( explode( "\n", $longdesc ) as $line ) { + if ( 0 === strpos( $line, '#' ) ) { + break; + } + $description .= $line . "\n"; + } + + // Fires if it has description text at the head of `$longdesc`. + if ( $description ) { + $links = array(); // An array of URLs from the description. + $pattern = '/\[.+?\]\((https?:\/\/.+?)\)/'; + $newdesc = preg_replace_callback( $pattern, function( $matches ) use ( &$links ) { + static $count = 0; + $count++; + $links[] = $matches[1]; + return str_replace( '(' . $matches[1] . ')', '[' . $count . ']', $matches[0] ); + }, $description ); + + $footnote = ''; + for ( $i = 0; $i < count( $links ); $i++ ) { + $n = $i + 1; + $footnote .= '[' . $n . '] ' . $links[ $i ] . "\n"; + } + + if ( $footnote ) { + $newdesc = trim( $newdesc ) . "\n\n---\n" . $footnote; + $longdesc = str_replace( trim( $description ), trim( $newdesc ), $longdesc ); + } + } + + return $longdesc; + } +} + +WP_CLI::add_command( 'help', 'Help_Command' ); + diff --git a/php/commands/src/CLI_Command.php b/php/commands/src/CLI_Command.php new file mode 100644 index 000000000..fa2474fd7 --- /dev/null +++ b/php/commands/src/CLI_Command.php @@ -0,0 +1,624 @@ + $command->get_name(), + 'description' => $command->get_shortdesc(), + 'longdesc' => $command->get_longdesc(), + ); + + foreach ( $command->get_subcommands() as $subcommand ) { + $dump['subcommands'][] = $this->command_to_array( $subcommand ); + } + + if ( empty( $dump['subcommands'] ) ) { + $dump['synopsis'] = (string) $command->get_synopsis(); + } + + return $dump; + } + + /** + * Print WP-CLI version. + * + * ## EXAMPLES + * + * # Display CLI version. + * $ wp cli version + * WP-CLI 0.24.1 + */ + public function version() { + WP_CLI::line( 'WP-CLI ' . WP_CLI_VERSION ); + } + + /** + * Print various details about the WP-CLI environment. + * + * Helpful for diagnostic purposes, this command shares: + * + * * OS information. + * * Shell information. + * * PHP binary used. + * * PHP binary version. + * * php.ini configuration file used (which is typically different than web). + * * WP-CLI root dir: where WP-CLI is installed (if non-Phar install). + * * WP-CLI global config: where the global config YAML file is located. + * * WP-CLI project config: where the project config YAML file is located. + * * WP-CLI version: currently installed version. + * + * See [config docs](https://wp-cli.org/config/) for more details on global + * and project config YAML files. + * + * ## OPTIONS + * + * [--format=] + * : Render output in a particular format. + * --- + * default: list + * options: + * - list + * - json + * --- + * + * ## EXAMPLES + * + * # Display various data about the CLI environment. + * $ wp cli info + * OS: Linux 4.10.0-42-generic #46~16.04.1-Ubuntu SMP Mon Dec 4 15:57:59 UTC 2017 x86_64 + * Shell: /usr/bin/zsh + * PHP binary: /usr/bin/php + * PHP version: 7.1.12-1+ubuntu16.04.1+deb.sury.org+1 + * php.ini used: /etc/php/7.1/cli/php.ini + * WP-CLI root dir: phar://wp-cli.phar + * WP-CLI packages dir: /home/person/.wp-cli/packages/ + * WP-CLI global config: + * WP-CLI project config: + * WP-CLI version: 1.5.0 + */ + public function info( $_, $assoc_args ) { + $php_bin = Utils\get_php_binary(); + + $system_os = sprintf( '%s %s %s %s', php_uname( 's' ), php_uname( 'r' ), php_uname( 'v' ), php_uname( 'm' ) ); + $shell = getenv( 'SHELL' ); + if ( ! $shell && Utils\is_windows() ) { + $shell = getenv( 'ComSpec' ); + } + $runner = WP_CLI::get_runner(); + + $packages_dir = $runner->get_packages_dir_path(); + if ( ! is_dir( $packages_dir ) ) { + $packages_dir = null; + } + if ( \WP_CLI\Utils\get_flag_value( $assoc_args, 'format' ) === 'json' ) { + $info = array( + 'php_binary_path' => $php_bin, + 'global_config_path' => $runner->global_config_path, + 'project_config_path' => $runner->project_config_path, + 'wp_cli_dir_path' => WP_CLI_ROOT, + 'wp_cli_packages_dir_path' => $packages_dir, + 'wp_cli_version' => WP_CLI_VERSION, + 'system_os' => $system_os, + 'shell' => $shell, + ); + + WP_CLI::line( json_encode( $info ) ); + } else { + WP_CLI::line( "OS:\t" . $system_os ); + WP_CLI::line( "Shell:\t" . $shell ); + WP_CLI::line( "PHP binary:\t" . $php_bin ); + WP_CLI::line( "PHP version:\t" . PHP_VERSION ); + WP_CLI::line( "php.ini used:\t" . get_cfg_var( 'cfg_file_path' ) ); + WP_CLI::line( "WP-CLI root dir:\t" . WP_CLI_ROOT ); + WP_CLI::line( "WP-CLI vendor dir:\t" . WP_CLI_VENDOR_DIR ); + WP_CLI::line( "WP_CLI phar path:\t" . ( defined( 'WP_CLI_PHAR_PATH' ) ? WP_CLI_PHAR_PATH : '' ) ); + WP_CLI::line( "WP-CLI packages dir:\t" . $packages_dir ); + WP_CLI::line( "WP-CLI global config:\t" . $runner->global_config_path ); + WP_CLI::line( "WP-CLI project config:\t" . $runner->project_config_path ); + WP_CLI::line( "WP-CLI version:\t" . WP_CLI_VERSION ); + } + } + + /** + * Check to see if there is a newer version of WP-CLI available. + * + * Queries the Github releases API. Returns available versions if there are + * updates available, or success message if using the latest release. + * + * ## OPTIONS + * + * [--patch] + * : Only list patch updates. + * + * [--minor] + * : Only list minor updates. + * + * [--major] + * : Only list major updates. + * + * [--field=] + * : Prints the value of a single field for each update. + * + * [--fields=] + * : Limit the output to specific object fields. Defaults to version,update_type,package_url. + * + * [--format=] + * : Render output in a particular format. + * --- + * default: table + * options: + * - table + * - csv + * - json + * - count + * - yaml + * --- + * + * ## EXAMPLES + * + * # Check for update. + * $ wp cli check-update + * Success: WP-CLI is at the latest version. + * + * # Check for update and new version is available. + * $ wp cli check-update + * +---------+-------------+-------------------------------------------------------------------------------+ + * | version | update_type | package_url | + * +---------+-------------+-------------------------------------------------------------------------------+ + * | 0.24.1 | patch | https://github.com/wp-cli/wp-cli/releases/download/v0.24.1/wp-cli-0.24.1.phar | + * +---------+-------------+-------------------------------------------------------------------------------+ + * + * @subcommand check-update + */ + public function check_update( $_, $assoc_args ) { + $updates = $this->get_updates( $assoc_args ); + + if ( $updates ) { + $formatter = new \WP_CLI\Formatter( + $assoc_args, + array( 'version', 'update_type', 'package_url' ) + ); + $formatter->display_items( $updates ); + } elseif ( empty( $assoc_args['format'] ) || 'table' == $assoc_args['format'] ) { + $update_type = $this->get_update_type_str( $assoc_args ); + WP_CLI::success( "WP-CLI is at the latest{$update_type}version." ); + } + } + + /** + * Update WP-CLI to the latest release. + * + * Default behavior is to check the releases API for the newest stable + * version, and prompt if one is available. + * + * Use `--stable` to install or reinstall the latest stable version. + * + * Use `--nightly` to install the latest built version of the master branch. + * While not recommended for production, nightly contains the latest and + * greatest, and should be stable enough for development and staging + * environments. + * + * Only works for the Phar installation mechanism. + * + * ## OPTIONS + * + * [--patch] + * : Only perform patch updates. + * + * [--minor] + * : Only perform minor updates. + * + * [--major] + * : Only perform major updates. + * + * [--stable] + * : Update to the latest stable release. Skips update check. + * + * [--nightly] + * : Update to the latest built version of the master branch. Potentially unstable. + * + * [--yes] + * : Do not prompt for confirmation. + * + * ## EXAMPLES + * + * # Update CLI. + * $ wp cli update + * You have version 0.24.0. Would you like to update to 0.24.1? [y/n] y + * Downloading from https://github.com/wp-cli/wp-cli/releases/download/v0.24.1/wp-cli-0.24.1.phar... + * New version works. Proceeding to replace. + * Success: Updated WP-CLI to 0.24.1. + */ + public function update( $_, $assoc_args ) { + if ( ! Utils\inside_phar() ) { + WP_CLI::error( 'You can only self-update Phar files.' ); + } + + $old_phar = realpath( $_SERVER['argv'][0] ); + + if ( ! is_writable( $old_phar ) ) { + WP_CLI::error( sprintf( '%s is not writable by current user.', $old_phar ) ); + } elseif ( ! is_writable( dirname( $old_phar ) ) ) { + WP_CLI::error( sprintf( '%s is not writable by current user.', dirname( $old_phar ) ) ); + } + + if ( Utils\get_flag_value( $assoc_args, 'nightly' ) ) { + WP_CLI::confirm( sprintf( 'You have version %s. Would you like to update to the latest nightly?', WP_CLI_VERSION ), $assoc_args ); + $download_url = 'https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli-nightly.phar'; + $md5_url = 'https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli-nightly.phar.md5'; + } elseif ( Utils\get_flag_value( $assoc_args, 'stable' ) ) { + WP_CLI::confirm( sprintf( 'You have version %s. Would you like to update to the latest stable release?', WP_CLI_VERSION ), $assoc_args ); + $download_url = 'https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar'; + $md5_url = 'https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar.md5'; + } else { + + $updates = $this->get_updates( $assoc_args ); + + if ( empty( $updates ) ) { + $update_type = $this->get_update_type_str( $assoc_args ); + WP_CLI::success( "WP-CLI is at the latest{$update_type}version." ); + return; + } + + $newest = $updates[0]; + + WP_CLI::confirm( sprintf( 'You have version %s. Would you like to update to %s?', WP_CLI_VERSION, $newest['version'] ), $assoc_args ); + + $download_url = $newest['package_url']; + $md5_url = str_replace( '.phar', '.phar.md5', $download_url ); + } + + WP_CLI::log( sprintf( 'Downloading from %s...', $download_url ) ); + + $temp = \WP_CLI\Utils\get_temp_dir() . uniqid( 'wp_', true ) . '.phar'; + + $headers = array(); + $options = array( + 'timeout' => 600, // 10 minutes ought to be enough for everybody. + 'filename' => $temp, + ); + + Utils\http_request( 'GET', $download_url, null, $headers, $options ); + + $md5_response = Utils\http_request( 'GET', $md5_url ); + if ( 20 != substr( $md5_response->status_code, 0, 2 ) ) { + WP_CLI::error( "Couldn't access md5 hash for release (HTTP code {$md5_response->status_code})." ); + } + $md5_file = md5_file( $temp ); + $release_hash = trim( $md5_response->body ); + if ( $md5_file === $release_hash ) { + WP_CLI::log( 'md5 hash verified: ' . $release_hash ); + } else { + WP_CLI::error( "md5 hash for download ({$md5_file}) is different than the release hash ({$release_hash})." ); + } + + $allow_root = WP_CLI::get_runner()->config['allow-root'] ? '--allow-root' : ''; + $php_binary = Utils\get_php_binary(); + $process = WP_CLI\Process::create( "{$php_binary} $temp --info {$allow_root}" ); + $result = $process->run(); + if ( 0 !== $result->return_code || false === stripos( $result->stdout, 'WP-CLI version:' ) ) { + $multi_line = explode( PHP_EOL, $result->stderr ); + WP_CLI::error_multi_line( $multi_line ); + WP_CLI::error( 'The downloaded PHAR is broken, try running wp cli update again.' ); + } + + WP_CLI::log( 'New version works. Proceeding to replace.' ); + + $mode = fileperms( $old_phar ) & 511; + + if ( false === chmod( $temp, $mode ) ) { + WP_CLI::error( sprintf( 'Cannot chmod %s.', $temp ) ); + } + + class_exists( '\cli\Colors' ); // This autoloads \cli\Colors - after we move the file we no longer have access to this class. + + if ( false === rename( $temp, $old_phar ) ) { + WP_CLI::error( sprintf( 'Cannot move %s to %s', $temp, $old_phar ) ); + } + + if ( Utils\get_flag_value( $assoc_args, 'nightly' ) ) { + $updated_version = 'the latest nightly release'; + } elseif ( Utils\get_flag_value( $assoc_args, 'stable' ) ) { + $updated_version = 'the latest stable release'; + } else { + $updated_version = $newest['version']; + } + WP_CLI::success( sprintf( 'Updated WP-CLI to %s.', $updated_version ) ); + } + + /** + * Returns update information. + */ + private function get_updates( $assoc_args ) { + $url = 'https://api.github.com/repos/wp-cli/wp-cli/releases?per_page=100'; + + $options = array( + 'timeout' => 30, + ); + + $headers = array( + 'Accept' => 'application/json', + ); + if ( $github_token = getenv( 'GITHUB_TOKEN' ) ) { + $headers['Authorization'] = 'token ' . $github_token; + } + + $response = Utils\http_request( 'GET', $url, null, $headers, $options ); + + if ( ! $response->success || 200 !== $response->status_code ) { + WP_CLI::error( sprintf( 'Failed to get latest version (HTTP code %d).', $response->status_code ) ); + } + + $release_data = json_decode( $response->body ); + + $updates = array( + 'major' => false, + 'minor' => false, + 'patch' => false, + ); + foreach ( $release_data as $release ) { + + // Get rid of leading "v" if there is one set. + $release_version = $release->tag_name; + if ( 'v' === substr( $release_version, 0, 1 ) ) { + $release_version = ltrim( $release_version, 'v' ); + } + + $update_type = Utils\get_named_sem_ver( $release_version, WP_CLI_VERSION ); + if ( ! $update_type ) { + continue; + } + + if ( ! empty( $updates[ $update_type ] ) && ! Comparator::greaterThan( $release_version, $updates[ $update_type ]['version'] ) ) { + continue; + } + + $updates[ $update_type ] = array( + 'version' => $release_version, + 'update_type' => $update_type, + 'package_url' => $release->assets[0]->browser_download_url, + ); + } + + foreach ( $updates as $type => $value ) { + if ( empty( $value ) ) { + unset( $updates[ $type ] ); + } + } + + foreach ( array( 'major', 'minor', 'patch' ) as $type ) { + if ( true === \WP_CLI\Utils\get_flag_value( $assoc_args, $type ) ) { + return ! empty( $updates[ $type ] ) ? array( $updates[ $type ] ) : false; + } + } + + if ( empty( $updates ) && preg_match( '#-alpha-(.+)$#', WP_CLI_VERSION, $matches ) ) { + $version_url = 'https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/NIGHTLY_VERSION'; + $response = Utils\http_request( 'GET', $version_url ); + if ( ! $response->success || 200 !== $response->status_code ) { + WP_CLI::error( sprintf( 'Failed to get current nightly version (HTTP code %d)', $response->status_code ) ); + } + $nightly_version = trim( $response->body ); + if ( WP_CLI_VERSION != $nightly_version ) { + $updates['nightly'] = array( + 'version' => $nightly_version, + 'update_type' => 'nightly', + 'package_url' => 'https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli-nightly.phar', + ); + } + } + + return array_values( $updates ); + } + + /** + * Dump the list of global parameters, as JSON or in var_export format. + * + * ## OPTIONS + * + * [--with-values] + * : Display current values also. + * + * [--format=] + * : Render output in a particular format. + * --- + * default: json + * options: + * - var_export + * - json + * --- + * + * ## EXAMPLES + * + * # Dump the list of global parameters. + * $ wp cli param-dump --format=var_export + * array ( + * 'path' => + * array ( + * 'runtime' => '=', + * 'file' => '', + * 'synopsis' => '', + * 'default' => NULL, + * 'multiple' => false, + * 'desc' => 'Path to the WordPress files.', + * ), + * 'url' => + * array ( + * + * @subcommand param-dump + */ + public function param_dump( $_, $assoc_args ) { + $spec = \WP_CLI::get_configurator()->get_spec(); + + if ( \WP_CLI\Utils\get_flag_value( $assoc_args, 'with-values' ) ) { + $config = \WP_CLI::get_configurator()->to_array(); + // Copy current config values to $spec + foreach ( $spec as $key => $value ) { + $current = null; + if ( isset( $config[0][ $key ] ) ) { + $current = $config[0][ $key ]; + } + $spec[ $key ]['current'] = $current; + } + } + + if ( 'var_export' === \WP_CLI\Utils\get_flag_value( $assoc_args, 'format' ) ) { + var_export( $spec ); + } else { + echo json_encode( $spec ); + } + } + + /** + * Dump the list of installed commands, as JSON. + * + * ## EXAMPLES + * + * # Dump the list of installed commands. + * $ wp cli cmd-dump + * {"name":"wp","description":"Manage WordPress through the command-line.","longdesc":"\n\n## GLOBAL PARAMETERS\n\n --path=\n Path to the WordPress files.\n\n --ssh=\n Perform operation against a remote server over SSH (or a container using scheme of "docker" or "docker-compose").\n\n --url=\n Pretend request came from given URL. In multisite, this argument is how the target site is specified. \n\n --user=\n + * + * @subcommand cmd-dump + */ + public function cmd_dump() { + echo json_encode( $this->command_to_array( WP_CLI::get_root_command() ) ); + } + + /** + * Generate tab completion strings. + * + * ## OPTIONS + * + * --line= + * : The current command line to be executed. + * + * --point= + * : The index to the current cursor position relative to the beginning of the command. + * + * ## EXAMPLES + * + * # Generate tab completion strings. + * $ wp cli completions --line='wp eva' --point=100 + * eval + * eval-file + */ + public function completions( $_, $assoc_args ) { + $line = substr( $assoc_args['line'], 0, $assoc_args['point'] ); + $compl = new \WP_CLI\Completions( $line ); + $compl->render(); + } + + /** + * List available WP-CLI aliases. + * + * Aliases are shorthand references to WordPress installs. For instance, + * `@dev` could refer to a development install and `@prod` could refer to + * a production install. This command gives you visibility in what + * registered aliases you have available. + * + * ## OPTIONS + * + * [--format=] + * : Render output in a particular format. + * --- + * default: yaml + * options: + * - yaml + * - json + * --- + * + * ## EXAMPLES + * + * # List all available aliases. + * $ wp cli alias + * --- + * @all: Run command against every registered alias. + * @prod: + * ssh: runcommand@runcommand.io~/webapps/production + * @dev: + * ssh: vagrant@192.168.50.10/srv/www/runcommand.dev + * @both: + * - @prod + * - @dev + * + * @alias aliases + */ + public function alias( $_, $assoc_args ) { + WP_CLI::print_value( WP_CLI::get_runner()->aliases, $assoc_args ); + } + + /** + * Get a string representing the type of update being checked for. + */ + private function get_update_type_str( $assoc_args ) { + $update_type = ' '; + foreach ( array( 'major', 'minor', 'patch' ) as $type ) { + if ( true === \WP_CLI\Utils\get_flag_value( $assoc_args, $type ) ) { + $update_type = ' ' . $type . ' '; + break; + } + } + return $update_type; + } + + /** + * Detects if a command exists + * + * This commands checks if a command is registered with WP-CLI. + * If the command is found then it returns with exit status 0. + * If the command doesn't exist, then it will exit with status 1. + * + * ## OPTIONS + * ... + * : The command + * + * ## EXAMPLES + * + * # The "site delete" command is registered. + * $ wp cli has-command "site delete" + * $ echo $? + * 0 + * + * # The "foo bar" command is not registered. + * $ wp cli has-command "foo bar" + * $ echo $? + * 1 + * + * @subcommand has-command + * + * @when after_wp_load + */ + public function has_command( $_, $assoc_args ) { + + // If command is input as a string, then explode it into array. + $command = explode( ' ', implode( ' ', $_ ) ); + + WP_CLI::halt( is_array( WP_CLI::get_runner()->find_command_to_run( $command ) ) ? 0 : 1 ); + } +} diff --git a/php/config-spec.php b/php/config-spec.php new file mode 100644 index 000000000..15456002c --- /dev/null +++ b/php/config-spec.php @@ -0,0 +1,117 @@ + array( + 'runtime' => '=', + 'file' => '', + 'desc' => 'Path to the WordPress files.', + ), + + 'url' => array( + 'runtime' => '=', + 'file' => '', + 'desc' => 'Pretend request came from given URL. In multisite, this argument is how the target site is specified.', + ), + + 'ssh' => array( + 'runtime' => '=[:][@][:][]', + 'file' => '[:][@][:][]', + 'desc' => 'Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "vagrant").', + ), + + 'http' => array( + 'runtime' => '=', + 'file' => '', + 'desc' => 'Perform operation against a remote WordPress install over HTTP.', + ), + + 'blog' => array( + 'deprecated' => 'Use --url instead.', + 'runtime' => '=', + ), + + 'user' => array( + 'runtime' => '=', + 'file' => '', + 'desc' => 'Set the WordPress user.', + ), + + 'skip-plugins' => array( + 'runtime' => '[=]', + 'file' => '', + 'desc' => 'Skip loading all or some plugins. Note: mu-plugins are still loaded.', + 'default' => '', + ), + + 'skip-themes' => array( + 'runtime' => '[=]', + 'file' => '', + 'desc' => 'Skip loading all or some themes.', + 'default' => '', + ), + + 'skip-packages' => array( + 'runtime' => '', + 'file' => '', + 'desc' => 'Skip loading all installed packages.', + 'default' => false, + ), + + 'require' => array( + 'runtime' => '=', + 'file' => '', + 'desc' => 'Load PHP file before running the command (may be used more than once).', + 'multiple' => true, + 'default' => array(), + ), + + 'disabled_commands' => array( + 'file' => '', + 'default' => array(), + 'desc' => '(Sub)commands to disable.', + ), + + 'color' => array( + 'runtime' => true, + 'file' => '', + 'default' => 'auto', + 'desc' => 'Whether to colorize the output.', + ), + + 'debug' => array( + 'runtime' => '[=]', + 'file' => '', + 'default' => false, + 'desc' => 'Show all PHP errors; add verbosity to WP-CLI bootstrap.', + ), + + 'prompt' => array( + 'runtime' => '[=]', + 'file' => false, + 'default' => false, + 'desc' => 'Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values.', + ), + + 'quiet' => array( + 'runtime' => '', + 'file' => '', + 'default' => false, + 'desc' => 'Suppress informational messages.', + ), + + 'apache_modules' => array( + 'file' => '', + 'desc' => 'List of Apache Modules that are to be reported as loaded.', + 'multiple' => true, + 'default' => array(), + ), + + # --allow-root => (NOT RECOMMENDED) Allow wp-cli to run as root. This poses + # a security risk, so you probably do not want to do this. + 'allow-root' => array( + 'file' => false, # Explicit. Just in case the default changes. + 'runtime' => '', + 'hidden' => true, + ), + +); diff --git a/php/dispatcher.php b/php/dispatcher.php new file mode 100644 index 000000000..bd11a3927 --- /dev/null +++ b/php/dispatcher.php @@ -0,0 +1,20 @@ +get_name() ); + } while ( $command = $command->get_parent() ); + + return $path; +} + diff --git a/php/utils-wp.php b/php/utils-wp.php new file mode 100644 index 000000000..96b3aaba3 --- /dev/null +++ b/php/utils-wp.php @@ -0,0 +1,373 @@ +get_col( "SHOW TABLES LIKE '%_options'" ); + $found_prefixes = array(); + if ( count( $tables ) ) { + foreach ( $tables as $table ) { + $maybe_prefix = substr( $table, 0, - strlen( 'options' ) ); + if ( $maybe_prefix !== $table_prefix ) { + $found_prefixes[] = $maybe_prefix; + } + } + } + if ( count( $found_prefixes ) ) { + $prefix_list = implode( ', ', $found_prefixes ); + $install_label = count( $found_prefixes ) > 1 ? 'installs' : 'install'; + \WP_CLI::error( + "The site you have requested is not installed.\n" . + "Your table prefix is '{$table_prefix}'. Found {$install_label} with table prefix: {$prefix_list}.\n" . + 'Or, run `wp core install` to create database tables.' + ); + } else { + \WP_CLI::error( + "The site you have requested is not installed.\n" . + 'Run `wp core install` to create database tables.' + ); + } + } +} + +function wp_debug_mode() { + if ( \WP_CLI::get_config( 'debug' ) ) { + if ( ! defined( 'WP_DEBUG' ) ) { + define( 'WP_DEBUG', true ); + } + + error_reporting( E_ALL & ~E_DEPRECATED & ~E_STRICT ); + } else { + if ( WP_DEBUG ) { + error_reporting( E_ALL ); + + if ( WP_DEBUG_DISPLAY ) { + ini_set( 'display_errors', 1 ); + } elseif ( null !== WP_DEBUG_DISPLAY ) { + ini_set( 'display_errors', 0 ); + } + + if ( WP_DEBUG_LOG ) { + ini_set( 'log_errors', 1 ); + ini_set( 'error_log', WP_CONTENT_DIR . '/debug.log' ); + } + } else { + error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR ); + } + + if ( defined( 'XMLRPC_REQUEST' ) || defined( 'REST_REQUEST' ) || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) { + ini_set( 'display_errors', 0 ); + } + } + + // XDebug already sends errors to STDERR + ini_set( 'display_errors', function_exists( 'xdebug_debug_zval' ) ? false : 'STDERR' ); +} + +function replace_wp_die_handler() { + \remove_filter( 'wp_die_handler', '_default_wp_die_handler' ); + \add_filter( + 'wp_die_handler', function() { + return __NAMESPACE__ . '\\' . 'wp_die_handler'; + } + ); +} + +function wp_die_handler( $message ) { + if ( $message instanceof \WP_Error ) { + $message = $message->get_error_message(); + } + + $message = wp_clean_error_message( $message ); + + \WP_CLI::error( $message ); +} + +/** + * Clean HTML error message so suitable for text display. + */ +function wp_clean_error_message( $message ) { + $original_message = $message = trim( $message ); + if ( preg_match( '|^\

(.+?)

|', $original_message, $matches ) ) { + $message = $matches[1] . '.'; + } + if ( preg_match( '|\

(.+?)

|', $original_message, $matches ) ) { + $message .= ' ' . $matches[1]; + } + + $search_replace = array( + '' => '`', + '' => '`', + ); + $message = str_replace( array_keys( $search_replace ), array_values( $search_replace ), $message ); + $message = strip_tags( $message ); + $message = html_entity_decode( $message, ENT_COMPAT, 'UTF-8' ); + + return $message; +} + +function wp_redirect_handler( $url ) { + \WP_CLI::warning( 'Some code is trying to do a URL redirect. Backtrace:' ); + + ob_start(); + debug_print_backtrace(); + fwrite( STDERR, ob_get_clean() ); + + return $url; +} + +function maybe_require( $since, $path ) { + if ( wp_version_compare( $since, '>=' ) ) { + require $path; + } +} + +function get_upgrader( $class ) { + if ( ! class_exists( '\WP_Upgrader' ) ) { + require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; + } + + return new $class( new \WP_CLI\UpgraderSkin ); +} + +/** + * Converts a plugin basename back into a friendly slug. + */ +function get_plugin_name( $basename ) { + if ( false === strpos( $basename, '/' ) ) { + $name = basename( $basename, '.php' ); + } else { + $name = dirname( $basename ); + } + + return $name; +} + +function is_plugin_skipped( $file ) { + $name = get_plugin_name( str_replace( WP_PLUGIN_DIR . '/', '', $file ) ); + + $skipped_plugins = \WP_CLI::get_runner()->config['skip-plugins']; + if ( true === $skipped_plugins ) { + return true; + } + + if ( ! is_array( $skipped_plugins ) ) { + $skipped_plugins = explode( ',', $skipped_plugins ); + } + + return in_array( $name, array_filter( $skipped_plugins ) ); +} + +function get_theme_name( $path ) { + return basename( $path ); +} + +function is_theme_skipped( $path ) { + $name = get_theme_name( $path ); + + $skipped_themes = \WP_CLI::get_runner()->config['skip-themes']; + if ( true === $skipped_themes ) { + return true; + } + + if ( ! is_array( $skipped_themes ) ) { + $skipped_themes = explode( ',', $skipped_themes ); + } + + return in_array( $name, array_filter( $skipped_themes ) ); +} + +/** + * Register the sidebar for unused widgets + * Core does this in /wp-admin/widgets.php, which isn't helpful + */ +function wp_register_unused_sidebar() { + + register_sidebar( + array( + 'name' => __( 'Inactive Widgets' ), + 'id' => 'wp_inactive_widgets', + 'class' => 'inactive-sidebar', + 'description' => __( 'Drag widgets here to remove them from the sidebar but keep their settings.' ), + 'before_widget' => '', + 'after_widget' => '', + 'before_title' => '', + 'after_title' => '', + ) + ); + +} + +/** + * Attempts to determine which object cache is being used. + * + * Note that the guesses made by this function are based on the WP_Object_Cache classes + * that define the 3rd party object cache extension. Changes to those classes could render + * problems with this function's ability to determine which object cache is being used. + * + * @return string + */ +function wp_get_cache_type() { + global $_wp_using_ext_object_cache, $wp_object_cache; + + if ( ! empty( $_wp_using_ext_object_cache ) ) { + // Test for Memcached PECL extension memcached object cache (https://github.com/tollmanz/wordpress-memcached-backend) + if ( isset( $wp_object_cache->m ) && is_a( $wp_object_cache->m, 'Memcached' ) ) { + $message = 'Memcached'; + + // Test for Memcache PECL extension memcached object cache (http://wordpress.org/extend/plugins/memcached/) + } elseif ( isset( $wp_object_cache->mc ) ) { + $is_memcache = true; + foreach ( $wp_object_cache->mc as $bucket ) { + if ( ! is_a( $bucket, 'Memcache' ) && ! is_a( $bucket, 'Memcached' ) ) { + $is_memcache = false; + } + } + + if ( $is_memcache ) { + $message = 'Memcache'; + } + + // Test for Xcache object cache (http://plugins.svn.wordpress.org/xcache/trunk/object-cache.php) + } elseif ( is_a( $wp_object_cache, 'XCache_Object_Cache' ) ) { + $message = 'Xcache'; + + // Test for WinCache object cache (http://wordpress.org/extend/plugins/wincache-object-cache-backend/) + } elseif ( class_exists( 'WinCache_Object_Cache' ) ) { + $message = 'WinCache'; + + // Test for APC object cache (http://wordpress.org/extend/plugins/apc/) + } elseif ( class_exists( 'APC_Object_Cache' ) ) { + $message = 'APC'; + + // Test for Redis Object Cache (https://github.com/alleyinteractive/wp-redis) + } elseif ( isset( $wp_object_cache->redis ) && is_a( $wp_object_cache->redis, 'Redis' ) ) { + $message = 'Redis'; + + // Test for WP LCache Object cache (https://github.com/lcache/wp-lcache) + } elseif ( isset( $wp_object_cache->lcache ) && is_a( $wp_object_cache->lcache, '\LCache\Integrated' ) ) { + $message = 'WP LCache'; + + } elseif ( function_exists( 'w3_instance' ) ) { + $config = w3_instance( 'W3_Config' ); + $message = 'Unknown'; + + if ( $config->get_boolean( 'objectcache.enabled' ) ) { + $message = 'W3TC ' . $config->get_string( 'objectcache.engine' ); + } + } else { + $message = 'Unknown'; + } + } else { + $message = 'Default'; + } + return $message; +} + +/** + * Clear WordPress internal object caches. + * + * In long-running scripts, the internal caches on `$wp_object_cache` and `$wpdb` + * can grow to consume gigabytes of memory. Periodically calling this utility + * can help with memory management. + * + * @access public + * @category System + * @deprecated 1.5.0 + */ +function wp_clear_object_cache() { + global $wpdb, $wp_object_cache; + + $wpdb->queries = array(); // or define( 'WP_IMPORTING', true ); + + if ( ! is_object( $wp_object_cache ) ) { + return; + } + + // The following are Memcached (Redux) plugin specific (see https://core.trac.wordpress.org/ticket/31463). + if ( isset( $wp_object_cache->group_ops ) ) { + $wp_object_cache->group_ops = array(); + } + if ( isset( $wp_object_cache->stats ) ) { + $wp_object_cache->stats = array(); + } + if ( isset( $wp_object_cache->memcache_debug ) ) { + $wp_object_cache->memcache_debug = array(); + } + // Used by `WP_Object_Cache` also. + if ( isset( $wp_object_cache->cache ) ) { + $wp_object_cache->cache = array(); + } +} + +/** + * Get a set of tables in the database. + * + * Interprets common command-line options into a resolved set of table names. + * + * @param array $args Provided table names, or tables with wildcards. + * @param array $assoc_args Optional flags for groups of tables (e.g. --network) + * @return array $tables + */ +function wp_get_table_names( $args, $assoc_args = array() ) { + global $wpdb; + + $tables = array(); + if ( get_flag_value( $assoc_args, 'all-tables' ) ) { + $tables = $wpdb->get_col( 'SHOW TABLES' ); + + } elseif ( get_flag_value( $assoc_args, 'all-tables-with-prefix' ) ) { + $tables = $wpdb->get_col( $wpdb->prepare( 'SHOW TABLES LIKE %s', esc_like( $wpdb->get_blog_prefix() ) . '%' ) ); + + } else { + $scope = get_flag_value( $assoc_args, 'scope', 'all' ); + + // Note: BC change 1.5.0, taking scope into consideration for network also. + if ( get_flag_value( $assoc_args, 'network' ) && is_multisite() ) { + $network_global_scope = in_array( $scope, array( 'all', 'global', 'ms_global' ), true ) ? ( 'all' === $scope ? 'global' : $scope ) : ''; + $wp_tables = array_values( $wpdb->tables( $network_global_scope ) ); + if ( in_array( $scope, array( 'all', 'blog' ), true ) ) { + // Do directly for compat with old WP versions. Note: private, deleted, archived sites are not excluded. + $blog_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs WHERE site_id = $wpdb->siteid" ); + foreach ( $blog_ids as $blog_id ) { + $wp_tables = array_merge( $wp_tables, array_values( $wpdb->tables( 'blog', true /*prefix*/, $blog_id ) ) ); + } + } + } else { + $wp_tables = array_values( $wpdb->tables( $scope ) ); + } + + if ( ! global_terms_enabled() ) { + // Only include sitecategories when it's actually enabled. + $wp_tables = array_values( array_diff( $wp_tables, array( $wpdb->sitecategories ) ) ); + } + + // Note: BC change 1.5.0, tables are sorted (via TABLES view). + // @codingStandardsIgnoreLine + $tables = $wpdb->get_col( sprintf( "SHOW TABLES WHERE %s IN ('%s')", esc_sql_ident( 'Tables_in_' . $wpdb->dbname ), implode( "', '", $wpdb->_escape( $wp_tables ) ) ) ); + } + + // Filter by `$args`. + if ( $args ) { + $args_tables = array(); + foreach ( $args as $arg ) { + if ( false !== strpos( $arg, '*' ) || false !== strpos( $arg, '?' ) ) { + $args_tables = array_merge( $args_tables, array_filter( $tables, function ( $v ) use ( $arg ) { + return fnmatch( $arg, $v ); + } ) ); + } else { + $args_tables[] = $arg; + } + } + $args_tables = array_values( array_unique( $args_tables ) ); + if ( ! ( $tables = array_values( array_intersect( $tables, $args_tables ) ) ) ) { + \WP_CLI::error( sprintf( "Couldn't find any tables matching: %s", implode( ' ', $args ) ) ); + } + } + + return $tables; +} diff --git a/php/utils.php b/php/utils.php new file mode 100644 index 000000000..26b3dbbed --- /dev/null +++ b/php/utils.php @@ -0,0 +1,1453 @@ +config ) && ! empty( $composer->config->{'vendor-dir'} ) ) { + array_unshift( $vendor_paths, WP_CLI_ROOT . '/../../../' . $composer->config->{'vendor-dir'} ); + } + } + return $vendor_paths; +} + +// Using require() directly inside a class grants access to private methods to the loaded code +function load_file( $path ) { + require_once $path; +} + +function load_command( $name ) { + $path = WP_CLI_ROOT . "/php/commands/$name.php"; + + if ( is_readable( $path ) ) { + include_once $path; + } +} + +/** + * Like array_map(), except it returns a new iterator, instead of a modified array. + * + * Example: + * + * $arr = array('Football', 'Socker'); + * + * $it = iterator_map($arr, 'strtolower', function($val) { + * return str_replace('foo', 'bar', $val); + * }); + * + * foreach ( $it as $val ) { + * var_dump($val); + * } + * + * @param array|object Either a plain array or another iterator + * @param callback The function to apply to an element + * @return object An iterator that applies the given callback(s) + */ +function iterator_map( $it, $fn ) { + if ( is_array( $it ) ) { + $it = new \ArrayIterator( $it ); + } + + if ( ! method_exists( $it, 'add_transform' ) ) { + $it = new Transform( $it ); + } + + foreach ( array_slice( func_get_args(), 1 ) as $fn ) { + $it->add_transform( $fn ); + } + + return $it; +} + +/** + * Search for file by walking up the directory tree until the first file is found or until $stop_check($dir) returns true + * @param string|array The files (or file) to search for + * @param string|null The directory to start searching from; defaults to CWD + * @param callable Function which is passed the current dir each time a directory level is traversed + * @return null|string Null if the file was not found + */ +function find_file_upward( $files, $dir = null, $stop_check = null ) { + $files = (array) $files; + if ( is_null( $dir ) ) { + $dir = getcwd(); + } + while ( is_readable( $dir ) ) { + // Stop walking up when the supplied callable returns true being passed the $dir + if ( is_callable( $stop_check ) && call_user_func( $stop_check, $dir ) ) { + return null; + } + + foreach ( $files as $file ) { + $path = $dir . DIRECTORY_SEPARATOR . $file; + if ( file_exists( $path ) ) { + return $path; + } + } + + $parent_dir = dirname( $dir ); + if ( empty( $parent_dir ) || $parent_dir === $dir ) { + break; + } + $dir = $parent_dir; + } + return null; +} + +function is_path_absolute( $path ) { + // Windows + if ( isset( $path[1] ) && ':' === $path[1] ) { + return true; + } + + return '/' === $path[0]; +} + +/** + * Composes positional arguments into a command string. + * + * @param array + * @return string + */ +function args_to_str( $args ) { + return ' ' . implode( ' ', array_map( 'escapeshellarg', $args ) ); +} + +/** + * Composes associative arguments into a command string. + * + * @param array + * @return string + */ +function assoc_args_to_str( $assoc_args ) { + $str = ''; + + foreach ( $assoc_args as $key => $value ) { + if ( true === $value ) { + $str .= " --$key"; + } elseif ( is_array( $value ) ) { + foreach ( $value as $_ => $v ) { + $str .= assoc_args_to_str( + array( + $key => $v, + ) + ); + } + } else { + $str .= " --$key=" . escapeshellarg( $value ); + } + } + + return $str; +} + +/** + * Given a template string and an arbitrary number of arguments, + * returns the final command, with the parameters escaped. + */ +function esc_cmd( $cmd ) { + if ( func_num_args() < 2 ) { + trigger_error( 'esc_cmd() requires at least two arguments.', E_USER_WARNING ); + } + + $args = func_get_args(); + + $cmd = array_shift( $args ); + + return vsprintf( $cmd, array_map( 'escapeshellarg', $args ) ); +} + +function locate_wp_config() { + static $path; + + if ( null === $path ) { + $path = false; + + if ( file_exists( ABSPATH . 'wp-config.php' ) ) { + $path = ABSPATH . 'wp-config.php'; + } elseif ( file_exists( ABSPATH . '../wp-config.php' ) && ! file_exists( ABSPATH . '/../wp-settings.php' ) ) { + $path = ABSPATH . '../wp-config.php'; + } + + if ( $path ) { + $path = realpath( $path ); + } + } + + return $path; +} + +function wp_version_compare( $since, $operator ) { + $wp_version = str_replace( '-src', '', $GLOBALS['wp_version'] ); + $since = str_replace( '-src', '', $since ); + return version_compare( $wp_version, $since, $operator ); +} + +/** + * Render a collection of items as an ASCII table, JSON, CSV, YAML, list of ids, or count. + * + * Given a collection of items with a consistent data structure: + * + * ``` + * $items = array( + * array( + * 'key' => 'foo', + * 'value' => 'bar', + * ) + * ); + * ``` + * + * Render `$items` as an ASCII table: + * + * ``` + * WP_CLI\Utils\format_items( 'table', $items, array( 'key', 'value' ) ); + * + * # +-----+-------+ + * # | key | value | + * # +-----+-------+ + * # | foo | bar | + * # +-----+-------+ + * ``` + * + * Or render `$items` as YAML: + * + * ``` + * WP_CLI\Utils\format_items( 'yaml', $items, array( 'key', 'value' ) ); + * + * # --- + * # - + * # key: foo + * # value: bar + * ``` + * + * @access public + * @category Output + * + * @param string $format Format to use: 'table', 'json', 'csv', 'yaml', 'ids', 'count' + * @param array $items An array of items to output. + * @param array|string $fields Named fields for each item of data. Can be array or comma-separated list. + * @return null + */ +function format_items( $format, $items, $fields ) { + $assoc_args = compact( 'format', 'fields' ); + $formatter = new \WP_CLI\Formatter( $assoc_args ); + $formatter->display_items( $items ); +} + +/** + * Write data as CSV to a given file. + * + * @access public + * + * @param resource $fd File descriptor + * @param array $rows Array of rows to output + * @param array $headers List of CSV columns (optional) + */ +function write_csv( $fd, $rows, $headers = array() ) { + if ( ! empty( $headers ) ) { + fputcsv( $fd, $headers ); + } + + foreach ( $rows as $row ) { + if ( ! empty( $headers ) ) { + $row = pick_fields( $row, $headers ); + } + + fputcsv( $fd, array_values( $row ) ); + } +} + +/** + * Pick fields from an associative array or object. + * + * @param array|object Associative array or object to pick fields from + * @param array List of fields to pick + * @return array + */ +function pick_fields( $item, $fields ) { + $item = (object) $item; + + $values = array(); + + foreach ( $fields as $field ) { + $values[ $field ] = isset( $item->$field ) ? $item->$field : null; + } + + return $values; +} + +/** + * Launch system's $EDITOR for the user to edit some text. + * + * @access public + * @category Input + * + * @param string $content Some form of text to edit (e.g. post content) + * @return string|bool Edited text, if file is saved from editor; false, if no change to file. + */ +function launch_editor_for_input( $input, $filename = 'WP-CLI' ) { + + check_proc_available( 'launch_editor_for_input' ); + + $tmpdir = get_temp_dir(); + + do { + $tmpfile = basename( $filename ); + $tmpfile = preg_replace( '|\.[^.]*$|', '', $tmpfile ); + $tmpfile .= '-' . substr( md5( mt_rand() ), 0, 6 ); + $tmpfile = $tmpdir . $tmpfile . '.tmp'; + $fp = fopen( $tmpfile, 'xb' ); + if ( ! $fp && is_writable( $tmpdir ) && file_exists( $tmpfile ) ) { + $tmpfile = ''; + continue; + } + if ( $fp ) { + fclose( $fp ); + } + } while ( ! $tmpfile ); + + if ( ! $tmpfile ) { + \WP_CLI::error( 'Error creating temporary file.' ); + } + + $output = ''; + file_put_contents( $tmpfile, $input ); + + $editor = getenv( 'EDITOR' ); + if ( ! $editor ) { + $editor = is_windows() ? 'notepad' : 'vi'; + } + + $descriptorspec = array( STDIN, STDOUT, STDERR ); + $process = proc_open_compat( "$editor " . escapeshellarg( $tmpfile ), $descriptorspec, $pipes ); + $r = proc_close( $process ); + if ( $r ) { + exit( $r ); + } + + $output = file_get_contents( $tmpfile ); + + unlink( $tmpfile ); + + if ( $output === $input ) { + return false; + } + + return $output; +} + +/** + * @param string MySQL host string, as defined in wp-config.php + * @return array + */ +function mysql_host_to_cli_args( $raw_host ) { + $assoc_args = array(); + + $host_parts = explode( ':', $raw_host ); + if ( count( $host_parts ) == 2 ) { + list( $assoc_args['host'], $extra ) = $host_parts; + $extra = trim( $extra ); + if ( is_numeric( $extra ) ) { + $assoc_args['port'] = (int) $extra; + $assoc_args['protocol'] = 'tcp'; + } elseif ( '' !== $extra ) { + $assoc_args['socket'] = $extra; + } + } else { + $assoc_args['host'] = $raw_host; + } + + return $assoc_args; +} + +function run_mysql_command( $cmd, $assoc_args, $descriptors = null ) { + check_proc_available( 'run_mysql_command' ); + + if ( ! $descriptors ) { + $descriptors = array( STDIN, STDOUT, STDERR ); + } + + if ( isset( $assoc_args['host'] ) ) { + //@codingStandardsIgnoreStart + $assoc_args = array_merge( $assoc_args, mysql_host_to_cli_args( $assoc_args['host'] ) ); + //@codingStandardsIgnoreEnd + } + + $pass = $assoc_args['pass']; + unset( $assoc_args['pass'] ); + + $old_pass = getenv( 'MYSQL_PWD' ); + putenv( 'MYSQL_PWD=' . $pass ); + + $final_cmd = force_env_on_nix_systems( $cmd ) . assoc_args_to_str( $assoc_args ); + + $proc = proc_open_compat( $final_cmd, $descriptors, $pipes ); + if ( ! $proc ) { + exit( 1 ); + } + + $r = proc_close( $proc ); + + putenv( 'MYSQL_PWD=' . $old_pass ); + + if ( $r ) { + exit( $r ); + } +} + +/** + * Render PHP or other types of files using Mustache templates. + * + * IMPORTANT: Automatic HTML escaping is disabled! + */ +function mustache_render( $template_name, $data = array() ) { + if ( ! file_exists( $template_name ) ) { + $template_name = WP_CLI_ROOT . "/templates/$template_name"; + } + + $template = file_get_contents( $template_name ); + + $m = new \Mustache_Engine( + array( + 'escape' => function ( $val ) { + return $val; }, + ) + ); + + return $m->render( $template, $data ); +} + +/** + * Create a progress bar to display percent completion of a given operation. + * + * Progress bar is written to STDOUT, and disabled when command is piped. Progress + * advances with `$progress->tick()`, and completes with `$progress->finish()`. + * Process bar also indicates elapsed time and expected total time. + * + * ``` + * # `wp user generate` ticks progress bar each time a new user is created. + * # + * # $ wp user generate --count=500 + * # Generating users 22 % [=======> ] 0:05 / 0:23 + * + * $progress = \WP_CLI\Utils\make_progress_bar( 'Generating users', $count ); + * for ( $i = 0; $i < $count; $i++ ) { + * // uses wp_insert_user() to insert the user + * $progress->tick(); + * } + * $progress->finish(); + * ``` + * + * @access public + * @category Output + * + * @param string $message Text to display before the progress bar. + * @param integer $count Total number of ticks to be performed. + * @param int $interval Optional. The interval in milliseconds between updates. Default 100. + * @return cli\progress\Bar|WP_CLI\NoOp + */ +function make_progress_bar( $message, $count, $interval = 100 ) { + if ( \cli\Shell::isPiped() ) { + return new \WP_CLI\NoOp; + } + + return new \cli\progress\Bar( $message, $count, $interval ); +} + +function parse_url( $url ) { + $url_parts = \parse_url( $url ); + + if ( ! isset( $url_parts['scheme'] ) ) { + $url_parts = parse_url( 'http://' . $url ); + } + + return $url_parts; +} + +/** + * Check if we're running in a Windows environment (cmd.exe). + * + * @return bool + */ +function is_windows() { + return false !== ( $test_is_windows = getenv( 'WP_CLI_TEST_IS_WINDOWS' ) ) ? (bool) $test_is_windows : strtoupper( substr( PHP_OS, 0, 3 ) ) === 'WIN'; +} + +/** + * Replace magic constants in some PHP source code. + * + * @param string $source The PHP code to manipulate. + * @param string $path The path to use instead of the magic constants + */ +function replace_path_consts( $source, $path ) { + $replacements = array( + '__FILE__' => "'$path'", + '__DIR__' => "'" . dirname( $path ) . "'", + ); + + $old = array_keys( $replacements ); + $new = array_values( $replacements ); + + return str_replace( $old, $new, $source ); +} + +/** + * Make a HTTP request to a remote URL. + * + * Wraps the Requests HTTP library to ensure every request includes a cert. + * + * ``` + * # `wp core download` verifies the hash for a downloaded WordPress archive + * + * $md5_response = Utils\http_request( 'GET', $download_url . '.md5' ); + * if ( 20 != substr( $md5_response->status_code, 0, 2 ) ) { + * WP_CLI::error( "Couldn't access md5 hash for release (HTTP code {$response->status_code})" ); + * } + * ``` + * + * @access public + * + * @param string $method HTTP method (GET, POST, DELETE, etc.) + * @param string $url URL to make the HTTP request to. + * @param array $headers Add specific headers to the request. + * @param array $options + * @return object + */ +function http_request( $method, $url, $data = null, $headers = array(), $options = array() ) { + + $cert_path = '/rmccue/requests/library/Requests/Transport/cacert.pem'; + $halt_on_error = ! isset( $options['halt_on_error'] ) || (bool) $options['halt_on_error']; + if ( inside_phar() ) { + // cURL can't read Phar archives + $options['verify'] = extract_from_phar( + WP_CLI_VENDOR_DIR . $cert_path + ); + } else { + foreach ( get_vendor_paths() as $vendor_path ) { + if ( file_exists( $vendor_path . $cert_path ) ) { + $options['verify'] = $vendor_path . $cert_path; + break; + } + } + if ( empty( $options['verify'] ) ) { + $error_msg = 'Cannot find SSL certificate.'; + if ( $halt_on_error ) { + WP_CLI::error( $error_msg ); + } + throw new \RuntimeException( $error_msg ); + } + } + + try { + return \Requests::request( $url, $headers, $data, $method, $options ); + } catch ( \Requests_Exception $ex ) { + // CURLE_SSL_CACERT_BADFILE only defined for PHP >= 7. + if ( 'curlerror' !== $ex->getType() || ! in_array( curl_errno( $ex->getData() ), array( CURLE_SSL_CONNECT_ERROR, CURLE_SSL_CERTPROBLEM, 77 /*CURLE_SSL_CACERT_BADFILE*/ ), true ) ) { + $error_msg = sprintf( "Failed to get url '%s': %s.", $url, $ex->getMessage() ); + if ( $halt_on_error ) { + WP_CLI::error( $error_msg ); + } + throw new \RuntimeException( $error_msg, null, $ex ); + } + // Handle SSL certificate issues gracefully + \WP_CLI::warning( sprintf( "Re-trying without verify after failing to get verified url '%s' %s.", $url, $ex->getMessage() ) ); + $options['verify'] = false; + try { + return \Requests::request( $url, $headers, $data, $method, $options ); + } catch ( \Requests_Exception $ex ) { + $error_msg = sprintf( "Failed to get non-verified url '%s' %s.", $url, $ex->getMessage() ); + if ( $halt_on_error ) { + WP_CLI::error( $error_msg ); + } + throw new \RuntimeException( $error_msg, null, $ex ); + } + } +} + +/** + * Increments a version string using the "x.y.z-pre" format + * + * Can increment the major, minor or patch number by one + * If $new_version == "same" the version string is not changed + * If $new_version is not a known keyword, it will be used as the new version string directly + * + * @param string $current_version + * @param string $new_version + * @return string + */ +function increment_version( $current_version, $new_version ) { + // split version assuming the format is x.y.z-pre + $current_version = explode( '-', $current_version, 2 ); + $current_version[0] = explode( '.', $current_version[0] ); + + switch ( $new_version ) { + case 'same': + // do nothing + break; + + case 'patch': + $current_version[0][2]++; + + $current_version = array( $current_version[0] ); // drop possible pre-release info + break; + + case 'minor': + $current_version[0][1]++; + $current_version[0][2] = 0; + + $current_version = array( $current_version[0] ); // drop possible pre-release info + break; + + case 'major': + $current_version[0][0]++; + $current_version[0][1] = 0; + $current_version[0][2] = 0; + + $current_version = array( $current_version[0] ); // drop possible pre-release info + break; + + default: // not a keyword + $current_version = array( array( $new_version ) ); + break; + } + + // reconstruct version string + $current_version[0] = implode( '.', $current_version[0] ); + $current_version = implode( '-', $current_version ); + + return $current_version; +} + +/** + * Compare two version strings to get the named semantic version. + * + * @access public + * + * @param string $new_version + * @param string $original_version + * @return string $name 'major', 'minor', 'patch' + */ +function get_named_sem_ver( $new_version, $original_version ) { + + if ( ! Comparator::greaterThan( $new_version, $original_version ) ) { + return ''; + } + + $parts = explode( '-', $original_version ); + $bits = explode( '.', $parts[0] ); + $major = $bits[0]; + if ( isset( $bits[1] ) ) { + $minor = $bits[1]; + } + if ( isset( $bits[2] ) ) { + $patch = $bits[2]; + } + + if ( ! is_null( $minor ) && Semver::satisfies( $new_version, "{$major}.{$minor}.x" ) ) { + return 'patch'; + } + + if ( Semver::satisfies( $new_version, "{$major}.x.x" ) ) { + return 'minor'; + } + + return 'major'; +} + +/** + * Return the flag value or, if it's not set, the $default value. + * + * Because flags can be negated (e.g. --no-quiet to negate --quiet), this + * function provides a safer alternative to using + * `isset( $assoc_args['quiet'] )` or similar. + * + * @access public + * @category Input + * + * @param array $assoc_args Arguments array. + * @param string $flag Flag to get the value. + * @param mixed $default Default value for the flag. Default: NULL + * @return mixed + */ +function get_flag_value( $assoc_args, $flag, $default = null ) { + return isset( $assoc_args[ $flag ] ) ? $assoc_args[ $flag ] : $default; +} + +/** + * Get the home directory. + * + * @access public + * @category System + * + * @return string + */ +function get_home_dir() { + $home = getenv( 'HOME' ); + if ( ! $home ) { + // In Windows $HOME may not be defined + $home = getenv( 'HOMEDRIVE' ) . getenv( 'HOMEPATH' ); + } + + return rtrim( $home, '/\\' ); +} + +/** + * Appends a trailing slash. + * + * @access public + * @category System + * + * @param string $string What to add the trailing slash to. + * @return string String with trailing slash added. + */ +function trailingslashit( $string ) { + return rtrim( $string, '/\\' ) . '/'; +} + +/** + * Convert Windows EOLs to *nix. + * + * @param string $str String to convert. + * @return string String with carriage return / newline pairs reduced to newlines. + */ +function normalize_eols( $str ) { + return str_replace( "\r\n", "\n", $str ); +} + +/** + * Get the system's temp directory. Warns user if it isn't writable. + * + * @access public + * @category System + * + * @return string + */ +function get_temp_dir() { + static $temp = ''; + + if ( $temp ) { + return $temp; + } + + // `sys_get_temp_dir()` introduced PHP 5.2.1. Will always return something. + $temp = trailingslashit( sys_get_temp_dir() ); + + if ( ! is_writable( $temp ) ) { + \WP_CLI::warning( "Temp directory isn't writable: {$temp}" ); + } + + return $temp; +} + +/** + * Parse a SSH url for its host, port, and path. + * + * Similar to parse_url(), but adds support for defined SSH aliases. + * + * ``` + * host OR host/path/to/wordpress OR host:port/path/to/wordpress + * ``` + * + * @access public + * + * @return mixed + */ +function parse_ssh_url( $url, $component = -1 ) { + preg_match( '#^((docker|docker\-compose|ssh|vagrant):)?(([^@:]+)@)?([^:/~]+)(:([\d]*))?((/|~)(.+))?$#', $url, $matches ); + $bits = array(); + foreach ( array( + 2 => 'scheme', + 4 => 'user', + 5 => 'host', + 7 => 'port', + 8 => 'path', + ) as $i => $key ) { + if ( ! empty( $matches[ $i ] ) ) { + $bits[ $key ] = $matches[ $i ]; + } + } + + // Find the hostname from `vagrant ssh-config` automatically. + if ( preg_match( '/^vagrant:?/', $url ) ) { + if ( 'vagrant' === $bits['host'] && empty( $bits['scheme'] ) ) { + $ssh_config = shell_exec( 'vagrant ssh-config 2>/dev/null' ); + if ( preg_match( '/Host\s(.+)/', $ssh_config, $matches ) ) { + $bits['scheme'] = 'vagrant'; + $bits['host'] = $matches[1]; + } + } + } + + switch ( $component ) { + case PHP_URL_SCHEME: + return isset( $bits['scheme'] ) ? $bits['scheme'] : null; + case PHP_URL_USER: + return isset( $bits['user'] ) ? $bits['user'] : null; + case PHP_URL_HOST: + return isset( $bits['host'] ) ? $bits['host'] : null; + case PHP_URL_PATH: + return isset( $bits['path'] ) ? $bits['path'] : null; + case PHP_URL_PORT: + return isset( $bits['port'] ) ? $bits['port'] : null; + default: + return $bits; + } +} + +/** + * Report the results of the same operation against multiple resources. + * + * @access public + * @category Input + * + * @param string $noun Resource being affected (e.g. plugin) + * @param string $verb Type of action happening to the noun (e.g. activate) + * @param integer $total Total number of resource being affected. + * @param integer $successes Number of successful operations. + * @param integer $failures Number of failures. + * @param null|integer $skips Optional. Number of skipped operations. Default null (don't show skips). + */ +function report_batch_operation_results( $noun, $verb, $total, $successes, $failures, $skips = null ) { + $plural_noun = $noun . 's'; + $past_tense_verb = past_tense_verb( $verb ); + $past_tense_verb_upper = ucfirst( $past_tense_verb ); + if ( $failures ) { + $failed_skipped_message = null === $skips ? '' : " ({$failures} failed" . ( $skips ? ", {$skips} skipped" : '' ) . ')'; + if ( $successes ) { + WP_CLI::error( "Only {$past_tense_verb} {$successes} of {$total} {$plural_noun}{$failed_skipped_message}." ); + } else { + WP_CLI::error( "No {$plural_noun} {$past_tense_verb}{$failed_skipped_message}." ); + } + } else { + $skipped_message = $skips ? " ({$skips} skipped)" : ''; + if ( $successes || $skips ) { + WP_CLI::success( "{$past_tense_verb_upper} {$successes} of {$total} {$plural_noun}{$skipped_message}." ); + } else { + $message = $total > 1 ? ucfirst( $plural_noun ) : ucfirst( $noun ); + WP_CLI::success( "{$message} already {$past_tense_verb}." ); + } + } +} + +/** + * Parse a string of command line arguments into an $argv-esqe variable. + * + * @access public + * @category Input + * + * @param string $arguments + * @return array + */ +function parse_str_to_argv( $arguments ) { + preg_match_all( '/(?<=^|\s)([\'"]?)(.+?)(? 'create', + 'check' => 'check-update', + 'capability' => 'cap', + 'clear' => 'flush', + 'decrement' => 'decr', + 'del' => 'delete', + 'directory' => 'dir', + 'exec' => 'eval', + 'exec-file' => 'eval-file', + 'increment' => 'incr', + 'language' => 'locale', + 'lang' => 'locale', + 'new' => 'create', + 'number' => 'count', + 'remove' => 'delete', + 'regen' => 'regenerate', + 'rep' => 'replace', + 'repl' => 'replace', + 'trash' => 'delete', + 'v' => 'version', + ); + + if ( array_key_exists( $target, $suggestion_map ) && in_array( $suggestion_map[ $target ], $options, true ) ) { + return $suggestion_map[ $target ]; + } + + if ( empty( $options ) ) { + return ''; + } + foreach ( $options as $option ) { + $distance = levenshtein( $option, $target ); + $levenshtein[ $option ] = $distance; + } + + // Sort known command strings by distance to user entry. + asort( $levenshtein ); + + // Fetch the closest command string. + reset( $levenshtein ); + $suggestion = key( $levenshtein ); + + // Only return a suggestion if below a given threshold. + return $levenshtein[ $suggestion ] <= $threshold && $suggestion !== $target + ? (string) $suggestion + : ''; +} + +/** + * Get a Phar-safe version of a path. + * + * For paths inside a Phar, this strips the outer filesystem's location to + * reduce the path to what it needs to be within the Phar archive. + * + * Use the __FILE__ or __DIR__ constants as a starting point. + * + * @param string $path An absolute path that might be within a Phar. + * + * @return string A Phar-safe version of the path. + */ +function phar_safe_path( $path ) { + + if ( ! inside_phar() ) { + return $path; + } + + return str_replace( + PHAR_STREAM_PREFIX . WP_CLI_PHAR_PATH . '/', + PHAR_STREAM_PREFIX, + $path + ); +} + +/** + * Check whether a given Command object is part of the bundled set of + * commands. + * + * This function accepts both a fully qualified class name as a string as + * well as an object that extends `WP_CLI\Dispatcher\CompositeCommand`. + * + * @param \WP_CLI\Dispatcher\CompositeCommand|string $command + * + * @return bool + */ +function is_bundled_command( $command ) { + static $classes; + + if ( null === $classes ) { + $classes = array(); + $class_map = WP_CLI_VENDOR_DIR . '/composer/autoload_commands_classmap.php'; + if ( file_exists( WP_CLI_VENDOR_DIR . '/composer/' ) ) { + $classes = include $class_map; + } + } + + if ( is_object( $command ) ) { + $command = get_class( $command ); + } + + return is_string( $command ) + ? array_key_exists( $command, $classes ) + : false; +} + +/** + * Maybe prefix command string with "/usr/bin/env". + * Removes (if there) if Windows, adds (if not there) if not. + * + * @param string $command + * + * @return string + */ +function force_env_on_nix_systems( $command ) { + $env_prefix = '/usr/bin/env '; + $env_prefix_len = strlen( $env_prefix ); + if ( is_windows() ) { + if ( 0 === strncmp( $command, $env_prefix, $env_prefix_len ) ) { + $command = substr( $command, $env_prefix_len ); + } + } else { + if ( 0 !== strncmp( $command, $env_prefix, $env_prefix_len ) ) { + $command = $env_prefix . $command; + } + } + return $command; +} + +/** + * Check that `proc_open()` and `proc_close()` haven't been disabled. + * + * @param string $context Optional. If set will appear in error message. Default null. + * @param bool $return Optional. If set will return false rather than error out. Default false. + * + * @return bool + */ +function check_proc_available( $context = null, $return = false ) { + if ( ! function_exists( 'proc_open' ) || ! function_exists( 'proc_close' ) ) { + if ( $return ) { + return false; + } + $msg = 'The PHP functions `proc_open()` and/or `proc_close()` are disabled. Please check your PHP ini directive `disable_functions` or suhosin settings.'; + if ( $context ) { + WP_CLI::error( sprintf( "Cannot do '%s': %s", $context, $msg ) ); + } else { + WP_CLI::error( $msg ); + } + } + return true; +} + +/** + * Returns past tense of verb, with limited accuracy. Only regular verbs catered for, apart from "reset". + * + * @param string $verb Verb to return past tense of. + * + * @return string + */ +function past_tense_verb( $verb ) { + static $irregular = array( + 'reset' => 'reset', + ); + if ( isset( $irregular[ $verb ] ) ) { + return $irregular[ $verb ]; + } + $last = substr( $verb, -1 ); + if ( 'e' === $last ) { + $verb = substr( $verb, 0, -1 ); + } elseif ( 'y' === $last && ! preg_match( '/[aeiou]y$/', $verb ) ) { + $verb = substr( $verb, 0, -1 ) . 'i'; + } elseif ( preg_match( '/^[^aeiou]*[aeiou][^aeiouhwxy]$/', $verb ) ) { + // Rule of thumb that most (all?) one-voweled regular verbs ending in vowel + consonant (excluding "h", "w", "x", "y") double their final consonant - misses many cases (eg "submit"). + $verb .= $last; + } + return $verb . 'ed'; +} + +/** + * Get the path to the PHP binary used when executing WP-CLI. + * + * Environment values permit specific binaries to be indicated. + * + * @access public + * @category System + * + * @return string + */ +function get_php_binary() { + if ( $wp_cli_php_used = getenv( 'WP_CLI_PHP_USED' ) ) { + return $wp_cli_php_used; + } + + if ( $wp_cli_php = getenv( 'WP_CLI_PHP' ) ) { + return $wp_cli_php; + } + + // Available since PHP 5.4. + if ( defined( 'PHP_BINARY' ) ) { + return PHP_BINARY; + } + + // @codingStandardsIgnoreLine + if ( @is_executable( PHP_BINDIR . '/php' ) ) { + return PHP_BINDIR . '/php'; + } + + // @codingStandardsIgnoreLine + if ( is_windows() && @is_executable( PHP_BINDIR . '/php.exe' ) ) { + return PHP_BINDIR . '/php.exe'; + } + + return 'php'; +} + +/** + * Windows compatible `proc_open()`. + * Works around bug in PHP, and also deals with *nix-like `ENV_VAR=blah cmd` environment variable prefixes. + * + * @access public + * + * @param string $command Command to execute. + * @param array $descriptorspec Indexed array of descriptor numbers and their values. + * @param array &$pipes Indexed array of file pointers that correspond to PHP's end of any pipes that are created. + * @param string $cwd Initial working directory for the command. + * @param array $env Array of environment variables. + * @param array $other_options Array of additional options (Windows only). + * + * @return string Command stripped of any environment variable settings. + */ +function proc_open_compat( $cmd, $descriptorspec, &$pipes, $cwd = null, $env = null, $other_options = null ) { + if ( is_windows() ) { + // Need to encompass the whole command in double quotes - PHP bug https://bugs.php.net/bug.php?id=49139 + $cmd = '"' . _proc_open_compat_win_env( $cmd, $env ) . '"'; + } + return proc_open( $cmd, $descriptorspec, $pipes, $cwd, $env, $other_options ); +} + +/** + * For use by `proc_open_compat()` only. Separated out for ease of testing. Windows only. + * Turns *nix-like `ENV_VAR=blah command` environment variable prefixes into stripped `cmd` with prefixed environment variables added to passed in environment array. + * + * @access private + * + * @param string $command Command to execute. + * @param array &$env Array of existing environment variables. Will be modified if any settings in command. + * + * @return string Command stripped of any environment variable settings. + */ +function _proc_open_compat_win_env( $cmd, &$env ) { + if ( false !== strpos( $cmd, '=' ) ) { + while ( preg_match( '/^([A-Za-z_][A-Za-z0-9_]*)=("[^"]*"|[^ ]*) /', $cmd, $matches ) ) { + $cmd = substr( $cmd, strlen( $matches[0] ) ); + if ( null === $env ) { + $env = array(); + } + $env[ $matches[1] ] = isset( $matches[2][0] ) && '"' === $matches[2][0] ? substr( $matches[2], 1, -1 ) : $matches[2]; + } + } + return $cmd; +} + +/** + * First half of escaping for LIKE special characters % and _ before preparing for MySQL. + * + * Use this only before wpdb::prepare() or esc_sql(). Reversing the order is very bad for security. + * + * Copied from core "wp-includes/wp-db.php". Avoids dependency on WP 4.4 wpdb. + * + * @access public + * + * @param string $text The raw text to be escaped. The input typed by the user should have no + * extra or deleted slashes. + * @return string Text in the form of a LIKE phrase. The output is not SQL safe. Call $wpdb::prepare() + * or real_escape next. + */ +function esc_like( $text ) { + return addcslashes( $text, '_%\\' ); +} + +/** + * Escapes (backticks) MySQL identifiers (aka schema object names) - i.e. column names, table names, and database/index/alias/view etc names. + * See https://dev.mysql.com/doc/refman/5.5/en/identifiers.html + * + * @param string|array $idents A single identifier or an array of identifiers. + * @return string|array An escaped string if given a string, or an array of escaped strings if given an array of strings. + */ +function esc_sql_ident( $idents ) { + $backtick = function ( $v ) { + // Escape any backticks in the identifier by doubling. + return '`' . str_replace( '`', '``', $v ) . '`'; + }; + if ( is_string( $idents ) ) { + return $backtick( $idents ); + } + return array_map( $backtick, $idents ); +} + +/** + * Check whether a given string is a valid JSON representation. + * + * @param string $argument String to evaluate. + * @param bool $ignore_scalars Optional. Whether to ignore scalar values. + * Defaults to true. + * + * @return bool Whether the provided string is a valid JSON representation. + */ +function is_json( $argument, $ignore_scalars = true ) { + if ( ! is_string( $argument ) || '' === $argument ) { + return false; + } + + if ( $ignore_scalars && ! in_array( $argument[0], array( '{', '[' ), true ) ) { + return false; + } + + json_decode( $argument, $assoc = true ); + + return json_last_error() === JSON_ERROR_NONE; +} + +/** + * Parse known shell arrays included in the $assoc_args array. + * + * @param array $assoc_args Associative array of arguments. + * @param array $array_arguments Array of argument keys that should receive an + * array through the shell. + * + * @return array + */ +function parse_shell_arrays( $assoc_args, $array_arguments ) { + if ( empty( $assoc_args ) || empty( $array_arguments ) ) { + return $assoc_args; + } + + foreach ( $array_arguments as $key ) { + if ( array_key_exists( $key, $assoc_args ) && is_json( $assoc_args[ $key ] ) ) { + $assoc_args[ $key ] = json_decode( $assoc_args[ $key ], $assoc = true ); + } + } + + return $assoc_args; +} diff --git a/php/wp-cli.php b/php/wp-cli.php new file mode 100644 index 000000000..afd00d75d --- /dev/null +++ b/php/wp-cli.php @@ -0,0 +1,23 @@ +error ) ) { + wp_die( $wpdb->error ); +} + +// Set the database table prefix and the format specifiers for database table columns. +// @codingStandardsIgnoreStart +$GLOBALS['table_prefix'] = $table_prefix; +// @codingStandardsIgnoreEnd +wp_set_wpdb_vars(); + +// Start the WordPress object cache, or an external object cache if the drop-in is present. +wp_start_object_cache(); + +// Attach the default filters. +require ABSPATH . WPINC . '/default-filters.php'; + +// Initialize multisite if enabled. +if ( is_multisite() ) { + Utils\maybe_require( '4.6-alpha-37575', ABSPATH . WPINC . '/class-wp-site-query.php' ); + Utils\maybe_require( '4.6-alpha-37896', ABSPATH . WPINC . '/class-wp-network-query.php' ); + require ABSPATH . WPINC . '/ms-blogs.php'; + require ABSPATH . WPINC . '/ms-settings.php'; +} elseif ( ! defined( 'MULTISITE' ) ) { + define( 'MULTISITE', false ); +} + +register_shutdown_function( 'shutdown_action_hook' ); + +// Stop most of WordPress from being loaded if we just want the basics. +if ( SHORTINIT ) { + return false; +} + +// Load the L10n library. +require_once ABSPATH . WPINC . '/l10n.php'; + +// WP-CLI: Permit Utils\wp_not_installed() to run on < WP 4.0 +apply_filters( 'nocache_headers', array() ); + +// Run the installer if WordPress is not installed. +wp_not_installed(); + +// Load most of WordPress. +require ABSPATH . WPINC . '/class-wp-walker.php'; +require ABSPATH . WPINC . '/class-wp-ajax-response.php'; +require ABSPATH . WPINC . '/formatting.php'; +require ABSPATH . WPINC . '/capabilities.php'; +Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-wp-roles.php' ); +Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-wp-role.php' ); +Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-wp-user.php' ); +require ABSPATH . WPINC . '/query.php'; +Utils\maybe_require( '3.7-alpha-25139', ABSPATH . WPINC . '/date.php' ); +require ABSPATH . WPINC . '/theme.php'; +require ABSPATH . WPINC . '/class-wp-theme.php'; +require ABSPATH . WPINC . '/template.php'; +require ABSPATH . WPINC . '/user.php'; +Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-wp-user-query.php' ); +Utils\maybe_require( '4.0', ABSPATH . WPINC . '/session.php' ); +require ABSPATH . WPINC . '/meta.php'; +Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-wp-meta-query.php' ); +Utils\maybe_require( '4.5-alpha-35776', ABSPATH . WPINC . '/class-wp-metadata-lazyloader.php' ); +require ABSPATH . WPINC . '/general-template.php'; +require ABSPATH . WPINC . '/link-template.php'; +require ABSPATH . WPINC . '/author-template.php'; +require ABSPATH . WPINC . '/post.php'; +Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-walker-page.php' ); +Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-walker-page-dropdown.php' ); +Utils\maybe_require( '4.6-alpha-37890', ABSPATH . WPINC . '/class-wp-post-type.php' ); +Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-wp-post.php' ); +require ABSPATH . WPINC . '/post-template.php'; +Utils\maybe_require( '3.6-alpha-23451', ABSPATH . WPINC . '/revision.php' ); +Utils\maybe_require( '3.6-alpha-23451', ABSPATH . WPINC . '/post-formats.php' ); +require ABSPATH . WPINC . '/post-thumbnail-template.php'; +require ABSPATH . WPINC . '/category.php'; +Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-walker-category.php' ); +Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-walker-category-dropdown.php' ); +require ABSPATH . WPINC . '/category-template.php'; +require ABSPATH . WPINC . '/comment.php'; +Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-wp-comment.php' ); +Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-wp-comment-query.php' ); +Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-walker-comment.php' ); +require ABSPATH . WPINC . '/comment-template.php'; +require ABSPATH . WPINC . '/rewrite.php'; +Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-wp-rewrite.php' ); +require ABSPATH . WPINC . '/feed.php'; +require ABSPATH . WPINC . '/bookmark.php'; +require ABSPATH . WPINC . '/bookmark-template.php'; +require ABSPATH . WPINC . '/kses.php'; +require ABSPATH . WPINC . '/cron.php'; +require ABSPATH . WPINC . '/deprecated.php'; +require ABSPATH . WPINC . '/script-loader.php'; +require ABSPATH . WPINC . '/taxonomy.php'; +Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-wp-term.php' ); +Utils\maybe_require( '4.6-alpha-37575', ABSPATH . WPINC . '/class-wp-term-query.php' ); +Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-wp-tax-query.php' ); +require ABSPATH . WPINC . '/update.php'; +require ABSPATH . WPINC . '/canonical.php'; +require ABSPATH . WPINC . '/shortcodes.php'; +Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/embed.php' ); +require ABSPATH . WPINC . '/class-wp-embed.php'; +require ABSPATH . WPINC . '/media.php'; +Utils\maybe_require( '4.4-alpha-34903', ABSPATH . WPINC . '/class-wp-oembed-controller.php' ); +require ABSPATH . WPINC . '/http.php'; +require_once ABSPATH . WPINC . '/class-http.php'; +Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-wp-http-streams.php' ); +Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-wp-http-curl.php' ); +Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-wp-http-proxy.php' ); +Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-wp-http-cookie.php' ); +Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-wp-http-encoding.php' ); +Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-wp-http-response.php' ); +Utils\maybe_require( '4.6-alpha-37438', ABSPATH . WPINC . '/class-wp-http-requests-response.php' ); +require ABSPATH . WPINC . '/widgets.php'; +Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-wp-widget.php' ); +Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-wp-widget-factory.php' ); +require ABSPATH . WPINC . '/nav-menu.php'; +require ABSPATH . WPINC . '/nav-menu-template.php'; +require ABSPATH . WPINC . '/admin-bar.php'; +Utils\maybe_require( '4.4-alpha-34928', ABSPATH . WPINC . '/rest-api.php' ); +Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/rest-api/class-wp-rest-server.php' ); +Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/rest-api/class-wp-rest-response.php' ); +Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/rest-api/class-wp-rest-request.php' ); + +// Load multisite-specific files. +if ( is_multisite() ) { + require ABSPATH . WPINC . '/ms-functions.php'; + require ABSPATH . WPINC . '/ms-default-filters.php'; + require ABSPATH . WPINC . '/ms-deprecated.php'; +} + +// Define constants that rely on the API to obtain the default value. +// Define must-use plugin directory constants, which may be overridden in the sunrise.php drop-in. +wp_plugin_directory_constants(); + +$symlinked_plugins_supported = function_exists( 'wp_register_plugin_realpath' ); +if ( $symlinked_plugins_supported ) { + $GLOBALS['wp_plugin_paths'] = array(); +} + +// Load must-use plugins. +foreach ( wp_get_mu_plugins() as $mu_plugin ) { + include_once $mu_plugin; +} +unset( $mu_plugin ); + +// Load network activated plugins. +if ( is_multisite() ) { + foreach ( wp_get_active_network_plugins() as $network_plugin ) { + if ( $symlinked_plugins_supported ) { + wp_register_plugin_realpath( $network_plugin ); + } + include_once $network_plugin; + } + unset( $network_plugin ); +} + +do_action( 'muplugins_loaded' ); + +if ( is_multisite() ) { + ms_cookie_constants(); +} + +// Define constants after multisite is loaded. Cookie-related constants may be overridden in ms_network_cookies(). +wp_cookie_constants(); + +// Define and enforce our SSL constants +wp_ssl_constants(); + +// Create common globals. +require ABSPATH . WPINC . '/vars.php'; + +// Make taxonomies and posts available to plugins and themes. +// @plugin authors: warning: these get registered again on the init hook. +create_initial_taxonomies(); +create_initial_post_types(); + +// Register the default theme directory root +register_theme_directory( get_theme_root() ); + +// Load active plugins. +foreach ( wp_get_active_and_valid_plugins() as $plugin ) { + if ( $symlinked_plugins_supported ) { + wp_register_plugin_realpath( $plugin ); + } + include_once $plugin; +} +unset( $plugin, $symlinked_plugins_supported ); + +// Load pluggable functions. +require ABSPATH . WPINC . '/pluggable.php'; +require ABSPATH . WPINC . '/pluggable-deprecated.php'; + +// Set internal encoding. +wp_set_internal_encoding(); + +// Run wp_cache_postload() if object cache is enabled and the function exists. +if ( WP_CACHE && function_exists( 'wp_cache_postload' ) ) { + wp_cache_postload(); +} + +do_action( 'plugins_loaded' ); + +// Define constants which affect functionality if not already defined. +wp_functionality_constants(); + +// Add magic quotes and set up $_REQUEST ( $_GET + $_POST ) +wp_magic_quotes(); + +do_action( 'sanitize_comment_cookies' ); + +/** + * WordPress Query object + * @global object $wp_the_query + * @since 2.0.0 + */ +$GLOBALS['wp_the_query'] = new WP_Query(); + +/** + * Holds the reference to @see $wp_the_query + * Use this global for WordPress queries + * @global object $wp_query + * @since 1.5.0 + */ +$GLOBALS['wp_query'] = $GLOBALS['wp_the_query']; + +/** + * Holds the WordPress Rewrite object for creating pretty URLs + * @global object $wp_rewrite + * @since 1.5.0 + */ +$GLOBALS['wp_rewrite'] = new WP_Rewrite(); + +/** + * WordPress Object + * @global object $wp + * @since 2.0.0 + */ +$GLOBALS['wp'] = new WP(); + +/** + * WordPress Widget Factory Object + * @global object $wp_widget_factory + * @since 2.8.0 + */ +$GLOBALS['wp_widget_factory'] = new WP_Widget_Factory(); + +/** + * WordPress User Roles + * @global object $wp_roles + * @since 2.0.0 + */ +$GLOBALS['wp_roles'] = new WP_Roles(); + +do_action( 'setup_theme' ); + +// Define the template related constants. +wp_templating_constants(); + +// Load the default text localization domain. +load_default_textdomain(); + +$locale = get_locale(); +$locale_file = WP_LANG_DIR . "/$locale.php"; +if ( ( 0 === validate_file( $locale ) ) && is_readable( $locale_file ) ) { + require $locale_file; +} +unset( $locale_file ); + +// Pull in locale data after loading text domain. +require_once ABSPATH . WPINC . '/locale.php'; + +/** + * WordPress Locale object for loading locale domain date and various strings. + * @global object $wp_locale + * @since 2.1.0 + */ +$GLOBALS['wp_locale'] = new WP_Locale(); + +// Load the functions for the active theme, for both parent and child theme if applicable. +global $pagenow; +if ( ! defined( 'WP_INSTALLING' ) || 'wp-activate.php' === $pagenow ) { + if ( TEMPLATEPATH !== STYLESHEETPATH && file_exists( STYLESHEETPATH . '/functions.php' ) ) { + include STYLESHEETPATH . '/functions.php'; + } + if ( file_exists( TEMPLATEPATH . '/functions.php' ) ) { + include TEMPLATEPATH . '/functions.php'; + } +} + +do_action( 'after_setup_theme' ); + +// Set up current user. +$GLOBALS['wp']->init(); + +/** + * Most of WP is loaded at this stage, and the user is authenticated. WP continues + * to load on the init hook that follows (e.g. widgets), and many plugins instantiate + * themselves on it for all sorts of reasons (e.g. they need a user, a taxonomy, etc.). + * + * If you wish to plug an action once WP is loaded, use the wp_loaded hook below. + */ +do_action( 'init' ); + +// Check site status +# if ( is_multisite() ) { // WP-CLI +if ( is_multisite() && ! defined( 'WP_INSTALLING' ) ) { + if ( true !== ( $file = ms_site_check() ) ) { + require $file; + die(); + } + unset( $file ); +} + +/** + * This hook is fired once WP, all plugins, and the theme are fully loaded and instantiated. + * + * AJAX requests should use wp-admin/admin-ajax.php. admin-ajax.php can handle requests for + * users not logged in. + * + * @link http://codex.wordpress.org/AJAX_in_Plugins + * + * @since 3.0.0 + */ +do_action( 'wp_loaded' ); diff --git a/phpcs.xml.dist b/phpcs.xml.dist new file mode 100644 index 000000000..e34339ca5 --- /dev/null +++ b/phpcs.xml.dist @@ -0,0 +1,43 @@ + + + WordPress Coding Standards for WP-CLI + + + + + + + + + + + . + */ci/* + */features/* + */packages/* + */tests/* + */utils/* + */vendor/* + + + + + + + + + + + + + + + + + + + + + + + diff --git a/phpunit.xml.dist b/phpunit.xml.dist new file mode 100644 index 000000000..529dae0ef --- /dev/null +++ b/phpunit.xml.dist @@ -0,0 +1,11 @@ + + + + tests/ + tests/ + + + diff --git a/templates/man-params.mustache b/templates/man-params.mustache new file mode 100644 index 000000000..dcf83d419 --- /dev/null +++ b/templates/man-params.mustache @@ -0,0 +1,19 @@ +{{#is_subcommand}} + + +{{/is_subcommand}} +{{#has_subcommands}} + + +{{/has_subcommands}} +## GLOBAL PARAMETERS + +{{#parameters}} + {{synopsis}} + {{desc}} + +{{/parameters}} +{{#root_command}} + Run 'wp help ' to get more information on a specific command. + +{{/root_command}} diff --git a/templates/man.mustache b/templates/man.mustache new file mode 100644 index 000000000..fbb2e9bd6 --- /dev/null +++ b/templates/man.mustache @@ -0,0 +1,28 @@ +## NAME + + {{name}} + +{{#shortdesc}} +## DESCRIPTION + + {{shortdesc}} + +{{/shortdesc}} +## SYNOPSIS + + {{synopsis}} + +{{#alias}} +## ALIAS + + {{alias}} + +{{/alias}} +{{#has-subcommands}} +## SUBCOMMANDS + +{{#subcommands}} + {{.}} +{{/subcommands}} + +{{/has-subcommands}} diff --git a/templates/plugin-status.mustache b/templates/plugin-status.mustache new file mode 100644 index 000000000..375862690 --- /dev/null +++ b/templates/plugin-status.mustache @@ -0,0 +1,6 @@ +Plugin %9{{slug}}%n details: + Name: {{name}} + Status: {{status}}%n + Version: {{version}} + Author: {{author}} + Description: {{description}} diff --git a/templates/theme-status.mustache b/templates/theme-status.mustache new file mode 100644 index 000000000..c53be6338 --- /dev/null +++ b/templates/theme-status.mustache @@ -0,0 +1,5 @@ +Theme %9{{slug}}%n details: + Name: {{name}} + Status: {{status}}%n + Version: {{version}} + Author: {{author}} diff --git a/templates/versions.mustache b/templates/versions.mustache new file mode 100644 index 000000000..a52954e82 --- /dev/null +++ b/templates/versions.mustache @@ -0,0 +1,4 @@ +WordPress version: {{wp-version}} +Database revision: {{db-version}} +TinyMCE version: {{mce-version}} +Package language: {{local-package}} diff --git a/tests/bootstrap.php b/tests/bootstrap.php new file mode 100644 index 000000000..d0a2f3b59 --- /dev/null +++ b/tests/bootstrap.php @@ -0,0 +1,20 @@ +] + * + * ## EXAMPLES + * + * $ wp foo command2 --path=/**a/**b/**c/** + */ + +final + protected + static + function + command2() { + } + + /** + * Command3 function + * + * ## OPTIONS + * + * [--path=] + * + * ## EXAMPLES + * + * $ wp foo command3 --path=/**a/**b/**c/** + function*/public function command3( $function ) {} + + function command4() {} +} + +/** + * Basic class + * + * ## EXAMPLES + * + * # Foo. + * $ wp foo --final abstract + class*/abstract class + CommandFactoryTests_Get_Doc_Comment_2_Command_Win + extends WP_CLI_Command + { + function command1() {} + } diff --git a/tests/data/commandfactory-doc_comment-class.php b/tests/data/commandfactory-doc_comment-class.php new file mode 100644 index 000000000..01b1c5eb2 --- /dev/null +++ b/tests/data/commandfactory-doc_comment-class.php @@ -0,0 +1,70 @@ +] + * + * ## EXAMPLES + * + * $ wp foo command2 --path=/**a/**b/**c/** + */ + +final + protected + static + function + command2() { + } + + /** + * Command3 function + * + * ## OPTIONS + * + * [--path=] + * + * ## EXAMPLES + * + * $ wp foo command3 --path=/**a/**b/**c/** + function*/public function command3( $function ) {} + + function command4() {} +} + +/** + * Basic class + * + * ## EXAMPLES + * + * # Foo. + * $ wp foo --final abstract + class*/abstract class + CommandFactoryTests_Get_Doc_Comment_2_Command + extends WP_CLI_Command + { + function command1() {} + } diff --git a/tests/data/commandfactory-doc_comment-function-win.php b/tests/data/commandfactory-doc_comment-function-win.php new file mode 100644 index 000000000..7fa1382e9 --- /dev/null +++ b/tests/data/commandfactory-doc_comment-function-win.php @@ -0,0 +1,19 @@ +=' ) ) { + + class_alias( 'PHPUnit\Framework\TestCase', 'PHPUnit_Framework_TestCase' ); + class_alias( 'PHPUnit\Framework\Exception', 'PHPUnit_Framework_Exception' ); + class_alias( 'PHPUnit\Framework\ExpectationFailedException', 'PHPUnit_Framework_ExpectationFailedException' ); + class_alias( 'PHPUnit\Framework\Error\Notice', 'PHPUnit_Framework_Error_Notice' ); + class_alias( 'PHPUnit\Framework\Error\Warning', 'PHPUnit_Framework_Error_Warning' ); + class_alias( 'PHPUnit\Framework\Test', 'PHPUnit_Framework_Test' ); + class_alias( 'PHPUnit\Framework\Warning', 'PHPUnit_Framework_Warning' ); + class_alias( 'PHPUnit\Framework\AssertionFailedError', 'PHPUnit_Framework_AssertionFailedError' ); + class_alias( 'PHPUnit\Framework\TestSuite', 'PHPUnit_Framework_TestSuite' ); + class_alias( 'PHPUnit\Framework\TestListener', 'PHPUnit_Framework_TestListener' ); + class_alias( 'PHPUnit\Util\GlobalState', 'PHPUnit_Util_GlobalState' ); + class_alias( 'PHPUnit\Util\Getopt', 'PHPUnit_Util_Getopt' ); + +} diff --git a/tests/test-arg-validation.php b/tests/test-arg-validation.php new file mode 100644 index 000000000..4a3b3680c --- /dev/null +++ b/tests/test-arg-validation.php @@ -0,0 +1,64 @@ + []' ); + + $this->assertFalse( $validator->enough_positionals( array() ) ); + $this->assertTrue( $validator->enough_positionals( array( 1, 2 ) ) ); + $this->assertTrue( $validator->enough_positionals( array( 1, 2, 3, 4 ) ) ); + + $this->assertEquals( array( 4 ), $validator->unknown_positionals( array( 1, 2, 3, 4 ) ) ); + } + + function testRepeatingPositional() { + $validator = new SynopsisValidator( ' [...]' ); + + $this->assertFalse( $validator->enough_positionals( array() ) ); + $this->assertTrue( $validator->enough_positionals( array( 1 ) ) ); + $this->assertTrue( $validator->enough_positionals( array( 1, 2, 3 ) ) ); + + $this->assertEmpty( $validator->unknown_positionals( array( 1, 2, 3 ) ) ); + } + + function testUnknownAssocEmpty() { + $validator = new SynopsisValidator( '' ); + + $assoc_args = array( 'foo' => true, 'bar' => false ); + $this->assertEquals( array_keys( $assoc_args ), $validator->unknown_assoc( $assoc_args ) ); + } + + function testUnknownAssoc() { + $validator = new SynopsisValidator( '--type= [--brand=] [--flag]' ); + + $assoc_args = array( 'type' => 'analog', 'brand' => true, 'flag' => true ); + $this->assertEmpty( $validator->unknown_assoc( $assoc_args ) ); + + $assoc_args['another'] = true; + $this->assertContains( 'another', $validator->unknown_assoc( $assoc_args ) ); + } + + function testMissingAssoc() { + $validator = new SynopsisValidator( '--type= [--brand=] [--flag]' ); + + $assoc_args = array( 'brand' => true, 'flag' => true ); + list( $errors, $to_unset ) = $validator->validate_assoc( $assoc_args ); + + $this->assertCount( 1, $errors['fatal'] ); + $this->assertCount( 1, $errors['warning'] ); + } + + function testAssocWithOptionalValue() { + $validator = new SynopsisValidator( '[--network[=]]' ); + + $assoc_args = array( 'network' => true ); + list( $errors, $to_unset ) = $validator->validate_assoc( $assoc_args ); + + $this->assertCount( 0, $errors['fatal'] ); + $this->assertCount( 0, $errors['warning'] ); + } +} + diff --git a/tests/test-autoload-splitter.php b/tests/test-autoload-splitter.php new file mode 100644 index 000000000..88515d822 --- /dev/null +++ b/tests/test-autoload-splitter.php @@ -0,0 +1,65 @@ +assertSame( $expected, $autoload_splitter('foo', $code) ); + } + + /** + * Data provider of code paths. + * + * @return array + */ + public function dataCodePaths() { + return array( + array( '/wp-cli/a-command/', true ), + array( '/wp-cli/abcd-command/', true ), + array( '/wp-cli/a-b-c-d-e-f-g-h-i-j-k-l-m-n-o-p-q-r-s-t-u-v-w-x-y-z-command/', true ), + array( 'xyz/wp-cli/abcd-command/zxy', true ), + + array( '/php/commands/src/', true ), + array( 'xyz/php/commands/src/zyx', true ), + + array( '/wp-cli/-command/', false ), // No command name. + array( '/wp-cli/--command/', false ), // No command name. + array( '/wp-cli/abcd-command-/', false ), // End is not '-command/` + array( '/wp-cli/abcd-/', false ), // End is not '-command/'. + array( '/wp-cli/abcd-command', false ), // End is not '-command/'. + array( 'wp-cli/abcd-command/', false ), // Start is not '/wp-cli/'. + array( '/wp--cli/abcd-command/', false ), // Start is not '/wp-cli/'. + array( '/wp-cliabcd-command/', false ), // Start is not '/wp-cli/'. + array( '/wp-cli//abcd-command/', false ), // Middle contains two '/'. + + array( '/php-/commands/src/', false ), // Start is not '/php/'. + array( 'php/commands/src/', false ), // Start is not '/php/'. + array( '/php/commands/src', false ), // End is not '/src/'. + array( '/php/commands/srcs/', false ), // End is not '/src/'. + array( '/php/commandssrc/', false ), // End is not '/src/'. + ); + } +} diff --git a/tests/test-behat-tags.php b/tests/test-behat-tags.php new file mode 100644 index 000000000..11ea159de --- /dev/null +++ b/tests/test-behat-tags.php @@ -0,0 +1,133 @@ +temp_dir = Utils\get_temp_dir() . uniqid( 'wp-cli-test-behat-tags-', true ); + mkdir( $this->temp_dir ); + mkdir( $this->temp_dir . '/features' ); + } + + function tearDown() { + + if ( $this->temp_dir && file_exists( $this->temp_dir ) ) { + foreach ( glob( $this->temp_dir . '/features/*' ) as $feature_file ) { + unlink( $feature_file ); + } + rmdir( $this->temp_dir . '/features' ); + rmdir( $this->temp_dir ); + } + + parent::tearDown(); + } + + /** + * @dataProvider data_behat_tags_wp_version_github_token + */ + function test_behat_tags_wp_version_github_token( $env, $expected ) { + $env_wp_version = getenv( 'WP_VERSION' ); + $env_github_token = getenv( 'GITHUB_TOKEN' ); + + putenv( 'WP_VERSION' ); + putenv( 'GITHUB_TOKEN' ); + + $behat_tags = dirname( __DIR__ ) . '/ci/behat-tags.php'; + + $contents = '@require-wp-4.6 @require-wp-4.8 @require-wp-4.9 @less-than-wp-4.6 @less-than-wp-4.8 @less-than-wp-4.9'; + file_put_contents( $this->temp_dir . '/features/wp_version.feature', $contents ); + + $output = exec( "cd {$this->temp_dir}; $env php $behat_tags" ); + $this->assertSame( '--tags=' . $expected . '&&~@broken', $output ); + + putenv( false === $env_wp_version ? 'WP_VERSION' : "WP_VERSION=$env_wp_version" ); + putenv( false === $env_github_token ? 'GITHUB_TOKEN' : "GITHUB_TOKEN=$env_github_token" ); + } + + function data_behat_tags_wp_version_github_token() { + return array( + array( 'WP_VERSION=4.5', '~@require-wp-4.6&&~@require-wp-4.8&&~@require-wp-4.9&&~@github-api' ), + array( 'WP_VERSION=4.6', '~@require-wp-4.8&&~@require-wp-4.9&&~@less-than-wp-4.6&&~@github-api' ), + array( 'WP_VERSION=4.7', '~@require-wp-4.8&&~@require-wp-4.9&&~@less-than-wp-4.6&&~@github-api' ), + array( 'WP_VERSION=4.8', '~@require-wp-4.9&&~@less-than-wp-4.6&&~@less-than-wp-4.8&&~@github-api' ), + array( 'WP_VERSION=4.9', '~@less-than-wp-4.6&&~@less-than-wp-4.8&&~@less-than-wp-4.9&&~@github-api' ), + array( 'WP_VERSION=5.0', '~@less-than-wp-4.6&&~@less-than-wp-4.8&&~@less-than-wp-4.9&&~@github-api' ), + array( 'WP_VERSION=latest', '~@less-than-wp-4.6&&~@less-than-wp-4.8&&~@less-than-wp-4.9&&~@github-api' ), + array( 'WP_VERSION=trunk', '~@less-than-wp-4.6&&~@less-than-wp-4.8&&~@less-than-wp-4.9&&~@github-api' ), + array( 'WP_VERSION=nightly', '~@less-than-wp-4.6&&~@less-than-wp-4.8&&~@less-than-wp-4.9&&~@github-api' ), + array( '', '~@less-than-wp-4.6&&~@less-than-wp-4.8&&~@less-than-wp-4.9&&~@github-api' ), + array( 'GITHUB_TOKEN=blah', '~@less-than-wp-4.6&&~@less-than-wp-4.8&&~@less-than-wp-4.9' ), + ); + } + + function test_behat_tags_php_version() { + $env_github_token = getenv( 'GITHUB_TOKEN' ); + + putenv( 'GITHUB_TOKEN' ); + + $behat_tags = dirname( __DIR__ ) . '/ci/behat-tags.php'; + + $php_version = substr( PHP_VERSION, 0, 3 ); + $contents = $expected = ''; + + if ( '5.3' === $php_version ) { + $contents = '@require-php-5.2 @require-php-5.3 @require-php-5.4 @less-than-php-5.2 @less-than-php-5.3 @less-than-php-5.4'; + $expected = '~@require-php-5.4&&~@less-than-php-5.2&&~@less-than-php-5.3'; + } elseif ( '5.4' === $php_version ) { + $contents = '@require-php-5.3 @require-php-5.4 @require-php-5.5 @less-than-php-5.3 @less-than-php-5.4 @less-than-php-5.5'; + $expected = '~@require-php-5.5&&~@less-than-php-5.3&&~@less-than-php-5.4'; + } elseif ( '5.5' === $php_version ) { + $contents = '@require-php-5.4 @require-php-5.5 @require-php-5.6 @less-than-php-5.4 @less-than-php-5.5 @less-than-php-5.6'; + $expected = '~@require-php-5.6&&~@less-than-php-5.4&&~@less-than-php-5.5'; + } elseif ( '5.6' === $php_version ) { + $contents = '@require-php-5.5 @require-php-5.6 @require-php-7.0 @less-than-php-5.5 @less-than-php-5.6 @less-than-php-7.0'; + $expected = '~@require-php-7.0&&~@less-than-php-5.5&&~@less-than-php-5.6'; + } elseif ( '7.0' === $php_version ) { + $contents = '@require-php-5.6 @require-php-7.0 @require-php-7.1 @less-than-php-5.6 @less-than-php-7.0 @less-than-php-7.1'; + $expected = '~@require-php-7.1&&~@less-than-php-5.6&&~@less-than-php-7.0'; + } elseif ( '7.1' === $php_version ) { + $contents = '@require-php-7.0 @require-php-7.1 @require-php-7.2 @less-than-php-7.0 @less-than-php-7.1 @less-than-php-7.2'; + $expected = '~@require-php-7.2&&~@less-than-php-7.0&&~@less-than-php-7.1'; + } elseif ( '7.2' === $php_version ) { + $contents = '@require-php-7.1 @require-php-7.2 @require-php-7.3 @less-than-php-7.1 @less-than-php-7.2 @less-than-php-7.3'; + $expected = '~@require-php-7.3&&~@less-than-php-7.1&&~@less-than-php-7.2'; + } else { + $this->markTestSkipped( "No test for PHP_VERSION $php_version." ); + } + + file_put_contents( $this->temp_dir . '/features/php_version.feature', $contents ); + + $output = exec( "cd {$this->temp_dir}; php $behat_tags" ); + $this->assertSame( '--tags=' . $expected . '&&~@github-api&&~@broken', $output ); + + putenv( false === $env_github_token ? 'GITHUB_TOKEN' : "GITHUB_TOKEN=$env_github_token" ); + } + + function test_behat_tags_extension() { + $env_github_token = getenv( 'GITHUB_TOKEN' ); + + putenv( 'GITHUB_TOKEN' ); + + $behat_tags = dirname( __DIR__ ) . '/ci/behat-tags.php'; + + file_put_contents( $this->temp_dir . '/features/extension.feature', '@require-extension-imagick @require-extension-curl' ); + + $expecteds = array(); + if ( ! extension_loaded( 'imagick' ) ) { + $expecteds[] = '~@require-extension-imagick'; + } + if ( ! extension_loaded( 'intl' ) ) { + $expecteds[] = '~@require-extension-intl'; + } + $expected = '--tags=' . implode( '&&', array_merge( array( '~@github-api', '~@broken' ), $expecteds ) ); + $output = exec( "cd {$this->temp_dir}; php $behat_tags" ); + $this->assertSame( $expected, $output ); + + putenv( false === $env_github_token ? 'GITHUB_TOKEN' : "GITHUB_TOKEN=$env_github_token" ); + } +} diff --git a/tests/test-bundled-commands.php b/tests/test-bundled-commands.php new file mode 100644 index 000000000..912f1620e --- /dev/null +++ b/tests/test-bundled-commands.php @@ -0,0 +1,43 @@ +assertEquals( $expected_result, $result ); + } + + public function dataProviderIsBundledCommands() { + return array( + // Bundled commands. + array( 'CLI_Command', true ), + array( new CLI_Command(), true ), + + // Commands not bundled. + array( 'Random_Unknown_Command', false ), + array( new Random_Unknown_Command(), false ), + + // Wrong data types. + array( array( 'CLI_Command' ), false ), + array( new stdClass(), false ), + array( 42, false ), + array( null, false ), + ); + } +} diff --git a/tests/test-commandfactory.php b/tests/test-commandfactory.php new file mode 100644 index 000000000..bf2ab11a5 --- /dev/null +++ b/tests/test-commandfactory.php @@ -0,0 +1,418 @@ +setAccessible( true ); + } + + $actual = $extract_last_doc_comment->invoke( null, $content ); + $this->assertSame( $expected, $actual ); + + // Restore. + putenv( false === $is_windows ? 'WP_CLI_TEST_IS_WINDOWS' : "WP_CLI_TEST_IS_WINDOWS=$is_windows" ); + } + + /** + * @dataProvider dataProviderExtractLastDocComment + */ + function testExtractLastDocCommentWin( $content, $expected ) { + // Save and set test env var. + $is_windows = getenv( 'WP_CLI_TEST_IS_WINDOWS' ); + putenv( 'WP_CLI_TEST_IS_WINDOWS=1' ); + + static $extract_last_doc_comment = null; + if ( null === $extract_last_doc_comment ) { + $extract_last_doc_comment = new \ReflectionMethod( 'WP_CLI\Dispatcher\CommandFactory', 'extract_last_doc_comment' ); + $extract_last_doc_comment->setAccessible( true ); + } + + $actual = $extract_last_doc_comment->invoke( null, $content ); + $this->assertSame( $expected, $actual ); + + // Restore. + putenv( false === $is_windows ? 'WP_CLI_TEST_IS_WINDOWS' : "WP_CLI_TEST_IS_WINDOWS=$is_windows" ); + } + + function dataProviderExtractLastDocComment() { + return array( + array( "", false ), + array( "*/", false ), + array( "/*/ ", false ), + array( "/**/", false ), + array( "/***/ */", false ), + array( "/***/", "/***/" ), + array( "\n /**\n \n \t\n */ \t\n \n ", "/**\n \n \t\n */" ), + array( "\r\n /**\r\n \r\n \t\r\n */ \t\r\n \r\n ", "/**\r\n \r\n \t\r\n */" ), + array( "/**/ /***/ /***/", "/***/" ), + array( "asdfasdf/** /** */", "/** /** */" ), + array( "*//** /** */", "/** /** */" ), + array( "/** *//** /** */", "/** /** */" ), + array( "*//** */ /** /** */", "/** /** */" ), + array( "*//** *//** /** /** */", "/** /** /** */" ), + + array( "/** */class qwer", "/** */" ), + array( "/**1*/class qwer{}/**2*/class asdf", "/**2*/" ), + array( "/** */class qwer {}\nclass asdf", false ), + array( "/** */class qwer {}\r\nclass asdf", false ), + + array( "/** */function qwer", "/** */" ), + array( "/** */function qwer( \$function ) {}", "/** */" ), + array( "/**1*/function qwer() {}/**2*/function asdf()", "/**2*/" ), + array( "/** */function qwer() {}\nfunction asdf()", false ), + array( "/** */function qwer() {}\r\nfunction asdf()", false ), + array( "/** */function qwer() {}function asdf()", false ), + array( "/** */function qwer() {};function asdf( \$function )", false ), + ); + } + + function testGetDocComment() { + // Save and set test env var. + $get_doc_comment = getenv( 'WP_CLI_TEST_GET_DOC_COMMENT' ); + $is_windows = getenv( 'WP_CLI_TEST_IS_WINDOWS' ); + + putenv( 'WP_CLI_TEST_GET_DOC_COMMENT=1' ); + putenv( 'WP_CLI_TEST_IS_WINDOWS=0' ); + + // Make private function accessible. + $get_doc_comment = new \ReflectionMethod( 'WP_CLI\Dispatcher\CommandFactory', 'get_doc_comment' ); + $get_doc_comment->setAccessible( true ); + + if ( ! class_exists( 'CommandFactoryTests_Get_Doc_Comment_1_Command', false ) ) { + require __DIR__ . '/data/commandfactory-doc_comment-class.php'; + } + if ( ! class_exists( 'CommandFactoryTests_Get_Doc_Comment_1_Command_Win', false ) ) { + require __DIR__ . '/data/commandfactory-doc_comment-class-win.php'; + } + + // Class 1 + + $reflection = new \ReflectionClass( 'CommandFactoryTests_Get_Doc_Comment_1_Command' ); + $expected = $reflection->getDocComment(); + + $actual = $get_doc_comment->invoke( null, $reflection ); + $this->assertSame( $expected, $actual ); + + // Class method 1 + + $reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command', 'command1' ); + $expected = $reflection->getDocComment(); + + $actual = $get_doc_comment->invoke( null, $reflection ); + $this->assertSame( $expected, $actual ); + + // Class method 2 + + $reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command', 'command2' ); + $expected = $reflection->getDocComment(); + + $actual = $get_doc_comment->invoke( null, $reflection ); + $this->assertSame( $expected, $actual ); + + // Class method 3 + + $reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command', 'command3' ); + $expected = $reflection->getDocComment(); + + $actual = $get_doc_comment->invoke( null, $reflection ); + $this->assertSame( $expected, $actual ); + + // Class method 4 + + $reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command', 'command4' ); + $expected = $reflection->getDocComment(); + + $actual = $get_doc_comment->invoke( null, $reflection ); + $this->assertSame( $expected, $actual ); + $this->assertFalse( $actual ); + + // Class 1 Windows + + $reflection = new \ReflectionClass( 'CommandFactoryTests_Get_Doc_Comment_1_Command_Win' ); + $expected = $reflection->getDocComment(); + + $actual = $get_doc_comment->invoke( null, $reflection ); + $this->assertSame( $expected, $actual ); + + // Class method 1 + + $reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command_Win', 'command1' ); + $expected = $reflection->getDocComment(); + + $actual = $get_doc_comment->invoke( null, $reflection ); + $this->assertSame( $expected, $actual ); + + // Class method 2 + + $reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command_Win', 'command2' ); + $expected = $reflection->getDocComment(); + + $actual = $get_doc_comment->invoke( null, $reflection ); + $this->assertSame( $expected, $actual ); + + // Class method 3 + + $reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command_Win', 'command3' ); + $expected = $reflection->getDocComment(); + + $actual = $get_doc_comment->invoke( null, $reflection ); + $this->assertSame( $expected, $actual ); + + // Class method 4 + + $reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command_Win', 'command4' ); + $expected = $reflection->getDocComment(); + + $actual = $get_doc_comment->invoke( null, $reflection ); + $this->assertSame( $expected, $actual ); + $this->assertFalse( $actual ); + + // Class 2 + + $reflection = new \ReflectionClass( 'CommandFactoryTests_Get_Doc_Comment_2_Command' ); + $expected = $reflection->getDocComment(); + + $actual = $get_doc_comment->invoke( null, $reflection ); + $this->assertSame( $expected, $actual ); + + // Class method 1 + + $reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_2_Command', 'command1' ); + $expected = $reflection->getDocComment(); + + $actual = $get_doc_comment->invoke( null, $reflection ); + $this->assertSame( $expected, $actual ); + $this->assertFalse( $actual ); + + // Class 2 Windows + + $reflection = new \ReflectionClass( 'CommandFactoryTests_Get_Doc_Comment_2_Command_Win' ); + $expected = $reflection->getDocComment(); + + $actual = $get_doc_comment->invoke( null, $reflection ); + $this->assertSame( $expected, $actual ); + + // Class method 1 + + $reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_2_Command_Win', 'command1' ); + $expected = $reflection->getDocComment(); + + $actual = $get_doc_comment->invoke( null, $reflection ); + $this->assertSame( $expected, $actual ); + $this->assertFalse( $actual ); + + // Functions + + require __DIR__ . '/data/commandfactory-doc_comment-function.php'; + + // Function 1 + + $reflection = new \ReflectionFunction( 'commandfactorytests_get_doc_comment_func_1' ); + $expected = $reflection->getDocComment(); + + $actual = $get_doc_comment->invoke( null, $reflection ); + $this->assertSame( $expected, $actual ); + + // Function 2 + + $reflection = new \ReflectionFunction( 'commandfactorytests_get_doc_comment_func_2' ); + $expected = $reflection->getDocComment(); + + $actual = $get_doc_comment->invoke( null, $reflection ); + $this->assertSame( $expected, $actual ); + + // Function 3 + + $reflection = new \ReflectionFunction( $commandfactorytests_get_doc_comment_func_3 ); + $expected = $reflection->getDocComment(); + + $actual = $get_doc_comment->invoke( null, $reflection ); + $this->assertSame( $expected, $actual ); + + // Restore. + putenv( false === $get_doc_comment ? 'WP_CLI_TEST_GET_DOC_COMMENT' : "WP_CLI_TEST_GET_DOC_COMMENT=$get_doc_comment" ); + putenv( false === $is_windows ? 'WP_CLI_TEST_IS_WINDOWS' : "WP_CLI_TEST_IS_WINDOWS=$is_windows" ); + } + + function testGetDocCommentWin() { + // Save and set test env var. + $get_doc_comment = getenv( 'WP_CLI_TEST_GET_DOC_COMMENT' ); + $is_windows = getenv( 'WP_CLI_TEST_IS_WINDOWS' ); + + putenv( 'WP_CLI_TEST_GET_DOC_COMMENT=1' ); + putenv( 'WP_CLI_TEST_IS_WINDOWS=1' ); + + // Make private function accessible. + $get_doc_comment = new \ReflectionMethod( 'WP_CLI\Dispatcher\CommandFactory', 'get_doc_comment' ); + $get_doc_comment->setAccessible( true ); + + if ( ! class_exists( 'CommandFactoryTests_Get_Doc_Comment_1_Command', false ) ) { + require __DIR__ . '/data/commandfactory-doc_comment-class.php'; + } + if ( ! class_exists( 'CommandFactoryTests_Get_Doc_Comment_1_Command_Win', false ) ) { + require __DIR__ . '/data/commandfactory-doc_comment-class-win.php'; + } + + // Class 1 + + $reflection = new \ReflectionClass( 'CommandFactoryTests_Get_Doc_Comment_1_Command' ); + $expected = $reflection->getDocComment(); + + $actual = $get_doc_comment->invoke( null, $reflection ); + $this->assertSame( $expected, $actual ); + + // Class method 1 + + $reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command', 'command1' ); + $expected = $reflection->getDocComment(); + + $actual = $get_doc_comment->invoke( null, $reflection ); + $this->assertSame( $expected, $actual ); + + // Class method 2 + + $reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command', 'command2' ); + $expected = $reflection->getDocComment(); + + $actual = $get_doc_comment->invoke( null, $reflection ); + $this->assertSame( $expected, $actual ); + + // Class method 3 + + $reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command', 'command3' ); + $expected = $reflection->getDocComment(); + + $actual = $get_doc_comment->invoke( null, $reflection ); + $this->assertSame( $expected, $actual ); + + // Class method 4 + + $reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command', 'command4' ); + $expected = $reflection->getDocComment(); + + $actual = $get_doc_comment->invoke( null, $reflection ); + $this->assertSame( $expected, $actual ); + $this->assertFalse( $actual ); + + // Class 1 Windows + + $reflection = new \ReflectionClass( 'CommandFactoryTests_Get_Doc_Comment_1_Command_Win' ); + $expected = $reflection->getDocComment(); + + $actual = $get_doc_comment->invoke( null, $reflection ); + $this->assertSame( $expected, $actual ); + + // Class method 1 + + $reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command_Win', 'command1' ); + $expected = $reflection->getDocComment(); + + $actual = $get_doc_comment->invoke( null, $reflection ); + $this->assertSame( $expected, $actual ); + + // Class method 2 + + $reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command_Win', 'command2' ); + $expected = $reflection->getDocComment(); + + $actual = $get_doc_comment->invoke( null, $reflection ); + $this->assertSame( $expected, $actual ); + + // Class method 3 + + $reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command_Win', 'command3' ); + $expected = $reflection->getDocComment(); + + $actual = $get_doc_comment->invoke( null, $reflection ); + $this->assertSame( $expected, $actual ); + + // Class method 4 + + $reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command_Win', 'command4' ); + $expected = $reflection->getDocComment(); + + $actual = $get_doc_comment->invoke( null, $reflection ); + $this->assertSame( $expected, $actual ); + $this->assertFalse( $actual ); + + // Class 2 + + $reflection = new \ReflectionClass( 'CommandFactoryTests_Get_Doc_Comment_2_Command' ); + $expected = $reflection->getDocComment(); + + $actual = $get_doc_comment->invoke( null, $reflection ); + $this->assertSame( $expected, $actual ); + + // Class method 1 + + $reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_2_Command', 'command1' ); + $expected = $reflection->getDocComment(); + + $actual = $get_doc_comment->invoke( null, $reflection ); + $this->assertSame( $expected, $actual ); + $this->assertFalse( $actual ); + + // Class 2 Windows + + $reflection = new \ReflectionClass( 'CommandFactoryTests_Get_Doc_Comment_2_Command_Win' ); + $expected = $reflection->getDocComment(); + + $actual = $get_doc_comment->invoke( null, $reflection ); + $this->assertSame( $expected, $actual ); + + // Class method 1 + + $reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_2_Command_Win', 'command1' ); + $expected = $reflection->getDocComment(); + + $actual = $get_doc_comment->invoke( null, $reflection ); + $this->assertSame( $expected, $actual ); + $this->assertFalse( $actual ); + + // Functions + + require __DIR__ . '/data/commandfactory-doc_comment-function-win.php'; + + // Function 1 Windows + + $reflection = new \ReflectionFunction( 'commandfactorytests_get_doc_comment_func_1_win' ); + $expected = $reflection->getDocComment(); + + $actual = $get_doc_comment->invoke( null, $reflection ); + $this->assertSame( $expected, $actual ); + + // Function 2 + + $reflection = new \ReflectionFunction( 'commandfactorytests_get_doc_comment_func_2_win' ); + $expected = $reflection->getDocComment(); + + $actual = $get_doc_comment->invoke( null, $reflection ); + $this->assertSame( $expected, $actual ); + + // Function 3 + + $reflection = new \ReflectionFunction( $commandfactorytests_get_doc_comment_func_3_win ); + $expected = $reflection->getDocComment(); + + $actual = $get_doc_comment->invoke( null, $reflection ); + $this->assertSame( $expected, $actual ); + + // Restore. + putenv( false === $get_doc_comment ? 'WP_CLI_TEST_GET_DOC_COMMENT' : "WP_CLI_TEST_GET_DOC_COMMENT=$get_doc_comment" ); + putenv( false === $is_windows ? 'WP_CLI_TEST_IS_WINDOWS' : "WP_CLI_TEST_IS_WINDOWS=$is_windows" ); + } +} diff --git a/tests/test-configurator.php b/tests/test-configurator.php new file mode 100644 index 000000000..ea13aaeb3 --- /dev/null +++ b/tests/test-configurator.php @@ -0,0 +1,65 @@ +assertCount( 1, $args[0] ); + $this->assertCount( 2, $args[1] ); + + $this->assertEquals( 'foo', $args[0][0] ); + + $this->assertEquals( 'bar', $args[1][0][0] ); + $this->assertTrue( $args[1][0][1] ); + + $this->assertEquals( 'baz', $args[1][1][0] ); + $this->assertEquals( 'text', $args[1][1][1] ); + + } + + function testExtractAssocNoValue() { + $args = Configurator::extract_assoc( array( 'foo', '--bar=', '--baz=text' ) ); + + $this->assertCount( 1, $args[0] ); + $this->assertCount( 2, $args[1] ); + + $this->assertEquals( 'foo', $args[0][0] ); + + $this->assertEquals( 'bar', $args[1][0][0] ); + $this->assertEmpty( $args[1][0][1] ); + + $this->assertEquals( 'baz', $args[1][1][0] ); + $this->assertEquals( 'text', $args[1][1][1] ); + + } + + function testExtractAssocGlobalLocal() { + $args = Configurator::extract_assoc( array( '--url=foo.dev', '--path=wp', 'foo', '--bar=', '--baz=text', '--url=bar.dev' ) ); + + $this->assertCount( 1, $args[0] ); + $this->assertCount( 5, $args[1] ); + $this->assertCount( 2, $args[2] ); + $this->assertCount( 3, $args[3] ); + + $this->assertEquals( 'url', $args[2][0][0] ); + $this->assertEquals( 'foo.dev', $args[2][0][1] ); + $this->assertEquals( 'url', $args[3][2][0] ); + $this->assertEquals( 'bar.dev', $args[3][2][1] ); + } + + function testExtractAssocDoubleDashInValue() { + $args = Configurator::extract_assoc( array( '--test=text--text' ) ); + + $this->assertCount( 0, $args[0] ); + $this->assertCount( 1, $args[1] ); + + $this->assertEquals( 'test', $args[1][0][0] ); + $this->assertEquals( 'text--text', $args[1][0][1] ); + + } + + +} diff --git a/tests/test-doc-parser.php b/tests/test-doc-parser.php new file mode 100644 index 000000000..7fdf261c0 --- /dev/null +++ b/tests/test-doc-parser.php @@ -0,0 +1,200 @@ +assertEquals( '', $doc->get_shortdesc() ); + $this->assertEquals( '', $doc->get_longdesc() ); + $this->assertEquals( '', $doc->get_synopsis() ); + $this->assertEquals( '', $doc->get_tag('alias') ); + } + + function test_only_tags() { + $doc = new DocParser( <<assertEquals( '', $doc->get_shortdesc() ); + $this->assertEquals( '', $doc->get_longdesc() ); + $this->assertEquals( '', $doc->get_synopsis() ); + $this->assertEquals( '', $doc->get_tag('foo') ); + $this->assertEquals( 'rock-on', $doc->get_tag('alias') ); + $this->assertEquals( 'revoke-md5-passwords', $doc->get_tag('subcommand') ); + } + + function test_no_longdesc() { + $doc = new DocParser( <<assertEquals( 'Rock and roll!', $doc->get_shortdesc() ); + $this->assertEquals( '', $doc->get_longdesc() ); + $this->assertEquals( '', $doc->get_synopsis() ); + $this->assertEquals( 'rock-on', $doc->get_tag('alias') ); + } + + function test_complete() { + $doc = new DocParser( <<... + * : Start with one or more genres. + * + * --volume= + * : Sets the volume. + * + * --artist= + * : Limit to a specific artist. + * + * ## EXAMPLES + * + * wp rock-on --volume=11 + * + * @synopsis [--volume=] + * @alias rock-on + */ +EOB + ); + + $this->assertEquals( 'Rock and roll!', $doc->get_shortdesc() ); + $this->assertEquals( '[--volume=]', $doc->get_synopsis() ); + $this->assertEquals( 'Start with one or more genres.', $doc->get_arg_desc( 'genre' ) ); + $this->assertEquals( 'Sets the volume.', $doc->get_param_desc( 'volume' ) ); + $this->assertEquals( 'rock-on', $doc->get_tag('alias') ); + + $longdesc = <<... +: Start with one or more genres. + +--volume= +: Sets the volume. + +--artist= +: Limit to a specific artist. + +## EXAMPLES + +wp rock-on --volume=11 +EOB + ; + $this->assertEquals( $longdesc, $doc->get_longdesc() ); + } + + public function test_desc_parses_yaml() { + $longdesc = <<... +: Start with one or more genres. +--- +options: + - rock + - electronic +default: rock +--- + +--volume= +: Sets the volume. +--- +default: 10 +--- + +--artist= +: Limit to a specific artist. + +## EXAMPLES + +wp rock-on electronic --volume=11 + +EOB; + $doc = new DocParser( $longdesc ); + $this->assertEquals( 'Start with one or more genres.', $doc->get_arg_desc( 'genre' ) ); + $this->assertEquals( 'Sets the volume.', $doc->get_param_desc( 'volume' ) ); + $this->assertEquals( array( + 'options' => array( 'rock', 'electronic' ), + 'default' => 'rock', + ), $doc->get_arg_args( 'genre' ) ); + $this->assertEquals( array( + 'default' => 10, + ), $doc->get_param_args( 'volume' ) ); + $this->assertNull( $doc->get_param_args( 'artist' ) ); + } + + public function test_desc_doesnt_parse_far_params_yaml() { + $longdesc = << +: The name of the action or filter. + +[--format=] +: List callbacks as a table, JSON, CSV, or YAML. +--- +default: table +options: + - table + - json + - csv + - yaml +--- +EOB; + $doc = new DocParser( $longdesc ); + $this->assertEquals( array( + 'default' => 'table', + 'options' => array( 'table', 'json', 'csv', 'yaml' ), + ), $doc->get_param_args( 'format' ) ); + $this->assertNull( $doc->get_arg_args( 'hook' ) ); + } + + public function test_desc_doesnt_parse_far_args_yaml() { + $longdesc = << +: The name of the action or filter. + + +: List callbacks as a table, JSON, CSV, or YAML. +--- +default: table +options: + - table + - json + - csv + - yaml +--- +EOB; + $doc = new DocParser( $longdesc ); + $this->assertEquals( array( + 'default' => 'table', + 'options' => array( 'table', 'json', 'csv', 'yaml' ), + ), $doc->get_arg_args( 'format' ) ); + $this->assertNull( $doc->get_arg_args( 'hook' ) ); + } + +} + diff --git a/tests/test-extractor.php b/tests/test-extractor.php new file mode 100644 index 000000000..330b99390 --- /dev/null +++ b/tests/test-extractor.php @@ -0,0 +1,274 @@ +setAccessible( true ); + self::$prev_logger = $class_wp_cli_logger->getValue(); + + self::$logger = new \WP_CLI\Loggers\Execution; + WP_CLI::set_logger( self::$logger ); + + // Remove any failed tests detritus. + $temp_dirs = Utils\get_temp_dir() . self::$copy_overwrite_files_prefix . '*'; + foreach ( glob( $temp_dirs ) as $temp_dir ) { + Extractor::rmdir( $temp_dir ); + } + } + + public function tearDown() { + // Restore logger. + WP_CLI::set_logger( self::$prev_logger ); + + parent::tearDown(); + } + + public function test_rmdir() { + list( $temp_dir, $src_dir, $wp_dir ) = self::create_test_directory_structure(); + + $this->assertTrue( is_dir( $wp_dir ) ); + Extractor::rmdir( $wp_dir ); + $this->assertFalse( file_exists( $wp_dir ) ); + + $this->assertTrue( is_dir( $temp_dir ) ); + Extractor::rmdir( $temp_dir ); + $this->assertFalse( file_exists( $temp_dir ) ); + } + + public function test_err_rmdir() { + $msg = ''; + try { + Extractor::rmdir( 'no-such-dir' ); + } catch ( \Exception $e ) { + $msg = $e->getMessage(); + } + $this->assertTrue( false !== strpos( $msg, 'no-such-dir' ) ); + $this->assertTrue( empty( self::$logger->stderr ) ); + } + + public function test_copy_overwrite_files() { + list( $temp_dir, $src_dir, $wp_dir ) = self::create_test_directory_structure(); + + $dest_dir = $temp_dir . '/dest'; + + Extractor::copy_overwrite_files( $wp_dir, $dest_dir ); + + $files = self::recursive_scandir( $dest_dir ); + + $this->assertSame( self::$expected_wp, $files ); + $this->assertTrue( empty( self::$logger->stderr ) ); + + // Clean up. + Extractor::rmdir( $temp_dir ); + } + + public function test_err_copy_overwrite_files() { + $msg = ''; + try { + Extractor::copy_overwrite_files( 'no-such-dir', 'dest-dir' ); + } catch ( \Exception $e ) { + $msg = $e->getMessage(); + } + $this->assertTrue( false !== strpos( $msg, 'no-such-dir' ) ); + $this->assertTrue( empty( self::$logger->stderr ) ); + } + + public function test_extract_tarball() { + if ( ! exec( 'tar --version' ) ) { + $this->markTestSkipped( 'tar not installed.' ); + } + + list( $temp_dir, $src_dir, $wp_dir ) = self::create_test_directory_structure(); + + $tarball = $temp_dir . '/test.tar.gz'; + $dest_dir = $temp_dir . '/dest'; + + // Create test tarball. + $output = array(); + $return_var = -1; + // Need --force-local for Windows to avoid "C:" being interpreted as being on remote machine. + exec( Utils\esc_cmd( 'tar czvf %1$s --force-local --directory=%2$s/src wordpress', $tarball, $temp_dir ), $output, $return_var ); + $this->assertSame( 0, $return_var ); + $this->assertFalse( empty( $output ) ); + sort( $output ); + $this->assertSame( self::recursive_scandir( $src_dir ), $output ); + + // Test. + Extractor::extract( $tarball, $dest_dir ); + + $files = self::recursive_scandir( $dest_dir ); + $this->assertSame( self::$expected_wp, $files ); + $this->assertTrue( empty( self::$logger->stderr ) ); + + // Clean up. + Extractor::rmdir( $temp_dir ); + } + + public function test_err_extract_tarball() { + // Non-existent. + $msg = ''; + try { + Extractor::extract( 'no-such-tar.tar.gz', 'dest-dir' ); + } catch ( \Exception $e ) { + $msg = $e->getMessage(); + } + $this->assertTrue( false !== strpos( $msg, 'no-such-tar' ) ); + $this->assertTrue( 0 === strpos( self::$logger->stderr, 'Warning: PharData failed' ) ); + $this->assertTrue( false !== strpos( self::$logger->stderr, 'no-such-tar' ) ); + + self::$logger->stderr = self::$logger->stdout = ''; // Reset logger. + + // Zero-length. + $zero_tar = Utils\get_temp_dir() . 'zero-tar.tar.gz'; + touch( $zero_tar ); + $msg = ''; + try { + Extractor::extract( $zero_tar, 'dest-dir' ); + } catch ( \Exception $e ) { + $msg = $e->getMessage(); + } + unlink( $zero_tar ); + $this->assertTrue( false !== strpos( $msg, 'zero-tar' ) ); + $this->assertTrue( 0 === strpos( self::$logger->stderr, 'Warning: PharData failed' ) ); + $this->assertTrue( false !== strpos( self::$logger->stderr, 'zero-tar' ) ); + } + + public function test_extract_zip() { + if ( ! class_exists( 'ZipArchive' ) ) { + $this->markTestSkipped( 'ZipArchive not installed.' ); + } + + list( $temp_dir, $src_dir, $wp_dir ) = self::create_test_directory_structure(); + + $zipfile = $temp_dir . '/test.zip'; + $dest_dir = $temp_dir . '/dest'; + + // Create test zip. + $zip = new ZipArchive; + $result = $zip->open( $zipfile, ZipArchive::CREATE ); + $this->assertTrue( $result ); + $files = self::recursive_scandir( $src_dir ); + foreach ( $files as $file ) { + if ( 0 === substr_compare( $file, '/', -1 ) ) { + $result = $zip->addEmptyDir( $file ); + } else { + $result = $zip->addFile( $src_dir . '/' . $file, $file ); + } + $this->assertTrue( $result ); + } + $result = $zip->close(); + $this->assertTrue( $result ); + + // Test. + Extractor::extract( $zipfile, $dest_dir ); + + $files = self::recursive_scandir( $dest_dir ); + $this->assertSame( self::$expected_wp, $files ); + $this->assertTrue( empty( self::$logger->stderr ) ); + + // Clean up. + Extractor::rmdir( $temp_dir ); + } + + public function test_err_extract_zip() { + if ( ! class_exists( 'ZipArchive' ) ) { + $this->markTestSkipped( 'ZipArchive not installed.' ); + } + + // Non-existent. + $msg = ''; + try { + Extractor::extract( 'no-such-zip.zip', 'dest-dir' ); + } catch ( \Exception $e ) { + $msg = $e->getMessage(); + } + $this->assertTrue( false !== strpos( $msg, 'no-such-zip' ) ); + $this->assertTrue( empty( self::$logger->stderr ) ); + + self::$logger->stderr = self::$logger->stdout = ''; // Reset logger. + + // Zero-length. + $zero_zip = Utils\get_temp_dir() . 'zero-zip.zip'; + touch( $zero_zip ); + $msg = ''; + try { + Extractor::extract( $zero_zip, 'dest-dir' ); + } catch ( \Exception $e ) { + $msg = $e->getMessage(); + } + unlink( $zero_zip ); + $this->assertTrue( false !== strpos( $msg, 'zero-zip' ) ); + $this->assertTrue( empty( self::$logger->stderr ) ); + } + + public function test_err_extract() { + $msg = ''; + try { + Extractor::extract( 'not-supported.tar.xz', 'dest-dir' ); + } catch ( \Exception $e ) { + $msg = $e->getMessage(); + } + $this->assertSame( "Extraction only supported for '.zip' and '.tar.gz' file types.", $msg ); + $this->assertTrue( empty( self::$logger->stderr ) ); + } + + private function create_test_directory_structure() { + $temp_dir = Utils\get_temp_dir() . uniqid( self::$copy_overwrite_files_prefix, true ); + mkdir( $temp_dir ); + + $src_dir = $temp_dir . '/src'; + mkdir( $src_dir ); + + $wp_dir = $src_dir . '/wordpress'; + mkdir( $wp_dir ); + + foreach ( self::$expected_wp as $file ) { + if ( 0 === substr_compare( $file, '/', -1 ) ) { + mkdir( $wp_dir . '/' . $file ); + } else { + touch( $wp_dir . '/' . $file ); + } + } + + return array( $temp_dir, $src_dir, $wp_dir ); + } + + private function recursive_scandir( $dir, $prefix_dir = '' ) { + $ret = array(); + foreach ( array_diff( scandir( $dir ), array( '.', '..' ) ) as $file ) { + if ( is_dir( $dir . '/' . $file ) ) { + $ret[] = ( $prefix_dir ? ( $prefix_dir . '/'. $file ) : $file ) . '/'; + $ret = array_merge( $ret, self::recursive_scandir( $dir . '/' . $file, $prefix_dir ? ( $prefix_dir . '/' . $file ) : $file ) ); + } else { + $ret[] = $prefix_dir ? ( $prefix_dir . '/'. $file ) : $file; + } + } + return $ret; + } +} diff --git a/tests/test-file-cache.php b/tests/test-file-cache.php new file mode 100644 index 000000000..1ab58e6fb --- /dev/null +++ b/tests/test-file-cache.php @@ -0,0 +1,84 @@ +assertSame( $cache_dir . '/', $cache->get_root() ); + unset( $cache ); + + $cache = new FileCache( $cache_dir . '/', $ttl, $max_size ); + $this->assertSame( $cache_dir . '/', $cache->get_root() ); + unset( $cache ); + + $cache = new FileCache( $cache_dir . '\\', $ttl, $max_size ); + $this->assertSame( $cache_dir . '/', $cache->get_root() ); + unset( $cache ); + + rmdir( $cache_dir ); + } + + public function test_ensure_dir_exists() { + $class_wp_cli_logger = new ReflectionProperty( 'WP_CLI', 'logger' ); + $class_wp_cli_logger->setAccessible( true ); + $prev_logger = $class_wp_cli_logger->getValue(); + + $logger = new WP_CLI\Loggers\Execution; + WP_CLI::set_logger( $logger ); + + $max_size = 32; + $ttl = 60; + $cache_dir = Utils\get_temp_dir() . uniqid( 'wp-cli-test-file-cache', true ); + + $cache = new FileCache( $cache_dir, $ttl, $max_size ); + $test_class = new ReflectionClass( $cache ); + $method = $test_class->getMethod( 'ensure_dir_exists' ); + $method->setAccessible( true ); + + // Cache directory should be created. + $result = $method->invokeArgs( $cache, array( $cache_dir . '/test1' ) ); + $this->assertTrue( $result ); + $this->assertTrue( is_dir( $cache_dir . '/test1' ) ); + + // Try to create the same directory again. it should return true. + $result = $method->invokeArgs( $cache, array( $cache_dir . '/test1' ) ); + $this->assertTrue( $result ); + + // `chmod()` doesn't work on Windows. + if ( ! Utils\is_windows() ) { + // It should be failed because permission denied. + $logger->stderr = ''; + chmod( $cache_dir . '/test1', 0000 ); + $result = $method->invokeArgs( $cache, array( $cache_dir . '/test1/error' ) ); + $expected = "/^Warning: Failed to create directory '.+': mkdir\(\): Permission denied\.$/"; + $this->assertRegexp( $expected, $logger->stderr ); + } + + // It should be failed because file exists. + $logger->stderr = ''; + file_put_contents( $cache_dir . '/test2', '' ); + $result = $method->invokeArgs( $cache, array( $cache_dir . '/test2' ) ); + $expected = "/^Warning: Failed to create directory '.+': mkdir\(\): File exists\.$/"; + $this->assertRegexp( $expected, $logger->stderr ); + + // Restore + chmod( $cache_dir . '/test1', 0755 ); + rmdir( $cache_dir . '/test1' ); + unlink( $cache_dir . '/test2' ); + rmdir( $cache_dir ); + $class_wp_cli_logger->setValue( $prev_logger ); + } +} diff --git a/tests/test-help.php b/tests/test-help.php new file mode 100644 index 000000000..9cbbb2a62 --- /dev/null +++ b/tests/test-help.php @@ -0,0 +1,117 @@ +getMethod( 'parse_reference_links' ); + $method->setAccessible( true ); + + $desc = 'This is a [reference link](https://wordpress.org/). It should be displayed very nice!'; + $result = $method->invokeArgs( null, array( $desc ) ); + + $expected =<<assertSame( $expected, $result ); + + $desc = 'This is a [reference link](https://wordpress.org/) and [second link](http://wp-cli.org/). It should be displayed very nice!'; + $result = $method->invokeArgs( null, array( $desc ) ); + + $expected =<<assertSame( $expected, $result ); + + $desc =<<invokeArgs( null, array( $desc ) ); + + $expected =<<assertSame( $expected, $result ); + + $desc =<<invokeArgs( null, array( $desc ) ); + + $expected =<<assertSame( $expected, $result ); + + $desc =<<invokeArgs( null, array( $desc ) ); + + $expected =<<assertSame( $expected, $result ); + + $desc =<<invokeArgs( null, array( $desc ) ); + + $expected =<<assertSame( $expected, $result ); + } +} diff --git a/tests/test-logging.php b/tests/test-logging.php new file mode 100644 index 000000000..8ab356707 --- /dev/null +++ b/tests/test-logging.php @@ -0,0 +1,113 @@ + array ( + 'debug' => true + ) + ); + } + + protected function write( $handle, $str ) { + echo $str; + } +} + +class MockQuietLogger extends WP_CLI\Loggers\Quiet { + + protected function get_runner() { + return (object) array ( + 'config' => array ( + 'debug' => true + ) + ); + } +} + +class LoggingTests extends PHPUnit_Framework_TestCase { + + function testLogDebug() { + $message = 'This is a test message.'; + + $regularLogger = new MockRegularLogger( false ); + $this->expectOutputRegex( "/Debug: {$message} \(\d+\.*\d*s\)/" ); + $regularLogger->debug( $message ); + + $quietLogger = new MockQuietLogger(); + $this->expectOutputRegex( "/Debug: {$message} \(\d+\.*\d*s\)/" ); + $quietLogger->debug( $message ); + } + + function testLogEscaping() { + $logger = new MockRegularLogger( false ); + + $message = 'foo%20bar'; + + $this->expectOutputString( "Success: $message\n" ); + $logger->success( $message ); + } + + function testExecutionLogger() { + // Save Runner config. + $runner = WP_CLI::get_runner(); + $runner_config = new \ReflectionProperty( $runner, 'config' ); + $runner_config->setAccessible( true ); + + $prev_config = $runner_config->getValue( $runner ); + + // Set debug. + $runner_config->setValue( $runner, array( 'debug' => true ) ); + + $logger = new WP_CLI\Loggers\Execution; + + // Standard use. + + $logger->info( 'info' ); + $logger->info( 'info2' ); + $logger->success( 'success' ); + $logger->warning( 'warning' ); + $logger->error( 'error' ); + $logger->success( 'success2' ); + $logger->warning( 'warning2' ); + $logger->debug( 'debug', 'group' ); + $logger->error_multi_line( array( "line11", "line12", "line13" ) ); + $logger->error( 'error2' ); + $logger->error_multi_line( array( "line21" ) ); + $logger->debug( 'debug2', 'group2' ); + + $this->assertSame( "info\ninfo2\nSuccess: success\nSuccess: success2\n", $logger->stdout ); + $this->assertSame( 1, preg_match( '/^' + . 'Warning: warning\nError: error\n' + . 'Warning: warning2\nDebug \(group\): debug \([0-9.]+s\)\n' + . 'Error:\nline11\nline12\nline13\n---------\n\nError: error2\n' + . 'Error:\nline21\n---------\n\nDebug \(group2\): debug2 \([0-9.]+s\)$/', $logger->stderr ) ); + + $logger->stdout = $logger->stderr = ''; + + // With output buffering. + + $logger->ob_start(); + + echo "echo"; + $logger->info( 'info' ); + print "print\n"; + $logger->success( 'success' ); + echo "echo2\n"; + $logger->error( 'error' ); + echo "echo3\n"; + $logger->success( 'success2' ); + echo "echo4"; + + $logger->ob_end(); + + $this->assertSame( "echoinfo\nprint\nSuccess: success\necho2\necho3\nSuccess: success2\necho4", $logger->stdout ); + $this->assertSame( "Error: error\n", $logger->stderr ); + + $logger->stdout = $logger->stderr = ''; + + // Restore. + $runner_config->setValue( $runner, $prev_config ); + } +} diff --git a/tests/test-process.php b/tests/test-process.php new file mode 100644 index 000000000..562451597 --- /dev/null +++ b/tests/test-process.php @@ -0,0 +1,29 @@ +run(); + + $this->assertSame( $process_run->stdout, $expected_out ); + } + + function data_process_env() { + return array( + array( '', array(), array(), '' ), + array( 'ENV=blah', array(), array( 'ENV' ), 'blah' ), + array( 'ENV="blah blah"', array(), array( 'ENV' ), 'blah blah' ), + array( 'ENV_1="blah1 blah1" ENV_2="blah2" ENV_3=blah3', array( 'ENV' => 'in' ), array( 'ENV', 'ENV_1', 'ENV_2', 'ENV_3' ), 'inblah1 blah1blah2blah3' ), + array( 'ENV=blah', array( 'ENV_1' => 'in1', 'ENV_2' => 'in2' ), array( 'ENV_1', 'ENV_2', 'ENV' ), 'in1in2blah' ), + ); + } +} diff --git a/tests/test-search-replace.php b/tests/test-search-replace.php new file mode 100644 index 000000000..c08a8a475 --- /dev/null +++ b/tests/test-search-replace.php @@ -0,0 +1,86 @@ +run( $data, $serialised ); + } + + function testReplaceString() { + $orig = 'foo'; + $replacement = self::recursive_unserialize_replace( 'foo', 'bar', $orig ); + $this->assertEquals( 'bar', $replacement ); + } + + function testPrivateConstructor() { + $old_obj = ClassWithPrivateConstructor::get_instance(); + + $new_obj = self::recursive_unserialize_replace( 'foo', 'bar', $old_obj, false, true ); + $this->assertEquals( 'bar', $new_obj->prop ); + } + + function testObjectLoop() { + $old_object = new stdClass(); + $old_object->prop = 'foo'; + $old_object->self = $old_object; + + $new_obj = self::recursive_unserialize_replace( 'foo', 'bar', $old_object, false, true ); + $this->assertEquals( 'bar', $new_obj->prop ); + } + + function testArrayLoop() { + $old_array = array( 'prop' => 'foo' ); + $old_array['self'] = &$old_array; + + $new_array = self::recursive_unserialize_replace( 'foo', 'bar', $old_array, false, true ); + $this->assertEquals( 'bar', $new_array['prop'] ); + } + + function testArraySameValues() { + $old_array = array( + 'prop1' => array( + 'foo', + ), + 'prop2' => array( + 'foo', + ), + ); + $new_array = self::recursive_unserialize_replace( 'foo', 'bar', $old_array, false, true ); + $this->assertEquals( 'bar', $new_array['prop1'][0] ); + $this->assertEquals( 'bar', $new_array['prop2'][0] ); + } + + function testMixedObjectArrayLoop() { + $old_object = new stdClass(); + $old_object->prop = 'foo'; + $old_object->array = array('prop' => 'foo'); + $old_object->array['object'] = $old_object; + + $new_object = self::recursive_unserialize_replace( 'foo', 'bar', $old_object, false, true ); + $this->assertEquals( 'bar', $new_object->prop ); + $this->assertEquals( 'bar', $new_object->array['prop']); + } + + function testMixedArrayObjectLoop() { + $old_array = array( 'prop' => 'foo', 'object' => new stdClass() ); + $old_array['object']->prop = 'foo'; + $old_array['object']->array = &$old_array; + + $new_array = self::recursive_unserialize_replace( 'foo', 'bar', $old_array, false, true ); + $this->assertEquals( 'bar', $new_array['prop'] ); + $this->assertEquals( 'bar', $new_array['object']->prop); + } +} + + +class ClassWithPrivateConstructor { + + public $prop = 'foo'; + + private function __construct() {} + + public static function get_instance() { + return new self; + } +} diff --git a/tests/test-synopsis.php b/tests/test-synopsis.php new file mode 100644 index 000000000..418d74d81 --- /dev/null +++ b/tests/test-synopsis.php @@ -0,0 +1,185 @@ +assertEmpty( $r ); + } + + function testPositional() { + $r = SynopsisParser::parse( ' []' ); + + $this->assertCount( 2, $r ); + + $param = $r[0]; + $this->assertEquals( 'positional', $param['type'] ); + $this->assertFalse( $param['optional'] ); + + $param = $r[1]; + $this->assertEquals( 'positional', $param['type'] ); + $this->assertTrue( $param['optional'] ); + } + + function testFlag() { + $r = SynopsisParser::parse( '[--foo]' ); + + $this->assertCount( 1, $r ); + + $param = $r[0]; + $this->assertEquals( 'flag', $param['type'] ); + $this->assertTrue( $param['optional'] ); + + // flags can't be mandatory + $r = SynopsisParser::parse( '--foo' ); + + $this->assertCount( 1, $r ); + + $param = $r[0]; + $this->assertEquals( 'unknown', $param['type'] ); + } + + function testGeneric() { + $r = SynopsisParser::parse( '--= [--=] --[=] [--[=]]' ); + + $this->assertCount( 4, $r ); + + $param = $r[0]; + $this->assertEquals( 'generic', $param['type'] ); + $this->assertFalse( $param['optional'] ); + + $param = $r[1]; + $this->assertEquals( 'generic', $param['type'] ); + $this->assertTrue( $param['optional'] ); + + $param = $r[2]; + $this->assertEquals( 'unknown', $param['type'] ); + + $param = $r[3]; + $this->assertEquals( 'unknown', $param['type'] ); + } + + function testAssoc() { + $r = SynopsisParser::parse( '--foo= [--bar=] [--bar[=]]' ); + + $this->assertCount( 3, $r ); + + $param = $r[0]; + $this->assertEquals( 'assoc', $param['type'] ); + $this->assertFalse( $param['optional'] ); + + $param = $r[1]; + $this->assertEquals( 'assoc', $param['type'] ); + $this->assertTrue( $param['optional'] ); + + $param = $r[2]; + $this->assertEquals( 'assoc', $param['type'] ); + $this->assertTrue( $param['optional'] ); + $this->assertTrue( $param['value']['optional'] ); + } + + function testInvalidAssoc() { + $r = SynopsisParser::parse( '--bar[=] --bar=[] --count=100' ); + + $this->assertCount( 3, $r ); + + $this->assertEquals( 'unknown', $r[0]['type'] ); + $this->assertEquals( 'unknown', $r[1]['type'] ); + $this->assertEquals( 'unknown', $r[2]['type'] ); + } + + function testRepeating() { + $r = SynopsisParser::parse( '... [--=...]' ); + + $this->assertCount( 2, $r ); + + $param = $r[0]; + $this->assertEquals( 'positional', $param['type'] ); + $this->assertTrue( $param['repeating'] ); + + $param = $r[1]; + $this->assertEquals( 'generic', $param['type'] ); + $this->assertTrue( $param['repeating'] ); + } + + function testCombined() { + $r = SynopsisParser::parse( ' --assoc= --= [--flag]' ); + + $this->assertCount( 4, $r ); + + $this->assertEquals( 'positional', $r[0]['type'] ); + $this->assertEquals( 'assoc', $r[1]['type'] ); + $this->assertEquals( 'generic', $r[2]['type'] ); + $this->assertEquals( 'flag', $r[3]['type'] ); + } + + function testAllowedValueCharacters() { + $r = SynopsisParser::parse( '--capitals= --hyphen= --combined= --disallowed=' ); + + $this->assertCount( 4, $r ); + + $param = $r[0]; + $this->assertEquals( 'assoc', $param['type'] ); + $this->assertFalse( $param['optional'] ); + + $param = $r[1]; + $this->assertEquals( 'assoc', $param['type'] ); + $this->assertFalse( $param['optional'] ); + + $param = $r[2]; + $this->assertEquals( 'assoc', $param['type'] ); + $this->assertFalse( $param['optional'] ); + + $this->assertEquals( 'unknown', $r[3]['type'] ); + } + + function testRender() { + $a = array( + array( + 'name' => 'message', + 'type' => 'positional', + 'description' => 'A short message to display to the user.', + ), + array( + 'name' => 'secrets', + 'type' => 'positional', + 'description' => 'You may tell secrets, or you may not', + 'optional' => true, + 'repeating' => true, + ), + array( + 'name' => 'meal', + 'type' => 'assoc', + 'description' => 'A meal during the day or night.', + ), + array( + 'name' => 'snack', + 'type' => 'assoc', + 'description' => 'If you are hungry between meals, you should snack.', + 'optional' => true, + ) + ); + $this->assertEquals( ' [...] --meal= [--snack=]', SynopsisParser::render( $a ) ); + } + + function testParseThenRender() { + $o = ' --assoc= --= [--flag]'; + $a = SynopsisParser::parse( $o ); + $r = SynopsisParser::render( $a ); + $this->assertEquals( $o, $r ); + } + + function testParseThenRenderNumeric() { + $o = ' --a2ssoc= --= [--f3lag]'; + $a = SynopsisParser::parse( $o ); + $this->assertEquals( 'p1ositional', $a[0]['name'] ); + $this->assertEquals( 'a2ssoc', $a[1]['name'] ); + $this->assertEquals( 'f3lag', $a[3]['name'] ); + $r = SynopsisParser::render( $a ); + $this->assertEquals( $o, $r ); + } + +} diff --git a/tests/test-utils.php b/tests/test-utils.php new file mode 100644 index 000000000..df89914b0 --- /dev/null +++ b/tests/test-utils.php @@ -0,0 +1,733 @@ +assertEquals( + Utils\increment_version( '1.2.3-pre', 'same' ), + '1.2.3-pre' + ); + + $this->assertEquals( + Utils\increment_version( '1.2.3-pre', 'patch' ), + '1.2.4' + ); + + $this->assertEquals( + Utils\increment_version( '1.2.3-pre', 'minor' ), + '1.3.0' + ); + + $this->assertEquals( + Utils\increment_version( '1.2.3-pre', 'major' ), + '2.0.0' + ); + + // custom version string + $this->assertEquals( + Utils\increment_version( '1.2.3-pre', '4.5.6-alpha1' ), + '4.5.6-alpha1' + ); + } + + public function testGetSemVer() { + $original_version = '0.19.1'; + $this->assertEmpty( Utils\get_named_sem_ver( '0.18.0', $original_version ) ); + $this->assertEmpty( Utils\get_named_sem_ver( '0.19.1', $original_version ) ); + $this->assertEquals( 'patch', Utils\get_named_sem_ver( '0.19.2', $original_version ) ); + $this->assertEquals( 'minor', Utils\get_named_sem_ver( '0.20.0', $original_version ) ); + $this->assertEquals( 'minor', Utils\get_named_sem_ver( '0.20.3', $original_version ) ); + $this->assertEquals( 'major', Utils\get_named_sem_ver( '1.0.0', $original_version ) ); + $this->assertEquals( 'major', Utils\get_named_sem_ver( '1.1.1', $original_version ) ); + } + + public function testGetSemVerWP() { + $original_version = '3.0'; + $this->assertEmpty( Utils\get_named_sem_ver( '2.8', $original_version ) ); + $this->assertEmpty( Utils\get_named_sem_ver( '2.9.1', $original_version ) ); + $this->assertEquals( 'patch', Utils\get_named_sem_ver( '3.0.1', $original_version ) ); + $this->assertEquals( 'minor', Utils\get_named_sem_ver( '3.1', $original_version ) ); + $this->assertEquals( 'minor', Utils\get_named_sem_ver( '3.1.1', $original_version ) ); + $this->assertEquals( 'major', Utils\get_named_sem_ver( '4.0', $original_version ) ); + $this->assertEquals( 'major', Utils\get_named_sem_ver( '4.1.1', $original_version ) ); + } + + public function testParseSSHUrl() { + $testcase = 'foo'; + $this->assertEquals( array( + 'host' => 'foo', + ), Utils\parse_ssh_url( $testcase ) ); + $this->assertEquals( null, Utils\parse_ssh_url( $testcase, PHP_URL_SCHEME ) ); + $this->assertEquals( null, Utils\parse_ssh_url( $testcase, PHP_URL_USER ) ); + $this->assertEquals( 'foo', Utils\parse_ssh_url( $testcase, PHP_URL_HOST ) ); + $this->assertEquals( null, Utils\parse_ssh_url( $testcase, PHP_URL_PORT ) ); + $this->assertEquals( null, Utils\parse_ssh_url( $testcase, PHP_URL_PATH ) ); + + $testcase = 'foo.com'; + $this->assertEquals( array( + 'host' => 'foo.com', + ), Utils\parse_ssh_url( $testcase ) ); + $this->assertEquals( null, Utils\parse_ssh_url( $testcase, PHP_URL_SCHEME ) ); + $this->assertEquals( null, Utils\parse_ssh_url( $testcase, PHP_URL_USER ) ); + $this->assertEquals( 'foo.com', Utils\parse_ssh_url( $testcase, PHP_URL_HOST ) ); + $this->assertEquals( null, Utils\parse_ssh_url( $testcase, PHP_URL_PORT ) ); + $this->assertEquals( null, Utils\parse_ssh_url( $testcase, PHP_URL_PATH ) ); + + $testcase = 'foo.com:2222'; + $this->assertEquals( array( + 'host' => 'foo.com', + 'port' => 2222, + ), Utils\parse_ssh_url( $testcase ) ); + $this->assertEquals( null, Utils\parse_ssh_url( $testcase, PHP_URL_SCHEME ) ); + $this->assertEquals( null, Utils\parse_ssh_url( $testcase, PHP_URL_USER ) ); + $this->assertEquals( 'foo.com', Utils\parse_ssh_url( $testcase, PHP_URL_HOST ) ); + $this->assertEquals( 2222, Utils\parse_ssh_url( $testcase, PHP_URL_PORT ) ); + $this->assertEquals( null, Utils\parse_ssh_url( $testcase, PHP_URL_PATH ) ); + + $testcase = 'foo.com:2222/path/to/dir'; + $this->assertEquals( array( + 'host' => 'foo.com', + 'port' => 2222, + 'path' => '/path/to/dir', + ), Utils\parse_ssh_url( $testcase ) ); + $this->assertEquals( null, Utils\parse_ssh_url( $testcase, PHP_URL_SCHEME ) ); + $this->assertEquals( null, Utils\parse_ssh_url( $testcase, PHP_URL_USER ) ); + $this->assertEquals( 'foo.com', Utils\parse_ssh_url( $testcase, PHP_URL_HOST ) ); + $this->assertEquals( 2222, Utils\parse_ssh_url( $testcase, PHP_URL_PORT ) ); + $this->assertEquals( '/path/to/dir', Utils\parse_ssh_url( $testcase, PHP_URL_PATH ) ); + + $testcase = 'foo.com~/path/to/dir'; + $this->assertEquals( array( + 'host' => 'foo.com', + 'path' => '~/path/to/dir', + ), Utils\parse_ssh_url( $testcase ) ); + $this->assertEquals( null, Utils\parse_ssh_url( $testcase, PHP_URL_SCHEME ) ); + $this->assertEquals( null, Utils\parse_ssh_url( $testcase, PHP_URL_USER ) ); + $this->assertEquals( 'foo.com', Utils\parse_ssh_url( $testcase, PHP_URL_HOST ) ); + $this->assertEquals( null, Utils\parse_ssh_url( $testcase, PHP_URL_PORT ) ); + $this->assertEquals( '~/path/to/dir', Utils\parse_ssh_url( $testcase, PHP_URL_PATH ) ); + + // No host + $testcase = '~/path/to/dir'; + $this->assertEquals( array(), Utils\parse_ssh_url( $testcase ) ); + $this->assertEquals( null, Utils\parse_ssh_url( $testcase, PHP_URL_SCHEME ) ); + $this->assertEquals( null, Utils\parse_ssh_url( $testcase, PHP_URL_USER ) ); + $this->assertEquals( null, Utils\parse_ssh_url( $testcase, PHP_URL_HOST ) ); + $this->assertEquals( null, Utils\parse_ssh_url( $testcase, PHP_URL_PORT ) ); + $this->assertEquals( null, Utils\parse_ssh_url( $testcase, PHP_URL_PATH ) ); + + // host and path, no port, with scp notation + $testcase = 'foo.com:~/path/to/dir'; + $this->assertEquals( array( + 'host' => 'foo.com', + 'path' => '~/path/to/dir', + ), Utils\parse_ssh_url( $testcase ) ); + $this->assertEquals( null, Utils\parse_ssh_url( $testcase, PHP_URL_SCHEME ) ); + $this->assertEquals( null, Utils\parse_ssh_url( $testcase, PHP_URL_USER ) ); + $this->assertEquals( 'foo.com', Utils\parse_ssh_url( $testcase, PHP_URL_HOST ) ); + $this->assertEquals( null, Utils\parse_ssh_url( $testcase, PHP_URL_PORT ) ); + $this->assertEquals( '~/path/to/dir', Utils\parse_ssh_url( $testcase, PHP_URL_PATH ) ); + + $testcase = 'foo.com:2222~/path/to/dir'; + $this->assertEquals( array( + 'host' => 'foo.com', + 'path' => '~/path/to/dir', + 'port' => '2222' + ), Utils\parse_ssh_url( $testcase ) ); + $this->assertEquals( null, Utils\parse_ssh_url( $testcase, PHP_URL_SCHEME ) ); + $this->assertEquals( null, Utils\parse_ssh_url( $testcase, PHP_URL_USER ) ); + $this->assertEquals( 'foo.com', Utils\parse_ssh_url( $testcase, PHP_URL_HOST ) ); + $this->assertEquals( '2222', Utils\parse_ssh_url( $testcase, PHP_URL_PORT ) ); + $this->assertEquals( '~/path/to/dir', Utils\parse_ssh_url( $testcase, PHP_URL_PATH ) ); + + // explicit scheme, user, host, path, no port + $testcase = 'ssh:bar@foo.com:~/path/to/dir'; + $this->assertEquals( array( + 'scheme' => 'ssh', + 'user' => 'bar', + 'host' => 'foo.com', + 'path' => '~/path/to/dir', + ), Utils\parse_ssh_url( $testcase ) ); + $this->assertEquals( 'ssh', Utils\parse_ssh_url( $testcase, PHP_URL_SCHEME ) ); + $this->assertEquals( 'bar', Utils\parse_ssh_url( $testcase, PHP_URL_USER ) ); + $this->assertEquals( 'foo.com', Utils\parse_ssh_url( $testcase, PHP_URL_HOST ) ); + $this->assertEquals( null, Utils\parse_ssh_url( $testcase, PHP_URL_PORT ) ); + $this->assertEquals( '~/path/to/dir', Utils\parse_ssh_url( $testcase, PHP_URL_PATH ) ); + + // container scheme + $testcase = 'docker:wordpress'; + $this->assertEquals( array( + 'scheme' => 'docker', + 'host' => 'wordpress', + ), Utils\parse_ssh_url( $testcase ) ); + $this->assertEquals( 'docker', Utils\parse_ssh_url( $testcase, PHP_URL_SCHEME ) ); + $this->assertEquals( null, Utils\parse_ssh_url( $testcase, PHP_URL_USER ) ); + $this->assertEquals( 'wordpress', Utils\parse_ssh_url( $testcase, PHP_URL_HOST ) ); + $this->assertEquals( null, Utils\parse_ssh_url( $testcase, PHP_URL_PORT ) ); + $this->assertEquals( null, Utils\parse_ssh_url( $testcase, PHP_URL_PATH ) ); + + // container scheme with user, and host + $testcase = 'docker:bar@wordpress'; + $this->assertEquals( array( + 'scheme' => 'docker', + 'user' => 'bar', + 'host' => 'wordpress', + ), Utils\parse_ssh_url( $testcase ) ); + $this->assertEquals( 'docker', Utils\parse_ssh_url( $testcase, PHP_URL_SCHEME ) ); + $this->assertEquals( 'bar', Utils\parse_ssh_url( $testcase, PHP_URL_USER ) ); + $this->assertEquals( 'wordpress', Utils\parse_ssh_url( $testcase, PHP_URL_HOST ) ); + $this->assertEquals( null, Utils\parse_ssh_url( $testcase, PHP_URL_PORT ) ); + $this->assertEquals( null, Utils\parse_ssh_url( $testcase, PHP_URL_PATH ) ); + + // container scheme with user, host, and path + $testcase = 'docker-compose:bar@wordpress:~/path/to/dir'; + $this->assertEquals( array( + 'scheme' => 'docker-compose', + 'user' => 'bar', + 'host' => 'wordpress', + 'path' => '~/path/to/dir', + ), Utils\parse_ssh_url( $testcase ) ); + $this->assertEquals( 'docker-compose', Utils\parse_ssh_url( $testcase, PHP_URL_SCHEME ) ); + $this->assertEquals( 'bar', Utils\parse_ssh_url( $testcase, PHP_URL_USER ) ); + $this->assertEquals( 'wordpress', Utils\parse_ssh_url( $testcase, PHP_URL_HOST ) ); + $this->assertEquals( null, Utils\parse_ssh_url( $testcase, PHP_URL_PORT ) ); + $this->assertEquals( '~/path/to/dir', Utils\parse_ssh_url( $testcase, PHP_URL_PATH ) ); + + // vagrant scheme + $testcase = 'vagrant:default'; + $this->assertEquals( array( + 'scheme' => 'vagrant', + 'host' => 'default', + ), Utils\parse_ssh_url( $testcase ) ); + $this->assertEquals( 'vagrant', Utils\parse_ssh_url( $testcase, PHP_URL_SCHEME ) ); + $this->assertEquals( null, Utils\parse_ssh_url( $testcase, PHP_URL_USER ) ); + $this->assertEquals( 'default', Utils\parse_ssh_url( $testcase, PHP_URL_HOST ) ); + $this->assertEquals( null, Utils\parse_ssh_url( $testcase, PHP_URL_PORT ) ); + $this->assertEquals( null, Utils\parse_ssh_url( $testcase, PHP_URL_PATH ) ); + + // vagrant scheme + $testcase = 'vagrant:/var/www/html'; + $this->assertEquals( array( + 'host' => 'vagrant', + 'path' => '/var/www/html', + ), Utils\parse_ssh_url( $testcase ) ); + $this->assertEquals( null, Utils\parse_ssh_url( $testcase, PHP_URL_SCHEME ) ); + $this->assertEquals( null, Utils\parse_ssh_url( $testcase, PHP_URL_USER ) ); + $this->assertEquals( 'vagrant', Utils\parse_ssh_url( $testcase, PHP_URL_HOST ) ); + $this->assertEquals( null, Utils\parse_ssh_url( $testcase, PHP_URL_PORT ) ); + $this->assertEquals( '/var/www/html', Utils\parse_ssh_url( $testcase, PHP_URL_PATH ) ); + + // unsupported scheme, should not match + $testcase = 'foo:bar'; + $this->assertEquals( array(), Utils\parse_ssh_url( $testcase ) ); + $this->assertEquals( null, Utils\parse_ssh_url( $testcase, PHP_URL_SCHEME ) ); + $this->assertEquals( null, Utils\parse_ssh_url( $testcase, PHP_URL_USER ) ); + $this->assertEquals( null, Utils\parse_ssh_url( $testcase, PHP_URL_HOST ) ); + $this->assertEquals( null, Utils\parse_ssh_url( $testcase, PHP_URL_PORT ) ); + $this->assertEquals( null, Utils\parse_ssh_url( $testcase, PHP_URL_PATH ) ); + } + + public function testParseStrToArgv() { + $this->assertEquals( array(), Utils\parse_str_to_argv( '' ) ); + $this->assertEquals( array( + 'option', + 'get', + 'home', + ), Utils\parse_str_to_argv( 'option get home' ) ); + $this->assertEquals( array( + 'core', + 'download', + '--path=/var/www/', + ), Utils\parse_str_to_argv( 'core download --path=/var/www/' ) ); + $this->assertEquals( array( + 'eval', + 'echo wp_get_current_user()->user_login;', + ), Utils\parse_str_to_argv( 'eval "echo wp_get_current_user()->user_login;"' ) ); + } + + public function testAssocArgsToString() { + // Strip quotes for Windows compat. + $strip_quotes = function ( $str ) { + return str_replace( array( '"', "'" ), '', $str ); + }; + + $expected = " --url='foo.dev' --porcelain --apple='banana'"; + $actual = Utils\assoc_args_to_str( array( + 'url' => 'foo.dev', + 'porcelain' => true, + 'apple' => 'banana' + ) ); + $this->assertSame( $strip_quotes( $expected ), $strip_quotes( $actual ) ); + + $expected = " --url='foo.dev' --require='file-a.php' --require='file-b.php' --porcelain --apple='banana'"; + $actual = Utils\assoc_args_to_str( array( + 'url' => 'foo.dev', + 'require' => array( + 'file-a.php', + 'file-b.php', + ), + 'porcelain' => true, + 'apple' => 'banana' + ) ); + $this->assertSame( $strip_quotes( $expected ), $strip_quotes( $actual ) ); + } + + public function testForceEnvOnNixSystems() { + $env_is_windows = getenv( 'WP_CLI_TEST_IS_WINDOWS' ); + + putenv( 'WP_CLI_TEST_IS_WINDOWS=0' ); + $this->assertSame( '/usr/bin/env cmd', Utils\force_env_on_nix_systems( 'cmd' ) ); + $this->assertSame( '/usr/bin/env cmd', Utils\force_env_on_nix_systems( '/usr/bin/env cmd' ) ); + + putenv( 'WP_CLI_TEST_IS_WINDOWS=1' ); + $this->assertSame( 'cmd', Utils\force_env_on_nix_systems( 'cmd' ) ); + $this->assertSame( 'cmd', Utils\force_env_on_nix_systems( '/usr/bin/env cmd' ) ); + + putenv( false === $env_is_windows ? 'WP_CLI_TEST_IS_WINDOWS' : "WP_CLI_TEST_IS_WINDOWS=$env_is_windows" ); + } + + public function testGetHomeDir() { + + // save environments + $home = getenv( 'HOME' ); + $homedrive = getenv( 'HOMEDRIVE' ); + $homepath = getenv( 'HOMEPATH' ); + + putenv( 'HOME=/home/user' ); + $this->assertSame('/home/user', Utils\get_home_dir() ); + + putenv( 'HOME' ); + + putenv( 'HOMEDRIVE=D:' ); + putenv( 'HOMEPATH' ); + $this->assertSame( 'D:', Utils\get_home_dir() ); + + putenv( 'HOMEPATH=\\Windows\\User\\' ); + $this->assertSame( 'D:\\Windows\\User', Utils\get_home_dir() ); + + putenv( 'HOMEPATH=\\Windows\\User\\HOGE\\' ); + $this->assertSame( 'D:\\Windows\\User\\HOGE', Utils\get_home_dir() ); + + // restore environments + putenv( false === $home ? 'HOME' : "HOME=$home" ); + putenv( false === $homedrive ? 'HOMEDRIVE' : "HOME=$homedrive" ); + putenv( false === $homepath ? 'HOMEPATH' : "HOME=$homepath" ); + } + + public function testTrailingslashit() { + $this->assertSame( 'a/', Utils\trailingslashit( 'a' ) ); + $this->assertSame( 'a/', Utils\trailingslashit( 'a/' ) ); + $this->assertSame( 'a/', Utils\trailingslashit( 'a\\' ) ); + $this->assertSame( 'a/', Utils\trailingslashit( 'a\\//\\' ) ); + } + + public function testNormalizeEols() { + $this->assertSame( "\na\ra\na\n", Utils\normalize_eols( "\r\na\ra\r\na\r\n" ) ); + } + + public function testGetTempDir() { + $this->assertTrue( '/' === substr( Utils\get_temp_dir(), -1 ) ); + + // INI directive `sys_temp_dir` introduced PHP 5.5.0. + if ( version_compare( PHP_VERSION, '5.5.0', '>=' ) ) { + + // `sys_temp_dir` set to unwritable. + + $cmd = 'php ' . escapeshellarg( '-dsys_temp_dir=\\tmp\\' ) . ' php/boot-fs.php --skip-wordpress eval ' . escapeshellarg( 'echo WP_CLI\\Utils\\get_temp_dir();' ) . ' 2>&1'; + $output = array(); + exec( $cmd, $output ); + $output = trim( implode( "\n", $output ) ); + $this->assertTrue( false !== strpos( $output, 'Warning' ) ); + $this->assertTrue( false !== strpos( $output, 'writable' ) ); + $this->assertTrue( false !== strpos( $output, '\\tmp/' ) ); + + // `sys_temp_dir` unset. + + $cmd = 'php ' . escapeshellarg( '-dsys_temp_dir=' ) . ' php/boot-fs.php --skip-wordpress eval ' . escapeshellarg( 'echo WP_CLI\\Utils\\get_temp_dir();' ) . ' 2>&1'; + $output = array(); + exec( $cmd, $output ); + $output = trim( implode( "\n", $output ) ); + $this->assertTrue( '/' === substr( $output, -1 ) ); + } + } + + public function testHttpRequestBadAddress() { + // Save WP_CLI state. + $class_wp_cli_logger = new \ReflectionProperty( 'WP_CLI', 'logger' ); + $class_wp_cli_logger->setAccessible( true ); + $class_wp_cli_capture_exit = new \ReflectionProperty( 'WP_CLI', 'capture_exit' ); + $class_wp_cli_capture_exit->setAccessible( true ); + + $prev_logger = $class_wp_cli_logger->getValue(); + $prev_capture_exit = $class_wp_cli_capture_exit->getValue(); + + // Enable exit exception. + $class_wp_cli_capture_exit->setValue( true ); + + $logger = new \WP_CLI\Loggers\Execution; + WP_CLI::set_logger( $logger ); + + $exception = null; + try { + Utils\http_request( 'GET', 'https://nosuchhost_asdf_asdf_asdf.com', null /*data*/, array() /*headers*/, array( 'timeout' => 0.01 ) ); + } catch ( \WP_CLI\ExitException $ex ) { + $exception = $ex; + } + $this->assertTrue( null !== $exception ); + $this->assertTrue( 1 === $exception->getCode() ); + $this->assertTrue( empty( $logger->stdout ) ); + $this->assertTrue( false === strpos( $logger->stderr, 'Warning' ) ); + $this->assertTrue( 0 === strpos( $logger->stderr, 'Error: Failed to get url' ) ); + + // Restore. + $class_wp_cli_logger->setValue( $prev_logger ); + $class_wp_cli_capture_exit->setValue( $prev_capture_exit ); + } + + public function testHttpRequestBadCAcert() { + if ( ! extension_loaded( 'curl' ) ) { + $this->markTestSkipped( 'curl not available' ); + } + + // Save WP_CLI state. + $class_wp_cli_logger = new \ReflectionProperty( 'WP_CLI', 'logger' ); + $class_wp_cli_logger->setAccessible( true ); + + $prev_logger = $class_wp_cli_logger->getValue(); + + $have_bad_cacert = false; + $created_dirs = array(); + + // Hack to create bad CAcert, using Utils\get_vendor_paths() preference for a path as part of a Composer-installed larger project. + $vendor_dir = WP_CLI_ROOT . '/../../../vendor'; + $cert_path = '/rmccue/requests/library/Requests/Transport/cacert.pem'; + $bad_cacert_path = $vendor_dir . $cert_path; + if ( ! file_exists( $bad_cacert_path ) ) { + // Capture any directories created so can clean up. + $dirs = array_merge( array( 'vendor' ), array_filter( explode( '/', dirname( $cert_path ) ) ) ); + $current_dir = dirname( $vendor_dir ); + foreach ( $dirs as $dir ) { + if ( ! file_exists( $current_dir . '/' . $dir ) ) { + if ( ! @mkdir( $current_dir . '/' . $dir ) ) { + break; + } + $created_dirs[] = $current_dir . '/' . $dir; + } + $current_dir .= '/' . $dir; + } + if ( $current_dir === dirname( $bad_cacert_path ) && file_put_contents( $bad_cacert_path, "-----BEGIN CERTIFICATE-----\nasdfasdf\n-----END CERTIFICATE-----\n" ) ) { + $have_bad_cacert = true; + } + } + + if ( ! $have_bad_cacert ) { + foreach ( array_reverse( $created_dirs ) as $created_dir ) { + rmdir( $created_dir ); + } + $this->markTestSkipped( 'Unable to create bad CAcert.' ); + } + + $logger = new \WP_CLI\Loggers\Execution; + WP_CLI::set_logger( $logger ); + + Utils\http_request( 'GET', 'https://example.com' ); + + // Undo bad CAcert hack before asserting. + unlink( $bad_cacert_path ); + foreach ( array_reverse( $created_dirs ) as $created_dir ) { + rmdir( $created_dir ); + } + + $this->assertTrue( empty( $logger->stdout ) ); + $this->assertTrue( 0 === strpos( $logger->stderr, 'Warning: Re-trying without verify after failing to get verified url' ) ); + $this->assertFalse( strpos( $logger->stderr, 'Error' ) ); + + // Restore. + $class_wp_cli_logger->setValue( $prev_logger ); + } + + public function testRunMysqlCommandProcDisabled() { + $err_msg = 'Error: Cannot do \'run_mysql_command\': The PHP functions `proc_open()` and/or `proc_close()` are disabled'; + + $cmd = 'php -ddisable_functions=proc_open php/boot-fs.php --skip-wordpress eval ' . escapeshellarg( 'WP_CLI\\Utils\\run_mysql_command( null, array() );' ) . ' 2>&1'; + $output = array(); + exec( $cmd, $output ); + $output = trim( implode( "\n", $output ) ); + $this->assertTrue( false !== strpos( $output, $err_msg ) ); + + $cmd = 'php -ddisable_functions=proc_close php/boot-fs.php --skip-wordpress eval ' . escapeshellarg( 'WP_CLI\\Utils\\run_mysql_command( null, array() );' ) . ' 2>&1'; + $output = array(); + exec( $cmd, $output ); + $output = trim( implode( "\n", $output ) ); + $this->assertTrue( false !== strpos( $output, $err_msg ) ); + } + + public function testLaunchEditorForInputProcDisabled() { + $err_msg = 'Error: Cannot do \'launch_editor_for_input\': The PHP functions `proc_open()` and/or `proc_close()` are disabled'; + + $cmd = 'php -ddisable_functions=proc_open php/boot-fs.php --skip-wordpress eval ' . escapeshellarg( 'WP_CLI\\Utils\\launch_editor_for_input( null, null );' ) . ' 2>&1'; + $output = array(); + exec( $cmd, $output ); + $output = trim( implode( "\n", $output ) ); + $this->assertTrue( false !== strpos( $output, $err_msg ) ); + + $cmd = 'php -ddisable_functions=proc_close php/boot-fs.php --skip-wordpress eval ' . escapeshellarg( 'WP_CLI\\Utils\\launch_editor_for_input( null, null );' ) . ' 2>&1'; + $output = array(); + exec( $cmd, $output ); + $output = trim( implode( "\n", $output ) ); + $this->assertTrue( false !== strpos( $output, $err_msg ) ); + } + + /** + * @dataProvider dataPastTenseVerb + */ + public function testPastTenseVerb( $verb, $expected ) { + $this->assertSame( $expected, Utils\past_tense_verb( $verb ) ); + } + + public function dataPastTenseVerb() { + return array( + // Known to be used by commands. + array( 'activate', 'activated' ), + array( 'deactivate', 'deactivated' ), + array( 'delete', 'deleted' ), + array( 'import', 'imported' ), + array( 'install', 'installed' ), + array( 'network activate', 'network activated' ), + array( 'network deactivate', 'network deactivated' ), + array( 'regenerate', 'regenerated' ), + array( 'reset', 'reset' ), + array( 'spam', 'spammed' ), + array( 'toggle', 'toggled' ), + array( 'uninstall', 'uninstalled' ), + array( 'update', 'updated' ), + // Some others. + array( 'call', 'called' ), + array( 'check', 'checked' ), + array( 'crop', 'cropped' ), + array( 'fix', 'fixed' ), // One vowel + final "x" excluded. + array( 'ah', 'ahed' ), // One vowel + final "h" excluded. + array( 'show', 'showed' ), // One vowel + final "w" excluded. + array( 'ski', 'skied' ), + array( 'slay', 'slayed' ), // One vowel + final "y" excluded (nearly all irregular anyway). + array( 'submit', 'submited' ), // BUG: multi-voweled verbs that double not catered for - should be "submitted". + array( 'try', 'tried' ), + ); + } + + /** + * @dataProvider dataExpandGlobs + */ + public function testExpandGlobs( $path, $expected ) { + $expand_globs_no_glob_brace = getenv( 'WP_CLI_TEST_EXPAND_GLOBS_NO_GLOB_BRACE' ); + + $dir = __DIR__ . '/data/expand_globs/'; + $expected = array_map( function ( $v ) use ( $dir ) { return $dir . $v; }, $expected ); + + putenv( 'WP_CLI_TEST_EXPAND_GLOBS_NO_GLOB_BRACE=0' ); + $out = Utils\expand_globs( $dir . $path ); + $this->assertSame( $expected, $out ); + + putenv( 'WP_CLI_TEST_EXPAND_GLOBS_NO_GLOB_BRACE=1' ); + $out = Utils\expand_globs( $dir . $path ); + $this->assertSame( $expected, $out ); + + putenv( false === $expand_globs_no_glob_brace ? 'WP_CLI_TEST_EXPAND_GLOBS_NO_GLOB_BRACE' : "WP_CLI_TEST_EXPAND_GLOBS_NO_GLOB_BRACE=$expand_globs_no_glob_brace" ); + } + + public function dataExpandGlobs() { + // Files in "data/expand_globs": foo.ab1, foo.ab2, foo.efg1, foo.efg2, bar.ab1, bar.ab2, baz.ab1, baz.ac1, baz.efg2. + return array( + array( 'foo.ab1', array( 'foo.ab1' ) ), + array( '{foo,bar}.ab1', array( 'foo.ab1', 'bar.ab1' ) ), + array( '{foo,baz}.a{b,c}1', array( 'foo.ab1', 'baz.ab1' , 'baz.ac1' ) ), + array( '{foo,baz}.{ab,ac}1', array( 'foo.ab1', 'baz.ab1' , 'baz.ac1' ) ), + array( '{foo,bar}.{ab1,efg1}', array( 'foo.ab1', 'foo.efg1', 'bar.ab1' ) ), + array( '{foo,bar,baz}.{ab,ac,efg}1', array( 'foo.ab1', 'foo.efg1', 'bar.ab1', 'baz.ab1', 'baz.ac1' ) ), + array( '{foo,ba{r,z}}.ab1', array( 'foo.ab1', 'bar.ab1', 'baz.ab1' ) ), + array( '{foo,ba{r,z}}.{ab1,efg1}', array( 'foo.ab1', 'foo.efg1', 'bar.ab1', 'baz.ab1') ), + array( '{foo,bar}.{ab{1,2},efg1}', array( 'foo.ab1', 'foo.ab2', 'foo.efg1', 'bar.ab1', 'bar.ab2' ) ), + array( '{foo,ba{r,z}}.{a{b,c}{1,2},efg{1,2}}', array( 'foo.ab1', 'foo.ab2', 'foo.efg1', 'foo.efg2', 'bar.ab1', 'bar.ab2', 'baz.ab1', 'baz.ac1', 'baz.efg2' ) ), + + array( 'no_such_file', array( 'no_such_file' ) ), // Documenting this behaviour here, which is odd (though advertized) - more natural to return an empty array. + ); + } + + /** + * @dataProvider dataReportBatchOperationResults + */ + public function testReportBatchOperationResults( $stdout, $stderr, $noun, $verb, $total, $successes, $failures, $skips ) { + // Save WP_CLI state. + $class_wp_cli_logger = new \ReflectionProperty( 'WP_CLI', 'logger' ); + $class_wp_cli_logger->setAccessible( true ); + $class_wp_cli_capture_exit = new \ReflectionProperty( 'WP_CLI', 'capture_exit' ); + $class_wp_cli_capture_exit->setAccessible( true ); + + $prev_logger = $class_wp_cli_logger->getValue(); + $prev_capture_exit = $class_wp_cli_capture_exit->getValue(); + + // Enable exit exception. + $class_wp_cli_capture_exit->setValue( true ); + + $logger = new \WP_CLI\Loggers\Execution; + WP_CLI::set_logger( $logger ); + + $exception = null; + + try { + Utils\report_batch_operation_results( $noun, $verb, $total, $successes, $failures, $skips ); + } catch ( \WP_CLI\ExitException $ex ) { + $exception = $ex; + } + $this->assertSame( $stdout, $logger->stdout ); + $this->assertSame( $stderr, $logger->stderr ); + + // Restore. + $class_wp_cli_logger->setValue( $prev_logger ); + $class_wp_cli_capture_exit->setValue( $prev_capture_exit ); + } + + public function dataReportBatchOperationResults() { + return array( + array( "Success: Noun already verbed.\n", '', 'noun', 'verb', 1, 0, 0, null ), + array( "Success: Verbed 1 of 1 nouns.\n", '', 'noun', 'verb', 1, 1, 0, null ), + array( "Success: Verbed 1 of 2 nouns.\n", '', 'noun', 'verb', 2, 1, 0, null ), + array( "Success: Verbed 2 of 2 nouns.\n", '', 'noun', 'verb', 2, 2, 0, 0 ), + array( "Success: Verbed 1 of 2 nouns (1 skipped).\n", '', 'noun', 'verb', 2, 1, 0, 1 ), + array( "Success: Verbed 2 of 4 nouns (2 skipped).\n", '', 'noun', 'verb', 4, 2, 0, 2 ), + array( '', "Error: No nouns verbed.\n", 'noun', 'verb', 1, 0, 1, null ), + array( '', "Error: No nouns verbed.\n", 'noun', 'verb', 2, 0, 1, null ), + array( '', "Error: No nouns verbed (2 failed).\n", 'noun', 'verb', 3, 0, 2, 0 ), + array( '', "Error: No nouns verbed (2 failed, 1 skipped).\n", 'noun', 'verb', 3, 0, 2, 1 ), + array( '', "Error: Only verbed 1 of 2 nouns.\n", 'noun', 'verb', 2, 1, 1, null ), + array( '', "Error: Only verbed 1 of 3 nouns (2 failed).\n", 'noun', 'verb', 3, 1, 2, 0 ), + array( '', "Error: Only verbed 1 of 6 nouns (3 failed, 2 skipped).\n", 'noun', 'verb', 6, 1, 3, 2 ), + ); + } + + public function testGetPHPBinary() { + $env_php_used = getenv( 'WP_CLI_PHP_USED' ); + $env_php = getenv( 'WP_CLI_PHP' ); + + putenv( 'WP_CLI_PHP_USED' ); + putenv( 'WP_CLI_PHP' ); + $get_php_binary = Utils\get_php_binary(); + $this->assertTrue( is_executable( $get_php_binary ) ); + + putenv( 'WP_CLI_PHP_USED=/my-php-5.3' ); + putenv( 'WP_CLI_PHP' ); + $get_php_binary = Utils\get_php_binary(); + $this->assertSame( $get_php_binary, '/my-php-5.3' ); + + putenv( 'WP_CLI_PHP=/my-php-7.3' ); + $get_php_binary = Utils\get_php_binary(); + $this->assertSame( $get_php_binary, '/my-php-5.3' ); // WP_CLI_PHP_USED wins. + + putenv( 'WP_CLI_PHP_USED' ); + $get_php_binary = Utils\get_php_binary(); + $this->assertSame( $get_php_binary, '/my-php-7.3' ); + + putenv( false === $env_php_used ? 'WP_CLI_PHP_USED' : "WP_CLI_PHP_USED=$env_php_used" ); + putenv( false === $env_php ? 'WP_CLI_PHP' : "WP_CLI_PHP=$env_php" ); + } + + /** + * @dataProvider dataProcOpenCompatWinEnv + */ + public function testProcOpenCompatWinEnv( $cmd, $env, $expected_cmd, $expected_env ) { + $env_is_windows = getenv( 'WP_CLI_TEST_IS_WINDOWS' ); + + putenv( 'WP_CLI_TEST_IS_WINDOWS=1' ); + + $cmd = Utils\_proc_open_compat_win_env( $cmd, $env ); + $this->assertSame( $expected_cmd, $cmd ); + $this->assertSame( $expected_env, $env ); + + putenv( false === $env_is_windows ? 'WP_CLI_TEST_IS_WINDOWS' : "WP_CLI_TEST_IS_WINDOWS=$env_is_windows" ); + } + + function dataProcOpenCompatWinEnv() { + return array( + array( 'echo', array(), 'echo', array() ), + array( 'ENV=blah echo', array(), 'echo', array( 'ENV' => 'blah' ) ), + array( 'ENV="blah blah" echo', array(), 'echo', array( 'ENV' => 'blah blah' ) ), + array( 'ENV_1="blah1 blah1" ENV_2="blah2" ENV_3=blah3 echo', array(), 'echo', array( 'ENV_1' => 'blah1 blah1', 'ENV_2' => 'blah2', 'ENV_3' => 'blah3' ) ), + array( 'ENV= echo', array(), 'echo', array( 'ENV' => '' ) ), + array( 'ENV=0 echo', array(), 'echo', array( 'ENV' => '0' ) ), + + // With `$env` set. + array( 'echo', array( 'ENV' => 'in' ), 'echo', array( 'ENV' => 'in' ) ), + array( 'ENV=blah echo', array( 'ENV_1' => 'in1', 'ENV_2' => 'in2' ), 'echo', array( 'ENV_1' => 'in1', 'ENV_2' => 'in2', 'ENV' => 'blah' ) ), + array( 'ENV="blah blah" echo', array( 'ENV' => 'in' ), 'echo', array( 'ENV' => 'blah blah' ) ), + + // Special cases. + array( '1=1 echo', array(), '1=1 echo', array() ), // Must begin with alphabetic or underscore. + array( '_eNv=1 echo', array(), 'echo', array( '_eNv' => '1' ) ), // Mixed-case and beginning with underscore allowed. + array( 'ENV=\'blah blah\' echo', array(), 'blah\' echo', array( 'ENV' => '\'blah' ) ), // Unix escaping not supported, ie treated literally. + ); + } + + /** + * Copied from core "tests/phpunit/tests/db.php" (adapted to not use `$wpdb`). + */ + function test_esc_like() { + $inputs = array( + 'howdy%', //Single Percent + 'howdy_', //Single Underscore + 'howdy\\', //Single slash + 'howdy\\howdy%howdy_', //The works + 'howdy\'"[[]*#[^howdy]!+)(*&$#@!~|}{=--`/.,<>?', //Plain text + ); + $expected = array( + 'howdy\\%', + 'howdy\\_', + 'howdy\\\\', + 'howdy\\\\howdy\\%howdy\\_', + 'howdy\'"[[]*#[^howdy]!+)(*&$#@!~|}{=--`/.,<>?', + ); + + foreach ( $inputs as $key => $input ) { + $this->assertEquals( $expected[ $key ], Utils\esc_like( $input ) ); + } + } + + /** @dataProvider dataIsJson */ + public function testIsJson( $argument, $ignore_scalars, $expected ) { + $this->assertEquals( $expected, Utils\is_json( $argument, $ignore_scalars ) ); + } + + public function dataIsJson() { + return array( + array( '42', true, false ), + array( '42', false, true ), + array( '"test"', true, false ), + array( '"test"', false, true ), + array( '{"key1":"value1","key2":"value2"}', true, true ), + array( '{"key1":"value1","key2":"value2"}', false, true ), + array( '["value1","value2"]', true, true ), + array( '["value1","value2"]', false, true ), + array( '0', true, false ), + array( '0', false, true ), + array( '', true, false ), + array( '', false, false ), + ); + } + + /** @dataProvider dataParseShellArray */ + public function testParseShellArray( $assoc_args, $array_arguments, $expected ) { + $this->assertEquals( $expected, Utils\parse_shell_arrays( $assoc_args, $array_arguments ) ); + } + + public function dataParseShellArray() { + return array( + array( array( 'alpha' => '{"key":"value"}' ), array(), array( 'alpha' => '{"key":"value"}' ) ), + array( array( 'alpha' => '{"key":"value"}' ), array( 'alpha' ), array( 'alpha' => array( 'key' => 'value' ) ) ), + array( array( 'alpha' => '{"key":"value"}' ), array( 'beta' ), array( 'alpha' => '{"key":"value"}' ) ), + ); + } +} diff --git a/tests/test-wp-cli.php b/tests/test-wp-cli.php new file mode 100644 index 000000000..209fef8c7 --- /dev/null +++ b/tests/test-wp-cli.php @@ -0,0 +1,24 @@ +&1'; + $output = array(); + exec( $cmd, $output ); + $output = trim( implode( "\n", $output ) ); + $this->assertTrue( false !== strpos( $output, $err_msg ) ); + + $cmd = 'php -ddisable_functions=proc_close php/boot-fs.php --skip-wordpress eval ' . escapeshellarg( 'WP_CLI::launch( null );' ) . ' 2>&1'; + $output = array(); + exec( $cmd, $output ); + $output = trim( implode( "\n", $output ) ); + $this->assertTrue( false !== strpos( $output, $err_msg ) ); + } + + public function testGetPHPBinary() { + $this->assertSame( WP_CLI\Utils\get_php_binary(), WP_CLI::get_php_binary() ); + } +} diff --git a/tests/test-wp-version-compare.php b/tests/test-wp-version-compare.php new file mode 100644 index 000000000..73c320930 --- /dev/null +++ b/tests/test-wp-version-compare.php @@ -0,0 +1,78 @@ +assertTrue( Utils\wp_version_compare( '4.8', '>=' ) ); + $this->assertFalse( Utils\wp_version_compare( '4.8', '<' ) ); + $this->assertFalse( Utils\wp_version_compare( '4.9-alpha-40870-src', '>' ) ); + $this->assertTrue( Utils\wp_version_compare( '4.9-alpha-40870-src', '=' ) ); + $this->assertFalse( Utils\wp_version_compare( '4.9-alpha-40870-src', '<' ) ); + $this->assertTrue( Utils\wp_version_compare( '4.9-beta1', '<' ) ); + $this->assertFalse( Utils\wp_version_compare( '4.9-beta1', '>' ) ); + $this->assertFalse( Utils\wp_version_compare( '4.9-beta1-45000', '>' ) ); + $this->assertTrue( Utils\wp_version_compare( '4.9-beta2-46000', '<' ) ); + $this->assertFalse( Utils\wp_version_compare( '4.9', '>=' ) ); + $this->assertTrue( Utils\wp_version_compare( '4.9', '<' ) ); + + $GLOBALS['wp_version'] = '4.9-beta1-45000'; + $this->assertTrue( Utils\wp_version_compare( '4.8', '>=' ) ); + $this->assertFalse( Utils\wp_version_compare( '4.8', '<' ) ); + $this->assertTrue( Utils\wp_version_compare( '4.9-alpha-40870-src', '>' ) ); + $this->assertFalse( Utils\wp_version_compare( '4.9-beta1', '<' ) ); + $this->assertTrue( Utils\wp_version_compare( '4.9-beta1', '>' ) ); + $this->assertTrue( Utils\wp_version_compare( '4.9-beta1-45000', '>=' ) ); + $this->assertTrue( Utils\wp_version_compare( '4.9-beta1-45000', '=' ) ); + $this->assertFalse( Utils\wp_version_compare( '4.9-beta1-45000', '>' ) ); + $this->assertTrue( Utils\wp_version_compare( '4.9-beta2-46000', '<' ) ); + $this->assertFalse( Utils\wp_version_compare( '4.9-beta2-46000', '>=' ) ); + $this->assertFalse( Utils\wp_version_compare( '4.9', '>=' ) ); + $this->assertTrue( Utils\wp_version_compare( '4.9', '<' ) ); + + $GLOBALS['wp_version'] = '4.9-beta2-46000'; + $this->assertTrue( Utils\wp_version_compare( '4.8', '>=' ) ); + $this->assertFalse( Utils\wp_version_compare( '4.8', '<' ) ); + $this->assertTrue( Utils\wp_version_compare( '4.9-alpha-40870-src', '>' ) ); + $this->assertFalse( Utils\wp_version_compare( '4.9-alpha-40870-src', '=' ) ); + $this->assertFalse( Utils\wp_version_compare( '4.9-beta1', '<' ) ); + $this->assertTrue( Utils\wp_version_compare( '4.9-beta1', '>' ) ); + $this->assertTrue( Utils\wp_version_compare( '4.9-beta1-45000', '>' ) ); + $this->assertTrue( Utils\wp_version_compare( '4.9-beta2-45550', '>' ) ); + $this->assertFalse( Utils\wp_version_compare( '4.9-beta2-45550', '<' ) ); + $this->assertFalse( Utils\wp_version_compare( '4.9', '>=' ) ); + $this->assertTrue( Utils\wp_version_compare( '4.9', '<' ) ); + + $GLOBALS['wp_version'] = '4.9-rc1-47000'; + $this->assertTrue( Utils\wp_version_compare( '4.8', '>=' ) ); + $this->assertFalse( Utils\wp_version_compare( '4.8', '<' ) ); + $this->assertTrue( Utils\wp_version_compare( '4.9-alpha-40870-src', '>' ) ); + $this->assertFalse( Utils\wp_version_compare( '4.9-alpha-40870-src', '=' ) ); + $this->assertFalse( Utils\wp_version_compare( '4.9-beta1', '<' ) ); + $this->assertTrue( Utils\wp_version_compare( '4.9-beta1', '>' ) ); + $this->assertTrue( Utils\wp_version_compare( '4.9-beta1-45000', '>' ) ); + $this->assertTrue( Utils\wp_version_compare( '4.9-beta2-45550', '>' ) ); + $this->assertFalse( Utils\wp_version_compare( '4.9-beta2-45550', '<' ) ); + $this->assertTrue( Utils\wp_version_compare( '4.9-rc2', '<' ) ); + $this->assertTrue( Utils\wp_version_compare( '4.9-rc2-48000', '<' ) ); + $this->assertFalse( Utils\wp_version_compare( '4.9', '>=' ) ); + $this->assertTrue( Utils\wp_version_compare( '4.9', '<' ) ); + + $GLOBALS['wp_version'] = '4.9'; + $this->assertTrue( Utils\wp_version_compare( '4.8', '>=' ) ); + $this->assertFalse( Utils\wp_version_compare( '4.8', '<' ) ); + $this->assertTrue( Utils\wp_version_compare( '4.9-alpha-40870-src', '>' ) ); + $this->assertFalse( Utils\wp_version_compare( '4.9-alpha-40870-src', '<' ) ); + $this->assertTrue( Utils\wp_version_compare( '4.9-beta1-45000', '>' ) ); + $this->assertFalse( Utils\wp_version_compare( '4.9-beta1', '<' ) ); + $this->assertTrue( Utils\wp_version_compare( '4.9-beta1', '>' ) ); + $this->assertTrue( Utils\wp_version_compare( '4.9', '>=' ) ); + $this->assertFalse( Utils\wp_version_compare( '4.9', '<' ) ); + } + +} diff --git a/utils/amp-paths.txt b/utils/amp-paths.txt new file mode 100644 index 000000000..a6c891d3b --- /dev/null +++ b/utils/amp-paths.txt @@ -0,0 +1,5 @@ +/Applications/MAMP/bin/php/php5.3*/bin/php +/Applications/MAMP/bin/php5*/bin/php +/Applications/MAMP/bin/php/php5.[34]*/bin/php +/Applications/xampp/xamppfiles/bin/php; +/opt/lampp/bin/php diff --git a/utils/auto-composer-update.sh b/utils/auto-composer-update.sh new file mode 100755 index 000000000..ce3c47c9b --- /dev/null +++ b/utils/auto-composer-update.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +### +# Runs composer update, commits changes to a new branch, +# and creates a pull request. +# +# Requires git, composer, and hub +### + +date + +if [ -z "$WP_CLI_DIR" ]; then + echo 'Please set $WP_CLI_DIR' + exit 1 +fi + +set -ex + +cd $WP_CLI_DIR + +# Reset WP-CLI directory to baseline +git checkout -f master +git pull origin master +composer install +# Run composer update and capture to untracked log file +composer update --no-progress --no-interaction |& tee vendor/update.log +UPDATE=$(cat vendor/update.log | col -b) + +# We only care to proceed when there are changes +if [ -z "$(git status -s)" ]; then + echo 'No updates available' + exit 0; +fi + +# Create a dated branch and commit the changes +DATE=$(date +%Y-%m-%d) +BRANCH="update-deps-$DATE" +git branch -f $BRANCH master +git checkout $BRANCH +git add . +MESSAGE="Update Composer dependencies ($DATE) + +\`\`\` +$UPDATE +\`\`\`" +git commit -m "$MESSAGE" + +# Push and pull request +git push origin $BRANCH +hub pull-request -m "$MESSAGE" diff --git a/utils/contrib-list.php b/utils/contrib-list.php new file mode 100644 index 000000000..3abd62de4 --- /dev/null +++ b/utils/contrib-list.php @@ -0,0 +1,205 @@ +] + * : Render output in a specific format. + * --- + * default: markdown + * options: + * - markdown + * - html + * --- + * + * @when before_wp_load + */ + public function __invoke( $_, $assoc_args ) { + + $contributors = array(); + $contributor_count = 0; + $pull_request_count = 0; + + // Get the contributors to the current open large project milestones + foreach( array( 'wp-cli/wp-cli', 'wp-cli/handbook', 'wp-cli/wp-cli.github.com' ) as $repo ) { + $milestones = self::get_project_milestones( $repo ); + // Cheap way to get the latest milestone + $milestone = array_shift( $milestones ); + WP_CLI::log( 'Current open ' . $repo . ' milestone: ' . $milestone->title ); + $pull_requests = self::get_project_milestone_pull_requests( $repo, $milestone->number ); + $repo_contributors = self::parse_contributors_from_pull_requests( $pull_requests ); + WP_CLI::log( ' - Contributors: ' . count( $repo_contributors ) ); + WP_CLI::log( ' - Pull requests: ' . count( $pull_requests ) ); + $pull_request_count += count( $pull_requests ); + $contributors = array_merge( $contributors, $repo_contributors ); + } + + // Identify all command dependencies and their contributors + $milestones = self::get_project_milestones( 'wp-cli/wp-cli', array( 'state' => 'closed' ) ); + // Cheap way to get the latest closed milestone + $milestone = array_shift( $milestones ); + $composer_lock_url = sprintf( 'https://raw.githubusercontent.com/wp-cli/wp-cli/v%s/composer.lock', $milestone->title ); + WP_CLI::log( 'Fetching ' . $composer_lock_url ); + $response = Utils\http_request( 'GET', $composer_lock_url ); + if ( 200 !== $response->status_code ) { + WP_CLI::error( sprintf( 'Could not fetch composer.json (HTTP code %d)', $response->status_code ) ); + } + $composer_json = json_decode( $response->body, true ); + foreach( $composer_json['packages'] as $package ) { + $package_name = $package['name']; + $version_constraint = str_replace( 'v', '', $package['version'] ); + if ( ! preg_match( '#^wp-cli/.+-command$#', $package_name ) ) { + continue; + } + // Closed milestones denote a tagged release + $milestones = self::get_project_milestones( $package_name, array( 'state' => 'closed' ) ); + $milestone_ids = array(); + $milestone_titles = array(); + foreach( $milestones as $milestone ) { + if ( ! version_compare( $milestone->title, $version_constraint, '>' ) ) { + continue; + } + $milestone_ids[] = $milestone->number; + $milestone_titles[] = $milestone->title; + } + // No shipped releases for this milestone. + if ( empty( $milestone_ids ) ) { + continue; + } + WP_CLI::log( 'Closed ' . $package_name . ' milestone(s): ' . implode( ', ', $milestone_titles ) ); + foreach( $milestone_ids as $milestone_id ) { + $pull_requests = self::get_project_milestone_pull_requests( $package_name, $milestone_id ); + $repo_contributors = self::parse_contributors_from_pull_requests( $pull_requests ); + WP_CLI::log( ' - Contributors: ' . count( $repo_contributors ) ); + WP_CLI::log( ' - Pull requests: ' . count( $pull_requests ) ); + $pull_request_count += count( $pull_requests ); + $contributors = array_merge( $contributors, $repo_contributors ); + } + } + + WP_CLI::log( 'Total contributors: ' . count( $contributors ) ); + WP_CLI::log( 'Total pull requests: ' . $pull_request_count ); + + // Sort and render the contributor list + asort( $contributors, SORT_NATURAL | SORT_FLAG_CASE ); + if ( in_array( $assoc_args['format'], array( 'markdown', 'html' ) ) ) { + $contrib_list = ''; + foreach( $contributors as $url => $login ) { + if ( 'markdown' === $assoc_args['format'] ) { + $contrib_list .= '[' . $login . '](' . $url . '), '; + } elseif ( 'html' === $assoc_args['format'] ) { + $contrib_list .= '' . $login . ', '; + } + } + $contrib_list = rtrim( $contrib_list, ', ' ); + WP_CLI::log( $contrib_list ); + } + } + + /** + * Get the milestones for a given project + * + * @param string $project + * @return array + */ + private static function get_project_milestones( $project, $args = array() ) { + $request_url = sprintf( 'https://api.github.com/repos/%s/milestones', $project ); + list( $body, $headers ) = self::make_github_api_request( $request_url, $args ); + return $body; + } + + /** + * Get the pull requests assigned to a milestone of a given project + * + * @param string $project + * @param integer $milestone_id + * @return array + */ + private static function get_project_milestone_pull_requests( $project, $milestone_id ) { + $request_url = sprintf( 'https://api.github.com/repos/%s/issues', $project ); + $args = array( + 'milestone' => $milestone_id, + 'state' => 'all', + ); + $pull_requests = array(); + do { + list( $body, $headers ) = self::make_github_api_request( $request_url, $args ); + foreach( $body as $issue ) { + if ( ! empty( $issue->pull_request ) ) { + $pull_requests[] = $issue; + } + } + $args = array(); + $request_url = false; + // Set $request_url to 'rel="next" if present' + if ( ! empty( $headers['Link'] ) ) { + $bits = trim( explode( ',', $headers['Link'] ) ); + foreach( $bits as $bit ) { + if ( false !== stripos( $bit, 'rel="next"' ) ) { + $hrefandrel = explode( '; ', $bit ); + $request_url = trim( $hrefandrel[0], '<>' ); + break; + } + } + } + } while( $request_url ); + return $pull_requests; + } + + /** + * Parse the contributors from pull request objects + * + * @param array $pull_requests + * @return array + */ + private static function parse_contributors_from_pull_requests( $pull_requests ) { + $contributors = array(); + foreach( $pull_requests as $pull_request ) { + if ( ! empty( $pull_request->user ) ) { + $contributors[ $pull_request->user->html_url ] = $pull_request->user->login; + } + } + return $contributors; + } + + /** + * Make a request to the GitHub API + * + * @param string $url + * @param string $args + * @return array + */ + private static function make_github_api_request( $url, $args = array() ) { + $headers = array( + 'Accept' => 'application/vnd.github.v3+json', + 'User-Agent' => 'WP-CLI', + ); + if ( $token = getenv( 'GITHUB_TOKEN' ) ) { + $headers['Authorization'] = 'token ' . $token; + } + $response = Utils\http_request( 'GET', $url, $args, $headers ); + if ( 200 !== $response->status_code ) { + WP_CLI::error( sprintf( 'GitHub API returned: %s (HTTP code %d)', $response->body, $response->status_code ) ); + } + return array( json_decode( $response->body ), $response->headers ); + } + +} + +WP_CLI::add_command( 'contrib-list', 'Contrib_List_Command' ); diff --git a/utils/find-php b/utils/find-php new file mode 100755 index 000000000..f8d19f4a2 --- /dev/null +++ b/utils/find-php @@ -0,0 +1,19 @@ +#!/usr/bin/env sh + +# Special case for *AMP installers, since they normally don't set themselves +# as the default cli php out of the box. +for amp_php in $(cat $(dirname $0)/amp-paths.txt); do + if [ -x $amp_php ]; then + echo $amp_php + exit + fi +done + +which php || which php-cli + +if [ $? -eq 0 ]; then + exit +fi + +echo "no PHP binary found" >&2 +exit 1 diff --git a/utils/get-package-require-from-composer.php b/utils/get-package-require-from-composer.php new file mode 100644 index 000000000..33e30ccfd --- /dev/null +++ b/utils/get-package-require-from-composer.php @@ -0,0 +1,23 @@ +autoload->files ) ) { + echo 'composer.json must specify valid "autoload" => "files"'; + exit(1); +} + +echo implode( PHP_EOL, $composer->autoload->files ); +exit(0); \ No newline at end of file diff --git a/utils/make-phar-spec.php b/utils/make-phar-spec.php new file mode 100644 index 000000000..2a2ad03f9 --- /dev/null +++ b/utils/make-phar-spec.php @@ -0,0 +1,37 @@ + array( + 'runtime' => '=', + 'file' => '', + 'desc' => 'Path to output file', + ), + + 'version' => array( + 'runtime' => '=', + 'file' => '', + 'desc' => 'New package version', + ), + + 'store-version' => array( + 'runtime' => '', + 'file' => '', + 'default' => false, + 'desc' => 'If true the contents of ./VERSION will be set to the value passed to --version', + ), + + 'quiet' => array( + 'runtime' => '', + 'file' => '', + 'default' => false, + 'desc' => 'Suppress informational messages', + ), + + 'build' => array( + 'runtime' => '=', + 'file' => '', + 'default' => '', + 'desc' => 'Create a minimum test build "cli", that only supports cli commands', + ), +); + diff --git a/utils/make-phar.php b/utils/make-phar.php new file mode 100644 index 000000000..14c57e74f --- /dev/null +++ b/utils/make-phar.php @@ -0,0 +1,308 @@ +parse_args( array_slice( $GLOBALS['argv'], 1 ) ); + +if ( ! isset( $args[0] ) || empty( $args[0] ) ) { + fwrite( STDERR, "usage: php -dphar.readonly=0 $argv[0] [--quiet] [--version=same|patch|minor|major|x.y.z] [--store-version] [--build=cli]" . PHP_EOL ); + exit(1); +} + +define( 'DEST_PATH', $args[0] ); + +define( 'BE_QUIET', isset( $runtime_config['quiet'] ) && $runtime_config['quiet'] ); + +define( 'BUILD', isset( $runtime_config['build'] ) ? $runtime_config['build'] : '' ); + +$current_version = trim( file_get_contents( WP_CLI_ROOT . '/VERSION' ) ); + +if ( isset( $runtime_config['version'] ) ) { + $new_version = $runtime_config['version']; + $new_version = Utils\increment_version( $current_version, $new_version ); + + if ( isset( $runtime_config['store-version'] ) && $runtime_config['store-version'] ) { + file_put_contents( WP_CLI_ROOT . '/VERSION', $new_version ); + } + + $current_version = $new_version; +} + +function add_file( $phar, $path ) { + $key = str_replace( WP_CLI_BASE_PATH, '', $path ); + + if ( ! BE_QUIET ) { + echo "$key - $path" . PHP_EOL; + } + + $basename = basename( $path ); + if ( 0 === strpos( $basename, 'autoload_' ) && preg_match( '/(?:classmap|files|namespaces|psr4|static)\.php$/', $basename ) ) { + // Strip autoload maps of unused stuff. + static $strip_res = null; + if ( null === $strip_res ) { + if ( 'cli' === BUILD ) { + $strips = array( + '\/(?:behat|composer|gherkin)\/src\/', + '\/phpunit\/', + '\/nb\/oxymel\/', + '-command\/src\/', + '\/wp-cli\/[^\n]+?-command\/', + '\/symfony\/(?!finder|polyfill-mbstring)[^\/]+\/', + '\/(?:dealerdirect|squizlabs|wimg)\/', + ); + } else { + $strips = array( + '\/(?:behat|gherkin)\/src\/', + '\/phpunit\/', + '\/symfony\/(?!console|filesystem|finder|polyfill-mbstring|process)[^\/]+\/', + '\/composer\/spdx-licenses\/', + '\/Composer\/(?:Command\/|Compiler\.php|Console\/|Downloader\/Pear|Installer\/Pear|Question\/|Repository\/Pear|SelfUpdate\/)', + '\/(?:dealerdirect|squizlabs|wimg)\/', + ); + } + $strip_res = array_map( function ( $v ) { + return '/^[^,\n]+?' . $v . '[^,\n]+?, *\n/m'; + }, $strips ); + } + $phar[ $key ] = preg_replace( $strip_res, '', file_get_contents( $path ) ); + } else { + $phar[ $key ] = file_get_contents( $path ); + } +} + +function set_file_contents( $phar, $path, $content ) { + $key = str_replace( WP_CLI_BASE_PATH, '', $path ); + + if ( ! BE_QUIET ) { + echo "$key - $path" . PHP_EOL; + } + + $phar[ $key ] = $content; +} + +function get_composer_versions( $current_version ) { + $composer_lock_path = WP_CLI_ROOT . '/composer.lock'; + if ( ! ( $get_composer_lock = file_get_contents( $composer_lock_path ) ) || ! ( $composer_lock = json_decode( $get_composer_lock, true ) ) ) { + fwrite( STDERR, sprintf( "Warning: Failed to read '%s'." . PHP_EOL, $composer_lock_path ) ); + return ''; + } + if ( ! isset( $composer_lock['packages'] ) ) { + fwrite( STDERR, sprintf( "Warning: No packages in '%s'." . PHP_EOL, $composer_lock_path ) ); + return ''; + } + $vendor_versions = array( implode( ' ', array( 'wp-cli/wp-cli', $current_version, date( 'c' ) ) ) ); + $missing_names = $missing_versions = $missing_references = 0; + foreach ( $composer_lock['packages'] as $package ) { + if ( isset( $package['name'] ) ) { + $vendor_version = array( $package['name'] ); + if ( isset( $package['version'] ) ) { + $vendor_version[] = $package['version']; + } else { + $vendor_version[] = 'unknown_version'; + $missing_versions++; + } + if ( isset( $package['source'] ) && isset( $package['source']['reference'] ) ) { + $vendor_version[] = $package['source']['reference']; + } elseif( isset( $package['dist'] ) && isset( $package['dist']['reference'] ) ) { + $vendor_version[] = $package['dist']['reference']; + } else { + $vendor_version[] = 'unknown_reference'; + $missing_references++; + } + $vendor_versions[] = implode( ' ', $vendor_version ); + } else { + $vendor_versions[] = implode( ' ', array( 'unknown_package', 'unknown_version', 'unknown_reference' ) ); + $missing_names++; + } + } + if ( $missing_names ) { + fwrite( STDERR, sprintf( "Warning: %d package names missing from '%s'." . PHP_EOL, $missing_names, $composer_lock_path ) ); + } + if ( $missing_versions ) { + fwrite( STDERR, sprintf( "Warning: %d package versions missing from '%s'." . PHP_EOL, $missing_versions, $composer_lock_path ) ); + } + if ( $missing_references ) { + fwrite( STDERR, sprintf( "Warning: %d package references missing from '%s'." . PHP_EOL, $missing_references, $composer_lock_path ) ); + } + return implode( "\n", $vendor_versions ); +} + +if ( file_exists( DEST_PATH ) ) { + unlink( DEST_PATH ); +} +$phar = new Phar( DEST_PATH, 0, 'wp-cli.phar' ); + +$phar->startBuffering(); + +// PHP files +$finder = new Finder(); +$finder + ->files() + ->ignoreVCS(true) + ->name('*.php') + ->in(WP_CLI_ROOT . '/php') + ->in(WP_CLI_VENDOR_DIR . '/mustache') + ->in(WP_CLI_VENDOR_DIR . '/rmccue/requests') + ->in(WP_CLI_VENDOR_DIR . '/composer') + ->in(WP_CLI_VENDOR_DIR . '/ramsey/array_column') + ->in(WP_CLI_VENDOR_DIR . '/symfony/finder') + ->in(WP_CLI_VENDOR_DIR . '/symfony/polyfill-mbstring') + ->notName('behat-tags.php') + ->notPath('#(?:[^/]+-command|php-cli-tools)/vendor/#') // For running locally, in case have composer installed or symlinked them. + ->exclude('examples') + ->exclude('features') + ->exclude('test') + ->exclude('tests') + ->exclude('Test') + ->exclude('Tests') + ; +if ( 'cli' === BUILD ) { + $finder + ->in(WP_CLI_VENDOR_DIR . '/wp-cli/mustangostang-spyc') + ->in(WP_CLI_VENDOR_DIR . '/wp-cli/php-cli-tools') + ->in(WP_CLI_VENDOR_DIR . '/seld/cli-prompt') + ->exclude('composer/ca-bundle') + ->exclude('composer/semver') + ->exclude('composer/src') + ->exclude('composer/spdx-licenses') + ; +} else { + $finder + ->in(WP_CLI_VENDOR_DIR . '/wp-cli') + ->in(WP_CLI_ROOT . '/features/bootstrap') // These are required for scaffold-package-command. + ->in(WP_CLI_ROOT . '/features/steps') + ->in(WP_CLI_ROOT . '/features/extra') + ->in(WP_CLI_VENDOR_DIR . '/nb/oxymel') + ->in(WP_CLI_VENDOR_DIR . '/psr') + ->in(WP_CLI_VENDOR_DIR . '/seld') + ->in(WP_CLI_VENDOR_DIR . '/symfony/console') + ->in(WP_CLI_VENDOR_DIR . '/symfony/filesystem') + ->in(WP_CLI_VENDOR_DIR . '/symfony/process') + ->in(WP_CLI_VENDOR_DIR . '/justinrainbow/json-schema') + ->exclude('demo') + ->exclude('nb/oxymel/OxymelTest.php') + ->exclude('composer/spdx-licenses') + ->exclude('composer/composer/src/Composer/Command') + ->exclude('composer/composer/src/Composer/Compiler.php') + ->exclude('composer/composer/src/Composer/Console') + ->exclude('composer/composer/src/Composer/Downloader/PearPackageExtractor.php') // Assuming Pear installation isn't supported by wp-cli. + ->exclude('composer/composer/src/Composer/Installer/PearBinaryInstaller.php') + ->exclude('composer/composer/src/Composer/Installer/PearInstaller.php') + ->exclude('composer/composer/src/Composer/Question') + ->exclude('composer/composer/src/Composer/Repository/Pear') + ->exclude('composer/composer/src/Composer/SelfUpdate') + ; +} + +foreach ( $finder as $file ) { + add_file( $phar, $file ); +} + +// other files +$finder = new Finder(); +$finder + ->files() + ->ignoreVCS(true) + ->ignoreDotFiles(false) + ->in( WP_CLI_ROOT . '/templates') + ; + +foreach ( $finder as $file ) { + add_file( $phar, $file ); +} + +if ( 'cli' !== BUILD ) { + // Include base project files, because the autoloader will load them + if ( WP_CLI_BASE_PATH !== WP_CLI_ROOT ) { + $finder = new Finder(); + $finder + ->files() + ->ignoreVCS(true) + ->name('*.php') + ->in(WP_CLI_BASE_PATH . '/src') + ->exclude('test') + ->exclude('tests') + ->exclude('Test') + ->exclude('Tests'); + foreach ( $finder as $file ) { + add_file( $phar, $file ); + } + // Any PHP files in the project root + foreach ( glob( WP_CLI_BASE_PATH . '/*.php' ) as $file ) { + add_file( $phar, $file ); + } + } + + $finder = new Finder(); + $finder + ->files() + ->ignoreVCS(true) + ->ignoreDotFiles(false) + ->in( WP_CLI_VENDOR_DIR . '/wp-cli/config-command/templates') + ; + foreach ( $finder as $file ) { + add_file( $phar, $file ); + } + + $finder = new Finder(); + $finder + ->files() + ->ignoreVCS(true) + ->ignoreDotFiles(false) + ->in( WP_CLI_VENDOR_DIR . '/wp-cli/scaffold-command/templates') + ; + foreach ( $finder as $file ) { + add_file( $phar, $file ); + } +} + +add_file( $phar, WP_CLI_VENDOR_DIR . '/autoload.php' ); +add_file( $phar, WP_CLI_VENDOR_DIR . '/autoload_commands.php' ); +add_file( $phar, WP_CLI_VENDOR_DIR . '/autoload_framework.php' ); +if ( 'cli' !== BUILD ) { + add_file( $phar, WP_CLI_ROOT . '/ci/behat-tags.php' ); + add_file( $phar, WP_CLI_VENDOR_DIR . '/composer/composer/LICENSE' ); + add_file( $phar, WP_CLI_VENDOR_DIR . '/composer/composer/res/composer-schema.json' ); +} +add_file( $phar, WP_CLI_VENDOR_DIR . '/rmccue/requests/library/Requests/Transport/cacert.pem' ); + +set_file_contents( $phar, WP_CLI_ROOT . '/COMPOSER_VERSIONS', get_composer_versions( $current_version ) ); +set_file_contents( $phar, WP_CLI_ROOT . '/VERSION', $current_version ); + +$phar_boot = str_replace( WP_CLI_BASE_PATH, '', WP_CLI_ROOT . '/php/boot-phar.php' ); +$phar->setStub( << +EOB +); + +$phar->stopBuffering(); + +chmod( DEST_PATH, 0755 ); // Make executable. + +if ( ! BE_QUIET ) { + echo "Generated " . DEST_PATH . PHP_EOL; +} diff --git a/utils/test-phar-download b/utils/test-phar-download new file mode 100755 index 000000000..f4c9ad7f4 --- /dev/null +++ b/utils/test-phar-download @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +actual_checksum=$(curl http://wp-cli.org/packages/phar/wp-cli.phar | md5sum | cut -d ' ' -f 1) + +echo "expected:" $(curl -s http://wp-cli.org/packages/phar/wp-cli.phar.md5) +echo "actual: " $actual_checksum + +actual_checksum=$(curl http://wp-cli.org/packages/phar/wp-cli.phar | sha512sum | cut -d ' ' -f 1) + +echo "expected SHA-512:" $(curl -s http://wp-cli.org/packages/phar/wp-cli.phar.sha512) +echo "actual SHA-512: " $actual_checksum diff --git a/utils/update-phar b/utils/update-phar new file mode 100755 index 000000000..e2b16973e --- /dev/null +++ b/utils/update-phar @@ -0,0 +1,50 @@ +#!/usr/bin/env bash + +set -ex + +version=${1-"same"} + +current_rev=$(git rev-parse HEAD) +current_rev=${current_rev:0:10} + +packages_repo=../wp-cli-packages + +fname="phar/wp-cli.phar" + +# generate archive +php -dphar.readonly=0 ./utils/make-phar.php $packages_repo/$fname --quiet --version=$version --store-version + +cd $packages_repo + +# smoke test +php $fname --version + +# check which wp-cli commit the previous Phar archive was based on +# can't use the md5 hash, since it will be different each time the +# archive is generated +new_commit_subj="update wp-cli.phar to wp-cli/wp-cli@$current_rev" + +current_commit_subj=$(git show -s --pretty=format:%s HEAD) + +if [ "$new_commit_subj" = "$current_commit_subj" ]; then + echo "already at latest revision" + exit 1 +fi + +# generate md5 checksum +if [ command -v md5sum > /dev/null ] +then + md5hash=$(md5sum $fname) +else + md5hash=$(md5 -r $fname) +fi + +echo $md5hash | cut -d ' ' -f 1 > $fname.md5 + +sha512sum $fname | cut -d ' ' -f 1 > $fname.sha512 + +git add $fname $fname.md5 $fname.sha512 + +git commit -m "$new_commit_subj" + +git push diff --git a/utils/wp-cli-rpm.spec b/utils/wp-cli-rpm.spec new file mode 100644 index 000000000..1d5ef032b --- /dev/null +++ b/utils/wp-cli-rpm.spec @@ -0,0 +1,50 @@ +Name: wp-cli +Version: 0.0.0 +Release: 2%{?dist} +Summary: The command line interface for WordPress +License: MIT +URL: http://wp-cli.org/ +Source0: wp-cli.phar +Source1: wp.1 +BuildArch: noarch + +%post +echo "PHP 5.3.29 or above must be installed." + +%description +WP-CLI is the command-line interface for WordPress. +You can update plugins, configure multisite installations +and much more, without using a web browser. + +%prep +chmod +x %{SOURCE0} +{ + echo '.TH "WP" "1"' + php %{SOURCE0} --help +} \ + | sed -e 's/^\([A-Z ]\+\)$/.SH "\1"/' \ + | sed -e 's/^ wp$/wp \\- The command line interface for WordPress/' \ + > %{SOURCE1} + +%build + +%install +mkdir -p %{buildroot}%{_bindir} +install -p -m 0755 %{SOURCE0} %{buildroot}%{_bindir}/wp +mkdir -p %{buildroot}%{_mandir}/man1 +install -p -m 0644 %{SOURCE1} %{buildroot}%{_mandir}/man1/ + +%files +%attr(0755, root, root) %{_bindir}/wp +%attr(0644, root, root) %{_mandir}/man1/wp.1* + +%changelog +* Tue Dec 12 2017 Murtaza Sarıaltun - 0.0.0-2 +- Remove php requirements. +- Update creating man page steps. +- Added output message. + +* Fri Jul 7 2017 Murtaza Sarıaltun - 0.0.0-1 +- First release of the spec file +- Check the spec file with `rpmlint -i -v wp-cli-rpm.spec` +- Build the package with `rpmbuild -bb wp-cli-rpm.spec` diff --git a/utils/wp-cli-updatedeb.sh b/utils/wp-cli-updatedeb.sh new file mode 100755 index 000000000..5432d9cea --- /dev/null +++ b/utils/wp-cli-updatedeb.sh @@ -0,0 +1,113 @@ +#!/bin/bash +# +# Package wp-cli to be installed in Debian-compatible systems. +# Only the phar file is included. +# +# VERSION :0.2.4 +# DATE :2017-05-31 +# AUTHOR :Viktor Szépe +# LICENSE :The MIT License (MIT) +# URL :https://github.com/wp-cli/wp-cli/tree/master/utils +# BASH-VERSION :4.2+ + +# packages source path +DIR="php-wpcli" +# phar URL +PHAR="https://github.com/wp-cli/builds/raw/gh-pages/phar/wp-cli.phar" + +die() { + local RET="$1" + shift + + echo -e "$@" >&2 + exit "$RET" +} + +dump_control() { + cat > DEBIAN/control < +Section: php +Priority: optional +Depends: php5-cli (>= 5.3.29) | php-cli | php7-cli, php5-mysql | php5-mysqlnd | php7.0-mysql | php7.1-mysql, mysql-client | mariadb-client +Homepage: http://wp-cli.org/ +Description: wp-cli is a set of command-line tools for managing + WordPress installations. You can update plugins, set up multisite + installations and much more, without using a web browser. + +EOF +} + +set -e + +# deb's dir +if ! [ -d "$DIR" ]; then + mkdir "$DIR" || die 1 "Cannot create directory here: ${PWD}" +fi + +pushd "$DIR" + +# control file +if ! [ -r DEBIAN/control ]; then + mkdir DEBIAN + dump_control +fi + +# copyright +if ! [ -r usr/share/doc/php-wpcli/copyright ]; then + mkdir -p usr/share/doc/php-wpcli &> /dev/null + wget -nv -O usr/share/doc/php-wpcli/copyright https://github.com/wp-cli/wp-cli/raw/master/LICENSE +fi + +# changelog +if ! [ -r usr/share/doc/php-wpcli/changelog.gz ]; then + mkdir -p usr/share/doc/php-wpcli &> /dev/null + echo "Changelog can be found in the blog: https://make.wordpress.org/cli/" \ + | gzip -n -9 > usr/share/doc/php-wpcli/changelog.gz +fi + +# content dirs +[ -d usr/bin ] || mkdir -p usr/bin + +# download current version +wget -nv -O usr/bin/wp "$PHAR" || die 3 "Phar download failure" +chmod +x usr/bin/wp || die 4 "chmod failure" + +# get version +WPCLI_VER="$(usr/bin/wp cli version | cut -d " " -f 2)" +[ -z "$WPCLI_VER" ] && die 5 "Cannot get wp-cli version" +echo "Current version: ${WPCLI_VER}" + +# update version +sed -i -e "s/^Version: .*$/Version: ${WPCLI_VER}/" DEBIAN/control || die 6 "Version update failure" + +# minimal man page +if ! [ -r usr/share/man/man1/wp.1.gz ]; then + mkdir -p usr/share/man/man1 &> /dev/null + { + echo '.TH "WP" "1"' + usr/bin/wp --help + } \ + | sed 's/^\([A-Z ]\+\)$/.SH "\1"/' \ + | sed 's/^ wp$/wp \\- A command line interface for WordPress/' \ + | gzip -n -9 > usr/share/man/man1/wp.1.gz +fi + +# update MD5-s +find usr -type f -exec md5sum "{}" ";" > DEBIAN/md5sums || die 7 "md5sum creation failure" + +popd + +# build package in the current diretory +WPCLI_PKG="${PWD}/php-wpcli_${WPCLI_VER}_all.deb" +fakeroot dpkg-deb --build "$DIR" "$WPCLI_PKG" || die 8 "Packaging failed" + +# check package - not critical +lintian --display-info --display-experimental --pedantic --show-overrides php-wpcli_*_all.deb || true + +# optional steps +echo "sign it: dpkg-sig -k SIGNING-KEY -s builder \"${WPCLI_PKG}\"" +echo "include in your repo: pushd /var/www/REPO-DIR" +echo " reprepro includedeb jessie \"${WPCLI_PKG}\" && popd" diff --git a/utils/wp-cli-updaterpm.sh b/utils/wp-cli-updaterpm.sh new file mode 100755 index 000000000..5bf04a4ba --- /dev/null +++ b/utils/wp-cli-updaterpm.sh @@ -0,0 +1,110 @@ +#!/bin/bash +# +# Package WP-CLI to be installed on RPM-based systems. +# +# VERSION :0.1.0 +# DATE :2017-07-12 +# AUTHOR :Viktor Szépe +# LICENSE :The MIT License (MIT) +# URL :https://github.com/wp-cli/wp-cli/tree/master/utils +# BASH-VERSION :4.2+ +# DEPENDS :apt-get install rpm rpmlint php-cli + +PHAR_URL="https://github.com/wp-cli/builds/raw/gh-pages/phar/wp-cli.phar" +# Source directory +SOURCE_DIR="rpm-src" + +die() { + local RET="$1" + shift + + echo -e "$@" >&2 + exit "$RET" +} + +set -e + +# Check dependencies +if ! hash php rpm; then + die 1 "Missing RPM build tools" +fi + +if ! [ -d "$SOURCE_DIR" ]; then + mkdir "$SOURCE_DIR" || die 2 "Cannot create directory here: ${PWD}" +fi + +pushd "$SOURCE_DIR" > /dev/null + +# Download the binary +wget -nv -O wp-cli.phar "$PHAR_URL" +chmod +x wp-cli.phar + +# Copy spec file +cp ../wp-cli-rpm.spec wp-cli.spec + +# Replace version placeholder +WPCLI_VER="$(php wp-cli.phar cli version | cut -d " " -f 2)" +if [ -z "$WPCLI_VER" ]; then + die 3 "Cannot get WP_CLI version" +fi +echo "Current version: ${WPCLI_VER}" +sed -i -e "s/^Version: .*\$/Version: ${WPCLI_VER}/" wp-cli.spec || die 4 "Version update failed" +sed -i -e "s/^\(\* .*\) 0\.0\.0-1\$/\1 ${WPCLI_VER}-1/" wp-cli.spec || die 5 "Changleog update failed" + +# Create man page +{ + echo '.TH "WP" "1"' + php wp-cli.phar --help +} \ + | sed -e 's/^\([A-Z ]\+\)$/.SH "\1"/' \ + | sed -e 's/^ wp$/wp \\- The command line interface for WordPress/' \ + > wp.1 + +# Build the package +rpmbuild --define "_sourcedir ${PWD}" --define "_rpmdir ${PWD}" -bb wp-cli.spec | tee wp-cli-updaterpm-rpmbuild.$$.log + +rpm_path=`grep -o "/.*/noarch/wp-cli-.*noarch.rpm" wp-cli-updaterpm-rpmbuild.$$.log` + +rm -f wp-cli-updaterpm-rpmbuild.$$.log + +if [ ${#rpm_path} -lt 20 ] ; then + echo "RPM path doesn't exist ($rpm_path)" + exit +fi + +if [[ $(type -P "rpmlint") ]] ; then + echo "Using rpmlint to check for errors" +# Run linter +cat <<"EOF" > rpmlint.config +setOption("CompressExtension", "gz") +addFilter(": E: no-packager-tag") +addFilter(": E: no-signature") +addFilter(": E: no-dependency-on locales-cli") +EOF + + rpmlint -v -f rpmlint.config -i $rpm_path || true + +elif ([ $(type -P "rpm2cpio") ] && [ $(type -P "cpio") ]); then + echo "No RPM lint found $rpm_path .. using alternative method" + mkdir rpm-test-$$ + cd rpm-test-$$ + if [ $? -ne 0 ] ; then + echo "Failed to cd into rpm-test-$$" + exit; + fi + rpm2cpio $rpm_path | cpio -idmv + + if [ -f "usr/bin/wp" ] ; then + echo "RPM test succeeded" + else + echo "RPM test failed" + fi + rm -rfv ../rpm-test-$$ +else + echo "All test methods failed" +fi + + +popd > /dev/null + +echo "OK." diff --git a/utils/wp-completion.bash b/utils/wp-completion.bash new file mode 100644 index 000000000..9df572b6d --- /dev/null +++ b/utils/wp-completion.bash @@ -0,0 +1,23 @@ +# bash completion for the `wp` command + +_wp_complete() { + local OLD_IFS="$IFS" + local cur=${COMP_WORDS[COMP_CWORD]} + + IFS=$'\n'; # want to preserve spaces at the end + local opts="$(wp cli completions --line="$COMP_LINE" --point="$COMP_POINT")" + + if [[ "$opts" =~ \\s* ]] + then + COMPREPLY=( $(compgen -f -- $cur) ) + elif [[ $opts = "" ]] + then + COMPREPLY=( $(compgen -f -- $cur) ) + else + COMPREPLY=( ${opts[*]} ) + fi + + IFS="$OLD_IFS" + return 0 +} +complete -o nospace -F _wp_complete wp From c13ba29055d8b3d191ad6d3fe33b15c7f5c75390 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar Date: Thu, 8 Feb 2018 12:54:46 +0530 Subject: [PATCH 0002/1044] Replace wp-cli instances with ee. Remove wp specific code. Merge upstream changes. --- .github/ISSUE_TEMPLATE | 70 +- .github/SUPPORT.md | 2 +- .gitignore | 9 + .mailmap | 234 -- .travis.yml | 69 - CONTRIBUTING.md | 2 +- LICENSE | 2 +- README.md | 76 +- bin/{wp => ee} | 12 +- bin/{wp.bat => ee.bat} | 0 ci/behat-tags.php | 85 - ci/deploy.sh | 56 - ci/prepare.sh | 40 - ci/sniff.sh | 6 - ci/test.sh | 11 - composer.json | 51 +- composer.lock | 2392 +---------------- features/aliases.feature | 405 --- features/bootstrap.feature | 358 --- features/bootstrap/FeatureContext.php | 942 ------- features/bootstrap/support.php | 200 -- features/cli-bash-completion.feature | 299 --- features/cli-info.feature | 49 - features/cli.feature | 214 -- features/command.feature | 1668 ------------ features/config.feature | 539 ---- features/extra/no-mail.php | 7 - features/flags.feature | 297 -- features/formatter.feature | 155 -- features/framework.feature | 362 --- features/help.feature | 1018 ------- features/hook.feature | 73 - features/make-phar.feature | 28 - features/prompt.feature | 90 - features/runcommand.feature | 304 --- features/runner.feature | 21 - features/skip-plugins.feature | 116 - features/skip-themes.feature | 152 -- features/steps.feature | 59 - features/steps/given.php | 219 -- features/steps/then.php | 237 -- features/steps/when.php | 54 - features/utils-wp.feature | 734 ----- features/validation.feature | 48 - php/{WP_CLI => EE}/AutoloadSplitter.php | 8 +- php/{WP_CLI => EE}/Autoloader.php | 4 +- .../Bootstrap/AutoloaderStep.php | 8 +- .../Bootstrap/BootstrapState.php | 4 +- .../Bootstrap/BootstrapStep.php | 4 +- .../Bootstrap/ConfigureRunner.php | 6 +- .../Bootstrap/DeclareAbstractBaseCommand.php | 8 +- .../Bootstrap/DeclareMainClass.php | 8 +- .../Bootstrap/DefineProtectedCommands.php | 4 +- .../Bootstrap/IncludeBundledAutoloader.php | 8 +- .../Bootstrap/IncludeFallbackAutoloader.php | 8 +- .../Bootstrap/IncludeFrameworkAutoloader.php | 8 +- .../Bootstrap/IncludePackageAutoloader.php | 10 +- .../Bootstrap/InitializeColorization.php | 6 +- .../Bootstrap/InitializeLogger.php | 8 +- php/{WP_CLI => EE}/Bootstrap/LaunchRunner.php | 4 +- .../Bootstrap/LoadDispatcher.php | 6 +- .../Bootstrap/LoadRequiredCommand.php | 12 +- .../Bootstrap/LoadUtilityFunctions.php | 8 +- .../Bootstrap/RegisterDeferredCommands.php | 12 +- .../Bootstrap/RegisterFrameworkCommands.php | 8 +- php/EE/Bootstrap/RunnerInstance.php | 32 + php/{WP_CLI => EE}/Completions.php | 20 +- php/{WP_CLI => EE}/ComposerIO.php | 8 +- php/{WP_CLI => EE}/Configurator.php | 33 +- .../Dispatcher/CommandAddition.php | 6 +- .../Dispatcher/CommandFactory.php | 26 +- .../Dispatcher/CommandNamespace.php | 16 +- .../Dispatcher/CompositeCommand.php | 26 +- php/{WP_CLI => EE}/Dispatcher/RootCommand.php | 12 +- php/{WP_CLI => EE}/Dispatcher/Subcommand.php | 46 +- php/{WP_CLI => EE}/DocParser.php | 2 +- php/{WP_CLI => EE}/ExitException.php | 2 +- php/{WP_CLI => EE}/Extractor.php | 12 +- php/{WP_CLI => EE}/Fetchers/Base.php | 8 +- php/{WP_CLI => EE}/FileCache.php | 6 +- php/{WP_CLI => EE}/Formatter.php | 26 +- php/{WP_CLI => EE}/Iterators/CSV.php | 4 +- php/{WP_CLI => EE}/Iterators/Exception.php | 2 +- php/{WP_CLI => EE}/Iterators/Transform.php | 2 +- php/{WP_CLI => EE}/Loggers/Base.php | 8 +- php/{WP_CLI => EE}/Loggers/Execution.php | 6 +- php/{WP_CLI => EE}/Loggers/Quiet.php | 8 +- php/{WP_CLI => EE}/Loggers/Regular.php | 2 +- php/{WP_CLI => EE}/NoOp.php | 2 +- .../PackageManagerEventSubscriber.php | 8 +- php/{WP_CLI => EE}/Process.php | 4 +- php/{WP_CLI => EE}/ProcessRun.php | 2 +- php/EE/Runner.php | 766 ++++++ php/{WP_CLI => EE}/SynopsisParser.php | 2 +- php/{WP_CLI => EE}/SynopsisValidator.php | 2 +- php/WP_CLI/Bootstrap/RunnerInstance.php | 32 - php/WP_CLI/Iterators/Query.php | 130 - php/WP_CLI/Iterators/Table.php | 94 - php/WP_CLI/Runner.php | 1725 ------------ php/WP_CLI/UpgraderSkin.php | 60 - php/WP_CLI/WpHttpCacheManager.php | 132 - php/boot-fs.php | 6 +- php/boot-phar.php | 16 +- php/bootstrap.php | 48 +- php/class-ee-command.php | 12 + php/{class-wp-cli.php => class-ee.php} | 379 +-- php/class-wp-cli-command.php | 12 - php/commands/cli.php | 2 +- php/commands/help.php | 24 +- php/commands/src/CLI_Command.php | 511 ++-- php/config-spec.php | 61 +- php/dispatcher.php | 4 +- php/ee.php | 17 + php/utils-wp.php | 373 --- php/utils.php | 240 +- php/wp-cli.php | 23 - php/wp-settings-cli.php | 450 ---- phpcs.xml.dist | 4 +- templates/man-params.mustache | 2 +- templates/versions.mustache | 4 - tests/bootstrap.php | 14 +- .../commandfactory-doc_comment-class-win.php | 4 +- .../data/commandfactory-doc_comment-class.php | 4 +- tests/test-arg-validation.php | 2 +- tests/test-autoload-splitter.php | 36 +- tests/test-behat-tags.php | 8 +- tests/test-bundled-commands.php | 4 +- tests/test-commandfactory.php | 48 +- tests/test-configurator.php | 2 +- tests/test-doc-parser.php | 2 +- tests/test-ee.php | 8 + tests/test-extractor.php | 35 +- tests/test-file-cache.php | 22 +- tests/test-help.php | 18 +- tests/test-logging.php | 8 +- tests/test-process.php | 4 +- tests/test-search-replace.php | 86 - tests/test-synopsis.php | 2 +- tests/test-utils.php | 197 +- tests/test-wp-cli.php | 24 - tests/test-wp-version-compare.php | 78 - utils/auto-composer-update.sh | 8 +- utils/contrib-list.php | 205 -- ...{wp-completion.bash => ee-completion.bash} | 8 +- utils/make-phar.php | 120 +- utils/test-phar-download | 8 +- utils/update-phar | 8 +- utils/wp-cli-rpm.spec | 50 - utils/wp-cli-updatedeb.sh | 113 - utils/wp-cli-updaterpm.sh | 110 - 150 files changed, 1863 insertions(+), 16750 deletions(-) delete mode 100644 .mailmap delete mode 100644 .travis.yml rename bin/{wp => ee} (84%) rename bin/{wp.bat => ee.bat} (100%) delete mode 100644 ci/behat-tags.php delete mode 100755 ci/deploy.sh delete mode 100755 ci/prepare.sh delete mode 100755 ci/sniff.sh delete mode 100755 ci/test.sh delete mode 100644 features/aliases.feature delete mode 100644 features/bootstrap.feature delete mode 100644 features/bootstrap/FeatureContext.php delete mode 100644 features/bootstrap/support.php delete mode 100644 features/cli-bash-completion.feature delete mode 100644 features/cli-info.feature delete mode 100644 features/cli.feature delete mode 100644 features/command.feature delete mode 100644 features/config.feature delete mode 100644 features/extra/no-mail.php delete mode 100644 features/flags.feature delete mode 100644 features/formatter.feature delete mode 100644 features/framework.feature delete mode 100644 features/help.feature delete mode 100644 features/hook.feature delete mode 100644 features/make-phar.feature delete mode 100644 features/prompt.feature delete mode 100644 features/runcommand.feature delete mode 100644 features/runner.feature delete mode 100644 features/skip-plugins.feature delete mode 100644 features/skip-themes.feature delete mode 100644 features/steps.feature delete mode 100644 features/steps/given.php delete mode 100644 features/steps/then.php delete mode 100644 features/steps/when.php delete mode 100644 features/utils-wp.feature delete mode 100644 features/validation.feature rename php/{WP_CLI => EE}/AutoloadSplitter.php (81%) rename php/{WP_CLI => EE}/Autoloader.php (99%) rename php/{WP_CLI => EE}/Bootstrap/AutoloaderStep.php (93%) rename php/{WP_CLI => EE}/Bootstrap/BootstrapState.php (95%) rename php/{WP_CLI => EE}/Bootstrap/BootstrapStep.php (87%) rename php/{WP_CLI => EE}/Bootstrap/ConfigureRunner.php (78%) rename php/{WP_CLI => EE}/Bootstrap/DeclareAbstractBaseCommand.php (70%) rename php/{WP_CLI => EE}/Bootstrap/DeclareMainClass.php (72%) rename php/{WP_CLI => EE}/Bootstrap/DefineProtectedCommands.php (95%) rename php/{WP_CLI => EE}/Bootstrap/IncludeBundledAutoloader.php (78%) rename php/{WP_CLI => EE}/Bootstrap/IncludeFallbackAutoloader.php (79%) rename php/{WP_CLI => EE}/Bootstrap/IncludeFrameworkAutoloader.php (83%) rename php/{WP_CLI => EE}/Bootstrap/IncludePackageAutoloader.php (83%) rename php/{WP_CLI => EE}/Bootstrap/InitializeColorization.php (78%) rename php/{WP_CLI => EE}/Bootstrap/InitializeLogger.php (83%) rename php/{WP_CLI => EE}/Bootstrap/LaunchRunner.php (89%) rename php/{WP_CLI => EE}/Bootstrap/LoadDispatcher.php (80%) rename php/{WP_CLI => EE}/Bootstrap/LoadRequiredCommand.php (84%) rename php/{WP_CLI => EE}/Bootstrap/LoadUtilityFunctions.php (70%) rename php/{WP_CLI => EE}/Bootstrap/RegisterDeferredCommands.php (84%) rename php/{WP_CLI => EE}/Bootstrap/RegisterFrameworkCommands.php (87%) create mode 100644 php/EE/Bootstrap/RunnerInstance.php rename php/{WP_CLI => EE}/Completions.php (85%) rename php/{WP_CLI => EE}/ComposerIO.php (87%) rename php/{WP_CLI => EE}/Configurator.php (88%) rename php/{WP_CLI => EE}/Dispatcher/CommandAddition.php (94%) rename php/{WP_CLI => EE}/Dispatcher/CommandFactory.php (88%) rename php/{WP_CLI => EE}/Dispatcher/CommandNamespace.php (75%) rename php/{WP_CLI => EE}/Dispatcher/CompositeCommand.php (89%) rename php/{WP_CLI => EE}/Dispatcher/RootCommand.php (79%) rename php/{WP_CLI => EE}/Dispatcher/Subcommand.php (91%) rename php/{WP_CLI => EE}/DocParser.php (99%) rename php/{WP_CLI => EE}/ExitException.php (73%) rename php/{WP_CLI => EE}/Extractor.php (94%) rename php/{WP_CLI => EE}/Fetchers/Base.php (80%) rename php/{WP_CLI => EE}/FileCache.php (97%) rename php/{WP_CLI => EE}/Formatter.php (93%) rename php/{WP_CLI => EE}/Iterators/CSV.php (93%) rename php/{WP_CLI => EE}/Iterators/Exception.php (65%) rename php/{WP_CLI => EE}/Iterators/Transform.php (93%) rename php/{WP_CLI => EE}/Loggers/Base.php (88%) rename php/{WP_CLI => EE}/Loggers/Execution.php (91%) rename php/{WP_CLI => EE}/Loggers/Quiet.php (79%) rename php/{WP_CLI => EE}/Loggers/Regular.php (98%) rename php/{WP_CLI => EE}/NoOp.php (91%) rename php/{WP_CLI => EE}/PackageManagerEventSubscriber.php (88%) rename php/{WP_CLI => EE}/Process.php (98%) rename php/{WP_CLI => EE}/ProcessRun.php (98%) create mode 100644 php/EE/Runner.php rename php/{WP_CLI => EE}/SynopsisParser.php (99%) rename php/{WP_CLI => EE}/SynopsisValidator.php (99%) delete mode 100644 php/WP_CLI/Bootstrap/RunnerInstance.php delete mode 100644 php/WP_CLI/Iterators/Query.php delete mode 100644 php/WP_CLI/Iterators/Table.php delete mode 100644 php/WP_CLI/Runner.php delete mode 100644 php/WP_CLI/UpgraderSkin.php delete mode 100644 php/WP_CLI/WpHttpCacheManager.php create mode 100644 php/class-ee-command.php rename php/{class-wp-cli.php => class-ee.php} (69%) delete mode 100644 php/class-wp-cli-command.php create mode 100644 php/ee.php delete mode 100644 php/utils-wp.php delete mode 100644 php/wp-cli.php delete mode 100644 php/wp-settings-cli.php delete mode 100644 templates/versions.mustache create mode 100644 tests/test-ee.php delete mode 100644 tests/test-search-replace.php delete mode 100644 tests/test-wp-cli.php delete mode 100644 tests/test-wp-version-compare.php delete mode 100644 utils/contrib-list.php rename utils/{wp-completion.bash => ee-completion.bash} (67%) delete mode 100644 utils/wp-cli-rpm.spec delete mode 100755 utils/wp-cli-updatedeb.sh delete mode 100755 utils/wp-cli-updaterpm.sh diff --git a/.github/ISSUE_TEMPLATE b/.github/ISSUE_TEMPLATE index f6706f740..6e687b492 100644 --- a/.github/ISSUE_TEMPLATE +++ b/.github/ISSUE_TEMPLATE @@ -1,40 +1,40 @@ (post|comment|site|term) list --*__in --field=url - if ( count( $args ) >= 2 && in_array( $args[0], array( 'post', 'comment', 'site', 'term' ) ) && 'url' === $args[1] ) { - switch ( $args[0] ) { - case 'post': - $post_ids = array_slice( $args, 2 ); - $args = array( 'post', 'list' ); - $assoc_args['post__in'] = implode( ',', $post_ids ); - $assoc_args['post_type'] = 'any'; - $assoc_args['orderby'] = 'post__in'; - $assoc_args['field'] = 'url'; - break; - case 'comment': - $comment_ids = array_slice( $args, 2 ); - $args = array( 'comment', 'list' ); - $assoc_args['comment__in'] = implode( ',', $comment_ids ); - $assoc_args['orderby'] = 'comment__in'; - $assoc_args['field'] = 'url'; - break; - case 'site': - $site_ids = array_slice( $args, 2 ); - $args = array( 'site', 'list' ); - $assoc_args['site__in'] = implode( ',', $site_ids ); - $assoc_args['field'] = 'url'; - break; - case 'term': - $taxonomy = ''; - if ( isset( $args[2] ) ) { - $taxonomy = $args[2]; - } - $term_ids = array_slice( $args, 3 ); - $args = array( 'term', 'list', $taxonomy ); - $assoc_args['include'] = implode( ',', $term_ids ); - $assoc_args['orderby'] = 'include'; - $assoc_args['field'] = 'url'; - break; - } - } - - // config get --[global|constant]= --> config get --type=constant|variable - // config get --> config list - if ( count( $args ) === 2 - && 'config' === $args[0] - && 'get' === $args[1] ) { - if ( isset( $assoc_args['global'] ) ) { - $name = $assoc_args['global']; - $type = 'variable'; - unset( $assoc_args['global'] ); - } elseif ( isset( $assoc_args['constant'] ) ) { - $name = $assoc_args['constant']; - $type = 'constant'; - unset( $assoc_args['constant'] ); - } - if ( ! empty( $name ) && ! empty( $type ) ) { - $args[] = $name; - $assoc_args['type'] = $type; - } else { - // We had a 'config get' without a '', so assume 'list' was wanted. - $args[1] = 'list'; - } - } - - return array( $args, $assoc_args ); - } - - /** - * Whether or not the output should be rendered in color - * - * @return bool - */ - public function in_color() { - return $this->colorize; - } - - public function init_colorization() { - if ( 'auto' === $this->config['color'] ) { - $this->colorize = ( ! \WP_CLI\Utils\isPiped() && ! \WP_CLI\Utils\is_windows() ); - } else { - $this->colorize = $this->config['color']; - } - } - - public function init_logger() { - if ( $this->config['quiet'] ) { - $logger = new \WP_CLI\Loggers\Quiet; - } else { - $logger = new \WP_CLI\Loggers\Regular( $this->in_color() ); - } - - WP_CLI::set_logger( $logger ); - } - - public function get_required_files() { - return $this->_required_files; - } - - /** - * Do WordPress core files exist? - * - * @return bool - */ - private function wp_exists() { - return file_exists( ABSPATH . 'wp-includes/version.php' ); - } - - /** - * Are WordPress core files readable? - * - * @return bool - */ - private function wp_is_readable() { - return is_readable( ABSPATH . 'wp-includes/version.php' ); - } - - private function check_wp_version() { - $wp_exists = $this->wp_exists(); - $wp_is_readable = $this->wp_is_readable(); - if ( ! $wp_exists || ! $wp_is_readable ) { - $this->show_synopsis_if_composite_command(); - // If the command doesn't exist use as error. - $args = $this->cmd_starts_with( array( 'help' ) ) ? array_slice( $this->arguments, 1 ) : $this->arguments; - $suggestion_or_disabled = $this->find_command_to_run( $args ); - if ( is_string( $suggestion_or_disabled ) ) { - if ( ! preg_match( '/disabled from the config file.$/', $suggestion_or_disabled ) ) { - WP_CLI::warning( "No WordPress install found. If the command '" . implode( ' ', $args ) . "' is in a plugin or theme, pass --path=`path/to/wordpress`." ); - } - WP_CLI::error( $suggestion_or_disabled ); - } - - if ( $wp_exists && ! $wp_is_readable ) { - WP_CLI::error( - 'It seems, the WordPress core files do not have the proper file permissions.' - ); - } - WP_CLI::error( - "This does not seem to be a WordPress install.\n" . - 'Pass --path=`path/to/wordpress` or run `wp core download`.' - ); - } - - global $wp_version; - include ABSPATH . 'wp-includes/version.php'; - - $minimum_version = '3.7'; - - // @codingStandardsIgnoreStart - if ( version_compare( $wp_version, $minimum_version, '<' ) ) { - WP_CLI::error( - "WP-CLI needs WordPress $minimum_version or later to work properly. " . - "The version currently installed is $wp_version.\n" . - 'Try running `wp core download --force`.' - ); - } - // @codingStandardsIgnoreEnd - } - - public function init_config() { - $configurator = \WP_CLI::get_configurator(); - - $argv = array_slice( $GLOBALS['argv'], 1 ); - - $this->alias = null; - if ( ! empty( $argv[0] ) && preg_match( '#' . Configurator::ALIAS_REGEX . '#', $argv[0], $matches ) ) { - $this->alias = array_shift( $argv ); - } - - // File config - { - $this->global_config_path = $this->get_global_config_path(); - $this->project_config_path = $this->get_project_config_path(); - - $configurator->merge_yml( $this->global_config_path, $this->alias ); - $config = $configurator->to_array(); - $this->_required_files['global'] = $config[0]['require']; - $configurator->merge_yml( $this->project_config_path, $this->alias ); - $config = $configurator->to_array(); - $this->_required_files['project'] = $config[0]['require']; - } - - // Runtime config and args - { - list( $args, $assoc_args, $this->runtime_config ) = $configurator->parse_args( $argv ); - - list( $this->arguments, $this->assoc_args ) = self::back_compat_conversions( - $args, $assoc_args - ); - - $configurator->merge_array( $this->runtime_config ); - } - - list( $this->config, $this->extra_config ) = $configurator->to_array(); - $this->aliases = $configurator->get_aliases(); - if ( count( $this->aliases ) && ! isset( $this->aliases['@all'] ) ) { - $this->aliases = array_reverse( $this->aliases ); - $this->aliases['@all'] = 'Run command against every registered alias.'; - $this->aliases = array_reverse( $this->aliases ); - } - $this->_required_files['runtime'] = $this->config['require']; - } - - private function check_root() { - if ( $this->config['allow-root'] ) { - return; # they're aware of the risks! - } - if ( count( $this->arguments ) >= 2 && 'cli' === $this->arguments[0] && in_array( $this->arguments[1], array( 'update', 'info' ), true ) ) { - return; # make it easier to update root-owned copies - } - if ( ! function_exists( 'posix_geteuid' ) ) { - return; # posix functions not available - } - if ( posix_geteuid() !== 0 ) { - return; # not root - } - - WP_CLI::error( - "YIKES! It looks like you're running this as root. You probably meant to " . - "run this as the user that your WordPress install exists under.\n" . - "\n" . - "If you REALLY mean to run this as root, we won't stop you, but just " . - 'bear in mind that any code on this site will then have full control of ' . - "your server, making it quite DANGEROUS.\n" . - "\n" . - "If you'd like to continue as root, please run this again, adding this " . - "flag: --allow-root\n" . - "\n" . - "If you'd like to run it as the user that this site is under, you can " . - "run the following to become the respective user:\n" . - "\n" . - " sudo -u USER -i -- wp \n" . - "\n" - ); - } - - private function run_alias_group( $aliases ) { - Utils\check_proc_available( 'group alias' ); - - $php_bin = escapeshellarg( Utils\get_php_binary() ); - - $script_path = $GLOBALS['argv'][0]; - - if ( getenv( 'WP_CLI_CONFIG_PATH' ) ) { - $config_path = getenv( 'WP_CLI_CONFIG_PATH' ); - } else { - $config_path = Utils\get_home_dir() . '/.wp-cli/config.yml'; - } - $config_path = escapeshellarg( $config_path ); - - foreach ( $aliases as $alias ) { - WP_CLI::log( $alias ); - $args = implode( ' ', array_map( 'escapeshellarg', $this->arguments ) ); - $assoc_args = Utils\assoc_args_to_str( $this->assoc_args ); - $runtime_config = Utils\assoc_args_to_str( $this->runtime_config ); - $full_command = "WP_CLI_CONFIG_PATH={$config_path} {$php_bin} {$script_path} {$alias} {$args}{$assoc_args}{$runtime_config}"; - $proc = Utils\proc_open_compat( $full_command, array( STDIN, STDOUT, STDERR ), $pipes ); - proc_close( $proc ); - } - } - - private function set_alias( $alias ) { - $orig_config = $this->config; - $alias_config = $this->aliases[ $this->alias ]; - $this->config = array_merge( $orig_config, $alias_config ); - foreach ( $alias_config as $key => $_ ) { - if ( isset( $orig_config[ $key ] ) && ! is_null( $orig_config[ $key ] ) ) { - $this->assoc_args[ $key ] = $orig_config[ $key ]; - } - } - } - - public function start() { - - // Enable PHP error reporting to stderr if testing. Will need to be re-enabled after WP loads. - if ( getenv( 'BEHAT_RUN' ) ) { - $this->enable_error_reporting(); - } - - WP_CLI::debug( $this->_global_config_path_debug, 'bootstrap' ); - WP_CLI::debug( $this->_project_config_path_debug, 'bootstrap' ); - WP_CLI::debug( 'argv: ' . implode( ' ', $GLOBALS['argv'] ), 'bootstrap' ); - - $this->check_root(); - if ( $this->alias ) { - if ( '@all' === $this->alias && ! isset( $this->aliases['@all'] ) ) { - WP_CLI::error( "Cannot use '@all' when no aliases are registered." ); - } - - if ( '@all' === $this->alias && is_string( $this->aliases['@all'] ) ) { - $aliases = array_keys( $this->aliases ); - $k = array_search( '@all', $aliases ); - unset( $aliases[ $k ] ); - $this->run_alias_group( $aliases ); - exit; - } - - if ( ! array_key_exists( $this->alias, $this->aliases ) ) { - $error_msg = "Alias '{$this->alias}' not found."; - $suggestion = Utils\get_suggestion( $this->alias, array_keys( $this->aliases ), $threshold = 2 ); - if ( $suggestion ) { - $error_msg .= PHP_EOL . "Did you mean '{$suggestion}'?"; - } - WP_CLI::error( $error_msg ); - } - // Numerically indexed means a group of aliases - if ( isset( $this->aliases[ $this->alias ][0] ) ) { - $group_aliases = $this->aliases[ $this->alias ]; - $all_aliases = array_keys( $this->aliases ); - if ( $diff = array_diff( $group_aliases, $all_aliases ) ) { - WP_CLI::error( "Group '{$this->alias}' contains one or more invalid aliases: " . implode( ', ', $diff ) ); - } - $this->run_alias_group( $group_aliases ); - exit; - } - - $this->set_alias( $this->alias ); - } - - if ( empty( $this->arguments ) ) { - $this->arguments[] = 'help'; - } - - // Protect 'cli info' from most of the runtime, - // except when the command will be run over SSH - if ( 'cli' === $this->arguments[0] && ! empty( $this->arguments[1] ) && 'info' === $this->arguments[1] && ! $this->config['ssh'] ) { - $this->_run_command_and_exit(); - } - - if ( isset( $this->config['http'] ) && ! class_exists( '\WP_REST_CLI\Runner' ) ) { - WP_CLI::error( "RESTful WP-CLI needs to be installed. Try 'wp package install wp-cli/restful'." ); - } - - if ( $this->config['ssh'] ) { - $this->run_ssh_command( $this->config['ssh'] ); - return; - } - - // Handle --path parameter - self::set_wp_root( $this->find_wp_root() ); - - // First try at showing man page - if help command and either haven't found 'version.php' or 'wp-config.php' (so won't be loading WP & adding commands) or help on subcommand. - if ( $this->cmd_starts_with( array( 'help' ) ) - && ( ! $this->wp_exists() - || ! Utils\locate_wp_config() - || count( $this->arguments ) > 2 - ) ) { - $this->auto_check_update(); - $this->run_command( $this->arguments, $this->assoc_args ); - // Help didn't exit so failed to find the command at this stage. - } - - // Handle --url parameter - $url = self::guess_url( $this->config ); - if ( $url ) { - \WP_CLI::set_url( $url ); - } - - $this->do_early_invoke( 'before_wp_load' ); - - $this->check_wp_version(); - - if ( $this->cmd_starts_with( array( 'config', 'create' ) ) ) { - $this->_run_command_and_exit(); - } - - if ( ! Utils\locate_wp_config() ) { - WP_CLI::error( - "'wp-config.php' not found.\n" . - 'Either create one manually or use `wp config create`.' - ); - } - - if ( $this->cmd_starts_with( array( 'core', 'is-installed' ) ) - || $this->cmd_starts_with( array( 'core', 'update-db' ) ) ) { - define( 'WP_INSTALLING', true ); - } - - if ( - count( $this->arguments ) >= 2 && - 'core' === $this->arguments[0] && - in_array( $this->arguments[1], array( 'install', 'multisite-install' ) ) - ) { - define( 'WP_INSTALLING', true ); - - // We really need a URL here - if ( ! isset( $_SERVER['HTTP_HOST'] ) ) { - $url = 'http://example.com'; - \WP_CLI::set_url( $url ); - } - - if ( 'multisite-install' == $this->arguments[1] ) { - // need to fake some globals to skip the checks in wp-includes/ms-settings.php - $url_parts = Utils\parse_url( $url ); - self::fake_current_site_blog( $url_parts ); - - if ( ! defined( 'COOKIEHASH' ) ) { - define( 'COOKIEHASH', md5( $url_parts['host'] ) ); - } - } - } - - if ( $this->cmd_starts_with( array( 'import' ) ) ) { - define( 'WP_LOAD_IMPORTERS', true ); - define( 'WP_IMPORTING', true ); - } - - if ( $this->cmd_starts_with( array( 'cron', 'event', 'run' ) ) ) { - define( 'DOING_CRON', true ); - } - - $this->load_wordpress(); - - $this->_run_command_and_exit(); - - } - - /** - * Load WordPress, if it hasn't already been loaded - */ - public function load_wordpress() { - static $wp_cli_is_loaded; - // Globals not explicitly globalized in WordPress - global $site_id, $wpdb, $public, $current_site, $current_blog, $path, $shortcode_tags; - - if ( ! empty( $wp_cli_is_loaded ) ) { - return; - } - - $wp_cli_is_loaded = true; - - WP_CLI::debug( 'Begin WordPress load', 'bootstrap' ); - WP_CLI::do_hook( 'before_wp_load' ); - - $this->check_wp_version(); - - $wp_config_path = Utils\locate_wp_config(); - if ( ! $wp_config_path ) { - WP_CLI::error( - "'wp-config.php' not found.\n" . - 'Either create one manually or use `wp config create`.' - ); - } - - WP_CLI::debug( 'wp-config.php path: ' . $wp_config_path, 'bootstrap' ); - WP_CLI::do_hook( 'before_wp_config_load' ); - - // Load wp-config.php code, in the global scope - $wp_cli_original_defined_vars = get_defined_vars(); - eval( $this->get_wp_config_code() ); - foreach ( get_defined_vars() as $key => $var ) { - if ( array_key_exists( $key, $wp_cli_original_defined_vars ) || 'wp_cli_original_defined_vars' === $key ) { - continue; - } - global ${$key}; - ${$key} = $var; - } - - $this->maybe_update_url_from_domain_constant(); - WP_CLI::do_hook( 'after_wp_config_load' ); - $this->do_early_invoke( 'after_wp_config_load' ); - - // Prevent error notice from wp_guess_url() when core isn't installed - if ( $this->cmd_starts_with( array( 'core', 'is-installed' ) ) - && ! defined( 'COOKIEHASH' ) ) { - define( 'COOKIEHASH', md5( 'wp-cli' ) ); - } - - // Load WP-CLI utilities - require WP_CLI_ROOT . '/php/utils-wp.php'; - - // Set up WordPress bootstrap actions and filters - $this->setup_bootstrap_hooks(); - - // Load Core, mu-plugins, plugins, themes etc. - if ( Utils\wp_version_compare( '4.6-alpha-37575', '>=' ) ) { - if ( $this->cmd_starts_with( array( 'help' ) ) ) { - // Hack: define `WP_DEBUG` and `WP_DEBUG_DISPLAY` to get `wpdb::bail()` to `wp_die()`. - if ( ! defined( 'WP_DEBUG' ) ) { - define( 'WP_DEBUG', true ); - } - if ( ! defined( 'WP_DEBUG_DISPLAY' ) ) { - define( 'WP_DEBUG_DISPLAY', true ); - } - } - require ABSPATH . 'wp-settings.php'; - } else { - require WP_CLI_ROOT . '/php/wp-settings-cli.php'; - } - - // Fix memory limit. See http://core.trac.wordpress.org/ticket/14889 - ini_set( 'memory_limit', -1 ); - - // Load all the admin APIs, for convenience - require ABSPATH . 'wp-admin/includes/admin.php'; - - add_filter( - 'filesystem_method', - function() { - return 'direct'; - }, - 99 - ); - - // Re-enable PHP error reporting to stderr if testing. - if ( getenv( 'BEHAT_RUN' ) ) { - $this->enable_error_reporting(); - } - - WP_CLI::debug( 'Loaded WordPress', 'bootstrap' ); - WP_CLI::do_hook( 'after_wp_load' ); - - } - - private static function fake_current_site_blog( $url_parts ) { - global $current_site, $current_blog; - - if ( ! isset( $url_parts['path'] ) ) { - $url_parts['path'] = '/'; - } - - $current_site = (object) array( - 'id' => 1, - 'blog_id' => 1, - 'domain' => $url_parts['host'], - 'path' => $url_parts['path'], - 'cookie_domain' => $url_parts['host'], - 'site_name' => 'Fake Site', - ); - - $current_blog = (object) array( - 'blog_id' => 1, - 'site_id' => 1, - 'domain' => $url_parts['host'], - 'path' => $url_parts['path'], - 'public' => '1', - 'archived' => '0', - 'mature' => '0', - 'spam' => '0', - 'deleted' => '0', - 'lang_id' => '0', - ); - } - - /** - * Called after wp-config.php is eval'd, to potentially reset `--url` - */ - private function maybe_update_url_from_domain_constant() { - if ( ! empty( $this->config['url'] ) || ! empty( $this->config['blog'] ) ) { - return; - } - - if ( defined( 'DOMAIN_CURRENT_SITE' ) ) { - $url = DOMAIN_CURRENT_SITE; - if ( defined( 'PATH_CURRENT_SITE' ) ) { - $url .= PATH_CURRENT_SITE; - } - \WP_CLI::set_url( $url ); - } - } - - /** - * Set up hooks meant to run during the WordPress bootstrap process - */ - private function setup_bootstrap_hooks() { - - if ( $this->config['skip-plugins'] ) { - $this->setup_skip_plugins_filters(); - } - - if ( $this->config['skip-themes'] ) { - WP_CLI::add_wp_hook( 'setup_theme', array( $this, 'action_setup_theme_wp_cli_skip_themes' ), 999 ); - } - - if ( $this->cmd_starts_with( array( 'help' ) ) ) { - // Try to trap errors on help. - $help_handler = array( $this, 'help_wp_die_handler' ); // Avoid any cross PHP version issues by not using $this in anon function. - WP_CLI::add_wp_hook( - 'wp_die_handler', - function () use ( $help_handler ) { - return $help_handler; - } - ); - } else { - WP_CLI::add_wp_hook( - 'wp_die_handler', - function() { - return '\WP_CLI\Utils\wp_die_handler'; - } - ); - } - - // Prevent code from performing a redirect - WP_CLI::add_wp_hook( 'wp_redirect', 'WP_CLI\\Utils\\wp_redirect_handler' ); - - WP_CLI::add_wp_hook( - 'nocache_headers', - function( $headers ) { - // WordPress might be calling nocache_headers() because of a dead db - global $wpdb; - if ( ! empty( $wpdb->error ) ) { - Utils\wp_die_handler( $wpdb->error ); - } - // Otherwise, WP might be calling nocache_headers() because WP isn't installed - Utils\wp_not_installed(); - return $headers; - } - ); - - // ALTERNATE_WP_CRON might trigger a redirect, which we can't handle - if ( defined( 'ALTERNATE_WP_CRON' ) && ALTERNATE_WP_CRON ) { - WP_CLI::add_wp_hook( - 'muplugins_loaded', - function() { - remove_action( 'init', 'wp_cron' ); - } - ); - } - - // Get rid of warnings when converting single site to multisite - if ( defined( 'WP_INSTALLING' ) && $this->is_multisite() ) { - $values = array( - 'ms_files_rewriting' => null, - 'active_sitewide_plugins' => array(), - '_site_transient_update_core' => null, - '_site_transient_update_themes' => null, - '_site_transient_update_plugins' => null, - 'WPLANG' => '', - ); - foreach ( $values as $key => $value ) { - WP_CLI::add_wp_hook( - "pre_site_option_$key", - function () use ( $values, $key ) { - return $values[ $key ]; - } - ); - } - } - - // Always permit operations against sites, regardless of status - WP_CLI::add_wp_hook( 'ms_site_check', '__return_true' ); - - // Always permit operations against WordPress, regardless of maintenance mode - WP_CLI::add_wp_hook( - 'enable_maintenance_mode', - function() { - return false; - } - ); - - // Use our own debug mode handling instead of WP core - WP_CLI::add_wp_hook( - 'enable_wp_debug_mode_checks', - function( $ret ) { - Utils\wp_debug_mode(); - return false; - } - ); - - // Never load advanced-cache.php drop-in when WP-CLI is operating - WP_CLI::add_wp_hook( - 'enable_loading_advanced_cache_dropin', - function() { - return false; - } - ); - - // In a multisite install, die if unable to find site given in --url parameter - if ( $this->is_multisite() ) { - $run_on_site_not_found = false; - if ( $this->cmd_starts_with( array( 'cache', 'flush' ) ) ) { - $run_on_site_not_found = 'cache flush'; - } - if ( $this->cmd_starts_with( array( 'search-replace' ) ) ) { - // Table-specified - // Bits: search-replace [
...] - // Or not against a specific blog - if ( count( $this->arguments ) > 3 - || ! empty( $this->assoc_args['network'] ) - || ! empty( $this->assoc_args['all-tables'] ) - || ! empty( $this->assoc_args['all-tables-with-prefix'] ) ) { - $run_on_site_not_found = 'search-replace'; - } - } - if ( $run_on_site_not_found - && Utils\wp_version_compare( '4.0', '>=' ) ) { - WP_CLI::add_wp_hook( - 'ms_site_not_found', - function() use ( $run_on_site_not_found ) { - // esc_sql() isn't yet loaded, but needed. - if ( 'search-replace' === $run_on_site_not_found ) { - require_once ABSPATH . WPINC . '/formatting.php'; - } - // PHP 5.3 compatible implementation of _run_command_and_exit(). - $runner = WP_CLI::get_runner(); - $runner->run_command( $runner->arguments, $runner->assoc_args ); - exit; - }, - 1 - ); - } - WP_CLI::add_wp_hook( - 'ms_site_not_found', - function( $current_site, $domain, $path ) { - $url = $domain . $path; - $message = $url ? "Site '{$url}' not found." : 'Site not found.'; - $has_param = isset( WP_CLI::get_runner()->config['url'] ); - $has_const = defined( 'DOMAIN_CURRENT_SITE' ); - $explanation = ''; - if ( $has_param ) { - $explanation = 'Verify `--url=` matches an existing site.'; - } else { - $explanation = "Define DOMAIN_CURRENT_SITE in 'wp-config.php' or use `--url=` to override."; - - if ( $has_const ) { - $explanation = 'Verify DOMAIN_CURRENT_SITE matches an existing site or use `--url=` to override.'; - } - } - if ( $explanation ) { - $message .= ' ' . $explanation; - } - WP_CLI::error( $message ); - }, - 10, - 3 - ); - } - - // The APC cache is not available on the command-line, so bail, to prevent cache poisoning - WP_CLI::add_wp_hook( - 'muplugins_loaded', - function() { - if ( $GLOBALS['_wp_using_ext_object_cache'] && class_exists( 'APC_Object_Cache' ) ) { - WP_CLI::warning( 'Running WP-CLI while the APC object cache is activated can result in cache corruption.' ); - WP_CLI::confirm( 'Given the consequences, do you wish to continue?' ); - } - }, - 0 - ); - - // Handle --user parameter - if ( ! defined( 'WP_INSTALLING' ) ) { - $config = $this->config; - WP_CLI::add_wp_hook( - 'init', - function() use ( $config ) { - if ( isset( $config['user'] ) ) { - $fetcher = new \WP_CLI\Fetchers\User; - $user = $fetcher->get_check( $config['user'] ); - wp_set_current_user( $user->ID ); - } else { - add_action( 'init', 'kses_remove_filters', 11 ); - } - }, - 0 - ); - } - - // Avoid uncaught exception when using wp_mail() without defined $_SERVER['SERVER_NAME'] - WP_CLI::add_wp_hook( - 'wp_mail_from', - function( $from_email ) { - if ( 'wordpress@' === $from_email ) { - $sitename = strtolower( parse_url( site_url(), PHP_URL_HOST ) ); - if ( substr( $sitename, 0, 4 ) == 'www.' ) { - $sitename = substr( $sitename, 4 ); - } - $from_email = 'wordpress@' . $sitename; - } - return $from_email; - } - ); - - // Don't apply set_url_scheme in get_site_url() - WP_CLI::add_wp_hook( - 'site_url', - function( $url, $path, $scheme, $blog_id ) { - if ( empty( $blog_id ) || ! is_multisite() ) { - $url = get_option( 'siteurl' ); - } else { - switch_to_blog( $blog_id ); - $url = get_option( 'siteurl' ); - restore_current_blog(); - } - if ( $path && is_string( $path ) ) { - $url .= '/' . ltrim( $path, '/' ); - } - return $url; - }, - 0, - 4 - ); - - } - - /** - * Set up the filters to skip the loaded plugins - */ - private function setup_skip_plugins_filters() { - $wp_cli_filter_active_plugins = function( $plugins ) { - $skipped_plugins = WP_CLI::get_runner()->config['skip-plugins']; - if ( true === $skipped_plugins ) { - return array(); - } - if ( ! is_array( $plugins ) ) { - return $plugins; - } - foreach ( $plugins as $a => $b ) { - // active_sitewide_plugins stores plugin name as the key. - if ( false !== strpos( current_filter(), 'active_sitewide_plugins' ) && Utils\is_plugin_skipped( $a ) ) { - unset( $plugins[ $a ] ); - // active_plugins stores plugin name as the value. - } elseif ( false !== strpos( current_filter(), 'active_plugins' ) && Utils\is_plugin_skipped( $b ) ) { - unset( $plugins[ $a ] ); - } - } - // Reindex because active_plugins expects a numeric index. - if ( false !== strpos( current_filter(), 'active_plugins' ) ) { - $plugins = array_values( $plugins ); - } - return $plugins; - }; - - $hooks = array( - 'pre_site_option_active_sitewide_plugins', - 'site_option_active_sitewide_plugins', - 'pre_option_active_plugins', - 'option_active_plugins', - ); - foreach ( $hooks as $hook ) { - WP_CLI::add_wp_hook( $hook, $wp_cli_filter_active_plugins, 999 ); - } - WP_CLI::add_wp_hook( - 'plugins_loaded', - function() use ( $hooks, $wp_cli_filter_active_plugins ) { - foreach ( $hooks as $hook ) { - remove_filter( $hook, $wp_cli_filter_active_plugins, 999 ); - } - }, - 0 - ); - } - - /** - * Set up the filters to skip the loaded theme - */ - public function action_setup_theme_wp_cli_skip_themes() { - $wp_cli_filter_active_theme = function( $value ) { - $skipped_themes = WP_CLI::get_runner()->config['skip-themes']; - if ( true === $skipped_themes ) { - return ''; - } - if ( ! is_array( $skipped_themes ) ) { - $skipped_themes = explode( ',', $skipped_themes ); - } - - $checked_value = $value; - // Always check against the stylesheet value - // This ensures a child theme can be skipped when template differs - if ( false !== stripos( current_filter(), 'option_template' ) ) { - $checked_value = get_option( 'stylesheet' ); - } - - if ( '' === $checked_value || in_array( $checked_value, $skipped_themes ) ) { - return ''; - } - return $value; - }; - $hooks = array( - 'pre_option_template', - 'option_template', - 'pre_option_stylesheet', - 'option_stylesheet', - ); - foreach ( $hooks as $hook ) { - add_filter( $hook, $wp_cli_filter_active_theme, 999 ); - } - // Clean up after the TEMPLATEPATH and STYLESHEETPATH constants are defined - WP_CLI::add_wp_hook( - 'after_setup_theme', - function() use ( $hooks, $wp_cli_filter_active_theme ) { - foreach ( $hooks as $hook ) { - remove_filter( $hook, $wp_cli_filter_active_theme, 999 ); - } - }, - 0 - ); - } - - /** - * Whether or not this WordPress install is multisite. - * - * For use after wp-config.php has loaded, but before the rest of WordPress - * is loaded. - */ - private function is_multisite() { - if ( defined( 'MULTISITE' ) ) { - return MULTISITE; - } - - if ( defined( 'SUBDOMAIN_INSTALL' ) || defined( 'VHOST' ) || defined( 'SUNRISE' ) ) { - return true; - } - - return false; - } - - /** - * Error handler for `wp_die()` when the command is help to try to trap errors (db connection failure in particular) during WordPress load. - */ - public function help_wp_die_handler( $message ) { - $help_exit_warning = 'Error during WordPress load.'; - if ( $message instanceof \WP_Error ) { - $help_exit_warning = WP_CLI\Utils\wp_clean_error_message( $message->get_error_message() ); - } elseif ( is_string( $message ) ) { - $help_exit_warning = WP_CLI\Utils\wp_clean_error_message( $message ); - } - $this->_run_command_and_exit( $help_exit_warning ); - } - - /** - * Check whether there's a WP-CLI update available, and suggest update if so. - */ - private function auto_check_update() { - - // `wp cli update` only works with Phars at this time. - if ( ! Utils\inside_phar() ) { - return; - } - - $existing_phar = realpath( $_SERVER['argv'][0] ); - // Phar needs to be writable to be easily updateable. - if ( ! is_writable( $existing_phar ) || ! is_writable( dirname( $existing_phar ) ) ) { - return; - } - - // Only check for update when a human is operating. - if ( ! function_exists( 'posix_isatty' ) || ! posix_isatty( STDOUT ) ) { - return; - } - - // Allow hosts and other providers to disable automatic check update. - if ( getenv( 'WP_CLI_DISABLE_AUTO_CHECK_UPDATE' ) ) { - return; - } - - // Permit configuration of number of days between checks. - $days_between_checks = getenv( 'WP_CLI_AUTO_CHECK_UPDATE_DAYS' ); - if ( false === $days_between_checks ) { - $days_between_checks = 1; - } - - $cache = WP_CLI::get_cache(); - $cache_key = 'wp-cli-update-check'; - // Bail early on the first check, so we don't always check on an unwritable cache. - if ( ! $cache->has( $cache_key ) ) { - $cache->write( $cache_key, time() ); - return; - } - - // Bail if last check is still within our update check time period. - $last_check = (int) $cache->read( $cache_key ); - if ( time() - ( 24 * 60 * 60 * $days_between_checks ) < $last_check ) { - return; - } - - // In case the operation fails, ensure the timestamp has been updated. - $cache->write( $cache_key, time() ); - - // Check whether any updates are available. - ob_start(); - WP_CLI::run_command( - array( 'cli', 'check-update' ), - array( - 'format' => 'count', - ) - ); - $count = ob_get_clean(); - if ( ! $count ) { - return; - } - - // Looks like an update is available, so let's prompt to update. - WP_CLI::run_command( array( 'cli', 'update' ) ); - // If the Phar was replaced, we can't proceed with the original process. - exit; - } - - /** - * Get a suggestion on similar (sub)commands when the user entered an - * unknown (sub)command. - * - * @param string $entry User entry that didn't match an - * existing command. - * @param CompositeCommand $root_command Root command to start search for - * suggestions at. - * - * @return string Suggestion that fits the user entry, or an empty string. - */ - private function get_subcommand_suggestion( $entry, CompositeCommand $root_command = null ) { - $commands = array(); - $this->enumerate_commands( $root_command ?: \WP_CLI::get_root_command(), $commands ); - - return Utils\get_suggestion( $entry, $commands, $threshold = 2 ); - } - - /** - * Recursive method to enumerate all known commands. - * - * @param CompositeCommand $command Composite command to recurse over. - * @param array $list Reference to list accumulating results. - * @param string $parent Parent command to use as prefix. - */ - private function enumerate_commands( CompositeCommand $command, array &$list, $parent = '' ) { - foreach ( $command->get_subcommands() as $subcommand ) { - /** @var CompositeCommand $subcommand */ - $command_string = empty( $parent ) - ? $subcommand->get_name() - : "{$parent} {$subcommand->get_name()}"; - - $list[] = $command_string; - - $this->enumerate_commands( $subcommand, $list, $command_string ); - } - } - - /** - * Enables (almost) full PHP error reporting to stderr. - */ - private function enable_error_reporting() { - if ( E_ALL !== error_reporting() ) { - // Don't enable E_DEPRECATED as old versions of WP use PHP 4 style constructors and the mysql extension. - error_reporting( E_ALL & ~E_DEPRECATED ); - } - ini_set( 'display_errors', 'stderr' ); - } -} diff --git a/php/WP_CLI/UpgraderSkin.php b/php/WP_CLI/UpgraderSkin.php deleted file mode 100644 index f9e0deaa0..000000000 --- a/php/WP_CLI/UpgraderSkin.php +++ /dev/null @@ -1,60 +0,0 @@ -upgrader->strings[ $error ] ) ) { - $error = $this->upgrader->strings[ $error ]; - } - - // TODO: show all errors, not just the first one - \WP_CLI::warning( $error ); - } - - public function feedback( $string ) { - - if ( 'parent_theme_prepare_install' === $string ) { - \WP_CLI::get_http_cache_manager()->whitelist_package( $this->api->download_link, 'theme', $this->api->slug, $this->api->version ); - } - - if ( isset( $this->upgrader->strings[ $string ] ) ) { - $string = $this->upgrader->strings[ $string ]; - } - - if ( strpos( $string, '%' ) !== false ) { - $args = func_get_args(); - $args = array_splice( $args, 1 ); - if ( ! empty( $args ) ) { - $string = vsprintf( $string, $args ); - } - } - - if ( empty( $string ) ) { - return; - } - - $string = str_replace( '…', '...', strip_tags( $string ) ); - $string = html_entity_decode( $string, ENT_QUOTES, get_bloginfo( 'charset' ) ); - - \WP_CLI::log( $string ); - } -} - diff --git a/php/WP_CLI/WpHttpCacheManager.php b/php/WP_CLI/WpHttpCacheManager.php deleted file mode 100644 index 4fff0aa86..000000000 --- a/php/WP_CLI/WpHttpCacheManager.php +++ /dev/null @@ -1,132 +0,0 @@ -cache = $cache; - - // hook into wp http api - add_filter( 'pre_http_request', array( $this, 'filter_pre_http_request' ), 10, 3 ); - add_filter( 'http_response', array( $this, 'filter_http_response' ), 10, 3 ); - } - - /** - * short circuit wp http api with cached file - */ - public function filter_pre_http_request( $response, $args, $url ) { - // check if whitelisted - if ( ! isset( $this->whitelist[ $url ] ) ) { - return $response; - } - // check if downloading - if ( 'GET' !== $args['method'] || empty( $args['filename'] ) ) { - return $response; - } - // check cache and export to designated location - $filename = $this->cache->has( $this->whitelist[ $url ]['key'], $this->whitelist[ $url ]['ttl'] ); - if ( $filename ) { - WP_CLI::log( sprintf( 'Using cached file \'%s\'...', $filename ) ); - if ( copy( $filename, $args['filename'] ) ) { - // simulate successful download response - return array( - 'response' => array( - 'code' => 200, - 'message' => 'OK', - ), - 'filename' => $args['filename'], - ); - } - - WP_CLI::error( sprintf( 'Error copying cached file %s to %s', $filename, $url ) ); - } - return $response; - } - - - /** - * cache wp http api downloads - * - * @param array $response - * @param array $args - * @param string $url - */ - public function filter_http_response( $response, $args, $url ) { - // check if whitelisted - if ( ! isset( $this->whitelist[ $url ] ) ) { - return $response; - } - // check if downloading - if ( 'GET' !== $args['method'] || empty( $args['filename'] ) ) { - return $response; - } - // check if download was successful - if ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) { - return $response; - } - // cache downloaded file - $this->cache->import( $this->whitelist[ $url ]['key'], $response['filename'] ); - return $response; - } - - /** - * whitelist a package url - * - * @param string $url - * @param string $group package group (themes, plugins, ...) - * @param string $slug package slug - * @param string $version package version - * @param int $ttl - */ - public function whitelist_package( $url, $group, $slug, $version, $ttl = null ) { - $ext = pathinfo( parse_url( $url, PHP_URL_PATH ), PATHINFO_EXTENSION ); - $key = "$group/$slug-$version.$ext"; - $this->whitelist_url( $url, $key, $ttl ); - wp_update_plugins(); - } - - /** - * whitelist a url - * - * @param string $url - * @param string $key - * @param int $ttl - */ - public function whitelist_url( $url, $key = null, $ttl = null ) { - $key = $key ? : $url; - $this->whitelist[ $url ] = compact( 'key', 'ttl' ); - } - - /** - * check if url is whitelisted - * - * @param string $url - * @return bool - */ - public function is_whitelisted( $url ) { - return isset( $this->whitelist[ $url ] ); - } - -} diff --git a/php/boot-fs.php b/php/boot-fs.php index f1cfc5900..9f001103e 100644 --- a/php/boot-fs.php +++ b/php/boot-fs.php @@ -8,11 +8,11 @@ } if ( version_compare( PHP_VERSION, '5.3.0', '<' ) ) { - printf( "Error: WP-CLI requires PHP %s or newer. You are running version %s.\n", '5.3.0', PHP_VERSION ); + printf( "Error: EE requires PHP %s or newer. You are running version %s.\n", '5.3.0', PHP_VERSION ); die( -1 ); } -define( 'WP_CLI_ROOT', dirname( __DIR__ ) ); +define( 'EE_ROOT', dirname( __DIR__ ) ); -include_once WP_CLI_ROOT . '/php/wp-cli.php'; +include_once EE_ROOT . '/php/ee.php'; diff --git a/php/boot-phar.php b/php/boot-phar.php index 946e8369e..97ad6239c 100644 --- a/php/boot-phar.php +++ b/php/boot-phar.php @@ -1,15 +1,15 @@ add_namespace( - 'WP_CLI\Bootstrap', - WP_CLI_ROOT . '/php/WP_CLI/Bootstrap' + 'EE\Bootstrap', + EE_ROOT . '/php/EE/Bootstrap' )->register(); } @@ -70,7 +70,7 @@ function bootstrap() { $state = initialize_bootstrap_state(); foreach ( get_bootstrap_steps() as $step ) { - /** @var \WP_CLI\Bootstrap\BootstrapStep $step_instance */ + /** @var \EE\Bootstrap\BootstrapStep $step_instance */ $step_instance = new $step(); $state = $step_instance->process( $state ); } diff --git a/php/class-ee-command.php b/php/class-ee-command.php new file mode 100644 index 000000000..484906e3b --- /dev/null +++ b/php/class-ee-command.php @@ -0,0 +1,12 @@ +` - Before the command is added. * * `after_add_command:` - After the command was added. * * `before_invoke:` - Just before a command is invoked. * * `after_invoke:` - Just after a command is invoked. - * * `find_command_to_run_pre` - Just before WP-CLI finds the command to run. - * * `before_wp_load` - Just before the WP load process begins. - * * `before_wp_config_load` - After wp-config.php has been located. - * * `after_wp_config_load` - After wp-config.php has been loaded into scope. - * * `after_wp_load` - Just after the WP load process has completed. + * * `find_command_to_run_pre` - Just before EE finds the command to run. * - * WP-CLI commands can create their own hooks with `WP_CLI::do_hook()`. + * EE commands can create their own hooks with `EE::do_hook()`. * - * If additional arguments are passed through the `WP_CLI::do_hook()` call, - * these will be passed on to the callback provided by `WP_CLI::add_hook()`. + * If additional arguments are passed through the `EE::do_hook()` call, + * these will be passed on to the callback provided by `EE::add_hook()`. * - * ``` - * # `wp network meta` confirms command is executing in multisite context. - * WP_CLI::add_command( 'network meta', 'Network_Meta_Command', array( - * 'before_invoke' => function () { - * if ( !is_multisite() ) { - * WP_CLI::error( 'This is not a multisite install.' ); - * } - * } - * ) ); - * ``` * * @access public * @category Registration @@ -247,7 +187,7 @@ public static function add_hook( $when, $callback ) { /** * Execute callbacks registered to a given hook. * - * See `WP_CLI::add_hook()` for details on WP-CLI's internal hook system. + * See `EE::add_hook()` for details on EE's internal hook system. * Commands can provide and call their own hooks. * * @access public @@ -255,7 +195,7 @@ public static function add_hook( $when, $callback ) { * * @param string $when Identifier for the hook. * @param mixed ... Optional. Arguments that will be passed onto the - * callback provided by `WP_CLI::add_hook()`. + * callback provided by `EE::add_hook()`. * @return null */ public static function do_hook( $when ) { @@ -275,90 +215,10 @@ public static function do_hook( $when ) { } /** - * Add a callback to a WordPress action or filter. - * - * `add_action()` without needing access to `add_action()`. If WordPress is - * already loaded though, you should use `add_action()` (and `add_filter()`) - * instead. - * - * @access public - * @category Registration - * - * @param string $tag Named WordPress action or filter. - * @param mixed $function_to_add Callable to execute when the action or filter is evaluated. - * @param integer $priority Priority to add the callback as. - * @param integer $accepted_args Number of arguments to pass to callback. - * @return true - */ - public static function add_wp_hook( $tag, $function_to_add, $priority = 10, $accepted_args = 1 ) { - global $wp_filter, $merged_filters; - - if ( function_exists( 'add_filter' ) ) { - add_filter( $tag, $function_to_add, $priority, $accepted_args ); - } else { - $idx = self::wp_hook_build_unique_id( $tag, $function_to_add, $priority ); - $wp_filter[ $tag ][ $priority ][ $idx ] = array( - 'function' => $function_to_add, - 'accepted_args' => $accepted_args, - ); - unset( $merged_filters[ $tag ] ); - } - - return true; - } - - /** - * Build Unique ID for storage and retrieval. - * - * Essentially _wp_filter_build_unique_id() without needing access to _wp_filter_build_unique_id() - */ - private static function wp_hook_build_unique_id( $tag, $function, $priority ) { - global $wp_filter; - static $filter_id_count = 0; - - if ( is_string( $function ) ) { - return $function; - } - - if ( is_object( $function ) ) { - // Closures are currently implemented as objects - $function = array( $function, '' ); - } else { - $function = (array) $function; - } - - if ( is_object( $function[0] ) ) { - // Object Class Calling - if ( function_exists( 'spl_object_hash' ) ) { - return spl_object_hash( $function[0] ) . $function[1]; - } - - $obj_idx = get_class( $function[0] ) . $function[1]; - if ( ! isset( $function[0]->wp_filter_id ) ) { - if ( false === $priority ) { - return false; - } - $obj_idx .= isset( $wp_filter[ $tag ][ $priority ] ) ? count( (array) $wp_filter[ $tag ][ $priority ] ) : $filter_id_count; - $function[0]->wp_filter_id = $filter_id_count; - ++$filter_id_count; - } else { - $obj_idx .= $function[0]->wp_filter_id; - } - - return $obj_idx; - } - - if ( is_string( $function[0] ) ) { - // Static Calling - return $function[0] . '::' . $function[1]; - } - } - - /** - * Register a command to WP-CLI. + * Register a command to EE. * - * WP-CLI supports using any callable class, function, or closure as a - * command. `WP_CLI::add_command()` is used for both internal and + * EE supports using any callable class, function, or closure as a + * command. `EE::add_command()` is used for both internal and * third-party command registration. * * Command arguments are parsed from PHPDoc by default, but also can be @@ -367,7 +227,7 @@ private static function wp_hook_build_unique_id( $tag, $function, $priority ) { * ``` * # Register a custom 'foo' command to output a supplied positional param. * # - * # $ wp foo bar --append=qux + * # $ ee foo bar --append=qux * # Success: bar qux * * /** @@ -378,13 +238,11 @@ private static function wp_hook_build_unique_id( $tag, $function, $priority ) { * * * * --append= * * : An awesome message to append to the original message. - * * - * * @when before_wp_load * *\/ * $foo = function( $args, $assoc_args ) { - * WP_CLI::success( $args[0] . ' ' . $assoc_args['append'] ); + * EE::success( $args[0] . ' ' . $assoc_args['append'] ); * }; - * WP_CLI::add_command( 'foo', $foo ); + * EE::add_command( 'foo', $foo ); * ``` * * @access public @@ -400,14 +258,14 @@ private static function wp_hook_build_unique_id( $tag, $function, $priority ) { * @type string $shortdesc Short description (80 char or less) for the command. * @type string $longdesc Description of arbitrary length for examples, etc. * @type string $synopsis The synopsis for the command (string or array). - * @type string $when Execute callback on a named WP-CLI hook (e.g. before_wp_load). + * @type string $when Execute callback on a named EE hook. * @type bool $is_deferred Whether the command addition had already been deferred. * } * @return true True on success, false if deferred, hard error if registration failed. */ public static function add_command( $name, $callable, $args = array() ) { - // Bail immediately if the WP-CLI executable has not been run. - if ( ! defined( 'WP_CLI' ) ) { + // Bail immediately if the EE executable has not been run. + if ( ! defined( 'EE' ) ) { return false; } @@ -424,14 +282,14 @@ public static function add_command( $name, $callable, $args = array() ) { $callable[0] = is_object( $callable[0] ) ? get_class( $callable[0] ) : $callable[0]; $callable = array( $callable[0], $callable[1] ); } - WP_CLI::error( sprintf( 'Callable %s does not exist, and cannot be registered as `wp %s`.', json_encode( $callable ), $name ) ); + EE::error( sprintf( 'Callable %s does not exist, and cannot be registered as `ee %s`.', json_encode( $callable ), $name ) ); } $addition = new Dispatcher\CommandAddition(); self::do_hook( "before_add_command:{$name}", $addition ); if ( $addition->was_aborted() ) { - WP_CLI::warning( "Aborting the addition of the command '{$name}' with reason: {$addition->get_reason()}." ); + EE::warning( "Aborting the addition of the command '{$name}' with reason: {$addition->get_reason()}." ); return false; } @@ -460,7 +318,7 @@ public static function add_command( $name, $callable, $args = array() ) { $subcommand = new Dispatcher\CompositeCommand( $command, $subcommand_name, - new \WP_CLI\DocParser( '' ) + new \EE\DocParser( '' ) ); $command->add_subcommand( $subcommand_name, $subcommand ); } else { @@ -505,7 +363,7 @@ public static function add_command( $name, $callable, $args = array() ) { if ( is_string( $args['synopsis'] ) ) { $leaf_command->set_synopsis( $args['synopsis'] ); } elseif ( is_array( $args['synopsis'] ) ) { - $synopsis = \WP_CLI\SynopsisParser::render( $args['synopsis'] ); + $synopsis = \EE\SynopsisParser::render( $args['synopsis'] ); $leaf_command->set_synopsis( $synopsis ); $long_desc = ''; $bits = explode( ' ', $synopsis ); @@ -554,7 +412,7 @@ public static function add_command( $name, $callable, $args = array() ) { * @param string $name Name for the sub-command. * @param string $parent Name for the parent command. * @param string $callable Command implementation as a class, function or closure. - * @param array $args Optional. See `WP_CLI::add_command()` for details. + * @param array $args Optional. See `EE::add_command()` for details. */ private static function defer_command_addition( $name, $parent, $callable, $args = array() ) { $args['is_deferred'] = true; @@ -566,7 +424,7 @@ private static function defer_command_addition( $name, $parent, $callable, $args self::add_hook( "after_add_command:$parent", function () use ( $name ) { - $deferred_additions = WP_CLI::get_deferred_additions(); + $deferred_additions = EE::get_deferred_additions(); if ( ! array_key_exists( $name, $deferred_additions ) ) { return; @@ -574,9 +432,9 @@ function () use ( $name ) { $callable = $deferred_additions[ $name ]['callable']; $args = $deferred_additions[ $name ]['args']; - WP_CLI::remove_deferred_addition( $name ); + EE::remove_deferred_addition( $name ); - WP_CLI::add_command( $name, $callable, $args ); + EE::add_command( $name, $callable, $args ); } ); } @@ -595,7 +453,7 @@ public static function get_deferred_additions() { */ public static function remove_deferred_addition( $name ) { if ( ! array_key_exists( $name, self::$deferred_additions ) ) { - WP_CLI::warning( "Trying to remove a non-existent command addition '{$name}'." ); + EE::warning( "Trying to remove a non-existent command addition '{$name}'." ); } unset( self::$deferred_additions[ $name ] ); @@ -604,8 +462,8 @@ public static function remove_deferred_addition( $name ) { /** * Display informational message without prefix, and ignore `--quiet`. * - * Message is written to STDOUT. `WP_CLI::log()` is typically recommended; - * `WP_CLI::line()` is included for historical compat. + * Message is written to STDOUT. `EE::log()` is typically recommended; + * `EE::line()` is included for historical compat. * * @access public * @category Output @@ -623,8 +481,8 @@ public static function line( $message = '' ) { * Message is written to STDOUT, or discarded when `--quiet` flag is supplied. * * ``` - * # `wp cli update` lets user know of each step in the update process. - * WP_CLI::log( sprintf( 'Downloading from %s...', $download_url ) ); + * # `ee cli update` lets user know of each step in the update process. + * EE::log( sprintf( 'Downloading from %s...', $download_url ) ); * ``` * * @access public @@ -643,16 +501,6 @@ public static function log( $message ) { * * Typically recommended to inform user of successful script conclusion. * - * ``` - * # wp rewrite flush expects 'rewrite_rules' option to be set after flush. - * flush_rewrite_rules( \WP_CLI\Utils\get_flag_value( $assoc_args, 'hard' ) ); - * if ( ! get_option( 'rewrite_rules' ) ) { - * WP_CLI::warning( "Rewrite rules are empty." ); - * } else { - * WP_CLI::success( 'Rewrite rules flushed.' ); - * } - * ``` - * * @access public * @category Output * @@ -669,21 +517,7 @@ public static function success( $message ) { * Debug message is written to STDERR, and includes script execution time. * * Helpful for optionally showing greater detail when needed. Used throughout - * WP-CLI bootstrap process for easier debugging and profiling. - * - * ``` - * # Called in `WP_CLI\Runner::set_wp_root()`. - * private static function set_wp_root( $path ) { - * define( 'ABSPATH', Utils\trailingslashit( $path ) ); - * WP_CLI::debug( 'ABSPATH defined: ' . ABSPATH ); - * $_SERVER['DOCUMENT_ROOT'] = realpath( $path ); - * } - * - * # Debug details only appear when `--debug` is used. - * # $ wp --debug - * # [...] - * # Debug: ABSPATH defined: /srv/www/wordpress-develop.dev/src/ (0.225s) - * ``` + * EE bootstrap process for easier debugging and profiling. * * @access public * @category Output @@ -701,19 +535,9 @@ public static function debug( $message, $group = false ) { * * Warning message is written to STDERR. * - * Use instead of `WP_CLI::debug()` when script execution should be permitted + * Use instead of `EE::debug()` when script execution should be permitted * to continue. * - * ``` - * # `wp plugin activate` skips activation when plugin is network active. - * $status = $this->get_status( $plugin->file ); - * // Network-active is the highest level of activation status - * if ( 'active-network' === $status ) { - * WP_CLI::warning( "Plugin '{$plugin->name}' is already network active." ); - * continue; - * } - * ``` - * * @access public * @category Output * @@ -730,20 +554,13 @@ public static function warning( $message ) { * Error message is written to STDERR. Defaults to halting script execution * with return code 1. * - * Use `WP_CLI::warning()` instead when script execution should be permitted + * Use `EE::warning()` instead when script execution should be permitted * to continue. * - * ``` - * # `wp cache flush` considers flush failure to be a fatal error. - * if ( false === wp_cache_flush() ) { - * WP_CLI::error( 'The object cache could not be flushed.' ); - * } - * ``` - * * @access public * @category Output * - * @param string|WP_Error $message Message to write to STDERR. + * @param string|EE_Error $message Message to write to STDERR. * @param boolean|integer $exit True defaults to exit(1). * @return null */ @@ -770,7 +587,7 @@ public static function error( $message, $exit = true ) { /** * Halt script execution with a specific return code. * - * Permits script execution to be overloaded by `WP_CLI::runcommand()` + * Permits script execution to be overloaded by `EE::runcommand()` * * @access public * @category Output @@ -806,12 +623,6 @@ public static function error_multi_line( $message_lines ) { * If 'y' is provided to the question, the script execution continues. If * 'n' or any other response is provided to the question, script exits. * - * ``` - * # `wp db drop` asks for confirmation before dropping the database. - * - * WP_CLI::confirm( "Are you sure you want to drop the database?", $assoc_args ); - * ``` - * * @access public * @category Input * @@ -819,7 +630,7 @@ public static function error_multi_line( $message_lines ) { * @param array $assoc_args Skips prompt if 'yes' is provided. */ public static function confirm( $question, $assoc_args = array() ) { - if ( ! \WP_CLI\Utils\get_flag_value( $assoc_args, 'yes' ) ) { + if ( ! \EE\Utils\get_flag_value( $assoc_args, 'yes' ) ) { fwrite( STDOUT, $question . ' [y/n] ' ); $answer = strtolower( trim( fgets( STDIN ) ) ); @@ -863,10 +674,10 @@ public static function get_value_from_arg_or_stdin( $args, $index ) { * @param array $assoc_args */ public static function read_value( $raw_value, $assoc_args = array() ) { - if ( \WP_CLI\Utils\get_flag_value( $assoc_args, 'format' ) === 'json' ) { + if ( \EE\Utils\get_flag_value( $assoc_args, 'format' ) === 'json' ) { $value = json_decode( $raw_value, true ); if ( null === $value ) { - WP_CLI::error( sprintf( 'Invalid JSON: %s', $raw_value ) ); + EE::error( sprintf( 'Invalid JSON: %s', $raw_value ) ); } } else { $value = $raw_value; @@ -882,9 +693,9 @@ public static function read_value( $raw_value, $assoc_args = array() ) { * @param array $assoc_args Arguments passed to the command, determining format. */ public static function print_value( $value, $assoc_args = array() ) { - if ( \WP_CLI\Utils\get_flag_value( $assoc_args, 'format' ) === 'json' ) { + if ( \EE\Utils\get_flag_value( $assoc_args, 'format' ) === 'json' ) { $value = json_encode( $value ); - } elseif ( \WP_CLI\Utils\get_flag_value( $assoc_args, 'format' ) === 'yaml' ) { + } elseif ( \EE\Utils\get_flag_value( $assoc_args, 'format' ) === 'yaml' ) { $value = Spyc::YAMLDump( $value, 2, 0 ); } elseif ( is_array( $value ) || is_object( $value ) ) { $value = var_export( $value ); @@ -894,7 +705,7 @@ public static function print_value( $value, $assoc_args = array() ) { } /** - * Convert a wp_error into a string + * Convert a EE_error into a string * * @param mixed $errors * @return string @@ -913,7 +724,7 @@ public static function error_to_string( $errors ) { return '"' . $data . '"'; }; - if ( is_object( $errors ) && is_a( $errors, 'WP_Error' ) ) { + if ( is_object( $errors ) && is_a( $errors, 'EE_Error' ) ) { foreach ( $errors->get_error_messages() as $message ) { if ( $errors->get_error_data() ) { return $message . ' ' . $render_data( $errors->get_error_data() ); @@ -927,15 +738,6 @@ public static function error_to_string( $errors ) { /** * Launch an arbitrary external process that takes over I/O. * - * ``` - * # `wp core download` falls back to the `tar` binary when PharData isn't available - * if ( ! class_exists( 'PharData' ) ) { - * $cmd = "tar xz --strip-components=1 --directory=%s -f $tarball"; - * WP_CLI::launch( Utils\esc_cmd( $cmd, $dest ) ); - * return; - * } - * ``` - * * @access public * @category Execution * @@ -966,19 +768,19 @@ public static function launch( $command, $exit_on_error = true, $return_detailed } /** - * Run a WP-CLI command in a new process reusing the current runtime arguments. + * Run a EE command in a new process reusing the current runtime arguments. * - * Use `WP_CLI::runcommand()` instead, which is easier to use and works better. + * Use `EE::runcommand()` instead, which is easier to use and works better. * * Note: While this command does persist a limited set of runtime arguments, - * it *does not* persist environment variables. Practically speaking, WP-CLI - * packages won't be loaded when using WP_CLI::launch_self() because the + * it *does not* persist environment variables. Practically speaking, EE + * packages won't be loaded when using EE::launch_self() because the * launched process doesn't have access to the current process $HOME. * * @access public * @category Execution * - * @param string $command WP-CLI command to call. + * @param string $command EE command to call. * @param array $args Positional arguments to include when calling the command. * @param array $assoc_args Associative arguments to include when calling the command. * @param bool $exit_on_error Whether to exit if the command returns an elevated return code. @@ -1006,23 +808,23 @@ public static function launch_self( $command, $args = array(), $assoc_args = arr $script_path = $GLOBALS['argv'][0]; - if ( getenv( 'WP_CLI_CONFIG_PATH' ) ) { - $config_path = getenv( 'WP_CLI_CONFIG_PATH' ); + if ( getenv( 'EE_CONFIG_PATH' ) ) { + $config_path = getenv( 'EE_CONFIG_PATH' ); } else { - $config_path = Utils\get_home_dir() . '/.wp-cli/config.yml'; + $config_path = Utils\get_home_dir() . '/.ee4/config.yml'; } $config_path = escapeshellarg( $config_path ); $args = implode( ' ', array_map( 'escapeshellarg', $args ) ); - $assoc_args = \WP_CLI\Utils\assoc_args_to_str( $assoc_args ); + $assoc_args = \EE\Utils\assoc_args_to_str( $assoc_args ); - $full_command = "WP_CLI_CONFIG_PATH={$config_path} {$php_bin} {$script_path} {$command} {$args} {$assoc_args}"; + $full_command = "EE_CONFIG_PATH={$config_path} {$php_bin} {$script_path} {$command} {$args} {$assoc_args}"; return self::launch( $full_command, $exit_on_error, $return_detailed ); } /** - * Get the path to the PHP binary used when executing WP-CLI. + * Get the path to the PHP binary used when executing EE. * * Environment values permit specific binaries to be indicated. * @@ -1041,10 +843,10 @@ public static function get_php_binary() { * Get values of global configuration parameters. * * Provides access to `--path=`, `--url=`, and other values of - * the [global configuration parameters](https://wp-cli.org/config/). + * the [global configuration parameters](https://ee.org/config/). * * ``` - * WP_CLI::log( 'The --url= value is: ' . WP_CLI::get_config( 'url' ) ); + * EE::log( 'The --url= value is: ' . EE::get_config( 'url' ) ); * ``` * * @access public @@ -1067,9 +869,9 @@ public static function get_config( $key = null ) { } /** - * Run a WP-CLI command. + * Run a EE command. * - * Launches a new child process to run a specified WP-CLI command. + * Launches a new child process to run a specified EE command. * Optionally: * * * Run the command in an existing process. @@ -1084,13 +886,13 @@ public static function get_config( $key = null ) { * 'launch' => false, // Reuse the current process. * 'exit_error' => true, // Halt script execution on error. * ); - * $plugins = WP_CLI::runcommand( 'plugin list --format=json', $options ); + * $plugins = EE::runcommand( 'plugin list --format=json', $options ); * ``` * * @access public * @category Execution * - * @param string $command WP-CLI command to run, including arguments. + * @param string $command EE command to run, including arguments. * @param array $options Configuration options for command execution. * @return mixed */ @@ -1128,7 +930,7 @@ public static function runcommand( $command, $options = array() ) { $script_path = $GLOBALS['argv'][0]; // Persist runtime arguments unless they've been specified otherwise. - $configurator = \WP_CLI::get_configurator(); + $configurator = \EE::get_configurator(); $argv = array_slice( $GLOBALS['argv'], 1 ); list( $_, $_, $runtime_config ) = $configurator->parse_args( $argv ); foreach ( $runtime_config as $k => $v ) { @@ -1173,7 +975,7 @@ public static function runcommand( $command, $options = array() ) { list( $args, $assoc_args, $runtime_config ) = $configurator->parse_args( $argv ); if ( $return ) { $existing_logger = self::$logger; - self::$logger = new WP_CLI\Loggers\Execution; + self::$logger = new EE\Loggers\Execution; self::$logger->ob_start(); } if ( ! $exit_error ) { @@ -1224,15 +1026,15 @@ public static function runcommand( $command, $options = array() ) { * Run a given command within the current process using the same global * parameters. * - * Use `WP_CLI::runcommand()` instead, which is easier to use and works better. + * Use `EE::runcommand()` instead, which is easier to use and works better. * * To run a command using a new process with the same global parameters, - * use WP_CLI::launch_self(). To run a command using a new process with - * different global parameters, use WP_CLI::launch(). + * use EE::launch_self(). To run a command using a new process with + * different global parameters, use EE::launch(). * * ``` * ob_start(); - * WP_CLI::run_command( array( 'cli', 'cmd-dump' ) ); + * EE::run_command( array( 'cli', 'cmd-dump' ) ); * $ret = ob_get_clean(); * ``` * @@ -1245,29 +1047,4 @@ public static function runcommand( $command, $options = array() ) { public static function run_command( $args, $assoc_args = array() ) { self::get_runner()->run_command( $args, $assoc_args ); } - - - - // DEPRECATED STUFF - - public static function add_man_dir() { - trigger_error( 'WP_CLI::add_man_dir() is deprecated. Add docs inline.', E_USER_WARNING ); - } - - // back-compat - public static function out( $str ) { - fwrite( STDOUT, $str ); - } - - // back-compat - // @codingStandardsIgnoreLine - public static function addCommand( $name, $class ) { - trigger_error( - sprintf( - 'wp %s: %s is deprecated. use WP_CLI::add_command() instead.', - $name, __FUNCTION__ - ), E_USER_WARNING - ); - self::add_command( $name, $class ); - } } diff --git a/php/class-wp-cli-command.php b/php/class-wp-cli-command.php deleted file mode 100644 index 0cccc51a4..000000000 --- a/php/class-wp-cli-command.php +++ /dev/null @@ -1,12 +0,0 @@ -find_command_to_run( $args ); + $r = EE::get_runner()->find_command_to_run( $args ); if ( is_array( $r ) ) { list( $command ) = $r; @@ -88,7 +88,7 @@ function ( $matches ) use ( $wordwrap_width, $tab ) { } // section headers - $out = preg_replace( '/^## ([A-Z ]+)/m', WP_CLI::colorize( '%9\1%n' ), $out ); + $out = preg_replace( '/^## ([A-Z ]+)/m', EE::colorize( '%9\1%n' ), $out ); self::pass_through_pager( $out ); } @@ -110,7 +110,7 @@ private static function indent( $whitespace, $text ) { private static function pass_through_pager( $out ) { if ( ! Utils\check_proc_available( null /*context*/, true /*return*/ ) ) { - WP_CLI::debug( 'Warning: check_proc_available() failed in pass_through_pager().', 'help' ); + EE::debug( 'Warning: check_proc_available() failed in pass_through_pager().', 'help' ); return $out; } @@ -121,7 +121,7 @@ private static function pass_through_pager( $out ) { // For Windows 7 need to set code page to something other than Unicode (65001) to get around "Not enough memory." error with `more.com` on PHP 7.1+. if ( 'more' === $pager && defined( 'PHP_WINDOWS_VERSION_MAJOR' ) && PHP_WINDOWS_VERSION_MAJOR < 10 && function_exists( 'sapi_windows_cp_set' ) ) { // Note will also apply to Windows 8 (see http://msdn.microsoft.com/en-us/library/windows/desktop/ms724832.aspx) but probably harmless anyway. - $cp = getenv( 'WP_CLI_WINDOWS_CODE_PAGE' ) ?: 1252; // Code page 1252 is the most used so probably the most compat. + $cp = getenv( 'EE_WINDOWS_CODE_PAGE' ) ?: 1252; // Code page 1252 is the most used so probably the most compat. sapi_windows_cp_set( $cp ); // `sapi_windows_cp_set()` introduced PHP 7.1. } @@ -165,7 +165,7 @@ private static function render_subcommands( $command ) { $subcommands = array(); foreach ( $command->get_subcommands() as $subcommand ) { - if ( WP_CLI::get_runner()->is_command_disabled( $subcommand ) ) { + if ( EE::get_runner()->is_command_disabled( $subcommand ) ) { continue; } @@ -236,5 +236,5 @@ private static function parse_reference_links( $longdesc ) { } } -WP_CLI::add_command( 'help', 'Help_Command' ); +EE::add_command( 'help', 'Help_Command' ); diff --git a/php/commands/src/CLI_Command.php b/php/commands/src/CLI_Command.php index fa2474fd7..12369eac1 100644 --- a/php/commands/src/CLI_Command.php +++ b/php/commands/src/CLI_Command.php @@ -1,31 +1,29 @@ get_packages_dir_path(); if ( ! is_dir( $packages_dir ) ) { $packages_dir = null; } - if ( \WP_CLI\Utils\get_flag_value( $assoc_args, 'format' ) === 'json' ) { + if ( \EE\Utils\get_flag_value( $assoc_args, 'format' ) === 'json' ) { $info = array( 'php_binary_path' => $php_bin, 'global_config_path' => $runner->global_config_path, 'project_config_path' => $runner->project_config_path, - 'wp_cli_dir_path' => WP_CLI_ROOT, - 'wp_cli_packages_dir_path' => $packages_dir, - 'wp_cli_version' => WP_CLI_VERSION, + 'ee_dir_path' => EE_ROOT, + 'ee_packages_dir_path' => $packages_dir, + 'ee_version' => EE_VERSION, 'system_os' => $system_os, 'shell' => $shell, ); - WP_CLI::line( json_encode( $info ) ); + EE::line( json_encode( $info ) ); } else { - WP_CLI::line( "OS:\t" . $system_os ); - WP_CLI::line( "Shell:\t" . $shell ); - WP_CLI::line( "PHP binary:\t" . $php_bin ); - WP_CLI::line( "PHP version:\t" . PHP_VERSION ); - WP_CLI::line( "php.ini used:\t" . get_cfg_var( 'cfg_file_path' ) ); - WP_CLI::line( "WP-CLI root dir:\t" . WP_CLI_ROOT ); - WP_CLI::line( "WP-CLI vendor dir:\t" . WP_CLI_VENDOR_DIR ); - WP_CLI::line( "WP_CLI phar path:\t" . ( defined( 'WP_CLI_PHAR_PATH' ) ? WP_CLI_PHAR_PATH : '' ) ); - WP_CLI::line( "WP-CLI packages dir:\t" . $packages_dir ); - WP_CLI::line( "WP-CLI global config:\t" . $runner->global_config_path ); - WP_CLI::line( "WP-CLI project config:\t" . $runner->project_config_path ); - WP_CLI::line( "WP-CLI version:\t" . WP_CLI_VERSION ); + + $info = array( + array( 'OS', $system_os ), + array( 'Shell', $shell ), + array( 'PHP binary', $php_bin ), + array( 'PHP version', PHP_VERSION ), + array( 'php.ini used', get_cfg_var( 'cfg_file_path' ) ), + array( 'EE root dir', EE_ROOT ), + array( 'EE vendor dir', EE_VENDOR_DIR ), + array( 'EE phar path', ( defined( 'EE_PHAR_PATH' ) ? EE_PHAR_PATH : '' ) ), + array( 'EE packages dir', $packages_dir ), + array( 'EE global config', $runner->global_config_path ), + array( 'EE project config', $runner->project_config_path ), + array( 'EE version', EE_VERSION ), + ); + + $info_table = new \cli\Table(); + $info_table->setRows( $info ); + $info_table->setRenderer( new \cli\table\Ascii() ); + $lines = array_slice( $info_table->getDisplayLines(), 2 ); + foreach ( $lines as $line ) { + \EE::line( $line ); + } } } /** - * Check to see if there is a newer version of WP-CLI available. + * Check to see if there is a newer version of EE available. * * Queries the Github releases API. Returns available versions if there are * updates available, or success message if using the latest release. @@ -183,15 +192,15 @@ public function info( $_, $assoc_args ) { * ## EXAMPLES * * # Check for update. - * $ wp cli check-update - * Success: WP-CLI is at the latest version. + * $ ee cli check-update + * Success: EE is at the latest version. * * # Check for update and new version is available. - * $ wp cli check-update + * $ ee cli check-update * +---------+-------------+-------------------------------------------------------------------------------+ * | version | update_type | package_url | * +---------+-------------+-------------------------------------------------------------------------------+ - * | 0.24.1 | patch | https://github.com/wp-cli/wp-cli/releases/download/v0.24.1/wp-cli-0.24.1.phar | + * | 0.24.1 | patch | https://github.com/ee/ee/releases/download/v0.24.1/ee-0.24.1.phar | * +---------+-------------+-------------------------------------------------------------------------------+ * * @subcommand check-update @@ -200,19 +209,19 @@ public function check_update( $_, $assoc_args ) { $updates = $this->get_updates( $assoc_args ); if ( $updates ) { - $formatter = new \WP_CLI\Formatter( + $formatter = new \EE\Formatter( $assoc_args, array( 'version', 'update_type', 'package_url' ) ); $formatter->display_items( $updates ); } elseif ( empty( $assoc_args['format'] ) || 'table' == $assoc_args['format'] ) { $update_type = $this->get_update_type_str( $assoc_args ); - WP_CLI::success( "WP-CLI is at the latest{$update_type}version." ); + EE::success( "EE is at the latest{$update_type}version." ); } } /** - * Update WP-CLI to the latest release. + * Update EE to the latest release. * * Default behavior is to check the releases API for the newest stable * version, and prompt if one is available. @@ -249,190 +258,194 @@ public function check_update( $_, $assoc_args ) { * ## EXAMPLES * * # Update CLI. - * $ wp cli update + * $ ee cli update * You have version 0.24.0. Would you like to update to 0.24.1? [y/n] y - * Downloading from https://github.com/wp-cli/wp-cli/releases/download/v0.24.1/wp-cli-0.24.1.phar... + * Downloading from https://github.com/ee/ee/releases/download/v0.24.1/ee-0.24.1.phar... * New version works. Proceeding to replace. - * Success: Updated WP-CLI to 0.24.1. + * Success: Updated EE to 0.24.1. */ public function update( $_, $assoc_args ) { - if ( ! Utils\inside_phar() ) { - WP_CLI::error( 'You can only self-update Phar files.' ); - } - - $old_phar = realpath( $_SERVER['argv'][0] ); - - if ( ! is_writable( $old_phar ) ) { - WP_CLI::error( sprintf( '%s is not writable by current user.', $old_phar ) ); - } elseif ( ! is_writable( dirname( $old_phar ) ) ) { - WP_CLI::error( sprintf( '%s is not writable by current user.', dirname( $old_phar ) ) ); - } - - if ( Utils\get_flag_value( $assoc_args, 'nightly' ) ) { - WP_CLI::confirm( sprintf( 'You have version %s. Would you like to update to the latest nightly?', WP_CLI_VERSION ), $assoc_args ); - $download_url = 'https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli-nightly.phar'; - $md5_url = 'https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli-nightly.phar.md5'; - } elseif ( Utils\get_flag_value( $assoc_args, 'stable' ) ) { - WP_CLI::confirm( sprintf( 'You have version %s. Would you like to update to the latest stable release?', WP_CLI_VERSION ), $assoc_args ); - $download_url = 'https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar'; - $md5_url = 'https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar.md5'; - } else { - - $updates = $this->get_updates( $assoc_args ); - - if ( empty( $updates ) ) { - $update_type = $this->get_update_type_str( $assoc_args ); - WP_CLI::success( "WP-CLI is at the latest{$update_type}version." ); - return; - } - - $newest = $updates[0]; - - WP_CLI::confirm( sprintf( 'You have version %s. Would you like to update to %s?', WP_CLI_VERSION, $newest['version'] ), $assoc_args ); - - $download_url = $newest['package_url']; - $md5_url = str_replace( '.phar', '.phar.md5', $download_url ); - } - - WP_CLI::log( sprintf( 'Downloading from %s...', $download_url ) ); - - $temp = \WP_CLI\Utils\get_temp_dir() . uniqid( 'wp_', true ) . '.phar'; - - $headers = array(); - $options = array( - 'timeout' => 600, // 10 minutes ought to be enough for everybody. - 'filename' => $temp, - ); - - Utils\http_request( 'GET', $download_url, null, $headers, $options ); - - $md5_response = Utils\http_request( 'GET', $md5_url ); - if ( 20 != substr( $md5_response->status_code, 0, 2 ) ) { - WP_CLI::error( "Couldn't access md5 hash for release (HTTP code {$md5_response->status_code})." ); - } - $md5_file = md5_file( $temp ); - $release_hash = trim( $md5_response->body ); - if ( $md5_file === $release_hash ) { - WP_CLI::log( 'md5 hash verified: ' . $release_hash ); - } else { - WP_CLI::error( "md5 hash for download ({$md5_file}) is different than the release hash ({$release_hash})." ); - } - - $allow_root = WP_CLI::get_runner()->config['allow-root'] ? '--allow-root' : ''; - $php_binary = Utils\get_php_binary(); - $process = WP_CLI\Process::create( "{$php_binary} $temp --info {$allow_root}" ); - $result = $process->run(); - if ( 0 !== $result->return_code || false === stripos( $result->stdout, 'WP-CLI version:' ) ) { - $multi_line = explode( PHP_EOL, $result->stderr ); - WP_CLI::error_multi_line( $multi_line ); - WP_CLI::error( 'The downloaded PHAR is broken, try running wp cli update again.' ); - } - - WP_CLI::log( 'New version works. Proceeding to replace.' ); - - $mode = fileperms( $old_phar ) & 511; - - if ( false === chmod( $temp, $mode ) ) { - WP_CLI::error( sprintf( 'Cannot chmod %s.', $temp ) ); - } - - class_exists( '\cli\Colors' ); // This autoloads \cli\Colors - after we move the file we no longer have access to this class. - - if ( false === rename( $temp, $old_phar ) ) { - WP_CLI::error( sprintf( 'Cannot move %s to %s', $temp, $old_phar ) ); - } - - if ( Utils\get_flag_value( $assoc_args, 'nightly' ) ) { - $updated_version = 'the latest nightly release'; - } elseif ( Utils\get_flag_value( $assoc_args, 'stable' ) ) { - $updated_version = 'the latest stable release'; - } else { - $updated_version = $newest['version']; - } - WP_CLI::success( sprintf( 'Updated WP-CLI to %s.', $updated_version ) ); + // TODO: Update procedure to update EE + // + // if ( ! Utils\inside_phar() ) { + // EE::error( 'You can only self-update Phar files.' ); + // } + + // $old_phar = realpath( $_SERVER['argv'][0] ); + + // if ( ! is_writable( $old_phar ) ) { + // EE::error( sprintf( '%s is not writable by current user.', $old_phar ) ); + // } elseif ( ! is_writable( dirname( $old_phar ) ) ) { + // EE::error( sprintf( '%s is not writable by current user.', dirname( $old_phar ) ) ); + // } + + // if ( Utils\get_flag_value( $assoc_args, 'nightly' ) ) { + // EE::confirm( sprintf( 'You have version %s. Would you like to update to the latest nightly?', EE_VERSION ), $assoc_args ); + // $download_url = 'https://raw.githubusercontent.com/ee/builds/gh-pages/phar/ee-nightly.phar'; + // $md5_url = 'https://raw.githubusercontent.com/ee/builds/gh-pages/phar/ee-nightly.phar.md5'; + // } elseif ( Utils\get_flag_value( $assoc_args, 'stable' ) ) { + // EE::confirm( sprintf( 'You have version %s. Would you like to update to the latest stable release?', EE_VERSION ), $assoc_args ); + // $download_url = 'https://raw.githubusercontent.com/ee/builds/gh-pages/phar/ee.phar'; + // $md5_url = 'https://raw.githubusercontent.com/ee/builds/gh-pages/phar/ee.phar.md5'; + // } else { + + // $updates = $this->get_updates( $assoc_args ); + + // if ( empty( $updates ) ) { + // $update_type = $this->get_update_type_str( $assoc_args ); + // EE::success( "EE is at the latest{$update_type}version." ); + // return; + // } + + // $newest = $updates[0]; + + // EE::confirm( sprintf( 'You have version %s. Would you like to update to %s?', EE_VERSION, $newest['version'] ), $assoc_args ); + + // $download_url = $newest['package_url']; + // $md5_url = str_replace( '.phar', '.phar.md5', $download_url ); + // } + + // EE::log( sprintf( 'Downloading from %s...', $download_url ) ); + + // $temp = \EE\Utils\get_temp_dir() . uniqid( 'ee_', true ) . '.phar'; + + // $headers = array(); + // $options = array( + // 'timeout' => 600, // 10 minutes ought to be enough for everybody. + // 'filename' => $temp, + // ); + + // Utils\http_request( 'GET', $download_url, null, $headers, $options ); + + // $md5_response = Utils\http_request( 'GET', $md5_url ); + // if ( 20 != substr( $md5_response->status_code, 0, 2 ) ) { + // EE::error( "Couldn't access md5 hash for release (HTTP code {$md5_response->status_code})." ); + // } + // $md5_file = md5_file( $temp ); + // $release_hash = trim( $md5_response->body ); + // if ( $md5_file === $release_hash ) { + // EE::log( 'md5 hash verified: ' . $release_hash ); + // } else { + // EE::error( "md5 hash for download ({$md5_file}) is different than the release hash ({$release_hash})." ); + // } + + // $allow_root = EE::get_runner()->config['allow-root'] ? '--allow-root' : ''; + // $php_binary = Utils\get_php_binary(); + // $process = EE\Process::create( "{$php_binary} $temp --info {$allow_root}" ); + // $result = $process->run(); + // if ( 0 !== $result->return_code || false === stripos( $result->stdout, 'EE version:' ) ) { + // $multi_line = explode( PHP_EOL, $result->stderr ); + // EE::error_multi_line( $multi_line ); + // EE::error( 'The downloaded PHAR is broken, try running ee cli update again.' ); + // } + + // EE::log( 'New version works. Proceeding to replace.' ); + + // $mode = fileperms( $old_phar ) & 511; + + // if ( false === chmod( $temp, $mode ) ) { + // EE::error( sprintf( 'Cannot chmod %s.', $temp ) ); + // } + + // class_exists( '\cli\Colors' ); // This autoloads \cli\Colors - after we move the file we no longer have access to this class. + + // if ( false === rename( $temp, $old_phar ) ) { + // EE::error( sprintf( 'Cannot move %s to %s', $temp, $old_phar ) ); + // } + + // if ( Utils\get_flag_value( $assoc_args, 'nightly' ) ) { + // $updated_version = 'the latest nightly release'; + // } elseif ( Utils\get_flag_value( $assoc_args, 'stable' ) ) { + // $updated_version = 'the latest stable release'; + // } else { + // $updated_version = $newest['version']; + // } + // EE::success( sprintf( 'Updated EE to %s.', $updated_version ) ); } /** * Returns update information. */ private function get_updates( $assoc_args ) { - $url = 'https://api.github.com/repos/wp-cli/wp-cli/releases?per_page=100'; - - $options = array( - 'timeout' => 30, - ); - - $headers = array( - 'Accept' => 'application/json', - ); - if ( $github_token = getenv( 'GITHUB_TOKEN' ) ) { - $headers['Authorization'] = 'token ' . $github_token; - } - - $response = Utils\http_request( 'GET', $url, null, $headers, $options ); - - if ( ! $response->success || 200 !== $response->status_code ) { - WP_CLI::error( sprintf( 'Failed to get latest version (HTTP code %d).', $response->status_code ) ); - } - - $release_data = json_decode( $response->body ); - - $updates = array( - 'major' => false, - 'minor' => false, - 'patch' => false, - ); - foreach ( $release_data as $release ) { - - // Get rid of leading "v" if there is one set. - $release_version = $release->tag_name; - if ( 'v' === substr( $release_version, 0, 1 ) ) { - $release_version = ltrim( $release_version, 'v' ); - } - - $update_type = Utils\get_named_sem_ver( $release_version, WP_CLI_VERSION ); - if ( ! $update_type ) { - continue; - } - - if ( ! empty( $updates[ $update_type ] ) && ! Comparator::greaterThan( $release_version, $updates[ $update_type ]['version'] ) ) { - continue; - } - - $updates[ $update_type ] = array( - 'version' => $release_version, - 'update_type' => $update_type, - 'package_url' => $release->assets[0]->browser_download_url, - ); - } - - foreach ( $updates as $type => $value ) { - if ( empty( $value ) ) { - unset( $updates[ $type ] ); - } - } - - foreach ( array( 'major', 'minor', 'patch' ) as $type ) { - if ( true === \WP_CLI\Utils\get_flag_value( $assoc_args, $type ) ) { - return ! empty( $updates[ $type ] ) ? array( $updates[ $type ] ) : false; - } - } - - if ( empty( $updates ) && preg_match( '#-alpha-(.+)$#', WP_CLI_VERSION, $matches ) ) { - $version_url = 'https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/NIGHTLY_VERSION'; - $response = Utils\http_request( 'GET', $version_url ); - if ( ! $response->success || 200 !== $response->status_code ) { - WP_CLI::error( sprintf( 'Failed to get current nightly version (HTTP code %d)', $response->status_code ) ); - } - $nightly_version = trim( $response->body ); - if ( WP_CLI_VERSION != $nightly_version ) { - $updates['nightly'] = array( - 'version' => $nightly_version, - 'update_type' => 'nightly', - 'package_url' => 'https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli-nightly.phar', - ); - } - } + // TODO: update URLs + // + // $url = 'https://api.github.com/repos/ee/ee/releases?per_page=100'; + + // $options = array( + // 'timeout' => 30, + // ); + + // $headers = array( + // 'Accept' => 'application/json', + // ); + // if ( $github_token = getenv( 'GITHUB_TOKEN' ) ) { + // $headers['Authorization'] = 'token ' . $github_token; + // } + + // $response = Utils\http_request( 'GET', $url, null, $headers, $options ); + + // if ( ! $response->success || 200 !== $response->status_code ) { + // EE::error( sprintf( 'Failed to get latest version (HTTP code %d).', $response->status_code ) ); + // } + + // $release_data = json_decode( $response->body ); + + // $updates = array( + // 'major' => false, + // 'minor' => false, + // 'patch' => false, + // ); + // foreach ( $release_data as $release ) { + + // // Get rid of leading "v" if there is one set. + // $release_version = $release->tag_name; + // if ( 'v' === substr( $release_version, 0, 1 ) ) { + // $release_version = ltrim( $release_version, 'v' ); + // } + + // $update_type = Utils\get_named_sem_ver( $release_version, EE_VERSION ); + // if ( ! $update_type ) { + // continue; + // } + + // if ( ! empty( $updates[ $update_type ] ) && ! Comparator::greaterThan( $release_version, $updates[ $update_type ]['version'] ) ) { + // continue; + // } + + // $updates[ $update_type ] = array( + // 'version' => $release_version, + // 'update_type' => $update_type, + // 'package_url' => $release->assets[0]->browser_download_url, + // ); + // } + + // foreach ( $updates as $type => $value ) { + // if ( empty( $value ) ) { + // unset( $updates[ $type ] ); + // } + // } + + // foreach ( array( 'major', 'minor', 'patch' ) as $type ) { + // if ( true === \EE\Utils\get_flag_value( $assoc_args, $type ) ) { + // return ! empty( $updates[ $type ] ) ? array( $updates[ $type ] ) : false; + // } + // } + + // if ( empty( $updates ) && preg_match( '#-alpha-(.+)$#', EE_VERSION, $matches ) ) { + // $version_url = 'https://raw.githubusercontent.com/ee/builds/gh-pages/phar/NIGHTLY_VERSION'; + // $response = Utils\http_request( 'GET', $version_url ); + // if ( ! $response->success || 200 !== $response->status_code ) { + // EE::error( sprintf( 'Failed to get current nightly version (HTTP code %d)', $response->status_code ) ); + // } + // $nightly_version = trim( $response->body ); + // if ( EE_VERSION != $nightly_version ) { + // $updates['nightly'] = array( + // 'version' => $nightly_version, + // 'update_type' => 'nightly', + // 'package_url' => 'https://raw.githubusercontent.com/ee/builds/gh-pages/phar/ee-nightly.phar', + // ); + // } + // } return array_values( $updates ); } @@ -457,7 +470,7 @@ private function get_updates( $assoc_args ) { * ## EXAMPLES * * # Dump the list of global parameters. - * $ wp cli param-dump --format=var_export + * $ ee cli param-dump --format=var_export * array ( * 'path' => * array ( @@ -474,10 +487,10 @@ private function get_updates( $assoc_args ) { * @subcommand param-dump */ public function param_dump( $_, $assoc_args ) { - $spec = \WP_CLI::get_configurator()->get_spec(); + $spec = \EE::get_configurator()->get_spec(); - if ( \WP_CLI\Utils\get_flag_value( $assoc_args, 'with-values' ) ) { - $config = \WP_CLI::get_configurator()->to_array(); + if ( \EE\Utils\get_flag_value( $assoc_args, 'with-values' ) ) { + $config = \EE::get_configurator()->to_array(); // Copy current config values to $spec foreach ( $spec as $key => $value ) { $current = null; @@ -488,7 +501,7 @@ public function param_dump( $_, $assoc_args ) { } } - if ( 'var_export' === \WP_CLI\Utils\get_flag_value( $assoc_args, 'format' ) ) { + if ( 'var_export' === \EE\Utils\get_flag_value( $assoc_args, 'format' ) ) { var_export( $spec ); } else { echo json_encode( $spec ); @@ -501,13 +514,13 @@ public function param_dump( $_, $assoc_args ) { * ## EXAMPLES * * # Dump the list of installed commands. - * $ wp cli cmd-dump - * {"name":"wp","description":"Manage WordPress through the command-line.","longdesc":"\n\n## GLOBAL PARAMETERS\n\n --path=\n Path to the WordPress files.\n\n --ssh=\n Perform operation against a remote server over SSH (or a container using scheme of "docker" or "docker-compose").\n\n --url=\n Pretend request came from given URL. In multisite, this argument is how the target site is specified. \n\n --user=\n + * $ ee cli cmd-dump + * {"name":"ee","description":"Manage WordPress through the command-line.","longdesc":"\n\n## GLOBAL PARAMETERS\n\n --path=\n Path to the WordPress files.\n\n --ssh=\n Perform operation against a remote server over SSH (or a container using scheme of "docker" or "docker-compose").\n\n --url=\n Pretend request came from given URL. In multisite, this argument is how the target site is specified. \n\n --user=\n * * @subcommand cmd-dump */ public function cmd_dump() { - echo json_encode( $this->command_to_array( WP_CLI::get_root_command() ) ); + echo json_encode( $this->command_to_array( EE::get_root_command() ) ); } /** @@ -524,18 +537,18 @@ public function cmd_dump() { * ## EXAMPLES * * # Generate tab completion strings. - * $ wp cli completions --line='wp eva' --point=100 + * $ ee cli completions --line='ee eva' --point=100 * eval * eval-file */ public function completions( $_, $assoc_args ) { $line = substr( $assoc_args['line'], 0, $assoc_args['point'] ); - $compl = new \WP_CLI\Completions( $line ); + $compl = new \EE\Completions( $line ); $compl->render(); } /** - * List available WP-CLI aliases. + * List available EE aliases. * * Aliases are shorthand references to WordPress installs. For instance, * `@dev` could refer to a development install and `@prod` could refer to @@ -556,7 +569,7 @@ public function completions( $_, $assoc_args ) { * ## EXAMPLES * * # List all available aliases. - * $ wp cli alias + * $ ee cli alias * --- * @all: Run command against every registered alias. * @prod: @@ -570,7 +583,7 @@ public function completions( $_, $assoc_args ) { * @alias aliases */ public function alias( $_, $assoc_args ) { - WP_CLI::print_value( WP_CLI::get_runner()->aliases, $assoc_args ); + EE::print_value( EE::get_runner()->aliases, $assoc_args ); } /** @@ -579,7 +592,7 @@ public function alias( $_, $assoc_args ) { private function get_update_type_str( $assoc_args ) { $update_type = ' '; foreach ( array( 'major', 'minor', 'patch' ) as $type ) { - if ( true === \WP_CLI\Utils\get_flag_value( $assoc_args, $type ) ) { + if ( true === \EE\Utils\get_flag_value( $assoc_args, $type ) ) { $update_type = ' ' . $type . ' '; break; } @@ -590,7 +603,7 @@ private function get_update_type_str( $assoc_args ) { /** * Detects if a command exists * - * This commands checks if a command is registered with WP-CLI. + * This commands checks if a command is registered with EE. * If the command is found then it returns with exit status 0. * If the command doesn't exist, then it will exit with status 1. * @@ -601,24 +614,22 @@ private function get_update_type_str( $assoc_args ) { * ## EXAMPLES * * # The "site delete" command is registered. - * $ wp cli has-command "site delete" + * $ ee cli has-command "site delete" * $ echo $? * 0 * * # The "foo bar" command is not registered. - * $ wp cli has-command "foo bar" + * $ ee cli has-command "foo bar" * $ echo $? * 1 * * @subcommand has-command - * - * @when after_wp_load */ public function has_command( $_, $assoc_args ) { // If command is input as a string, then explode it into array. $command = explode( ' ', implode( ' ', $_ ) ); - WP_CLI::halt( is_array( WP_CLI::get_runner()->find_command_to_run( $command ) ) ? 0 : 1 ); + EE::halt( is_array( EE::get_runner()->find_command_to_run( $command ) ) ? 0 : 1 ); } } diff --git a/php/config-spec.php b/php/config-spec.php index 15456002c..abff64be4 100644 --- a/php/config-spec.php +++ b/php/config-spec.php @@ -1,17 +1,8 @@ array( - 'runtime' => '=', - 'file' => '', - 'desc' => 'Path to the WordPress files.', - ), +# Global configuration file for EE. - 'url' => array( - 'runtime' => '=', - 'file' => '', - 'desc' => 'Pretend request came from given URL. In multisite, this argument is how the target site is specified.', - ), +return array( 'ssh' => array( 'runtime' => '=[:][@][:][]', @@ -19,36 +10,13 @@ 'desc' => 'Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "vagrant").', ), - 'http' => array( - 'runtime' => '=', - 'file' => '', - 'desc' => 'Perform operation against a remote WordPress install over HTTP.', - ), - - 'blog' => array( - 'deprecated' => 'Use --url instead.', - 'runtime' => '=', - ), - - 'user' => array( - 'runtime' => '=', - 'file' => '', - 'desc' => 'Set the WordPress user.', - ), - - 'skip-plugins' => array( - 'runtime' => '[=]', - 'file' => '', - 'desc' => 'Skip loading all or some plugins. Note: mu-plugins are still loaded.', - 'default' => '', - ), - - 'skip-themes' => array( - 'runtime' => '[=]', - 'file' => '', - 'desc' => 'Skip loading all or some themes.', - 'default' => '', - ), + # Used by wp-cli to control wp site remotely. + # Might be useful in future for controlling ee remotely. + // 'http' => array( + // 'runtime' => '=', + // 'file' => '', + // 'desc' => 'Reserved for future.', + // ), 'skip-packages' => array( 'runtime' => '', @@ -82,7 +50,7 @@ 'runtime' => '[=]', 'file' => '', 'default' => false, - 'desc' => 'Show all PHP errors; add verbosity to WP-CLI bootstrap.', + 'desc' => 'Show all PHP errors; add verbosity to EE bootstrap.', ), 'prompt' => array( @@ -99,14 +67,7 @@ 'desc' => 'Suppress informational messages.', ), - 'apache_modules' => array( - 'file' => '', - 'desc' => 'List of Apache Modules that are to be reported as loaded.', - 'multiple' => true, - 'default' => array(), - ), - - # --allow-root => (NOT RECOMMENDED) Allow wp-cli to run as root. This poses + # --allow-root => (NOT RECOMMENDED) Allow ee to run as root. This poses # a security risk, so you probably do not want to do this. 'allow-root' => array( 'file' => false, # Explicit. Just in case the default changes. diff --git a/php/dispatcher.php b/php/dispatcher.php index bd11a3927..7ef1c9bd7 100644 --- a/php/dispatcher.php +++ b/php/dispatcher.php @@ -1,11 +1,11 @@ get_col( "SHOW TABLES LIKE '%_options'" ); - $found_prefixes = array(); - if ( count( $tables ) ) { - foreach ( $tables as $table ) { - $maybe_prefix = substr( $table, 0, - strlen( 'options' ) ); - if ( $maybe_prefix !== $table_prefix ) { - $found_prefixes[] = $maybe_prefix; - } - } - } - if ( count( $found_prefixes ) ) { - $prefix_list = implode( ', ', $found_prefixes ); - $install_label = count( $found_prefixes ) > 1 ? 'installs' : 'install'; - \WP_CLI::error( - "The site you have requested is not installed.\n" . - "Your table prefix is '{$table_prefix}'. Found {$install_label} with table prefix: {$prefix_list}.\n" . - 'Or, run `wp core install` to create database tables.' - ); - } else { - \WP_CLI::error( - "The site you have requested is not installed.\n" . - 'Run `wp core install` to create database tables.' - ); - } - } -} - -function wp_debug_mode() { - if ( \WP_CLI::get_config( 'debug' ) ) { - if ( ! defined( 'WP_DEBUG' ) ) { - define( 'WP_DEBUG', true ); - } - - error_reporting( E_ALL & ~E_DEPRECATED & ~E_STRICT ); - } else { - if ( WP_DEBUG ) { - error_reporting( E_ALL ); - - if ( WP_DEBUG_DISPLAY ) { - ini_set( 'display_errors', 1 ); - } elseif ( null !== WP_DEBUG_DISPLAY ) { - ini_set( 'display_errors', 0 ); - } - - if ( WP_DEBUG_LOG ) { - ini_set( 'log_errors', 1 ); - ini_set( 'error_log', WP_CONTENT_DIR . '/debug.log' ); - } - } else { - error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR ); - } - - if ( defined( 'XMLRPC_REQUEST' ) || defined( 'REST_REQUEST' ) || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) { - ini_set( 'display_errors', 0 ); - } - } - - // XDebug already sends errors to STDERR - ini_set( 'display_errors', function_exists( 'xdebug_debug_zval' ) ? false : 'STDERR' ); -} - -function replace_wp_die_handler() { - \remove_filter( 'wp_die_handler', '_default_wp_die_handler' ); - \add_filter( - 'wp_die_handler', function() { - return __NAMESPACE__ . '\\' . 'wp_die_handler'; - } - ); -} - -function wp_die_handler( $message ) { - if ( $message instanceof \WP_Error ) { - $message = $message->get_error_message(); - } - - $message = wp_clean_error_message( $message ); - - \WP_CLI::error( $message ); -} - -/** - * Clean HTML error message so suitable for text display. - */ -function wp_clean_error_message( $message ) { - $original_message = $message = trim( $message ); - if ( preg_match( '|^\

(.+?)

|', $original_message, $matches ) ) { - $message = $matches[1] . '.'; - } - if ( preg_match( '|\

(.+?)

|', $original_message, $matches ) ) { - $message .= ' ' . $matches[1]; - } - - $search_replace = array( - '' => '`', - '' => '`', - ); - $message = str_replace( array_keys( $search_replace ), array_values( $search_replace ), $message ); - $message = strip_tags( $message ); - $message = html_entity_decode( $message, ENT_COMPAT, 'UTF-8' ); - - return $message; -} - -function wp_redirect_handler( $url ) { - \WP_CLI::warning( 'Some code is trying to do a URL redirect. Backtrace:' ); - - ob_start(); - debug_print_backtrace(); - fwrite( STDERR, ob_get_clean() ); - - return $url; -} - -function maybe_require( $since, $path ) { - if ( wp_version_compare( $since, '>=' ) ) { - require $path; - } -} - -function get_upgrader( $class ) { - if ( ! class_exists( '\WP_Upgrader' ) ) { - require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; - } - - return new $class( new \WP_CLI\UpgraderSkin ); -} - -/** - * Converts a plugin basename back into a friendly slug. - */ -function get_plugin_name( $basename ) { - if ( false === strpos( $basename, '/' ) ) { - $name = basename( $basename, '.php' ); - } else { - $name = dirname( $basename ); - } - - return $name; -} - -function is_plugin_skipped( $file ) { - $name = get_plugin_name( str_replace( WP_PLUGIN_DIR . '/', '', $file ) ); - - $skipped_plugins = \WP_CLI::get_runner()->config['skip-plugins']; - if ( true === $skipped_plugins ) { - return true; - } - - if ( ! is_array( $skipped_plugins ) ) { - $skipped_plugins = explode( ',', $skipped_plugins ); - } - - return in_array( $name, array_filter( $skipped_plugins ) ); -} - -function get_theme_name( $path ) { - return basename( $path ); -} - -function is_theme_skipped( $path ) { - $name = get_theme_name( $path ); - - $skipped_themes = \WP_CLI::get_runner()->config['skip-themes']; - if ( true === $skipped_themes ) { - return true; - } - - if ( ! is_array( $skipped_themes ) ) { - $skipped_themes = explode( ',', $skipped_themes ); - } - - return in_array( $name, array_filter( $skipped_themes ) ); -} - -/** - * Register the sidebar for unused widgets - * Core does this in /wp-admin/widgets.php, which isn't helpful - */ -function wp_register_unused_sidebar() { - - register_sidebar( - array( - 'name' => __( 'Inactive Widgets' ), - 'id' => 'wp_inactive_widgets', - 'class' => 'inactive-sidebar', - 'description' => __( 'Drag widgets here to remove them from the sidebar but keep their settings.' ), - 'before_widget' => '', - 'after_widget' => '', - 'before_title' => '', - 'after_title' => '', - ) - ); - -} - -/** - * Attempts to determine which object cache is being used. - * - * Note that the guesses made by this function are based on the WP_Object_Cache classes - * that define the 3rd party object cache extension. Changes to those classes could render - * problems with this function's ability to determine which object cache is being used. - * - * @return string - */ -function wp_get_cache_type() { - global $_wp_using_ext_object_cache, $wp_object_cache; - - if ( ! empty( $_wp_using_ext_object_cache ) ) { - // Test for Memcached PECL extension memcached object cache (https://github.com/tollmanz/wordpress-memcached-backend) - if ( isset( $wp_object_cache->m ) && is_a( $wp_object_cache->m, 'Memcached' ) ) { - $message = 'Memcached'; - - // Test for Memcache PECL extension memcached object cache (http://wordpress.org/extend/plugins/memcached/) - } elseif ( isset( $wp_object_cache->mc ) ) { - $is_memcache = true; - foreach ( $wp_object_cache->mc as $bucket ) { - if ( ! is_a( $bucket, 'Memcache' ) && ! is_a( $bucket, 'Memcached' ) ) { - $is_memcache = false; - } - } - - if ( $is_memcache ) { - $message = 'Memcache'; - } - - // Test for Xcache object cache (http://plugins.svn.wordpress.org/xcache/trunk/object-cache.php) - } elseif ( is_a( $wp_object_cache, 'XCache_Object_Cache' ) ) { - $message = 'Xcache'; - - // Test for WinCache object cache (http://wordpress.org/extend/plugins/wincache-object-cache-backend/) - } elseif ( class_exists( 'WinCache_Object_Cache' ) ) { - $message = 'WinCache'; - - // Test for APC object cache (http://wordpress.org/extend/plugins/apc/) - } elseif ( class_exists( 'APC_Object_Cache' ) ) { - $message = 'APC'; - - // Test for Redis Object Cache (https://github.com/alleyinteractive/wp-redis) - } elseif ( isset( $wp_object_cache->redis ) && is_a( $wp_object_cache->redis, 'Redis' ) ) { - $message = 'Redis'; - - // Test for WP LCache Object cache (https://github.com/lcache/wp-lcache) - } elseif ( isset( $wp_object_cache->lcache ) && is_a( $wp_object_cache->lcache, '\LCache\Integrated' ) ) { - $message = 'WP LCache'; - - } elseif ( function_exists( 'w3_instance' ) ) { - $config = w3_instance( 'W3_Config' ); - $message = 'Unknown'; - - if ( $config->get_boolean( 'objectcache.enabled' ) ) { - $message = 'W3TC ' . $config->get_string( 'objectcache.engine' ); - } - } else { - $message = 'Unknown'; - } - } else { - $message = 'Default'; - } - return $message; -} - -/** - * Clear WordPress internal object caches. - * - * In long-running scripts, the internal caches on `$wp_object_cache` and `$wpdb` - * can grow to consume gigabytes of memory. Periodically calling this utility - * can help with memory management. - * - * @access public - * @category System - * @deprecated 1.5.0 - */ -function wp_clear_object_cache() { - global $wpdb, $wp_object_cache; - - $wpdb->queries = array(); // or define( 'WP_IMPORTING', true ); - - if ( ! is_object( $wp_object_cache ) ) { - return; - } - - // The following are Memcached (Redux) plugin specific (see https://core.trac.wordpress.org/ticket/31463). - if ( isset( $wp_object_cache->group_ops ) ) { - $wp_object_cache->group_ops = array(); - } - if ( isset( $wp_object_cache->stats ) ) { - $wp_object_cache->stats = array(); - } - if ( isset( $wp_object_cache->memcache_debug ) ) { - $wp_object_cache->memcache_debug = array(); - } - // Used by `WP_Object_Cache` also. - if ( isset( $wp_object_cache->cache ) ) { - $wp_object_cache->cache = array(); - } -} - -/** - * Get a set of tables in the database. - * - * Interprets common command-line options into a resolved set of table names. - * - * @param array $args Provided table names, or tables with wildcards. - * @param array $assoc_args Optional flags for groups of tables (e.g. --network) - * @return array $tables - */ -function wp_get_table_names( $args, $assoc_args = array() ) { - global $wpdb; - - $tables = array(); - if ( get_flag_value( $assoc_args, 'all-tables' ) ) { - $tables = $wpdb->get_col( 'SHOW TABLES' ); - - } elseif ( get_flag_value( $assoc_args, 'all-tables-with-prefix' ) ) { - $tables = $wpdb->get_col( $wpdb->prepare( 'SHOW TABLES LIKE %s', esc_like( $wpdb->get_blog_prefix() ) . '%' ) ); - - } else { - $scope = get_flag_value( $assoc_args, 'scope', 'all' ); - - // Note: BC change 1.5.0, taking scope into consideration for network also. - if ( get_flag_value( $assoc_args, 'network' ) && is_multisite() ) { - $network_global_scope = in_array( $scope, array( 'all', 'global', 'ms_global' ), true ) ? ( 'all' === $scope ? 'global' : $scope ) : ''; - $wp_tables = array_values( $wpdb->tables( $network_global_scope ) ); - if ( in_array( $scope, array( 'all', 'blog' ), true ) ) { - // Do directly for compat with old WP versions. Note: private, deleted, archived sites are not excluded. - $blog_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs WHERE site_id = $wpdb->siteid" ); - foreach ( $blog_ids as $blog_id ) { - $wp_tables = array_merge( $wp_tables, array_values( $wpdb->tables( 'blog', true /*prefix*/, $blog_id ) ) ); - } - } - } else { - $wp_tables = array_values( $wpdb->tables( $scope ) ); - } - - if ( ! global_terms_enabled() ) { - // Only include sitecategories when it's actually enabled. - $wp_tables = array_values( array_diff( $wp_tables, array( $wpdb->sitecategories ) ) ); - } - - // Note: BC change 1.5.0, tables are sorted (via TABLES view). - // @codingStandardsIgnoreLine - $tables = $wpdb->get_col( sprintf( "SHOW TABLES WHERE %s IN ('%s')", esc_sql_ident( 'Tables_in_' . $wpdb->dbname ), implode( "', '", $wpdb->_escape( $wp_tables ) ) ) ); - } - - // Filter by `$args`. - if ( $args ) { - $args_tables = array(); - foreach ( $args as $arg ) { - if ( false !== strpos( $arg, '*' ) || false !== strpos( $arg, '?' ) ) { - $args_tables = array_merge( $args_tables, array_filter( $tables, function ( $v ) use ( $arg ) { - return fnmatch( $arg, $v ); - } ) ); - } else { - $args_tables[] = $arg; - } - } - $args_tables = array_values( array_unique( $args_tables ) ); - if ( ! ( $tables = array_values( array_intersect( $tables, $args_tables ) ) ) ) { - \WP_CLI::error( sprintf( "Couldn't find any tables matching: %s", implode( ' ', $args ) ) ); - } - } - - return $tables; -} diff --git a/php/utils.php b/php/utils.php index 26b3dbbed..e3788e186 100644 --- a/php/utils.php +++ b/php/utils.php @@ -2,18 +2,18 @@ // Utilities that do NOT depend on WordPress code. -namespace WP_CLI\Utils; +namespace EE\Utils; use \Composer\Semver\Comparator; use \Composer\Semver\Semver; -use \WP_CLI; -use \WP_CLI\Dispatcher; -use \WP_CLI\Iterators\Transform; +use \EE; +use \EE\Dispatcher; +use \EE\Iterators\Transform; const PHAR_STREAM_PREFIX = 'phar://'; function inside_phar() { - return 0 === strpos( WP_CLI_ROOT, PHAR_STREAM_PREFIX ); + return 0 === strpos( EE_ROOT, PHAR_STREAM_PREFIX ); } // Files that need to be read by external programs have to be extracted from the Phar archive. @@ -24,7 +24,7 @@ function extract_from_phar( $path ) { $fname = basename( $path ); - $tmp_path = get_temp_dir() . "wp-cli-$fname"; + $tmp_path = get_temp_dir() . "ee-$fname"; copy( $path, $tmp_path ); @@ -41,10 +41,10 @@ function() use ( $tmp_path ) { function load_dependencies() { if ( inside_phar() ) { - if ( file_exists( WP_CLI_ROOT . '/vendor/autoload.php' ) ) { - require WP_CLI_ROOT . '/vendor/autoload.php'; - } elseif ( file_exists( dirname( dirname( WP_CLI_ROOT ) ) . '/autoload.php' ) ) { - require dirname( dirname( WP_CLI_ROOT ) ) . '/autoload.php'; + if ( file_exists( EE_ROOT . '/vendor/autoload.php' ) ) { + require EE_ROOT . '/vendor/autoload.php'; + } elseif ( file_exists( dirname( dirname( EE_ROOT ) ) . '/autoload.php' ) ) { + require dirname( dirname( EE_ROOT ) ) . '/autoload.php'; } return; } @@ -67,14 +67,14 @@ function load_dependencies() { function get_vendor_paths() { $vendor_paths = array( - WP_CLI_ROOT . '/../../../vendor', // part of a larger project / installed via Composer (preferred) - WP_CLI_ROOT . '/vendor', // top-level project / installed as Git clone + EE_ROOT . '/../../../vendor', // part of a larger project / installed via Composer (preferred) + EE_ROOT . '/vendor', // top-level project / installed as Git clone ); - $maybe_composer_json = WP_CLI_ROOT . '/../../../composer.json'; + $maybe_composer_json = EE_ROOT . '/../../../composer.json'; if ( file_exists( $maybe_composer_json ) && is_readable( $maybe_composer_json ) ) { $composer = json_decode( file_get_contents( $maybe_composer_json ) ); if ( ! empty( $composer->config ) && ! empty( $composer->config->{'vendor-dir'} ) ) { - array_unshift( $vendor_paths, WP_CLI_ROOT . '/../../../' . $composer->config->{'vendor-dir'} ); + array_unshift( $vendor_paths, EE_ROOT . '/../../../' . $composer->config->{'vendor-dir'} ); } } return $vendor_paths; @@ -86,7 +86,7 @@ function load_file( $path ) { } function load_command( $name ) { - $path = WP_CLI_ROOT . "/php/commands/$name.php"; + $path = EE_ROOT . "/php/commands/$name.php"; if ( is_readable( $path ) ) { include_once $path; @@ -225,32 +225,6 @@ function esc_cmd( $cmd ) { return vsprintf( $cmd, array_map( 'escapeshellarg', $args ) ); } -function locate_wp_config() { - static $path; - - if ( null === $path ) { - $path = false; - - if ( file_exists( ABSPATH . 'wp-config.php' ) ) { - $path = ABSPATH . 'wp-config.php'; - } elseif ( file_exists( ABSPATH . '../wp-config.php' ) && ! file_exists( ABSPATH . '/../wp-settings.php' ) ) { - $path = ABSPATH . '../wp-config.php'; - } - - if ( $path ) { - $path = realpath( $path ); - } - } - - return $path; -} - -function wp_version_compare( $since, $operator ) { - $wp_version = str_replace( '-src', '', $GLOBALS['wp_version'] ); - $since = str_replace( '-src', '', $since ); - return version_compare( $wp_version, $since, $operator ); -} - /** * Render a collection of items as an ASCII table, JSON, CSV, YAML, list of ids, or count. * @@ -268,7 +242,7 @@ function wp_version_compare( $since, $operator ) { * Render `$items` as an ASCII table: * * ``` - * WP_CLI\Utils\format_items( 'table', $items, array( 'key', 'value' ) ); + * EE\Utils\format_items( 'table', $items, array( 'key', 'value' ) ); * * # +-----+-------+ * # | key | value | @@ -280,7 +254,7 @@ function wp_version_compare( $since, $operator ) { * Or render `$items` as YAML: * * ``` - * WP_CLI\Utils\format_items( 'yaml', $items, array( 'key', 'value' ) ); + * EE\Utils\format_items( 'yaml', $items, array( 'key', 'value' ) ); * * # --- * # - @@ -298,7 +272,7 @@ function wp_version_compare( $since, $operator ) { */ function format_items( $format, $items, $fields ) { $assoc_args = compact( 'format', 'fields' ); - $formatter = new \WP_CLI\Formatter( $assoc_args ); + $formatter = new \EE\Formatter( $assoc_args ); $formatter->display_items( $items ); } @@ -353,7 +327,7 @@ function pick_fields( $item, $fields ) { * @param string $content Some form of text to edit (e.g. post content) * @return string|bool Edited text, if file is saved from editor; false, if no change to file. */ -function launch_editor_for_input( $input, $filename = 'WP-CLI' ) { +function launch_editor_for_input( $input, $filename = 'EE' ) { check_proc_available( 'launch_editor_for_input' ); @@ -375,7 +349,7 @@ function launch_editor_for_input( $input, $filename = 'WP-CLI' ) { } while ( ! $tmpfile ); if ( ! $tmpfile ) { - \WP_CLI::error( 'Error creating temporary file.' ); + \EE::error( 'Error creating temporary file.' ); } $output = ''; @@ -404,65 +378,6 @@ function launch_editor_for_input( $input, $filename = 'WP-CLI' ) { return $output; } -/** - * @param string MySQL host string, as defined in wp-config.php - * @return array - */ -function mysql_host_to_cli_args( $raw_host ) { - $assoc_args = array(); - - $host_parts = explode( ':', $raw_host ); - if ( count( $host_parts ) == 2 ) { - list( $assoc_args['host'], $extra ) = $host_parts; - $extra = trim( $extra ); - if ( is_numeric( $extra ) ) { - $assoc_args['port'] = (int) $extra; - $assoc_args['protocol'] = 'tcp'; - } elseif ( '' !== $extra ) { - $assoc_args['socket'] = $extra; - } - } else { - $assoc_args['host'] = $raw_host; - } - - return $assoc_args; -} - -function run_mysql_command( $cmd, $assoc_args, $descriptors = null ) { - check_proc_available( 'run_mysql_command' ); - - if ( ! $descriptors ) { - $descriptors = array( STDIN, STDOUT, STDERR ); - } - - if ( isset( $assoc_args['host'] ) ) { - //@codingStandardsIgnoreStart - $assoc_args = array_merge( $assoc_args, mysql_host_to_cli_args( $assoc_args['host'] ) ); - //@codingStandardsIgnoreEnd - } - - $pass = $assoc_args['pass']; - unset( $assoc_args['pass'] ); - - $old_pass = getenv( 'MYSQL_PWD' ); - putenv( 'MYSQL_PWD=' . $pass ); - - $final_cmd = force_env_on_nix_systems( $cmd ) . assoc_args_to_str( $assoc_args ); - - $proc = proc_open_compat( $final_cmd, $descriptors, $pipes ); - if ( ! $proc ) { - exit( 1 ); - } - - $r = proc_close( $proc ); - - putenv( 'MYSQL_PWD=' . $old_pass ); - - if ( $r ) { - exit( $r ); - } -} - /** * Render PHP or other types of files using Mustache templates. * @@ -470,7 +385,7 @@ function run_mysql_command( $cmd, $assoc_args, $descriptors = null ) { */ function mustache_render( $template_name, $data = array() ) { if ( ! file_exists( $template_name ) ) { - $template_name = WP_CLI_ROOT . "/templates/$template_name"; + $template_name = EE_ROOT . "/templates/$template_name"; } $template = file_get_contents( $template_name ); @@ -492,31 +407,17 @@ function mustache_render( $template_name, $data = array() ) { * advances with `$progress->tick()`, and completes with `$progress->finish()`. * Process bar also indicates elapsed time and expected total time. * - * ``` - * # `wp user generate` ticks progress bar each time a new user is created. - * # - * # $ wp user generate --count=500 - * # Generating users 22 % [=======> ] 0:05 / 0:23 - * - * $progress = \WP_CLI\Utils\make_progress_bar( 'Generating users', $count ); - * for ( $i = 0; $i < $count; $i++ ) { - * // uses wp_insert_user() to insert the user - * $progress->tick(); - * } - * $progress->finish(); - * ``` - * * @access public * @category Output * * @param string $message Text to display before the progress bar. * @param integer $count Total number of ticks to be performed. * @param int $interval Optional. The interval in milliseconds between updates. Default 100. - * @return cli\progress\Bar|WP_CLI\NoOp + * @return cli\progress\Bar|EE\NoOp */ function make_progress_bar( $message, $count, $interval = 100 ) { if ( \cli\Shell::isPiped() ) { - return new \WP_CLI\NoOp; + return new \EE\NoOp; } return new \cli\progress\Bar( $message, $count, $interval ); @@ -538,7 +439,7 @@ function parse_url( $url ) { * @return bool */ function is_windows() { - return false !== ( $test_is_windows = getenv( 'WP_CLI_TEST_IS_WINDOWS' ) ) ? (bool) $test_is_windows : strtoupper( substr( PHP_OS, 0, 3 ) ) === 'WIN'; + return false !== ( $test_is_windows = getenv( 'EE_TEST_IS_WINDOWS' ) ) ? (bool) $test_is_windows : strtoupper( substr( PHP_OS, 0, 3 ) ) === 'WIN'; } /** @@ -564,15 +465,6 @@ function replace_path_consts( $source, $path ) { * * Wraps the Requests HTTP library to ensure every request includes a cert. * - * ``` - * # `wp core download` verifies the hash for a downloaded WordPress archive - * - * $md5_response = Utils\http_request( 'GET', $download_url . '.md5' ); - * if ( 20 != substr( $md5_response->status_code, 0, 2 ) ) { - * WP_CLI::error( "Couldn't access md5 hash for release (HTTP code {$response->status_code})" ); - * } - * ``` - * * @access public * * @param string $method HTTP method (GET, POST, DELETE, etc.) @@ -588,7 +480,7 @@ function http_request( $method, $url, $data = null, $headers = array(), $options if ( inside_phar() ) { // cURL can't read Phar archives $options['verify'] = extract_from_phar( - WP_CLI_VENDOR_DIR . $cert_path + EE_VENDOR_DIR . $cert_path ); } else { foreach ( get_vendor_paths() as $vendor_path ) { @@ -600,7 +492,7 @@ function http_request( $method, $url, $data = null, $headers = array(), $options if ( empty( $options['verify'] ) ) { $error_msg = 'Cannot find SSL certificate.'; if ( $halt_on_error ) { - WP_CLI::error( $error_msg ); + EE::error( $error_msg ); } throw new \RuntimeException( $error_msg ); } @@ -613,19 +505,19 @@ function http_request( $method, $url, $data = null, $headers = array(), $options if ( 'curlerror' !== $ex->getType() || ! in_array( curl_errno( $ex->getData() ), array( CURLE_SSL_CONNECT_ERROR, CURLE_SSL_CERTPROBLEM, 77 /*CURLE_SSL_CACERT_BADFILE*/ ), true ) ) { $error_msg = sprintf( "Failed to get url '%s': %s.", $url, $ex->getMessage() ); if ( $halt_on_error ) { - WP_CLI::error( $error_msg ); + EE::error( $error_msg ); } throw new \RuntimeException( $error_msg, null, $ex ); } // Handle SSL certificate issues gracefully - \WP_CLI::warning( sprintf( "Re-trying without verify after failing to get verified url '%s' %s.", $url, $ex->getMessage() ) ); + \EE::warning( sprintf( "Re-trying without verify after failing to get verified url '%s' %s.", $url, $ex->getMessage() ) ); $options['verify'] = false; try { return \Requests::request( $url, $headers, $data, $method, $options ); } catch ( \Requests_Exception $ex ) { $error_msg = sprintf( "Failed to get non-verified url '%s' %s.", $url, $ex->getMessage() ); if ( $halt_on_error ) { - WP_CLI::error( $error_msg ); + EE::error( $error_msg ); } throw new \RuntimeException( $error_msg, null, $ex ); } @@ -801,7 +693,7 @@ function get_temp_dir() { $temp = trailingslashit( sys_get_temp_dir() ); if ( ! is_writable( $temp ) ) { - \WP_CLI::warning( "Temp directory isn't writable: {$temp}" ); + \EE::warning( "Temp directory isn't writable: {$temp}" ); } return $temp; @@ -882,17 +774,17 @@ function report_batch_operation_results( $noun, $verb, $total, $successes, $fail if ( $failures ) { $failed_skipped_message = null === $skips ? '' : " ({$failures} failed" . ( $skips ? ", {$skips} skipped" : '' ) . ')'; if ( $successes ) { - WP_CLI::error( "Only {$past_tense_verb} {$successes} of {$total} {$plural_noun}{$failed_skipped_message}." ); + EE::error( "Only {$past_tense_verb} {$successes} of {$total} {$plural_noun}{$failed_skipped_message}." ); } else { - WP_CLI::error( "No {$plural_noun} {$past_tense_verb}{$failed_skipped_message}." ); + EE::error( "No {$plural_noun} {$past_tense_verb}{$failed_skipped_message}." ); } } else { $skipped_message = $skips ? " ({$skips} skipped)" : ''; if ( $successes || $skips ) { - WP_CLI::success( "{$past_tense_verb_upper} {$successes} of {$total} {$plural_noun}{$skipped_message}." ); + EE::success( "{$past_tense_verb_upper} {$successes} of {$total} {$plural_noun}{$skipped_message}." ); } else { $message = $total > 1 ? ucfirst( $plural_noun ) : ucfirst( $noun ); - WP_CLI::success( "{$message} already {$past_tense_verb}." ); + EE::success( "{$message} already {$past_tense_verb}." ); } } } @@ -977,8 +869,8 @@ function expand_globs( $paths, $flags = 'default' ) { // Compatibility for systems without GLOB_BRACE. $glob_func = 'glob'; if ( 'default' === $flags ) { - if ( ! defined( 'GLOB_BRACE' ) || getenv( 'WP_CLI_TEST_EXPAND_GLOBS_NO_GLOB_BRACE' ) ) { - $glob_func = 'WP_CLI\Utils\glob_brace'; + if ( ! defined( 'GLOB_BRACE' ) || getenv( 'EE_TEST_EXPAND_GLOBS_NO_GLOB_BRACE' ) ) { + $glob_func = 'EE\Utils\glob_brace'; } else { $flags = GLOB_BRACE; } @@ -1177,7 +1069,7 @@ function phar_safe_path( $path ) { } return str_replace( - PHAR_STREAM_PREFIX . WP_CLI_PHAR_PATH . '/', + PHAR_STREAM_PREFIX . EE_PHAR_PATH . '/', PHAR_STREAM_PREFIX, $path ); @@ -1188,9 +1080,9 @@ function phar_safe_path( $path ) { * commands. * * This function accepts both a fully qualified class name as a string as - * well as an object that extends `WP_CLI\Dispatcher\CompositeCommand`. + * well as an object that extends `EE\Dispatcher\CompositeCommand`. * - * @param \WP_CLI\Dispatcher\CompositeCommand|string $command + * @param \EE\Dispatcher\CompositeCommand|string $command * * @return bool */ @@ -1199,8 +1091,8 @@ function is_bundled_command( $command ) { if ( null === $classes ) { $classes = array(); - $class_map = WP_CLI_VENDOR_DIR . '/composer/autoload_commands_classmap.php'; - if ( file_exists( WP_CLI_VENDOR_DIR . '/composer/' ) ) { + $class_map = EE_VENDOR_DIR . '/composer/autoload_commands_classmap.php'; + if ( file_exists( EE_VENDOR_DIR . '/composer/' ) ) { $classes = include $class_map; } } @@ -1252,9 +1144,9 @@ function check_proc_available( $context = null, $return = false ) { } $msg = 'The PHP functions `proc_open()` and/or `proc_close()` are disabled. Please check your PHP ini directive `disable_functions` or suhosin settings.'; if ( $context ) { - WP_CLI::error( sprintf( "Cannot do '%s': %s", $context, $msg ) ); + EE::error( sprintf( "Cannot do '%s': %s", $context, $msg ) ); } else { - WP_CLI::error( $msg ); + EE::error( $msg ); } } return true; @@ -1287,7 +1179,7 @@ function past_tense_verb( $verb ) { } /** - * Get the path to the PHP binary used when executing WP-CLI. + * Get the path to the PHP binary used when executing EE. * * Environment values permit specific binaries to be indicated. * @@ -1297,12 +1189,12 @@ function past_tense_verb( $verb ) { * @return string */ function get_php_binary() { - if ( $wp_cli_php_used = getenv( 'WP_CLI_PHP_USED' ) ) { - return $wp_cli_php_used; + if ( $ee_php_used = getenv( 'EE_PHP_USED' ) ) { + return $ee_php_used; } - if ( $wp_cli_php = getenv( 'WP_CLI_PHP' ) ) { - return $wp_cli_php; + if ( $ee_php = getenv( 'EE_PHP' ) ) { + return $ee_php; } // Available since PHP 5.4. @@ -1370,42 +1262,6 @@ function _proc_open_compat_win_env( $cmd, &$env ) { return $cmd; } -/** - * First half of escaping for LIKE special characters % and _ before preparing for MySQL. - * - * Use this only before wpdb::prepare() or esc_sql(). Reversing the order is very bad for security. - * - * Copied from core "wp-includes/wp-db.php". Avoids dependency on WP 4.4 wpdb. - * - * @access public - * - * @param string $text The raw text to be escaped. The input typed by the user should have no - * extra or deleted slashes. - * @return string Text in the form of a LIKE phrase. The output is not SQL safe. Call $wpdb::prepare() - * or real_escape next. - */ -function esc_like( $text ) { - return addcslashes( $text, '_%\\' ); -} - -/** - * Escapes (backticks) MySQL identifiers (aka schema object names) - i.e. column names, table names, and database/index/alias/view etc names. - * See https://dev.mysql.com/doc/refman/5.5/en/identifiers.html - * - * @param string|array $idents A single identifier or an array of identifiers. - * @return string|array An escaped string if given a string, or an array of escaped strings if given an array of strings. - */ -function esc_sql_ident( $idents ) { - $backtick = function ( $v ) { - // Escape any backticks in the identifier by doubling. - return '`' . str_replace( '`', '``', $v ) . '`'; - }; - if ( is_string( $idents ) ) { - return $backtick( $idents ); - } - return array_map( $backtick, $idents ); -} - /** * Check whether a given string is a valid JSON representation. * diff --git a/php/wp-cli.php b/php/wp-cli.php deleted file mode 100644 index afd00d75d..000000000 --- a/php/wp-cli.php +++ /dev/null @@ -1,23 +0,0 @@ -error ) ) { - wp_die( $wpdb->error ); -} - -// Set the database table prefix and the format specifiers for database table columns. -// @codingStandardsIgnoreStart -$GLOBALS['table_prefix'] = $table_prefix; -// @codingStandardsIgnoreEnd -wp_set_wpdb_vars(); - -// Start the WordPress object cache, or an external object cache if the drop-in is present. -wp_start_object_cache(); - -// Attach the default filters. -require ABSPATH . WPINC . '/default-filters.php'; - -// Initialize multisite if enabled. -if ( is_multisite() ) { - Utils\maybe_require( '4.6-alpha-37575', ABSPATH . WPINC . '/class-wp-site-query.php' ); - Utils\maybe_require( '4.6-alpha-37896', ABSPATH . WPINC . '/class-wp-network-query.php' ); - require ABSPATH . WPINC . '/ms-blogs.php'; - require ABSPATH . WPINC . '/ms-settings.php'; -} elseif ( ! defined( 'MULTISITE' ) ) { - define( 'MULTISITE', false ); -} - -register_shutdown_function( 'shutdown_action_hook' ); - -// Stop most of WordPress from being loaded if we just want the basics. -if ( SHORTINIT ) { - return false; -} - -// Load the L10n library. -require_once ABSPATH . WPINC . '/l10n.php'; - -// WP-CLI: Permit Utils\wp_not_installed() to run on < WP 4.0 -apply_filters( 'nocache_headers', array() ); - -// Run the installer if WordPress is not installed. -wp_not_installed(); - -// Load most of WordPress. -require ABSPATH . WPINC . '/class-wp-walker.php'; -require ABSPATH . WPINC . '/class-wp-ajax-response.php'; -require ABSPATH . WPINC . '/formatting.php'; -require ABSPATH . WPINC . '/capabilities.php'; -Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-wp-roles.php' ); -Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-wp-role.php' ); -Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-wp-user.php' ); -require ABSPATH . WPINC . '/query.php'; -Utils\maybe_require( '3.7-alpha-25139', ABSPATH . WPINC . '/date.php' ); -require ABSPATH . WPINC . '/theme.php'; -require ABSPATH . WPINC . '/class-wp-theme.php'; -require ABSPATH . WPINC . '/template.php'; -require ABSPATH . WPINC . '/user.php'; -Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-wp-user-query.php' ); -Utils\maybe_require( '4.0', ABSPATH . WPINC . '/session.php' ); -require ABSPATH . WPINC . '/meta.php'; -Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-wp-meta-query.php' ); -Utils\maybe_require( '4.5-alpha-35776', ABSPATH . WPINC . '/class-wp-metadata-lazyloader.php' ); -require ABSPATH . WPINC . '/general-template.php'; -require ABSPATH . WPINC . '/link-template.php'; -require ABSPATH . WPINC . '/author-template.php'; -require ABSPATH . WPINC . '/post.php'; -Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-walker-page.php' ); -Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-walker-page-dropdown.php' ); -Utils\maybe_require( '4.6-alpha-37890', ABSPATH . WPINC . '/class-wp-post-type.php' ); -Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-wp-post.php' ); -require ABSPATH . WPINC . '/post-template.php'; -Utils\maybe_require( '3.6-alpha-23451', ABSPATH . WPINC . '/revision.php' ); -Utils\maybe_require( '3.6-alpha-23451', ABSPATH . WPINC . '/post-formats.php' ); -require ABSPATH . WPINC . '/post-thumbnail-template.php'; -require ABSPATH . WPINC . '/category.php'; -Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-walker-category.php' ); -Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-walker-category-dropdown.php' ); -require ABSPATH . WPINC . '/category-template.php'; -require ABSPATH . WPINC . '/comment.php'; -Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-wp-comment.php' ); -Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-wp-comment-query.php' ); -Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-walker-comment.php' ); -require ABSPATH . WPINC . '/comment-template.php'; -require ABSPATH . WPINC . '/rewrite.php'; -Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-wp-rewrite.php' ); -require ABSPATH . WPINC . '/feed.php'; -require ABSPATH . WPINC . '/bookmark.php'; -require ABSPATH . WPINC . '/bookmark-template.php'; -require ABSPATH . WPINC . '/kses.php'; -require ABSPATH . WPINC . '/cron.php'; -require ABSPATH . WPINC . '/deprecated.php'; -require ABSPATH . WPINC . '/script-loader.php'; -require ABSPATH . WPINC . '/taxonomy.php'; -Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-wp-term.php' ); -Utils\maybe_require( '4.6-alpha-37575', ABSPATH . WPINC . '/class-wp-term-query.php' ); -Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-wp-tax-query.php' ); -require ABSPATH . WPINC . '/update.php'; -require ABSPATH . WPINC . '/canonical.php'; -require ABSPATH . WPINC . '/shortcodes.php'; -Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/embed.php' ); -require ABSPATH . WPINC . '/class-wp-embed.php'; -require ABSPATH . WPINC . '/media.php'; -Utils\maybe_require( '4.4-alpha-34903', ABSPATH . WPINC . '/class-wp-oembed-controller.php' ); -require ABSPATH . WPINC . '/http.php'; -require_once ABSPATH . WPINC . '/class-http.php'; -Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-wp-http-streams.php' ); -Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-wp-http-curl.php' ); -Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-wp-http-proxy.php' ); -Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-wp-http-cookie.php' ); -Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-wp-http-encoding.php' ); -Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-wp-http-response.php' ); -Utils\maybe_require( '4.6-alpha-37438', ABSPATH . WPINC . '/class-wp-http-requests-response.php' ); -require ABSPATH . WPINC . '/widgets.php'; -Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-wp-widget.php' ); -Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/class-wp-widget-factory.php' ); -require ABSPATH . WPINC . '/nav-menu.php'; -require ABSPATH . WPINC . '/nav-menu-template.php'; -require ABSPATH . WPINC . '/admin-bar.php'; -Utils\maybe_require( '4.4-alpha-34928', ABSPATH . WPINC . '/rest-api.php' ); -Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/rest-api/class-wp-rest-server.php' ); -Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/rest-api/class-wp-rest-response.php' ); -Utils\maybe_require( '4.4-beta4-35719', ABSPATH . WPINC . '/rest-api/class-wp-rest-request.php' ); - -// Load multisite-specific files. -if ( is_multisite() ) { - require ABSPATH . WPINC . '/ms-functions.php'; - require ABSPATH . WPINC . '/ms-default-filters.php'; - require ABSPATH . WPINC . '/ms-deprecated.php'; -} - -// Define constants that rely on the API to obtain the default value. -// Define must-use plugin directory constants, which may be overridden in the sunrise.php drop-in. -wp_plugin_directory_constants(); - -$symlinked_plugins_supported = function_exists( 'wp_register_plugin_realpath' ); -if ( $symlinked_plugins_supported ) { - $GLOBALS['wp_plugin_paths'] = array(); -} - -// Load must-use plugins. -foreach ( wp_get_mu_plugins() as $mu_plugin ) { - include_once $mu_plugin; -} -unset( $mu_plugin ); - -// Load network activated plugins. -if ( is_multisite() ) { - foreach ( wp_get_active_network_plugins() as $network_plugin ) { - if ( $symlinked_plugins_supported ) { - wp_register_plugin_realpath( $network_plugin ); - } - include_once $network_plugin; - } - unset( $network_plugin ); -} - -do_action( 'muplugins_loaded' ); - -if ( is_multisite() ) { - ms_cookie_constants(); -} - -// Define constants after multisite is loaded. Cookie-related constants may be overridden in ms_network_cookies(). -wp_cookie_constants(); - -// Define and enforce our SSL constants -wp_ssl_constants(); - -// Create common globals. -require ABSPATH . WPINC . '/vars.php'; - -// Make taxonomies and posts available to plugins and themes. -// @plugin authors: warning: these get registered again on the init hook. -create_initial_taxonomies(); -create_initial_post_types(); - -// Register the default theme directory root -register_theme_directory( get_theme_root() ); - -// Load active plugins. -foreach ( wp_get_active_and_valid_plugins() as $plugin ) { - if ( $symlinked_plugins_supported ) { - wp_register_plugin_realpath( $plugin ); - } - include_once $plugin; -} -unset( $plugin, $symlinked_plugins_supported ); - -// Load pluggable functions. -require ABSPATH . WPINC . '/pluggable.php'; -require ABSPATH . WPINC . '/pluggable-deprecated.php'; - -// Set internal encoding. -wp_set_internal_encoding(); - -// Run wp_cache_postload() if object cache is enabled and the function exists. -if ( WP_CACHE && function_exists( 'wp_cache_postload' ) ) { - wp_cache_postload(); -} - -do_action( 'plugins_loaded' ); - -// Define constants which affect functionality if not already defined. -wp_functionality_constants(); - -// Add magic quotes and set up $_REQUEST ( $_GET + $_POST ) -wp_magic_quotes(); - -do_action( 'sanitize_comment_cookies' ); - -/** - * WordPress Query object - * @global object $wp_the_query - * @since 2.0.0 - */ -$GLOBALS['wp_the_query'] = new WP_Query(); - -/** - * Holds the reference to @see $wp_the_query - * Use this global for WordPress queries - * @global object $wp_query - * @since 1.5.0 - */ -$GLOBALS['wp_query'] = $GLOBALS['wp_the_query']; - -/** - * Holds the WordPress Rewrite object for creating pretty URLs - * @global object $wp_rewrite - * @since 1.5.0 - */ -$GLOBALS['wp_rewrite'] = new WP_Rewrite(); - -/** - * WordPress Object - * @global object $wp - * @since 2.0.0 - */ -$GLOBALS['wp'] = new WP(); - -/** - * WordPress Widget Factory Object - * @global object $wp_widget_factory - * @since 2.8.0 - */ -$GLOBALS['wp_widget_factory'] = new WP_Widget_Factory(); - -/** - * WordPress User Roles - * @global object $wp_roles - * @since 2.0.0 - */ -$GLOBALS['wp_roles'] = new WP_Roles(); - -do_action( 'setup_theme' ); - -// Define the template related constants. -wp_templating_constants(); - -// Load the default text localization domain. -load_default_textdomain(); - -$locale = get_locale(); -$locale_file = WP_LANG_DIR . "/$locale.php"; -if ( ( 0 === validate_file( $locale ) ) && is_readable( $locale_file ) ) { - require $locale_file; -} -unset( $locale_file ); - -// Pull in locale data after loading text domain. -require_once ABSPATH . WPINC . '/locale.php'; - -/** - * WordPress Locale object for loading locale domain date and various strings. - * @global object $wp_locale - * @since 2.1.0 - */ -$GLOBALS['wp_locale'] = new WP_Locale(); - -// Load the functions for the active theme, for both parent and child theme if applicable. -global $pagenow; -if ( ! defined( 'WP_INSTALLING' ) || 'wp-activate.php' === $pagenow ) { - if ( TEMPLATEPATH !== STYLESHEETPATH && file_exists( STYLESHEETPATH . '/functions.php' ) ) { - include STYLESHEETPATH . '/functions.php'; - } - if ( file_exists( TEMPLATEPATH . '/functions.php' ) ) { - include TEMPLATEPATH . '/functions.php'; - } -} - -do_action( 'after_setup_theme' ); - -// Set up current user. -$GLOBALS['wp']->init(); - -/** - * Most of WP is loaded at this stage, and the user is authenticated. WP continues - * to load on the init hook that follows (e.g. widgets), and many plugins instantiate - * themselves on it for all sorts of reasons (e.g. they need a user, a taxonomy, etc.). - * - * If you wish to plug an action once WP is loaded, use the wp_loaded hook below. - */ -do_action( 'init' ); - -// Check site status -# if ( is_multisite() ) { // WP-CLI -if ( is_multisite() && ! defined( 'WP_INSTALLING' ) ) { - if ( true !== ( $file = ms_site_check() ) ) { - require $file; - die(); - } - unset( $file ); -} - -/** - * This hook is fired once WP, all plugins, and the theme are fully loaded and instantiated. - * - * AJAX requests should use wp-admin/admin-ajax.php. admin-ajax.php can handle requests for - * users not logged in. - * - * @link http://codex.wordpress.org/AJAX_in_Plugins - * - * @since 3.0.0 - */ -do_action( 'wp_loaded' ); diff --git a/phpcs.xml.dist b/phpcs.xml.dist index e34339ca5..5407e84f8 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -1,6 +1,6 @@ - - WordPress Coding Standards for WP-CLI + + WordPress Coding Standards for EE diff --git a/templates/man-params.mustache b/templates/man-params.mustache index dcf83d419..6701b0f6d 100644 --- a/templates/man-params.mustache +++ b/templates/man-params.mustache @@ -14,6 +14,6 @@ {{/parameters}} {{#root_command}} - Run 'wp help ' to get more information on a specific command. + Run 'ee help ' to get more information on a specific command. {{/root_command}} diff --git a/templates/versions.mustache b/templates/versions.mustache deleted file mode 100644 index a52954e82..000000000 --- a/templates/versions.mustache +++ /dev/null @@ -1,4 +0,0 @@ -WordPress version: {{wp-version}} -Database revision: {{db-version}} -TinyMCE version: {{mce-version}} -Package language: {{local-package}} diff --git a/tests/bootstrap.php b/tests/bootstrap.php index d0a2f3b59..757e19f8f 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1,6 +1,6 @@ temp_dir = Utils\get_temp_dir() . uniqid( 'wp-cli-test-behat-tags-', true ); + $this->temp_dir = Utils\get_temp_dir() . uniqid( 'ee-test-behat-tags-', true ); mkdir( $this->temp_dir ); mkdir( $this->temp_dir . '/features' ); } @@ -121,8 +121,8 @@ function test_behat_tags_extension() { if ( ! extension_loaded( 'imagick' ) ) { $expecteds[] = '~@require-extension-imagick'; } - if ( ! extension_loaded( 'intl' ) ) { - $expecteds[] = '~@require-extension-intl'; + if ( ! extension_loaded( 'curl' ) ) { + $expecteds[] = '~@require-extension-curl'; } $expected = '--tags=' . implode( '&&', array_merge( array( '~@github-api', '~@broken' ), $expecteds ) ); $output = exec( "cd {$this->temp_dir}; php $behat_tags" ); diff --git a/tests/test-bundled-commands.php b/tests/test-bundled-commands.php index 912f1620e..500302186 100644 --- a/tests/test-bundled-commands.php +++ b/tests/test-bundled-commands.php @@ -1,7 +1,7 @@ setAccessible( true ); } @@ -24,7 +24,7 @@ function testExtractLastDocComment( $content, $expected ) { $this->assertSame( $expected, $actual ); // Restore. - putenv( false === $is_windows ? 'WP_CLI_TEST_IS_WINDOWS' : "WP_CLI_TEST_IS_WINDOWS=$is_windows" ); + putenv( false === $is_windows ? 'EE_TEST_IS_WINDOWS' : "EE_TEST_IS_WINDOWS=$is_windows" ); } /** @@ -32,12 +32,12 @@ function testExtractLastDocComment( $content, $expected ) { */ function testExtractLastDocCommentWin( $content, $expected ) { // Save and set test env var. - $is_windows = getenv( 'WP_CLI_TEST_IS_WINDOWS' ); - putenv( 'WP_CLI_TEST_IS_WINDOWS=1' ); + $is_windows = getenv( 'EE_TEST_IS_WINDOWS' ); + putenv( 'EE_TEST_IS_WINDOWS=1' ); static $extract_last_doc_comment = null; if ( null === $extract_last_doc_comment ) { - $extract_last_doc_comment = new \ReflectionMethod( 'WP_CLI\Dispatcher\CommandFactory', 'extract_last_doc_comment' ); + $extract_last_doc_comment = new \ReflectionMethod( 'EE\Dispatcher\CommandFactory', 'extract_last_doc_comment' ); $extract_last_doc_comment->setAccessible( true ); } @@ -45,7 +45,7 @@ function testExtractLastDocCommentWin( $content, $expected ) { $this->assertSame( $expected, $actual ); // Restore. - putenv( false === $is_windows ? 'WP_CLI_TEST_IS_WINDOWS' : "WP_CLI_TEST_IS_WINDOWS=$is_windows" ); + putenv( false === $is_windows ? 'EE_TEST_IS_WINDOWS' : "EE_TEST_IS_WINDOWS=$is_windows" ); } function dataProviderExtractLastDocComment() { @@ -82,14 +82,14 @@ function dataProviderExtractLastDocComment() { function testGetDocComment() { // Save and set test env var. - $get_doc_comment = getenv( 'WP_CLI_TEST_GET_DOC_COMMENT' ); - $is_windows = getenv( 'WP_CLI_TEST_IS_WINDOWS' ); + $get_doc_comment = getenv( 'EE_TEST_GET_DOC_COMMENT' ); + $is_windows = getenv( 'EE_TEST_IS_WINDOWS' ); - putenv( 'WP_CLI_TEST_GET_DOC_COMMENT=1' ); - putenv( 'WP_CLI_TEST_IS_WINDOWS=0' ); + putenv( 'EE_TEST_GET_DOC_COMMENT=1' ); + putenv( 'EE_TEST_IS_WINDOWS=0' ); // Make private function accessible. - $get_doc_comment = new \ReflectionMethod( 'WP_CLI\Dispatcher\CommandFactory', 'get_doc_comment' ); + $get_doc_comment = new \ReflectionMethod( 'EE\Dispatcher\CommandFactory', 'get_doc_comment' ); $get_doc_comment->setAccessible( true ); if ( ! class_exists( 'CommandFactoryTests_Get_Doc_Comment_1_Command', false ) ) { @@ -244,20 +244,20 @@ function testGetDocComment() { $this->assertSame( $expected, $actual ); // Restore. - putenv( false === $get_doc_comment ? 'WP_CLI_TEST_GET_DOC_COMMENT' : "WP_CLI_TEST_GET_DOC_COMMENT=$get_doc_comment" ); - putenv( false === $is_windows ? 'WP_CLI_TEST_IS_WINDOWS' : "WP_CLI_TEST_IS_WINDOWS=$is_windows" ); + putenv( false === $get_doc_comment ? 'EE_TEST_GET_DOC_COMMENT' : "EE_TEST_GET_DOC_COMMENT=$get_doc_comment" ); + putenv( false === $is_windows ? 'EE_TEST_IS_WINDOWS' : "EE_TEST_IS_WINDOWS=$is_windows" ); } function testGetDocCommentWin() { // Save and set test env var. - $get_doc_comment = getenv( 'WP_CLI_TEST_GET_DOC_COMMENT' ); - $is_windows = getenv( 'WP_CLI_TEST_IS_WINDOWS' ); + $get_doc_comment = getenv( 'EE_TEST_GET_DOC_COMMENT' ); + $is_windows = getenv( 'EE_TEST_IS_WINDOWS' ); - putenv( 'WP_CLI_TEST_GET_DOC_COMMENT=1' ); - putenv( 'WP_CLI_TEST_IS_WINDOWS=1' ); + putenv( 'EE_TEST_GET_DOC_COMMENT=1' ); + putenv( 'EE_TEST_IS_WINDOWS=1' ); // Make private function accessible. - $get_doc_comment = new \ReflectionMethod( 'WP_CLI\Dispatcher\CommandFactory', 'get_doc_comment' ); + $get_doc_comment = new \ReflectionMethod( 'EE\Dispatcher\CommandFactory', 'get_doc_comment' ); $get_doc_comment->setAccessible( true ); if ( ! class_exists( 'CommandFactoryTests_Get_Doc_Comment_1_Command', false ) ) { @@ -412,7 +412,7 @@ function testGetDocCommentWin() { $this->assertSame( $expected, $actual ); // Restore. - putenv( false === $get_doc_comment ? 'WP_CLI_TEST_GET_DOC_COMMENT' : "WP_CLI_TEST_GET_DOC_COMMENT=$get_doc_comment" ); - putenv( false === $is_windows ? 'WP_CLI_TEST_IS_WINDOWS' : "WP_CLI_TEST_IS_WINDOWS=$is_windows" ); + putenv( false === $get_doc_comment ? 'EE_TEST_GET_DOC_COMMENT' : "EE_TEST_GET_DOC_COMMENT=$get_doc_comment" ); + putenv( false === $is_windows ? 'EE_TEST_IS_WINDOWS' : "EE_TEST_IS_WINDOWS=$is_windows" ); } } diff --git a/tests/test-configurator.php b/tests/test-configurator.php index ea13aaeb3..cd20e36c5 100644 --- a/tests/test-configurator.php +++ b/tests/test-configurator.php @@ -1,6 +1,6 @@ assertSame( EE\Utils\get_php_binary(), EE::get_php_binary() ); + } +} diff --git a/tests/test-extractor.php b/tests/test-extractor.php index 330b99390..ccab128a9 100644 --- a/tests/test-extractor.php +++ b/tests/test-extractor.php @@ -1,11 +1,11 @@ setAccessible( true ); - self::$prev_logger = $class_wp_cli_logger->getValue(); + $class_ee_logger = new \ReflectionProperty( 'EE', 'logger' ); + $class_ee_logger->setAccessible( true ); + self::$prev_logger = $class_ee_logger->getValue(); - self::$logger = new \WP_CLI\Loggers\Execution; - WP_CLI::set_logger( self::$logger ); + self::$logger = new \EE\Loggers\Execution; + EE::set_logger( self::$logger ); // Remove any failed tests detritus. $temp_dirs = Utils\get_temp_dir() . self::$copy_overwrite_files_prefix . '*'; @@ -44,7 +44,7 @@ public function setUp() { public function tearDown() { // Restore logger. - WP_CLI::set_logger( self::$prev_logger ); + EE::set_logger( self::$prev_logger ); parent::tearDown(); } @@ -112,11 +112,24 @@ public function test_extract_tarball() { // Create test tarball. $output = array(); $return_var = -1; - // Need --force-local for Windows to avoid "C:" being interpreted as being on remote machine. - exec( Utils\esc_cmd( 'tar czvf %1$s --force-local --directory=%2$s/src wordpress', $tarball, $temp_dir ), $output, $return_var ); + // Need --force-local for Windows to avoid "C:" being interpreted as being on remote machine, and redirect for Mac as outputs verbosely on STDERR. + $cmd = 'tar czvf %1$s' . ( Utils\is_windows() ? ' --force-local' : '' ) . ' --directory=%2$s/src wordpress 2>&1'; + exec( Utils\esc_cmd( $cmd, $tarball, $temp_dir ), $output, $return_var ); $this->assertSame( 0, $return_var ); $this->assertFalse( empty( $output ) ); + + // Normalize (Mac) output. + $output = array_map( function ( $v ) { + if ( 'a ' === substr( $v, 0, 2 ) ) { + $v = substr( $v, 2 ); + } + if ( '/' !== substr( $v, -1 ) && false === strpos( $v, '.' ) ) { + $v .= '/'; + } + return $v; + }, $output ); sort( $output ); + $this->assertSame( self::recursive_scandir( $src_dir ), $output ); // Test. diff --git a/tests/test-file-cache.php b/tests/test-file-cache.php index 1ab58e6fb..eec03c2cb 100644 --- a/tests/test-file-cache.php +++ b/tests/test-file-cache.php @@ -1,9 +1,9 @@ assertSame( $cache_dir . '/', $cache->get_root() ); @@ -32,16 +32,16 @@ public function testGetRoot() { } public function test_ensure_dir_exists() { - $class_wp_cli_logger = new ReflectionProperty( 'WP_CLI', 'logger' ); - $class_wp_cli_logger->setAccessible( true ); - $prev_logger = $class_wp_cli_logger->getValue(); + $class_ee_logger = new ReflectionProperty( 'EE', 'logger' ); + $class_ee_logger->setAccessible( true ); + $prev_logger = $class_ee_logger->getValue(); - $logger = new WP_CLI\Loggers\Execution; - WP_CLI::set_logger( $logger ); + $logger = new EE\Loggers\Execution; + EE::set_logger( $logger ); $max_size = 32; $ttl = 60; - $cache_dir = Utils\get_temp_dir() . uniqid( 'wp-cli-test-file-cache', true ); + $cache_dir = Utils\get_temp_dir() . uniqid( 'ee-test-file-cache', true ); $cache = new FileCache( $cache_dir, $ttl, $max_size ); $test_class = new ReflectionClass( $cache ); @@ -79,6 +79,6 @@ public function test_ensure_dir_exists() { rmdir( $cache_dir . '/test1' ); unlink( $cache_dir . '/test2' ); rmdir( $cache_dir ); - $class_wp_cli_logger->setValue( $prev_logger ); + $class_ee_logger->setValue( $prev_logger ); } } diff --git a/tests/test-help.php b/tests/test-help.php index 9cbbb2a62..d9c0441b4 100644 --- a/tests/test-help.php +++ b/tests/test-help.php @@ -1,9 +1,9 @@ assertSame( $expected, $result ); - $desc = 'This is a [reference link](https://wordpress.org/) and [second link](http://wp-cli.org/). It should be displayed very nice!'; + $desc = 'This is a [reference link](https://wordpress.org/) and [second link](http://ee.org/). It should be displayed very nice!'; $result = $method->invokeArgs( null, array( $desc ) ); $expected =<<assertSame( $expected, $result ); $desc =<<invokeArgs( null, array( $desc ) ); @@ -48,13 +48,13 @@ public function test_parse_reference_links() { --- [1] https://wordpress.org/ -[2] http://wp-cli.org/ +[2] http://ee.org/ EOL; $this->assertSame( $expected, $result ); $desc =<<setAccessible( true ); @@ -60,7 +60,7 @@ function testExecutionLogger() { // Set debug. $runner_config->setValue( $runner, array( 'debug' => true ) ); - $logger = new WP_CLI\Loggers\Execution; + $logger = new EE\Loggers\Execution; // Standard use. diff --git a/tests/test-process.php b/tests/test-process.php index 562451597..e51b9782f 100644 --- a/tests/test-process.php +++ b/tests/test-process.php @@ -1,7 +1,7 @@ run( $data, $serialised ); - } - - function testReplaceString() { - $orig = 'foo'; - $replacement = self::recursive_unserialize_replace( 'foo', 'bar', $orig ); - $this->assertEquals( 'bar', $replacement ); - } - - function testPrivateConstructor() { - $old_obj = ClassWithPrivateConstructor::get_instance(); - - $new_obj = self::recursive_unserialize_replace( 'foo', 'bar', $old_obj, false, true ); - $this->assertEquals( 'bar', $new_obj->prop ); - } - - function testObjectLoop() { - $old_object = new stdClass(); - $old_object->prop = 'foo'; - $old_object->self = $old_object; - - $new_obj = self::recursive_unserialize_replace( 'foo', 'bar', $old_object, false, true ); - $this->assertEquals( 'bar', $new_obj->prop ); - } - - function testArrayLoop() { - $old_array = array( 'prop' => 'foo' ); - $old_array['self'] = &$old_array; - - $new_array = self::recursive_unserialize_replace( 'foo', 'bar', $old_array, false, true ); - $this->assertEquals( 'bar', $new_array['prop'] ); - } - - function testArraySameValues() { - $old_array = array( - 'prop1' => array( - 'foo', - ), - 'prop2' => array( - 'foo', - ), - ); - $new_array = self::recursive_unserialize_replace( 'foo', 'bar', $old_array, false, true ); - $this->assertEquals( 'bar', $new_array['prop1'][0] ); - $this->assertEquals( 'bar', $new_array['prop2'][0] ); - } - - function testMixedObjectArrayLoop() { - $old_object = new stdClass(); - $old_object->prop = 'foo'; - $old_object->array = array('prop' => 'foo'); - $old_object->array['object'] = $old_object; - - $new_object = self::recursive_unserialize_replace( 'foo', 'bar', $old_object, false, true ); - $this->assertEquals( 'bar', $new_object->prop ); - $this->assertEquals( 'bar', $new_object->array['prop']); - } - - function testMixedArrayObjectLoop() { - $old_array = array( 'prop' => 'foo', 'object' => new stdClass() ); - $old_array['object']->prop = 'foo'; - $old_array['object']->array = &$old_array; - - $new_array = self::recursive_unserialize_replace( 'foo', 'bar', $old_array, false, true ); - $this->assertEquals( 'bar', $new_array['prop'] ); - $this->assertEquals( 'bar', $new_array['object']->prop); - } -} - - -class ClassWithPrivateConstructor { - - public $prop = 'foo'; - - private function __construct() {} - - public static function get_instance() { - return new self; - } -} diff --git a/tests/test-synopsis.php b/tests/test-synopsis.php index 418d74d81..414f32885 100644 --- a/tests/test-synopsis.php +++ b/tests/test-synopsis.php @@ -1,6 +1,6 @@ assertSame( '/usr/bin/env cmd', Utils\force_env_on_nix_systems( 'cmd' ) ); $this->assertSame( '/usr/bin/env cmd', Utils\force_env_on_nix_systems( '/usr/bin/env cmd' ) ); - putenv( 'WP_CLI_TEST_IS_WINDOWS=1' ); + putenv( 'EE_TEST_IS_WINDOWS=1' ); $this->assertSame( 'cmd', Utils\force_env_on_nix_systems( 'cmd' ) ); $this->assertSame( 'cmd', Utils\force_env_on_nix_systems( '/usr/bin/env cmd' ) ); - putenv( false === $env_is_windows ? 'WP_CLI_TEST_IS_WINDOWS' : "WP_CLI_TEST_IS_WINDOWS=$env_is_windows" ); + putenv( false === $env_is_windows ? 'EE_TEST_IS_WINDOWS' : "EE_TEST_IS_WINDOWS=$env_is_windows" ); } public function testGetHomeDir() { @@ -332,50 +332,28 @@ public function testNormalizeEols() { public function testGetTempDir() { $this->assertTrue( '/' === substr( Utils\get_temp_dir(), -1 ) ); - - // INI directive `sys_temp_dir` introduced PHP 5.5.0. - if ( version_compare( PHP_VERSION, '5.5.0', '>=' ) ) { - - // `sys_temp_dir` set to unwritable. - - $cmd = 'php ' . escapeshellarg( '-dsys_temp_dir=\\tmp\\' ) . ' php/boot-fs.php --skip-wordpress eval ' . escapeshellarg( 'echo WP_CLI\\Utils\\get_temp_dir();' ) . ' 2>&1'; - $output = array(); - exec( $cmd, $output ); - $output = trim( implode( "\n", $output ) ); - $this->assertTrue( false !== strpos( $output, 'Warning' ) ); - $this->assertTrue( false !== strpos( $output, 'writable' ) ); - $this->assertTrue( false !== strpos( $output, '\\tmp/' ) ); - - // `sys_temp_dir` unset. - - $cmd = 'php ' . escapeshellarg( '-dsys_temp_dir=' ) . ' php/boot-fs.php --skip-wordpress eval ' . escapeshellarg( 'echo WP_CLI\\Utils\\get_temp_dir();' ) . ' 2>&1'; - $output = array(); - exec( $cmd, $output ); - $output = trim( implode( "\n", $output ) ); - $this->assertTrue( '/' === substr( $output, -1 ) ); - } } public function testHttpRequestBadAddress() { - // Save WP_CLI state. - $class_wp_cli_logger = new \ReflectionProperty( 'WP_CLI', 'logger' ); - $class_wp_cli_logger->setAccessible( true ); - $class_wp_cli_capture_exit = new \ReflectionProperty( 'WP_CLI', 'capture_exit' ); - $class_wp_cli_capture_exit->setAccessible( true ); + // Save EE state. + $class_ee_logger = new \ReflectionProperty( 'EE', 'logger' ); + $class_ee_logger->setAccessible( true ); + $class_ee_capture_exit = new \ReflectionProperty( 'EE', 'capture_exit' ); + $class_ee_capture_exit->setAccessible( true ); - $prev_logger = $class_wp_cli_logger->getValue(); - $prev_capture_exit = $class_wp_cli_capture_exit->getValue(); + $prev_logger = $class_ee_logger->getValue(); + $prev_capture_exit = $class_ee_capture_exit->getValue(); // Enable exit exception. - $class_wp_cli_capture_exit->setValue( true ); + $class_ee_capture_exit->setValue( true ); - $logger = new \WP_CLI\Loggers\Execution; - WP_CLI::set_logger( $logger ); + $logger = new \EE\Loggers\Execution; + EE::set_logger( $logger ); $exception = null; try { Utils\http_request( 'GET', 'https://nosuchhost_asdf_asdf_asdf.com', null /*data*/, array() /*headers*/, array( 'timeout' => 0.01 ) ); - } catch ( \WP_CLI\ExitException $ex ) { + } catch ( \EE\ExitException $ex ) { $exception = $ex; } $this->assertTrue( null !== $exception ); @@ -385,8 +363,8 @@ public function testHttpRequestBadAddress() { $this->assertTrue( 0 === strpos( $logger->stderr, 'Error: Failed to get url' ) ); // Restore. - $class_wp_cli_logger->setValue( $prev_logger ); - $class_wp_cli_capture_exit->setValue( $prev_capture_exit ); + $class_ee_logger->setValue( $prev_logger ); + $class_ee_capture_exit->setValue( $prev_capture_exit ); } public function testHttpRequestBadCAcert() { @@ -394,17 +372,17 @@ public function testHttpRequestBadCAcert() { $this->markTestSkipped( 'curl not available' ); } - // Save WP_CLI state. - $class_wp_cli_logger = new \ReflectionProperty( 'WP_CLI', 'logger' ); - $class_wp_cli_logger->setAccessible( true ); + // Save EE state. + $class_ee_logger = new \ReflectionProperty( 'EE', 'logger' ); + $class_ee_logger->setAccessible( true ); - $prev_logger = $class_wp_cli_logger->getValue(); + $prev_logger = $class_ee_logger->getValue(); $have_bad_cacert = false; $created_dirs = array(); // Hack to create bad CAcert, using Utils\get_vendor_paths() preference for a path as part of a Composer-installed larger project. - $vendor_dir = WP_CLI_ROOT . '/../../../vendor'; + $vendor_dir = EE_ROOT . '/../../../vendor'; $cert_path = '/rmccue/requests/library/Requests/Transport/cacert.pem'; $bad_cacert_path = $vendor_dir . $cert_path; if ( ! file_exists( $bad_cacert_path ) ) { @@ -432,8 +410,8 @@ public function testHttpRequestBadCAcert() { $this->markTestSkipped( 'Unable to create bad CAcert.' ); } - $logger = new \WP_CLI\Loggers\Execution; - WP_CLI::set_logger( $logger ); + $logger = new \EE\Loggers\Execution; + EE::set_logger( $logger ); Utils\http_request( 'GET', 'https://example.com' ); @@ -448,39 +426,7 @@ public function testHttpRequestBadCAcert() { $this->assertFalse( strpos( $logger->stderr, 'Error' ) ); // Restore. - $class_wp_cli_logger->setValue( $prev_logger ); - } - - public function testRunMysqlCommandProcDisabled() { - $err_msg = 'Error: Cannot do \'run_mysql_command\': The PHP functions `proc_open()` and/or `proc_close()` are disabled'; - - $cmd = 'php -ddisable_functions=proc_open php/boot-fs.php --skip-wordpress eval ' . escapeshellarg( 'WP_CLI\\Utils\\run_mysql_command( null, array() );' ) . ' 2>&1'; - $output = array(); - exec( $cmd, $output ); - $output = trim( implode( "\n", $output ) ); - $this->assertTrue( false !== strpos( $output, $err_msg ) ); - - $cmd = 'php -ddisable_functions=proc_close php/boot-fs.php --skip-wordpress eval ' . escapeshellarg( 'WP_CLI\\Utils\\run_mysql_command( null, array() );' ) . ' 2>&1'; - $output = array(); - exec( $cmd, $output ); - $output = trim( implode( "\n", $output ) ); - $this->assertTrue( false !== strpos( $output, $err_msg ) ); - } - - public function testLaunchEditorForInputProcDisabled() { - $err_msg = 'Error: Cannot do \'launch_editor_for_input\': The PHP functions `proc_open()` and/or `proc_close()` are disabled'; - - $cmd = 'php -ddisable_functions=proc_open php/boot-fs.php --skip-wordpress eval ' . escapeshellarg( 'WP_CLI\\Utils\\launch_editor_for_input( null, null );' ) . ' 2>&1'; - $output = array(); - exec( $cmd, $output ); - $output = trim( implode( "\n", $output ) ); - $this->assertTrue( false !== strpos( $output, $err_msg ) ); - - $cmd = 'php -ddisable_functions=proc_close php/boot-fs.php --skip-wordpress eval ' . escapeshellarg( 'WP_CLI\\Utils\\launch_editor_for_input( null, null );' ) . ' 2>&1'; - $output = array(); - exec( $cmd, $output ); - $output = trim( implode( "\n", $output ) ); - $this->assertTrue( false !== strpos( $output, $err_msg ) ); + $class_ee_logger->setValue( $prev_logger ); } /** @@ -524,20 +470,23 @@ public function dataPastTenseVerb() { * @dataProvider dataExpandGlobs */ public function testExpandGlobs( $path, $expected ) { - $expand_globs_no_glob_brace = getenv( 'WP_CLI_TEST_EXPAND_GLOBS_NO_GLOB_BRACE' ); + $expand_globs_no_glob_brace = getenv( 'EE_TEST_EXPAND_GLOBS_NO_GLOB_BRACE' ); $dir = __DIR__ . '/data/expand_globs/'; $expected = array_map( function ( $v ) use ( $dir ) { return $dir . $v; }, $expected ); + sort( $expected ); - putenv( 'WP_CLI_TEST_EXPAND_GLOBS_NO_GLOB_BRACE=0' ); + putenv( 'EE_TEST_EXPAND_GLOBS_NO_GLOB_BRACE=0' ); $out = Utils\expand_globs( $dir . $path ); + sort( $out ); $this->assertSame( $expected, $out ); - putenv( 'WP_CLI_TEST_EXPAND_GLOBS_NO_GLOB_BRACE=1' ); + putenv( 'EE_TEST_EXPAND_GLOBS_NO_GLOB_BRACE=1' ); $out = Utils\expand_globs( $dir . $path ); + sort( $out ); $this->assertSame( $expected, $out ); - putenv( false === $expand_globs_no_glob_brace ? 'WP_CLI_TEST_EXPAND_GLOBS_NO_GLOB_BRACE' : "WP_CLI_TEST_EXPAND_GLOBS_NO_GLOB_BRACE=$expand_globs_no_glob_brace" ); + putenv( false === $expand_globs_no_glob_brace ? 'EE_TEST_EXPAND_GLOBS_NO_GLOB_BRACE' : "EE_TEST_EXPAND_GLOBS_NO_GLOB_BRACE=$expand_globs_no_glob_brace" ); } public function dataExpandGlobs() { @@ -562,34 +511,34 @@ public function dataExpandGlobs() { * @dataProvider dataReportBatchOperationResults */ public function testReportBatchOperationResults( $stdout, $stderr, $noun, $verb, $total, $successes, $failures, $skips ) { - // Save WP_CLI state. - $class_wp_cli_logger = new \ReflectionProperty( 'WP_CLI', 'logger' ); - $class_wp_cli_logger->setAccessible( true ); - $class_wp_cli_capture_exit = new \ReflectionProperty( 'WP_CLI', 'capture_exit' ); - $class_wp_cli_capture_exit->setAccessible( true ); + // Save EE state. + $class_ee_logger = new \ReflectionProperty( 'EE', 'logger' ); + $class_ee_logger->setAccessible( true ); + $class_ee_capture_exit = new \ReflectionProperty( 'EE', 'capture_exit' ); + $class_ee_capture_exit->setAccessible( true ); - $prev_logger = $class_wp_cli_logger->getValue(); - $prev_capture_exit = $class_wp_cli_capture_exit->getValue(); + $prev_logger = $class_ee_logger->getValue(); + $prev_capture_exit = $class_ee_capture_exit->getValue(); // Enable exit exception. - $class_wp_cli_capture_exit->setValue( true ); + $class_ee_capture_exit->setValue( true ); - $logger = new \WP_CLI\Loggers\Execution; - WP_CLI::set_logger( $logger ); + $logger = new \EE\Loggers\Execution; + EE::set_logger( $logger ); $exception = null; try { Utils\report_batch_operation_results( $noun, $verb, $total, $successes, $failures, $skips ); - } catch ( \WP_CLI\ExitException $ex ) { + } catch ( \EE\ExitException $ex ) { $exception = $ex; } $this->assertSame( $stdout, $logger->stdout ); $this->assertSame( $stderr, $logger->stderr ); // Restore. - $class_wp_cli_logger->setValue( $prev_logger ); - $class_wp_cli_capture_exit->setValue( $prev_capture_exit ); + $class_ee_logger->setValue( $prev_logger ); + $class_ee_capture_exit->setValue( $prev_capture_exit ); } public function dataReportBatchOperationResults() { @@ -611,44 +560,44 @@ public function dataReportBatchOperationResults() { } public function testGetPHPBinary() { - $env_php_used = getenv( 'WP_CLI_PHP_USED' ); - $env_php = getenv( 'WP_CLI_PHP' ); + $env_php_used = getenv( 'EE_PHP_USED' ); + $env_php = getenv( 'EE_PHP' ); - putenv( 'WP_CLI_PHP_USED' ); - putenv( 'WP_CLI_PHP' ); + putenv( 'EE_PHP_USED' ); + putenv( 'EE_PHP' ); $get_php_binary = Utils\get_php_binary(); $this->assertTrue( is_executable( $get_php_binary ) ); - putenv( 'WP_CLI_PHP_USED=/my-php-5.3' ); - putenv( 'WP_CLI_PHP' ); + putenv( 'EE_PHP_USED=/my-php-5.3' ); + putenv( 'EE_PHP' ); $get_php_binary = Utils\get_php_binary(); $this->assertSame( $get_php_binary, '/my-php-5.3' ); - putenv( 'WP_CLI_PHP=/my-php-7.3' ); + putenv( 'EE_PHP=/my-php-7.3' ); $get_php_binary = Utils\get_php_binary(); - $this->assertSame( $get_php_binary, '/my-php-5.3' ); // WP_CLI_PHP_USED wins. + $this->assertSame( $get_php_binary, '/my-php-5.3' ); // EE_PHP_USED wins. - putenv( 'WP_CLI_PHP_USED' ); + putenv( 'EE_PHP_USED' ); $get_php_binary = Utils\get_php_binary(); $this->assertSame( $get_php_binary, '/my-php-7.3' ); - putenv( false === $env_php_used ? 'WP_CLI_PHP_USED' : "WP_CLI_PHP_USED=$env_php_used" ); - putenv( false === $env_php ? 'WP_CLI_PHP' : "WP_CLI_PHP=$env_php" ); + putenv( false === $env_php_used ? 'EE_PHP_USED' : "EE_PHP_USED=$env_php_used" ); + putenv( false === $env_php ? 'EE_PHP' : "EE_PHP=$env_php" ); } /** * @dataProvider dataProcOpenCompatWinEnv */ public function testProcOpenCompatWinEnv( $cmd, $env, $expected_cmd, $expected_env ) { - $env_is_windows = getenv( 'WP_CLI_TEST_IS_WINDOWS' ); + $env_is_windows = getenv( 'EE_TEST_IS_WINDOWS' ); - putenv( 'WP_CLI_TEST_IS_WINDOWS=1' ); + putenv( 'EE_TEST_IS_WINDOWS=1' ); $cmd = Utils\_proc_open_compat_win_env( $cmd, $env ); $this->assertSame( $expected_cmd, $cmd ); $this->assertSame( $expected_env, $env ); - putenv( false === $env_is_windows ? 'WP_CLI_TEST_IS_WINDOWS' : "WP_CLI_TEST_IS_WINDOWS=$env_is_windows" ); + putenv( false === $env_is_windows ? 'EE_TEST_IS_WINDOWS' : "EE_TEST_IS_WINDOWS=$env_is_windows" ); } function dataProcOpenCompatWinEnv() { @@ -672,30 +621,6 @@ function dataProcOpenCompatWinEnv() { ); } - /** - * Copied from core "tests/phpunit/tests/db.php" (adapted to not use `$wpdb`). - */ - function test_esc_like() { - $inputs = array( - 'howdy%', //Single Percent - 'howdy_', //Single Underscore - 'howdy\\', //Single slash - 'howdy\\howdy%howdy_', //The works - 'howdy\'"[[]*#[^howdy]!+)(*&$#@!~|}{=--`/.,<>?', //Plain text - ); - $expected = array( - 'howdy\\%', - 'howdy\\_', - 'howdy\\\\', - 'howdy\\\\howdy\\%howdy\\_', - 'howdy\'"[[]*#[^howdy]!+)(*&$#@!~|}{=--`/.,<>?', - ); - - foreach ( $inputs as $key => $input ) { - $this->assertEquals( $expected[ $key ], Utils\esc_like( $input ) ); - } - } - /** @dataProvider dataIsJson */ public function testIsJson( $argument, $ignore_scalars, $expected ) { $this->assertEquals( $expected, Utils\is_json( $argument, $ignore_scalars ) ); diff --git a/tests/test-wp-cli.php b/tests/test-wp-cli.php deleted file mode 100644 index 209fef8c7..000000000 --- a/tests/test-wp-cli.php +++ /dev/null @@ -1,24 +0,0 @@ -&1'; - $output = array(); - exec( $cmd, $output ); - $output = trim( implode( "\n", $output ) ); - $this->assertTrue( false !== strpos( $output, $err_msg ) ); - - $cmd = 'php -ddisable_functions=proc_close php/boot-fs.php --skip-wordpress eval ' . escapeshellarg( 'WP_CLI::launch( null );' ) . ' 2>&1'; - $output = array(); - exec( $cmd, $output ); - $output = trim( implode( "\n", $output ) ); - $this->assertTrue( false !== strpos( $output, $err_msg ) ); - } - - public function testGetPHPBinary() { - $this->assertSame( WP_CLI\Utils\get_php_binary(), WP_CLI::get_php_binary() ); - } -} diff --git a/tests/test-wp-version-compare.php b/tests/test-wp-version-compare.php deleted file mode 100644 index 73c320930..000000000 --- a/tests/test-wp-version-compare.php +++ /dev/null @@ -1,78 +0,0 @@ -assertTrue( Utils\wp_version_compare( '4.8', '>=' ) ); - $this->assertFalse( Utils\wp_version_compare( '4.8', '<' ) ); - $this->assertFalse( Utils\wp_version_compare( '4.9-alpha-40870-src', '>' ) ); - $this->assertTrue( Utils\wp_version_compare( '4.9-alpha-40870-src', '=' ) ); - $this->assertFalse( Utils\wp_version_compare( '4.9-alpha-40870-src', '<' ) ); - $this->assertTrue( Utils\wp_version_compare( '4.9-beta1', '<' ) ); - $this->assertFalse( Utils\wp_version_compare( '4.9-beta1', '>' ) ); - $this->assertFalse( Utils\wp_version_compare( '4.9-beta1-45000', '>' ) ); - $this->assertTrue( Utils\wp_version_compare( '4.9-beta2-46000', '<' ) ); - $this->assertFalse( Utils\wp_version_compare( '4.9', '>=' ) ); - $this->assertTrue( Utils\wp_version_compare( '4.9', '<' ) ); - - $GLOBALS['wp_version'] = '4.9-beta1-45000'; - $this->assertTrue( Utils\wp_version_compare( '4.8', '>=' ) ); - $this->assertFalse( Utils\wp_version_compare( '4.8', '<' ) ); - $this->assertTrue( Utils\wp_version_compare( '4.9-alpha-40870-src', '>' ) ); - $this->assertFalse( Utils\wp_version_compare( '4.9-beta1', '<' ) ); - $this->assertTrue( Utils\wp_version_compare( '4.9-beta1', '>' ) ); - $this->assertTrue( Utils\wp_version_compare( '4.9-beta1-45000', '>=' ) ); - $this->assertTrue( Utils\wp_version_compare( '4.9-beta1-45000', '=' ) ); - $this->assertFalse( Utils\wp_version_compare( '4.9-beta1-45000', '>' ) ); - $this->assertTrue( Utils\wp_version_compare( '4.9-beta2-46000', '<' ) ); - $this->assertFalse( Utils\wp_version_compare( '4.9-beta2-46000', '>=' ) ); - $this->assertFalse( Utils\wp_version_compare( '4.9', '>=' ) ); - $this->assertTrue( Utils\wp_version_compare( '4.9', '<' ) ); - - $GLOBALS['wp_version'] = '4.9-beta2-46000'; - $this->assertTrue( Utils\wp_version_compare( '4.8', '>=' ) ); - $this->assertFalse( Utils\wp_version_compare( '4.8', '<' ) ); - $this->assertTrue( Utils\wp_version_compare( '4.9-alpha-40870-src', '>' ) ); - $this->assertFalse( Utils\wp_version_compare( '4.9-alpha-40870-src', '=' ) ); - $this->assertFalse( Utils\wp_version_compare( '4.9-beta1', '<' ) ); - $this->assertTrue( Utils\wp_version_compare( '4.9-beta1', '>' ) ); - $this->assertTrue( Utils\wp_version_compare( '4.9-beta1-45000', '>' ) ); - $this->assertTrue( Utils\wp_version_compare( '4.9-beta2-45550', '>' ) ); - $this->assertFalse( Utils\wp_version_compare( '4.9-beta2-45550', '<' ) ); - $this->assertFalse( Utils\wp_version_compare( '4.9', '>=' ) ); - $this->assertTrue( Utils\wp_version_compare( '4.9', '<' ) ); - - $GLOBALS['wp_version'] = '4.9-rc1-47000'; - $this->assertTrue( Utils\wp_version_compare( '4.8', '>=' ) ); - $this->assertFalse( Utils\wp_version_compare( '4.8', '<' ) ); - $this->assertTrue( Utils\wp_version_compare( '4.9-alpha-40870-src', '>' ) ); - $this->assertFalse( Utils\wp_version_compare( '4.9-alpha-40870-src', '=' ) ); - $this->assertFalse( Utils\wp_version_compare( '4.9-beta1', '<' ) ); - $this->assertTrue( Utils\wp_version_compare( '4.9-beta1', '>' ) ); - $this->assertTrue( Utils\wp_version_compare( '4.9-beta1-45000', '>' ) ); - $this->assertTrue( Utils\wp_version_compare( '4.9-beta2-45550', '>' ) ); - $this->assertFalse( Utils\wp_version_compare( '4.9-beta2-45550', '<' ) ); - $this->assertTrue( Utils\wp_version_compare( '4.9-rc2', '<' ) ); - $this->assertTrue( Utils\wp_version_compare( '4.9-rc2-48000', '<' ) ); - $this->assertFalse( Utils\wp_version_compare( '4.9', '>=' ) ); - $this->assertTrue( Utils\wp_version_compare( '4.9', '<' ) ); - - $GLOBALS['wp_version'] = '4.9'; - $this->assertTrue( Utils\wp_version_compare( '4.8', '>=' ) ); - $this->assertFalse( Utils\wp_version_compare( '4.8', '<' ) ); - $this->assertTrue( Utils\wp_version_compare( '4.9-alpha-40870-src', '>' ) ); - $this->assertFalse( Utils\wp_version_compare( '4.9-alpha-40870-src', '<' ) ); - $this->assertTrue( Utils\wp_version_compare( '4.9-beta1-45000', '>' ) ); - $this->assertFalse( Utils\wp_version_compare( '4.9-beta1', '<' ) ); - $this->assertTrue( Utils\wp_version_compare( '4.9-beta1', '>' ) ); - $this->assertTrue( Utils\wp_version_compare( '4.9', '>=' ) ); - $this->assertFalse( Utils\wp_version_compare( '4.9', '<' ) ); - } - -} diff --git a/utils/auto-composer-update.sh b/utils/auto-composer-update.sh index ce3c47c9b..e3fa84dd9 100755 --- a/utils/auto-composer-update.sh +++ b/utils/auto-composer-update.sh @@ -9,16 +9,16 @@ date -if [ -z "$WP_CLI_DIR" ]; then - echo 'Please set $WP_CLI_DIR' +if [ -z "$EE_DIR" ]; then + echo 'Please set $EE_DIR' exit 1 fi set -ex -cd $WP_CLI_DIR +cd $EE_DIR -# Reset WP-CLI directory to baseline +# Reset EE directory to baseline git checkout -f master git pull origin master composer install diff --git a/utils/contrib-list.php b/utils/contrib-list.php deleted file mode 100644 index 3abd62de4..000000000 --- a/utils/contrib-list.php +++ /dev/null @@ -1,205 +0,0 @@ -] - * : Render output in a specific format. - * --- - * default: markdown - * options: - * - markdown - * - html - * --- - * - * @when before_wp_load - */ - public function __invoke( $_, $assoc_args ) { - - $contributors = array(); - $contributor_count = 0; - $pull_request_count = 0; - - // Get the contributors to the current open large project milestones - foreach( array( 'wp-cli/wp-cli', 'wp-cli/handbook', 'wp-cli/wp-cli.github.com' ) as $repo ) { - $milestones = self::get_project_milestones( $repo ); - // Cheap way to get the latest milestone - $milestone = array_shift( $milestones ); - WP_CLI::log( 'Current open ' . $repo . ' milestone: ' . $milestone->title ); - $pull_requests = self::get_project_milestone_pull_requests( $repo, $milestone->number ); - $repo_contributors = self::parse_contributors_from_pull_requests( $pull_requests ); - WP_CLI::log( ' - Contributors: ' . count( $repo_contributors ) ); - WP_CLI::log( ' - Pull requests: ' . count( $pull_requests ) ); - $pull_request_count += count( $pull_requests ); - $contributors = array_merge( $contributors, $repo_contributors ); - } - - // Identify all command dependencies and their contributors - $milestones = self::get_project_milestones( 'wp-cli/wp-cli', array( 'state' => 'closed' ) ); - // Cheap way to get the latest closed milestone - $milestone = array_shift( $milestones ); - $composer_lock_url = sprintf( 'https://raw.githubusercontent.com/wp-cli/wp-cli/v%s/composer.lock', $milestone->title ); - WP_CLI::log( 'Fetching ' . $composer_lock_url ); - $response = Utils\http_request( 'GET', $composer_lock_url ); - if ( 200 !== $response->status_code ) { - WP_CLI::error( sprintf( 'Could not fetch composer.json (HTTP code %d)', $response->status_code ) ); - } - $composer_json = json_decode( $response->body, true ); - foreach( $composer_json['packages'] as $package ) { - $package_name = $package['name']; - $version_constraint = str_replace( 'v', '', $package['version'] ); - if ( ! preg_match( '#^wp-cli/.+-command$#', $package_name ) ) { - continue; - } - // Closed milestones denote a tagged release - $milestones = self::get_project_milestones( $package_name, array( 'state' => 'closed' ) ); - $milestone_ids = array(); - $milestone_titles = array(); - foreach( $milestones as $milestone ) { - if ( ! version_compare( $milestone->title, $version_constraint, '>' ) ) { - continue; - } - $milestone_ids[] = $milestone->number; - $milestone_titles[] = $milestone->title; - } - // No shipped releases for this milestone. - if ( empty( $milestone_ids ) ) { - continue; - } - WP_CLI::log( 'Closed ' . $package_name . ' milestone(s): ' . implode( ', ', $milestone_titles ) ); - foreach( $milestone_ids as $milestone_id ) { - $pull_requests = self::get_project_milestone_pull_requests( $package_name, $milestone_id ); - $repo_contributors = self::parse_contributors_from_pull_requests( $pull_requests ); - WP_CLI::log( ' - Contributors: ' . count( $repo_contributors ) ); - WP_CLI::log( ' - Pull requests: ' . count( $pull_requests ) ); - $pull_request_count += count( $pull_requests ); - $contributors = array_merge( $contributors, $repo_contributors ); - } - } - - WP_CLI::log( 'Total contributors: ' . count( $contributors ) ); - WP_CLI::log( 'Total pull requests: ' . $pull_request_count ); - - // Sort and render the contributor list - asort( $contributors, SORT_NATURAL | SORT_FLAG_CASE ); - if ( in_array( $assoc_args['format'], array( 'markdown', 'html' ) ) ) { - $contrib_list = ''; - foreach( $contributors as $url => $login ) { - if ( 'markdown' === $assoc_args['format'] ) { - $contrib_list .= '[' . $login . '](' . $url . '), '; - } elseif ( 'html' === $assoc_args['format'] ) { - $contrib_list .= '' . $login . ', '; - } - } - $contrib_list = rtrim( $contrib_list, ', ' ); - WP_CLI::log( $contrib_list ); - } - } - - /** - * Get the milestones for a given project - * - * @param string $project - * @return array - */ - private static function get_project_milestones( $project, $args = array() ) { - $request_url = sprintf( 'https://api.github.com/repos/%s/milestones', $project ); - list( $body, $headers ) = self::make_github_api_request( $request_url, $args ); - return $body; - } - - /** - * Get the pull requests assigned to a milestone of a given project - * - * @param string $project - * @param integer $milestone_id - * @return array - */ - private static function get_project_milestone_pull_requests( $project, $milestone_id ) { - $request_url = sprintf( 'https://api.github.com/repos/%s/issues', $project ); - $args = array( - 'milestone' => $milestone_id, - 'state' => 'all', - ); - $pull_requests = array(); - do { - list( $body, $headers ) = self::make_github_api_request( $request_url, $args ); - foreach( $body as $issue ) { - if ( ! empty( $issue->pull_request ) ) { - $pull_requests[] = $issue; - } - } - $args = array(); - $request_url = false; - // Set $request_url to 'rel="next" if present' - if ( ! empty( $headers['Link'] ) ) { - $bits = trim( explode( ',', $headers['Link'] ) ); - foreach( $bits as $bit ) { - if ( false !== stripos( $bit, 'rel="next"' ) ) { - $hrefandrel = explode( '; ', $bit ); - $request_url = trim( $hrefandrel[0], '<>' ); - break; - } - } - } - } while( $request_url ); - return $pull_requests; - } - - /** - * Parse the contributors from pull request objects - * - * @param array $pull_requests - * @return array - */ - private static function parse_contributors_from_pull_requests( $pull_requests ) { - $contributors = array(); - foreach( $pull_requests as $pull_request ) { - if ( ! empty( $pull_request->user ) ) { - $contributors[ $pull_request->user->html_url ] = $pull_request->user->login; - } - } - return $contributors; - } - - /** - * Make a request to the GitHub API - * - * @param string $url - * @param string $args - * @return array - */ - private static function make_github_api_request( $url, $args = array() ) { - $headers = array( - 'Accept' => 'application/vnd.github.v3+json', - 'User-Agent' => 'WP-CLI', - ); - if ( $token = getenv( 'GITHUB_TOKEN' ) ) { - $headers['Authorization'] = 'token ' . $token; - } - $response = Utils\http_request( 'GET', $url, $args, $headers ); - if ( 200 !== $response->status_code ) { - WP_CLI::error( sprintf( 'GitHub API returned: %s (HTTP code %d)', $response->body, $response->status_code ) ); - } - return array( json_decode( $response->body ), $response->headers ); - } - -} - -WP_CLI::add_command( 'contrib-list', 'Contrib_List_Command' ); diff --git a/utils/wp-completion.bash b/utils/ee-completion.bash similarity index 67% rename from utils/wp-completion.bash rename to utils/ee-completion.bash index 9df572b6d..cd2bee805 100644 --- a/utils/wp-completion.bash +++ b/utils/ee-completion.bash @@ -1,11 +1,11 @@ -# bash completion for the `wp` command +# bash completion for the `ee` command -_wp_complete() { +_ee_complete() { local OLD_IFS="$IFS" local cur=${COMP_WORDS[COMP_CWORD]} IFS=$'\n'; # want to preserve spaces at the end - local opts="$(wp cli completions --line="$COMP_LINE" --point="$COMP_POINT")" + local opts="$(ee cli completions --line="$COMP_LINE" --point="$COMP_POINT")" if [[ "$opts" =~ \\s* ]] then @@ -20,4 +20,4 @@ _wp_complete() { IFS="$OLD_IFS" return 0 } -complete -o nospace -F _wp_complete wp +complete -o nospace -F _ee_complete ee \ No newline at end of file diff --git a/utils/make-phar.php b/utils/make-phar.php index 14c57e74f..a03bf2a25 100644 --- a/utils/make-phar.php +++ b/utils/make-phar.php @@ -1,25 +1,25 @@ parse_args( array_slice( $GLOBALS['argv'], 1 ) ); @@ -34,21 +34,21 @@ define( 'BUILD', isset( $runtime_config['build'] ) ? $runtime_config['build'] : '' ); -$current_version = trim( file_get_contents( WP_CLI_ROOT . '/VERSION' ) ); +$current_version = trim( file_get_contents( EE_ROOT . '/VERSION' ) ); if ( isset( $runtime_config['version'] ) ) { $new_version = $runtime_config['version']; $new_version = Utils\increment_version( $current_version, $new_version ); if ( isset( $runtime_config['store-version'] ) && $runtime_config['store-version'] ) { - file_put_contents( WP_CLI_ROOT . '/VERSION', $new_version ); + file_put_contents( EE_ROOT . '/VERSION', $new_version ); } $current_version = $new_version; } function add_file( $phar, $path ) { - $key = str_replace( WP_CLI_BASE_PATH, '', $path ); + $key = str_replace( EE_BASE_PATH, '', $path ); if ( ! BE_QUIET ) { echo "$key - $path" . PHP_EOL; @@ -65,7 +65,7 @@ function add_file( $phar, $path ) { '\/phpunit\/', '\/nb\/oxymel\/', '-command\/src\/', - '\/wp-cli\/[^\n]+?-command\/', + '\/ee\/[^\n]+?-command\/', '\/symfony\/(?!finder|polyfill-mbstring)[^\/]+\/', '\/(?:dealerdirect|squizlabs|wimg)\/', ); @@ -90,7 +90,7 @@ function add_file( $phar, $path ) { } function set_file_contents( $phar, $path, $content ) { - $key = str_replace( WP_CLI_BASE_PATH, '', $path ); + $key = str_replace( EE_BASE_PATH, '', $path ); if ( ! BE_QUIET ) { echo "$key - $path" . PHP_EOL; @@ -100,7 +100,7 @@ function set_file_contents( $phar, $path, $content ) { } function get_composer_versions( $current_version ) { - $composer_lock_path = WP_CLI_ROOT . '/composer.lock'; + $composer_lock_path = EE_ROOT . '/composer.lock'; if ( ! ( $get_composer_lock = file_get_contents( $composer_lock_path ) ) || ! ( $composer_lock = json_decode( $get_composer_lock, true ) ) ) { fwrite( STDERR, sprintf( "Warning: Failed to read '%s'." . PHP_EOL, $composer_lock_path ) ); return ''; @@ -109,7 +109,7 @@ function get_composer_versions( $current_version ) { fwrite( STDERR, sprintf( "Warning: No packages in '%s'." . PHP_EOL, $composer_lock_path ) ); return ''; } - $vendor_versions = array( implode( ' ', array( 'wp-cli/wp-cli', $current_version, date( 'c' ) ) ) ); + $vendor_versions = array( implode( ' ', array( 'ee/ee', $current_version, date( 'c' ) ) ) ); $missing_names = $missing_versions = $missing_references = 0; foreach ( $composer_lock['packages'] as $package ) { if ( isset( $package['name'] ) ) { @@ -149,7 +149,7 @@ function get_composer_versions( $current_version ) { if ( file_exists( DEST_PATH ) ) { unlink( DEST_PATH ); } -$phar = new Phar( DEST_PATH, 0, 'wp-cli.phar' ); +$phar = new Phar( DEST_PATH, 0, 'ee.phar' ); $phar->startBuffering(); @@ -159,13 +159,13 @@ function get_composer_versions( $current_version ) { ->files() ->ignoreVCS(true) ->name('*.php') - ->in(WP_CLI_ROOT . '/php') - ->in(WP_CLI_VENDOR_DIR . '/mustache') - ->in(WP_CLI_VENDOR_DIR . '/rmccue/requests') - ->in(WP_CLI_VENDOR_DIR . '/composer') - ->in(WP_CLI_VENDOR_DIR . '/ramsey/array_column') - ->in(WP_CLI_VENDOR_DIR . '/symfony/finder') - ->in(WP_CLI_VENDOR_DIR . '/symfony/polyfill-mbstring') + ->in(EE_ROOT . '/php') + ->in(EE_VENDOR_DIR . '/mustache') + ->in(EE_VENDOR_DIR . '/rmccue/requests') + ->in(EE_VENDOR_DIR . '/composer') + ->in(EE_VENDOR_DIR . '/ramsey/array_column') + ->in(EE_VENDOR_DIR . '/symfony/finder') + ->in(EE_VENDOR_DIR . '/symfony/polyfill-mbstring') ->notName('behat-tags.php') ->notPath('#(?:[^/]+-command|php-cli-tools)/vendor/#') // For running locally, in case have composer installed or symlinked them. ->exclude('examples') @@ -177,9 +177,9 @@ function get_composer_versions( $current_version ) { ; if ( 'cli' === BUILD ) { $finder - ->in(WP_CLI_VENDOR_DIR . '/wp-cli/mustangostang-spyc') - ->in(WP_CLI_VENDOR_DIR . '/wp-cli/php-cli-tools') - ->in(WP_CLI_VENDOR_DIR . '/seld/cli-prompt') + ->in(EE_VENDOR_DIR . '/ee/mustangostang-spyc') + ->in(EE_VENDOR_DIR . '/ee/php-cli-tools') + ->in(EE_VENDOR_DIR . '/seld/cli-prompt') ->exclude('composer/ca-bundle') ->exclude('composer/semver') ->exclude('composer/src') @@ -187,24 +187,24 @@ function get_composer_versions( $current_version ) { ; } else { $finder - ->in(WP_CLI_VENDOR_DIR . '/wp-cli') - ->in(WP_CLI_ROOT . '/features/bootstrap') // These are required for scaffold-package-command. - ->in(WP_CLI_ROOT . '/features/steps') - ->in(WP_CLI_ROOT . '/features/extra') - ->in(WP_CLI_VENDOR_DIR . '/nb/oxymel') - ->in(WP_CLI_VENDOR_DIR . '/psr') - ->in(WP_CLI_VENDOR_DIR . '/seld') - ->in(WP_CLI_VENDOR_DIR . '/symfony/console') - ->in(WP_CLI_VENDOR_DIR . '/symfony/filesystem') - ->in(WP_CLI_VENDOR_DIR . '/symfony/process') - ->in(WP_CLI_VENDOR_DIR . '/justinrainbow/json-schema') + ->in(EE_VENDOR_DIR . '/ee') + ->in(EE_ROOT . '/features/bootstrap') // These are required for scaffold-package-command. + ->in(EE_ROOT . '/features/steps') + ->in(EE_ROOT . '/features/extra') + ->in(EE_VENDOR_DIR . '/nb/oxymel') + ->in(EE_VENDOR_DIR . '/psr') + ->in(EE_VENDOR_DIR . '/seld') + ->in(EE_VENDOR_DIR . '/symfony/console') + ->in(EE_VENDOR_DIR . '/symfony/filesystem') + ->in(EE_VENDOR_DIR . '/symfony/process') + ->in(EE_VENDOR_DIR . '/justinrainbow/json-schema') ->exclude('demo') ->exclude('nb/oxymel/OxymelTest.php') ->exclude('composer/spdx-licenses') ->exclude('composer/composer/src/Composer/Command') ->exclude('composer/composer/src/Composer/Compiler.php') ->exclude('composer/composer/src/Composer/Console') - ->exclude('composer/composer/src/Composer/Downloader/PearPackageExtractor.php') // Assuming Pear installation isn't supported by wp-cli. + ->exclude('composer/composer/src/Composer/Downloader/PearPackageExtractor.php') // Assuming Pear installation isn't supported by ee. ->exclude('composer/composer/src/Composer/Installer/PearBinaryInstaller.php') ->exclude('composer/composer/src/Composer/Installer/PearInstaller.php') ->exclude('composer/composer/src/Composer/Question') @@ -223,7 +223,7 @@ function get_composer_versions( $current_version ) { ->files() ->ignoreVCS(true) ->ignoreDotFiles(false) - ->in( WP_CLI_ROOT . '/templates') + ->in( EE_ROOT . '/templates') ; foreach ( $finder as $file ) { @@ -232,13 +232,13 @@ function get_composer_versions( $current_version ) { if ( 'cli' !== BUILD ) { // Include base project files, because the autoloader will load them - if ( WP_CLI_BASE_PATH !== WP_CLI_ROOT ) { + if ( EE_BASE_PATH !== EE_ROOT ) { $finder = new Finder(); $finder ->files() ->ignoreVCS(true) ->name('*.php') - ->in(WP_CLI_BASE_PATH . '/src') + ->in(EE_BASE_PATH . '/src') ->exclude('test') ->exclude('tests') ->exclude('Test') @@ -247,7 +247,7 @@ function get_composer_versions( $current_version ) { add_file( $phar, $file ); } // Any PHP files in the project root - foreach ( glob( WP_CLI_BASE_PATH . '/*.php' ) as $file ) { + foreach ( glob( EE_BASE_PATH . '/*.php' ) as $file ) { add_file( $phar, $file ); } } @@ -257,7 +257,7 @@ function get_composer_versions( $current_version ) { ->files() ->ignoreVCS(true) ->ignoreDotFiles(false) - ->in( WP_CLI_VENDOR_DIR . '/wp-cli/config-command/templates') + ->in( EE_VENDOR_DIR . '/ee/config-command/templates') ; foreach ( $finder as $file ) { add_file( $phar, $file ); @@ -268,32 +268,32 @@ function get_composer_versions( $current_version ) { ->files() ->ignoreVCS(true) ->ignoreDotFiles(false) - ->in( WP_CLI_VENDOR_DIR . '/wp-cli/scaffold-command/templates') + ->in( EE_VENDOR_DIR . '/ee/scaffold-command/templates') ; foreach ( $finder as $file ) { add_file( $phar, $file ); } } -add_file( $phar, WP_CLI_VENDOR_DIR . '/autoload.php' ); -add_file( $phar, WP_CLI_VENDOR_DIR . '/autoload_commands.php' ); -add_file( $phar, WP_CLI_VENDOR_DIR . '/autoload_framework.php' ); +add_file( $phar, EE_VENDOR_DIR . '/autoload.php' ); +add_file( $phar, EE_VENDOR_DIR . '/autoload_commands.php' ); +add_file( $phar, EE_VENDOR_DIR . '/autoload_framework.php' ); if ( 'cli' !== BUILD ) { - add_file( $phar, WP_CLI_ROOT . '/ci/behat-tags.php' ); - add_file( $phar, WP_CLI_VENDOR_DIR . '/composer/composer/LICENSE' ); - add_file( $phar, WP_CLI_VENDOR_DIR . '/composer/composer/res/composer-schema.json' ); + add_file( $phar, EE_ROOT . '/ci/behat-tags.php' ); + add_file( $phar, EE_VENDOR_DIR . '/composer/composer/LICENSE' ); + add_file( $phar, EE_VENDOR_DIR . '/composer/composer/res/composer-schema.json' ); } -add_file( $phar, WP_CLI_VENDOR_DIR . '/rmccue/requests/library/Requests/Transport/cacert.pem' ); +add_file( $phar, EE_VENDOR_DIR . '/rmccue/requests/library/Requests/Transport/cacert.pem' ); -set_file_contents( $phar, WP_CLI_ROOT . '/COMPOSER_VERSIONS', get_composer_versions( $current_version ) ); -set_file_contents( $phar, WP_CLI_ROOT . '/VERSION', $current_version ); +set_file_contents( $phar, EE_ROOT . '/COMPOSER_VERSIONS', get_composer_versions( $current_version ) ); +set_file_contents( $phar, EE_ROOT . '/VERSION', $current_version ); -$phar_boot = str_replace( WP_CLI_BASE_PATH, '', WP_CLI_ROOT . '/php/boot-phar.php' ); +$phar_boot = str_replace( EE_BASE_PATH, '', EE_ROOT . '/php/boot-phar.php' ); $phar->setStub( << EOB diff --git a/utils/test-phar-download b/utils/test-phar-download index f4c9ad7f4..f23c24c39 100755 --- a/utils/test-phar-download +++ b/utils/test-phar-download @@ -1,11 +1,11 @@ #!/usr/bin/env bash -actual_checksum=$(curl http://wp-cli.org/packages/phar/wp-cli.phar | md5sum | cut -d ' ' -f 1) +actual_checksum=$(curl http://ee.org/packages/phar/ee.phar | md5sum | cut -d ' ' -f 1) -echo "expected:" $(curl -s http://wp-cli.org/packages/phar/wp-cli.phar.md5) +echo "expected:" $(curl -s http://ee.org/packages/phar/ee.phar.md5) echo "actual: " $actual_checksum -actual_checksum=$(curl http://wp-cli.org/packages/phar/wp-cli.phar | sha512sum | cut -d ' ' -f 1) +actual_checksum=$(curl http://ee.org/packages/phar/ee.phar | sha512sum | cut -d ' ' -f 1) -echo "expected SHA-512:" $(curl -s http://wp-cli.org/packages/phar/wp-cli.phar.sha512) +echo "expected SHA-512:" $(curl -s http://ee.org/packages/phar/ee.phar.sha512) echo "actual SHA-512: " $actual_checksum diff --git a/utils/update-phar b/utils/update-phar index e2b16973e..21dbd9872 100755 --- a/utils/update-phar +++ b/utils/update-phar @@ -7,9 +7,9 @@ version=${1-"same"} current_rev=$(git rev-parse HEAD) current_rev=${current_rev:0:10} -packages_repo=../wp-cli-packages +packages_repo=../ee-packages -fname="phar/wp-cli.phar" +fname="phar/ee.phar" # generate archive php -dphar.readonly=0 ./utils/make-phar.php $packages_repo/$fname --quiet --version=$version --store-version @@ -19,10 +19,10 @@ cd $packages_repo # smoke test php $fname --version -# check which wp-cli commit the previous Phar archive was based on +# check which ee commit the previous Phar archive was based on # can't use the md5 hash, since it will be different each time the # archive is generated -new_commit_subj="update wp-cli.phar to wp-cli/wp-cli@$current_rev" +new_commit_subj="update ee.phar to ee/ee@$current_rev" current_commit_subj=$(git show -s --pretty=format:%s HEAD) diff --git a/utils/wp-cli-rpm.spec b/utils/wp-cli-rpm.spec deleted file mode 100644 index 1d5ef032b..000000000 --- a/utils/wp-cli-rpm.spec +++ /dev/null @@ -1,50 +0,0 @@ -Name: wp-cli -Version: 0.0.0 -Release: 2%{?dist} -Summary: The command line interface for WordPress -License: MIT -URL: http://wp-cli.org/ -Source0: wp-cli.phar -Source1: wp.1 -BuildArch: noarch - -%post -echo "PHP 5.3.29 or above must be installed." - -%description -WP-CLI is the command-line interface for WordPress. -You can update plugins, configure multisite installations -and much more, without using a web browser. - -%prep -chmod +x %{SOURCE0} -{ - echo '.TH "WP" "1"' - php %{SOURCE0} --help -} \ - | sed -e 's/^\([A-Z ]\+\)$/.SH "\1"/' \ - | sed -e 's/^ wp$/wp \\- The command line interface for WordPress/' \ - > %{SOURCE1} - -%build - -%install -mkdir -p %{buildroot}%{_bindir} -install -p -m 0755 %{SOURCE0} %{buildroot}%{_bindir}/wp -mkdir -p %{buildroot}%{_mandir}/man1 -install -p -m 0644 %{SOURCE1} %{buildroot}%{_mandir}/man1/ - -%files -%attr(0755, root, root) %{_bindir}/wp -%attr(0644, root, root) %{_mandir}/man1/wp.1* - -%changelog -* Tue Dec 12 2017 Murtaza Sarıaltun - 0.0.0-2 -- Remove php requirements. -- Update creating man page steps. -- Added output message. - -* Fri Jul 7 2017 Murtaza Sarıaltun - 0.0.0-1 -- First release of the spec file -- Check the spec file with `rpmlint -i -v wp-cli-rpm.spec` -- Build the package with `rpmbuild -bb wp-cli-rpm.spec` diff --git a/utils/wp-cli-updatedeb.sh b/utils/wp-cli-updatedeb.sh deleted file mode 100755 index 5432d9cea..000000000 --- a/utils/wp-cli-updatedeb.sh +++ /dev/null @@ -1,113 +0,0 @@ -#!/bin/bash -# -# Package wp-cli to be installed in Debian-compatible systems. -# Only the phar file is included. -# -# VERSION :0.2.4 -# DATE :2017-05-31 -# AUTHOR :Viktor Szépe -# LICENSE :The MIT License (MIT) -# URL :https://github.com/wp-cli/wp-cli/tree/master/utils -# BASH-VERSION :4.2+ - -# packages source path -DIR="php-wpcli" -# phar URL -PHAR="https://github.com/wp-cli/builds/raw/gh-pages/phar/wp-cli.phar" - -die() { - local RET="$1" - shift - - echo -e "$@" >&2 - exit "$RET" -} - -dump_control() { - cat > DEBIAN/control < -Section: php -Priority: optional -Depends: php5-cli (>= 5.3.29) | php-cli | php7-cli, php5-mysql | php5-mysqlnd | php7.0-mysql | php7.1-mysql, mysql-client | mariadb-client -Homepage: http://wp-cli.org/ -Description: wp-cli is a set of command-line tools for managing - WordPress installations. You can update plugins, set up multisite - installations and much more, without using a web browser. - -EOF -} - -set -e - -# deb's dir -if ! [ -d "$DIR" ]; then - mkdir "$DIR" || die 1 "Cannot create directory here: ${PWD}" -fi - -pushd "$DIR" - -# control file -if ! [ -r DEBIAN/control ]; then - mkdir DEBIAN - dump_control -fi - -# copyright -if ! [ -r usr/share/doc/php-wpcli/copyright ]; then - mkdir -p usr/share/doc/php-wpcli &> /dev/null - wget -nv -O usr/share/doc/php-wpcli/copyright https://github.com/wp-cli/wp-cli/raw/master/LICENSE -fi - -# changelog -if ! [ -r usr/share/doc/php-wpcli/changelog.gz ]; then - mkdir -p usr/share/doc/php-wpcli &> /dev/null - echo "Changelog can be found in the blog: https://make.wordpress.org/cli/" \ - | gzip -n -9 > usr/share/doc/php-wpcli/changelog.gz -fi - -# content dirs -[ -d usr/bin ] || mkdir -p usr/bin - -# download current version -wget -nv -O usr/bin/wp "$PHAR" || die 3 "Phar download failure" -chmod +x usr/bin/wp || die 4 "chmod failure" - -# get version -WPCLI_VER="$(usr/bin/wp cli version | cut -d " " -f 2)" -[ -z "$WPCLI_VER" ] && die 5 "Cannot get wp-cli version" -echo "Current version: ${WPCLI_VER}" - -# update version -sed -i -e "s/^Version: .*$/Version: ${WPCLI_VER}/" DEBIAN/control || die 6 "Version update failure" - -# minimal man page -if ! [ -r usr/share/man/man1/wp.1.gz ]; then - mkdir -p usr/share/man/man1 &> /dev/null - { - echo '.TH "WP" "1"' - usr/bin/wp --help - } \ - | sed 's/^\([A-Z ]\+\)$/.SH "\1"/' \ - | sed 's/^ wp$/wp \\- A command line interface for WordPress/' \ - | gzip -n -9 > usr/share/man/man1/wp.1.gz -fi - -# update MD5-s -find usr -type f -exec md5sum "{}" ";" > DEBIAN/md5sums || die 7 "md5sum creation failure" - -popd - -# build package in the current diretory -WPCLI_PKG="${PWD}/php-wpcli_${WPCLI_VER}_all.deb" -fakeroot dpkg-deb --build "$DIR" "$WPCLI_PKG" || die 8 "Packaging failed" - -# check package - not critical -lintian --display-info --display-experimental --pedantic --show-overrides php-wpcli_*_all.deb || true - -# optional steps -echo "sign it: dpkg-sig -k SIGNING-KEY -s builder \"${WPCLI_PKG}\"" -echo "include in your repo: pushd /var/www/REPO-DIR" -echo " reprepro includedeb jessie \"${WPCLI_PKG}\" && popd" diff --git a/utils/wp-cli-updaterpm.sh b/utils/wp-cli-updaterpm.sh deleted file mode 100755 index 5bf04a4ba..000000000 --- a/utils/wp-cli-updaterpm.sh +++ /dev/null @@ -1,110 +0,0 @@ -#!/bin/bash -# -# Package WP-CLI to be installed on RPM-based systems. -# -# VERSION :0.1.0 -# DATE :2017-07-12 -# AUTHOR :Viktor Szépe -# LICENSE :The MIT License (MIT) -# URL :https://github.com/wp-cli/wp-cli/tree/master/utils -# BASH-VERSION :4.2+ -# DEPENDS :apt-get install rpm rpmlint php-cli - -PHAR_URL="https://github.com/wp-cli/builds/raw/gh-pages/phar/wp-cli.phar" -# Source directory -SOURCE_DIR="rpm-src" - -die() { - local RET="$1" - shift - - echo -e "$@" >&2 - exit "$RET" -} - -set -e - -# Check dependencies -if ! hash php rpm; then - die 1 "Missing RPM build tools" -fi - -if ! [ -d "$SOURCE_DIR" ]; then - mkdir "$SOURCE_DIR" || die 2 "Cannot create directory here: ${PWD}" -fi - -pushd "$SOURCE_DIR" > /dev/null - -# Download the binary -wget -nv -O wp-cli.phar "$PHAR_URL" -chmod +x wp-cli.phar - -# Copy spec file -cp ../wp-cli-rpm.spec wp-cli.spec - -# Replace version placeholder -WPCLI_VER="$(php wp-cli.phar cli version | cut -d " " -f 2)" -if [ -z "$WPCLI_VER" ]; then - die 3 "Cannot get WP_CLI version" -fi -echo "Current version: ${WPCLI_VER}" -sed -i -e "s/^Version: .*\$/Version: ${WPCLI_VER}/" wp-cli.spec || die 4 "Version update failed" -sed -i -e "s/^\(\* .*\) 0\.0\.0-1\$/\1 ${WPCLI_VER}-1/" wp-cli.spec || die 5 "Changleog update failed" - -# Create man page -{ - echo '.TH "WP" "1"' - php wp-cli.phar --help -} \ - | sed -e 's/^\([A-Z ]\+\)$/.SH "\1"/' \ - | sed -e 's/^ wp$/wp \\- The command line interface for WordPress/' \ - > wp.1 - -# Build the package -rpmbuild --define "_sourcedir ${PWD}" --define "_rpmdir ${PWD}" -bb wp-cli.spec | tee wp-cli-updaterpm-rpmbuild.$$.log - -rpm_path=`grep -o "/.*/noarch/wp-cli-.*noarch.rpm" wp-cli-updaterpm-rpmbuild.$$.log` - -rm -f wp-cli-updaterpm-rpmbuild.$$.log - -if [ ${#rpm_path} -lt 20 ] ; then - echo "RPM path doesn't exist ($rpm_path)" - exit -fi - -if [[ $(type -P "rpmlint") ]] ; then - echo "Using rpmlint to check for errors" -# Run linter -cat <<"EOF" > rpmlint.config -setOption("CompressExtension", "gz") -addFilter(": E: no-packager-tag") -addFilter(": E: no-signature") -addFilter(": E: no-dependency-on locales-cli") -EOF - - rpmlint -v -f rpmlint.config -i $rpm_path || true - -elif ([ $(type -P "rpm2cpio") ] && [ $(type -P "cpio") ]); then - echo "No RPM lint found $rpm_path .. using alternative method" - mkdir rpm-test-$$ - cd rpm-test-$$ - if [ $? -ne 0 ] ; then - echo "Failed to cd into rpm-test-$$" - exit; - fi - rpm2cpio $rpm_path | cpio -idmv - - if [ -f "usr/bin/wp" ] ; then - echo "RPM test succeeded" - else - echo "RPM test failed" - fi - rm -rfv ../rpm-test-$$ -else - echo "All test methods failed" -fi - - -popd > /dev/null - -echo "OK." From 45957fc8cc25d6210f705cf3a0fa9c135f67576f Mon Sep 17 00:00:00 2001 From: r Date: Fri, 16 Feb 2018 14:57:07 +0530 Subject: [PATCH 0003/1044] Add site command --- composer.json | 11 +- composer.lock | 351 +++++++++++++++++++++++--------------------------- 2 files changed, 169 insertions(+), 193 deletions(-) diff --git a/composer.json b/composer.json index 9d3a9eef4..3d3f5c5dd 100644 --- a/composer.json +++ b/composer.json @@ -40,7 +40,8 @@ "symfony/yaml": "^2.7|^3.0", "wp-cli/autoload-splitter": "^0.1.5", "wp-cli/mustangostang-spyc": "^0.6.3", - "wp-cli/php-cli-tools": "~0.11.2" + "wp-cli/php-cli-tools": "~0.11.2", + "ee/site-command": "dev-master" }, "suggest": { "psy/psysh": "Enhanced shell functionality" @@ -59,5 +60,11 @@ "split-target-prefix-true": "autoload_commands", "split-target-prefix-false": "autoload_framework" } - } + }, + "repositories": { + "ee/site-command": { + "type": "vcs", + "url": "git@git.rtcamp.com:riddhesh.sanghvi/site-command.git" + } + } } diff --git a/composer.lock b/composer.lock index ff72d1537..8b38b5532 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "e5f91715e5797d5acc49e73afc86ea26", + "content-hash": "c1f486af18c6815f4ca7927a79b2cf7f", "packages": [ { "name": "composer/ca-bundle", @@ -64,35 +64,35 @@ }, { "name": "composer/composer", - "version": "1.5.6", + "version": "1.6.3", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "4f7f9c12753ec43f1e4629e2a71cabe81f2a4eab" + "reference": "88a69fda0f2187ad8714cedffd7a8872dceaa4c2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/4f7f9c12753ec43f1e4629e2a71cabe81f2a4eab", - "reference": "4f7f9c12753ec43f1e4629e2a71cabe81f2a4eab", + "url": "https://api.github.com/repos/composer/composer/zipball/88a69fda0f2187ad8714cedffd7a8872dceaa4c2", + "reference": "88a69fda0f2187ad8714cedffd7a8872dceaa4c2", "shasum": "" }, "require": { "composer/ca-bundle": "^1.0", "composer/semver": "^1.0", - "composer/spdx-licenses": "^1.0", + "composer/spdx-licenses": "^1.2", "justinrainbow/json-schema": "^3.0 || ^4.0 || ^5.0", "php": "^5.3.2 || ^7.0", "psr/log": "^1.0", "seld/cli-prompt": "^1.0", "seld/jsonlint": "^1.4", "seld/phar-utils": "^1.0", - "symfony/console": "^2.7 || ^3.0", - "symfony/filesystem": "^2.7 || ^3.0", - "symfony/finder": "^2.7 || ^3.0", - "symfony/process": "^2.7 || ^3.0" + "symfony/console": "^2.7 || ^3.0 || ^4.0", + "symfony/filesystem": "^2.7 || ^3.0 || ^4.0", + "symfony/finder": "^2.7 || ^3.0 || ^4.0", + "symfony/process": "^2.7 || ^3.0 || ^4.0" }, "require-dev": { - "phpunit/phpunit": "^4.5 || ^5.0.5", + "phpunit/phpunit": "^4.8.35 || ^5.7", "phpunit/phpunit-mock-objects": "^2.3 || ^3.0" }, "suggest": { @@ -106,7 +106,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.5-dev" + "dev-master": "1.6-dev" } }, "autoload": { @@ -137,7 +137,7 @@ "dependency", "package" ], - "time": "2017-12-18T11:09:18+00:00" + "time": "2018-01-31T15:28:18+00:00" }, { "name": "composer/semver", @@ -203,23 +203,23 @@ }, { "name": "composer/spdx-licenses", - "version": "1.1.6", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/composer/spdx-licenses.git", - "reference": "2603a0d7ddc00a015deb576fa5297ca43dee6b1c" + "reference": "7e111c50db92fa2ced140f5ba23b4e261bc77a30" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/2603a0d7ddc00a015deb576fa5297ca43dee6b1c", - "reference": "2603a0d7ddc00a015deb576fa5297ca43dee6b1c", + "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/7e111c50db92fa2ced140f5ba23b4e261bc77a30", + "reference": "7e111c50db92fa2ced140f5ba23b4e261bc77a30", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "^4.5 || ^5.0.5", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5", "phpunit/phpunit-mock-objects": "2.3.0 || ^3.0" }, "type": "library", @@ -260,20 +260,53 @@ "spdx", "validator" ], - "time": "2017-04-03T19:08:52+00:00" + "time": "2018-01-31T13:17:27+00:00" + }, + { + "name": "ee/site-command", + "version": "dev-master", + "source": { + "type": "git", + "url": "git@git.rtcamp.com:riddhesh.sanghvi/site-command.git", + "reference": "370cccfe7e4f2025a95d368cbc21e57c54c5fc2c" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "site", + "site create" + ] + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "site-command.php" + ] + }, + "license": [ + "MIT" + ], + "homepage": "https://github.com/ee/site", + "time": "2018-02-16T08:29:11+00:00" }, { "name": "justinrainbow/json-schema", - "version": "5.2.6", + "version": "5.2.7", "source": { "type": "git", "url": "https://github.com/justinrainbow/json-schema.git", - "reference": "d283e11b6e14c6f4664cf080415c4341293e5bbd" + "reference": "8560d4314577199ba51bf2032f02cd1315587c23" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/d283e11b6e14c6f4664cf080415c4341293e5bbd", - "reference": "d283e11b6e14c6f4664cf080415c4341293e5bbd", + "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/8560d4314577199ba51bf2032f02cd1315587c23", + "reference": "8560d4314577199ba51bf2032f02cd1315587c23", "shasum": "" }, "require": { @@ -282,7 +315,7 @@ "require-dev": { "friendsofphp/php-cs-fixer": "^2.1", "json-schema/json-schema-test-suite": "1.2.0", - "phpunit/phpunit": "^4.8.22" + "phpunit/phpunit": "^4.8.35" }, "bin": [ "bin/validate-json" @@ -326,7 +359,7 @@ "json", "schema" ], - "time": "2017-10-21T13:15:38+00:00" + "time": "2018-02-14T22:26:30+00:00" }, { "name": "mustache/mustache", @@ -374,47 +407,6 @@ ], "time": "2017-07-11T12:54:05+00:00" }, - { - "name": "nb/oxymel", - "version": "v0.1.0", - "source": { - "type": "git", - "url": "https://github.com/nb/oxymel.git", - "reference": "cbe626ef55d5c4cc9b5e6e3904b395861ea76e3c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nb/oxymel/zipball/cbe626ef55d5c4cc9b5e6e3904b395861ea76e3c", - "reference": "cbe626ef55d5c4cc9b5e6e3904b395861ea76e3c", - "shasum": "" - }, - "require": { - "php": ">=5.2.4" - }, - "type": "library", - "autoload": { - "psr-0": { - "Oxymel": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nikolay Bachiyski", - "email": "nb@nikolay.bg", - "homepage": "http://extrapolate.me/" - } - ], - "description": "A sweet XML builder", - "homepage": "https://github.com/nb/oxymel", - "keywords": [ - "xml" - ], - "time": "2013-02-24T15:01:54+00:00" - }, { "name": "psr/log", "version": "1.0.2", @@ -606,23 +598,23 @@ }, { "name": "seld/jsonlint", - "version": "1.6.2", + "version": "1.7.1", "source": { "type": "git", "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "7a30649c67ee0d19faacfd9fa2cfb6cc032d9b19" + "reference": "d15f59a67ff805a44c50ea0516d2341740f81a38" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/7a30649c67ee0d19faacfd9fa2cfb6cc032d9b19", - "reference": "7a30649c67ee0d19faacfd9fa2cfb6cc032d9b19", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/d15f59a67ff805a44c50ea0516d2341740f81a38", + "reference": "d15f59a67ff805a44c50ea0516d2341740f81a38", "shasum": "" }, "require": { "php": "^5.3 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "^4.5" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" }, "bin": [ "bin/jsonlint" @@ -651,7 +643,7 @@ "parser", "validator" ], - "time": "2017-11-30T15:34:22+00:00" + "time": "2018-01-24T12:46:19+00:00" }, { "name": "seld/phar-utils", @@ -699,16 +691,16 @@ }, { "name": "symfony/config", - "version": "v2.8.32", + "version": "v2.8.34", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "f4f3f1d7090c464434bbbc3e8aa2b41149c59196" + "reference": "17605ff58313d9fe94e507620a399721fc347b6d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/f4f3f1d7090c464434bbbc3e8aa2b41149c59196", - "reference": "f4f3f1d7090c464434bbbc3e8aa2b41149c59196", + "url": "https://api.github.com/repos/symfony/config/zipball/17605ff58313d9fe94e507620a399721fc347b6d", + "reference": "17605ff58313d9fe94e507620a399721fc347b6d", "shasum": "" }, "require": { @@ -751,20 +743,20 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2017-11-07T11:56:23+00:00" + "time": "2018-01-21T19:03:25+00:00" }, { "name": "symfony/console", - "version": "v2.8.32", + "version": "v2.8.34", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "46270f1ca44f08ebc134ce120fd2c2baf5fd63de" + "reference": "162ca7d0ea597599967aa63b23418e747da0896b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/46270f1ca44f08ebc134ce120fd2c2baf5fd63de", - "reference": "46270f1ca44f08ebc134ce120fd2c2baf5fd63de", + "url": "https://api.github.com/repos/symfony/console/zipball/162ca7d0ea597599967aa63b23418e747da0896b", + "reference": "162ca7d0ea597599967aa63b23418e747da0896b", "shasum": "" }, "require": { @@ -812,20 +804,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2017-11-29T09:33:18+00:00" + "time": "2018-01-29T08:54:45+00:00" }, { "name": "symfony/debug", - "version": "v2.8.32", + "version": "v2.8.34", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "e72a0340dc2e273b3c4398d8eef9157ba51d8b95" + "reference": "35e36287fc0fdc8a08f70efcd4865ae6d8a6ee55" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/e72a0340dc2e273b3c4398d8eef9157ba51d8b95", - "reference": "e72a0340dc2e273b3c4398d8eef9157ba51d8b95", + "url": "https://api.github.com/repos/symfony/debug/zipball/35e36287fc0fdc8a08f70efcd4865ae6d8a6ee55", + "reference": "35e36287fc0fdc8a08f70efcd4865ae6d8a6ee55", "shasum": "" }, "require": { @@ -869,20 +861,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2017-11-19T19:05:05+00:00" + "time": "2018-01-18T22:12:33+00:00" }, { "name": "symfony/dependency-injection", - "version": "v2.8.32", + "version": "v2.8.34", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "d3e81e5402c38500770eb5595d78a6d85ea9e412" + "reference": "91ad61e6f140b050eba4aa39bc52eece713f2a71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/d3e81e5402c38500770eb5595d78a6d85ea9e412", - "reference": "d3e81e5402c38500770eb5595d78a6d85ea9e412", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/91ad61e6f140b050eba4aa39bc52eece713f2a71", + "reference": "91ad61e6f140b050eba4aa39bc52eece713f2a71", "shasum": "" }, "require": { @@ -932,20 +924,20 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2017-11-23T11:13:33+00:00" + "time": "2018-01-29T08:55:23+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v2.8.32", + "version": "v2.8.34", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "b59aacf238fadda50d612c9de73b74751872a903" + "reference": "d64be24fc1eba62f9daace8a8918f797fc8e87cc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b59aacf238fadda50d612c9de73b74751872a903", - "reference": "b59aacf238fadda50d612c9de73b74751872a903", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/d64be24fc1eba62f9daace8a8918f797fc8e87cc", + "reference": "d64be24fc1eba62f9daace8a8918f797fc8e87cc", "shasum": "" }, "require": { @@ -992,20 +984,20 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2017-11-05T15:25:56+00:00" + "time": "2018-01-03T07:36:31+00:00" }, { "name": "symfony/filesystem", - "version": "v2.8.32", + "version": "v2.8.34", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "15ceb6736a9eebd0d99f9e05a62296ab6ce1cf2b" + "reference": "1f4e8351e0196562f5e8ec584baeceeb8e2e92f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/15ceb6736a9eebd0d99f9e05a62296ab6ce1cf2b", - "reference": "15ceb6736a9eebd0d99f9e05a62296ab6ce1cf2b", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/1f4e8351e0196562f5e8ec584baeceeb8e2e92f6", + "reference": "1f4e8351e0196562f5e8ec584baeceeb8e2e92f6", "shasum": "" }, "require": { @@ -1041,20 +1033,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2017-11-19T18:39:05+00:00" + "time": "2018-01-03T07:36:31+00:00" }, { "name": "symfony/finder", - "version": "v2.8.32", + "version": "v2.8.34", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "efeceae6a05a9b2fcb3391333f1d4a828ff44ab8" + "reference": "9786ccb6a1f94a89ae18fc6a1b68de1f070823ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/efeceae6a05a9b2fcb3391333f1d4a828ff44ab8", - "reference": "efeceae6a05a9b2fcb3391333f1d4a828ff44ab8", + "url": "https://api.github.com/repos/symfony/finder/zipball/9786ccb6a1f94a89ae18fc6a1b68de1f070823ed", + "reference": "9786ccb6a1f94a89ae18fc6a1b68de1f070823ed", "shasum": "" }, "require": { @@ -1090,20 +1082,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2017-11-05T15:25:56+00:00" + "time": "2018-01-29T08:54:45+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.6.0", + "version": "v1.7.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296" + "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296", - "reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/78be803ce01e55d3491c1397cf1c64beb9c1b63b", + "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b", "shasum": "" }, "require": { @@ -1115,7 +1107,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6-dev" + "dev-master": "1.7-dev" } }, "autoload": { @@ -1149,20 +1141,20 @@ "portable", "shim" ], - "time": "2017-10-11T12:05:26+00:00" + "time": "2018-01-30T19:27:44+00:00" }, { "name": "symfony/process", - "version": "v2.8.32", + "version": "v2.8.34", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "d25449e031f600807949aab7cadbf267712f4eee" + "reference": "905efe90024caa75a2fc93f54e14b26f2a099d96" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/d25449e031f600807949aab7cadbf267712f4eee", - "reference": "d25449e031f600807949aab7cadbf267712f4eee", + "url": "https://api.github.com/repos/symfony/process/zipball/905efe90024caa75a2fc93f54e14b26f2a099d96", + "reference": "905efe90024caa75a2fc93f54e14b26f2a099d96", "shasum": "" }, "require": { @@ -1198,20 +1190,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2017-11-05T15:25:56+00:00" + "time": "2018-01-29T08:54:45+00:00" }, { "name": "symfony/translation", - "version": "v2.8.32", + "version": "v2.8.34", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "0c63d56516c4c4c323228ca6348eadb7c91b1daf" + "reference": "72235c1121ae282254e897e342c001f3d4bb7e8d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/0c63d56516c4c4c323228ca6348eadb7c91b1daf", - "reference": "0c63d56516c4c4c323228ca6348eadb7c91b1daf", + "url": "https://api.github.com/repos/symfony/translation/zipball/72235c1121ae282254e897e342c001f3d4bb7e8d", + "reference": "72235c1121ae282254e897e342c001f3d4bb7e8d", "shasum": "" }, "require": { @@ -1262,20 +1254,20 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2017-11-07T14:08:47+00:00" + "time": "2018-01-18T13:56:23+00:00" }, { "name": "symfony/yaml", - "version": "v2.8.32", + "version": "v2.8.34", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "968ef42161e4bc04200119da473077f9e7015128" + "reference": "be720fcfae4614df204190d57795351059946a77" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/968ef42161e4bc04200119da473077f9e7015128", - "reference": "968ef42161e4bc04200119da473077f9e7015128", + "url": "https://api.github.com/repos/symfony/yaml/zipball/be720fcfae4614df204190d57795351059946a77", + "reference": "be720fcfae4614df204190d57795351059946a77", "shasum": "" }, "require": { @@ -1311,7 +1303,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2017-11-29T09:33:18+00:00" + "time": "2018-01-03T07:36:31+00:00" }, { "name": "wp-cli/autoload-splitter", @@ -1352,56 +1344,40 @@ ], "description": "Composer plugin for splitting a generated autoloader into two distinct parts.", "homepage": "https://wp-cli.org", - "time": "2017-08-03T08:40:17+00:00" + "time": "2017-08-03T08:40:16+00:00" }, { - "name": "wp-cli/cache-command", - "version": "v1.0.6", + "name": "wp-cli/mustangostang-spyc", + "version": "0.6.3", "source": { "type": "git", - "url": "https://github.com/wp-cli/cache-command.git", - "reference": "d82cba9effa198f17847dce5771c8fb20c443ffa" + "url": "https://github.com/wp-cli/spyc.git", + "reference": "6aa0b4da69ce9e9a2c8402dab8d43cf32c581cc7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/cache-command/zipball/d82cba9effa198f17847dce5771c8fb20c443ffa", - "reference": "d82cba9effa198f17847dce5771c8fb20c443ffa", + "url": "https://api.github.com/repos/wp-cli/spyc/zipball/6aa0b4da69ce9e9a2c8402dab8d43cf32c581cc7", + "reference": "6aa0b4da69ce9e9a2c8402dab8d43cf32c581cc7", "shasum": "" }, + "require": { + "php": ">=5.3.1" + }, "require-dev": { - "behat/behat": "~2.5", - "wp-cli/wp-cli": "*" + "phpunit/phpunit": "4.3.*@dev" }, - "type": "wp-cli-package", + "type": "library", "extra": { "branch-alias": { - "dev-master": "1.x-dev" - }, - "bundled": true, - "commands": [ - "cache", - "cache add", - "cache decr", - "cache delete", - "cache flush", - "cache get", - "cache incr", - "cache replace", - "cache set", - "cache type", - "transient", - "transient delete", - "transient get", - "transient set", - "transient type" - ] + "dev-master": "0.5.x-dev" + } }, "autoload": { "psr-4": { - "": "src/" + "Mustangostang\\": "src/" }, "files": [ - "cache-command.php" + "includes/functions.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -1410,50 +1386,38 @@ ], "authors": [ { - "name": "Daniel Bachhuber", - "email": "daniel@runcommand.io", - "homepage": "https://runcommand.io" + "name": "mustangostang", + "email": "vlad.andersen@gmail.com" } ], - "description": "Manages object and transient caches.", - "homepage": "https://github.com/wp-cli/cache-command", - "time": "2017-12-14T19:21:19+00:00" + "description": "A simple YAML loader/dumper class for PHP (WP-CLI fork)", + "homepage": "https://github.com/mustangostang/spyc/", + "time": "2017-04-25T11:26:20+00:00" }, { - "name": "wp-cli/checksum-command", - "version": "v1.0.8", + "name": "wp-cli/php-cli-tools", + "version": "v0.11.8", "source": { "type": "git", - "url": "https://github.com/wp-cli/checksum-command.git", - "reference": "360c0c658242919e9a74ba06917fd8a691484174" + "url": "https://github.com/wp-cli/php-cli-tools.git", + "reference": "363c75349f5dde561e0b416dd00f7aaa76fa2c27" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/checksum-command/zipball/360c0c658242919e9a74ba06917fd8a691484174", - "reference": "360c0c658242919e9a74ba06917fd8a691484174", + "url": "https://api.github.com/repos/wp-cli/php-cli-tools/zipball/363c75349f5dde561e0b416dd00f7aaa76fa2c27", + "reference": "363c75349f5dde561e0b416dd00f7aaa76fa2c27", "shasum": "" }, - "require-dev": { - "behat/behat": "~2.5", - "wp-cli/wp-cli": "^1.5" - }, - "type": "wp-cli-package", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - }, - "bundled": true, - "commands": [ - "core verify-checksums", - "plugin verify-checksums" - ] + "require": { + "php": ">= 5.3.0" }, + "type": "library", "autoload": { - "psr-4": { - "": "src/" + "psr-0": { + "cli": "lib/" }, "files": [ - "checksum-command.php" + "lib/cli/cli.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -1461,10 +1425,15 @@ "MIT" ], "authors": [ + { + "name": "James Logsdon", + "email": "jlogsdon@php.net", + "role": "Developer" + }, { "name": "Daniel Bachhuber", - "email": "daniel@runcommand.io", - "homepage": "https://runcommand.io" + "email": "daniel@handbuilt.co", + "role": "Maintainer" } ], "description": "Console utilities for PHP", From 151f9cd727d3aa021d381b49feaaa505bba2964d Mon Sep 17 00:00:00 2001 From: r Date: Fri, 16 Feb 2018 17:13:08 +0530 Subject: [PATCH 0004/1044] Add configuration files --- ee4-config/wp/config/.env.deployer | 23 +++++++++ ee4-config/wp/config/.env.example | 8 ++++ ee4-config/wp/config/nginx/default.conf | 36 ++++++++++++++ ee4-config/wp/config/php-fpm/php.ini | 7 +++ ee4-config/wp/docker-compose.yml | 62 +++++++++++++++++++++++++ 5 files changed, 136 insertions(+) create mode 100644 ee4-config/wp/config/.env.deployer create mode 100644 ee4-config/wp/config/.env.example create mode 100644 ee4-config/wp/config/nginx/default.conf create mode 100644 ee4-config/wp/config/php-fpm/php.ini create mode 100644 ee4-config/wp/docker-compose.yml diff --git a/ee4-config/wp/config/.env.deployer b/ee4-config/wp/config/.env.deployer new file mode 100644 index 000000000..4c772fef0 --- /dev/null +++ b/ee4-config/wp/config/.env.deployer @@ -0,0 +1,23 @@ +DB_NAME=database_name +DB_USER=database_user +DB_PASSWORD=database_password + +# Optional variables +DB_HOST=mysql +# DB_PREFIX=wp_ + +WP_ENV=development +WP_HOME=http://example.com +WP_SITEURL=${WP_HOME} + +# Generate your keys here: https://roots.io/salts.html +AUTH_KEY='generateme' +SECURE_AUTH_KEY='generateme' +LOGGED_IN_KEY='generateme' +NONCE_KEY='generateme' +AUTH_SALT='generateme' +SECURE_AUTH_SALT='generateme' +LOGGED_IN_SALT='generateme' +NONCE_SALT='generateme' +WP_CACHE_KEY_SALT='example.com:' #trailing `:` is important + diff --git a/ee4-config/wp/config/.env.example b/ee4-config/wp/config/.env.example new file mode 100644 index 000000000..afab96d16 --- /dev/null +++ b/ee4-config/wp/config/.env.example @@ -0,0 +1,8 @@ +MYSQL_ROOT_PASSWORD=password +MYSQL_DATABASE=wordpress +MYSQL_USER=wordpress +MYSQL_PASSWORD=password + +WORDPRESS_DB_HOST=db +VIRTUAL_HOST={V_HOST} +VIRTUAL_HOST_EMAIL=example@site1.test diff --git a/ee4-config/wp/config/nginx/default.conf b/ee4-config/wp/config/nginx/default.conf new file mode 100644 index 000000000..9672262dd --- /dev/null +++ b/ee4-config/wp/config/nginx/default.conf @@ -0,0 +1,36 @@ +server { + server_name localhost; + + access_log /var/log/nginx/access.log; + error_log /var/log/nginx/error.log; + + root /var/www/html; + index index.php; + + if (!-e $request_filename) { + rewrite /wp-admin$ $scheme://$host$uri/ permanent; + rewrite ^(/[^/]+)?(/wp-.*) $2 last; + rewrite ^(/[^/]+)?(/.*\.php) $2 last; + } + + location / { + try_files $uri $uri/ /index.php?$args; + } + + location ~ \.php$ { + try_files $uri =404; + include fastcgi_params; + fastcgi_pass php:9000; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + } + + location = /robots.txt { + return 200 'User-agent: * +Disallow: /'; + access_log off; + log_not_found off; + } + + client_max_body_size 100m; + include /etc/nginx/sites-enabled/*; +} diff --git a/ee4-config/wp/config/php-fpm/php.ini b/ee4-config/wp/config/php-fpm/php.ini new file mode 100644 index 000000000..c5964c495 --- /dev/null +++ b/ee4-config/wp/config/php-fpm/php.ini @@ -0,0 +1,7 @@ +# Custom PHP settings + +upload_max_filesize = 100M +post_max_size = 100M + +[mail function] +sendmail_path = /usr/sbin/sendmail -S mail:1025 diff --git a/ee4-config/wp/docker-compose.yml b/ee4-config/wp/docker-compose.yml new file mode 100644 index 000000000..63d9a13a7 --- /dev/null +++ b/ee4-config/wp/docker-compose.yml @@ -0,0 +1,62 @@ +version: '3' + +services: + mail: + image: mailhog/mailhog + restart: always + command: ["-invite-jim=false"] + environment: + - VIRTUAL_HOST=mail.${VIRTUAL_HOST} + - VIRTUAL_PORT=8025 + - LETSENCRYPT_HOST=mail.${VIRTUAL_HOST} + networks: + - site-network + + db: + image: mysql:latest + restart: always + volumes: + - "./app/db:/var/lib/mysql" + environment: + - MYSQL_ROOT_PASSWORD + - MYSQL_DATABASE + - MYSQL_USER + - MYSQL_PASSWORD + networks: + - site-network + + php: + image: rtcamp/wordpress + depends_on: + - db + restart: always + volumes: + - "./app/src:/var/www/html" + - "./config/php-fpm/php.ini:/usr/local/etc/php/php.ini" + environment: + - WORDPRESS_DB_HOST + - WORDPRESS_DB_USER=${MYSQL_USER} + - WORDPRESS_DB_PASSWORD=${MYSQL_PASSWORD} + networks: + - site-network + + nginx: + image: nginx:latest + depends_on: + - php + restart: always + environment: + - VIRTUAL_HOST + - LETSENCRYPT_HOST=${VIRTUAL_HOST} + - LETSENCRYPT_EMAIL=${VIRTUAL_HOST_EMAIL} + volumes: + - "./app/src:/var/www/html" + - "./config/nginx/default.conf:/etc/nginx/conf.d/default.conf" + - "./logs/nginx:/var/log/nginx" + networks: + - site-network + +networks: + site-network: + external: + name: ${VIRTUAL_HOST} From ace992d6c401d49ce111b444f1c27fbacb1a70e4 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi Date: Tue, 20 Feb 2018 18:34:21 +0530 Subject: [PATCH 0005/1044] Update lock file --- composer.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.lock b/composer.lock index 8b38b5532..a6f246069 100644 --- a/composer.lock +++ b/composer.lock @@ -268,7 +268,7 @@ "source": { "type": "git", "url": "git@git.rtcamp.com:riddhesh.sanghvi/site-command.git", - "reference": "370cccfe7e4f2025a95d368cbc21e57c54c5fc2c" + "reference": "d39f2d8ac70d792c0a7dd0e80661b79b4bab29fb" }, "type": "wp-cli-package", "extra": { @@ -293,7 +293,7 @@ "MIT" ], "homepage": "https://github.com/ee/site", - "time": "2018-02-16T08:29:11+00:00" + "time": "2018-02-20T12:38:08+00:00" }, { "name": "justinrainbow/json-schema", From 0442d74c92ef291bf99e2d5f557ef4628d17deda Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar Date: Wed, 21 Feb 2018 12:31:03 +0530 Subject: [PATCH 0006/1044] Add ability to continue script execution in confirm --- php/class-ee.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/php/class-ee.php b/php/class-ee.php index 986fec7ef..1ce6bd3bd 100644 --- a/php/class-ee.php +++ b/php/class-ee.php @@ -620,8 +620,9 @@ public static function error_multi_line( $message_lines ) { /** * Ask for confirmation before running a destructive operation. * - * If 'y' is provided to the question, the script execution continues. If - * 'n' or any other response is provided to the question, script exits. + * If 'y' is provided to the question, the script execution continues and returns true. If + * 'n' or any other response is provided to the question, script exits if + * $exit is set to true. Otherwise the script returns false. * * @access public * @category Input @@ -629,16 +630,20 @@ public static function error_multi_line( $message_lines ) { * @param string $question Question to display before the prompt. * @param array $assoc_args Skips prompt if 'yes' is provided. */ - public static function confirm( $question, $assoc_args = array() ) { + public static function confirm( $question, $assoc_args = array(), $exit = true ) { if ( ! \EE\Utils\get_flag_value( $assoc_args, 'yes' ) ) { fwrite( STDOUT, $question . ' [y/n] ' ); $answer = strtolower( trim( fgets( STDIN ) ) ); if ( 'y' != $answer ) { - exit; + if( $exit === true ) + exit; + return false; } + return true; } + return true; } /** From 479915570199b581cc3da9fd7c5bf3e66eec2f61 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar Date: Thu, 22 Feb 2018 13:31:31 +0530 Subject: [PATCH 0007/1044] Add sites_path param. --- php/EE/Runner.php | 46 ++++++++++++++++++++++++++++++++++++++++++++- php/config-spec.php | 7 +++++++ 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index b2b46f3eb..b875f7098 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -6,6 +6,7 @@ use EE\Utils; use EE\Dispatcher; use EE\Dispatcher\CompositeCommand; +use Mustangostang\Spyc; /** * Performs the execution of a command. @@ -477,7 +478,7 @@ public function init_config() { { $this->global_config_path = $this->get_global_config_path(); $this->project_config_path = $this->get_project_config_path(); - + $configurator->merge_yml( $this->global_config_path, $this->alias ); $config = $configurator->to_array(); $this->_required_files['global'] = $config[0]['require']; @@ -504,6 +505,47 @@ public function init_config() { } $this->_required_files['runtime'] = $this->config['require']; } + + private function check_sites_path() { + + if ( empty($this->config['sites_path']) ) { + $this->config['sites_path'] = \cli\prompt("Enter path where sites will be stored", '~/Sites/'); + + $config_file_path = getenv('EE_CONFIG_PATH') ? getenv('EE_CONFIG_PATH') : Utils\get_home_dir() . '/.ee4/config.yml'; + $config_dir_path = dirname( $config_file_path ); + + if ( file_exists( $config_file_path ) ) { + if ( is_readable( $config_file_path ) ) { + if ( is_writable( $config_file_path ) ) { + $existing_config = Spyc::YAMLLoad ( $config_file_path ); + $this->add_sites_path_to_config_file( $config_file_path, $existing_config ); + return; + } + EE::error("The config file {$config_file_path} is not writable. Please set a config path which is writable in EE_CONFIG_PATH environment variable."); + } + EE::error("The config file {$config_file_path} is not readable. Please select a config path which is readable in EE_CONFIG_PATH environment variable."); + } + else { + if ( is_writable( $config_dir_path ) ) { + $this->add_sites_path_to_config_file( $config_file_path ); + return; + } + $mkdir_success = mkdir ( $config_dir_path , 0755, true ); + if ( ! $mkdir_success ) { + EE::error("The config file path ${$config_dir_path} is not writable. Please select a config path which is writable in EE_CONFIG_PATH environment variable."); + } + $this->add_sites_path_to_config_file( $config_file_path ); + } + } + } + + private function add_sites_path_to_config_file( $config_file_path, $config = [] ) { + $config['sites_path'] = $this->config['sites_path']; + + $config_file = fopen( $config_file_path, "w" ); + fwrite( $config_file, Spyc::YAMLDump( $config ) ); + fclose( $config_file ); + } private function check_root() { if ( $this->config['allow-root'] ) { @@ -576,6 +618,8 @@ private function set_alias( $alias ) { public function start() { + $this->check_sites_path(); + // Enable PHP error reporting to stderr if testing. if ( getenv( 'BEHAT_RUN' ) ) { $this->enable_error_reporting(); diff --git a/php/config-spec.php b/php/config-spec.php index abff64be4..21163c30c 100644 --- a/php/config-spec.php +++ b/php/config-spec.php @@ -39,6 +39,13 @@ 'desc' => '(Sub)commands to disable.', ), + 'sites_path' => array( + 'runtime' => '=', + 'file' => '', + 'default' => null, + 'desc' => 'Absolute path to where all sites will be stored.', + ), + 'color' => array( 'runtime' => true, 'file' => '', From 309873ac58005fc73766cdc409893b964f8151b7 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar Date: Thu, 22 Feb 2018 16:01:31 +0530 Subject: [PATCH 0008/1044] Change make-phar to generate phar for ee. --- utils/make-phar.php | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/utils/make-phar.php b/utils/make-phar.php index a03bf2a25..ba7def009 100644 --- a/utils/make-phar.php +++ b/utils/make-phar.php @@ -188,10 +188,6 @@ function get_composer_versions( $current_version ) { } else { $finder ->in(EE_VENDOR_DIR . '/ee') - ->in(EE_ROOT . '/features/bootstrap') // These are required for scaffold-package-command. - ->in(EE_ROOT . '/features/steps') - ->in(EE_ROOT . '/features/extra') - ->in(EE_VENDOR_DIR . '/nb/oxymel') ->in(EE_VENDOR_DIR . '/psr') ->in(EE_VENDOR_DIR . '/seld') ->in(EE_VENDOR_DIR . '/symfony/console') @@ -252,24 +248,6 @@ function get_composer_versions( $current_version ) { } } - $finder = new Finder(); - $finder - ->files() - ->ignoreVCS(true) - ->ignoreDotFiles(false) - ->in( EE_VENDOR_DIR . '/ee/config-command/templates') - ; - foreach ( $finder as $file ) { - add_file( $phar, $file ); - } - - $finder = new Finder(); - $finder - ->files() - ->ignoreVCS(true) - ->ignoreDotFiles(false) - ->in( EE_VENDOR_DIR . '/ee/scaffold-command/templates') - ; foreach ( $finder as $file ) { add_file( $phar, $file ); } @@ -279,7 +257,6 @@ function get_composer_versions( $current_version ) { add_file( $phar, EE_VENDOR_DIR . '/autoload_commands.php' ); add_file( $phar, EE_VENDOR_DIR . '/autoload_framework.php' ); if ( 'cli' !== BUILD ) { - add_file( $phar, EE_ROOT . '/ci/behat-tags.php' ); add_file( $phar, EE_VENDOR_DIR . '/composer/composer/LICENSE' ); add_file( $phar, EE_VENDOR_DIR . '/composer/composer/res/composer-schema.json' ); } From 5492ce8f14d3939bb3af94dd6db5c8e492ebdc57 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar Date: Tue, 27 Feb 2018 13:08:30 +0530 Subject: [PATCH 0009/1044] Fix autoloading error. Loads class-ee.php before calling vendor autoload. It ensures that the autload will not be called in commands. --- tests/bootstrap.php | 1 + utils/make-phar.php | 2 ++ 2 files changed, 3 insertions(+) diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 757e19f8f..80481698c 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -15,6 +15,7 @@ define( 'EE_VENDOR_DIR' , dirname( dirname( EE_ROOT ) ) ); } +require_once EE_ROOT . '/php/class-ee.php'; require_once EE_VENDOR_DIR . '/autoload.php'; require_once EE_ROOT . '/php/utils.php'; diff --git a/utils/make-phar.php b/utils/make-phar.php index ba7def009..b8e0cdcae 100644 --- a/utils/make-phar.php +++ b/utils/make-phar.php @@ -12,6 +12,8 @@ fwrite( STDERR, 'Missing vendor/autoload.php' . PHP_EOL ); exit(1); } + +require EE_ROOT . '/php/class-ee.php'; require EE_VENDOR_DIR . '/autoload.php'; require EE_ROOT . '/php/utils.php'; From 2d1b70a0d41531c37df2a97fc8ce11e98e88d34f Mon Sep 17 00:00:00 2001 From: Mriyam Tamuli Date: Tue, 27 Feb 2018 16:07:51 +0530 Subject: [PATCH 0010/1044] Add ensure_present_in_config function Signed-off-by: Mriyam Tamuli --- php/EE/Runner.php | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index b875f7098..1b3629a56 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -478,7 +478,7 @@ public function init_config() { { $this->global_config_path = $this->get_global_config_path(); $this->project_config_path = $this->get_project_config_path(); - + $configurator->merge_yml( $this->global_config_path, $this->alias ); $config = $configurator->to_array(); $this->_required_files['global'] = $config[0]['require']; @@ -505,20 +505,27 @@ public function init_config() { } $this->_required_files['runtime'] = $this->config['require']; } - - private function check_sites_path() { - - if ( empty($this->config['sites_path']) ) { - $this->config['sites_path'] = \cli\prompt("Enter path where sites will be stored", '~/Sites/'); - + + /** + * Ensures that vars are present in config. If they aren't, attempts to + * create config file and add vars in it. + * + * @param $var Variable to check. + * @param $default Default value to use if $var is not set. + */ + private function ensure_present_in_config( $var, $default) { + + if ( empty($this->config[$var]) ) { + $this->config[$var] = $default ; + $config_file_path = getenv('EE_CONFIG_PATH') ? getenv('EE_CONFIG_PATH') : Utils\get_home_dir() . '/.ee4/config.yml'; $config_dir_path = dirname( $config_file_path ); - + if ( file_exists( $config_file_path ) ) { if ( is_readable( $config_file_path ) ) { if ( is_writable( $config_file_path ) ) { $existing_config = Spyc::YAMLLoad ( $config_file_path ); - $this->add_sites_path_to_config_file( $config_file_path, $existing_config ); + $this->add_var_to_config_file( $var, $config_file_path, $existing_config ); return; } EE::error("The config file {$config_file_path} is not writable. Please set a config path which is writable in EE_CONFIG_PATH environment variable."); @@ -527,20 +534,20 @@ private function check_sites_path() { } else { if ( is_writable( $config_dir_path ) ) { - $this->add_sites_path_to_config_file( $config_file_path ); + $this->add_var_to_config_file( $var, $config_file_path ); return; } $mkdir_success = mkdir ( $config_dir_path , 0755, true ); if ( ! $mkdir_success ) { EE::error("The config file path ${$config_dir_path} is not writable. Please select a config path which is writable in EE_CONFIG_PATH environment variable."); } - $this->add_sites_path_to_config_file( $config_file_path ); + $this->add_var_to_config_file($var, $config_file_path ); } } } - private function add_sites_path_to_config_file( $config_file_path, $config = [] ) { - $config['sites_path'] = $this->config['sites_path']; + private function add_var_to_config_file( $var, $config_file_path, $config = [] ) { + $config[$var] = $this->config[$var]; $config_file = fopen( $config_file_path, "w" ); fwrite( $config_file, Spyc::YAMLDump( $config ) ); @@ -618,7 +625,7 @@ private function set_alias( $alias ) { public function start() { - $this->check_sites_path(); + $this->ensure_present_in_config( 'sites_path', Utils\get_home_dir(). '/Sites' ); // Enable PHP error reporting to stderr if testing. if ( getenv( 'BEHAT_RUN' ) ) { From 9413c2a5c7bd4989ab25946792bdcfc6fb2b2c4b Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar Date: Tue, 27 Feb 2018 15:56:10 +0530 Subject: [PATCH 0011/1044] Add check to ensure db_path is in config --- php/EE/Runner.php | 1 + 1 file changed, 1 insertion(+) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 1b3629a56..698bbea20 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -626,6 +626,7 @@ private function set_alias( $alias ) { public function start() { $this->ensure_present_in_config( 'sites_path', Utils\get_home_dir(). '/Sites' ); + $this->ensure_present_in_config( 'db_path', Utils\get_home_dir(). '/.ee4/ee4.db' ); // Enable PHP error reporting to stderr if testing. if ( getenv( 'BEHAT_RUN' ) ) { From bd580ece90a150064219755dd3208c013e817851 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar Date: Tue, 27 Feb 2018 13:21:36 +0530 Subject: [PATCH 0012/1044] Correct phar building phar wasn't building correctly due to some minor errors. Corrected it. --- utils/make-phar.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/utils/make-phar.php b/utils/make-phar.php index b8e0cdcae..4cc103c14 100644 --- a/utils/make-phar.php +++ b/utils/make-phar.php @@ -179,8 +179,8 @@ function get_composer_versions( $current_version ) { ; if ( 'cli' === BUILD ) { $finder - ->in(EE_VENDOR_DIR . '/ee/mustangostang-spyc') - ->in(EE_VENDOR_DIR . '/ee/php-cli-tools') + ->in(EE_VENDOR_DIR . '/wp-cli/mustangostang-spyc') + ->in(EE_VENDOR_DIR . '/wp-cli/php-cli-tools') ->in(EE_VENDOR_DIR . '/seld/cli-prompt') ->exclude('composer/ca-bundle') ->exclude('composer/semver') @@ -190,6 +190,7 @@ function get_composer_versions( $current_version ) { } else { $finder ->in(EE_VENDOR_DIR . '/ee') + ->in(EE_VENDOR_DIR . '/wp-cli') ->in(EE_VENDOR_DIR . '/psr') ->in(EE_VENDOR_DIR . '/seld') ->in(EE_VENDOR_DIR . '/symfony/console') From 551e2464e267ceafdfc16a921e1e13fdc76683e6 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi Date: Tue, 27 Feb 2018 17:00:44 +0530 Subject: [PATCH 0013/1044] Update composer and yml --- composer.json | 4 ++-- composer.lock | 10 +++++----- ee4-config/wp/docker-compose.yml | 5 +---- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/composer.json b/composer.json index 3d3f5c5dd..39b5cdc62 100644 --- a/composer.json +++ b/composer.json @@ -41,7 +41,7 @@ "wp-cli/autoload-splitter": "^0.1.5", "wp-cli/mustangostang-spyc": "^0.6.3", "wp-cli/php-cli-tools": "~0.11.2", - "ee/site-command": "dev-master" + "ee/site-command": "dev-develop" }, "suggest": { "psy/psysh": "Enhanced shell functionality" @@ -64,7 +64,7 @@ "repositories": { "ee/site-command": { "type": "vcs", - "url": "git@git.rtcamp.com:riddhesh.sanghvi/site-command.git" + "url": "git@git.rtcamp.com:sys/site-command.git" } } } diff --git a/composer.lock b/composer.lock index a6f246069..f028d1c76 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "c1f486af18c6815f4ca7927a79b2cf7f", + "content-hash": "1eb596923d6e6dbca943799dfacaab8b", "packages": [ { "name": "composer/ca-bundle", @@ -264,11 +264,11 @@ }, { "name": "ee/site-command", - "version": "dev-master", + "version": "dev-develop", "source": { "type": "git", - "url": "git@git.rtcamp.com:riddhesh.sanghvi/site-command.git", - "reference": "d39f2d8ac70d792c0a7dd0e80661b79b4bab29fb" + "url": "git@git.rtcamp.com:sys/site-command.git", + "reference": "cd06622a5e6895f03bb9760fa4822c10c2464f02" }, "type": "wp-cli-package", "extra": { @@ -293,7 +293,7 @@ "MIT" ], "homepage": "https://github.com/ee/site", - "time": "2018-02-20T12:38:08+00:00" + "time": "2018-02-27T05:34:19+00:00" }, { "name": "justinrainbow/json-schema", diff --git a/ee4-config/wp/docker-compose.yml b/ee4-config/wp/docker-compose.yml index 63d9a13a7..a8661773d 100644 --- a/ee4-config/wp/docker-compose.yml +++ b/ee4-config/wp/docker-compose.yml @@ -8,7 +8,6 @@ services: environment: - VIRTUAL_HOST=mail.${VIRTUAL_HOST} - VIRTUAL_PORT=8025 - - LETSENCRYPT_HOST=mail.${VIRTUAL_HOST} networks: - site-network @@ -47,8 +46,6 @@ services: restart: always environment: - VIRTUAL_HOST - - LETSENCRYPT_HOST=${VIRTUAL_HOST} - - LETSENCRYPT_EMAIL=${VIRTUAL_HOST_EMAIL} volumes: - "./app/src:/var/www/html" - "./config/nginx/default.conf:/etc/nginx/conf.d/default.conf" @@ -59,4 +56,4 @@ services: networks: site-network: external: - name: ${VIRTUAL_HOST} + name: ${VIRTUAL_HOST} \ No newline at end of file From 8b8b9605c23058c2115d53215e4a30dbf90ed1ad Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi Date: Tue, 27 Feb 2018 18:32:39 +0530 Subject: [PATCH 0014/1044] Add config folder to phar --- utils/make-phar.php | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/make-phar.php b/utils/make-phar.php index 4cc103c14..c496d9742 100644 --- a/utils/make-phar.php +++ b/utils/make-phar.php @@ -223,6 +223,7 @@ function get_composer_versions( $current_version ) { ->ignoreVCS(true) ->ignoreDotFiles(false) ->in( EE_ROOT . '/templates') + ->in(EE_ROOT . '/ee4-config') ; foreach ( $finder as $file ) { From ecde8c510aa0daa027d80bacb83161f407f4524b Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi Date: Tue, 27 Feb 2018 18:45:58 +0530 Subject: [PATCH 0015/1044] Update phar creation --- utils/update-phar | 36 ++---------------------------------- 1 file changed, 2 insertions(+), 34 deletions(-) diff --git a/utils/update-phar b/utils/update-phar index 21dbd9872..e0e4f8334 100755 --- a/utils/update-phar +++ b/utils/update-phar @@ -4,10 +4,8 @@ set -ex version=${1-"same"} -current_rev=$(git rev-parse HEAD) -current_rev=${current_rev:0:10} - packages_repo=../ee-packages +mkdir -p "$packages_repo/phar" fname="phar/ee.phar" @@ -17,34 +15,4 @@ php -dphar.readonly=0 ./utils/make-phar.php $packages_repo/$fname --quiet --vers cd $packages_repo # smoke test -php $fname --version - -# check which ee commit the previous Phar archive was based on -# can't use the md5 hash, since it will be different each time the -# archive is generated -new_commit_subj="update ee.phar to ee/ee@$current_rev" - -current_commit_subj=$(git show -s --pretty=format:%s HEAD) - -if [ "$new_commit_subj" = "$current_commit_subj" ]; then - echo "already at latest revision" - exit 1 -fi - -# generate md5 checksum -if [ command -v md5sum > /dev/null ] -then - md5hash=$(md5sum $fname) -else - md5hash=$(md5 -r $fname) -fi - -echo $md5hash | cut -d ' ' -f 1 > $fname.md5 - -sha512sum $fname | cut -d ' ' -f 1 > $fname.sha512 - -git add $fname $fname.md5 $fname.sha512 - -git commit -m "$new_commit_subj" - -git push +php $fname cli version From 5b191e10ccf308099c5a98f0d0fe67e9ceec15f6 Mon Sep 17 00:00:00 2001 From: Dharmin Shah Date: Tue, 27 Feb 2018 19:44:58 +0530 Subject: [PATCH 0016/1044] Add docker-compose.yml for traefik --- ee4-config/wp/docker-compose-traefik.yml | 68 ++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 ee4-config/wp/docker-compose-traefik.yml diff --git a/ee4-config/wp/docker-compose-traefik.yml b/ee4-config/wp/docker-compose-traefik.yml new file mode 100644 index 000000000..960330c23 --- /dev/null +++ b/ee4-config/wp/docker-compose-traefik.yml @@ -0,0 +1,68 @@ +version: '3' + +services: + mail: + image: mailhog/mailhog + restart: always + command: ["-invite-jim=false"] + labels: + - traefik.enable=false + environment: + - VIRTUAL_HOST=mail.${VIRTUAL_HOST} + - VIRTUAL_PORT=8025 + networks: + - site-network + + db: + image: mysql:latest + restart: always + volumes: + - "./app/db:/var/lib/mysql" + labels: + - traefik.enable=false + environment: + - MYSQL_ROOT_PASSWORD + - MYSQL_DATABASE + - MYSQL_USER + - MYSQL_PASSWORD + networks: + - site-network + + php: + image: rtcamp/wordpress + depends_on: + - db + restart: always + labels: + - traefik.enable=false + volumes: + - "./app/src:/var/www/html" + - "./config/php-fpm/php.ini:/usr/local/etc/php/php.ini" + environment: + - WORDPRESS_DB_HOST + - WORDPRESS_DB_USER=${MYSQL_USER} + - WORDPRESS_DB_PASSWORD=${MYSQL_PASSWORD} + networks: + - site-network + + nginx: + image: nginx:latest + depends_on: + - php + restart: always + environment: + - VIRTUAL_HOST + labels: + - "traefik.backend=${VIRTUAL_HOST}" + - "traefik.frontend.rule=HostRegexp:${VIRTUAL_HOST},{subdomain:[-a-z0-9]+}.${VIRTUAL_HOST}" + volumes: + - "./app/src:/var/www/html" + - "./config/nginx/default.conf:/etc/nginx/conf.d/default.conf" + - "./logs/nginx:/var/log/nginx" + networks: + - site-network + +networks: + site-network: + external: + name: ${VIRTUAL_HOST} From 3e70e33dfabb2cd32aa223378f3f67ad120e3d37 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi Date: Wed, 28 Feb 2018 18:19:12 +0530 Subject: [PATCH 0017/1044] Add config folder to phar --- utils/make-phar.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/make-phar.php b/utils/make-phar.php index c496d9742..e8c0f6742 100644 --- a/utils/make-phar.php +++ b/utils/make-phar.php @@ -223,7 +223,7 @@ function get_composer_versions( $current_version ) { ->ignoreVCS(true) ->ignoreDotFiles(false) ->in( EE_ROOT . '/templates') - ->in(EE_ROOT . '/ee4-config') + ->in( EE_ROOT . '/ee4-config') ; foreach ( $finder as $file ) { From 5b92ecfacd67ca21b44d54648caab5bce48b4730 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar Date: Mon, 12 Mar 2018 17:21:54 +0530 Subject: [PATCH 0018/1044] Change .ee in paths to .ee4 This should've been done earlier, but in some places .ee -> .ee4 convertion wasn't done. This commit fixes it. --- php/EE/Runner.php | 2 +- php/class-ee.php | 2 +- php/commands/src/CLI_Command.php | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 698bbea20..963958705 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -152,7 +152,7 @@ public function get_packages_dir_path() { if ( getenv( 'EE_PACKAGES_DIR' ) ) { $packages_dir = Utils\trailingslashit( getenv( 'EE_PACKAGES_DIR' ) ); } else { - $packages_dir = Utils\get_home_dir() . '/.ee/packages/'; + $packages_dir = Utils\get_home_dir() . '/.ee4/packages/'; } return $packages_dir; } diff --git a/php/class-ee.php b/php/class-ee.php index 1ce6bd3bd..e534709a2 100644 --- a/php/class-ee.php +++ b/php/class-ee.php @@ -74,7 +74,7 @@ public static function get_cache() { if ( ! $cache ) { $home = Utils\get_home_dir(); - $dir = getenv( 'EE_CACHE_DIR' ) ? : "$home/.ee/cache"; + $dir = getenv( 'EE_CACHE_DIR' ) ? : "$home/.ee4/cache"; // 6 months, 300mb $cache = new FileCache( $dir, 15552000, 314572800 ); diff --git a/php/commands/src/CLI_Command.php b/php/commands/src/CLI_Command.php index 12369eac1..4ba32c949 100644 --- a/php/commands/src/CLI_Command.php +++ b/php/commands/src/CLI_Command.php @@ -95,7 +95,7 @@ public function version() { * PHP version: 7.1.12-1+ubuntu16.04.1+deb.sury.org+1 * php.ini used: /etc/php/7.1/cli/php.ini * EE root dir: phar://ee.phar - * EE packages dir: /home/person/.ee/packages/ + * EE packages dir: /home/person/.ee4/packages/ * EE global config: * EE project config: * EE version: 1.5.0 @@ -266,7 +266,7 @@ public function check_update( $_, $assoc_args ) { */ public function update( $_, $assoc_args ) { // TODO: Update procedure to update EE - // + // // if ( ! Utils\inside_phar() ) { // EE::error( 'You can only self-update Phar files.' ); // } @@ -368,7 +368,7 @@ public function update( $_, $assoc_args ) { */ private function get_updates( $assoc_args ) { // TODO: update URLs - // + // // $url = 'https://api.github.com/repos/ee/ee/releases?per_page=100'; // $options = array( From 385a9fc1d633aaf326dfbc50aef0b942fb710ce4 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar Date: Tue, 13 Mar 2018 13:43:24 +0530 Subject: [PATCH 0019/1044] Remove Autoload Splitter and made stuff work using custom autoloader --- composer.json | 9 +--- composer.lock | 43 +--------------- php/EE/AutoloadSplitter.php | 33 ------------ ...ckAutoloader.php => IncludeAutoloader.php} | 6 +-- php/EE/Bootstrap/IncludeBundledAutoloader.php | 37 -------------- .../Bootstrap/IncludeFrameworkAutoloader.php | 50 ------------------- .../Bootstrap/RegisterFrameworkCommands.php | 42 ---------------- php/bootstrap.php | 6 +-- 8 files changed, 7 insertions(+), 219 deletions(-) delete mode 100644 php/EE/AutoloadSplitter.php rename php/EE/Bootstrap/{IncludeFallbackAutoloader.php => IncludeAutoloader.php} (76%) delete mode 100644 php/EE/Bootstrap/IncludeBundledAutoloader.php delete mode 100644 php/EE/Bootstrap/IncludeFrameworkAutoloader.php delete mode 100644 php/EE/Bootstrap/RegisterFrameworkCommands.php diff --git a/composer.json b/composer.json index 39b5cdc62..2f59d4284 100644 --- a/composer.json +++ b/composer.json @@ -38,7 +38,6 @@ "symfony/process": "^2.1|^3.0", "symfony/translation": "^2.7|^3.0", "symfony/yaml": "^2.7|^3.0", - "wp-cli/autoload-splitter": "^0.1.5", "wp-cli/mustangostang-spyc": "^0.6.3", "wp-cli/php-cli-tools": "~0.11.2", "ee/site-command": "dev-develop" @@ -53,12 +52,6 @@ "extra": { "branch-alias": { "dev-master": "1.5.x-dev" - }, - "autoload-splitter": { - "splitter-logic": "EE\\AutoloadSplitter", - "splitter-location": "php/EE/AutoloadSplitter.php", - "split-target-prefix-true": "autoload_commands", - "split-target-prefix-false": "autoload_framework" } }, "repositories": { @@ -66,5 +59,5 @@ "type": "vcs", "url": "git@git.rtcamp.com:sys/site-command.git" } - } + } } diff --git a/composer.lock b/composer.lock index f028d1c76..a96d15a6b 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "1eb596923d6e6dbca943799dfacaab8b", + "content-hash": "e56a545d7bcdde31439aa6b202c41970", "packages": [ { "name": "composer/ca-bundle", @@ -1305,47 +1305,6 @@ "homepage": "https://symfony.com", "time": "2018-01-03T07:36:31+00:00" }, - { - "name": "wp-cli/autoload-splitter", - "version": "v0.1.5", - "source": { - "type": "git", - "url": "https://github.com/wp-cli/autoload-splitter.git", - "reference": "fb4302da26390811d2631c62b42b75976d224bb8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/wp-cli/autoload-splitter/zipball/fb4302da26390811d2631c62b42b75976d224bb8", - "reference": "fb4302da26390811d2631c62b42b75976d224bb8", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.1" - }, - "type": "composer-plugin", - "extra": { - "class": "WP_CLI\\AutoloadSplitter\\ComposerPlugin" - }, - "autoload": { - "psr-4": { - "WP_CLI\\AutoloadSplitter\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Alain Schlesser", - "email": "alain.schlesser@gmail.com", - "homepage": "https://www.alainschlesser.com" - } - ], - "description": "Composer plugin for splitting a generated autoloader into two distinct parts.", - "homepage": "https://wp-cli.org", - "time": "2017-08-03T08:40:16+00:00" - }, { "name": "wp-cli/mustangostang-spyc", "version": "0.6.3", diff --git a/php/EE/AutoloadSplitter.php b/php/EE/AutoloadSplitter.php deleted file mode 100644 index ebc78bf66..000000000 --- a/php/EE/AutoloadSplitter.php +++ /dev/null @@ -1,33 +0,0 @@ -get_custom_vendor_folder() ) { - array_unshift( - $autoloader_paths, - EE_ROOT . '/../../../' . $custom_vendor . '/autoload_commands.php' - ); - } - - return $autoloader_paths; - } -} diff --git a/php/EE/Bootstrap/IncludeFrameworkAutoloader.php b/php/EE/Bootstrap/IncludeFrameworkAutoloader.php deleted file mode 100644 index 3b9ab522e..000000000 --- a/php/EE/Bootstrap/IncludeFrameworkAutoloader.php +++ /dev/null @@ -1,50 +0,0 @@ -get_custom_vendor_folder() ) { - array_unshift( - $autoloader_paths, - EE_ROOT . '/../../../' . $custom_vendor . '/autoload_framework.php' - ); - } - - return $autoloader_paths; - } - - /** - * Handle the failure to find an autoloader. - * - * @return void - */ - protected function handle_failure() { - fwrite( - STDERR, - "Internal error: Can't find Composer autoloader.\nTry running: composer install\n" - ); - exit( 3 ); - } -} diff --git a/php/EE/Bootstrap/RegisterFrameworkCommands.php b/php/EE/Bootstrap/RegisterFrameworkCommands.php deleted file mode 100644 index 7814accec..000000000 --- a/php/EE/Bootstrap/RegisterFrameworkCommands.php +++ /dev/null @@ -1,42 +0,0 @@ -getMessage() - ); - } - } - - return $state; - } -} diff --git a/php/bootstrap.php b/php/bootstrap.php index 65ddb4ed4..45d0d49e8 100644 --- a/php/bootstrap.php +++ b/php/bootstrap.php @@ -18,16 +18,13 @@ function get_bootstrap_steps() { 'EE\Bootstrap\LoadDispatcher', 'EE\Bootstrap\DeclareMainClass', 'EE\Bootstrap\DeclareAbstractBaseCommand', - 'EE\Bootstrap\IncludeFrameworkAutoloader', + 'EE\Bootstrap\IncludeAutoloader', 'EE\Bootstrap\ConfigureRunner', 'EE\Bootstrap\InitializeColorization', 'EE\Bootstrap\InitializeLogger', 'EE\Bootstrap\DefineProtectedCommands', 'EE\Bootstrap\LoadRequiredCommand', 'EE\Bootstrap\IncludePackageAutoloader', - 'EE\Bootstrap\IncludeBundledAutoloader', - 'EE\Bootstrap\RegisterFrameworkCommands', - 'EE\Bootstrap\IncludeFallbackAutoloader', 'EE\Bootstrap\RegisterDeferredCommands', 'EE\Bootstrap\LaunchRunner', ); @@ -66,6 +63,7 @@ function initialize_bootstrap_state() { * `process()` method. */ function bootstrap() { + prepare_bootstrap(); $state = initialize_bootstrap_state(); From f8a156ef009d7ab701bc5e0ebec9a460d5a99729 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar Date: Tue, 13 Mar 2018 16:12:14 +0530 Subject: [PATCH 0020/1044] Remove more bootstrap code. Add dependency to ensure that class-ee.php is required before any other files are included. --- composer.json | 23 +++++++-- composer.lock | 48 ++++++++++++++++++- .../Bootstrap/DeclareAbstractBaseCommand.php | 26 ---------- php/EE/Bootstrap/DeclareMainClass.php | 26 ---------- php/EE/Bootstrap/IncludeAutoloader.php | 35 -------------- php/EE/Bootstrap/LoadDispatcher.php | 26 ---------- php/EE/Bootstrap/LoadUtilityFunctions.php | 26 ---------- php/bootstrap.php | 8 +--- 8 files changed, 66 insertions(+), 152 deletions(-) delete mode 100644 php/EE/Bootstrap/DeclareAbstractBaseCommand.php delete mode 100644 php/EE/Bootstrap/DeclareMainClass.php delete mode 100644 php/EE/Bootstrap/IncludeAutoloader.php delete mode 100644 php/EE/Bootstrap/LoadDispatcher.php delete mode 100644 php/EE/Bootstrap/LoadUtilityFunctions.php diff --git a/composer.json b/composer.json index 2f59d4284..6329955f3 100644 --- a/composer.json +++ b/composer.json @@ -24,6 +24,8 @@ "php": ">=5.3.29", "composer/composer": "^1.2.0", "composer/semver": "~1.0", + "ee/site-command": "dev-develop", + "funkjedi/composer-include-files": "^1.0", "justinrainbow/json-schema": "~5.2.5", "mustache/mustache": "~2.4", "ramsey/array_column": "~1.1", @@ -39,20 +41,31 @@ "symfony/translation": "^2.7|^3.0", "symfony/yaml": "^2.7|^3.0", "wp-cli/mustangostang-spyc": "^0.6.3", - "wp-cli/php-cli-tools": "~0.11.2", - "ee/site-command": "dev-develop" + "wp-cli/php-cli-tools": "~0.11.2" }, "suggest": { "psy/psysh": "Enhanced shell functionality" }, "autoload": { - "psr-0": { "EE": "php" }, - "psr-4": { "": "php/commands/src" } + "psr-0": { + "EE": "php", + "EE\\Bootstrap": "php/EE/Bootstrap" + }, + + "psr-4": { + "": "php/commands/src" + } }, "extra": { "branch-alias": { "dev-master": "1.5.x-dev" - } + }, + "include_files": [ + "php/utils.php", + "php/dispatcher.php", + "php/class-ee.php", + "php/class-ee-command.php" + ] }, "repositories": { "ee/site-command": { diff --git a/composer.lock b/composer.lock index a96d15a6b..fcedd97b6 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "e56a545d7bcdde31439aa6b202c41970", + "content-hash": "d252b34722db82655ba289eb2c27dfcc", "packages": [ { "name": "composer/ca-bundle", @@ -293,7 +293,51 @@ "MIT" ], "homepage": "https://github.com/ee/site", - "time": "2018-02-27T05:34:19+00:00" + "time": "2018-02-27 05:34:19" + }, + { + "name": "funkjedi/composer-include-files", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/funkjedi/composer-include-files.git", + "reference": "5e96f2e46537d99b8b72662796955dba739e251f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/funkjedi/composer-include-files/zipball/5e96f2e46537d99b8b72662796955dba739e251f", + "reference": "5e96f2e46537d99b8b72662796955dba739e251f", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0" + }, + "type": "composer-plugin", + "extra": { + "class": "ComposerIncludeFiles\\Plugin" + }, + "autoload": { + "psr-4": { + "ComposerIncludeFiles\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Tim Robertson", + "email": "funkjedi@gmail.com" + } + ], + "description": "Include files at a higher priority than autoload files.", + "homepage": "https://github.com/funkjedi/composer-include-files", + "keywords": [ + "autoload", + "composer" + ], + "time": "2016-12-23T18:15:30+00:00" }, { "name": "justinrainbow/json-schema", diff --git a/php/EE/Bootstrap/DeclareAbstractBaseCommand.php b/php/EE/Bootstrap/DeclareAbstractBaseCommand.php deleted file mode 100644 index 5d34b78f3..000000000 --- a/php/EE/Bootstrap/DeclareAbstractBaseCommand.php +++ /dev/null @@ -1,26 +0,0 @@ -get_custom_vendor_folder() ) { - array_unshift( - $autoloader_paths, - EE_ROOT . '/../../../' . $custom_vendor . '/autoload.php' - ); - } - - return $autoloader_paths; - } -} diff --git a/php/EE/Bootstrap/LoadDispatcher.php b/php/EE/Bootstrap/LoadDispatcher.php deleted file mode 100644 index 728c97e62..000000000 --- a/php/EE/Bootstrap/LoadDispatcher.php +++ /dev/null @@ -1,26 +0,0 @@ - Date: Tue, 13 Mar 2018 16:15:21 +0530 Subject: [PATCH 0021/1044] Removed EE bootstrap autloader. --- php/EE/Autoloader.php | 177 ------------------------------------------ php/bootstrap.php | 18 ----- 2 files changed, 195 deletions(-) delete mode 100644 php/EE/Autoloader.php diff --git a/php/EE/Autoloader.php b/php/EE/Autoloader.php deleted file mode 100644 index f19e9228b..000000000 --- a/php/EE/Autoloader.php +++ /dev/null @@ -1,177 +0,0 @@ -unregister(); - } - - /** - * Registers the autoload callback with the SPL autoload system. - */ - public function register() { - spl_autoload_register( array( $this, 'autoload' ) ); - } - - /** - * Unregisters the autoload callback with the SPL autoload system. - */ - public function unregister() { - spl_autoload_unregister( array( $this, 'autoload' ) ); - } - - /** - * Add a specific namespace structure with our custom autoloader. - * - * @param string $root Root namespace name. - * @param string $base_dir Directory containing the class files. - * @param string $prefix Prefix to be added before the class. - * @param string $suffix Suffix to be added after the class. - * @param boolean $lowercase Whether the class should be changed to - * lowercase. - * @param boolean $underscores Whether the underscores should be changed to - * hyphens. - * - * @return self - */ - public function add_namespace( - $root, - $base_dir, - $prefix = '', - $suffix = '.php', - $lowercase = false, - $underscores = false - ) { - $this->namespaces[] = array( - 'root' => $this->normalize_root( (string) $root ), - 'base_dir' => $this->add_trailing_slash( (string) $base_dir ), - 'prefix' => (string) $prefix, - 'suffix' => (string) $suffix, - 'lowercase' => (bool) $lowercase, - 'underscores' => (bool) $underscores, - ); - - return $this; - } - - /** - * The autoload function that gets registered with the SPL Autoloader - * system. - * - * @param string $class The class that got requested by the spl_autoloader. - */ - public function autoload( $class ) { - - // Iterate over namespaces to find a match. - foreach ( $this->namespaces as $namespace ) { - - // Move on if the object does not belong to the current namespace. - if ( 0 !== strpos( $class, $namespace['root'] ) ) { - continue; - } - - // Remove namespace root level to correspond with root filesystem, and - // replace the namespace separator "\" by the system-dependent directory separator. - $filename = str_replace( - array( $namespace['root'], '\\' ), array( '', DIRECTORY_SEPARATOR ), - $class - ); - - // Remove a leading backslash from the class name. - $filename = $this->remove_leading_backslash( $filename ); - - // Change to lower case if requested. - if ( $namespace['lowercase'] ) { - $filename = strtolower( $filename ); - } - - // Change underscores into hyphens if requested. - if ( $namespace['underscores'] ) { - $filename = str_replace( '_', '-', $filename ); - } - - // Add base_dir, prefix and suffix. - $filepath = $namespace['base_dir'] - . $namespace['prefix'] - . $filename - . $namespace['suffix']; - - // Throw an exception if the file does not exist or is not readable. - if ( is_readable( $filepath ) ) { - require_once $filepath; - } - } - } - - /** - * Normalize a namespace root. - * - * @param string $root Namespace root that needs to be normalized. - * - * @return string Normalized namespace root. - */ - protected function normalize_root( $root ) { - $root = $this->remove_leading_backslash( $root ); - - return $this->add_trailing_backslash( $root ); - } - - /** - * Remove a leading backslash from a string. - * - * @param string $string String to remove the leading backslash from. - * - * @return string Modified string. - */ - protected function remove_leading_backslash( $string ) { - return ltrim( $string, '\\' ); - } - - /** - * Make sure a string ends with a trailing backslash. - * - * @param string $string String to check the trailing backslash of. - * - * @return string Modified string. - */ - protected function add_trailing_backslash( $string ) { - return rtrim( $string, '\\' ) . '\\'; - } - - /** - * Make sure a string ends with a trailing slash. - * - * @param string $string String to check the trailing slash of. - * - * @return string Modified string. - */ - protected function add_trailing_slash( $string ) { - return rtrim( $string, '/\\' ) . '/'; - } -} diff --git a/php/bootstrap.php b/php/bootstrap.php index dc5e53d38..e2e4b1efe 100644 --- a/php/bootstrap.php +++ b/php/bootstrap.php @@ -25,23 +25,6 @@ function get_bootstrap_steps() { ); } -/** - * Register the classes needed for the bootstrap process. - * - * The Composer autoloader is not active yet at this point, so we need to use a - * custom autoloader to fetch the bootstrap classes in a flexible way. - */ -function prepare_bootstrap() { - require_once EE_ROOT . '/php/EE/Autoloader.php'; - - $autoloader = new Autoloader(); - - $autoloader->add_namespace( - 'EE\Bootstrap', - EE_ROOT . '/php/EE/Bootstrap' - )->register(); -} - /** * Initialize and return the bootstrap state to pass from step to step. * @@ -59,7 +42,6 @@ function initialize_bootstrap_state() { */ function bootstrap() { - // prepare_bootstrap(); require_once EE_VENDOR_DIR . '/autoload.php'; $state = initialize_bootstrap_state(); From baffeeca3293a1d6b1909088f44553f39f095e0c Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi Date: Tue, 13 Mar 2018 18:20:50 +0530 Subject: [PATCH 0022/1044] Add wp-command Format composer.json according to editorconfig --- composer.json | 139 +++++++++++++++++++++++++++----------------------- composer.lock | 123 ++++++++++++++++++++++++++++---------------- 2 files changed, 155 insertions(+), 107 deletions(-) diff --git a/composer.json b/composer.json index 39b5cdc62..e86fc27cd 100644 --- a/composer.json +++ b/composer.json @@ -1,70 +1,83 @@ { - "name": "easyengine/ee", - "description": "The command line interface for WordPress", - "keywords": [ "cli", "wordpress" ], - "homepage": "https://ee.org", - "license": "MIT", - "support": { - "issues": "https://github.com/ee/ee/issues", - "source": "https://github.com/ee/ee", - "docs": "https://make.wordpress.org/cli/handbook/" - }, - "bin": [ - "bin/ee.bat", "bin/ee" - ], - "config": { - "platform": { - "php": "5.3.29" - }, - "sort-packages": true - }, - "minimum-stability": "dev", - "prefer-stable": true, - "require": { - "php": ">=5.3.29", - "composer/composer": "^1.2.0", - "composer/semver": "~1.0", - "justinrainbow/json-schema": "~5.2.5", - "mustache/mustache": "~2.4", - "ramsey/array_column": "~1.1", - "rmccue/requests": "~1.6", - "symfony/config": "^2.7|^3.0", - "symfony/console": "^2.7|^3.0", - "symfony/debug": "^2.7|^3.0", - "symfony/dependency-injection": "^2.7|^3.0", - "symfony/event-dispatcher": "^2.7|^3.0", - "symfony/filesystem": "^2.7|^3.0", - "symfony/finder": "^2.7|^3.0", - "symfony/process": "^2.1|^3.0", - "symfony/translation": "^2.7|^3.0", - "symfony/yaml": "^2.7|^3.0", - "wp-cli/autoload-splitter": "^0.1.5", - "wp-cli/mustangostang-spyc": "^0.6.3", - "wp-cli/php-cli-tools": "~0.11.2", - "ee/site-command": "dev-develop" - }, - "suggest": { - "psy/psysh": "Enhanced shell functionality" - }, - "autoload": { - "psr-0": { "EE": "php" }, - "psr-4": { "": "php/commands/src" } - }, - "extra": { - "branch-alias": { - "dev-master": "1.5.x-dev" - }, - "autoload-splitter": { - "splitter-logic": "EE\\AutoloadSplitter", - "splitter-location": "php/EE/AutoloadSplitter.php", - "split-target-prefix-true": "autoload_commands", - "split-target-prefix-false": "autoload_framework" - } - }, - "repositories": { + "name": "easyengine/ee", + "description": "The command line interface for WordPress", + "keywords": [ + "cli", + "wordpress" + ], + "homepage": "https://ee.org", + "license": "MIT", + "support": { + "issues": "https://github.com/ee/ee/issues", + "source": "https://github.com/ee/ee", + "docs": "https://make.wordpress.org/cli/handbook/" + }, + "bin": [ + "bin/ee.bat", + "bin/ee" + ], + "config": { + "platform": { + "php": "5.3.29" + }, + "sort-packages": true + }, + "minimum-stability": "dev", + "prefer-stable": true, + "require": { + "php": ">=5.3.29", + "composer/composer": "^1.2.0", + "composer/semver": "~1.0", + "justinrainbow/json-schema": "~5.2.5", + "mustache/mustache": "~2.4", + "ramsey/array_column": "~1.1", + "rmccue/requests": "~1.6", + "symfony/config": "^2.7|^3.0", + "symfony/console": "^2.7|^3.0", + "symfony/debug": "^2.7|^3.0", + "symfony/dependency-injection": "^2.7|^3.0", + "symfony/event-dispatcher": "^2.7|^3.0", + "symfony/filesystem": "^2.7|^3.0", + "symfony/finder": "^2.7|^3.0", + "symfony/process": "^2.1|^3.0", + "symfony/translation": "^2.7|^3.0", + "symfony/yaml": "^2.7|^3.0", + "wp-cli/autoload-splitter": "^0.1.5", + "wp-cli/mustangostang-spyc": "^0.6.3", + "wp-cli/php-cli-tools": "~0.11.2", + "ee/site-command": "dev-master", + "ee/wp-command": "dev-master" + }, + "suggest": { + "psy/psysh": "Enhanced shell functionality" + }, + "autoload": { + "psr-0": { + "EE": "php" + }, + "psr-4": { + "": "php/commands/src" + } + }, + "extra": { + "branch-alias": { + "dev-master": "1.5.x-dev" + }, + "autoload-splitter": { + "splitter-logic": "EE\\AutoloadSplitter", + "splitter-location": "php/EE/AutoloadSplitter.php", + "split-target-prefix-true": "autoload_commands", + "split-target-prefix-false": "autoload_framework" + } + }, + "repositories": { "ee/site-command": { "type": "vcs", "url": "git@git.rtcamp.com:sys/site-command.git" + }, + "ee/wp-command": { + "type": "vcs", + "url": "git@git.rtcamp.com:sys/wp-command.git" } } } diff --git a/composer.lock b/composer.lock index f028d1c76..eeb46f232 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "1eb596923d6e6dbca943799dfacaab8b", + "content-hash": "22f46c35014680ccaeeecff176b91829", "packages": [ { "name": "composer/ca-bundle", @@ -264,11 +264,11 @@ }, { "name": "ee/site-command", - "version": "dev-develop", + "version": "dev-master", "source": { "type": "git", "url": "git@git.rtcamp.com:sys/site-command.git", - "reference": "cd06622a5e6895f03bb9760fa4822c10c2464f02" + "reference": "5219c4d025ed7f24bb612c411481ba54c793847b" }, "type": "wp-cli-package", "extra": { @@ -278,7 +278,9 @@ "bundled": true, "commands": [ "site", - "site create" + "site create", + "site list", + "site delete" ] }, "autoload": { @@ -293,7 +295,39 @@ "MIT" ], "homepage": "https://github.com/ee/site", - "time": "2018-02-27T05:34:19+00:00" + "time": "2018-03-06T13:44:05+00:00" + }, + { + "name": "ee/wp-command", + "version": "dev-master", + "source": { + "type": "git", + "url": "git@git.rtcamp.com:sys/wp-command.git", + "reference": "84a03ca8cd9c227e51eb5d082e9f4bacfd8de188" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "wp" + ] + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "wp-command.php" + ] + }, + "license": [ + "MIT" + ], + "homepage": "https://github.com/easyengine/wp-command", + "time": "2018-03-13T12:33:49+00:00" }, { "name": "justinrainbow/json-schema", @@ -691,7 +725,7 @@ }, { "name": "symfony/config", - "version": "v2.8.34", + "version": "v2.8.36", "source": { "type": "git", "url": "https://github.com/symfony/config.git", @@ -747,16 +781,16 @@ }, { "name": "symfony/console", - "version": "v2.8.34", + "version": "v2.8.36", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "162ca7d0ea597599967aa63b23418e747da0896b" + "reference": "a6ff8b2ffa4eb43046828b303af2e3fedadacc27" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/162ca7d0ea597599967aa63b23418e747da0896b", - "reference": "162ca7d0ea597599967aa63b23418e747da0896b", + "url": "https://api.github.com/repos/symfony/console/zipball/a6ff8b2ffa4eb43046828b303af2e3fedadacc27", + "reference": "a6ff8b2ffa4eb43046828b303af2e3fedadacc27", "shasum": "" }, "require": { @@ -804,20 +838,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-01-29T08:54:45+00:00" + "time": "2018-02-26T15:33:21+00:00" }, { "name": "symfony/debug", - "version": "v2.8.34", + "version": "v2.8.36", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "35e36287fc0fdc8a08f70efcd4865ae6d8a6ee55" + "reference": "f693ba88189b6384370c13d114cfd010649c31af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/35e36287fc0fdc8a08f70efcd4865ae6d8a6ee55", - "reference": "35e36287fc0fdc8a08f70efcd4865ae6d8a6ee55", + "url": "https://api.github.com/repos/symfony/debug/zipball/f693ba88189b6384370c13d114cfd010649c31af", + "reference": "f693ba88189b6384370c13d114cfd010649c31af", "shasum": "" }, "require": { @@ -861,20 +895,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2018-01-18T22:12:33+00:00" + "time": "2018-02-28T21:47:46+00:00" }, { "name": "symfony/dependency-injection", - "version": "v2.8.34", + "version": "v2.8.36", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "91ad61e6f140b050eba4aa39bc52eece713f2a71" + "reference": "3d7cbf34cd75ede7f94b9b990f85bd089e15cd55" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/91ad61e6f140b050eba4aa39bc52eece713f2a71", - "reference": "91ad61e6f140b050eba4aa39bc52eece713f2a71", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/3d7cbf34cd75ede7f94b9b990f85bd089e15cd55", + "reference": "3d7cbf34cd75ede7f94b9b990f85bd089e15cd55", "shasum": "" }, "require": { @@ -924,20 +958,20 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2018-01-29T08:55:23+00:00" + "time": "2018-02-19T16:23:47+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v2.8.34", + "version": "v2.8.36", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "d64be24fc1eba62f9daace8a8918f797fc8e87cc" + "reference": "f5d2d7dcc33b89e20c2696ea9afcbddf6540081c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/d64be24fc1eba62f9daace8a8918f797fc8e87cc", - "reference": "d64be24fc1eba62f9daace8a8918f797fc8e87cc", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/f5d2d7dcc33b89e20c2696ea9afcbddf6540081c", + "reference": "f5d2d7dcc33b89e20c2696ea9afcbddf6540081c", "shasum": "" }, "require": { @@ -984,20 +1018,20 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2018-01-03T07:36:31+00:00" + "time": "2018-02-11T16:53:59+00:00" }, { "name": "symfony/filesystem", - "version": "v2.8.34", + "version": "v2.8.36", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "1f4e8351e0196562f5e8ec584baeceeb8e2e92f6" + "reference": "125403a59e4cb4e3ebf46d0162fabcde613d2b97" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/1f4e8351e0196562f5e8ec584baeceeb8e2e92f6", - "reference": "1f4e8351e0196562f5e8ec584baeceeb8e2e92f6", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/125403a59e4cb4e3ebf46d0162fabcde613d2b97", + "reference": "125403a59e4cb4e3ebf46d0162fabcde613d2b97", "shasum": "" }, "require": { @@ -1033,20 +1067,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2018-01-03T07:36:31+00:00" + "time": "2018-02-19T16:23:47+00:00" }, { "name": "symfony/finder", - "version": "v2.8.34", + "version": "v2.8.36", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "9786ccb6a1f94a89ae18fc6a1b68de1f070823ed" + "reference": "c5c751ccd50230b4517393344080a0eaf968bf2d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/9786ccb6a1f94a89ae18fc6a1b68de1f070823ed", - "reference": "9786ccb6a1f94a89ae18fc6a1b68de1f070823ed", + "url": "https://api.github.com/repos/symfony/finder/zipball/c5c751ccd50230b4517393344080a0eaf968bf2d", + "reference": "c5c751ccd50230b4517393344080a0eaf968bf2d", "shasum": "" }, "require": { @@ -1082,7 +1116,7 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2018-01-29T08:54:45+00:00" + "time": "2018-03-05T18:27:59+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -1145,16 +1179,16 @@ }, { "name": "symfony/process", - "version": "v2.8.34", + "version": "v2.8.36", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "905efe90024caa75a2fc93f54e14b26f2a099d96" + "reference": "756f614c5061729ea245ac6717231f7e3bfb74f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/905efe90024caa75a2fc93f54e14b26f2a099d96", - "reference": "905efe90024caa75a2fc93f54e14b26f2a099d96", + "url": "https://api.github.com/repos/symfony/process/zipball/756f614c5061729ea245ac6717231f7e3bfb74f9", + "reference": "756f614c5061729ea245ac6717231f7e3bfb74f9", "shasum": "" }, "require": { @@ -1190,11 +1224,11 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2018-01-29T08:54:45+00:00" + "time": "2018-02-12T17:44:58+00:00" }, { "name": "symfony/translation", - "version": "v2.8.34", + "version": "v2.8.36", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", @@ -1258,7 +1292,7 @@ }, { "name": "symfony/yaml", - "version": "v2.8.34", + "version": "v2.8.36", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", @@ -1449,7 +1483,8 @@ "aliases": [], "minimum-stability": "dev", "stability-flags": { - "ee/site-command": 20 + "ee/site-command": 20, + "ee/wp-command": 20 }, "prefer-stable": true, "prefer-lowest": false, From 20ad7f1d10c8eac3083427949d4103f2bfcee2d5 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi Date: Wed, 14 Mar 2018 14:21:57 +0530 Subject: [PATCH 0023/1044] Add db class Add util functions --- composer.json | 5 +- php/class-ee-db.php | 198 ++++++++++++++++++++++++++++++++++++++++++++ php/class-ee.php | 10 +++ php/utils.php | 84 +++++++++++++++++++ 4 files changed, 296 insertions(+), 1 deletion(-) create mode 100644 php/class-ee-db.php diff --git a/composer.json b/composer.json index e86fc27cd..cb858d80f 100644 --- a/composer.json +++ b/composer.json @@ -57,7 +57,10 @@ }, "psr-4": { "": "php/commands/src" - } + }, + "files": [ + "php/class-ee-db.php" + ] }, "extra": { "branch-alias": { diff --git a/php/class-ee-db.php b/php/class-ee-db.php new file mode 100644 index 000000000..77d796287 --- /dev/null +++ b/php/class-ee-db.php @@ -0,0 +1,198 @@ +lastErrorMsg() ); + } + } + } + + /** + * Sqlite database creation. + */ + public static function create() { + self::$db = new SQLite3( DB ); + $query = "CREATE TABLE sites ( + id INTEGER NOT NULL, + sitename VARCHAR, + site_type VARCHAR, + proxy_type VARCHAR, + cache_type VARCHAR, + site_path VARCHAR, + created_on DATETIME, + is_enabled BOOLEAN DEFAULT 1, + is_ssl BOOLEAN DEFAULT 0, + storage_fs VARCHAR, + storage_db VARCHAR, + db_name VARCHAR, + db_user VARCHAR, + db_password VARCHAR, + db_host VARCHAR, + is_hhvm BOOLEAN DEFAULT 0, + is_pagespeed BOOLEAN DEFAULT 0, + php_version VARCHAR, + PRIMARY KEY (id), + UNIQUE (sitename), + CHECK (is_enabled IN (0, 1)), + CHECK (is_ssl IN (0, 1)), + CHECK (is_hhvm IN (0, 1)), + CHECK (is_pagespeed IN (0, 1)) + );"; + self::$db->exec( $query ); + } + + /** + * Insert row in table. + * + * @param array $data in key value pair. + * + * @return bool + */ + public static function insert( $data ) { + + if ( empty ( self::$db ) ) { + self::init_db(); + } + + $table_name = TABLE; + + $fields = '`' . implode( '`, `', array_keys( $data ) ) . '`'; + $formats = '"' . implode( '", "', $data ) . '"'; + + $insert_query = "INSERT INTO `$table_name` ($fields) VALUES ($formats);"; + + $insert_query_exec = self::$db->exec( $insert_query ); + + if ( ! $insert_query_exec ) { + EE::debug( self::$db->lastErrorMsg() ); + self::$db->close(); + } else { + self::$db->close(); + + return true; + } + + return false; + } + + /** + * @param array $columns + * @param array $where + * Select data from the database. + * + * @return array|bool + */ + public static function select( $columns = array(), $where = array() ) { + + if ( empty ( self::$db ) ) { + self::init_db(); + } + + $table_name = TABLE; + + $conditions = array(); + if ( empty( $columns ) ) { + $columns = '*'; + } else { + $columns = implode( ', ', $columns ); + } + + foreach ( $where as $key => $value ) { + $conditions[] = "`$key`='" . $value . "'"; + } + + $conditions = implode( ' AND ', $conditions ); + + $select_data_query = "SELECT {$columns} FROM `$table_name`"; + + if ( ! empty( $conditions ) ) { + $select_data_query .= " WHERE $conditions"; + } + + $select_data_exec = self::$db->query( $select_data_query ); + $select_data = array(); + if ( $select_data_exec ) { + while ( $row = $select_data_exec->fetchArray( SQLITE3_ASSOC ) ) { + $select_data[] = $row; + } + } + if ( empty( $select_data ) ) { + return false; + } + + return $select_data; + } + + /** + * Check if a site entry exists in the database. + * + * @param String $site_name Name of the site to be checked. + * + * @return bool Success. + */ + public static function site_in_db( $site_name ) { + + if ( empty ( self::$db ) ) { + self::init_db(); + } + + $site = self::select( array( 'id' ), array( 'sitename' => $site_name ) ); + + if ( $site ) { + return true; + } else { + return false; + } + } + + + /** + * Delete data from table. + * + * @param $where + * + * @return bool + */ + public static function delete( $where ) { + + $table_name = TABLE; + + $conditions = array(); + foreach ( $where as $key => $value ) { + $conditions[] = "`$key`='" . $value . "'"; + } + + $conditions = implode( ' AND ', $conditions ); + $delete_query = "DELETE FROM `$table_name` WHERE $conditions"; + + $delete_query_exec = self::$db->exec( $delete_query ); + + if ( ! $delete_query_exec ) { + EE::debug( self::$db->lastErrorMsg() ); + self::$db->close(); + } else { + self::$db->close(); + + return true; + } + + return false; + } +} diff --git a/php/class-ee.php b/php/class-ee.php index e534709a2..1a3892338 100644 --- a/php/class-ee.php +++ b/php/class-ee.php @@ -22,6 +22,8 @@ class EE { private static $deferred_additions = array(); + private static $db; + /** * Set the logger instance. * @@ -1052,4 +1054,12 @@ public static function runcommand( $command, $options = array() ) { public static function run_command( $args, $assoc_args = array() ) { self::get_runner()->run_command( $args, $assoc_args ); } + + public static function db() { + if ( empty( self::$db ) ) { + self::$db = new EE_DB(); + } + + return self::$db; + } } diff --git a/php/utils.php b/php/utils.php index e3788e186..3cdd85beb 100644 --- a/php/utils.php +++ b/php/utils.php @@ -1307,3 +1307,87 @@ function parse_shell_arrays( $assoc_args, $array_arguments ) { return $assoc_args; } + +/** + * Remove trailing slash from a string. + * + * @param string $str Input string. + * + * @return string String without trailing slash. + */ +function remove_trailing_slash( $str ) { + + return rtrim( $str, '/' ); +} + +/** + * Function to recursively copy directory. + * + * @param string $source Source directory. + * @param string $dest Destination directory. + * + * @return bool Success. + */ +function copy_recursive( $source, $dest ) { + + if ( ! is_dir( $dest ) ) { + if ( ! @mkdir( $dest, 0755 ) ) { + return false; + } + } + + foreach ( + $iterator = new \RecursiveIteratorIterator( + new \RecursiveDirectoryIterator( $source, \RecursiveDirectoryIterator::SKIP_DOTS ), + \RecursiveIteratorIterator::SELF_FIRST + ) as $item + ) { + if ( $item->isDir() ) { + mkdir( $dest . DIRECTORY_SEPARATOR . $iterator->getSubPathName() ); + } else { + copy( $item, $dest . DIRECTORY_SEPARATOR . $iterator->getSubPathName() ); + } + } + + return true; +} + +/** + * Delete directory. + * + * @param string $dir path to directory. + */ +function delete_dir( $dir ) { + $it = new RecursiveDirectoryIterator( $dir, RecursiveDirectoryIterator::SKIP_DOTS ); + $files = new RecursiveIteratorIterator( + $it, + RecursiveIteratorIterator::CHILD_FIRST + ); + foreach ( $files as $file ) { + if ( $file->isDir() ) { + @rmdir( $file->getRealPath() ); + } else { + @unlink( $file->getRealPath() ); + } + } + if ( @rmdir( $dir ) ) { + return true; + } + + return false; +} + +/** + * Function to generate random password. + */ +function random_password() { + $alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'; + $pass = array(); + $alphaLength = strlen( $alphabet ) - 1; + for ( $i = 0; $i < 12; $i ++ ) { + $n = rand( 0, $alphaLength ); + $pass[] = $alphabet[$n]; + } + + return implode( $pass ); +} From 552e309757376c755f99ee6178c448ebfbe507dd Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi Date: Tue, 13 Mar 2018 18:20:50 +0530 Subject: [PATCH 0024/1044] Add wp-command Format composer.json according to editorconfig --- composer.json | 4 +++ composer.lock | 87 ++++++++++++++++++++++++++------------------------- 2 files changed, 49 insertions(+), 42 deletions(-) diff --git a/composer.json b/composer.json index 6329955f3..bc2415e4e 100644 --- a/composer.json +++ b/composer.json @@ -71,6 +71,10 @@ "ee/site-command": { "type": "vcs", "url": "git@git.rtcamp.com:sys/site-command.git" + }, + "ee/wp-command": { + "type": "vcs", + "url": "git@git.rtcamp.com:sys/wp-command.git" } } } diff --git a/composer.lock b/composer.lock index fcedd97b6..b4890a1d9 100644 --- a/composer.lock +++ b/composer.lock @@ -264,11 +264,11 @@ }, { "name": "ee/site-command", - "version": "dev-develop", + "version": "dev-master", "source": { "type": "git", "url": "git@git.rtcamp.com:sys/site-command.git", - "reference": "cd06622a5e6895f03bb9760fa4822c10c2464f02" + "reference": "5219c4d025ed7f24bb612c411481ba54c793847b" }, "type": "wp-cli-package", "extra": { @@ -278,7 +278,9 @@ "bundled": true, "commands": [ "site", - "site create" + "site create", + "site list", + "site delete" ] }, "autoload": { @@ -735,7 +737,7 @@ }, { "name": "symfony/config", - "version": "v2.8.34", + "version": "v2.8.36", "source": { "type": "git", "url": "https://github.com/symfony/config.git", @@ -791,16 +793,16 @@ }, { "name": "symfony/console", - "version": "v2.8.34", + "version": "v2.8.36", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "162ca7d0ea597599967aa63b23418e747da0896b" + "reference": "a6ff8b2ffa4eb43046828b303af2e3fedadacc27" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/162ca7d0ea597599967aa63b23418e747da0896b", - "reference": "162ca7d0ea597599967aa63b23418e747da0896b", + "url": "https://api.github.com/repos/symfony/console/zipball/a6ff8b2ffa4eb43046828b303af2e3fedadacc27", + "reference": "a6ff8b2ffa4eb43046828b303af2e3fedadacc27", "shasum": "" }, "require": { @@ -848,20 +850,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-01-29T08:54:45+00:00" + "time": "2018-02-26T15:33:21+00:00" }, { "name": "symfony/debug", - "version": "v2.8.34", + "version": "v2.8.36", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "35e36287fc0fdc8a08f70efcd4865ae6d8a6ee55" + "reference": "f693ba88189b6384370c13d114cfd010649c31af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/35e36287fc0fdc8a08f70efcd4865ae6d8a6ee55", - "reference": "35e36287fc0fdc8a08f70efcd4865ae6d8a6ee55", + "url": "https://api.github.com/repos/symfony/debug/zipball/f693ba88189b6384370c13d114cfd010649c31af", + "reference": "f693ba88189b6384370c13d114cfd010649c31af", "shasum": "" }, "require": { @@ -905,20 +907,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2018-01-18T22:12:33+00:00" + "time": "2018-02-28T21:47:46+00:00" }, { "name": "symfony/dependency-injection", - "version": "v2.8.34", + "version": "v2.8.36", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "91ad61e6f140b050eba4aa39bc52eece713f2a71" + "reference": "3d7cbf34cd75ede7f94b9b990f85bd089e15cd55" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/91ad61e6f140b050eba4aa39bc52eece713f2a71", - "reference": "91ad61e6f140b050eba4aa39bc52eece713f2a71", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/3d7cbf34cd75ede7f94b9b990f85bd089e15cd55", + "reference": "3d7cbf34cd75ede7f94b9b990f85bd089e15cd55", "shasum": "" }, "require": { @@ -968,20 +970,20 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2018-01-29T08:55:23+00:00" + "time": "2018-02-19T16:23:47+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v2.8.34", + "version": "v2.8.36", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "d64be24fc1eba62f9daace8a8918f797fc8e87cc" + "reference": "f5d2d7dcc33b89e20c2696ea9afcbddf6540081c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/d64be24fc1eba62f9daace8a8918f797fc8e87cc", - "reference": "d64be24fc1eba62f9daace8a8918f797fc8e87cc", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/f5d2d7dcc33b89e20c2696ea9afcbddf6540081c", + "reference": "f5d2d7dcc33b89e20c2696ea9afcbddf6540081c", "shasum": "" }, "require": { @@ -1028,20 +1030,20 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2018-01-03T07:36:31+00:00" + "time": "2018-02-11T16:53:59+00:00" }, { "name": "symfony/filesystem", - "version": "v2.8.34", + "version": "v2.8.36", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "1f4e8351e0196562f5e8ec584baeceeb8e2e92f6" + "reference": "125403a59e4cb4e3ebf46d0162fabcde613d2b97" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/1f4e8351e0196562f5e8ec584baeceeb8e2e92f6", - "reference": "1f4e8351e0196562f5e8ec584baeceeb8e2e92f6", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/125403a59e4cb4e3ebf46d0162fabcde613d2b97", + "reference": "125403a59e4cb4e3ebf46d0162fabcde613d2b97", "shasum": "" }, "require": { @@ -1077,20 +1079,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2018-01-03T07:36:31+00:00" + "time": "2018-02-19T16:23:47+00:00" }, { "name": "symfony/finder", - "version": "v2.8.34", + "version": "v2.8.36", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "9786ccb6a1f94a89ae18fc6a1b68de1f070823ed" + "reference": "c5c751ccd50230b4517393344080a0eaf968bf2d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/9786ccb6a1f94a89ae18fc6a1b68de1f070823ed", - "reference": "9786ccb6a1f94a89ae18fc6a1b68de1f070823ed", + "url": "https://api.github.com/repos/symfony/finder/zipball/c5c751ccd50230b4517393344080a0eaf968bf2d", + "reference": "c5c751ccd50230b4517393344080a0eaf968bf2d", "shasum": "" }, "require": { @@ -1126,7 +1128,7 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2018-01-29T08:54:45+00:00" + "time": "2018-03-05T18:27:59+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -1189,16 +1191,16 @@ }, { "name": "symfony/process", - "version": "v2.8.34", + "version": "v2.8.36", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "905efe90024caa75a2fc93f54e14b26f2a099d96" + "reference": "756f614c5061729ea245ac6717231f7e3bfb74f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/905efe90024caa75a2fc93f54e14b26f2a099d96", - "reference": "905efe90024caa75a2fc93f54e14b26f2a099d96", + "url": "https://api.github.com/repos/symfony/process/zipball/756f614c5061729ea245ac6717231f7e3bfb74f9", + "reference": "756f614c5061729ea245ac6717231f7e3bfb74f9", "shasum": "" }, "require": { @@ -1234,11 +1236,11 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2018-01-29T08:54:45+00:00" + "time": "2018-02-12T17:44:58+00:00" }, { "name": "symfony/translation", - "version": "v2.8.34", + "version": "v2.8.36", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", @@ -1302,7 +1304,7 @@ }, { "name": "symfony/yaml", - "version": "v2.8.34", + "version": "v2.8.36", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", @@ -1452,7 +1454,8 @@ "aliases": [], "minimum-stability": "dev", "stability-flags": { - "ee/site-command": 20 + "ee/site-command": 20, + "ee/wp-command": 20 }, "prefer-stable": true, "prefer-lowest": false, From 55ffacf6c557c815419d0559a967f8fad2a055e9 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar Date: Tue, 13 Mar 2018 13:43:24 +0530 Subject: [PATCH 0025/1044] Remove Autoload Splitter and made stuff work using custom autoloader --- composer.json | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index bc2415e4e..e09a89de2 100644 --- a/composer.json +++ b/composer.json @@ -24,9 +24,8 @@ "php": ">=5.3.29", "composer/composer": "^1.2.0", "composer/semver": "~1.0", - "ee/site-command": "dev-develop", - "funkjedi/composer-include-files": "^1.0", - "justinrainbow/json-schema": "~5.2.5", + "funkjedi/composer-include-files": "^1.0", + "justinrainbow/json-schema": "~5.2.5", "mustache/mustache": "~2.4", "ramsey/array_column": "~1.1", "rmccue/requests": "~1.6", @@ -41,7 +40,9 @@ "symfony/translation": "^2.7|^3.0", "symfony/yaml": "^2.7|^3.0", "wp-cli/mustangostang-spyc": "^0.6.3", - "wp-cli/php-cli-tools": "~0.11.2" + "wp-cli/php-cli-tools": "~0.11.2", + "ee/site-command": "dev-develop", + "ee/wp-command": "dev-master" }, "suggest": { "psy/psysh": "Enhanced shell functionality" From 00be30f0cac97bf7af770aa73a89572f7960cd94 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar Date: Wed, 14 Mar 2018 15:36:43 +0530 Subject: [PATCH 0026/1044] Fixed composer.json --- composer.json | 136 +++++++++++++++++++++++++------------------------- composer.lock | 37 +++++++++++++- 2 files changed, 103 insertions(+), 70 deletions(-) diff --git a/composer.json b/composer.json index e09a89de2..07f7bf3d0 100644 --- a/composer.json +++ b/composer.json @@ -1,74 +1,74 @@ { - "name": "easyengine/ee", - "description": "The command line interface for WordPress", - "keywords": [ "cli", "wordpress" ], - "homepage": "https://ee.org", - "license": "MIT", - "support": { - "issues": "https://github.com/ee/ee/issues", - "source": "https://github.com/ee/ee", - "docs": "https://make.wordpress.org/cli/handbook/" - }, - "bin": [ - "bin/ee.bat", "bin/ee" - ], - "config": { - "platform": { - "php": "5.3.29" - }, - "sort-packages": true - }, - "minimum-stability": "dev", - "prefer-stable": true, - "require": { - "php": ">=5.3.29", - "composer/composer": "^1.2.0", - "composer/semver": "~1.0", + "name": "easyengine/ee", + "description": "The command line interface for WordPress", + "keywords": [ "cli", "wordpress" ], + "homepage": "https://ee.org", + "license": "MIT", + "support": { + "issues": "https://github.com/ee/ee/issues", + "source": "https://github.com/ee/ee", + "docs": "https://make.wordpress.org/cli/handbook/" + }, + "bin": [ + "bin/ee.bat", "bin/ee" + ], + "config": { + "platform": { + "php": "5.3.29" + }, + "sort-packages": true + }, + "minimum-stability": "dev", + "prefer-stable": true, + "require": { + "php": ">=5.3.29", + "composer/composer": "^1.2.0", + "composer/semver": "~1.0", + "ee/site-command": "dev-master", + "ee/wp-command": "dev-master", "funkjedi/composer-include-files": "^1.0", "justinrainbow/json-schema": "~5.2.5", - "mustache/mustache": "~2.4", - "ramsey/array_column": "~1.1", - "rmccue/requests": "~1.6", - "symfony/config": "^2.7|^3.0", - "symfony/console": "^2.7|^3.0", - "symfony/debug": "^2.7|^3.0", - "symfony/dependency-injection": "^2.7|^3.0", - "symfony/event-dispatcher": "^2.7|^3.0", - "symfony/filesystem": "^2.7|^3.0", - "symfony/finder": "^2.7|^3.0", - "symfony/process": "^2.1|^3.0", - "symfony/translation": "^2.7|^3.0", - "symfony/yaml": "^2.7|^3.0", - "wp-cli/mustangostang-spyc": "^0.6.3", - "wp-cli/php-cli-tools": "~0.11.2", - "ee/site-command": "dev-develop", - "ee/wp-command": "dev-master" - }, - "suggest": { - "psy/psysh": "Enhanced shell functionality" - }, - "autoload": { - "psr-0": { - "EE": "php", - "EE\\Bootstrap": "php/EE/Bootstrap" - }, + "mustache/mustache": "~2.4", + "ramsey/array_column": "~1.1", + "rmccue/requests": "~1.6", + "symfony/config": "^2.7|^3.0", + "symfony/console": "^2.7|^3.0", + "symfony/debug": "^2.7|^3.0", + "symfony/dependency-injection": "^2.7|^3.0", + "symfony/event-dispatcher": "^2.7|^3.0", + "symfony/filesystem": "^2.7|^3.0", + "symfony/finder": "^2.7|^3.0", + "symfony/process": "^2.1|^3.0", + "symfony/translation": "^2.7|^3.0", + "symfony/yaml": "^2.7|^3.0", + "wp-cli/mustangostang-spyc": "^0.6.3", + "wp-cli/php-cli-tools": "~0.11.2" + }, + "suggest": { + "psy/psysh": "Enhanced shell functionality" + }, + "autoload": { + "psr-0": { + "EE": "php", + "EE\\Bootstrap": "php/EE/Bootstrap" + }, - "psr-4": { - "": "php/commands/src" - } - }, - "extra": { - "branch-alias": { - "dev-master": "1.5.x-dev" - }, - "include_files": [ - "php/utils.php", - "php/dispatcher.php", - "php/class-ee.php", - "php/class-ee-command.php" - ] - }, - "repositories": { + "psr-4": { + "": "php/commands/src" + } + }, + "extra": { + "branch-alias": { + "dev-master": "1.5.x-dev" + }, + "include_files": [ + "php/utils.php", + "php/dispatcher.php", + "php/class-ee.php", + "php/class-ee-command.php" + ] + }, + "repositories": { "ee/site-command": { "type": "vcs", "url": "git@git.rtcamp.com:sys/site-command.git" @@ -77,5 +77,5 @@ "type": "vcs", "url": "git@git.rtcamp.com:sys/wp-command.git" } - } + } } diff --git a/composer.lock b/composer.lock index b4890a1d9..f4bfa8608 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "d252b34722db82655ba289eb2c27dfcc", + "content-hash": "2bab8599a304f590815397c96f71f635", "packages": [ { "name": "composer/ca-bundle", @@ -295,7 +295,40 @@ "MIT" ], "homepage": "https://github.com/ee/site", - "time": "2018-02-27 05:34:19" + "time": "2018-03-06 13:44:05" + }, + { + "name": "funkjedi/composer-include-files", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/funkjedi/composer-include-files.git", + "reference": "5e96f2e46537d99b8b72662796955dba739e251f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/funkjedi/composer-include-files/zipball/5e96f2e46537d99b8b72662796955dba739e251f", + "reference": "5e96f2e46537d99b8b72662796955dba739e251f", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0" + }, + "type": "composer-plugin", + "extra": { + "class": "ComposerIncludeFiles\\Plugin" + }, + "autoload": { + "psr-4": { + "ComposerIncludeFiles\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "homepage": "https://github.com/easyengine/wp-command", + "time": "2018-03-13 12:33:49" }, { "name": "funkjedi/composer-include-files", From 1c3e67c926b15fdc64d10dd23390cc9c05076bbc Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar Date: Wed, 14 Mar 2018 15:49:23 +0530 Subject: [PATCH 0027/1044] Uploaded composer.lock file --- composer.lock | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/composer.lock b/composer.lock index f4bfa8608..23563a4a2 100644 --- a/composer.lock +++ b/composer.lock @@ -298,32 +298,31 @@ "time": "2018-03-06 13:44:05" }, { - "name": "funkjedi/composer-include-files", - "version": "1.0.0", + "name": "ee/wp-command", + "version": "dev-master", "source": { "type": "git", - "url": "https://github.com/funkjedi/composer-include-files.git", - "reference": "5e96f2e46537d99b8b72662796955dba739e251f" + "url": "git@git.rtcamp.com:sys/wp-command.git", + "reference": "84a03ca8cd9c227e51eb5d082e9f4bacfd8de188" }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/funkjedi/composer-include-files/zipball/5e96f2e46537d99b8b72662796955dba739e251f", - "reference": "5e96f2e46537d99b8b72662796955dba739e251f", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.0" - }, - "type": "composer-plugin", + "type": "wp-cli-package", "extra": { - "class": "ComposerIncludeFiles\\Plugin" + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "wp" + ] }, "autoload": { "psr-4": { - "ComposerIncludeFiles\\": "src" - } + "": "src/" + }, + "files": [ + "wp-command.php" + ] }, - "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], From 600a5659cb7fa518f9ca330f62c8182bee930f3e Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi Date: Wed, 14 Mar 2018 16:33:14 +0530 Subject: [PATCH 0028/1044] Add init_ee4 to Runner.php Add constants in ee.php --- php/EE/Runner.php | 19 +++++++++++++++++++ php/ee.php | 3 +++ 2 files changed, 22 insertions(+) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 963958705..f72f2e7ca 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -43,6 +43,24 @@ public function __get( $key ) { return $this->$key; } + /** + * Function to check and create the root directory for ee4. + */ + private function init_ee4() { + + if ( ! is_dir( EE_CONF_ROOT ) ) { + mkdir( EE_CONF_ROOT ); + } + + if ( ! is_dir( $this->config['sites_path'] ) ) { + mkdir( $this->config['sites_path'] ); + } + define( 'WEBROOT', \EE\Utils\trailingslashit( $this->config['sites_path'] ) ); + define( 'DB', EE_CONF_ROOT . 'ee4.db' ); + define( 'LOCALHOST_IP', '127.0.0.1' ); + define( 'TABLE', 'sites' ); + } + /** * Register a command for early invocation, generally before WordPress loads. * @@ -627,6 +645,7 @@ public function start() { $this->ensure_present_in_config( 'sites_path', Utils\get_home_dir(). '/Sites' ); $this->ensure_present_in_config( 'db_path', Utils\get_home_dir(). '/.ee4/ee4.db' ); + $this->init_ee4(); // Enable PHP error reporting to stderr if testing. if ( getenv( 'BEHAT_RUN' ) ) { diff --git a/php/ee.php b/php/ee.php index 48e8e8499..fbe65e58e 100644 --- a/php/ee.php +++ b/php/ee.php @@ -4,6 +4,9 @@ define( 'EE', true ); define( 'EE_VERSION', trim( file_get_contents( EE_ROOT . '/VERSION' ) ) ); define( 'EE_START_MICROTIME', microtime( true ) ); +define( 'HOME', $_SERVER['HOME'] ); +define( 'EE_CONF_ROOT', HOME . '/.ee4' ); +define( 'EE_SITE_CONF_ROOT', EE_ROOT . '/ee4-config/' ); if ( file_exists( EE_ROOT . '/vendor/autoload.php' ) ) { define( 'EE_VENDOR_DIR', EE_ROOT . '/vendor' ); From 2aef2c2edf5a5e519f8f2c4a4fa3345e35e339b1 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi Date: Wed, 14 Mar 2018 21:34:25 +0530 Subject: [PATCH 0029/1044] Add logger Update utils to resolve namespace issue --- .idea/ee4.iml | 11 +++++++ composer.json | 7 +++-- composer.lock | 80 ++++++++++++++++++++++++++++++++++++++++++++++- php/EE/Runner.php | 15 ++++++++- php/class-ee.php | 20 ++++++++++++ php/utils.php | 6 ++-- 6 files changed, 131 insertions(+), 8 deletions(-) create mode 100644 .idea/ee4.iml diff --git a/.idea/ee4.iml b/.idea/ee4.iml new file mode 100644 index 000000000..545c81804 --- /dev/null +++ b/.idea/ee4.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/composer.json b/composer.json index cb858d80f..0020a89b0 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,10 @@ "php": ">=5.3.29", "composer/composer": "^1.2.0", "composer/semver": "~1.0", + "ee/site-command": "dev-master", + "ee/wp-command": "dev-master", "justinrainbow/json-schema": "~5.2.5", + "monolog/monolog": "^1.23", "mustache/mustache": "~2.4", "ramsey/array_column": "~1.1", "rmccue/requests": "~1.6", @@ -44,9 +47,7 @@ "symfony/yaml": "^2.7|^3.0", "wp-cli/autoload-splitter": "^0.1.5", "wp-cli/mustangostang-spyc": "^0.6.3", - "wp-cli/php-cli-tools": "~0.11.2", - "ee/site-command": "dev-master", - "ee/wp-command": "dev-master" + "wp-cli/php-cli-tools": "~0.11.2" }, "suggest": { "psy/psysh": "Enhanced shell functionality" diff --git a/composer.lock b/composer.lock index eeb46f232..4e7afd7f1 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "22f46c35014680ccaeeecff176b91829", + "content-hash": "0a9ef06ee2e7c71f95f0adab7d3140c5", "packages": [ { "name": "composer/ca-bundle", @@ -395,6 +395,84 @@ ], "time": "2018-02-14T22:26:30+00:00" }, + { + "name": "monolog/monolog", + "version": "1.23.0", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/monolog.git", + "reference": "fd8c787753b3a2ad11bc60c063cff1358a32a3b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/fd8c787753b3a2ad11bc60c063cff1358a32a3b4", + "reference": "fd8c787753b3a2ad11bc60c063cff1358a32a3b4", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "psr/log": "~1.0" + }, + "provide": { + "psr/log-implementation": "1.0.0" + }, + "require-dev": { + "aws/aws-sdk-php": "^2.4.9 || ^3.0", + "doctrine/couchdb": "~1.0@dev", + "graylog2/gelf-php": "~1.0", + "jakub-onderka/php-parallel-lint": "0.9", + "php-amqplib/php-amqplib": "~2.4", + "php-console/php-console": "^3.1.3", + "phpunit/phpunit": "~4.5", + "phpunit/phpunit-mock-objects": "2.3.0", + "ruflin/elastica": ">=0.90 <3.0", + "sentry/sentry": "^0.13", + "swiftmailer/swiftmailer": "^5.3|^6.0" + }, + "suggest": { + "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", + "doctrine/couchdb": "Allow sending log messages to a CouchDB server", + "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", + "ext-mongo": "Allow sending log messages to a MongoDB server", + "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", + "mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver", + "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", + "php-console/php-console": "Allow sending log messages to Google Chrome", + "rollbar/rollbar": "Allow sending log messages to Rollbar", + "ruflin/elastica": "Allow sending log messages to an Elastic Search server", + "sentry/sentry": "Allow sending log messages to a Sentry server" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Monolog\\": "src/Monolog" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Sends your logs to files, sockets, inboxes, databases and various web services", + "homepage": "http://github.com/Seldaek/monolog", + "keywords": [ + "log", + "logging", + "psr-3" + ], + "time": "2017-06-19T01:22:40+00:00" + }, { "name": "mustache/mustache", "version": "v2.12.0", diff --git a/php/EE/Runner.php b/php/EE/Runner.php index f72f2e7ca..a31580538 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -7,6 +7,9 @@ use EE\Dispatcher; use EE\Dispatcher\CompositeCommand; use Mustangostang\Spyc; +use Monolog\Logger; +use Monolog\Handler\StreamHandler; +use Monolog\Formatter\LineFormatter; /** * Performs the execution of a command. @@ -56,7 +59,7 @@ private function init_ee4() { mkdir( $this->config['sites_path'] ); } define( 'WEBROOT', \EE\Utils\trailingslashit( $this->config['sites_path'] ) ); - define( 'DB', EE_CONF_ROOT . 'ee4.db' ); + define( 'DB', EE_CONF_ROOT . '/ee4.db' ); define( 'LOCALHOST_IP', '127.0.0.1' ); define( 'TABLE', 'sites' ); } @@ -476,6 +479,16 @@ public function init_logger() { } EE::set_logger( $logger ); + + $dateFormat = 'd-m-Y H:i:s'; + $output = "[%datetime%] %channel%.%level_name%: %message% %context% %extra%\n"; + $formatter = new \Monolog\Formatter\LineFormatter( $output, $dateFormat, false, true ); + $stream = new \Monolog\Handler\StreamHandler( EE_CONF_ROOT . '/ee4.log', Logger::DEBUG ); + $stream->setFormatter( $formatter ); + $file_logger = new \Monolog\Logger( 'ee4' ); + $file_logger->pushHandler( $stream ); + $file_logger->info( '::::::::::::::::::::::::ee4 invoked::::::::::::::::::::::::' ); + EE::set_file_logger( $file_logger ); } public function get_required_files() { diff --git a/php/class-ee.php b/php/class-ee.php index 1a3892338..7d5dccceb 100644 --- a/php/class-ee.php +++ b/php/class-ee.php @@ -24,6 +24,8 @@ class EE { private static $db; + private static $file_logger; + /** * Set the logger instance. * @@ -33,6 +35,24 @@ public static function set_logger( $logger ) { self::$logger = $logger; } + /** + * Set the file logger instance. + * + * @param object $file_logger + */ + public static function set_file_logger( $file_logger ) { + self::$file_logger = $file_logger; + } + + /** + * Return file logger object. + * + * @return object $file_logger + */ + public static function get_file_logger() { + return self::$file_logger; + } + /** * Get the Configurator instance * diff --git a/php/utils.php b/php/utils.php index 3cdd85beb..ef1732462 100644 --- a/php/utils.php +++ b/php/utils.php @@ -1358,10 +1358,10 @@ function copy_recursive( $source, $dest ) { * @param string $dir path to directory. */ function delete_dir( $dir ) { - $it = new RecursiveDirectoryIterator( $dir, RecursiveDirectoryIterator::SKIP_DOTS ); - $files = new RecursiveIteratorIterator( + $it = new \RecursiveDirectoryIterator( $dir, \RecursiveDirectoryIterator::SKIP_DOTS ); + $files = new \RecursiveIteratorIterator( $it, - RecursiveIteratorIterator::CHILD_FIRST + \RecursiveIteratorIterator::CHILD_FIRST ); foreach ( $files as $file ) { if ( $file->isDir() ) { From 9c90b92553acc24c0c253448caad0def0d15c920 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi Date: Wed, 14 Mar 2018 22:27:30 +0530 Subject: [PATCH 0030/1044] Add lgging to console logger --- php/class-ee.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/php/class-ee.php b/php/class-ee.php index 7d5dccceb..6792901f7 100644 --- a/php/class-ee.php +++ b/php/class-ee.php @@ -514,6 +514,7 @@ public static function line( $message = '' ) { */ public static function log( $message ) { self::$logger->info( $message ); + self::$file_logger->info( $message ); } /** @@ -568,6 +569,7 @@ public static function debug( $message, $group = false ) { */ public static function warning( $message ) { self::$logger->warning( self::error_to_string( $message ) ); + self::$file_logger->warning( $message ); } /** @@ -589,6 +591,7 @@ public static function warning( $message ) { public static function error( $message, $exit = true ) { if ( ! isset( self::get_runner()->assoc_args['completions'] ) ) { self::$logger->error( self::error_to_string( $message ) ); + self::$file_logger->error( $message ); } $return_code = false; From b45e6f76bd69db7bf8625195fcef89847fff42e5 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi Date: Wed, 14 Mar 2018 22:44:32 +0530 Subject: [PATCH 0031/1044] Add wp-command patch for additional params --- php/EE/Dispatcher/Subcommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/EE/Dispatcher/Subcommand.php b/php/EE/Dispatcher/Subcommand.php index 17ee1a294..6b8179dd7 100644 --- a/php/EE/Dispatcher/Subcommand.php +++ b/php/EE/Dispatcher/Subcommand.php @@ -285,7 +285,7 @@ private function validate_args( $args, $assoc_args, $extra_args ) { } $unknown_positionals = $validator->unknown_positionals( $args ); - if ( ! empty( $unknown_positionals ) ) { + if ( ! empty( $unknown_positionals ) && 'wp' !== $this->name ) { \EE::error( 'Too many positional arguments: ' . implode( ' ', $unknown_positionals ) From 32edf223d1749f25a9ca8a2151c8fa9637ca8b09 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi Date: Thu, 15 Mar 2018 12:51:41 +0530 Subject: [PATCH 0032/1044] Add logger to phar --- utils/make-phar.php | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/make-phar.php b/utils/make-phar.php index e8c0f6742..e95229bd3 100644 --- a/utils/make-phar.php +++ b/utils/make-phar.php @@ -168,6 +168,7 @@ function get_composer_versions( $current_version ) { ->in(EE_VENDOR_DIR . '/ramsey/array_column') ->in(EE_VENDOR_DIR . '/symfony/finder') ->in(EE_VENDOR_DIR . '/symfony/polyfill-mbstring') + ->in(EE_VENDOR_DIR . '/monolog') ->notName('behat-tags.php') ->notPath('#(?:[^/]+-command|php-cli-tools)/vendor/#') // For running locally, in case have composer installed or symlinked them. ->exclude('examples') From 8133bfece53c4e27852a77e3d0d5f331802ba5a2 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi Date: Fri, 16 Mar 2018 16:29:49 +0530 Subject: [PATCH 0033/1044] Update composer --- composer.json | 32 ++++++++--------- composer.lock | 95 ++++++++++++++++++++++++++------------------------- 2 files changed, 63 insertions(+), 64 deletions(-) diff --git a/composer.json b/composer.json index 0020a89b0..7d914699e 100644 --- a/composer.json +++ b/composer.json @@ -1,10 +1,7 @@ { "name": "easyengine/ee", "description": "The command line interface for WordPress", - "keywords": [ - "cli", - "wordpress" - ], + "keywords": [ "cli", "wordpress" ], "homepage": "https://ee.org", "license": "MIT", "support": { @@ -13,8 +10,7 @@ "docs": "https://make.wordpress.org/cli/handbook/" }, "bin": [ - "bin/ee.bat", - "bin/ee" + "bin/ee.bat", "bin/ee" ], "config": { "platform": { @@ -30,6 +26,7 @@ "composer/semver": "~1.0", "ee/site-command": "dev-master", "ee/wp-command": "dev-master", + "funkjedi/composer-include-files": "^1.0", "justinrainbow/json-schema": "~5.2.5", "monolog/monolog": "^1.23", "mustache/mustache": "~2.4", @@ -45,7 +42,6 @@ "symfony/process": "^2.1|^3.0", "symfony/translation": "^2.7|^3.0", "symfony/yaml": "^2.7|^3.0", - "wp-cli/autoload-splitter": "^0.1.5", "wp-cli/mustangostang-spyc": "^0.6.3", "wp-cli/php-cli-tools": "~0.11.2" }, @@ -54,25 +50,25 @@ }, "autoload": { "psr-0": { - "EE": "php" + "EE": "php", + "EE\\Bootstrap": "php/EE/Bootstrap" }, + "psr-4": { "": "php/commands/src" - }, - "files": [ - "php/class-ee-db.php" - ] + } }, "extra": { "branch-alias": { "dev-master": "1.5.x-dev" }, - "autoload-splitter": { - "splitter-logic": "EE\\AutoloadSplitter", - "splitter-location": "php/EE/AutoloadSplitter.php", - "split-target-prefix-true": "autoload_commands", - "split-target-prefix-false": "autoload_framework" - } + "include_files": [ + "php/class-ee.php", + "php/class-ee-command.php", + "php/class-ee-db.php", + "php/dispatcher.php", + "php/utils.php" + ] }, "repositories": { "ee/site-command": { diff --git a/composer.lock b/composer.lock index 4e7afd7f1..020c87b1e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "0a9ef06ee2e7c71f95f0adab7d3140c5", + "content-hash": "c49b9beeb8ba141ad744f1b829be3228", "packages": [ { "name": "composer/ca-bundle", @@ -268,7 +268,7 @@ "source": { "type": "git", "url": "git@git.rtcamp.com:sys/site-command.git", - "reference": "5219c4d025ed7f24bb612c411481ba54c793847b" + "reference": "ef5f7f4c8aaf5fb3ec509c28919eeb2d2b082dbd" }, "type": "wp-cli-package", "extra": { @@ -295,7 +295,7 @@ "MIT" ], "homepage": "https://github.com/ee/site", - "time": "2018-03-06T13:44:05+00:00" + "time": "2018-03-16T10:32:50+00:00" }, { "name": "ee/wp-command", @@ -303,7 +303,7 @@ "source": { "type": "git", "url": "git@git.rtcamp.com:sys/wp-command.git", - "reference": "84a03ca8cd9c227e51eb5d082e9f4bacfd8de188" + "reference": "5dd0e04c2f11a2b1ed1bb25e26a9c55e6f4d66a4" }, "type": "wp-cli-package", "extra": { @@ -327,7 +327,51 @@ "MIT" ], "homepage": "https://github.com/easyengine/wp-command", - "time": "2018-03-13T12:33:49+00:00" + "time": "2018-03-16T10:51:04+00:00" + }, + { + "name": "funkjedi/composer-include-files", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/funkjedi/composer-include-files.git", + "reference": "5e96f2e46537d99b8b72662796955dba739e251f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/funkjedi/composer-include-files/zipball/5e96f2e46537d99b8b72662796955dba739e251f", + "reference": "5e96f2e46537d99b8b72662796955dba739e251f", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0" + }, + "type": "composer-plugin", + "extra": { + "class": "ComposerIncludeFiles\\Plugin" + }, + "autoload": { + "psr-4": { + "ComposerIncludeFiles\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Tim Robertson", + "email": "funkjedi@gmail.com" + } + ], + "description": "Include files at a higher priority than autoload files.", + "homepage": "https://github.com/funkjedi/composer-include-files", + "keywords": [ + "autoload", + "composer" + ], + "time": "2016-12-23T18:15:30+00:00" }, { "name": "justinrainbow/json-schema", @@ -1417,47 +1461,6 @@ "homepage": "https://symfony.com", "time": "2018-01-03T07:36:31+00:00" }, - { - "name": "wp-cli/autoload-splitter", - "version": "v0.1.5", - "source": { - "type": "git", - "url": "https://github.com/wp-cli/autoload-splitter.git", - "reference": "fb4302da26390811d2631c62b42b75976d224bb8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/wp-cli/autoload-splitter/zipball/fb4302da26390811d2631c62b42b75976d224bb8", - "reference": "fb4302da26390811d2631c62b42b75976d224bb8", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.1" - }, - "type": "composer-plugin", - "extra": { - "class": "WP_CLI\\AutoloadSplitter\\ComposerPlugin" - }, - "autoload": { - "psr-4": { - "WP_CLI\\AutoloadSplitter\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Alain Schlesser", - "email": "alain.schlesser@gmail.com", - "homepage": "https://www.alainschlesser.com" - } - ], - "description": "Composer plugin for splitting a generated autoloader into two distinct parts.", - "homepage": "https://wp-cli.org", - "time": "2017-08-03T08:40:16+00:00" - }, { "name": "wp-cli/mustangostang-spyc", "version": "0.6.3", From 38fcb6ff900cb4a0108da61b746ac2f25b9061e3 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar Date: Mon, 19 Mar 2018 17:20:12 +0530 Subject: [PATCH 0034/1044] Fixs tests --- tests/test-extractor.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test-extractor.php b/tests/test-extractor.php index ccab128a9..8d3ba5a3f 100644 --- a/tests/test-extractor.php +++ b/tests/test-extractor.php @@ -33,7 +33,9 @@ public function setUp() { self::$prev_logger = $class_ee_logger->getValue(); self::$logger = new \EE\Loggers\Execution; + $logger_quiet = new \EE\Loggers\Quiet; EE::set_logger( self::$logger ); + EE::set_file_logger( $logger_quiet ); // Remove any failed tests detritus. $temp_dirs = Utils\get_temp_dir() . self::$copy_overwrite_files_prefix . '*'; From a74c44a95a05673de872cbf79183fa2789aa6e2c Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar Date: Mon, 19 Mar 2018 14:59:18 +0530 Subject: [PATCH 0035/1044] Revert Autoloading changes made earlier --- composer.json | 32 ++-- composer.lock | 95 +++++----- php/EE/AutoloadSplitter.php | 33 ++++ php/EE/Autoloader.php | 177 ++++++++++++++++++ .../Bootstrap/DeclareAbstractBaseCommand.php | 26 +++ php/EE/Bootstrap/DeclareMainClass.php | 26 +++ php/EE/Bootstrap/IncludeBundledAutoloader.php | 37 ++++ .../Bootstrap/IncludeFallbackAutoloader.php | 35 ++++ .../Bootstrap/IncludeFrameworkAutoloader.php | 50 +++++ php/EE/Bootstrap/LoadDispatcher.php | 26 +++ php/EE/Bootstrap/LoadUtilityFunctions.php | 26 +++ .../Bootstrap/RegisterFrameworkCommands.php | 42 +++++ php/bootstrap.php | 28 ++- 13 files changed, 568 insertions(+), 65 deletions(-) create mode 100644 php/EE/AutoloadSplitter.php create mode 100644 php/EE/Autoloader.php create mode 100644 php/EE/Bootstrap/DeclareAbstractBaseCommand.php create mode 100644 php/EE/Bootstrap/DeclareMainClass.php create mode 100644 php/EE/Bootstrap/IncludeBundledAutoloader.php create mode 100644 php/EE/Bootstrap/IncludeFallbackAutoloader.php create mode 100644 php/EE/Bootstrap/IncludeFrameworkAutoloader.php create mode 100644 php/EE/Bootstrap/LoadDispatcher.php create mode 100644 php/EE/Bootstrap/LoadUtilityFunctions.php create mode 100644 php/EE/Bootstrap/RegisterFrameworkCommands.php diff --git a/composer.json b/composer.json index 7d914699e..0020a89b0 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,10 @@ { "name": "easyengine/ee", "description": "The command line interface for WordPress", - "keywords": [ "cli", "wordpress" ], + "keywords": [ + "cli", + "wordpress" + ], "homepage": "https://ee.org", "license": "MIT", "support": { @@ -10,7 +13,8 @@ "docs": "https://make.wordpress.org/cli/handbook/" }, "bin": [ - "bin/ee.bat", "bin/ee" + "bin/ee.bat", + "bin/ee" ], "config": { "platform": { @@ -26,7 +30,6 @@ "composer/semver": "~1.0", "ee/site-command": "dev-master", "ee/wp-command": "dev-master", - "funkjedi/composer-include-files": "^1.0", "justinrainbow/json-schema": "~5.2.5", "monolog/monolog": "^1.23", "mustache/mustache": "~2.4", @@ -42,6 +45,7 @@ "symfony/process": "^2.1|^3.0", "symfony/translation": "^2.7|^3.0", "symfony/yaml": "^2.7|^3.0", + "wp-cli/autoload-splitter": "^0.1.5", "wp-cli/mustangostang-spyc": "^0.6.3", "wp-cli/php-cli-tools": "~0.11.2" }, @@ -50,25 +54,25 @@ }, "autoload": { "psr-0": { - "EE": "php", - "EE\\Bootstrap": "php/EE/Bootstrap" + "EE": "php" }, - "psr-4": { "": "php/commands/src" - } + }, + "files": [ + "php/class-ee-db.php" + ] }, "extra": { "branch-alias": { "dev-master": "1.5.x-dev" }, - "include_files": [ - "php/class-ee.php", - "php/class-ee-command.php", - "php/class-ee-db.php", - "php/dispatcher.php", - "php/utils.php" - ] + "autoload-splitter": { + "splitter-logic": "EE\\AutoloadSplitter", + "splitter-location": "php/EE/AutoloadSplitter.php", + "split-target-prefix-true": "autoload_commands", + "split-target-prefix-false": "autoload_framework" + } }, "repositories": { "ee/site-command": { diff --git a/composer.lock b/composer.lock index 020c87b1e..4e7afd7f1 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "c49b9beeb8ba141ad744f1b829be3228", + "content-hash": "0a9ef06ee2e7c71f95f0adab7d3140c5", "packages": [ { "name": "composer/ca-bundle", @@ -268,7 +268,7 @@ "source": { "type": "git", "url": "git@git.rtcamp.com:sys/site-command.git", - "reference": "ef5f7f4c8aaf5fb3ec509c28919eeb2d2b082dbd" + "reference": "5219c4d025ed7f24bb612c411481ba54c793847b" }, "type": "wp-cli-package", "extra": { @@ -295,7 +295,7 @@ "MIT" ], "homepage": "https://github.com/ee/site", - "time": "2018-03-16T10:32:50+00:00" + "time": "2018-03-06T13:44:05+00:00" }, { "name": "ee/wp-command", @@ -303,7 +303,7 @@ "source": { "type": "git", "url": "git@git.rtcamp.com:sys/wp-command.git", - "reference": "5dd0e04c2f11a2b1ed1bb25e26a9c55e6f4d66a4" + "reference": "84a03ca8cd9c227e51eb5d082e9f4bacfd8de188" }, "type": "wp-cli-package", "extra": { @@ -327,51 +327,7 @@ "MIT" ], "homepage": "https://github.com/easyengine/wp-command", - "time": "2018-03-16T10:51:04+00:00" - }, - { - "name": "funkjedi/composer-include-files", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/funkjedi/composer-include-files.git", - "reference": "5e96f2e46537d99b8b72662796955dba739e251f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/funkjedi/composer-include-files/zipball/5e96f2e46537d99b8b72662796955dba739e251f", - "reference": "5e96f2e46537d99b8b72662796955dba739e251f", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.0" - }, - "type": "composer-plugin", - "extra": { - "class": "ComposerIncludeFiles\\Plugin" - }, - "autoload": { - "psr-4": { - "ComposerIncludeFiles\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Tim Robertson", - "email": "funkjedi@gmail.com" - } - ], - "description": "Include files at a higher priority than autoload files.", - "homepage": "https://github.com/funkjedi/composer-include-files", - "keywords": [ - "autoload", - "composer" - ], - "time": "2016-12-23T18:15:30+00:00" + "time": "2018-03-13T12:33:49+00:00" }, { "name": "justinrainbow/json-schema", @@ -1461,6 +1417,47 @@ "homepage": "https://symfony.com", "time": "2018-01-03T07:36:31+00:00" }, + { + "name": "wp-cli/autoload-splitter", + "version": "v0.1.5", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/autoload-splitter.git", + "reference": "fb4302da26390811d2631c62b42b75976d224bb8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/autoload-splitter/zipball/fb4302da26390811d2631c62b42b75976d224bb8", + "reference": "fb4302da26390811d2631c62b42b75976d224bb8", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.1" + }, + "type": "composer-plugin", + "extra": { + "class": "WP_CLI\\AutoloadSplitter\\ComposerPlugin" + }, + "autoload": { + "psr-4": { + "WP_CLI\\AutoloadSplitter\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Alain Schlesser", + "email": "alain.schlesser@gmail.com", + "homepage": "https://www.alainschlesser.com" + } + ], + "description": "Composer plugin for splitting a generated autoloader into two distinct parts.", + "homepage": "https://wp-cli.org", + "time": "2017-08-03T08:40:16+00:00" + }, { "name": "wp-cli/mustangostang-spyc", "version": "0.6.3", diff --git a/php/EE/AutoloadSplitter.php b/php/EE/AutoloadSplitter.php new file mode 100644 index 000000000..ebc78bf66 --- /dev/null +++ b/php/EE/AutoloadSplitter.php @@ -0,0 +1,33 @@ +unregister(); + } + + /** + * Registers the autoload callback with the SPL autoload system. + */ + public function register() { + spl_autoload_register( array( $this, 'autoload' ) ); + } + + /** + * Unregisters the autoload callback with the SPL autoload system. + */ + public function unregister() { + spl_autoload_unregister( array( $this, 'autoload' ) ); + } + + /** + * Add a specific namespace structure with our custom autoloader. + * + * @param string $root Root namespace name. + * @param string $base_dir Directory containing the class files. + * @param string $prefix Prefix to be added before the class. + * @param string $suffix Suffix to be added after the class. + * @param boolean $lowercase Whether the class should be changed to + * lowercase. + * @param boolean $underscores Whether the underscores should be changed to + * hyphens. + * + * @return self + */ + public function add_namespace( + $root, + $base_dir, + $prefix = '', + $suffix = '.php', + $lowercase = false, + $underscores = false + ) { + $this->namespaces[] = array( + 'root' => $this->normalize_root( (string) $root ), + 'base_dir' => $this->add_trailing_slash( (string) $base_dir ), + 'prefix' => (string) $prefix, + 'suffix' => (string) $suffix, + 'lowercase' => (bool) $lowercase, + 'underscores' => (bool) $underscores, + ); + + return $this; + } + + /** + * The autoload function that gets registered with the SPL Autoloader + * system. + * + * @param string $class The class that got requested by the spl_autoloader. + */ + public function autoload( $class ) { + + // Iterate over namespaces to find a match. + foreach ( $this->namespaces as $namespace ) { + + // Move on if the object does not belong to the current namespace. + if ( 0 !== strpos( $class, $namespace['root'] ) ) { + continue; + } + + // Remove namespace root level to correspond with root filesystem, and + // replace the namespace separator "\" by the system-dependent directory separator. + $filename = str_replace( + array( $namespace['root'], '\\' ), array( '', DIRECTORY_SEPARATOR ), + $class + ); + + // Remove a leading backslash from the class name. + $filename = $this->remove_leading_backslash( $filename ); + + // Change to lower case if requested. + if ( $namespace['lowercase'] ) { + $filename = strtolower( $filename ); + } + + // Change underscores into hyphens if requested. + if ( $namespace['underscores'] ) { + $filename = str_replace( '_', '-', $filename ); + } + + // Add base_dir, prefix and suffix. + $filepath = $namespace['base_dir'] + . $namespace['prefix'] + . $filename + . $namespace['suffix']; + + // Throw an exception if the file does not exist or is not readable. + if ( is_readable( $filepath ) ) { + require_once $filepath; + } + } + } + + /** + * Normalize a namespace root. + * + * @param string $root Namespace root that needs to be normalized. + * + * @return string Normalized namespace root. + */ + protected function normalize_root( $root ) { + $root = $this->remove_leading_backslash( $root ); + + return $this->add_trailing_backslash( $root ); + } + + /** + * Remove a leading backslash from a string. + * + * @param string $string String to remove the leading backslash from. + * + * @return string Modified string. + */ + protected function remove_leading_backslash( $string ) { + return ltrim( $string, '\\' ); + } + + /** + * Make sure a string ends with a trailing backslash. + * + * @param string $string String to check the trailing backslash of. + * + * @return string Modified string. + */ + protected function add_trailing_backslash( $string ) { + return rtrim( $string, '\\' ) . '\\'; + } + + /** + * Make sure a string ends with a trailing slash. + * + * @param string $string String to check the trailing slash of. + * + * @return string Modified string. + */ + protected function add_trailing_slash( $string ) { + return rtrim( $string, '/\\' ) . '/'; + } +} diff --git a/php/EE/Bootstrap/DeclareAbstractBaseCommand.php b/php/EE/Bootstrap/DeclareAbstractBaseCommand.php new file mode 100644 index 000000000..5d34b78f3 --- /dev/null +++ b/php/EE/Bootstrap/DeclareAbstractBaseCommand.php @@ -0,0 +1,26 @@ +get_custom_vendor_folder() ) { + array_unshift( + $autoloader_paths, + EE_ROOT . '/../../../' . $custom_vendor . '/autoload_commands.php' + ); + } + + return $autoloader_paths; + } +} diff --git a/php/EE/Bootstrap/IncludeFallbackAutoloader.php b/php/EE/Bootstrap/IncludeFallbackAutoloader.php new file mode 100644 index 000000000..04ada980c --- /dev/null +++ b/php/EE/Bootstrap/IncludeFallbackAutoloader.php @@ -0,0 +1,35 @@ +get_custom_vendor_folder() ) { + array_unshift( + $autoloader_paths, + EE_ROOT . '/../../../' . $custom_vendor . '/autoload.php' + ); + } + + return $autoloader_paths; + } +} diff --git a/php/EE/Bootstrap/IncludeFrameworkAutoloader.php b/php/EE/Bootstrap/IncludeFrameworkAutoloader.php new file mode 100644 index 000000000..3b9ab522e --- /dev/null +++ b/php/EE/Bootstrap/IncludeFrameworkAutoloader.php @@ -0,0 +1,50 @@ +get_custom_vendor_folder() ) { + array_unshift( + $autoloader_paths, + EE_ROOT . '/../../../' . $custom_vendor . '/autoload_framework.php' + ); + } + + return $autoloader_paths; + } + + /** + * Handle the failure to find an autoloader. + * + * @return void + */ + protected function handle_failure() { + fwrite( + STDERR, + "Internal error: Can't find Composer autoloader.\nTry running: composer install\n" + ); + exit( 3 ); + } +} diff --git a/php/EE/Bootstrap/LoadDispatcher.php b/php/EE/Bootstrap/LoadDispatcher.php new file mode 100644 index 000000000..728c97e62 --- /dev/null +++ b/php/EE/Bootstrap/LoadDispatcher.php @@ -0,0 +1,26 @@ +getMessage() + ); + } + } + + return $state; + } +} diff --git a/php/bootstrap.php b/php/bootstrap.php index e2e4b1efe..65ddb4ed4 100644 --- a/php/bootstrap.php +++ b/php/bootstrap.php @@ -14,17 +14,42 @@ */ function get_bootstrap_steps() { return array( + 'EE\Bootstrap\LoadUtilityFunctions', + 'EE\Bootstrap\LoadDispatcher', + 'EE\Bootstrap\DeclareMainClass', + 'EE\Bootstrap\DeclareAbstractBaseCommand', + 'EE\Bootstrap\IncludeFrameworkAutoloader', 'EE\Bootstrap\ConfigureRunner', 'EE\Bootstrap\InitializeColorization', 'EE\Bootstrap\InitializeLogger', 'EE\Bootstrap\DefineProtectedCommands', 'EE\Bootstrap\LoadRequiredCommand', 'EE\Bootstrap\IncludePackageAutoloader', + 'EE\Bootstrap\IncludeBundledAutoloader', + 'EE\Bootstrap\RegisterFrameworkCommands', + 'EE\Bootstrap\IncludeFallbackAutoloader', 'EE\Bootstrap\RegisterDeferredCommands', 'EE\Bootstrap\LaunchRunner', ); } +/** + * Register the classes needed for the bootstrap process. + * + * The Composer autoloader is not active yet at this point, so we need to use a + * custom autoloader to fetch the bootstrap classes in a flexible way. + */ +function prepare_bootstrap() { + require_once EE_ROOT . '/php/EE/Autoloader.php'; + + $autoloader = new Autoloader(); + + $autoloader->add_namespace( + 'EE\Bootstrap', + EE_ROOT . '/php/EE/Bootstrap' + )->register(); +} + /** * Initialize and return the bootstrap state to pass from step to step. * @@ -41,8 +66,7 @@ function initialize_bootstrap_state() { * `process()` method. */ function bootstrap() { - - require_once EE_VENDOR_DIR . '/autoload.php'; + prepare_bootstrap(); $state = initialize_bootstrap_state(); foreach ( get_bootstrap_steps() as $step ) { From 362315fac4a946101559690b76f22af53de3d416 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar Date: Mon, 19 Mar 2018 17:37:37 +0530 Subject: [PATCH 0036/1044] Fix autloading --- php/boot-fs.php | 2 +- php/boot-phar.php | 10 +++++----- php/{ee.php => init-ee.php} | 0 3 files changed, 6 insertions(+), 6 deletions(-) rename php/{ee.php => init-ee.php} (100%) diff --git a/php/boot-fs.php b/php/boot-fs.php index 9f001103e..2a8cf0d7e 100644 --- a/php/boot-fs.php +++ b/php/boot-fs.php @@ -14,5 +14,5 @@ define( 'EE_ROOT', dirname( __DIR__ ) ); -include_once EE_ROOT . '/php/ee.php'; +include_once EE_ROOT . '/php/init-ee.php'; diff --git a/php/boot-phar.php b/php/boot-phar.php index 97ad6239c..4fff464b7 100644 --- a/php/boot-phar.php +++ b/php/boot-phar.php @@ -3,13 +3,13 @@ // Store the path to the Phar early on for `Utils\phar-safe-path()` function. define( 'EE_PHAR_PATH', getcwd() ); -if ( file_exists( 'phar://ee.phar/php/ee.php' ) ) { +if ( file_exists( 'phar://ee.phar/php/init-ee.php' ) ) { define( 'EE_ROOT', 'phar://ee.phar' ); - include EE_ROOT . '/php/ee.php'; -} elseif ( file_exists( 'phar://ee.phar/vendor/ee/ee/php/ee.php' ) ) { + include EE_ROOT . '/php/init-ee.php'; +} elseif ( file_exists( 'phar://ee.phar/vendor/ee/ee/php/init-ee.php' ) ) { define( 'EE_ROOT', 'phar://ee.phar/vendor/ee/ee' ); - include EE_ROOT . '/php/ee.php'; + include EE_ROOT . '/php/init-ee.php'; } else { - echo "Couldn't find 'php/ee.php'. Was this Phar built correctly?"; + echo "Couldn't find 'php/init-ee.php'. Was this Phar built correctly?"; exit( 1 ); } diff --git a/php/ee.php b/php/init-ee.php similarity index 100% rename from php/ee.php rename to php/init-ee.php From 38d698e275ae8da91c7ab291771536fd9a192afd Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar Date: Mon, 19 Mar 2018 17:50:51 +0530 Subject: [PATCH 0037/1044] Revert changes made in past due to autoload --- tests/bootstrap.php | 1 - utils/make-phar.php | 1 - 2 files changed, 2 deletions(-) diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 80481698c..757e19f8f 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -15,7 +15,6 @@ define( 'EE_VENDOR_DIR' , dirname( dirname( EE_ROOT ) ) ); } -require_once EE_ROOT . '/php/class-ee.php'; require_once EE_VENDOR_DIR . '/autoload.php'; require_once EE_ROOT . '/php/utils.php'; diff --git a/utils/make-phar.php b/utils/make-phar.php index e95229bd3..efdeaba9b 100644 --- a/utils/make-phar.php +++ b/utils/make-phar.php @@ -13,7 +13,6 @@ exit(1); } -require EE_ROOT . '/php/class-ee.php'; require EE_VENDOR_DIR . '/autoload.php'; require EE_ROOT . '/php/utils.php'; From 16d35463f4182b062af65789f5ceed72d0792882 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar Date: Mon, 19 Mar 2018 18:24:02 +0530 Subject: [PATCH 0038/1044] Add require-dev section to composer Update lock file --- composer.json | 8 + composer.lock | 904 +++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 905 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index 0020a89b0..97d7f5161 100644 --- a/composer.json +++ b/composer.json @@ -49,6 +49,14 @@ "wp-cli/mustangostang-spyc": "^0.6.3", "wp-cli/php-cli-tools": "~0.11.2" }, + "require-dev": { + "behat/behat": "2.5.*", + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3", + "phpunit/phpunit": "3.7.*", + "roave/security-advisories": "dev-master", + "wimg/php-compatibility": "^8.0", + "wp-coding-standards/wpcs": "^0.13.1" + }, "suggest": { "psy/psysh": "Enhanced shell functionality" }, diff --git a/composer.lock b/composer.lock index 4e7afd7f1..2b4717b9f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "0a9ef06ee2e7c71f95f0adab7d3140c5", + "content-hash": "93ea52dfe7415e976235310dec02b2f2", "packages": [ { "name": "composer/ca-bundle", @@ -268,7 +268,7 @@ "source": { "type": "git", "url": "git@git.rtcamp.com:sys/site-command.git", - "reference": "5219c4d025ed7f24bb612c411481ba54c793847b" + "reference": "ef5f7f4c8aaf5fb3ec509c28919eeb2d2b082dbd" }, "type": "wp-cli-package", "extra": { @@ -295,7 +295,7 @@ "MIT" ], "homepage": "https://github.com/ee/site", - "time": "2018-03-06T13:44:05+00:00" + "time": "2018-03-16 10:32:50" }, { "name": "ee/wp-command", @@ -303,7 +303,7 @@ "source": { "type": "git", "url": "git@git.rtcamp.com:sys/wp-command.git", - "reference": "84a03ca8cd9c227e51eb5d082e9f4bacfd8de188" + "reference": "5dd0e04c2f11a2b1ed1bb25e26a9c55e6f4d66a4" }, "type": "wp-cli-package", "extra": { @@ -327,7 +327,7 @@ "MIT" ], "homepage": "https://github.com/easyengine/wp-command", - "time": "2018-03-13T12:33:49+00:00" + "time": "2018-03-16 10:51:04" }, { "name": "justinrainbow/json-schema", @@ -1557,12 +1557,902 @@ "time": "2017-10-12T21:50:48+00:00" } ], - "packages-dev": [], + "packages-dev": [ + { + "name": "behat/behat", + "version": "v2.5.5", + "source": { + "type": "git", + "url": "https://github.com/Behat/Behat.git", + "reference": "c1e48826b84669c97a1efa78459aedfdcdcf2120" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Behat/Behat/zipball/c1e48826b84669c97a1efa78459aedfdcdcf2120", + "reference": "c1e48826b84669c97a1efa78459aedfdcdcf2120", + "shasum": "" + }, + "require": { + "behat/gherkin": "~2.3.0", + "php": ">=5.3.1", + "symfony/config": "~2.3", + "symfony/console": "~2.0", + "symfony/dependency-injection": "~2.0", + "symfony/event-dispatcher": "~2.0", + "symfony/finder": "~2.0", + "symfony/translation": "~2.3", + "symfony/yaml": "~2.0" + }, + "require-dev": { + "phpunit/phpunit": "~3.7.19" + }, + "suggest": { + "behat/mink-extension": "for integration with Mink testing framework", + "behat/symfony2-extension": "for integration with Symfony2 web framework", + "behat/yii-extension": "for integration with Yii web framework" + }, + "bin": [ + "bin/behat" + ], + "type": "library", + "autoload": { + "psr-0": { + "Behat\\Behat": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + } + ], + "description": "Scenario-oriented BDD framework for PHP 5.3", + "homepage": "http://behat.org/", + "keywords": [ + "BDD", + "Behat", + "Symfony2" + ], + "time": "2015-06-01T09:37:55+00:00" + }, + { + "name": "behat/gherkin", + "version": "v2.3.5", + "source": { + "type": "git", + "url": "https://github.com/Behat/Gherkin.git", + "reference": "2b33963da5525400573560c173ab5c9c057e1852" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Behat/Gherkin/zipball/2b33963da5525400573560c173ab5c9c057e1852", + "reference": "2b33963da5525400573560c173ab5c9c057e1852", + "shasum": "" + }, + "require": { + "php": ">=5.3.1", + "symfony/finder": "~2.0" + }, + "require-dev": { + "symfony/config": "~2.0", + "symfony/translation": "~2.0", + "symfony/yaml": "~2.0" + }, + "suggest": { + "symfony/config": "If you want to use Config component to manage resources", + "symfony/translation": "If you want to use Symfony2 translations adapter", + "symfony/yaml": "If you want to parse features, represented in YAML files" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-develop": "2.2-dev" + } + }, + "autoload": { + "psr-0": { + "Behat\\Gherkin": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + } + ], + "description": "Gherkin DSL parser for PHP 5.3", + "homepage": "http://behat.org/", + "keywords": [ + "BDD", + "Behat", + "DSL", + "Symfony2", + "parser" + ], + "time": "2013-10-15T11:22:17+00:00" + }, + { + "name": "dealerdirect/phpcodesniffer-composer-installer", + "version": "v0.4.4", + "source": { + "type": "git", + "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", + "reference": "2e41850d5f7797cbb1af7b030d245b3b24e63a08" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/2e41850d5f7797cbb1af7b030d245b3b24e63a08", + "reference": "2e41850d5f7797cbb1af7b030d245b3b24e63a08", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0", + "php": "^5.3|^7", + "squizlabs/php_codesniffer": "*" + }, + "require-dev": { + "composer/composer": "*", + "wimg/php-compatibility": "^8.0" + }, + "suggest": { + "dealerdirect/qa-tools": "All the PHP QA tools you'll need" + }, + "type": "composer-plugin", + "extra": { + "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" + }, + "autoload": { + "psr-4": { + "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Franck Nijhof", + "email": "f.nijhof@dealerdirect.nl", + "homepage": "http://workingatdealerdirect.eu", + "role": "Developer" + } + ], + "description": "PHP_CodeSniffer Standards Composer Installer Plugin", + "homepage": "http://workingatdealerdirect.eu", + "keywords": [ + "PHPCodeSniffer", + "PHP_CodeSniffer", + "code quality", + "codesniffer", + "composer", + "installer", + "phpcs", + "plugin", + "qa", + "quality", + "standard", + "standards", + "style guide", + "stylecheck", + "tests" + ], + "time": "2017-12-06T16:27:17+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "1.2.18", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "fe2466802556d3fe4e4d1d58ffd3ccfd0a19be0b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/fe2466802556d3fe4e4d1d58ffd3ccfd0a19be0b", + "reference": "fe2466802556d3fe4e4d1d58ffd3ccfd0a19be0b", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "phpunit/php-file-iterator": ">=1.3.0@stable", + "phpunit/php-text-template": ">=1.2.0@stable", + "phpunit/php-token-stream": ">=1.1.3,<1.3.0" + }, + "require-dev": { + "phpunit/phpunit": "3.7.*@dev" + }, + "suggest": { + "ext-dom": "*", + "ext-xdebug": ">=2.0.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "PHP/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "time": "2014-09-02T10:13:14+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "time": "2017-11-27T13:52:08+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2017-02-26T11:10:40+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "1.2.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "ad4e1e23ae01b483c16f600ff1bebec184588e32" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/ad4e1e23ae01b483c16f600ff1bebec184588e32", + "reference": "ad4e1e23ae01b483c16f600ff1bebec184588e32", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + }, + "autoload": { + "classmap": [ + "PHP/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2014-03-03T05:10:30+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "3.7.38", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "38709dc22d519a3d1be46849868aa2ddf822bcf6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/38709dc22d519a3d1be46849868aa2ddf822bcf6", + "reference": "38709dc22d519a3d1be46849868aa2ddf822bcf6", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-dom": "*", + "ext-json": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-spl": "*", + "php": ">=5.3.3", + "phpunit/php-code-coverage": "~1.2", + "phpunit/php-file-iterator": "~1.3", + "phpunit/php-text-template": "~1.1", + "phpunit/php-timer": "~1.0", + "phpunit/phpunit-mock-objects": "~1.2", + "symfony/yaml": "~2.0" + }, + "require-dev": { + "pear-pear.php.net/pear": "1.9.4" + }, + "suggest": { + "phpunit/php-invoker": "~1.1" + }, + "bin": [ + "composer/bin/phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.7.x-dev" + } + }, + "autoload": { + "classmap": [ + "PHPUnit/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "", + "../../symfony/yaml/" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "http://www.phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "time": "2014-10-17T09:04:17+00:00" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "1.2.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "5794e3c5c5ba0fb037b11d8151add2a07fa82875" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/5794e3c5c5ba0fb037b11d8151add2a07fa82875", + "reference": "5794e3c5c5ba0fb037b11d8151add2a07fa82875", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "phpunit/php-text-template": ">=1.1.1@stable" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "autoload": { + "classmap": [ + "PHPUnit/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "time": "2013-01-13T10:24:48+00:00" + }, + { + "name": "roave/security-advisories", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/Roave/SecurityAdvisories.git", + "reference": "1b2f1f59ff8fc933e4d61ee45214ff3228e20c75" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/1b2f1f59ff8fc933e4d61ee45214ff3228e20c75", + "reference": "1b2f1f59ff8fc933e4d61ee45214ff3228e20c75", + "shasum": "" + }, + "conflict": { + "3f/pygmentize": "<1.2", + "adodb/adodb-php": "<5.20.6", + "amphp/artax": "<1.0.6|>=2,<2.0.6", + "amphp/http": "<1.0.1", + "asymmetricrypt/asymmetricrypt": ">=0,<9.9.99", + "aws/aws-sdk-php": ">=3,<3.2.1", + "bugsnag/bugsnag-laravel": ">=2,<2.0.2", + "cakephp/cakephp": ">=1.3,<1.3.18|>=2,<2.4.99|>=2.5,<2.5.99|>=2.6,<2.6.12|>=2.7,<2.7.6|>=3,<3.0.15|>=3.1,<3.1.4", + "cart2quote/module-quotation": ">=4.1.6,<=4.4.5|>=5,<5.4.4", + "cartalyst/sentry": "<=2.1.6", + "codeigniter/framework": "<=3.0.6", + "composer/composer": "<=1.0.0-alpha11", + "contao-components/mediaelement": ">=2.14.2,<2.21.1", + "contao/core": ">=2,<3.5.32", + "contao/core-bundle": ">=4,<4.4.8", + "contao/listing-bundle": ">=4,<4.4.8", + "contao/newsletter-bundle": ">=4,<4.1", + "doctrine/annotations": ">=1,<1.2.7", + "doctrine/cache": ">=1,<1.3.2|>=1.4,<1.4.2", + "doctrine/common": ">=2,<2.4.3|>=2.5,<2.5.1", + "doctrine/dbal": ">=2,<2.0.8|>=2.1,<2.1.2", + "doctrine/doctrine-bundle": "<1.5.2", + "doctrine/doctrine-module": "<=0.7.1", + "doctrine/mongodb-odm": ">=1,<1.0.2", + "doctrine/mongodb-odm-bundle": ">=2,<3.0.1", + "doctrine/orm": ">=2,<2.4.8|>=2.5,<2.5.1", + "dompdf/dompdf": ">=0.6,<0.6.2", + "drupal/core": ">=8,<8.4.5", + "drupal/drupal": ">=8,<8.4.5", + "erusev/parsedown": "<1.7", + "ezsystems/ezpublish-legacy": ">=5.3,<5.3.12.3|>=5.4,<5.4.11.3|>=2017.8,<2017.8.1.1|>=2017.12,<2017.12.2.1", + "firebase/php-jwt": "<2", + "friendsofsymfony/rest-bundle": ">=1.2,<1.2.2", + "friendsofsymfony/user-bundle": ">=1.2,<1.3.5", + "gree/jose": "<=2.2", + "gregwar/rst": "<1.0.3", + "guzzlehttp/guzzle": ">=6,<6.2.1|>=4.0.0-rc2,<4.2.4|>=5,<5.3.1", + "illuminate/auth": ">=4,<4.0.99|>=4.1,<4.1.26", + "illuminate/database": ">=4,<4.0.99|>=4.1,<4.1.29", + "joomla/session": "<1.3.1", + "laravel/framework": ">=4,<4.0.99|>=4.1,<4.1.29", + "laravel/socialite": ">=1,<1.0.99|>=2,<2.0.10", + "magento/magento1ce": ">=1.5.0.1,<1.9.3.2", + "magento/magento1ee": ">=1.9,<1.14.3.2", + "magento/magento2ce": ">=2,<2.2", + "monolog/monolog": ">=1.8,<1.12", + "namshi/jose": "<2.2", + "onelogin/php-saml": "<2.10.4", + "oro/crm": ">=1.7,<1.7.4", + "oro/platform": ">=1.7,<1.7.4", + "padraic/humbug_get_contents": "<1.1.2", + "pagarme/pagarme-php": ">=0,<3", + "paragonie/random_compat": "<2", + "phpmailer/phpmailer": ">=5,<5.2.24", + "phpunit/phpunit": ">=4.8.19,<4.8.28|>=5.0.10,<5.6.3", + "phpxmlrpc/extras": "<0.6.1", + "propel/propel": ">=2.0.0-alpha1,<=2.0.0-alpha7", + "propel/propel1": ">=1,<=1.7.1", + "pusher/pusher-php-server": "<2.2.1", + "sabre/dav": ">=1.6,<1.6.99|>=1.7,<1.7.11|>=1.8,<1.8.9", + "shopware/shopware": "<5.3.7", + "silverstripe/cms": ">=3,<=3.0.11|>=3.1,<3.1.11", + "silverstripe/forum": "<=0.6.1|>=0.7,<=0.7.3", + "silverstripe/framework": ">=3,<3.3", + "silverstripe/userforms": "<3", + "simplesamlphp/saml2": "<1.10.6|>=2,<2.3.8|>=3,<3.1.4", + "simplesamlphp/simplesamlphp": "<1.15.2", + "simplesamlphp/simplesamlphp-module-infocard": "<1.0.1", + "socalnick/scn-social-auth": "<1.15.2", + "squizlabs/php_codesniffer": ">=1,<2.8.1", + "stormpath/sdk": ">=0,<9.9.99", + "swiftmailer/swiftmailer": ">=4,<5.4.5", + "symfony/dependency-injection": ">=2,<2.0.17", + "symfony/form": ">=2.3,<2.3.35|>=2.4,<2.6.12|>=2.7,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", + "symfony/framework-bundle": ">=2,<2.3.18|>=2.4,<2.4.8|>=2.5,<2.5.2", + "symfony/http-foundation": ">=2,<2.3.27|>=2.4,<2.5.11|>=2.6,<2.6.6", + "symfony/http-kernel": ">=2,<2.3.29|>=2.4,<2.5.12|>=2.6,<2.6.8", + "symfony/intl": ">=2.7,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", + "symfony/routing": ">=2,<2.0.19", + "symfony/security": ">=2,<2.0.25|>=2.1,<2.1.13|>=2.2,<2.2.9|>=2.3,<2.3.37|>=2.4,<2.6.13|>=2.7,<2.7.9|>=2.7.30,<2.7.32|>=2.8.23,<2.8.25|>=3.2.10,<3.2.12|>=3.3.3,<3.3.5", + "symfony/security-core": ">=2.4,<2.6.13|>=2.7,<2.7.9|>=2.7.30,<2.7.32|>=2.8,<2.8.6|>=2.8.23,<2.8.25|>=3,<3.0.6|>=3.2.10,<3.2.12|>=3.3.3,<3.3.5", + "symfony/security-csrf": ">=2.7,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", + "symfony/security-http": ">=2.3,<2.3.41|>=2.4,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", + "symfony/serializer": ">=2,<2.0.11", + "symfony/symfony": ">=2,<2.3.41|>=2.4,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", + "symfony/translation": ">=2,<2.0.17", + "symfony/validator": ">=2,<2.0.24|>=2.1,<2.1.12|>=2.2,<2.2.5|>=2.3,<2.3.3", + "symfony/web-profiler-bundle": ">=2,<2.3.19|>=2.4,<2.4.9|>=2.5,<2.5.4", + "symfony/yaml": ">=2,<2.0.22|>=2.1,<2.1.7", + "thelia/backoffice-default-template": ">=2.1,<2.1.2", + "thelia/thelia": ">=2.1.0-beta1,<2.1.3|>=2.1,<2.1.2", + "titon/framework": ">=0,<9.9.99", + "twig/twig": "<1.20", + "typo3/cms": ">=6.2,<6.2.30|>=7,<7.6.22|>=8,<8.7.5", + "typo3/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.10|>=3.1,<3.1.7|>=3.2,<3.2.7|>=3.3,<3.3.5", + "typo3/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4", + "willdurand/js-translation-bundle": "<2.1.1", + "yiisoft/yii": ">=1.1.14,<1.1.15", + "yiisoft/yii2": "<2.0.14", + "yiisoft/yii2-bootstrap": "<2.0.4", + "yiisoft/yii2-dev": "<2.0.14", + "yiisoft/yii2-gii": "<2.0.4", + "yiisoft/yii2-jui": "<2.0.4", + "zendframework/zend-cache": ">=2.4,<2.4.8|>=2.5,<2.5.3", + "zendframework/zend-captcha": ">=2,<2.4.9|>=2.5,<2.5.2", + "zendframework/zend-crypt": ">=2,<2.4.9|>=2.5,<2.5.2", + "zendframework/zend-db": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.10|>=2.3,<2.3.5", + "zendframework/zend-diactoros": ">=1,<1.0.4", + "zendframework/zend-form": ">=2,<2.2.7|>=2.3,<2.3.1", + "zendframework/zend-http": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.3,<2.3.8|>=2.4,<2.4.1", + "zendframework/zend-json": ">=2.1,<2.1.6|>=2.2,<2.2.6", + "zendframework/zend-ldap": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.8|>=2.3,<2.3.3", + "zendframework/zend-mail": ">=2,<2.4.11|>=2.5,<2.7.2", + "zendframework/zend-navigation": ">=2,<2.2.7|>=2.3,<2.3.1", + "zendframework/zend-session": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.9|>=2.3,<2.3.4", + "zendframework/zend-validator": ">=2.3,<2.3.6", + "zendframework/zend-view": ">=2,<2.2.7|>=2.3,<2.3.1", + "zendframework/zend-xmlrpc": ">=2.1,<2.1.6|>=2.2,<2.2.6", + "zendframework/zendframework": ">=2,<2.4.11|>=2.5,<2.5.1", + "zendframework/zendframework1": "<1.12.20", + "zendframework/zendopenid": ">=2,<2.0.2", + "zendframework/zendxml": ">=1,<1.0.1", + "zetacomponents/mail": "<1.8.2", + "zf-commons/zfc-user": "<1.2.2", + "zfcampus/zf-apigility-doctrine": ">=1,<1.0.3", + "zfr/zfr-oauth2-server-module": "<0.1.2" + }, + "type": "metapackage", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "role": "maintainer" + } + ], + "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", + "time": "2018-03-15T17:53:05+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "2.9.1", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/dcbed1074f8244661eecddfc2a675430d8d33f62", + "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "bin": [ + "scripts/phpcs", + "scripts/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "classmap": [ + "CodeSniffer.php", + "CodeSniffer/CLI.php", + "CodeSniffer/Exception.php", + "CodeSniffer/File.php", + "CodeSniffer/Fixer.php", + "CodeSniffer/Report.php", + "CodeSniffer/Reporting.php", + "CodeSniffer/Sniff.php", + "CodeSniffer/Tokens.php", + "CodeSniffer/Reports/", + "CodeSniffer/Tokenizers/", + "CodeSniffer/DocGenerators/", + "CodeSniffer/Standards/AbstractPatternSniff.php", + "CodeSniffer/Standards/AbstractScopeSniff.php", + "CodeSniffer/Standards/AbstractVariableSniff.php", + "CodeSniffer/Standards/IncorrectPatternException.php", + "CodeSniffer/Standards/Generic/Sniffs/", + "CodeSniffer/Standards/MySource/Sniffs/", + "CodeSniffer/Standards/PEAR/Sniffs/", + "CodeSniffer/Standards/PSR1/Sniffs/", + "CodeSniffer/Standards/PSR2/Sniffs/", + "CodeSniffer/Standards/Squiz/Sniffs/", + "CodeSniffer/Standards/Zend/Sniffs/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "http://www.squizlabs.com/php-codesniffer", + "keywords": [ + "phpcs", + "standards" + ], + "time": "2017-05-22T02:43:20+00:00" + }, + { + "name": "wimg/php-compatibility", + "version": "8.1.0", + "source": { + "type": "git", + "url": "https://github.com/wimg/PHPCompatibility.git", + "reference": "4ac01e4fe8faaa4f8d3b3cd06ea92e5418ce472e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wimg/PHPCompatibility/zipball/4ac01e4fe8faaa4f8d3b3cd06ea92e5418ce472e", + "reference": "4ac01e4fe8faaa4f8d3b3cd06ea92e5418ce472e", + "shasum": "" + }, + "require": { + "php": ">=5.3", + "squizlabs/php_codesniffer": "^2.2 || ^3.0.2" + }, + "conflict": { + "squizlabs/php_codesniffer": "2.6.2" + }, + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3" + }, + "type": "phpcodesniffer-standard", + "autoload": { + "psr-4": { + "PHPCompatibility\\": "PHPCompatibility/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0" + ], + "authors": [ + { + "name": "Wim Godden", + "role": "lead" + } + ], + "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP version compatibility.", + "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", + "keywords": [ + "compatibility", + "phpcs", + "standards" + ], + "time": "2017-12-27T21:58:38+00:00" + }, + { + "name": "wp-coding-standards/wpcs", + "version": "0.13.1", + "source": { + "type": "git", + "url": "https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git", + "reference": "1f64b1a0b5b789822d0303436ee4e30e0135e4dc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/zipball/1f64b1a0b5b789822d0303436ee4e30e0135e4dc", + "reference": "1f64b1a0b5b789822d0303436ee4e30e0135e4dc", + "shasum": "" + }, + "require": { + "php": ">=5.3", + "squizlabs/php_codesniffer": "^2.9.0 || ^3.0.2" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.1" + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Contributors", + "homepage": "https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/graphs/contributors" + } + ], + "description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions", + "keywords": [ + "phpcs", + "standards", + "wordpress" + ], + "time": "2017-08-05T16:08:58+00:00" + } + ], "aliases": [], "minimum-stability": "dev", "stability-flags": { "ee/site-command": 20, - "ee/wp-command": 20 + "ee/wp-command": 20, + "roave/security-advisories": 20 }, "prefer-stable": true, "prefer-lowest": false, From 3c124d3ecf96e7dd7bd40de6c141e9c60b9df682 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi Date: Mon, 19 Mar 2018 20:03:27 +0530 Subject: [PATCH 0039/1044] Add dnsmasq --- php/EE/Runner.php | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index a31580538..3daf9f5f3 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -64,6 +64,34 @@ private function init_ee4() { define( 'TABLE', 'sites' ); } + /** + * Start dnsmasq. + */ + private function init_dnsmasq() { + $is_dnsmasq_running = EE::launch( "docker inspect -f '{{.State.Running}}' dnsmasq", false, true ); + + if ( ! $is_dnsmasq_running->return_code ) { + if ( preg_match( '/false/', $is_dnsmasq_running->stdout ) ) { + // Start it. + $start_dnsmasq = EE::launch( "docker start dnsmasq", false, true ); + if ( $start_dnsmasq->return_code ) { + EE::error( 'There was some error in starting the dnsmasq container.' ); + } + } + } else { + $HOME = HOME; + // Create it. + if ( ! touch( "$HOME/.ee4/ee4_hosts" ) ) { + EE::error( 'Could not create dnsmasq host file.' ); + } + $create_dnsmasq = EE::launch( "docker run --name dnsmasq -d -p 127.0.0.1:53:53/udp -v $HOME/.ee4/ee4_hosts:/etc/ee4_hosts --restart always dharmin/dnsmasq-ee", false ); + + if ( $create_dnsmasq ) { + EE::error( "dnsmasq could not be created." ); + } + } + } + /** * Register a command for early invocation, generally before WordPress loads. * @@ -659,6 +687,7 @@ public function start() { $this->ensure_present_in_config( 'sites_path', Utils\get_home_dir(). '/Sites' ); $this->ensure_present_in_config( 'db_path', Utils\get_home_dir(). '/.ee4/ee4.db' ); $this->init_ee4(); + $this->init_dnsmasq(); // Enable PHP error reporting to stderr if testing. if ( getenv( 'BEHAT_RUN' ) ) { From a83e4b69ab45534a77b72dea2f39ecb56ec41601 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi Date: Tue, 20 Mar 2018 19:19:51 +0530 Subject: [PATCH 0040/1044] Update composer, Readme, Version --- .idea/ee4.iml | 11 --- README.md | 190 ++++---------------------------------------------- VERSION | 2 +- composer.json | 26 +++---- composer.lock | 152 +++++++++++++++++++++------------------- 5 files changed, 104 insertions(+), 277 deletions(-) delete mode 100644 .idea/ee4.iml diff --git a/.idea/ee4.iml b/.idea/ee4.iml deleted file mode 100644 index 545c81804..000000000 --- a/.idea/ee4.iml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/README.md b/README.md index ebbfbc810..6fc0cfbdb 100644 --- a/README.md +++ b/README.md @@ -1,200 +1,36 @@ -EE +EEv4 ====== -[EE](https://ee.org/) is the command-line interface for [WordPress](https://wordpress.org/). You can update plugins, configure multisite installs and much more, without using a web browser. +## Requirements -Ongoing maintenance is made possible by: - - - -The current stable release is [version 1.5.0](https://make.wordpress.org/cli/2018/01/31/version-1-5-0-released/). For announcements, follow [@wpcli on Twitter](https://twitter.com/wpcli) or [sign up for email updates](https://make.wordpress.org/cli/subscribe/). [Check out the roadmap](https://make.wordpress.org/cli/handbook/roadmap/) for an overview of what's planned for upcoming releases. - -[![Build Status](https://travis-ci.org/ee/ee.svg?branch=master)](https://travis-ci.org/ee/ee) [![Dependency Status](https://gemnasium.com/badges/github.com/ee/ee.svg)](https://gemnasium.com/github.com/ee/ee) [![Average time to resolve an issue](https://isitmaintained.com/badge/resolution/ee/ee.svg)](https://isitmaintained.com/project/ee/ee "Average time to resolve an issue") [![Percentage of issues still open](https://isitmaintained.com/badge/open/ee/ee.svg)](https://isitmaintained.com/project/ee/ee "Percentage of issues still open") - -Quick links: [Using](#using) | [Installing](#installing) | [Support](#support) | [Extending](#extending) | [Contributing](#contributing) | [Credits](#credits) - -## Using - -EE provides a command-line interface for many actions you might perform in the WordPress admin. For instance, `wp plugin install --activate` ([doc](https://developer.wordpress.org/cli/commands/plugin/install/)) lets you install and activate a WordPress plugin: - -```bash -$ wp plugin install user-switching --activate -Installing User Switching (1.0.9) -Downloading install package from https://downloads.wordpress.org/plugin/user-switching.1.0.9.zip... -Unpacking the package... -Installing the plugin... -Plugin installed successfully. -Activating 'user-switching'... -Plugin 'user-switching' activated. -Success: Installed 1 of 1 plugins. -``` - -EE also includes commands for many things you can't do in the WordPress admin. For example, `wp transient delete --all` ([doc](https://developer.wordpress.org/cli/commands/transient/delete/)) lets you delete one or all transients: - -```bash -$ wp transient delete --all -Success: 34 transients deleted from the database. -``` - -For a more complete introduction to using EE, read the [Quick Start guide](https://make.wordpress.org/cli/handbook/quick-start/). Or, catch up with [shell friends](https://make.wordpress.org/cli/handbook/shell-friends/) to learn about helpful command line utilities. - -Already feel comfortable with the basics? Jump into the [complete list of commands](https://developer.wordpress.org/cli/commands/) for detailed information on managing themes and plugins, importing and exporting data, performing database search-replace operations and more. +* Docker +* Docker-Compose +* PHP ## Installing -Downloading the Phar file is our recommended installation method for most users. Should you need, see also our documentation on [alternative installation methods](https://make.wordpress.org/cli/handbook/installing/). - -Before installing EE, please make sure your environment meets the minimum requirements: - -- UNIX-like environment (OS X, Linux, FreeBSD, Cygwin); limited support in Windows environment -- PHP 5.3.29 or later -- WordPress 3.7 or later. Versions older than the latest WordPress release may have degraded functionality - -Once you've verified requirements, download the [ee.phar](https://raw.github.com/ee/builds/gh-pages/phar/ee.phar) file using `wget` or `curl`: +Once you've verified requirements, download the [ee.phar](https://raw.github.com/mbtamuli/ee4-builds/master/ee.phar) file using `wget` or `curl`: ```bash -curl -O https://raw.githubusercontent.com/ee/builds/gh-pages/phar/ee.phar +curl -O https://raw.githubusercontent.com/mbtamuli/ee4-builds/master/ee.phar ``` Next, check the Phar file to verify that it's working: ```bash -php ee.phar --info +php ee.phar cli info ``` -To use EE from the command line by typing `wp`, make the file executable and move it to somewhere in your PATH. For example: +To use EEv4 from the command line by typing `ee4`, make the file executable and move it to somewhere in your PATH. For example: ```bash chmod +x ee.phar -sudo mv ee.phar /usr/local/bin/wp +sudo mv ee.phar /usr/local/bin/ee4 ``` -If EE was installed successfully, you should see something like this when you run `wp --info`: +If EE was installed successfully, you should see something like this when you run `ee4 cli version`: ```bash -$ wp --info -OS: Darwin 16.7.0 Darwin Kernel Version 16.7.0: Thu Jan 11 22:59:40 PST 2018; root:xnu-3789.73.8~1/RELEASE_X86_64 x86_64 -Shell: /bin/zsh -PHP binary: /usr/local/bin/php -PHP version: 7.0.22 -php.ini used: /etc/local/etc/php/7.0/php.ini -EE root dir: /home/ee/.ee -EE vendor dir: /home/ee/.ee/vendor -EE packages dir: /home/ee/.ee/packages/ -EE global config: /home/ee/.ee/config.yml -EE project config: -EE version: 1.5.0 +$ ee4 cli version +EE 0.0.1 ``` - -### Updating - -You can update EE with `wp cli update` ([doc](https://developer.wordpress.org/cli/commands/cli/update/)), or by repeating the installation steps. - -If EE is owned by root or another system user, you'll need to run `sudo wp cli update`. - -Want to live life on the edge? Run `wp cli update --nightly` to use the latest nightly build of EE. The nightly build is more or less stable enough for you to use in your development environment, and always includes the latest and greatest EE features. - -### Tab completions - -EE also comes with a tab completion script for Bash and ZSH. Just download [wp-completion.bash](https://raw.githubusercontent.com/ee/ee/master/utils/wp-completion.bash) and source it from `~/.bash_profile`: - -```bash -source /FULL/PATH/TO/wp-completion.bash -``` - -Don't forget to run `source ~/.bash_profile` afterwards. - -If using zsh for your shell, you may need to load and start `bashcompinit` before sourcing. Put the following in your `.zshrc`: - -```bash -autoload bashcompinit -bashcompinit -source /FULL/PATH/TO/wp-completion.bash -``` - -## Support - -EE's maintainers and contributors have limited availability to address general support questions. The [current version of EE](https://make.wordpress.org/cli/handbook/roadmap/) is the only officially supported version. - -When looking for support, please first search for your question in these venues: - -* [Common issues and their fixes](https://make.wordpress.org/cli/handbook/common-issues/) -* [EE handbook](https://make.wordpress.org/cli/handbook/) -* [Open or closed issues in the EE GitHub organization](https://github.com/issues?utf8=%E2%9C%93&q=sort%3Aupdated-desc+org%3Aee+is%3Aissue) -* [Threads tagged 'EE' in the WordPress.org support forum](https://wordpress.org/support/topic-tag/ee/) -* [Questions tagged 'EE' in the WordPress StackExchange](https://wordpress.stackexchange.com/questions/tagged/ee) - -If you didn't find an answer in one of the venues above, you can: - -* Join the `#cli` channel in the [WordPress.org Slack](https://make.wordpress.org/chat/) to chat with whomever might be available at the time. This option is best for quick questions. -* [Post a new thread](https://wordpress.org/support/forum/wp-advanced/#new-post) in the WordPress.org support forum and tag it 'EE' so it's seen by the community. - -GitHub issues are meant for tracking enhancements to and bugs of existing commands, not general support. Before submitting a bug report, please [review our best practices](https://make.wordpress.org/cli/handbook/bug-reports/) to help ensure your issue is addressed in a timely manner. - -Please do not ask support questions on Twitter. Twitter isn't an acceptable venue for support because: 1) it's hard to hold conversations in under 140 characters, and 2) Twitter isn't a place where someone with your same question can search for an answer in a prior conversation. - -Remember, libre != gratis; the open source license grants you the freedom to use and modify, but not commitments of other people's time. Please be respectful, and set your expectations accordingly. - -## Extending - -A **command** is the atomic unit of EE functionality. `wp plugin install` ([doc](https://developer.wordpress.org/cli/commands/plugin/install/)) is one command. `wp plugin activate` ([doc](https://developer.wordpress.org/cli/commands/plugin/activate/)) is another. - -EE supports registering any callable class, function, or closure as a command. It reads usage details from the callback's PHPdoc. `EE::add_command()` ([doc](https://make.wordpress.org/cli/handbook/internal-api/ee-add-command/)) is used for both internal and third-party command registration. - -```php -/** - * Delete an option from the database. - * - * Returns an error if the option didn't exist. - * - * ## OPTIONS - * - * - * : Key for the option. - * - * ## EXAMPLES - * - * $ wp option delete my_option - * Success: Deleted 'my_option' option. - */ -$delete_option_cmd = function( $args ) { - list( $key ) = $args; - - if ( ! delete_option( $key ) ) { - EE::error( "Could not delete '$key' option. Does it exist?" ); - } else { - EE::success( "Deleted '$key' option." ); - } -}; -EE::add_command( 'option delete', $delete_option_cmd ); -``` - -EE comes with dozens of commands. It's easier than it looks to create a custom EE command. Read the [commands cookbook](https://make.wordpress.org/cli/handbook/commands-cookbook/) to learn more. Browse the [internal API docs](https://make.wordpress.org/cli/handbook/internal-api/) to discover a variety of helpful functions you can use in your custom EE command. - -## Contributing - -We appreciate you taking the initiative to contribute to EE. It’s because of you, and the community around you, that EE is such a great project. - -**Contributing isn’t limited to just code.** We encourage you to contribute in the way that best fits your abilities, by writing tutorials, giving a demo at your local meetup, helping other users with their support questions, or revising our documentation. - -Read through our [contributing guidelines in the handbook](https://make.wordpress.org/cli/handbook/contributing/) for a thorough introduction to how you can get involved. Following these guidelines helps to communicate that you respect the time of other contributors on the project. In turn, they’ll do their best to reciprocate that respect when working with you, across timezones and around the world. - -## Leadership - -EE has two project maintainers: [danielbachhuber](https://github.com/danielbachhuber) and [schlessera](http://github.com/schlessera). - -On occasion, we [grant write access to contributors](https://make.wordpress.org/cli/handbook/committers-credo/) who have demonstrated, over a period of time, that they are capable and invested in moving the project forward. - -Read the [governance document in the handbook](https://make.wordpress.org/cli/handbook/governance/) for more operational details about the project. - -## Credits - -Besides the libraries defined in [composer.json](composer.json), we have used code or ideas from the following projects: - -* [Drush](https://github.com/drush-ops/drush) for... a lot of things -* [wpshell](https://code.trac.wordpress.org/browser/wpshell) for `wp shell` -* [Regenerate Thumbnails](https://wordpress.org/plugins/regenerate-thumbnails/) for `wp media regenerate` -* [Search-Replace-DB](https://github.com/interconnectit/Search-Replace-DB) for `wp search-replace` -* [WordPress-CLI-Exporter](https://github.com/Automattic/WordPress-CLI-Exporter) for `wp export` -* [WordPress-CLI-Importer](https://github.com/Automattic/WordPress-CLI-Importer) for `wp import` -* [wordpress-plugin-tests](https://github.com/benbalter/wordpress-plugin-tests/) for `wp scaffold plugin-tests` diff --git a/VERSION b/VERSION index fbffcdf95..8a9ecc2ea 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.0.0-alpha +0.0.1 \ No newline at end of file diff --git a/composer.json b/composer.json index 97d7f5161..514a4f00e 100644 --- a/composer.json +++ b/composer.json @@ -1,15 +1,15 @@ { - "name": "easyengine/ee", - "description": "The command line interface for WordPress", + "name": "mrrobot47/ee", + "description": "The command line interface for EasyEngine", "keywords": [ "cli", - "wordpress" + "easyengine" ], - "homepage": "https://ee.org", + "homepage": "https://easyengine.io", "license": "MIT", "support": { - "issues": "https://github.com/ee/ee/issues", - "source": "https://github.com/ee/ee", + "issues": "https://github.com/mrrobot47/ee4/issues", + "source": "https://github.com/mrrobot47/ee4", "docs": "https://make.wordpress.org/cli/handbook/" }, "bin": [ @@ -28,8 +28,8 @@ "php": ">=5.3.29", "composer/composer": "^1.2.0", "composer/semver": "~1.0", - "ee/site-command": "dev-master", - "ee/wp-command": "dev-master", + "mrrobot47/site-command": "^1.0", + "mrrobot47/wp-command": "^1.0", "justinrainbow/json-schema": "~5.2.5", "monolog/monolog": "^1.23", "mustache/mustache": "~2.4", @@ -81,15 +81,5 @@ "split-target-prefix-true": "autoload_commands", "split-target-prefix-false": "autoload_framework" } - }, - "repositories": { - "ee/site-command": { - "type": "vcs", - "url": "git@git.rtcamp.com:sys/site-command.git" - }, - "ee/wp-command": { - "type": "vcs", - "url": "git@git.rtcamp.com:sys/wp-command.git" - } } } diff --git a/composer.lock b/composer.lock index 2b4717b9f..55e6abec6 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "93ea52dfe7415e976235310dec02b2f2", + "content-hash": "fc67c7e6e907eb0d250a46fde17c7deb", "packages": [ { "name": "composer/ca-bundle", @@ -262,73 +262,6 @@ ], "time": "2018-01-31T13:17:27+00:00" }, - { - "name": "ee/site-command", - "version": "dev-master", - "source": { - "type": "git", - "url": "git@git.rtcamp.com:sys/site-command.git", - "reference": "ef5f7f4c8aaf5fb3ec509c28919eeb2d2b082dbd" - }, - "type": "wp-cli-package", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - }, - "bundled": true, - "commands": [ - "site", - "site create", - "site list", - "site delete" - ] - }, - "autoload": { - "psr-4": { - "": "src/" - }, - "files": [ - "site-command.php" - ] - }, - "license": [ - "MIT" - ], - "homepage": "https://github.com/ee/site", - "time": "2018-03-16 10:32:50" - }, - { - "name": "ee/wp-command", - "version": "dev-master", - "source": { - "type": "git", - "url": "git@git.rtcamp.com:sys/wp-command.git", - "reference": "5dd0e04c2f11a2b1ed1bb25e26a9c55e6f4d66a4" - }, - "type": "wp-cli-package", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - }, - "bundled": true, - "commands": [ - "wp" - ] - }, - "autoload": { - "psr-4": { - "": "src/" - }, - "files": [ - "wp-command.php" - ] - }, - "license": [ - "MIT" - ], - "homepage": "https://github.com/easyengine/wp-command", - "time": "2018-03-16 10:51:04" - }, { "name": "justinrainbow/json-schema", "version": "5.2.7", @@ -473,6 +406,87 @@ ], "time": "2017-06-19T01:22:40+00:00" }, + { + "name": "mrrobot47/site-command", + "version": "v1.0", + "source": { + "type": "git", + "url": "https://github.com/mrrobot47/site-command.git", + "reference": "3c97096613fba41e027b5b07d57876f23c507ddc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mrrobot47/site-command/zipball/3c97096613fba41e027b5b07d57876f23c507ddc", + "reference": "3c97096613fba41e027b5b07d57876f23c507ddc", + "shasum": "" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "site", + "site create", + "site list", + "site delete" + ] + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "site-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "homepage": "https://github.com/mrrobot47/site-command", + "time": "2018-03-20T13:22:14+00:00" + }, + { + "name": "mrrobot47/wp-command", + "version": "v1.0", + "source": { + "type": "git", + "url": "https://github.com/mrrobot47/wp-command.git", + "reference": "4a3e8b899245166a8a4558ceb9cb573292539193" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mrrobot47/wp-command/zipball/4a3e8b899245166a8a4558ceb9cb573292539193", + "reference": "4a3e8b899245166a8a4558ceb9cb573292539193", + "shasum": "" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "wp" + ] + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "wp-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "homepage": "https://github.com/mrrobot47/wp-command", + "time": "2018-03-20T13:26:46+00:00" + }, { "name": "mustache/mustache", "version": "v2.12.0", @@ -2450,8 +2464,6 @@ "aliases": [], "minimum-stability": "dev", "stability-flags": { - "ee/site-command": 20, - "ee/wp-command": 20, "roave/security-advisories": 20 }, "prefer-stable": true, From 1bdc43ec4c85f67b8d1c2963e1dba3214873ca8c Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi Date: Tue, 20 Mar 2018 19:26:26 +0530 Subject: [PATCH 0041/1044] Update make-phar --- utils/make-phar.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/make-phar.php b/utils/make-phar.php index efdeaba9b..f07adb0b8 100644 --- a/utils/make-phar.php +++ b/utils/make-phar.php @@ -110,7 +110,7 @@ function get_composer_versions( $current_version ) { fwrite( STDERR, sprintf( "Warning: No packages in '%s'." . PHP_EOL, $composer_lock_path ) ); return ''; } - $vendor_versions = array( implode( ' ', array( 'ee/ee', $current_version, date( 'c' ) ) ) ); + $vendor_versions = array( implode( ' ', array( 'mrrobot47/ee', $current_version, date( 'c' ) ) ) ); $missing_names = $missing_versions = $missing_references = 0; foreach ( $composer_lock['packages'] as $package ) { if ( isset( $package['name'] ) ) { @@ -189,7 +189,7 @@ function get_composer_versions( $current_version ) { ; } else { $finder - ->in(EE_VENDOR_DIR . '/ee') + ->in(EE_VENDOR_DIR . '/mrrobot47') ->in(EE_VENDOR_DIR . '/wp-cli') ->in(EE_VENDOR_DIR . '/psr') ->in(EE_VENDOR_DIR . '/seld') From cd9b6ecb7c63f7a46209bbd732956e6df1ec06b6 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi Date: Tue, 20 Mar 2018 19:37:10 +0530 Subject: [PATCH 0042/1044] Update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6fc0cfbdb..78540d374 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ EEv4 ## Installing -Once you've verified requirements, download the [ee.phar](https://raw.github.com/mbtamuli/ee4-builds/master/ee.phar) file using `wget` or `curl`: +Once you've verified requirements, download the [ee4.phar](https://raw.githubusercontent.com/mrrobot47/ee4-builds/master/ee4.phar) file using `wget` or `curl`: ```bash curl -O https://raw.githubusercontent.com/mbtamuli/ee4-builds/master/ee.phar From cf6298714bcade24f662395be463538fab4c3478 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi Date: Fri, 23 Mar 2018 16:27:38 +0530 Subject: [PATCH 0043/1044] Update AutoloadSplitter --- php/EE/AutoloadSplitter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/EE/AutoloadSplitter.php b/php/EE/AutoloadSplitter.php index ebc78bf66..7a9f1b501 100644 --- a/php/EE/AutoloadSplitter.php +++ b/php/EE/AutoloadSplitter.php @@ -27,7 +27,7 @@ class AutoloadSplitter { * @return bool Whether to split out the class into a separate autoloader. */ public function __invoke( $class, $code ) { - return 1 === preg_match( '/\/ee\/\w+(?:-\w+)*-command\//', $code ) + return 1 === preg_match( '/\/mrrobot47\/\w+(?:-\w+)*-command\//', $code ) || 1 === preg_match( '/\/php\/commands\/src\//', $code ); } } From 18f533ea3f988ad093e498181bc6137706f03e0d Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi Date: Mon, 26 Mar 2018 12:15:55 +0530 Subject: [PATCH 0044/1044] Add travis.yml Update composer Add behat tests Update loggin --- .travis.yml | 46 ++++++ README.md | 2 +- composer.json | 2 +- composer.lock | 28 ++-- features/bootstrap/FeatureContext.php | 47 ++++++ features/bootstrap/support.php | 207 ++++++++++++++++++++++++++ features/extra/no-mail.php | 7 + features/site.feature | 60 ++++++++ features/steps/given.php | 29 ++++ features/steps/then.php | 74 +++++++++ features/steps/when.php | 9 ++ php/class-ee.php | 1 + 12 files changed, 497 insertions(+), 15 deletions(-) create mode 100644 .travis.yml create mode 100644 features/bootstrap/FeatureContext.php create mode 100644 features/bootstrap/support.php create mode 100644 features/extra/no-mail.php create mode 100644 features/site.feature create mode 100644 features/steps/given.php create mode 100644 features/steps/then.php create mode 100644 features/steps/when.php diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..1d45601d0 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,46 @@ +sudo: true +dist: trusty + +language: php + +notifications: + email: + on_success: never + on_failure: change + +branches: + only: + - master + +cache: + directories: + - $HOME/.composer/cache + +env: + global: + - PATH="$TRAVIS_BUILD_DIR/vendor/bin:$PATH" + +matrix: + include: + - php: 7.2 + - php: 7.1 + - php: 7.0 + - php: 5.6 + +before_install: + - | + # Remove Xdebug for a huge performance increase: + if [ -f ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini ]; then + phpenv config-rm xdebug.ini + else + echo "xdebug.ini does not exist" + fi + +install: + - composer install + +before_script: + - composer validate + +script: + - vendor/bin/behat diff --git a/README.md b/README.md index 78540d374..4f8ba6430 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ EEv4 Once you've verified requirements, download the [ee4.phar](https://raw.githubusercontent.com/mrrobot47/ee4-builds/master/ee4.phar) file using `wget` or `curl`: ```bash -curl -O https://raw.githubusercontent.com/mbtamuli/ee4-builds/master/ee.phar +curl -O https://raw.githubusercontent.com/mrrobot47/ee4-builds/master/ee4.phar ``` Next, check the Phar file to verify that it's working: diff --git a/composer.json b/composer.json index 514a4f00e..f3f164089 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ "php": ">=5.3.29", "composer/composer": "^1.2.0", "composer/semver": "~1.0", - "mrrobot47/site-command": "^1.0", + "mrrobot47/site-command": "1.1", "mrrobot47/wp-command": "^1.0", "justinrainbow/json-schema": "~5.2.5", "monolog/monolog": "^1.23", diff --git a/composer.lock b/composer.lock index 55e6abec6..5371c6f5a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "fc67c7e6e907eb0d250a46fde17c7deb", + "content-hash": "c5535e4f84bef0ddd529133f3c4bbe3e", "packages": [ { "name": "composer/ca-bundle", @@ -408,16 +408,16 @@ }, { "name": "mrrobot47/site-command", - "version": "v1.0", + "version": "v1.1", "source": { "type": "git", "url": "https://github.com/mrrobot47/site-command.git", - "reference": "3c97096613fba41e027b5b07d57876f23c507ddc" + "reference": "551278bd995ff8f30eb2062b9564cbe684eaae06" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mrrobot47/site-command/zipball/3c97096613fba41e027b5b07d57876f23c507ddc", - "reference": "3c97096613fba41e027b5b07d57876f23c507ddc", + "url": "https://api.github.com/repos/mrrobot47/site-command/zipball/551278bd995ff8f30eb2062b9564cbe684eaae06", + "reference": "551278bd995ff8f30eb2062b9564cbe684eaae06", "shasum": "" }, "type": "wp-cli-package", @@ -446,7 +446,7 @@ "MIT" ], "homepage": "https://github.com/mrrobot47/site-command", - "time": "2018-03-20T13:22:14+00:00" + "time": "2018-03-26T06:23:33+00:00" }, { "name": "mrrobot47/wp-command", @@ -2139,12 +2139,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "1b2f1f59ff8fc933e4d61ee45214ff3228e20c75" + "reference": "4a272b63452f4d8ff0d48a759e59db9359a9b5b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/1b2f1f59ff8fc933e4d61ee45214ff3228e20c75", - "reference": "1b2f1f59ff8fc933e4d61ee45214ff3228e20c75", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/4a272b63452f4d8ff0d48a759e59db9359a9b5b7", + "reference": "4a272b63452f4d8ff0d48a759e59db9359a9b5b7", "shasum": "" }, "conflict": { @@ -2217,7 +2217,7 @@ "simplesamlphp/simplesamlphp": "<1.15.2", "simplesamlphp/simplesamlphp-module-infocard": "<1.0.1", "socalnick/scn-social-auth": "<1.15.2", - "squizlabs/php_codesniffer": ">=1,<2.8.1", + "squizlabs/php_codesniffer": ">=1,<2.8.1|>=3,<3.0.1", "stormpath/sdk": ">=0,<9.9.99", "swiftmailer/swiftmailer": ">=4,<5.4.5", "symfony/dependency-injection": ">=2,<2.0.17", @@ -2246,11 +2246,13 @@ "typo3/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4", "willdurand/js-translation-bundle": "<2.1.1", "yiisoft/yii": ">=1.1.14,<1.1.15", - "yiisoft/yii2": "<2.0.14", + "yiisoft/yii2": "<2.0.15", "yiisoft/yii2-bootstrap": "<2.0.4", - "yiisoft/yii2-dev": "<2.0.14", + "yiisoft/yii2-dev": "<2.0.15", + "yiisoft/yii2-elasticsearch": "<2.0.5", "yiisoft/yii2-gii": "<2.0.4", "yiisoft/yii2-jui": "<2.0.4", + "yiisoft/yii2-redis": "<2.0.8", "zendframework/zend-cache": ">=2.4,<2.4.8|>=2.5,<2.5.3", "zendframework/zend-captcha": ">=2,<2.4.9|>=2.5,<2.5.2", "zendframework/zend-crypt": ">=2,<2.4.9|>=2.5,<2.5.2", @@ -2288,7 +2290,7 @@ } ], "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", - "time": "2018-03-15T17:53:05+00:00" + "time": "2018-03-22T21:16:54+00:00" }, { "name": "squizlabs/php_codesniffer", diff --git a/features/bootstrap/FeatureContext.php b/features/bootstrap/FeatureContext.php new file mode 100644 index 000000000..2f736646d --- /dev/null +++ b/features/bootstrap/FeatureContext.php @@ -0,0 +1,47 @@ +getFeature()->getScenarios()[1]->getExamples()->getRows(), 1 ), 0 ) ); + $out = shell_exec( "bin/ee site list" ); + + foreach ( $sites as $site ) { + if ( strpos( $out, $site ) !== false ) { + exec( "bin/ee site delete $site" ); + } + } + } +} diff --git a/features/bootstrap/support.php b/features/bootstrap/support.php new file mode 100644 index 000000000..ed9a5b565 --- /dev/null +++ b/features/bootstrap/support.php @@ -0,0 +1,207 @@ + $value ) { + if ( ! compareContents( $value, $actual->$name ) ) { + return false; + } + } + } else if ( is_array( $expected ) ) { + foreach ( $expected as $key => $value ) { + if ( ! compareContents( $value, $actual[$key] ) ) { + return false; + } + } + } else { + return $expected === $actual; + } + + return true; +} + +/** + * Compare two strings containing JSON to ensure that @a $actualJson contains at + * least what the JSON string @a $expectedJson contains. + * + * @return whether or not @a $actualJson contains @a $expectedJson + * @retval true @a $actualJson contains @a $expectedJson + * @retval false @a $actualJson does not contain @a $expectedJson + * + * @param [in] $actualJson the JSON string to be tested + * @param [in] $expectedJson the expected JSON string + * + * Examples: + * expected: {'a':1,'array':[1,3,5]} + * + * 1 ) + * actual: {'a':1,'b':2,'c':3,'array':[1,2,3,4,5]} + * return: true + * + * 2 ) + * actual: {'b':2,'c':3,'array':[1,2,3,4,5]} + * return: false + * element 'a' is missing from the root object + * + * 3 ) + * actual: {'a':0,'b':2,'c':3,'array':[1,2,3,4,5]} + * return: false + * the value of element 'a' is not 1 + * + * 4 ) + * actual: {'a':1,'b':2,'c':3,'array':[1,2,4,5]} + * return: false + * the contents of 'array' does not include 3 + */ +function checkThatJsonStringContainsJsonString( $actualJson, $expectedJson ) { + $actualValue = json_decode( $actualJson ); + $expectedValue = json_decode( $expectedJson ); + + if ( ! $actualValue ) { + return false; + } + + return compareContents( $expectedValue, $actualValue ); +} + +/** + * Compare two strings to confirm $actualCSV contains $expectedCSV + * Both strings are expected to have headers for their CSVs. + * $actualCSV must match all data rows in $expectedCSV + * + * @param string A CSV string + * @param array A nested array of values + * + * @return bool Whether $actualCSV contains $expectedCSV + */ +function checkThatCsvStringContainsValues( $actualCSV, $expectedCSV ) { + $actualCSV = array_map( 'str_getcsv', explode( PHP_EOL, $actualCSV ) ); + + if ( empty( $actualCSV ) ) { + return false; + } + + // Each sample must have headers + $actualHeaders = array_values( array_shift( $actualCSV ) ); + $expectedHeaders = array_values( array_shift( $expectedCSV ) ); + + // Each expectedCSV must exist somewhere in actualCSV in the proper column + $expectedResult = 0; + foreach ( $expectedCSV as $expected_row ) { + $expected_row = array_combine( $expectedHeaders, $expected_row ); + foreach ( $actualCSV as $actual_row ) { + + if ( count( $actualHeaders ) != count( $actual_row ) ) { + continue; + } + + $actual_row = array_intersect_key( array_combine( $actualHeaders, $actual_row ), $expected_row ); + if ( $actual_row == $expected_row ) { + $expectedResult ++; + } + } + } + + return $expectedResult >= count( $expectedCSV ); +} + +/** + * Compare two strings containing YAML to ensure that @a $actualYaml contains at + * least what the YAML string @a $expectedYaml contains. + * + * @return whether or not @a $actualYaml contains @a $expectedJson + * @retval true @a $actualYaml contains @a $expectedJson + * @retval false @a $actualYaml does not contain @a $expectedJson + * + * @param [in] $actualYaml the YAML string to be tested + * @param [in] $expectedYaml the expected YAML string + */ +function checkThatYamlStringContainsYamlString( $actualYaml, $expectedYaml ) { + $actualValue = Mustangostang\Spyc::YAMLLoad( $actualYaml ); + $expectedValue = Mustangostang\Spyc::YAMLLoad( $expectedYaml ); + + if ( ! $actualValue ) { + return false; + } + + return compareContents( $expectedValue, $actualValue ); +} + diff --git a/features/extra/no-mail.php b/features/extra/no-mail.php new file mode 100644 index 000000000..3acdcabe2 --- /dev/null +++ b/features/extra/no-mail.php @@ -0,0 +1,7 @@ + --wp' + Then The '' should have webroot + And The '' should have tables + + Examples: + | site | + | hello.test | + | world.test | + + Scenario Outline: List the sites + When I run 'bin/ee site list' + Then STDOUT should return something like + """ + List of Sites: + + - hello.test + - world.test + """ + + Examples: + | site | + | hello.test | + | world.test | + + + Scenario Outline: Delete the sites + When I run 'bin/ee site delete ' + Then The '' containers should be removed + And The '' webroot should be removed + And The '' db entry should be removed + + Examples: + | site | + | hello.test | + | world.test | + + +#Scenario: Site Clean-up works properly +# When I cleanup test 'bin/ee site create ' +# Then The '' containers should be removed +# And The '' webroot should be removed +# And The '' db entry should be removed +# +# Examples: +# | site | +# | hello.test | +# | world.test | diff --git a/features/steps/given.php b/features/steps/given.php new file mode 100644 index 000000000..1f2b07042 --- /dev/null +++ b/features/steps/given.php @@ -0,0 +1,29 @@ +Given( + "/^\'([^\']*)\' is installed$/", + function ( $world, $package ) { + exec( "type " . $package, $output, $return_status ); + if ( 0 !== $return_status ) { + throw new Exception( $package . " is not installed! Code:" . $return_status ); + } + } +); + +$steps->Given( + "/^running container \'([^\']*)\'$/", + function ( $world, $container ) { + exec( "docker inspect -f '{{.State.Running}}' " . $container, $output, $code ); + // $output = trim(implode("\n", $output)); + if ( 0 !== $code ) { + throw new Exception( $container . " is not available!" ); + } + } +); +/* +$steps->Given('/^Webroot path in config$/', function($world) { + //throw new \Behat\Behat\Exception\PendingException(); + $world->webroot_path = rtrim( \EE::get_runner()->config['sites_path'], '/\\' ) . '/'; +}); +*/ diff --git a/features/steps/then.php b/features/steps/then.php new file mode 100644 index 000000000..2262854de --- /dev/null +++ b/features/steps/then.php @@ -0,0 +1,74 @@ +Then( + "/^STDOUT should return (something like|exactly)$/", + function ( $world, $condition, $string ) { + if ( "exactly" === $condition ) { + if ( (string) $string !== $world->output ) { + throw new Exception( + "Actual output is:\n" . $world->output + ); + } + } else if ( "something like" === $condition ) { + if ( strpos( $world->output, (string) $string ) !== false ) { + throw new Exception( "Actual output is : " . $world->output ); + } + } + } +); + + +$steps->Then( + '/^The \'([^\']*)\' should have webroot$/', function ( $world, $site ) { + if ( is_dir( $_SERVER['HOME'] . "/Sites/" . $site ) ) { + if ( ! file_exists( $_SERVER['HOME'] . "/Sites/" . $site . "/app/src/wp-config.php" ) ) { + throw new Exception( "WordPress data not found!" ); + } + } else { + throw new Exception( "Site root not created!" ); + } +} +); + +$steps->Then( + '/^The \'([^\']*)\' should have tables$/', function ( $world, $site ) { + if ( is_dir( $_SERVER['HOME'] . "/Sites/" . $site ) ) { + exec( "bin/ee wp $site db check", $output ); + if ( strpos( $world->output, 'Success' ) === false ) { + throw new Exception( "WordPress db check failed!" ); + } + } +} +); + +$steps->Then( + '/^The \'([^\']*)\' containers should be removed$/', function ( $world, $site ) { + $containers = array( 'php', 'nginx', 'db', 'mail' ); + $base_name = implode( '', explode( '.', $site ) ); + + foreach ( $containers as $container ) { + $container_name = $base_name . '_' . $container . '_1'; + exec( "docker inspect -f '{{.State.Running}}' $container_name > /dev/null 2>&1", $exec_out, $return ); + if ( ! $return ) { + throw new Exception( "$container_name has not been removed!" ); + } + } +} +); + +$steps->Then( + '/^The \'([^\']*)\' webroot should be removed$/', function ( $world, $site ) { + if ( file_exists( $_SERVER['HOME'] . "/Sites/" . $site ) ) { + throw new Exception( "Webroot has not been removed!" ); + } +} +); + +$steps->Then( + '/^The \'([^\']*)\' db entry should be removed$/', function ( $world, $site ) { + $out = shell_exec( "bin/ee site list" ); + if ( strpos( $out, $site ) !== false ) { + throw new Exception( "$site db entry not been removed!" ); + } +} +); diff --git a/features/steps/when.php b/features/steps/when.php new file mode 100644 index 000000000..b29fa157f --- /dev/null +++ b/features/steps/when.php @@ -0,0 +1,9 @@ +When( + "/^I run \'([^\']*)\'$/", + function ( $world, $command ) { + exec( $command, $output ); + $world->output = trim( implode( "\n", $output ) ); + } +); diff --git a/php/class-ee.php b/php/class-ee.php index 6792901f7..7784fd2df 100644 --- a/php/class-ee.php +++ b/php/class-ee.php @@ -551,6 +551,7 @@ public static function success( $message ) { */ public static function debug( $message, $group = false ) { self::$logger->debug( self::error_to_string( $message ), $group ); + self::$file_logger->debug( $message ); } /** From d8598d4aabd82490c176dca650f291f129a4d5ff Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi Date: Mon, 2 Apr 2018 20:42:53 +0530 Subject: [PATCH 0045/1044] Add phpmyadmin --- .travis.yml | 39 +++++++++++++++++++++++++++----- README.md | 6 ++--- composer.json | 8 ++++++- composer.lock | 18 +++++++++------ ee4-config/wp/docker-compose.yml | 8 +++++++ php/EE/Runner.php | 31 +------------------------ php/utils.php | 29 ++++++++++++++++++++++++ 7 files changed, 92 insertions(+), 47 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1d45601d0..783bbb82f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,6 @@ -sudo: true -dist: trusty +sudo: required +services: + - docker language: php @@ -19,13 +20,11 @@ cache: env: global: - PATH="$TRAVIS_BUILD_DIR/vendor/bin:$PATH" + - DOCKER_COMPOSE_VERSION=1.20.1 matrix: include: - php: 7.2 - - php: 7.1 - - php: 7.0 - - php: 5.6 before_install: - | @@ -35,12 +34,40 @@ before_install: else echo "xdebug.ini does not exist" fi + - sudo rm /usr/local/bin/docker-compose + - curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose + - chmod +x docker-compose + - sudo mv docker-compose /usr/local/bin + - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - + - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" + - sudo apt-get update + - sudo apt-get -y install docker-ce install: - composer install before_script: - composer validate + - pwd && ls -al script: - - vendor/bin/behat + - pwd && ls -al + - docker --version + - docker-compose --version + - bin/ee site create test.test --debug + # - vendor/bin/behat + + - mkdir test1 + - cp -R ~/build/mrrobot47/ee4/ee4-config/wp/* test1/ + - cd test1 + # - mv config/.env.example .env + # - sed -i 's/VIRTUAL_HOST=.*/VIRTUAL_HOST=site1.test/' .env + # - pwd && ls -al + # - docker network create site1.test + # - docker-compose up -d + - docker info + +after_script: + - pwd && ls -al + - ls -al ~/.ee4 + - cat ~/.ee4/ee4.log diff --git a/README.md b/README.md index 4f8ba6430..fd660fe89 100644 --- a/README.md +++ b/README.md @@ -18,14 +18,14 @@ curl -O https://raw.githubusercontent.com/mrrobot47/ee4-builds/master/ee4.phar Next, check the Phar file to verify that it's working: ```bash -php ee.phar cli info +php ee4.phar cli info ``` To use EEv4 from the command line by typing `ee4`, make the file executable and move it to somewhere in your PATH. For example: ```bash -chmod +x ee.phar -sudo mv ee.phar /usr/local/bin/ee4 +chmod +x ee4.phar +sudo mv ee4.phar /usr/local/bin/ee4 ``` If EE was installed successfully, you should see something like this when you run `ee4 cli version`: diff --git a/composer.json b/composer.json index f3f164089..b89ffbef1 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ "php": ">=5.3.29", "composer/composer": "^1.2.0", "composer/semver": "~1.0", - "mrrobot47/site-command": "1.1", + "mrrobot47/site-command": "dev-master", "mrrobot47/wp-command": "^1.0", "justinrainbow/json-schema": "~5.2.5", "monolog/monolog": "^1.23", @@ -81,5 +81,11 @@ "split-target-prefix-true": "autoload_commands", "split-target-prefix-false": "autoload_framework" } + }, + "repositories": { + "mrrobot47/site-command": { + "type": "vcs", + "url": "https://github.com/mrrobot47/site-command.git" + } } } diff --git a/composer.lock b/composer.lock index 5371c6f5a..d61558bd2 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "c5535e4f84bef0ddd529133f3c4bbe3e", + "content-hash": "eadd9cb62b4a7d18b91ff2685df55fc6", "packages": [ { "name": "composer/ca-bundle", @@ -408,16 +408,16 @@ }, { "name": "mrrobot47/site-command", - "version": "v1.1", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/mrrobot47/site-command.git", - "reference": "551278bd995ff8f30eb2062b9564cbe684eaae06" + "reference": "2a3c41646e21c06d0c4e0d2a65496e8c523da57d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mrrobot47/site-command/zipball/551278bd995ff8f30eb2062b9564cbe684eaae06", - "reference": "551278bd995ff8f30eb2062b9564cbe684eaae06", + "url": "https://api.github.com/repos/mrrobot47/site-command/zipball/2a3c41646e21c06d0c4e0d2a65496e8c523da57d", + "reference": "2a3c41646e21c06d0c4e0d2a65496e8c523da57d", "shasum": "" }, "type": "wp-cli-package", @@ -441,12 +441,15 @@ "site-command.php" ] }, - "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "homepage": "https://github.com/mrrobot47/site-command", - "time": "2018-03-26T06:23:33+00:00" + "support": { + "source": "https://github.com/mrrobot47/site-command/tree/master", + "issues": "https://github.com/mrrobot47/site-command/issues" + }, + "time": "2018-03-27T16:10:43+00:00" }, { "name": "mrrobot47/wp-command", @@ -2466,6 +2469,7 @@ "aliases": [], "minimum-stability": "dev", "stability-flags": { + "mrrobot47/site-command": 20, "roave/security-advisories": 20 }, "prefer-stable": true, diff --git a/ee4-config/wp/docker-compose.yml b/ee4-config/wp/docker-compose.yml index a8661773d..141d6eacf 100644 --- a/ee4-config/wp/docker-compose.yml +++ b/ee4-config/wp/docker-compose.yml @@ -24,6 +24,14 @@ services: networks: - site-network + phpmyadmin: + image: phpmyadmin/phpmyadmin + restart: always + environment: + - VIRTUAL_HOST=pma.${VIRTUAL_HOST} + networks: + - site-network + php: image: rtcamp/wordpress depends_on: diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 3daf9f5f3..96297d9c6 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -64,34 +64,6 @@ private function init_ee4() { define( 'TABLE', 'sites' ); } - /** - * Start dnsmasq. - */ - private function init_dnsmasq() { - $is_dnsmasq_running = EE::launch( "docker inspect -f '{{.State.Running}}' dnsmasq", false, true ); - - if ( ! $is_dnsmasq_running->return_code ) { - if ( preg_match( '/false/', $is_dnsmasq_running->stdout ) ) { - // Start it. - $start_dnsmasq = EE::launch( "docker start dnsmasq", false, true ); - if ( $start_dnsmasq->return_code ) { - EE::error( 'There was some error in starting the dnsmasq container.' ); - } - } - } else { - $HOME = HOME; - // Create it. - if ( ! touch( "$HOME/.ee4/ee4_hosts" ) ) { - EE::error( 'Could not create dnsmasq host file.' ); - } - $create_dnsmasq = EE::launch( "docker run --name dnsmasq -d -p 127.0.0.1:53:53/udp -v $HOME/.ee4/ee4_hosts:/etc/ee4_hosts --restart always dharmin/dnsmasq-ee", false ); - - if ( $create_dnsmasq ) { - EE::error( "dnsmasq could not be created." ); - } - } - } - /** * Register a command for early invocation, generally before WordPress loads. * @@ -684,10 +656,9 @@ private function set_alias( $alias ) { public function start() { - $this->ensure_present_in_config( 'sites_path', Utils\get_home_dir(). '/Sites' ); + $this->ensure_present_in_config( 'sites_path', Utils\get_home_dir(). '/ee4-sites' ); $this->ensure_present_in_config( 'db_path', Utils\get_home_dir(). '/.ee4/ee4.db' ); $this->init_ee4(); - $this->init_dnsmasq(); // Enable PHP error reporting to stderr if testing. if ( getenv( 'BEHAT_RUN' ) ) { diff --git a/php/utils.php b/php/utils.php index ef1732462..e884e01b6 100644 --- a/php/utils.php +++ b/php/utils.php @@ -1391,3 +1391,32 @@ function random_password() { return implode( $pass ); } + +/** + * Log data with deliminators for separate view + * + * @param String $log_data Data to log + * + * @TODO: can add withName parameter for future logging. + */ +function delem_log( $log_data ) { + EE::get_file_logger()->info( "======================== $log_data ========================" ); +} + +/** + * Format and print debug messages for EE::launch + * + * @param Object $launch EE::Launch command object + */ +function launch_debug( $launch ) { + EE::debug( '-----------------------' ); + EE::debug( "COMMAND: $launch->command" ); + if ( ! empty( $launch->stdout ) ) { + EE::debug( "STDOUT: $launch->stdout" ); + } + if ( ! empty( $launch->stderr ) ) { + EE::debug( "STDERR: $launch->stderr" ); + } + EE::debug( "RETURN CODE: $launch->return_code" ); + EE::debug( '-----------------------' ); +} From b34b896f8fa726c1278b48f8f3bfff853f1e8c96 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi Date: Wed, 4 Apr 2018 16:51:50 +0530 Subject: [PATCH 0046/1044] Patch for wp Additional commands b45e6f7 --- php/EE/Dispatcher/Subcommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/EE/Dispatcher/Subcommand.php b/php/EE/Dispatcher/Subcommand.php index 6b8179dd7..4f462f951 100644 --- a/php/EE/Dispatcher/Subcommand.php +++ b/php/EE/Dispatcher/Subcommand.php @@ -363,7 +363,7 @@ private function validate_args( $args, $assoc_args, $extra_args ) { } } - if ( ! empty( $errors['fatal'] ) ) { + if ( ! empty( $errors['fatal'] ) && 'wp' !== $this->name ) { $out = 'Parameter errors:'; foreach ( $errors['fatal'] as $key => $error ) { $out .= "\n {$error}"; From 4fb0b21f951abc40b1ed84ee4bdbb8af9b5bc20f Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi Date: Wed, 4 Apr 2018 19:14:25 +0530 Subject: [PATCH 0047/1044] Add docker class and refactor --- composer.json | 8 +- composer.lock | 107 ++++++++-------- php/class-ee-docker.php | 196 ++++++++++++++++++++++++++++++ php/class-ee.php | 10 ++ php/utils.php | 16 ++- templates/docker-compose.mustache | 46 +++++++ 6 files changed, 320 insertions(+), 63 deletions(-) create mode 100644 php/class-ee-docker.php create mode 100644 templates/docker-compose.mustache diff --git a/composer.json b/composer.json index b89ffbef1..dc270ac83 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ "php": ">=5.3.29", "composer/composer": "^1.2.0", "composer/semver": "~1.0", - "mrrobot47/site-command": "dev-master", + "mrrobot47/site-command": "1.3", "mrrobot47/wp-command": "^1.0", "justinrainbow/json-schema": "~5.2.5", "monolog/monolog": "^1.23", @@ -81,11 +81,5 @@ "split-target-prefix-true": "autoload_commands", "split-target-prefix-false": "autoload_framework" } - }, - "repositories": { - "mrrobot47/site-command": { - "type": "vcs", - "url": "https://github.com/mrrobot47/site-command.git" - } } } diff --git a/composer.lock b/composer.lock index d61558bd2..1bf39db33 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "eadd9cb62b4a7d18b91ff2685df55fc6", + "content-hash": "c6cd0e777528ec465834452112be5d19", "packages": [ { "name": "composer/ca-bundle", - "version": "1.1.0", + "version": "1.1.1", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "943b2c4fcad1ef178d16a713c2468bf7e579c288" + "reference": "d2c0a83b7533d6912e8d516756ebd34f893e9169" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/943b2c4fcad1ef178d16a713c2468bf7e579c288", - "reference": "943b2c4fcad1ef178d16a713c2468bf7e579c288", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/d2c0a83b7533d6912e8d516756ebd34f893e9169", + "reference": "d2c0a83b7533d6912e8d516756ebd34f893e9169", "shasum": "" }, "require": { @@ -26,7 +26,7 @@ "php": "^5.3.2 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5", "psr/log": "^1.0", "symfony/process": "^2.5 || ^3.0 || ^4.0" }, @@ -60,7 +60,7 @@ "ssl", "tls" ], - "time": "2017-11-29T09:37:33+00:00" + "time": "2018-03-29T19:57:20+00:00" }, { "name": "composer/composer", @@ -408,16 +408,16 @@ }, { "name": "mrrobot47/site-command", - "version": "dev-master", + "version": "v1.3", "source": { "type": "git", "url": "https://github.com/mrrobot47/site-command.git", - "reference": "2a3c41646e21c06d0c4e0d2a65496e8c523da57d" + "reference": "060a4f008292e48d17997e37331af278142f662b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mrrobot47/site-command/zipball/2a3c41646e21c06d0c4e0d2a65496e8c523da57d", - "reference": "2a3c41646e21c06d0c4e0d2a65496e8c523da57d", + "url": "https://api.github.com/repos/mrrobot47/site-command/zipball/060a4f008292e48d17997e37331af278142f662b", + "reference": "060a4f008292e48d17997e37331af278142f662b", "shasum": "" }, "type": "wp-cli-package", @@ -441,15 +441,12 @@ "site-command.php" ] }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "homepage": "https://github.com/mrrobot47/site-command", - "support": { - "source": "https://github.com/mrrobot47/site-command/tree/master", - "issues": "https://github.com/mrrobot47/site-command/issues" - }, - "time": "2018-03-27T16:10:43+00:00" + "time": "2018-04-02T14:57:58+00:00" }, { "name": "mrrobot47/wp-command", @@ -820,16 +817,16 @@ }, { "name": "symfony/config", - "version": "v2.8.36", + "version": "v2.8.37", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "17605ff58313d9fe94e507620a399721fc347b6d" + "reference": "ecacddeaf76732231eea1657f6f5b062dade94c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/17605ff58313d9fe94e507620a399721fc347b6d", - "reference": "17605ff58313d9fe94e507620a399721fc347b6d", + "url": "https://api.github.com/repos/symfony/config/zipball/ecacddeaf76732231eea1657f6f5b062dade94c9", + "reference": "ecacddeaf76732231eea1657f6f5b062dade94c9", "shasum": "" }, "require": { @@ -872,20 +869,20 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2018-01-21T19:03:25+00:00" + "time": "2018-03-19T21:11:56+00:00" }, { "name": "symfony/console", - "version": "v2.8.36", + "version": "v2.8.37", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "a6ff8b2ffa4eb43046828b303af2e3fedadacc27" + "reference": "390fa4899dbcc47bd41935d87c4572ea4305d3ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/a6ff8b2ffa4eb43046828b303af2e3fedadacc27", - "reference": "a6ff8b2ffa4eb43046828b303af2e3fedadacc27", + "url": "https://api.github.com/repos/symfony/console/zipball/390fa4899dbcc47bd41935d87c4572ea4305d3ce", + "reference": "390fa4899dbcc47bd41935d87c4572ea4305d3ce", "shasum": "" }, "require": { @@ -933,20 +930,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-02-26T15:33:21+00:00" + "time": "2018-03-19T21:13:58+00:00" }, { "name": "symfony/debug", - "version": "v2.8.36", + "version": "v2.8.37", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "f693ba88189b6384370c13d114cfd010649c31af" + "reference": "ce92aa63881b80f79042962a3fbea217f5ac9b4e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/f693ba88189b6384370c13d114cfd010649c31af", - "reference": "f693ba88189b6384370c13d114cfd010649c31af", + "url": "https://api.github.com/repos/symfony/debug/zipball/ce92aa63881b80f79042962a3fbea217f5ac9b4e", + "reference": "ce92aa63881b80f79042962a3fbea217f5ac9b4e", "shasum": "" }, "require": { @@ -990,11 +987,11 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2018-02-28T21:47:46+00:00" + "time": "2018-03-28T18:22:50+00:00" }, { "name": "symfony/dependency-injection", - "version": "v2.8.36", + "version": "v2.8.37", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", @@ -1057,7 +1054,7 @@ }, { "name": "symfony/event-dispatcher", - "version": "v2.8.36", + "version": "v2.8.37", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", @@ -1117,7 +1114,7 @@ }, { "name": "symfony/filesystem", - "version": "v2.8.36", + "version": "v2.8.37", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", @@ -1166,16 +1163,16 @@ }, { "name": "symfony/finder", - "version": "v2.8.36", + "version": "v2.8.37", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "c5c751ccd50230b4517393344080a0eaf968bf2d" + "reference": "3cf7b50fa4cd6c2c4aa504b85196b12e386659d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/c5c751ccd50230b4517393344080a0eaf968bf2d", - "reference": "c5c751ccd50230b4517393344080a0eaf968bf2d", + "url": "https://api.github.com/repos/symfony/finder/zipball/3cf7b50fa4cd6c2c4aa504b85196b12e386659d4", + "reference": "3cf7b50fa4cd6c2c4aa504b85196b12e386659d4", "shasum": "" }, "require": { @@ -1211,7 +1208,7 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2018-03-05T18:27:59+00:00" + "time": "2018-03-28T18:22:50+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -1274,16 +1271,16 @@ }, { "name": "symfony/process", - "version": "v2.8.36", + "version": "v2.8.37", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "756f614c5061729ea245ac6717231f7e3bfb74f9" + "reference": "c2fc900ee54e1e44aa956eae8ba041a5347ba93c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/756f614c5061729ea245ac6717231f7e3bfb74f9", - "reference": "756f614c5061729ea245ac6717231f7e3bfb74f9", + "url": "https://api.github.com/repos/symfony/process/zipball/c2fc900ee54e1e44aa956eae8ba041a5347ba93c", + "reference": "c2fc900ee54e1e44aa956eae8ba041a5347ba93c", "shasum": "" }, "require": { @@ -1319,11 +1316,11 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2018-02-12T17:44:58+00:00" + "time": "2018-03-19T21:11:56+00:00" }, { "name": "symfony/translation", - "version": "v2.8.36", + "version": "v2.8.37", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", @@ -1387,7 +1384,7 @@ }, { "name": "symfony/yaml", - "version": "v2.8.36", + "version": "v2.8.37", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", @@ -2142,12 +2139,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "4a272b63452f4d8ff0d48a759e59db9359a9b5b7" + "reference": "c83f6aa0ed08f680c012656d411d1b7c94003012" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/4a272b63452f4d8ff0d48a759e59db9359a9b5b7", - "reference": "4a272b63452f4d8ff0d48a759e59db9359a9b5b7", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/c83f6aa0ed08f680c012656d411d1b7c94003012", + "reference": "c83f6aa0ed08f680c012656d411d1b7c94003012", "shasum": "" }, "conflict": { @@ -2178,8 +2175,8 @@ "doctrine/mongodb-odm-bundle": ">=2,<3.0.1", "doctrine/orm": ">=2,<2.4.8|>=2.5,<2.5.1", "dompdf/dompdf": ">=0.6,<0.6.2", - "drupal/core": ">=8,<8.4.5", - "drupal/drupal": ">=8,<8.4.5", + "drupal/core": ">=7,<7.58|>=8,<8.4.6|>=8.5,<8.5.1", + "drupal/drupal": ">=7,<7.58|>=8,<8.4.6|>=8.5,<8.5.1", "erusev/parsedown": "<1.7", "ezsystems/ezpublish-legacy": ">=5.3,<5.3.12.3|>=5.4,<5.4.11.3|>=2017.8,<2017.8.1.1|>=2017.12,<2017.12.2.1", "firebase/php-jwt": "<2", @@ -2188,10 +2185,11 @@ "gree/jose": "<=2.2", "gregwar/rst": "<1.0.3", "guzzlehttp/guzzle": ">=6,<6.2.1|>=4.0.0-rc2,<4.2.4|>=5,<5.3.1", - "illuminate/auth": ">=4,<4.0.99|>=4.1,<4.1.26", + "illuminate/auth": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.10", "illuminate/database": ">=4,<4.0.99|>=4.1,<4.1.29", + "illuminate/encryption": ">=4,<=4.0.11|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.40|>=5.6,<5.6.15", "joomla/session": "<1.3.1", - "laravel/framework": ">=4,<4.0.99|>=4.1,<4.1.29", + "laravel/framework": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.40|>=5.6,<5.6.15", "laravel/socialite": ">=1,<1.0.99|>=2,<2.0.10", "magento/magento1ce": ">=1.5.0.1,<1.9.3.2", "magento/magento1ee": ">=1.9,<1.14.3.2", @@ -2293,7 +2291,7 @@ } ], "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", - "time": "2018-03-22T21:16:54+00:00" + "time": "2018-04-02T06:47:13+00:00" }, { "name": "squizlabs/php_codesniffer", @@ -2469,7 +2467,6 @@ "aliases": [], "minimum-stability": "dev", "stability-flags": { - "mrrobot47/site-command": 20, "roave/security-advisories": 20 }, "prefer-stable": true, diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php new file mode 100644 index 000000000..b11a37407 --- /dev/null +++ b/php/class-ee-docker.php @@ -0,0 +1,196 @@ +'always'); + $network_default = array('name'=>'site-network'); + + //////////////////DB///////////////////// + $db['service_name'] = array('name'=>'db'); + $db['image'] = array('name'=>'mysql:latest'); + $db['restart'] = $restart_default; + $db['volumes'] = array(array('vol'=>array('name'=>'./app/db:/var/lib/mysql'))); + $db['environment'] = array('env'=>array( + array('name'=>'MYSQL_ROOT_PASSWORD'), + array('name'=>'MYSQL_DATABASE'), + array('name'=>'MYSQL_USER'), + array('name'=>'MYSQL_PASSWORD'), + ), + ); + $db['networks'] = $network_default; + + ///////////////PHP////////////////////// + $php['service_name'] = array('name'=>'php'); + $php['image'] = array('name'=>'rtcamp/wordpress'); + $php['depends_on'] = array('name'=>'db'); + $php['restart'] = $restart_default; + $php['volumes'] = array(array('vol'=>array(array('name'=>'./app/src:/var/www/html'),array('name'=>'./config/php-fpm/php.ini:/usr/local/etc/php/php.ini')))); + $php['environment'] = array('env'=>array( + array('name'=>'WORDPRESS_DB_HOST'), + array('name'=>'WORDPRESS_DB_USER=${MYSQL_USER}'), + array('name'=>'WORDPRESS_DB_PASSWORD=${MYSQL_PASSWORD}'), + ), + ); + $php['networks'] = $network_default; + + + ///////////////nginx////////////////////// + $nginx['service_name'] = array('name'=>'nginx'); + $nginx['image'] = array('name'=>'nginx:latest'); + $nginx['depends_on'] = array('name'=>'php'); + $nginx['restart'] = $restart_default; + if(in_array('le',$filters)){ + $nginx['environment'] = array('env'=>array(array('name'=>'VIRTUAL_HOST'),array('name'=>'LETSENCRYPT_HOST=${VIRTUAL_HOST}'),array('name'=>'LETSENCRYPT_EMAIL=${VIRTUAL_HOST_EMAIL}'))); + }else{ + $nginx['environment'] = array('env'=>array(array('name'=>'VIRTUAL_HOST'))); + } + $nginx['volumes'] = array(array('vol'=>array(array('name'=>'./app/src:/var/www/html'),array('name'=>'./config/nginx/default.conf:/etc/nginx/conf.d/default.conf'),array('name'=>'./logs/nginx:/var/log/nginx')))); + $nginx['networks'] = $network_default; + + ///////////////phpmyadmin////////////////////// + $phpmyadmin['service_name'] = array('name'=>'phpmyadmin'); + $phpmyadmin['image'] = array('name'=>'phpmyadmin/phpmyadmin'); + $phpmyadmin['restart'] = $restart_default; + $phpmyadmin['environment'] = array('env'=>array(array('name'=>'VIRTUAL_HOST=pma.${VIRTUAL_HOST}'))); + $phpmyadmin['networks'] = $network_default; + + ///////////////mail////////////////////// + $mail['service_name'] = array('name'=>'mail'); + $mail['image'] = array('name'=>'mailhog/mailhog'); + $mail['restart'] = $restart_default; + $mail['command'] = array('name'=>'["-invite-jim=false"]'); + if(in_array('le',$filters)){ + $mail['environment'] = array('env'=>array(array('name'=>'VIRTUAL_HOST=mail.${VIRTUAL_HOST}'),array('name'=>'VIRTUAL_PORT=8025'),array('name'=>'LETSENCRYPT_HOST=${VIRTUAL_HOST}'),array('name'=>'LETSENCRYPT_EMAIL=${VIRTUAL_HOST_EMAIL}'))); + }else{ + $mail['environment'] = array('env'=>array(array('name'=>'VIRTUAL_HOST=mail.${VIRTUAL_HOST}'),array('name'=>'VIRTUAL_PORT=8025'))); + } + $mail['networks'] = $network_default; + + $base[] = $db; + $base[] = $php; + $base[] = $nginx; + $base[] = $mail; + $base[] = $phpmyadmin; + + $binding = array( + 'services'=>$base, + 'network'=>true, + ); + + $docker_compose_yml = (mustache_render( 'docker-compose.mustache', $binding )); + return $docker_compose_yml; + } + + public static function boot_container( $container ){ + $status=self::container_status($container); + if($status){ + if('exited'===$status){ + return self::start_container( $container ); + }else{ + return true; + } + }else{ + return self::create_container( $container ); + } + } + + public static function container_status( $container ){ + $status = EE::launch( "docker inspect -f '{{.State.Running}}' $container", false, true ); + default_debug($status); + if ( ! $status->return_code ) { + if ( preg_match( '/true/', $status->stdout ) ) { + return 'running'; + }else{ + return 'exited'; + } + } + return false; + } + + /** + * Function to start the container if it exists but is not running. + * + * @param String $container Container to be started + */ + public static function start_container( $container ) { + return default_launch( "docker start $container"); + } + + /** + * Function to create and start the container if it does not exist. + */ + private function create_container( $container, $command = '' ) { + + $HOME = HOME; + + switch ($container){ + case 'traefik-proxy': + $command = "docker run -d -p 8080:8080 -p 80:80 -p 443:443 -v /var/run/docker.sock:/var/run/docker.sock -v /dev/null:/etc/traefik/traefik.toml --name traefik traefik --api --docker --docker.domain=docker.localhost --logLevel=DEBUG"; + break; + + case 'nginx-proxy': + $command = "docker run --name nginx-proxy -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v $HOME/.ee4/nginx/certs:/etc/nginx/certs -v $HOME/.ee4/nginx/dhparam:/etc/nginx/dhparam -v $HOME/.ee4/nginx/conf.d:/etc/nginx/conf.d -v $HOME/.ee4/nginx/htpasswd:/etc/nginx/htpasswd -v $HOME/.ee4/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v $HOME/.ee4:/app/ee4 dharmin/nginx-proxy"; + break; + + case 'redis': + $command = ""; + break; + } + + return default_launch($command); + } + + public static function create_network( $name ) { + return default_launch( "docker network create $name"); + } + + public static function connect_network( $name, $connect_to ){ + return default_launch( "docker network connect $name $connect_to"); + } + + public static function rm_network( $name ) { + return default_launch( "docker network rm $name"); + } + + public static function disconnect_network( $name, $connected_to ){ + return default_launch( "docker network disconnect $name $connected_to"); + } + + /** + * Function to start the containers. + */ + public static function docker_compose_up( $dir ) { + $chdir_return_code = chdir( $dir ); + if ( $chdir_return_code ) { + $docker_compose_up = EE::launch( "docker-compose up -d", false, true ); + default_debug( $docker_compose_up ); + + if ( $docker_compose_up->return_code ) { + throw new Exception( 'There was some error in docker-compose up.' ); + } + } else { + throw new Exception( 'Error in changing directory.' ); + } + } + + /** + * docker-compose down + */ + public static function docker_compose_down( $dir ) { + $chdir_return_code = chdir( $dir ); + if($chdir_return_code){ + return default_launch( 'docker-compose down'); + } + return false; + } +} diff --git a/php/class-ee.php b/php/class-ee.php index 7784fd2df..70821c1b8 100644 --- a/php/class-ee.php +++ b/php/class-ee.php @@ -24,6 +24,8 @@ class EE { private static $db; + private static $docker; + private static $file_logger; /** @@ -1086,4 +1088,12 @@ public static function db() { return self::$db; } + + public static function docker() { + if ( empty( self::$docker ) ) { + self::$docker = new EE_DOCKER(); + } + + return self::$docker; + } } diff --git a/php/utils.php b/php/utils.php index e884e01b6..a594a06b4 100644 --- a/php/utils.php +++ b/php/utils.php @@ -1408,7 +1408,7 @@ function delem_log( $log_data ) { * * @param Object $launch EE::Launch command object */ -function launch_debug( $launch ) { +function default_debug( $launch ) { EE::debug( '-----------------------' ); EE::debug( "COMMAND: $launch->command" ); if ( ! empty( $launch->stdout ) ) { @@ -1420,3 +1420,17 @@ function launch_debug( $launch ) { EE::debug( "RETURN CODE: $launch->return_code" ); EE::debug( '-----------------------' ); } + +/** + * Default Launch command. + * + * @param Object $launch EE::Launch command object + */ +function default_launch( $command ) { + $launch = EE::launch( $command, false, true ); + default_debug( $launch ); + if ( ! $launch->return_code ) { + return true; + } + return false; +} diff --git a/templates/docker-compose.mustache b/templates/docker-compose.mustache new file mode 100644 index 000000000..8865be209 --- /dev/null +++ b/templates/docker-compose.mustache @@ -0,0 +1,46 @@ +version: '3' + +services: + +{{#services}} + {{#service_name}} + {{name}}: + {{/service_name}} + {{#image}} + image: {{name}} + {{/image}} + {{#depends_on}} + depends_on: + - {{name}} + {{/depends_on}} + {{#restart}} + restart: {{name}} + {{/restart}} + {{#command}} + command: {{name}} + {{/command}} + {{#volumes}} + volumes: + {{#vol}} + - "{{name}}" + {{/vol}} + {{/volumes}} + {{#environment}} + environment: + {{#env}} + - {{name}} + {{/env}} + {{/environment}} + {{#networks}} + networks: + - {{name}} + {{/networks}} + +{{/services}} + +{{#network}} +networks: + site-network: + external: + name: ${VIRTUAL_HOST} +{{/network}} \ No newline at end of file From a07a78169a2ae1df69e7b29a97d9a6ebcb449919 Mon Sep 17 00:00:00 2001 From: Dharmin Shah Date: Wed, 4 Apr 2018 19:33:58 +0530 Subject: [PATCH 0048/1044] Add ee4 configs --- ee4-config/redis/redis.conf | 1052 +++++++++++++++++ ee4-config/wp/config/nginx/default.conf | 37 +- ee4-config/wp/docker-compose-traefik.yml | 2 +- ee4-config/wp/docker-compose.yml | 14 +- ee4-config/wpredis/config/.env.deployer | 23 + ee4-config/wpredis/config/.env.example | 8 + ee4-config/wpredis/config/nginx/default.conf | 18 + ee4-config/wpredis/config/php-fpm/php.ini | 7 + ee4-config/wpredis/docker-compose-traefik.yml | 68 ++ ee4-config/wpredis/docker-compose.yml | 67 ++ 10 files changed, 1265 insertions(+), 31 deletions(-) create mode 100644 ee4-config/redis/redis.conf create mode 100644 ee4-config/wpredis/config/.env.deployer create mode 100644 ee4-config/wpredis/config/.env.example create mode 100644 ee4-config/wpredis/config/nginx/default.conf create mode 100644 ee4-config/wpredis/config/php-fpm/php.ini create mode 100644 ee4-config/wpredis/docker-compose-traefik.yml create mode 100644 ee4-config/wpredis/docker-compose.yml diff --git a/ee4-config/redis/redis.conf b/ee4-config/redis/redis.conf new file mode 100644 index 000000000..8b41aa852 --- /dev/null +++ b/ee4-config/redis/redis.conf @@ -0,0 +1,1052 @@ +# Redis configuration file example. +# +# Note that in order to read the configuration file, Redis must be +# started with the file path as first argument: +# +# ./redis-server /path/to/redis.conf + +# Note on units: when memory size is needed, it is possible to specify +# it in the usual form of 1k 5GB 4M and so forth: +# +# 1k => 1000 bytes +# 1kb => 1024 bytes +# 1m => 1000000 bytes +# 1mb => 1024*1024 bytes +# 1g => 1000000000 bytes +# 1gb => 1024*1024*1024 bytes +# +# units are case insensitive so 1GB 1Gb 1gB are all the same. + +################################## INCLUDES ################################### + +# Include one or more other config files here. This is useful if you +# have a standard template that goes to all Redis servers but also need +# to customize a few per-server settings. Include files can include +# other files, so use this wisely. +# +# Notice option "include" won't be rewritten by command "CONFIG REWRITE" +# from admin or Redis Sentinel. Since Redis always uses the last processed +# line as value of a configuration directive, you'd better put includes +# at the beginning of this file to avoid overwriting config change at runtime. +# +# If instead you are interested in using includes to override configuration +# options, it is better to use include as the last line. +# +# include /path/to/local.conf +# include /path/to/other.conf + +################################## NETWORK ##################################### + +# By default, if no "bind" configuration directive is specified, Redis listens +# for connections from all the network interfaces available on the server. +# It is possible to listen to just one or multiple selected interfaces using +# the "bind" configuration directive, followed by one or more IP addresses. +# +# Examples: +# +# bind 192.168.1.100 10.0.0.1 +# bind 127.0.0.1 ::1 +# +# ~~~ WARNING ~~~ If the computer running Redis is directly exposed to the +# internet, binding to all the interfaces is dangerous and will expose the +# instance to everybody on the internet. So by default we uncomment the +# following bind directive, that will force Redis to listen only into +# the IPv4 lookback interface address (this means Redis will be able to +# accept connections only from clients running into the same computer it +# is running). +# +# IF YOU ARE SURE YOU WANT YOUR INSTANCE TO LISTEN TO ALL THE INTERFACES +# JUST COMMENT THE FOLLOWING LINE. +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +bind 127.0.0.1 + +# Protected mode is a layer of security protection, in order to avoid that +# Redis instances left open on the internet are accessed and exploited. +# +# When protected mode is on and if: +# +# 1) The server is not binding explicitly to a set of addresses using the +# "bind" directive. +# 2) No password is configured. +# +# The server only accepts connections from clients connecting from the +# IPv4 and IPv6 loopback addresses 127.0.0.1 and ::1, and from Unix domain +# sockets. +# +# By default protected mode is enabled. You should disable it only if +# you are sure you want clients from other hosts to connect to Redis +# even if no authentication is configured, nor a specific set of interfaces +# are explicitly listed using the "bind" directive. +protected-mode yes + +# Accept connections on the specified port, default is 6379 (IANA #815344). +# If port 0 is specified Redis will not listen on a TCP socket. +port 6379 + +# TCP listen() backlog. +# +# In high requests-per-second environments you need an high backlog in order +# to avoid slow clients connections issues. Note that the Linux kernel +# will silently truncate it to the value of /proc/sys/net/core/somaxconn so +# make sure to raise both the value of somaxconn and tcp_max_syn_backlog +# in order to get the desired effect. +tcp-backlog 511 + +# Unix socket. +# +# Specify the path for the Unix socket that will be used to listen for +# incoming connections. There is no default, so Redis will not listen +# on a unix socket when not specified. +# +# unixsocket /var/run/redis/redis.sock +# unixsocketperm 700 + +# Close the connection after a client is idle for N seconds (0 to disable) +timeout 0 + +# TCP keepalive. +# +# If non-zero, use SO_KEEPALIVE to send TCP ACKs to clients in absence +# of communication. This is useful for two reasons: +# +# 1) Detect dead peers. +# 2) Take the connection alive from the point of view of network +# equipment in the middle. +# +# On Linux, the specified value (in seconds) is the period used to send ACKs. +# Note that to close the connection the double of the time is needed. +# On other kernels the period depends on the kernel configuration. +# +# A reasonable value for this option is 300 seconds, which is the new +# Redis default starting with Redis 3.2.1. +tcp-keepalive 300 + +################################# GENERAL ##################################### + +# By default Redis does not run as a daemon. Use 'yes' if you need it. +# Note that Redis will write a pid file in /var/run/redis.pid when daemonized. +daemonize yes + +# If you run Redis from upstart or systemd, Redis can interact with your +# supervision tree. Options: +# supervised no - no supervision interaction +# supervised upstart - signal upstart by putting Redis into SIGSTOP mode +# supervised systemd - signal systemd by writing READY=1 to $NOTIFY_SOCKET +# supervised auto - detect upstart or systemd method based on +# UPSTART_JOB or NOTIFY_SOCKET environment variables +# Note: these supervision methods only signal "process is ready." +# They do not enable continuous liveness pings back to your supervisor. +supervised no + +# If a pid file is specified, Redis writes it where specified at startup +# and removes it at exit. +# +# When the server runs non daemonized, no pid file is created if none is +# specified in the configuration. When the server is daemonized, the pid file +# is used even if not specified, defaulting to "/var/run/redis.pid". +# +# Creating a pid file is best effort: if Redis is not able to create it +# nothing bad happens, the server will start and run normally. +pidfile /var/run/redis/redis-server.pid + +# Specify the server verbosity level. +# This can be one of: +# debug (a lot of information, useful for development/testing) +# verbose (many rarely useful info, but not a mess like the debug level) +# notice (moderately verbose, what you want in production probably) +# warning (only very important / critical messages are logged) +loglevel notice + +# Specify the log file name. Also the empty string can be used to force +# Redis to log on the standard output. Note that if you use standard +# output for logging but daemonize, logs will be sent to /dev/null +logfile /data/redis-server.log + +# To enable logging to the system logger, just set 'syslog-enabled' to yes, +# and optionally update the other syslog parameters to suit your needs. +# syslog-enabled no + +# Specify the syslog identity. +# syslog-ident redis + +# Specify the syslog facility. Must be USER or between LOCAL0-LOCAL7. +# syslog-facility local0 + +# Set the number of databases. The default database is DB 0, you can select +# a different one on a per-connection basis using SELECT where +# dbid is a number between 0 and 'databases'-1 +databases 16 + +################################ SNAPSHOTTING ################################ +# +# Save the DB on disk: +# +# save +# +# Will save the DB if both the given number of seconds and the given +# number of write operations against the DB occurred. +# +# In the example below the behaviour will be to save: +# after 900 sec (15 min) if at least 1 key changed +# after 300 sec (5 min) if at least 10 keys changed +# after 60 sec if at least 10000 keys changed +# +# Note: you can disable saving completely by commenting out all "save" lines. +# +# It is also possible to remove all the previously configured save +# points by adding a save directive with a single empty string argument +# like in the following example: +# +# save "" + +save 900 1 +save 300 10 +save 60 10000 + +# By default Redis will stop accepting writes if RDB snapshots are enabled +# (at least one save point) and the latest background save failed. +# This will make the user aware (in a hard way) that data is not persisting +# on disk properly, otherwise chances are that no one will notice and some +# disaster will happen. +# +# If the background saving process will start working again Redis will +# automatically allow writes again. +# +# However if you have setup your proper monitoring of the Redis server +# and persistence, you may want to disable this feature so that Redis will +# continue to work as usual even if there are problems with disk, +# permissions, and so forth. +stop-writes-on-bgsave-error yes + +# Compress string objects using LZF when dump .rdb databases? +# For default that's set to 'yes' as it's almost always a win. +# If you want to save some CPU in the saving child set it to 'no' but +# the dataset will likely be bigger if you have compressible values or keys. +rdbcompression yes + +# Since version 5 of RDB a CRC64 checksum is placed at the end of the file. +# This makes the format more resistant to corruption but there is a performance +# hit to pay (around 10%) when saving and loading RDB files, so you can disable it +# for maximum performances. +# +# RDB files created with checksum disabled have a checksum of zero that will +# tell the loading code to skip the check. +rdbchecksum yes + +# The filename where to dump the DB +dbfilename dump.rdb + +# The working directory. +# +# The DB will be written inside this directory, with the filename specified +# above using the 'dbfilename' configuration directive. +# +# The Append Only File will also be created inside this directory. +# +# Note that you must specify a directory here, not a file name. +dir /var/lib/redis + +################################# REPLICATION ################################# + +# Master-Slave replication. Use slaveof to make a Redis instance a copy of +# another Redis server. A few things to understand ASAP about Redis replication. +# +# 1) Redis replication is asynchronous, but you can configure a master to +# stop accepting writes if it appears to be not connected with at least +# a given number of slaves. +# 2) Redis slaves are able to perform a partial resynchronization with the +# master if the replication link is lost for a relatively small amount of +# time. You may want to configure the replication backlog size (see the next +# sections of this file) with a sensible value depending on your needs. +# 3) Replication is automatic and does not need user intervention. After a +# network partition slaves automatically try to reconnect to masters +# and resynchronize with them. +# +# slaveof + +# If the master is password protected (using the "requirepass" configuration +# directive below) it is possible to tell the slave to authenticate before +# starting the replication synchronization process, otherwise the master will +# refuse the slave request. +# +# masterauth + +# When a slave loses its connection with the master, or when the replication +# is still in progress, the slave can act in two different ways: +# +# 1) if slave-serve-stale-data is set to 'yes' (the default) the slave will +# still reply to client requests, possibly with out of date data, or the +# data set may just be empty if this is the first synchronization. +# +# 2) if slave-serve-stale-data is set to 'no' the slave will reply with +# an error "SYNC with master in progress" to all the kind of commands +# but to INFO and SLAVEOF. +# +slave-serve-stale-data yes + +# You can configure a slave instance to accept writes or not. Writing against +# a slave instance may be useful to store some ephemeral data (because data +# written on a slave will be easily deleted after resync with the master) but +# may also cause problems if clients are writing to it because of a +# misconfiguration. +# +# Since Redis 2.6 by default slaves are read-only. +# +# Note: read only slaves are not designed to be exposed to untrusted clients +# on the internet. It's just a protection layer against misuse of the instance. +# Still a read only slave exports by default all the administrative commands +# such as CONFIG, DEBUG, and so forth. To a limited extent you can improve +# security of read only slaves using 'rename-command' to shadow all the +# administrative / dangerous commands. +slave-read-only yes + +# Replication SYNC strategy: disk or socket. +# +# ------------------------------------------------------- +# WARNING: DISKLESS REPLICATION IS EXPERIMENTAL CURRENTLY +# ------------------------------------------------------- +# +# New slaves and reconnecting slaves that are not able to continue the replication +# process just receiving differences, need to do what is called a "full +# synchronization". An RDB file is transmitted from the master to the slaves. +# The transmission can happen in two different ways: +# +# 1) Disk-backed: The Redis master creates a new process that writes the RDB +# file on disk. Later the file is transferred by the parent +# process to the slaves incrementally. +# 2) Diskless: The Redis master creates a new process that directly writes the +# RDB file to slave sockets, without touching the disk at all. +# +# With disk-backed replication, while the RDB file is generated, more slaves +# can be queued and served with the RDB file as soon as the current child producing +# the RDB file finishes its work. With diskless replication instead once +# the transfer starts, new slaves arriving will be queued and a new transfer +# will start when the current one terminates. +# +# When diskless replication is used, the master waits a configurable amount of +# time (in seconds) before starting the transfer in the hope that multiple slaves +# will arrive and the transfer can be parallelized. +# +# With slow disks and fast (large bandwidth) networks, diskless replication +# works better. +repl-diskless-sync no + +# When diskless replication is enabled, it is possible to configure the delay +# the server waits in order to spawn the child that transfers the RDB via socket +# to the slaves. +# +# This is important since once the transfer starts, it is not possible to serve +# new slaves arriving, that will be queued for the next RDB transfer, so the server +# waits a delay in order to let more slaves arrive. +# +# The delay is specified in seconds, and by default is 5 seconds. To disable +# it entirely just set it to 0 seconds and the transfer will start ASAP. +repl-diskless-sync-delay 5 + +# Slaves send PINGs to server in a predefined interval. It's possible to change +# this interval with the repl_ping_slave_period option. The default value is 10 +# seconds. +# +# repl-ping-slave-period 10 + +# The following option sets the replication timeout for: +# +# 1) Bulk transfer I/O during SYNC, from the point of view of slave. +# 2) Master timeout from the point of view of slaves (data, pings). +# 3) Slave timeout from the point of view of masters (REPLCONF ACK pings). +# +# It is important to make sure that this value is greater than the value +# specified for repl-ping-slave-period otherwise a timeout will be detected +# every time there is low traffic between the master and the slave. +# +# repl-timeout 60 + +# Disable TCP_NODELAY on the slave socket after SYNC? +# +# If you select "yes" Redis will use a smaller number of TCP packets and +# less bandwidth to send data to slaves. But this can add a delay for +# the data to appear on the slave side, up to 40 milliseconds with +# Linux kernels using a default configuration. +# +# If you select "no" the delay for data to appear on the slave side will +# be reduced but more bandwidth will be used for replication. +# +# By default we optimize for low latency, but in very high traffic conditions +# or when the master and slaves are many hops away, turning this to "yes" may +# be a good idea. +repl-disable-tcp-nodelay no + +# Set the replication backlog size. The backlog is a buffer that accumulates +# slave data when slaves are disconnected for some time, so that when a slave +# wants to reconnect again, often a full resync is not needed, but a partial +# resync is enough, just passing the portion of data the slave missed while +# disconnected. +# +# The bigger the replication backlog, the longer the time the slave can be +# disconnected and later be able to perform a partial resynchronization. +# +# The backlog is only allocated once there is at least a slave connected. +# +# repl-backlog-size 1mb + +# After a master has no longer connected slaves for some time, the backlog +# will be freed. The following option configures the amount of seconds that +# need to elapse, starting from the time the last slave disconnected, for +# the backlog buffer to be freed. +# +# A value of 0 means to never release the backlog. +# +# repl-backlog-ttl 3600 + +# The slave priority is an integer number published by Redis in the INFO output. +# It is used by Redis Sentinel in order to select a slave to promote into a +# master if the master is no longer working correctly. +# +# A slave with a low priority number is considered better for promotion, so +# for instance if there are three slaves with priority 10, 100, 25 Sentinel will +# pick the one with priority 10, that is the lowest. +# +# However a special priority of 0 marks the slave as not able to perform the +# role of master, so a slave with priority of 0 will never be selected by +# Redis Sentinel for promotion. +# +# By default the priority is 100. +slave-priority 100 + +# It is possible for a master to stop accepting writes if there are less than +# N slaves connected, having a lag less or equal than M seconds. +# +# The N slaves need to be in "online" state. +# +# The lag in seconds, that must be <= the specified value, is calculated from +# the last ping received from the slave, that is usually sent every second. +# +# This option does not GUARANTEE that N replicas will accept the write, but +# will limit the window of exposure for lost writes in case not enough slaves +# are available, to the specified number of seconds. +# +# For example to require at least 3 slaves with a lag <= 10 seconds use: +# +# min-slaves-to-write 3 +# min-slaves-max-lag 10 +# +# Setting one or the other to 0 disables the feature. +# +# By default min-slaves-to-write is set to 0 (feature disabled) and +# min-slaves-max-lag is set to 10. + +# A Redis master is able to list the address and port of the attached +# slaves in different ways. For example the "INFO replication" section +# offers this information, which is used, among other tools, by +# Redis Sentinel in order to discover slave instances. +# Another place where this info is available is in the output of the +# "ROLE" command of a masteer. +# +# The listed IP and address normally reported by a slave is obtained +# in the following way: +# +# IP: The address is auto detected by checking the peer address +# of the socket used by the slave to connect with the master. +# +# Port: The port is communicated by the slave during the replication +# handshake, and is normally the port that the slave is using to +# list for connections. +# +# However when port forwarding or Network Address Translation (NAT) is +# used, the slave may be actually reachable via different IP and port +# pairs. The following two options can be used by a slave in order to +# report to its master a specific set of IP and port, so that both INFO +# and ROLE will report those values. +# +# There is no need to use both the options if you need to override just +# the port or the IP address. +# +# slave-announce-ip 5.5.5.5 +# slave-announce-port 1234 + +################################## SECURITY ################################### + +# Require clients to issue AUTH before processing any other +# commands. This might be useful in environments in which you do not trust +# others with access to the host running redis-server. +# +# This should stay commented out for backward compatibility and because most +# people do not need auth (e.g. they run their own servers). +# +# Warning: since Redis is pretty fast an outside user can try up to +# 150k passwords per second against a good box. This means that you should +# use a very strong password otherwise it will be very easy to break. +# +# requirepass foobared + +# Command renaming. +# +# It is possible to change the name of dangerous commands in a shared +# environment. For instance the CONFIG command may be renamed into something +# hard to guess so that it will still be available for internal-use tools +# but not available for general clients. +# +# Example: +# +# rename-command CONFIG b840fc02d524045429941cc15f59e41cb7be6c52 +# +# It is also possible to completely kill a command by renaming it into +# an empty string: +# +# rename-command CONFIG "" +# +# Please note that changing the name of commands that are logged into the +# AOF file or transmitted to slaves may cause problems. + +################################### LIMITS #################################### + +# Set the max number of connected clients at the same time. By default +# this limit is set to 10000 clients, however if the Redis server is not +# able to configure the process file limit to allow for the specified limit +# the max number of allowed clients is set to the current file limit +# minus 32 (as Redis reserves a few file descriptors for internal uses). +# +# Once the limit is reached Redis will close all the new connections sending +# an error 'max number of clients reached'. +# +# maxclients 10000 + +# Don't use more memory than the specified amount of bytes. +# When the memory limit is reached Redis will try to remove keys +# according to the eviction policy selected (see maxmemory-policy). +# +# If Redis can't remove keys according to the policy, or if the policy is +# set to 'noeviction', Redis will start to reply with errors to commands +# that would use more memory, like SET, LPUSH, and so on, and will continue +# to reply to read-only commands like GET. +# +# This option is usually useful when using Redis as an LRU cache, or to set +# a hard memory limit for an instance (using the 'noeviction' policy). +# +# WARNING: If you have slaves attached to an instance with maxmemory on, +# the size of the output buffers needed to feed the slaves are subtracted +# from the used memory count, so that network problems / resyncs will +# not trigger a loop where keys are evicted, and in turn the output +# buffer of slaves is full with DELs of keys evicted triggering the deletion +# of more keys, and so forth until the database is completely emptied. +# +# In short... if you have slaves attached it is suggested that you set a lower +# limit for maxmemory so that there is some free RAM on the system for slave +# output buffers (but this is not needed if the policy is 'noeviction'). +# +maxmemory 3334382387 + +# MAXMEMORY POLICY: how Redis will select what to remove when maxmemory +# is reached. You can select among five behaviors: +# +# volatile-lru -> remove the key with an expire set using an LRU algorithm +# allkeys-lru -> remove any key according to the LRU algorithm +# volatile-random -> remove a random key with an expire set +# allkeys-random -> remove a random key, any key +# volatile-ttl -> remove the key with the nearest expire time (minor TTL) +# noeviction -> don't expire at all, just return an error on write operations +# +# Note: with any of the above policies, Redis will return an error on write +# operations, when there are no suitable keys for eviction. +# +# At the date of writing these commands are: set setnx setex append +# incr decr rpush lpush rpushx lpushx linsert lset rpoplpush sadd +# sinter sinterstore sunion sunionstore sdiff sdiffstore zadd zincrby +# zunionstore zinterstore hset hsetnx hmset hincrby incrby decrby +# getset mset msetnx exec sort +# +# The default is: +# +maxmemory-policy allkeys-lru + +# LRU and minimal TTL algorithms are not precise algorithms but approximated +# algorithms (in order to save memory), so you can tune it for speed or +# accuracy. For default Redis will check five keys and pick the one that was +# used less recently, you can change the sample size using the following +# configuration directive. +# +# The default of 5 produces good enough results. 10 Approximates very closely +# true LRU but costs a bit more CPU. 3 is very fast but not very accurate. +# +# maxmemory-samples 5 + +############################## APPEND ONLY MODE ############################### + +# By default Redis asynchronously dumps the dataset on disk. This mode is +# good enough in many applications, but an issue with the Redis process or +# a power outage may result into a few minutes of writes lost (depending on +# the configured save points). +# +# The Append Only File is an alternative persistence mode that provides +# much better durability. For instance using the default data fsync policy +# (see later in the config file) Redis can lose just one second of writes in a +# dramatic event like a server power outage, or a single write if something +# wrong with the Redis process itself happens, but the operating system is +# still running correctly. +# +# AOF and RDB persistence can be enabled at the same time without problems. +# If the AOF is enabled on startup Redis will load the AOF, that is the file +# with the better durability guarantees. +# +# Please check http://redis.io/topics/persistence for more information. + +appendonly no + +# The name of the append only file (default: "appendonly.aof") + +appendfilename "appendonly.aof" + +# The fsync() call tells the Operating System to actually write data on disk +# instead of waiting for more data in the output buffer. Some OS will really flush +# data on disk, some other OS will just try to do it ASAP. +# +# Redis supports three different modes: +# +# no: don't fsync, just let the OS flush the data when it wants. Faster. +# always: fsync after every write to the append only log. Slow, Safest. +# everysec: fsync only one time every second. Compromise. +# +# The default is "everysec", as that's usually the right compromise between +# speed and data safety. It's up to you to understand if you can relax this to +# "no" that will let the operating system flush the output buffer when +# it wants, for better performances (but if you can live with the idea of +# some data loss consider the default persistence mode that's snapshotting), +# or on the contrary, use "always" that's very slow but a bit safer than +# everysec. +# +# More details please check the following article: +# http://antirez.com/post/redis-persistence-demystified.html +# +# If unsure, use "everysec". + +# appendfsync always +appendfsync everysec +# appendfsync no + +# When the AOF fsync policy is set to always or everysec, and a background +# saving process (a background save or AOF log background rewriting) is +# performing a lot of I/O against the disk, in some Linux configurations +# Redis may block too long on the fsync() call. Note that there is no fix for +# this currently, as even performing fsync in a different thread will block +# our synchronous write(2) call. +# +# In order to mitigate this problem it's possible to use the following option +# that will prevent fsync() from being called in the main process while a +# BGSAVE or BGREWRITEAOF is in progress. +# +# This means that while another child is saving, the durability of Redis is +# the same as "appendfsync none". In practical terms, this means that it is +# possible to lose up to 30 seconds of log in the worst scenario (with the +# default Linux settings). +# +# If you have latency problems turn this to "yes". Otherwise leave it as +# "no" that is the safest pick from the point of view of durability. + +no-appendfsync-on-rewrite no + +# Automatic rewrite of the append only file. +# Redis is able to automatically rewrite the log file implicitly calling +# BGREWRITEAOF when the AOF log size grows by the specified percentage. +# +# This is how it works: Redis remembers the size of the AOF file after the +# latest rewrite (if no rewrite has happened since the restart, the size of +# the AOF at startup is used). +# +# This base size is compared to the current size. If the current size is +# bigger than the specified percentage, the rewrite is triggered. Also +# you need to specify a minimal size for the AOF file to be rewritten, this +# is useful to avoid rewriting the AOF file even if the percentage increase +# is reached but it is still pretty small. +# +# Specify a percentage of zero in order to disable the automatic AOF +# rewrite feature. + +auto-aof-rewrite-percentage 100 +auto-aof-rewrite-min-size 64mb + +# An AOF file may be found to be truncated at the end during the Redis +# startup process, when the AOF data gets loaded back into memory. +# This may happen when the system where Redis is running +# crashes, especially when an ext4 filesystem is mounted without the +# data=ordered option (however this can't happen when Redis itself +# crashes or aborts but the operating system still works correctly). +# +# Redis can either exit with an error when this happens, or load as much +# data as possible (the default now) and start if the AOF file is found +# to be truncated at the end. The following option controls this behavior. +# +# If aof-load-truncated is set to yes, a truncated AOF file is loaded and +# the Redis server starts emitting a log to inform the user of the event. +# Otherwise if the option is set to no, the server aborts with an error +# and refuses to start. When the option is set to no, the user requires +# to fix the AOF file using the "redis-check-aof" utility before to restart +# the server. +# +# Note that if the AOF file will be found to be corrupted in the middle +# the server will still exit with an error. This option only applies when +# Redis will try to read more data from the AOF file but not enough bytes +# will be found. +aof-load-truncated yes + +################################ LUA SCRIPTING ############################### + +# Max execution time of a Lua script in milliseconds. +# +# If the maximum execution time is reached Redis will log that a script is +# still in execution after the maximum allowed time and will start to +# reply to queries with an error. +# +# When a long running script exceeds the maximum execution time only the +# SCRIPT KILL and SHUTDOWN NOSAVE commands are available. The first can be +# used to stop a script that did not yet called write commands. The second +# is the only way to shut down the server in the case a write command was +# already issued by the script but the user doesn't want to wait for the natural +# termination of the script. +# +# Set it to 0 or a negative value for unlimited execution without warnings. +lua-time-limit 5000 + +################################ REDIS CLUSTER ############################### +# +# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +# WARNING EXPERIMENTAL: Redis Cluster is considered to be stable code, however +# in order to mark it as "mature" we need to wait for a non trivial percentage +# of users to deploy it in production. +# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +# +# Normal Redis instances can't be part of a Redis Cluster; only nodes that are +# started as cluster nodes can. In order to start a Redis instance as a +# cluster node enable the cluster support uncommenting the following: +# +# cluster-enabled yes + +# Every cluster node has a cluster configuration file. This file is not +# intended to be edited by hand. It is created and updated by Redis nodes. +# Every Redis Cluster node requires a different cluster configuration file. +# Make sure that instances running in the same system do not have +# overlapping cluster configuration file names. +# +# cluster-config-file nodes-6379.conf + +# Cluster node timeout is the amount of milliseconds a node must be unreachable +# for it to be considered in failure state. +# Most other internal time limits are multiple of the node timeout. +# +# cluster-node-timeout 15000 + +# A slave of a failing master will avoid to start a failover if its data +# looks too old. +# +# There is no simple way for a slave to actually have a exact measure of +# its "data age", so the following two checks are performed: +# +# 1) If there are multiple slaves able to failover, they exchange messages +# in order to try to give an advantage to the slave with the best +# replication offset (more data from the master processed). +# Slaves will try to get their rank by offset, and apply to the start +# of the failover a delay proportional to their rank. +# +# 2) Every single slave computes the time of the last interaction with +# its master. This can be the last ping or command received (if the master +# is still in the "connected" state), or the time that elapsed since the +# disconnection with the master (if the replication link is currently down). +# If the last interaction is too old, the slave will not try to failover +# at all. +# +# The point "2" can be tuned by user. Specifically a slave will not perform +# the failover if, since the last interaction with the master, the time +# elapsed is greater than: +# +# (node-timeout * slave-validity-factor) + repl-ping-slave-period +# +# So for example if node-timeout is 30 seconds, and the slave-validity-factor +# is 10, and assuming a default repl-ping-slave-period of 10 seconds, the +# slave will not try to failover if it was not able to talk with the master +# for longer than 310 seconds. +# +# A large slave-validity-factor may allow slaves with too old data to failover +# a master, while a too small value may prevent the cluster from being able to +# elect a slave at all. +# +# For maximum availability, it is possible to set the slave-validity-factor +# to a value of 0, which means, that slaves will always try to failover the +# master regardless of the last time they interacted with the master. +# (However they'll always try to apply a delay proportional to their +# offset rank). +# +# Zero is the only value able to guarantee that when all the partitions heal +# the cluster will always be able to continue. +# +# cluster-slave-validity-factor 10 + +# Cluster slaves are able to migrate to orphaned masters, that are masters +# that are left without working slaves. This improves the cluster ability +# to resist to failures as otherwise an orphaned master can't be failed over +# in case of failure if it has no working slaves. +# +# Slaves migrate to orphaned masters only if there are still at least a +# given number of other working slaves for their old master. This number +# is the "migration barrier". A migration barrier of 1 means that a slave +# will migrate only if there is at least 1 other working slave for its master +# and so forth. It usually reflects the number of slaves you want for every +# master in your cluster. +# +# Default is 1 (slaves migrate only if their masters remain with at least +# one slave). To disable migration just set it to a very large value. +# A value of 0 can be set but is useful only for debugging and dangerous +# in production. +# +# cluster-migration-barrier 1 + +# By default Redis Cluster nodes stop accepting queries if they detect there +# is at least an hash slot uncovered (no available node is serving it). +# This way if the cluster is partially down (for example a range of hash slots +# are no longer covered) all the cluster becomes, eventually, unavailable. +# It automatically returns available as soon as all the slots are covered again. +# +# However sometimes you want the subset of the cluster which is working, +# to continue to accept queries for the part of the key space that is still +# covered. In order to do so, just set the cluster-require-full-coverage +# option to no. +# +# cluster-require-full-coverage yes + +# In order to setup your cluster make sure to read the documentation +# available at http://redis.io web site. + +################################## SLOW LOG ################################### + +# The Redis Slow Log is a system to log queries that exceeded a specified +# execution time. The execution time does not include the I/O operations +# like talking with the client, sending the reply and so forth, +# but just the time needed to actually execute the command (this is the only +# stage of command execution where the thread is blocked and can not serve +# other requests in the meantime). +# +# You can configure the slow log with two parameters: one tells Redis +# what is the execution time, in microseconds, to exceed in order for the +# command to get logged, and the other parameter is the length of the +# slow log. When a new command is logged the oldest one is removed from the +# queue of logged commands. + +# The following time is expressed in microseconds, so 1000000 is equivalent +# to one second. Note that a negative number disables the slow log, while +# a value of zero forces the logging of every command. +slowlog-log-slower-than 10000 + +# There is no limit to this length. Just be aware that it will consume memory. +# You can reclaim memory used by the slow log with SLOWLOG RESET. +slowlog-max-len 128 + +################################ LATENCY MONITOR ############################## + +# The Redis latency monitoring subsystem samples different operations +# at runtime in order to collect data related to possible sources of +# latency of a Redis instance. +# +# Via the LATENCY command this information is available to the user that can +# print graphs and obtain reports. +# +# The system only logs operations that were performed in a time equal or +# greater than the amount of milliseconds specified via the +# latency-monitor-threshold configuration directive. When its value is set +# to zero, the latency monitor is turned off. +# +# By default latency monitoring is disabled since it is mostly not needed +# if you don't have latency issues, and collecting data has a performance +# impact, that while very small, can be measured under big load. Latency +# monitoring can easily be enabled at runtime using the command +# "CONFIG SET latency-monitor-threshold " if needed. +latency-monitor-threshold 0 + +############################# EVENT NOTIFICATION ############################## + +# Redis can notify Pub/Sub clients about events happening in the key space. +# This feature is documented at http://redis.io/topics/notifications +# +# For instance if keyspace events notification is enabled, and a client +# performs a DEL operation on key "foo" stored in the Database 0, two +# messages will be published via Pub/Sub: +# +# PUBLISH __keyspace@0__:foo del +# PUBLISH __keyevent@0__:del foo +# +# It is possible to select the events that Redis will notify among a set +# of classes. Every class is identified by a single character: +# +# K Keyspace events, published with __keyspace@__ prefix. +# E Keyevent events, published with __keyevent@__ prefix. +# g Generic commands (non-type specific) like DEL, EXPIRE, RENAME, ... +# $ String commands +# l List commands +# s Set commands +# h Hash commands +# z Sorted set commands +# x Expired events (events generated every time a key expires) +# e Evicted events (events generated when a key is evicted for maxmemory) +# A Alias for g$lshzxe, so that the "AKE" string means all the events. +# +# The "notify-keyspace-events" takes as argument a string that is composed +# of zero or multiple characters. The empty string means that notifications +# are disabled. +# +# Example: to enable list and generic events, from the point of view of the +# event name, use: +# +# notify-keyspace-events Elg +# +# Example 2: to get the stream of the expired keys subscribing to channel +# name __keyevent@0__:expired use: +# +# notify-keyspace-events Ex +# +# By default all notifications are disabled because most users don't need +# this feature and the feature has some overhead. Note that if you don't +# specify at least one of K or E, no events will be delivered. +notify-keyspace-events "" + +############################### ADVANCED CONFIG ############################### + +# Hashes are encoded using a memory efficient data structure when they have a +# small number of entries, and the biggest entry does not exceed a given +# threshold. These thresholds can be configured using the following directives. +hash-max-ziplist-entries 512 +hash-max-ziplist-value 64 + +# Lists are also encoded in a special way to save a lot of space. +# The number of entries allowed per internal list node can be specified +# as a fixed maximum size or a maximum number of elements. +# For a fixed maximum size, use -5 through -1, meaning: +# -5: max size: 64 Kb <-- not recommended for normal workloads +# -4: max size: 32 Kb <-- not recommended +# -3: max size: 16 Kb <-- probably not recommended +# -2: max size: 8 Kb <-- good +# -1: max size: 4 Kb <-- good +# Positive numbers mean store up to _exactly_ that number of elements +# per list node. +# The highest performing option is usually -2 (8 Kb size) or -1 (4 Kb size), +# but if your use case is unique, adjust the settings as necessary. +list-max-ziplist-size -2 + +# Lists may also be compressed. +# Compress depth is the number of quicklist ziplist nodes from *each* side of +# the list to *exclude* from compression. The head and tail of the list +# are always uncompressed for fast push/pop operations. Settings are: +# 0: disable all list compression +# 1: depth 1 means "don't start compressing until after 1 node into the list, +# going from either the head or tail" +# So: [head]->node->node->...->node->[tail] +# [head], [tail] will always be uncompressed; inner nodes will compress. +# 2: [head]->[next]->node->node->...->node->[prev]->[tail] +# 2 here means: don't compress head or head->next or tail->prev or tail, +# but compress all nodes between them. +# 3: [head]->[next]->[next]->node->node->...->node->[prev]->[prev]->[tail] +# etc. +list-compress-depth 0 + +# Sets have a special encoding in just one case: when a set is composed +# of just strings that happen to be integers in radix 10 in the range +# of 64 bit signed integers. +# The following configuration setting sets the limit in the size of the +# set in order to use this special memory saving encoding. +set-max-intset-entries 512 + +# Similarly to hashes and lists, sorted sets are also specially encoded in +# order to save a lot of space. This encoding is only used when the length and +# elements of a sorted set are below the following limits: +zset-max-ziplist-entries 128 +zset-max-ziplist-value 64 + +# HyperLogLog sparse representation bytes limit. The limit includes the +# 16 bytes header. When an HyperLogLog using the sparse representation crosses +# this limit, it is converted into the dense representation. +# +# A value greater than 16000 is totally useless, since at that point the +# dense representation is more memory efficient. +# +# The suggested value is ~ 3000 in order to have the benefits of +# the space efficient encoding without slowing down too much PFADD, +# which is O(N) with the sparse encoding. The value can be raised to +# ~ 10000 when CPU is not a concern, but space is, and the data set is +# composed of many HyperLogLogs with cardinality in the 0 - 15000 range. +hll-sparse-max-bytes 3000 + +# Active rehashing uses 1 millisecond every 100 milliseconds of CPU time in +# order to help rehashing the main Redis hash table (the one mapping top-level +# keys to values). The hash table implementation Redis uses (see dict.c) +# performs a lazy rehashing: the more operation you run into a hash table +# that is rehashing, the more rehashing "steps" are performed, so if the +# server is idle the rehashing is never complete and some more memory is used +# by the hash table. +# +# The default is to use this millisecond 10 times every second in order to +# actively rehash the main dictionaries, freeing memory when possible. +# +# If unsure: +# use "activerehashing no" if you have hard latency requirements and it is +# not a good thing in your environment that Redis can reply from time to time +# to queries with 2 milliseconds delay. +# +# use "activerehashing yes" if you don't have such hard requirements but +# want to free memory asap when possible. +activerehashing yes + +# The client output buffer limits can be used to force disconnection of clients +# that are not reading data from the server fast enough for some reason (a +# common reason is that a Pub/Sub client can't consume messages as fast as the +# publisher can produce them). +# +# The limit can be set differently for the three different classes of clients: +# +# normal -> normal clients including MONITOR clients +# slave -> slave clients +# pubsub -> clients subscribed to at least one pubsub channel or pattern +# +# The syntax of every client-output-buffer-limit directive is the following: +# +# client-output-buffer-limit +# +# A client is immediately disconnected once the hard limit is reached, or if +# the soft limit is reached and remains reached for the specified number of +# seconds (continuously). +# So for instance if the hard limit is 32 megabytes and the soft limit is +# 16 megabytes / 10 seconds, the client will get disconnected immediately +# if the size of the output buffers reach 32 megabytes, but will also get +# disconnected if the client reaches 16 megabytes and continuously overcomes +# the limit for 10 seconds. +# +# By default normal clients are not limited because they don't receive data +# without asking (in a push way), but just after a request, so only +# asynchronous clients may create a scenario where data is requested faster +# than it can read. +# +# Instead there is a default limit for pubsub and slave clients, since +# subscribers and slaves receive data in a push fashion. +# +# Both the hard or the soft limit can be disabled by setting them to zero. +client-output-buffer-limit normal 0 0 0 +client-output-buffer-limit slave 256mb 64mb 60 +client-output-buffer-limit pubsub 32mb 8mb 60 + +# Redis calls an internal function to perform many background tasks, like +# closing connections of clients in timeout, purging expired keys that are +# never requested, and so forth. +# +# Not all tasks are performed with the same frequency, but Redis checks for +# tasks to perform according to the specified "hz" value. +# +# By default "hz" is set to 10. Raising the value will use more CPU when +# Redis is idle, but at the same time will make Redis more responsive when +# there are many keys expiring at the same time, and timeouts may be +# handled with more precision. +# +# The range is between 1 and 500, however a value over 100 is usually not +# a good idea. Most users should use the default of 10 and raise this up to +# 100 only in environments where very low latency is required. +hz 10 + +# When a child rewrites the AOF file, if the following option is enabled +# the file will be fsync-ed every 32 MB of data generated. This is useful +# in order to commit the file to the disk more incrementally and avoid +# big latency spikes. +aof-rewrite-incremental-fsync yes diff --git a/ee4-config/wp/config/nginx/default.conf b/ee4-config/wp/config/nginx/default.conf index 9672262dd..c8aab00a7 100644 --- a/ee4-config/wp/config/nginx/default.conf +++ b/ee4-config/wp/config/nginx/default.conf @@ -1,36 +1,19 @@ server { - server_name localhost; + access_log /var/log/nginx/access.log; + error_log /var/log/nginx/error.log; - access_log /var/log/nginx/access.log; - error_log /var/log/nginx/error.log; + root /var/www/html; - root /var/www/html; - index index.php; + server_name site1.test; - if (!-e $request_filename) { - rewrite /wp-admin$ $scheme://$host$uri/ permanent; - rewrite ^(/[^/]+)?(/wp-.*) $2 last; - rewrite ^(/[^/]+)?(/.*\.php) $2 last; - } + index index.php index.html index.htm; - location / { - try_files $uri $uri/ /index.php?$args; - } - location ~ \.php$ { - try_files $uri =404; - include fastcgi_params; - fastcgi_pass php:9000; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - } + # include common/redis-php7.conf; - location = /robots.txt { - return 200 'User-agent: * -Disallow: /'; - access_log off; - log_not_found off; - } + include common/php7.conf; + include common/wpcommon-php7.conf; + include common/locations-php7.conf; - client_max_body_size 100m; - include /etc/nginx/sites-enabled/*; + client_max_body_size 100m; } diff --git a/ee4-config/wp/docker-compose-traefik.yml b/ee4-config/wp/docker-compose-traefik.yml index 960330c23..7b87eb314 100644 --- a/ee4-config/wp/docker-compose-traefik.yml +++ b/ee4-config/wp/docker-compose-traefik.yml @@ -46,7 +46,7 @@ services: - site-network nginx: - image: nginx:latest + image: dharmin/nginx:latest depends_on: - php restart: always diff --git a/ee4-config/wp/docker-compose.yml b/ee4-config/wp/docker-compose.yml index a8661773d..8aa243b68 100644 --- a/ee4-config/wp/docker-compose.yml +++ b/ee4-config/wp/docker-compose.yml @@ -24,8 +24,16 @@ services: networks: - site-network + phpmyadmin: + image: phpmyadmin/phpmyadmin + restart: always + environment: + - VIRTUAL_HOST=pma.${VIRTUAL_HOST} + networks: + - site-network + php: - image: rtcamp/wordpress + image: wordpress/rtcamp depends_on: - db restart: always @@ -40,7 +48,7 @@ services: - site-network nginx: - image: nginx:latest + image: dharmin/nginx:latest depends_on: - php restart: always @@ -56,4 +64,4 @@ services: networks: site-network: external: - name: ${VIRTUAL_HOST} \ No newline at end of file + name: ${VIRTUAL_HOST} diff --git a/ee4-config/wpredis/config/.env.deployer b/ee4-config/wpredis/config/.env.deployer new file mode 100644 index 000000000..4c772fef0 --- /dev/null +++ b/ee4-config/wpredis/config/.env.deployer @@ -0,0 +1,23 @@ +DB_NAME=database_name +DB_USER=database_user +DB_PASSWORD=database_password + +# Optional variables +DB_HOST=mysql +# DB_PREFIX=wp_ + +WP_ENV=development +WP_HOME=http://example.com +WP_SITEURL=${WP_HOME} + +# Generate your keys here: https://roots.io/salts.html +AUTH_KEY='generateme' +SECURE_AUTH_KEY='generateme' +LOGGED_IN_KEY='generateme' +NONCE_KEY='generateme' +AUTH_SALT='generateme' +SECURE_AUTH_SALT='generateme' +LOGGED_IN_SALT='generateme' +NONCE_SALT='generateme' +WP_CACHE_KEY_SALT='example.com:' #trailing `:` is important + diff --git a/ee4-config/wpredis/config/.env.example b/ee4-config/wpredis/config/.env.example new file mode 100644 index 000000000..afab96d16 --- /dev/null +++ b/ee4-config/wpredis/config/.env.example @@ -0,0 +1,8 @@ +MYSQL_ROOT_PASSWORD=password +MYSQL_DATABASE=wordpress +MYSQL_USER=wordpress +MYSQL_PASSWORD=password + +WORDPRESS_DB_HOST=db +VIRTUAL_HOST={V_HOST} +VIRTUAL_HOST_EMAIL=example@site1.test diff --git a/ee4-config/wpredis/config/nginx/default.conf b/ee4-config/wpredis/config/nginx/default.conf new file mode 100644 index 000000000..90ae77de3 --- /dev/null +++ b/ee4-config/wpredis/config/nginx/default.conf @@ -0,0 +1,18 @@ +server { + access_log /var/log/nginx/access.log; + error_log /var/log/nginx/error.log; + + root /var/www/html; + + server_name site1.test; + + index index.php index.html index.htm; + + + include common/redis-php7.conf; + + include common/wpcommon-php7.conf; + include common/locations-php7.conf; + + client_max_body_size 100m; +} diff --git a/ee4-config/wpredis/config/php-fpm/php.ini b/ee4-config/wpredis/config/php-fpm/php.ini new file mode 100644 index 000000000..c5964c495 --- /dev/null +++ b/ee4-config/wpredis/config/php-fpm/php.ini @@ -0,0 +1,7 @@ +# Custom PHP settings + +upload_max_filesize = 100M +post_max_size = 100M + +[mail function] +sendmail_path = /usr/sbin/sendmail -S mail:1025 diff --git a/ee4-config/wpredis/docker-compose-traefik.yml b/ee4-config/wpredis/docker-compose-traefik.yml new file mode 100644 index 000000000..7b87eb314 --- /dev/null +++ b/ee4-config/wpredis/docker-compose-traefik.yml @@ -0,0 +1,68 @@ +version: '3' + +services: + mail: + image: mailhog/mailhog + restart: always + command: ["-invite-jim=false"] + labels: + - traefik.enable=false + environment: + - VIRTUAL_HOST=mail.${VIRTUAL_HOST} + - VIRTUAL_PORT=8025 + networks: + - site-network + + db: + image: mysql:latest + restart: always + volumes: + - "./app/db:/var/lib/mysql" + labels: + - traefik.enable=false + environment: + - MYSQL_ROOT_PASSWORD + - MYSQL_DATABASE + - MYSQL_USER + - MYSQL_PASSWORD + networks: + - site-network + + php: + image: rtcamp/wordpress + depends_on: + - db + restart: always + labels: + - traefik.enable=false + volumes: + - "./app/src:/var/www/html" + - "./config/php-fpm/php.ini:/usr/local/etc/php/php.ini" + environment: + - WORDPRESS_DB_HOST + - WORDPRESS_DB_USER=${MYSQL_USER} + - WORDPRESS_DB_PASSWORD=${MYSQL_PASSWORD} + networks: + - site-network + + nginx: + image: dharmin/nginx:latest + depends_on: + - php + restart: always + environment: + - VIRTUAL_HOST + labels: + - "traefik.backend=${VIRTUAL_HOST}" + - "traefik.frontend.rule=HostRegexp:${VIRTUAL_HOST},{subdomain:[-a-z0-9]+}.${VIRTUAL_HOST}" + volumes: + - "./app/src:/var/www/html" + - "./config/nginx/default.conf:/etc/nginx/conf.d/default.conf" + - "./logs/nginx:/var/log/nginx" + networks: + - site-network + +networks: + site-network: + external: + name: ${VIRTUAL_HOST} diff --git a/ee4-config/wpredis/docker-compose.yml b/ee4-config/wpredis/docker-compose.yml new file mode 100644 index 000000000..8aa243b68 --- /dev/null +++ b/ee4-config/wpredis/docker-compose.yml @@ -0,0 +1,67 @@ +version: '3' + +services: + mail: + image: mailhog/mailhog + restart: always + command: ["-invite-jim=false"] + environment: + - VIRTUAL_HOST=mail.${VIRTUAL_HOST} + - VIRTUAL_PORT=8025 + networks: + - site-network + + db: + image: mysql:latest + restart: always + volumes: + - "./app/db:/var/lib/mysql" + environment: + - MYSQL_ROOT_PASSWORD + - MYSQL_DATABASE + - MYSQL_USER + - MYSQL_PASSWORD + networks: + - site-network + + phpmyadmin: + image: phpmyadmin/phpmyadmin + restart: always + environment: + - VIRTUAL_HOST=pma.${VIRTUAL_HOST} + networks: + - site-network + + php: + image: wordpress/rtcamp + depends_on: + - db + restart: always + volumes: + - "./app/src:/var/www/html" + - "./config/php-fpm/php.ini:/usr/local/etc/php/php.ini" + environment: + - WORDPRESS_DB_HOST + - WORDPRESS_DB_USER=${MYSQL_USER} + - WORDPRESS_DB_PASSWORD=${MYSQL_PASSWORD} + networks: + - site-network + + nginx: + image: dharmin/nginx:latest + depends_on: + - php + restart: always + environment: + - VIRTUAL_HOST + volumes: + - "./app/src:/var/www/html" + - "./config/nginx/default.conf:/etc/nginx/conf.d/default.conf" + - "./logs/nginx:/var/log/nginx" + networks: + - site-network + +networks: + site-network: + external: + name: ${VIRTUAL_HOST} From 9909e91a3eae3754a0470e7cb76679b0eaa43b72 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi Date: Wed, 4 Apr 2018 19:14:25 +0530 Subject: [PATCH 0049/1044] Add docker class and refactor --- composer.json | 8 +- composer.lock | 107 ++++++++-------- php/class-ee-docker.php | 201 ++++++++++++++++++++++++++++++ php/class-ee.php | 10 ++ php/utils.php | 16 ++- templates/docker-compose.mustache | 49 ++++++++ 6 files changed, 328 insertions(+), 63 deletions(-) create mode 100644 php/class-ee-docker.php create mode 100644 templates/docker-compose.mustache diff --git a/composer.json b/composer.json index b89ffbef1..dc270ac83 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ "php": ">=5.3.29", "composer/composer": "^1.2.0", "composer/semver": "~1.0", - "mrrobot47/site-command": "dev-master", + "mrrobot47/site-command": "1.3", "mrrobot47/wp-command": "^1.0", "justinrainbow/json-schema": "~5.2.5", "monolog/monolog": "^1.23", @@ -81,11 +81,5 @@ "split-target-prefix-true": "autoload_commands", "split-target-prefix-false": "autoload_framework" } - }, - "repositories": { - "mrrobot47/site-command": { - "type": "vcs", - "url": "https://github.com/mrrobot47/site-command.git" - } } } diff --git a/composer.lock b/composer.lock index d61558bd2..1bf39db33 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "eadd9cb62b4a7d18b91ff2685df55fc6", + "content-hash": "c6cd0e777528ec465834452112be5d19", "packages": [ { "name": "composer/ca-bundle", - "version": "1.1.0", + "version": "1.1.1", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "943b2c4fcad1ef178d16a713c2468bf7e579c288" + "reference": "d2c0a83b7533d6912e8d516756ebd34f893e9169" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/943b2c4fcad1ef178d16a713c2468bf7e579c288", - "reference": "943b2c4fcad1ef178d16a713c2468bf7e579c288", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/d2c0a83b7533d6912e8d516756ebd34f893e9169", + "reference": "d2c0a83b7533d6912e8d516756ebd34f893e9169", "shasum": "" }, "require": { @@ -26,7 +26,7 @@ "php": "^5.3.2 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5", "psr/log": "^1.0", "symfony/process": "^2.5 || ^3.0 || ^4.0" }, @@ -60,7 +60,7 @@ "ssl", "tls" ], - "time": "2017-11-29T09:37:33+00:00" + "time": "2018-03-29T19:57:20+00:00" }, { "name": "composer/composer", @@ -408,16 +408,16 @@ }, { "name": "mrrobot47/site-command", - "version": "dev-master", + "version": "v1.3", "source": { "type": "git", "url": "https://github.com/mrrobot47/site-command.git", - "reference": "2a3c41646e21c06d0c4e0d2a65496e8c523da57d" + "reference": "060a4f008292e48d17997e37331af278142f662b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mrrobot47/site-command/zipball/2a3c41646e21c06d0c4e0d2a65496e8c523da57d", - "reference": "2a3c41646e21c06d0c4e0d2a65496e8c523da57d", + "url": "https://api.github.com/repos/mrrobot47/site-command/zipball/060a4f008292e48d17997e37331af278142f662b", + "reference": "060a4f008292e48d17997e37331af278142f662b", "shasum": "" }, "type": "wp-cli-package", @@ -441,15 +441,12 @@ "site-command.php" ] }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "homepage": "https://github.com/mrrobot47/site-command", - "support": { - "source": "https://github.com/mrrobot47/site-command/tree/master", - "issues": "https://github.com/mrrobot47/site-command/issues" - }, - "time": "2018-03-27T16:10:43+00:00" + "time": "2018-04-02T14:57:58+00:00" }, { "name": "mrrobot47/wp-command", @@ -820,16 +817,16 @@ }, { "name": "symfony/config", - "version": "v2.8.36", + "version": "v2.8.37", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "17605ff58313d9fe94e507620a399721fc347b6d" + "reference": "ecacddeaf76732231eea1657f6f5b062dade94c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/17605ff58313d9fe94e507620a399721fc347b6d", - "reference": "17605ff58313d9fe94e507620a399721fc347b6d", + "url": "https://api.github.com/repos/symfony/config/zipball/ecacddeaf76732231eea1657f6f5b062dade94c9", + "reference": "ecacddeaf76732231eea1657f6f5b062dade94c9", "shasum": "" }, "require": { @@ -872,20 +869,20 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2018-01-21T19:03:25+00:00" + "time": "2018-03-19T21:11:56+00:00" }, { "name": "symfony/console", - "version": "v2.8.36", + "version": "v2.8.37", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "a6ff8b2ffa4eb43046828b303af2e3fedadacc27" + "reference": "390fa4899dbcc47bd41935d87c4572ea4305d3ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/a6ff8b2ffa4eb43046828b303af2e3fedadacc27", - "reference": "a6ff8b2ffa4eb43046828b303af2e3fedadacc27", + "url": "https://api.github.com/repos/symfony/console/zipball/390fa4899dbcc47bd41935d87c4572ea4305d3ce", + "reference": "390fa4899dbcc47bd41935d87c4572ea4305d3ce", "shasum": "" }, "require": { @@ -933,20 +930,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-02-26T15:33:21+00:00" + "time": "2018-03-19T21:13:58+00:00" }, { "name": "symfony/debug", - "version": "v2.8.36", + "version": "v2.8.37", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "f693ba88189b6384370c13d114cfd010649c31af" + "reference": "ce92aa63881b80f79042962a3fbea217f5ac9b4e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/f693ba88189b6384370c13d114cfd010649c31af", - "reference": "f693ba88189b6384370c13d114cfd010649c31af", + "url": "https://api.github.com/repos/symfony/debug/zipball/ce92aa63881b80f79042962a3fbea217f5ac9b4e", + "reference": "ce92aa63881b80f79042962a3fbea217f5ac9b4e", "shasum": "" }, "require": { @@ -990,11 +987,11 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2018-02-28T21:47:46+00:00" + "time": "2018-03-28T18:22:50+00:00" }, { "name": "symfony/dependency-injection", - "version": "v2.8.36", + "version": "v2.8.37", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", @@ -1057,7 +1054,7 @@ }, { "name": "symfony/event-dispatcher", - "version": "v2.8.36", + "version": "v2.8.37", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", @@ -1117,7 +1114,7 @@ }, { "name": "symfony/filesystem", - "version": "v2.8.36", + "version": "v2.8.37", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", @@ -1166,16 +1163,16 @@ }, { "name": "symfony/finder", - "version": "v2.8.36", + "version": "v2.8.37", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "c5c751ccd50230b4517393344080a0eaf968bf2d" + "reference": "3cf7b50fa4cd6c2c4aa504b85196b12e386659d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/c5c751ccd50230b4517393344080a0eaf968bf2d", - "reference": "c5c751ccd50230b4517393344080a0eaf968bf2d", + "url": "https://api.github.com/repos/symfony/finder/zipball/3cf7b50fa4cd6c2c4aa504b85196b12e386659d4", + "reference": "3cf7b50fa4cd6c2c4aa504b85196b12e386659d4", "shasum": "" }, "require": { @@ -1211,7 +1208,7 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2018-03-05T18:27:59+00:00" + "time": "2018-03-28T18:22:50+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -1274,16 +1271,16 @@ }, { "name": "symfony/process", - "version": "v2.8.36", + "version": "v2.8.37", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "756f614c5061729ea245ac6717231f7e3bfb74f9" + "reference": "c2fc900ee54e1e44aa956eae8ba041a5347ba93c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/756f614c5061729ea245ac6717231f7e3bfb74f9", - "reference": "756f614c5061729ea245ac6717231f7e3bfb74f9", + "url": "https://api.github.com/repos/symfony/process/zipball/c2fc900ee54e1e44aa956eae8ba041a5347ba93c", + "reference": "c2fc900ee54e1e44aa956eae8ba041a5347ba93c", "shasum": "" }, "require": { @@ -1319,11 +1316,11 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2018-02-12T17:44:58+00:00" + "time": "2018-03-19T21:11:56+00:00" }, { "name": "symfony/translation", - "version": "v2.8.36", + "version": "v2.8.37", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", @@ -1387,7 +1384,7 @@ }, { "name": "symfony/yaml", - "version": "v2.8.36", + "version": "v2.8.37", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", @@ -2142,12 +2139,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "4a272b63452f4d8ff0d48a759e59db9359a9b5b7" + "reference": "c83f6aa0ed08f680c012656d411d1b7c94003012" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/4a272b63452f4d8ff0d48a759e59db9359a9b5b7", - "reference": "4a272b63452f4d8ff0d48a759e59db9359a9b5b7", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/c83f6aa0ed08f680c012656d411d1b7c94003012", + "reference": "c83f6aa0ed08f680c012656d411d1b7c94003012", "shasum": "" }, "conflict": { @@ -2178,8 +2175,8 @@ "doctrine/mongodb-odm-bundle": ">=2,<3.0.1", "doctrine/orm": ">=2,<2.4.8|>=2.5,<2.5.1", "dompdf/dompdf": ">=0.6,<0.6.2", - "drupal/core": ">=8,<8.4.5", - "drupal/drupal": ">=8,<8.4.5", + "drupal/core": ">=7,<7.58|>=8,<8.4.6|>=8.5,<8.5.1", + "drupal/drupal": ">=7,<7.58|>=8,<8.4.6|>=8.5,<8.5.1", "erusev/parsedown": "<1.7", "ezsystems/ezpublish-legacy": ">=5.3,<5.3.12.3|>=5.4,<5.4.11.3|>=2017.8,<2017.8.1.1|>=2017.12,<2017.12.2.1", "firebase/php-jwt": "<2", @@ -2188,10 +2185,11 @@ "gree/jose": "<=2.2", "gregwar/rst": "<1.0.3", "guzzlehttp/guzzle": ">=6,<6.2.1|>=4.0.0-rc2,<4.2.4|>=5,<5.3.1", - "illuminate/auth": ">=4,<4.0.99|>=4.1,<4.1.26", + "illuminate/auth": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.10", "illuminate/database": ">=4,<4.0.99|>=4.1,<4.1.29", + "illuminate/encryption": ">=4,<=4.0.11|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.40|>=5.6,<5.6.15", "joomla/session": "<1.3.1", - "laravel/framework": ">=4,<4.0.99|>=4.1,<4.1.29", + "laravel/framework": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.40|>=5.6,<5.6.15", "laravel/socialite": ">=1,<1.0.99|>=2,<2.0.10", "magento/magento1ce": ">=1.5.0.1,<1.9.3.2", "magento/magento1ee": ">=1.9,<1.14.3.2", @@ -2293,7 +2291,7 @@ } ], "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", - "time": "2018-03-22T21:16:54+00:00" + "time": "2018-04-02T06:47:13+00:00" }, { "name": "squizlabs/php_codesniffer", @@ -2469,7 +2467,6 @@ "aliases": [], "minimum-stability": "dev", "stability-flags": { - "mrrobot47/site-command": 20, "roave/security-advisories": 20 }, "prefer-stable": true, diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php new file mode 100644 index 000000000..f25e57d2d --- /dev/null +++ b/php/class-ee-docker.php @@ -0,0 +1,201 @@ + 'always' ); + $network_default = array( 'name' => 'site-network' ); + + //////////////////DB///////////////////// + $db['service_name'] = array( 'name' => 'db' ); + $db['image'] = array( 'name' => 'mysql:latest' ); + $db['restart'] = $restart_default; + $db['volumes'] = array( array( 'vol' => array( 'name' => './app/db:/var/lib/mysql' ) ) ); + $db['environment'] = array( + 'env' => array( + array( 'name' => 'MYSQL_ROOT_PASSWORD' ), + array( 'name' => 'MYSQL_DATABASE' ), + array( 'name' => 'MYSQL_USER' ), + array( 'name' => 'MYSQL_PASSWORD' ), + ), + ); + $db['networks'] = $network_default; + + ///////////////PHP////////////////////// + $php['service_name'] = array( 'name' => 'php' ); + $php['image'] = array( 'name' => 'rtcamp/wordpress' ); + $php['depends_on'] = array( 'name' => 'db' ); + $php['restart'] = $restart_default; + $php['volumes'] = array( array( 'vol' => array( array( 'name' => './app/src:/var/www/html' ), array( 'name' => './config/php-fpm/php.ini:/usr/local/etc/php/php.ini' ) ) ) ); + $php['environment'] = array( + 'env' => array( + array( 'name' => 'WORDPRESS_DB_HOST' ), + array( 'name' => 'WORDPRESS_DB_USER=${MYSQL_USER}' ), + array( 'name' => 'WORDPRESS_DB_PASSWORD=${MYSQL_PASSWORD}' ), + ), + ); + $php['networks'] = $network_default; + + + ///////////////nginx////////////////////// + $nginx['service_name'] = array( 'name' => 'nginx' ); + $nginx['image'] = array( 'name' => 'nginx:latest' ); + $nginx['depends_on'] = array( 'name' => 'php' ); + $nginx['restart'] = $restart_default; + if ( in_array( 'le', $filters ) ) { + $nginx['environment'] = array( 'env' => array( array( 'name' => 'VIRTUAL_HOST' ), array( 'name' => 'LETSENCRYPT_HOST=${VIRTUAL_HOST}' ), array( 'name' => 'LETSENCRYPT_EMAIL=${VIRTUAL_HOST_EMAIL}' ) ) ); + } else { + $nginx['environment'] = array( 'env' => array( array( 'name' => 'VIRTUAL_HOST' ) ) ); + } + $nginx['volumes'] = array( array( 'vol' => array( array( 'name' => './app/src:/var/www/html' ), array( 'name' => './config/nginx/default.conf:/etc/nginx/conf.d/default.conf' ), array( 'name' => './logs/nginx:/var/log/nginx' ) ) ) ); + $nginx['networks'] = $network_default; + + ///////////////phpmyadmin////////////////////// + $phpmyadmin['service_name'] = array( 'name' => 'phpmyadmin' ); + $phpmyadmin['image'] = array( 'name' => 'phpmyadmin/phpmyadmin' ); + $phpmyadmin['restart'] = $restart_default; + $phpmyadmin['environment'] = array( 'env' => array( array( 'name' => 'VIRTUAL_HOST=pma.${VIRTUAL_HOST}' ) ) ); + $phpmyadmin['networks'] = $network_default; + + ///////////////mail////////////////////// + $mail['service_name'] = array( 'name' => 'mail' ); + $mail['image'] = array( 'name' => 'mailhog/mailhog' ); + $mail['restart'] = $restart_default; + $mail['command'] = array( 'name' => '["-invite-jim=false"]' ); + if ( in_array( 'le', $filters ) ) { + $mail['environment'] = array( 'env' => array( array( 'name' => 'VIRTUAL_HOST=mail.${VIRTUAL_HOST}' ), array( 'name' => 'VIRTUAL_PORT=8025' ), array( 'name' => 'LETSENCRYPT_HOST=${VIRTUAL_HOST}' ), array( 'name' => 'LETSENCRYPT_EMAIL=${VIRTUAL_HOST_EMAIL}' ) ) ); + } else { + $mail['environment'] = array( 'env' => array( array( 'name' => 'VIRTUAL_HOST=mail.${VIRTUAL_HOST}' ), array( 'name' => 'VIRTUAL_PORT=8025' ) ) ); + } + $mail['networks'] = $network_default; + + $base[] = $db; + $base[] = $php; + $base[] = $nginx; + $base[] = $mail; + $base[] = $phpmyadmin; + + $binding = array( + 'services' => $base, + 'network' => true, + ); + + $docker_compose_yml = ( mustache_render( 'docker-compose.mustache', $binding ) ); + + return $docker_compose_yml; + } + + public static function boot_container( $container ) { + $status = self::container_status( $container ); + if ( $status ) { + if ( 'exited' === $status ) { + return self::start_container( $container ); + } else { + return true; + } + } else { + return self::create_container( $container ); + } + } + + public static function container_status( $container ) { + $status = EE::launch( "docker inspect -f '{{.State.Running}}' $container", false, true ); + default_debug( $status ); + if ( ! $status->return_code ) { + if ( preg_match( '/true/', $status->stdout ) ) { + return 'running'; + } else { + return 'exited'; + } + } + + return false; + } + + /** + * Function to start the container if it exists but is not running. + * + * @param String $container Container to be started + */ + public static function start_container( $container ) { + return default_launch( "docker start $container" ); + } + + /** + * Function to create and start the container if it does not exist. + */ + private function create_container( $container, $command = '' ) { + + $HOME = HOME; + + switch ( $container ) { + case 'traefik-proxy': + $command = "docker run -d -p 8080:8080 -p 80:80 -p 443:443 -v /var/run/docker.sock:/var/run/docker.sock -v /dev/null:/etc/traefik/traefik.toml --name ee4_traefik traefik --api --docker --docker.domain=docker.localhost --logLevel=DEBUG"; + break; + + case 'nginx-proxy': + $command = "docker run --name ee4_nginx-proxy -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v $HOME/.ee4/nginx/certs:/etc/nginx/certs -v $HOME/.ee4/nginx/dhparam:/etc/nginx/dhparam -v $HOME/.ee4/nginx/conf.d:/etc/nginx/conf.d -v $HOME/.ee4/nginx/htpasswd:/etc/nginx/htpasswd -v $HOME/.ee4/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v $HOME/.ee4:/app/ee4 dharmin/nginx-proxy"; + break; + + case 'wpredis': + $command = ""; + break; + } + + return default_launch( $command ); + } + + public static function create_network( $name ) { + return default_launch( "docker network create $name" ); + } + + public static function connect_network( $name, $connect_to ) { + return default_launch( "docker network connect $name $connect_to" ); + } + + public static function rm_network( $name ) { + return default_launch( "docker network rm $name" ); + } + + public static function disconnect_network( $name, $connected_to ) { + return default_launch( "docker network disconnect $name $connected_to" ); + } + + /** + * Function to start the containers. + */ + public static function docker_compose_up( $dir ) { + $chdir_return_code = chdir( $dir ); + if ( $chdir_return_code ) { + $docker_compose_up = EE::launch( "docker-compose up -d", false, true ); + default_debug( $docker_compose_up ); + + if ( $docker_compose_up->return_code ) { + throw new Exception( 'There was some error in docker-compose up.' ); + } + } else { + throw new Exception( 'Error in changing directory.' ); + } + } + + /** + * docker-compose down + */ + public static function docker_compose_down( $dir ) { + $chdir_return_code = chdir( $dir ); + if ( $chdir_return_code ) { + return default_launch( 'docker-compose down' ); + } + + return false; + } +} diff --git a/php/class-ee.php b/php/class-ee.php index 7784fd2df..70821c1b8 100644 --- a/php/class-ee.php +++ b/php/class-ee.php @@ -24,6 +24,8 @@ class EE { private static $db; + private static $docker; + private static $file_logger; /** @@ -1086,4 +1088,12 @@ public static function db() { return self::$db; } + + public static function docker() { + if ( empty( self::$docker ) ) { + self::$docker = new EE_DOCKER(); + } + + return self::$docker; + } } diff --git a/php/utils.php b/php/utils.php index e884e01b6..a594a06b4 100644 --- a/php/utils.php +++ b/php/utils.php @@ -1408,7 +1408,7 @@ function delem_log( $log_data ) { * * @param Object $launch EE::Launch command object */ -function launch_debug( $launch ) { +function default_debug( $launch ) { EE::debug( '-----------------------' ); EE::debug( "COMMAND: $launch->command" ); if ( ! empty( $launch->stdout ) ) { @@ -1420,3 +1420,17 @@ function launch_debug( $launch ) { EE::debug( "RETURN CODE: $launch->return_code" ); EE::debug( '-----------------------' ); } + +/** + * Default Launch command. + * + * @param Object $launch EE::Launch command object + */ +function default_launch( $command ) { + $launch = EE::launch( $command, false, true ); + default_debug( $launch ); + if ( ! $launch->return_code ) { + return true; + } + return false; +} diff --git a/templates/docker-compose.mustache b/templates/docker-compose.mustache new file mode 100644 index 000000000..1e08b8c96 --- /dev/null +++ b/templates/docker-compose.mustache @@ -0,0 +1,49 @@ +version: '3' + +services: + +{{#services}} + {{#service_name}} + {{name}}: + {{/service_name}} + {{#image}} + image: {{name}} + {{/image}} + {{#depends_on}} + depends_on: + - {{name}} + {{/depends_on}} + {{#restart}} + restart: {{name}} + {{/restart}} + {{#command}} + command: {{name}} + {{/command}} + {{#labels}} + labels: {{name}} + {{/labels}} + {{#volumes}} + volumes: + {{#vol}} + - "{{name}}" + {{/vol}} + {{/volumes}} + {{#environment}} + environment: + {{#env}} + - {{name}} + {{/env}} + {{/environment}} + {{#networks}} + networks: + - {{name}} + {{/networks}} + +{{/services}} + +{{#network}} +networks: + site-network: + external: + name: ${VIRTUAL_HOST} +{{/network}} \ No newline at end of file From d9cdba03ad8b6d65f2be08c76f4c42fb8200c331 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi Date: Wed, 4 Apr 2018 23:48:39 +0530 Subject: [PATCH 0050/1044] Add wpredis site-type --- ee4-config/wp/config/.env.deployer | 23 ------ ee4-config/wp/config/.env.example | 4 +- .../wp/config/nginx/common/locations.conf | 76 +++++++++++++++++++ ee4-config/wp/config/nginx/common/php.conf | 11 +++ .../wp/config/nginx/common/wpcommon.conf | 35 +++++++++ ee4-config/wp/config/nginx/default.conf | 11 +-- ee4-config/wp/docker-compose-traefik.yml | 68 ----------------- ee4-config/wp/docker-compose.yml | 67 ---------------- ee4-config/wpredis/config/.env.deployer | 23 ------ ee4-config/wpredis/config/.env.example | 4 +- .../config/nginx/common/locations.conf | 76 +++++++++++++++++++ .../wpredis/config/nginx/common/redis.conf | 57 ++++++++++++++ .../wpredis/config/nginx/common/wpcommon.conf | 35 +++++++++ ee4-config/wpredis/config/nginx/default.conf | 8 +- ee4-config/wpredis/docker-compose-traefik.yml | 68 ----------------- ee4-config/wpredis/docker-compose.yml | 67 ---------------- php/class-ee-docker.php | 16 ++-- php/init-ee.php | 2 +- 18 files changed, 314 insertions(+), 337 deletions(-) delete mode 100644 ee4-config/wp/config/.env.deployer create mode 100644 ee4-config/wp/config/nginx/common/locations.conf create mode 100644 ee4-config/wp/config/nginx/common/php.conf create mode 100644 ee4-config/wp/config/nginx/common/wpcommon.conf delete mode 100644 ee4-config/wp/docker-compose-traefik.yml delete mode 100644 ee4-config/wp/docker-compose.yml delete mode 100644 ee4-config/wpredis/config/.env.deployer create mode 100644 ee4-config/wpredis/config/nginx/common/locations.conf create mode 100644 ee4-config/wpredis/config/nginx/common/redis.conf create mode 100644 ee4-config/wpredis/config/nginx/common/wpcommon.conf delete mode 100644 ee4-config/wpredis/docker-compose-traefik.yml delete mode 100644 ee4-config/wpredis/docker-compose.yml diff --git a/ee4-config/wp/config/.env.deployer b/ee4-config/wp/config/.env.deployer deleted file mode 100644 index 4c772fef0..000000000 --- a/ee4-config/wp/config/.env.deployer +++ /dev/null @@ -1,23 +0,0 @@ -DB_NAME=database_name -DB_USER=database_user -DB_PASSWORD=database_password - -# Optional variables -DB_HOST=mysql -# DB_PREFIX=wp_ - -WP_ENV=development -WP_HOME=http://example.com -WP_SITEURL=${WP_HOME} - -# Generate your keys here: https://roots.io/salts.html -AUTH_KEY='generateme' -SECURE_AUTH_KEY='generateme' -LOGGED_IN_KEY='generateme' -NONCE_KEY='generateme' -AUTH_SALT='generateme' -SECURE_AUTH_SALT='generateme' -LOGGED_IN_SALT='generateme' -NONCE_SALT='generateme' -WP_CACHE_KEY_SALT='example.com:' #trailing `:` is important - diff --git a/ee4-config/wp/config/.env.example b/ee4-config/wp/config/.env.example index afab96d16..30c3cc7b2 100644 --- a/ee4-config/wp/config/.env.example +++ b/ee4-config/wp/config/.env.example @@ -5,4 +5,6 @@ MYSQL_PASSWORD=password WORDPRESS_DB_HOST=db VIRTUAL_HOST={V_HOST} -VIRTUAL_HOST_EMAIL=example@site1.test +VIRTUAL_HOST_EMAIL=example@{V_HOST} +USER_ID=1000 +GROUP_ID=1000 diff --git a/ee4-config/wp/config/nginx/common/locations.conf b/ee4-config/wp/config/nginx/common/locations.conf new file mode 100644 index 000000000..1a0f8b5c4 --- /dev/null +++ b/ee4-config/wp/config/nginx/common/locations.conf @@ -0,0 +1,76 @@ +# NGINX CONFIGURATION FOR COMMON LOCATION +# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee) +# Basic locations files +location = /favicon.ico { + access_log off; + log_not_found off; + expires max; +} + +location = /robots.txt { + # Some WordPress plugin gererate robots.txt file + # Refer #340 issue + + return 200 'User-agent: * +Disallow: /'; + access_log off; + log_not_found off; +} +# Cache static files +location ~* \.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf|swf)$ { + add_header "Access-Control-Allow-Origin" "*"; + access_log off; + log_not_found off; + expires max; +} +# Security settings for better privacy +# Deny hidden files +location /.well-known { + allow all; +} +location ~ /\. { + deny all; + access_log off; + log_not_found off; +} +# Deny backup extensions & log files +location ~* ^.+\.(bak|log|old|orig|original|php#|php~|php_bak|save|swo|swp|sql)$ { + deny all; + access_log off; + log_not_found off; +} +# Return 403 forbidden for readme.(txt|html) or license.(txt|html) or example.(txt|html) +if ($uri ~* "^.+(readme|license|example)\.(txt|html)$") { + return 403; +} +# Status pages +location /nginx_status { + stub_status on; + access_log off; + +} +location ~ ^/(status|ping) { + include fastcgi_params; + fastcgi_pass php:9000; + +} +# EasyEngine (ee) utilities +# phpMyAdmin settings +location /pma { + return 301 https://$host:22222/db/pma; +} +location /phpMyAdmin { + return 301 https://$host:22222/db/pma; +} +location /phpmyadmin { + return 301 https://$host:22222/db/pma; +} +# Adminer settings +location /adminer { + return 301 https://$host:22222/db/adminer; +} + +location ~* \.(css|js)$ { + expires 5s; + add_header Cache-Control "public, must-revalidate"; +} diff --git a/ee4-config/wp/config/nginx/common/php.conf b/ee4-config/wp/config/nginx/common/php.conf new file mode 100644 index 000000000..9b38372bb --- /dev/null +++ b/ee4-config/wp/config/nginx/common/php.conf @@ -0,0 +1,11 @@ +# PHP NGINX CONFIGURATION +# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee) +location / { + try_files $uri $uri/ /index.php?$args; +} +location ~ \.php$ { + try_files $uri =404; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + include fastcgi_params; + fastcgi_pass php:9000; +} diff --git a/ee4-config/wp/config/nginx/common/wpcommon.conf b/ee4-config/wp/config/nginx/common/wpcommon.conf new file mode 100644 index 000000000..be7795e1c --- /dev/null +++ b/ee4-config/wp/config/nginx/common/wpcommon.conf @@ -0,0 +1,35 @@ +# WordPress COMMON SETTINGS +# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee) +# Limit access to avoid brute force attack +location = /wp-login.php { + limit_req zone=one burst=1 nodelay; + include fastcgi_params; + fastcgi_pass php:9000; +} +# Disable wp-config.txt +location = /wp-config.txt { + deny all; + access_log off; + log_not_found off; +} +# Disallow php in upload folder +location /wp-content/uploads/ { + location ~ \.php$ { + #Prevent Direct Access Of PHP Files From Web Browsers + deny all; + } +} +# Yoast sitemap +location ~ ([^/]*)sitemap(.*)\.x(m|s)l$ { + rewrite ^/sitemap\.xml$ /sitemap_index.xml permanent; + rewrite ^/([a-z]+)?-?sitemap\.xsl$ /index.php?xsl=$1 last; + # Rules for yoast sitemap with wp|wpsubdir|wpsubdomain + rewrite ^.*/sitemap_index\.xml$ /index.php?sitemap=1 last; + rewrite ^.*/([^/]+?)-sitemap([0-9]+)?\.xml$ /index.php?sitemap=$1&sitemap_n=$2 last; + # Following lines are options. Needed for WordPress seo addons + rewrite ^/news_sitemap\.xml$ /index.php?sitemap=wpseo_news last; + rewrite ^/locations\.kml$ /index.php?sitemap=wpseo_local_kml last; + rewrite ^/geo_sitemap\.xml$ /index.php?sitemap=wpseo_local last; + rewrite ^/video-sitemap\.xsl$ /index.php?xsl=video last; + access_log off; +} diff --git a/ee4-config/wp/config/nginx/default.conf b/ee4-config/wp/config/nginx/default.conf index c8aab00a7..ac2169817 100644 --- a/ee4-config/wp/config/nginx/default.conf +++ b/ee4-config/wp/config/nginx/default.conf @@ -4,16 +4,13 @@ server { root /var/www/html; - server_name site1.test; + server_name _; index index.php index.html index.htm; - - # include common/redis-php7.conf; - - include common/php7.conf; - include common/wpcommon-php7.conf; - include common/locations-php7.conf; + include common/php.conf; + include common/wpcommon.conf; + include common/locations.conf; client_max_body_size 100m; } diff --git a/ee4-config/wp/docker-compose-traefik.yml b/ee4-config/wp/docker-compose-traefik.yml deleted file mode 100644 index 7b87eb314..000000000 --- a/ee4-config/wp/docker-compose-traefik.yml +++ /dev/null @@ -1,68 +0,0 @@ -version: '3' - -services: - mail: - image: mailhog/mailhog - restart: always - command: ["-invite-jim=false"] - labels: - - traefik.enable=false - environment: - - VIRTUAL_HOST=mail.${VIRTUAL_HOST} - - VIRTUAL_PORT=8025 - networks: - - site-network - - db: - image: mysql:latest - restart: always - volumes: - - "./app/db:/var/lib/mysql" - labels: - - traefik.enable=false - environment: - - MYSQL_ROOT_PASSWORD - - MYSQL_DATABASE - - MYSQL_USER - - MYSQL_PASSWORD - networks: - - site-network - - php: - image: rtcamp/wordpress - depends_on: - - db - restart: always - labels: - - traefik.enable=false - volumes: - - "./app/src:/var/www/html" - - "./config/php-fpm/php.ini:/usr/local/etc/php/php.ini" - environment: - - WORDPRESS_DB_HOST - - WORDPRESS_DB_USER=${MYSQL_USER} - - WORDPRESS_DB_PASSWORD=${MYSQL_PASSWORD} - networks: - - site-network - - nginx: - image: dharmin/nginx:latest - depends_on: - - php - restart: always - environment: - - VIRTUAL_HOST - labels: - - "traefik.backend=${VIRTUAL_HOST}" - - "traefik.frontend.rule=HostRegexp:${VIRTUAL_HOST},{subdomain:[-a-z0-9]+}.${VIRTUAL_HOST}" - volumes: - - "./app/src:/var/www/html" - - "./config/nginx/default.conf:/etc/nginx/conf.d/default.conf" - - "./logs/nginx:/var/log/nginx" - networks: - - site-network - -networks: - site-network: - external: - name: ${VIRTUAL_HOST} diff --git a/ee4-config/wp/docker-compose.yml b/ee4-config/wp/docker-compose.yml deleted file mode 100644 index 8aa243b68..000000000 --- a/ee4-config/wp/docker-compose.yml +++ /dev/null @@ -1,67 +0,0 @@ -version: '3' - -services: - mail: - image: mailhog/mailhog - restart: always - command: ["-invite-jim=false"] - environment: - - VIRTUAL_HOST=mail.${VIRTUAL_HOST} - - VIRTUAL_PORT=8025 - networks: - - site-network - - db: - image: mysql:latest - restart: always - volumes: - - "./app/db:/var/lib/mysql" - environment: - - MYSQL_ROOT_PASSWORD - - MYSQL_DATABASE - - MYSQL_USER - - MYSQL_PASSWORD - networks: - - site-network - - phpmyadmin: - image: phpmyadmin/phpmyadmin - restart: always - environment: - - VIRTUAL_HOST=pma.${VIRTUAL_HOST} - networks: - - site-network - - php: - image: wordpress/rtcamp - depends_on: - - db - restart: always - volumes: - - "./app/src:/var/www/html" - - "./config/php-fpm/php.ini:/usr/local/etc/php/php.ini" - environment: - - WORDPRESS_DB_HOST - - WORDPRESS_DB_USER=${MYSQL_USER} - - WORDPRESS_DB_PASSWORD=${MYSQL_PASSWORD} - networks: - - site-network - - nginx: - image: dharmin/nginx:latest - depends_on: - - php - restart: always - environment: - - VIRTUAL_HOST - volumes: - - "./app/src:/var/www/html" - - "./config/nginx/default.conf:/etc/nginx/conf.d/default.conf" - - "./logs/nginx:/var/log/nginx" - networks: - - site-network - -networks: - site-network: - external: - name: ${VIRTUAL_HOST} diff --git a/ee4-config/wpredis/config/.env.deployer b/ee4-config/wpredis/config/.env.deployer deleted file mode 100644 index 4c772fef0..000000000 --- a/ee4-config/wpredis/config/.env.deployer +++ /dev/null @@ -1,23 +0,0 @@ -DB_NAME=database_name -DB_USER=database_user -DB_PASSWORD=database_password - -# Optional variables -DB_HOST=mysql -# DB_PREFIX=wp_ - -WP_ENV=development -WP_HOME=http://example.com -WP_SITEURL=${WP_HOME} - -# Generate your keys here: https://roots.io/salts.html -AUTH_KEY='generateme' -SECURE_AUTH_KEY='generateme' -LOGGED_IN_KEY='generateme' -NONCE_KEY='generateme' -AUTH_SALT='generateme' -SECURE_AUTH_SALT='generateme' -LOGGED_IN_SALT='generateme' -NONCE_SALT='generateme' -WP_CACHE_KEY_SALT='example.com:' #trailing `:` is important - diff --git a/ee4-config/wpredis/config/.env.example b/ee4-config/wpredis/config/.env.example index afab96d16..30c3cc7b2 100644 --- a/ee4-config/wpredis/config/.env.example +++ b/ee4-config/wpredis/config/.env.example @@ -5,4 +5,6 @@ MYSQL_PASSWORD=password WORDPRESS_DB_HOST=db VIRTUAL_HOST={V_HOST} -VIRTUAL_HOST_EMAIL=example@site1.test +VIRTUAL_HOST_EMAIL=example@{V_HOST} +USER_ID=1000 +GROUP_ID=1000 diff --git a/ee4-config/wpredis/config/nginx/common/locations.conf b/ee4-config/wpredis/config/nginx/common/locations.conf new file mode 100644 index 000000000..1a0f8b5c4 --- /dev/null +++ b/ee4-config/wpredis/config/nginx/common/locations.conf @@ -0,0 +1,76 @@ +# NGINX CONFIGURATION FOR COMMON LOCATION +# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee) +# Basic locations files +location = /favicon.ico { + access_log off; + log_not_found off; + expires max; +} + +location = /robots.txt { + # Some WordPress plugin gererate robots.txt file + # Refer #340 issue + + return 200 'User-agent: * +Disallow: /'; + access_log off; + log_not_found off; +} +# Cache static files +location ~* \.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf|swf)$ { + add_header "Access-Control-Allow-Origin" "*"; + access_log off; + log_not_found off; + expires max; +} +# Security settings for better privacy +# Deny hidden files +location /.well-known { + allow all; +} +location ~ /\. { + deny all; + access_log off; + log_not_found off; +} +# Deny backup extensions & log files +location ~* ^.+\.(bak|log|old|orig|original|php#|php~|php_bak|save|swo|swp|sql)$ { + deny all; + access_log off; + log_not_found off; +} +# Return 403 forbidden for readme.(txt|html) or license.(txt|html) or example.(txt|html) +if ($uri ~* "^.+(readme|license|example)\.(txt|html)$") { + return 403; +} +# Status pages +location /nginx_status { + stub_status on; + access_log off; + +} +location ~ ^/(status|ping) { + include fastcgi_params; + fastcgi_pass php:9000; + +} +# EasyEngine (ee) utilities +# phpMyAdmin settings +location /pma { + return 301 https://$host:22222/db/pma; +} +location /phpMyAdmin { + return 301 https://$host:22222/db/pma; +} +location /phpmyadmin { + return 301 https://$host:22222/db/pma; +} +# Adminer settings +location /adminer { + return 301 https://$host:22222/db/adminer; +} + +location ~* \.(css|js)$ { + expires 5s; + add_header Cache-Control "public, must-revalidate"; +} diff --git a/ee4-config/wpredis/config/nginx/common/redis.conf b/ee4-config/wpredis/config/nginx/common/redis.conf new file mode 100644 index 000000000..5bf2d2f29 --- /dev/null +++ b/ee4-config/wpredis/config/nginx/common/redis.conf @@ -0,0 +1,57 @@ +# Redis NGINX CONFIGURATION +# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee) +set $skip_cache 0; +# POST requests and URL with a query string should always go to php +if ($request_method = POST) { + set $skip_cache 1; +} +if ($query_string != "") { + set $skip_cache 1; +} +# Don't cache URL containing the following segments +if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|wp-.*.php|index.php|/feed/|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") { + set $skip_cache 1; +} +# Don't use the cache for logged in users or recent commenter or customer with items in cart +if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|woocommerce_items_in_cart") { + set $skip_cache 1; +} +# Use cached or actual file if they exists, Otherwise pass request to WordPress +location / { + try_files $uri $uri/ /index.php?$args; +} + +location /redis-fetch { + internal ; + set $redis_key $args; + redis_pass ee4_redis:6379; +} +location /redis-store { + internal ; + set_unescape_uri $key $arg_key ; + redis2_query set $key $echo_request_body; + redis2_query expire $key 14400; + redis2_pass ee4_redis:6379; +} + +location ~ \.php$ { +# add_header Cache-Control "max-age=0, no-cache, no-store, must-revalidate"; + set $key "nginx-cache:$scheme$request_method$host$request_uri"; + try_files $uri =404; + + srcache_fetch_skip $skip_cache; + srcache_store_skip $skip_cache; + + srcache_response_cache_control off; + + set_escape_uri $escaped_key $key; + + srcache_fetch GET /redis-fetch $key; + srcache_store PUT /redis-store key=$escaped_key; + + more_set_headers 'X-SRCache-Fetch-Status $srcache_fetch_status'; + more_set_headers 'X-SRCache-Store-Status $srcache_store_status'; + + include fastcgi_params; + fastcgi_pass php:9000; +} diff --git a/ee4-config/wpredis/config/nginx/common/wpcommon.conf b/ee4-config/wpredis/config/nginx/common/wpcommon.conf new file mode 100644 index 000000000..be7795e1c --- /dev/null +++ b/ee4-config/wpredis/config/nginx/common/wpcommon.conf @@ -0,0 +1,35 @@ +# WordPress COMMON SETTINGS +# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee) +# Limit access to avoid brute force attack +location = /wp-login.php { + limit_req zone=one burst=1 nodelay; + include fastcgi_params; + fastcgi_pass php:9000; +} +# Disable wp-config.txt +location = /wp-config.txt { + deny all; + access_log off; + log_not_found off; +} +# Disallow php in upload folder +location /wp-content/uploads/ { + location ~ \.php$ { + #Prevent Direct Access Of PHP Files From Web Browsers + deny all; + } +} +# Yoast sitemap +location ~ ([^/]*)sitemap(.*)\.x(m|s)l$ { + rewrite ^/sitemap\.xml$ /sitemap_index.xml permanent; + rewrite ^/([a-z]+)?-?sitemap\.xsl$ /index.php?xsl=$1 last; + # Rules for yoast sitemap with wp|wpsubdir|wpsubdomain + rewrite ^.*/sitemap_index\.xml$ /index.php?sitemap=1 last; + rewrite ^.*/([^/]+?)-sitemap([0-9]+)?\.xml$ /index.php?sitemap=$1&sitemap_n=$2 last; + # Following lines are options. Needed for WordPress seo addons + rewrite ^/news_sitemap\.xml$ /index.php?sitemap=wpseo_news last; + rewrite ^/locations\.kml$ /index.php?sitemap=wpseo_local_kml last; + rewrite ^/geo_sitemap\.xml$ /index.php?sitemap=wpseo_local last; + rewrite ^/video-sitemap\.xsl$ /index.php?xsl=video last; + access_log off; +} diff --git a/ee4-config/wpredis/config/nginx/default.conf b/ee4-config/wpredis/config/nginx/default.conf index 90ae77de3..d088a4e02 100644 --- a/ee4-config/wpredis/config/nginx/default.conf +++ b/ee4-config/wpredis/config/nginx/default.conf @@ -4,15 +4,15 @@ server { root /var/www/html; - server_name site1.test; + server_name _; index index.php index.html index.htm; - include common/redis-php7.conf; + include common/redis.conf; - include common/wpcommon-php7.conf; - include common/locations-php7.conf; + include common/wpcommon.conf; + include common/locations.conf; client_max_body_size 100m; } diff --git a/ee4-config/wpredis/docker-compose-traefik.yml b/ee4-config/wpredis/docker-compose-traefik.yml deleted file mode 100644 index 7b87eb314..000000000 --- a/ee4-config/wpredis/docker-compose-traefik.yml +++ /dev/null @@ -1,68 +0,0 @@ -version: '3' - -services: - mail: - image: mailhog/mailhog - restart: always - command: ["-invite-jim=false"] - labels: - - traefik.enable=false - environment: - - VIRTUAL_HOST=mail.${VIRTUAL_HOST} - - VIRTUAL_PORT=8025 - networks: - - site-network - - db: - image: mysql:latest - restart: always - volumes: - - "./app/db:/var/lib/mysql" - labels: - - traefik.enable=false - environment: - - MYSQL_ROOT_PASSWORD - - MYSQL_DATABASE - - MYSQL_USER - - MYSQL_PASSWORD - networks: - - site-network - - php: - image: rtcamp/wordpress - depends_on: - - db - restart: always - labels: - - traefik.enable=false - volumes: - - "./app/src:/var/www/html" - - "./config/php-fpm/php.ini:/usr/local/etc/php/php.ini" - environment: - - WORDPRESS_DB_HOST - - WORDPRESS_DB_USER=${MYSQL_USER} - - WORDPRESS_DB_PASSWORD=${MYSQL_PASSWORD} - networks: - - site-network - - nginx: - image: dharmin/nginx:latest - depends_on: - - php - restart: always - environment: - - VIRTUAL_HOST - labels: - - "traefik.backend=${VIRTUAL_HOST}" - - "traefik.frontend.rule=HostRegexp:${VIRTUAL_HOST},{subdomain:[-a-z0-9]+}.${VIRTUAL_HOST}" - volumes: - - "./app/src:/var/www/html" - - "./config/nginx/default.conf:/etc/nginx/conf.d/default.conf" - - "./logs/nginx:/var/log/nginx" - networks: - - site-network - -networks: - site-network: - external: - name: ${VIRTUAL_HOST} diff --git a/ee4-config/wpredis/docker-compose.yml b/ee4-config/wpredis/docker-compose.yml deleted file mode 100644 index 8aa243b68..000000000 --- a/ee4-config/wpredis/docker-compose.yml +++ /dev/null @@ -1,67 +0,0 @@ -version: '3' - -services: - mail: - image: mailhog/mailhog - restart: always - command: ["-invite-jim=false"] - environment: - - VIRTUAL_HOST=mail.${VIRTUAL_HOST} - - VIRTUAL_PORT=8025 - networks: - - site-network - - db: - image: mysql:latest - restart: always - volumes: - - "./app/db:/var/lib/mysql" - environment: - - MYSQL_ROOT_PASSWORD - - MYSQL_DATABASE - - MYSQL_USER - - MYSQL_PASSWORD - networks: - - site-network - - phpmyadmin: - image: phpmyadmin/phpmyadmin - restart: always - environment: - - VIRTUAL_HOST=pma.${VIRTUAL_HOST} - networks: - - site-network - - php: - image: wordpress/rtcamp - depends_on: - - db - restart: always - volumes: - - "./app/src:/var/www/html" - - "./config/php-fpm/php.ini:/usr/local/etc/php/php.ini" - environment: - - WORDPRESS_DB_HOST - - WORDPRESS_DB_USER=${MYSQL_USER} - - WORDPRESS_DB_PASSWORD=${MYSQL_PASSWORD} - networks: - - site-network - - nginx: - image: dharmin/nginx:latest - depends_on: - - php - restart: always - environment: - - VIRTUAL_HOST - volumes: - - "./app/src:/var/www/html" - - "./config/nginx/default.conf:/etc/nginx/conf.d/default.conf" - - "./logs/nginx:/var/log/nginx" - networks: - - site-network - -networks: - site-network: - external: - name: ${VIRTUAL_HOST} diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php index f25e57d2d..0730a8eb8 100644 --- a/php/class-ee-docker.php +++ b/php/class-ee-docker.php @@ -32,7 +32,7 @@ public static function create_docker_composer( array $filters = [] ) { ///////////////PHP////////////////////// $php['service_name'] = array( 'name' => 'php' ); - $php['image'] = array( 'name' => 'rtcamp/wordpress' ); + $php['image'] = array( 'name' => 'dharmin/wordpress' ); $php['depends_on'] = array( 'name' => 'db' ); $php['restart'] = $restart_default; $php['volumes'] = array( array( 'vol' => array( array( 'name' => './app/src:/var/www/html' ), array( 'name' => './config/php-fpm/php.ini:/usr/local/etc/php/php.ini' ) ) ) ); @@ -41,6 +41,8 @@ public static function create_docker_composer( array $filters = [] ) { array( 'name' => 'WORDPRESS_DB_HOST' ), array( 'name' => 'WORDPRESS_DB_USER=${MYSQL_USER}' ), array( 'name' => 'WORDPRESS_DB_PASSWORD=${MYSQL_PASSWORD}' ), + array( 'name' => 'USER_ID=${USER_ID}' ), + array( 'name' => 'GROUP_ID=${GROUP_ID}' ), ), ); $php['networks'] = $network_default; @@ -48,7 +50,7 @@ public static function create_docker_composer( array $filters = [] ) { ///////////////nginx////////////////////// $nginx['service_name'] = array( 'name' => 'nginx' ); - $nginx['image'] = array( 'name' => 'nginx:latest' ); + $nginx['image'] = array( 'name' => 'dharmin/nginx:latest' ); $nginx['depends_on'] = array( 'name' => 'php' ); $nginx['restart'] = $restart_default; if ( in_array( 'le', $filters ) ) { @@ -56,7 +58,7 @@ public static function create_docker_composer( array $filters = [] ) { } else { $nginx['environment'] = array( 'env' => array( array( 'name' => 'VIRTUAL_HOST' ) ) ); } - $nginx['volumes'] = array( array( 'vol' => array( array( 'name' => './app/src:/var/www/html' ), array( 'name' => './config/nginx/default.conf:/etc/nginx/conf.d/default.conf' ), array( 'name' => './logs/nginx:/var/log/nginx' ) ) ) ); + $nginx['volumes'] = array( array( 'vol' => array( array( 'name' => './app/src:/var/www/html' ), array( 'name' => './config/nginx/default.conf:/etc/nginx/conf.d/default.conf' ), array( 'name' => './logs/nginx:/var/log/nginx' ), array('name'=>'./config/nginx/common:/usr/local/openresty/nginx/conf/common') ) ) ); $nginx['networks'] = $network_default; ///////////////phpmyadmin////////////////////// @@ -138,16 +140,16 @@ private function create_container( $container, $command = '' ) { $HOME = HOME; switch ( $container ) { - case 'traefik-proxy': + case 'ee4_traefik-proxy': $command = "docker run -d -p 8080:8080 -p 80:80 -p 443:443 -v /var/run/docker.sock:/var/run/docker.sock -v /dev/null:/etc/traefik/traefik.toml --name ee4_traefik traefik --api --docker --docker.domain=docker.localhost --logLevel=DEBUG"; break; - case 'nginx-proxy': + case 'ee4_nginx-proxy': $command = "docker run --name ee4_nginx-proxy -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v $HOME/.ee4/nginx/certs:/etc/nginx/certs -v $HOME/.ee4/nginx/dhparam:/etc/nginx/dhparam -v $HOME/.ee4/nginx/conf.d:/etc/nginx/conf.d -v $HOME/.ee4/nginx/htpasswd:/etc/nginx/htpasswd -v $HOME/.ee4/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v $HOME/.ee4:/app/ee4 dharmin/nginx-proxy"; break; - case 'wpredis': - $command = ""; + case 'ee4_redis': + $command = "docker run --name ee4_redis -d --restart=always dharmin/redis"; break; } diff --git a/php/init-ee.php b/php/init-ee.php index fbe65e58e..6a20e06b2 100644 --- a/php/init-ee.php +++ b/php/init-ee.php @@ -6,7 +6,7 @@ define( 'EE_START_MICROTIME', microtime( true ) ); define( 'HOME', $_SERVER['HOME'] ); define( 'EE_CONF_ROOT', HOME . '/.ee4' ); -define( 'EE_SITE_CONF_ROOT', EE_ROOT . '/ee4-config/' ); +define( 'EE_SITE_CONF_ROOT', EE_ROOT . '/ee4-config' ); if ( file_exists( EE_ROOT . '/vendor/autoload.php' ) ) { define( 'EE_VENDOR_DIR', EE_ROOT . '/vendor' ); From afad101f85001b02d9a86c337ff16d591326f9bf Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi Date: Thu, 5 Apr 2018 14:49:11 +0530 Subject: [PATCH 0051/1044] Rename docker compose function. Rename image names. Remove traefik. Add phpdoc comments. --- php/class-ee-docker.php | 91 +++++++++++++++++++++++++++++++++-------- 1 file changed, 73 insertions(+), 18 deletions(-) diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php index 0730a8eb8..35119c77e 100644 --- a/php/class-ee-docker.php +++ b/php/class-ee-docker.php @@ -8,16 +8,22 @@ class EE_DOCKER { /** * Generate docker-compose.yml according to requirement. + * + * @param array $filters Array of flags to determine the docker-compose.yml generation. + * Empty/Default -> Generates default WordPress docker-compose.yml + * ['le'] -> Enables letsencrypt in the generation. + * + * @return String docker-compose.yml content string. */ - public static function create_docker_composer( array $filters = [] ) { + public static function generate_docker_composer_yml( array $filters = [] ) { $base = array(); $restart_default = array( 'name' => 'always' ); $network_default = array( 'name' => 'site-network' ); - //////////////////DB///////////////////// + // db configuration. $db['service_name'] = array( 'name' => 'db' ); - $db['image'] = array( 'name' => 'mysql:latest' ); + $db['image'] = array( 'name' => 'easyengine/mysql' ); $db['restart'] = $restart_default; $db['volumes'] = array( array( 'vol' => array( 'name' => './app/db:/var/lib/mysql' ) ) ); $db['environment'] = array( @@ -30,9 +36,9 @@ public static function create_docker_composer( array $filters = [] ) { ); $db['networks'] = $network_default; - ///////////////PHP////////////////////// + // PHP configuration. $php['service_name'] = array( 'name' => 'php' ); - $php['image'] = array( 'name' => 'dharmin/wordpress' ); + $php['image'] = array( 'name' => 'easyengine/php' ); $php['depends_on'] = array( 'name' => 'db' ); $php['restart'] = $restart_default; $php['volumes'] = array( array( 'vol' => array( array( 'name' => './app/src:/var/www/html' ), array( 'name' => './config/php-fpm/php.ini:/usr/local/etc/php/php.ini' ) ) ) ); @@ -48,9 +54,9 @@ public static function create_docker_composer( array $filters = [] ) { $php['networks'] = $network_default; - ///////////////nginx////////////////////// + // nginx configuration.. $nginx['service_name'] = array( 'name' => 'nginx' ); - $nginx['image'] = array( 'name' => 'dharmin/nginx:latest' ); + $nginx['image'] = array( 'name' => 'easyengine/nginx' ); $nginx['depends_on'] = array( 'name' => 'php' ); $nginx['restart'] = $restart_default; if ( in_array( 'le', $filters ) ) { @@ -58,19 +64,19 @@ public static function create_docker_composer( array $filters = [] ) { } else { $nginx['environment'] = array( 'env' => array( array( 'name' => 'VIRTUAL_HOST' ) ) ); } - $nginx['volumes'] = array( array( 'vol' => array( array( 'name' => './app/src:/var/www/html' ), array( 'name' => './config/nginx/default.conf:/etc/nginx/conf.d/default.conf' ), array( 'name' => './logs/nginx:/var/log/nginx' ), array('name'=>'./config/nginx/common:/usr/local/openresty/nginx/conf/common') ) ) ); + $nginx['volumes'] = array( array( 'vol' => array( array( 'name' => './app/src:/var/www/html' ), array( 'name' => './config/nginx/default.conf:/etc/nginx/conf.d/default.conf' ), array( 'name' => './logs/nginx:/var/log/nginx' ), array( 'name' => './config/nginx/common:/usr/local/openresty/nginx/conf/common' ) ) ) ); $nginx['networks'] = $network_default; - ///////////////phpmyadmin////////////////////// + // PhpMyAdmin configuration. $phpmyadmin['service_name'] = array( 'name' => 'phpmyadmin' ); - $phpmyadmin['image'] = array( 'name' => 'phpmyadmin/phpmyadmin' ); + $phpmyadmin['image'] = array( 'name' => 'easyengine/phpmyadmin' ); $phpmyadmin['restart'] = $restart_default; $phpmyadmin['environment'] = array( 'env' => array( array( 'name' => 'VIRTUAL_HOST=pma.${VIRTUAL_HOST}' ) ) ); $phpmyadmin['networks'] = $network_default; - ///////////////mail////////////////////// + // mailhog configuration. $mail['service_name'] = array( 'name' => 'mail' ); - $mail['image'] = array( 'name' => 'mailhog/mailhog' ); + $mail['image'] = array( 'name' => 'easyengine/mailhog' ); $mail['restart'] = $restart_default; $mail['command'] = array( 'name' => '["-invite-jim=false"]' ); if ( in_array( 'le', $filters ) ) { @@ -96,6 +102,13 @@ public static function create_docker_composer( array $filters = [] ) { return $docker_compose_yml; } + /** + * Check and Start or create container if not running. + * + * @param String $container Name of the + * + * @return bool success. + */ public static function boot_container( $container ) { $status = self::container_status( $container ); if ( $status ) { @@ -126,7 +139,9 @@ public static function container_status( $container ) { /** * Function to start the container if it exists but is not running. * - * @param String $container Container to be started + * @param String $container Container to be started. + * + * @return bool success. */ public static function start_container( $container ) { return default_launch( "docker start $container" ); @@ -134,15 +149,17 @@ public static function start_container( $container ) { /** * Function to create and start the container if it does not exist. + * + * @param String $container Container to be created. + * @param String $command Command to launch the container. + * + * @return bool success. */ private function create_container( $container, $command = '' ) { $HOME = HOME; switch ( $container ) { - case 'ee4_traefik-proxy': - $command = "docker run -d -p 8080:8080 -p 80:80 -p 443:443 -v /var/run/docker.sock:/var/run/docker.sock -v /dev/null:/etc/traefik/traefik.toml --name ee4_traefik traefik --api --docker --docker.domain=docker.localhost --logLevel=DEBUG"; - break; case 'ee4_nginx-proxy': $command = "docker run --name ee4_nginx-proxy -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v $HOME/.ee4/nginx/certs:/etc/nginx/certs -v $HOME/.ee4/nginx/dhparam:/etc/nginx/dhparam -v $HOME/.ee4/nginx/conf.d:/etc/nginx/conf.d -v $HOME/.ee4/nginx/htpasswd:/etc/nginx/htpasswd -v $HOME/.ee4/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v $HOME/.ee4:/app/ee4 dharmin/nginx-proxy"; @@ -156,24 +173,58 @@ private function create_container( $container, $command = '' ) { return default_launch( $command ); } + /** + * Create docker network. + * + * @param String $name Name of the network to be created. + * + * @return bool success. + */ public static function create_network( $name ) { return default_launch( "docker network create $name" ); } + /** + * Connect to given docker network. + * + * @param String $name Name of the network that has to be connected. + * @param String $connect_to Name of the network to which connection has to be established. + * + * @return bool success. + */ public static function connect_network( $name, $connect_to ) { return default_launch( "docker network connect $name $connect_to" ); } + /** + * Remove docker network. + * + * @param String $name Name of the network to be removed. + * + * @return bool success. + */ public static function rm_network( $name ) { return default_launch( "docker network rm $name" ); } + /** + * Disconnect docker network. + * + * @param String $name Name of the network to be disconnected. + * @param String $connected_to Name of the network from which it has to be disconnected. + * + * @return bool success. + */ public static function disconnect_network( $name, $connected_to ) { return default_launch( "docker network disconnect $name $connected_to" ); } /** - * Function to start the containers. + * Function to boot the containers. + * + * @param String $dir Path to docker-compose.yml. + * + * @return bool success. */ public static function docker_compose_up( $dir ) { $chdir_return_code = chdir( $dir ); @@ -190,7 +241,11 @@ public static function docker_compose_up( $dir ) { } /** - * docker-compose down + * Function to destroy the containers. + * + * @param String $dir Path to docker-compose.yml. + * + * @return bool success. */ public static function docker_compose_down( $dir ) { $chdir_return_code = chdir( $dir ); From 537f71173bd9dbc130596416012e3b5b7b5f7257 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi Date: Thu, 5 Apr 2018 20:09:14 +0530 Subject: [PATCH 0052/1044] Update README and composer.json --- README.md | 164 +++++++++++++++++++++++++++++++++++++++++++++++--- composer.json | 18 +++--- 2 files changed, 164 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index fd660fe89..289ba3973 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ -EEv4 -====== +# EEv4 ## Requirements @@ -9,23 +8,23 @@ EEv4 ## Installing -Once you've verified requirements, download the [ee4.phar](https://raw.githubusercontent.com/mrrobot47/ee4-builds/master/ee4.phar) file using `wget` or `curl`: +Once you've verified requirements, download the [easyengine.phar](https://raw.githubusercontent.com/easyengine/easyengine-builds/master/easyengine.phar) file using `wget` or `curl`: ```bash -curl -O https://raw.githubusercontent.com/mrrobot47/ee4-builds/master/ee4.phar +curl -O https://raw.githubusercontent.com/easyengine/easyengine-builds/master/easyengine.phar ``` Next, check the Phar file to verify that it's working: ```bash -php ee4.phar cli info +php easyengine.phar cli info ``` To use EEv4 from the command line by typing `ee4`, make the file executable and move it to somewhere in your PATH. For example: ```bash -chmod +x ee4.phar -sudo mv ee4.phar /usr/local/bin/ee4 +chmod +x easyengine.phar +sudo mv easyengine.phar /usr/local/bin/ee4 ``` If EE was installed successfully, you should see something like this when you run `ee4 cli version`: @@ -34,3 +33,154 @@ If EE was installed successfully, you should see something like this when you ru $ ee4 cli version EE 0.0.1 ``` + +## Commands + +### ee4 site + +Creates, lists and deletes WordPress websites. + +~~~ +ee4 site +~~~ + + +**EXAMPLES** + + # Create simple WordPress website. No parameter flag defaults to --wp + $ ee4 site create site.test + Success: ee4_nginx-proxy container launched successfully. + Configuring project... + Creating WordPress site site.test... + Copying configuration files... + Success: Configuration files copied. + Updating configuration files... + Success: Configuration files updated. + Success: Network started. + Success: Site connected to ee4_nginx-proxy. + Success: Host entry successfully added. + Checking and verifying site-up status. This may take some time. + .......... + Installing WordPress site... + Success: http://site.test has been created successfully! + Access phpMyAdmin : pma.site.test + Access mail : mail.site.test + Site Title : site.test + Username : admin + Password : DrwKpMsaGiuI + DB Password : Si23era8cnmR + E-Mail : mail@site.test + Site entry created. + + $ ee4 site create site2.test --wpredis --user=admin --pass=admin --email=admin@admin.example --title="Site by EasyEngine" + Configuring project... + Creating WordPress site site2.test... + Copying configuration files... + Success: Configuration files copied. + Updating configuration files... + Success: Configuration files updated. + Success: Network started. + Success: Site connected to ee4_nginx-proxy. + Success: Site connected to ee4_redis. + Success: Host entry successfully added. + Checking and verifying site-up status. This may take some time. + .......... + Installing WordPress site... + Success: http://site2.test has been created successfully! + Access phpMyAdmin : pma.site2.test + Access mail : mail.site2.test + Site Title : Site by EasyEngine + Username : admin + Password : admin + DB Password : B4B6ggCBcJyE + E-Mail : admin@admin.example + Site entry created. + + $ ee4 site list + List of Sites: + + - site.test + - site2.test + + $ ee4 site delete site.test + [site.test] Docker Containers removed. + [site.test] Disconnected from Docker network nginx-proxy + [site.test] Docker network nginx-proxy removed. + [sudo] password for mrrobot: + [site.test] site root removed. + Removing database entry. + Site site.test deleted. + +### ee4 site create + +~~~ +ee4 site create [--wp|--wpredis] [--letsencrypt] [--title=] [--user=<username>] [--pass=<password>] [--email=<email>] +~~~ + +Creates WordPress site. + +**OPTIONS** + + [--wp] + Creates simple WordPress website. + + [--wpredis] + Creates WordPress website with Redis caching. + + [--letsencrypt] + Generates letsencrypt certificates for the site. + + [--title=<title>] + Title of website. + + [--user=<username>] + Username of the WordPress administrator. + + [--pass=<password>] + Password for the WordPress administrator. + + [--email=<email>] + E-Mail of the WordPress administrator. + +### ee4 site list + +~~~ +ee4 site list +~~~ + +Lists all the sites created by EasyEngine. + +### ee4 site delete + +~~~ +ee4 site delete <site-name> +~~~ + +Deletes the given site if it was created by EasyEngine. + +### ee4 wp + +Run all the wp commands for site created by EasyEngine. + +~~~ +ee4 wp +~~~ + +### Usage + +~~~ +ee4 wp <site-name> <wp-command> +~~~ + +**EXAMPLES** + + $ ee4 wp site.test plugin list + +---------+----------+-----------+---------+ + | name | status | update | version | + +---------+----------+-----------+---------+ + | akismet | inactive | available | 4.0.2 | + | hello | inactive | none | 1.6 | + +---------+----------+-----------+---------+ + + $ ee4 wp site.test user create author1 author1@site.test --user_pass=password --role=administrator + Success: Created user 2. \ No newline at end of file diff --git a/composer.json b/composer.json index dc270ac83..1e6a0c050 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "mrrobot47/ee", + "name": "easyengine/easyengine", "description": "The command line interface for EasyEngine", "keywords": [ "cli", @@ -8,12 +8,11 @@ "homepage": "https://easyengine.io", "license": "MIT", "support": { - "issues": "https://github.com/mrrobot47/ee4/issues", - "source": "https://github.com/mrrobot47/ee4", - "docs": "https://make.wordpress.org/cli/handbook/" + "issues": "https://github.com/easyengine/easyengine/issues", + "source": "https://github.com/easyengine/easyengine", + "docs": "https://easyengine.io/docs/" }, "bin": [ - "bin/ee.bat", "bin/ee" ], "config": { @@ -28,8 +27,8 @@ "php": ">=5.3.29", "composer/composer": "^1.2.0", "composer/semver": "~1.0", - "mrrobot47/site-command": "1.3", - "mrrobot47/wp-command": "^1.0", + "easyengine/site-command": "^1.0.0", + "easyengine/wp-command": "^1.0.0", "justinrainbow/json-schema": "~5.2.5", "monolog/monolog": "^1.23", "mustache/mustache": "~2.4", @@ -66,10 +65,7 @@ }, "psr-4": { "": "php/commands/src" - }, - "files": [ - "php/class-ee-db.php" - ] + } }, "extra": { "branch-alias": { From 7932b8ccb8c1eb73548a9e0a363c495bf4e83e9e Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Fri, 6 Apr 2018 15:54:38 +0530 Subject: [PATCH 0053/1044] Remove travis and contributing files --- .travis.yml | 73 ------------------------------------------------- CONTRIBUTING.md | 10 ------- 2 files changed, 83 deletions(-) delete mode 100644 .travis.yml delete mode 100644 CONTRIBUTING.md diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 783bbb82f..000000000 --- a/.travis.yml +++ /dev/null @@ -1,73 +0,0 @@ -sudo: required -services: - - docker - -language: php - -notifications: - email: - on_success: never - on_failure: change - -branches: - only: - - master - -cache: - directories: - - $HOME/.composer/cache - -env: - global: - - PATH="$TRAVIS_BUILD_DIR/vendor/bin:$PATH" - - DOCKER_COMPOSE_VERSION=1.20.1 - -matrix: - include: - - php: 7.2 - -before_install: - - | - # Remove Xdebug for a huge performance increase: - if [ -f ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini ]; then - phpenv config-rm xdebug.ini - else - echo "xdebug.ini does not exist" - fi - - sudo rm /usr/local/bin/docker-compose - - curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose - - chmod +x docker-compose - - sudo mv docker-compose /usr/local/bin - - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - - - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" - - sudo apt-get update - - sudo apt-get -y install docker-ce - -install: - - composer install - -before_script: - - composer validate - - pwd && ls -al - -script: - - pwd && ls -al - - docker --version - - docker-compose --version - - bin/ee site create test.test --debug - # - vendor/bin/behat - - - mkdir test1 - - cp -R ~/build/mrrobot47/ee4/ee4-config/wp/* test1/ - - cd test1 - # - mv config/.env.example .env - # - sed -i 's/VIRTUAL_HOST=.*/VIRTUAL_HOST=site1.test/' .env - # - pwd && ls -al - # - docker network create site1.test - # - docker-compose up -d - - docker info - -after_script: - - pwd && ls -al - - ls -al ~/.ee4 - - cat ~/.ee4/ee4.log diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 3b735102e..000000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,10 +0,0 @@ -Contributing -============ - -Welcome and thanks! - -We appreciate you taking the initiative to contribute to EE. It’s because of you, and the community around you, that EE is such a great project. - -**Contributing isn’t limited to just code.** We encourage you to contribute in the way that best fits your abilities, by writing tutorials, giving a demo at your local meetup, helping other users with their support questions, or revising our documentation. - -Read through our [contributing guidelines in the handbook](https://make.wordpress.org/cli/handbook/contributing/) for a thorough introduction to how you can get involved. Following these guidelines helps to communicate that you respect the time of other contributors on the project. In turn, they’ll do their best to reciprocate that respect when working with you, across timezones and around the world. From 2f3ce478f44cf52970806a797b55958db2fd327b Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Fri, 6 Apr 2018 16:04:29 +0530 Subject: [PATCH 0054/1044] Update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 289ba3973..2e88a0b9e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# EEv4 +# EasyEngine v4 ## Requirements From ec52cf828761bdc33c3911ac0132cf4fbbac2919 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Fri, 6 Apr 2018 16:05:05 +0530 Subject: [PATCH 0055/1044] Update docker image names --- php/class-ee-docker.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php index 35119c77e..61cc74355 100644 --- a/php/class-ee-docker.php +++ b/php/class-ee-docker.php @@ -23,7 +23,7 @@ public static function generate_docker_composer_yml( array $filters = [] ) { // db configuration. $db['service_name'] = array( 'name' => 'db' ); - $db['image'] = array( 'name' => 'easyengine/mysql' ); + $db['image'] = array( 'name' => 'easyengine/mariadb' ); $db['restart'] = $restart_default; $db['volumes'] = array( array( 'vol' => array( 'name' => './app/db:/var/lib/mysql' ) ) ); $db['environment'] = array( @@ -76,7 +76,7 @@ public static function generate_docker_composer_yml( array $filters = [] ) { // mailhog configuration. $mail['service_name'] = array( 'name' => 'mail' ); - $mail['image'] = array( 'name' => 'easyengine/mailhog' ); + $mail['image'] = array( 'name' => 'easyengine/mail' ); $mail['restart'] = $restart_default; $mail['command'] = array( 'name' => '["-invite-jim=false"]' ); if ( in_array( 'le', $filters ) ) { @@ -162,11 +162,11 @@ private function create_container( $container, $command = '' ) { switch ( $container ) { case 'ee4_nginx-proxy': - $command = "docker run --name ee4_nginx-proxy -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v $HOME/.ee4/nginx/certs:/etc/nginx/certs -v $HOME/.ee4/nginx/dhparam:/etc/nginx/dhparam -v $HOME/.ee4/nginx/conf.d:/etc/nginx/conf.d -v $HOME/.ee4/nginx/htpasswd:/etc/nginx/htpasswd -v $HOME/.ee4/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v $HOME/.ee4:/app/ee4 dharmin/nginx-proxy"; + $command = "docker run --name ee4_nginx-proxy -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v $HOME/.ee4/nginx/certs:/etc/nginx/certs -v $HOME/.ee4/nginx/dhparam:/etc/nginx/dhparam -v $HOME/.ee4/nginx/conf.d:/etc/nginx/conf.d -v $HOME/.ee4/nginx/htpasswd:/etc/nginx/htpasswd -v $HOME/.ee4/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v $HOME/.ee4:/app/ee4 easyengine/nginx-proxy"; break; case 'ee4_redis': - $command = "docker run --name ee4_redis -d --restart=always dharmin/redis"; + $command = "docker run --name ee4_redis -d --restart=always easyengine/redis"; break; } From a545e8fc80931d407519a3a91a605df1203f0ebd Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Fri, 6 Apr 2018 22:18:00 +0530 Subject: [PATCH 0056/1044] Update to EasyEngine packages --- php/EE/AutoloadSplitter.php | 2 +- utils/make-phar.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/php/EE/AutoloadSplitter.php b/php/EE/AutoloadSplitter.php index 7a9f1b501..858db9a5b 100644 --- a/php/EE/AutoloadSplitter.php +++ b/php/EE/AutoloadSplitter.php @@ -27,7 +27,7 @@ class AutoloadSplitter { * @return bool Whether to split out the class into a separate autoloader. */ public function __invoke( $class, $code ) { - return 1 === preg_match( '/\/mrrobot47\/\w+(?:-\w+)*-command\//', $code ) + return 1 === preg_match( '/\/easyengine\/\w+(?:-\w+)*-command\//', $code ) || 1 === preg_match( '/\/php\/commands\/src\//', $code ); } } diff --git a/utils/make-phar.php b/utils/make-phar.php index f07adb0b8..864c90e22 100644 --- a/utils/make-phar.php +++ b/utils/make-phar.php @@ -110,7 +110,7 @@ function get_composer_versions( $current_version ) { fwrite( STDERR, sprintf( "Warning: No packages in '%s'." . PHP_EOL, $composer_lock_path ) ); return ''; } - $vendor_versions = array( implode( ' ', array( 'mrrobot47/ee', $current_version, date( 'c' ) ) ) ); + $vendor_versions = array( implode( ' ', array( 'easyengine/ee', $current_version, date( 'c' ) ) ) ); $missing_names = $missing_versions = $missing_references = 0; foreach ( $composer_lock['packages'] as $package ) { if ( isset( $package['name'] ) ) { @@ -189,7 +189,7 @@ function get_composer_versions( $current_version ) { ; } else { $finder - ->in(EE_VENDOR_DIR . '/mrrobot47') + ->in(EE_VENDOR_DIR . '/easyengine') ->in(EE_VENDOR_DIR . '/wp-cli') ->in(EE_VENDOR_DIR . '/psr') ->in(EE_VENDOR_DIR . '/seld') From 29731ec8d288ae91b7afd917dc2333feb6a590e4 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Fri, 6 Apr 2018 22:24:02 +0530 Subject: [PATCH 0057/1044] Update EasyEngine packages version --- composer.json | 4 +- composer.lock | 226 +++++++++++++++++++++++++------------------------- 2 files changed, 116 insertions(+), 114 deletions(-) diff --git a/composer.json b/composer.json index 1e6a0c050..b0b9d77eb 100644 --- a/composer.json +++ b/composer.json @@ -27,8 +27,8 @@ "php": ">=5.3.29", "composer/composer": "^1.2.0", "composer/semver": "~1.0", - "easyengine/site-command": "^1.0.0", - "easyengine/wp-command": "^1.0.0", + "easyengine/site-command": "dev-master", + "easyengine/wp-command": "dev-master", "justinrainbow/json-schema": "~5.2.5", "monolog/monolog": "^1.23", "mustache/mustache": "~2.4", diff --git a/composer.lock b/composer.lock index 1bf39db33..91b8413cb 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "c6cd0e777528ec465834452112be5d19", + "content-hash": "80bc4a48c5afd7e3306ace1fb21e17e3", "packages": [ { "name": "composer/ca-bundle", @@ -262,6 +262,87 @@ ], "time": "2018-01-31T13:17:27+00:00" }, + { + "name": "easyengine/site-command", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/EasyEngine/site-command.git", + "reference": "85f913a404d336082e25cc06c79990143134ae89" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/85f913a404d336082e25cc06c79990143134ae89", + "reference": "85f913a404d336082e25cc06c79990143134ae89", + "shasum": "" + }, + "type": "ee-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "site", + "site create", + "site list", + "site delete" + ] + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "site-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "homepage": "https://github.com/easyengine/site-command", + "time": "2018-04-06T15:50:47+00:00" + }, + { + "name": "easyengine/wp-command", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/EasyEngine/wp-command.git", + "reference": "4eb2ddd64e2fe8485dfb5a31bb3da4864fd0b792" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/EasyEngine/wp-command/zipball/4eb2ddd64e2fe8485dfb5a31bb3da4864fd0b792", + "reference": "4eb2ddd64e2fe8485dfb5a31bb3da4864fd0b792", + "shasum": "" + }, + "type": "ee-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "wp" + ] + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "wp-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "homepage": "https://github.com/easyengine/wp-command", + "time": "2018-04-06T15:37:41+00:00" + }, { "name": "justinrainbow/json-schema", "version": "5.2.7", @@ -406,87 +487,6 @@ ], "time": "2017-06-19T01:22:40+00:00" }, - { - "name": "mrrobot47/site-command", - "version": "v1.3", - "source": { - "type": "git", - "url": "https://github.com/mrrobot47/site-command.git", - "reference": "060a4f008292e48d17997e37331af278142f662b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mrrobot47/site-command/zipball/060a4f008292e48d17997e37331af278142f662b", - "reference": "060a4f008292e48d17997e37331af278142f662b", - "shasum": "" - }, - "type": "wp-cli-package", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - }, - "bundled": true, - "commands": [ - "site", - "site create", - "site list", - "site delete" - ] - }, - "autoload": { - "psr-4": { - "": "src/" - }, - "files": [ - "site-command.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "homepage": "https://github.com/mrrobot47/site-command", - "time": "2018-04-02T14:57:58+00:00" - }, - { - "name": "mrrobot47/wp-command", - "version": "v1.0", - "source": { - "type": "git", - "url": "https://github.com/mrrobot47/wp-command.git", - "reference": "4a3e8b899245166a8a4558ceb9cb573292539193" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mrrobot47/wp-command/zipball/4a3e8b899245166a8a4558ceb9cb573292539193", - "reference": "4a3e8b899245166a8a4558ceb9cb573292539193", - "shasum": "" - }, - "type": "wp-cli-package", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - }, - "bundled": true, - "commands": [ - "wp" - ] - }, - "autoload": { - "psr-4": { - "": "src/" - }, - "files": [ - "wp-command.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "homepage": "https://github.com/mrrobot47/wp-command", - "time": "2018-03-20T13:26:46+00:00" - }, { "name": "mustache/mustache", "version": "v2.12.0", @@ -817,7 +817,7 @@ }, { "name": "symfony/config", - "version": "v2.8.37", + "version": "v2.8.38", "source": { "type": "git", "url": "https://github.com/symfony/config.git", @@ -873,16 +873,16 @@ }, { "name": "symfony/console", - "version": "v2.8.37", + "version": "v2.8.38", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "390fa4899dbcc47bd41935d87c4572ea4305d3ce" + "reference": "7f78892d900c72a40acd1fe793c856ef0c110f26" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/390fa4899dbcc47bd41935d87c4572ea4305d3ce", - "reference": "390fa4899dbcc47bd41935d87c4572ea4305d3ce", + "url": "https://api.github.com/repos/symfony/console/zipball/7f78892d900c72a40acd1fe793c856ef0c110f26", + "reference": "7f78892d900c72a40acd1fe793c856ef0c110f26", "shasum": "" }, "require": { @@ -930,20 +930,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-03-19T21:13:58+00:00" + "time": "2018-04-03T05:20:27+00:00" }, { "name": "symfony/debug", - "version": "v2.8.37", + "version": "v2.8.38", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "ce92aa63881b80f79042962a3fbea217f5ac9b4e" + "reference": "4486d2be5e068b51fece4c8551c14e709f573c8d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/ce92aa63881b80f79042962a3fbea217f5ac9b4e", - "reference": "ce92aa63881b80f79042962a3fbea217f5ac9b4e", + "url": "https://api.github.com/repos/symfony/debug/zipball/4486d2be5e068b51fece4c8551c14e709f573c8d", + "reference": "4486d2be5e068b51fece4c8551c14e709f573c8d", "shasum": "" }, "require": { @@ -987,11 +987,11 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2018-03-28T18:22:50+00:00" + "time": "2018-04-03T05:20:27+00:00" }, { "name": "symfony/dependency-injection", - "version": "v2.8.37", + "version": "v2.8.38", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", @@ -1054,16 +1054,16 @@ }, { "name": "symfony/event-dispatcher", - "version": "v2.8.37", + "version": "v2.8.38", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "f5d2d7dcc33b89e20c2696ea9afcbddf6540081c" + "reference": "9b69aad7d4c086dc94ebade2d5eb9145da5dac8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/f5d2d7dcc33b89e20c2696ea9afcbddf6540081c", - "reference": "f5d2d7dcc33b89e20c2696ea9afcbddf6540081c", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/9b69aad7d4c086dc94ebade2d5eb9145da5dac8c", + "reference": "9b69aad7d4c086dc94ebade2d5eb9145da5dac8c", "shasum": "" }, "require": { @@ -1110,11 +1110,11 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2018-02-11T16:53:59+00:00" + "time": "2018-04-06T07:35:03+00:00" }, { "name": "symfony/filesystem", - "version": "v2.8.37", + "version": "v2.8.38", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", @@ -1163,16 +1163,16 @@ }, { "name": "symfony/finder", - "version": "v2.8.37", + "version": "v2.8.38", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "3cf7b50fa4cd6c2c4aa504b85196b12e386659d4" + "reference": "423746fc18ccf31f9abec43e4f078bb6e024b2d5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/3cf7b50fa4cd6c2c4aa504b85196b12e386659d4", - "reference": "3cf7b50fa4cd6c2c4aa504b85196b12e386659d4", + "url": "https://api.github.com/repos/symfony/finder/zipball/423746fc18ccf31f9abec43e4f078bb6e024b2d5", + "reference": "423746fc18ccf31f9abec43e4f078bb6e024b2d5", "shasum": "" }, "require": { @@ -1208,7 +1208,7 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2018-03-28T18:22:50+00:00" + "time": "2018-04-04T13:38:31+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -1271,16 +1271,16 @@ }, { "name": "symfony/process", - "version": "v2.8.37", + "version": "v2.8.38", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "c2fc900ee54e1e44aa956eae8ba041a5347ba93c" + "reference": "ee2c91470ff262b1a00aec27875d38594aa87629" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/c2fc900ee54e1e44aa956eae8ba041a5347ba93c", - "reference": "c2fc900ee54e1e44aa956eae8ba041a5347ba93c", + "url": "https://api.github.com/repos/symfony/process/zipball/ee2c91470ff262b1a00aec27875d38594aa87629", + "reference": "ee2c91470ff262b1a00aec27875d38594aa87629", "shasum": "" }, "require": { @@ -1316,11 +1316,11 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2018-03-19T21:11:56+00:00" + "time": "2018-04-03T05:20:27+00:00" }, { "name": "symfony/translation", - "version": "v2.8.37", + "version": "v2.8.38", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", @@ -1384,7 +1384,7 @@ }, { "name": "symfony/yaml", - "version": "v2.8.37", + "version": "v2.8.38", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", @@ -2467,6 +2467,8 @@ "aliases": [], "minimum-stability": "dev", "stability-flags": { + "easyengine/site-command": 20, + "easyengine/wp-command": 20, "roave/security-advisories": 20 }, "prefer-stable": true, From 343ae9bf188b7c1da97f3f93ac577e270dae84b1 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Mon, 9 Apr 2018 16:40:54 +0530 Subject: [PATCH 0058/1044] Setup travis-ci for phar building Add deployment and prepration scripts --- .travis.yml | 44 ++++++++++++++++++++++++++++++++++++++++++++ ci/deploy.sh | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ ci/prepare.sh | 6 ++++++ 3 files changed, 101 insertions(+) create mode 100644 .travis.yml create mode 100755 ci/deploy.sh create mode 100755 ci/prepare.sh diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..189a9f559 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,44 @@ +sudo: false + +language: php +php: 7.1 + +env: + global: + - PATH="$TRAVIS_BUILD_DIR/vendor/bin:$PATH" + +before_install: + - | + # Remove Xdebug for a huge performance increase: + if [ -f ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini ]; then + phpenv config-rm xdebug.ini + else + echo "xdebug.ini does not exist" + fi + +install: + - composer install + +before_script: + - composer validate + - ./ci/prepare.sh + +jobs: + include: + - stage: deploy + env: DEPLOY_BRANCH=release/v4 + script: ./ci/deploy.sh + +cache: + directories: + - $HOME/.composer/cache + +branches: + only: + - develop-v4 + - release/v4 + +notifications: + email: + on_success: never + on_failure: change \ No newline at end of file diff --git a/ci/deploy.sh b/ci/deploy.sh new file mode 100755 index 000000000..f4d761879 --- /dev/null +++ b/ci/deploy.sh @@ -0,0 +1,51 @@ +#!/bin/bash + +# called by Travis CI + +if [[ "false" != "$TRAVIS_PULL_REQUEST" ]]; then + echo "Not deploying pull requests." + exit +fi + +if [ -z $DEPLOY_BRANCH ]; then + echo "Skipping deployment as DEPLOY_BRANCH is not set" + exit +fi + +if [[ "$TRAVIS_BRANCH" != "$DEPLOY_BRANCH" ]] && [[ ! "$TRAVIS_BRANCH" == "release-"* ]]; then + echo "Skipping deployment as '$TRAVIS_BRANCH' is not a deploy branch." + exit +fi + +# Turn off command traces while dealing with the private key +set +x + +# Get the encrypted private key from the repo settings +echo $EE_REPO_DEPLOY_KEY | base64 --decode > ~/.ssh/id_rsa +chmod 600 ~/.ssh/id_rsa + +# anyone can read the build log, so it MUST NOT contain any sensitive data +set -x + +# add github's public key +echo "|1|qPmmP7LVZ7Qbpk7AylmkfR0FApQ=|WUy1WS3F4qcr3R5Sc728778goPw= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==" >> ~/.ssh/known_hosts + +git clone git@github.com:easyengine/easyengine-builds.git + +git config user.name "Travis CI" +git config user.email "travis@travis-ci.org" +git config push.default "current" + +fname="easyengine.phar" + +mv easyengine.phar easyengine-builds/$fname +cd easyengine-builds +chmod -x $fname + +md5sum $fname | cut -d ' ' -f 1 > $fname.md5 +sha512sum $fname | cut -d ' ' -f 1 > $fname.sha512 + +git add . +git commit -m "phar build: $TRAVIS_REPO_SLUG@$TRAVIS_COMMIT" + +git push \ No newline at end of file diff --git a/ci/prepare.sh b/ci/prepare.sh new file mode 100755 index 000000000..bd6cd82f8 --- /dev/null +++ b/ci/prepare.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +# called by Travis CI + +php -dphar.readonly=0 ./utils/make-phar.php easyengine.phar --quite > /dev/null +php easyengine.phar cli version \ No newline at end of file From 121862b3afabf5d00ba49903fc7fd5e1068f637a Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Mon, 9 Apr 2018 17:05:47 +0530 Subject: [PATCH 0059/1044] Update Composer Lock file --- composer.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.lock b/composer.lock index 91b8413cb..4a2d1d27d 100644 --- a/composer.lock +++ b/composer.lock @@ -268,12 +268,12 @@ "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "85f913a404d336082e25cc06c79990143134ae89" + "reference": "f62bd63b04bfe89de794cc08d2d63e6b8a4a48c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/85f913a404d336082e25cc06c79990143134ae89", - "reference": "85f913a404d336082e25cc06c79990143134ae89", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/f62bd63b04bfe89de794cc08d2d63e6b8a4a48c4", + "reference": "f62bd63b04bfe89de794cc08d2d63e6b8a4a48c4", "shasum": "" }, "type": "ee-cli-package", @@ -302,7 +302,7 @@ "MIT" ], "homepage": "https://github.com/easyengine/site-command", - "time": "2018-04-06T15:50:47+00:00" + "time": "2018-04-09T11:25:52+00:00" }, { "name": "easyengine/wp-command", From 910d613ec3d09d5e4d2b0cc3bc3e2344991abcdd Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Mon, 9 Apr 2018 17:11:26 +0530 Subject: [PATCH 0060/1044] Add no-interaction flag in composer install --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 189a9f559..f3a6a27be 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,7 @@ before_install: fi install: - - composer install + - composer install --no-interaction before_script: - composer validate From dbf2b1e9a03a2f610e874e000d88a4f6915a9695 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Mon, 9 Apr 2018 17:37:18 +0530 Subject: [PATCH 0061/1044] Add nightly version build automation --- ci/deploy.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ci/deploy.sh b/ci/deploy.sh index f4d761879..1eaca255c 100755 --- a/ci/deploy.sh +++ b/ci/deploy.sh @@ -12,7 +12,7 @@ if [ -z $DEPLOY_BRANCH ]; then exit fi -if [[ "$TRAVIS_BRANCH" != "$DEPLOY_BRANCH" ]] && [[ ! "$TRAVIS_BRANCH" == "release-"* ]]; then +if [[ "$TRAVIS_BRANCH" != "$DEPLOY_BRANCH" ]] && [[ ! "$TRAVIS_BRANCH" == "develop-v4" ]]; then echo "Skipping deployment as '$TRAVIS_BRANCH' is not a deploy branch." exit fi @@ -38,7 +38,13 @@ git config push.default "current" fname="easyengine.phar" -mv easyengine.phar easyengine-builds/$fname +if [[ "$TRAVIS_BRANCH" == "develop-v4" ]]; then + fname="easyengine-nightly.phar" +else + fname="easyengine.phar" +fi + +mv $fname easyengine-builds/$fname cd easyengine-builds chmod -x $fname From 00e22a7a8566c05e4e4c9f8621fcb5b15c56f0b8 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Mon, 9 Apr 2018 17:42:18 +0530 Subject: [PATCH 0062/1044] Move builds to phar folder --- ci/deploy.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ci/deploy.sh b/ci/deploy.sh index 1eaca255c..1877ddc15 100755 --- a/ci/deploy.sh +++ b/ci/deploy.sh @@ -36,12 +36,10 @@ git config user.name "Travis CI" git config user.email "travis@travis-ci.org" git config push.default "current" -fname="easyengine.phar" - if [[ "$TRAVIS_BRANCH" == "develop-v4" ]]; then - fname="easyengine-nightly.phar" + fname="phar/easyengine-nightly.phar" else - fname="easyengine.phar" + fname="phar/easyengine.phar" fi mv $fname easyengine-builds/$fname From 591f6adcd5ec7bc47322fc8bb3ba0d431b2053ce Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Mon, 9 Apr 2018 17:58:44 +0530 Subject: [PATCH 0063/1044] Update move builds to phar folder --- ci/deploy.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ci/deploy.sh b/ci/deploy.sh index 1877ddc15..94f15911e 100755 --- a/ci/deploy.sh +++ b/ci/deploy.sh @@ -42,7 +42,8 @@ else fname="phar/easyengine.phar" fi -mv $fname easyengine-builds/$fname +mkdir -p easyengine-builds/phar +mv easyengine.phar easyengine-builds/$fname cd easyengine-builds chmod -x $fname From 250e4f602c9bd3509957e9d2f56d805777f2de6a Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Wed, 11 Apr 2018 11:53:46 +0530 Subject: [PATCH 0064/1044] Add automated docker image building --- ci/deploy.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ci/deploy.sh b/ci/deploy.sh index 94f15911e..a14e0e63f 100755 --- a/ci/deploy.sh +++ b/ci/deploy.sh @@ -52,5 +52,11 @@ sha512sum $fname | cut -d ' ' -f 1 > $fname.sha512 git add . git commit -m "phar build: $TRAVIS_REPO_SLUG@$TRAVIS_COMMIT" +git push -git push \ No newline at end of file +# Trigger docker image build with new phar +if [[ "$TRAVIS_BRANCH" == "develop-v4" ]]; then + curl -H "Content-Type: application/json" --data '{"docker_tag": "nightly"}' -X POST https://registry.hub.docker.com/u/easyengine/base/trigger/"$DOCKER_BUILD_TOKEN"/ +else + curl -H "Content-Type: application/json" --data '{"docker_tag": "latest"}' -X POST https://registry.hub.docker.com/u/easyengine/base/trigger/"$DOCKER_BUILD_TOKEN"/ +fi \ No newline at end of file From 4caa5b338138f1e53f4d5bc3f1ec90250d963cfb Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Wed, 11 Apr 2018 12:57:23 +0530 Subject: [PATCH 0065/1044] Update image tags --- ci/deploy.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/deploy.sh b/ci/deploy.sh index a14e0e63f..e851a23ff 100755 --- a/ci/deploy.sh +++ b/ci/deploy.sh @@ -56,7 +56,7 @@ git push # Trigger docker image build with new phar if [[ "$TRAVIS_BRANCH" == "develop-v4" ]]; then - curl -H "Content-Type: application/json" --data '{"docker_tag": "nightly"}' -X POST https://registry.hub.docker.com/u/easyengine/base/trigger/"$DOCKER_BUILD_TOKEN"/ -else curl -H "Content-Type: application/json" --data '{"docker_tag": "latest"}' -X POST https://registry.hub.docker.com/u/easyengine/base/trigger/"$DOCKER_BUILD_TOKEN"/ +else + curl -H "Content-Type: application/json" --data '{"docker_tag": "stable"}' -X POST https://registry.hub.docker.com/u/easyengine/base/trigger/"$DOCKER_BUILD_TOKEN"/ fi \ No newline at end of file From 2f437282982d23c2dab1c3e1aa9736ae53c3daa4 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Wed, 11 Apr 2018 19:53:12 +0530 Subject: [PATCH 0066/1044] Update composer.lock --- composer.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.lock b/composer.lock index 4a2d1d27d..f6cf6bb8e 100644 --- a/composer.lock +++ b/composer.lock @@ -310,12 +310,12 @@ "source": { "type": "git", "url": "https://github.com/EasyEngine/wp-command.git", - "reference": "4eb2ddd64e2fe8485dfb5a31bb3da4864fd0b792" + "reference": "24671d90ebf141ee690199388ba99ff44a54b5e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/wp-command/zipball/4eb2ddd64e2fe8485dfb5a31bb3da4864fd0b792", - "reference": "4eb2ddd64e2fe8485dfb5a31bb3da4864fd0b792", + "url": "https://api.github.com/repos/EasyEngine/wp-command/zipball/24671d90ebf141ee690199388ba99ff44a54b5e5", + "reference": "24671d90ebf141ee690199388ba99ff44a54b5e5", "shasum": "" }, "type": "ee-cli-package", @@ -341,7 +341,7 @@ "MIT" ], "homepage": "https://github.com/easyengine/wp-command", - "time": "2018-04-06T15:37:41+00:00" + "time": "2018-04-11T12:21:55+00:00" }, { "name": "justinrainbow/json-schema", From 0169b420198f891a2c177dff208bbb29ab88f63a Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Wed, 11 Apr 2018 20:18:45 +0530 Subject: [PATCH 0067/1044] Update readme from phar to base image setup --- README.md | 56 +++++++++++++++++++++---------------------------------- 1 file changed, 21 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index 2e88a0b9e..37321f291 100644 --- a/README.md +++ b/README.md @@ -1,36 +1,22 @@ # EasyEngine v4 +[![Build Status](https://travis-ci.org/EasyEngine/easyengine.svg?branch=release%2Fv4)](https://travis-ci.org/EasyEngine/easyengine) ## Requirements * Docker -* Docker-Compose -* PHP ## Installing -Once you've verified requirements, download the [easyengine.phar](https://raw.githubusercontent.com/easyengine/easyengine-builds/master/easyengine.phar) file using `wget` or `curl`: +Once you've verified requirements, download the [setup.sh](rt.cx/eev4) file using `wget` or `curl` and execute it: ```bash -curl -O https://raw.githubusercontent.com/easyengine/easyengine-builds/master/easyengine.phar +wget rt.cx/eev4 -O ee4-setup && bash ee4-setup ``` -Next, check the Phar file to verify that it's working: +If EE was installed successfully, you should see something like this when you run `ee cli version`: ```bash -php easyengine.phar cli info -``` - -To use EEv4 from the command line by typing `ee4`, make the file executable and move it to somewhere in your PATH. For example: - -```bash -chmod +x easyengine.phar -sudo mv easyengine.phar /usr/local/bin/ee4 -``` - -If EE was installed successfully, you should see something like this when you run `ee4 cli version`: - -```bash -$ ee4 cli version +$ ee cli version EE 0.0.1 ``` @@ -41,14 +27,14 @@ EE 0.0.1 Creates, lists and deletes WordPress websites. ~~~ -ee4 site +ee site ~~~ **EXAMPLES** # Create simple WordPress website. No parameter flag defaults to --wp - $ ee4 site create site.test + $ ee site create site.test Success: ee4_nginx-proxy container launched successfully. Configuring project... Creating WordPress site site.test... @@ -72,7 +58,7 @@ ee4 site E-Mail : mail@site.test Site entry created. - $ ee4 site create site2.test --wpredis --user=admin --pass=admin --email=admin@admin.example --title="Site by EasyEngine" + $ ee site create site2.test --wpredis --user=admin --pass=admin --email=admin@admin.example --title="Site by EasyEngine" Configuring project... Creating WordPress site site2.test... Copying configuration files... @@ -96,13 +82,13 @@ ee4 site E-Mail : admin@admin.example Site entry created. - $ ee4 site list + $ ee site list List of Sites: - site.test - site2.test - $ ee4 site delete site.test + $ ee site delete site.test [site.test] Docker Containers removed. [site.test] Disconnected from Docker network nginx-proxy [site.test] Docker network nginx-proxy removed. @@ -111,10 +97,10 @@ ee4 site Removing database entry. Site site.test deleted. -### ee4 site create +### ee site create ~~~ -ee4 site create <site-name> [--wp|--wpredis] [--letsencrypt] [--title=<title>] [--user=<username>] [--pass=<password>] [--email=<email>] +ee site create <site-name> [--wp|--wpredis] [--letsencrypt] [--title=<title>] [--user=<username>] [--pass=<password>] [--email=<email>] ~~~ Creates WordPress site. @@ -142,39 +128,39 @@ Creates WordPress site. [--email=<email>] E-Mail of the WordPress administrator. -### ee4 site list +### ee site list ~~~ -ee4 site list +ee site list ~~~ Lists all the sites created by EasyEngine. -### ee4 site delete +### ee site delete ~~~ -ee4 site delete <site-name> +ee site delete <site-name> ~~~ Deletes the given site if it was created by EasyEngine. -### ee4 wp +### ee wp Run all the wp commands for site created by EasyEngine. ~~~ -ee4 wp +ee wp ~~~ ### Usage ~~~ -ee4 wp <site-name> <wp-command> +ee wp <site-name> <wp-command> ~~~ **EXAMPLES** - $ ee4 wp site.test plugin list + $ ee wp site.test plugin list +---------+----------+-----------+---------+ | name | status | update | version | +---------+----------+-----------+---------+ @@ -182,5 +168,5 @@ ee4 wp <site-name> <wp-command> | hello | inactive | none | 1.6 | +---------+----------+-----------+---------+ - $ ee4 wp site.test user create author1 author1@site.test --user_pass=password --role=administrator + $ ee wp site.test user create author1 author1@site.test --user_pass=password --role=administrator Success: Created user 2. \ No newline at end of file From 1530d0161164d3ec42890c32ca67048c8b3d4e5d Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Wed, 11 Apr 2018 20:21:03 +0530 Subject: [PATCH 0068/1044] Update setup url --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 37321f291..61b24fd7c 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ ## Installing -Once you've verified requirements, download the [setup.sh](rt.cx/eev4) file using `wget` or `curl` and execute it: +Once you've verified requirements, download the [setup.sh](http://rt.cx/eev4) file using `wget` or `curl` and execute it: ```bash wget rt.cx/eev4 -O ee4-setup && bash ee4-setup From 09d6d5ef9ab261f19e2d89a280af62c1738cc2eb Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Fri, 13 Apr 2018 15:57:17 +0530 Subject: [PATCH 0069/1044] Add update feature --- php/EE/Runner.php | 1 + php/commands/src/CLI_Command.php | 315 ++++--------------------------- 2 files changed, 39 insertions(+), 277 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 96297d9c6..c2d67c118 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -658,6 +658,7 @@ public function start() { $this->ensure_present_in_config( 'sites_path', Utils\get_home_dir(). '/ee4-sites' ); $this->ensure_present_in_config( 'db_path', Utils\get_home_dir(). '/.ee4/ee4.db' ); + $this->ensure_present_in_config( 'ee_installer_version', 'stable' ); $this->init_ee4(); // Enable PHP error reporting to stderr if testing. diff --git a/php/commands/src/CLI_Command.php b/php/commands/src/CLI_Command.php index 4ba32c949..f0459feac 100644 --- a/php/commands/src/CLI_Command.php +++ b/php/commands/src/CLI_Command.php @@ -2,6 +2,7 @@ use \Composer\Semver\Comparator; use \EE\Utils; +use Mustangostang\Spyc; /** * Review current EE info, check for updates, or see defined aliases. @@ -27,9 +28,9 @@ class CLI_Command extends EE_Command { private function command_to_array( $command ) { $dump = array( - 'name' => $command->get_name(), + 'name' => $command->get_name(), 'description' => $command->get_shortdesc(), - 'longdesc' => $command->get_longdesc(), + 'longdesc' => $command->get_longdesc(), ); foreach ( $command->get_subcommands() as $subcommand ) { @@ -116,14 +117,14 @@ public function info( $_, $assoc_args ) { } if ( \EE\Utils\get_flag_value( $assoc_args, 'format' ) === 'json' ) { $info = array( - 'php_binary_path' => $php_bin, - 'global_config_path' => $runner->global_config_path, - 'project_config_path' => $runner->project_config_path, + 'php_binary_path' => $php_bin, + 'global_config_path' => $runner->global_config_path, + 'project_config_path' => $runner->project_config_path, 'ee_dir_path' => EE_ROOT, 'ee_packages_dir_path' => $packages_dir, 'ee_version' => EE_VERSION, - 'system_os' => $system_os, - 'shell' => $shell, + 'system_os' => $system_os, + 'shell' => $shell, ); EE::line( json_encode( $info ) ); @@ -154,72 +155,6 @@ public function info( $_, $assoc_args ) { } } - /** - * Check to see if there is a newer version of EE available. - * - * Queries the Github releases API. Returns available versions if there are - * updates available, or success message if using the latest release. - * - * ## OPTIONS - * - * [--patch] - * : Only list patch updates. - * - * [--minor] - * : Only list minor updates. - * - * [--major] - * : Only list major updates. - * - * [--field=<field>] - * : Prints the value of a single field for each update. - * - * [--fields=<fields>] - * : Limit the output to specific object fields. Defaults to version,update_type,package_url. - * - * [--format=<format>] - * : Render output in a particular format. - * --- - * default: table - * options: - * - table - * - csv - * - json - * - count - * - yaml - * --- - * - * ## EXAMPLES - * - * # Check for update. - * $ ee cli check-update - * Success: EE is at the latest version. - * - * # Check for update and new version is available. - * $ ee cli check-update - * +---------+-------------+-------------------------------------------------------------------------------+ - * | version | update_type | package_url | - * +---------+-------------+-------------------------------------------------------------------------------+ - * | 0.24.1 | patch | https://github.com/ee/ee/releases/download/v0.24.1/ee-0.24.1.phar | - * +---------+-------------+-------------------------------------------------------------------------------+ - * - * @subcommand check-update - */ - public function check_update( $_, $assoc_args ) { - $updates = $this->get_updates( $assoc_args ); - - if ( $updates ) { - $formatter = new \EE\Formatter( - $assoc_args, - array( 'version', 'update_type', 'package_url' ) - ); - $formatter->display_items( $updates ); - } elseif ( empty( $assoc_args['format'] ) || 'table' == $assoc_args['format'] ) { - $update_type = $this->get_update_type_str( $assoc_args ); - EE::success( "EE is at the latest{$update_type}version." ); - } - } - /** * Update EE to the latest release. * @@ -228,32 +163,18 @@ public function check_update( $_, $assoc_args ) { * * Use `--stable` to install or reinstall the latest stable version. * - * Use `--nightly` to install the latest built version of the master branch. + * Use `--nightly` to install the latest built version of the develop branch. * While not recommended for production, nightly contains the latest and * greatest, and should be stable enough for development and staging * environments. * - * Only works for the Phar installation mechanism. - * * ## OPTIONS * - * [--patch] - * : Only perform patch updates. - * - * [--minor] - * : Only perform minor updates. - * - * [--major] - * : Only perform major updates. - * * [--stable] - * : Update to the latest stable release. Skips update check. + * : Update to the latest stable release. * * [--nightly] - * : Update to the latest built version of the master branch. Potentially unstable. - * - * [--yes] - * : Do not prompt for confirmation. + * : Update to the latest built version of the develop branch. Potentially unstable. * * ## EXAMPLES * @@ -265,189 +186,28 @@ public function check_update( $_, $assoc_args ) { * Success: Updated EE to 0.24.1. */ public function update( $_, $assoc_args ) { - // TODO: Update procedure to update EE - // - // if ( ! Utils\inside_phar() ) { - // EE::error( 'You can only self-update Phar files.' ); - // } - - // $old_phar = realpath( $_SERVER['argv'][0] ); - - // if ( ! is_writable( $old_phar ) ) { - // EE::error( sprintf( '%s is not writable by current user.', $old_phar ) ); - // } elseif ( ! is_writable( dirname( $old_phar ) ) ) { - // EE::error( sprintf( '%s is not writable by current user.', dirname( $old_phar ) ) ); - // } - - // if ( Utils\get_flag_value( $assoc_args, 'nightly' ) ) { - // EE::confirm( sprintf( 'You have version %s. Would you like to update to the latest nightly?', EE_VERSION ), $assoc_args ); - // $download_url = 'https://raw.githubusercontent.com/ee/builds/gh-pages/phar/ee-nightly.phar'; - // $md5_url = 'https://raw.githubusercontent.com/ee/builds/gh-pages/phar/ee-nightly.phar.md5'; - // } elseif ( Utils\get_flag_value( $assoc_args, 'stable' ) ) { - // EE::confirm( sprintf( 'You have version %s. Would you like to update to the latest stable release?', EE_VERSION ), $assoc_args ); - // $download_url = 'https://raw.githubusercontent.com/ee/builds/gh-pages/phar/ee.phar'; - // $md5_url = 'https://raw.githubusercontent.com/ee/builds/gh-pages/phar/ee.phar.md5'; - // } else { - // $updates = $this->get_updates( $assoc_args ); + $config_file_path = getenv( 'EE_CONFIG_PATH' ) ? getenv( 'EE_CONFIG_PATH' ) : Utils\get_home_dir() . '/.ee4/config.yml'; - // if ( empty( $updates ) ) { - // $update_type = $this->get_update_type_str( $assoc_args ); - // EE::success( "EE is at the latest{$update_type}version." ); - // return; - // } + $existing_config = Spyc::YAMLLoad( $config_file_path ); - // $newest = $updates[0]; - - // EE::confirm( sprintf( 'You have version %s. Would you like to update to %s?', EE_VERSION, $newest['version'] ), $assoc_args ); - - // $download_url = $newest['package_url']; - // $md5_url = str_replace( '.phar', '.phar.md5', $download_url ); - // } - - // EE::log( sprintf( 'Downloading from %s...', $download_url ) ); - - // $temp = \EE\Utils\get_temp_dir() . uniqid( 'ee_', true ) . '.phar'; - - // $headers = array(); - // $options = array( - // 'timeout' => 600, // 10 minutes ought to be enough for everybody. - // 'filename' => $temp, - // ); - - // Utils\http_request( 'GET', $download_url, null, $headers, $options ); - - // $md5_response = Utils\http_request( 'GET', $md5_url ); - // if ( 20 != substr( $md5_response->status_code, 0, 2 ) ) { - // EE::error( "Couldn't access md5 hash for release (HTTP code {$md5_response->status_code})." ); - // } - // $md5_file = md5_file( $temp ); - // $release_hash = trim( $md5_response->body ); - // if ( $md5_file === $release_hash ) { - // EE::log( 'md5 hash verified: ' . $release_hash ); - // } else { - // EE::error( "md5 hash for download ({$md5_file}) is different than the release hash ({$release_hash})." ); - // } - - // $allow_root = EE::get_runner()->config['allow-root'] ? '--allow-root' : ''; - // $php_binary = Utils\get_php_binary(); - // $process = EE\Process::create( "{$php_binary} $temp --info {$allow_root}" ); - // $result = $process->run(); - // if ( 0 !== $result->return_code || false === stripos( $result->stdout, 'EE version:' ) ) { - // $multi_line = explode( PHP_EOL, $result->stderr ); - // EE::error_multi_line( $multi_line ); - // EE::error( 'The downloaded PHAR is broken, try running ee cli update again.' ); - // } - - // EE::log( 'New version works. Proceeding to replace.' ); - - // $mode = fileperms( $old_phar ) & 511; - - // if ( false === chmod( $temp, $mode ) ) { - // EE::error( sprintf( 'Cannot chmod %s.', $temp ) ); - // } - - // class_exists( '\cli\Colors' ); // This autoloads \cli\Colors - after we move the file we no longer have access to this class. - - // if ( false === rename( $temp, $old_phar ) ) { - // EE::error( sprintf( 'Cannot move %s to %s', $temp, $old_phar ) ); - // } - - // if ( Utils\get_flag_value( $assoc_args, 'nightly' ) ) { - // $updated_version = 'the latest nightly release'; - // } elseif ( Utils\get_flag_value( $assoc_args, 'stable' ) ) { - // $updated_version = 'the latest stable release'; - // } else { - // $updated_version = $newest['version']; - // } - // EE::success( sprintf( 'Updated EE to %s.', $updated_version ) ); - } - - /** - * Returns update information. - */ - private function get_updates( $assoc_args ) { - // TODO: update URLs - // - // $url = 'https://api.github.com/repos/ee/ee/releases?per_page=100'; - - // $options = array( - // 'timeout' => 30, - // ); - - // $headers = array( - // 'Accept' => 'application/json', - // ); - // if ( $github_token = getenv( 'GITHUB_TOKEN' ) ) { - // $headers['Authorization'] = 'token ' . $github_token; - // } - - // $response = Utils\http_request( 'GET', $url, null, $headers, $options ); - - // if ( ! $response->success || 200 !== $response->status_code ) { - // EE::error( sprintf( 'Failed to get latest version (HTTP code %d).', $response->status_code ) ); - // } - - // $release_data = json_decode( $response->body ); - - // $updates = array( - // 'major' => false, - // 'minor' => false, - // 'patch' => false, - // ); - // foreach ( $release_data as $release ) { - - // // Get rid of leading "v" if there is one set. - // $release_version = $release->tag_name; - // if ( 'v' === substr( $release_version, 0, 1 ) ) { - // $release_version = ltrim( $release_version, 'v' ); - // } - - // $update_type = Utils\get_named_sem_ver( $release_version, EE_VERSION ); - // if ( ! $update_type ) { - // continue; - // } - - // if ( ! empty( $updates[ $update_type ] ) && ! Comparator::greaterThan( $release_version, $updates[ $update_type ]['version'] ) ) { - // continue; - // } - - // $updates[ $update_type ] = array( - // 'version' => $release_version, - // 'update_type' => $update_type, - // 'package_url' => $release->assets[0]->browser_download_url, - // ); - // } - - // foreach ( $updates as $type => $value ) { - // if ( empty( $value ) ) { - // unset( $updates[ $type ] ); - // } - // } - - // foreach ( array( 'major', 'minor', 'patch' ) as $type ) { - // if ( true === \EE\Utils\get_flag_value( $assoc_args, $type ) ) { - // return ! empty( $updates[ $type ] ) ? array( $updates[ $type ] ) : false; - // } - // } + if ( Utils\get_flag_value( $assoc_args, 'nightly' ) ) { + $existing_config['ee_installer_version'] = 'nightly'; + } else { + $existing_config['ee_installer_version'] = 'stable'; + } - // if ( empty( $updates ) && preg_match( '#-alpha-(.+)$#', EE_VERSION, $matches ) ) { - // $version_url = 'https://raw.githubusercontent.com/ee/builds/gh-pages/phar/NIGHTLY_VERSION'; - // $response = Utils\http_request( 'GET', $version_url ); - // if ( ! $response->success || 200 !== $response->status_code ) { - // EE::error( sprintf( 'Failed to get current nightly version (HTTP code %d)', $response->status_code ) ); - // } - // $nightly_version = trim( $response->body ); - // if ( EE_VERSION != $nightly_version ) { - // $updates['nightly'] = array( - // 'version' => $nightly_version, - // 'update_type' => 'nightly', - // 'package_url' => 'https://raw.githubusercontent.com/ee/builds/gh-pages/phar/ee-nightly.phar', - // ); - // } - // } + $config_file = fopen( $config_file_path, "w" ); + fwrite( $config_file, Spyc::YAMLDump( $existing_config ) ); + fclose( $config_file ); - return array_values( $updates ); + file_put_contents( EE_CONF_ROOT . '/update.sh', file_get_contents( 'http://rt.cx/eev4' ) ); + if ( \EE\Utils\default_launch( 'bash ' . EE_CONF_ROOT . '/update.sh' ) ) { + EE::success( 'Update complete.' ); + unlink( EE_CONF_ROOT . '/update.sh' ); + } else { + EE::error( 'There was some error in running update. Please check logs and re-run update.' ); + } } /** @@ -494,10 +254,10 @@ public function param_dump( $_, $assoc_args ) { // Copy current config values to $spec foreach ( $spec as $key => $value ) { $current = null; - if ( isset( $config[0][ $key ] ) ) { - $current = $config[0][ $key ]; + if ( isset( $config[0][$key] ) ) { + $current = $config[0][$key]; } - $spec[ $key ]['current'] = $current; + $spec[$key]['current'] = $current; } } @@ -516,7 +276,7 @@ public function param_dump( $_, $assoc_args ) { * # Dump the list of installed commands. * $ ee cli cmd-dump * {"name":"ee","description":"Manage WordPress through the command-line.","longdesc":"\n\n## GLOBAL PARAMETERS\n\n --path=<path>\n Path to the WordPress files.\n\n --ssh=<ssh>\n Perform operation against a remote server over SSH (or a container using scheme of "docker" or "docker-compose").\n\n --url=<url>\n Pretend request came from given URL. In multisite, this argument is how the target site is specified. \n\n --user=<id|login|email>\n - * + * * @subcommand cmd-dump */ public function cmd_dump() { @@ -542,7 +302,7 @@ public function cmd_dump() { * eval-file */ public function completions( $_, $assoc_args ) { - $line = substr( $assoc_args['line'], 0, $assoc_args['point'] ); + $line = substr( $assoc_args['line'], 0, $assoc_args['point'] ); $compl = new \EE\Completions( $line ); $compl->render(); } @@ -571,12 +331,12 @@ public function completions( $_, $assoc_args ) { * # List all available aliases. * $ ee cli alias * --- - * @all: Run command against every registered alias. - * @prod: + * @all : Run command against every registered alias. + * @prod : * ssh: runcommand@runcommand.io~/webapps/production - * @dev: + * @dev : * ssh: vagrant@192.168.50.10/srv/www/runcommand.dev - * @both: + * @both : * - @prod * - @dev * @@ -597,6 +357,7 @@ private function get_update_type_str( $assoc_args ) { break; } } + return $update_type; } From 1bd32c00f4834bf862904660e8535d61168a3edf Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Fri, 13 Apr 2018 17:44:38 +0530 Subject: [PATCH 0070/1044] Add entries in config-spec --- php/config-spec.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/php/config-spec.php b/php/config-spec.php index 21163c30c..1d28fea53 100644 --- a/php/config-spec.php +++ b/php/config-spec.php @@ -46,6 +46,19 @@ 'desc' => 'Absolute path to where all sites will be stored.', ), + 'db_path' => array( + 'runtime' => '=<path>', + 'file' => '<path>', + 'default' => null, + 'desc' => 'Absolute path to where site configuration db is stored.', + ), + + 'ee_installer_version' => array( + 'file' => '<path>', + 'default' => null, + 'desc' => 'EE version to run.', + ), + 'color' => array( 'runtime' => true, 'file' => '<bool>', From 07f1cd618386092d8b9f46d7054a40b7905ceec1 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Fri, 13 Apr 2018 23:11:41 +0530 Subject: [PATCH 0071/1044] Make db_path dynamic from config.yml --- php/EE/Runner.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index c2d67c118..f41a37b3d 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -59,7 +59,7 @@ private function init_ee4() { mkdir( $this->config['sites_path'] ); } define( 'WEBROOT', \EE\Utils\trailingslashit( $this->config['sites_path'] ) ); - define( 'DB', EE_CONF_ROOT . '/ee4.db' ); + define( 'DB', $this->config['db_path'] ); define( 'LOCALHOST_IP', '127.0.0.1' ); define( 'TABLE', 'sites' ); } From d8c8f811230df17728220298dfffe250b186e4fb Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Sun, 15 Apr 2018 22:31:02 +0530 Subject: [PATCH 0072/1044] Add get_type to get arguments Update copy_recursive --- php/utils.php | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/php/utils.php b/php/utils.php index a594a06b4..f1b773ae8 100644 --- a/php/utils.php +++ b/php/utils.php @@ -1343,7 +1343,9 @@ function copy_recursive( $source, $dest ) { ) as $item ) { if ( $item->isDir() ) { - mkdir( $dest . DIRECTORY_SEPARATOR . $iterator->getSubPathName() ); + if ( ! file_exists( $dest . DIRECTORY_SEPARATOR . $iterator->getSubPathName() ) ) { + mkdir( $dest . DIRECTORY_SEPARATOR . $iterator->getSubPathName() ); + } } else { copy( $item, $dest . DIRECTORY_SEPARATOR . $iterator->getSubPathName() ); } @@ -1431,6 +1433,33 @@ function default_launch( $command ) { default_debug( $launch ); if ( ! $launch->return_code ) { return true; - } + } return false; } + +/** + * Function to return the type from arguments. + * + * @param array $assoc_args User input arguments. + * @param array $arg_types Types to check with. + * @param mixed $default Default in case of no match + * + * @return string Type of site parsed from argument given from user. + */ +function get_type( $assoc_args, $arg_types, $default = false ) { + $type = ''; + $cnt = 0; + foreach ( $arg_types as $arg_type ) { + if ( get_flag_value( $assoc_args, $arg_type ) ) { + $cnt ++; + $type = $arg_type; + } + } + if ( $cnt == 1 ) { + return $type; + } else if ( $cnt == 0 ) { + return $default; + } else { + return false; + } +} From f9a59bc73b3b70e8db4d41dde6f96b8917e2dd7b Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Sun, 15 Apr 2018 22:52:22 +0530 Subject: [PATCH 0073/1044] Update docker-compose for multi-site --- php/class-ee-docker.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php index 61cc74355..cebc8b669 100644 --- a/php/class-ee-docker.php +++ b/php/class-ee-docker.php @@ -59,10 +59,14 @@ public static function generate_docker_composer_yml( array $filters = [] ) { $nginx['image'] = array( 'name' => 'easyengine/nginx' ); $nginx['depends_on'] = array( 'name' => 'php' ); $nginx['restart'] = $restart_default; + + $v_host = in_array( 'wpsubdom', $filters ) ? 'VIRTUAL_HOST=${VIRTUAL_HOST},*.${VIRTUAL_HOST}' : 'VIRTUAL_HOST'; + if ( in_array( 'le', $filters ) ) { - $nginx['environment'] = array( 'env' => array( array( 'name' => 'VIRTUAL_HOST' ), array( 'name' => 'LETSENCRYPT_HOST=${VIRTUAL_HOST}' ), array( 'name' => 'LETSENCRYPT_EMAIL=${VIRTUAL_HOST_EMAIL}' ) ) ); + $le_v_host = in_array( 'wpsubdom', $filters ) ? 'LETSENCRYPT_HOST=${VIRTUAL_HOST},*.${VIRTUAL_HOST}' : 'LETSENCRYPT_HOST=${VIRTUAL_HOST}'; + $nginx['environment'] = array( 'env' => array( array( 'name' => $v_host ), array( 'name' => $le_v_host ), array( 'name' => 'LETSENCRYPT_EMAIL=${VIRTUAL_HOST_EMAIL}' ) ) ); } else { - $nginx['environment'] = array( 'env' => array( array( 'name' => 'VIRTUAL_HOST' ) ) ); + $nginx['environment'] = array( 'env' => array( array( 'name' => $v_host ) ) ); } $nginx['volumes'] = array( array( 'vol' => array( array( 'name' => './app/src:/var/www/html' ), array( 'name' => './config/nginx/default.conf:/etc/nginx/conf.d/default.conf' ), array( 'name' => './logs/nginx:/var/log/nginx' ), array( 'name' => './config/nginx/common:/usr/local/openresty/nginx/conf/common' ) ) ) ); $nginx['networks'] = $network_default; From 34b9202c500345ba3712beb91eb5a1690eb08455 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Sun, 15 Apr 2018 22:53:36 +0530 Subject: [PATCH 0074/1044] Add config file for multi-site --- .../wpsubdir/config/nginx/common/wpsubdir.conf | 10 ++++++++++ ee4-config/wpsubdir/config/nginx/default.conf | 17 +++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 ee4-config/wpsubdir/config/nginx/common/wpsubdir.conf create mode 100644 ee4-config/wpsubdir/config/nginx/default.conf diff --git a/ee4-config/wpsubdir/config/nginx/common/wpsubdir.conf b/ee4-config/wpsubdir/config/nginx/common/wpsubdir.conf new file mode 100644 index 000000000..58229c323 --- /dev/null +++ b/ee4-config/wpsubdir/config/nginx/common/wpsubdir.conf @@ -0,0 +1,10 @@ +# WPSUBDIRECTORY NGINX CONFIGURATION +# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee) +if (!-e $request_filename) { +# Redirect wp-admin to wp-admin/ +rewrite /wp-admin$ $scheme://$host$uri/ permanent; +# Redirect wp-* files/folders +rewrite ^(/[^/]+)?(/wp-.*) $2 last; +# Redirect other php files +rewrite ^(/[^/]+)?(/.*\.php) $2 last; +} \ No newline at end of file diff --git a/ee4-config/wpsubdir/config/nginx/default.conf b/ee4-config/wpsubdir/config/nginx/default.conf new file mode 100644 index 000000000..2ef7fe7b7 --- /dev/null +++ b/ee4-config/wpsubdir/config/nginx/default.conf @@ -0,0 +1,17 @@ +server { + access_log /var/log/nginx/access.log; + error_log /var/log/nginx/error.log; + + root /var/www/html; + + server_name {V_HOST}; + + index index.php index.html index.htm; + + include common/wpsubdir.conf; + include common/php.conf; + include common/wpcommon.conf; + include common/locations.conf; + + client_max_body_size 100m; +} From 8534ee894196b719797d93a332c13b7fa0e946e4 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Sun, 15 Apr 2018 22:55:17 +0530 Subject: [PATCH 0075/1044] Update config files server_name and pma --- ee4-config/wp/config/nginx/common/locations.conf | 6 +++--- ee4-config/wp/config/nginx/default.conf | 2 +- ee4-config/wpredis/config/nginx/common/locations.conf | 6 +++--- ee4-config/wpredis/config/nginx/default.conf | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ee4-config/wp/config/nginx/common/locations.conf b/ee4-config/wp/config/nginx/common/locations.conf index 1a0f8b5c4..a45de4d74 100644 --- a/ee4-config/wp/config/nginx/common/locations.conf +++ b/ee4-config/wp/config/nginx/common/locations.conf @@ -57,13 +57,13 @@ location ~ ^/(status|ping) { # EasyEngine (ee) utilities # phpMyAdmin settings location /pma { - return 301 https://$host:22222/db/pma; + return 301 http://pma.$host; } location /phpMyAdmin { - return 301 https://$host:22222/db/pma; + return 301 http://pma.$host; } location /phpmyadmin { - return 301 https://$host:22222/db/pma; + return 301 http://pma.$host; } # Adminer settings location /adminer { diff --git a/ee4-config/wp/config/nginx/default.conf b/ee4-config/wp/config/nginx/default.conf index ac2169817..ca30b4195 100644 --- a/ee4-config/wp/config/nginx/default.conf +++ b/ee4-config/wp/config/nginx/default.conf @@ -4,7 +4,7 @@ server { root /var/www/html; - server_name _; + server_name {V_HOST}; index index.php index.html index.htm; diff --git a/ee4-config/wpredis/config/nginx/common/locations.conf b/ee4-config/wpredis/config/nginx/common/locations.conf index 1a0f8b5c4..a45de4d74 100644 --- a/ee4-config/wpredis/config/nginx/common/locations.conf +++ b/ee4-config/wpredis/config/nginx/common/locations.conf @@ -57,13 +57,13 @@ location ~ ^/(status|ping) { # EasyEngine (ee) utilities # phpMyAdmin settings location /pma { - return 301 https://$host:22222/db/pma; + return 301 http://pma.$host; } location /phpMyAdmin { - return 301 https://$host:22222/db/pma; + return 301 http://pma.$host; } location /phpmyadmin { - return 301 https://$host:22222/db/pma; + return 301 http://pma.$host; } # Adminer settings location /adminer { diff --git a/ee4-config/wpredis/config/nginx/default.conf b/ee4-config/wpredis/config/nginx/default.conf index d088a4e02..9ca0eedb9 100644 --- a/ee4-config/wpredis/config/nginx/default.conf +++ b/ee4-config/wpredis/config/nginx/default.conf @@ -4,7 +4,7 @@ server { root /var/www/html; - server_name _; + server_name {V_HOST}; index index.php index.html index.htm; From 8d05a49baef1a6a69db43457742b365b47f2cfaa Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Mon, 16 Apr 2018 16:13:52 +0530 Subject: [PATCH 0076/1044] Create default configuration folder for common files --- .../{wp => default}/config/.env.example | 0 .../config/nginx/common/locations.conf | 0 .../config/nginx/common/wpcommon.conf | 0 .../{wp => default}/config/php-fpm/php.ini | 0 ee4-config/wpredis/config/.env.example | 10 --- .../config/nginx/common/locations.conf | 76 ------------------- .../wpredis/config/nginx/common/wpcommon.conf | 35 --------- ee4-config/wpredis/config/php-fpm/php.ini | 7 -- 8 files changed, 128 deletions(-) rename ee4-config/{wp => default}/config/.env.example (100%) rename ee4-config/{wp => default}/config/nginx/common/locations.conf (100%) rename ee4-config/{wp => default}/config/nginx/common/wpcommon.conf (100%) rename ee4-config/{wp => default}/config/php-fpm/php.ini (100%) delete mode 100644 ee4-config/wpredis/config/.env.example delete mode 100644 ee4-config/wpredis/config/nginx/common/locations.conf delete mode 100644 ee4-config/wpredis/config/nginx/common/wpcommon.conf delete mode 100644 ee4-config/wpredis/config/php-fpm/php.ini diff --git a/ee4-config/wp/config/.env.example b/ee4-config/default/config/.env.example similarity index 100% rename from ee4-config/wp/config/.env.example rename to ee4-config/default/config/.env.example diff --git a/ee4-config/wp/config/nginx/common/locations.conf b/ee4-config/default/config/nginx/common/locations.conf similarity index 100% rename from ee4-config/wp/config/nginx/common/locations.conf rename to ee4-config/default/config/nginx/common/locations.conf diff --git a/ee4-config/wp/config/nginx/common/wpcommon.conf b/ee4-config/default/config/nginx/common/wpcommon.conf similarity index 100% rename from ee4-config/wp/config/nginx/common/wpcommon.conf rename to ee4-config/default/config/nginx/common/wpcommon.conf diff --git a/ee4-config/wp/config/php-fpm/php.ini b/ee4-config/default/config/php-fpm/php.ini similarity index 100% rename from ee4-config/wp/config/php-fpm/php.ini rename to ee4-config/default/config/php-fpm/php.ini diff --git a/ee4-config/wpredis/config/.env.example b/ee4-config/wpredis/config/.env.example deleted file mode 100644 index 30c3cc7b2..000000000 --- a/ee4-config/wpredis/config/.env.example +++ /dev/null @@ -1,10 +0,0 @@ -MYSQL_ROOT_PASSWORD=password -MYSQL_DATABASE=wordpress -MYSQL_USER=wordpress -MYSQL_PASSWORD=password - -WORDPRESS_DB_HOST=db -VIRTUAL_HOST={V_HOST} -VIRTUAL_HOST_EMAIL=example@{V_HOST} -USER_ID=1000 -GROUP_ID=1000 diff --git a/ee4-config/wpredis/config/nginx/common/locations.conf b/ee4-config/wpredis/config/nginx/common/locations.conf deleted file mode 100644 index a45de4d74..000000000 --- a/ee4-config/wpredis/config/nginx/common/locations.conf +++ /dev/null @@ -1,76 +0,0 @@ -# NGINX CONFIGURATION FOR COMMON LOCATION -# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee) -# Basic locations files -location = /favicon.ico { - access_log off; - log_not_found off; - expires max; -} - -location = /robots.txt { - # Some WordPress plugin gererate robots.txt file - # Refer #340 issue - - return 200 'User-agent: * -Disallow: /'; - access_log off; - log_not_found off; -} -# Cache static files -location ~* \.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf|swf)$ { - add_header "Access-Control-Allow-Origin" "*"; - access_log off; - log_not_found off; - expires max; -} -# Security settings for better privacy -# Deny hidden files -location /.well-known { - allow all; -} -location ~ /\. { - deny all; - access_log off; - log_not_found off; -} -# Deny backup extensions & log files -location ~* ^.+\.(bak|log|old|orig|original|php#|php~|php_bak|save|swo|swp|sql)$ { - deny all; - access_log off; - log_not_found off; -} -# Return 403 forbidden for readme.(txt|html) or license.(txt|html) or example.(txt|html) -if ($uri ~* "^.+(readme|license|example)\.(txt|html)$") { - return 403; -} -# Status pages -location /nginx_status { - stub_status on; - access_log off; - -} -location ~ ^/(status|ping) { - include fastcgi_params; - fastcgi_pass php:9000; - -} -# EasyEngine (ee) utilities -# phpMyAdmin settings -location /pma { - return 301 http://pma.$host; -} -location /phpMyAdmin { - return 301 http://pma.$host; -} -location /phpmyadmin { - return 301 http://pma.$host; -} -# Adminer settings -location /adminer { - return 301 https://$host:22222/db/adminer; -} - -location ~* \.(css|js)$ { - expires 5s; - add_header Cache-Control "public, must-revalidate"; -} diff --git a/ee4-config/wpredis/config/nginx/common/wpcommon.conf b/ee4-config/wpredis/config/nginx/common/wpcommon.conf deleted file mode 100644 index be7795e1c..000000000 --- a/ee4-config/wpredis/config/nginx/common/wpcommon.conf +++ /dev/null @@ -1,35 +0,0 @@ -# WordPress COMMON SETTINGS -# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee) -# Limit access to avoid brute force attack -location = /wp-login.php { - limit_req zone=one burst=1 nodelay; - include fastcgi_params; - fastcgi_pass php:9000; -} -# Disable wp-config.txt -location = /wp-config.txt { - deny all; - access_log off; - log_not_found off; -} -# Disallow php in upload folder -location /wp-content/uploads/ { - location ~ \.php$ { - #Prevent Direct Access Of PHP Files From Web Browsers - deny all; - } -} -# Yoast sitemap -location ~ ([^/]*)sitemap(.*)\.x(m|s)l$ { - rewrite ^/sitemap\.xml$ /sitemap_index.xml permanent; - rewrite ^/([a-z]+)?-?sitemap\.xsl$ /index.php?xsl=$1 last; - # Rules for yoast sitemap with wp|wpsubdir|wpsubdomain - rewrite ^.*/sitemap_index\.xml$ /index.php?sitemap=1 last; - rewrite ^.*/([^/]+?)-sitemap([0-9]+)?\.xml$ /index.php?sitemap=$1&sitemap_n=$2 last; - # Following lines are options. Needed for WordPress seo addons - rewrite ^/news_sitemap\.xml$ /index.php?sitemap=wpseo_news last; - rewrite ^/locations\.kml$ /index.php?sitemap=wpseo_local_kml last; - rewrite ^/geo_sitemap\.xml$ /index.php?sitemap=wpseo_local last; - rewrite ^/video-sitemap\.xsl$ /index.php?xsl=video last; - access_log off; -} diff --git a/ee4-config/wpredis/config/php-fpm/php.ini b/ee4-config/wpredis/config/php-fpm/php.ini deleted file mode 100644 index c5964c495..000000000 --- a/ee4-config/wpredis/config/php-fpm/php.ini +++ /dev/null @@ -1,7 +0,0 @@ -# Custom PHP settings - -upload_max_filesize = 100M -post_max_size = 100M - -[mail function] -sendmail_path = /usr/sbin/sendmail -S mail:1025 From dae9de1c5a8d40a1eb41ca4c4378dacb78633dee Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Mon, 16 Apr 2018 17:04:58 +0530 Subject: [PATCH 0077/1044] Make function static --- php/class-ee-docker.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php index cebc8b669..0af8cc278 100644 --- a/php/class-ee-docker.php +++ b/php/class-ee-docker.php @@ -159,7 +159,7 @@ public static function start_container( $container ) { * * @return bool success. */ - private function create_container( $container, $command = '' ) { + public static function create_container( $container, $command = '' ) { $HOME = HOME; From 38442e88d8b4ed39a1daa47982adcbb52a71fc5f Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Mon, 16 Apr 2018 19:41:20 +0530 Subject: [PATCH 0078/1044] Composer lock update for multi-site --- composer.lock | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/composer.lock b/composer.lock index f6cf6bb8e..f322a0dd1 100644 --- a/composer.lock +++ b/composer.lock @@ -64,16 +64,16 @@ }, { "name": "composer/composer", - "version": "1.6.3", + "version": "1.6.4", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "88a69fda0f2187ad8714cedffd7a8872dceaa4c2" + "reference": "86ad51e8a3c64c9782446aae740a61fc6faa2522" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/88a69fda0f2187ad8714cedffd7a8872dceaa4c2", - "reference": "88a69fda0f2187ad8714cedffd7a8872dceaa4c2", + "url": "https://api.github.com/repos/composer/composer/zipball/86ad51e8a3c64c9782446aae740a61fc6faa2522", + "reference": "86ad51e8a3c64c9782446aae740a61fc6faa2522", "shasum": "" }, "require": { @@ -137,7 +137,7 @@ "dependency", "package" ], - "time": "2018-01-31T15:28:18+00:00" + "time": "2018-04-13T10:04:24+00:00" }, { "name": "composer/semver", @@ -268,12 +268,12 @@ "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "f62bd63b04bfe89de794cc08d2d63e6b8a4a48c4" + "reference": "a9558e1eb32c9a322732d0932ede0ff8601f82ec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/f62bd63b04bfe89de794cc08d2d63e6b8a4a48c4", - "reference": "f62bd63b04bfe89de794cc08d2d63e6b8a4a48c4", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/a9558e1eb32c9a322732d0932ede0ff8601f82ec", + "reference": "a9558e1eb32c9a322732d0932ede0ff8601f82ec", "shasum": "" }, "type": "ee-cli-package", @@ -302,7 +302,7 @@ "MIT" ], "homepage": "https://github.com/easyengine/site-command", - "time": "2018-04-09T11:25:52+00:00" + "time": "2018-04-16T14:03:46+00:00" }, { "name": "easyengine/wp-command", @@ -2139,12 +2139,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "c83f6aa0ed08f680c012656d411d1b7c94003012" + "reference": "bf3a473c42c3640103645f9477fd425749341780" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/c83f6aa0ed08f680c012656d411d1b7c94003012", - "reference": "c83f6aa0ed08f680c012656d411d1b7c94003012", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/bf3a473c42c3640103645f9477fd425749341780", + "reference": "bf3a473c42c3640103645f9477fd425749341780", "shasum": "" }, "conflict": { @@ -2189,6 +2189,7 @@ "illuminate/database": ">=4,<4.0.99|>=4.1,<4.1.29", "illuminate/encryption": ">=4,<=4.0.11|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.40|>=5.6,<5.6.15", "joomla/session": "<1.3.1", + "kreait/firebase-php": ">=3.2,<3.8.1", "laravel/framework": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.40|>=5.6,<5.6.15", "laravel/socialite": ">=1,<1.0.99|>=2,<2.0.10", "magento/magento1ce": ">=1.5.0.1,<1.9.3.2", @@ -2202,6 +2203,7 @@ "padraic/humbug_get_contents": "<1.1.2", "pagarme/pagarme-php": ">=0,<3", "paragonie/random_compat": "<2", + "paypal/merchant-sdk-php": "<3.12", "phpmailer/phpmailer": ">=5,<5.2.24", "phpunit/phpunit": ">=4.8.19,<4.8.28|>=5.0.10,<5.6.3", "phpxmlrpc/extras": "<0.6.1", @@ -2217,6 +2219,7 @@ "simplesamlphp/saml2": "<1.10.6|>=2,<2.3.8|>=3,<3.1.4", "simplesamlphp/simplesamlphp": "<1.15.2", "simplesamlphp/simplesamlphp-module-infocard": "<1.0.1", + "slim/slim": "<2.6", "socalnick/scn-social-auth": "<1.15.2", "squizlabs/php_codesniffer": ">=1,<2.8.1|>=3,<3.0.1", "stormpath/sdk": ">=0,<9.9.99", @@ -2291,7 +2294,7 @@ } ], "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", - "time": "2018-04-02T06:47:13+00:00" + "time": "2018-04-14T07:19:11+00:00" }, { "name": "squizlabs/php_codesniffer", From c87e565aeebcf7a9fa5ea524737dd17b30176d73 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Mon, 16 Apr 2018 19:50:18 +0530 Subject: [PATCH 0079/1044] Add help flag compatiblity --- php/EE/Runner.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index f41a37b3d..cda8ce5a0 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -522,6 +522,12 @@ public function init_config() { { list( $args, $assoc_args, $this->runtime_config ) = $configurator->parse_args( $argv ); + // foo --help -> help foo + if ( isset( $assoc_args['help'] ) ) { + array_unshift( $args, 'help' ); + unset( $assoc_args['help'] ); + } + list( $this->arguments, $this->assoc_args ) = [ $args, $assoc_args ]; $configurator->merge_array( $this->runtime_config ); From 4ac73a619d218fa356a42fe29d45633fe676d4ba Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Mon, 16 Apr 2018 20:01:31 +0530 Subject: [PATCH 0080/1044] Remove letsencrypt from mail --- php/class-ee-docker.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php index 0af8cc278..9ac030a55 100644 --- a/php/class-ee-docker.php +++ b/php/class-ee-docker.php @@ -83,11 +83,7 @@ public static function generate_docker_composer_yml( array $filters = [] ) { $mail['image'] = array( 'name' => 'easyengine/mail' ); $mail['restart'] = $restart_default; $mail['command'] = array( 'name' => '["-invite-jim=false"]' ); - if ( in_array( 'le', $filters ) ) { - $mail['environment'] = array( 'env' => array( array( 'name' => 'VIRTUAL_HOST=mail.${VIRTUAL_HOST}' ), array( 'name' => 'VIRTUAL_PORT=8025' ), array( 'name' => 'LETSENCRYPT_HOST=${VIRTUAL_HOST}' ), array( 'name' => 'LETSENCRYPT_EMAIL=${VIRTUAL_HOST_EMAIL}' ) ) ); - } else { - $mail['environment'] = array( 'env' => array( array( 'name' => 'VIRTUAL_HOST=mail.${VIRTUAL_HOST}' ), array( 'name' => 'VIRTUAL_PORT=8025' ) ) ); - } + $mail['environment'] = array( 'env' => array( array( 'name' => 'VIRTUAL_HOST=mail.${VIRTUAL_HOST}' ), array( 'name' => 'VIRTUAL_PORT=8025' ) ) ); $mail['networks'] = $network_default; $base[] = $db; From e717a4c7a346f14c02f0512eb1c18a710aee4a15 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Tue, 17 Apr 2018 11:15:06 +0530 Subject: [PATCH 0081/1044] Display docker error msg --- php/class-ee-docker.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php index 0af8cc278..58a6a0d85 100644 --- a/php/class-ee-docker.php +++ b/php/class-ee-docker.php @@ -174,7 +174,12 @@ public static function create_container( $container, $command = '' ) { break; } - return default_launch( $command ); + $launch = EE::launch( $command, false, true ); + default_debug( $launch ); + if ( ! $launch->return_code ) { + return true; + } + EE::error( $launch->stderr ); } /** From 9567c7cd1b419682a0d00217ec3b5a3f9d5351e4 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Tue, 17 Apr 2018 12:19:43 +0530 Subject: [PATCH 0082/1044] Update docker-compose up function --- php/class-ee-docker.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php index 0af8cc278..be250cc6d 100644 --- a/php/class-ee-docker.php +++ b/php/class-ee-docker.php @@ -233,15 +233,10 @@ public static function disconnect_network( $name, $connected_to ) { public static function docker_compose_up( $dir ) { $chdir_return_code = chdir( $dir ); if ( $chdir_return_code ) { - $docker_compose_up = EE::launch( "docker-compose up -d", false, true ); - default_debug( $docker_compose_up ); - - if ( $docker_compose_up->return_code ) { - throw new Exception( 'There was some error in docker-compose up.' ); - } - } else { - throw new Exception( 'Error in changing directory.' ); + return default_launch( 'docker-compose up -d' ); } + + return false; } /** From 10128aa04d0a50f21d0e583158da98e4338d6a03 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Tue, 17 Apr 2018 12:20:33 +0530 Subject: [PATCH 0083/1044] Add update function --- php/class-ee-db.php | 63 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 52 insertions(+), 11 deletions(-) diff --git a/php/class-ee-db.php b/php/class-ee-db.php index 77d796287..e3173d8b1 100644 --- a/php/class-ee-db.php +++ b/php/class-ee-db.php @@ -140,28 +140,47 @@ public static function select( $columns = array(), $where = array() ) { return $select_data; } + /** - * Check if a site entry exists in the database. + * Update row in table. * - * @param String $site_name Name of the site to be checked. + * @param $data + * @param $where * - * @return bool Success. + * @return bool */ - public static function site_in_db( $site_name ) { - + public static function update( $data, $where ) { if ( empty ( self::$db ) ) { self::init_db(); } - $site = self::select( array( 'id' ), array( 'sitename' => $site_name ) ); + $table_name = TABLE; - if ( $site ) { - return true; - } else { - return false; + $fields = array(); + $conditions = array(); + foreach ( $data as $key => $value ) { + $fields[] = "`$key`='" . $value . "'"; + } + foreach ( $where as $key => $value ) { + $conditions[] = "`$key`='" . $value . "'"; + } + $fields = implode( ', ', $fields ); + $conditions = implode( ' AND ', $conditions ); + if ( ! empty( $fields ) ) { + $update_query = "UPDATE `$table_name` SET $fields WHERE $conditions"; + $update_query_exec = self::$db->exec( $update_query ); + if ( ! $update_query_exec ) { + EE::debug( self::$db->lastErrorMsg() ); + self::$db->close(); + } else { + self::$db->close(); + + return true; + } } - } + return false; + } /** * Delete data from table. @@ -195,4 +214,26 @@ public static function delete( $where ) { return false; } + + /** + * Check if a site entry exists in the database. + * + * @param String $site_name Name of the site to be checked. + * + * @return bool Success. + */ + public static function site_in_db( $site_name ) { + + if ( empty ( self::$db ) ) { + self::init_db(); + } + + $site = self::select( array( 'id' ), array( 'sitename' => $site_name ) ); + + if ( $site ) { + return true; + } else { + return false; + } + } } From dc2bed2cb4db089688654abc63c2b76500930544 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Tue, 17 Apr 2018 18:11:14 +0530 Subject: [PATCH 0084/1044] composer.lock update for site enable-disable --- composer.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.lock b/composer.lock index f322a0dd1..532a44382 100644 --- a/composer.lock +++ b/composer.lock @@ -268,12 +268,12 @@ "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "a9558e1eb32c9a322732d0932ede0ff8601f82ec" + "reference": "5fc76c0d0eecd9f1cdda7691eb336a375a56da74" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/a9558e1eb32c9a322732d0932ede0ff8601f82ec", - "reference": "a9558e1eb32c9a322732d0932ede0ff8601f82ec", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/5fc76c0d0eecd9f1cdda7691eb336a375a56da74", + "reference": "5fc76c0d0eecd9f1cdda7691eb336a375a56da74", "shasum": "" }, "type": "ee-cli-package", @@ -302,7 +302,7 @@ "MIT" ], "homepage": "https://github.com/easyengine/site-command", - "time": "2018-04-16T14:03:46+00:00" + "time": "2018-04-17T12:30:50+00:00" }, { "name": "easyengine/wp-command", From e34a53503ba3b862fbae9603895bf0d6467db3cc Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Tue, 17 Apr 2018 20:13:28 +0530 Subject: [PATCH 0085/1044] Add docker not installed error msg --- php/class-ee-docker.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php index c3f80ecc2..7330bf994 100644 --- a/php/class-ee-docker.php +++ b/php/class-ee-docker.php @@ -83,8 +83,8 @@ public static function generate_docker_composer_yml( array $filters = [] ) { $mail['image'] = array( 'name' => 'easyengine/mail' ); $mail['restart'] = $restart_default; $mail['command'] = array( 'name' => '["-invite-jim=false"]' ); - $mail['environment'] = array( 'env' => array( array( 'name' => 'VIRTUAL_HOST=mail.${VIRTUAL_HOST}' ), array( 'name' => 'VIRTUAL_PORT=8025' ) ) ); - $mail['networks'] = $network_default; + $mail['environment'] = array( 'env' => array( array( 'name' => 'VIRTUAL_HOST=mail.${VIRTUAL_HOST}' ), array( 'name' => 'VIRTUAL_PORT=8025' ) ) ); + $mail['networks'] = $network_default; $base[] = $db; $base[] = $php; @@ -123,6 +123,13 @@ public static function boot_container( $container ) { } public static function container_status( $container ) { + $exec_command = 'which docker'; + exec( $exec_command, $out, $ret ); + EE::debug( 'COMMAND: ' . $exec_command ); + EE::debug( 'RETURN CODE: ' . $ret ); + if ( $ret ) { + EE::error( 'Docker is not installed. Please install Docker to run EasyEngine.' ); + } $status = EE::launch( "docker inspect -f '{{.State.Running}}' $container", false, true ); default_debug( $status ); if ( ! $status->return_code ) { From 1e36ce9c4c2ff4309f6bd94535531547dccff614 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Tue, 17 Apr 2018 20:14:17 +0530 Subject: [PATCH 0086/1044] Update config files for multisite redis --- .../config/nginx/common/redis.conf | 57 +++++++++++++++++++ .../config/nginx/common/wpsubdir.conf | 10 ++++ .../wpredis-subdir/config/nginx/default.conf | 18 ++++++ .../wpsubdir/config/nginx/common/php.conf | 11 ++++ 4 files changed, 96 insertions(+) create mode 100644 ee4-config/wpredis-subdir/config/nginx/common/redis.conf create mode 100644 ee4-config/wpredis-subdir/config/nginx/common/wpsubdir.conf create mode 100644 ee4-config/wpredis-subdir/config/nginx/default.conf create mode 100644 ee4-config/wpsubdir/config/nginx/common/php.conf diff --git a/ee4-config/wpredis-subdir/config/nginx/common/redis.conf b/ee4-config/wpredis-subdir/config/nginx/common/redis.conf new file mode 100644 index 000000000..5bf2d2f29 --- /dev/null +++ b/ee4-config/wpredis-subdir/config/nginx/common/redis.conf @@ -0,0 +1,57 @@ +# Redis NGINX CONFIGURATION +# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee) +set $skip_cache 0; +# POST requests and URL with a query string should always go to php +if ($request_method = POST) { + set $skip_cache 1; +} +if ($query_string != "") { + set $skip_cache 1; +} +# Don't cache URL containing the following segments +if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|wp-.*.php|index.php|/feed/|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") { + set $skip_cache 1; +} +# Don't use the cache for logged in users or recent commenter or customer with items in cart +if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|woocommerce_items_in_cart") { + set $skip_cache 1; +} +# Use cached or actual file if they exists, Otherwise pass request to WordPress +location / { + try_files $uri $uri/ /index.php?$args; +} + +location /redis-fetch { + internal ; + set $redis_key $args; + redis_pass ee4_redis:6379; +} +location /redis-store { + internal ; + set_unescape_uri $key $arg_key ; + redis2_query set $key $echo_request_body; + redis2_query expire $key 14400; + redis2_pass ee4_redis:6379; +} + +location ~ \.php$ { +# add_header Cache-Control "max-age=0, no-cache, no-store, must-revalidate"; + set $key "nginx-cache:$scheme$request_method$host$request_uri"; + try_files $uri =404; + + srcache_fetch_skip $skip_cache; + srcache_store_skip $skip_cache; + + srcache_response_cache_control off; + + set_escape_uri $escaped_key $key; + + srcache_fetch GET /redis-fetch $key; + srcache_store PUT /redis-store key=$escaped_key; + + more_set_headers 'X-SRCache-Fetch-Status $srcache_fetch_status'; + more_set_headers 'X-SRCache-Store-Status $srcache_store_status'; + + include fastcgi_params; + fastcgi_pass php:9000; +} diff --git a/ee4-config/wpredis-subdir/config/nginx/common/wpsubdir.conf b/ee4-config/wpredis-subdir/config/nginx/common/wpsubdir.conf new file mode 100644 index 000000000..58229c323 --- /dev/null +++ b/ee4-config/wpredis-subdir/config/nginx/common/wpsubdir.conf @@ -0,0 +1,10 @@ +# WPSUBDIRECTORY NGINX CONFIGURATION +# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee) +if (!-e $request_filename) { +# Redirect wp-admin to wp-admin/ +rewrite /wp-admin$ $scheme://$host$uri/ permanent; +# Redirect wp-* files/folders +rewrite ^(/[^/]+)?(/wp-.*) $2 last; +# Redirect other php files +rewrite ^(/[^/]+)?(/.*\.php) $2 last; +} \ No newline at end of file diff --git a/ee4-config/wpredis-subdir/config/nginx/default.conf b/ee4-config/wpredis-subdir/config/nginx/default.conf new file mode 100644 index 000000000..3b71e2ec6 --- /dev/null +++ b/ee4-config/wpredis-subdir/config/nginx/default.conf @@ -0,0 +1,18 @@ +server { + access_log /var/log/nginx/access.log; + error_log /var/log/nginx/error.log; + + root /var/www/html; + + server_name {V_HOST}; + + index index.php index.html index.htm; + + + include common/redis.conf; + include common/wpsubdir.conf; + include common/wpcommon.conf; + include common/locations.conf; + + client_max_body_size 100m; +} diff --git a/ee4-config/wpsubdir/config/nginx/common/php.conf b/ee4-config/wpsubdir/config/nginx/common/php.conf new file mode 100644 index 000000000..9b38372bb --- /dev/null +++ b/ee4-config/wpsubdir/config/nginx/common/php.conf @@ -0,0 +1,11 @@ +# PHP NGINX CONFIGURATION +# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee) +location / { + try_files $uri $uri/ /index.php?$args; +} +location ~ \.php$ { + try_files $uri =404; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + include fastcgi_params; + fastcgi_pass php:9000; +} From e27744ace19803aa98af8cb8dda378b9bc3f5d5c Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Tue, 17 Apr 2018 20:29:15 +0530 Subject: [PATCH 0087/1044] composer.lock update for multi-site-redis --- composer.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.lock b/composer.lock index 532a44382..4299a01fa 100644 --- a/composer.lock +++ b/composer.lock @@ -268,12 +268,12 @@ "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "5fc76c0d0eecd9f1cdda7691eb336a375a56da74" + "reference": "48dd0a1b8169230f03bc3428aed494cd46002658" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/5fc76c0d0eecd9f1cdda7691eb336a375a56da74", - "reference": "5fc76c0d0eecd9f1cdda7691eb336a375a56da74", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/48dd0a1b8169230f03bc3428aed494cd46002658", + "reference": "48dd0a1b8169230f03bc3428aed494cd46002658", "shasum": "" }, "type": "ee-cli-package", @@ -302,7 +302,7 @@ "MIT" ], "homepage": "https://github.com/easyengine/site-command", - "time": "2018-04-17T12:30:50+00:00" + "time": "2018-04-17T14:56:16+00:00" }, { "name": "easyengine/wp-command", From c7cb95f53c4165535e33e41341725c44d96b55f6 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Fri, 20 Apr 2018 19:22:46 +0530 Subject: [PATCH 0088/1044] Add core repo structure documentation --- docs/core-repo-structure.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 docs/core-repo-structure.md diff --git a/docs/core-repo-structure.md b/docs/core-repo-structure.md new file mode 100644 index 000000000..7c36dec47 --- /dev/null +++ b/docs/core-repo-structure.md @@ -0,0 +1,20 @@ +EasyEngine Core Repository +=== + +The core repository contains the cli interface for EasyEngine and the internal api's to facilitate and accomodate the creation and execution of commands. It is built on top of [WP-CLI](https://github.com/wp-cli/wp-cli) and follows the same basic structure. + +1. `bin` folder contains the wrapper shell script to execute EasyEngine. +2. `ci` folder contains shell scripts to automate the phar building and deploying of the same to the [easyengine-builds](https://github.com/easyengine/easyengine-builds) repository with the help of [travis-ci](https://travis-ci.org/). +3. `ee4-config` folder has all the `nginx, php and redis` configurations requiered for different types of sites like `WordPress - Single-Site, Multi-Site` etc. +4. The `php` folder contains the main part of EasyEngine cli. + * It conatins the `cli-command` which handles the most basic required functions like: `version, update` etc. + * The [WP-CLI internal-api](https://github.com/wp-cli/handbook/blob/master/internal-api.md), booting and auto-loading logic and other utilities. + * It also contains new classes: + * `EE_DB` having the generic Sqlite3 functions for db management. + * `EE_DOCKER` having various docker related functions like starting, stopping and inspecting containers, creating and connecting to networks, generating `docker-compose.yml`. + * Also, the internal-api has been slightly modified to remove WordPress specific functions and additional features like, logging of all the command invocation and related log, success, debug and error messages from `EE::info(), EE::success(), EE::debug(), EE::error()` outputs into a file for debugging purposes. +5. `templates` folder conatins the [mustache](https://mustache.github.io/) templates for man/help, generation of `docker-compose.yml` etc. +6. `utils` folder contains the scripts for `phar` generation. + + + From 98bcd7522c1369bf592418f15263ebac2fd8b9ff Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Fri, 20 Apr 2018 19:23:06 +0530 Subject: [PATCH 0089/1044] Add build and release documentation --- docs/build-and-release.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 docs/build-and-release.md diff --git a/docs/build-and-release.md b/docs/build-and-release.md new file mode 100644 index 000000000..2a6497585 --- /dev/null +++ b/docs/build-and-release.md @@ -0,0 +1,12 @@ +Build and Release Process +=== + +Currently EasyEngine v4 is in development stage. Hence the main branch for v4 is [release/v4](https://github.com/easyengine/easyengine/tree/release/v4) and the ongoing development branch is [develop-v4](https://github.com/easyengine/easyengine/tree/develop-v4). + +The current build and release process uses [travis-ci](https://travis-ci.org/) and docker build triggers. + +* Whenever any commit is pushed or merged into the `develop-v4` branch, it trigggers the travis-ci to generate a `nightly phar` and commits it to the [easyengine-builds](https://github.com/easyengine/easyengine-builds) repository, after that the docker build trigger for the `latest` tag is invoked and it takes the newly committed `nightly phar` and builds the `base image` with it. + +* Simillarly, whenever any commit is pushed or merged into the `releas/v4` branch, it trigggers the travis-ci to generate a `stable phar` and commits it to the [easyengine-builds](https://github.com/easyengine/easyengine-builds) repository, after that the docker build trigger for the `stable` tag is invoked and it takes the newly committed `stable phar` and builds the `base image` with it. + +As there are a few issues with docker build triggers and the build fails at times, we may shift to builduing and pushing the docker image from travis-ci itself in the near future. \ No newline at end of file From 1486891a3fd0cf89889d7813e0fd91f5f3a9874c Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Fri, 20 Apr 2018 19:23:34 +0530 Subject: [PATCH 0090/1044] Add test documentation --- docs/test-documentation.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 docs/test-documentation.md diff --git a/docs/test-documentation.md b/docs/test-documentation.md new file mode 100644 index 000000000..79940ac26 --- /dev/null +++ b/docs/test-documentation.md @@ -0,0 +1,5 @@ +Test Documentation +=== + +Like [WP-CLI](https://github.com/wp-cli/wp-cli), EasyEngine also uses Behat to run it’s functional tests. + From b8b46d815e52ab2f5217524ada2cb0e272300520 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Fri, 20 Apr 2018 19:24:01 +0530 Subject: [PATCH 0091/1044] Add structure for multiple repo documentation --- docs/structure-for-multiple-repos.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 docs/structure-for-multiple-repos.md diff --git a/docs/structure-for-multiple-repos.md b/docs/structure-for-multiple-repos.md new file mode 100644 index 000000000..493b66b43 --- /dev/null +++ b/docs/structure-for-multiple-repos.md @@ -0,0 +1,8 @@ +Structure For Multiple Reops +===== + +EasyEngine v4 follows [WP-CLI](https://github.com/wp-cli/wp-cli) as the base of creation, hence it consists of multiple repos. The core repo [EasyEngine](https://github.com/EasyEngine/easyengine) contains the main structure and cli interface to facilitate the execution of all the commands. + +Each command has a seperate repository like: [site-command](https://github.com/easyengine/site-command), [wp-command](https://github.com/easyengine/wp-command) etc., and they are added as commands to EasyEngine via composer packages. + +Apart from the commands there are also other miscellaneous repositories like the [easyengine-builds](https://github.com/easyengine/easyengine-builds) that contains the stable as well as nightly builds of phar generated from the main repository, [dockerfiles](https://github.com/easyengine/dockerfiles) repository contains all the dockerfiles that are in use by EasyEngine. \ No newline at end of file From 57e4721bac7cb75c4b48e2c764835dc20d6be423 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Tue, 24 Apr 2018 16:42:04 +0530 Subject: [PATCH 0092/1044] Add developer docs --- docs/developer-docs.md | 49 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 docs/developer-docs.md diff --git a/docs/developer-docs.md b/docs/developer-docs.md new file mode 100644 index 000000000..607b6cb8c --- /dev/null +++ b/docs/developer-docs.md @@ -0,0 +1,49 @@ +EasyEngine Developer Docs +========================= + +## Requirements + +* Git +* PHP +* Composer + +## Steps + +1. Before starting refer the [core repository structure](https://github.com/EasyEngine/easyengine/blob/develop-v4/docs/core-repo-structure.md) and the [structure for multiple repositories](https://github.com/EasyEngine/easyengine/blob/develop-v4/docs/structure-for-multiple-repos.md). + +2. Fork the template repository and rename it to the command you want to create. This will now look like `author/command-name` in your github. + +3. Update the `name` and `homepage` in the `composer.json` of the cloned repository. If the name is not updated properly then composer update/install with it will fail. + +3. Clone the EasyEngine core repository locally and checkout the development branch. +```bash +git clone git@github.com:EasyEngine/easyengine.git && git checkout develop-v4 +``` +4. Update the `composer.json` in the core repository, add the following in `require`: +``` +"author/command-name": "dev-master" +``` +Also, append the follwing section in the `composer.json`: +``` +"repositories": { + "author/command-name": { + "type": "vcs", + "url": "git@github.com:author/command-name.git" + } +} +``` +Or, you can add your repository to packagist and run `composer reqiure author/name`. + +5. Run `composer update --prefer-source` in the core repository after this. +7. After that, try running the default command `hello-world` given in the template, it should give a success message as below: +```bash +$ ./bin/ee hello-world +Success: Hello world. +``` +6. Your repository will be in the vendor directory. + * Go to your repository directory: `cd vendor/author/command-name`. + * Try `git remote -v`, if you have already put the proper url and used `--prefer-source` during composer install then the `remote origin` will have your github url. + * In case that is missing, do `git remote add origin git@github.com:author/command-name.git`. + * Make changes inside the vendor directory itself to view your changes directly and keep commiting them regularly. + +Note: We are working on scaffold command and these manual steps will be replaced very soon. \ No newline at end of file From 15c9e0d09544340576ddebe19eed7553968bd606 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Tue, 24 Apr 2018 16:54:31 +0530 Subject: [PATCH 0093/1044] Add template repo url --- docs/developer-docs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/developer-docs.md b/docs/developer-docs.md index 607b6cb8c..390d2d0f6 100644 --- a/docs/developer-docs.md +++ b/docs/developer-docs.md @@ -11,7 +11,7 @@ EasyEngine Developer Docs 1. Before starting refer the [core repository structure](https://github.com/EasyEngine/easyengine/blob/develop-v4/docs/core-repo-structure.md) and the [structure for multiple repositories](https://github.com/EasyEngine/easyengine/blob/develop-v4/docs/structure-for-multiple-repos.md). -2. Fork the template repository and rename it to the command you want to create. This will now look like `author/command-name` in your github. +2. Fork the [command template repository](https://github.com/EasyEngine/command-template) and rename it to the command you want to create. This will now look like `author/command-name` in your github. 3. Update the `name` and `homepage` in the `composer.json` of the cloned repository. If the name is not updated properly then composer update/install with it will fail. From 8a513606292f479bff72bdbcaf8fc5ce9175354c Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Fri, 4 May 2018 08:13:56 +0530 Subject: [PATCH 0094/1044] Add dockerfile docs --- docs/docker-files.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 docs/docker-files.md diff --git a/docs/docker-files.md b/docs/docker-files.md new file mode 100644 index 000000000..02f5ee4ac --- /dev/null +++ b/docs/docker-files.md @@ -0,0 +1,18 @@ +Docker Files +============ + +1. nginx-proxy: EasyEngine nginx-proxy uses [jwilder/nginx-proxy](https://github.com/jwilder/nginx-proxy) as the base. Nginx-proxy sets up a container running nginx and docker-gen. docker-gen generates reverse proxy configs for nginx and reloads nginx when containers are started and stopped. The root permission in this image have been changed with user permission in the EasyEngine image. + +2. nginx: EasyEngine nginx image uses [openresty](https://github.com/openresty/docker-openresty) as the base. It is a full-fledged web application nginx server. Multiple additional modules have been added to make it similar to the EasyEngine version 3 nginx server as well as add things on top of it. + +3. php: EasyEngine php image uses [wordpress](https://github.com/docker-library/wordpress) as the base image. Additional php extension that may be required have been added on top of it, also the permissions of the site data on the host machine is given to the user creating the site in this image. + +4. redis: EasyEngine redis image uses [redis](https://github.com/docker-library/redis) image. + +5. mail: EasyEngine mail image uses [mailhog](https://github.com/mailhog/MailHog) image. + +6. db: EasyEngine db image uses [mariadb](https://github.com/docker-library/mariadb/) image. + +7. phpmyadmin: EasyEngine db image uses [phpmyadmin](https://github.com/phpmyadmin/docker) image. + +8. base: EasyEngine base image has been created by EasyEngine to facilitate the usage of EasyEngine v4 without any software dependency. Pulling and using this image will create the enviournment required to run EasyEngine and create the sites from this container with the help of the wrapper-script. The wrapper-script simply passes the parameters/arguments/flags given to it directly to the easyengine phar inside the easyengine base container for execution and running of EasyEngine. \ No newline at end of file From abeb81457d5aae3c685fadcdf93dafd81b333d60 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Fri, 4 May 2018 08:25:26 +0530 Subject: [PATCH 0095/1044] Fix minor spelling errors --- docs/build-and-release.md | 6 +++--- docs/core-repo-structure.md | 8 ++++---- docs/developer-docs.md | 4 ++-- docs/docker-files.md | 2 +- docs/structure-for-multiple-repos.md | 4 ++-- docs/test-documentation.md | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/build-and-release.md b/docs/build-and-release.md index 2a6497585..f390c7bbb 100644 --- a/docs/build-and-release.md +++ b/docs/build-and-release.md @@ -5,8 +5,8 @@ Currently EasyEngine v4 is in development stage. Hence the main branch for v4 is The current build and release process uses [travis-ci](https://travis-ci.org/) and docker build triggers. -* Whenever any commit is pushed or merged into the `develop-v4` branch, it trigggers the travis-ci to generate a `nightly phar` and commits it to the [easyengine-builds](https://github.com/easyengine/easyengine-builds) repository, after that the docker build trigger for the `latest` tag is invoked and it takes the newly committed `nightly phar` and builds the `base image` with it. +* Whenever any commit is pushed or merged into the `develop-v4` branch, it triggers the travis-ci to generate a `nightly phar` and commits it to the [easyengine-builds](https://github.com/easyengine/easyengine-builds) repository, after that the docker build trigger for the `latest` tag is invoked and it takes the newly committed `nightly phar` and builds the `base image` with it. -* Simillarly, whenever any commit is pushed or merged into the `releas/v4` branch, it trigggers the travis-ci to generate a `stable phar` and commits it to the [easyengine-builds](https://github.com/easyengine/easyengine-builds) repository, after that the docker build trigger for the `stable` tag is invoked and it takes the newly committed `stable phar` and builds the `base image` with it. +* Similarly, whenever any commit is pushed or merged into the `releas/v4` branch, it triggers the travis-ci to generate a `stable phar` and commits it to the [easyengine-builds](https://github.com/easyengine/easyengine-builds) repository, after that the docker build trigger for the `stable` tag is invoked and it takes the newly committed `stable phar` and builds the `base image` with it. -As there are a few issues with docker build triggers and the build fails at times, we may shift to builduing and pushing the docker image from travis-ci itself in the near future. \ No newline at end of file +As there are a few issues with docker build triggers and the build fails at times, we may shift to building and pushing the docker image from travis-ci itself in the near future. \ No newline at end of file diff --git a/docs/core-repo-structure.md b/docs/core-repo-structure.md index 7c36dec47..77e037e80 100644 --- a/docs/core-repo-structure.md +++ b/docs/core-repo-structure.md @@ -1,19 +1,19 @@ EasyEngine Core Repository === -The core repository contains the cli interface for EasyEngine and the internal api's to facilitate and accomodate the creation and execution of commands. It is built on top of [WP-CLI](https://github.com/wp-cli/wp-cli) and follows the same basic structure. +The core repository contains the cli interface for EasyEngine and the internal api's to facilitate and accommodate the creation and execution of commands. It is built on top of [WP-CLI](https://github.com/wp-cli/wp-cli) and follows the same basic structure. 1. `bin` folder contains the wrapper shell script to execute EasyEngine. 2. `ci` folder contains shell scripts to automate the phar building and deploying of the same to the [easyengine-builds](https://github.com/easyengine/easyengine-builds) repository with the help of [travis-ci](https://travis-ci.org/). -3. `ee4-config` folder has all the `nginx, php and redis` configurations requiered for different types of sites like `WordPress - Single-Site, Multi-Site` etc. +3. `ee4-config` folder has all the `nginx, php and redis` configurations required for different types of sites like `WordPress - Single-Site, Multi-Site` etc. 4. The `php` folder contains the main part of EasyEngine cli. - * It conatins the `cli-command` which handles the most basic required functions like: `version, update` etc. + * It contains the `cli-command` which handles the most basic required functions like: `version, update` etc. * The [WP-CLI internal-api](https://github.com/wp-cli/handbook/blob/master/internal-api.md), booting and auto-loading logic and other utilities. * It also contains new classes: * `EE_DB` having the generic Sqlite3 functions for db management. * `EE_DOCKER` having various docker related functions like starting, stopping and inspecting containers, creating and connecting to networks, generating `docker-compose.yml`. * Also, the internal-api has been slightly modified to remove WordPress specific functions and additional features like, logging of all the command invocation and related log, success, debug and error messages from `EE::info(), EE::success(), EE::debug(), EE::error()` outputs into a file for debugging purposes. -5. `templates` folder conatins the [mustache](https://mustache.github.io/) templates for man/help, generation of `docker-compose.yml` etc. +5. `templates` folder contains the [mustache](https://mustache.github.io/) templates for man/help, generation of `docker-compose.yml` etc. 6. `utils` folder contains the scripts for `phar` generation. diff --git a/docs/developer-docs.md b/docs/developer-docs.md index 390d2d0f6..d156ef12a 100644 --- a/docs/developer-docs.md +++ b/docs/developer-docs.md @@ -23,7 +23,7 @@ git clone git@github.com:EasyEngine/easyengine.git && git checkout develop-v4 ``` "author/command-name": "dev-master" ``` -Also, append the follwing section in the `composer.json`: +Also, append the following section in the `composer.json`: ``` "repositories": { "author/command-name": { @@ -44,6 +44,6 @@ Success: Hello world. * Go to your repository directory: `cd vendor/author/command-name`. * Try `git remote -v`, if you have already put the proper url and used `--prefer-source` during composer install then the `remote origin` will have your github url. * In case that is missing, do `git remote add origin git@github.com:author/command-name.git`. - * Make changes inside the vendor directory itself to view your changes directly and keep commiting them regularly. + * Make changes inside the vendor directory itself to view your changes directly and keep committing them regularly. Note: We are working on scaffold command and these manual steps will be replaced very soon. \ No newline at end of file diff --git a/docs/docker-files.md b/docs/docker-files.md index 02f5ee4ac..a8f155520 100644 --- a/docs/docker-files.md +++ b/docs/docker-files.md @@ -15,4 +15,4 @@ Docker Files 7. phpmyadmin: EasyEngine db image uses [phpmyadmin](https://github.com/phpmyadmin/docker) image. -8. base: EasyEngine base image has been created by EasyEngine to facilitate the usage of EasyEngine v4 without any software dependency. Pulling and using this image will create the enviournment required to run EasyEngine and create the sites from this container with the help of the wrapper-script. The wrapper-script simply passes the parameters/arguments/flags given to it directly to the easyengine phar inside the easyengine base container for execution and running of EasyEngine. \ No newline at end of file +8. base: EasyEngine base image has been created by EasyEngine to facilitate the usage of EasyEngine v4 without any software dependency. Pulling and using this image will create the environment required to run EasyEngine and create the sites from this container with the help of the wrapper-script. The wrapper-script simply passes the parameters/arguments/flags given to it directly to the easyengine phar inside the easyengine base container for execution and running of EasyEngine. \ No newline at end of file diff --git a/docs/structure-for-multiple-repos.md b/docs/structure-for-multiple-repos.md index 493b66b43..15e7ac6f7 100644 --- a/docs/structure-for-multiple-repos.md +++ b/docs/structure-for-multiple-repos.md @@ -3,6 +3,6 @@ Structure For Multiple Reops EasyEngine v4 follows [WP-CLI](https://github.com/wp-cli/wp-cli) as the base of creation, hence it consists of multiple repos. The core repo [EasyEngine](https://github.com/EasyEngine/easyengine) contains the main structure and cli interface to facilitate the execution of all the commands. -Each command has a seperate repository like: [site-command](https://github.com/easyengine/site-command), [wp-command](https://github.com/easyengine/wp-command) etc., and they are added as commands to EasyEngine via composer packages. +Each command has a separate repository like: [site-command](https://github.com/easyengine/site-command), [wp-command](https://github.com/easyengine/wp-command) etc., and they are added as commands to EasyEngine via composer packages. -Apart from the commands there are also other miscellaneous repositories like the [easyengine-builds](https://github.com/easyengine/easyengine-builds) that contains the stable as well as nightly builds of phar generated from the main repository, [dockerfiles](https://github.com/easyengine/dockerfiles) repository contains all the dockerfiles that are in use by EasyEngine. \ No newline at end of file +Apart from the commands, there are also other miscellaneous repositories like the [easyengine-builds](https://github.com/easyengine/easyengine-builds) that contains the stable, as well as nightly builds of phar generated from the main repository, [dockerfiles](https://github.com/easyengine/dockerfiles) repository contains all the dockerfiles that are in use by EasyEngine. \ No newline at end of file diff --git a/docs/test-documentation.md b/docs/test-documentation.md index 79940ac26..4ab8cbdd4 100644 --- a/docs/test-documentation.md +++ b/docs/test-documentation.md @@ -1,5 +1,5 @@ Test Documentation === -Like [WP-CLI](https://github.com/wp-cli/wp-cli), EasyEngine also uses Behat to run it’s functional tests. +Like [WP-CLI](https://github.com/wp-cli/wp-cli), EasyEngine also uses Behat to run its functional tests. From b519510c9314e0504cc31a49b381ddcd94737269 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Wed, 9 May 2018 15:42:04 +0530 Subject: [PATCH 0096/1044] Add function for tabular info display --- php/utils.php | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/php/utils.php b/php/utils.php index f1b773ae8..e6e4b1608 100644 --- a/php/utils.php +++ b/php/utils.php @@ -1463,3 +1463,45 @@ function get_type( $assoc_args, $arg_types, $default = false ) { return false; } } + +/** + * Render a collection of items as an ASCII table. + * + * Given a collection of items with a consistent data structure: + * + * ``` + * $items = array( + * array( 'key1' => 'value1'), + * array( 'key2' => 'value2'), + * ); + * ``` + * + * Render `$items` as an ASCII table: + * + * ``` + * EE\Utils\format_table( $items ); + * + * # +------+--------+ + * # | key1 | value1 | + * # +------+--------+ + * # | key2 | value2 | + * # +------+--------+ + * ``` + * + * @param array $items An array of items to output. + * + * @return null + */ +function format_table( $items ) { + $item_table = new \cli\Table(); + $item_table->setRows( $items ); + $item_table->setRenderer( new \cli\table\Ascii() ); + $lines = array_slice( $item_table->getDisplayLines(), 3 ); + array_pop( $lines ); + $delem = $item_table->getDisplayLines()[0]; + foreach ( $lines as $line ) { + \EE::log( $delem ); + \EE::log( $line ); + } + \EE::log( $delem ); +} From 6bb198f28270cafc3011143976e7afe039698be3 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Wed, 9 May 2018 15:43:29 +0530 Subject: [PATCH 0097/1044] Update db schema for site info --- php/class-ee-db.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/php/class-ee-db.php b/php/class-ee-db.php index e3173d8b1..c238094fc 100644 --- a/php/class-ee-db.php +++ b/php/class-ee-db.php @@ -33,6 +33,7 @@ public static function create() { id INTEGER NOT NULL, sitename VARCHAR, site_type VARCHAR, + site_title VARCHAR, proxy_type VARCHAR, cache_type VARCHAR, site_path VARCHAR, @@ -45,15 +46,14 @@ public static function create() { db_user VARCHAR, db_password VARCHAR, db_host VARCHAR, - is_hhvm BOOLEAN DEFAULT 0, - is_pagespeed BOOLEAN DEFAULT 0, + wp_user VARCHAR, + wp_pass VARCHAR, + email VARCHAR, php_version VARCHAR, PRIMARY KEY (id), UNIQUE (sitename), CHECK (is_enabled IN (0, 1)), - CHECK (is_ssl IN (0, 1)), - CHECK (is_hhvm IN (0, 1)), - CHECK (is_pagespeed IN (0, 1)) + CHECK (is_ssl IN (0, 1)) );"; self::$db->exec( $query ); } From b539d78ec95f0a4586c842d45e8acf881c814ff9 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Wed, 16 May 2018 19:18:33 +0530 Subject: [PATCH 0098/1044] Update lock file for the changes --- composer.lock | 130 ++++++++++++++++++++++++++------------------------ 1 file changed, 67 insertions(+), 63 deletions(-) diff --git a/composer.lock b/composer.lock index 4299a01fa..426a5e72e 100644 --- a/composer.lock +++ b/composer.lock @@ -64,16 +64,16 @@ }, { "name": "composer/composer", - "version": "1.6.4", + "version": "1.6.5", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "86ad51e8a3c64c9782446aae740a61fc6faa2522" + "reference": "b184a92419cc9a9c4c6a09db555a94d441cb11c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/86ad51e8a3c64c9782446aae740a61fc6faa2522", - "reference": "86ad51e8a3c64c9782446aae740a61fc6faa2522", + "url": "https://api.github.com/repos/composer/composer/zipball/b184a92419cc9a9c4c6a09db555a94d441cb11c9", + "reference": "b184a92419cc9a9c4c6a09db555a94d441cb11c9", "shasum": "" }, "require": { @@ -91,6 +91,9 @@ "symfony/finder": "^2.7 || ^3.0 || ^4.0", "symfony/process": "^2.7 || ^3.0 || ^4.0" }, + "conflict": { + "symfony/console": "2.8.38" + }, "require-dev": { "phpunit/phpunit": "^4.8.35 || ^5.7", "phpunit/phpunit-mock-objects": "^2.3 || ^3.0" @@ -137,7 +140,7 @@ "dependency", "package" ], - "time": "2018-04-13T10:04:24+00:00" + "time": "2018-05-04T09:44:59+00:00" }, { "name": "composer/semver", @@ -203,16 +206,16 @@ }, { "name": "composer/spdx-licenses", - "version": "1.3.0", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/composer/spdx-licenses.git", - "reference": "7e111c50db92fa2ced140f5ba23b4e261bc77a30" + "reference": "cb17687e9f936acd7e7245ad3890f953770dec1b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/7e111c50db92fa2ced140f5ba23b4e261bc77a30", - "reference": "7e111c50db92fa2ced140f5ba23b4e261bc77a30", + "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/cb17687e9f936acd7e7245ad3890f953770dec1b", + "reference": "cb17687e9f936acd7e7245ad3890f953770dec1b", "shasum": "" }, "require": { @@ -260,7 +263,7 @@ "spdx", "validator" ], - "time": "2018-01-31T13:17:27+00:00" + "time": "2018-04-30T10:33:04+00:00" }, { "name": "easyengine/site-command", @@ -268,12 +271,12 @@ "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "48dd0a1b8169230f03bc3428aed494cd46002658" + "reference": "220d042b0304b42c5ac79cb9f05026448d65e5d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/48dd0a1b8169230f03bc3428aed494cd46002658", - "reference": "48dd0a1b8169230f03bc3428aed494cd46002658", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/220d042b0304b42c5ac79cb9f05026448d65e5d4", + "reference": "220d042b0304b42c5ac79cb9f05026448d65e5d4", "shasum": "" }, "type": "ee-cli-package", @@ -302,7 +305,7 @@ "MIT" ], "homepage": "https://github.com/easyengine/site-command", - "time": "2018-04-17T14:56:16+00:00" + "time": "2018-05-16T13:41:46+00:00" }, { "name": "easyengine/wp-command", @@ -310,12 +313,12 @@ "source": { "type": "git", "url": "https://github.com/EasyEngine/wp-command.git", - "reference": "24671d90ebf141ee690199388ba99ff44a54b5e5" + "reference": "ac24266486a60653bac0024bbdc3731ff1fa1edd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/wp-command/zipball/24671d90ebf141ee690199388ba99ff44a54b5e5", - "reference": "24671d90ebf141ee690199388ba99ff44a54b5e5", + "url": "https://api.github.com/repos/EasyEngine/wp-command/zipball/ac24266486a60653bac0024bbdc3731ff1fa1edd", + "reference": "ac24266486a60653bac0024bbdc3731ff1fa1edd", "shasum": "" }, "type": "ee-cli-package", @@ -341,7 +344,7 @@ "MIT" ], "homepage": "https://github.com/easyengine/wp-command", - "time": "2018-04-11T12:21:55+00:00" + "time": "2018-05-16T11:51:52+00:00" }, { "name": "justinrainbow/json-schema", @@ -817,7 +820,7 @@ }, { "name": "symfony/config", - "version": "v2.8.38", + "version": "v2.8.39", "source": { "type": "git", "url": "https://github.com/symfony/config.git", @@ -873,16 +876,16 @@ }, { "name": "symfony/console", - "version": "v2.8.38", + "version": "v2.8.39", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "7f78892d900c72a40acd1fe793c856ef0c110f26" + "reference": "932d1e4f7f33ee37d3534f5f452474daa66283c2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/7f78892d900c72a40acd1fe793c856ef0c110f26", - "reference": "7f78892d900c72a40acd1fe793c856ef0c110f26", + "url": "https://api.github.com/repos/symfony/console/zipball/932d1e4f7f33ee37d3534f5f452474daa66283c2", + "reference": "932d1e4f7f33ee37d3534f5f452474daa66283c2", "shasum": "" }, "require": { @@ -896,7 +899,7 @@ "symfony/process": "~2.1|~3.0.0" }, "suggest": { - "psr/log": "For using the console logger", + "psr/log-implementation": "For using the console logger", "symfony/event-dispatcher": "", "symfony/process": "" }, @@ -930,11 +933,11 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-04-03T05:20:27+00:00" + "time": "2018-04-30T01:21:07+00:00" }, { "name": "symfony/debug", - "version": "v2.8.38", + "version": "v2.8.39", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", @@ -991,7 +994,7 @@ }, { "name": "symfony/dependency-injection", - "version": "v2.8.38", + "version": "v2.8.39", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", @@ -1054,7 +1057,7 @@ }, { "name": "symfony/event-dispatcher", - "version": "v2.8.38", + "version": "v2.8.39", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", @@ -1114,7 +1117,7 @@ }, { "name": "symfony/filesystem", - "version": "v2.8.38", + "version": "v2.8.39", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", @@ -1163,7 +1166,7 @@ }, { "name": "symfony/finder", - "version": "v2.8.38", + "version": "v2.8.39", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", @@ -1212,16 +1215,16 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.7.0", + "version": "v1.8.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b" + "reference": "3296adf6a6454a050679cde90f95350ad604b171" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/78be803ce01e55d3491c1397cf1c64beb9c1b63b", - "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/3296adf6a6454a050679cde90f95350ad604b171", + "reference": "3296adf6a6454a050679cde90f95350ad604b171", "shasum": "" }, "require": { @@ -1233,7 +1236,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7-dev" + "dev-master": "1.8-dev" } }, "autoload": { @@ -1267,11 +1270,11 @@ "portable", "shim" ], - "time": "2018-01-30T19:27:44+00:00" + "time": "2018-04-26T10:06:28+00:00" }, { "name": "symfony/process", - "version": "v2.8.38", + "version": "v2.8.39", "source": { "type": "git", "url": "https://github.com/symfony/process.git", @@ -1320,16 +1323,16 @@ }, { "name": "symfony/translation", - "version": "v2.8.38", + "version": "v2.8.39", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "72235c1121ae282254e897e342c001f3d4bb7e8d" + "reference": "6f744108f846097cb250d90c8c463ddd23b43f60" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/72235c1121ae282254e897e342c001f3d4bb7e8d", - "reference": "72235c1121ae282254e897e342c001f3d4bb7e8d", + "url": "https://api.github.com/repos/symfony/translation/zipball/6f744108f846097cb250d90c8c463ddd23b43f60", + "reference": "6f744108f846097cb250d90c8c463ddd23b43f60", "shasum": "" }, "require": { @@ -1346,7 +1349,7 @@ "symfony/yaml": "~2.2|~3.0.0" }, "suggest": { - "psr/log": "To use logging capability in translator", + "psr/log-implementation": "To use logging capability in translator", "symfony/config": "", "symfony/yaml": "" }, @@ -1380,20 +1383,20 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2018-01-18T13:56:23+00:00" + "time": "2018-04-30T01:21:07+00:00" }, { "name": "symfony/yaml", - "version": "v2.8.38", + "version": "v2.8.39", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "be720fcfae4614df204190d57795351059946a77" + "reference": "d20bd2bdee063863e426297af41eda45ccad6f7e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/be720fcfae4614df204190d57795351059946a77", - "reference": "be720fcfae4614df204190d57795351059946a77", + "url": "https://api.github.com/repos/symfony/yaml/zipball/d20bd2bdee063863e426297af41eda45ccad6f7e", + "reference": "d20bd2bdee063863e426297af41eda45ccad6f7e", "shasum": "" }, "require": { @@ -1429,7 +1432,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2018-01-03T07:36:31+00:00" + "time": "2018-04-08T07:53:13+00:00" }, { "name": "wp-cli/autoload-splitter", @@ -1522,16 +1525,16 @@ }, { "name": "wp-cli/php-cli-tools", - "version": "v0.11.8", + "version": "v0.11.9", "source": { "type": "git", "url": "https://github.com/wp-cli/php-cli-tools.git", - "reference": "363c75349f5dde561e0b416dd00f7aaa76fa2c27" + "reference": "766653b45f99c817edb2b05dc23f7ee9a893768d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/php-cli-tools/zipball/363c75349f5dde561e0b416dd00f7aaa76fa2c27", - "reference": "363c75349f5dde561e0b416dd00f7aaa76fa2c27", + "url": "https://api.github.com/repos/wp-cli/php-cli-tools/zipball/766653b45f99c817edb2b05dc23f7ee9a893768d", + "reference": "766653b45f99c817edb2b05dc23f7ee9a893768d", "shasum": "" }, "require": { @@ -1568,7 +1571,7 @@ "cli", "console" ], - "time": "2017-10-12T21:50:48+00:00" + "time": "2018-04-20T08:11:30+00:00" } ], "packages-dev": [ @@ -2139,17 +2142,17 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "bf3a473c42c3640103645f9477fd425749341780" + "reference": "6fe712594835e5b70de30aec5fc244a7bd8464cd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/bf3a473c42c3640103645f9477fd425749341780", - "reference": "bf3a473c42c3640103645f9477fd425749341780", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/6fe712594835e5b70de30aec5fc244a7bd8464cd", + "reference": "6fe712594835e5b70de30aec5fc244a7bd8464cd", "shasum": "" }, "conflict": { "3f/pygmentize": "<1.2", - "adodb/adodb-php": "<5.20.6", + "adodb/adodb-php": "<5.20.12", "amphp/artax": "<1.0.6|>=2,<2.0.6", "amphp/http": "<1.0.1", "asymmetricrypt/asymmetricrypt": ">=0,<9.9.99", @@ -2161,8 +2164,8 @@ "codeigniter/framework": "<=3.0.6", "composer/composer": "<=1.0.0-alpha11", "contao-components/mediaelement": ">=2.14.2,<2.21.1", - "contao/core": ">=2,<3.5.32", - "contao/core-bundle": ">=4,<4.4.8", + "contao/core": ">=2,<3.5.35", + "contao/core-bundle": ">=4,<4.4.18|>=4.5,<4.5.8", "contao/listing-bundle": ">=4,<4.4.8", "contao/newsletter-bundle": ">=4,<4.1", "doctrine/annotations": ">=1,<1.2.7", @@ -2175,13 +2178,14 @@ "doctrine/mongodb-odm-bundle": ">=2,<3.0.1", "doctrine/orm": ">=2,<2.4.8|>=2.5,<2.5.1", "dompdf/dompdf": ">=0.6,<0.6.2", - "drupal/core": ">=7,<7.58|>=8,<8.4.6|>=8.5,<8.5.1", - "drupal/drupal": ">=7,<7.58|>=8,<8.4.6|>=8.5,<8.5.1", + "drupal/core": ">=7,<7.59|>=8,<8.4.8|>=8.5,<8.5.3", + "drupal/drupal": ">=7,<7.59|>=8,<8.4.8|>=8.5,<8.5.3", "erusev/parsedown": "<1.7", "ezsystems/ezpublish-legacy": ">=5.3,<5.3.12.3|>=5.4,<5.4.11.3|>=2017.8,<2017.8.1.1|>=2017.12,<2017.12.2.1", "firebase/php-jwt": "<2", "friendsofsymfony/rest-bundle": ">=1.2,<1.2.2", "friendsofsymfony/user-bundle": ">=1.2,<1.3.5", + "fuel/core": "<1.8.1", "gree/jose": "<=2.2", "gregwar/rst": "<1.0.3", "guzzlehttp/guzzle": ">=6,<6.2.1|>=4.0.0-rc2,<4.2.4|>=5,<5.3.1", @@ -2242,7 +2246,7 @@ "symfony/web-profiler-bundle": ">=2,<2.3.19|>=2.4,<2.4.9|>=2.5,<2.5.4", "symfony/yaml": ">=2,<2.0.22|>=2.1,<2.1.7", "thelia/backoffice-default-template": ">=2.1,<2.1.2", - "thelia/thelia": ">=2.1.0-beta1,<2.1.3|>=2.1,<2.1.2", + "thelia/thelia": ">=2.1,<2.1.2|>=2.1.0-beta1,<2.1.3", "titon/framework": ">=0,<9.9.99", "twig/twig": "<1.20", "typo3/cms": ">=6.2,<6.2.30|>=7,<7.6.22|>=8,<8.7.5", @@ -2294,7 +2298,7 @@ } ], "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", - "time": "2018-04-14T07:19:11+00:00" + "time": "2018-05-11T06:55:15+00:00" }, { "name": "squizlabs/php_codesniffer", From 3da4e5bad95376d145c77c788b08b43d7f2df3dd Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Wed, 23 May 2018 14:00:56 +0530 Subject: [PATCH 0099/1044] Add letsencrypt container launch command --- php/class-ee-docker.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php index 7330bf994..7367925f9 100644 --- a/php/class-ee-docker.php +++ b/php/class-ee-docker.php @@ -166,15 +166,20 @@ public static function create_container( $container, $command = '' ) { $HOME = HOME; - switch ( $container ) { + $nginx_proxy_name = 'ee4_nginx-proxy'; + switch ( $container ) { case 'ee4_nginx-proxy': - $command = "docker run --name ee4_nginx-proxy -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v $HOME/.ee4/nginx/certs:/etc/nginx/certs -v $HOME/.ee4/nginx/dhparam:/etc/nginx/dhparam -v $HOME/.ee4/nginx/conf.d:/etc/nginx/conf.d -v $HOME/.ee4/nginx/htpasswd:/etc/nginx/htpasswd -v $HOME/.ee4/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v $HOME/.ee4:/app/ee4 easyengine/nginx-proxy"; + $command = "docker run --name $nginx_proxy_name -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v $HOME/.ee4/nginx/certs:/etc/nginx/certs -v $HOME/.ee4/nginx/dhparam:/etc/nginx/dhparam -v $HOME/.ee4/nginx/conf.d:/etc/nginx/conf.d -v $HOME/.ee4/nginx/htpasswd:/etc/nginx/htpasswd -v $HOME/.ee4/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v $HOME/.ee4:/app/ee4 -v /usr/share/nginx/html easyengine/nginx-proxy"; break; case 'ee4_redis': $command = "docker run --name ee4_redis -d --restart=always easyengine/redis"; break; + + case 'letsencrypt': + $command = "docker run --name letsencrypt -d -v $HOME/.ee4/nginx/certs:/etc/nginx/certs:rw -v /var/run/docker.sock:/var/run/docker.sock:ro --volumes-from $nginx_proxy_name jrcs/letsencrypt-nginx-proxy-companion"; + break; } $launch = EE::launch( $command, false, true ); From 928a72f181748409ba7fa1ff2aa3f765a14a4299 Mon Sep 17 00:00:00 2001 From: Mriyam Tamuli <mbtamuli@gmail.com> Date: Wed, 30 May 2018 19:36:05 +0530 Subject: [PATCH 0100/1044] Adjust branch name master-v4 Signed-off-by: Mriyam Tamuli <mbtamuli@gmail.com> --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index f3a6a27be..4c71cfd82 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,7 +26,7 @@ before_script: jobs: include: - stage: deploy - env: DEPLOY_BRANCH=release/v4 + env: DEPLOY_BRANCH=master-v4 script: ./ci/deploy.sh cache: @@ -36,9 +36,9 @@ cache: branches: only: - develop-v4 - - release/v4 + - master-v4 notifications: email: on_success: never - on_failure: change \ No newline at end of file + on_failure: change From 683b6da0681786783e9d4f9de525c719542c86af Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Wed, 30 May 2018 20:05:42 +0530 Subject: [PATCH 0101/1044] Clear readme till installer is ready --- README.md | 171 +----------------------------------------------------- 1 file changed, 1 insertion(+), 170 deletions(-) diff --git a/README.md b/README.md index 61b24fd7c..09bc3b19c 100644 --- a/README.md +++ b/README.md @@ -1,172 +1,3 @@ # EasyEngine v4 -[![Build Status](https://travis-ci.org/EasyEngine/easyengine.svg?branch=release%2Fv4)](https://travis-ci.org/EasyEngine/easyengine) -## Requirements - -* Docker - -## Installing - -Once you've verified requirements, download the [setup.sh](http://rt.cx/eev4) file using `wget` or `curl` and execute it: - -```bash -wget rt.cx/eev4 -O ee4-setup && bash ee4-setup -``` - -If EE was installed successfully, you should see something like this when you run `ee cli version`: - -```bash -$ ee cli version -EE 0.0.1 -``` - -## Commands - -### ee4 site - -Creates, lists and deletes WordPress websites. - -~~~ -ee site -~~~ - - -**EXAMPLES** - - # Create simple WordPress website. No parameter flag defaults to --wp - $ ee site create site.test - Success: ee4_nginx-proxy container launched successfully. - Configuring project... - Creating WordPress site site.test... - Copying configuration files... - Success: Configuration files copied. - Updating configuration files... - Success: Configuration files updated. - Success: Network started. - Success: Site connected to ee4_nginx-proxy. - Success: Host entry successfully added. - Checking and verifying site-up status. This may take some time. - .......... - Installing WordPress site... - Success: http://site.test has been created successfully! - Access phpMyAdmin : pma.site.test - Access mail : mail.site.test - Site Title : site.test - Username : admin - Password : DrwKpMsaGiuI - DB Password : Si23era8cnmR - E-Mail : mail@site.test - Site entry created. - - $ ee site create site2.test --wpredis --user=admin --pass=admin --email=admin@admin.example --title="Site by EasyEngine" - Configuring project... - Creating WordPress site site2.test... - Copying configuration files... - Success: Configuration files copied. - Updating configuration files... - Success: Configuration files updated. - Success: Network started. - Success: Site connected to ee4_nginx-proxy. - Success: Site connected to ee4_redis. - Success: Host entry successfully added. - Checking and verifying site-up status. This may take some time. - .......... - Installing WordPress site... - Success: http://site2.test has been created successfully! - Access phpMyAdmin : pma.site2.test - Access mail : mail.site2.test - Site Title : Site by EasyEngine - Username : admin - Password : admin - DB Password : B4B6ggCBcJyE - E-Mail : admin@admin.example - Site entry created. - - $ ee site list - List of Sites: - - - site.test - - site2.test - - $ ee site delete site.test - [site.test] Docker Containers removed. - [site.test] Disconnected from Docker network nginx-proxy - [site.test] Docker network nginx-proxy removed. - [sudo] password for mrrobot: - [site.test] site root removed. - Removing database entry. - Site site.test deleted. - -### ee site create - -~~~ -ee site create <site-name> [--wp|--wpredis] [--letsencrypt] [--title=<title>] [--user=<username>] [--pass=<password>] [--email=<email>] -~~~ - -Creates WordPress site. - -**OPTIONS** - - [--wp] - Creates simple WordPress website. - - [--wpredis] - Creates WordPress website with Redis caching. - - [--letsencrypt] - Generates letsencrypt certificates for the site. - - [--title=<title>] - Title of website. - - [--user=<username>] - Username of the WordPress administrator. - - [--pass=<password>] - Password for the WordPress administrator. - - [--email=<email>] - E-Mail of the WordPress administrator. - -### ee site list - -~~~ -ee site list -~~~ - -Lists all the sites created by EasyEngine. - -### ee site delete - -~~~ -ee site delete <site-name> -~~~ - -Deletes the given site if it was created by EasyEngine. - -### ee wp - -Run all the wp commands for site created by EasyEngine. - -~~~ -ee wp -~~~ - -### Usage - -~~~ -ee wp <site-name> <wp-command> -~~~ - -**EXAMPLES** - - $ ee wp site.test plugin list - +---------+----------+-----------+---------+ - | name | status | update | version | - +---------+----------+-----------+---------+ - | akismet | inactive | available | 4.0.2 | - | hello | inactive | none | 1.6 | - +---------+----------+-----------+---------+ - - $ ee wp site.test user create author1 author1@site.test --user_pass=password --role=administrator - Success: Created user 2. \ No newline at end of file +[![Build Status](https://travis-ci.org/EasyEngine/easyengine.svg?branch=release%2Fv4)](https://travis-ci.org/EasyEngine/easyengine) \ No newline at end of file From b0c690a9aae3627acc27e2dbb4100c07104d7e13 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Wed, 30 May 2018 20:07:40 +0530 Subject: [PATCH 0102/1044] Add readme explaining bin --- bin/README.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 bin/README.md diff --git a/bin/README.md b/bin/README.md new file mode 100644 index 000000000..5ef232097 --- /dev/null +++ b/bin/README.md @@ -0,0 +1,4 @@ +bin +=== + +Entrypoint to the php scripts which also sets the required enviournment variables. \ No newline at end of file From fb695d965ce914c06ffbb2cbc120cf004694665f Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Wed, 30 May 2018 20:11:42 +0530 Subject: [PATCH 0103/1044] Remove extra file --- bin/ee.bat | 2 -- 1 file changed, 2 deletions(-) delete mode 100755 bin/ee.bat diff --git a/bin/ee.bat b/bin/ee.bat deleted file mode 100755 index 59f953440..000000000 --- a/bin/ee.bat +++ /dev/null @@ -1,2 +0,0 @@ -@ECHO OFF -php "%~dp0../php/boot-fs.php" %* \ No newline at end of file From 9e6de396108aa567c36aba403b4e7d60d15f5760 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Wed, 30 May 2018 20:12:06 +0530 Subject: [PATCH 0104/1044] Add readme explaining ci --- ci/README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 ci/README.md diff --git a/ci/README.md b/ci/README.md new file mode 100644 index 000000000..ccc6f29de --- /dev/null +++ b/ci/README.md @@ -0,0 +1,13 @@ +Build and Release Process +========================= + +Currently EasyEngine v4 is in development stage. Hence the main branch for v4 is [master-v4](https://github.com/easyengine/easyengine/tree/master-v4) and the ongoing development branch is [develop-v4](https://github.com/easyengine/easyengine/tree/develop-v4). + +The current build and release process uses [travis-ci](https://travis-ci.org/) and docker build triggers. + +* Whenever any commit is pushed or merged into the `develop-v4` branch, it trigggers the travis-ci to generate a `nightly phar` and commits it to the [easyengine-builds](https://github.com/easyengine/easyengine-builds) repository. + +* Simillarly, whenever any commit is pushed or merged into the `master-v4` branch, it trigggers the travis-ci to generate a `stable phar` and commits it to the [easyengine-builds](https://github.com/easyengine/easyengine-builds) repository. + +* `prepare.sh` creates the phar. +* `deploy.sh` Takes the phar and deploys it to the [easyengine-builds](https://github.com/easyengine/easyengine-builds) repository. \ No newline at end of file From a9c6c1c3b00f12bcb30a03c9f481a0b6acda2964 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Wed, 30 May 2018 20:12:34 +0530 Subject: [PATCH 0105/1044] Add readme explaining php folder --- php/README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 php/README.md diff --git a/php/README.md b/php/README.md new file mode 100644 index 000000000..2ae430ce8 --- /dev/null +++ b/php/README.md @@ -0,0 +1,13 @@ +Internal-API +============ +This folder contains the main part of EasyEngine cli. + +* It conatins the `cli-command` which handles the most basic required functions like: `version, update` etc. + +* The [WP-CLI internal-api](https://github.com/wp-cli/handbook/blob/master/internal-api.md), booting and auto-loading logic and other utilities. + +* It also contains new classes: + * `EE_DB` having the generic Sqlite3 functions for db management. + * `EE_DOCKER` having various docker related functions like starting, stopping and inspecting containers, creating and connecting to networks, generating `docker-compose.yml`. + +* Also, the internal-api has been slightly modified to remove WordPress specific functions and additional features like, logging of all the command invocation and related log, success, debug and error messages from `EE::info(), EE::success(), EE::debug(), EE::error()` outputs into a file for debugging purposes. \ No newline at end of file From 6f5d468ec07b9315eaafad4c1736b6657923e41d Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Wed, 30 May 2018 20:13:06 +0530 Subject: [PATCH 0106/1044] Add readme explaining templates --- templates/README.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 templates/README.md diff --git a/templates/README.md b/templates/README.md new file mode 100644 index 000000000..c6e996534 --- /dev/null +++ b/templates/README.md @@ -0,0 +1,4 @@ +Templates +========= + +The mustache templates for the EasyEngine core and mustache as well as default templated configurations required for different types of site are populated here. \ No newline at end of file From cbeac0ec7e7c467dd79589621b65c36ca8712164 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Wed, 30 May 2018 20:13:34 +0530 Subject: [PATCH 0107/1044] Remove extra template files --- templates/plugin-status.mustache | 6 ------ templates/theme-status.mustache | 5 ----- 2 files changed, 11 deletions(-) delete mode 100644 templates/plugin-status.mustache delete mode 100644 templates/theme-status.mustache diff --git a/templates/plugin-status.mustache b/templates/plugin-status.mustache deleted file mode 100644 index 375862690..000000000 --- a/templates/plugin-status.mustache +++ /dev/null @@ -1,6 +0,0 @@ -Plugin %9{{slug}}%n details: - Name: {{name}} - Status: {{status}}%n - Version: {{version}} - Author: {{author}} - Description: {{description}} diff --git a/templates/theme-status.mustache b/templates/theme-status.mustache deleted file mode 100644 index c53be6338..000000000 --- a/templates/theme-status.mustache +++ /dev/null @@ -1,5 +0,0 @@ -Theme %9{{slug}}%n details: - Name: {{name}} - Status: {{status}}%n - Version: {{version}} - Author: {{author}} From 80481f88a4646526250b557e76155f16e65f441e Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Wed, 30 May 2018 20:14:17 +0530 Subject: [PATCH 0108/1044] Add readme explaining utils --- utils/README.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 utils/README.md diff --git a/utils/README.md b/utils/README.md new file mode 100644 index 000000000..2abab7c5a --- /dev/null +++ b/utils/README.md @@ -0,0 +1,4 @@ +Utils +===== + +The scripts for phar generation ee command auto-completion. \ No newline at end of file From 2feb3b5bb94f1bd673d6bc4b228afda467ef1584 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Thu, 31 May 2018 18:30:41 +0530 Subject: [PATCH 0109/1044] Fix help issue in wp-command. Closes #1011 --- php/EE/Runner.php | 140 +++++++++++++++++++++++++--------------------- 1 file changed, 75 insertions(+), 65 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index cda8ce5a0..c4d852ee9 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -67,11 +67,11 @@ private function init_ee4() { /** * Register a command for early invocation, generally before WordPress loads. * - * @param string $when Named execution hook + * @param string $when Named execution hook * @param EE\Dispatcher\Subcommand $command */ public function register_early_invoke( $when, $command ) { - $this->_early_invoke[ $when ][] = array_slice( Dispatcher\get_path( $command ), 1 ); + $this->_early_invoke[$when][] = array_slice( Dispatcher\get_path( $command ), 1 ); } /** @@ -80,13 +80,13 @@ public function register_early_invoke( $when, $command ) { * @param string $when Named execution hook */ private function do_early_invoke( $when ) { - if ( ! isset( $this->_early_invoke[ $when ] ) ) { + if ( ! isset( $this->_early_invoke[$when] ) ) { return; } // Search the value of @when from the command method. $real_when = ''; - $r = $this->find_command_to_run( $this->arguments ); + $r = $this->find_command_to_run( $this->arguments ); if ( is_array( $r ) ) { list( $command, $final_args, $cmd_path ) = $r; @@ -99,7 +99,7 @@ private function do_early_invoke( $when ) { } } - foreach ( $this->_early_invoke[ $when ] as $path ) { + foreach ( $this->_early_invoke[$when] as $path ) { if ( $this->cmd_starts_with( $path ) ) { if ( empty( $real_when ) || ( $real_when && $real_when === $when ) ) { $this->_run_command_and_exit(); @@ -116,10 +116,10 @@ private function do_early_invoke( $when ) { public function get_global_config_path() { if ( getenv( 'EE_CONFIG_PATH' ) ) { - $config_path = getenv( 'EE_CONFIG_PATH' ); + $config_path = getenv( 'EE_CONFIG_PATH' ); $this->_global_config_path_debug = 'Using global config from EE_CONFIG_PATH env var: ' . $config_path; } else { - $config_path = Utils\get_home_dir() . '/.ee4/config.yml'; + $config_path = Utils\get_home_dir() . '/.ee4/config.yml'; $this->_global_config_path_debug = 'Using default global config: ' . $config_path; } @@ -175,6 +175,7 @@ public function get_packages_dir_path() { } else { $packages_dir = Utils\get_home_dir() . '/.ee4/packages/'; } + return $packages_dir; } @@ -186,6 +187,7 @@ private function cmd_starts_with( $prefix ) { * Given positional arguments, find the command to execute. * * @param array $args + * * @return array|string Command, args, and path on success; error message on failure */ public function find_command_to_run( $args ) { @@ -197,15 +199,16 @@ public function find_command_to_run( $args ) { while ( ! empty( $args ) && $command->can_have_subcommands() ) { $cmd_path[] = $args[0]; - $full_name = implode( ' ', $cmd_path ); + $full_name = implode( ' ', $cmd_path ); $subcommand = $command->find_subcommand( $args ); if ( ! $subcommand ) { if ( count( $cmd_path ) > 1 ) { - $child = array_pop( $cmd_path ); + $child = array_pop( $cmd_path ); $parent_name = implode( ' ', $cmd_path ); - $suggestion = $this->get_subcommand_suggestion( $child, $command ); + $suggestion = $this->get_subcommand_suggestion( $child, $command ); + return sprintf( "'%s' is not a registered subcommand of '%s'. See 'ee help %s' for available subcommands.%s", $child, @@ -240,9 +243,9 @@ public function find_command_to_run( $args ) { /** * Find the EE command to run given arguments, and invoke it. * - * @param array $args Positional arguments including command name - * @param array $assoc_args Associative arguments for the command. - * @param array $options Configuration options for the function. + * @param array $args Positional arguments including command name + * @param array $assoc_args Associative arguments for the command. + * @param array $options Configuration options for the function. */ public function run_command( $args, $assoc_args = array(), $options = array() ) { @@ -257,14 +260,15 @@ public function run_command( $args, $assoc_args = array(), $options = array() ) $extra_args = array(); - if ( isset( $this->extra_config[ $name ] ) ) { - $extra_args = $this->extra_config[ $name ]; + if ( isset( $this->extra_config[$name] ) ) { + $extra_args = $this->extra_config[$name]; } EE::debug( 'Running command: ' . $name, 'bootstrap' ); try { $command->invoke( $final_args, $assoc_args, $extra_args ); - } catch ( EE\Iterators\Exception $e ) { + } + catch ( EE\Iterators\Exception $e ) { EE::error( $e->getMessage() ); } } @@ -306,6 +310,7 @@ private function _run_command_and_exit( $help_exit_warning = '' ) { * scheme of "docker" or "docker-compose"). * * @param string $connection_string Passed connection string. + * * @return void */ private function run_ssh_command( $connection_string ) { @@ -328,16 +333,16 @@ private function run_ssh_command( $connection_string ) { } $ee_binary = 'ee'; - $ee_args = array_slice( $GLOBALS['argv'], 1 ); + $ee_args = array_slice( $GLOBALS['argv'], 1 ); if ( $this->alias && ! empty( $ee_args[0] ) && $this->alias === $ee_args[0] ) { array_shift( $ee_args ); $runtime_alias = array(); - foreach ( $this->aliases[ $this->alias ] as $key => $value ) { + foreach ( $this->aliases[$this->alias] as $key => $value ) { if ( 'ssh' === $key ) { continue; } - $runtime_alias[ $key ] = $value; + $runtime_alias[$key] = $value; } if ( ! empty( $runtime_alias ) ) { $encoded_alias = json_encode( @@ -345,17 +350,17 @@ private function run_ssh_command( $connection_string ) { $this->alias => $runtime_alias, ) ); - $ee_binary = "EE_RUNTIME_ALIAS='{$encoded_alias}' {$ee_binary} {$this->alias}"; + $ee_binary = "EE_RUNTIME_ALIAS='{$encoded_alias}' {$ee_binary} {$this->alias}"; } } foreach ( $ee_args as $k => $v ) { if ( preg_match( '#--ssh=#', $v ) ) { - unset( $ee_args[ $k ] ); + unset( $ee_args[$k] ); } } - $ee_command = $pre_cmd . $env_vars . $ee_binary . ' ' . implode( ' ', array_map( 'escapeshellarg', $ee_args ) ); + $ee_command = $pre_cmd . $env_vars . $ee_binary . ' ' . implode( ' ', array_map( 'escapeshellarg', $ee_args ) ); $escaped_command = $this->generate_ssh_command( $bits, $ee_command ); passthru( $escaped_command, $exit_code ); @@ -371,6 +376,7 @@ private function run_ssh_command( $connection_string ) { * * @param array $bits Parsed connection string. * @param string $ee_command EE command to run. + * * @return string */ private function generate_ssh_command( $bits, $ee_command ) { @@ -378,11 +384,11 @@ private function generate_ssh_command( $bits, $ee_command ) { // Set default values. foreach ( array( 'scheme', 'user', 'host', 'port', 'path' ) as $bit ) { - if ( ! isset( $bits[ $bit ] ) ) { - $bits[ $bit ] = null; + if ( ! isset( $bits[$bit] ) ) { + $bits[$bit] = null; } - EE::debug( 'SSH ' . $bit . ': ' . $bits[ $bit ], 'bootstrap' ); + EE::debug( 'SSH ' . $bit . ': ' . $bits[$bit], 'bootstrap' ); } $is_tty = function_exists( 'posix_isatty' ) && posix_isatty( STDOUT ); @@ -451,6 +457,7 @@ private function generate_ssh_command( $bits, $ee_command ) { */ public function is_command_disabled( $command ) { $path = implode( ' ', array_slice( \EE\Dispatcher\get_path( $command ), 1 ) ); + return in_array( $path, $this->config['disabled_commands'] ); } @@ -507,14 +514,14 @@ public function init_config() { // File config { - $this->global_config_path = $this->get_global_config_path(); + $this->global_config_path = $this->get_global_config_path(); $this->project_config_path = $this->get_project_config_path(); $configurator->merge_yml( $this->global_config_path, $this->alias ); - $config = $configurator->to_array(); + $config = $configurator->to_array(); $this->_required_files['global'] = $config[0]['require']; $configurator->merge_yml( $this->project_config_path, $this->alias ); - $config = $configurator->to_array(); + $config = $configurator->to_array(); $this->_required_files['project'] = $config[0]['require']; } @@ -523,10 +530,10 @@ public function init_config() { list( $args, $assoc_args, $this->runtime_config ) = $configurator->parse_args( $argv ); // foo --help -> help foo - if ( isset( $assoc_args['help'] ) ) { - array_unshift( $args, 'help' ); - unset( $assoc_args['help'] ); - } + if ( isset( $assoc_args['help'] ) && ! in_array( 'wp', $args ) ) { + array_unshift( $args, 'help' ); + unset( $assoc_args['help'] ); + } list( $this->arguments, $this->assoc_args ) = [ $args, $assoc_args ]; @@ -536,9 +543,9 @@ public function init_config() { list( $this->config, $this->extra_config ) = $configurator->to_array(); $this->aliases = $configurator->get_aliases(); if ( count( $this->aliases ) && ! isset( $this->aliases['@all'] ) ) { - $this->aliases = array_reverse( $this->aliases ); + $this->aliases = array_reverse( $this->aliases ); $this->aliases['@all'] = 'Run command against every registered alias.'; - $this->aliases = array_reverse( $this->aliases ); + $this->aliases = array_reverse( $this->aliases ); } $this->_required_files['runtime'] = $this->config['require']; } @@ -547,38 +554,39 @@ public function init_config() { * Ensures that vars are present in config. If they aren't, attempts to * create config file and add vars in it. * - * @param $var Variable to check. + * @param $var Variable to check. * @param $default Default value to use if $var is not set. */ - private function ensure_present_in_config( $var, $default) { + private function ensure_present_in_config( $var, $default ) { - if ( empty($this->config[$var]) ) { - $this->config[$var] = $default ; + if ( empty( $this->config[$var] ) ) { + $this->config[$var] = $default; - $config_file_path = getenv('EE_CONFIG_PATH') ? getenv('EE_CONFIG_PATH') : Utils\get_home_dir() . '/.ee4/config.yml'; - $config_dir_path = dirname( $config_file_path ); + $config_file_path = getenv( 'EE_CONFIG_PATH' ) ? getenv( 'EE_CONFIG_PATH' ) : Utils\get_home_dir() . '/.ee4/config.yml'; + $config_dir_path = dirname( $config_file_path ); if ( file_exists( $config_file_path ) ) { if ( is_readable( $config_file_path ) ) { if ( is_writable( $config_file_path ) ) { - $existing_config = Spyc::YAMLLoad ( $config_file_path ); + $existing_config = Spyc::YAMLLoad( $config_file_path ); $this->add_var_to_config_file( $var, $config_file_path, $existing_config ); + return; } - EE::error("The config file {$config_file_path} is not writable. Please set a config path which is writable in EE_CONFIG_PATH environment variable."); + EE::error( "The config file {$config_file_path} is not writable. Please set a config path which is writable in EE_CONFIG_PATH environment variable." ); } - EE::error("The config file {$config_file_path} is not readable. Please select a config path which is readable in EE_CONFIG_PATH environment variable."); - } - else { + EE::error( "The config file {$config_file_path} is not readable. Please select a config path which is readable in EE_CONFIG_PATH environment variable." ); + } else { if ( is_writable( $config_dir_path ) ) { $this->add_var_to_config_file( $var, $config_file_path ); + return; } - $mkdir_success = mkdir ( $config_dir_path , 0755, true ); + $mkdir_success = mkdir( $config_dir_path, 0755, true ); if ( ! $mkdir_success ) { - EE::error("The config file path ${$config_dir_path} is not writable. Please select a config path which is writable in EE_CONFIG_PATH environment variable."); + EE::error( "The config file path ${$config_dir_path} is not writable. Please select a config path which is writable in EE_CONFIG_PATH environment variable." ); } - $this->add_var_to_config_file($var, $config_file_path ); + $this->add_var_to_config_file( $var, $config_file_path ); } } } @@ -640,30 +648,30 @@ private function run_alias_group( $aliases ) { foreach ( $aliases as $alias ) { EE::log( $alias ); - $args = implode( ' ', array_map( 'escapeshellarg', $this->arguments ) ); - $assoc_args = Utils\assoc_args_to_str( $this->assoc_args ); + $args = implode( ' ', array_map( 'escapeshellarg', $this->arguments ) ); + $assoc_args = Utils\assoc_args_to_str( $this->assoc_args ); $runtime_config = Utils\assoc_args_to_str( $this->runtime_config ); - $full_command = "EE_CONFIG_PATH={$config_path} {$php_bin} {$script_path} {$alias} {$args}{$assoc_args}{$runtime_config}"; - $proc = Utils\proc_open_compat( $full_command, array( STDIN, STDOUT, STDERR ), $pipes ); + $full_command = "EE_CONFIG_PATH={$config_path} {$php_bin} {$script_path} {$alias} {$args}{$assoc_args}{$runtime_config}"; + $proc = Utils\proc_open_compat( $full_command, array( STDIN, STDOUT, STDERR ), $pipes ); proc_close( $proc ); } } private function set_alias( $alias ) { - $orig_config = $this->config; - $alias_config = $this->aliases[ $this->alias ]; + $orig_config = $this->config; + $alias_config = $this->aliases[$this->alias]; $this->config = array_merge( $orig_config, $alias_config ); foreach ( $alias_config as $key => $_ ) { - if ( isset( $orig_config[ $key ] ) && ! is_null( $orig_config[ $key ] ) ) { - $this->assoc_args[ $key ] = $orig_config[ $key ]; + if ( isset( $orig_config[$key] ) && ! is_null( $orig_config[$key] ) ) { + $this->assoc_args[$key] = $orig_config[$key]; } } } public function start() { - $this->ensure_present_in_config( 'sites_path', Utils\get_home_dir(). '/ee4-sites' ); - $this->ensure_present_in_config( 'db_path', Utils\get_home_dir(). '/.ee4/ee4.db' ); + $this->ensure_present_in_config( 'sites_path', Utils\get_home_dir() . '/ee4-sites' ); + $this->ensure_present_in_config( 'db_path', Utils\get_home_dir() . '/.ee4/ee4.db' ); $this->ensure_present_in_config( 'ee_installer_version', 'stable' ); $this->init_ee4(); @@ -684,14 +692,14 @@ public function start() { if ( '@all' === $this->alias && is_string( $this->aliases['@all'] ) ) { $aliases = array_keys( $this->aliases ); - $k = array_search( '@all', $aliases ); - unset( $aliases[ $k ] ); + $k = array_search( '@all', $aliases ); + unset( $aliases[$k] ); $this->run_alias_group( $aliases ); exit; } if ( ! array_key_exists( $this->alias, $this->aliases ) ) { - $error_msg = "Alias '{$this->alias}' not found."; + $error_msg = "Alias '{$this->alias}' not found."; $suggestion = Utils\get_suggestion( $this->alias, array_keys( $this->aliases ), $threshold = 2 ); if ( $suggestion ) { $error_msg .= PHP_EOL . "Did you mean '{$suggestion}'?"; @@ -699,9 +707,9 @@ public function start() { EE::error( $error_msg ); } // Numerically indexed means a group of aliases - if ( isset( $this->aliases[ $this->alias ][0] ) ) { - $group_aliases = $this->aliases[ $this->alias ]; - $all_aliases = array_keys( $this->aliases ); + if ( isset( $this->aliases[$this->alias][0] ) ) { + $group_aliases = $this->aliases[$this->alias]; + $all_aliases = array_keys( $this->aliases ); if ( $diff = array_diff( $group_aliases, $all_aliases ) ) { EE::error( "Group '{$this->alias}' contains one or more invalid aliases: " . implode( ', ', $diff ) ); } @@ -724,6 +732,7 @@ public function start() { if ( $this->config['ssh'] ) { $this->run_ssh_command( $this->config['ssh'] ); + return; } @@ -770,11 +779,12 @@ private function auto_check_update() { $days_between_checks = 1; } - $cache = EE::get_cache(); + $cache = EE::get_cache(); $cache_key = 'ee-update-check'; // Bail early on the first check, so we don't always check on an unwritable cache. if ( ! $cache->has( $cache_key ) ) { $cache->write( $cache_key, time() ); + return; } From 8ddfffb7354c10e57ba1bc15d771057aab6c38c1 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Thu, 31 May 2018 18:32:17 +0530 Subject: [PATCH 0110/1044] Add function to get site enabled status --- php/class-ee-db.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/php/class-ee-db.php b/php/class-ee-db.php index c238094fc..d53aba73a 100644 --- a/php/class-ee-db.php +++ b/php/class-ee-db.php @@ -236,4 +236,27 @@ public static function site_in_db( $site_name ) { return false; } } + + /** + * Check if a site entry exists in the database as well as if it is enbaled. + * + * @param String $site_name Name of the site to be checked. + * + * @return bool true if site is enabled, + * false if disabled or site does not exists. + */ + public static function site_enabled( $site_name ) { + + if ( empty ( self::$db ) ) { + self::init_db(); + } + + $site = self::select( array( 'id', 'is_enabled' ), array( 'sitename' => $site_name ) ); + + if ( 1 === count( $site ) ) { + return $site[0]['is_enabled']; + } + + return false; + } } From 71cf343997e34ac54d78fdb44ad084ee42db4f4d Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Thu, 31 May 2018 19:50:11 +0530 Subject: [PATCH 0111/1044] Move redis from global to per site container. Add site network connect-disconnect funtions. --- php/class-ee-docker.php | 39 +++++++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php index 7367925f9..141a903bf 100644 --- a/php/class-ee-docker.php +++ b/php/class-ee-docker.php @@ -86,12 +86,21 @@ public static function generate_docker_composer_yml( array $filters = [] ) { $mail['environment'] = array( 'env' => array( array( 'name' => 'VIRTUAL_HOST=mail.${VIRTUAL_HOST}' ), array( 'name' => 'VIRTUAL_PORT=8025' ) ) ); $mail['networks'] = $network_default; + // redis configuration. + $redis['service_name'] = array( 'name' => 'redis' ); + $redis['image'] = array( 'name' => 'easyengine/redis' ); + $redis['networks'] = $network_default; + $base[] = $db; $base[] = $php; $base[] = $nginx; $base[] = $mail; $base[] = $phpmyadmin; + if ( in_array( 'wpredis', $filters ) ) { + $base[] = $redis; + } + $binding = array( 'services' => $base, 'network' => true, @@ -173,10 +182,6 @@ public static function create_container( $container, $command = '' ) { $command = "docker run --name $nginx_proxy_name -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v $HOME/.ee4/nginx/certs:/etc/nginx/certs -v $HOME/.ee4/nginx/dhparam:/etc/nginx/dhparam -v $HOME/.ee4/nginx/conf.d:/etc/nginx/conf.d -v $HOME/.ee4/nginx/htpasswd:/etc/nginx/htpasswd -v $HOME/.ee4/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v $HOME/.ee4:/app/ee4 -v /usr/share/nginx/html easyengine/nginx-proxy"; break; - case 'ee4_redis': - $command = "docker run --name ee4_redis -d --restart=always easyengine/redis"; - break; - case 'letsencrypt': $command = "docker run --name letsencrypt -d -v $HOME/.ee4/nginx/certs:/etc/nginx/certs:rw -v /var/run/docker.sock:/var/run/docker.sock:ro --volumes-from $nginx_proxy_name jrcs/letsencrypt-nginx-proxy-companion"; break; @@ -236,6 +241,32 @@ public static function disconnect_network( $name, $connected_to ) { return default_launch( "docker network disconnect $name $connected_to" ); } + + /** + * Function to connect site network to appropriate containers. + */ + public function connect_site_network_to( $site_name, $to_container ) { + + if ( self::connect_network( $site_name, $to_container ) ) { + EE::success( "Site connected to $to_container." ); + } else { + throw new Exception( "There was some error connecting to $to_container." ); + } + } + + /** + * Function to disconnect site network from appropriate containers. + */ + public function disconnect_site_network_from( $site_name, $from_container ) { + + if ( self::disconnect_network( $site_name, $from_container ) ) { + EE::log( "[$site_name] Disconnected from Docker network of $from_container" ); + } else { + EE::warning( "Error in disconnecting from Docker network of $from_container" ); + } + } + + /** * Function to boot the containers. * From 9d2bdfc370df78d377546d6bd37c971eb07488a9 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Thu, 31 May 2018 19:54:07 +0530 Subject: [PATCH 0112/1044] Update config files for per site redis --- ee4-config/wpredis-subdir/config/nginx/common/redis.conf | 4 ++-- ee4-config/wpredis/config/nginx/common/redis.conf | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ee4-config/wpredis-subdir/config/nginx/common/redis.conf b/ee4-config/wpredis-subdir/config/nginx/common/redis.conf index 5bf2d2f29..985e80e8d 100644 --- a/ee4-config/wpredis-subdir/config/nginx/common/redis.conf +++ b/ee4-config/wpredis-subdir/config/nginx/common/redis.conf @@ -24,14 +24,14 @@ location / { location /redis-fetch { internal ; set $redis_key $args; - redis_pass ee4_redis:6379; + redis_pass redis:6379; } location /redis-store { internal ; set_unescape_uri $key $arg_key ; redis2_query set $key $echo_request_body; redis2_query expire $key 14400; - redis2_pass ee4_redis:6379; + redis2_pass redis:6379; } location ~ \.php$ { diff --git a/ee4-config/wpredis/config/nginx/common/redis.conf b/ee4-config/wpredis/config/nginx/common/redis.conf index 5bf2d2f29..985e80e8d 100644 --- a/ee4-config/wpredis/config/nginx/common/redis.conf +++ b/ee4-config/wpredis/config/nginx/common/redis.conf @@ -24,14 +24,14 @@ location / { location /redis-fetch { internal ; set $redis_key $args; - redis_pass ee4_redis:6379; + redis_pass redis:6379; } location /redis-store { internal ; set_unescape_uri $key $arg_key ; redis2_query set $key $echo_request_body; redis2_query expire $key 14400; - redis2_pass ee4_redis:6379; + redis2_pass redis:6379; } location ~ \.php$ { From 12cc96bd2b101e7d4720209cc79ba0d71aab3de8 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Thu, 31 May 2018 20:38:45 +0530 Subject: [PATCH 0113/1044] Revert back phpcbf run --- php/EE/Runner.php | 140 +++++++++++++++++++++------------------------- 1 file changed, 65 insertions(+), 75 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index c4d852ee9..74e7c6961 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -67,11 +67,11 @@ private function init_ee4() { /** * Register a command for early invocation, generally before WordPress loads. * - * @param string $when Named execution hook + * @param string $when Named execution hook * @param EE\Dispatcher\Subcommand $command */ public function register_early_invoke( $when, $command ) { - $this->_early_invoke[$when][] = array_slice( Dispatcher\get_path( $command ), 1 ); + $this->_early_invoke[ $when ][] = array_slice( Dispatcher\get_path( $command ), 1 ); } /** @@ -80,13 +80,13 @@ public function register_early_invoke( $when, $command ) { * @param string $when Named execution hook */ private function do_early_invoke( $when ) { - if ( ! isset( $this->_early_invoke[$when] ) ) { + if ( ! isset( $this->_early_invoke[ $when ] ) ) { return; } // Search the value of @when from the command method. $real_when = ''; - $r = $this->find_command_to_run( $this->arguments ); + $r = $this->find_command_to_run( $this->arguments ); if ( is_array( $r ) ) { list( $command, $final_args, $cmd_path ) = $r; @@ -99,7 +99,7 @@ private function do_early_invoke( $when ) { } } - foreach ( $this->_early_invoke[$when] as $path ) { + foreach ( $this->_early_invoke[ $when ] as $path ) { if ( $this->cmd_starts_with( $path ) ) { if ( empty( $real_when ) || ( $real_when && $real_when === $when ) ) { $this->_run_command_and_exit(); @@ -116,10 +116,10 @@ private function do_early_invoke( $when ) { public function get_global_config_path() { if ( getenv( 'EE_CONFIG_PATH' ) ) { - $config_path = getenv( 'EE_CONFIG_PATH' ); + $config_path = getenv( 'EE_CONFIG_PATH' ); $this->_global_config_path_debug = 'Using global config from EE_CONFIG_PATH env var: ' . $config_path; } else { - $config_path = Utils\get_home_dir() . '/.ee4/config.yml'; + $config_path = Utils\get_home_dir() . '/.ee4/config.yml'; $this->_global_config_path_debug = 'Using default global config: ' . $config_path; } @@ -175,7 +175,6 @@ public function get_packages_dir_path() { } else { $packages_dir = Utils\get_home_dir() . '/.ee4/packages/'; } - return $packages_dir; } @@ -187,7 +186,6 @@ private function cmd_starts_with( $prefix ) { * Given positional arguments, find the command to execute. * * @param array $args - * * @return array|string Command, args, and path on success; error message on failure */ public function find_command_to_run( $args ) { @@ -199,16 +197,15 @@ public function find_command_to_run( $args ) { while ( ! empty( $args ) && $command->can_have_subcommands() ) { $cmd_path[] = $args[0]; - $full_name = implode( ' ', $cmd_path ); + $full_name = implode( ' ', $cmd_path ); $subcommand = $command->find_subcommand( $args ); if ( ! $subcommand ) { if ( count( $cmd_path ) > 1 ) { - $child = array_pop( $cmd_path ); + $child = array_pop( $cmd_path ); $parent_name = implode( ' ', $cmd_path ); - $suggestion = $this->get_subcommand_suggestion( $child, $command ); - + $suggestion = $this->get_subcommand_suggestion( $child, $command ); return sprintf( "'%s' is not a registered subcommand of '%s'. See 'ee help %s' for available subcommands.%s", $child, @@ -243,9 +240,9 @@ public function find_command_to_run( $args ) { /** * Find the EE command to run given arguments, and invoke it. * - * @param array $args Positional arguments including command name - * @param array $assoc_args Associative arguments for the command. - * @param array $options Configuration options for the function. + * @param array $args Positional arguments including command name + * @param array $assoc_args Associative arguments for the command. + * @param array $options Configuration options for the function. */ public function run_command( $args, $assoc_args = array(), $options = array() ) { @@ -260,15 +257,14 @@ public function run_command( $args, $assoc_args = array(), $options = array() ) $extra_args = array(); - if ( isset( $this->extra_config[$name] ) ) { - $extra_args = $this->extra_config[$name]; + if ( isset( $this->extra_config[ $name ] ) ) { + $extra_args = $this->extra_config[ $name ]; } EE::debug( 'Running command: ' . $name, 'bootstrap' ); try { $command->invoke( $final_args, $assoc_args, $extra_args ); - } - catch ( EE\Iterators\Exception $e ) { + } catch ( EE\Iterators\Exception $e ) { EE::error( $e->getMessage() ); } } @@ -310,7 +306,6 @@ private function _run_command_and_exit( $help_exit_warning = '' ) { * scheme of "docker" or "docker-compose"). * * @param string $connection_string Passed connection string. - * * @return void */ private function run_ssh_command( $connection_string ) { @@ -333,16 +328,16 @@ private function run_ssh_command( $connection_string ) { } $ee_binary = 'ee'; - $ee_args = array_slice( $GLOBALS['argv'], 1 ); + $ee_args = array_slice( $GLOBALS['argv'], 1 ); if ( $this->alias && ! empty( $ee_args[0] ) && $this->alias === $ee_args[0] ) { array_shift( $ee_args ); $runtime_alias = array(); - foreach ( $this->aliases[$this->alias] as $key => $value ) { + foreach ( $this->aliases[ $this->alias ] as $key => $value ) { if ( 'ssh' === $key ) { continue; } - $runtime_alias[$key] = $value; + $runtime_alias[ $key ] = $value; } if ( ! empty( $runtime_alias ) ) { $encoded_alias = json_encode( @@ -350,17 +345,17 @@ private function run_ssh_command( $connection_string ) { $this->alias => $runtime_alias, ) ); - $ee_binary = "EE_RUNTIME_ALIAS='{$encoded_alias}' {$ee_binary} {$this->alias}"; + $ee_binary = "EE_RUNTIME_ALIAS='{$encoded_alias}' {$ee_binary} {$this->alias}"; } } foreach ( $ee_args as $k => $v ) { if ( preg_match( '#--ssh=#', $v ) ) { - unset( $ee_args[$k] ); + unset( $ee_args[ $k ] ); } } - $ee_command = $pre_cmd . $env_vars . $ee_binary . ' ' . implode( ' ', array_map( 'escapeshellarg', $ee_args ) ); + $ee_command = $pre_cmd . $env_vars . $ee_binary . ' ' . implode( ' ', array_map( 'escapeshellarg', $ee_args ) ); $escaped_command = $this->generate_ssh_command( $bits, $ee_command ); passthru( $escaped_command, $exit_code ); @@ -376,7 +371,6 @@ private function run_ssh_command( $connection_string ) { * * @param array $bits Parsed connection string. * @param string $ee_command EE command to run. - * * @return string */ private function generate_ssh_command( $bits, $ee_command ) { @@ -384,11 +378,11 @@ private function generate_ssh_command( $bits, $ee_command ) { // Set default values. foreach ( array( 'scheme', 'user', 'host', 'port', 'path' ) as $bit ) { - if ( ! isset( $bits[$bit] ) ) { - $bits[$bit] = null; + if ( ! isset( $bits[ $bit ] ) ) { + $bits[ $bit ] = null; } - EE::debug( 'SSH ' . $bit . ': ' . $bits[$bit], 'bootstrap' ); + EE::debug( 'SSH ' . $bit . ': ' . $bits[ $bit ], 'bootstrap' ); } $is_tty = function_exists( 'posix_isatty' ) && posix_isatty( STDOUT ); @@ -457,7 +451,6 @@ private function generate_ssh_command( $bits, $ee_command ) { */ public function is_command_disabled( $command ) { $path = implode( ' ', array_slice( \EE\Dispatcher\get_path( $command ), 1 ) ); - return in_array( $path, $this->config['disabled_commands'] ); } @@ -514,14 +507,14 @@ public function init_config() { // File config { - $this->global_config_path = $this->get_global_config_path(); + $this->global_config_path = $this->get_global_config_path(); $this->project_config_path = $this->get_project_config_path(); $configurator->merge_yml( $this->global_config_path, $this->alias ); - $config = $configurator->to_array(); + $config = $configurator->to_array(); $this->_required_files['global'] = $config[0]['require']; $configurator->merge_yml( $this->project_config_path, $this->alias ); - $config = $configurator->to_array(); + $config = $configurator->to_array(); $this->_required_files['project'] = $config[0]['require']; } @@ -530,10 +523,10 @@ public function init_config() { list( $args, $assoc_args, $this->runtime_config ) = $configurator->parse_args( $argv ); // foo --help -> help foo - if ( isset( $assoc_args['help'] ) && ! in_array( 'wp', $args ) ) { - array_unshift( $args, 'help' ); - unset( $assoc_args['help'] ); - } + if ( isset( $assoc_args['help'] ) && ! in_array( 'wp', $args ) ) { + array_unshift( $args, 'help' ); + unset( $assoc_args['help'] ); + } list( $this->arguments, $this->assoc_args ) = [ $args, $assoc_args ]; @@ -543,9 +536,9 @@ public function init_config() { list( $this->config, $this->extra_config ) = $configurator->to_array(); $this->aliases = $configurator->get_aliases(); if ( count( $this->aliases ) && ! isset( $this->aliases['@all'] ) ) { - $this->aliases = array_reverse( $this->aliases ); + $this->aliases = array_reverse( $this->aliases ); $this->aliases['@all'] = 'Run command against every registered alias.'; - $this->aliases = array_reverse( $this->aliases ); + $this->aliases = array_reverse( $this->aliases ); } $this->_required_files['runtime'] = $this->config['require']; } @@ -554,39 +547,38 @@ public function init_config() { * Ensures that vars are present in config. If they aren't, attempts to * create config file and add vars in it. * - * @param $var Variable to check. + * @param $var Variable to check. * @param $default Default value to use if $var is not set. */ - private function ensure_present_in_config( $var, $default ) { + private function ensure_present_in_config( $var, $default) { - if ( empty( $this->config[$var] ) ) { - $this->config[$var] = $default; + if ( empty($this->config[$var]) ) { + $this->config[$var] = $default ; - $config_file_path = getenv( 'EE_CONFIG_PATH' ) ? getenv( 'EE_CONFIG_PATH' ) : Utils\get_home_dir() . '/.ee4/config.yml'; - $config_dir_path = dirname( $config_file_path ); + $config_file_path = getenv('EE_CONFIG_PATH') ? getenv('EE_CONFIG_PATH') : Utils\get_home_dir() . '/.ee4/config.yml'; + $config_dir_path = dirname( $config_file_path ); if ( file_exists( $config_file_path ) ) { if ( is_readable( $config_file_path ) ) { if ( is_writable( $config_file_path ) ) { - $existing_config = Spyc::YAMLLoad( $config_file_path ); + $existing_config = Spyc::YAMLLoad ( $config_file_path ); $this->add_var_to_config_file( $var, $config_file_path, $existing_config ); - return; } - EE::error( "The config file {$config_file_path} is not writable. Please set a config path which is writable in EE_CONFIG_PATH environment variable." ); + EE::error("The config file {$config_file_path} is not writable. Please set a config path which is writable in EE_CONFIG_PATH environment variable."); } - EE::error( "The config file {$config_file_path} is not readable. Please select a config path which is readable in EE_CONFIG_PATH environment variable." ); - } else { + EE::error("The config file {$config_file_path} is not readable. Please select a config path which is readable in EE_CONFIG_PATH environment variable."); + } + else { if ( is_writable( $config_dir_path ) ) { $this->add_var_to_config_file( $var, $config_file_path ); - return; } - $mkdir_success = mkdir( $config_dir_path, 0755, true ); + $mkdir_success = mkdir ( $config_dir_path , 0755, true ); if ( ! $mkdir_success ) { - EE::error( "The config file path ${$config_dir_path} is not writable. Please select a config path which is writable in EE_CONFIG_PATH environment variable." ); + EE::error("The config file path ${$config_dir_path} is not writable. Please select a config path which is writable in EE_CONFIG_PATH environment variable."); } - $this->add_var_to_config_file( $var, $config_file_path ); + $this->add_var_to_config_file($var, $config_file_path ); } } } @@ -648,30 +640,30 @@ private function run_alias_group( $aliases ) { foreach ( $aliases as $alias ) { EE::log( $alias ); - $args = implode( ' ', array_map( 'escapeshellarg', $this->arguments ) ); - $assoc_args = Utils\assoc_args_to_str( $this->assoc_args ); + $args = implode( ' ', array_map( 'escapeshellarg', $this->arguments ) ); + $assoc_args = Utils\assoc_args_to_str( $this->assoc_args ); $runtime_config = Utils\assoc_args_to_str( $this->runtime_config ); - $full_command = "EE_CONFIG_PATH={$config_path} {$php_bin} {$script_path} {$alias} {$args}{$assoc_args}{$runtime_config}"; - $proc = Utils\proc_open_compat( $full_command, array( STDIN, STDOUT, STDERR ), $pipes ); + $full_command = "EE_CONFIG_PATH={$config_path} {$php_bin} {$script_path} {$alias} {$args}{$assoc_args}{$runtime_config}"; + $proc = Utils\proc_open_compat( $full_command, array( STDIN, STDOUT, STDERR ), $pipes ); proc_close( $proc ); } } private function set_alias( $alias ) { - $orig_config = $this->config; - $alias_config = $this->aliases[$this->alias]; + $orig_config = $this->config; + $alias_config = $this->aliases[ $this->alias ]; $this->config = array_merge( $orig_config, $alias_config ); foreach ( $alias_config as $key => $_ ) { - if ( isset( $orig_config[$key] ) && ! is_null( $orig_config[$key] ) ) { - $this->assoc_args[$key] = $orig_config[$key]; + if ( isset( $orig_config[ $key ] ) && ! is_null( $orig_config[ $key ] ) ) { + $this->assoc_args[ $key ] = $orig_config[ $key ]; } } } public function start() { - $this->ensure_present_in_config( 'sites_path', Utils\get_home_dir() . '/ee4-sites' ); - $this->ensure_present_in_config( 'db_path', Utils\get_home_dir() . '/.ee4/ee4.db' ); + $this->ensure_present_in_config( 'sites_path', Utils\get_home_dir(). '/ee4-sites' ); + $this->ensure_present_in_config( 'db_path', Utils\get_home_dir(). '/.ee4/ee4.db' ); $this->ensure_present_in_config( 'ee_installer_version', 'stable' ); $this->init_ee4(); @@ -692,14 +684,14 @@ public function start() { if ( '@all' === $this->alias && is_string( $this->aliases['@all'] ) ) { $aliases = array_keys( $this->aliases ); - $k = array_search( '@all', $aliases ); - unset( $aliases[$k] ); + $k = array_search( '@all', $aliases ); + unset( $aliases[ $k ] ); $this->run_alias_group( $aliases ); exit; } if ( ! array_key_exists( $this->alias, $this->aliases ) ) { - $error_msg = "Alias '{$this->alias}' not found."; + $error_msg = "Alias '{$this->alias}' not found."; $suggestion = Utils\get_suggestion( $this->alias, array_keys( $this->aliases ), $threshold = 2 ); if ( $suggestion ) { $error_msg .= PHP_EOL . "Did you mean '{$suggestion}'?"; @@ -707,9 +699,9 @@ public function start() { EE::error( $error_msg ); } // Numerically indexed means a group of aliases - if ( isset( $this->aliases[$this->alias][0] ) ) { - $group_aliases = $this->aliases[$this->alias]; - $all_aliases = array_keys( $this->aliases ); + if ( isset( $this->aliases[ $this->alias ][0] ) ) { + $group_aliases = $this->aliases[ $this->alias ]; + $all_aliases = array_keys( $this->aliases ); if ( $diff = array_diff( $group_aliases, $all_aliases ) ) { EE::error( "Group '{$this->alias}' contains one or more invalid aliases: " . implode( ', ', $diff ) ); } @@ -732,7 +724,6 @@ public function start() { if ( $this->config['ssh'] ) { $this->run_ssh_command( $this->config['ssh'] ); - return; } @@ -779,12 +770,11 @@ private function auto_check_update() { $days_between_checks = 1; } - $cache = EE::get_cache(); + $cache = EE::get_cache(); $cache_key = 'ee-update-check'; // Bail early on the first check, so we don't always check on an unwritable cache. if ( ! $cache->has( $cache_key ) ) { $cache->write( $cache_key, time() ); - return; } From 0e683129d99d26ef9c55b638eafde1b236aadde3 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Thu, 31 May 2018 20:44:28 +0530 Subject: [PATCH 0114/1044] Remove letsencrypt temoprarily. Will be added back as soon as nginx-proxy is replaced with traefik. --- php/class-ee-docker.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php index 141a903bf..70af73412 100644 --- a/php/class-ee-docker.php +++ b/php/class-ee-docker.php @@ -11,7 +11,7 @@ class EE_DOCKER { * * @param array $filters Array of flags to determine the docker-compose.yml generation. * Empty/Default -> Generates default WordPress docker-compose.yml - * ['le'] -> Enables letsencrypt in the generation. + * ['wpsubdom'] -> Generates Subdomain WordPress docker-compose.yml * * @return String docker-compose.yml content string. */ @@ -62,12 +62,7 @@ public static function generate_docker_composer_yml( array $filters = [] ) { $v_host = in_array( 'wpsubdom', $filters ) ? 'VIRTUAL_HOST=${VIRTUAL_HOST},*.${VIRTUAL_HOST}' : 'VIRTUAL_HOST'; - if ( in_array( 'le', $filters ) ) { - $le_v_host = in_array( 'wpsubdom', $filters ) ? 'LETSENCRYPT_HOST=${VIRTUAL_HOST},*.${VIRTUAL_HOST}' : 'LETSENCRYPT_HOST=${VIRTUAL_HOST}'; - $nginx['environment'] = array( 'env' => array( array( 'name' => $v_host ), array( 'name' => $le_v_host ), array( 'name' => 'LETSENCRYPT_EMAIL=${VIRTUAL_HOST_EMAIL}' ) ) ); - } else { - $nginx['environment'] = array( 'env' => array( array( 'name' => $v_host ) ) ); - } + $nginx['environment'] = array( 'env' => array( array( 'name' => $v_host ) ) ); $nginx['volumes'] = array( array( 'vol' => array( array( 'name' => './app/src:/var/www/html' ), array( 'name' => './config/nginx/default.conf:/etc/nginx/conf.d/default.conf' ), array( 'name' => './logs/nginx:/var/log/nginx' ), array( 'name' => './config/nginx/common:/usr/local/openresty/nginx/conf/common' ) ) ) ); $nginx['networks'] = $network_default; @@ -182,9 +177,6 @@ public static function create_container( $container, $command = '' ) { $command = "docker run --name $nginx_proxy_name -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v $HOME/.ee4/nginx/certs:/etc/nginx/certs -v $HOME/.ee4/nginx/dhparam:/etc/nginx/dhparam -v $HOME/.ee4/nginx/conf.d:/etc/nginx/conf.d -v $HOME/.ee4/nginx/htpasswd:/etc/nginx/htpasswd -v $HOME/.ee4/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v $HOME/.ee4:/app/ee4 -v /usr/share/nginx/html easyengine/nginx-proxy"; break; - case 'letsencrypt': - $command = "docker run --name letsencrypt -d -v $HOME/.ee4/nginx/certs:/etc/nginx/certs:rw -v /var/run/docker.sock:/var/run/docker.sock:ro --volumes-from $nginx_proxy_name jrcs/letsencrypt-nginx-proxy-companion"; - break; } $launch = EE::launch( $command, false, true ); From 1169d92d21d7e455475e971fe54d531b188140f6 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Mon, 4 Jun 2018 14:57:48 +0530 Subject: [PATCH 0115/1044] Update build and release docs --- docs/build-and-release.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/docs/build-and-release.md b/docs/build-and-release.md index f390c7bbb..1229879aa 100644 --- a/docs/build-and-release.md +++ b/docs/build-and-release.md @@ -1,12 +1,10 @@ Build and Release Process === -Currently EasyEngine v4 is in development stage. Hence the main branch for v4 is [release/v4](https://github.com/easyengine/easyengine/tree/release/v4) and the ongoing development branch is [develop-v4](https://github.com/easyengine/easyengine/tree/develop-v4). +Currently EasyEngine v4 is in development stage. Hence the main branch for v4 is [master-v4](https://github.com/easyengine/easyengine/tree/master-v4) and the ongoing development branch is [develop-v4](https://github.com/easyengine/easyengine/tree/develop-v4). -The current build and release process uses [travis-ci](https://travis-ci.org/) and docker build triggers. +The current build and release process uses [travis-ci](https://travis-ci.org/). -* Whenever any commit is pushed or merged into the `develop-v4` branch, it triggers the travis-ci to generate a `nightly phar` and commits it to the [easyengine-builds](https://github.com/easyengine/easyengine-builds) repository, after that the docker build trigger for the `latest` tag is invoked and it takes the newly committed `nightly phar` and builds the `base image` with it. +* Whenever any commit is pushed or merged into the `develop-v4` branch, it triggers the travis-ci to generate a `nightly phar` and commits it to the [easyengine-builds](https://github.com/easyengine/easyengine-builds) repository. -* Similarly, whenever any commit is pushed or merged into the `releas/v4` branch, it triggers the travis-ci to generate a `stable phar` and commits it to the [easyengine-builds](https://github.com/easyengine/easyengine-builds) repository, after that the docker build trigger for the `stable` tag is invoked and it takes the newly committed `stable phar` and builds the `base image` with it. - -As there are a few issues with docker build triggers and the build fails at times, we may shift to building and pushing the docker image from travis-ci itself in the near future. \ No newline at end of file +* Similarly, whenever any commit is pushed or merged into the `releas/v4` branch, it triggers the travis-ci to generate a `stable phar` and commits it to the [easyengine-builds](https://github.com/easyengine/easyengine-builds) repository. \ No newline at end of file From a51ef1c4b6fcdd81f57c73a1efacebb99baf58eb Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Mon, 4 Jun 2018 14:58:44 +0530 Subject: [PATCH 0116/1044] Will be added later --- docs/test-documentation.md | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 docs/test-documentation.md diff --git a/docs/test-documentation.md b/docs/test-documentation.md deleted file mode 100644 index 4ab8cbdd4..000000000 --- a/docs/test-documentation.md +++ /dev/null @@ -1,5 +0,0 @@ -Test Documentation -=== - -Like [WP-CLI](https://github.com/wp-cli/wp-cli), EasyEngine also uses Behat to run its functional tests. - From 8e899187b8d64d35900db168b242c63bac55b188 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Mon, 4 Jun 2018 14:59:17 +0530 Subject: [PATCH 0117/1044] Update developer docs for all 3 scenarios Closes #1032 --- docs/developer-docs.md | 69 +++++++++++++++++++++++++++++++++++------- 1 file changed, 58 insertions(+), 11 deletions(-) diff --git a/docs/developer-docs.md b/docs/developer-docs.md index d156ef12a..8ab9ef169 100644 --- a/docs/developer-docs.md +++ b/docs/developer-docs.md @@ -7,40 +7,87 @@ EasyEngine Developer Docs * PHP * Composer -## Steps +Before starting refer the [core repository structure](docs/core-repo-structure.md) and the [structure for multiple repositories](docs/structure-for-multiple-repos.md). -1. Before starting refer the [core repository structure](https://github.com/EasyEngine/easyengine/blob/develop-v4/docs/core-repo-structure.md) and the [structure for multiple repositories](https://github.com/EasyEngine/easyengine/blob/develop-v4/docs/structure-for-multiple-repos.md). +## Steps for working on core repository -2. Fork the [command template repository](https://github.com/EasyEngine/command-template) and rename it to the command you want to create. This will now look like `author/command-name` in your github. +1. Fork the EasyEngine core repository, clone it locally and checkout the development branch. +```bash +git clone git@github.com:your-username/easyengine.git && git checkout develop-v4 +``` +2. Run `composer install` in the core repository after this. + +3. Make required changes and check them by running it locally using the following from the easyengine repository root: + +```bash +$ ./bin/ee command +``` -3. Update the `name` and `homepage` in the `composer.json` of the cloned repository. If the name is not updated properly then composer update/install with it will fail. +## Steps for working on existing commands + +1. Clone the EasyEngine core repository locally and checkout the development branch. +```bash +git clone git@github.com:EasyEngine/easyengine.git && git checkout develop-v4 +``` + +2. Fork the command you want to work on. + +3. Update the `composer.json` in the EasyEngine core repository, replace that command from `require` block to have your command name. For example lets replace site command: + +~~```"easyengine/site-command": "dev-master"```~~ + +```"your-username/site-command": "dev-master"``` + +4. Append the following section in the `composer.json` for development: +``` +"repositories": { + "author/command-name": { + "type": "path", + "url": "path/to/your/forked/repository" + } +} +``` + +5. Run `composer update` in the core repository after this. + +6. Then, run your commands locally using the following from the easyengine repository root: +```bash +$ ./bin/ee command +``` + +## Steps for creating a new command + +1. Fork the [command template repository](https://github.com/EasyEngine/command-template) and rename it to the command you want to create. This will now look like `author/command-name` in your github. + +2. Update the `name` and `homepage` in the `composer.json` of the cloned repository. If the name is not updated properly then composer update/install with it will fail. 3. Clone the EasyEngine core repository locally and checkout the development branch. ```bash git clone git@github.com:EasyEngine/easyengine.git && git checkout develop-v4 ``` -4. Update the `composer.json` in the core repository, add the following in `require`: +4. Update the `composer.json` in the EasyEngine core repository, add the following in `require`: ``` "author/command-name": "dev-master" ``` -Also, append the following section in the `composer.json`: +Also, append the following section in the `composer.json` for development: ``` "repositories": { "author/command-name": { - "type": "vcs", - "url": "git@github.com:author/command-name.git" + "type": "path", + "url": "path/to/your/forked/repository" } } ``` + Or, you can add your repository to packagist and run `composer reqiure author/name`. -5. Run `composer update --prefer-source` in the core repository after this. -7. After that, try running the default command `hello-world` given in the template, it should give a success message as below: +5. Run `composer update` in the core repository after this. +6. After that, try running the default command `hello-world` given in the template, it should give a success message as below by running it from the easyengine repository root: ```bash $ ./bin/ee hello-world Success: Hello world. ``` -6. Your repository will be in the vendor directory. +7. Your repository will be in the vendor directory. * Go to your repository directory: `cd vendor/author/command-name`. * Try `git remote -v`, if you have already put the proper url and used `--prefer-source` during composer install then the `remote origin` will have your github url. * In case that is missing, do `git remote add origin git@github.com:author/command-name.git`. From 76b3baeec14dd1869cfb8812390505ebafb7081a Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Mon, 4 Jun 2018 15:15:28 +0530 Subject: [PATCH 0118/1044] Update realtive path of url --- docs/developer-docs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/developer-docs.md b/docs/developer-docs.md index 8ab9ef169..155833aa4 100644 --- a/docs/developer-docs.md +++ b/docs/developer-docs.md @@ -7,7 +7,7 @@ EasyEngine Developer Docs * PHP * Composer -Before starting refer the [core repository structure](docs/core-repo-structure.md) and the [structure for multiple repositories](docs/structure-for-multiple-repos.md). +Before starting refer the [core repository structure](core-repo-structure.md) and the [structure for multiple repositories](structure-for-multiple-repos.md). ## Steps for working on core repository From 868a029242f2a68573919df3cdbff8e72e60461e Mon Sep 17 00:00:00 2001 From: Abhijit <abhijitrakas@gmail.com> Date: Tue, 5 Jun 2018 10:59:51 +0530 Subject: [PATCH 0119/1044] Remove allow root flag --- php/EE/Runner.php | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index cda8ce5a0..f878f2880 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -591,39 +591,6 @@ private function add_var_to_config_file( $var, $config_file_path, $config = [] ) fclose( $config_file ); } - private function check_root() { - if ( $this->config['allow-root'] ) { - return; # they're aware of the risks! - } - if ( count( $this->arguments ) >= 2 && 'cli' === $this->arguments[0] && in_array( $this->arguments[1], array( 'update', 'info' ), true ) ) { - return; # make it easier to update root-owned copies - } - if ( ! function_exists( 'posix_geteuid' ) ) { - return; # posix functions not available - } - if ( posix_geteuid() !== 0 ) { - return; # not root - } - - EE::error( - "YIKES! It looks like you're running this as root. You probably meant to " . - "run this as the user that your WordPress install exists under.\n" . - "\n" . - "If you REALLY mean to run this as root, we won't stop you, but just " . - 'bear in mind that any code on this site will then have full control of ' . - "your server, making it quite DANGEROUS.\n" . - "\n" . - "If you'd like to continue as root, please run this again, adding this " . - "flag: --allow-root\n" . - "\n" . - "If you'd like to run it as the user that this site is under, you can " . - "run the following to become the respective user:\n" . - "\n" . - " sudo -u USER -i -- ee <command>\n" . - "\n" - ); - } - private function run_alias_group( $aliases ) { Utils\check_proc_available( 'group alias' ); @@ -676,7 +643,6 @@ public function start() { EE::debug( $this->_project_config_path_debug, 'bootstrap' ); EE::debug( 'argv: ' . implode( ' ', $GLOBALS['argv'] ), 'bootstrap' ); - $this->check_root(); if ( $this->alias ) { if ( '@all' === $this->alias && ! isset( $this->aliases['@all'] ) ) { EE::error( "Cannot use '@all' when no aliases are registered." ); From 18f482e3d423b1e3d6b4f0af0b5ceea5a3937f0b Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Wed, 6 Jun 2018 19:36:30 +0530 Subject: [PATCH 0120/1044] Update core-repo structure readme --- docs/core-repo-structure.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/core-repo-structure.md b/docs/core-repo-structure.md index 77e037e80..e9c907582 100644 --- a/docs/core-repo-structure.md +++ b/docs/core-repo-structure.md @@ -3,18 +3,18 @@ EasyEngine Core Repository The core repository contains the cli interface for EasyEngine and the internal api's to facilitate and accommodate the creation and execution of commands. It is built on top of [WP-CLI](https://github.com/wp-cli/wp-cli) and follows the same basic structure. -1. `bin` folder contains the wrapper shell script to execute EasyEngine. -2. `ci` folder contains shell scripts to automate the phar building and deploying of the same to the [easyengine-builds](https://github.com/easyengine/easyengine-builds) repository with the help of [travis-ci](https://travis-ci.org/). -3. `ee4-config` folder has all the `nginx, php and redis` configurations required for different types of sites like `WordPress - Single-Site, Multi-Site` etc. -4. The `php` folder contains the main part of EasyEngine cli. +1. The `bin` directory contains the shell script entrypoint to the PHP files. +2. `ci` directory contains shell scripts to automate the phar building and deploying of the same to the [easyengine-builds](https://github.com/easyengine/easyengine-builds) repository with the help of [travis-ci](https://travis-ci.org/). +3. `ee4-config` directory has all the `nginx, php and redis` configurations required for different types of sites like `WordPress - Single-Site, Multi-Site` etc. +4. The `php` directory contains the core of EasyEngine cli. * It contains the `cli-command` which handles the most basic required functions like: `version, update` etc. * The [WP-CLI internal-api](https://github.com/wp-cli/handbook/blob/master/internal-api.md), booting and auto-loading logic and other utilities. - * It also contains new classes: + * EasyEngine adds the following classes on top of the existing codebase: * `EE_DB` having the generic Sqlite3 functions for db management. - * `EE_DOCKER` having various docker related functions like starting, stopping and inspecting containers, creating and connecting to networks, generating `docker-compose.yml`. + * `EE_DOCKER` having various docker related functions like starting, stopping and inspecting containers, creating and connecting to networks etc. * Also, the internal-api has been slightly modified to remove WordPress specific functions and additional features like, logging of all the command invocation and related log, success, debug and error messages from `EE::info(), EE::success(), EE::debug(), EE::error()` outputs into a file for debugging purposes. -5. `templates` folder contains the [mustache](https://mustache.github.io/) templates for man/help, generation of `docker-compose.yml` etc. -6. `utils` folder contains the scripts for `phar` generation. +5. `templates` directory contains the [mustache](https://mustache.github.io/) templates for man page/help, generation of `docker-compose.yml` etc. +6. `utils` directory contains the scripts for `phar` generation. From 56dab7d8982a43b7c33b70ce1f5aa412f58477e1 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Wed, 6 Jun 2018 19:37:08 +0530 Subject: [PATCH 0121/1044] Add info about installer repo --- docs/structure-for-multiple-repos.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/structure-for-multiple-repos.md b/docs/structure-for-multiple-repos.md index 15e7ac6f7..c4cfad164 100644 --- a/docs/structure-for-multiple-repos.md +++ b/docs/structure-for-multiple-repos.md @@ -1,8 +1,12 @@ Structure For Multiple Reops -===== +============================ EasyEngine v4 follows [WP-CLI](https://github.com/wp-cli/wp-cli) as the base of creation, hence it consists of multiple repos. The core repo [EasyEngine](https://github.com/EasyEngine/easyengine) contains the main structure and cli interface to facilitate the execution of all the commands. Each command has a separate repository like: [site-command](https://github.com/easyengine/site-command), [wp-command](https://github.com/easyengine/wp-command) etc., and they are added as commands to EasyEngine via composer packages. -Apart from the commands, there are also other miscellaneous repositories like the [easyengine-builds](https://github.com/easyengine/easyengine-builds) that contains the stable, as well as nightly builds of phar generated from the main repository, [dockerfiles](https://github.com/easyengine/dockerfiles) repository contains all the dockerfiles that are in use by EasyEngine. \ No newline at end of file +Apart from the commands, there are also other miscellaneous repositories like: + +* [easyengine-builds](https://github.com/easyengine/easyengine-builds) that contains the stable, as well as nightly builds of phar generated from the main repository. +* [dockerfiles](https://github.com/easyengine/dockerfiles) repository contains all the dockerfiles that are in use by EasyEngine. +* [installer](https://github.com/easyengine/installer) containing the installer scripts for EasyEngine. \ No newline at end of file From 59a1f7f7e7f334a66ef802fb8246b63e7e688d6a Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Wed, 6 Jun 2018 19:37:42 +0530 Subject: [PATCH 0122/1044] Update nginx image description Remove base image for now --- docs/docker-files.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/docker-files.md b/docs/docker-files.md index a8f155520..8dd438f6a 100644 --- a/docs/docker-files.md +++ b/docs/docker-files.md @@ -3,7 +3,7 @@ Docker Files 1. nginx-proxy: EasyEngine nginx-proxy uses [jwilder/nginx-proxy](https://github.com/jwilder/nginx-proxy) as the base. Nginx-proxy sets up a container running nginx and docker-gen. docker-gen generates reverse proxy configs for nginx and reloads nginx when containers are started and stopped. The root permission in this image have been changed with user permission in the EasyEngine image. -2. nginx: EasyEngine nginx image uses [openresty](https://github.com/openresty/docker-openresty) as the base. It is a full-fledged web application nginx server. Multiple additional modules have been added to make it similar to the EasyEngine version 3 nginx server as well as add things on top of it. +2. nginx: EasyEngine nginx image uses [openresty](https://github.com/openresty/docker-openresty) as the base. It is a full-fledged web application nginx server. Multiple additional modules have been added to make it similar to the EasyEngine version 3 nginx server as well as to add EasyEngine's custom configuration on top of it. 3. php: EasyEngine php image uses [wordpress](https://github.com/docker-library/wordpress) as the base image. Additional php extension that may be required have been added on top of it, also the permissions of the site data on the host machine is given to the user creating the site in this image. @@ -13,6 +13,4 @@ Docker Files 6. db: EasyEngine db image uses [mariadb](https://github.com/docker-library/mariadb/) image. -7. phpmyadmin: EasyEngine db image uses [phpmyadmin](https://github.com/phpmyadmin/docker) image. - -8. base: EasyEngine base image has been created by EasyEngine to facilitate the usage of EasyEngine v4 without any software dependency. Pulling and using this image will create the environment required to run EasyEngine and create the sites from this container with the help of the wrapper-script. The wrapper-script simply passes the parameters/arguments/flags given to it directly to the easyengine phar inside the easyengine base container for execution and running of EasyEngine. \ No newline at end of file +7. phpmyadmin: EasyEngine db image uses [phpmyadmin](https://github.com/phpmyadmin/docker) image. \ No newline at end of file From 3ebde4072b5eca76d82e8b0207fc8d809e415b2a Mon Sep 17 00:00:00 2001 From: Abhijit <abhijitrakas@gmail.com> Date: Wed, 6 Jun 2018 20:29:19 +0530 Subject: [PATCH 0123/1044] Remove allow-root from all files --- php/class-ee.php | 3 +-- php/config-spec.php | 8 -------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/php/class-ee.php b/php/class-ee.php index 70821c1b8..0f8c9d49f 100644 --- a/php/class-ee.php +++ b/php/class-ee.php @@ -818,7 +818,7 @@ public static function launch( $command, $exit_on_error = true, $return_detailed * @param array $assoc_args Associative arguments to include when calling the command. * @param bool $exit_on_error Whether to exit if the command returns an elevated return code. * @param bool $return_detailed Whether to return an exit status (default) or detailed execution results. - * @param array $runtime_args Override one or more global args (path,url,user,allow-root) + * @param array $runtime_args Override one or more global args (path,url,user) * @return int|ProcessRun The command exit status, or a ProcessRun instance */ public static function launch_self( $command, $args = array(), $assoc_args = array(), $exit_on_error = true, $return_detailed = false, $runtime_args = array() ) { @@ -826,7 +826,6 @@ public static function launch_self( $command, $args = array(), $assoc_args = arr 'path', 'url', 'user', - 'allow-root', ); foreach ( $reused_runtime_args as $key ) { diff --git a/php/config-spec.php b/php/config-spec.php index 1d28fea53..925894ef1 100644 --- a/php/config-spec.php +++ b/php/config-spec.php @@ -87,12 +87,4 @@ 'desc' => 'Suppress informational messages.', ), - # --allow-root => (NOT RECOMMENDED) Allow ee to run as root. This poses - # a security risk, so you probably do not want to do this. - 'allow-root' => array( - 'file' => false, # Explicit. Just in case the default changes. - 'runtime' => '', - 'hidden' => true, - ), - ); From 7db806b3a1a18972f2348bd8acff5afc69b0870e Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Wed, 6 Jun 2018 22:03:18 +0530 Subject: [PATCH 0124/1044] Update developer docs --- docs/developer-docs.md | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/docs/developer-docs.md b/docs/developer-docs.md index 155833aa4..1cef66755 100644 --- a/docs/developer-docs.md +++ b/docs/developer-docs.md @@ -38,10 +38,10 @@ git clone git@github.com:EasyEngine/easyengine.git && git checkout develop-v4 ```"your-username/site-command": "dev-master"``` -4. Append the following section in the `composer.json` for development: +4. Append the following section in the `composer.json` for development, eg. for site-command: ``` "repositories": { - "author/command-name": { + "janedoe/site-command": { "type": "path", "url": "path/to/your/forked/repository" } @@ -79,7 +79,7 @@ Also, append the following section in the `composer.json` for development: } ``` -Or, you can add your repository to packagist and run `composer reqiure author/name`. +Or, you can add your repository to packagist and run `composer reqiure author/command-name`. 5. Run `composer update` in the core repository after this. 6. After that, try running the default command `hello-world` given in the template, it should give a success message as below by running it from the easyengine repository root: @@ -87,10 +87,5 @@ Or, you can add your repository to packagist and run `composer reqiure author/na $ ./bin/ee hello-world Success: Hello world. ``` -7. Your repository will be in the vendor directory. - * Go to your repository directory: `cd vendor/author/command-name`. - * Try `git remote -v`, if you have already put the proper url and used `--prefer-source` during composer install then the `remote origin` will have your github url. - * In case that is missing, do `git remote add origin git@github.com:author/command-name.git`. - * Make changes inside the vendor directory itself to view your changes directly and keep committing them regularly. -Note: We are working on scaffold command and these manual steps will be replaced very soon. \ No newline at end of file +Note: These manual steps for setting up a new EasyEngine command will be replaced by a scaffold command. \ No newline at end of file From a0c889b9a8d5ca786e851cb5583642f18b42bc2f Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Wed, 6 Jun 2018 22:11:10 +0530 Subject: [PATCH 0125/1044] Update docker-files to have traefik description --- docs/docker-files.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docker-files.md b/docs/docker-files.md index 8dd438f6a..fe18bc76a 100644 --- a/docs/docker-files.md +++ b/docs/docker-files.md @@ -1,7 +1,7 @@ Docker Files ============ -1. nginx-proxy: EasyEngine nginx-proxy uses [jwilder/nginx-proxy](https://github.com/jwilder/nginx-proxy) as the base. Nginx-proxy sets up a container running nginx and docker-gen. docker-gen generates reverse proxy configs for nginx and reloads nginx when containers are started and stopped. The root permission in this image have been changed with user permission in the EasyEngine image. +1. traefik: EasyEngine traefik uses [traefik](https://github.com/containous/traefik) for load-balancing. Træfik is a modern HTTP reverse proxy and load balancer that makes deploying microservices easy. 2. nginx: EasyEngine nginx image uses [openresty](https://github.com/openresty/docker-openresty) as the base. It is a full-fledged web application nginx server. Multiple additional modules have been added to make it similar to the EasyEngine version 3 nginx server as well as to add EasyEngine's custom configuration on top of it. From 603b385e458bd53d33f74eb67689bf792ffc7840 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Wed, 6 Jun 2018 22:36:59 +0530 Subject: [PATCH 0126/1044] Remove config files --- ee4-config/default/config/.env.example | 10 - .../config/nginx/common/locations.conf | 76 -- .../default/config/nginx/common/wpcommon.conf | 35 - ee4-config/default/config/php-fpm/php.ini | 7 - ee4-config/redis/redis.conf | 1052 ----------------- ee4-config/wp/config/nginx/common/php.conf | 11 - ee4-config/wp/config/nginx/default.conf | 16 - .../config/nginx/common/redis.conf | 57 - .../config/nginx/common/wpsubdir.conf | 10 - .../wpredis-subdir/config/nginx/default.conf | 18 - .../wpredis/config/nginx/common/redis.conf | 57 - ee4-config/wpredis/config/nginx/default.conf | 18 - .../wpsubdir/config/nginx/common/php.conf | 11 - .../config/nginx/common/wpsubdir.conf | 10 - ee4-config/wpsubdir/config/nginx/default.conf | 17 - php/init-ee.php | 1 - 16 files changed, 1406 deletions(-) delete mode 100644 ee4-config/default/config/.env.example delete mode 100644 ee4-config/default/config/nginx/common/locations.conf delete mode 100644 ee4-config/default/config/nginx/common/wpcommon.conf delete mode 100644 ee4-config/default/config/php-fpm/php.ini delete mode 100644 ee4-config/redis/redis.conf delete mode 100644 ee4-config/wp/config/nginx/common/php.conf delete mode 100644 ee4-config/wp/config/nginx/default.conf delete mode 100644 ee4-config/wpredis-subdir/config/nginx/common/redis.conf delete mode 100644 ee4-config/wpredis-subdir/config/nginx/common/wpsubdir.conf delete mode 100644 ee4-config/wpredis-subdir/config/nginx/default.conf delete mode 100644 ee4-config/wpredis/config/nginx/common/redis.conf delete mode 100644 ee4-config/wpredis/config/nginx/default.conf delete mode 100644 ee4-config/wpsubdir/config/nginx/common/php.conf delete mode 100644 ee4-config/wpsubdir/config/nginx/common/wpsubdir.conf delete mode 100644 ee4-config/wpsubdir/config/nginx/default.conf diff --git a/ee4-config/default/config/.env.example b/ee4-config/default/config/.env.example deleted file mode 100644 index 30c3cc7b2..000000000 --- a/ee4-config/default/config/.env.example +++ /dev/null @@ -1,10 +0,0 @@ -MYSQL_ROOT_PASSWORD=password -MYSQL_DATABASE=wordpress -MYSQL_USER=wordpress -MYSQL_PASSWORD=password - -WORDPRESS_DB_HOST=db -VIRTUAL_HOST={V_HOST} -VIRTUAL_HOST_EMAIL=example@{V_HOST} -USER_ID=1000 -GROUP_ID=1000 diff --git a/ee4-config/default/config/nginx/common/locations.conf b/ee4-config/default/config/nginx/common/locations.conf deleted file mode 100644 index a45de4d74..000000000 --- a/ee4-config/default/config/nginx/common/locations.conf +++ /dev/null @@ -1,76 +0,0 @@ -# NGINX CONFIGURATION FOR COMMON LOCATION -# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee) -# Basic locations files -location = /favicon.ico { - access_log off; - log_not_found off; - expires max; -} - -location = /robots.txt { - # Some WordPress plugin gererate robots.txt file - # Refer #340 issue - - return 200 'User-agent: * -Disallow: /'; - access_log off; - log_not_found off; -} -# Cache static files -location ~* \.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf|swf)$ { - add_header "Access-Control-Allow-Origin" "*"; - access_log off; - log_not_found off; - expires max; -} -# Security settings for better privacy -# Deny hidden files -location /.well-known { - allow all; -} -location ~ /\. { - deny all; - access_log off; - log_not_found off; -} -# Deny backup extensions & log files -location ~* ^.+\.(bak|log|old|orig|original|php#|php~|php_bak|save|swo|swp|sql)$ { - deny all; - access_log off; - log_not_found off; -} -# Return 403 forbidden for readme.(txt|html) or license.(txt|html) or example.(txt|html) -if ($uri ~* "^.+(readme|license|example)\.(txt|html)$") { - return 403; -} -# Status pages -location /nginx_status { - stub_status on; - access_log off; - -} -location ~ ^/(status|ping) { - include fastcgi_params; - fastcgi_pass php:9000; - -} -# EasyEngine (ee) utilities -# phpMyAdmin settings -location /pma { - return 301 http://pma.$host; -} -location /phpMyAdmin { - return 301 http://pma.$host; -} -location /phpmyadmin { - return 301 http://pma.$host; -} -# Adminer settings -location /adminer { - return 301 https://$host:22222/db/adminer; -} - -location ~* \.(css|js)$ { - expires 5s; - add_header Cache-Control "public, must-revalidate"; -} diff --git a/ee4-config/default/config/nginx/common/wpcommon.conf b/ee4-config/default/config/nginx/common/wpcommon.conf deleted file mode 100644 index be7795e1c..000000000 --- a/ee4-config/default/config/nginx/common/wpcommon.conf +++ /dev/null @@ -1,35 +0,0 @@ -# WordPress COMMON SETTINGS -# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee) -# Limit access to avoid brute force attack -location = /wp-login.php { - limit_req zone=one burst=1 nodelay; - include fastcgi_params; - fastcgi_pass php:9000; -} -# Disable wp-config.txt -location = /wp-config.txt { - deny all; - access_log off; - log_not_found off; -} -# Disallow php in upload folder -location /wp-content/uploads/ { - location ~ \.php$ { - #Prevent Direct Access Of PHP Files From Web Browsers - deny all; - } -} -# Yoast sitemap -location ~ ([^/]*)sitemap(.*)\.x(m|s)l$ { - rewrite ^/sitemap\.xml$ /sitemap_index.xml permanent; - rewrite ^/([a-z]+)?-?sitemap\.xsl$ /index.php?xsl=$1 last; - # Rules for yoast sitemap with wp|wpsubdir|wpsubdomain - rewrite ^.*/sitemap_index\.xml$ /index.php?sitemap=1 last; - rewrite ^.*/([^/]+?)-sitemap([0-9]+)?\.xml$ /index.php?sitemap=$1&sitemap_n=$2 last; - # Following lines are options. Needed for WordPress seo addons - rewrite ^/news_sitemap\.xml$ /index.php?sitemap=wpseo_news last; - rewrite ^/locations\.kml$ /index.php?sitemap=wpseo_local_kml last; - rewrite ^/geo_sitemap\.xml$ /index.php?sitemap=wpseo_local last; - rewrite ^/video-sitemap\.xsl$ /index.php?xsl=video last; - access_log off; -} diff --git a/ee4-config/default/config/php-fpm/php.ini b/ee4-config/default/config/php-fpm/php.ini deleted file mode 100644 index c5964c495..000000000 --- a/ee4-config/default/config/php-fpm/php.ini +++ /dev/null @@ -1,7 +0,0 @@ -# Custom PHP settings - -upload_max_filesize = 100M -post_max_size = 100M - -[mail function] -sendmail_path = /usr/sbin/sendmail -S mail:1025 diff --git a/ee4-config/redis/redis.conf b/ee4-config/redis/redis.conf deleted file mode 100644 index 8b41aa852..000000000 --- a/ee4-config/redis/redis.conf +++ /dev/null @@ -1,1052 +0,0 @@ -# Redis configuration file example. -# -# Note that in order to read the configuration file, Redis must be -# started with the file path as first argument: -# -# ./redis-server /path/to/redis.conf - -# Note on units: when memory size is needed, it is possible to specify -# it in the usual form of 1k 5GB 4M and so forth: -# -# 1k => 1000 bytes -# 1kb => 1024 bytes -# 1m => 1000000 bytes -# 1mb => 1024*1024 bytes -# 1g => 1000000000 bytes -# 1gb => 1024*1024*1024 bytes -# -# units are case insensitive so 1GB 1Gb 1gB are all the same. - -################################## INCLUDES ################################### - -# Include one or more other config files here. This is useful if you -# have a standard template that goes to all Redis servers but also need -# to customize a few per-server settings. Include files can include -# other files, so use this wisely. -# -# Notice option "include" won't be rewritten by command "CONFIG REWRITE" -# from admin or Redis Sentinel. Since Redis always uses the last processed -# line as value of a configuration directive, you'd better put includes -# at the beginning of this file to avoid overwriting config change at runtime. -# -# If instead you are interested in using includes to override configuration -# options, it is better to use include as the last line. -# -# include /path/to/local.conf -# include /path/to/other.conf - -################################## NETWORK ##################################### - -# By default, if no "bind" configuration directive is specified, Redis listens -# for connections from all the network interfaces available on the server. -# It is possible to listen to just one or multiple selected interfaces using -# the "bind" configuration directive, followed by one or more IP addresses. -# -# Examples: -# -# bind 192.168.1.100 10.0.0.1 -# bind 127.0.0.1 ::1 -# -# ~~~ WARNING ~~~ If the computer running Redis is directly exposed to the -# internet, binding to all the interfaces is dangerous and will expose the -# instance to everybody on the internet. So by default we uncomment the -# following bind directive, that will force Redis to listen only into -# the IPv4 lookback interface address (this means Redis will be able to -# accept connections only from clients running into the same computer it -# is running). -# -# IF YOU ARE SURE YOU WANT YOUR INSTANCE TO LISTEN TO ALL THE INTERFACES -# JUST COMMENT THE FOLLOWING LINE. -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -bind 127.0.0.1 - -# Protected mode is a layer of security protection, in order to avoid that -# Redis instances left open on the internet are accessed and exploited. -# -# When protected mode is on and if: -# -# 1) The server is not binding explicitly to a set of addresses using the -# "bind" directive. -# 2) No password is configured. -# -# The server only accepts connections from clients connecting from the -# IPv4 and IPv6 loopback addresses 127.0.0.1 and ::1, and from Unix domain -# sockets. -# -# By default protected mode is enabled. You should disable it only if -# you are sure you want clients from other hosts to connect to Redis -# even if no authentication is configured, nor a specific set of interfaces -# are explicitly listed using the "bind" directive. -protected-mode yes - -# Accept connections on the specified port, default is 6379 (IANA #815344). -# If port 0 is specified Redis will not listen on a TCP socket. -port 6379 - -# TCP listen() backlog. -# -# In high requests-per-second environments you need an high backlog in order -# to avoid slow clients connections issues. Note that the Linux kernel -# will silently truncate it to the value of /proc/sys/net/core/somaxconn so -# make sure to raise both the value of somaxconn and tcp_max_syn_backlog -# in order to get the desired effect. -tcp-backlog 511 - -# Unix socket. -# -# Specify the path for the Unix socket that will be used to listen for -# incoming connections. There is no default, so Redis will not listen -# on a unix socket when not specified. -# -# unixsocket /var/run/redis/redis.sock -# unixsocketperm 700 - -# Close the connection after a client is idle for N seconds (0 to disable) -timeout 0 - -# TCP keepalive. -# -# If non-zero, use SO_KEEPALIVE to send TCP ACKs to clients in absence -# of communication. This is useful for two reasons: -# -# 1) Detect dead peers. -# 2) Take the connection alive from the point of view of network -# equipment in the middle. -# -# On Linux, the specified value (in seconds) is the period used to send ACKs. -# Note that to close the connection the double of the time is needed. -# On other kernels the period depends on the kernel configuration. -# -# A reasonable value for this option is 300 seconds, which is the new -# Redis default starting with Redis 3.2.1. -tcp-keepalive 300 - -################################# GENERAL ##################################### - -# By default Redis does not run as a daemon. Use 'yes' if you need it. -# Note that Redis will write a pid file in /var/run/redis.pid when daemonized. -daemonize yes - -# If you run Redis from upstart or systemd, Redis can interact with your -# supervision tree. Options: -# supervised no - no supervision interaction -# supervised upstart - signal upstart by putting Redis into SIGSTOP mode -# supervised systemd - signal systemd by writing READY=1 to $NOTIFY_SOCKET -# supervised auto - detect upstart or systemd method based on -# UPSTART_JOB or NOTIFY_SOCKET environment variables -# Note: these supervision methods only signal "process is ready." -# They do not enable continuous liveness pings back to your supervisor. -supervised no - -# If a pid file is specified, Redis writes it where specified at startup -# and removes it at exit. -# -# When the server runs non daemonized, no pid file is created if none is -# specified in the configuration. When the server is daemonized, the pid file -# is used even if not specified, defaulting to "/var/run/redis.pid". -# -# Creating a pid file is best effort: if Redis is not able to create it -# nothing bad happens, the server will start and run normally. -pidfile /var/run/redis/redis-server.pid - -# Specify the server verbosity level. -# This can be one of: -# debug (a lot of information, useful for development/testing) -# verbose (many rarely useful info, but not a mess like the debug level) -# notice (moderately verbose, what you want in production probably) -# warning (only very important / critical messages are logged) -loglevel notice - -# Specify the log file name. Also the empty string can be used to force -# Redis to log on the standard output. Note that if you use standard -# output for logging but daemonize, logs will be sent to /dev/null -logfile /data/redis-server.log - -# To enable logging to the system logger, just set 'syslog-enabled' to yes, -# and optionally update the other syslog parameters to suit your needs. -# syslog-enabled no - -# Specify the syslog identity. -# syslog-ident redis - -# Specify the syslog facility. Must be USER or between LOCAL0-LOCAL7. -# syslog-facility local0 - -# Set the number of databases. The default database is DB 0, you can select -# a different one on a per-connection basis using SELECT <dbid> where -# dbid is a number between 0 and 'databases'-1 -databases 16 - -################################ SNAPSHOTTING ################################ -# -# Save the DB on disk: -# -# save <seconds> <changes> -# -# Will save the DB if both the given number of seconds and the given -# number of write operations against the DB occurred. -# -# In the example below the behaviour will be to save: -# after 900 sec (15 min) if at least 1 key changed -# after 300 sec (5 min) if at least 10 keys changed -# after 60 sec if at least 10000 keys changed -# -# Note: you can disable saving completely by commenting out all "save" lines. -# -# It is also possible to remove all the previously configured save -# points by adding a save directive with a single empty string argument -# like in the following example: -# -# save "" - -save 900 1 -save 300 10 -save 60 10000 - -# By default Redis will stop accepting writes if RDB snapshots are enabled -# (at least one save point) and the latest background save failed. -# This will make the user aware (in a hard way) that data is not persisting -# on disk properly, otherwise chances are that no one will notice and some -# disaster will happen. -# -# If the background saving process will start working again Redis will -# automatically allow writes again. -# -# However if you have setup your proper monitoring of the Redis server -# and persistence, you may want to disable this feature so that Redis will -# continue to work as usual even if there are problems with disk, -# permissions, and so forth. -stop-writes-on-bgsave-error yes - -# Compress string objects using LZF when dump .rdb databases? -# For default that's set to 'yes' as it's almost always a win. -# If you want to save some CPU in the saving child set it to 'no' but -# the dataset will likely be bigger if you have compressible values or keys. -rdbcompression yes - -# Since version 5 of RDB a CRC64 checksum is placed at the end of the file. -# This makes the format more resistant to corruption but there is a performance -# hit to pay (around 10%) when saving and loading RDB files, so you can disable it -# for maximum performances. -# -# RDB files created with checksum disabled have a checksum of zero that will -# tell the loading code to skip the check. -rdbchecksum yes - -# The filename where to dump the DB -dbfilename dump.rdb - -# The working directory. -# -# The DB will be written inside this directory, with the filename specified -# above using the 'dbfilename' configuration directive. -# -# The Append Only File will also be created inside this directory. -# -# Note that you must specify a directory here, not a file name. -dir /var/lib/redis - -################################# REPLICATION ################################# - -# Master-Slave replication. Use slaveof to make a Redis instance a copy of -# another Redis server. A few things to understand ASAP about Redis replication. -# -# 1) Redis replication is asynchronous, but you can configure a master to -# stop accepting writes if it appears to be not connected with at least -# a given number of slaves. -# 2) Redis slaves are able to perform a partial resynchronization with the -# master if the replication link is lost for a relatively small amount of -# time. You may want to configure the replication backlog size (see the next -# sections of this file) with a sensible value depending on your needs. -# 3) Replication is automatic and does not need user intervention. After a -# network partition slaves automatically try to reconnect to masters -# and resynchronize with them. -# -# slaveof <masterip> <masterport> - -# If the master is password protected (using the "requirepass" configuration -# directive below) it is possible to tell the slave to authenticate before -# starting the replication synchronization process, otherwise the master will -# refuse the slave request. -# -# masterauth <master-password> - -# When a slave loses its connection with the master, or when the replication -# is still in progress, the slave can act in two different ways: -# -# 1) if slave-serve-stale-data is set to 'yes' (the default) the slave will -# still reply to client requests, possibly with out of date data, or the -# data set may just be empty if this is the first synchronization. -# -# 2) if slave-serve-stale-data is set to 'no' the slave will reply with -# an error "SYNC with master in progress" to all the kind of commands -# but to INFO and SLAVEOF. -# -slave-serve-stale-data yes - -# You can configure a slave instance to accept writes or not. Writing against -# a slave instance may be useful to store some ephemeral data (because data -# written on a slave will be easily deleted after resync with the master) but -# may also cause problems if clients are writing to it because of a -# misconfiguration. -# -# Since Redis 2.6 by default slaves are read-only. -# -# Note: read only slaves are not designed to be exposed to untrusted clients -# on the internet. It's just a protection layer against misuse of the instance. -# Still a read only slave exports by default all the administrative commands -# such as CONFIG, DEBUG, and so forth. To a limited extent you can improve -# security of read only slaves using 'rename-command' to shadow all the -# administrative / dangerous commands. -slave-read-only yes - -# Replication SYNC strategy: disk or socket. -# -# ------------------------------------------------------- -# WARNING: DISKLESS REPLICATION IS EXPERIMENTAL CURRENTLY -# ------------------------------------------------------- -# -# New slaves and reconnecting slaves that are not able to continue the replication -# process just receiving differences, need to do what is called a "full -# synchronization". An RDB file is transmitted from the master to the slaves. -# The transmission can happen in two different ways: -# -# 1) Disk-backed: The Redis master creates a new process that writes the RDB -# file on disk. Later the file is transferred by the parent -# process to the slaves incrementally. -# 2) Diskless: The Redis master creates a new process that directly writes the -# RDB file to slave sockets, without touching the disk at all. -# -# With disk-backed replication, while the RDB file is generated, more slaves -# can be queued and served with the RDB file as soon as the current child producing -# the RDB file finishes its work. With diskless replication instead once -# the transfer starts, new slaves arriving will be queued and a new transfer -# will start when the current one terminates. -# -# When diskless replication is used, the master waits a configurable amount of -# time (in seconds) before starting the transfer in the hope that multiple slaves -# will arrive and the transfer can be parallelized. -# -# With slow disks and fast (large bandwidth) networks, diskless replication -# works better. -repl-diskless-sync no - -# When diskless replication is enabled, it is possible to configure the delay -# the server waits in order to spawn the child that transfers the RDB via socket -# to the slaves. -# -# This is important since once the transfer starts, it is not possible to serve -# new slaves arriving, that will be queued for the next RDB transfer, so the server -# waits a delay in order to let more slaves arrive. -# -# The delay is specified in seconds, and by default is 5 seconds. To disable -# it entirely just set it to 0 seconds and the transfer will start ASAP. -repl-diskless-sync-delay 5 - -# Slaves send PINGs to server in a predefined interval. It's possible to change -# this interval with the repl_ping_slave_period option. The default value is 10 -# seconds. -# -# repl-ping-slave-period 10 - -# The following option sets the replication timeout for: -# -# 1) Bulk transfer I/O during SYNC, from the point of view of slave. -# 2) Master timeout from the point of view of slaves (data, pings). -# 3) Slave timeout from the point of view of masters (REPLCONF ACK pings). -# -# It is important to make sure that this value is greater than the value -# specified for repl-ping-slave-period otherwise a timeout will be detected -# every time there is low traffic between the master and the slave. -# -# repl-timeout 60 - -# Disable TCP_NODELAY on the slave socket after SYNC? -# -# If you select "yes" Redis will use a smaller number of TCP packets and -# less bandwidth to send data to slaves. But this can add a delay for -# the data to appear on the slave side, up to 40 milliseconds with -# Linux kernels using a default configuration. -# -# If you select "no" the delay for data to appear on the slave side will -# be reduced but more bandwidth will be used for replication. -# -# By default we optimize for low latency, but in very high traffic conditions -# or when the master and slaves are many hops away, turning this to "yes" may -# be a good idea. -repl-disable-tcp-nodelay no - -# Set the replication backlog size. The backlog is a buffer that accumulates -# slave data when slaves are disconnected for some time, so that when a slave -# wants to reconnect again, often a full resync is not needed, but a partial -# resync is enough, just passing the portion of data the slave missed while -# disconnected. -# -# The bigger the replication backlog, the longer the time the slave can be -# disconnected and later be able to perform a partial resynchronization. -# -# The backlog is only allocated once there is at least a slave connected. -# -# repl-backlog-size 1mb - -# After a master has no longer connected slaves for some time, the backlog -# will be freed. The following option configures the amount of seconds that -# need to elapse, starting from the time the last slave disconnected, for -# the backlog buffer to be freed. -# -# A value of 0 means to never release the backlog. -# -# repl-backlog-ttl 3600 - -# The slave priority is an integer number published by Redis in the INFO output. -# It is used by Redis Sentinel in order to select a slave to promote into a -# master if the master is no longer working correctly. -# -# A slave with a low priority number is considered better for promotion, so -# for instance if there are three slaves with priority 10, 100, 25 Sentinel will -# pick the one with priority 10, that is the lowest. -# -# However a special priority of 0 marks the slave as not able to perform the -# role of master, so a slave with priority of 0 will never be selected by -# Redis Sentinel for promotion. -# -# By default the priority is 100. -slave-priority 100 - -# It is possible for a master to stop accepting writes if there are less than -# N slaves connected, having a lag less or equal than M seconds. -# -# The N slaves need to be in "online" state. -# -# The lag in seconds, that must be <= the specified value, is calculated from -# the last ping received from the slave, that is usually sent every second. -# -# This option does not GUARANTEE that N replicas will accept the write, but -# will limit the window of exposure for lost writes in case not enough slaves -# are available, to the specified number of seconds. -# -# For example to require at least 3 slaves with a lag <= 10 seconds use: -# -# min-slaves-to-write 3 -# min-slaves-max-lag 10 -# -# Setting one or the other to 0 disables the feature. -# -# By default min-slaves-to-write is set to 0 (feature disabled) and -# min-slaves-max-lag is set to 10. - -# A Redis master is able to list the address and port of the attached -# slaves in different ways. For example the "INFO replication" section -# offers this information, which is used, among other tools, by -# Redis Sentinel in order to discover slave instances. -# Another place where this info is available is in the output of the -# "ROLE" command of a masteer. -# -# The listed IP and address normally reported by a slave is obtained -# in the following way: -# -# IP: The address is auto detected by checking the peer address -# of the socket used by the slave to connect with the master. -# -# Port: The port is communicated by the slave during the replication -# handshake, and is normally the port that the slave is using to -# list for connections. -# -# However when port forwarding or Network Address Translation (NAT) is -# used, the slave may be actually reachable via different IP and port -# pairs. The following two options can be used by a slave in order to -# report to its master a specific set of IP and port, so that both INFO -# and ROLE will report those values. -# -# There is no need to use both the options if you need to override just -# the port or the IP address. -# -# slave-announce-ip 5.5.5.5 -# slave-announce-port 1234 - -################################## SECURITY ################################### - -# Require clients to issue AUTH <PASSWORD> before processing any other -# commands. This might be useful in environments in which you do not trust -# others with access to the host running redis-server. -# -# This should stay commented out for backward compatibility and because most -# people do not need auth (e.g. they run their own servers). -# -# Warning: since Redis is pretty fast an outside user can try up to -# 150k passwords per second against a good box. This means that you should -# use a very strong password otherwise it will be very easy to break. -# -# requirepass foobared - -# Command renaming. -# -# It is possible to change the name of dangerous commands in a shared -# environment. For instance the CONFIG command may be renamed into something -# hard to guess so that it will still be available for internal-use tools -# but not available for general clients. -# -# Example: -# -# rename-command CONFIG b840fc02d524045429941cc15f59e41cb7be6c52 -# -# It is also possible to completely kill a command by renaming it into -# an empty string: -# -# rename-command CONFIG "" -# -# Please note that changing the name of commands that are logged into the -# AOF file or transmitted to slaves may cause problems. - -################################### LIMITS #################################### - -# Set the max number of connected clients at the same time. By default -# this limit is set to 10000 clients, however if the Redis server is not -# able to configure the process file limit to allow for the specified limit -# the max number of allowed clients is set to the current file limit -# minus 32 (as Redis reserves a few file descriptors for internal uses). -# -# Once the limit is reached Redis will close all the new connections sending -# an error 'max number of clients reached'. -# -# maxclients 10000 - -# Don't use more memory than the specified amount of bytes. -# When the memory limit is reached Redis will try to remove keys -# according to the eviction policy selected (see maxmemory-policy). -# -# If Redis can't remove keys according to the policy, or if the policy is -# set to 'noeviction', Redis will start to reply with errors to commands -# that would use more memory, like SET, LPUSH, and so on, and will continue -# to reply to read-only commands like GET. -# -# This option is usually useful when using Redis as an LRU cache, or to set -# a hard memory limit for an instance (using the 'noeviction' policy). -# -# WARNING: If you have slaves attached to an instance with maxmemory on, -# the size of the output buffers needed to feed the slaves are subtracted -# from the used memory count, so that network problems / resyncs will -# not trigger a loop where keys are evicted, and in turn the output -# buffer of slaves is full with DELs of keys evicted triggering the deletion -# of more keys, and so forth until the database is completely emptied. -# -# In short... if you have slaves attached it is suggested that you set a lower -# limit for maxmemory so that there is some free RAM on the system for slave -# output buffers (but this is not needed if the policy is 'noeviction'). -# -maxmemory 3334382387 - -# MAXMEMORY POLICY: how Redis will select what to remove when maxmemory -# is reached. You can select among five behaviors: -# -# volatile-lru -> remove the key with an expire set using an LRU algorithm -# allkeys-lru -> remove any key according to the LRU algorithm -# volatile-random -> remove a random key with an expire set -# allkeys-random -> remove a random key, any key -# volatile-ttl -> remove the key with the nearest expire time (minor TTL) -# noeviction -> don't expire at all, just return an error on write operations -# -# Note: with any of the above policies, Redis will return an error on write -# operations, when there are no suitable keys for eviction. -# -# At the date of writing these commands are: set setnx setex append -# incr decr rpush lpush rpushx lpushx linsert lset rpoplpush sadd -# sinter sinterstore sunion sunionstore sdiff sdiffstore zadd zincrby -# zunionstore zinterstore hset hsetnx hmset hincrby incrby decrby -# getset mset msetnx exec sort -# -# The default is: -# -maxmemory-policy allkeys-lru - -# LRU and minimal TTL algorithms are not precise algorithms but approximated -# algorithms (in order to save memory), so you can tune it for speed or -# accuracy. For default Redis will check five keys and pick the one that was -# used less recently, you can change the sample size using the following -# configuration directive. -# -# The default of 5 produces good enough results. 10 Approximates very closely -# true LRU but costs a bit more CPU. 3 is very fast but not very accurate. -# -# maxmemory-samples 5 - -############################## APPEND ONLY MODE ############################### - -# By default Redis asynchronously dumps the dataset on disk. This mode is -# good enough in many applications, but an issue with the Redis process or -# a power outage may result into a few minutes of writes lost (depending on -# the configured save points). -# -# The Append Only File is an alternative persistence mode that provides -# much better durability. For instance using the default data fsync policy -# (see later in the config file) Redis can lose just one second of writes in a -# dramatic event like a server power outage, or a single write if something -# wrong with the Redis process itself happens, but the operating system is -# still running correctly. -# -# AOF and RDB persistence can be enabled at the same time without problems. -# If the AOF is enabled on startup Redis will load the AOF, that is the file -# with the better durability guarantees. -# -# Please check http://redis.io/topics/persistence for more information. - -appendonly no - -# The name of the append only file (default: "appendonly.aof") - -appendfilename "appendonly.aof" - -# The fsync() call tells the Operating System to actually write data on disk -# instead of waiting for more data in the output buffer. Some OS will really flush -# data on disk, some other OS will just try to do it ASAP. -# -# Redis supports three different modes: -# -# no: don't fsync, just let the OS flush the data when it wants. Faster. -# always: fsync after every write to the append only log. Slow, Safest. -# everysec: fsync only one time every second. Compromise. -# -# The default is "everysec", as that's usually the right compromise between -# speed and data safety. It's up to you to understand if you can relax this to -# "no" that will let the operating system flush the output buffer when -# it wants, for better performances (but if you can live with the idea of -# some data loss consider the default persistence mode that's snapshotting), -# or on the contrary, use "always" that's very slow but a bit safer than -# everysec. -# -# More details please check the following article: -# http://antirez.com/post/redis-persistence-demystified.html -# -# If unsure, use "everysec". - -# appendfsync always -appendfsync everysec -# appendfsync no - -# When the AOF fsync policy is set to always or everysec, and a background -# saving process (a background save or AOF log background rewriting) is -# performing a lot of I/O against the disk, in some Linux configurations -# Redis may block too long on the fsync() call. Note that there is no fix for -# this currently, as even performing fsync in a different thread will block -# our synchronous write(2) call. -# -# In order to mitigate this problem it's possible to use the following option -# that will prevent fsync() from being called in the main process while a -# BGSAVE or BGREWRITEAOF is in progress. -# -# This means that while another child is saving, the durability of Redis is -# the same as "appendfsync none". In practical terms, this means that it is -# possible to lose up to 30 seconds of log in the worst scenario (with the -# default Linux settings). -# -# If you have latency problems turn this to "yes". Otherwise leave it as -# "no" that is the safest pick from the point of view of durability. - -no-appendfsync-on-rewrite no - -# Automatic rewrite of the append only file. -# Redis is able to automatically rewrite the log file implicitly calling -# BGREWRITEAOF when the AOF log size grows by the specified percentage. -# -# This is how it works: Redis remembers the size of the AOF file after the -# latest rewrite (if no rewrite has happened since the restart, the size of -# the AOF at startup is used). -# -# This base size is compared to the current size. If the current size is -# bigger than the specified percentage, the rewrite is triggered. Also -# you need to specify a minimal size for the AOF file to be rewritten, this -# is useful to avoid rewriting the AOF file even if the percentage increase -# is reached but it is still pretty small. -# -# Specify a percentage of zero in order to disable the automatic AOF -# rewrite feature. - -auto-aof-rewrite-percentage 100 -auto-aof-rewrite-min-size 64mb - -# An AOF file may be found to be truncated at the end during the Redis -# startup process, when the AOF data gets loaded back into memory. -# This may happen when the system where Redis is running -# crashes, especially when an ext4 filesystem is mounted without the -# data=ordered option (however this can't happen when Redis itself -# crashes or aborts but the operating system still works correctly). -# -# Redis can either exit with an error when this happens, or load as much -# data as possible (the default now) and start if the AOF file is found -# to be truncated at the end. The following option controls this behavior. -# -# If aof-load-truncated is set to yes, a truncated AOF file is loaded and -# the Redis server starts emitting a log to inform the user of the event. -# Otherwise if the option is set to no, the server aborts with an error -# and refuses to start. When the option is set to no, the user requires -# to fix the AOF file using the "redis-check-aof" utility before to restart -# the server. -# -# Note that if the AOF file will be found to be corrupted in the middle -# the server will still exit with an error. This option only applies when -# Redis will try to read more data from the AOF file but not enough bytes -# will be found. -aof-load-truncated yes - -################################ LUA SCRIPTING ############################### - -# Max execution time of a Lua script in milliseconds. -# -# If the maximum execution time is reached Redis will log that a script is -# still in execution after the maximum allowed time and will start to -# reply to queries with an error. -# -# When a long running script exceeds the maximum execution time only the -# SCRIPT KILL and SHUTDOWN NOSAVE commands are available. The first can be -# used to stop a script that did not yet called write commands. The second -# is the only way to shut down the server in the case a write command was -# already issued by the script but the user doesn't want to wait for the natural -# termination of the script. -# -# Set it to 0 or a negative value for unlimited execution without warnings. -lua-time-limit 5000 - -################################ REDIS CLUSTER ############################### -# -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# WARNING EXPERIMENTAL: Redis Cluster is considered to be stable code, however -# in order to mark it as "mature" we need to wait for a non trivial percentage -# of users to deploy it in production. -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# -# Normal Redis instances can't be part of a Redis Cluster; only nodes that are -# started as cluster nodes can. In order to start a Redis instance as a -# cluster node enable the cluster support uncommenting the following: -# -# cluster-enabled yes - -# Every cluster node has a cluster configuration file. This file is not -# intended to be edited by hand. It is created and updated by Redis nodes. -# Every Redis Cluster node requires a different cluster configuration file. -# Make sure that instances running in the same system do not have -# overlapping cluster configuration file names. -# -# cluster-config-file nodes-6379.conf - -# Cluster node timeout is the amount of milliseconds a node must be unreachable -# for it to be considered in failure state. -# Most other internal time limits are multiple of the node timeout. -# -# cluster-node-timeout 15000 - -# A slave of a failing master will avoid to start a failover if its data -# looks too old. -# -# There is no simple way for a slave to actually have a exact measure of -# its "data age", so the following two checks are performed: -# -# 1) If there are multiple slaves able to failover, they exchange messages -# in order to try to give an advantage to the slave with the best -# replication offset (more data from the master processed). -# Slaves will try to get their rank by offset, and apply to the start -# of the failover a delay proportional to their rank. -# -# 2) Every single slave computes the time of the last interaction with -# its master. This can be the last ping or command received (if the master -# is still in the "connected" state), or the time that elapsed since the -# disconnection with the master (if the replication link is currently down). -# If the last interaction is too old, the slave will not try to failover -# at all. -# -# The point "2" can be tuned by user. Specifically a slave will not perform -# the failover if, since the last interaction with the master, the time -# elapsed is greater than: -# -# (node-timeout * slave-validity-factor) + repl-ping-slave-period -# -# So for example if node-timeout is 30 seconds, and the slave-validity-factor -# is 10, and assuming a default repl-ping-slave-period of 10 seconds, the -# slave will not try to failover if it was not able to talk with the master -# for longer than 310 seconds. -# -# A large slave-validity-factor may allow slaves with too old data to failover -# a master, while a too small value may prevent the cluster from being able to -# elect a slave at all. -# -# For maximum availability, it is possible to set the slave-validity-factor -# to a value of 0, which means, that slaves will always try to failover the -# master regardless of the last time they interacted with the master. -# (However they'll always try to apply a delay proportional to their -# offset rank). -# -# Zero is the only value able to guarantee that when all the partitions heal -# the cluster will always be able to continue. -# -# cluster-slave-validity-factor 10 - -# Cluster slaves are able to migrate to orphaned masters, that are masters -# that are left without working slaves. This improves the cluster ability -# to resist to failures as otherwise an orphaned master can't be failed over -# in case of failure if it has no working slaves. -# -# Slaves migrate to orphaned masters only if there are still at least a -# given number of other working slaves for their old master. This number -# is the "migration barrier". A migration barrier of 1 means that a slave -# will migrate only if there is at least 1 other working slave for its master -# and so forth. It usually reflects the number of slaves you want for every -# master in your cluster. -# -# Default is 1 (slaves migrate only if their masters remain with at least -# one slave). To disable migration just set it to a very large value. -# A value of 0 can be set but is useful only for debugging and dangerous -# in production. -# -# cluster-migration-barrier 1 - -# By default Redis Cluster nodes stop accepting queries if they detect there -# is at least an hash slot uncovered (no available node is serving it). -# This way if the cluster is partially down (for example a range of hash slots -# are no longer covered) all the cluster becomes, eventually, unavailable. -# It automatically returns available as soon as all the slots are covered again. -# -# However sometimes you want the subset of the cluster which is working, -# to continue to accept queries for the part of the key space that is still -# covered. In order to do so, just set the cluster-require-full-coverage -# option to no. -# -# cluster-require-full-coverage yes - -# In order to setup your cluster make sure to read the documentation -# available at http://redis.io web site. - -################################## SLOW LOG ################################### - -# The Redis Slow Log is a system to log queries that exceeded a specified -# execution time. The execution time does not include the I/O operations -# like talking with the client, sending the reply and so forth, -# but just the time needed to actually execute the command (this is the only -# stage of command execution where the thread is blocked and can not serve -# other requests in the meantime). -# -# You can configure the slow log with two parameters: one tells Redis -# what is the execution time, in microseconds, to exceed in order for the -# command to get logged, and the other parameter is the length of the -# slow log. When a new command is logged the oldest one is removed from the -# queue of logged commands. - -# The following time is expressed in microseconds, so 1000000 is equivalent -# to one second. Note that a negative number disables the slow log, while -# a value of zero forces the logging of every command. -slowlog-log-slower-than 10000 - -# There is no limit to this length. Just be aware that it will consume memory. -# You can reclaim memory used by the slow log with SLOWLOG RESET. -slowlog-max-len 128 - -################################ LATENCY MONITOR ############################## - -# The Redis latency monitoring subsystem samples different operations -# at runtime in order to collect data related to possible sources of -# latency of a Redis instance. -# -# Via the LATENCY command this information is available to the user that can -# print graphs and obtain reports. -# -# The system only logs operations that were performed in a time equal or -# greater than the amount of milliseconds specified via the -# latency-monitor-threshold configuration directive. When its value is set -# to zero, the latency monitor is turned off. -# -# By default latency monitoring is disabled since it is mostly not needed -# if you don't have latency issues, and collecting data has a performance -# impact, that while very small, can be measured under big load. Latency -# monitoring can easily be enabled at runtime using the command -# "CONFIG SET latency-monitor-threshold <milliseconds>" if needed. -latency-monitor-threshold 0 - -############################# EVENT NOTIFICATION ############################## - -# Redis can notify Pub/Sub clients about events happening in the key space. -# This feature is documented at http://redis.io/topics/notifications -# -# For instance if keyspace events notification is enabled, and a client -# performs a DEL operation on key "foo" stored in the Database 0, two -# messages will be published via Pub/Sub: -# -# PUBLISH __keyspace@0__:foo del -# PUBLISH __keyevent@0__:del foo -# -# It is possible to select the events that Redis will notify among a set -# of classes. Every class is identified by a single character: -# -# K Keyspace events, published with __keyspace@<db>__ prefix. -# E Keyevent events, published with __keyevent@<db>__ prefix. -# g Generic commands (non-type specific) like DEL, EXPIRE, RENAME, ... -# $ String commands -# l List commands -# s Set commands -# h Hash commands -# z Sorted set commands -# x Expired events (events generated every time a key expires) -# e Evicted events (events generated when a key is evicted for maxmemory) -# A Alias for g$lshzxe, so that the "AKE" string means all the events. -# -# The "notify-keyspace-events" takes as argument a string that is composed -# of zero or multiple characters. The empty string means that notifications -# are disabled. -# -# Example: to enable list and generic events, from the point of view of the -# event name, use: -# -# notify-keyspace-events Elg -# -# Example 2: to get the stream of the expired keys subscribing to channel -# name __keyevent@0__:expired use: -# -# notify-keyspace-events Ex -# -# By default all notifications are disabled because most users don't need -# this feature and the feature has some overhead. Note that if you don't -# specify at least one of K or E, no events will be delivered. -notify-keyspace-events "" - -############################### ADVANCED CONFIG ############################### - -# Hashes are encoded using a memory efficient data structure when they have a -# small number of entries, and the biggest entry does not exceed a given -# threshold. These thresholds can be configured using the following directives. -hash-max-ziplist-entries 512 -hash-max-ziplist-value 64 - -# Lists are also encoded in a special way to save a lot of space. -# The number of entries allowed per internal list node can be specified -# as a fixed maximum size or a maximum number of elements. -# For a fixed maximum size, use -5 through -1, meaning: -# -5: max size: 64 Kb <-- not recommended for normal workloads -# -4: max size: 32 Kb <-- not recommended -# -3: max size: 16 Kb <-- probably not recommended -# -2: max size: 8 Kb <-- good -# -1: max size: 4 Kb <-- good -# Positive numbers mean store up to _exactly_ that number of elements -# per list node. -# The highest performing option is usually -2 (8 Kb size) or -1 (4 Kb size), -# but if your use case is unique, adjust the settings as necessary. -list-max-ziplist-size -2 - -# Lists may also be compressed. -# Compress depth is the number of quicklist ziplist nodes from *each* side of -# the list to *exclude* from compression. The head and tail of the list -# are always uncompressed for fast push/pop operations. Settings are: -# 0: disable all list compression -# 1: depth 1 means "don't start compressing until after 1 node into the list, -# going from either the head or tail" -# So: [head]->node->node->...->node->[tail] -# [head], [tail] will always be uncompressed; inner nodes will compress. -# 2: [head]->[next]->node->node->...->node->[prev]->[tail] -# 2 here means: don't compress head or head->next or tail->prev or tail, -# but compress all nodes between them. -# 3: [head]->[next]->[next]->node->node->...->node->[prev]->[prev]->[tail] -# etc. -list-compress-depth 0 - -# Sets have a special encoding in just one case: when a set is composed -# of just strings that happen to be integers in radix 10 in the range -# of 64 bit signed integers. -# The following configuration setting sets the limit in the size of the -# set in order to use this special memory saving encoding. -set-max-intset-entries 512 - -# Similarly to hashes and lists, sorted sets are also specially encoded in -# order to save a lot of space. This encoding is only used when the length and -# elements of a sorted set are below the following limits: -zset-max-ziplist-entries 128 -zset-max-ziplist-value 64 - -# HyperLogLog sparse representation bytes limit. The limit includes the -# 16 bytes header. When an HyperLogLog using the sparse representation crosses -# this limit, it is converted into the dense representation. -# -# A value greater than 16000 is totally useless, since at that point the -# dense representation is more memory efficient. -# -# The suggested value is ~ 3000 in order to have the benefits of -# the space efficient encoding without slowing down too much PFADD, -# which is O(N) with the sparse encoding. The value can be raised to -# ~ 10000 when CPU is not a concern, but space is, and the data set is -# composed of many HyperLogLogs with cardinality in the 0 - 15000 range. -hll-sparse-max-bytes 3000 - -# Active rehashing uses 1 millisecond every 100 milliseconds of CPU time in -# order to help rehashing the main Redis hash table (the one mapping top-level -# keys to values). The hash table implementation Redis uses (see dict.c) -# performs a lazy rehashing: the more operation you run into a hash table -# that is rehashing, the more rehashing "steps" are performed, so if the -# server is idle the rehashing is never complete and some more memory is used -# by the hash table. -# -# The default is to use this millisecond 10 times every second in order to -# actively rehash the main dictionaries, freeing memory when possible. -# -# If unsure: -# use "activerehashing no" if you have hard latency requirements and it is -# not a good thing in your environment that Redis can reply from time to time -# to queries with 2 milliseconds delay. -# -# use "activerehashing yes" if you don't have such hard requirements but -# want to free memory asap when possible. -activerehashing yes - -# The client output buffer limits can be used to force disconnection of clients -# that are not reading data from the server fast enough for some reason (a -# common reason is that a Pub/Sub client can't consume messages as fast as the -# publisher can produce them). -# -# The limit can be set differently for the three different classes of clients: -# -# normal -> normal clients including MONITOR clients -# slave -> slave clients -# pubsub -> clients subscribed to at least one pubsub channel or pattern -# -# The syntax of every client-output-buffer-limit directive is the following: -# -# client-output-buffer-limit <class> <hard limit> <soft limit> <soft seconds> -# -# A client is immediately disconnected once the hard limit is reached, or if -# the soft limit is reached and remains reached for the specified number of -# seconds (continuously). -# So for instance if the hard limit is 32 megabytes and the soft limit is -# 16 megabytes / 10 seconds, the client will get disconnected immediately -# if the size of the output buffers reach 32 megabytes, but will also get -# disconnected if the client reaches 16 megabytes and continuously overcomes -# the limit for 10 seconds. -# -# By default normal clients are not limited because they don't receive data -# without asking (in a push way), but just after a request, so only -# asynchronous clients may create a scenario where data is requested faster -# than it can read. -# -# Instead there is a default limit for pubsub and slave clients, since -# subscribers and slaves receive data in a push fashion. -# -# Both the hard or the soft limit can be disabled by setting them to zero. -client-output-buffer-limit normal 0 0 0 -client-output-buffer-limit slave 256mb 64mb 60 -client-output-buffer-limit pubsub 32mb 8mb 60 - -# Redis calls an internal function to perform many background tasks, like -# closing connections of clients in timeout, purging expired keys that are -# never requested, and so forth. -# -# Not all tasks are performed with the same frequency, but Redis checks for -# tasks to perform according to the specified "hz" value. -# -# By default "hz" is set to 10. Raising the value will use more CPU when -# Redis is idle, but at the same time will make Redis more responsive when -# there are many keys expiring at the same time, and timeouts may be -# handled with more precision. -# -# The range is between 1 and 500, however a value over 100 is usually not -# a good idea. Most users should use the default of 10 and raise this up to -# 100 only in environments where very low latency is required. -hz 10 - -# When a child rewrites the AOF file, if the following option is enabled -# the file will be fsync-ed every 32 MB of data generated. This is useful -# in order to commit the file to the disk more incrementally and avoid -# big latency spikes. -aof-rewrite-incremental-fsync yes diff --git a/ee4-config/wp/config/nginx/common/php.conf b/ee4-config/wp/config/nginx/common/php.conf deleted file mode 100644 index 9b38372bb..000000000 --- a/ee4-config/wp/config/nginx/common/php.conf +++ /dev/null @@ -1,11 +0,0 @@ -# PHP NGINX CONFIGURATION -# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee) -location / { - try_files $uri $uri/ /index.php?$args; -} -location ~ \.php$ { - try_files $uri =404; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - include fastcgi_params; - fastcgi_pass php:9000; -} diff --git a/ee4-config/wp/config/nginx/default.conf b/ee4-config/wp/config/nginx/default.conf deleted file mode 100644 index ca30b4195..000000000 --- a/ee4-config/wp/config/nginx/default.conf +++ /dev/null @@ -1,16 +0,0 @@ -server { - access_log /var/log/nginx/access.log; - error_log /var/log/nginx/error.log; - - root /var/www/html; - - server_name {V_HOST}; - - index index.php index.html index.htm; - - include common/php.conf; - include common/wpcommon.conf; - include common/locations.conf; - - client_max_body_size 100m; -} diff --git a/ee4-config/wpredis-subdir/config/nginx/common/redis.conf b/ee4-config/wpredis-subdir/config/nginx/common/redis.conf deleted file mode 100644 index 985e80e8d..000000000 --- a/ee4-config/wpredis-subdir/config/nginx/common/redis.conf +++ /dev/null @@ -1,57 +0,0 @@ -# Redis NGINX CONFIGURATION -# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee) -set $skip_cache 0; -# POST requests and URL with a query string should always go to php -if ($request_method = POST) { - set $skip_cache 1; -} -if ($query_string != "") { - set $skip_cache 1; -} -# Don't cache URL containing the following segments -if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|wp-.*.php|index.php|/feed/|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") { - set $skip_cache 1; -} -# Don't use the cache for logged in users or recent commenter or customer with items in cart -if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|woocommerce_items_in_cart") { - set $skip_cache 1; -} -# Use cached or actual file if they exists, Otherwise pass request to WordPress -location / { - try_files $uri $uri/ /index.php?$args; -} - -location /redis-fetch { - internal ; - set $redis_key $args; - redis_pass redis:6379; -} -location /redis-store { - internal ; - set_unescape_uri $key $arg_key ; - redis2_query set $key $echo_request_body; - redis2_query expire $key 14400; - redis2_pass redis:6379; -} - -location ~ \.php$ { -# add_header Cache-Control "max-age=0, no-cache, no-store, must-revalidate"; - set $key "nginx-cache:$scheme$request_method$host$request_uri"; - try_files $uri =404; - - srcache_fetch_skip $skip_cache; - srcache_store_skip $skip_cache; - - srcache_response_cache_control off; - - set_escape_uri $escaped_key $key; - - srcache_fetch GET /redis-fetch $key; - srcache_store PUT /redis-store key=$escaped_key; - - more_set_headers 'X-SRCache-Fetch-Status $srcache_fetch_status'; - more_set_headers 'X-SRCache-Store-Status $srcache_store_status'; - - include fastcgi_params; - fastcgi_pass php:9000; -} diff --git a/ee4-config/wpredis-subdir/config/nginx/common/wpsubdir.conf b/ee4-config/wpredis-subdir/config/nginx/common/wpsubdir.conf deleted file mode 100644 index 58229c323..000000000 --- a/ee4-config/wpredis-subdir/config/nginx/common/wpsubdir.conf +++ /dev/null @@ -1,10 +0,0 @@ -# WPSUBDIRECTORY NGINX CONFIGURATION -# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee) -if (!-e $request_filename) { -# Redirect wp-admin to wp-admin/ -rewrite /wp-admin$ $scheme://$host$uri/ permanent; -# Redirect wp-* files/folders -rewrite ^(/[^/]+)?(/wp-.*) $2 last; -# Redirect other php files -rewrite ^(/[^/]+)?(/.*\.php) $2 last; -} \ No newline at end of file diff --git a/ee4-config/wpredis-subdir/config/nginx/default.conf b/ee4-config/wpredis-subdir/config/nginx/default.conf deleted file mode 100644 index 3b71e2ec6..000000000 --- a/ee4-config/wpredis-subdir/config/nginx/default.conf +++ /dev/null @@ -1,18 +0,0 @@ -server { - access_log /var/log/nginx/access.log; - error_log /var/log/nginx/error.log; - - root /var/www/html; - - server_name {V_HOST}; - - index index.php index.html index.htm; - - - include common/redis.conf; - include common/wpsubdir.conf; - include common/wpcommon.conf; - include common/locations.conf; - - client_max_body_size 100m; -} diff --git a/ee4-config/wpredis/config/nginx/common/redis.conf b/ee4-config/wpredis/config/nginx/common/redis.conf deleted file mode 100644 index 985e80e8d..000000000 --- a/ee4-config/wpredis/config/nginx/common/redis.conf +++ /dev/null @@ -1,57 +0,0 @@ -# Redis NGINX CONFIGURATION -# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee) -set $skip_cache 0; -# POST requests and URL with a query string should always go to php -if ($request_method = POST) { - set $skip_cache 1; -} -if ($query_string != "") { - set $skip_cache 1; -} -# Don't cache URL containing the following segments -if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|wp-.*.php|index.php|/feed/|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") { - set $skip_cache 1; -} -# Don't use the cache for logged in users or recent commenter or customer with items in cart -if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|woocommerce_items_in_cart") { - set $skip_cache 1; -} -# Use cached or actual file if they exists, Otherwise pass request to WordPress -location / { - try_files $uri $uri/ /index.php?$args; -} - -location /redis-fetch { - internal ; - set $redis_key $args; - redis_pass redis:6379; -} -location /redis-store { - internal ; - set_unescape_uri $key $arg_key ; - redis2_query set $key $echo_request_body; - redis2_query expire $key 14400; - redis2_pass redis:6379; -} - -location ~ \.php$ { -# add_header Cache-Control "max-age=0, no-cache, no-store, must-revalidate"; - set $key "nginx-cache:$scheme$request_method$host$request_uri"; - try_files $uri =404; - - srcache_fetch_skip $skip_cache; - srcache_store_skip $skip_cache; - - srcache_response_cache_control off; - - set_escape_uri $escaped_key $key; - - srcache_fetch GET /redis-fetch $key; - srcache_store PUT /redis-store key=$escaped_key; - - more_set_headers 'X-SRCache-Fetch-Status $srcache_fetch_status'; - more_set_headers 'X-SRCache-Store-Status $srcache_store_status'; - - include fastcgi_params; - fastcgi_pass php:9000; -} diff --git a/ee4-config/wpredis/config/nginx/default.conf b/ee4-config/wpredis/config/nginx/default.conf deleted file mode 100644 index 9ca0eedb9..000000000 --- a/ee4-config/wpredis/config/nginx/default.conf +++ /dev/null @@ -1,18 +0,0 @@ -server { - access_log /var/log/nginx/access.log; - error_log /var/log/nginx/error.log; - - root /var/www/html; - - server_name {V_HOST}; - - index index.php index.html index.htm; - - - include common/redis.conf; - - include common/wpcommon.conf; - include common/locations.conf; - - client_max_body_size 100m; -} diff --git a/ee4-config/wpsubdir/config/nginx/common/php.conf b/ee4-config/wpsubdir/config/nginx/common/php.conf deleted file mode 100644 index 9b38372bb..000000000 --- a/ee4-config/wpsubdir/config/nginx/common/php.conf +++ /dev/null @@ -1,11 +0,0 @@ -# PHP NGINX CONFIGURATION -# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee) -location / { - try_files $uri $uri/ /index.php?$args; -} -location ~ \.php$ { - try_files $uri =404; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - include fastcgi_params; - fastcgi_pass php:9000; -} diff --git a/ee4-config/wpsubdir/config/nginx/common/wpsubdir.conf b/ee4-config/wpsubdir/config/nginx/common/wpsubdir.conf deleted file mode 100644 index 58229c323..000000000 --- a/ee4-config/wpsubdir/config/nginx/common/wpsubdir.conf +++ /dev/null @@ -1,10 +0,0 @@ -# WPSUBDIRECTORY NGINX CONFIGURATION -# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee) -if (!-e $request_filename) { -# Redirect wp-admin to wp-admin/ -rewrite /wp-admin$ $scheme://$host$uri/ permanent; -# Redirect wp-* files/folders -rewrite ^(/[^/]+)?(/wp-.*) $2 last; -# Redirect other php files -rewrite ^(/[^/]+)?(/.*\.php) $2 last; -} \ No newline at end of file diff --git a/ee4-config/wpsubdir/config/nginx/default.conf b/ee4-config/wpsubdir/config/nginx/default.conf deleted file mode 100644 index 2ef7fe7b7..000000000 --- a/ee4-config/wpsubdir/config/nginx/default.conf +++ /dev/null @@ -1,17 +0,0 @@ -server { - access_log /var/log/nginx/access.log; - error_log /var/log/nginx/error.log; - - root /var/www/html; - - server_name {V_HOST}; - - index index.php index.html index.htm; - - include common/wpsubdir.conf; - include common/php.conf; - include common/wpcommon.conf; - include common/locations.conf; - - client_max_body_size 100m; -} diff --git a/php/init-ee.php b/php/init-ee.php index 6a20e06b2..5ef2730f8 100644 --- a/php/init-ee.php +++ b/php/init-ee.php @@ -6,7 +6,6 @@ define( 'EE_START_MICROTIME', microtime( true ) ); define( 'HOME', $_SERVER['HOME'] ); define( 'EE_CONF_ROOT', HOME . '/.ee4' ); -define( 'EE_SITE_CONF_ROOT', EE_ROOT . '/ee4-config' ); if ( file_exists( EE_ROOT . '/vendor/autoload.php' ) ) { define( 'EE_VENDOR_DIR', EE_ROOT . '/vendor' ); From b9ecf375a8d47f02ba1ac4015bd0f1cc1909e5d2 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Wed, 6 Jun 2018 23:54:09 +0530 Subject: [PATCH 0127/1044] Move template to site-command --- templates/docker-compose.mustache | 49 ------------------------------- 1 file changed, 49 deletions(-) delete mode 100644 templates/docker-compose.mustache diff --git a/templates/docker-compose.mustache b/templates/docker-compose.mustache deleted file mode 100644 index 1e08b8c96..000000000 --- a/templates/docker-compose.mustache +++ /dev/null @@ -1,49 +0,0 @@ -version: '3' - -services: - -{{#services}} - {{#service_name}} - {{name}}: - {{/service_name}} - {{#image}} - image: {{name}} - {{/image}} - {{#depends_on}} - depends_on: - - {{name}} - {{/depends_on}} - {{#restart}} - restart: {{name}} - {{/restart}} - {{#command}} - command: {{name}} - {{/command}} - {{#labels}} - labels: {{name}} - {{/labels}} - {{#volumes}} - volumes: - {{#vol}} - - "{{name}}" - {{/vol}} - {{/volumes}} - {{#environment}} - environment: - {{#env}} - - {{name}} - {{/env}} - {{/environment}} - {{#networks}} - networks: - - {{name}} - {{/networks}} - -{{/services}} - -{{#network}} -networks: - site-network: - external: - name: ${VIRTUAL_HOST} -{{/network}} \ No newline at end of file From 3aeac5011f2cf9866a0c36325493403913efb4ee Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Wed, 6 Jun 2018 23:54:45 +0530 Subject: [PATCH 0128/1044] Add command for traefik Move docker-compose generation to site-command --- php/class-ee-docker.php | 110 ++-------------------------------------- 1 file changed, 5 insertions(+), 105 deletions(-) diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php index 70af73412..b8fef0778 100644 --- a/php/class-ee-docker.php +++ b/php/class-ee-docker.php @@ -6,106 +6,6 @@ class EE_DOCKER { - /** - * Generate docker-compose.yml according to requirement. - * - * @param array $filters Array of flags to determine the docker-compose.yml generation. - * Empty/Default -> Generates default WordPress docker-compose.yml - * ['wpsubdom'] -> Generates Subdomain WordPress docker-compose.yml - * - * @return String docker-compose.yml content string. - */ - public static function generate_docker_composer_yml( array $filters = [] ) { - $base = array(); - - $restart_default = array( 'name' => 'always' ); - $network_default = array( 'name' => 'site-network' ); - - // db configuration. - $db['service_name'] = array( 'name' => 'db' ); - $db['image'] = array( 'name' => 'easyengine/mariadb' ); - $db['restart'] = $restart_default; - $db['volumes'] = array( array( 'vol' => array( 'name' => './app/db:/var/lib/mysql' ) ) ); - $db['environment'] = array( - 'env' => array( - array( 'name' => 'MYSQL_ROOT_PASSWORD' ), - array( 'name' => 'MYSQL_DATABASE' ), - array( 'name' => 'MYSQL_USER' ), - array( 'name' => 'MYSQL_PASSWORD' ), - ), - ); - $db['networks'] = $network_default; - - // PHP configuration. - $php['service_name'] = array( 'name' => 'php' ); - $php['image'] = array( 'name' => 'easyengine/php' ); - $php['depends_on'] = array( 'name' => 'db' ); - $php['restart'] = $restart_default; - $php['volumes'] = array( array( 'vol' => array( array( 'name' => './app/src:/var/www/html' ), array( 'name' => './config/php-fpm/php.ini:/usr/local/etc/php/php.ini' ) ) ) ); - $php['environment'] = array( - 'env' => array( - array( 'name' => 'WORDPRESS_DB_HOST' ), - array( 'name' => 'WORDPRESS_DB_USER=${MYSQL_USER}' ), - array( 'name' => 'WORDPRESS_DB_PASSWORD=${MYSQL_PASSWORD}' ), - array( 'name' => 'USER_ID=${USER_ID}' ), - array( 'name' => 'GROUP_ID=${GROUP_ID}' ), - ), - ); - $php['networks'] = $network_default; - - - // nginx configuration.. - $nginx['service_name'] = array( 'name' => 'nginx' ); - $nginx['image'] = array( 'name' => 'easyengine/nginx' ); - $nginx['depends_on'] = array( 'name' => 'php' ); - $nginx['restart'] = $restart_default; - - $v_host = in_array( 'wpsubdom', $filters ) ? 'VIRTUAL_HOST=${VIRTUAL_HOST},*.${VIRTUAL_HOST}' : 'VIRTUAL_HOST'; - - $nginx['environment'] = array( 'env' => array( array( 'name' => $v_host ) ) ); - $nginx['volumes'] = array( array( 'vol' => array( array( 'name' => './app/src:/var/www/html' ), array( 'name' => './config/nginx/default.conf:/etc/nginx/conf.d/default.conf' ), array( 'name' => './logs/nginx:/var/log/nginx' ), array( 'name' => './config/nginx/common:/usr/local/openresty/nginx/conf/common' ) ) ) ); - $nginx['networks'] = $network_default; - - // PhpMyAdmin configuration. - $phpmyadmin['service_name'] = array( 'name' => 'phpmyadmin' ); - $phpmyadmin['image'] = array( 'name' => 'easyengine/phpmyadmin' ); - $phpmyadmin['restart'] = $restart_default; - $phpmyadmin['environment'] = array( 'env' => array( array( 'name' => 'VIRTUAL_HOST=pma.${VIRTUAL_HOST}' ) ) ); - $phpmyadmin['networks'] = $network_default; - - // mailhog configuration. - $mail['service_name'] = array( 'name' => 'mail' ); - $mail['image'] = array( 'name' => 'easyengine/mail' ); - $mail['restart'] = $restart_default; - $mail['command'] = array( 'name' => '["-invite-jim=false"]' ); - $mail['environment'] = array( 'env' => array( array( 'name' => 'VIRTUAL_HOST=mail.${VIRTUAL_HOST}' ), array( 'name' => 'VIRTUAL_PORT=8025' ) ) ); - $mail['networks'] = $network_default; - - // redis configuration. - $redis['service_name'] = array( 'name' => 'redis' ); - $redis['image'] = array( 'name' => 'easyengine/redis' ); - $redis['networks'] = $network_default; - - $base[] = $db; - $base[] = $php; - $base[] = $nginx; - $base[] = $mail; - $base[] = $phpmyadmin; - - if ( in_array( 'wpredis', $filters ) ) { - $base[] = $redis; - } - - $binding = array( - 'services' => $base, - 'network' => true, - ); - - $docker_compose_yml = ( mustache_render( 'docker-compose.mustache', $binding ) ); - - return $docker_compose_yml; - } - /** * Check and Start or create container if not running. * @@ -168,13 +68,13 @@ public static function start_container( $container ) { */ public static function create_container( $container, $command = '' ) { - $HOME = HOME; - - $nginx_proxy_name = 'ee4_nginx-proxy'; + $HOME = HOME; + $proxy_name = 'ee4_traefik'; switch ( $container ) { - case 'ee4_nginx-proxy': - $command = "docker run --name $nginx_proxy_name -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v $HOME/.ee4/nginx/certs:/etc/nginx/certs -v $HOME/.ee4/nginx/dhparam:/etc/nginx/dhparam -v $HOME/.ee4/nginx/conf.d:/etc/nginx/conf.d -v $HOME/.ee4/nginx/htpasswd:/etc/nginx/htpasswd -v $HOME/.ee4/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v $HOME/.ee4:/app/ee4 -v /usr/share/nginx/html easyengine/nginx-proxy"; + + case 'ee4_traefik': + $command = "docker run -d -p 8080:8080 -p 80:80 -p 443:443 -v /var/run/docker.sock:/var/run/docker.sock -v $HOME/.ee4/traefik/traefik.toml:/etc/traefik/traefik.toml -v $HOME/.ee4/traefik/acme.json:/etc/traefik/acme.json --name $proxy_name traefik --logLevel=DEBUG"; break; } From f6fe610d29137396a212cbf7bac201a664c5b04a Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Wed, 6 Jun 2018 23:55:56 +0530 Subject: [PATCH 0129/1044] Add config changes for traefik --- php/EE/Runner.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 74e7c6961..896b212d9 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -55,6 +55,24 @@ private function init_ee4() { mkdir( EE_CONF_ROOT ); } + if ( ! is_dir( EE_CONF_ROOT . '/traefik' ) ) { + mkdir( EE_CONF_ROOT . '/traefik' ); + touch( EE_CONF_ROOT . '/traefik/acme.json' ); + chmod( EE_CONF_ROOT . '/traefik/acme.json', 600 ); + file_put_contents( + EE_CONF_ROOT . '/traefik/traefik.toml', '################################################################ +# API and dashboard configuration +################################################################ +[api] +################################################################ +# Docker configuration backend +################################################################ +[docker] +domain = "docker.local" +watch = true' + ); + } + if ( ! is_dir( $this->config['sites_path'] ) ) { mkdir( $this->config['sites_path'] ); } From 12efc0be0c2a7ecf468f13c3cf18187f115549d2 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Thu, 7 Jun 2018 00:22:47 +0530 Subject: [PATCH 0130/1044] Make class-ee-docker.php generic --- php/class-ee-docker.php | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php index b8fef0778..5b50c82e9 100644 --- a/php/class-ee-docker.php +++ b/php/class-ee-docker.php @@ -9,11 +9,12 @@ class EE_DOCKER { /** * Check and Start or create container if not running. * - * @param String $container Name of the + * @param String $container Name of the container. + * @param String $command Command to launch that container if needed. * * @return bool success. */ - public static function boot_container( $container ) { + public static function boot_container( $container, $command = '' ) { $status = self::container_status( $container ); if ( $status ) { if ( 'exited' === $status ) { @@ -22,7 +23,7 @@ public static function boot_container( $container ) { return true; } } else { - return self::create_container( $container ); + return self::create_container( $container, $command ); } } @@ -66,18 +67,7 @@ public static function start_container( $container ) { * * @return bool success. */ - public static function create_container( $container, $command = '' ) { - - $HOME = HOME; - $proxy_name = 'ee4_traefik'; - - switch ( $container ) { - - case 'ee4_traefik': - $command = "docker run -d -p 8080:8080 -p 80:80 -p 443:443 -v /var/run/docker.sock:/var/run/docker.sock -v $HOME/.ee4/traefik/traefik.toml:/etc/traefik/traefik.toml -v $HOME/.ee4/traefik/acme.json:/etc/traefik/acme.json --name $proxy_name traefik --logLevel=DEBUG"; - break; - - } + public static function create_container( $container, $command ) { $launch = EE::launch( $command, false, true ); default_debug( $launch ); From 5d51ad2610fefcbf84550a6c8eb72ff111c6779e Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Thu, 7 Jun 2018 16:14:56 +0530 Subject: [PATCH 0131/1044] WIP: Update command --- php/EE/Runner.php | 22 +++-- php/commands/src/CLI_Command.php | 159 +++++++++++++++++++++++++++---- 2 files changed, 156 insertions(+), 25 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 74e7c6961..3107a3649 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -480,10 +480,18 @@ public function init_logger() { EE::set_logger( $logger ); + if ( 'cli' === $this->arguments[0] && ! empty( $this->arguments[1] ) && 'info' === $this->arguments[1] && ! $this->config['ssh'] ) { + touch ('/tmp/temp_ee4.log'); + $file_logging_path = '/tmp/temp_ee4.log'; + } + else { + $file_logging_path = EE_CONF_ROOT . '/ee4.log'; + } + $dateFormat = 'd-m-Y H:i:s'; $output = "[%datetime%] %channel%.%level_name%: %message% %context% %extra%\n"; $formatter = new \Monolog\Formatter\LineFormatter( $output, $dateFormat, false, true ); - $stream = new \Monolog\Handler\StreamHandler( EE_CONF_ROOT . '/ee4.log', Logger::DEBUG ); + $stream = new \Monolog\Handler\StreamHandler( $file_logging_path , Logger::DEBUG ); $stream->setFormatter( $formatter ); $file_logger = new \Monolog\Logger( 'ee4' ); $file_logger->pushHandler( $stream ); @@ -662,6 +670,12 @@ private function set_alias( $alias ) { public function start() { + // // Protect 'cli info' from most of the runtime, + // // except when the command will be run over SSH + if ( 'cli' === $this->arguments[0] && ! empty( $this->arguments[1] ) && 'info' === $this->arguments[1] && ! $this->config['ssh'] ) { + $this->_run_command_and_exit(); + } + $this->ensure_present_in_config( 'sites_path', Utils\get_home_dir(). '/ee4-sites' ); $this->ensure_present_in_config( 'db_path', Utils\get_home_dir(). '/.ee4/ee4.db' ); $this->ensure_present_in_config( 'ee_installer_version', 'stable' ); @@ -716,12 +730,6 @@ public function start() { $this->arguments[] = 'help'; } - // Protect 'cli info' from most of the runtime, - // except when the command will be run over SSH - if ( 'cli' === $this->arguments[0] && ! empty( $this->arguments[1] ) && 'info' === $this->arguments[1] && ! $this->config['ssh'] ) { - $this->_run_command_and_exit(); - } - if ( $this->config['ssh'] ) { $this->run_ssh_command( $this->config['ssh'] ); return; diff --git a/php/commands/src/CLI_Command.php b/php/commands/src/CLI_Command.php index f0459feac..8d47a78f1 100644 --- a/php/commands/src/CLI_Command.php +++ b/php/commands/src/CLI_Command.php @@ -179,35 +179,158 @@ public function info( $_, $assoc_args ) { * ## EXAMPLES * * # Update CLI. - * $ ee cli update * You have version 0.24.0. Would you like to update to 0.24.1? [y/n] y - * Downloading from https://github.com/ee/ee/releases/download/v0.24.1/ee-0.24.1.phar... + * Downloading from https://github.com/ee/ee/releases + * $ ee cli update/download/v0.24.1/ee-0.24.1.phar... * New version works. Proceeding to replace. * Success: Updated EE to 0.24.1. */ public function update( $_, $assoc_args ) { - $config_file_path = getenv( 'EE_CONFIG_PATH' ) ? getenv( 'EE_CONFIG_PATH' ) : Utils\get_home_dir() . '/.ee4/config.yml'; - - $existing_config = Spyc::YAMLLoad( $config_file_path ); - + if ( ! Utils\inside_phar() ) { + EE::error( 'You can only self-update Phar files.' ); + } + $old_phar = realpath( $_SERVER['argv'][0] ); + if ( ! is_writable( $old_phar ) ) { + EE::error( sprintf( '%s is not writable by current user.', $old_phar ) ); + } elseif ( ! is_writable( dirname( $old_phar ) ) ) { + EE::error( sprintf( '%s is not writable by current user.', dirname( $old_phar ) ) ); + } if ( Utils\get_flag_value( $assoc_args, 'nightly' ) ) { - $existing_config['ee_installer_version'] = 'nightly'; + EE::confirm( sprintf( 'You have version %s. Would you like to update to the latest nightly?', EE_VERSION ), $assoc_args ); + $download_url = 'https://raw.githubusercontent.com/EasyEngine/easyengine-builds/master/phar/easyengine-nightly.phar'; + $md5_url = 'https://raw.githubusercontent.com/EasyEngine/easyengine-builds/master/phar/easyengine-nightly.phar.md5'; + } elseif ( Utils\get_flag_value( $assoc_args, 'stable' ) ) { + EE::confirm( sprintf( 'You have version %s. Would you like to update to the latest stable release?', EE_VERSION ), $assoc_args ); + $download_url = 'https://raw.githubusercontent.com/kirtangajjar/easyengine-builds/master/phar/easyengine.phar'; + $md5_url = 'https://raw.githubusercontent.com/kirtangajjar/easyengine-builds/master/phar/easyengine.phar.md5'; } else { - $existing_config['ee_installer_version'] = 'stable'; + $updates = $this->get_updates( $assoc_args ); + if ( empty( $updates ) ) { + $update_type = $this->get_update_type_str( $assoc_args ); + EE::success( "EasyEngine is at the latest{$update_type}version." ); + return; + } + $newest = $updates[0]; + EE::confirm( sprintf( 'You have version %s. Would you like to update to %s?', EE_VERSION, $newest['version'] ), $assoc_args ); + $download_url = $newest['package_url']; + $md5_url = str_replace( '.phar', '.phar.md5', $download_url ); } - - $config_file = fopen( $config_file_path, "w" ); - fwrite( $config_file, Spyc::YAMLDump( $existing_config ) ); - fclose( $config_file ); - - file_put_contents( EE_CONF_ROOT . '/update.sh', file_get_contents( 'http://rt.cx/eev4' ) ); - if ( \EE\Utils\default_launch( 'bash ' . EE_CONF_ROOT . '/update.sh' ) ) { - EE::success( 'Update complete.' ); - unlink( EE_CONF_ROOT . '/update.sh' ); + EE::log( sprintf( 'Downloading from %s...', $download_url ) ); + $temp = \EE\Utils\get_temp_dir() . uniqid( 'ee_', true ) . '.phar'; + $headers = array(); + $options = array( + 'timeout' => 600, // 10 minutes ought to be enough for everybody. + 'filename' => $temp, + ); + Utils\http_request( 'GET', $download_url, null, $headers, $options ); + $md5_response = Utils\http_request( 'GET', $md5_url ); + if ( 20 != substr( $md5_response->status_code, 0, 2 ) ) { + EE::error( "Couldn't access md5 hash for release (HTTP code {$md5_response->status_code})." ); + } + $md5_file = md5_file( $temp ); + $release_hash = trim( $md5_response->body ); + // if ( $md5_file === $release_hash ) { + // EE::log( 'md5 hash verified: ' . $release_hash ); + // } else { + // EE::error( "md5 hash for download ({$md5_file}) is different than the release hash ({$release_hash})." ); + // } + $php_binary = Utils\get_php_binary(); + $process = EE\Process::create( "{$php_binary} $temp cli info" ); + $result = $process->run(); + if ( 0 !== $result->return_code || false === stripos( $result->stdout, 'EE version' ) ) { + $multi_line = explode( PHP_EOL, $result->stderr ); + EE::error_multi_line( $multi_line ); + EE::error( 'The downloaded PHAR is broken, try running ee cli update again.' ); + } + EE::log( 'New version works. Proceeding to replace.' ); + $mode = fileperms( $old_phar ) & 511; + if ( false === chmod( $temp, $mode ) ) { + EE::error( sprintf( 'Cannot chmod %s.', $temp ) ); + } + class_exists( '\cli\Colors' ); // This autoloads \cli\Colors - after we move the file we no longer have access to this class. + if ( false === rename( $temp, $old_phar ) ) { + EE::error( sprintf( 'Cannot move %s to %s', $temp, $old_phar ) ); + } + if ( Utils\get_flag_value( $assoc_args, 'nightly' ) ) { + $updated_version = 'the latest nightly release'; + } elseif ( Utils\get_flag_value( $assoc_args, 'stable' ) ) { + $updated_version = 'the latest stable release'; } else { - EE::error( 'There was some error in running update. Please check logs and re-run update.' ); + $updated_version = $newest['version']; + } + EE::success( sprintf( 'Updated WP-CLI to %s.', $updated_version ) ); + } + + /** + * Returns update information. + */ + private function get_updates( $assoc_args ) { + $url = 'https://api.github.com/repos/EasyEngine/easyengine/releases?per_page=100'; + $options = array( + 'timeout' => 30, + ); + $headers = array( + 'Accept' => 'application/json', + ); + if ( $github_token = getenv( 'GITHUB_TOKEN' ) ) { + $headers['Authorization'] = 'token ' . $github_token; + } + $response = Utils\http_request( 'GET', $url, null, $headers, $options ); + if ( ! $response->success || 200 !== $response->status_code ) { + EE::error( sprintf( 'Failed to get latest version (HTTP code %d).', $response->status_code ) ); + } + $release_data = json_decode( $response->body ); + $updates = array( + 'major' => false, + 'minor' => false, + 'patch' => false, + ); + foreach ( $release_data as $release ) { + // Get rid of leading "v" if there is one set. + $release_version = $release->tag_name; + if ( 'v' === substr( $release_version, 0, 1 ) ) { + $release_version = ltrim( $release_version, 'v' ); + } + $update_type = Utils\get_named_sem_ver( $release_version, EE_VERSION ); + if ( ! $update_type ) { + continue; + } + if ( ! empty( $updates[ $update_type ] ) && ! Comparator::greaterThan( $release_version, $updates[ $update_type ]['version'] ) ) { + continue; + } + $updates[ $update_type ] = array( + 'version' => $release_version, + 'update_type' => $update_type, + 'package_url' => $release->assets[0]->browser_download_url, + ); + } + foreach ( $updates as $type => $value ) { + if ( empty( $value ) ) { + unset( $updates[ $type ] ); + } + } + foreach ( array( 'major', 'minor', 'patch' ) as $type ) { + if ( true === \EE\Utils\get_flag_value( $assoc_args, $type ) ) { + return ! empty( $updates[ $type ] ) ? array( $updates[ $type ] ) : false; + } + } + if ( empty( $updates ) && preg_match( '#-alpha-(.+)$#', EE_VERSION, $matches ) ) { + $version_url = 'https://raw.githubusercontent.com/EasyEngine/easyengine-builds/master/phar/NIGHTLY_VERSION'; + $response = Utils\http_request( 'GET', $version_url ); + if ( ! $response->success || 200 !== $response->status_code ) { + EE::error( sprintf( 'Failed to get current nightly version (HTTP code %d)', $response->status_code ) ); + } + $nightly_version = trim( $response->body ); + if ( EE_VERSION != $nightly_version ) { + $updates['nightly'] = array( + 'version' => $nightly_version, + 'update_type' => 'nightly', + 'package_url' => 'https://raw.githubusercontent.com/EasyEngine/easyengine-builds/master/phar/easyengine-nightly.phar ', + ); + } } + return array_values( $updates ); } /** From 62c875d5853b6912aa3b7fe2ffe62362a6d332ae Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Thu, 7 Jun 2018 18:09:07 +0530 Subject: [PATCH 0132/1044] Fix update function --- php/EE/Runner.php | 7 +++---- php/commands/src/CLI_Command.php | 14 +++++++------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index d721dacf6..8aad847be 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -480,9 +480,8 @@ public function init_logger() { EE::set_logger( $logger ); - if ( 'cli' === $this->arguments[0] && ! empty( $this->arguments[1] ) && 'info' === $this->arguments[1] && ! $this->config['ssh'] ) { - touch ('/tmp/temp_ee4.log'); - $file_logging_path = '/tmp/temp_ee4.log'; + if ( !empty( $this->arguments[0] ) && 'cli' === $this->arguments[0] && ! empty( $this->arguments[1] ) && 'info' === $this->arguments[1] && ! $this->config['ssh'] ) { + $file_logging_path = '/dev/null'; } else { $file_logging_path = EE_CONF_ROOT . '/ee4.log'; @@ -639,7 +638,7 @@ public function start() { // // Protect 'cli info' from most of the runtime, // // except when the command will be run over SSH - if ( 'cli' === $this->arguments[0] && ! empty( $this->arguments[1] ) && 'info' === $this->arguments[1] && ! $this->config['ssh'] ) { + if ( ! empty( $this->arguments[0] ) && 'cli' === $this->arguments[0] && ! empty( $this->arguments[1] ) && 'info' === $this->arguments[1] && ! $this->config['ssh'] ) { $this->_run_command_and_exit(); } diff --git a/php/commands/src/CLI_Command.php b/php/commands/src/CLI_Command.php index 8d47a78f1..813acb231 100644 --- a/php/commands/src/CLI_Command.php +++ b/php/commands/src/CLI_Command.php @@ -202,8 +202,8 @@ public function update( $_, $assoc_args ) { $md5_url = 'https://raw.githubusercontent.com/EasyEngine/easyengine-builds/master/phar/easyengine-nightly.phar.md5'; } elseif ( Utils\get_flag_value( $assoc_args, 'stable' ) ) { EE::confirm( sprintf( 'You have version %s. Would you like to update to the latest stable release?', EE_VERSION ), $assoc_args ); - $download_url = 'https://raw.githubusercontent.com/kirtangajjar/easyengine-builds/master/phar/easyengine.phar'; - $md5_url = 'https://raw.githubusercontent.com/kirtangajjar/easyengine-builds/master/phar/easyengine.phar.md5'; + $download_url = 'https://raw.githubusercontent.com/EasyEngine/easyengine-builds/master/phar/easyengine.phar'; + $md5_url = 'https://raw.githubusercontent.com/EasyEngine/easyengine-builds/master/phar/easyengine.phar.md5'; } else { $updates = $this->get_updates( $assoc_args ); if ( empty( $updates ) ) { @@ -230,11 +230,11 @@ public function update( $_, $assoc_args ) { } $md5_file = md5_file( $temp ); $release_hash = trim( $md5_response->body ); - // if ( $md5_file === $release_hash ) { - // EE::log( 'md5 hash verified: ' . $release_hash ); - // } else { - // EE::error( "md5 hash for download ({$md5_file}) is different than the release hash ({$release_hash})." ); - // } + if ( $md5_file === $release_hash ) { + EE::log( 'md5 hash verified: ' . $release_hash ); + } else { + EE::error( "md5 hash for download ({$md5_file}) is different than the release hash ({$release_hash})." ); + } $php_binary = Utils\get_php_binary(); $process = EE\Process::create( "{$php_binary} $temp cli info" ); $result = $process->run(); From 9a3471866e160a0f449df5460b4d35880744c327 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Fri, 8 Jun 2018 03:16:46 +0530 Subject: [PATCH 0133/1044] Move traefik specific configs to site-command --- php/EE/Runner.php | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 896b212d9..74e7c6961 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -55,24 +55,6 @@ private function init_ee4() { mkdir( EE_CONF_ROOT ); } - if ( ! is_dir( EE_CONF_ROOT . '/traefik' ) ) { - mkdir( EE_CONF_ROOT . '/traefik' ); - touch( EE_CONF_ROOT . '/traefik/acme.json' ); - chmod( EE_CONF_ROOT . '/traefik/acme.json', 600 ); - file_put_contents( - EE_CONF_ROOT . '/traefik/traefik.toml', '################################################################ -# API and dashboard configuration -################################################################ -[api] -################################################################ -# Docker configuration backend -################################################################ -[docker] -domain = "docker.local" -watch = true' - ); - } - if ( ! is_dir( $this->config['sites_path'] ) ) { mkdir( $this->config['sites_path'] ); } From 9809747deebe73719409480b6f9aa8ac6e01e023 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Fri, 8 Jun 2018 14:38:28 +0530 Subject: [PATCH 0134/1044] Changed ee4 instances to ee --- docs/core-repo-structure.md | 2 +- php/EE/Runner.php | 25 +++++++++++++------------ php/class-ee.php | 4 ++-- php/commands/src/CLI_Command.php | 4 ++-- php/init-ee.php | 2 +- utils/make-phar.php | 2 +- 6 files changed, 20 insertions(+), 19 deletions(-) diff --git a/docs/core-repo-structure.md b/docs/core-repo-structure.md index e9c907582..f27c31951 100644 --- a/docs/core-repo-structure.md +++ b/docs/core-repo-structure.md @@ -5,7 +5,7 @@ The core repository contains the cli interface for EasyEngine and the internal a 1. The `bin` directory contains the shell script entrypoint to the PHP files. 2. `ci` directory contains shell scripts to automate the phar building and deploying of the same to the [easyengine-builds](https://github.com/easyengine/easyengine-builds) repository with the help of [travis-ci](https://travis-ci.org/). -3. `ee4-config` directory has all the `nginx, php and redis` configurations required for different types of sites like `WordPress - Single-Site, Multi-Site` etc. +3. `ee-config` directory has all the `nginx, php and redis` configurations required for different types of sites like `WordPress - Single-Site, Multi-Site` etc. 4. The `php` directory contains the core of EasyEngine cli. * It contains the `cli-command` which handles the most basic required functions like: `version, update` etc. * The [WP-CLI internal-api](https://github.com/wp-cli/handbook/blob/master/internal-api.md), booting and auto-loading logic and other utilities. diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 8a4121a0c..d39b22e5f 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -47,9 +47,9 @@ public function __get( $key ) { } /** - * Function to check and create the root directory for ee4. + * Function to check and create the root directory for ee. */ - private function init_ee4() { + private function init_ee() { if ( ! is_dir( EE_CONF_ROOT ) ) { mkdir( EE_CONF_ROOT ); @@ -119,7 +119,8 @@ public function get_global_config_path() { $config_path = getenv( 'EE_CONFIG_PATH' ); $this->_global_config_path_debug = 'Using global config from EE_CONFIG_PATH env var: ' . $config_path; } else { - $config_path = Utils\get_home_dir() . '/.ee4/config.yml'; + // $config_path = Utils\get_home_dir() . '/.ee/config.yml'; + $config_path = EE_CONFIG_PATH . '/config.yml'; $this->_global_config_path_debug = 'Using default global config: ' . $config_path; } @@ -173,7 +174,7 @@ public function get_packages_dir_path() { if ( getenv( 'EE_PACKAGES_DIR' ) ) { $packages_dir = Utils\trailingslashit( getenv( 'EE_PACKAGES_DIR' ) ); } else { - $packages_dir = Utils\get_home_dir() . '/.ee4/packages/'; + $packages_dir = Utils\get_home_dir() . '/.ee/packages/'; } return $packages_dir; } @@ -483,11 +484,11 @@ public function init_logger() { $dateFormat = 'd-m-Y H:i:s'; $output = "[%datetime%] %channel%.%level_name%: %message% %context% %extra%\n"; $formatter = new \Monolog\Formatter\LineFormatter( $output, $dateFormat, false, true ); - $stream = new \Monolog\Handler\StreamHandler( EE_CONF_ROOT . '/ee4.log', Logger::DEBUG ); + $stream = new \Monolog\Handler\StreamHandler( EE_CONF_ROOT . '/ee.log', Logger::DEBUG ); $stream->setFormatter( $formatter ); - $file_logger = new \Monolog\Logger( 'ee4' ); + $file_logger = new \Monolog\Logger( 'ee' ); $file_logger->pushHandler( $stream ); - $file_logger->info( '::::::::::::::::::::::::ee4 invoked::::::::::::::::::::::::' ); + $file_logger->info( '::::::::::::::::::::::::ee invoked::::::::::::::::::::::::' ); EE::set_file_logger( $file_logger ); } @@ -555,7 +556,7 @@ private function ensure_present_in_config( $var, $default) { if ( empty($this->config[$var]) ) { $this->config[$var] = $default ; - $config_file_path = getenv('EE_CONFIG_PATH') ? getenv('EE_CONFIG_PATH') : Utils\get_home_dir() . '/.ee4/config.yml'; + $config_file_path = getenv('EE_CONFIG_PATH') ? getenv('EE_CONFIG_PATH') : EE_CONFIG_PATH . '/config.yml'; $config_dir_path = dirname( $config_file_path ); if ( file_exists( $config_file_path ) ) { @@ -601,7 +602,7 @@ private function run_alias_group( $aliases ) { if ( getenv( 'EE_CONFIG_PATH' ) ) { $config_path = getenv( 'EE_CONFIG_PATH' ); } else { - $config_path = Utils\get_home_dir() . '/.ee4/config.yml'; + $config_path = EE_CONFIG_PATH . '/config.yml'; } $config_path = escapeshellarg( $config_path ); @@ -629,10 +630,10 @@ private function set_alias( $alias ) { public function start() { - $this->ensure_present_in_config( 'sites_path', Utils\get_home_dir(). '/ee4-sites' ); - $this->ensure_present_in_config( 'db_path', Utils\get_home_dir(). '/.ee4/ee4.db' ); + $this->ensure_present_in_config( 'sites_path', Utils\get_home_dir(). '/ee-sites' ); + $this->ensure_present_in_config( 'db_path', EE_CONFIG_PATH. '/ee.db' ); $this->ensure_present_in_config( 'ee_installer_version', 'stable' ); - $this->init_ee4(); + $this->init_ee(); // Enable PHP error reporting to stderr if testing. if ( getenv( 'BEHAT_RUN' ) ) { diff --git a/php/class-ee.php b/php/class-ee.php index 0f8c9d49f..518860341 100644 --- a/php/class-ee.php +++ b/php/class-ee.php @@ -98,7 +98,7 @@ public static function get_cache() { if ( ! $cache ) { $home = Utils\get_home_dir(); - $dir = getenv( 'EE_CACHE_DIR' ) ? : "$home/.ee4/cache"; + $dir = getenv( 'EE_CACHE_DIR' ) ? : "$home/.ee/cache"; // 6 months, 300mb $cache = new FileCache( $dir, 15552000, 314572800 ); @@ -843,7 +843,7 @@ public static function launch_self( $command, $args = array(), $assoc_args = arr if ( getenv( 'EE_CONFIG_PATH' ) ) { $config_path = getenv( 'EE_CONFIG_PATH' ); } else { - $config_path = Utils\get_home_dir() . '/.ee4/config.yml'; + $config_path = EE_CONFIG_PATH . '/config.yml'; } $config_path = escapeshellarg( $config_path ); diff --git a/php/commands/src/CLI_Command.php b/php/commands/src/CLI_Command.php index f0459feac..e6df3eb8c 100644 --- a/php/commands/src/CLI_Command.php +++ b/php/commands/src/CLI_Command.php @@ -96,7 +96,7 @@ public function version() { * PHP version: 7.1.12-1+ubuntu16.04.1+deb.sury.org+1 * php.ini used: /etc/php/7.1/cli/php.ini * EE root dir: phar://ee.phar - * EE packages dir: /home/person/.ee4/packages/ + * EE packages dir: /home/person/.ee/packages/ * EE global config: * EE project config: * EE version: 1.5.0 @@ -187,7 +187,7 @@ public function info( $_, $assoc_args ) { */ public function update( $_, $assoc_args ) { - $config_file_path = getenv( 'EE_CONFIG_PATH' ) ? getenv( 'EE_CONFIG_PATH' ) : Utils\get_home_dir() . '/.ee4/config.yml'; + $config_file_path = getenv( 'EE_CONFIG_PATH' ) ? getenv( 'EE_CONFIG_PATH' ) : EE_CONFIG_PATH . '/config.yml'; $existing_config = Spyc::YAMLLoad( $config_file_path ); diff --git a/php/init-ee.php b/php/init-ee.php index 6a20e06b2..953a62641 100644 --- a/php/init-ee.php +++ b/php/init-ee.php @@ -5,7 +5,7 @@ define( 'EE_VERSION', trim( file_get_contents( EE_ROOT . '/VERSION' ) ) ); define( 'EE_START_MICROTIME', microtime( true ) ); define( 'HOME', $_SERVER['HOME'] ); -define( 'EE_CONF_ROOT', HOME . '/.ee4' ); +define( 'EE_CONF_ROOT', '/opt/easyengine' ); define( 'EE_SITE_CONF_ROOT', EE_ROOT . '/ee4-config' ); if ( file_exists( EE_ROOT . '/vendor/autoload.php' ) ) { diff --git a/utils/make-phar.php b/utils/make-phar.php index 864c90e22..714a7f9ec 100644 --- a/utils/make-phar.php +++ b/utils/make-phar.php @@ -223,7 +223,7 @@ function get_composer_versions( $current_version ) { ->ignoreVCS(true) ->ignoreDotFiles(false) ->in( EE_ROOT . '/templates') - ->in( EE_ROOT . '/ee4-config') + ->in( EE_ROOT . '/ee-config') ; foreach ( $finder as $file ) { From a4d45a97e3de860df682c5f7bf7672c9517a5f79 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Fri, 8 Jun 2018 14:45:49 +0530 Subject: [PATCH 0135/1044] Reverted change in make-phar.php --- utils/make-phar.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/make-phar.php b/utils/make-phar.php index 714a7f9ec..864c90e22 100644 --- a/utils/make-phar.php +++ b/utils/make-phar.php @@ -223,7 +223,7 @@ function get_composer_versions( $current_version ) { ->ignoreVCS(true) ->ignoreDotFiles(false) ->in( EE_ROOT . '/templates') - ->in( EE_ROOT . '/ee-config') + ->in( EE_ROOT . '/ee4-config') ; foreach ( $finder as $file ) { From aa8ca571fda2113521d93c5005ead1a316e69ce1 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Fri, 8 Jun 2018 14:56:53 +0530 Subject: [PATCH 0136/1044] Remove ee4-config folder from phar --- utils/make-phar.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/utils/make-phar.php b/utils/make-phar.php index 864c90e22..2570d5d33 100644 --- a/utils/make-phar.php +++ b/utils/make-phar.php @@ -222,9 +222,7 @@ function get_composer_versions( $current_version ) { ->files() ->ignoreVCS(true) ->ignoreDotFiles(false) - ->in( EE_ROOT . '/templates') - ->in( EE_ROOT . '/ee4-config') - ; + ->in( EE_ROOT . '/templates'); foreach ( $finder as $file ) { add_file( $phar, $file ); From d9cd61fb45c36bbe6114d7eb4691db8e8d0afcd1 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Fri, 8 Jun 2018 16:28:45 +0530 Subject: [PATCH 0137/1044] Include yosymfony in vendor of phar --- utils/make-phar.php | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/make-phar.php b/utils/make-phar.php index 864c90e22..843472bfc 100644 --- a/utils/make-phar.php +++ b/utils/make-phar.php @@ -168,6 +168,7 @@ function get_composer_versions( $current_version ) { ->in(EE_VENDOR_DIR . '/symfony/finder') ->in(EE_VENDOR_DIR . '/symfony/polyfill-mbstring') ->in(EE_VENDOR_DIR . '/monolog') + ->in(EE_VENDOR_DIR . '/yosymfony') ->notName('behat-tags.php') ->notPath('#(?:[^/]+-command|php-cli-tools)/vendor/#') // For running locally, in case have composer installed or symlinked them. ->exclude('examples') From 341f16b8e8c5677516318748b1045d9a6dd268a1 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Fri, 8 Jun 2018 17:55:28 +0530 Subject: [PATCH 0138/1044] Replaced EE_CONFIG_PATH with EE_CONF_ROOT --- php/EE/Runner.php | 8 ++++---- php/class-ee.php | 2 +- php/commands/src/CLI_Command.php | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index d39b22e5f..8cd69dc3d 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -120,7 +120,7 @@ public function get_global_config_path() { $this->_global_config_path_debug = 'Using global config from EE_CONFIG_PATH env var: ' . $config_path; } else { // $config_path = Utils\get_home_dir() . '/.ee/config.yml'; - $config_path = EE_CONFIG_PATH . '/config.yml'; + $config_path = EE_CONF_ROOT . '/config.yml'; $this->_global_config_path_debug = 'Using default global config: ' . $config_path; } @@ -556,7 +556,7 @@ private function ensure_present_in_config( $var, $default) { if ( empty($this->config[$var]) ) { $this->config[$var] = $default ; - $config_file_path = getenv('EE_CONFIG_PATH') ? getenv('EE_CONFIG_PATH') : EE_CONFIG_PATH . '/config.yml'; + $config_file_path = getenv('EE_CONFIG_PATH') ? getenv('EE_CONFIG_PATH') : EE_CONF_ROOT . '/config.yml'; $config_dir_path = dirname( $config_file_path ); if ( file_exists( $config_file_path ) ) { @@ -602,7 +602,7 @@ private function run_alias_group( $aliases ) { if ( getenv( 'EE_CONFIG_PATH' ) ) { $config_path = getenv( 'EE_CONFIG_PATH' ); } else { - $config_path = EE_CONFIG_PATH . '/config.yml'; + $config_path = EE_CONF_ROOT . '/config.yml'; } $config_path = escapeshellarg( $config_path ); @@ -631,7 +631,7 @@ private function set_alias( $alias ) { public function start() { $this->ensure_present_in_config( 'sites_path', Utils\get_home_dir(). '/ee-sites' ); - $this->ensure_present_in_config( 'db_path', EE_CONFIG_PATH. '/ee.db' ); + $this->ensure_present_in_config( 'db_path', EE_CONF_ROOT . '/ee.db' ); $this->ensure_present_in_config( 'ee_installer_version', 'stable' ); $this->init_ee(); diff --git a/php/class-ee.php b/php/class-ee.php index 518860341..6662e4bc2 100644 --- a/php/class-ee.php +++ b/php/class-ee.php @@ -843,7 +843,7 @@ public static function launch_self( $command, $args = array(), $assoc_args = arr if ( getenv( 'EE_CONFIG_PATH' ) ) { $config_path = getenv( 'EE_CONFIG_PATH' ); } else { - $config_path = EE_CONFIG_PATH . '/config.yml'; + $config_path = EE_CONF_ROOT . '/config.yml'; } $config_path = escapeshellarg( $config_path ); diff --git a/php/commands/src/CLI_Command.php b/php/commands/src/CLI_Command.php index e6df3eb8c..fc3bce74e 100644 --- a/php/commands/src/CLI_Command.php +++ b/php/commands/src/CLI_Command.php @@ -187,7 +187,7 @@ public function info( $_, $assoc_args ) { */ public function update( $_, $assoc_args ) { - $config_file_path = getenv( 'EE_CONFIG_PATH' ) ? getenv( 'EE_CONFIG_PATH' ) : EE_CONFIG_PATH . '/config.yml'; + $config_file_path = getenv( 'EE_CONFIG_PATH' ) ? getenv( 'EE_CONFIG_PATH' ) : EE_CONF_ROOT . '/config.yml'; $existing_config = Spyc::YAMLLoad( $config_file_path ); From d2fd04e58d51388e05eef98296599f2f32ccfaba Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Fri, 8 Jun 2018 18:11:52 +0530 Subject: [PATCH 0139/1044] Fix phpcs changes --- php/EE/Runner.php | 4 +-- php/commands/src/CLI_Command.php | 46 +++++++++++++++++--------------- 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 8aad847be..095e04c6f 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -636,8 +636,8 @@ private function set_alias( $alias ) { public function start() { - // // Protect 'cli info' from most of the runtime, - // // except when the command will be run over SSH + // Protect 'cli info' from most of the runtime, + // except when the command will be run over SSH if ( ! empty( $this->arguments[0] ) && 'cli' === $this->arguments[0] && ! empty( $this->arguments[1] ) && 'info' === $this->arguments[1] && ! $this->config['ssh'] ) { $this->_run_command_and_exit(); } diff --git a/php/commands/src/CLI_Command.php b/php/commands/src/CLI_Command.php index 813acb231..637836ddb 100644 --- a/php/commands/src/CLI_Command.php +++ b/php/commands/src/CLI_Command.php @@ -180,7 +180,7 @@ public function info( $_, $assoc_args ) { * * # Update CLI. * You have version 0.24.0. Would you like to update to 0.24.1? [y/n] y - * Downloading from https://github.com/ee/ee/releases + * Downloading from https://github.com/ee/ee/releases/download/v4.0.0/ee-4.0.0.phar... * $ ee cli update/download/v0.24.1/ee-0.24.1.phar... * New version works. Proceeding to replace. * Success: Updated EE to 0.24.1. @@ -209,18 +209,19 @@ public function update( $_, $assoc_args ) { if ( empty( $updates ) ) { $update_type = $this->get_update_type_str( $assoc_args ); EE::success( "EasyEngine is at the latest{$update_type}version." ); + return; } $newest = $updates[0]; EE::confirm( sprintf( 'You have version %s. Would you like to update to %s?', EE_VERSION, $newest['version'] ), $assoc_args ); $download_url = $newest['package_url']; - $md5_url = str_replace( '.phar', '.phar.md5', $download_url ); + $md5_url = str_replace( '.phar', '.phar.md5', $download_url ); } EE::log( sprintf( 'Downloading from %s...', $download_url ) ); - $temp = \EE\Utils\get_temp_dir() . uniqid( 'ee_', true ) . '.phar'; + $temp = \EE\Utils\get_temp_dir() . uniqid( 'ee_', true ) . '.phar'; $headers = array(); $options = array( - 'timeout' => 600, // 10 minutes ought to be enough for everybody. + 'timeout' => 600, // 10 minutes ought to be enough for everybody. 'filename' => $temp, ); Utils\http_request( 'GET', $download_url, null, $headers, $options ); @@ -228,7 +229,7 @@ public function update( $_, $assoc_args ) { if ( 20 != substr( $md5_response->status_code, 0, 2 ) ) { EE::error( "Couldn't access md5 hash for release (HTTP code {$md5_response->status_code})." ); } - $md5_file = md5_file( $temp ); + $md5_file = md5_file( $temp ); $release_hash = trim( $md5_response->body ); if ( $md5_file === $release_hash ) { EE::log( 'md5 hash verified: ' . $release_hash ); @@ -236,8 +237,8 @@ public function update( $_, $assoc_args ) { EE::error( "md5 hash for download ({$md5_file}) is different than the release hash ({$release_hash})." ); } $php_binary = Utils\get_php_binary(); - $process = EE\Process::create( "{$php_binary} $temp cli info" ); - $result = $process->run(); + $process = EE\Process::create( "{$php_binary} $temp cli info" ); + $result = $process->run(); if ( 0 !== $result->return_code || false === stripos( $result->stdout, 'EE version' ) ) { $multi_line = explode( PHP_EOL, $result->stderr ); EE::error_multi_line( $multi_line ); @@ -262,11 +263,11 @@ class_exists( '\cli\Colors' ); // This autoloads \cli\Colors - after we move the EE::success( sprintf( 'Updated WP-CLI to %s.', $updated_version ) ); } - /** + /** * Returns update information. */ private function get_updates( $assoc_args ) { - $url = 'https://api.github.com/repos/EasyEngine/easyengine/releases?per_page=100'; + $url = 'https://api.github.com/repos/EasyEngine/easyengine/releases?per_page=100'; $options = array( 'timeout' => 30, ); @@ -281,10 +282,10 @@ private function get_updates( $assoc_args ) { EE::error( sprintf( 'Failed to get latest version (HTTP code %d).', $response->status_code ) ); } $release_data = json_decode( $response->body ); - $updates = array( - 'major' => false, - 'minor' => false, - 'patch' => false, + $updates = array( + 'major' => false, + 'minor' => false, + 'patch' => false, ); foreach ( $release_data as $release ) { // Get rid of leading "v" if there is one set. @@ -296,40 +297,41 @@ private function get_updates( $assoc_args ) { if ( ! $update_type ) { continue; } - if ( ! empty( $updates[ $update_type ] ) && ! Comparator::greaterThan( $release_version, $updates[ $update_type ]['version'] ) ) { + if ( ! empty( $updates[$update_type] ) && ! Comparator::greaterThan( $release_version, $updates[$update_type]['version'] ) ) { continue; } - $updates[ $update_type ] = array( - 'version' => $release_version, + $updates[$update_type] = array( + 'version' => $release_version, 'update_type' => $update_type, 'package_url' => $release->assets[0]->browser_download_url, ); } foreach ( $updates as $type => $value ) { if ( empty( $value ) ) { - unset( $updates[ $type ] ); + unset( $updates[$type] ); } } foreach ( array( 'major', 'minor', 'patch' ) as $type ) { if ( true === \EE\Utils\get_flag_value( $assoc_args, $type ) ) { - return ! empty( $updates[ $type ] ) ? array( $updates[ $type ] ) : false; + return ! empty( $updates[$type] ) ? array( $updates[$type] ) : false; } } if ( empty( $updates ) && preg_match( '#-alpha-(.+)$#', EE_VERSION, $matches ) ) { $version_url = 'https://raw.githubusercontent.com/EasyEngine/easyengine-builds/master/phar/NIGHTLY_VERSION'; - $response = Utils\http_request( 'GET', $version_url ); + $response = Utils\http_request( 'GET', $version_url ); if ( ! $response->success || 200 !== $response->status_code ) { EE::error( sprintf( 'Failed to get current nightly version (HTTP code %d)', $response->status_code ) ); } $nightly_version = trim( $response->body ); if ( EE_VERSION != $nightly_version ) { $updates['nightly'] = array( - 'version' => $nightly_version, - 'update_type' => 'nightly', - 'package_url' => 'https://raw.githubusercontent.com/EasyEngine/easyengine-builds/master/phar/easyengine-nightly.phar ', + 'version' => $nightly_version, + 'update_type' => 'nightly', + 'package_url' => 'https://raw.githubusercontent.com/EasyEngine/easyengine-builds/master/phar/easyengine-nightly.phar', ); } } + return array_values( $updates ); } From ee0589db4d15e68918d83d8fcc3a3ecd1ea81e15 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Fri, 8 Jun 2018 18:20:08 +0530 Subject: [PATCH 0140/1044] Remove comment --- php/EE/Runner.php | 1 - 1 file changed, 1 deletion(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 8cd69dc3d..081cd3806 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -119,7 +119,6 @@ public function get_global_config_path() { $config_path = getenv( 'EE_CONFIG_PATH' ); $this->_global_config_path_debug = 'Using global config from EE_CONFIG_PATH env var: ' . $config_path; } else { - // $config_path = Utils\get_home_dir() . '/.ee/config.yml'; $config_path = EE_CONF_ROOT . '/config.yml'; $this->_global_config_path_debug = 'Using default global config: ' . $config_path; } From a2c9f12975708a1472ca779b8ed588d4ce342202 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Fri, 8 Jun 2018 22:45:04 +0530 Subject: [PATCH 0141/1044] Fix template not getting included in site command --- utils/make-phar.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/utils/make-phar.php b/utils/make-phar.php index 864c90e22..37aadae37 100644 --- a/utils/make-phar.php +++ b/utils/make-phar.php @@ -216,10 +216,20 @@ function get_composer_versions( $current_version ) { add_file( $phar, $file ); } -// other files $finder = new Finder(); + $finder ->files() + ->in(EE_VENDOR_DIR . '/easyengine/site-command/templates') + ->name('*.mustache'); + +foreach ( $finder as $file ) { + add_file( $phar, $file ); +} + +// other files +$finder = new Finder(); +$finder->files() ->ignoreVCS(true) ->ignoreDotFiles(false) ->in( EE_ROOT . '/templates') From 36bc11aeb32efcb59260c5fcda45e36d56adb297 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Fri, 8 Jun 2018 23:45:28 +0530 Subject: [PATCH 0142/1044] Update php platform for yosymfony-toml --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index b0b9d77eb..760c21d9c 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ ], "config": { "platform": { - "php": "5.3.29" + "php": "7.1" }, "sort-packages": true }, From 199c8107fd449911e1d84b2661b8e9085b78e43e Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Sat, 9 Jun 2018 00:01:34 +0530 Subject: [PATCH 0143/1044] Update init_ee to handle global dir creation Enable sudo creation of global directory. Change init_ee sequence for logger to initialize with file. --- php/EE/Runner.php | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 081cd3806..b227df187 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -52,14 +52,19 @@ public function __get( $key ) { private function init_ee() { if ( ! is_dir( EE_CONF_ROOT ) ) { - mkdir( EE_CONF_ROOT ); + $user = getenv('USER'); + shell_exec('sudo mkdir -p ' . EE_CONF_ROOT); + shell_exec("sudo chown -R $user: " . EE_CONF_ROOT); } + $this->ensure_present_in_config( 'sites_path', Utils\get_home_dir(). '/ee-sites' ); + $this->ensure_present_in_config( 'ee_installer_version', 'stable' ); + if ( ! is_dir( $this->config['sites_path'] ) ) { mkdir( $this->config['sites_path'] ); } define( 'WEBROOT', \EE\Utils\trailingslashit( $this->config['sites_path'] ) ); - define( 'DB', $this->config['db_path'] ); + define( 'DB', EE_CONF_ROOT.'/easyengine.sqlite' ); define( 'LOCALHOST_IP', '127.0.0.1' ); define( 'TABLE', 'sites' ); } @@ -480,6 +485,15 @@ public function init_logger() { EE::set_logger( $logger ); + $this->init_ee(); + + if ( !empty( $this->arguments[0] ) && 'cli' === $this->arguments[0] && ! empty( $this->arguments[1] ) && 'info' === $this->arguments[1] && ! $this->config['ssh'] ) { + $file_logging_path = '/dev/null'; + } + else { + $file_logging_path = EE_CONF_ROOT . '/ee4.log'; + } + $dateFormat = 'd-m-Y H:i:s'; $output = "[%datetime%] %channel%.%level_name%: %message% %context% %extra%\n"; $formatter = new \Monolog\Formatter\LineFormatter( $output, $dateFormat, false, true ); @@ -629,10 +643,6 @@ private function set_alias( $alias ) { public function start() { - $this->ensure_present_in_config( 'sites_path', Utils\get_home_dir(). '/ee-sites' ); - $this->ensure_present_in_config( 'db_path', EE_CONF_ROOT . '/ee.db' ); - $this->ensure_present_in_config( 'ee_installer_version', 'stable' ); - $this->init_ee(); // Enable PHP error reporting to stderr if testing. if ( getenv( 'BEHAT_RUN' ) ) { From 9ab2c24b2595457146409fb64f4dea78752d9bac Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Sat, 9 Jun 2018 00:09:21 +0530 Subject: [PATCH 0144/1044] Update phar creation to accomodate all config files --- utils/make-phar.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utils/make-phar.php b/utils/make-phar.php index 37aadae37..5c23fb325 100644 --- a/utils/make-phar.php +++ b/utils/make-phar.php @@ -220,8 +220,11 @@ function get_composer_versions( $current_version ) { $finder ->files() + ->ignoreDotFiles(false) ->in(EE_VENDOR_DIR . '/easyengine/site-command/templates') - ->name('*.mustache'); + ->name('*.mustache') + ->name('.env.mustache') + ->name('*.ini'); foreach ( $finder as $file ) { add_file( $phar, $file ); From 50747845383957d1f16e3d2d2d247fc7ef75c19c Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Sat, 9 Jun 2018 01:09:51 +0530 Subject: [PATCH 0145/1044] Remove extra lines and chown --- php/EE/Runner.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index b227df187..9be3ba4ae 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -54,7 +54,6 @@ private function init_ee() { if ( ! is_dir( EE_CONF_ROOT ) ) { $user = getenv('USER'); shell_exec('sudo mkdir -p ' . EE_CONF_ROOT); - shell_exec("sudo chown -R $user: " . EE_CONF_ROOT); } $this->ensure_present_in_config( 'sites_path', Utils\get_home_dir(). '/ee-sites' ); @@ -487,13 +486,6 @@ public function init_logger() { $this->init_ee(); - if ( !empty( $this->arguments[0] ) && 'cli' === $this->arguments[0] && ! empty( $this->arguments[1] ) && 'info' === $this->arguments[1] && ! $this->config['ssh'] ) { - $file_logging_path = '/dev/null'; - } - else { - $file_logging_path = EE_CONF_ROOT . '/ee4.log'; - } - $dateFormat = 'd-m-Y H:i:s'; $output = "[%datetime%] %channel%.%level_name%: %message% %context% %extra%\n"; $formatter = new \Monolog\Formatter\LineFormatter( $output, $dateFormat, false, true ); From 52c618af86047b5e2b505a901ba2dd67582fc9b0 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Sat, 9 Jun 2018 01:46:15 +0530 Subject: [PATCH 0146/1044] Shift to standard name --- php/EE/Runner.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 9be3ba4ae..6c8a7af31 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -63,7 +63,7 @@ private function init_ee() { mkdir( $this->config['sites_path'] ); } define( 'WEBROOT', \EE\Utils\trailingslashit( $this->config['sites_path'] ) ); - define( 'DB', EE_CONF_ROOT.'/easyengine.sqlite' ); + define( 'DB', EE_CONF_ROOT.'/ee.sqlite' ); define( 'LOCALHOST_IP', '127.0.0.1' ); define( 'TABLE', 'sites' ); } From d313a542887286238c5a660ff0052948e120c719 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Sat, 9 Jun 2018 01:48:14 +0530 Subject: [PATCH 0147/1044] Change packages directory --- php/EE/Runner.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 6c8a7af31..9842773f4 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -177,7 +177,7 @@ public function get_packages_dir_path() { if ( getenv( 'EE_PACKAGES_DIR' ) ) { $packages_dir = Utils\trailingslashit( getenv( 'EE_PACKAGES_DIR' ) ); } else { - $packages_dir = Utils\get_home_dir() . '/.ee/packages/'; + $packages_dir = EE_CONF_ROOT . '/packages'; } return $packages_dir; } From b4944ef87c3ee0fc30d3529904ed1f282c5be426 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Sat, 9 Jun 2018 01:56:27 +0530 Subject: [PATCH 0148/1044] Remove ini entry from finder as not needed --- utils/make-phar.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/utils/make-phar.php b/utils/make-phar.php index 5c23fb325..3f61bdc82 100644 --- a/utils/make-phar.php +++ b/utils/make-phar.php @@ -223,8 +223,7 @@ function get_composer_versions( $current_version ) { ->ignoreDotFiles(false) ->in(EE_VENDOR_DIR . '/easyengine/site-command/templates') ->name('*.mustache') - ->name('.env.mustache') - ->name('*.ini'); + ->name('.env.mustache'); foreach ( $finder as $file ) { add_file( $phar, $file ); From 5af722a6a34ead8d169299ce427a7cb5760480bd Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Sat, 9 Jun 2018 01:58:56 +0530 Subject: [PATCH 0149/1044] Update name to standard name --- php/EE/Runner.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 095e04c6f..d56a48732 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -484,7 +484,7 @@ public function init_logger() { $file_logging_path = '/dev/null'; } else { - $file_logging_path = EE_CONF_ROOT . '/ee4.log'; + $file_logging_path = EE_CONF_ROOT . '/ee.log'; } $dateFormat = 'd-m-Y H:i:s'; From 0f1b7ac5dc6b205b777a239c4c852e9c856260f9 Mon Sep 17 00:00:00 2001 From: Mriyam Tamuli <mbtamuli@gmail.com> Date: Sat, 9 Jun 2018 03:04:11 +0530 Subject: [PATCH 0150/1044] Update composer.lock Signed-off-by: Mriyam Tamuli <mbtamuli@gmail.com> --- composer.lock | 344 ++++++++++++++++++++++++++++++++++---------------- 1 file changed, 238 insertions(+), 106 deletions(-) diff --git a/composer.lock b/composer.lock index 426a5e72e..0e7dc40ae 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "80bc4a48c5afd7e3306ace1fb21e17e3", + "content-hash": "dff0a4c2d5e6300dd3e30a277bb5c6ee", "packages": [ { "name": "composer/ca-bundle", @@ -271,14 +271,17 @@ "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "220d042b0304b42c5ac79cb9f05026448d65e5d4" + "reference": "d021d7ace1e8acc8817c5d00613eb66e0d78b7e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/220d042b0304b42c5ac79cb9f05026448d65e5d4", - "reference": "220d042b0304b42c5ac79cb9f05026448d65e5d4", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/d021d7ace1e8acc8817c5d00613eb66e0d78b7e5", + "reference": "d021d7ace1e8acc8817c5d00613eb66e0d78b7e5", "shasum": "" }, + "require": { + "yosymfony/toml": "^1.0" + }, "type": "ee-cli-package", "extra": { "branch-alias": { @@ -305,7 +308,7 @@ "MIT" ], "homepage": "https://github.com/easyengine/site-command", - "time": "2018-05-16T13:41:46+00:00" + "time": "2018-06-08T21:20:53+00:00" }, { "name": "easyengine/wp-command", @@ -820,21 +823,22 @@ }, { "name": "symfony/config", - "version": "v2.8.39", + "version": "v2.8.41", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "ecacddeaf76732231eea1657f6f5b062dade94c9" + "reference": "93bdf96d0e3c9b29740bf9050e7a996b443c8436" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/ecacddeaf76732231eea1657f6f5b062dade94c9", - "reference": "ecacddeaf76732231eea1657f6f5b062dade94c9", + "url": "https://api.github.com/repos/symfony/config/zipball/93bdf96d0e3c9b29740bf9050e7a996b443c8436", + "reference": "93bdf96d0e3c9b29740bf9050e7a996b443c8436", "shasum": "" }, "require": { "php": ">=5.3.9", - "symfony/filesystem": "~2.3|~3.0.0" + "symfony/filesystem": "~2.3|~3.0.0", + "symfony/polyfill-ctype": "~1.8" }, "require-dev": { "symfony/yaml": "~2.7|~3.0.0" @@ -872,20 +876,20 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2018-03-19T21:11:56+00:00" + "time": "2018-05-01T22:52:40+00:00" }, { "name": "symfony/console", - "version": "v2.8.39", + "version": "v2.8.41", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "932d1e4f7f33ee37d3534f5f452474daa66283c2" + "reference": "e8e59b74ad1274714dad2748349b55e3e6e630c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/932d1e4f7f33ee37d3534f5f452474daa66283c2", - "reference": "932d1e4f7f33ee37d3534f5f452474daa66283c2", + "url": "https://api.github.com/repos/symfony/console/zipball/e8e59b74ad1274714dad2748349b55e3e6e630c7", + "reference": "e8e59b74ad1274714dad2748349b55e3e6e630c7", "shasum": "" }, "require": { @@ -933,37 +937,37 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-04-30T01:21:07+00:00" + "time": "2018-05-15T21:17:45+00:00" }, { "name": "symfony/debug", - "version": "v2.8.39", + "version": "v3.0.9", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "4486d2be5e068b51fece4c8551c14e709f573c8d" + "reference": "697c527acd9ea1b2d3efac34d9806bf255278b0a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/4486d2be5e068b51fece4c8551c14e709f573c8d", - "reference": "4486d2be5e068b51fece4c8551c14e709f573c8d", + "url": "https://api.github.com/repos/symfony/debug/zipball/697c527acd9ea1b2d3efac34d9806bf255278b0a", + "reference": "697c527acd9ea1b2d3efac34d9806bf255278b0a", "shasum": "" }, "require": { - "php": ">=5.3.9", + "php": ">=5.5.9", "psr/log": "~1.0" }, "conflict": { "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" }, "require-dev": { - "symfony/class-loader": "~2.2|~3.0.0", - "symfony/http-kernel": "~2.3.24|~2.5.9|^2.6.2|~3.0.0" + "symfony/class-loader": "~2.8|~3.0", + "symfony/http-kernel": "~2.8|~3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -990,11 +994,11 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2018-04-03T05:20:27+00:00" + "time": "2016-07-30T07:22:48+00:00" }, { "name": "symfony/dependency-injection", - "version": "v2.8.39", + "version": "v2.8.41", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", @@ -1057,7 +1061,7 @@ }, { "name": "symfony/event-dispatcher", - "version": "v2.8.39", + "version": "v2.8.41", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", @@ -1117,25 +1121,25 @@ }, { "name": "symfony/filesystem", - "version": "v2.8.39", + "version": "v3.0.9", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "125403a59e4cb4e3ebf46d0162fabcde613d2b97" + "reference": "b2da5009d9bacbd91d83486aa1f44c793a8c380d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/125403a59e4cb4e3ebf46d0162fabcde613d2b97", - "reference": "125403a59e4cb4e3ebf46d0162fabcde613d2b97", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/b2da5009d9bacbd91d83486aa1f44c793a8c380d", + "reference": "b2da5009d9bacbd91d83486aa1f44c793a8c380d", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": ">=5.5.9" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -1162,20 +1166,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2018-02-19T16:23:47+00:00" + "time": "2016-07-20T05:43:46+00:00" }, { "name": "symfony/finder", - "version": "v2.8.39", + "version": "v2.8.41", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "423746fc18ccf31f9abec43e4f078bb6e024b2d5" + "reference": "79764d21163db295f0daf8bd9d9b91f97e65db6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/423746fc18ccf31f9abec43e4f078bb6e024b2d5", - "reference": "423746fc18ccf31f9abec43e4f078bb6e024b2d5", + "url": "https://api.github.com/repos/symfony/finder/zipball/79764d21163db295f0daf8bd9d9b91f97e65db6a", + "reference": "79764d21163db295f0daf8bd9d9b91f97e65db6a", "shasum": "" }, "require": { @@ -1211,7 +1215,62 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2018-04-04T13:38:31+00:00" + "time": "2018-05-15T21:17:45+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.8.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/7cc359f1b7b80fc25ed7796be7d96adc9b354bae", + "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + }, + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2018-04-30T19:57:29+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -1274,25 +1333,25 @@ }, { "name": "symfony/process", - "version": "v2.8.39", + "version": "v3.4.11", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "ee2c91470ff262b1a00aec27875d38594aa87629" + "reference": "4cbf2db9abcb01486a21b7a059e03a62fae63187" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/ee2c91470ff262b1a00aec27875d38594aa87629", - "reference": "ee2c91470ff262b1a00aec27875d38594aa87629", + "url": "https://api.github.com/repos/symfony/process/zipball/4cbf2db9abcb01486a21b7a059e03a62fae63187", + "reference": "4cbf2db9abcb01486a21b7a059e03a62fae63187", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": "^5.5.9|>=7.0.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -1319,20 +1378,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2018-04-03T05:20:27+00:00" + "time": "2018-05-16T08:49:21+00:00" }, { "name": "symfony/translation", - "version": "v2.8.39", + "version": "v2.8.41", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "6f744108f846097cb250d90c8c463ddd23b43f60" + "reference": "c6a27966a92fa361bf2c3a938abc6dee91f7ad67" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/6f744108f846097cb250d90c8c463ddd23b43f60", - "reference": "6f744108f846097cb250d90c8c463ddd23b43f60", + "url": "https://api.github.com/repos/symfony/translation/zipball/c6a27966a92fa361bf2c3a938abc6dee91f7ad67", + "reference": "c6a27966a92fa361bf2c3a938abc6dee91f7ad67", "shasum": "" }, "require": { @@ -1383,24 +1442,25 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2018-04-30T01:21:07+00:00" + "time": "2018-05-21T09:59:10+00:00" }, { "name": "symfony/yaml", - "version": "v2.8.39", + "version": "v2.8.41", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "d20bd2bdee063863e426297af41eda45ccad6f7e" + "reference": "51356b7a2ff7c9fd06b2f1681cc463bb62b5c1ff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/d20bd2bdee063863e426297af41eda45ccad6f7e", - "reference": "d20bd2bdee063863e426297af41eda45ccad6f7e", + "url": "https://api.github.com/repos/symfony/yaml/zipball/51356b7a2ff7c9fd06b2f1681cc463bb62b5c1ff", + "reference": "51356b7a2ff7c9fd06b2f1681cc463bb62b5c1ff", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": ">=5.3.9", + "symfony/polyfill-ctype": "~1.8" }, "type": "library", "extra": { @@ -1432,7 +1492,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2018-04-08T07:53:13+00:00" + "time": "2018-05-01T22:52:40+00:00" }, { "name": "wp-cli/autoload-splitter", @@ -1572,6 +1632,102 @@ "console" ], "time": "2018-04-20T08:11:30+00:00" + }, + { + "name": "yosymfony/parser-utils", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/yosymfony/parser-utils.git", + "reference": "5376469d996a8f09139c0c795048b1140d143281" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/yosymfony/parser-utils/zipball/5376469d996a8f09139c0c795048b1140d143281", + "reference": "5376469d996a8f09139c0c795048b1140d143281", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Yosymfony\\ParserUtils\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Victor Puertas", + "email": "vpgugr@gmail.com", + "homepage": "http://yosymfony.com" + } + ], + "description": "Parser utilities", + "homepage": "http://github.com/yosymfony/toml", + "keywords": [ + "lexer", + "parser" + ], + "time": "2017-11-18T22:30:41+00:00" + }, + { + "name": "yosymfony/toml", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/yosymfony/toml.git", + "reference": "8d67c2c9a5941d40a3a37ff42c3c3b72a0a09678" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/yosymfony/toml/zipball/8d67c2c9a5941d40a3a37ff42c3c3b72a0a09678", + "reference": "8d67c2c9a5941d40a3a37ff42c3c3b72a0a09678", + "shasum": "" + }, + "require": { + "php": ">=7.1", + "yosymfony/parser-utils": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Yosymfony\\Toml\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Victor Puertas", + "email": "vpgugr@gmail.com", + "homepage": "http://yosymfony.com" + } + ], + "description": "A PHP parser for TOML compatible with specification 0.4.0", + "homepage": "http://github.com/yosymfony/toml", + "keywords": [ + "mojombo", + "parser", + "toml" + ], + "time": "2018-02-05T22:43:21+00:00" } ], "packages-dev": [ @@ -2142,12 +2298,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "6fe712594835e5b70de30aec5fc244a7bd8464cd" + "reference": "0e4ea9f9e1fd3c6a563524f8f399696d98c7c85a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/6fe712594835e5b70de30aec5fc244a7bd8464cd", - "reference": "6fe712594835e5b70de30aec5fc244a7bd8464cd", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/0e4ea9f9e1fd3c6a563524f8f399696d98c7c85a", + "reference": "0e4ea9f9e1fd3c6a563524f8f399696d98c7c85a", "shasum": "" }, "conflict": { @@ -2158,7 +2314,7 @@ "asymmetricrypt/asymmetricrypt": ">=0,<9.9.99", "aws/aws-sdk-php": ">=3,<3.2.1", "bugsnag/bugsnag-laravel": ">=2,<2.0.2", - "cakephp/cakephp": ">=1.3,<1.3.18|>=2,<2.4.99|>=2.5,<2.5.99|>=2.6,<2.6.12|>=2.7,<2.7.6|>=3,<3.0.15|>=3.1,<3.1.4", + "cakephp/cakephp": ">=1.3,<1.3.18|>=2,<2.4.99|>=2.5,<2.5.99|>=2.6,<2.6.12|>=2.7,<2.7.6|>=3,<3.0.15|>=3.1,<3.1.4|>=3.4,<3.4.14|>=3.5,<3.5.17|>=3.6,<3.6.4", "cart2quote/module-quotation": ">=4.1.6,<=4.4.5|>=5,<5.4.4", "cartalyst/sentry": "<=2.1.6", "codeigniter/framework": "<=3.0.6", @@ -2215,6 +2371,7 @@ "propel/propel1": ">=1,<=1.7.1", "pusher/pusher-php-server": "<2.2.1", "sabre/dav": ">=1.6,<1.6.99|>=1.7,<1.7.11|>=1.8,<1.8.9", + "sensiolabs/connect": "<4.2.3", "shopware/shopware": "<5.3.7", "silverstripe/cms": ">=3,<=3.0.11|>=3.1,<3.1.11", "silverstripe/forum": "<=0.6.1|>=0.7,<=0.7.3", @@ -2231,16 +2388,18 @@ "symfony/dependency-injection": ">=2,<2.0.17", "symfony/form": ">=2.3,<2.3.35|>=2.4,<2.6.12|>=2.7,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", "symfony/framework-bundle": ">=2,<2.3.18|>=2.4,<2.4.8|>=2.5,<2.5.2", - "symfony/http-foundation": ">=2,<2.3.27|>=2.4,<2.5.11|>=2.6,<2.6.6", + "symfony/http-foundation": ">=2,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", "symfony/http-kernel": ">=2,<2.3.29|>=2.4,<2.5.12|>=2.6,<2.6.8", "symfony/intl": ">=2.7,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", "symfony/routing": ">=2,<2.0.19", - "symfony/security": ">=2,<2.0.25|>=2.1,<2.1.13|>=2.2,<2.2.9|>=2.3,<2.3.37|>=2.4,<2.6.13|>=2.7,<2.7.9|>=2.7.30,<2.7.32|>=2.8.23,<2.8.25|>=3.2.10,<3.2.12|>=3.3.3,<3.3.5", - "symfony/security-core": ">=2.4,<2.6.13|>=2.7,<2.7.9|>=2.7.30,<2.7.32|>=2.8,<2.8.6|>=2.8.23,<2.8.25|>=3,<3.0.6|>=3.2.10,<3.2.12|>=3.3.3,<3.3.5", - "symfony/security-csrf": ">=2.7,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", - "symfony/security-http": ">=2.3,<2.3.41|>=2.4,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", + "symfony/security": ">=2,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", + "symfony/security-bundle": ">=2,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", + "symfony/security-core": ">=2.4,<2.6.13|>=2.7,<2.7.9|>=2.7.30,<2.7.32|>=2.8,<2.8.37|>=3,<3.3.17|>=3.4,<3.4.7|>=4,<4.0.7", + "symfony/security-csrf": ">=2.4,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", + "symfony/security-guard": ">=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", + "symfony/security-http": ">=2.3,<2.3.41|>=2.4,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", "symfony/serializer": ">=2,<2.0.11", - "symfony/symfony": ">=2,<2.3.41|>=2.4,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", + "symfony/symfony": ">=2,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", "symfony/translation": ">=2,<2.0.17", "symfony/validator": ">=2,<2.0.24|>=2.1,<2.1.12|>=2.2,<2.2.5|>=2.3,<2.3.3", "symfony/web-profiler-bundle": ">=2,<2.3.19|>=2.4,<2.4.9|>=2.5,<2.5.4", @@ -2298,68 +2457,41 @@ } ], "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", - "time": "2018-05-11T06:55:15+00:00" + "time": "2018-06-08T09:55:50+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "2.9.1", + "version": "3.3.0", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62" + "reference": "d86873af43b4aa9d1f39a3601cc0cfcf02b25266" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/dcbed1074f8244661eecddfc2a675430d8d33f62", - "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/d86873af43b4aa9d1f39a3601cc0cfcf02b25266", + "reference": "d86873af43b4aa9d1f39a3601cc0cfcf02b25266", "shasum": "" }, "require": { "ext-simplexml": "*", "ext-tokenizer": "*", "ext-xmlwriter": "*", - "php": ">=5.1.2" + "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, "bin": [ - "scripts/phpcs", - "scripts/phpcbf" + "bin/phpcs", + "bin/phpcbf" ], "type": "library", "extra": { "branch-alias": { - "dev-master": "2.x-dev" + "dev-master": "3.x-dev" } }, - "autoload": { - "classmap": [ - "CodeSniffer.php", - "CodeSniffer/CLI.php", - "CodeSniffer/Exception.php", - "CodeSniffer/File.php", - "CodeSniffer/Fixer.php", - "CodeSniffer/Report.php", - "CodeSniffer/Reporting.php", - "CodeSniffer/Sniff.php", - "CodeSniffer/Tokens.php", - "CodeSniffer/Reports/", - "CodeSniffer/Tokenizers/", - "CodeSniffer/DocGenerators/", - "CodeSniffer/Standards/AbstractPatternSniff.php", - "CodeSniffer/Standards/AbstractScopeSniff.php", - "CodeSniffer/Standards/AbstractVariableSniff.php", - "CodeSniffer/Standards/IncorrectPatternException.php", - "CodeSniffer/Standards/Generic/Sniffs/", - "CodeSniffer/Standards/MySource/Sniffs/", - "CodeSniffer/Standards/PEAR/Sniffs/", - "CodeSniffer/Standards/PSR1/Sniffs/", - "CodeSniffer/Standards/PSR2/Sniffs/", - "CodeSniffer/Standards/Squiz/Sniffs/", - "CodeSniffer/Standards/Zend/Sniffs/" - ] - }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" @@ -2376,7 +2508,7 @@ "phpcs", "standards" ], - "time": "2017-05-22T02:43:20+00:00" + "time": "2018-06-06T23:58:19+00:00" }, { "name": "wimg/php-compatibility", @@ -2485,6 +2617,6 @@ }, "platform-dev": [], "platform-overrides": { - "php": "5.3.29" + "php": "7.1" } } From da0fcf9db50474a2d24d5ed6f33a63b565e09955 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Mon, 11 Jun 2018 11:59:18 +0530 Subject: [PATCH 0151/1044] Update loading sequence for show argument errors in runner --- php/bootstrap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/bootstrap.php b/php/bootstrap.php index 65ddb4ed4..195efd818 100644 --- a/php/bootstrap.php +++ b/php/bootstrap.php @@ -19,9 +19,9 @@ function get_bootstrap_steps() { 'EE\Bootstrap\DeclareMainClass', 'EE\Bootstrap\DeclareAbstractBaseCommand', 'EE\Bootstrap\IncludeFrameworkAutoloader', - 'EE\Bootstrap\ConfigureRunner', 'EE\Bootstrap\InitializeColorization', 'EE\Bootstrap\InitializeLogger', + 'EE\Bootstrap\ConfigureRunner', 'EE\Bootstrap\DefineProtectedCommands', 'EE\Bootstrap\LoadRequiredCommand', 'EE\Bootstrap\IncludePackageAutoloader', From a651dd6de203e62ad1084171a4eecd02d2410924 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Mon, 11 Jun 2018 12:00:05 +0530 Subject: [PATCH 0152/1044] Add glogal locale flag --- php/config-spec.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/php/config-spec.php b/php/config-spec.php index 925894ef1..39951fcb8 100644 --- a/php/config-spec.php +++ b/php/config-spec.php @@ -46,11 +46,11 @@ 'desc' => 'Absolute path to where all sites will be stored.', ), - 'db_path' => array( - 'runtime' => '=<path>', - 'file' => '<path>', + 'locale' => array( + 'runtime' => '=<locale>', + 'file' => '<locale>', 'default' => null, - 'desc' => 'Absolute path to where site configuration db is stored.', + 'desc' => 'Locale for WordPress.', ), 'ee_installer_version' => array( From c62ad88913a33f0f1e4b882321d07a8c65b30b37 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Mon, 11 Jun 2018 12:01:04 +0530 Subject: [PATCH 0153/1044] Add args backward compatibilty and error msgs --- php/EE/Runner.php | 41 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 98c124046..bf09b9070 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -535,10 +535,45 @@ public function init_config() { list( $args, $assoc_args, $this->runtime_config ) = $configurator->parse_args( $argv ); // foo --help -> help foo - if ( isset( $assoc_args['help'] ) && ! in_array( 'wp', $args ) ) { - array_unshift( $args, 'help' ); - unset( $assoc_args['help'] ); + if ( isset( $assoc_args['help'] ) && ! in_array( 'wp', $args ) ) { + array_unshift( $args, 'help' ); + unset( $assoc_args['help'] ); + } + + if ( isset( $assoc_args['version'] ) ) { + array_unshift( $args, 'version' ); + array_unshift( $args, 'cli' ); + unset( $assoc_args['version'] ); } + + // ee3 backward compatibility to wp-cli flags + $wp_compat_array_map = array( + 'user' => 'admin_user', + 'pass' => 'admin_pass', + 'email' => 'admin_email' + ); + + foreach ( $wp_compat_array_map as $from => $to ) { + if ( isset( $assoc_args[$from] ) ) { + $assoc_args[$to] = $assoc_args[$from]; + unset( $assoc_args[$from] ); + } + } + + // backward compatibility message + $unsupported_create_old_args = array( + 'w3tc', + 'wpsc', + 'wpfc', + 'pagespeed', + ); + + $old_arg = array_intersect( $unsupported_create_old_args, array_keys( $assoc_args ) ); + + $old_args = implode(' --',$old_arg); + if ( isset($args[1]) && 'create' === $args[1] && ! empty ($old_arg) ) { + \EE::error( "Sorry, --$old_args flag/s is/are no longer supported in EE v4.\nPlease run `ee help " . implode( ' ', $args ) . '`.' ); + } list( $this->arguments, $this->assoc_args ) = [ $args, $assoc_args ]; From 4c963214a88c6a4381949df3fae4f541b22e2308 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Mon, 11 Jun 2018 12:21:34 +0530 Subject: [PATCH 0154/1044] Add auto-site name detect util functions --- php/utils.php | 339 ++++++++++++++++++++++++++++++++------------------ 1 file changed, 220 insertions(+), 119 deletions(-) diff --git a/php/utils.php b/php/utils.php index e6e4b1608..762081e5b 100644 --- a/php/utils.php +++ b/php/utils.php @@ -29,7 +29,7 @@ function extract_from_phar( $path ) { copy( $path, $tmp_path ); register_shutdown_function( - function() use ( $tmp_path ) { + function () use ( $tmp_path ) { if ( file_exists( $tmp_path ) ) { unlink( $tmp_path ); } @@ -46,6 +46,7 @@ function load_dependencies() { } elseif ( file_exists( dirname( dirname( EE_ROOT ) ) . '/autoload.php' ) ) { require dirname( dirname( EE_ROOT ) ) . '/autoload.php'; } + return; } @@ -66,7 +67,7 @@ function load_dependencies() { } function get_vendor_paths() { - $vendor_paths = array( + $vendor_paths = array( EE_ROOT . '/../../../vendor', // part of a larger project / installed via Composer (preferred) EE_ROOT . '/vendor', // top-level project / installed as Git clone ); @@ -77,6 +78,7 @@ function get_vendor_paths() { array_unshift( $vendor_paths, EE_ROOT . '/../../../' . $composer->config->{'vendor-dir'} ); } } + return $vendor_paths; } @@ -110,6 +112,7 @@ function load_command( $name ) { * * @param array|object Either a plain array or another iterator * @param callback The function to apply to an element + * * @return object An iterator that applies the given callback(s) */ function iterator_map( $it, $fn ) { @@ -130,9 +133,11 @@ function iterator_map( $it, $fn ) { /** * Search for file by walking up the directory tree until the first file is found or until $stop_check($dir) returns true + * * @param string|array The files (or file) to search for * @param string|null The directory to start searching from; defaults to CWD * @param callable Function which is passed the current dir each time a directory level is traversed + * * @return null|string Null if the file was not found */ function find_file_upward( $files, $dir = null, $stop_check = null ) { @@ -159,6 +164,7 @@ function find_file_upward( $files, $dir = null, $stop_check = null ) { } $dir = $parent_dir; } + return null; } @@ -175,6 +181,7 @@ function is_path_absolute( $path ) { * Composes positional arguments into a command string. * * @param array + * * @return string */ function args_to_str( $args ) { @@ -185,6 +192,7 @@ function args_to_str( $args ) { * Composes associative arguments into a command string. * * @param array + * * @return string */ function assoc_args_to_str( $assoc_args ) { @@ -262,17 +270,18 @@ function esc_cmd( $cmd ) { * # value: bar * ``` * - * @access public + * @access public * @category Output * - * @param string $format Format to use: 'table', 'json', 'csv', 'yaml', 'ids', 'count' - * @param array $items An array of items to output. - * @param array|string $fields Named fields for each item of data. Can be array or comma-separated list. + * @param string $format Format to use: 'table', 'json', 'csv', 'yaml', 'ids', 'count' + * @param array $items An array of items to output. + * @param array|string $fields Named fields for each item of data. Can be array or comma-separated list. + * * @return null */ function format_items( $format, $items, $fields ) { $assoc_args = compact( 'format', 'fields' ); - $formatter = new \EE\Formatter( $assoc_args ); + $formatter = new \EE\Formatter( $assoc_args ); $formatter->display_items( $items ); } @@ -281,9 +290,9 @@ function format_items( $format, $items, $fields ) { * * @access public * - * @param resource $fd File descriptor - * @param array $rows Array of rows to output - * @param array $headers List of CSV columns (optional) + * @param resource $fd File descriptor + * @param array $rows Array of rows to output + * @param array $headers List of CSV columns (optional) */ function write_csv( $fd, $rows, $headers = array() ) { if ( ! empty( $headers ) ) { @@ -304,6 +313,7 @@ function write_csv( $fd, $rows, $headers = array() ) { * * @param array|object Associative array or object to pick fields from * @param array List of fields to pick + * * @return array */ function pick_fields( $item, $fields ) { @@ -312,7 +322,7 @@ function pick_fields( $item, $fields ) { $values = array(); foreach ( $fields as $field ) { - $values[ $field ] = isset( $item->$field ) ? $item->$field : null; + $values[$field] = isset( $item->$field ) ? $item->$field : null; } return $values; @@ -321,10 +331,11 @@ function pick_fields( $item, $fields ) { /** * Launch system's $EDITOR for the user to edit some text. * - * @access public + * @access public * @category Input * - * @param string $content Some form of text to edit (e.g. post content) + * @param string $content Some form of text to edit (e.g. post content) + * * @return string|bool Edited text, if file is saved from editor; false, if no change to file. */ function launch_editor_for_input( $input, $filename = 'EE' ) { @@ -338,7 +349,7 @@ function launch_editor_for_input( $input, $filename = 'EE' ) { $tmpfile = preg_replace( '|\.[^.]*$|', '', $tmpfile ); $tmpfile .= '-' . substr( md5( mt_rand() ), 0, 6 ); $tmpfile = $tmpdir . $tmpfile . '.tmp'; - $fp = fopen( $tmpfile, 'xb' ); + $fp = fopen( $tmpfile, 'xb' ); if ( ! $fp && is_writable( $tmpdir ) && file_exists( $tmpfile ) ) { $tmpfile = ''; continue; @@ -361,8 +372,8 @@ function launch_editor_for_input( $input, $filename = 'EE' ) { } $descriptorspec = array( STDIN, STDOUT, STDERR ); - $process = proc_open_compat( "$editor " . escapeshellarg( $tmpfile ), $descriptorspec, $pipes ); - $r = proc_close( $process ); + $process = proc_open_compat( "$editor " . escapeshellarg( $tmpfile ), $descriptorspec, $pipes ); + $r = proc_close( $process ); if ( $r ) { exit( $r ); } @@ -393,7 +404,8 @@ function mustache_render( $template_name, $data = array() ) { $m = new \Mustache_Engine( array( 'escape' => function ( $val ) { - return $val; }, + return $val; + }, ) ); @@ -407,12 +419,13 @@ function mustache_render( $template_name, $data = array() ) { * advances with `$progress->tick()`, and completes with `$progress->finish()`. * Process bar also indicates elapsed time and expected total time. * - * @access public + * @access public * @category Output * * @param string $message Text to display before the progress bar. * @param integer $count Total number of ticks to be performed. * @param int $interval Optional. The interval in milliseconds between updates. Default 100. + * * @return cli\progress\Bar|EE\NoOp */ function make_progress_bar( $message, $count, $interval = 100 ) { @@ -446,7 +459,7 @@ function is_windows() { * Replace magic constants in some PHP source code. * * @param string $source The PHP code to manipulate. - * @param string $path The path to use instead of the magic constants + * @param string $path The path to use instead of the magic constants */ function replace_path_consts( $source, $path ) { $replacements = array( @@ -467,15 +480,16 @@ function replace_path_consts( $source, $path ) { * * @access public * - * @param string $method HTTP method (GET, POST, DELETE, etc.) - * @param string $url URL to make the HTTP request to. - * @param array $headers Add specific headers to the request. - * @param array $options + * @param string $method HTTP method (GET, POST, DELETE, etc.) + * @param string $url URL to make the HTTP request to. + * @param array $headers Add specific headers to the request. + * @param array $options + * * @return object */ function http_request( $method, $url, $data = null, $headers = array(), $options = array() ) { - $cert_path = '/rmccue/requests/library/Requests/Transport/cacert.pem'; + $cert_path = '/rmccue/requests/library/Requests/Transport/cacert.pem'; $halt_on_error = ! isset( $options['halt_on_error'] ) || (bool) $options['halt_on_error']; if ( inside_phar() ) { // cURL can't read Phar archives @@ -500,7 +514,8 @@ function http_request( $method, $url, $data = null, $headers = array(), $options try { return \Requests::request( $url, $headers, $data, $method, $options ); - } catch ( \Requests_Exception $ex ) { + } + catch ( \Requests_Exception $ex ) { // CURLE_SSL_CACERT_BADFILE only defined for PHP >= 7. if ( 'curlerror' !== $ex->getType() || ! in_array( curl_errno( $ex->getData() ), array( CURLE_SSL_CONNECT_ERROR, CURLE_SSL_CERTPROBLEM, 77 /*CURLE_SSL_CACERT_BADFILE*/ ), true ) ) { $error_msg = sprintf( "Failed to get url '%s': %s.", $url, $ex->getMessage() ); @@ -514,7 +529,8 @@ function http_request( $method, $url, $data = null, $headers = array(), $options $options['verify'] = false; try { return \Requests::request( $url, $headers, $data, $method, $options ); - } catch ( \Requests_Exception $ex ) { + } + catch ( \Requests_Exception $ex ) { $error_msg = sprintf( "Failed to get non-verified url '%s' %s.", $url, $ex->getMessage() ); if ( $halt_on_error ) { EE::error( $error_msg ); @@ -533,6 +549,7 @@ function http_request( $method, $url, $data = null, $headers = array(), $options * * @param string $current_version * @param string $new_version + * * @return string */ function increment_version( $current_version, $new_version ) { @@ -546,20 +563,20 @@ function increment_version( $current_version, $new_version ) { break; case 'patch': - $current_version[0][2]++; + $current_version[0][2] ++; $current_version = array( $current_version[0] ); // drop possible pre-release info break; case 'minor': - $current_version[0][1]++; + $current_version[0][1] ++; $current_version[0][2] = 0; $current_version = array( $current_version[0] ); // drop possible pre-release info break; case 'major': - $current_version[0][0]++; + $current_version[0][0] ++; $current_version[0][1] = 0; $current_version[0][2] = 0; @@ -585,6 +602,7 @@ function increment_version( $current_version, $new_version ) { * * @param string $new_version * @param string $original_version + * * @return string $name 'major', 'minor', 'patch' */ function get_named_sem_ver( $new_version, $original_version ) { @@ -594,7 +612,7 @@ function get_named_sem_ver( $new_version, $original_version ) { } $parts = explode( '-', $original_version ); - $bits = explode( '.', $parts[0] ); + $bits = explode( '.', $parts[0] ); $major = $bits[0]; if ( isset( $bits[1] ) ) { $minor = $bits[1]; @@ -621,22 +639,23 @@ function get_named_sem_ver( $new_version, $original_version ) { * function provides a safer alternative to using * `isset( $assoc_args['quiet'] )` or similar. * - * @access public + * @access public * @category Input * - * @param array $assoc_args Arguments array. - * @param string $flag Flag to get the value. - * @param mixed $default Default value for the flag. Default: NULL + * @param array $assoc_args Arguments array. + * @param string $flag Flag to get the value. + * @param mixed $default Default value for the flag. Default: NULL + * * @return mixed */ function get_flag_value( $assoc_args, $flag, $default = null ) { - return isset( $assoc_args[ $flag ] ) ? $assoc_args[ $flag ] : $default; + return isset( $assoc_args[$flag] ) ? $assoc_args[$flag] : $default; } /** * Get the home directory. * - * @access public + * @access public * @category System * * @return string @@ -654,10 +673,11 @@ function get_home_dir() { /** * Appends a trailing slash. * - * @access public + * @access public * @category System * * @param string $string What to add the trailing slash to. + * * @return string String with trailing slash added. */ function trailingslashit( $string ) { @@ -668,6 +688,7 @@ function trailingslashit( $string ) { * Convert Windows EOLs to *nix. * * @param string $str String to convert. + * * @return string String with carriage return / newline pairs reduced to newlines. */ function normalize_eols( $str ) { @@ -677,7 +698,7 @@ function normalize_eols( $str ) { /** * Get the system's temp directory. Warns user if it isn't writable. * - * @access public + * @access public * @category System * * @return string @@ -712,18 +733,20 @@ function get_temp_dir() { * * @return mixed */ -function parse_ssh_url( $url, $component = -1 ) { +function parse_ssh_url( $url, $component = - 1 ) { preg_match( '#^((docker|docker\-compose|ssh|vagrant):)?(([^@:]+)@)?([^:/~]+)(:([\d]*))?((/|~)(.+))?$#', $url, $matches ); $bits = array(); - foreach ( array( - 2 => 'scheme', - 4 => 'user', - 5 => 'host', - 7 => 'port', - 8 => 'path', - ) as $i => $key ) { - if ( ! empty( $matches[ $i ] ) ) { - $bits[ $key ] = $matches[ $i ]; + foreach ( + array( + 2 => 'scheme', + 4 => 'user', + 5 => 'host', + 7 => 'port', + 8 => 'path', + ) as $i => $key + ) { + if ( ! empty( $matches[$i] ) ) { + $bits[$key] = $matches[$i]; } } @@ -757,7 +780,7 @@ function parse_ssh_url( $url, $component = -1 ) { /** * Report the results of the same operation against multiple resources. * - * @access public + * @access public * @category Input * * @param string $noun Resource being affected (e.g. plugin) @@ -768,8 +791,8 @@ function parse_ssh_url( $url, $component = -1 ) { * @param null|integer $skips Optional. Number of skipped operations. Default null (don't show skips). */ function report_batch_operation_results( $noun, $verb, $total, $successes, $failures, $skips = null ) { - $plural_noun = $noun . 's'; - $past_tense_verb = past_tense_verb( $verb ); + $plural_noun = $noun . 's'; + $past_tense_verb = past_tense_verb( $verb ); $past_tense_verb_upper = ucfirst( $past_tense_verb ); if ( $failures ) { $failed_skipped_message = null === $skips ? '' : " ({$failures} failed" . ( $skips ? ", {$skips} skipped" : '' ) . ')'; @@ -792,26 +815,29 @@ function report_batch_operation_results( $noun, $verb, $total, $successes, $fail /** * Parse a string of command line arguments into an $argv-esqe variable. * - * @access public + * @access public * @category Input * * @param string $arguments + * * @return array */ function parse_str_to_argv( $arguments ) { preg_match_all( '/(?<=^|\s)([\'"]?)(.+?)(?<!\\\\)\1(?=$|\s)/', $arguments, $matches ); $argv = isset( $matches[0] ) ? $matches[0] : array(); $argv = array_map( - function( $arg ) { + function ( $arg ) { foreach ( array( '"', "'" ) as $char ) { - if ( substr( $arg, 0, 1 ) === $char && substr( $arg, -1 ) === $char ) { - $arg = substr( $arg, 1, -1 ); + if ( substr( $arg, 0, 1 ) === $char && substr( $arg, - 1 ) === $char ) { + $arg = substr( $arg, 1, - 1 ); break; } } - return $arg; + + return $arg; }, $argv ); + return $argv; } @@ -822,6 +848,7 @@ function( $arg ) { * * @param string $path * @param string $suffix + * * @return string */ function basename( $path, $suffix = '' ) { @@ -852,7 +879,7 @@ function isPiped() { return filter_var( $shellPipe, FILTER_VALIDATE_BOOLEAN ); } - return (function_exists( 'posix_isatty' ) && ! posix_isatty( STDOUT )); + return ( function_exists( 'posix_isatty' ) && ! posix_isatty( STDOUT ) ); } /** @@ -900,8 +927,8 @@ function expand_globs( $paths, $flags = 'default' ) { * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * - * @param string $pattern Filename pattern. - * @param void $dummy_flags Not used. + * @param string $pattern Filename pattern. + * @param void $dummy_flags Not used. * * @return array Array of paths. */ @@ -911,22 +938,22 @@ function glob_brace( $pattern, $dummy_flags = null ) { if ( ! $next_brace_sub ) { // Find the end of the subpattern in a brace expression. $next_brace_sub = function ( $pattern, $current ) { - $length = strlen( $pattern ); - $depth = 0; + $length = strlen( $pattern ); + $depth = 0; while ( $current < $length ) { - if ( '\\' === $pattern[ $current ] ) { - if ( ++$current === $length ) { + if ( '\\' === $pattern[$current] ) { + if ( ++ $current === $length ) { break; } - $current++; + $current ++; } else { - if ( ( '}' === $pattern[ $current ] && 0 === $depth-- ) || ( ',' === $pattern[ $current ] && 0 === $depth ) ) { + if ( ( '}' === $pattern[$current] && 0 === $depth -- ) || ( ',' === $pattern[$current] && 0 === $depth ) ) { break; } - if ( '{' === $pattern[ $current++ ] ) { - $depth++; + if ( '{' === $pattern[$current ++] ) { + $depth ++; } } } @@ -938,10 +965,10 @@ function glob_brace( $pattern, $dummy_flags = null ) { $length = strlen( $pattern ); // Find first opening brace. - for ( $begin = 0; $begin < $length; $begin++ ) { - if ( '\\' === $pattern[ $begin ] ) { - $begin++; - } elseif ( '{' === $pattern[ $begin ] ) { + for ( $begin = 0; $begin < $length; $begin ++ ) { + if ( '\\' === $pattern[$begin] ) { + $begin ++; + } elseif ( '{' === $pattern[$begin] ) { break; } } @@ -954,26 +981,26 @@ function glob_brace( $pattern, $dummy_flags = null ) { $rest = $next; // Point `$rest` to matching closing brace. - while ( '}' !== $pattern[ $rest ] ) { + while ( '}' !== $pattern[$rest] ) { if ( null === ( $rest = $next_brace_sub( $pattern, $rest + 1 ) ) ) { return glob( $pattern ); } } $paths = array(); - $p = $begin + 1; + $p = $begin + 1; // For each comma-separated subpattern. do { $subpattern = substr( $pattern, 0, $begin ) - . substr( $pattern, $p, $next - $p ) - . substr( $pattern, $rest + 1 ); + . substr( $pattern, $p, $next - $p ) + . substr( $pattern, $rest + 1 ); if ( $result = glob_brace( $subpattern ) ) { $paths = array_merge( $paths, $result ); } - if ( '}' === $pattern[ $next ] ) { + if ( '}' === $pattern[$next] ) { break; } @@ -1003,38 +1030,38 @@ function glob_brace( $pattern, $dummy_flags = null ) { function get_suggestion( $target, array $options, $threshold = 2 ) { $suggestion_map = array( - 'add' => 'create', - 'check' => 'check-update', + 'add' => 'create', + 'check' => 'check-update', 'capability' => 'cap', - 'clear' => 'flush', - 'decrement' => 'decr', - 'del' => 'delete', - 'directory' => 'dir', - 'exec' => 'eval', - 'exec-file' => 'eval-file', - 'increment' => 'incr', - 'language' => 'locale', - 'lang' => 'locale', - 'new' => 'create', - 'number' => 'count', - 'remove' => 'delete', - 'regen' => 'regenerate', - 'rep' => 'replace', - 'repl' => 'replace', - 'trash' => 'delete', - 'v' => 'version', + 'clear' => 'flush', + 'decrement' => 'decr', + 'del' => 'delete', + 'directory' => 'dir', + 'exec' => 'eval', + 'exec-file' => 'eval-file', + 'increment' => 'incr', + 'language' => 'locale', + 'lang' => 'locale', + 'new' => 'create', + 'number' => 'count', + 'remove' => 'delete', + 'regen' => 'regenerate', + 'rep' => 'replace', + 'repl' => 'replace', + 'trash' => 'delete', + 'v' => 'version', ); - if ( array_key_exists( $target, $suggestion_map ) && in_array( $suggestion_map[ $target ], $options, true ) ) { - return $suggestion_map[ $target ]; + if ( array_key_exists( $target, $suggestion_map ) && in_array( $suggestion_map[$target], $options, true ) ) { + return $suggestion_map[$target]; } if ( empty( $options ) ) { return ''; } foreach ( $options as $option ) { - $distance = levenshtein( $option, $target ); - $levenshtein[ $option ] = $distance; + $distance = levenshtein( $option, $target ); + $levenshtein[$option] = $distance; } // Sort known command strings by distance to user entry. @@ -1045,7 +1072,7 @@ function get_suggestion( $target, array $options, $threshold = 2 ) { $suggestion = key( $levenshtein ); // Only return a suggestion if below a given threshold. - return $levenshtein[ $suggestion ] <= $threshold && $suggestion !== $target + return $levenshtein[$suggestion] <= $threshold && $suggestion !== $target ? (string) $suggestion : ''; } @@ -1090,7 +1117,7 @@ function is_bundled_command( $command ) { static $classes; if ( null === $classes ) { - $classes = array(); + $classes = array(); $class_map = EE_VENDOR_DIR . '/composer/autoload_commands_classmap.php'; if ( file_exists( EE_VENDOR_DIR . '/composer/' ) ) { $classes = include $class_map; @@ -1115,7 +1142,7 @@ function is_bundled_command( $command ) { * @return string */ function force_env_on_nix_systems( $command ) { - $env_prefix = '/usr/bin/env '; + $env_prefix = '/usr/bin/env '; $env_prefix_len = strlen( $env_prefix ); if ( is_windows() ) { if ( 0 === strncmp( $command, $env_prefix, $env_prefix_len ) ) { @@ -1126,6 +1153,7 @@ function force_env_on_nix_systems( $command ) { $command = $env_prefix . $command; } } + return $command; } @@ -1149,6 +1177,7 @@ function check_proc_available( $context = null, $return = false ) { EE::error( $msg ); } } + return true; } @@ -1163,18 +1192,19 @@ function past_tense_verb( $verb ) { static $irregular = array( 'reset' => 'reset', ); - if ( isset( $irregular[ $verb ] ) ) { - return $irregular[ $verb ]; + if ( isset( $irregular[$verb] ) ) { + return $irregular[$verb]; } - $last = substr( $verb, -1 ); + $last = substr( $verb, - 1 ); if ( 'e' === $last ) { - $verb = substr( $verb, 0, -1 ); + $verb = substr( $verb, 0, - 1 ); } elseif ( 'y' === $last && ! preg_match( '/[aeiou]y$/', $verb ) ) { - $verb = substr( $verb, 0, -1 ) . 'i'; + $verb = substr( $verb, 0, - 1 ) . 'i'; } elseif ( preg_match( '/^[^aeiou]*[aeiou][^aeiouhwxy]$/', $verb ) ) { // Rule of thumb that most (all?) one-voweled regular verbs ending in vowel + consonant (excluding "h", "w", "x", "y") double their final consonant - misses many cases (eg "submit"). $verb .= $last; } + return $verb . 'ed'; } @@ -1183,7 +1213,7 @@ function past_tense_verb( $verb ) { * * Environment values permit specific binaries to be indicated. * - * @access public + * @access public * @category System * * @return string @@ -1221,12 +1251,12 @@ function get_php_binary() { * * @access public * - * @param string $command Command to execute. - * @param array $descriptorspec Indexed array of descriptor numbers and their values. - * @param array &$pipes Indexed array of file pointers that correspond to PHP's end of any pipes that are created. - * @param string $cwd Initial working directory for the command. - * @param array $env Array of environment variables. - * @param array $other_options Array of additional options (Windows only). + * @param string $command Command to execute. + * @param array $descriptorspec Indexed array of descriptor numbers and their values. + * @param array &$pipes Indexed array of file pointers that correspond to PHP's end of any pipes that are created. + * @param string $cwd Initial working directory for the command. + * @param array $env Array of environment variables. + * @param array $other_options Array of additional options (Windows only). * * @return string Command stripped of any environment variable settings. */ @@ -1235,6 +1265,7 @@ function proc_open_compat( $cmd, $descriptorspec, &$pipes, $cwd = null, $env = n // Need to encompass the whole command in double quotes - PHP bug https://bugs.php.net/bug.php?id=49139 $cmd = '"' . _proc_open_compat_win_env( $cmd, $env ) . '"'; } + return proc_open( $cmd, $descriptorspec, $pipes, $cwd, $env, $other_options ); } @@ -1245,7 +1276,7 @@ function proc_open_compat( $cmd, $descriptorspec, &$pipes, $cwd = null, $env = n * @access private * * @param string $command Command to execute. - * @param array &$env Array of existing environment variables. Will be modified if any settings in command. + * @param array &$env Array of existing environment variables. Will be modified if any settings in command. * * @return string Command stripped of any environment variable settings. */ @@ -1256,9 +1287,10 @@ function _proc_open_compat_win_env( $cmd, &$env ) { if ( null === $env ) { $env = array(); } - $env[ $matches[1] ] = isset( $matches[2][0] ) && '"' === $matches[2][0] ? substr( $matches[2], 1, -1 ) : $matches[2]; + $env[$matches[1]] = isset( $matches[2][0] ) && '"' === $matches[2][0] ? substr( $matches[2], 1, - 1 ) : $matches[2]; } } + return $cmd; } @@ -1300,8 +1332,8 @@ function parse_shell_arrays( $assoc_args, $array_arguments ) { } foreach ( $array_arguments as $key ) { - if ( array_key_exists( $key, $assoc_args ) && is_json( $assoc_args[ $key ] ) ) { - $assoc_args[ $key ] = json_decode( $assoc_args[ $key ], $assoc = true ); + if ( array_key_exists( $key, $assoc_args ) && is_json( $assoc_args[$key] ) ) { + $assoc_args[$key] = json_decode( $assoc_args[$key], $assoc = true ); } } @@ -1434,6 +1466,7 @@ function default_launch( $command ) { if ( ! $launch->return_code ) { return true; } + return false; } @@ -1490,7 +1523,6 @@ function get_type( $assoc_args, $arg_types, $default = false ) { * * @param array $items An array of items to output. * - * @return null */ function format_table( $items ) { $item_table = new \cli\Table(); @@ -1505,3 +1537,72 @@ function format_table( $items ) { } \EE::log( $delem ); } + +/** + * Get the site-name from the path from where ee is running if it is a valid site path. + * + * @return bool|String Name of the site or false in failure. + */ +function get_site_name() { + $sites = EE::db()::select( array( 'sitename' ) ); + + if ( $sites ) { + $cwd = getcwd(); + $name_in_path = explode( '/', $cwd ); + $site_name = array_intersect( array_flatten( $sites ), $name_in_path ); + + if ( 1 === count( $site_name ) ) { + $path = EE::db()::select( array( 'site_path' ), array( 'sitename' => $site_name[0] ) ); + if ( $path ) { + $site_path = $path[0]['site_path']; + if ( $site_path === substr( $cwd, 0, strlen( $site_path ) ) ) { + return $site_name[0]; + } + } + } + } + + return false; +} + +/** + * Function to set the site-name in the args when ee is running in a site folder and the site-name has not been passed in the args. If the site-name could not be found it will throw an error. + * + * @param array $args The passed arguments. + * @param String $command The command passing the arguments to aut=detect site-name. + * + * @return array Arguments with site-name set. + */ +function set_site_arg( $args, $command ) { + if ( isset( $args[0] ) ) { + if ( EE::db()::site_in_db( $args[0] ) ) { + return $args; + } + } + $site_name = get_site_name(); + if ( $site_name ) { + array_unshift( $args, $site_name ); + } else { + EE::error( "Could not find the site you wish to run $command command on.\nEither pass it as an argument: `ee $command <site-name>` \nor run `ee $command` from inside the site folder." ); + } + + return $args; +} + +/** + * Function to flatten a multi-dimensional array. + * + * @param array $array Mulit-dimensional input array. + * + * @return array Resultant flattened array. + */ +function array_flatten( array $array ) { + $return = array(); + array_walk_recursive( + $array, function ( $a ) use ( &$return ) { + $return[] = $a; + } + ); + + return $return; +} From 26e2ad28bfbca1527c83562b7614bcd5006fb28d Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Mon, 11 Jun 2018 12:59:19 +0530 Subject: [PATCH 0155/1044] Add default locale in config file --- php/EE/Runner.php | 1 + 1 file changed, 1 insertion(+) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index bf09b9070..1825fc485 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -57,6 +57,7 @@ private function init_ee() { } $this->ensure_present_in_config( 'sites_path', Utils\get_home_dir(). '/ee-sites' ); + $this->ensure_present_in_config( 'locale', 'en_US' ); $this->ensure_present_in_config( 'ee_installer_version', 'stable' ); if ( ! is_dir( $this->config['sites_path'] ) ) { From f76250c48e567eb9008574093487e7f10f8b2c3a Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Mon, 11 Jun 2018 13:03:59 +0530 Subject: [PATCH 0156/1044] Revert back phpcbf in whole file --- php/utils.php | 269 ++++++++++++++++++++++---------------------------- 1 file changed, 118 insertions(+), 151 deletions(-) diff --git a/php/utils.php b/php/utils.php index 762081e5b..2eef7ef13 100644 --- a/php/utils.php +++ b/php/utils.php @@ -29,7 +29,7 @@ function extract_from_phar( $path ) { copy( $path, $tmp_path ); register_shutdown_function( - function () use ( $tmp_path ) { + function() use ( $tmp_path ) { if ( file_exists( $tmp_path ) ) { unlink( $tmp_path ); } @@ -46,7 +46,6 @@ function load_dependencies() { } elseif ( file_exists( dirname( dirname( EE_ROOT ) ) . '/autoload.php' ) ) { require dirname( dirname( EE_ROOT ) ) . '/autoload.php'; } - return; } @@ -67,7 +66,7 @@ function load_dependencies() { } function get_vendor_paths() { - $vendor_paths = array( + $vendor_paths = array( EE_ROOT . '/../../../vendor', // part of a larger project / installed via Composer (preferred) EE_ROOT . '/vendor', // top-level project / installed as Git clone ); @@ -78,7 +77,6 @@ function get_vendor_paths() { array_unshift( $vendor_paths, EE_ROOT . '/../../../' . $composer->config->{'vendor-dir'} ); } } - return $vendor_paths; } @@ -112,7 +110,6 @@ function load_command( $name ) { * * @param array|object Either a plain array or another iterator * @param callback The function to apply to an element - * * @return object An iterator that applies the given callback(s) */ function iterator_map( $it, $fn ) { @@ -133,11 +130,9 @@ function iterator_map( $it, $fn ) { /** * Search for file by walking up the directory tree until the first file is found or until $stop_check($dir) returns true - * * @param string|array The files (or file) to search for * @param string|null The directory to start searching from; defaults to CWD * @param callable Function which is passed the current dir each time a directory level is traversed - * * @return null|string Null if the file was not found */ function find_file_upward( $files, $dir = null, $stop_check = null ) { @@ -164,7 +159,6 @@ function find_file_upward( $files, $dir = null, $stop_check = null ) { } $dir = $parent_dir; } - return null; } @@ -181,7 +175,6 @@ function is_path_absolute( $path ) { * Composes positional arguments into a command string. * * @param array - * * @return string */ function args_to_str( $args ) { @@ -192,7 +185,6 @@ function args_to_str( $args ) { * Composes associative arguments into a command string. * * @param array - * * @return string */ function assoc_args_to_str( $assoc_args ) { @@ -270,18 +262,17 @@ function esc_cmd( $cmd ) { * # value: bar * ``` * - * @access public + * @access public * @category Output * - * @param string $format Format to use: 'table', 'json', 'csv', 'yaml', 'ids', 'count' - * @param array $items An array of items to output. - * @param array|string $fields Named fields for each item of data. Can be array or comma-separated list. - * + * @param string $format Format to use: 'table', 'json', 'csv', 'yaml', 'ids', 'count' + * @param array $items An array of items to output. + * @param array|string $fields Named fields for each item of data. Can be array or comma-separated list. * @return null */ function format_items( $format, $items, $fields ) { $assoc_args = compact( 'format', 'fields' ); - $formatter = new \EE\Formatter( $assoc_args ); + $formatter = new \EE\Formatter( $assoc_args ); $formatter->display_items( $items ); } @@ -290,9 +281,9 @@ function format_items( $format, $items, $fields ) { * * @access public * - * @param resource $fd File descriptor - * @param array $rows Array of rows to output - * @param array $headers List of CSV columns (optional) + * @param resource $fd File descriptor + * @param array $rows Array of rows to output + * @param array $headers List of CSV columns (optional) */ function write_csv( $fd, $rows, $headers = array() ) { if ( ! empty( $headers ) ) { @@ -313,7 +304,6 @@ function write_csv( $fd, $rows, $headers = array() ) { * * @param array|object Associative array or object to pick fields from * @param array List of fields to pick - * * @return array */ function pick_fields( $item, $fields ) { @@ -322,7 +312,7 @@ function pick_fields( $item, $fields ) { $values = array(); foreach ( $fields as $field ) { - $values[$field] = isset( $item->$field ) ? $item->$field : null; + $values[ $field ] = isset( $item->$field ) ? $item->$field : null; } return $values; @@ -331,11 +321,10 @@ function pick_fields( $item, $fields ) { /** * Launch system's $EDITOR for the user to edit some text. * - * @access public + * @access public * @category Input * - * @param string $content Some form of text to edit (e.g. post content) - * + * @param string $content Some form of text to edit (e.g. post content) * @return string|bool Edited text, if file is saved from editor; false, if no change to file. */ function launch_editor_for_input( $input, $filename = 'EE' ) { @@ -349,7 +338,7 @@ function launch_editor_for_input( $input, $filename = 'EE' ) { $tmpfile = preg_replace( '|\.[^.]*$|', '', $tmpfile ); $tmpfile .= '-' . substr( md5( mt_rand() ), 0, 6 ); $tmpfile = $tmpdir . $tmpfile . '.tmp'; - $fp = fopen( $tmpfile, 'xb' ); + $fp = fopen( $tmpfile, 'xb' ); if ( ! $fp && is_writable( $tmpdir ) && file_exists( $tmpfile ) ) { $tmpfile = ''; continue; @@ -372,8 +361,8 @@ function launch_editor_for_input( $input, $filename = 'EE' ) { } $descriptorspec = array( STDIN, STDOUT, STDERR ); - $process = proc_open_compat( "$editor " . escapeshellarg( $tmpfile ), $descriptorspec, $pipes ); - $r = proc_close( $process ); + $process = proc_open_compat( "$editor " . escapeshellarg( $tmpfile ), $descriptorspec, $pipes ); + $r = proc_close( $process ); if ( $r ) { exit( $r ); } @@ -404,8 +393,7 @@ function mustache_render( $template_name, $data = array() ) { $m = new \Mustache_Engine( array( 'escape' => function ( $val ) { - return $val; - }, + return $val; }, ) ); @@ -419,13 +407,12 @@ function mustache_render( $template_name, $data = array() ) { * advances with `$progress->tick()`, and completes with `$progress->finish()`. * Process bar also indicates elapsed time and expected total time. * - * @access public + * @access public * @category Output * * @param string $message Text to display before the progress bar. * @param integer $count Total number of ticks to be performed. * @param int $interval Optional. The interval in milliseconds between updates. Default 100. - * * @return cli\progress\Bar|EE\NoOp */ function make_progress_bar( $message, $count, $interval = 100 ) { @@ -459,7 +446,7 @@ function is_windows() { * Replace magic constants in some PHP source code. * * @param string $source The PHP code to manipulate. - * @param string $path The path to use instead of the magic constants + * @param string $path The path to use instead of the magic constants */ function replace_path_consts( $source, $path ) { $replacements = array( @@ -480,16 +467,15 @@ function replace_path_consts( $source, $path ) { * * @access public * - * @param string $method HTTP method (GET, POST, DELETE, etc.) - * @param string $url URL to make the HTTP request to. - * @param array $headers Add specific headers to the request. - * @param array $options - * + * @param string $method HTTP method (GET, POST, DELETE, etc.) + * @param string $url URL to make the HTTP request to. + * @param array $headers Add specific headers to the request. + * @param array $options * @return object */ function http_request( $method, $url, $data = null, $headers = array(), $options = array() ) { - $cert_path = '/rmccue/requests/library/Requests/Transport/cacert.pem'; + $cert_path = '/rmccue/requests/library/Requests/Transport/cacert.pem'; $halt_on_error = ! isset( $options['halt_on_error'] ) || (bool) $options['halt_on_error']; if ( inside_phar() ) { // cURL can't read Phar archives @@ -514,8 +500,7 @@ function http_request( $method, $url, $data = null, $headers = array(), $options try { return \Requests::request( $url, $headers, $data, $method, $options ); - } - catch ( \Requests_Exception $ex ) { + } catch ( \Requests_Exception $ex ) { // CURLE_SSL_CACERT_BADFILE only defined for PHP >= 7. if ( 'curlerror' !== $ex->getType() || ! in_array( curl_errno( $ex->getData() ), array( CURLE_SSL_CONNECT_ERROR, CURLE_SSL_CERTPROBLEM, 77 /*CURLE_SSL_CACERT_BADFILE*/ ), true ) ) { $error_msg = sprintf( "Failed to get url '%s': %s.", $url, $ex->getMessage() ); @@ -529,8 +514,7 @@ function http_request( $method, $url, $data = null, $headers = array(), $options $options['verify'] = false; try { return \Requests::request( $url, $headers, $data, $method, $options ); - } - catch ( \Requests_Exception $ex ) { + } catch ( \Requests_Exception $ex ) { $error_msg = sprintf( "Failed to get non-verified url '%s' %s.", $url, $ex->getMessage() ); if ( $halt_on_error ) { EE::error( $error_msg ); @@ -549,7 +533,6 @@ function http_request( $method, $url, $data = null, $headers = array(), $options * * @param string $current_version * @param string $new_version - * * @return string */ function increment_version( $current_version, $new_version ) { @@ -563,20 +546,20 @@ function increment_version( $current_version, $new_version ) { break; case 'patch': - $current_version[0][2] ++; + $current_version[0][2]++; $current_version = array( $current_version[0] ); // drop possible pre-release info break; case 'minor': - $current_version[0][1] ++; + $current_version[0][1]++; $current_version[0][2] = 0; $current_version = array( $current_version[0] ); // drop possible pre-release info break; case 'major': - $current_version[0][0] ++; + $current_version[0][0]++; $current_version[0][1] = 0; $current_version[0][2] = 0; @@ -602,7 +585,6 @@ function increment_version( $current_version, $new_version ) { * * @param string $new_version * @param string $original_version - * * @return string $name 'major', 'minor', 'patch' */ function get_named_sem_ver( $new_version, $original_version ) { @@ -612,7 +594,7 @@ function get_named_sem_ver( $new_version, $original_version ) { } $parts = explode( '-', $original_version ); - $bits = explode( '.', $parts[0] ); + $bits = explode( '.', $parts[0] ); $major = $bits[0]; if ( isset( $bits[1] ) ) { $minor = $bits[1]; @@ -639,23 +621,22 @@ function get_named_sem_ver( $new_version, $original_version ) { * function provides a safer alternative to using * `isset( $assoc_args['quiet'] )` or similar. * - * @access public + * @access public * @category Input * - * @param array $assoc_args Arguments array. - * @param string $flag Flag to get the value. - * @param mixed $default Default value for the flag. Default: NULL - * + * @param array $assoc_args Arguments array. + * @param string $flag Flag to get the value. + * @param mixed $default Default value for the flag. Default: NULL * @return mixed */ function get_flag_value( $assoc_args, $flag, $default = null ) { - return isset( $assoc_args[$flag] ) ? $assoc_args[$flag] : $default; + return isset( $assoc_args[ $flag ] ) ? $assoc_args[ $flag ] : $default; } /** * Get the home directory. * - * @access public + * @access public * @category System * * @return string @@ -673,11 +654,10 @@ function get_home_dir() { /** * Appends a trailing slash. * - * @access public + * @access public * @category System * * @param string $string What to add the trailing slash to. - * * @return string String with trailing slash added. */ function trailingslashit( $string ) { @@ -688,7 +668,6 @@ function trailingslashit( $string ) { * Convert Windows EOLs to *nix. * * @param string $str String to convert. - * * @return string String with carriage return / newline pairs reduced to newlines. */ function normalize_eols( $str ) { @@ -698,7 +677,7 @@ function normalize_eols( $str ) { /** * Get the system's temp directory. Warns user if it isn't writable. * - * @access public + * @access public * @category System * * @return string @@ -733,20 +712,18 @@ function get_temp_dir() { * * @return mixed */ -function parse_ssh_url( $url, $component = - 1 ) { +function parse_ssh_url( $url, $component = -1 ) { preg_match( '#^((docker|docker\-compose|ssh|vagrant):)?(([^@:]+)@)?([^:/~]+)(:([\d]*))?((/|~)(.+))?$#', $url, $matches ); $bits = array(); - foreach ( - array( - 2 => 'scheme', - 4 => 'user', - 5 => 'host', - 7 => 'port', - 8 => 'path', - ) as $i => $key - ) { - if ( ! empty( $matches[$i] ) ) { - $bits[$key] = $matches[$i]; + foreach ( array( + 2 => 'scheme', + 4 => 'user', + 5 => 'host', + 7 => 'port', + 8 => 'path', + ) as $i => $key ) { + if ( ! empty( $matches[ $i ] ) ) { + $bits[ $key ] = $matches[ $i ]; } } @@ -780,7 +757,7 @@ function parse_ssh_url( $url, $component = - 1 ) { /** * Report the results of the same operation against multiple resources. * - * @access public + * @access public * @category Input * * @param string $noun Resource being affected (e.g. plugin) @@ -791,8 +768,8 @@ function parse_ssh_url( $url, $component = - 1 ) { * @param null|integer $skips Optional. Number of skipped operations. Default null (don't show skips). */ function report_batch_operation_results( $noun, $verb, $total, $successes, $failures, $skips = null ) { - $plural_noun = $noun . 's'; - $past_tense_verb = past_tense_verb( $verb ); + $plural_noun = $noun . 's'; + $past_tense_verb = past_tense_verb( $verb ); $past_tense_verb_upper = ucfirst( $past_tense_verb ); if ( $failures ) { $failed_skipped_message = null === $skips ? '' : " ({$failures} failed" . ( $skips ? ", {$skips} skipped" : '' ) . ')'; @@ -815,29 +792,26 @@ function report_batch_operation_results( $noun, $verb, $total, $successes, $fail /** * Parse a string of command line arguments into an $argv-esqe variable. * - * @access public + * @access public * @category Input * * @param string $arguments - * * @return array */ function parse_str_to_argv( $arguments ) { preg_match_all( '/(?<=^|\s)([\'"]?)(.+?)(?<!\\\\)\1(?=$|\s)/', $arguments, $matches ); $argv = isset( $matches[0] ) ? $matches[0] : array(); $argv = array_map( - function ( $arg ) { + function( $arg ) { foreach ( array( '"', "'" ) as $char ) { - if ( substr( $arg, 0, 1 ) === $char && substr( $arg, - 1 ) === $char ) { - $arg = substr( $arg, 1, - 1 ); + if ( substr( $arg, 0, 1 ) === $char && substr( $arg, -1 ) === $char ) { + $arg = substr( $arg, 1, -1 ); break; } } - - return $arg; + return $arg; }, $argv ); - return $argv; } @@ -848,7 +822,6 @@ function ( $arg ) { * * @param string $path * @param string $suffix - * * @return string */ function basename( $path, $suffix = '' ) { @@ -879,7 +852,7 @@ function isPiped() { return filter_var( $shellPipe, FILTER_VALIDATE_BOOLEAN ); } - return ( function_exists( 'posix_isatty' ) && ! posix_isatty( STDOUT ) ); + return (function_exists( 'posix_isatty' ) && ! posix_isatty( STDOUT )); } /** @@ -927,8 +900,8 @@ function expand_globs( $paths, $flags = 'default' ) { * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * - * @param string $pattern Filename pattern. - * @param void $dummy_flags Not used. + * @param string $pattern Filename pattern. + * @param void $dummy_flags Not used. * * @return array Array of paths. */ @@ -938,22 +911,22 @@ function glob_brace( $pattern, $dummy_flags = null ) { if ( ! $next_brace_sub ) { // Find the end of the subpattern in a brace expression. $next_brace_sub = function ( $pattern, $current ) { - $length = strlen( $pattern ); - $depth = 0; + $length = strlen( $pattern ); + $depth = 0; while ( $current < $length ) { - if ( '\\' === $pattern[$current] ) { - if ( ++ $current === $length ) { + if ( '\\' === $pattern[ $current ] ) { + if ( ++$current === $length ) { break; } - $current ++; + $current++; } else { - if ( ( '}' === $pattern[$current] && 0 === $depth -- ) || ( ',' === $pattern[$current] && 0 === $depth ) ) { + if ( ( '}' === $pattern[ $current ] && 0 === $depth-- ) || ( ',' === $pattern[ $current ] && 0 === $depth ) ) { break; } - if ( '{' === $pattern[$current ++] ) { - $depth ++; + if ( '{' === $pattern[ $current++ ] ) { + $depth++; } } } @@ -965,10 +938,10 @@ function glob_brace( $pattern, $dummy_flags = null ) { $length = strlen( $pattern ); // Find first opening brace. - for ( $begin = 0; $begin < $length; $begin ++ ) { - if ( '\\' === $pattern[$begin] ) { - $begin ++; - } elseif ( '{' === $pattern[$begin] ) { + for ( $begin = 0; $begin < $length; $begin++ ) { + if ( '\\' === $pattern[ $begin ] ) { + $begin++; + } elseif ( '{' === $pattern[ $begin ] ) { break; } } @@ -981,26 +954,26 @@ function glob_brace( $pattern, $dummy_flags = null ) { $rest = $next; // Point `$rest` to matching closing brace. - while ( '}' !== $pattern[$rest] ) { + while ( '}' !== $pattern[ $rest ] ) { if ( null === ( $rest = $next_brace_sub( $pattern, $rest + 1 ) ) ) { return glob( $pattern ); } } $paths = array(); - $p = $begin + 1; + $p = $begin + 1; // For each comma-separated subpattern. do { $subpattern = substr( $pattern, 0, $begin ) - . substr( $pattern, $p, $next - $p ) - . substr( $pattern, $rest + 1 ); + . substr( $pattern, $p, $next - $p ) + . substr( $pattern, $rest + 1 ); if ( $result = glob_brace( $subpattern ) ) { $paths = array_merge( $paths, $result ); } - if ( '}' === $pattern[$next] ) { + if ( '}' === $pattern[ $next ] ) { break; } @@ -1030,38 +1003,38 @@ function glob_brace( $pattern, $dummy_flags = null ) { function get_suggestion( $target, array $options, $threshold = 2 ) { $suggestion_map = array( - 'add' => 'create', - 'check' => 'check-update', + 'add' => 'create', + 'check' => 'check-update', 'capability' => 'cap', - 'clear' => 'flush', - 'decrement' => 'decr', - 'del' => 'delete', - 'directory' => 'dir', - 'exec' => 'eval', - 'exec-file' => 'eval-file', - 'increment' => 'incr', - 'language' => 'locale', - 'lang' => 'locale', - 'new' => 'create', - 'number' => 'count', - 'remove' => 'delete', - 'regen' => 'regenerate', - 'rep' => 'replace', - 'repl' => 'replace', - 'trash' => 'delete', - 'v' => 'version', + 'clear' => 'flush', + 'decrement' => 'decr', + 'del' => 'delete', + 'directory' => 'dir', + 'exec' => 'eval', + 'exec-file' => 'eval-file', + 'increment' => 'incr', + 'language' => 'locale', + 'lang' => 'locale', + 'new' => 'create', + 'number' => 'count', + 'remove' => 'delete', + 'regen' => 'regenerate', + 'rep' => 'replace', + 'repl' => 'replace', + 'trash' => 'delete', + 'v' => 'version', ); - if ( array_key_exists( $target, $suggestion_map ) && in_array( $suggestion_map[$target], $options, true ) ) { - return $suggestion_map[$target]; + if ( array_key_exists( $target, $suggestion_map ) && in_array( $suggestion_map[ $target ], $options, true ) ) { + return $suggestion_map[ $target ]; } if ( empty( $options ) ) { return ''; } foreach ( $options as $option ) { - $distance = levenshtein( $option, $target ); - $levenshtein[$option] = $distance; + $distance = levenshtein( $option, $target ); + $levenshtein[ $option ] = $distance; } // Sort known command strings by distance to user entry. @@ -1072,7 +1045,7 @@ function get_suggestion( $target, array $options, $threshold = 2 ) { $suggestion = key( $levenshtein ); // Only return a suggestion if below a given threshold. - return $levenshtein[$suggestion] <= $threshold && $suggestion !== $target + return $levenshtein[ $suggestion ] <= $threshold && $suggestion !== $target ? (string) $suggestion : ''; } @@ -1117,7 +1090,7 @@ function is_bundled_command( $command ) { static $classes; if ( null === $classes ) { - $classes = array(); + $classes = array(); $class_map = EE_VENDOR_DIR . '/composer/autoload_commands_classmap.php'; if ( file_exists( EE_VENDOR_DIR . '/composer/' ) ) { $classes = include $class_map; @@ -1142,7 +1115,7 @@ function is_bundled_command( $command ) { * @return string */ function force_env_on_nix_systems( $command ) { - $env_prefix = '/usr/bin/env '; + $env_prefix = '/usr/bin/env '; $env_prefix_len = strlen( $env_prefix ); if ( is_windows() ) { if ( 0 === strncmp( $command, $env_prefix, $env_prefix_len ) ) { @@ -1153,7 +1126,6 @@ function force_env_on_nix_systems( $command ) { $command = $env_prefix . $command; } } - return $command; } @@ -1177,7 +1149,6 @@ function check_proc_available( $context = null, $return = false ) { EE::error( $msg ); } } - return true; } @@ -1192,19 +1163,18 @@ function past_tense_verb( $verb ) { static $irregular = array( 'reset' => 'reset', ); - if ( isset( $irregular[$verb] ) ) { - return $irregular[$verb]; + if ( isset( $irregular[ $verb ] ) ) { + return $irregular[ $verb ]; } - $last = substr( $verb, - 1 ); + $last = substr( $verb, -1 ); if ( 'e' === $last ) { - $verb = substr( $verb, 0, - 1 ); + $verb = substr( $verb, 0, -1 ); } elseif ( 'y' === $last && ! preg_match( '/[aeiou]y$/', $verb ) ) { - $verb = substr( $verb, 0, - 1 ) . 'i'; + $verb = substr( $verb, 0, -1 ) . 'i'; } elseif ( preg_match( '/^[^aeiou]*[aeiou][^aeiouhwxy]$/', $verb ) ) { // Rule of thumb that most (all?) one-voweled regular verbs ending in vowel + consonant (excluding "h", "w", "x", "y") double their final consonant - misses many cases (eg "submit"). $verb .= $last; } - return $verb . 'ed'; } @@ -1213,7 +1183,7 @@ function past_tense_verb( $verb ) { * * Environment values permit specific binaries to be indicated. * - * @access public + * @access public * @category System * * @return string @@ -1251,12 +1221,12 @@ function get_php_binary() { * * @access public * - * @param string $command Command to execute. - * @param array $descriptorspec Indexed array of descriptor numbers and their values. - * @param array &$pipes Indexed array of file pointers that correspond to PHP's end of any pipes that are created. - * @param string $cwd Initial working directory for the command. - * @param array $env Array of environment variables. - * @param array $other_options Array of additional options (Windows only). + * @param string $command Command to execute. + * @param array $descriptorspec Indexed array of descriptor numbers and their values. + * @param array &$pipes Indexed array of file pointers that correspond to PHP's end of any pipes that are created. + * @param string $cwd Initial working directory for the command. + * @param array $env Array of environment variables. + * @param array $other_options Array of additional options (Windows only). * * @return string Command stripped of any environment variable settings. */ @@ -1265,7 +1235,6 @@ function proc_open_compat( $cmd, $descriptorspec, &$pipes, $cwd = null, $env = n // Need to encompass the whole command in double quotes - PHP bug https://bugs.php.net/bug.php?id=49139 $cmd = '"' . _proc_open_compat_win_env( $cmd, $env ) . '"'; } - return proc_open( $cmd, $descriptorspec, $pipes, $cwd, $env, $other_options ); } @@ -1276,7 +1245,7 @@ function proc_open_compat( $cmd, $descriptorspec, &$pipes, $cwd = null, $env = n * @access private * * @param string $command Command to execute. - * @param array &$env Array of existing environment variables. Will be modified if any settings in command. + * @param array &$env Array of existing environment variables. Will be modified if any settings in command. * * @return string Command stripped of any environment variable settings. */ @@ -1287,10 +1256,9 @@ function _proc_open_compat_win_env( $cmd, &$env ) { if ( null === $env ) { $env = array(); } - $env[$matches[1]] = isset( $matches[2][0] ) && '"' === $matches[2][0] ? substr( $matches[2], 1, - 1 ) : $matches[2]; + $env[ $matches[1] ] = isset( $matches[2][0] ) && '"' === $matches[2][0] ? substr( $matches[2], 1, -1 ) : $matches[2]; } } - return $cmd; } @@ -1332,8 +1300,8 @@ function parse_shell_arrays( $assoc_args, $array_arguments ) { } foreach ( $array_arguments as $key ) { - if ( array_key_exists( $key, $assoc_args ) && is_json( $assoc_args[$key] ) ) { - $assoc_args[$key] = json_decode( $assoc_args[$key], $assoc = true ); + if ( array_key_exists( $key, $assoc_args ) && is_json( $assoc_args[ $key ] ) ) { + $assoc_args[ $key ] = json_decode( $assoc_args[ $key ], $assoc = true ); } } @@ -1466,7 +1434,6 @@ function default_launch( $command ) { if ( ! $launch->return_code ) { return true; } - return false; } From 35426d2aa4d0ad1f8184d2a5f97c422303a91d89 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Mon, 11 Jun 2018 14:47:33 +0530 Subject: [PATCH 0157/1044] Update database --- php/class-ee-db.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/php/class-ee-db.php b/php/class-ee-db.php index d53aba73a..de4241194 100644 --- a/php/class-ee-db.php +++ b/php/class-ee-db.php @@ -44,7 +44,8 @@ public static function create() { storage_db VARCHAR, db_name VARCHAR, db_user VARCHAR, - db_password VARCHAR, + db_password VARCHAR, + db_root_password VARCHAR, db_host VARCHAR, wp_user VARCHAR, wp_pass VARCHAR, From 1e2f24db73b4cb2735e3cc8852fa14afbebb3932 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Mon, 11 Jun 2018 14:48:29 +0530 Subject: [PATCH 0158/1044] Update init_ee loading and version flag compatibility --- php/EE/Runner.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 1825fc485..2ef95ed73 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -485,7 +485,6 @@ public function init_logger() { EE::set_logger( $logger ); - $this->init_ee(); if ( !empty( $this->arguments[0] ) && 'cli' === $this->arguments[0] && ! empty( $this->arguments[1] ) && 'info' === $this->arguments[1] && ! $this->config['ssh'] ) { $file_logging_path = '/dev/null'; } @@ -541,7 +540,7 @@ public function init_config() { unset( $assoc_args['help'] ); } - if ( isset( $assoc_args['version'] ) ) { + if ( empty( $args ) && isset( $assoc_args['version'] ) ) { array_unshift( $args, 'version' ); array_unshift( $args, 'cli' ); unset( $assoc_args['version'] ); @@ -677,6 +676,7 @@ private function set_alias( $alias ) { public function start() { + $this->init_ee(); // Enable PHP error reporting to stderr if testing. if ( getenv( 'BEHAT_RUN' ) ) { From a50e8f6c1ad412010ce7c956f66788dc6ca5e904 Mon Sep 17 00:00:00 2001 From: Mriyam Tamuli <mbtamuli@gmail.com> Date: Mon, 11 Jun 2018 18:58:26 +0530 Subject: [PATCH 0159/1044] Update CONTRIBUTING.md and ISSUE_TEMPLATE.md Signed-off-by: Mriyam Tamuli <mbtamuli@gmail.com> --- .github/CONTRIBUTING.md | 34 +++++++++++++++++++++++++++++ .github/ISSUE_TEMPLATE | 41 ----------------------------------- .github/ISSUE_TEMPLATE.md | 9 ++++++++ .github/PULL_REQUEST_TEMPLATE | 16 -------------- .github/SUPPORT.md | 6 ----- 5 files changed, 43 insertions(+), 63 deletions(-) create mode 100644 .github/CONTRIBUTING.md delete mode 100644 .github/ISSUE_TEMPLATE create mode 100644 .github/ISSUE_TEMPLATE.md delete mode 100644 .github/PULL_REQUEST_TEMPLATE delete mode 100644 .github/SUPPORT.md diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 000000000..7f557a8e2 --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,34 @@ +# Community Guidelines + +This guide details how to get involve in EasyEngine commmunity. Please read this carefully. + + + +## How to get help? + +Please attach the output of following command when open a new support request. + +```bash +lsb_release -a +ee -v +ee info +wp --allow-root --info +``` + +### Where to create issue? + +For free support, please use - http://community.rtcamp.com/c/easyengine + +Please do NOT clutter github issue tracker here with support requests. It hampers development speed of this project. + + +### Pull Requests + +When submitting your code please follow this coding standerds - http://docs.rtcamp.com/easyengine/dev/python/ + + +### EasyEngine Chat + +Developer & contributor discussion: https://gitter.im/rtCamp/easyengine + +Please do NOT use chat for technical support. Chat is limited to developer & contributor disucssion related to EasyEngine future. diff --git a/.github/ISSUE_TEMPLATE b/.github/ISSUE_TEMPLATE deleted file mode 100644 index 6e687b492..000000000 --- a/.github/ISSUE_TEMPLATE +++ /dev/null @@ -1,41 +0,0 @@ -<!-- - -Thanks for taking the time to help improve EE! - -Found a bug or want to suggest an enhancement to an existing command? Before creating an issue, please review our best practices: http://ee.org/docs/bug-reports/ - -Have an idea for something new? Jump into the ideas repo: https://github.com/ee/ideas - -Need help with something? Github issues aren't for general support questions, but there are other venues you can try: http://ee.org/#support Make sure you're running the most recent version of EE! The current version is the only officially supported version. - -Want to suggest a feature? Check out the roadmap for how feature development happens: https://ee.org/docs/roadmap/ - -Oh! It's worth noting EE represents a collection of sub-projects, each with their own issue tracker. One of these may be a better destination: - -* `wp (cache|transient) *` https://github.com/ee/cache-command -* `wp checksum` https://github.com/ee/checksum-command -* `wp config *` https://github.com/ee/config-command -* `wp core *` https://github.com/ee/core-command -* `wp cron *` https://github.com/ee/cron-command -* `wp db *` https://github.com/ee/db-command -* `wp embed *` https://github.com/ee/embed-command -* `wp (eval|eval-file)` https://github.com/ee/eval-command -* `wp export` https://github.com/ee/export-command -* `wp (option|post|comment|user|term|site) *` https://github.com/ee/entity-command -* `wp import` https://github.com/ee/import-command -* `wp language` https://github.com/ee/language-command -* `wp media *` https://github.com/ee/media-command -* `wp package *` https://github.com/ee/package-command -* `wp (plugin|theme) *` https://github.com/ee/extension-command -* `wp rewrite` https://github.com/ee/rewrite-command -* `wp (role|cap) *` https://github.com/ee/role-command -* `wp scaffold *` https://github.com/ee/scaffold-command -* `wp search-replace` https://github.com/ee/search-replace-command -* `wp server` https://github.com/ee/server-command -* `wp shell` https://github.com/ee/shell-command -* `wp super-admin *` https://github.com/ee/super-admin-command -* `wp (widget|sidebar) *` https://github.com/ee/widget-command - -You can safely delete this comment. - ---> diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 000000000..b2e446cb8 --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,9 @@ +This issue tracker is only for issues related to EasyEngine. Please use http://community.rtcamp.com/c/easyengine for support questions. + +If you feel the issue is a EasyEngine core specific issue, please attach the output of the following commands. + +System Information +- [ ] lsb_release -a +- [ ] ee -v +- [ ] ee info +- [ ] wp --allow-root --info diff --git a/.github/PULL_REQUEST_TEMPLATE b/.github/PULL_REQUEST_TEMPLATE deleted file mode 100644 index 291a4a188..000000000 --- a/.github/PULL_REQUEST_TEMPLATE +++ /dev/null @@ -1,16 +0,0 @@ -<!-- - -Thanks for submitting a pull request! - -Please review our contributing guidelines if you haven't recently: https://make.wordpress.org/cli/handbook/contributing/#creating-a-pull-request - -Here's an overview to our process: - -1. One of the project committers will soon provide a code review (https://make.wordpress.org/cli/handbook/code-review/). -2. You are expected to address the code review comments in a timely manner (if we don't hear from you in two weeks, we'll consider your pull request abandoned). -3. Please make sure to include functional tests for your changes. -4. The reviewing committer will merge your pull request as soon as it passes code review (and provided it fits within the scope of the project). - -You can safely delete this comment. - ---> diff --git a/.github/SUPPORT.md b/.github/SUPPORT.md deleted file mode 100644 index b1888b8d1..000000000 --- a/.github/SUPPORT.md +++ /dev/null @@ -1,6 +0,0 @@ -Support -======= - -Hi there, - -GitHub issues are meant for enhancement requests and specific, reproducible bugs, not for general support questions. For support options, please review https://ee.org/#support From 4443461d74268fecb2b61922ffb5c27d119a1a75 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Mon, 11 Jun 2018 19:59:54 +0530 Subject: [PATCH 0160/1044] Update getting first element method --- php/utils.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/php/utils.php b/php/utils.php index 2eef7ef13..8ae12b7a6 100644 --- a/php/utils.php +++ b/php/utils.php @@ -1519,11 +1519,12 @@ function get_site_name() { $site_name = array_intersect( array_flatten( $sites ), $name_in_path ); if ( 1 === count( $site_name ) ) { - $path = EE::db()::select( array( 'site_path' ), array( 'sitename' => $site_name[0] ) ); + $name = reset( $site_name ); + $path = EE::db()::select( array( 'site_path' ), array( 'sitename' => $name ) ); if ( $path ) { $site_path = $path[0]['site_path']; if ( $site_path === substr( $cwd, 0, strlen( $site_path ) ) ) { - return $site_name[0]; + return $name; } } } From 888e08ca663a7cd7e0a4e2e2903b5c0596725608 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Sun, 10 Jun 2018 18:40:00 +0530 Subject: [PATCH 0161/1044] Fix execution flow and replace name --- php/EE/Runner.php | 6 ++++++ php/commands/src/CLI_Command.php | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 2ef95ed73..9ccaf473e 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -726,6 +726,12 @@ public function start() { $this->arguments[] = 'help'; } + // Protect 'cli info' from most of the runtime, + // except when the command will be run over SSH + if ( ! empty( $this->arguments[0] ) && 'cli' === $this->arguments[0] && ! empty( $this->arguments[1] ) && 'info' === $this->arguments[1] && ! $this->config['ssh'] ) { + $this->_run_command_and_exit(); + } + if ( $this->config['ssh'] ) { $this->run_ssh_command( $this->config['ssh'] ); return; diff --git a/php/commands/src/CLI_Command.php b/php/commands/src/CLI_Command.php index a0a242d0b..866f51d4f 100644 --- a/php/commands/src/CLI_Command.php +++ b/php/commands/src/CLI_Command.php @@ -259,7 +259,7 @@ class_exists( '\cli\Colors' ); // This autoloads \cli\Colors - after we move the } else { $updated_version = $newest['version']; } - EE::success( sprintf( 'Updated WP-CLI to %s.', $updated_version ) ); + EE::success( sprintf( 'Updated EE to %s.', $updated_version ) ); } /** From 3780b66973cda40ec4193c937265294feba3ad9a Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Sun, 10 Jun 2018 19:24:51 +0530 Subject: [PATCH 0162/1044] Add migratte function. Will be worked upon properly in next version. --- php/commands/src/CLI_Command.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/php/commands/src/CLI_Command.php b/php/commands/src/CLI_Command.php index 866f51d4f..e43fa36e7 100644 --- a/php/commands/src/CLI_Command.php +++ b/php/commands/src/CLI_Command.php @@ -153,6 +153,17 @@ public function info( $_, $assoc_args ) { \EE::line( $line ); } } + + if ( '/tmp' === getcwd() ) { + $this->migrate(); + } + } + + /** + * Function to run migrations required to upgrade to the newer version. Will always be invoked from the newer phar downloaded inside the /tmp folder + */ + private function migrate() { + } /** From 3dde8519288ee7a124f9a142dcf1b827e0512b0a Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Mon, 11 Jun 2018 19:34:21 +0530 Subject: [PATCH 0163/1044] Allow only root users for now --- php/EE/Runner.php | 6 +++++- php/class-ee.php | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 2ef95ed73..e5255258c 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -485,6 +485,10 @@ public function init_logger() { EE::set_logger( $logger ); + if ( ! is_writable( EE_CONF_ROOT ) ) { + EE::err( 'Please run `ee` as root user.' ); + } + if ( !empty( $this->arguments[0] ) && 'cli' === $this->arguments[0] && ! empty( $this->arguments[1] ) && 'info' === $this->arguments[1] && ! $this->config['ssh'] ) { $file_logging_path = '/dev/null'; } @@ -623,7 +627,7 @@ private function ensure_present_in_config( $var, $default) { } $mkdir_success = mkdir ( $config_dir_path , 0755, true ); if ( ! $mkdir_success ) { - EE::error("The config file path ${$config_dir_path} is not writable. Please select a config path which is writable in EE_CONFIG_PATH environment variable."); + EE::err("The config file path ${$config_dir_path} is not writable.\n Please run `ee` it as root user."); } $this->add_var_to_config_file($var, $config_file_path ); } diff --git a/php/class-ee.php b/php/class-ee.php index 6662e4bc2..b2fbc68dd 100644 --- a/php/class-ee.php +++ b/php/class-ee.php @@ -612,6 +612,38 @@ public static function error( $message, $exit = true ) { } } + /** + * Display error message prefixed with "Error: " and exit script without writing to log file. + * + * Use `EE::error()` instead when error is to be logged. + * + * @access public + * @category Output + * + * @param string|EE_Error $message Message to write to STDERR. + * @param boolean|integer $exit True defaults to exit(1). + * @return null + */ + public static function err( $message, $exit = true ) { + if ( ! isset( self::get_runner()->assoc_args['completions'] ) ) { + self::$logger->error( self::error_to_string( $message ) ); + } + + $return_code = false; + if ( true === $exit ) { + $return_code = 1; + } elseif ( is_int( $exit ) && $exit >= 1 ) { + $return_code = $exit; + } + + if ( $return_code ) { + if ( self::$capture_exit ) { + throw new ExitException( null, $return_code ); + } + exit( $return_code ); + } + } + /** * Halt script execution with a specific return code. * From 40365cbdd44f95b6bb8cea6d9d69d82e4ae5dc14 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Mon, 11 Jun 2018 19:52:11 +0530 Subject: [PATCH 0164/1044] Update ci for root changes --- ci/prepare.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/prepare.sh b/ci/prepare.sh index bd6cd82f8..f194f4a0e 100755 --- a/ci/prepare.sh +++ b/ci/prepare.sh @@ -3,4 +3,4 @@ # called by Travis CI php -dphar.readonly=0 ./utils/make-phar.php easyengine.phar --quite > /dev/null -php easyengine.phar cli version \ No newline at end of file +sudo php easyengine.phar cli version \ No newline at end of file From 1be3c79f126404aeea71c58d7d54871e2b662298 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Mon, 11 Jun 2018 19:53:04 +0530 Subject: [PATCH 0165/1044] Remove docker-build triggers --- ci/deploy.sh | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/ci/deploy.sh b/ci/deploy.sh index e851a23ff..f06643034 100755 --- a/ci/deploy.sh +++ b/ci/deploy.sh @@ -52,11 +52,4 @@ sha512sum $fname | cut -d ' ' -f 1 > $fname.sha512 git add . git commit -m "phar build: $TRAVIS_REPO_SLUG@$TRAVIS_COMMIT" -git push - -# Trigger docker image build with new phar -if [[ "$TRAVIS_BRANCH" == "develop-v4" ]]; then - curl -H "Content-Type: application/json" --data '{"docker_tag": "latest"}' -X POST https://registry.hub.docker.com/u/easyengine/base/trigger/"$DOCKER_BUILD_TOKEN"/ -else - curl -H "Content-Type: application/json" --data '{"docker_tag": "stable"}' -X POST https://registry.hub.docker.com/u/easyengine/base/trigger/"$DOCKER_BUILD_TOKEN"/ -fi \ No newline at end of file +git push \ No newline at end of file From d4f0ae13589f75a1707e666269a28f6fbd0b263d Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Mon, 11 Jun 2018 19:53:24 +0530 Subject: [PATCH 0166/1044] Update branch names --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index f3a6a27be..e98fa54ee 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,7 +26,7 @@ before_script: jobs: include: - stage: deploy - env: DEPLOY_BRANCH=release/v4 + env: DEPLOY_BRANCH=master-v4 script: ./ci/deploy.sh cache: @@ -36,7 +36,7 @@ cache: branches: only: - develop-v4 - - release/v4 + - master-v4 notifications: email: From 89b2158e8c53ca2c13a856ed0823732fa3bb7d15 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Mon, 11 Jun 2018 19:56:36 +0530 Subject: [PATCH 0167/1044] Allow sudo in travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e98fa54ee..f5c2cfa8d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -sudo: false +sudo: true language: php php: 7.1 From a5554a9a256747afe2ae7b6dafc2c2541a27aa41 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Mon, 11 Jun 2018 20:51:54 +0530 Subject: [PATCH 0168/1044] Fix sudo permission in travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f5c2cfa8d..dc7601aae 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -sudo: true +sudo: required language: php php: 7.1 From d238c1003f1031a060cfb614d70ab33a63fb002a Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Mon, 11 Jun 2018 21:17:03 +0530 Subject: [PATCH 0169/1044] Remove version print for now --- ci/prepare.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ci/prepare.sh b/ci/prepare.sh index f194f4a0e..bac8770ca 100755 --- a/ci/prepare.sh +++ b/ci/prepare.sh @@ -2,5 +2,4 @@ # called by Travis CI -php -dphar.readonly=0 ./utils/make-phar.php easyengine.phar --quite > /dev/null -sudo php easyengine.phar cli version \ No newline at end of file +php -dphar.readonly=0 ./utils/make-phar.php easyengine.phar --quite > /dev/null \ No newline at end of file From b506dc91487618bc41d3212284efab94a0b861f2 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Mon, 11 Jun 2018 21:27:43 +0530 Subject: [PATCH 0170/1044] Update composer json and lock for beta1 --- composer.json | 1 - composer.lock | 52 ++++++--------------------------------------------- 2 files changed, 6 insertions(+), 47 deletions(-) diff --git a/composer.json b/composer.json index 760c21d9c..0c5727af8 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,6 @@ "composer/composer": "^1.2.0", "composer/semver": "~1.0", "easyengine/site-command": "dev-master", - "easyengine/wp-command": "dev-master", "justinrainbow/json-schema": "~5.2.5", "monolog/monolog": "^1.23", "mustache/mustache": "~2.4", diff --git a/composer.lock b/composer.lock index 0e7dc40ae..c662e986f 100644 --- a/composer.lock +++ b/composer.lock @@ -1,10 +1,10 @@ { "_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#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "dff0a4c2d5e6300dd3e30a277bb5c6ee", + "content-hash": "60cb6927fc84af7853527d6849f128d4", "packages": [ { "name": "composer/ca-bundle", @@ -271,12 +271,12 @@ "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "d021d7ace1e8acc8817c5d00613eb66e0d78b7e5" + "reference": "de002f79eb6a1df8b556f78d07f494358a37d47b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/d021d7ace1e8acc8817c5d00613eb66e0d78b7e5", - "reference": "d021d7ace1e8acc8817c5d00613eb66e0d78b7e5", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/de002f79eb6a1df8b556f78d07f494358a37d47b", + "reference": "de002f79eb6a1df8b556f78d07f494358a37d47b", "shasum": "" }, "require": { @@ -308,46 +308,7 @@ "MIT" ], "homepage": "https://github.com/easyengine/site-command", - "time": "2018-06-08T21:20:53+00:00" - }, - { - "name": "easyengine/wp-command", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/EasyEngine/wp-command.git", - "reference": "ac24266486a60653bac0024bbdc3731ff1fa1edd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/wp-command/zipball/ac24266486a60653bac0024bbdc3731ff1fa1edd", - "reference": "ac24266486a60653bac0024bbdc3731ff1fa1edd", - "shasum": "" - }, - "type": "ee-cli-package", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - }, - "bundled": true, - "commands": [ - "wp" - ] - }, - "autoload": { - "psr-4": { - "": "src/" - }, - "files": [ - "wp-command.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "homepage": "https://github.com/easyengine/wp-command", - "time": "2018-05-16T11:51:52+00:00" + "time": "2018-06-11T15:52:47+00:00" }, { "name": "justinrainbow/json-schema", @@ -2607,7 +2568,6 @@ "minimum-stability": "dev", "stability-flags": { "easyengine/site-command": 20, - "easyengine/wp-command": 20, "roave/security-advisories": 20 }, "prefer-stable": true, From 0ee9f8b706ff631eb271ab8a7e5572c2f363ffab Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Mon, 11 Jun 2018 21:44:22 +0530 Subject: [PATCH 0171/1044] Change init_ee loading sequence --- php/EE/Runner.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 24d0d86a6..2679f30fa 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -485,6 +485,8 @@ public function init_logger() { EE::set_logger( $logger ); + $this->init_ee(); + if ( ! is_writable( EE_CONF_ROOT ) ) { EE::err( 'Please run `ee` as root user.' ); } @@ -680,8 +682,6 @@ private function set_alias( $alias ) { public function start() { - $this->init_ee(); - // Enable PHP error reporting to stderr if testing. if ( getenv( 'BEHAT_RUN' ) ) { $this->enable_error_reporting(); From b8fafbf5635f6d55e36ed37403130094a5f2305a Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Tue, 12 Jun 2018 00:00:05 +0530 Subject: [PATCH 0172/1044] Remove unnecessary-flags from help --- php/EE/Bootstrap/IncludePackageAutoloader.php | 10 +++---- php/EE/Runner.php | 10 ++----- php/config-spec.php | 29 ------------------- 3 files changed, 7 insertions(+), 42 deletions(-) diff --git a/php/EE/Bootstrap/IncludePackageAutoloader.php b/php/EE/Bootstrap/IncludePackageAutoloader.php index 98a1cc62c..2fdbca737 100644 --- a/php/EE/Bootstrap/IncludePackageAutoloader.php +++ b/php/EE/Bootstrap/IncludePackageAutoloader.php @@ -23,12 +23,12 @@ protected function get_autoloader_paths() { } $runner = new RunnerInstance(); - $skip_packages = $runner()->config['skip-packages']; - if ( true === $skip_packages ) { - \EE::debug( 'Skipped loading packages.', 'bootstrap' ); + //$skip_packages = $runner()->config['skip-packages']; + // if ( true === $skip_packages ) { + // \EE::debug( 'Skipped loading packages.', 'bootstrap' ); - return false; - } + // return false; + // } $autoloader_path = $runner()->get_packages_dir_path() . 'vendor/autoload.php'; diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 2679f30fa..bf69bf8a0 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -530,10 +530,9 @@ public function init_config() { $configurator->merge_yml( $this->global_config_path, $this->alias ); $config = $configurator->to_array(); - $this->_required_files['global'] = $config[0]['require']; $configurator->merge_yml( $this->project_config_path, $this->alias ); $config = $configurator->to_array(); - $this->_required_files['project'] = $config[0]['require']; + //$this->_required_files['project'] = $config[0]['require']; } // Runtime config and args @@ -593,7 +592,7 @@ public function init_config() { $this->aliases['@all'] = 'Run command against every registered alias.'; $this->aliases = array_reverse( $this->aliases ); } - $this->_required_files['runtime'] = $this->config['require']; + //$this->_required_files['runtime'] = $this->config['require']; } /** @@ -736,11 +735,6 @@ public function start() { $this->_run_command_and_exit(); } - if ( $this->config['ssh'] ) { - $this->run_ssh_command( $this->config['ssh'] ); - return; - } - // First try at showing man page. if ( $this->cmd_starts_with( array( 'help' ) ) ) { $this->auto_check_update(); diff --git a/php/config-spec.php b/php/config-spec.php index 39951fcb8..ac3989dab 100644 --- a/php/config-spec.php +++ b/php/config-spec.php @@ -4,35 +4,6 @@ return array( - 'ssh' => array( - 'runtime' => '=[<scheme>:][<user>@]<host|container>[:<port>][<path>]', - 'file' => '[<scheme>:][<user>@]<host|container>[:<port>][<path>]', - 'desc' => 'Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "vagrant").', - ), - - # Used by wp-cli to control wp site remotely. - # Might be useful in future for controlling ee remotely. - // 'http' => array( - // 'runtime' => '=<http>', - // 'file' => '<http>', - // 'desc' => 'Reserved for future.', - // ), - - 'skip-packages' => array( - 'runtime' => '', - 'file' => '<bool>', - 'desc' => 'Skip loading all installed packages.', - 'default' => false, - ), - - 'require' => array( - 'runtime' => '=<path>', - 'file' => '<path>', - 'desc' => 'Load PHP file before running the command (may be used more than once).', - 'multiple' => true, - 'default' => array(), - ), - 'disabled_commands' => array( 'file' => '<list>', 'default' => array(), From ced22a0fec0c3f5de2302fd35cfaf0a9d2350c77 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Tue, 12 Jun 2018 00:56:11 +0530 Subject: [PATCH 0173/1044] Fix config directory issue --- php/EE/Runner.php | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index bf69bf8a0..704cf1df4 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -51,11 +51,6 @@ public function __get( $key ) { */ private function init_ee() { - if ( ! is_dir( EE_CONF_ROOT ) ) { - $user = getenv('USER'); - shell_exec('sudo mkdir -p ' . EE_CONF_ROOT); - } - $this->ensure_present_in_config( 'sites_path', Utils\get_home_dir(). '/ee-sites' ); $this->ensure_present_in_config( 'locale', 'en_US' ); $this->ensure_present_in_config( 'ee_installer_version', 'stable' ); @@ -485,7 +480,10 @@ public function init_logger() { EE::set_logger( $logger ); - $this->init_ee(); + // Create the config directory if not exist for file logger to initialize. + if ( ! is_dir( EE_CONF_ROOT ) ) { + shell_exec('sudo mkdir -p ' . EE_CONF_ROOT); + } if ( ! is_writable( EE_CONF_ROOT ) ) { EE::err( 'Please run `ee` as root user.' ); @@ -626,11 +624,7 @@ private function ensure_present_in_config( $var, $default) { $this->add_var_to_config_file( $var, $config_file_path ); return; } - $mkdir_success = mkdir ( $config_dir_path , 0755, true ); - if ( ! $mkdir_success ) { - EE::err("The config file path ${$config_dir_path} is not writable.\n Please run `ee` it as root user."); - } - $this->add_var_to_config_file($var, $config_file_path ); + EE::err("Please run `ee` as root user."); } } } @@ -681,6 +675,8 @@ private function set_alias( $alias ) { public function start() { + $this->init_ee(); + // Enable PHP error reporting to stderr if testing. if ( getenv( 'BEHAT_RUN' ) ) { $this->enable_error_reporting(); From 3082f6c2285df294fd4622c9e870b3171b7bdf19 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Tue, 12 Jun 2018 02:04:39 +0530 Subject: [PATCH 0174/1044] Update error message --- php/EE/Runner.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 704cf1df4..7e29fe240 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -486,7 +486,7 @@ public function init_logger() { } if ( ! is_writable( EE_CONF_ROOT ) ) { - EE::err( 'Please run `ee` as root user.' ); + EE::err( 'Please run `ee` with root privileges.' ); } if ( !empty( $this->arguments[0] ) && 'cli' === $this->arguments[0] && ! empty( $this->arguments[1] ) && 'info' === $this->arguments[1] && ! $this->config['ssh'] ) { @@ -624,7 +624,7 @@ private function ensure_present_in_config( $var, $default) { $this->add_var_to_config_file( $var, $config_file_path ); return; } - EE::err("Please run `ee` as root user."); + EE::err("Please run `ee` with root privileges."); } } } From 942d8ddf53863012dc08283f6aecbcb56994fbef Mon Sep 17 00:00:00 2001 From: Mriyam Tamuli <mbtamuli@gmail.com> Date: Tue, 12 Jun 2018 02:05:35 +0530 Subject: [PATCH 0175/1044] Update README for v4.0.0-beta.1 Signed-off-by: Mriyam Tamuli <mbtamuli@gmail.com> --- README.md | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 09bc3b19c..858485fe8 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,40 @@ # EasyEngine v4 -[![Build Status](https://travis-ci.org/EasyEngine/easyengine.svg?branch=release%2Fv4)](https://travis-ci.org/EasyEngine/easyengine) \ No newline at end of file +[![Build Status](https://travis-ci.org/EasyEngine/easyengine.svg?branch=master%2Fv4)](https://travis-ci.org/EasyEngine/easyengine) + +## Requirements + +* Docker +* Docker-Compose +* PHP CLI +* PHP Modules - `curl`, `sqlite3`, `pcntl` + +## Installing + +### Mac + +Once you have verified the requirements exist, download the `easyengine.phar` file using `wget` or `curl` and give it executable permissions: + +```bash +wget -O /usr/local/bin/ee https://raw.githubusercontent.com/EasyEngine/easyengine-builds/master/phar/easyengine.phar +chmod +x /usr/local/bin/ee +``` + +### Linux + +For Linux, we have created an installer script which will install all the dependencies for you. We have tested this on Ubuntu 14.04, 16.04, 18.04 and Debian 8. + +```bash +wget -qO ee rt.cx/ee4beta && sudo bash ee +``` + +Even if the script doesn't work for your distribution, you can manually install the dependencies and then run the following commands to install EasyEngine + +```bash +wget -O /usr/local/bin/ee https://raw.githubusercontent.com/EasyEngine/easyengine-builds/master/phar/easyengine.phar +chmod +x /usr/local/bin/ee +``` + +## Usage + +EasyEngine will currently only run with root privileges. You can run `ee help` or `ee help site` to get all the details about the various commands and subcommands that you can run. From 0480c35507bb7e6bfd29c11a654204b5f3a58008 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Tue, 12 Jun 2018 02:38:25 +0530 Subject: [PATCH 0176/1044] Update lock for v4.0.0-beta.1 --- composer.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.lock b/composer.lock index c662e986f..31d8246f5 100644 --- a/composer.lock +++ b/composer.lock @@ -271,12 +271,12 @@ "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "de002f79eb6a1df8b556f78d07f494358a37d47b" + "reference": "884d3b48a18d5a0063a8c2ecf38b256b93cf0735" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/de002f79eb6a1df8b556f78d07f494358a37d47b", - "reference": "de002f79eb6a1df8b556f78d07f494358a37d47b", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/884d3b48a18d5a0063a8c2ecf38b256b93cf0735", + "reference": "884d3b48a18d5a0063a8c2ecf38b256b93cf0735", "shasum": "" }, "require": { @@ -308,7 +308,7 @@ "MIT" ], "homepage": "https://github.com/easyengine/site-command", - "time": "2018-06-11T15:52:47+00:00" + "time": "2018-06-11T20:59:51+00:00" }, { "name": "justinrainbow/json-schema", From b4b22397572c3d1c47492396ca83a21893a16f73 Mon Sep 17 00:00:00 2001 From: Mriyam Tamuli <mbtamuli@gmail.com> Date: Tue, 12 Jun 2018 02:48:14 +0530 Subject: [PATCH 0177/1044] Bump working version to v4.0.0-beta.1 Signed-off-by: Mriyam Tamuli <mbtamuli@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 8a9ecc2ea..a35737f9a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.0.1 \ No newline at end of file +4.0.0-beta.1 From a31bf91e1436d8ecaed482922fde0451a344e79c Mon Sep 17 00:00:00 2001 From: Mriyam Tamuli <mbtamuli@gmail.com> Date: Tue, 12 Jun 2018 03:01:26 +0530 Subject: [PATCH 0178/1044] Update Travis badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 858485fe8..cc00f9ed1 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # EasyEngine v4 -[![Build Status](https://travis-ci.org/EasyEngine/easyengine.svg?branch=master%2Fv4)](https://travis-ci.org/EasyEngine/easyengine) +[![Build Status](https://travis-ci.org/EasyEngine/easyengine.svg?branch=master-v4)](https://travis-ci.org/EasyEngine/easyengine) ## Requirements From 6aa0fdc76da666ddadbce81a508d26665008414d Mon Sep 17 00:00:00 2001 From: Mriyam Tamuli <mbtamuli@gmail.com> Date: Tue, 12 Jun 2018 03:12:40 +0530 Subject: [PATCH 0179/1044] Update README.md Update Travis Badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 858485fe8..cc00f9ed1 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # EasyEngine v4 -[![Build Status](https://travis-ci.org/EasyEngine/easyengine.svg?branch=master%2Fv4)](https://travis-ci.org/EasyEngine/easyengine) +[![Build Status](https://travis-ci.org/EasyEngine/easyengine.svg?branch=master-v4)](https://travis-ci.org/EasyEngine/easyengine) ## Requirements From 68147523d346c8812766104b8c9a2431d33b63d8 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 12 Jun 2018 17:25:23 +0530 Subject: [PATCH 0180/1044] Update minimum requirements for php-cli in readme (#1061) Reason: Lib "yosymfony/toml" used in site-command Requires PHP >= 7.1. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cc00f9ed1..bcb6833de 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ * Docker * Docker-Compose -* PHP CLI +* PHP CLI (>=7.1) * PHP Modules - `curl`, `sqlite3`, `pcntl` ## Installing From a765430c04536502e5a6589905f5d8fb9448c519 Mon Sep 17 00:00:00 2001 From: Mriyam Tamuli <mbtamuli@gmail.com> Date: Tue, 12 Jun 2018 17:33:48 +0530 Subject: [PATCH 0181/1044] Remove MacOS install instructions Signed-off-by: Mriyam Tamuli <mbtamuli@gmail.com> --- README.md | 9 --------- 1 file changed, 9 deletions(-) diff --git a/README.md b/README.md index bcb6833de..81e4b6bd2 100644 --- a/README.md +++ b/README.md @@ -11,15 +11,6 @@ ## Installing -### Mac - -Once you have verified the requirements exist, download the `easyengine.phar` file using `wget` or `curl` and give it executable permissions: - -```bash -wget -O /usr/local/bin/ee https://raw.githubusercontent.com/EasyEngine/easyengine-builds/master/phar/easyengine.phar -chmod +x /usr/local/bin/ee -``` - ### Linux For Linux, we have created an installer script which will install all the dependencies for you. We have tested this on Ubuntu 14.04, 16.04, 18.04 and Debian 8. From dd60036cc246e74875fc59074a8671801b0c0ac9 Mon Sep 17 00:00:00 2001 From: Mriyam Tamuli <mbtamuli@gmail.com> Date: Tue, 12 Jun 2018 18:32:34 +0530 Subject: [PATCH 0182/1044] Add command examples to README Signed-off-by: Mriyam Tamuli <mbtamuli@gmail.com> --- README.md | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 81e4b6bd2..5fac12683 100644 --- a/README.md +++ b/README.md @@ -28,4 +28,53 @@ chmod +x /usr/local/bin/ee ## Usage -EasyEngine will currently only run with root privileges. You can run `ee help` or `ee help site` to get all the details about the various commands and subcommands that you can run. +## Basic Commands + +### create +Runs the site creation. + +```bash +ee site create example.com --wp # install wordpress without any page caching +ee site create example.com --wpredis # install wordpress + redis caching +ee site create example.com --wpsubir # install wpmu-subdirectory without any page caching +ee site create example.com --wpsubir --wpredis # install wpmu-subdirectory + redis caching +ee site create example.com --wpsubdom # install wpmu-subdomain without any page caching +ee site create example.com --wpsubdom --wpredis # install wpmu-subdomain + redis caching +``` + +### delete +Deletes an existing EasyEngine site. + +```bash +ee site delete example.com +``` + +### disable +Disables a website. It will stop and remove the docker containers of the website if they are running. + +```bash +ee site disable example.com +``` + +### enable +Enables a website. It will start the docker containers of the website if they are stopped. + +```bash +ee site enable example.com +``` + +### info +Display all the relevant site information, credentials and useful links. + +```bash +ee site info example.com +``` + +### list +Lists the created websites. + +```bash +ee site list +``` + +EasyEngine will currently only run with root privileges. You can run `ee help`, `ee help site` and `ee help site create` to get all the details about the various commands and subcommands that you can run. From 1c54f0df6e9bb5a05041b45d8d43eb451423fbc8 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Tue, 12 Jun 2018 18:47:11 +0530 Subject: [PATCH 0183/1044] Fix undefined index error --- php/EE/Runner.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 7e29fe240..b45fd3e79 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -489,7 +489,7 @@ public function init_logger() { EE::err( 'Please run `ee` with root privileges.' ); } - if ( !empty( $this->arguments[0] ) && 'cli' === $this->arguments[0] && ! empty( $this->arguments[1] ) && 'info' === $this->arguments[1] && ! $this->config['ssh'] ) { + if ( !empty( $this->arguments[0] ) && 'cli' === $this->arguments[0] && ! empty( $this->arguments[1] ) && 'info' === $this->arguments[1] ) { $file_logging_path = '/dev/null'; } else { @@ -727,7 +727,7 @@ public function start() { // Protect 'cli info' from most of the runtime, // except when the command will be run over SSH - if ( ! empty( $this->arguments[0] ) && 'cli' === $this->arguments[0] && ! empty( $this->arguments[1] ) && 'info' === $this->arguments[1] && ! $this->config['ssh'] ) { + if ( ! empty( $this->arguments[0] ) && 'cli' === $this->arguments[0] && ! empty( $this->arguments[1] ) && 'info' === $this->arguments[1] ) { $this->_run_command_and_exit(); } From 3442e00d5bf92878e7494df17f64e5bbec6913d8 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Tue, 12 Jun 2018 20:10:59 +0530 Subject: [PATCH 0184/1044] Update travis to append nightly in develop-v4 version --- ci/prepare.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ci/prepare.sh b/ci/prepare.sh index bac8770ca..33580d6eb 100755 --- a/ci/prepare.sh +++ b/ci/prepare.sh @@ -2,4 +2,11 @@ # called by Travis CI +if [[ "$TRAVIS_BRANCH" == "develop-v4" ]]; then + version=$(head -n 1 VERSION) + version="$(echo $version | xargs)" + version+="-nightly" + echo $version > VERSION +fi + php -dphar.readonly=0 ./utils/make-phar.php easyengine.phar --quite > /dev/null \ No newline at end of file From 652b0ae5dd5c92a43f7754cd7340ac83a041e3c8 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Wed, 13 Jun 2018 10:35:50 +0530 Subject: [PATCH 0185/1044] Fix update bug --- php/commands/src/CLI_Command.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/php/commands/src/CLI_Command.php b/php/commands/src/CLI_Command.php index e43fa36e7..bdd4ea727 100644 --- a/php/commands/src/CLI_Command.php +++ b/php/commands/src/CLI_Command.php @@ -259,7 +259,8 @@ public function update( $_, $assoc_args ) { if ( false === chmod( $temp, $mode ) ) { EE::error( sprintf( 'Cannot chmod %s.', $temp ) ); } - class_exists( '\cli\Colors' ); // This autoloads \cli\Colors - after we move the file we no longer have access to this class. + class_exists( '\cli\Streams' ); // This autoloads \cli\Streams - after we move the file we no longer have access to this class. + class_exists( '\cli\Colors' ); // This autoloads \cli\Colors if ( false === rename( $temp, $old_phar ) ) { EE::error( sprintf( 'Cannot move %s to %s', $temp, $old_phar ) ); } From 8ab4c10115ecd080781367984cb9f990a0a9193f Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Wed, 13 Jun 2018 20:04:15 +0530 Subject: [PATCH 0186/1044] Add test to verify site create command is working --- features/bootstrap/FeatureContext.php | 16 +++--- features/site.feature | 76 +++++++++++++++++---------- features/steps/then.php | 21 ++++++++ 3 files changed, 76 insertions(+), 37 deletions(-) diff --git a/features/bootstrap/FeatureContext.php b/features/bootstrap/FeatureContext.php index 2f736646d..24af9106c 100644 --- a/features/bootstrap/FeatureContext.php +++ b/features/bootstrap/FeatureContext.php @@ -35,13 +35,13 @@ public function getHookDefinitionResources() { * @AfterFeature */ public static function cleanup( FeatureEvent $event ) { - $sites = ( array_column( array_slice( $event->getFeature()->getScenarios()[1]->getExamples()->getRows(), 1 ), 0 ) ); - $out = shell_exec( "bin/ee site list" ); - - foreach ( $sites as $site ) { - if ( strpos( $out, $site ) !== false ) { - exec( "bin/ee site delete $site" ); - } - } + // $sites = ( array_column( array_slice( $event->getFeature()->getScenarios()[1]->getExamples()->getRows(), 1 ), 0 ) ); + // $out = shell_exec( "bin/ee site list" ); + + // foreach ( $sites as $site ) { + // if ( strpos( $out, $site ) !== false ) { + // exec( "bin/ee site delete $site" ); + // } + // } } } diff --git a/features/site.feature b/features/site.feature index 1552501cc..e08359c83 100644 --- a/features/site.feature +++ b/features/site.feature @@ -1,8 +1,16 @@ -Feature: Create WordPress site +Feature: Site Command - Scenario: ee site command working correctly + Scenario: ee throws error when run without root Given 'bin/ee' is installed When I run 'bin/ee' + Then STDOUT should return something like + """ + Error: Please run `ee` with root privileges. + """ + + Scenario: ee executable is command working correctly + Given 'bin/ee' is installed + When I run 'sudo bin/ee' Then STDOUT should return something like """ NAME @@ -10,46 +18,56 @@ Feature: Create WordPress site ee """ - Scenario Outline: Created site is running successfully - When I run 'bin/ee site create <site> --wp' - Then The '<site>' should have webroot - And The '<site>' should have tables - - Examples: - | site | - | hello.test | - | world.test | - - Scenario Outline: List the sites - When I run 'bin/ee site list' + Scenario: Check site command is present + When I run 'sudo bin/ee site' Then STDOUT should return something like """ - List of Sites: - - - hello.test - - world.test + usage: ee site """ + Scenario Outline: 'site create' is running successfully + When I run 'sudo bin/ee site create <site> --wp' + # When I run 'echo <site>' + Then Request on '<site>' should contain following headers: + | header | + | HTTP/1.1 200 OK | + + # And The '<site>' should have tables + Examples: | site | | hello.test | - | world.test | + # Scenario Outline: List the sites + # When I run 'sudo bin/ee site list' + # Then STDOUT should return something like + # """ + # List of Sites: - Scenario Outline: Delete the sites - When I run 'bin/ee site delete <site>' - Then The '<site>' containers should be removed - And The '<site>' webroot should be removed - And The '<site>' db entry should be removed + # - hello.test + # - world.test + # """ - Examples: - | site | - | hello.test | - | world.test | + # Examples: + # | site | + # | hello.test | + # | world.test | + + + # Scenario Outline: Delete the sites + # When I run 'sudo bin/ee site delete <site>' + # Then The '<site>' containers should be removed + # And The '<site>' webroot should be removed + # And The '<site>' db entry should be removed + + # Examples: + # | site | + # | hello.test | + # | world.test | #Scenario: Site Clean-up works properly -# When I cleanup test 'bin/ee site create <site>' +# When I cleanup test 'sudo bin/ee site create <site>' # Then The '<site>' containers should be removed # And The '<site>' webroot should be removed # And The '<site>' db entry should be removed diff --git a/features/steps/then.php b/features/steps/then.php index 2262854de..3b28d3f85 100644 --- a/features/steps/then.php +++ b/features/steps/then.php @@ -16,6 +16,27 @@ function ( $world, $condition, $string ) { } } ); +$steps->Then( + '/^Request on \'([^\']*)\' should contain following headers:$/', function ( $world, $site, $table ) { + $url = 'http://' . $site; + + $ch = curl_init(); + curl_setopt( $ch, CURLOPT_URL,$url ); + curl_setopt( $ch, CURLOPT_HEADER, true ); + curl_setopt( $ch, CURLOPT_NOBODY, true ); + curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); + $headers = curl_exec( $ch ); + curl_close ($ch); + + $rows = $table->getHash(); + + foreach ( $rows as $row ) { + if( strpos( $headers, $row['header'] ) === false ) { + throw new Exception( "Unable to find ". $row['header'] ."\nActual output is : " . $headers ); + } + } + } +); $steps->Then( From 4ffdd4fc1e25f919db664c9e5517865ccc9bd03b Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Wed, 13 Jun 2018 22:35:58 +0530 Subject: [PATCH 0187/1044] Correct previous test --- features/bootstrap/FeatureContext.php | 16 ++--- features/site.feature | 49 ++++++++------- features/steps/then.php | 91 ++++++++++++++------------- 3 files changed, 84 insertions(+), 72 deletions(-) diff --git a/features/bootstrap/FeatureContext.php b/features/bootstrap/FeatureContext.php index 24af9106c..a6e84c1a8 100644 --- a/features/bootstrap/FeatureContext.php +++ b/features/bootstrap/FeatureContext.php @@ -35,13 +35,13 @@ public function getHookDefinitionResources() { * @AfterFeature */ public static function cleanup( FeatureEvent $event ) { - // $sites = ( array_column( array_slice( $event->getFeature()->getScenarios()[1]->getExamples()->getRows(), 1 ), 0 ) ); - // $out = shell_exec( "bin/ee site list" ); - - // foreach ( $sites as $site ) { - // if ( strpos( $out, $site ) !== false ) { - // exec( "bin/ee site delete $site" ); - // } - // } + // $sites = ( array_column( array_slice( $event->getFeature()->getScenarios()[1]->getExamples()->getRows(), 1 ), 0 ) ); + // $out = shell_exec( "bin/ee site list" ); + + // foreach ( $sites as $site ) { + // if ( strpos( $out, $site ) !== false ) { + // exec( "bin/ee site delete $site" ); + // } + // } } } diff --git a/features/site.feature b/features/site.feature index e08359c83..248ac0d21 100644 --- a/features/site.feature +++ b/features/site.feature @@ -27,7 +27,8 @@ Feature: Site Command Scenario Outline: 'site create' is running successfully When I run 'sudo bin/ee site create <site> --wp' - # When I run 'echo <site>' + Then The site '<site>' should have webroot + Then The site '<site>' should have WordPress Then Request on '<site>' should contain following headers: | header | | HTTP/1.1 200 OK | @@ -38,32 +39,36 @@ Feature: Site Command | site | | hello.test | - # Scenario Outline: List the sites - # When I run 'sudo bin/ee site list' - # Then STDOUT should return something like - # """ - # List of Sites: + Scenario Outline: List the sites + When I run 'sudo bin/ee site list' + Then STDOUT should return something like + """ + List of Sites: - # - hello.test - # - world.test - # """ + hello.test + """ + + Examples: + | site | + | hello.test | - # Examples: - # | site | - # | hello.test | - # | world.test | + Scenario Outline: Delete the sites + When I run 'sudo bin/ee site delete <site>' + Then The '<site>' db entry should be removed + And The '<site>' webroot should be removed + And Following containers of site '<site>' should be removed: + | container | + | nginx | + | php | + | db | + | redis | + | phpmyadmin | - # Scenario Outline: Delete the sites - # When I run 'sudo bin/ee site delete <site>' - # Then The '<site>' containers should be removed - # And The '<site>' webroot should be removed - # And The '<site>' db entry should be removed - # Examples: - # | site | - # | hello.test | - # | world.test | + Examples: + | site | + | hello.test | #Scenario: Site Clean-up works properly diff --git a/features/steps/then.php b/features/steps/then.php index 3b28d3f85..a4ab9906c 100644 --- a/features/steps/then.php +++ b/features/steps/then.php @@ -1,74 +1,81 @@ <?php $steps->Then( - "/^STDOUT should return (something like|exactly)$/", - function ( $world, $condition, $string ) { - if ( "exactly" === $condition ) { - if ( (string) $string !== $world->output ) { - throw new Exception( - "Actual output is:\n" . $world->output - ); - } - } else if ( "something like" === $condition ) { - if ( strpos( $world->output, (string) $string ) !== false ) { - throw new Exception( "Actual output is : " . $world->output ); - } + "/^STDOUT should return (something like|exactly)$/", function ( $world, $condition, $string ) { + if ( "exactly" === $condition ) { + if ( (string) $string !== $world->output ) { + throw new Exception( + "Actual output is:\n" . $world->output + ); + } + } else if ( "something like" === $condition ) { + if ( strpos( $world->output, (string) $string ) !== false ) { + throw new Exception( "Actual output is : " . $world->output ); } } +} ); $steps->Then( '/^Request on \'([^\']*)\' should contain following headers:$/', function ( $world, $site, $table ) { - $url = 'http://' . $site; + $url = 'http://' . $site; - $ch = curl_init(); - curl_setopt( $ch, CURLOPT_URL,$url ); - curl_setopt( $ch, CURLOPT_HEADER, true ); - curl_setopt( $ch, CURLOPT_NOBODY, true ); - curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); - $headers = curl_exec( $ch ); - curl_close ($ch); + $ch = curl_init(); + curl_setopt( $ch, CURLOPT_URL,$url ); + curl_setopt( $ch, CURLOPT_HEADER, true ); + curl_setopt( $ch, CURLOPT_NOBODY, true ); + curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); + $headers = curl_exec( $ch ); + curl_close ($ch); - $rows = $table->getHash(); + $rows = $table->getHash(); - foreach ( $rows as $row ) { - if( strpos( $headers, $row['header'] ) === false ) { - throw new Exception( "Unable to find ". $row['header'] ."\nActual output is : " . $headers ); - } + foreach ( $rows as $row ) { + if( strpos( $headers, $row['header'] ) === false ) { + throw new Exception( "Unable to find ". $row['header'] ."\nActual output is : " . $headers ); } } +} ); $steps->Then( - '/^The \'([^\']*)\' should have webroot$/', function ( $world, $site ) { - if ( is_dir( $_SERVER['HOME'] . "/Sites/" . $site ) ) { - if ( ! file_exists( $_SERVER['HOME'] . "/Sites/" . $site . "/app/src/wp-config.php" ) ) { - throw new Exception( "WordPress data not found!" ); - } - } else { + '/^The site \'([^\']*)\' should have webroot$/', function ( $world, $site ) { + if ( ! is_dir( getenv('HOME') . "/ee-sites/" . $site ) ) { throw new Exception( "Site root not created!" ); } } ); $steps->Then( - '/^The \'([^\']*)\' should have tables$/', function ( $world, $site ) { - if ( is_dir( $_SERVER['HOME'] . "/Sites/" . $site ) ) { - exec( "bin/ee wp $site db check", $output ); - if ( strpos( $world->output, 'Success' ) === false ) { - throw new Exception( "WordPress db check failed!" ); - } + '/^The site \'([^\']*)\' should have WordPress$/', function ( $world, $site ) { + if ( ! file_exists( getenv('HOME') . "/ee-sites/" . $site . "/app/src/wp-config.php" ) ) { + throw new Exception( "WordPress data not found!" ); } } ); +// $steps->Then( +// '/^The \'([^\']*)\' containers should be removed$/', function ( $world, $site ) { +// $containers = array( 'php', 'nginx', 'db', 'mail' ); +// $base_name = implode( '', explode( '.', $site ) ); + +// foreach ( $containers as $container ) { +// $container_name = $base_name . '_' . $container . '_1'; +// exec( "docker inspect -f '{{.State.Running}}' $container_name > /dev/null 2>&1", $exec_out, $return ); +// if ( ! $return ) { +// throw new Exception( "$container_name has not been removed!" ); +// } +// } +// } +// ); + $steps->Then( - '/^The \'([^\']*)\' containers should be removed$/', function ( $world, $site ) { - $containers = array( 'php', 'nginx', 'db', 'mail' ); - $base_name = implode( '', explode( '.', $site ) ); + '/^Following containers of site \'([^\']*)\' should be removed:$/', function ( $world, $site, $table ) { + + $containers = $table->getHash(); foreach ( $containers as $container ) { - $container_name = $base_name . '_' . $container . '_1'; + $container_name = 'hellotest_' . $container . '_1'; exec( "docker inspect -f '{{.State.Running}}' $container_name > /dev/null 2>&1", $exec_out, $return ); if ( ! $return ) { throw new Exception( "$container_name has not been removed!" ); @@ -79,7 +86,7 @@ function ( $world, $condition, $string ) { $steps->Then( '/^The \'([^\']*)\' webroot should be removed$/', function ( $world, $site ) { - if ( file_exists( $_SERVER['HOME'] . "/Sites/" . $site ) ) { + if ( file_exists( getenv('HOME') . "/ee-sites/" . $site ) ) { throw new Exception( "Webroot has not been removed!" ); } } From 38275f9eded1ca26bd9c60c3767bb58429bc157d Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Thu, 14 Jun 2018 12:07:36 +0530 Subject: [PATCH 0188/1044] WIP update tests --- features/site.feature | 37 ++++++++++++++++--------------------- features/steps/then.php | 25 +++++-------------------- features/steps/when.php | 7 +++++-- 3 files changed, 26 insertions(+), 43 deletions(-) diff --git a/features/site.feature b/features/site.feature index 248ac0d21..bd8cae46e 100644 --- a/features/site.feature +++ b/features/site.feature @@ -39,25 +39,24 @@ Feature: Site Command | site | | hello.test | - Scenario Outline: List the sites - When I run 'sudo bin/ee site list' - Then STDOUT should return something like - """ - List of Sites: - - hello.test - """ - - Examples: - | site | - | hello.test | + Scenario: List the sites + When I run 'sudo bin/ee site list' + Then STDOUT should return exactly + """ + List of all Sites: + hello.test + """ - Scenario Outline: Delete the sites - When I run 'sudo bin/ee site delete <site>' - Then The '<site>' db entry should be removed - And The '<site>' webroot should be removed - And Following containers of site '<site>' should be removed: + Scenario: Delete the sites + When I run 'sudo bin/ee site delete hello.test' + Then STDOUT should return exactly + """ + Error: Site hello.test does not exist. + """ + And The 'hello.test' db entry should be removed + And The 'hello.test' webroot should be removed + And Following containers of site 'hello.test' should be removed: | container | | nginx | | php | @@ -66,10 +65,6 @@ Feature: Site Command | phpmyadmin | - Examples: - | site | - | hello.test | - #Scenario: Site Clean-up works properly # When I cleanup test 'sudo bin/ee site create <site>' diff --git a/features/steps/then.php b/features/steps/then.php index a4ab9906c..cfe75ffe4 100644 --- a/features/steps/then.php +++ b/features/steps/then.php @@ -1,15 +1,15 @@ <?php $steps->Then( - "/^STDOUT should return (something like|exactly)$/", function ( $world, $condition, $string ) { + "/^STDOUT should(\ not)? return (something like|exactly)$/", function ( $world, $not, $condition, $string ) { if ( "exactly" === $condition ) { - if ( (string) $string !== $world->output ) { + if ( ((string) $string !== $world->output) && !$not ) { throw new Exception( "Actual output is:\n" . $world->output ); } } else if ( "something like" === $condition ) { - if ( strpos( $world->output, (string) $string ) !== false ) { + if ( (strpos( $world->output, (string) $string ) !== false) && !$not ) { throw new Exception( "Actual output is : " . $world->output ); } } @@ -54,28 +54,13 @@ } ); -// $steps->Then( -// '/^The \'([^\']*)\' containers should be removed$/', function ( $world, $site ) { -// $containers = array( 'php', 'nginx', 'db', 'mail' ); -// $base_name = implode( '', explode( '.', $site ) ); - -// foreach ( $containers as $container ) { -// $container_name = $base_name . '_' . $container . '_1'; -// exec( "docker inspect -f '{{.State.Running}}' $container_name > /dev/null 2>&1", $exec_out, $return ); -// if ( ! $return ) { -// throw new Exception( "$container_name has not been removed!" ); -// } -// } -// } -// ); - $steps->Then( '/^Following containers of site \'([^\']*)\' should be removed:$/', function ( $world, $site, $table ) { $containers = $table->getHash(); foreach ( $containers as $container ) { - $container_name = 'hellotest_' . $container . '_1'; + $container_name = 'hellotest_' . $container['container'] . '_1'; exec( "docker inspect -f '{{.State.Running}}' $container_name > /dev/null 2>&1", $exec_out, $return ); if ( ! $return ) { throw new Exception( "$container_name has not been removed!" ); @@ -94,7 +79,7 @@ $steps->Then( '/^The \'([^\']*)\' db entry should be removed$/', function ( $world, $site ) { - $out = shell_exec( "bin/ee site list" ); + $out = shell_exec( "sudo bin/ee site list" ); if ( strpos( $out, $site ) !== false ) { throw new Exception( "$site db entry not been removed!" ); } diff --git a/features/steps/when.php b/features/steps/when.php index b29fa157f..95e5fddd2 100644 --- a/features/steps/when.php +++ b/features/steps/when.php @@ -1,9 +1,12 @@ <?php +// echo ; +include_once( __DIR__ . '/../../php/class-ee.php' ); +include_once( __DIR__ . '/../../php/utils.php' ); $steps->When( "/^I run \'([^\']*)\'$/", function ( $world, $command ) { - exec( $command, $output ); - $world->output = trim( implode( "\n", $output ) ); + $launch = EE::launch($command); + $world->output = trim( implode( "\n", $launch->output ) ); } ); From acdad395af03ef10dab25ad820d0c69fb15dfb8a Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Thu, 14 Jun 2018 13:13:15 +0530 Subject: [PATCH 0189/1044] WIP fix tests --- features/site.feature | 69 ++++++++++++++++++++--------------------- features/steps/then.php | 19 +++++++++++- features/steps/when.php | 5 +-- 3 files changed, 54 insertions(+), 39 deletions(-) diff --git a/features/site.feature b/features/site.feature index bd8cae46e..6f59f4e15 100644 --- a/features/site.feature +++ b/features/site.feature @@ -1,43 +1,43 @@ Feature: Site Command - Scenario: ee throws error when run without root - Given 'bin/ee' is installed - When I run 'bin/ee' - Then STDOUT should return something like - """ - Error: Please run `ee` with root privileges. - """ + # Scenario: ee throws error when run without root + # Given 'bin/ee' is installed + # When I run 'bin/ee' + # Then STDOUT should return something like + # """ + # Error: Please run `ee` with root privileges. + # """ - Scenario: ee executable is command working correctly - Given 'bin/ee' is installed - When I run 'sudo bin/ee' - Then STDOUT should return something like - """ - NAME + # Scenario: ee executable is command working correctly + # Given 'bin/ee' is installed + # When I run 'sudo bin/ee' + # Then STDOUT should return something like + # """ + # NAME - ee - """ + # ee + # """ - Scenario: Check site command is present - When I run 'sudo bin/ee site' - Then STDOUT should return something like - """ - usage: ee site - """ + # Scenario: Check site command is present + # When I run 'sudo bin/ee site' + # Then STDOUT should return something like + # """ + # usage: ee site + # """ - Scenario Outline: 'site create' is running successfully - When I run 'sudo bin/ee site create <site> --wp' - Then The site '<site>' should have webroot - Then The site '<site>' should have WordPress - Then Request on '<site>' should contain following headers: - | header | - | HTTP/1.1 200 OK | + # Scenario Outline: 'site create' is running successfully + # When I run 'sudo bin/ee site create <site> --wp' + # Then The site '<site>' should have webroot + # Then The site '<site>' should have WordPress + # Then Request on '<site>' should contain following headers: + # | header | + # | HTTP/1.1 200 OK | - # And The '<site>' should have tables + # # And The '<site>' should have tables - Examples: - | site | - | hello.test | + # Examples: + # | site | + # | hello.test | Scenario: List the sites When I run 'sudo bin/ee site list' @@ -50,10 +50,7 @@ Feature: Site Command Scenario: Delete the sites When I run 'sudo bin/ee site delete hello.test' - Then STDOUT should return exactly - """ - Error: Site hello.test does not exist. - """ + Then STDERR should be empty And The 'hello.test' db entry should be removed And The 'hello.test' webroot should be removed And Following containers of site 'hello.test' should be removed: diff --git a/features/steps/then.php b/features/steps/then.php index cfe75ffe4..87bfc86aa 100644 --- a/features/steps/then.php +++ b/features/steps/then.php @@ -1,7 +1,7 @@ <?php $steps->Then( - "/^STDOUT should(\ not)? return (something like|exactly)$/", function ( $world, $not, $condition, $string ) { + "/^STDOUT should(\ not)? (something like|exactly)$/", function ( $world, $not, $condition, $string ) { if ( "exactly" === $condition ) { if ( ((string) $string !== $world->output) && !$not ) { throw new Exception( @@ -15,6 +15,23 @@ } } ); + +$steps->Then( + "/^(STDOUT|STDERR) should be empty$/", function ( $world, $stream ) { + if($stream === 'STDERR') { + $output = $world->command->stderr; + } + else { + $output = $world->command->stdout; + } + if ( $output !== '' ) { + throw new Exception( + "Actual output is:\n" . $output + ); + } +} +); + $steps->Then( '/^Request on \'([^\']*)\' should contain following headers:$/', function ( $world, $site, $table ) { $url = 'http://' . $site; diff --git a/features/steps/when.php b/features/steps/when.php index 95e5fddd2..923b5c5d7 100644 --- a/features/steps/when.php +++ b/features/steps/when.php @@ -6,7 +6,8 @@ $steps->When( "/^I run \'([^\']*)\'$/", function ( $world, $command ) { - $launch = EE::launch($command); - $world->output = trim( implode( "\n", $launch->output ) ); + $world->command = EE::launch($command, false, true); +// $world->output = trim( implode( "\n", $launch->stdout) ); + $a=1; } ); From 3a3bed71484c7e1489d88f2e06898d2e9b94c58f Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Thu, 14 Jun 2018 13:38:58 +0530 Subject: [PATCH 0190/1044] Update behat to v3.x --- composer.json | 2 +- composer.lock | 517 +++++++++++++++++++------- features/bootstrap/FeatureContext.php | 83 +++-- 3 files changed, 429 insertions(+), 173 deletions(-) diff --git a/composer.json b/composer.json index 0c5727af8..06758baa3 100644 --- a/composer.json +++ b/composer.json @@ -48,7 +48,7 @@ "wp-cli/php-cli-tools": "~0.11.2" }, "require-dev": { - "behat/behat": "2.5.*", + "behat/behat": "3.4.*", "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3", "phpunit/phpunit": "3.7.*", "roave/security-advisories": "dev-master", diff --git a/composer.lock b/composer.lock index 31d8246f5..79ae72f18 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": "60cb6927fc84af7853527d6849f128d4", + "content-hash": "4543f9ae8e25d79d6858fa2d3e8ce1b3", "packages": [ { "name": "composer/ca-bundle", @@ -500,6 +500,55 @@ ], "time": "2017-07-11T12:54:05+00:00" }, + { + "name": "psr/container", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://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" + ], + "time": "2017-02-14T16:28:37+00:00" + }, { "name": "psr/log", "version": "1.0.2", @@ -784,25 +833,32 @@ }, { "name": "symfony/config", - "version": "v2.8.41", + "version": "v3.4.11", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "93bdf96d0e3c9b29740bf9050e7a996b443c8436" + "reference": "73e055cf2e6467715f187724a0347ea32079967c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/93bdf96d0e3c9b29740bf9050e7a996b443c8436", - "reference": "93bdf96d0e3c9b29740bf9050e7a996b443c8436", + "url": "https://api.github.com/repos/symfony/config/zipball/73e055cf2e6467715f187724a0347ea32079967c", + "reference": "73e055cf2e6467715f187724a0347ea32079967c", "shasum": "" }, "require": { - "php": ">=5.3.9", - "symfony/filesystem": "~2.3|~3.0.0", + "php": "^5.5.9|>=7.0.8", + "symfony/filesystem": "~2.8|~3.0|~4.0", "symfony/polyfill-ctype": "~1.8" }, + "conflict": { + "symfony/dependency-injection": "<3.3", + "symfony/finder": "<3.3" + }, "require-dev": { - "symfony/yaml": "~2.7|~3.0.0" + "symfony/dependency-injection": "~3.3|~4.0", + "symfony/event-dispatcher": "~3.3|~4.0", + "symfony/finder": "~3.3|~4.0", + "symfony/yaml": "~3.0|~4.0" }, "suggest": { "symfony/yaml": "To use the yaml reference dumper" @@ -810,7 +866,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -837,41 +893,49 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2018-05-01T22:52:40+00:00" + "time": "2018-05-14T16:49:53+00:00" }, { "name": "symfony/console", - "version": "v2.8.41", + "version": "v3.4.11", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "e8e59b74ad1274714dad2748349b55e3e6e630c7" + "reference": "36f83f642443c46f3cf751d4d2ee5d047d757a27" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/e8e59b74ad1274714dad2748349b55e3e6e630c7", - "reference": "e8e59b74ad1274714dad2748349b55e3e6e630c7", + "url": "https://api.github.com/repos/symfony/console/zipball/36f83f642443c46f3cf751d4d2ee5d047d757a27", + "reference": "36f83f642443c46f3cf751d4d2ee5d047d757a27", "shasum": "" }, "require": { - "php": ">=5.3.9", - "symfony/debug": "^2.7.2|~3.0.0", + "php": "^5.5.9|>=7.0.8", + "symfony/debug": "~2.8|~3.0|~4.0", "symfony/polyfill-mbstring": "~1.0" }, + "conflict": { + "symfony/dependency-injection": "<3.4", + "symfony/process": "<3.3" + }, "require-dev": { "psr/log": "~1.0", - "symfony/event-dispatcher": "~2.1|~3.0.0", - "symfony/process": "~2.1|~3.0.0" + "symfony/config": "~3.3|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/event-dispatcher": "~2.8|~3.0|~4.0", + "symfony/lock": "~3.4|~4.0", + "symfony/process": "~3.3|~4.0" }, "suggest": { "psr/log-implementation": "For using the console logger", "symfony/event-dispatcher": "", + "symfony/lock": "", "symfony/process": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -898,37 +962,36 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-05-15T21:17:45+00:00" + "time": "2018-05-16T08:49:21+00:00" }, { "name": "symfony/debug", - "version": "v3.0.9", + "version": "v3.4.11", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "697c527acd9ea1b2d3efac34d9806bf255278b0a" + "reference": "b28fd73fefbac341f673f5efd707d539d6a19f68" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/697c527acd9ea1b2d3efac34d9806bf255278b0a", - "reference": "697c527acd9ea1b2d3efac34d9806bf255278b0a", + "url": "https://api.github.com/repos/symfony/debug/zipball/b28fd73fefbac341f673f5efd707d539d6a19f68", + "reference": "b28fd73fefbac341f673f5efd707d539d6a19f68", "shasum": "" }, "require": { - "php": ">=5.5.9", + "php": "^5.5.9|>=7.0.8", "psr/log": "~1.0" }, "conflict": { "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" }, "require-dev": { - "symfony/class-loader": "~2.8|~3.0", - "symfony/http-kernel": "~2.8|~3.0" + "symfony/http-kernel": "~2.8|~3.0|~4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -955,43 +1018,51 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2016-07-30T07:22:48+00:00" + "time": "2018-05-16T14:03:39+00:00" }, { "name": "symfony/dependency-injection", - "version": "v2.8.41", + "version": "v3.4.11", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "3d7cbf34cd75ede7f94b9b990f85bd089e15cd55" + "reference": "8a4672aca8db6d807905d695799ea7d83c8e5bba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/3d7cbf34cd75ede7f94b9b990f85bd089e15cd55", - "reference": "3d7cbf34cd75ede7f94b9b990f85bd089e15cd55", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/8a4672aca8db6d807905d695799ea7d83c8e5bba", + "reference": "8a4672aca8db6d807905d695799ea7d83c8e5bba", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": "^5.5.9|>=7.0.8", + "psr/container": "^1.0" }, "conflict": { - "symfony/expression-language": "<2.6" + "symfony/config": "<3.3.7", + "symfony/finder": "<3.3", + "symfony/proxy-manager-bridge": "<3.4", + "symfony/yaml": "<3.4" + }, + "provide": { + "psr/container-implementation": "1.0" }, "require-dev": { - "symfony/config": "~2.2|~3.0.0", - "symfony/expression-language": "~2.6|~3.0.0", - "symfony/yaml": "~2.3.42|~2.7.14|~2.8.7|~3.0.7" + "symfony/config": "~3.3|~4.0", + "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/yaml": "~3.4|~4.0" }, "suggest": { "symfony/config": "", "symfony/expression-language": "For using expressions in service container configuration", + "symfony/finder": "For using double-star glob patterns or when GLOB_BRACE portability is required", "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", "symfony/yaml": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -1018,31 +1089,34 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2018-02-19T16:23:47+00:00" + "time": "2018-05-25T11:57:15+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v2.8.41", + "version": "v3.4.11", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "9b69aad7d4c086dc94ebade2d5eb9145da5dac8c" + "reference": "fdd5abcebd1061ec647089c6c41a07ed60af09f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/9b69aad7d4c086dc94ebade2d5eb9145da5dac8c", - "reference": "9b69aad7d4c086dc94ebade2d5eb9145da5dac8c", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/fdd5abcebd1061ec647089c6c41a07ed60af09f8", + "reference": "fdd5abcebd1061ec647089c6c41a07ed60af09f8", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": "^5.5.9|>=7.0.8" + }, + "conflict": { + "symfony/dependency-injection": "<3.3" }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "^2.0.5|~3.0.0", - "symfony/dependency-injection": "~2.6|~3.0.0", - "symfony/expression-language": "~2.6|~3.0.0", - "symfony/stopwatch": "~2.3|~3.0.0" + "symfony/config": "~2.8|~3.0|~4.0", + "symfony/dependency-injection": "~3.3|~4.0", + "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/stopwatch": "~2.8|~3.0|~4.0" }, "suggest": { "symfony/dependency-injection": "", @@ -1051,7 +1125,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -1078,29 +1152,30 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2018-04-06T07:35:03+00:00" + "time": "2018-04-06T07:35:25+00:00" }, { "name": "symfony/filesystem", - "version": "v3.0.9", + "version": "v3.4.11", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "b2da5009d9bacbd91d83486aa1f44c793a8c380d" + "reference": "8e03ca3fa52a0f56b87506f38cf7bd3f9442b3a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/b2da5009d9bacbd91d83486aa1f44c793a8c380d", - "reference": "b2da5009d9bacbd91d83486aa1f44c793a8c380d", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/8e03ca3fa52a0f56b87506f38cf7bd3f9442b3a0", + "reference": "8e03ca3fa52a0f56b87506f38cf7bd3f9442b3a0", "shasum": "" }, "require": { - "php": ">=5.5.9" + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-ctype": "~1.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -1127,29 +1202,29 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2016-07-20T05:43:46+00:00" + "time": "2018-05-16T08:49:21+00:00" }, { "name": "symfony/finder", - "version": "v2.8.41", + "version": "v3.4.11", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "79764d21163db295f0daf8bd9d9b91f97e65db6a" + "reference": "472a92f3df8b247b49ae364275fb32943b9656c6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/79764d21163db295f0daf8bd9d9b91f97e65db6a", - "reference": "79764d21163db295f0daf8bd9d9b91f97e65db6a", + "url": "https://api.github.com/repos/symfony/finder/zipball/472a92f3df8b247b49ae364275fb32943b9656c6", + "reference": "472a92f3df8b247b49ae364275fb32943b9656c6", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": "^5.5.9|>=7.0.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -1176,7 +1251,7 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2018-05-15T21:17:45+00:00" + "time": "2018-05-16T08:49:21+00:00" }, { "name": "symfony/polyfill-ctype", @@ -1343,30 +1418,34 @@ }, { "name": "symfony/translation", - "version": "v2.8.41", + "version": "v3.4.11", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "c6a27966a92fa361bf2c3a938abc6dee91f7ad67" + "reference": "7047f725e35eab768137c677f8c38e4a2a8e38fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/c6a27966a92fa361bf2c3a938abc6dee91f7ad67", - "reference": "c6a27966a92fa361bf2c3a938abc6dee91f7ad67", + "url": "https://api.github.com/repos/symfony/translation/zipball/7047f725e35eab768137c677f8c38e4a2a8e38fb", + "reference": "7047f725e35eab768137c677f8c38e4a2a8e38fb", "shasum": "" }, "require": { - "php": ">=5.3.9", + "php": "^5.5.9|>=7.0.8", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { - "symfony/config": "<2.7" + "symfony/config": "<2.8", + "symfony/dependency-injection": "<3.4", + "symfony/yaml": "<3.4" }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~2.8", - "symfony/intl": "~2.7.25|^2.8.18|~3.2.5", - "symfony/yaml": "~2.2|~3.0.0" + "symfony/config": "~2.8|~3.0|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/finder": "~2.8|~3.0|~4.0", + "symfony/intl": "^2.8.18|^3.2.5|~4.0", + "symfony/yaml": "~3.4|~4.0" }, "suggest": { "psr/log-implementation": "To use logging capability in translator", @@ -1376,7 +1455,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -1403,30 +1482,39 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2018-05-21T09:59:10+00:00" + "time": "2018-05-21T10:06:52+00:00" }, { "name": "symfony/yaml", - "version": "v2.8.41", + "version": "v3.4.11", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "51356b7a2ff7c9fd06b2f1681cc463bb62b5c1ff" + "reference": "c5010cc1692ce1fa328b1fb666961eb3d4a85bb0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/51356b7a2ff7c9fd06b2f1681cc463bb62b5c1ff", - "reference": "51356b7a2ff7c9fd06b2f1681cc463bb62b5c1ff", + "url": "https://api.github.com/repos/symfony/yaml/zipball/c5010cc1692ce1fa328b1fb666961eb3d4a85bb0", + "reference": "c5010cc1692ce1fa328b1fb666961eb3d4a85bb0", "shasum": "" }, "require": { - "php": ">=5.3.9", + "php": "^5.5.9|>=7.0.8", "symfony/polyfill-ctype": "~1.8" }, + "conflict": { + "symfony/console": "<3.4" + }, + "require-dev": { + "symfony/console": "~3.4|~4.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -1453,7 +1541,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2018-05-01T22:52:40+00:00" + "time": "2018-05-03T23:18:14+00:00" }, { "name": "wp-cli/autoload-splitter", @@ -1694,31 +1782,37 @@ "packages-dev": [ { "name": "behat/behat", - "version": "v2.5.5", + "version": "v3.4.3", "source": { "type": "git", "url": "https://github.com/Behat/Behat.git", - "reference": "c1e48826b84669c97a1efa78459aedfdcdcf2120" + "reference": "d60b161bff1b95ec4bb80bb8cb210ccf890314c2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Behat/Behat/zipball/c1e48826b84669c97a1efa78459aedfdcdcf2120", - "reference": "c1e48826b84669c97a1efa78459aedfdcdcf2120", + "url": "https://api.github.com/repos/Behat/Behat/zipball/d60b161bff1b95ec4bb80bb8cb210ccf890314c2", + "reference": "d60b161bff1b95ec4bb80bb8cb210ccf890314c2", "shasum": "" }, "require": { - "behat/gherkin": "~2.3.0", - "php": ">=5.3.1", - "symfony/config": "~2.3", - "symfony/console": "~2.0", - "symfony/dependency-injection": "~2.0", - "symfony/event-dispatcher": "~2.0", - "symfony/finder": "~2.0", - "symfony/translation": "~2.3", - "symfony/yaml": "~2.0" + "behat/gherkin": "^4.5.1", + "behat/transliterator": "^1.2", + "container-interop/container-interop": "^1.2", + "ext-mbstring": "*", + "php": ">=5.3.3", + "psr/container": "^1.0", + "symfony/class-loader": "~2.1||~3.0||~4.0", + "symfony/config": "~2.3||~3.0||~4.0", + "symfony/console": "~2.5||~3.0||~4.0", + "symfony/dependency-injection": "~2.1||~3.0||~4.0", + "symfony/event-dispatcher": "~2.1||~3.0||~4.0", + "symfony/translation": "~2.3||~3.0||~4.0", + "symfony/yaml": "~2.1||~3.0||~4.0" }, "require-dev": { - "phpunit/phpunit": "~3.7.19" + "herrera-io/box": "~1.6.1", + "phpunit/phpunit": "^4.8.36|^6.3", + "symfony/process": "~2.5|~3.0|~4.0" }, "suggest": { "behat/mink-extension": "for integration with Mink testing framework", @@ -1729,9 +1823,15 @@ "bin/behat" ], "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2.x-dev" + } + }, "autoload": { "psr-0": { - "Behat\\Behat": "src/" + "Behat\\Behat": "src/", + "Behat\\Testwork": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1748,44 +1848,50 @@ "description": "Scenario-oriented BDD framework for PHP 5.3", "homepage": "http://behat.org/", "keywords": [ + "Agile", "BDD", - "Behat", - "Symfony2" - ], - "time": "2015-06-01T09:37:55+00:00" + "ScenarioBDD", + "Scrum", + "StoryBDD", + "User story", + "business", + "development", + "documentation", + "examples", + "symfony", + "testing" + ], + "time": "2017-11-27T10:37:56+00:00" }, { "name": "behat/gherkin", - "version": "v2.3.5", + "version": "v4.5.1", "source": { "type": "git", "url": "https://github.com/Behat/Gherkin.git", - "reference": "2b33963da5525400573560c173ab5c9c057e1852" + "reference": "74ac03d52c5e23ad8abd5c5cce4ab0e8dc1b530a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Behat/Gherkin/zipball/2b33963da5525400573560c173ab5c9c057e1852", - "reference": "2b33963da5525400573560c173ab5c9c057e1852", + "url": "https://api.github.com/repos/Behat/Gherkin/zipball/74ac03d52c5e23ad8abd5c5cce4ab0e8dc1b530a", + "reference": "74ac03d52c5e23ad8abd5c5cce4ab0e8dc1b530a", "shasum": "" }, "require": { - "php": ">=5.3.1", - "symfony/finder": "~2.0" + "php": ">=5.3.1" }, "require-dev": { - "symfony/config": "~2.0", - "symfony/translation": "~2.0", - "symfony/yaml": "~2.0" + "phpunit/phpunit": "~4.5|~5", + "symfony/phpunit-bridge": "~2.7|~3", + "symfony/yaml": "~2.3|~3" }, "suggest": { - "symfony/config": "If you want to use Config component to manage resources", - "symfony/translation": "If you want to use Symfony2 translations adapter", "symfony/yaml": "If you want to parse features, represented in YAML files" }, "type": "library", "extra": { "branch-alias": { - "dev-develop": "2.2-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -1809,11 +1915,87 @@ "keywords": [ "BDD", "Behat", + "Cucumber", "DSL", - "Symfony2", + "gherkin", "parser" ], - "time": "2013-10-15T11:22:17+00:00" + "time": "2017-08-30T11:04:43+00:00" + }, + { + "name": "behat/transliterator", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/Behat/Transliterator.git", + "reference": "826ce7e9c2a6664c0d1f381cbb38b1fb80a7ee2c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Behat/Transliterator/zipball/826ce7e9c2a6664c0d1f381cbb38b1fb80a7ee2c", + "reference": "826ce7e9c2a6664c0d1f381cbb38b1fb80a7ee2c", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "chuyskywalker/rolling-curl": "^3.1", + "php-yaoi/php-yaoi": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + }, + "autoload": { + "psr-0": { + "Behat\\Transliterator": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Artistic-1.0" + ], + "description": "String transliterator", + "keywords": [ + "i18n", + "slug", + "transliterator" + ], + "time": "2017-04-04T11:38:05+00:00" + }, + { + "name": "container-interop/container-interop", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/container-interop/container-interop.git", + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/container-interop/container-interop/zipball/79cbf1341c22ec75643d841642dd5d6acd83bdb8", + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8", + "shasum": "" + }, + "require": { + "psr/container": "^1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Interop\\Container\\": "src/Interop/Container/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", + "homepage": "https://github.com/container-interop/container-interop", + "time": "2017-02-14T19:40:03+00:00" }, { "name": "dealerdirect/phpcodesniffer-composer-installer", @@ -1946,25 +2128,25 @@ }, { "name": "phpunit/php-file-iterator", - "version": "1.4.5", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + "reference": "cecbc684605bb0cc288828eb5d65d93d5c676d3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cecbc684605bb0cc288828eb5d65d93d5c676d3c", + "reference": "cecbc684605bb0cc288828eb5d65d93d5c676d3c", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -1979,7 +2161,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -1989,7 +2171,7 @@ "filesystem", "iterator" ], - "time": "2017-11-27T13:52:08+00:00" + "time": "2018-06-11T11:44:00+00:00" }, { "name": "phpunit/php-text-template", @@ -2133,38 +2315,39 @@ }, { "name": "phpunit/phpunit", - "version": "3.7.38", + "version": "3.7.18", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "38709dc22d519a3d1be46849868aa2ddf822bcf6" + "reference": "82335c294ae39a59965b0dc2027ac74eb62f53f1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/38709dc22d519a3d1be46849868aa2ddf822bcf6", - "reference": "38709dc22d519a3d1be46849868aa2ddf822bcf6", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/82335c294ae39a59965b0dc2027ac74eb62f53f1", + "reference": "82335c294ae39a59965b0dc2027ac74eb62f53f1", "shasum": "" }, "require": { - "ext-ctype": "*", "ext-dom": "*", - "ext-json": "*", "ext-pcre": "*", "ext-reflection": "*", "ext-spl": "*", "php": ">=5.3.3", - "phpunit/php-code-coverage": "~1.2", - "phpunit/php-file-iterator": "~1.3", - "phpunit/php-text-template": "~1.1", - "phpunit/php-timer": "~1.0", - "phpunit/phpunit-mock-objects": "~1.2", - "symfony/yaml": "~2.0" + "phpunit/php-code-coverage": ">=1.2.1,<1.3.0", + "phpunit/php-file-iterator": ">=1.3.1", + "phpunit/php-text-template": ">=1.1.1", + "phpunit/php-timer": ">=1.0.2,<1.1.0", + "phpunit/phpunit-mock-objects": ">=1.2.0,<1.3.0", + "symfony/yaml": ">=2.2.0" }, "require-dev": { - "pear-pear.php.net/pear": "1.9.4" + "pear-pear/pear": "1.9.4" }, "suggest": { - "phpunit/php-invoker": "~1.1" + "ext-json": "*", + "ext-simplexml": "*", + "ext-tokenizer": "*", + "phpunit/php-invoker": ">=1.1.0,<1.2.0" }, "bin": [ "composer/bin/phpunit" @@ -2202,7 +2385,7 @@ "testing", "xunit" ], - "time": "2014-10-17T09:04:17+00:00" + "time": "2013-03-07T21:45:39+00:00" }, { "name": "phpunit/phpunit-mock-objects", @@ -2471,6 +2654,62 @@ ], "time": "2018-06-06T23:58:19+00:00" }, + { + "name": "symfony/class-loader", + "version": "v3.4.11", + "source": { + "type": "git", + "url": "https://github.com/symfony/class-loader.git", + "reference": "e63c12699822bb3b667e7216ba07fbcc3a3e203e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/class-loader/zipball/e63c12699822bb3b667e7216ba07fbcc3a3e203e", + "reference": "e63c12699822bb3b667e7216ba07fbcc3a3e203e", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "require-dev": { + "symfony/finder": "~2.8|~3.0|~4.0", + "symfony/polyfill-apcu": "~1.1" + }, + "suggest": { + "symfony/polyfill-apcu": "For using ApcClassLoader on HHVM" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\ClassLoader\\": "" + }, + "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": "Symfony ClassLoader Component", + "homepage": "https://symfony.com", + "time": "2018-01-03T07:37:34+00:00" + }, { "name": "wimg/php-compatibility", "version": "8.1.0", diff --git a/features/bootstrap/FeatureContext.php b/features/bootstrap/FeatureContext.php index a6e84c1a8..f6ea8cc13 100644 --- a/features/bootstrap/FeatureContext.php +++ b/features/bootstrap/FeatureContext.php @@ -1,7 +1,7 @@ <?php -use Behat\Behat\Context\BehatContext, - Behat\Behat\Exception\PendingException; +use Behat\Behat\Context\Context; + use Behat\Gherkin\Node\PyStringNode, Behat\Gherkin\Node\TableNode, @@ -9,39 +9,56 @@ use Behat\Behat\Event\FeatureEvent; -class FeatureContext extends BehatContext implements \Behat\Behat\Context\ClosuredContextInterface { - public $output; +class FeatureContext implements Context { + public $command; public $webroot_path; - + + /** - * Returns array of step definition files (*.php). - * - * @return array - */ - public function getStepDefinitionResources() { - return glob( __DIR__ . '/../steps/*.php' ); - } + * @When I run :arg1 + */ + public function iRun($arg1) + { + throw new PendingException(); + } - /** - * Returns array of hook definition files (*.php). - * - * @return array - */ - public function getHookDefinitionResources() { - return array(); - } + /** + * @Then STDOUT should return exactly + */ + public function stdoutShouldReturnExactly(PyStringNode $string) + { + throw new PendingException(); + } - /** - * @AfterFeature - */ - public static function cleanup( FeatureEvent $event ) { - // $sites = ( array_column( array_slice( $event->getFeature()->getScenarios()[1]->getExamples()->getRows(), 1 ), 0 ) ); - // $out = shell_exec( "bin/ee site list" ); - - // foreach ( $sites as $site ) { - // if ( strpos( $out, $site ) !== false ) { - // exec( "bin/ee site delete $site" ); - // } - // } - } + /** + * @Then STDERR should be empty + */ + public function stderrShouldBeEmpty() + { + throw new PendingException(); + } + + /** + * @Then The :arg1 db entry should be removed + */ + public function theDbEntryShouldBeRemoved($arg1) + { + throw new PendingException(); + } + + /** + * @Then The :arg1 webroot should be removed + */ + public function theWebrootShouldBeRemoved($arg1) + { + throw new PendingException(); + } + + /** + * @Then Following containers of site :arg1 should be removed: + */ + public function followingContainersOfSiteShouldBeRemoved($arg1, TableNode $table) + { + throw new PendingException(); + } } From f2a45c39920d30ac64994bd1f68bcb883a22ff39 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Thu, 14 Jun 2018 15:13:34 +0530 Subject: [PATCH 0191/1044] Remove extra constants --- php/init-ee.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/php/init-ee.php b/php/init-ee.php index 953a62641..41a27baad 100644 --- a/php/init-ee.php +++ b/php/init-ee.php @@ -4,9 +4,7 @@ define( 'EE', true ); define( 'EE_VERSION', trim( file_get_contents( EE_ROOT . '/VERSION' ) ) ); define( 'EE_START_MICROTIME', microtime( true ) ); -define( 'HOME', $_SERVER['HOME'] ); define( 'EE_CONF_ROOT', '/opt/easyengine' ); -define( 'EE_SITE_CONF_ROOT', EE_ROOT . '/ee4-config' ); if ( file_exists( EE_ROOT . '/vendor/autoload.php' ) ) { define( 'EE_VENDOR_DIR', EE_ROOT . '/vendor' ); From 3eacd1365752a598c6f9f96e98448217c88b0f9d Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Fri, 15 Jun 2018 10:27:45 +0530 Subject: [PATCH 0192/1044] Port existing changes to v3 --- features/bootstrap/FeatureContext.php | 195 +++++++++++++++++++------- features/extra/no-mail.php | 7 - features/site.feature | 93 ++++++------ features/steps/given.php | 29 ---- features/steps/then.php | 104 -------------- features/steps/when.php | 13 -- 6 files changed, 182 insertions(+), 259 deletions(-) delete mode 100644 features/extra/no-mail.php delete mode 100644 features/steps/given.php delete mode 100644 features/steps/then.php delete mode 100644 features/steps/when.php diff --git a/features/bootstrap/FeatureContext.php b/features/bootstrap/FeatureContext.php index f6ea8cc13..d85d9e9df 100644 --- a/features/bootstrap/FeatureContext.php +++ b/features/bootstrap/FeatureContext.php @@ -1,64 +1,153 @@ <?php +include_once(__DIR__ . '/../../php/class-ee.php'); +include_once(__DIR__ . '/../../php/utils.php'); + use Behat\Behat\Context\Context; use Behat\Gherkin\Node\PyStringNode, - Behat\Gherkin\Node\TableNode, - Behat\Gherkin\Node\OutlineNode; - -use Behat\Behat\Event\FeatureEvent; + Behat\Gherkin\Node\TableNode; -class FeatureContext implements Context { +class FeatureContext implements Context +{ public $command; public $webroot_path; - - + + /** + * @Given :command is installed + */ + public function isInstalled($command) + { + exec("type " . $command, $output, $return_status); + if (0 !== $return_status) { + throw new Exception($command . " is not installed! Exit code is:" . $return_status); + } + } + + /** + * @When I run :command + */ + public function iRun($command) + { + $this->command = EE::launch($command, false, true); + } + + /** + * @Then /(STDOUT|STDERR) should return exactly/ + */ + public function stdoutShouldReturnExactly($output_stream, PyStringNode $expected_output) + { + $command_output = $output_stream === "STDOUT" ? $this->command->stdout : $this->command->stderr; + + if ((string)$expected_output !== trim($command_output)) { + throw new Exception("Actual output is:\n" . $command_output); + } + } + + /** + * @Then /(STDOUT|STDERR) should return something like/ + */ + public function stdoutShouldReturnSomethingLike($output_stream, PyStringNode $expected_output) + { + $command_output = $output_stream === "STDOUT" ? $this->command->stdout : $this->command->stderr; + + if (strpos($command_output, (string)$expected_output) === false) { + throw new Exception("Actual output is:\n" . $command_output); + } + } + + /** + * @Then The :site db entry should be removed + */ + public function theDbEntryShouldBeRemoved($site) + { + $out = shell_exec("sudo bin/ee site list"); + if (strpos($out, $site) !== false) { + throw new Exception("$site db entry not been removed!"); + } + + } + + /** + * @Then The :site webroot should be removed + */ + public function theWebrootShouldBeRemoved($site) + { + if (file_exists(getenv('HOME') . "/ee-sites/" . $site)) { + throw new Exception("Webroot has not been removed!"); + } + } + + /** + * @Then Following containers of site :site should be removed: + */ + public function followingContainersOfSiteShouldBeRemoved($site, TableNode $table) + { + $containers = $table->getHash(); + $site_name = implode(explode('.', $site)); + + foreach ($containers as $container) { + + $sevice = $container['container']; + $container_name = $site_name . '_' . $sevice . '_1'; + + exec("docker inspect -f '{{.State.Running}}' $container_name > /dev/null 2>&1", $exec_out, $return); + if (!$return) { + throw new Exception("$container_name has not been removed!"); + } + } + } + + /** + * @Then The site :site should have webroot + */ + public function theSiteShouldHaveWebroot($site) + { + if (!file_exists(getenv('HOME') . "/ee-sites/" . $site)) { + throw new Exception("Webroot has not been created!"); + } + } + + /** + * @Then The site :site should have WordPress + */ + public function theSiteShouldHaveWordpress($site) + { + if (!file_exists(getenv('HOME') . "/ee-sites/" . $site . "/app/src/wp-config.php")) { + throw new Exception("WordPress data not found!"); + } + } + + /** + * @Then Request on :site should contain following headers: + */ + public function requestOnShouldContainFollowingHeaders($site, TableNode $table) + { + $url = 'http://' . $site; + + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, $url); + curl_setopt($ch, CURLOPT_HEADER, true); + curl_setopt($ch, CURLOPT_NOBODY, true); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + $headers = curl_exec($ch); + curl_close($ch); + + $rows = $table->getHash(); + + foreach ($rows as $row) { + if (strpos($headers, $row['header']) === false) { + throw new Exception("Unable to find " . $row['header'] . "\nActual output is : " . $headers); + } + } + } + /** - * @When I run :arg1 - */ - public function iRun($arg1) - { - throw new PendingException(); - } - - /** - * @Then STDOUT should return exactly - */ - public function stdoutShouldReturnExactly(PyStringNode $string) - { - throw new PendingException(); - } - - /** - * @Then STDERR should be empty - */ - public function stderrShouldBeEmpty() - { - throw new PendingException(); - } - - /** - * @Then The :arg1 db entry should be removed - */ - public function theDbEntryShouldBeRemoved($arg1) - { - throw new PendingException(); - } - - /** - * @Then The :arg1 webroot should be removed - */ - public function theWebrootShouldBeRemoved($arg1) - { - throw new PendingException(); - } - - /** - * @Then Following containers of site :arg1 should be removed: - */ - public function followingContainersOfSiteShouldBeRemoved($arg1, TableNode $table) - { - throw new PendingException(); - } + * @AfterFeature + */ + public static function cleanup(AfterScenarioScope $scope) + { + exec("bin/ee site delete hello.test"); + } } diff --git a/features/extra/no-mail.php b/features/extra/no-mail.php deleted file mode 100644 index 3acdcabe2..000000000 --- a/features/extra/no-mail.php +++ /dev/null @@ -1,7 +0,0 @@ -<?php - -function wp_mail( $to ) { - // Log for testing purposes - EE::log( "EE test suite: Sent email to {$to}." ); -} - diff --git a/features/site.feature b/features/site.feature index 6f59f4e15..ff330bbdd 100644 --- a/features/site.feature +++ b/features/site.feature @@ -1,47 +1,41 @@ Feature: Site Command - # Scenario: ee throws error when run without root - # Given 'bin/ee' is installed - # When I run 'bin/ee' - # Then STDOUT should return something like - # """ - # Error: Please run `ee` with root privileges. - # """ - - # Scenario: ee executable is command working correctly - # Given 'bin/ee' is installed - # When I run 'sudo bin/ee' - # Then STDOUT should return something like - # """ - # NAME - - # ee - # """ - - # Scenario: Check site command is present - # When I run 'sudo bin/ee site' - # Then STDOUT should return something like - # """ - # usage: ee site - # """ + Scenario: ee throws error when run without root + Given 'bin/ee' is installed + When I run 'bin/ee' + Then STDERR should return exactly + """ + Error: Please run `ee` with root privileges. + """ - # Scenario Outline: 'site create' is running successfully - # When I run 'sudo bin/ee site create <site> --wp' - # Then The site '<site>' should have webroot - # Then The site '<site>' should have WordPress - # Then Request on '<site>' should contain following headers: - # | header | - # | HTTP/1.1 200 OK | + Scenario: ee executable is command working correctly + Given 'bin/ee' is installed + When I run 'sudo bin/ee' + Then STDOUT should return something like + """ + NAME - # # And The '<site>' should have tables + ee + """ - # Examples: - # | site | - # | hello.test | + Scenario: Check site command is present + When I run 'sudo bin/ee site' + Then STDOUT should return something like + """ + usage: ee site + """ - Scenario: List the sites - When I run 'sudo bin/ee site list' - Then STDOUT should return exactly + Scenario: Create site successfully + When I run 'sudo bin/ee site create hello.test --wp' + Then The site 'hello.test' should have webroot + And The site 'hello.test' should have WordPress + And Request on 'hello.test' should contain following headers: + | header | + | HTTP/1.1 200 OK | + + Scenario: List the sites + When I run 'sudo bin/ee site list' + Then STDOUT should return exactly """ List of all Sites: @@ -50,26 +44,19 @@ Feature: Site Command Scenario: Delete the sites When I run 'sudo bin/ee site delete hello.test' - Then STDERR should be empty + Then STDOUT should return something like + """ + Site hello.test deleted. + """ + And STDERR should return exactly + """ + """ And The 'hello.test' db entry should be removed And The 'hello.test' webroot should be removed - And Following containers of site 'hello.test' should be removed: + And Following containers of site 'abc.test' should be removed: | container | | nginx | | php | | db | | redis | | phpmyadmin | - - - -#Scenario: Site Clean-up works properly -# When I cleanup test 'sudo bin/ee site create <site>' -# Then The '<site>' containers should be removed -# And The '<site>' webroot should be removed -# And The '<site>' db entry should be removed -# -# Examples: -# | site | -# | hello.test | -# | world.test | diff --git a/features/steps/given.php b/features/steps/given.php deleted file mode 100644 index 1f2b07042..000000000 --- a/features/steps/given.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - - -$steps->Given( - "/^\'([^\']*)\' is installed$/", - function ( $world, $package ) { - exec( "type " . $package, $output, $return_status ); - if ( 0 !== $return_status ) { - throw new Exception( $package . " is not installed! Code:" . $return_status ); - } - } -); - -$steps->Given( - "/^running container \'([^\']*)\'$/", - function ( $world, $container ) { - exec( "docker inspect -f '{{.State.Running}}' " . $container, $output, $code ); - // $output = trim(implode("\n", $output)); - if ( 0 !== $code ) { - throw new Exception( $container . " is not available!" ); - } - } -); -/* -$steps->Given('/^Webroot path in config$/', function($world) { - //throw new \Behat\Behat\Exception\PendingException(); - $world->webroot_path = rtrim( \EE::get_runner()->config['sites_path'], '/\\' ) . '/'; -}); -*/ diff --git a/features/steps/then.php b/features/steps/then.php deleted file mode 100644 index 87bfc86aa..000000000 --- a/features/steps/then.php +++ /dev/null @@ -1,104 +0,0 @@ -<?php - -$steps->Then( - "/^STDOUT should(\ not)? (something like|exactly)$/", function ( $world, $not, $condition, $string ) { - if ( "exactly" === $condition ) { - if ( ((string) $string !== $world->output) && !$not ) { - throw new Exception( - "Actual output is:\n" . $world->output - ); - } - } else if ( "something like" === $condition ) { - if ( (strpos( $world->output, (string) $string ) !== false) && !$not ) { - throw new Exception( "Actual output is : " . $world->output ); - } - } -} -); - -$steps->Then( - "/^(STDOUT|STDERR) should be empty$/", function ( $world, $stream ) { - if($stream === 'STDERR') { - $output = $world->command->stderr; - } - else { - $output = $world->command->stdout; - } - if ( $output !== '' ) { - throw new Exception( - "Actual output is:\n" . $output - ); - } -} -); - -$steps->Then( - '/^Request on \'([^\']*)\' should contain following headers:$/', function ( $world, $site, $table ) { - $url = 'http://' . $site; - - $ch = curl_init(); - curl_setopt( $ch, CURLOPT_URL,$url ); - curl_setopt( $ch, CURLOPT_HEADER, true ); - curl_setopt( $ch, CURLOPT_NOBODY, true ); - curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); - $headers = curl_exec( $ch ); - curl_close ($ch); - - $rows = $table->getHash(); - - foreach ( $rows as $row ) { - if( strpos( $headers, $row['header'] ) === false ) { - throw new Exception( "Unable to find ". $row['header'] ."\nActual output is : " . $headers ); - } - } -} -); - - -$steps->Then( - '/^The site \'([^\']*)\' should have webroot$/', function ( $world, $site ) { - if ( ! is_dir( getenv('HOME') . "/ee-sites/" . $site ) ) { - throw new Exception( "Site root not created!" ); - } -} -); - -$steps->Then( - '/^The site \'([^\']*)\' should have WordPress$/', function ( $world, $site ) { - if ( ! file_exists( getenv('HOME') . "/ee-sites/" . $site . "/app/src/wp-config.php" ) ) { - throw new Exception( "WordPress data not found!" ); - } -} -); - -$steps->Then( - '/^Following containers of site \'([^\']*)\' should be removed:$/', function ( $world, $site, $table ) { - - $containers = $table->getHash(); - - foreach ( $containers as $container ) { - $container_name = 'hellotest_' . $container['container'] . '_1'; - exec( "docker inspect -f '{{.State.Running}}' $container_name > /dev/null 2>&1", $exec_out, $return ); - if ( ! $return ) { - throw new Exception( "$container_name has not been removed!" ); - } - } -} -); - -$steps->Then( - '/^The \'([^\']*)\' webroot should be removed$/', function ( $world, $site ) { - if ( file_exists( getenv('HOME') . "/ee-sites/" . $site ) ) { - throw new Exception( "Webroot has not been removed!" ); - } -} -); - -$steps->Then( - '/^The \'([^\']*)\' db entry should be removed$/', function ( $world, $site ) { - $out = shell_exec( "sudo bin/ee site list" ); - if ( strpos( $out, $site ) !== false ) { - throw new Exception( "$site db entry not been removed!" ); - } -} -); diff --git a/features/steps/when.php b/features/steps/when.php deleted file mode 100644 index 923b5c5d7..000000000 --- a/features/steps/when.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php -// echo ; -include_once( __DIR__ . '/../../php/class-ee.php' ); -include_once( __DIR__ . '/../../php/utils.php' ); - -$steps->When( - "/^I run \'([^\']*)\'$/", - function ( $world, $command ) { - $world->command = EE::launch($command, false, true); -// $world->output = trim( implode( "\n", $launch->stdout) ); - $a=1; - } -); From 1520983bef9895d2963265d9402d525d62efe099 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Fri, 15 Jun 2018 16:57:57 +0530 Subject: [PATCH 0193/1044] Update README for tests --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 5fac12683..11f2e7415 100644 --- a/README.md +++ b/README.md @@ -78,3 +78,11 @@ ee site list ``` EasyEngine will currently only run with root privileges. You can run `ee help`, `ee help site` and `ee help site create` to get all the details about the various commands and subcommands that you can run. + + +## Test + +EasyEngine is currently using [behat](http://behat.org/) v3.4.x functional tests. The tests for site-command are inside the `features/` directory in the core repository and can be run using +``` +vendor/bin/behat +``` \ No newline at end of file From 796afcfc03125634dd2b9f2381dbcb93439dfb43 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Fri, 15 Jun 2018 19:03:15 +0530 Subject: [PATCH 0194/1044] Fix test cleanup --- features/bootstrap/FeatureContext.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/features/bootstrap/FeatureContext.php b/features/bootstrap/FeatureContext.php index d85d9e9df..cb599b096 100644 --- a/features/bootstrap/FeatureContext.php +++ b/features/bootstrap/FeatureContext.php @@ -4,6 +4,7 @@ include_once(__DIR__ . '/../../php/utils.php'); use Behat\Behat\Context\Context; +use Behat\Behat\Hook\Scope\AfterFeatureScope; use Behat\Gherkin\Node\PyStringNode, @@ -146,8 +147,8 @@ public function requestOnShouldContainFollowingHeaders($site, TableNode $table) /** * @AfterFeature */ - public static function cleanup(AfterScenarioScope $scope) + public static function cleanup(AfterFeatureScope $scope) { - exec("bin/ee site delete hello.test"); + exec("sudo bin/ee site delete hello.test"); } } From 019ed30a7f2de8e0e142c46d0c34af268a9b9be5 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Mon, 18 Jun 2018 14:15:06 +0530 Subject: [PATCH 0195/1044] Fix deprecated warning in php7.2 Closes https://github.com/EasyEngine/easyengine/issues/1078. --- php/class-ee-docker.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php index 5b50c82e9..573d6bece 100644 --- a/php/class-ee-docker.php +++ b/php/class-ee-docker.php @@ -127,7 +127,7 @@ public static function disconnect_network( $name, $connected_to ) { /** * Function to connect site network to appropriate containers. */ - public function connect_site_network_to( $site_name, $to_container ) { + public static function connect_site_network_to( $site_name, $to_container ) { if ( self::connect_network( $site_name, $to_container ) ) { EE::success( "Site connected to $to_container." ); From 9eb7adbb668b53e1500285ddc0192a8821f7986a Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Mon, 18 Jun 2018 21:11:45 +0530 Subject: [PATCH 0196/1044] Confirmed sudo at entrypoint --- php/EE/Runner.php | 8 ++++---- php/init-ee.php | 5 +++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index b45fd3e79..a5a6c64a7 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -482,11 +482,11 @@ public function init_logger() { // Create the config directory if not exist for file logger to initialize. if ( ! is_dir( EE_CONF_ROOT ) ) { - shell_exec('sudo mkdir -p ' . EE_CONF_ROOT); + shell_exec('mkdir -p ' . EE_CONF_ROOT); } if ( ! is_writable( EE_CONF_ROOT ) ) { - EE::err( 'Please run `ee` with root privileges.' ); + EE::err( 'Config root: ' . EE_CONF_ROOT . ' is not writable by EasyEngine' ); } if ( !empty( $this->arguments[0] ) && 'cli' === $this->arguments[0] && ! empty( $this->arguments[1] ) && 'info' === $this->arguments[1] ) { @@ -548,7 +548,7 @@ public function init_config() { array_unshift( $args, 'cli' ); unset( $assoc_args['version'] ); } - + // ee3 backward compatibility to wp-cli flags $wp_compat_array_map = array( 'user' => 'admin_user', @@ -624,7 +624,7 @@ private function ensure_present_in_config( $var, $default) { $this->add_var_to_config_file( $var, $config_file_path ); return; } - EE::err("Please run `ee` with root privileges."); + EE::err("Configuration directory: $config_dir_path is not writable by EasyEngine."); } } } diff --git a/php/init-ee.php b/php/init-ee.php index 41a27baad..80608e008 100644 --- a/php/init-ee.php +++ b/php/init-ee.php @@ -1,5 +1,10 @@ <?php +if( posix_geteuid() ) { + echo "\033[1;31mError:\033[0m Please run `ee` with root privileges."; + return; +} + // Can be used by plugins/themes to check if EE is running or not define( 'EE', true ); define( 'EE_VERSION', trim( file_get_contents( EE_ROOT . '/VERSION' ) ) ); From a5fee57ab1b4b394b9b4edb400b22a0db94e9b74 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Fri, 15 Jun 2018 12:09:33 +0530 Subject: [PATCH 0197/1044] Extend EE::launch() to accomodate env and cwd --- php/class-ee.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/php/class-ee.php b/php/class-ee.php index b2fbc68dd..3f73788d3 100644 --- a/php/class-ee.php +++ b/php/class-ee.php @@ -803,21 +803,24 @@ public static function error_to_string( $errors ) { /** * Launch an arbitrary external process that takes over I/O. * - * @access public + * @access public * @category Execution * - * @param string $command External process to launch. - * @param boolean $exit_on_error Whether to exit if the command returns an elevated return code. + * @param string $command External process to launch. + * @param boolean $exit_on_error Whether to exit if the command returns an elevated return code. * @param boolean $return_detailed Whether to return an exit status (default) or detailed execution results. + * @param array $env Environment variables to set when running the command. + * @param string $cwd Directory to execute the command in. + * * @return int|ProcessRun The command exit status, or a ProcessRun object for full details. */ - public static function launch( $command, $exit_on_error = true, $return_detailed = false ) { + public static function launch( $command, $exit_on_error = true, $return_detailed = false, $env = array(), $cwd = null ) { Utils\check_proc_available( 'launch' ); - $proc = Process::create( $command ); + $proc = Process::create( $command, $cwd, $env ); $results = $proc->run(); - if ( -1 == $results->return_code ) { + if ( - 1 == $results->return_code ) { self::warning( "Spawned process returned exit code {$results->return_code}, which could be caused by a custom compiled version of PHP that uses the --enable-sigchild option." ); } From ca5dc5fa8a24ad1e8b3221146577d5bc10c49ef4 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Fri, 15 Jun 2018 12:09:46 +0530 Subject: [PATCH 0198/1044] Extend default_launch() for env and cwd Add default_exec and default_shell_exec with debugging Update random_password to accomodate length of password generated --- php/utils.php | 48 +++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 43 insertions(+), 5 deletions(-) diff --git a/php/utils.php b/php/utils.php index 8ae12b7a6..a06097cc6 100644 --- a/php/utils.php +++ b/php/utils.php @@ -1381,12 +1381,16 @@ function delete_dir( $dir ) { /** * Function to generate random password. + * + * @param int $length Length of random password required. + * + * @return string Random Password of specified length. */ -function random_password() { +function random_password( $length = 12 ) { $alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'; $pass = array(); $alphaLength = strlen( $alphabet ) - 1; - for ( $i = 0; $i < 12; $i ++ ) { + for ( $i = 0; $i < $length; $i ++ ) { $n = rand( 0, $alphaLength ); $pass[] = $alphabet[$n]; } @@ -1425,18 +1429,52 @@ function default_debug( $launch ) { /** * Default Launch command. + * This takes care of executing the command as well as debugging it to terminal as well as file. * - * @param Object $launch EE::Launch command object + * @param string $command The command to be executed via EE::launch(); + * @param array $env Environment variables to set when running the command. + * @param string $cwd Directory to execute the command in. + * + * @return bool True if executed successfully. False if failed. */ -function default_launch( $command ) { - $launch = EE::launch( $command, false, true ); +function default_launch( $command, $env = array(), $cwd = null ) { + $launch = EE::launch( $command, false, true, $env, $cwd ); default_debug( $launch ); if ( ! $launch->return_code ) { return true; } + return false; } +/** + * Function that takes care of executing the command as well as debugging it to terminal as well as file. + * + * @param string $command The command to be executed via exec(); + * + * @return bool True if executed successfully. False if failed. + */ +function default_exec( $command ) { + exec( $command, $out, $return_code ); + EE::debug( 'COMMAND: ' . $command ); + EE::debug( 'STDOUT: ' . implode( $out ) ); + EE::debug( 'RETURN CODE: ' . $return_code ); + if ( ! $return_code ) { + return true; + } + return false; +} + +/** + * Function that takes care of executing the command as well as debugging it to terminal as well as file. + * + * @param string $command The command to be executed via shell_exec(); + */ +function default_shell_exec( $command ) { + EE::debug( 'COMMAND: ' . $command ); + EE::debug( 'STDOUT: ' . shell_exec( $command ) ); +} + /** * Function to return the type from arguments. * From 01e60389dade1ef9584e6255f94817d892f5681d Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Mon, 18 Jun 2018 22:23:39 +0530 Subject: [PATCH 0199/1044] default env to null to use the same environment as the current PHP process --- php/utils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/utils.php b/php/utils.php index a06097cc6..58efa4fdf 100644 --- a/php/utils.php +++ b/php/utils.php @@ -1437,7 +1437,7 @@ function default_debug( $launch ) { * * @return bool True if executed successfully. False if failed. */ -function default_launch( $command, $env = array(), $cwd = null ) { +function default_launch( $command, $env = null, $cwd = null ) { $launch = EE::launch( $command, false, true, $env, $cwd ); default_debug( $launch ); if ( ! $launch->return_code ) { From efea065cf47cbba5329f6a36aade888d02a94226 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Tue, 19 Jun 2018 12:11:15 +0530 Subject: [PATCH 0200/1044] Fix according to review --- php/class-ee.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/php/class-ee.php b/php/class-ee.php index 3f73788d3..39a12a18d 100644 --- a/php/class-ee.php +++ b/php/class-ee.php @@ -814,13 +814,13 @@ public static function error_to_string( $errors ) { * * @return int|ProcessRun The command exit status, or a ProcessRun object for full details. */ - public static function launch( $command, $exit_on_error = true, $return_detailed = false, $env = array(), $cwd = null ) { + public static function launch( $command, $exit_on_error = true, $return_detailed = false, $env = null, $cwd = null ) { Utils\check_proc_available( 'launch' ); $proc = Process::create( $command, $cwd, $env ); $results = $proc->run(); - if ( - 1 == $results->return_code ) { + if ( -1 == $results->return_code ) { self::warning( "Spawned process returned exit code {$results->return_code}, which could be caused by a custom compiled version of PHP that uses the --enable-sigchild option." ); } From 2e2e4527e0d05842f07166144a4aa3ead2fb8a0b Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Thu, 21 Jun 2018 19:51:42 +0530 Subject: [PATCH 0201/1044] Throw error when wrong sitename is given from a site-root --- php/utils.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/php/utils.php b/php/utils.php index 58efa4fdf..711982352 100644 --- a/php/utils.php +++ b/php/utils.php @@ -1575,11 +1575,12 @@ function get_site_name() { * Function to set the site-name in the args when ee is running in a site folder and the site-name has not been passed in the args. If the site-name could not be found it will throw an error. * * @param array $args The passed arguments. - * @param String $command The command passing the arguments to aut=detect site-name. + * @param String $command The command passing the arguments to auto-detect site-name. + * @param bool $arg_zero Site-name will be present in the first argument. Default true. * * @return array Arguments with site-name set. */ -function set_site_arg( $args, $command ) { +function set_site_arg( $args, $command, $arg_zero=true ) { if ( isset( $args[0] ) ) { if ( EE::db()::site_in_db( $args[0] ) ) { return $args; @@ -1587,6 +1588,9 @@ function set_site_arg( $args, $command ) { } $site_name = get_site_name(); if ( $site_name ) { + if ( isset( $args[0] ) && $arg_zero ) { + EE::error( $args[0] . " is not a valid site-name. Did you mean `ee $command $site_name`?" ); + } array_unshift( $args, $site_name ); } else { EE::error( "Could not find the site you wish to run $command command on.\nEither pass it as an argument: `ee $command <site-name>` \nor run `ee $command` from inside the site folder." ); From a921769c9008258ce25a2b848ef7389ffb5016a8 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Mon, 25 Jun 2018 13:49:35 +0530 Subject: [PATCH 0202/1044] Add update tests --- features/bootstrap/FeatureContext.php | 37 +++++++++++++++++++++++++++ features/cli.feature | 16 ++++++++++++ php/commands/src/CLI_Command.php | 3 +++ 3 files changed, 56 insertions(+) create mode 100644 features/cli.feature diff --git a/features/bootstrap/FeatureContext.php b/features/bootstrap/FeatureContext.php index cb599b096..06b3fa1c9 100644 --- a/features/bootstrap/FeatureContext.php +++ b/features/bootstrap/FeatureContext.php @@ -15,6 +15,28 @@ class FeatureContext implements Context public $command; public $webroot_path; + /** + * @Given ee phar is generated + */ + public function eePharIsPresent() + { + // Checks if phar already exists, replaces it + if(file_exists('ee-old.phar')) { + // Below exec call is required as currenly `ee cli update` is ran with root + // which updates ee.phar with root privileges. + exec("sudo rm ee.phar"); + copy('ee-old.phar','ee.phar'); + return 0; + } + exec("php -dphar.readonly=0 utils/make-phar.php ee.phar", $output, $return_status); + if (0 !== $return_status) { + throw new Exception("Unable to generate phar" . $return_status); + } + + // Cache generaed phar as it is expensive to generate one + copy('ee.phar','ee-old.phar'); + } + /** * @Given :command is installed */ @@ -33,6 +55,15 @@ public function iRun($command) { $this->command = EE::launch($command, false, true); } + /** + * @Then return value should be 0 + */ + public function returnCodeShouldBe0() + { + if ( 0 !== $this->command->return_code ) { + throw new Exception("Actual return code is not zero: \n" . $this->command); + } + } /** * @Then /(STDOUT|STDERR) should return exactly/ @@ -150,5 +181,11 @@ public function requestOnShouldContainFollowingHeaders($site, TableNode $table) public static function cleanup(AfterFeatureScope $scope) { exec("sudo bin/ee site delete hello.test"); + if(file_exists('ee.phar')) { + unlink('ee.phar'); + } + if(file_exists('ee-old.phar')) { + unlink('ee-old.phar'); + } } } diff --git a/features/cli.feature b/features/cli.feature new file mode 100644 index 000000000..d5a04e116 --- /dev/null +++ b/features/cli.feature @@ -0,0 +1,16 @@ +Feature: CLI Command + + Scenario: ee update nightly works properly + Given ee phar is generated + When I run 'sudo php ee.phar cli update --nightly --yes' + Then return value should be 0 + + Scenario: ee update stable works properly + Given ee phar is generated + When I run 'sudo php ee.phar cli update --stable --yes' + Then return value should be 0 + + Scenario: ee update works properly + Given ee phar is generated + When I run 'php ee.phar cli update --yes' + Then return value should be 0 \ No newline at end of file diff --git a/php/commands/src/CLI_Command.php b/php/commands/src/CLI_Command.php index e43fa36e7..45aff8aab 100644 --- a/php/commands/src/CLI_Command.php +++ b/php/commands/src/CLI_Command.php @@ -187,6 +187,9 @@ private function migrate() { * [--nightly] * : Update to the latest built version of the develop branch. Potentially unstable. * + * [--yes] + * : Do not prompt for confirmation. + * * ## EXAMPLES * * # Update CLI. From d64fecef74e671b86d808ef4553a65cc475b2fd5 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Tue, 26 Jun 2018 12:59:03 +0530 Subject: [PATCH 0203/1044] Fix deprecated warning while disconnecting site. --- php/class-ee-docker.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php index 573d6bece..5acdefb89 100644 --- a/php/class-ee-docker.php +++ b/php/class-ee-docker.php @@ -139,7 +139,7 @@ public static function connect_site_network_to( $site_name, $to_container ) { /** * Function to disconnect site network from appropriate containers. */ - public function disconnect_site_network_from( $site_name, $from_container ) { + public static function disconnect_site_network_from( $site_name, $from_container ) { if ( self::disconnect_network( $site_name, $from_container ) ) { EE::log( "[$site_name] Disconnected from Docker network of $from_container" ); From 26356b75124ef712967eec81e91950715847f5b8 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Wed, 27 Jun 2018 12:16:33 +0530 Subject: [PATCH 0204/1044] Add check-update command --- php/commands/src/CLI_Command.php | 66 ++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/php/commands/src/CLI_Command.php b/php/commands/src/CLI_Command.php index e43fa36e7..6b89a2c45 100644 --- a/php/commands/src/CLI_Command.php +++ b/php/commands/src/CLI_Command.php @@ -166,6 +166,72 @@ private function migrate() { } + /** + * Check to see if there is a newer version of EE available. + * + * Queries the Github releases API. Returns available versions if there are + * updates available, or success message if using the latest release. + * + * ## OPTIONS + * + * [--patch] + * : Only list patch updates. + * + * [--minor] + * : Only list minor updates. + * + * [--major] + * : Only list major updates. + * + * [--field=<field>] + * : Prints the value of a single field for each update. + * + * [--fields=<fields>] + * : Limit the output to specific object fields. Defaults to version,update_type,package_url. + * + * [--format=<format>] + * : Render output in a particular format. + * --- + * default: table + * options: + * - table + * - csv + * - json + * - count + * - yaml + * --- + * + * ## EXAMPLES + * + * # Check for update. + * $ ee cli check-update + * Success: EE is at the latest version. + * + * # Check for update and new version is available. + * $ ee cli check-update + * +---------+-------------+------------------------------------------------------------------------------------------+ + * | version | update_type | package_url | + * +---------+-------------+------------------------------------------------------------------------------------------+ + * | 0.24.1 | patch | https://github.com/EasyEngine/easyengine/releases/download/v4.0.0-beta.1/easyengine.phar | + * +---------+-------------+------------------------------------------------------------------------------------------+ + * + * @subcommand check-update + */ + public function check_update( $_, $assoc_args ) { + $updates = $this->get_updates( $assoc_args ); + + if ( $updates ) { + $formatter = new \EE\Formatter( + $assoc_args, + array( 'version', 'update_type', 'package_url' ) + ); + $formatter->display_items( $updates ); + } elseif ( empty( $assoc_args['format'] ) || 'table' == $assoc_args['format'] ) { + $update_type = $this->get_update_type_str( $assoc_args ); + EE::success( "EasyEngine is at the latest{$update_type}version." ); + } + } + /** * Update EE to the latest release. * From 468abbdbd04feb69bec509357a22c702e7af695e Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Wed, 27 Jun 2018 13:47:02 +0530 Subject: [PATCH 0205/1044] Correct tests --- features/cli.feature | 2 +- features/site.feature | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/features/cli.feature b/features/cli.feature index d5a04e116..c74498d87 100644 --- a/features/cli.feature +++ b/features/cli.feature @@ -12,5 +12,5 @@ Feature: CLI Command Scenario: ee update works properly Given ee phar is generated - When I run 'php ee.phar cli update --yes' + When I run 'sudo php ee.phar cli update --yes' Then return value should be 0 \ No newline at end of file diff --git a/features/site.feature b/features/site.feature index ff330bbdd..b3c916f11 100644 --- a/features/site.feature +++ b/features/site.feature @@ -53,7 +53,7 @@ Feature: Site Command """ And The 'hello.test' db entry should be removed And The 'hello.test' webroot should be removed - And Following containers of site 'abc.test' should be removed: + And Following containers of site 'hello.test' should be removed: | container | | nginx | | php | From 16d8bcf73161ef9db300dd5788d9c7d343e1628a Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Thu, 28 Jun 2018 19:39:00 +0530 Subject: [PATCH 0206/1044] Add db_port field while creating database --- php/class-ee-db.php | 1 + 1 file changed, 1 insertion(+) diff --git a/php/class-ee-db.php b/php/class-ee-db.php index de4241194..341aeff51 100644 --- a/php/class-ee-db.php +++ b/php/class-ee-db.php @@ -47,6 +47,7 @@ public static function create() { db_password VARCHAR, db_root_password VARCHAR, db_host VARCHAR, + db_port VARCHAR, wp_user VARCHAR, wp_pass VARCHAR, email VARCHAR, From 590f4e26f28cc180a286eeebeb14d79a2c997528 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Mon, 25 Jun 2018 20:21:21 +0530 Subject: [PATCH 0207/1044] Add shell command to composer --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index 06758baa3..7f687169a 100644 --- a/composer.json +++ b/composer.json @@ -28,6 +28,7 @@ "composer/composer": "^1.2.0", "composer/semver": "~1.0", "easyengine/site-command": "dev-master", + "easyengine/shell-command": "dev-master", "justinrainbow/json-schema": "~5.2.5", "monolog/monolog": "^1.23", "mustache/mustache": "~2.4", From ce0dfed9ea24e2e39ea1aafff2d7e1fb01d73c4f Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Wed, 27 Jun 2018 17:21:04 +0530 Subject: [PATCH 0208/1044] update lock --- composer.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.lock b/composer.lock index 79ae72f18..1dda408f0 100644 --- a/composer.lock +++ b/composer.lock @@ -1369,16 +1369,16 @@ }, { "name": "symfony/process", - "version": "v3.4.11", + "version": "v3.4.12", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "4cbf2db9abcb01486a21b7a059e03a62fae63187" + "reference": "acc5a37c706ace827962851b69705b24e71ca17c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/4cbf2db9abcb01486a21b7a059e03a62fae63187", - "reference": "4cbf2db9abcb01486a21b7a059e03a62fae63187", + "url": "https://api.github.com/repos/symfony/process/zipball/acc5a37c706ace827962851b69705b24e71ca17c", + "reference": "acc5a37c706ace827962851b69705b24e71ca17c", "shasum": "" }, "require": { @@ -1414,7 +1414,7 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2018-05-16T08:49:21+00:00" + "time": "2018-05-30T04:24:30+00:00" }, { "name": "symfony/translation", From c6ca546eca245d02d464e414805d34f765a65694 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Thu, 28 Jun 2018 23:43:36 +0530 Subject: [PATCH 0209/1044] Update compose.json and lock --- composer.json | 4 ++-- composer.lock | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index 7f687169a..ab17a1526 100644 --- a/composer.json +++ b/composer.json @@ -27,8 +27,8 @@ "php": ">=5.3.29", "composer/composer": "^1.2.0", "composer/semver": "~1.0", - "easyengine/site-command": "dev-master", - "easyengine/shell-command": "dev-master", + "easyengine/site-command": "v1.0.0-beta.2", + "easyengine/shell-command": "v1.0.0-beta.1", "justinrainbow/json-schema": "~5.2.5", "monolog/monolog": "^1.23", "mustache/mustache": "~2.4", diff --git a/composer.lock b/composer.lock index 1dda408f0..d0cddb768 100644 --- a/composer.lock +++ b/composer.lock @@ -267,16 +267,16 @@ }, { "name": "easyengine/site-command", - "version": "dev-master", + "version": "v1.0.0-beta.2", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "884d3b48a18d5a0063a8c2ecf38b256b93cf0735" + "reference": "ef914e38bd2a3f24ea54f7ad5ce393fd058b2840" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/884d3b48a18d5a0063a8c2ecf38b256b93cf0735", - "reference": "884d3b48a18d5a0063a8c2ecf38b256b93cf0735", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/ef914e38bd2a3f24ea54f7ad5ce393fd058b2840", + "reference": "ef914e38bd2a3f24ea54f7ad5ce393fd058b2840", "shasum": "" }, "require": { @@ -308,7 +308,7 @@ "MIT" ], "homepage": "https://github.com/easyengine/site-command", - "time": "2018-06-11T20:59:51+00:00" + "time": "2018-06-28T17:50:46+00:00" }, { "name": "justinrainbow/json-schema", From abfb84c256e6ec56d200fecfbeae175e92eccad7 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Thu, 28 Jun 2018 23:52:01 +0530 Subject: [PATCH 0210/1044] Updated composer.lock --- composer.lock | 111 ++++++++++++++++++++++++++++++++++---------------- 1 file changed, 75 insertions(+), 36 deletions(-) diff --git a/composer.lock b/composer.lock index d0cddb768..05ea867e0 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": "4543f9ae8e25d79d6858fa2d3e8ce1b3", + "content-hash": "780df436dc46860276ed15f62d2066cf", "packages": [ { "name": "composer/ca-bundle", @@ -265,6 +265,46 @@ ], "time": "2018-04-30T10:33:04+00:00" }, + { + "name": "easyengine/shell-command", + "version": "v1.0.0-beta.1", + "source": { + "type": "git", + "url": "https://github.com/EasyEngine/shell-command.git", + "reference": "d0e8bac82c812dd871a0fbb0e901be15c76e55a7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/EasyEngine/shell-command/zipball/d0e8bac82c812dd871a0fbb0e901be15c76e55a7", + "reference": "d0e8bac82c812dd871a0fbb0e901be15c76e55a7", + "shasum": "" + }, + "type": "ee-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "shell" + ] + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "shell-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Shell to run helpful commands inside containers.", + "homepage": "https://github.com/easyengine/shell-command", + "time": "2018-06-25T14:38:55+00:00" + }, { "name": "easyengine/site-command", "version": "v1.0.0-beta.2", @@ -833,16 +873,16 @@ }, { "name": "symfony/config", - "version": "v3.4.11", + "version": "v3.4.12", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "73e055cf2e6467715f187724a0347ea32079967c" + "reference": "1fffdeb349ff36a25184e5564c25289b1dbfc402" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/73e055cf2e6467715f187724a0347ea32079967c", - "reference": "73e055cf2e6467715f187724a0347ea32079967c", + "url": "https://api.github.com/repos/symfony/config/zipball/1fffdeb349ff36a25184e5564c25289b1dbfc402", + "reference": "1fffdeb349ff36a25184e5564c25289b1dbfc402", "shasum": "" }, "require": { @@ -893,20 +933,20 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2018-05-14T16:49:53+00:00" + "time": "2018-06-19T14:02:58+00:00" }, { "name": "symfony/console", - "version": "v3.4.11", + "version": "v3.4.12", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "36f83f642443c46f3cf751d4d2ee5d047d757a27" + "reference": "1b97071a26d028c9bd4588264e101e14f6e7cd00" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/36f83f642443c46f3cf751d4d2ee5d047d757a27", - "reference": "36f83f642443c46f3cf751d4d2ee5d047d757a27", + "url": "https://api.github.com/repos/symfony/console/zipball/1b97071a26d028c9bd4588264e101e14f6e7cd00", + "reference": "1b97071a26d028c9bd4588264e101e14f6e7cd00", "shasum": "" }, "require": { @@ -962,20 +1002,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-05-16T08:49:21+00:00" + "time": "2018-05-23T05:02:55+00:00" }, { "name": "symfony/debug", - "version": "v3.4.11", + "version": "v3.4.12", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "b28fd73fefbac341f673f5efd707d539d6a19f68" + "reference": "47e6788c5b151cf0cfdf3329116bf33800632d75" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/b28fd73fefbac341f673f5efd707d539d6a19f68", - "reference": "b28fd73fefbac341f673f5efd707d539d6a19f68", + "url": "https://api.github.com/repos/symfony/debug/zipball/47e6788c5b151cf0cfdf3329116bf33800632d75", + "reference": "47e6788c5b151cf0cfdf3329116bf33800632d75", "shasum": "" }, "require": { @@ -1018,20 +1058,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2018-05-16T14:03:39+00:00" + "time": "2018-06-25T11:10:40+00:00" }, { "name": "symfony/dependency-injection", - "version": "v3.4.11", + "version": "v3.4.12", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "8a4672aca8db6d807905d695799ea7d83c8e5bba" + "reference": "a0be80e3f8c11aca506e250c00bb100c04c35d10" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/8a4672aca8db6d807905d695799ea7d83c8e5bba", - "reference": "8a4672aca8db6d807905d695799ea7d83c8e5bba", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/a0be80e3f8c11aca506e250c00bb100c04c35d10", + "reference": "a0be80e3f8c11aca506e250c00bb100c04c35d10", "shasum": "" }, "require": { @@ -1089,11 +1129,11 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2018-05-25T11:57:15+00:00" + "time": "2018-06-25T08:36:56+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v3.4.11", + "version": "v3.4.12", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", @@ -1156,16 +1196,16 @@ }, { "name": "symfony/filesystem", - "version": "v3.4.11", + "version": "v3.4.12", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "8e03ca3fa52a0f56b87506f38cf7bd3f9442b3a0" + "reference": "8a721a5f2553c6c3482b1c5b22ed60fe94dd63ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/8e03ca3fa52a0f56b87506f38cf7bd3f9442b3a0", - "reference": "8e03ca3fa52a0f56b87506f38cf7bd3f9442b3a0", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/8a721a5f2553c6c3482b1c5b22ed60fe94dd63ed", + "reference": "8a721a5f2553c6c3482b1c5b22ed60fe94dd63ed", "shasum": "" }, "require": { @@ -1202,20 +1242,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2018-05-16T08:49:21+00:00" + "time": "2018-06-21T11:10:19+00:00" }, { "name": "symfony/finder", - "version": "v3.4.11", + "version": "v3.4.12", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "472a92f3df8b247b49ae364275fb32943b9656c6" + "reference": "3a8c3de91d2b2c68cd2d665cf9d00f7ef9eaa394" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/472a92f3df8b247b49ae364275fb32943b9656c6", - "reference": "472a92f3df8b247b49ae364275fb32943b9656c6", + "url": "https://api.github.com/repos/symfony/finder/zipball/3a8c3de91d2b2c68cd2d665cf9d00f7ef9eaa394", + "reference": "3a8c3de91d2b2c68cd2d665cf9d00f7ef9eaa394", "shasum": "" }, "require": { @@ -1251,7 +1291,7 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2018-05-16T08:49:21+00:00" + "time": "2018-06-19T20:52:10+00:00" }, { "name": "symfony/polyfill-ctype", @@ -1418,7 +1458,7 @@ }, { "name": "symfony/translation", - "version": "v3.4.11", + "version": "v3.4.12", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", @@ -1486,7 +1526,7 @@ }, { "name": "symfony/yaml", - "version": "v3.4.11", + "version": "v3.4.12", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", @@ -2656,7 +2696,7 @@ }, { "name": "symfony/class-loader", - "version": "v3.4.11", + "version": "v3.4.12", "source": { "type": "git", "url": "https://github.com/symfony/class-loader.git", @@ -2806,7 +2846,6 @@ "aliases": [], "minimum-stability": "dev", "stability-flags": { - "easyengine/site-command": 20, "roave/security-advisories": 20 }, "prefer-stable": true, From 89de184e9dccda218053d95fa8673faa9adfaa77 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Mon, 25 Jun 2018 21:52:15 +0530 Subject: [PATCH 0211/1044] Update readme --- README.md | 111 +++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 101 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 11f2e7415..42b5eca9f 100644 --- a/README.md +++ b/README.md @@ -29,8 +29,29 @@ chmod +x /usr/local/bin/ee ## Usage ## Basic Commands - -### create +Currently there are three top level commands of `ee`. + * [ee site](#ee-site) + * [ee shell](#ee-shell) + * [ee cli](#ee-cli) + +Note: :warning: EasyEngine will currently only run with root privileges. You can run `ee help`, `ee help site` and `ee help site create` to get all the details about the various commands and subcommands that you can run. + +### ee site +Contains basic site management commands + +`site` command contains following subcommand + * [ee site create](#ee-site-create) + * [ee site delete](#ee-site-delete) + * [ee site disable](#ee-site-disable) + * [ee site enable](#ee-site-enable) + * [ee site info](#ee-site-info) + * [ee site list](#ee-site-list) + * [ee site start](#ee-site-start) + * [ee site stop](#ee-site-stop) + * [ee site restart](#ee-site-restart) + * [ee site reload](#ee-site-reload) + +#### ee site create Runs the site creation. ```bash @@ -42,47 +63,117 @@ ee site create example.com --wpsubdom # install wpmu-subdomain without ee site create example.com --wpsubdom --wpredis # install wpmu-subdomain + redis caching ``` -### delete +#### ee site delete Deletes an existing EasyEngine site. ```bash ee site delete example.com ``` -### disable +#### ee site disable Disables a website. It will stop and remove the docker containers of the website if they are running. ```bash ee site disable example.com ``` -### enable +#### ee site enable Enables a website. It will start the docker containers of the website if they are stopped. ```bash ee site enable example.com ``` -### info +#### ee site info Display all the relevant site information, credentials and useful links. ```bash ee site info example.com ``` -### list +#### ee site list Lists the created websites. ```bash ee site list ``` -EasyEngine will currently only run with root privileges. You can run `ee help`, `ee help site` and `ee help site create` to get all the details about the various commands and subcommands that you can run. +#### ee site start +Starts containers associated with site. + +```bash +ee site start example.com +ee site start example.com --nginx +``` + +#### ee site stop +Stops containers associated with site. + +```bash +ee site stop example.com +ee site stop example.com --nginx +``` + +#### ee site restart +Restarts containers associated with site. +```bash +ee site restart example.com +ee site restart example.com --nginx +``` + +#### ee site reload +Reload services in containers without restarting container(s) associated with site. -## Test +```bash +ee site reload example.com +ee site reload example.com --nginx +``` + +### ee shell +Gives you a shell where you can manage and interact with your site. + +```bash +ee shell example.com +``` + +### ee cli +Commands to manage easyengine itself + +`cli` command has following subcommands: + * [ee cli info](#ee-cli-info) + * [ee cli update](#ee-cli-update) + * [ee cli version](#ee-cli-version) + * [ee cli has-command](#ee-cli-has-command) + +#### ee cli info +Print various details about the EE environment. + +```bash +ee cli info +``` +#### ee cli update +Update EE to the latest release. + +```bash +ee cli update +``` +#### ee cli version +Print EE version. + +```bash +ee cli version +``` +#### ee cli has-command +Detects if a command exists + +```bash +ee cli has-command site +``` + +## Tests EasyEngine is currently using [behat](http://behat.org/) v3.4.x functional tests. The tests for site-command are inside the `features/` directory in the core repository and can be run using ``` vendor/bin/behat -``` \ No newline at end of file +``` From b3f0f38ed9067a9d41f3d432c6d9d4e3c3ff3f5d Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Thu, 28 Jun 2018 23:31:43 +0530 Subject: [PATCH 0212/1044] Update README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 42b5eca9f..73ee95bb0 100644 --- a/README.md +++ b/README.md @@ -153,13 +153,13 @@ Print various details about the EE environment. ee cli info ``` #### ee cli update -Update EE to the latest release. +Updates EasyEngine to the latest release. ```bash ee cli update ``` #### ee cli version -Print EE version. +Print EasyEngine version. ```bash ee cli version From 18cb397d0ea240ccb44879e1609df1cc63f223f9 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Fri, 29 Jun 2018 00:51:58 +0530 Subject: [PATCH 0213/1044] Update README --- README.md | 148 +++++++++--------------------------------------------- 1 file changed, 23 insertions(+), 125 deletions(-) diff --git a/README.md b/README.md index 73ee95bb0..f22b46ede 100644 --- a/README.md +++ b/README.md @@ -28,152 +28,50 @@ chmod +x /usr/local/bin/ee ## Usage -## Basic Commands -Currently there are three top level commands of `ee`. - * [ee site](#ee-site) - * [ee shell](#ee-shell) - * [ee cli](#ee-cli) +To get started with EasyEngine and create a wordpress site, run -Note: :warning: EasyEngine will currently only run with root privileges. You can run `ee help`, `ee help site` and `ee help site create` to get all the details about the various commands and subcommands that you can run. - -### ee site -Contains basic site management commands - -`site` command contains following subcommand - * [ee site create](#ee-site-create) - * [ee site delete](#ee-site-delete) - * [ee site disable](#ee-site-disable) - * [ee site enable](#ee-site-enable) - * [ee site info](#ee-site-info) - * [ee site list](#ee-site-list) - * [ee site start](#ee-site-start) - * [ee site stop](#ee-site-stop) - * [ee site restart](#ee-site-restart) - * [ee site reload](#ee-site-reload) - -#### ee site create -Runs the site creation. - -```bash -ee site create example.com --wp # install wordpress without any page caching -ee site create example.com --wpredis # install wordpress + redis caching -ee site create example.com --wpsubir # install wpmu-subdirectory without any page caching -ee site create example.com --wpsubir --wpredis # install wpmu-subdirectory + redis caching -ee site create example.com --wpsubdom # install wpmu-subdomain without any page caching -ee site create example.com --wpsubdom --wpredis # install wpmu-subdomain + redis caching ``` - -#### ee site delete -Deletes an existing EasyEngine site. - -```bash -ee site delete example.com +ee site create example.com ``` -#### ee site disable -Disables a website. It will stop and remove the docker containers of the website if they are running. +Need a wordpress site with caching? Try -```bash -ee site disable example.com ``` - -#### ee site enable -Enables a website. It will start the docker containers of the website if they are stopped. - -```bash -ee site enable example.com -``` - -#### ee site info -Display all the relevant site information, credentials and useful links. - -```bash -ee site info example.com +ee site create example.com --wpredis ``` -#### ee site list -Lists the created websites. - -```bash -ee site list -``` - -#### ee site start -Starts containers associated with site. - -```bash -ee site start example.com -ee site start example.com --nginx +Need a wordpress multi-site with page cache? ``` - -#### ee site stop -Stops containers associated with site. - -```bash -ee site stop example.com -ee site stop example.com --nginx +ee site create example.com --wpsubdir --wpredis ``` -#### ee site restart -Restarts containers associated with site. - -```bash -ee site restart example.com -ee site restart example.com --nginx +Want to play around with your new site? ``` - -#### ee site reload -Reload services in containers without restarting container(s) associated with site. - -```bash -ee site reload example.com -ee site reload example.com --nginx +ee shell example.com ``` -### ee shell -Gives you a shell where you can manage and interact with your site. +Want to know more? Checkout readme of these commands - + * [site command](https://github.com/EasyEngine/site-command/) + * [shell command](https://github.com/EasyEngine/shell-command/) -```bash -ee shell example.com -``` +Note: :warning: EasyEngine will currently only run with root privileges. You can run `ee help`, `ee help site` and `ee help site create` to get all the details about the various commands and subcommands that you can run. -### ee cli -Commands to manage easyengine itself +## Development -`cli` command has following subcommands: - * [ee cli info](#ee-cli-info) - * [ee cli update](#ee-cli-update) - * [ee cli version](#ee-cli-version) - * [ee cli has-command](#ee-cli-has-command) +Development of easyengine is done entirely on GitHub. -#### ee cli info -Print various details about the EE environment. +We've used [wp-cli](https://github.com/wp-cli/wp-cli/) framework as a base and built EasyEngine on top of it. -```bash -ee cli info -``` -#### ee cli update -Updates EasyEngine to the latest release. +This repo contains main core of easyengine (the framework). +All top level commands(except `ee cli`) i.e. `ee site`, `ee shell` have their own repos. -```bash -ee cli update -``` -#### ee cli version -Print EasyEngine version. +Currently we have following commands which are bundled by default in EasyEngine: -```bash -ee cli version -``` -#### ee cli has-command -Detects if a command exists +* [site command](https://github.com/EasyEngine/site-command/) +* [shell command](https://github.com/EasyEngine/shell-command/) -```bash -ee cli has-command site -``` +In future, community will be able to make their own packages and commands! -## Tests +## Contributing -EasyEngine is currently using [behat](http://behat.org/) v3.4.x functional tests. The tests for site-command are inside the `features/` directory in the core repository and can be run using -``` -vendor/bin/behat -``` +We warmheartedly welcome all contributions however and in whatever capacity you can either through Pull Requests or by reporting Issues. You can contribute here or in any of the above mentioned commands repo. From aa7c21c43d9c2f2053fd3d1022a46e8dac06d60d Mon Sep 17 00:00:00 2001 From: Mriyam Tamuli <mbtamuli@gmail.com> Date: Fri, 29 Jun 2018 01:03:20 +0530 Subject: [PATCH 0214/1044] Bump working version to v4.0.0-beta.2 Signed-off-by: Mriyam Tamuli <mbtamuli@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index a35737f9a..2f9037bc3 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.0.0-beta.1 +4.0.0-beta.2 From b704256205d4e5080797943db6fa785aee4c6522 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Sat, 30 Jun 2018 15:37:14 +0530 Subject: [PATCH 0215/1044] Add initial migration code --- php/EE/Migration/Base.php | 11 +++ php/EE/Migration/Executor.php | 136 +++++++++++++++++++++++++++++++ php/EE/Runner.php | 1 - php/class-ee-db.php | 106 +++++++++++++----------- php/commands/src/CLI_Command.php | 4 +- 5 files changed, 208 insertions(+), 50 deletions(-) create mode 100644 php/EE/Migration/Base.php create mode 100644 php/EE/Migration/Executor.php diff --git a/php/EE/Migration/Base.php b/php/EE/Migration/Base.php new file mode 100644 index 000000000..a8f6f4e78 --- /dev/null +++ b/php/EE/Migration/Base.php @@ -0,0 +1,11 @@ +<?php + +namespace EE\Migration; + +abstract class Base { + + public $status = 'incomplete'; + + abstract public function up(); + abstract public function down(); +} \ No newline at end of file diff --git a/php/EE/Migration/Executor.php b/php/EE/Migration/Executor.php new file mode 100644 index 000000000..ecdefa8a5 --- /dev/null +++ b/php/EE/Migration/Executor.php @@ -0,0 +1,136 @@ +<?php + +namespace EE\Migration; + +use \EE; +use \EE\Utils; +use Symfony\Component\Finder\Finder; + +class Executor { + + const MIGRATION_PATH = EE_ROOT . '/migrations'; + + /** + * Executes all pending migrations + */ + public static function execute_migrations() { + + Utils\delem_log( "ee migration start" ); + EE::log( "Migrating EasyEngine data to new version" ); + + $migrations = self::get_migrations_to_execute(); + + if( empty( $migrations ) ) { + EE::success( "Noting to migrate" ); + exit( 0 ); + } + + sort( $migrations ); + + try { + self::execute_migration_stack( $migrations ); + } catch( \Throwable $e ) { + Utils\delem_log( "ee migration ended abruptly" ); + exit( 1 ); + } + + EE::success( "Successfully migrated EasyEngine" ); + } + + /** + * Executes all migrations passed to it recursively. + * Also undo'es all migration if there was error executing any migration + */ + private static function execute_migration_stack( $migrations ) { + if( empty( $migrations ) ) { + return; + } + + $migration_path = self::get_migration_path( $migrations[0] ); + $migration_class_name = self::get_migration_class_name( $migrations[0] ); + + if( ! file_exists( $migration_path ) ) { + EE::error( "Unable to find migration file at $migration_path", false ); + throw new Exception(); + } + + require( $migration_path ); + + try { + $migration = new $migration_class_name; + if( ! $migration instanceof Base ) { + throw new \Exception( "$migration_class_name is not a instance of base migration class" ); + } + } + catch( \Throwable $e ) { + EE::error( $e->getMessage(), false ); + throw $e; + } + + try { + EE::log( "Migrating: $migrations[0]" ); + $migration->up(); + + \EE::db()->insert([ + 'migration' => $migrations[0], + 'timestamp' => date('Y-m-d H:i:s') + ], 'migrations' ); + + $migration->status = 'complete'; + EE::log( "Migrated: $migrations[0]" ); + $remaining_migrations = array_splice( $migrations, 1, count( $migrations ) ); + self::execute_migration_stack( $remaining_migrations ); + } + catch( \Throwable $e ) { + if( $migration->status !== 'complete' ) { + EE::error( "Errors were encountered while processing: $migrations[0]\n" . $e->getMessage(), false ); + } + EE::log( "Reverting: $migrations[0]" ); + $migration->down(); + EE::log( "Reverted: $migrations[0]" ); + throw $e; + } + } + + private static function get_migrations_to_execute() { + return array_values( + array_diff( + self::get_migrations_from_fs(), + self::get_migrations_from_db() + ) + ); + } + + private static function get_migrations_from_db() { + return \EE::db()->get_migrations(); + } + + private static function get_migrations_from_fs() { + // array_slice is used to remove . and .. returned by scandir() + $migrations = array_slice( scandir( self::MIGRATION_PATH ), 2 ); + array_walk( $migrations, function( &$migration, $index ) { + $migration = rtrim( $migration, '.php' ); + }); + return $migrations; + } + + private static function get_migration_path( $migration_name ) { + return self::MIGRATION_PATH . $migration_name . '.php' ; + } + + private static function get_migration_class_name( $migration_name ) { + // Convet snake_case to CamelCase + $class_name = self::camelize( $migration_name ); + // Replace dot with underscore + $class_name = str_replace( '.', '_', $class_name ); + // Remove date from it + $class_name = preg_replace( '/^\d*(?=[A-Z])/', '', $class_name ); + + return "\EE\Migration\\$class_name"; + } + + private static function camelize($input, $separator = '_') + { + return str_replace($separator, '', ucwords($input, $separator)); + } +} \ No newline at end of file diff --git a/php/EE/Runner.php b/php/EE/Runner.php index a5a6c64a7..e2ea7cf7a 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -61,7 +61,6 @@ private function init_ee() { define( 'WEBROOT', \EE\Utils\trailingslashit( $this->config['sites_path'] ) ); define( 'DB', EE_CONF_ROOT.'/ee.sqlite' ); define( 'LOCALHOST_IP', '127.0.0.1' ); - define( 'TABLE', 'sites' ); } /** diff --git a/php/class-ee-db.php b/php/class-ee-db.php index 341aeff51..f885fccc8 100644 --- a/php/class-ee-db.php +++ b/php/class-ee-db.php @@ -9,6 +9,10 @@ public function __construct() { self::init_db(); } } + + public function __destruct() { + self::$db->close(); + } /** * Function to initialize db and db connection. @@ -30,33 +34,41 @@ public static function init_db() { public static function create() { self::$db = new SQLite3( DB ); $query = "CREATE TABLE sites ( - id INTEGER NOT NULL, - sitename VARCHAR, - site_type VARCHAR, - site_title VARCHAR, - proxy_type VARCHAR, - cache_type VARCHAR, - site_path VARCHAR, - created_on DATETIME, - is_enabled BOOLEAN DEFAULT 1, - is_ssl BOOLEAN DEFAULT 0, - storage_fs VARCHAR, - storage_db VARCHAR, - db_name VARCHAR, - db_user VARCHAR, - db_password VARCHAR, - db_root_password VARCHAR, - db_host VARCHAR, - db_port VARCHAR, - wp_user VARCHAR, - wp_pass VARCHAR, - email VARCHAR, - php_version VARCHAR, - PRIMARY KEY (id), - UNIQUE (sitename), - CHECK (is_enabled IN (0, 1)), - CHECK (is_ssl IN (0, 1)) - );"; + id INTEGER NOT NULL, + sitename VARCHAR, + site_type VARCHAR, + site_title VARCHAR, + proxy_type VARCHAR, + cache_type VARCHAR, + site_path VARCHAR, + created_on DATETIME, + is_enabled BOOLEAN DEFAULT 1, + is_ssl BOOLEAN DEFAULT 0, + storage_fs VARCHAR, + storage_db VARCHAR, + db_name VARCHAR, + db_user VARCHAR, + db_password VARCHAR, + db_root_password VARCHAR, + db_host VARCHAR, + db_port VARCHAR, + wp_user VARCHAR, + wp_pass VARCHAR, + email VARCHAR, + php_version VARCHAR, + PRIMARY KEY (id), + UNIQUE (sitename), + CHECK (is_enabled IN (0, 1)), + CHECK (is_ssl IN (0, 1)) + );"; + + self::$db->exec( $query ); + + $query = "CREATE TABLE migrations ( + migration VARCHAR, + timestamp DATETIME, + );"; + self::$db->exec( $query ); } @@ -67,13 +79,12 @@ public static function create() { * * @return bool */ - public static function insert( $data ) { + public static function insert( $data, $table_name='sites' ) { if ( empty ( self::$db ) ) { self::init_db(); } - $table_name = TABLE; $fields = '`' . implode( '`, `', array_keys( $data ) ) . '`'; $formats = '"' . implode( '", "', $data ) . '"'; @@ -84,10 +95,7 @@ public static function insert( $data ) { if ( ! $insert_query_exec ) { EE::debug( self::$db->lastErrorMsg() ); - self::$db->close(); } else { - self::$db->close(); - return true; } @@ -101,14 +109,12 @@ public static function insert( $data ) { * * @return array|bool */ - public static function select( $columns = array(), $where = array() ) { + public static function select( $columns = array(), $where = array(), $table_name='sites' ) { if ( empty ( self::$db ) ) { self::init_db(); } - $table_name = TABLE; - $conditions = array(); if ( empty( $columns ) ) { $columns = '*'; @@ -151,13 +157,11 @@ public static function select( $columns = array(), $where = array() ) { * * @return bool */ - public static function update( $data, $where ) { + public static function update( $data, $where, $table_name='sites' ) { if ( empty ( self::$db ) ) { self::init_db(); } - $table_name = TABLE; - $fields = array(); $conditions = array(); foreach ( $data as $key => $value ) { @@ -173,10 +177,7 @@ public static function update( $data, $where ) { $update_query_exec = self::$db->exec( $update_query ); if ( ! $update_query_exec ) { EE::debug( self::$db->lastErrorMsg() ); - self::$db->close(); } else { - self::$db->close(); - return true; } } @@ -191,9 +192,7 @@ public static function update( $data, $where ) { * * @return bool */ - public static function delete( $where ) { - - $table_name = TABLE; + public static function delete( $where, $table_name='sites' ) { $conditions = array(); foreach ( $where as $key => $value ) { @@ -207,10 +206,7 @@ public static function delete( $where ) { if ( ! $delete_query_exec ) { EE::debug( self::$db->lastErrorMsg() ); - self::$db->close(); } else { - self::$db->close(); - return true; } @@ -261,4 +257,20 @@ public static function site_enabled( $site_name ) { return false; } + + /** + * Returns all migrations from table. + */ + public static function get_migrations() { + + if ( empty ( self::$db ) ) { + self::init_db(); + } + + $sites = self::select( [ 'migration' ], [], 'migrations' ); + if( empty( $sites ) ) { + return []; + } + return array_column( $sites, 'migration' ); + } } diff --git a/php/commands/src/CLI_Command.php b/php/commands/src/CLI_Command.php index 9241d9283..602b50022 100644 --- a/php/commands/src/CLI_Command.php +++ b/php/commands/src/CLI_Command.php @@ -162,8 +162,8 @@ public function info( $_, $assoc_args ) { /** * Function to run migrations required to upgrade to the newer version. Will always be invoked from the newer phar downloaded inside the /tmp folder */ - private function migrate() { - + public function migrate() { + EE\Migration\Executor::execute_migrations(); } /** From f968c54ea8ce2d8c0402ed82f0519896ee06f147 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Sat, 7 Jul 2018 01:18:19 +0530 Subject: [PATCH 0216/1044] Add function to take user input --- php/class-ee.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/php/class-ee.php b/php/class-ee.php index 39a12a18d..8884976ed 100644 --- a/php/class-ee.php +++ b/php/class-ee.php @@ -706,6 +706,22 @@ public static function confirm( $question, $assoc_args = array(), $exit = true ) return true; } + /** + * Get user input for some question. + * + * @access public + * @category Input + * + * @param string $question Question to display before the prompt. + * + * @return string input from user. + */ + public static function input( $question ) { + fwrite( STDOUT, $question ); + + return strtolower( trim( fgets( STDIN ) ) ); + } + /** * Read value from a positional argument or from STDIN. * From 3ddfe36206316bded3d45f4d5173b01501d60c25 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Sat, 7 Jul 2018 01:22:37 +0530 Subject: [PATCH 0217/1044] Add global param for letsencrypt mail --- php/config-spec.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/php/config-spec.php b/php/config-spec.php index ac3989dab..247b5a42c 100644 --- a/php/config-spec.php +++ b/php/config-spec.php @@ -24,6 +24,13 @@ 'desc' => 'Locale for WordPress.', ), + 'le-mail' => array( + 'runtime' => '=<le-mail>', + 'file' => '<le-mail>', + 'default' => null, + 'desc' => 'Mail-id to be used for letsencrypt.', + ), + 'ee_installer_version' => array( 'file' => '<path>', 'default' => null, From 073ed271f974ffd5cd8ad77a62d7e0d529b07b36 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Sun, 8 Jul 2018 23:06:51 +0530 Subject: [PATCH 0218/1044] add backward compatibility to le flag --- php/EE/Runner.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index a5a6c64a7..92242e2cc 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -549,11 +549,12 @@ public function init_config() { unset( $assoc_args['version'] ); } - // ee3 backward compatibility to wp-cli flags + // ee3 backward compatibility flags $wp_compat_array_map = array( - 'user' => 'admin_user', - 'pass' => 'admin_pass', - 'email' => 'admin_email' + 'user' => 'admin_user', + 'pass' => 'admin_pass', + 'email' => 'admin_email', + 'le' => 'letsencrypt', ); foreach ( $wp_compat_array_map as $from => $to ) { From ccd5a871b7ba79d195fa3b6b362964743f1d2c8d Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Mon, 9 Jul 2018 17:29:55 +0530 Subject: [PATCH 0219/1044] Fix output stream and return code --- php/init-ee.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/php/init-ee.php b/php/init-ee.php index 80608e008..4c2565be0 100644 --- a/php/init-ee.php +++ b/php/init-ee.php @@ -1,8 +1,8 @@ <?php -if( posix_geteuid() ) { - echo "\033[1;31mError:\033[0m Please run `ee` with root privileges."; - return; +if ( posix_geteuid() ) { + fwrite( STDERR, "\033[1;31mError:\033[0m Please run `ee` with root privileges." ); + exit( 1 ); } // Can be used by plugins/themes to check if EE is running or not From 14c07c8741dd6488967bca8d546625ab77a278e9 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Mon, 9 Jul 2018 17:36:14 +0530 Subject: [PATCH 0220/1044] Update output handling --- features/bootstrap/FeatureContext.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/features/bootstrap/FeatureContext.php b/features/bootstrap/FeatureContext.php index 06b3fa1c9..22b20a7cb 100644 --- a/features/bootstrap/FeatureContext.php +++ b/features/bootstrap/FeatureContext.php @@ -72,7 +72,9 @@ public function stdoutShouldReturnExactly($output_stream, PyStringNode $expected { $command_output = $output_stream === "STDOUT" ? $this->command->stdout : $this->command->stderr; - if ((string)$expected_output !== trim($command_output)) { + $command_output = str_replace(["\033[1;31m","\033[0m"],'',$command_output); + + if ($expected_output->getStrings()[0] !== trim($command_output)) { throw new Exception("Actual output is:\n" . $command_output); } } @@ -84,7 +86,7 @@ public function stdoutShouldReturnSomethingLike($output_stream, PyStringNode $ex { $command_output = $output_stream === "STDOUT" ? $this->command->stdout : $this->command->stderr; - if (strpos($command_output, (string)$expected_output) === false) { + if (strpos($command_output, $expected_output->getStrings()[0]) === false) { throw new Exception("Actual output is:\n" . $command_output); } } From b924ea2b027fafb9ab45c7f9d33e879ef1c13f74 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Mon, 9 Jul 2018 18:04:39 +0530 Subject: [PATCH 0221/1044] Update site list according to new list function --- features/site.feature | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/features/site.feature b/features/site.feature index b3c916f11..d825ebe32 100644 --- a/features/site.feature +++ b/features/site.feature @@ -34,11 +34,9 @@ Feature: Site Command | HTTP/1.1 200 OK | Scenario: List the sites - When I run 'sudo bin/ee site list' + When I run 'sudo bin/ee site list --format=text' Then STDOUT should return exactly """ - List of all Sites: - hello.test """ From 79349606be97e77c9d844853a8c276d622b851ae Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Mon, 9 Jul 2018 18:21:24 +0530 Subject: [PATCH 0222/1044] Handle empty output --- features/bootstrap/FeatureContext.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/features/bootstrap/FeatureContext.php b/features/bootstrap/FeatureContext.php index 22b20a7cb..9c51152e4 100644 --- a/features/bootstrap/FeatureContext.php +++ b/features/bootstrap/FeatureContext.php @@ -74,7 +74,8 @@ public function stdoutShouldReturnExactly($output_stream, PyStringNode $expected $command_output = str_replace(["\033[1;31m","\033[0m"],'',$command_output); - if ($expected_output->getStrings()[0] !== trim($command_output)) { + $expected_out = isset($expected_output->getStrings()[0]) ? $expected_output->getStrings()[0] : ''; + if ( $expected_out !== trim($command_output)) { throw new Exception("Actual output is:\n" . $command_output); } } @@ -86,7 +87,8 @@ public function stdoutShouldReturnSomethingLike($output_stream, PyStringNode $ex { $command_output = $output_stream === "STDOUT" ? $this->command->stdout : $this->command->stderr; - if (strpos($command_output, $expected_output->getStrings()[0]) === false) { + $expected_out = isset($expected_output->getStrings()[0]) ? $expected_output->getStrings()[0] : ''; + if (strpos($command_output, $expected_out) === false) { throw new Exception("Actual output is:\n" . $command_output); } } From e38a51f387d3ad8ad34ab3eef65fbb8ecd4b6619 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Mon, 9 Jul 2018 19:33:34 +0530 Subject: [PATCH 0223/1044] Update delete acc to new changes --- features/site.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/site.feature b/features/site.feature index d825ebe32..168d91dcd 100644 --- a/features/site.feature +++ b/features/site.feature @@ -41,7 +41,7 @@ Feature: Site Command """ Scenario: Delete the sites - When I run 'sudo bin/ee site delete hello.test' + When I run 'sudo bin/ee site delete hello.test --yes' Then STDOUT should return something like """ Site hello.test deleted. From 47b5f1b7c6051a5da47c642bcae700cdc0af6017 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Tue, 10 Jul 2018 13:58:41 +0530 Subject: [PATCH 0224/1044] Fix migration by removing trailing comma --- php/class-ee-db.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/class-ee-db.php b/php/class-ee-db.php index f885fccc8..7ecbc88f2 100644 --- a/php/class-ee-db.php +++ b/php/class-ee-db.php @@ -66,7 +66,7 @@ public static function create() { $query = "CREATE TABLE migrations ( migration VARCHAR, - timestamp DATETIME, + timestamp DATETIME );"; self::$db->exec( $query ); From f1194e3993e4bbf7939aa09ea675a60419827561 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Tue, 10 Jul 2018 17:19:20 +0530 Subject: [PATCH 0225/1044] print stdout and stderr if param is passed --- php/utils.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/php/utils.php b/php/utils.php index 711982352..973fff6f0 100644 --- a/php/utils.php +++ b/php/utils.php @@ -1437,13 +1437,19 @@ function default_debug( $launch ) { * * @return bool True if executed successfully. False if failed. */ -function default_launch( $command, $env = null, $cwd = null ) { +function default_launch( $command, $env = null, $cwd = null, $echo_stdout = false, $echo_stderr = false ) { $launch = EE::launch( $command, false, true, $env, $cwd ); default_debug( $launch ); + + if( $echo_stdout ) { + echo $launch->stdout; + } + if( $echo_stderr ) { + echo $launch->stderr; + } if ( ! $launch->return_code ) { return true; } - return false; } From 68d0e78e4f6d225edb7df487a4898d4d2c2e1934 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Tue, 10 Jul 2018 19:41:21 +0530 Subject: [PATCH 0226/1044] Change parameter sequence --- php/utils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/utils.php b/php/utils.php index 973fff6f0..f490ac8dd 100644 --- a/php/utils.php +++ b/php/utils.php @@ -1437,7 +1437,7 @@ function default_debug( $launch ) { * * @return bool True if executed successfully. False if failed. */ -function default_launch( $command, $env = null, $cwd = null, $echo_stdout = false, $echo_stderr = false ) { +function default_launch( $command, $echo_stdout = false, $echo_stderr = false, $env = null, $cwd = null ) { $launch = EE::launch( $command, false, true, $env, $cwd ); default_debug( $launch ); From 0c149727011b79565e3ec06ba02a1f38889da87d Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Tue, 10 Jul 2018 22:29:17 +0530 Subject: [PATCH 0227/1044] Update and make ensure_present_in_config generic --- php/EE/Runner.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 95a9a5813..c0da2d064 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -597,34 +597,34 @@ public function init_config() { * Ensures that vars are present in config. If they aren't, attempts to * create config file and add vars in it. * - * @param $var Variable to check. + * @param $var Variable to check. * @param $default Default value to use if $var is not set. */ - private function ensure_present_in_config( $var, $default) { - - if ( empty($this->config[$var]) ) { - $this->config[$var] = $default ; - - $config_file_path = getenv('EE_CONFIG_PATH') ? getenv('EE_CONFIG_PATH') : EE_CONF_ROOT . '/config.yml'; - $config_dir_path = dirname( $config_file_path ); + public function ensure_present_in_config( $var, $default ) { + $config_file_path = getenv( 'EE_CONFIG_PATH' ) ? getenv( 'EE_CONFIG_PATH' ) : EE_CONF_ROOT . '/config.yml'; + $existing_config = Spyc::YAMLLoad( $config_file_path ); + if ( ! isset( $existing_config[$var] ) ) { + $this->config[$var] = $default; + $config_dir_path = dirname( $config_file_path ); if ( file_exists( $config_file_path ) ) { if ( is_readable( $config_file_path ) ) { if ( is_writable( $config_file_path ) ) { - $existing_config = Spyc::YAMLLoad ( $config_file_path ); + $existing_config = Spyc::YAMLLoad( $config_file_path ); $this->add_var_to_config_file( $var, $config_file_path, $existing_config ); + return; } - EE::error("The config file {$config_file_path} is not writable. Please set a config path which is writable in EE_CONFIG_PATH environment variable."); + EE::error( "The config file {$config_file_path} is not writable. Please set a config path which is writable in EE_CONFIG_PATH environment variable." ); } - EE::error("The config file {$config_file_path} is not readable. Please select a config path which is readable in EE_CONFIG_PATH environment variable."); - } - else { + EE::error( "The config file {$config_file_path} is not readable. Please select a config path which is readable in EE_CONFIG_PATH environment variable." ); + } else { if ( is_writable( $config_dir_path ) ) { $this->add_var_to_config_file( $var, $config_file_path ); + return; } - EE::err("Configuration directory: $config_dir_path is not writable by EasyEngine."); + EE::err( "Configuration directory: $config_dir_path is not writable by EasyEngine." ); } } } From 5b8498285de95071acf2901f7a93fe0640cce2b9 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Tue, 10 Jul 2018 23:57:49 +0530 Subject: [PATCH 0228/1044] Update install url to https --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f22b46ede..7b68b870e 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ For Linux, we have created an installer script which will install all the dependencies for you. We have tested this on Ubuntu 14.04, 16.04, 18.04 and Debian 8. ```bash -wget -qO ee rt.cx/ee4beta && sudo bash ee +wget -qO ee https://rt.cx/ee4beta && sudo bash ee ``` Even if the script doesn't work for your distribution, you can manually install the dependencies and then run the following commands to install EasyEngine From 19229bbfb281da41b8328388737e23f91d11c4e4 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Tue, 10 Jul 2018 13:44:54 +0530 Subject: [PATCH 0229/1044] Update make-phar to load letsnecrypt related dependecies --- utils/make-phar.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/utils/make-phar.php b/utils/make-phar.php index ac0ff417e..0d48e3686 100644 --- a/utils/make-phar.php +++ b/utils/make-phar.php @@ -74,7 +74,7 @@ function add_file( $phar, $path ) { $strips = array( '\/(?:behat|gherkin)\/src\/', '\/phpunit\/', - '\/symfony\/(?!console|filesystem|finder|polyfill-mbstring|process)[^\/]+\/', + '\/symfony\/(?!console|filesystem|finder|polyfill-mbstring|process|serializer)[^\/]+\/', '\/composer\/spdx-licenses\/', '\/Composer\/(?:Command\/|Compiler\.php|Console\/|Downloader\/Pear|Installer\/Pear|Question\/|Repository\/Pear|SelfUpdate\/)', '\/(?:dealerdirect|squizlabs|wimg)\/', @@ -167,8 +167,13 @@ function get_composer_versions( $current_version ) { ->in(EE_VENDOR_DIR . '/ramsey/array_column') ->in(EE_VENDOR_DIR . '/symfony/finder') ->in(EE_VENDOR_DIR . '/symfony/polyfill-mbstring') + ->in(EE_VENDOR_DIR . '/symfony/polyfill-ctype') ->in(EE_VENDOR_DIR . '/monolog') - ->in(EE_VENDOR_DIR . '/yosymfony') + ->in(EE_VENDOR_DIR . '/guzzlehttp') + ->in(EE_VENDOR_DIR . '/acmephp') + ->in(EE_VENDOR_DIR . '/league') + ->in(EE_VENDOR_DIR . '/webmozart') + ->notName('behat-tags.php') ->notPath('#(?:[^/]+-command|php-cli-tools)/vendor/#') // For running locally, in case have composer installed or symlinked them. ->exclude('examples') @@ -197,6 +202,7 @@ function get_composer_versions( $current_version ) { ->in(EE_VENDOR_DIR . '/symfony/console') ->in(EE_VENDOR_DIR . '/symfony/filesystem') ->in(EE_VENDOR_DIR . '/symfony/process') + ->in(EE_VENDOR_DIR . '/symfony/serializer') ->in(EE_VENDOR_DIR . '/justinrainbow/json-schema') ->exclude('demo') ->exclude('nb/oxymel/OxymelTest.php') From 9a0fc78b3899421d1374681d088b2ed58b90490d Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Wed, 11 Jul 2018 00:20:03 +0530 Subject: [PATCH 0230/1044] Update site command to beta.3 and run composer update --- composer.json | 2 +- composer.lock | 701 ++++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 593 insertions(+), 110 deletions(-) diff --git a/composer.json b/composer.json index ab17a1526..fe6502a52 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ "php": ">=5.3.29", "composer/composer": "^1.2.0", "composer/semver": "~1.0", - "easyengine/site-command": "v1.0.0-beta.2", + "easyengine/site-command": "v1.0.0-beta.3", "easyengine/shell-command": "v1.0.0-beta.1", "justinrainbow/json-schema": "~5.2.5", "monolog/monolog": "^1.23", diff --git a/composer.lock b/composer.lock index 05ea867e0..c95ed73dc 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,135 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "780df436dc46860276ed15f62d2066cf", + "content-hash": "53ee6a10e1195979b78c7a84bcff3413", "packages": [ + { + "name": "acmephp/core", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/acmephp/core.git", + "reference": "910ca7b0edd25a54466050d9de276364f63cece1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/acmephp/core/zipball/910ca7b0edd25a54466050d9de276364f63cece1", + "reference": "910ca7b0edd25a54466050d9de276364f63cece1", + "shasum": "" + }, + "require": { + "acmephp/ssl": "^1.0-alpha2", + "ext-openssl": "*", + "guzzlehttp/guzzle": "^6.0", + "php": ">=5.5.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.22", + "symfony/process": "^3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "AcmePhp\\Core\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Titouan Galopin", + "email": "galopintitouan@gmail.com", + "homepage": "http://titouangalopin.com" + }, + { + "name": "Jérémy Derussé", + "homepage": "https://twitter.com/jderusse" + } + ], + "description": "Raw implementation of the ACME protocol in PHP", + "homepage": "https://github.com/acmephp/core", + "keywords": [ + "acmephp", + "certificate", + "csr", + "encryption", + "https", + "letsencrypt", + "openssl", + "ssl", + "x509" + ], + "time": "2018-07-06T19:04:41+00:00" + }, + { + "name": "acmephp/ssl", + "version": "1.0.0-beta4", + "source": { + "type": "git", + "url": "https://github.com/acmephp/ssl.git", + "reference": "fef7a791ae3a2e2921cd47cdceb6c10790c880bc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/acmephp/ssl/zipball/fef7a791ae3a2e2921cd47cdceb6c10790c880bc", + "reference": "fef7a791ae3a2e2921cd47cdceb6c10790c880bc", + "shasum": "" + }, + "require": { + "ext-openssl": "*", + "php": ">=5.5.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.22", + "sllh/php-cs-fixer-styleci-bridge": "^1.5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "AcmePhp\\Ssl\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Titouan Galopin", + "email": "galopintitouan@gmail.com", + "homepage": "http://titouangalopin.com" + }, + { + "name": "Jérémy Derussé", + "homepage": "https://twitter.com/jderusse" + } + ], + "description": "PHP wrapper around OpenSSL extension providing SSL encoding, decoding, parsing and signing features", + "homepage": "https://github.com/acmephp/ssl", + "keywords": [ + "acmephp", + "certificate", + "csr", + "https", + "openssl", + "ssl", + "x509" + ], + "time": "2016-12-28T23:53:27+00:00" + }, { "name": "composer/ca-bundle", "version": "1.1.1", @@ -307,20 +434,25 @@ }, { "name": "easyengine/site-command", - "version": "v1.0.0-beta.2", + "version": "v1.0.0-beta.3", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "ef914e38bd2a3f24ea54f7ad5ce393fd058b2840" + "reference": "d0f22148631e014f2e7a86a8f9c6bcb8c6491fa7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/ef914e38bd2a3f24ea54f7ad5ce393fd058b2840", - "reference": "ef914e38bd2a3f24ea54f7ad5ce393fd058b2840", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/d0f22148631e014f2e7a86a8f9c6bcb8c6491fa7", + "reference": "d0f22148631e014f2e7a86a8f9c6bcb8c6491fa7", "shasum": "" }, "require": { - "yosymfony/toml": "^1.0" + "acmephp/core": "dev-master", + "ext-openssl": "*", + "guzzlehttp/guzzle": "^6.0", + "league/flysystem": "^1.0.19", + "symfony/serializer": "^3.0", + "webmozart/assert": "^1.0" }, "type": "ee-cli-package", "extra": { @@ -337,7 +469,8 @@ }, "autoload": { "psr-4": { - "": "src/" + "": "src/", + "AcmePhp\\Cli\\": "AcmePhp/Cli" }, "files": [ "site-command.php" @@ -348,7 +481,188 @@ "MIT" ], "homepage": "https://github.com/easyengine/site-command", - "time": "2018-06-28T17:50:46+00:00" + "time": "2018-07-10T18:35:34+00:00" + }, + { + "name": "guzzlehttp/guzzle", + "version": "6.3.3", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba", + "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba", + "shasum": "" + }, + "require": { + "guzzlehttp/promises": "^1.0", + "guzzlehttp/psr7": "^1.4", + "php": ">=5.5" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", + "psr/log": "^1.0" + }, + "suggest": { + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.3-dev" + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "time": "2018-04-22T15:46:56+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "v1.3.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "shasum": "" + }, + "require": { + "php": ">=5.5.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "time": "2016-12-20T10:07:11+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "1.4.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "request", + "response", + "stream", + "uri", + "url" + ], + "time": "2017-03-20T17:10:46+00:00" }, { "name": "justinrainbow/json-schema", @@ -416,6 +730,90 @@ ], "time": "2018-02-14T22:26:30+00:00" }, + { + "name": "league/flysystem", + "version": "1.0.45", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/flysystem.git", + "reference": "a99f94e63b512d75f851b181afcdf0ee9ebef7e6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/a99f94e63b512d75f851b181afcdf0ee9ebef7e6", + "reference": "a99f94e63b512d75f851b181afcdf0ee9ebef7e6", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "conflict": { + "league/flysystem-sftp": "<1.0.6" + }, + "require-dev": { + "ext-fileinfo": "*", + "phpspec/phpspec": "^3.4", + "phpunit/phpunit": "^5.7" + }, + "suggest": { + "ext-fileinfo": "Required for MimeType", + "ext-ftp": "Allows you to use FTP server storage", + "ext-openssl": "Allows you to use FTPS server storage", + "league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2", + "league/flysystem-aws-s3-v3": "Allows you to use S3 storage with AWS SDK v3", + "league/flysystem-azure": "Allows you to use Windows Azure Blob storage", + "league/flysystem-cached-adapter": "Flysystem adapter decorator for metadata caching", + "league/flysystem-eventable-filesystem": "Allows you to use EventableFilesystem", + "league/flysystem-rackspace": "Allows you to use Rackspace Cloud Files", + "league/flysystem-sftp": "Allows you to use SFTP server storage via phpseclib", + "league/flysystem-webdav": "Allows you to use WebDAV storage", + "league/flysystem-ziparchive": "Allows you to use ZipArchive adapter", + "spatie/flysystem-dropbox": "Allows you to use Dropbox storage", + "srmklive/flysystem-dropbox-v2": "Allows you to use Dropbox storage for PHP 5 applications" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Flysystem\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frank de Jonge", + "email": "info@frenky.net" + } + ], + "description": "Filesystem abstraction: Many filesystems, one API.", + "keywords": [ + "Cloud Files", + "WebDAV", + "abstraction", + "aws", + "cloud", + "copy.com", + "dropbox", + "file systems", + "files", + "filesystem", + "filesystems", + "ftp", + "rackspace", + "remote", + "s3", + "sftp", + "storage" + ], + "time": "2018-05-07T08:44:23+00:00" + }, { "name": "monolog/monolog", "version": "1.23.0", @@ -589,6 +987,56 @@ ], "time": "2017-02-14T16:28:37+00:00" }, + { + "name": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "time": "2016-08-06T14:39:51+00:00" + }, { "name": "psr/log", "version": "1.0.2", @@ -1456,6 +1904,85 @@ "homepage": "https://symfony.com", "time": "2018-05-30T04:24:30+00:00" }, + { + "name": "symfony/serializer", + "version": "v3.4.12", + "source": { + "type": "git", + "url": "https://github.com/symfony/serializer.git", + "reference": "2e6d57dbbb37691f1480393440aff3a4b69dd9f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/serializer/zipball/2e6d57dbbb37691f1480393440aff3a4b69dd9f7", + "reference": "2e6d57dbbb37691f1480393440aff3a4b69dd9f7", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "phpdocumentor/type-resolver": "<0.2.1", + "symfony/dependency-injection": "<3.2", + "symfony/property-access": ">=3.0,<3.0.4|>=2.8,<2.8.4", + "symfony/property-info": "<3.1", + "symfony/yaml": "<3.4" + }, + "require-dev": { + "doctrine/annotations": "~1.0", + "doctrine/cache": "~1.0", + "phpdocumentor/reflection-docblock": "^3.0|^4.0", + "symfony/cache": "~3.1|~4.0", + "symfony/config": "~2.8|~3.0|~4.0", + "symfony/dependency-injection": "~3.2|~4.0", + "symfony/http-foundation": "~2.8|~3.0|~4.0", + "symfony/property-access": "~2.8|~3.0|~4.0", + "symfony/property-info": "~3.1|~4.0", + "symfony/yaml": "~3.4|~4.0" + }, + "suggest": { + "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.", + "doctrine/cache": "For using the default cached annotation reader and metadata cache.", + "psr/cache-implementation": "For using the metadata cache.", + "symfony/config": "For using the XML mapping loader.", + "symfony/http-foundation": "To use the DataUriNormalizer.", + "symfony/property-access": "For using the ObjectNormalizer.", + "symfony/property-info": "To deserialize relations.", + "symfony/yaml": "For using the default YAML mapping loader." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Serializer\\": "" + }, + "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": "Symfony Serializer Component", + "homepage": "https://symfony.com", + "time": "2018-06-22T08:58:39+00:00" + }, { "name": "symfony/translation", "version": "v3.4.12", @@ -1583,6 +2110,56 @@ "homepage": "https://symfony.com", "time": "2018-05-03T23:18:14+00:00" }, + { + "name": "webmozart/assert", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "0df1908962e7a3071564e857d86874dad1ef204a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", + "reference": "0df1908962e7a3071564e857d86874dad1ef204a", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2018-01-29T19:49:41+00:00" + }, { "name": "wp-cli/autoload-splitter", "version": "v0.1.5", @@ -1721,102 +2298,6 @@ "console" ], "time": "2018-04-20T08:11:30+00:00" - }, - { - "name": "yosymfony/parser-utils", - "version": "v1.0.0", - "source": { - "type": "git", - "url": "https://github.com/yosymfony/parser-utils.git", - "reference": "5376469d996a8f09139c0c795048b1140d143281" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/yosymfony/parser-utils/zipball/5376469d996a8f09139c0c795048b1140d143281", - "reference": "5376469d996a8f09139c0c795048b1140d143281", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-4": { - "Yosymfony\\ParserUtils\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Victor Puertas", - "email": "vpgugr@gmail.com", - "homepage": "http://yosymfony.com" - } - ], - "description": "Parser utilities", - "homepage": "http://github.com/yosymfony/toml", - "keywords": [ - "lexer", - "parser" - ], - "time": "2017-11-18T22:30:41+00:00" - }, - { - "name": "yosymfony/toml", - "version": "v1.0.1", - "source": { - "type": "git", - "url": "https://github.com/yosymfony/toml.git", - "reference": "8d67c2c9a5941d40a3a37ff42c3c3b72a0a09678" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/yosymfony/toml/zipball/8d67c2c9a5941d40a3a37ff42c3c3b72a0a09678", - "reference": "8d67c2c9a5941d40a3a37ff42c3c3b72a0a09678", - "shasum": "" - }, - "require": { - "php": ">=7.1", - "yosymfony/parser-utils": "^1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-4": { - "Yosymfony\\Toml\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Victor Puertas", - "email": "vpgugr@gmail.com", - "homepage": "http://yosymfony.com" - } - ], - "description": "A PHP parser for TOML compatible with specification 0.4.0", - "homepage": "http://github.com/yosymfony/toml", - "keywords": [ - "mojombo", - "parser", - "toml" - ], - "time": "2018-02-05T22:43:21+00:00" } ], "packages-dev": [ @@ -2482,12 +2963,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "0e4ea9f9e1fd3c6a563524f8f399696d98c7c85a" + "reference": "731d60f7fc78a8816dae7049df255cd55e30c313" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/0e4ea9f9e1fd3c6a563524f8f399696d98c7c85a", - "reference": "0e4ea9f9e1fd3c6a563524f8f399696d98c7c85a", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/731d60f7fc78a8816dae7049df255cd55e30c313", + "reference": "731d60f7fc78a8816dae7049df255cd55e30c313", "shasum": "" }, "conflict": { @@ -2538,7 +3019,7 @@ "laravel/socialite": ">=1,<1.0.99|>=2,<2.0.10", "magento/magento1ce": ">=1.5.0.1,<1.9.3.2", "magento/magento1ee": ">=1.9,<1.14.3.2", - "magento/magento2ce": ">=2,<2.2", + "magento/product-community-edition": ">=2,<2.2.5", "monolog/monolog": ">=1.8,<1.12", "namshi/jose": "<2.2", "onelogin/php-saml": "<2.10.4", @@ -2569,6 +3050,8 @@ "squizlabs/php_codesniffer": ">=1,<2.8.1|>=3,<3.0.1", "stormpath/sdk": ">=0,<9.9.99", "swiftmailer/swiftmailer": ">=4,<5.4.5", + "sylius/admin-bundle": ">=1,<1.0.17|>=1.1,<1.1.9|>=1.2,<1.2.2", + "sylius/sylius": ">=1,<1.0.17|>=1.1,<1.1.9|>=1.2,<1.2.2", "symfony/dependency-injection": ">=2,<2.0.17", "symfony/form": ">=2.3,<2.3.35|>=2.4,<2.6.12|>=2.7,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", "symfony/framework-bundle": ">=2,<2.3.18|>=2.4,<2.4.8|>=2.5,<2.5.2", @@ -2641,7 +3124,7 @@ } ], "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", - "time": "2018-06-08T09:55:50+00:00" + "time": "2018-07-09T14:09:25+00:00" }, { "name": "squizlabs/php_codesniffer", From c3ebb8f5bf8cb4b687f195e18bd9f432956d35fc Mon Sep 17 00:00:00 2001 From: Mriyam Tamuli <mbtamuli@gmail.com> Date: Wed, 11 Jul 2018 00:31:08 +0530 Subject: [PATCH 0231/1044] Bump working version to v4.0.0-beta.3 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 2f9037bc3..7d7c473b3 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.0.0-beta.2 +4.0.0-beta.3 From 20c1f19f8d51aa3862bfd3f2b9364a7be973561c Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Wed, 11 Jul 2018 19:12:24 +0530 Subject: [PATCH 0232/1044] Remove site-command tests. Update feature functions to only have ee test function. --- features/bootstrap/FeatureContext.php | 88 +-------------------------- features/site.feature | 60 ------------------ 2 files changed, 1 insertion(+), 147 deletions(-) delete mode 100644 features/site.feature diff --git a/features/bootstrap/FeatureContext.php b/features/bootstrap/FeatureContext.php index 9c51152e4..2261620ef 100644 --- a/features/bootstrap/FeatureContext.php +++ b/features/bootstrap/FeatureContext.php @@ -93,98 +93,12 @@ public function stdoutShouldReturnSomethingLike($output_stream, PyStringNode $ex } } - /** - * @Then The :site db entry should be removed - */ - public function theDbEntryShouldBeRemoved($site) - { - $out = shell_exec("sudo bin/ee site list"); - if (strpos($out, $site) !== false) { - throw new Exception("$site db entry not been removed!"); - } - - } - - /** - * @Then The :site webroot should be removed - */ - public function theWebrootShouldBeRemoved($site) - { - if (file_exists(getenv('HOME') . "/ee-sites/" . $site)) { - throw new Exception("Webroot has not been removed!"); - } - } - - /** - * @Then Following containers of site :site should be removed: - */ - public function followingContainersOfSiteShouldBeRemoved($site, TableNode $table) - { - $containers = $table->getHash(); - $site_name = implode(explode('.', $site)); - - foreach ($containers as $container) { - - $sevice = $container['container']; - $container_name = $site_name . '_' . $sevice . '_1'; - - exec("docker inspect -f '{{.State.Running}}' $container_name > /dev/null 2>&1", $exec_out, $return); - if (!$return) { - throw new Exception("$container_name has not been removed!"); - } - } - } - - /** - * @Then The site :site should have webroot - */ - public function theSiteShouldHaveWebroot($site) - { - if (!file_exists(getenv('HOME') . "/ee-sites/" . $site)) { - throw new Exception("Webroot has not been created!"); - } - } - - /** - * @Then The site :site should have WordPress - */ - public function theSiteShouldHaveWordpress($site) - { - if (!file_exists(getenv('HOME') . "/ee-sites/" . $site . "/app/src/wp-config.php")) { - throw new Exception("WordPress data not found!"); - } - } - - /** - * @Then Request on :site should contain following headers: - */ - public function requestOnShouldContainFollowingHeaders($site, TableNode $table) - { - $url = 'http://' . $site; - - $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, $url); - curl_setopt($ch, CURLOPT_HEADER, true); - curl_setopt($ch, CURLOPT_NOBODY, true); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - $headers = curl_exec($ch); - curl_close($ch); - - $rows = $table->getHash(); - - foreach ($rows as $row) { - if (strpos($headers, $row['header']) === false) { - throw new Exception("Unable to find " . $row['header'] . "\nActual output is : " . $headers); - } - } - } - + /** * @AfterFeature */ public static function cleanup(AfterFeatureScope $scope) { - exec("sudo bin/ee site delete hello.test"); if(file_exists('ee.phar')) { unlink('ee.phar'); } diff --git a/features/site.feature b/features/site.feature deleted file mode 100644 index 168d91dcd..000000000 --- a/features/site.feature +++ /dev/null @@ -1,60 +0,0 @@ -Feature: Site Command - - Scenario: ee throws error when run without root - Given 'bin/ee' is installed - When I run 'bin/ee' - Then STDERR should return exactly - """ - Error: Please run `ee` with root privileges. - """ - - Scenario: ee executable is command working correctly - Given 'bin/ee' is installed - When I run 'sudo bin/ee' - Then STDOUT should return something like - """ - NAME - - ee - """ - - Scenario: Check site command is present - When I run 'sudo bin/ee site' - Then STDOUT should return something like - """ - usage: ee site - """ - - Scenario: Create site successfully - When I run 'sudo bin/ee site create hello.test --wp' - Then The site 'hello.test' should have webroot - And The site 'hello.test' should have WordPress - And Request on 'hello.test' should contain following headers: - | header | - | HTTP/1.1 200 OK | - - Scenario: List the sites - When I run 'sudo bin/ee site list --format=text' - Then STDOUT should return exactly - """ - hello.test - """ - - Scenario: Delete the sites - When I run 'sudo bin/ee site delete hello.test --yes' - Then STDOUT should return something like - """ - Site hello.test deleted. - """ - And STDERR should return exactly - """ - """ - And The 'hello.test' db entry should be removed - And The 'hello.test' webroot should be removed - And Following containers of site 'hello.test' should be removed: - | container | - | nginx | - | php | - | db | - | redis | - | phpmyadmin | From 5b92235ccd0aa449e578e8e9cf290f233bc8b196 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Wed, 11 Jul 2018 19:12:48 +0530 Subject: [PATCH 0233/1044] Add test run --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index dc7601aae..9b50ec060 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,6 +21,7 @@ install: before_script: - composer validate + - ./vendor/bin/behat - ./ci/prepare.sh jobs: From 0dfbd27ed1bb537906593ea9ecb218b4407cc770 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Wed, 11 Jul 2018 19:22:05 +0530 Subject: [PATCH 0234/1044] Update test env installation --- .travis.yml | 1 + ci/test-env-install.sh | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100755 ci/test-env-install.sh diff --git a/.travis.yml b/.travis.yml index 9b50ec060..ff18f3e04 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,7 @@ before_install: install: - composer install --no-interaction + - ./ci/test-env-install.sh before_script: - composer validate diff --git a/ci/test-env-install.sh b/ci/test-env-install.sh new file mode 100755 index 000000000..0673ebbcb --- /dev/null +++ b/ci/test-env-install.sh @@ -0,0 +1,25 @@ +function setup_test_requirements() { + # Adding software-properties-common for add-apt-repository. + apt-get install -y software-properties-common + # Adding ondrej/php repository for installing php, this works for all ubuntu flavours. + add-apt-repository -y ppa:ondrej/php + apt-get update + # Installing php-cli, which is the minimum requirement to run EasyEngine + apt-get -y install php7.2-cli + + php_modules=( pcntl curl sqlite3 ) + if command -v php > /dev/null 2>&1; then + # Reading the php version. + default_php_version="$(readlink -f /usr/bin/php | gawk -F "php" '{ print $2}')" + for module in "${php_modules[@]}"; do + if ! php -m | grep $module >> $LOG_FILE 2>&1; then + echo "$module not installed. Installing..." + apt install -y php$default_php_version-$module + else + echo "$module is already installed" + fi + done + fi +} + +setup_test_requirements From 38e6fe8e8231654b1ec2ef0252bee812a7a8ae63 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Wed, 11 Jul 2018 19:30:37 +0530 Subject: [PATCH 0235/1044] Add env and sudo permission --- .travis.yml | 2 +- ci/test-env-install.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ff18f3e04..fe80b8aac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ before_install: install: - composer install --no-interaction - - ./ci/test-env-install.sh + - sudo ./ci/test-env-install.sh before_script: - composer validate diff --git a/ci/test-env-install.sh b/ci/test-env-install.sh index 0673ebbcb..9c7361b7c 100755 --- a/ci/test-env-install.sh +++ b/ci/test-env-install.sh @@ -1,3 +1,4 @@ +#!/usr/bin/env bash function setup_test_requirements() { # Adding software-properties-common for add-apt-repository. apt-get install -y software-properties-common From 1f547cddaa99e35c9e2df063ec1c33487a486164 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Fri, 13 Jul 2018 21:11:20 +0530 Subject: [PATCH 0236/1044] Update db for services --- php/class-ee-db.php | 41 +++++++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/php/class-ee-db.php b/php/class-ee-db.php index 7ecbc88f2..5d9d8e904 100644 --- a/php/class-ee-db.php +++ b/php/class-ee-db.php @@ -9,7 +9,7 @@ public function __construct() { self::init_db(); } } - + public function __destruct() { self::$db->close(); } @@ -34,7 +34,7 @@ public static function init_db() { public static function create() { self::$db = new SQLite3( DB ); $query = "CREATE TABLE sites ( - id INTEGER NOT NULL, + id INTEGER NOT NULL, sitename VARCHAR, site_type VARCHAR, site_title VARCHAR, @@ -56,19 +56,31 @@ public static function create() { wp_pass VARCHAR, email VARCHAR, php_version VARCHAR, - PRIMARY KEY (id), + PRIMARY KEY (id), UNIQUE (sitename), - CHECK (is_enabled IN (0, 1)), + CHECK (is_enabled IN (0, 1)), CHECK (is_ssl IN (0, 1)) );"; - self::$db->exec( $query ); - - $query = "CREATE TABLE migrations ( + $query .= "CREATE TABLE migrations ( migration VARCHAR, timestamp DATETIME );"; + $query .= "CREATE TABLE services ( + id INTEGER NOT NULL, + sitename VARCHAR, + phpmyadmin BOOLEAN DEFAULT 0, + mailhog BOOLEAN DEFAULT 0, + postfix BOOLEAN DEFAULT 0, + phpredisadmin BOOLEAN DEFAULT 0, + adminer BOOLEAN DEFAULT 0, + anemometer BOOLEAN DEFAULT 0, + debug BOOLEAN DEFAULT 0, + PRIMARY KEY (id), + FOREIGN KEY (id) REFERENCES sites(id) + );"; + self::$db->exec( $query ); } @@ -79,7 +91,7 @@ public static function create() { * * @return bool */ - public static function insert( $data, $table_name='sites' ) { + public static function insert( $data, $table_name = 'sites' ) { if ( empty ( self::$db ) ) { self::init_db(); @@ -109,7 +121,7 @@ public static function insert( $data, $table_name='sites' ) { * * @return array|bool */ - public static function select( $columns = array(), $where = array(), $table_name='sites' ) { + public static function select( $columns = array(), $where = array(), $table_name = 'sites', $limit = null ) { if ( empty ( self::$db ) ) { self::init_db(); @@ -134,6 +146,10 @@ public static function select( $columns = array(), $where = array(), $table_name $select_data_query .= " WHERE $conditions"; } + if ( ! empty( $limit ) ) { + $select_data_query .= " LIMIT $limit"; + } + $select_data_exec = self::$db->query( $select_data_query ); $select_data = array(); if ( $select_data_exec ) { @@ -157,7 +173,7 @@ public static function select( $columns = array(), $where = array(), $table_name * * @return bool */ - public static function update( $data, $where, $table_name='sites' ) { + public static function update( $data, $where, $table_name = 'sites' ) { if ( empty ( self::$db ) ) { self::init_db(); } @@ -192,7 +208,7 @@ public static function update( $data, $where, $table_name='sites' ) { * * @return bool */ - public static function delete( $where, $table_name='sites' ) { + public static function delete( $where, $table_name = 'sites' ) { $conditions = array(); foreach ( $where as $key => $value ) { @@ -268,9 +284,10 @@ public static function get_migrations() { } $sites = self::select( [ 'migration' ], [], 'migrations' ); - if( empty( $sites ) ) { + if ( empty( $sites ) ) { return []; } + return array_column( $sites, 'migration' ); } } From 14983f912495bf9878a53968b1ba3ff57a9d6c7b Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Fri, 13 Jul 2018 21:11:44 +0530 Subject: [PATCH 0237/1044] Make docker functions more generic --- php/class-ee-docker.php | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php index 5acdefb89..8f654f082 100644 --- a/php/class-ee-docker.php +++ b/php/class-ee-docker.php @@ -152,14 +152,21 @@ public static function disconnect_site_network_from( $site_name, $from_container /** * Function to boot the containers. * - * @param String $dir Path to docker-compose.yml. + * @param String $dir Path to docker-compose.yml. + * @param array $services Services to bring up. * * @return bool success. */ - public static function docker_compose_up( $dir ) { + public static function docker_compose_up( $dir, $services = [] ) { $chdir_return_code = chdir( $dir ); if ( $chdir_return_code ) { - return default_launch( 'docker-compose up -d' ); + if ( empty( $services ) ) { + return default_launch( 'docker-compose up -d' ); + } else { + $all_services = implode( ' ', $services ); + + return default_launch( "docker-compose up -d $all_services" ); + } } return false; @@ -168,14 +175,21 @@ public static function docker_compose_up( $dir ) { /** * Function to destroy the containers. * - * @param String $dir Path to docker-compose.yml. + * @param String $dir Path to docker-compose.yml. + * @param array $services Services to bring up. * * @return bool success. */ - public static function docker_compose_down( $dir ) { + public static function docker_compose_down( $dir, $services = [] ) { $chdir_return_code = chdir( $dir ); if ( $chdir_return_code ) { - return default_launch( 'docker-compose down' ); + if ( empty( $services ) ) { + return default_launch( 'docker-compose up -d' ); + } else { + $all_services = implode( ' ', $services ); + + return default_launch( "docker-compose up $all_services -d" ); + } } return false; From 4d46b2731c7293759fe844a48af4bae0f32bdae0 Mon Sep 17 00:00:00 2001 From: Mike Little <mike@zed1.com> Date: Fri, 13 Jul 2018 23:41:26 +0100 Subject: [PATCH 0238/1044] Update support commands to be new cli versions. --- .github/CONTRIBUTING.md | 4 ++-- .github/ISSUE_TEMPLATE.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 7f557a8e2..457de7a5b 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -10,8 +10,8 @@ Please attach the output of following command when open a new support request. ```bash lsb_release -a -ee -v -ee info +ee cli version +ee cli info wp --allow-root --info ``` diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index b2e446cb8..11f07cc10 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -4,6 +4,6 @@ If you feel the issue is a EasyEngine core specific issue, please attach the out System Information - [ ] lsb_release -a -- [ ] ee -v -- [ ] ee info +- [ ] ee cli version +- [ ] ee cli info - [ ] wp --allow-root --info From e729fc6ea72d35761a4553260de7ea76c8fd7110 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh.sanghvi@rtcamp.com> Date: Sun, 15 Jul 2018 18:20:33 +0530 Subject: [PATCH 0239/1044] Fix docker-compse down --- php/class-ee-docker.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php index 8f654f082..1fa1c6bb0 100644 --- a/php/class-ee-docker.php +++ b/php/class-ee-docker.php @@ -172,26 +172,21 @@ public static function docker_compose_up( $dir, $services = [] ) { return false; } - /** + /** * Function to destroy the containers. * * @param String $dir Path to docker-compose.yml. - * @param array $services Services to bring up. * * @return bool success. */ - public static function docker_compose_down( $dir, $services = [] ) { + public static function docker_compose_down( $dir ) { $chdir_return_code = chdir( $dir ); if ( $chdir_return_code ) { - if ( empty( $services ) ) { - return default_launch( 'docker-compose up -d' ); - } else { - $all_services = implode( ' ', $services ); - return default_launch( "docker-compose up $all_services -d" ); - } + return default_launch( 'docker-compose down' ); } return false; } + } From b5906a5acef13b3999f92e89756fa111813dfa51 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Mon, 16 Jul 2018 21:39:02 +0530 Subject: [PATCH 0240/1044] Add cli self-uninstall command Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/commands/src/CLI_Command.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/php/commands/src/CLI_Command.php b/php/commands/src/CLI_Command.php index 602b50022..ac8a1f474 100644 --- a/php/commands/src/CLI_Command.php +++ b/php/commands/src/CLI_Command.php @@ -162,7 +162,7 @@ public function info( $_, $assoc_args ) { /** * Function to run migrations required to upgrade to the newer version. Will always be invoked from the newer phar downloaded inside the /tmp folder */ - public function migrate() { + private function migrate() { EE\Migration\Executor::execute_migrations(); } @@ -488,6 +488,20 @@ public function cmd_dump() { echo json_encode( $this->command_to_array( EE::get_root_command() ) ); } + /** + * Uninstalls easyengine completely along with all sites + * + * @subcommand self-uninstall + */ + public function self_uninstall() { + EE::confirm("Are you sure you want to remove EasyEngine and all its sites(along with their data) ?"); + Utils\default_launch("docker rm -f $(docker ps -aqf label=org.label-schema.vendor=\"EasyEngine\")"); + $home = Utils\get_home_dir(); + Utils\default_launch("rm -rf $home/.ee/"); + Utils\default_launch("rm -rf $home/ee-sites/"); + Utils\default_launch("rm -rf " . EE_CONF_ROOT); + } + /** * Generate tab completion strings. * From ae86655d842617fb17ddb2fececffc33a82aa85a Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Mon, 16 Jul 2018 22:03:03 +0530 Subject: [PATCH 0241/1044] Add test for uninstall command Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- features/bootstrap/FeatureContext.php | 25 ++++++++++++++++++++++--- features/cli.feature | 6 +++++- php/commands/src/CLI_Command.php | 11 +++++++++-- 3 files changed, 36 insertions(+), 6 deletions(-) diff --git a/features/bootstrap/FeatureContext.php b/features/bootstrap/FeatureContext.php index 2261620ef..9df9825fa 100644 --- a/features/bootstrap/FeatureContext.php +++ b/features/bootstrap/FeatureContext.php @@ -7,8 +7,7 @@ use Behat\Behat\Hook\Scope\AfterFeatureScope; -use Behat\Gherkin\Node\PyStringNode, - Behat\Gherkin\Node\TableNode; +use Behat\Gherkin\Node\PyStringNode; class FeatureContext implements Context { @@ -93,7 +92,27 @@ public function stdoutShouldReturnSomethingLike($output_stream, PyStringNode $ex } } - + /** + * @Then ee should be deleted + */ + public function eeShouldBeDeleted() + { + $result = EE::launch("docker ps -aqf label=org.label-schema.vendor=\"EasyEngine\" | wc -l", false, true); + if( trim($result->stdout) !== '0' ) { + throw new Exception("All containers have not been removed."); + } + $home = getenv('HOME'); + if(file_exists("$home/.ee/")){ + throw new Exception("~/.ee/ has not been removed"); + } + if(file_exists("$home/ee-sites/")){ + throw new Exception("~/ee-sites/ has not been removed"); + } + if(file_exists(EE_CONF_ROOT)){ + throw new Exception(EE_CONF_ROOT . "has not been removed"); + } + } + /** * @AfterFeature */ diff --git a/features/cli.feature b/features/cli.feature index c74498d87..165de3ff2 100644 --- a/features/cli.feature +++ b/features/cli.feature @@ -13,4 +13,8 @@ Feature: CLI Command Scenario: ee update works properly Given ee phar is generated When I run 'sudo php ee.phar cli update --yes' - Then return value should be 0 \ No newline at end of file + Then return value should be 0 + + Scenario: ee uninstall works properly + When I run 'sudo bin/ee cli self-uninstall --yes' + Then ee should be deleted diff --git a/php/commands/src/CLI_Command.php b/php/commands/src/CLI_Command.php index ac8a1f474..8f1be58ec 100644 --- a/php/commands/src/CLI_Command.php +++ b/php/commands/src/CLI_Command.php @@ -491,10 +491,17 @@ public function cmd_dump() { /** * Uninstalls easyengine completely along with all sites * + * ## OPTIONS + * + * [--yes] + * : Do not prompt for confirmation. + * * @subcommand self-uninstall */ - public function self_uninstall() { - EE::confirm("Are you sure you want to remove EasyEngine and all its sites(along with their data) ?"); + public function self_uninstall( $args, $assoc_args ) { + + EE::confirm("Are you sure you want to remove EasyEngine and all its sites(along with their data) ?", $assoc_args); + Utils\default_launch("docker rm -f $(docker ps -aqf label=org.label-schema.vendor=\"EasyEngine\")"); $home = Utils\get_home_dir(); Utils\default_launch("rm -rf $home/.ee/"); From d8b7bb723788dc30bc3cc677b2aadb54eed66273 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Mon, 16 Jul 2018 22:12:17 +0530 Subject: [PATCH 0242/1044] Hardcode easyengine path Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- features/bootstrap/FeatureContext.php | 4 ++-- php/commands/src/CLI_Command.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/features/bootstrap/FeatureContext.php b/features/bootstrap/FeatureContext.php index 9df9825fa..93dd27871 100644 --- a/features/bootstrap/FeatureContext.php +++ b/features/bootstrap/FeatureContext.php @@ -108,8 +108,8 @@ public function eeShouldBeDeleted() if(file_exists("$home/ee-sites/")){ throw new Exception("~/ee-sites/ has not been removed"); } - if(file_exists(EE_CONF_ROOT)){ - throw new Exception(EE_CONF_ROOT . "has not been removed"); + if(file_exists('/opt/easyengine/')){ + throw new Exception("/opt/easyengine/ has not been removed"); } } diff --git a/php/commands/src/CLI_Command.php b/php/commands/src/CLI_Command.php index 8f1be58ec..d7176a6f5 100644 --- a/php/commands/src/CLI_Command.php +++ b/php/commands/src/CLI_Command.php @@ -506,7 +506,7 @@ public function self_uninstall( $args, $assoc_args ) { $home = Utils\get_home_dir(); Utils\default_launch("rm -rf $home/.ee/"); Utils\default_launch("rm -rf $home/ee-sites/"); - Utils\default_launch("rm -rf " . EE_CONF_ROOT); + Utils\default_launch("rm -rf /opt/easyengine/"); } /** From a03ad8c6f01c8edf59083d00250c07f2fe31d6b8 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Tue, 17 Jul 2018 11:44:46 +0530 Subject: [PATCH 0243/1044] Improve confirmation message Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/commands/src/CLI_Command.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/commands/src/CLI_Command.php b/php/commands/src/CLI_Command.php index d7176a6f5..b3858fc0e 100644 --- a/php/commands/src/CLI_Command.php +++ b/php/commands/src/CLI_Command.php @@ -500,7 +500,7 @@ public function cmd_dump() { */ public function self_uninstall( $args, $assoc_args ) { - EE::confirm("Are you sure you want to remove EasyEngine and all its sites(along with their data) ?", $assoc_args); + EE::confirm("Are you sure you want to remove EasyEngine and all its sites(along with their data)?\nThis is an irreversible action. No backup will be kept.", $assoc_args); Utils\default_launch("docker rm -f $(docker ps -aqf label=org.label-schema.vendor=\"EasyEngine\")"); $home = Utils\get_home_dir(); From c4eb3d4e2a0d4cb7a14543fb06400a183a9a5a60 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Tue, 17 Jul 2018 14:46:58 +0530 Subject: [PATCH 0244/1044] Fix ee uninstallation as per PR Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/commands/src/CLI_Command.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/php/commands/src/CLI_Command.php b/php/commands/src/CLI_Command.php index b3858fc0e..cd7f8a76a 100644 --- a/php/commands/src/CLI_Command.php +++ b/php/commands/src/CLI_Command.php @@ -1,8 +1,8 @@ <?php use \Composer\Semver\Comparator; +use \Symfony\Component\Filesystem\Filesystem; use \EE\Utils; -use Mustangostang\Spyc; /** * Review current EE info, check for updates, or see defined aliases. @@ -505,7 +505,16 @@ public function self_uninstall( $args, $assoc_args ) { Utils\default_launch("docker rm -f $(docker ps -aqf label=org.label-schema.vendor=\"EasyEngine\")"); $home = Utils\get_home_dir(); Utils\default_launch("rm -rf $home/.ee/"); - Utils\default_launch("rm -rf $home/ee-sites/"); + + $records = EE::db()->select(['site_path']); + + if( $records !== false ) { + $sites_paths = array_column($records, 'site_path'); + $fs = new Filesystem(); + $fs->remove($sites_paths); + } + + Utils\default_launch("rm -df $home/ee-sites/"); Utils\default_launch("rm -rf /opt/easyengine/"); } From 91ca476487888f92325416a8665283836b0761eb Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Thu, 19 Jul 2018 13:55:03 +0530 Subject: [PATCH 0245/1044] Add cron table Add start and stop container commands Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/class-ee-db.php | 7 +++++++ php/class-ee-docker.php | 24 +++++++++++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/php/class-ee-db.php b/php/class-ee-db.php index 5d9d8e904..0f739a858 100644 --- a/php/class-ee-db.php +++ b/php/class-ee-db.php @@ -81,6 +81,13 @@ public static function create() { FOREIGN KEY (id) REFERENCES sites(id) );"; + $query .= "CREATE TABLE cron ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + sitename VARCHAR, + command VARCHAR, + schedule VARCHAR, + );"; + self::$db->exec( $query ); } diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php index 1fa1c6bb0..1bc610cf4 100644 --- a/php/class-ee-docker.php +++ b/php/class-ee-docker.php @@ -59,6 +59,28 @@ public static function start_container( $container ) { return default_launch( "docker start $container" ); } + /** + * Function to stop a container + * + * @param String $container Container to be stopped. + * + * @return bool success. + */ + public static function stop_container( $container ) { + return default_launch( "docker stop $container" ); + } + + /** + * Function to restart a container + * + * @param String $container Container to be restarted. + * + * @return bool success. + */ + public static function restart_container( $container ) { + return default_launch( "docker restart $container" ); + } + /** * Function to create and start the container if it does not exist. * @@ -183,7 +205,7 @@ public static function docker_compose_down( $dir ) { $chdir_return_code = chdir( $dir ); if ( $chdir_return_code ) { - return default_launch( 'docker-compose down' ); + return default_launch( 'docker-compose down' ); } return false; From 6dd58a86ae1e6ec6e66802bb87cec05b93b9adfc Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 23 Jul 2018 13:50:06 +0530 Subject: [PATCH 0246/1044] Remove phar --- php/commands/src/CLI_Command.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/php/commands/src/CLI_Command.php b/php/commands/src/CLI_Command.php index cd7f8a76a..238a7038f 100644 --- a/php/commands/src/CLI_Command.php +++ b/php/commands/src/CLI_Command.php @@ -516,6 +516,10 @@ public function self_uninstall( $args, $assoc_args ) { Utils\default_launch("rm -df $home/ee-sites/"); Utils\default_launch("rm -rf /opt/easyengine/"); + + if ( Utils\inside_phar() ) { + unlink( realpath( $_SERVER['argv'][0] ) ); + } } /** From b436ece1c778589a929e30c4d5c56e24fbcb9efb Mon Sep 17 00:00:00 2001 From: Mriyam Tamuli <mbtamuli@gmail.com> Date: Mon, 23 Jul 2018 21:34:07 +0530 Subject: [PATCH 0247/1044] Update composer files for v4.0.0-beta.4 Signed-off-by: Mriyam Tamuli <mbtamuli@gmail.com> --- composer.json | 3 +- composer.lock | 89 ++++++++++++++++++++++++++++++++++++++------------- 2 files changed, 69 insertions(+), 23 deletions(-) diff --git a/composer.json b/composer.json index fe6502a52..612dfcf11 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,8 @@ "php": ">=5.3.29", "composer/composer": "^1.2.0", "composer/semver": "~1.0", - "easyengine/site-command": "v1.0.0-beta.3", + "easyengine/cron-command": "v1.0.0-beta.1", + "easyengine/site-command": "v1.0.0", "easyengine/shell-command": "v1.0.0-beta.1", "justinrainbow/json-schema": "~5.2.5", "monolog/monolog": "^1.23", diff --git a/composer.lock b/composer.lock index c95ed73dc..cf494918e 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": "53ee6a10e1195979b78c7a84bcff3413", + "content-hash": "b109c4c2b63f6aa91c0a297a81282e74", "packages": [ { "name": "acmephp/core", @@ -392,6 +392,49 @@ ], "time": "2018-04-30T10:33:04+00:00" }, + { + "name": "easyengine/cron-command", + "version": "v1.0.0-beta.1", + "source": { + "type": "git", + "url": "https://github.com/EasyEngine/cron-command.git", + "reference": "34b27c0b638a5dec73645eb39bd943850f7f973c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/EasyEngine/cron-command/zipball/34b27c0b638a5dec73645eb39bd943850f7f973c", + "reference": "34b27c0b638a5dec73645eb39bd943850f7f973c", + "shasum": "" + }, + "type": "ee-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "cron add", + "cron delete", + "cron list", + "cron run-now" + ] + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "cron-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Manages cron jobs in EasyEngine", + "homepage": "https://github.com/easyengine/cron-command", + "time": "2018-07-23T15:34:42+00:00" + }, { "name": "easyengine/shell-command", "version": "v1.0.0-beta.1", @@ -434,16 +477,16 @@ }, { "name": "easyengine/site-command", - "version": "v1.0.0-beta.3", + "version": "v1.0.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "d0f22148631e014f2e7a86a8f9c6bcb8c6491fa7" + "reference": "71fa9c5fae8022a9cc431f351e0100101c303dda" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/d0f22148631e014f2e7a86a8f9c6bcb8c6491fa7", - "reference": "d0f22148631e014f2e7a86a8f9c6bcb8c6491fa7", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/71fa9c5fae8022a9cc431f351e0100101c303dda", + "reference": "71fa9c5fae8022a9cc431f351e0100101c303dda", "shasum": "" }, "require": { @@ -481,7 +524,7 @@ "MIT" ], "homepage": "https://github.com/easyengine/site-command", - "time": "2018-07-10T18:35:34+00:00" + "time": "2018-07-23T15:42:41+00:00" }, { "name": "guzzlehttp/guzzle", @@ -2963,12 +3006,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "731d60f7fc78a8816dae7049df255cd55e30c313" + "reference": "053766d789f6393e5bc0896635d35abf8d2d362e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/731d60f7fc78a8816dae7049df255cd55e30c313", - "reference": "731d60f7fc78a8816dae7049df255cd55e30c313", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/053766d789f6393e5bc0896635d35abf8d2d362e", + "reference": "053766d789f6393e5bc0896635d35abf8d2d362e", "shasum": "" }, "conflict": { @@ -3017,7 +3060,7 @@ "kreait/firebase-php": ">=3.2,<3.8.1", "laravel/framework": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.40|>=5.6,<5.6.15", "laravel/socialite": ">=1,<1.0.99|>=2,<2.0.10", - "magento/magento1ce": ">=1.5.0.1,<1.9.3.2", + "magento/magento1ce": "<1.9.3.9", "magento/magento1ee": ">=1.9,<1.14.3.2", "magento/product-community-edition": ">=2,<2.2.5", "monolog/monolog": ">=1.8,<1.12", @@ -3075,7 +3118,8 @@ "thelia/thelia": ">=2.1,<2.1.2|>=2.1.0-beta1,<2.1.3", "titon/framework": ">=0,<9.9.99", "twig/twig": "<1.20", - "typo3/cms": ">=6.2,<6.2.30|>=7,<7.6.22|>=8,<8.7.5", + "typo3/cms": ">=6.2,<6.2.30|>=7,<7.6.30|>=8,<8.7.17|>=9,<9.3.2", + "typo3/cms-core": ">=8,<8.7.17|>=9,<9.3.2", "typo3/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.10|>=3.1,<3.1.7|>=3.2,<3.2.7|>=3.3,<3.3.5", "typo3/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4", "willdurand/js-translation-bundle": "<2.1.1", @@ -3124,7 +3168,7 @@ } ], "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", - "time": "2018-07-09T14:09:25+00:00" + "time": "2018-07-18T13:51:34+00:00" }, { "name": "squizlabs/php_codesniffer", @@ -3235,30 +3279,31 @@ }, { "name": "wimg/php-compatibility", - "version": "8.1.0", + "version": "8.2.0", "source": { "type": "git", - "url": "https://github.com/wimg/PHPCompatibility.git", - "reference": "4ac01e4fe8faaa4f8d3b3cd06ea92e5418ce472e" + "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", + "reference": "eaf613c1a8265bcfd7b0ab690783f2aef519f78a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wimg/PHPCompatibility/zipball/4ac01e4fe8faaa4f8d3b3cd06ea92e5418ce472e", - "reference": "4ac01e4fe8faaa4f8d3b3cd06ea92e5418ce472e", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/eaf613c1a8265bcfd7b0ab690783f2aef519f78a", + "reference": "eaf613c1a8265bcfd7b0ab690783f2aef519f78a", "shasum": "" }, "require": { "php": ">=5.3", - "squizlabs/php_codesniffer": "^2.2 || ^3.0.2" + "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" }, "conflict": { "squizlabs/php_codesniffer": "2.6.2" }, "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0" + "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" }, "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3" + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", + "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." }, "type": "phpcodesniffer-standard", "autoload": { @@ -3268,7 +3313,7 @@ }, "notification-url": "https://packagist.org/downloads/", "license": [ - "LGPL-3.0" + "LGPL-3.0-or-later" ], "authors": [ { @@ -3283,7 +3328,7 @@ "phpcs", "standards" ], - "time": "2017-12-27T21:58:38+00:00" + "time": "2018-07-17T13:42:26+00:00" }, { "name": "wp-coding-standards/wpcs", From faea24801d4a132a709c7d205fa980f27f6dd0d6 Mon Sep 17 00:00:00 2001 From: Mriyam Tamuli <mbtamuli@gmail.com> Date: Tue, 24 Jul 2018 11:21:56 +0530 Subject: [PATCH 0248/1044] Bump version to v4.0.0-beta.4 Signed-off-by: Mriyam Tamuli <mbtamuli@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 7d7c473b3..42caa876d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.0.0-beta.3 +4.0.0-beta.4 From 0e8dbd730f39771ec2f1dbe75350cea8c55b0967 Mon Sep 17 00:00:00 2001 From: Mriyam Tamuli <mbtamuli@gmail.com> Date: Tue, 24 Jul 2018 11:45:12 +0530 Subject: [PATCH 0249/1044] Remove erroneous comma in SQL query Signed-off-by: Mriyam Tamuli <mbtamuli@gmail.com> --- php/class-ee-db.php | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/php/class-ee-db.php b/php/class-ee-db.php index 0f739a858..f4697ea9e 100644 --- a/php/class-ee-db.php +++ b/php/class-ee-db.php @@ -35,29 +35,29 @@ public static function create() { self::$db = new SQLite3( DB ); $query = "CREATE TABLE sites ( id INTEGER NOT NULL, - sitename VARCHAR, - site_type VARCHAR, - site_title VARCHAR, - proxy_type VARCHAR, - cache_type VARCHAR, - site_path VARCHAR, - created_on DATETIME, - is_enabled BOOLEAN DEFAULT 1, - is_ssl BOOLEAN DEFAULT 0, - storage_fs VARCHAR, - storage_db VARCHAR, - db_name VARCHAR, - db_user VARCHAR, + sitename VARCHAR, + site_type VARCHAR, + site_title VARCHAR, + proxy_type VARCHAR, + cache_type VARCHAR, + site_path VARCHAR, + created_on DATETIME, + is_enabled BOOLEAN DEFAULT 1, + is_ssl BOOLEAN DEFAULT 0, + storage_fs VARCHAR, + storage_db VARCHAR, + db_name VARCHAR, + db_user VARCHAR, db_password VARCHAR, - db_root_password VARCHAR, - db_host VARCHAR, - db_port VARCHAR, - wp_user VARCHAR, - wp_pass VARCHAR, - email VARCHAR, - php_version VARCHAR, + db_root_password VARCHAR, + db_host VARCHAR, + db_port VARCHAR, + wp_user VARCHAR, + wp_pass VARCHAR, + email VARCHAR, + php_version VARCHAR, PRIMARY KEY (id), - UNIQUE (sitename), + UNIQUE (sitename), CHECK (is_enabled IN (0, 1)), CHECK (is_ssl IN (0, 1)) );"; @@ -85,7 +85,7 @@ public static function create() { id INTEGER PRIMARY KEY AUTOINCREMENT, sitename VARCHAR, command VARCHAR, - schedule VARCHAR, + schedule VARCHAR );"; self::$db->exec( $query ); From 6c3c6a00006d1920989bdd214efb394a1761f277 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Tue, 24 Jul 2018 21:11:38 +0530 Subject: [PATCH 0250/1044] add phar fix --- utils/make-phar.php | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/make-phar.php b/utils/make-phar.php index 0d48e3686..cb5b3d046 100644 --- a/utils/make-phar.php +++ b/utils/make-phar.php @@ -229,6 +229,7 @@ function get_composer_versions( $current_version ) { ->files() ->ignoreDotFiles(false) ->in(EE_VENDOR_DIR . '/easyengine/site-command/templates') + ->in(EE_VENDOR_DIR . '/easyengine/cron-command/templates') ->name('*.mustache') ->name('.env.mustache'); From 4bb0f20f7727677a1bdb9feb30603615b73ee3bd Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Tue, 24 Jul 2018 21:29:02 +0530 Subject: [PATCH 0251/1044] Add all templates folder in each repo --- utils/make-phar.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/utils/make-phar.php b/utils/make-phar.php index cb5b3d046..f40f7c7d1 100644 --- a/utils/make-phar.php +++ b/utils/make-phar.php @@ -228,8 +228,7 @@ function get_composer_versions( $current_version ) { $finder ->files() ->ignoreDotFiles(false) - ->in(EE_VENDOR_DIR . '/easyengine/site-command/templates') - ->in(EE_VENDOR_DIR . '/easyengine/cron-command/templates') + ->in(EE_VENDOR_DIR . '/easyengine/*-command/templates') ->name('*.mustache') ->name('.env.mustache'); From 9da9e8a4e6b65aaef6a52785386e69f584d39bee Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Wed, 25 Jul 2018 00:56:54 +0530 Subject: [PATCH 0252/1044] Add initial container migration --- php/EE/Migration/Containers.php | 56 +++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 php/EE/Migration/Containers.php diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php new file mode 100644 index 000000000..d53251588 --- /dev/null +++ b/php/EE/Migration/Containers.php @@ -0,0 +1,56 @@ +<?php + +namespace EE\Migration; +use function EE\Utils\default_launch; + +/** + * Migrates existing containers to new image + */ +class Containers { + + public static function start_container_migration() { + self::pull_new_images(); + + $sites = \EE_DB::select( [ 'sitename', 'site_path', 'site_type', 'cache_type', 'is_ssl', 'db_host' ] ); + $site_docker = new \Site_Docker(); + + foreach ( $sites as $site ) { + + $data[] = $site['site_type']; + $data[] = $site['cache_type']; + $data[] = $site['is_ssl']; + $data[] = $site['db_host']; + + $docker_compose_contents = $site_docker->generate_docker_compose_yml( $data ); + $docker_compose_path = $site['site_path'] . '/docker-compose.yml'; + + if ( ! default_launch( "cd ${site['site_path']} && mv docker-compose.yml docker-compose.yml._bak" ) ) { + EE::error( "Unable to find docker-compose.yml in ${site['site_path']} or couldn't create it's backup file. Ensure that EasyEngine has permission to create file there?" ); + } + + file_put_contents( $docker_compose_path, $docker_compose_contents ); + + $container_upgraded = default_launch( "cd ${site['site_path']} && docker-compose up -d", true, true ); + + if ( ! $container_upgraded ) { + EE::error( "Unable to upgrade containers of ${site['sitename']} site. Please check logs for more details." ); + } + } + } + + private static function pull_new_images() { + self::pull_or_error( 'easyengine/php', 'v' . EE_VERSION ); + self::pull_or_error( 'easyengine/cron', 'v' . EE_VERSION ); + self::pull_or_error( 'easyengine/redis', 'v' . EE_VERSION ); + self::pull_or_error( 'easyengine/nginx', 'v' . EE_VERSION ); + self::pull_or_error( 'easyengine/mailhog', 'v' . EE_VERSION ); + self::pull_or_error( 'easyengine/mariadb', 'v' . EE_VERSION ); + self::pull_or_error( 'easyengine/phpmyadmin', 'v' . EE_VERSION ); + } + + private static function pull_or_error( $image, $version ) { + if ( ! default_launch( "docker pull $image:$version" , true, true ) ) { + EE::error( "Unable to pull $image. Please check logs for more details." ); + } + } +} From 45393d154b85b469420925cc4283a59583805aa4 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Wed, 25 Jul 2018 16:50:44 +0530 Subject: [PATCH 0253/1044] Add RevertableStepProcessor. --- php/EE/Migration/Containers.php | 34 +++++++++--- php/EE/RevertableStepProcessor.php | 83 ++++++++++++++++++++++++++++++ 2 files changed, 109 insertions(+), 8 deletions(-) create mode 100644 php/EE/RevertableStepProcessor.php diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index d53251588..b89a4c635 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -1,6 +1,7 @@ <?php namespace EE\Migration; +use EE\RevertableStepProcessor; use function EE\Utils\default_launch; /** @@ -13,6 +14,7 @@ public static function start_container_migration() { $sites = \EE_DB::select( [ 'sitename', 'site_path', 'site_type', 'cache_type', 'is_ssl', 'db_host' ] ); $site_docker = new \Site_Docker(); + $rsp = new RevertableStepProcessor(); foreach ( $sites as $site ) { @@ -23,18 +25,34 @@ public static function start_container_migration() { $docker_compose_contents = $site_docker->generate_docker_compose_yml( $data ); $docker_compose_path = $site['site_path'] . '/docker-compose.yml'; + $docker_compose_backup_path = $site['site_path'] . '/docker-compose.yml'; - if ( ! default_launch( "cd ${site['site_path']} && mv docker-compose.yml docker-compose.yml._bak" ) ) { - EE::error( "Unable to find docker-compose.yml in ${site['site_path']} or couldn't create it's backup file. Ensure that EasyEngine has permission to create file there?" ); - } + $rsp->execute_step( + function () use ( $site ) { + if ( ! default_launch( "cd ${site['site_path']} && mv docker-compose.yml docker-compose.yml._bak" ) ) { + throw new \Exception( "Unable to find docker-compose.yml in ${site['site_path']} or couldn't create it's backup file. Ensure that EasyEngine has permission to create file there?" ); + } + }, function () {} + ); - file_put_contents( $docker_compose_path, $docker_compose_contents ); + $rsp->execute_step( + function () use ( $site, $docker_compose_backup_path, $docker_compose_path ) { - $container_upgraded = default_launch( "cd ${site['site_path']} && docker-compose up -d", true, true ); + file_put_contents( $docker_compose_path, $docker_compose_contents ); + $container_upgraded = default_launch( "cd ${site['site_path']} && docker-compose up -d", true, true ); - if ( ! $container_upgraded ) { - EE::error( "Unable to upgrade containers of ${site['sitename']} site. Please check logs for more details." ); - } + if ( ! $container_upgraded ) { + throw new \Exception( "Unable to upgrade containers of ${site['sitename']} site. Please check logs for more details." ); + } + }, function () use ( $docker_compose_backup_path, $docker_compose_path ) { + rename( $docker_compose_backup_path, $docker_compose_path ); + $container_downgraded = default_launch( "cd ${site['site_path']} && docker-compose up -d", true, true ); + + if ( ! $container_downgraded ) { + throw new \Exception( "Unable to downgrade containers of ${site['sitename']} site. Please check logs for more details." ); + } + } + ); } } diff --git a/php/EE/RevertableStepProcessor.php b/php/EE/RevertableStepProcessor.php new file mode 100644 index 000000000..73bfd8b8e --- /dev/null +++ b/php/EE/RevertableStepProcessor.php @@ -0,0 +1,83 @@ +<?php + +namespace EE; + +/** + * RevertibleStepProcessor + * + * This class is used to ensure that a series of steps have been executed successfully. + * If any one step fails while executing, All executed steps will be reverted. + */ +class RevertableStepProcessor { + + /** @var array Contains array of steps */ + private $steps = []; + + /** @var int Keeps track of steps executed. All items in $steps till this index have been executed */ + private $execution_index = 0; + + /** + * Adds a new step. + * + * @param callable $up_step Callable that will be called when step is to be executed + * @param callable $down_step Callable that will be called when step is to be reverted + * @param string $context Context of step. It will be used to display error. + */ + public function add_step( callable $up_step, callable $down_step, string $context = null ) { + $this->steps[] = [ + 'up' => $up_step, + 'down' => $down_step, + 'context' => $context, + ]; + + return $this; // Returns this to enable method chaining + } + + /** + * Adds new step and executes pending steps. + * + * @param callable $up_step Callable that will be called when step is to be executed + * @param callable $down_step Callable that will be called when step is to be reverted + * @param string $context Context of step. It will be used to display error. + */ + public function execute_step( callable $up_step, callable $down_step, string $context = null ) { + $this->add_step( $up_step, $down_step, $context ); + return $this->execute(); + } + + /** + * Executes all pending steps. Reverts the steps if any one step throws error. + */ + public function execute() { + for ( $i = $this->execution_index ; $i < count( $this->steps ); $i++ ) { + try { + call_user_func( $this->steps[ $i ]['up'] ); + $this->execution_index++; + } catch ( \Exception $e ) { + $this->steps[ $i ]['up']; + $context = $this->steps[ $i ]['context']; + $exception_message = $e->getMessage(); + + echo "Encountered error while processing \"$context\". Exception: $exception_message\n"; + + $this->rollback(); + return false; + } + } + return true; + } + + /** + * Rolls back all executed steps. + */ + public function rollback() { + while ( $this->execution_index >= 0 ) { + try { + call_user_func( $this->steps[ $this->execution_index ]['down'] ); + $this->execution_index--; + } catch ( \Exception $e ) { + echo 'Encountered error while reverting step. If possible, do it manually' ; + } + } + } +} From da923290b476962a617578bb59424186f4cdfeb6 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Wed, 25 Jul 2018 21:14:40 +0530 Subject: [PATCH 0254/1044] Add RevertableStepProcessor. Finish container migration Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- VERSION | 2 +- php/EE/Migration/Containers.php | 71 ++++++++++++++++++++++++++++++-- php/commands/src/CLI_Command.php | 1 + 3 files changed, 70 insertions(+), 4 deletions(-) diff --git a/VERSION b/VERSION index 42caa876d..6c29537e5 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.0.0-beta.4 +v4.0.0-beta.4-nightly \ No newline at end of file diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index b89a4c635..8b4729034 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -3,18 +3,79 @@ namespace EE\Migration; use EE\RevertableStepProcessor; use function EE\Utils\default_launch; +use EE; /** * Migrates existing containers to new image */ class Containers { + /** @var RevertableStepProcessor */ + private static $rsp; + public static function start_container_migration() { self::pull_new_images(); + self::migrate_site_containers(); + self::migrate_global_containers(); + } + + private static function migrate_global_containers() { + + // Upgrade nginx-proxy container + $existing_nginx_proxy_image = EE::launch( 'docker inspect --format=\'{{.Config.Image}} ee-nginx-proxy', false, true ); + if ( $existing_nginx_proxy_image->return_code === 0 ) { + self::$rsp->execute_step( + function () { + $EE_CONF_ROOT = EE_CONF_ROOT; + $nginx_proxy_image = 'easyengine/nginx-proxy:v' . EE_VERSION ; + $ee_proxy_command = "docker run --name ee-nginx-proxy -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v $EE_CONF_ROOT/nginx/certs:/etc/nginx/certs -v $EE_CONF_ROOT/nginx/dhparam:/etc/nginx/dhparam -v $EE_CONF_ROOT/nginx/conf.d:/etc/nginx/conf.d -v $EE_CONF_ROOT/nginx/htpasswd:/etc/nginx/htpasswd -v $EE_CONF_ROOT/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v $EE_CONF_ROOT:/app/ee4 -v /usr/share/nginx/html $nginx_proxy_image" ; + + if ( ! default_launch( $ee_proxy_command, true, true ) ) { + throw new \Exception( ' Unable to upgrade ee-nginx-proxy container' ); + } + }, + function () { + $EE_CONF_ROOT = EE_CONF_ROOT; + $nginx_proxy_image = trim( $existing_nginx_proxy_image->stout ); + $ee_proxy_command = "docker run --name ee-nginx-proxy -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v $EE_CONF_ROOT/nginx/certs:/etc/nginx/certs -v $EE_CONF_ROOT/nginx/dhparam:/etc/nginx/dhparam -v $EE_CONF_ROOT/nginx/conf.d:/etc/nginx/conf.d -v $EE_CONF_ROOT/nginx/htpasswd:/etc/nginx/htpasswd -v $EE_CONF_ROOT/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v $EE_CONF_ROOT:/app/ee4 -v /usr/share/nginx/html $nginx_proxy_image" ; + + if ( ! default_launch( $ee_proxy_command, true, true ) ) { + throw new \Exception( ' Unable to restore ee-nginx-proxy container' ); + } + } + ); + } + + // Upgrade cron container + $existing_cron_image = EE::launch( 'docker inspect --format=\'{{.Config.Image}} ee-cron-scheduler', false, true ); + if ( $existing_cron_image->return_code === 0 ) { + self::$rsp->execute_step( + function () { + $cron_image = 'easyengine/cron:v' . EE_VERSION; + $cron_scheduler_run_command = 'docker run --name ee-cron-scheduler --restart=always -d -v ' . EE_CONF_ROOT . '/cron:/etc/ofelia:ro -v /var/run/docker.sock:/var/run/docker.sock:ro ' . $cron_image ; + + if ( ! default_launch( $cron_scheduler_run_command, true, true ) ) { + throw new \Exception( ' Unable to upgrade ee-cron-scheduler container' ); + } + }, + function () { + $cron_image = trim( $existing_cron_image->stdout ); + $cron_scheduler_run_command = 'docker run --name ee-cron-scheduler --restart=always -d -v ' . EE_CONF_ROOT . '/cron:/etc/ofelia:ro -v /var/run/docker.sock:/var/run/docker.sock:ro ' . $cron_image ; + + if ( ! default_launch( $cron_scheduler_run_command, true, true ) ) { + throw new \Exception( ' Unable to restore ee-cron-scheduler container' ); + } + } + ); + } + } + /** + * Migrates all containers of existing sites + */ + private static function migrate_site_containers() { $sites = \EE_DB::select( [ 'sitename', 'site_path', 'site_type', 'cache_type', 'is_ssl', 'db_host' ] ); $site_docker = new \Site_Docker(); - $rsp = new RevertableStepProcessor(); foreach ( $sites as $site ) { @@ -27,7 +88,7 @@ public static function start_container_migration() { $docker_compose_path = $site['site_path'] . '/docker-compose.yml'; $docker_compose_backup_path = $site['site_path'] . '/docker-compose.yml'; - $rsp->execute_step( + self::$rsp->execute_step( function () use ( $site ) { if ( ! default_launch( "cd ${site['site_path']} && mv docker-compose.yml docker-compose.yml._bak" ) ) { throw new \Exception( "Unable to find docker-compose.yml in ${site['site_path']} or couldn't create it's backup file. Ensure that EasyEngine has permission to create file there?" ); @@ -35,7 +96,7 @@ function () use ( $site ) { }, function () {} ); - $rsp->execute_step( + self::$rsp->execute_step( function () use ( $site, $docker_compose_backup_path, $docker_compose_path ) { file_put_contents( $docker_compose_path, $docker_compose_contents ); @@ -56,6 +117,9 @@ function () use ( $site, $docker_compose_backup_path, $docker_compose_path ) { } } + /** + * Pulls new images of all containers used by easyengine + */ private static function pull_new_images() { self::pull_or_error( 'easyengine/php', 'v' . EE_VERSION ); self::pull_or_error( 'easyengine/cron', 'v' . EE_VERSION ); @@ -64,6 +128,7 @@ private static function pull_new_images() { self::pull_or_error( 'easyengine/mailhog', 'v' . EE_VERSION ); self::pull_or_error( 'easyengine/mariadb', 'v' . EE_VERSION ); self::pull_or_error( 'easyengine/phpmyadmin', 'v' . EE_VERSION ); + self::pull_or_error( 'easyengine/nginx-proxy', 'v' . EE_VERSION ); } private static function pull_or_error( $image, $version ) { diff --git a/php/commands/src/CLI_Command.php b/php/commands/src/CLI_Command.php index 238a7038f..3ddda7eba 100644 --- a/php/commands/src/CLI_Command.php +++ b/php/commands/src/CLI_Command.php @@ -163,6 +163,7 @@ public function info( $_, $assoc_args ) { * Function to run migrations required to upgrade to the newer version. Will always be invoked from the newer phar downloaded inside the /tmp folder */ private function migrate() { + EE\Migration\Containers::start_container_migration(); EE\Migration\Executor::execute_migrations(); } From 2f1b4f73649ac2cea9dd2e3d4b1c79b3dfcb37cc Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Thu, 26 Jul 2018 16:58:23 +0530 Subject: [PATCH 0255/1044] Fix container migration. Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/EE/Migration/Containers.php | 47 ++++++++++++++++++------------ php/EE/RevertableStepProcessor.php | 18 +++++++----- 2 files changed, 40 insertions(+), 25 deletions(-) diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index 8b4729034..54731115f 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -14,6 +14,7 @@ class Containers { private static $rsp; public static function start_container_migration() { + self::$rsp = new RevertableStepProcessor(); self::pull_new_images(); self::migrate_site_containers(); self::migrate_global_containers(); @@ -22,7 +23,7 @@ public static function start_container_migration() { private static function migrate_global_containers() { // Upgrade nginx-proxy container - $existing_nginx_proxy_image = EE::launch( 'docker inspect --format=\'{{.Config.Image}} ee-nginx-proxy', false, true ); + $existing_nginx_proxy_image = EE::launch( 'docker inspect --format=\'{{.Config.Image}}\' ee-nginx-proxy', false, true ); if ( $existing_nginx_proxy_image->return_code === 0 ) { self::$rsp->execute_step( function () { @@ -30,16 +31,20 @@ function () { $nginx_proxy_image = 'easyengine/nginx-proxy:v' . EE_VERSION ; $ee_proxy_command = "docker run --name ee-nginx-proxy -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v $EE_CONF_ROOT/nginx/certs:/etc/nginx/certs -v $EE_CONF_ROOT/nginx/dhparam:/etc/nginx/dhparam -v $EE_CONF_ROOT/nginx/conf.d:/etc/nginx/conf.d -v $EE_CONF_ROOT/nginx/htpasswd:/etc/nginx/htpasswd -v $EE_CONF_ROOT/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v $EE_CONF_ROOT:/app/ee4 -v /usr/share/nginx/html $nginx_proxy_image" ; - if ( ! default_launch( $ee_proxy_command, true, true ) ) { + default_launch( 'docker rm -f ee-nginx-proxy', false, true ); + + if ( ! default_launch( $ee_proxy_command, false, true ) ) { throw new \Exception( ' Unable to upgrade ee-nginx-proxy container' ); } }, - function () { + function () use ( $existing_nginx_proxy_image ) { $EE_CONF_ROOT = EE_CONF_ROOT; $nginx_proxy_image = trim( $existing_nginx_proxy_image->stout ); $ee_proxy_command = "docker run --name ee-nginx-proxy -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v $EE_CONF_ROOT/nginx/certs:/etc/nginx/certs -v $EE_CONF_ROOT/nginx/dhparam:/etc/nginx/dhparam -v $EE_CONF_ROOT/nginx/conf.d:/etc/nginx/conf.d -v $EE_CONF_ROOT/nginx/htpasswd:/etc/nginx/htpasswd -v $EE_CONF_ROOT/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v $EE_CONF_ROOT:/app/ee4 -v /usr/share/nginx/html $nginx_proxy_image" ; - if ( ! default_launch( $ee_proxy_command, true, true ) ) { + default_launch( 'docker rm -f ee-nginx-proxy', false, true ); + + if ( ! default_launch( $ee_proxy_command, false, true ) ) { throw new \Exception( ' Unable to restore ee-nginx-proxy container' ); } } @@ -47,22 +52,26 @@ function () { } // Upgrade cron container - $existing_cron_image = EE::launch( 'docker inspect --format=\'{{.Config.Image}} ee-cron-scheduler', false, true ); + $existing_cron_image = EE::launch( 'docker inspect --format=\'{{.Config.Image}}\' ee-cron-scheduler', false, true ); if ( $existing_cron_image->return_code === 0 ) { self::$rsp->execute_step( function () { $cron_image = 'easyengine/cron:v' . EE_VERSION; $cron_scheduler_run_command = 'docker run --name ee-cron-scheduler --restart=always -d -v ' . EE_CONF_ROOT . '/cron:/etc/ofelia:ro -v /var/run/docker.sock:/var/run/docker.sock:ro ' . $cron_image ; - if ( ! default_launch( $cron_scheduler_run_command, true, true ) ) { + default_launch( 'docker rm -f ee-cron-scheduler', false, true ); + + if ( ! default_launch( $cron_scheduler_run_command, false, true ) ) { throw new \Exception( ' Unable to upgrade ee-cron-scheduler container' ); } }, - function () { + function () use ( $existing_cron_image ) { $cron_image = trim( $existing_cron_image->stdout ); $cron_scheduler_run_command = 'docker run --name ee-cron-scheduler --restart=always -d -v ' . EE_CONF_ROOT . '/cron:/etc/ofelia:ro -v /var/run/docker.sock:/var/run/docker.sock:ro ' . $cron_image ; - if ( ! default_launch( $cron_scheduler_run_command, true, true ) ) { + default_launch( 'docker rm -f ee-cron-scheduler', false, true ); + + if ( ! default_launch( $cron_scheduler_run_command, false, true ) ) { throw new \Exception( ' Unable to restore ee-cron-scheduler container' ); } } @@ -86,28 +95,30 @@ private static function migrate_site_containers() { $docker_compose_contents = $site_docker->generate_docker_compose_yml( $data ); $docker_compose_path = $site['site_path'] . '/docker-compose.yml'; - $docker_compose_backup_path = $site['site_path'] . '/docker-compose.yml'; + $docker_compose_backup_path = $site['site_path'] . '/docker-compose.yml.bak'; self::$rsp->execute_step( - function () use ( $site ) { - if ( ! default_launch( "cd ${site['site_path']} && mv docker-compose.yml docker-compose.yml._bak" ) ) { - throw new \Exception( "Unable to find docker-compose.yml in ${site['site_path']} or couldn't create it's backup file. Ensure that EasyEngine has permission to create file there?" ); + function () use ( $site, $docker_compose_path, $docker_compose_backup_path ) { + if ( ! default_launch( "cp $docker_compose_path $docker_compose_backup_path" ) ) { + throw new \Exception( "Unable to find docker-compose.yml in ${site['site_path']} or couldn't create it's backup file. Ensure that EasyEngine has permission to create file there" ); } }, function () {} ); self::$rsp->execute_step( - function () use ( $site, $docker_compose_backup_path, $docker_compose_path ) { + function () use ( $site, $docker_compose_backup_path, $docker_compose_path, $docker_compose_contents ) { file_put_contents( $docker_compose_path, $docker_compose_contents ); - $container_upgraded = default_launch( "cd ${site['site_path']} && docker-compose up -d", true, true ); + $container_upgraded = default_launch( "cd ${site['site_path']} && docker-compose up -d" ); if ( ! $container_upgraded ) { - throw new \Exception( "Unable to upgrade containers of ${site['sitename']} site. Please check logs for more details." ); + throw new \Exception( "Unable to upgrade containers of site: ${site['sitename']}. Please check logs for more details." ); } - }, function () use ( $docker_compose_backup_path, $docker_compose_path ) { + + unlink( $docker_compose_backup_path ); + }, function () use ( $site, $docker_compose_backup_path, $docker_compose_path ) { rename( $docker_compose_backup_path, $docker_compose_path ); - $container_downgraded = default_launch( "cd ${site['site_path']} && docker-compose up -d", true, true ); + $container_downgraded = default_launch( "cd ${site['site_path']} && docker-compose up -d" ); if ( ! $container_downgraded ) { throw new \Exception( "Unable to downgrade containers of ${site['sitename']} site. Please check logs for more details." ); @@ -132,7 +143,7 @@ private static function pull_new_images() { } private static function pull_or_error( $image, $version ) { - if ( ! default_launch( "docker pull $image:$version" , true, true ) ) { + if ( ! default_launch( "docker pull $image:$version" ) ) { EE::error( "Unable to pull $image. Please check logs for more details." ); } } diff --git a/php/EE/RevertableStepProcessor.php b/php/EE/RevertableStepProcessor.php index 73bfd8b8e..85763c1fb 100644 --- a/php/EE/RevertableStepProcessor.php +++ b/php/EE/RevertableStepProcessor.php @@ -50,16 +50,15 @@ public function execute_step( callable $up_step, callable $down_step, string $co */ public function execute() { for ( $i = $this->execution_index ; $i < count( $this->steps ); $i++ ) { + $context = $this->steps[ $i ]['context']; try { + echo "Executing $context... "; call_user_func( $this->steps[ $i ]['up'] ); $this->execution_index++; + echo "done.\n"; } catch ( \Exception $e ) { - $this->steps[ $i ]['up']; - $context = $this->steps[ $i ]['context']; $exception_message = $e->getMessage(); - - echo "Encountered error while processing \"$context\". Exception: $exception_message\n"; - + echo "\nEncountered error while processing $context. Exception: $exception_message\n"; $this->rollback(); return false; } @@ -71,12 +70,17 @@ public function execute() { * Rolls back all executed steps. */ public function rollback() { + $context = $this->steps[ $this->execution_index ]['context']; while ( $this->execution_index >= 0 ) { try { + echo "Reverting $context... "; call_user_func( $this->steps[ $this->execution_index ]['down'] ); - $this->execution_index--; + echo "done.\n"; } catch ( \Exception $e ) { - echo 'Encountered error while reverting step. If possible, do it manually' ; + $exception_message = $e->getMessage(); + echo "\nEncountered error while reverting $context: $exception_message. If possible, do it manually\n" ; + } finally { + $this->execution_index--; } } } From bc7e5f9e20556848540204a13f7308aa2916a913 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Fri, 27 Jul 2018 19:55:16 +0530 Subject: [PATCH 0256/1044] Revert VERSION file --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 6c29537e5..42caa876d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v4.0.0-beta.4-nightly \ No newline at end of file +4.0.0-beta.4 From a26f2f20a2509a1e8f1ea4d60183c2404c2ae5c4 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Fri, 20 Jul 2018 19:51:53 +0530 Subject: [PATCH 0257/1044] Update required PHP version to 7.0 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 612dfcf11..40560a6ae 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=5.3.29", + "php": ">=7.0", "composer/composer": "^1.2.0", "composer/semver": "~1.0", "easyengine/cron-command": "v1.0.0-beta.1", From 0f56965bb98ae409d89e5b28d24068d326f949c6 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Fri, 20 Jul 2018 19:53:06 +0530 Subject: [PATCH 0258/1044] Remove array_coloumn package need for PHP version < 5.5 --- composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/composer.json b/composer.json index 40560a6ae..86d214c5e 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,6 @@ "justinrainbow/json-schema": "~5.2.5", "monolog/monolog": "^1.23", "mustache/mustache": "~2.4", - "ramsey/array_column": "~1.1", "rmccue/requests": "~1.6", "symfony/config": "^2.7|^3.0", "symfony/console": "^2.7|^3.0", From b2b15df34be23cbd71830cb89fa37487391f0c4b Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 30 Jul 2018 10:50:18 +0530 Subject: [PATCH 0259/1044] Update php version check at start Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/boot-fs.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/php/boot-fs.php b/php/boot-fs.php index 2a8cf0d7e..9f7413c7c 100644 --- a/php/boot-fs.php +++ b/php/boot-fs.php @@ -1,14 +1,14 @@ <?php -// This file needs to parse without error in PHP < 5.3 +// This file needs to parse without error in PHP < 7.0 if ( 'cli' !== PHP_SAPI ) { echo "Only CLI access.\n"; die( -1 ); } -if ( version_compare( PHP_VERSION, '5.3.0', '<' ) ) { - printf( "Error: EE requires PHP %s or newer. You are running version %s.\n", '5.3.0', PHP_VERSION ); +if ( version_compare( PHP_VERSION, '7.0', '<' ) ) { + printf( "Error: EE requires PHP %s or newer. You are running version %s.\n", '7.0', PHP_VERSION ); die( -1 ); } From 4abb5d7b8e3a06c37fc8ceeff081fd5348f99d05 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 30 Jul 2018 10:51:03 +0530 Subject: [PATCH 0260/1044] Update buffer start Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Loggers/Execution.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/php/EE/Loggers/Execution.php b/php/EE/Loggers/Execution.php index 6a46e3248..2ee7aa0cc 100644 --- a/php/EE/Loggers/Execution.php +++ b/php/EE/Loggers/Execution.php @@ -57,8 +57,7 @@ protected function write( $handle, $str ) { * Starts output buffering, using a callback to capture output from `echo`, `print`, `printf` (which write to the output buffer 'php://output' rather than STDOUT). */ public function ob_start() { - // To ensure sequential output, give a chunk size of 1 (or 2 if PHP < 5.4 as 1 was a special value meaning a 4KB chunk) to `ob_start()`, so that each write gets flushed immediately. - ob_start( array( $this, 'ob_start_callback' ), version_compare( PHP_VERSION, '5.4.0', '<' ) ? 2 : 1 ); + ob_start( array( $this, 'ob_start_callback' ), 1 ); } /** From 73d064b32b69ab35f2f39891c87a5eebd56e3f5f Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 30 Jul 2018 10:51:57 +0530 Subject: [PATCH 0261/1044] Update to minimum required version in travis Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index fe80b8aac..85f688b3a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ sudo: required language: php -php: 7.1 +php: 7.0 env: global: From 996616edf2faf99c963f3c2210958b2682d83727 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 30 Jul 2018 11:20:01 +0530 Subject: [PATCH 0262/1044] Update lock file to reflect composer changes Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- composer.lock | 139 +++++++++++++++++--------------------------------- 1 file changed, 47 insertions(+), 92 deletions(-) diff --git a/composer.lock b/composer.lock index cf494918e..0d890ecae 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": "b109c4c2b63f6aa91c0a297a81282e74", + "content-hash": "6f237f357e6d5533ab44375b7878885b", "packages": [ { "name": "acmephp/core", @@ -1127,51 +1127,6 @@ ], "time": "2016-10-10T12:19:37+00:00" }, - { - "name": "ramsey/array_column", - "version": "1.1.3", - "source": { - "type": "git", - "url": "https://github.com/ramsey/array_column.git", - "reference": "f8e52eb28e67eb50e613b451dd916abcf783c1db" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ramsey/array_column/zipball/f8e52eb28e67eb50e613b451dd916abcf783c1db", - "reference": "f8e52eb28e67eb50e613b451dd916abcf783c1db", - "shasum": "" - }, - "require-dev": { - "jakub-onderka/php-parallel-lint": "0.8.*", - "phpunit/phpunit": "~4.5", - "satooshi/php-coveralls": "0.6.*", - "squizlabs/php_codesniffer": "~2.2" - }, - "type": "library", - "autoload": { - "files": [ - "src/array_column.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ben Ramsey", - "homepage": "http://benramsey.com" - } - ], - "description": "Provides functionality for array_column() to projects using PHP earlier than version 5.5.", - "homepage": "https://github.com/ramsey/array_column", - "keywords": [ - "array", - "array_column", - "column" - ], - "time": "2015-03-20T22:07:39+00:00" - }, { "name": "rmccue/requests", "version": "v1.7.0", @@ -1364,7 +1319,7 @@ }, { "name": "symfony/config", - "version": "v3.4.12", + "version": "v3.4.13", "source": { "type": "git", "url": "https://github.com/symfony/config.git", @@ -1428,16 +1383,16 @@ }, { "name": "symfony/console", - "version": "v3.4.12", + "version": "v3.4.13", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "1b97071a26d028c9bd4588264e101e14f6e7cd00" + "reference": "e54f84c50e3b12972e7750edfc5ca84b2284c44e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/1b97071a26d028c9bd4588264e101e14f6e7cd00", - "reference": "1b97071a26d028c9bd4588264e101e14f6e7cd00", + "url": "https://api.github.com/repos/symfony/console/zipball/e54f84c50e3b12972e7750edfc5ca84b2284c44e", + "reference": "e54f84c50e3b12972e7750edfc5ca84b2284c44e", "shasum": "" }, "require": { @@ -1493,20 +1448,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-05-23T05:02:55+00:00" + "time": "2018-07-10T14:02:11+00:00" }, { "name": "symfony/debug", - "version": "v3.4.12", + "version": "v3.4.13", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "47e6788c5b151cf0cfdf3329116bf33800632d75" + "reference": "0e3ca9cbde90fffec8038f4d4e16fd4046bbd018" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/47e6788c5b151cf0cfdf3329116bf33800632d75", - "reference": "47e6788c5b151cf0cfdf3329116bf33800632d75", + "url": "https://api.github.com/repos/symfony/debug/zipball/0e3ca9cbde90fffec8038f4d4e16fd4046bbd018", + "reference": "0e3ca9cbde90fffec8038f4d4e16fd4046bbd018", "shasum": "" }, "require": { @@ -1549,20 +1504,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2018-06-25T11:10:40+00:00" + "time": "2018-06-26T08:45:54+00:00" }, { "name": "symfony/dependency-injection", - "version": "v3.4.12", + "version": "v3.4.13", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "a0be80e3f8c11aca506e250c00bb100c04c35d10" + "reference": "3f115cc3aae4d320b26db05e9531f4e32da29b89" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/a0be80e3f8c11aca506e250c00bb100c04c35d10", - "reference": "a0be80e3f8c11aca506e250c00bb100c04c35d10", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/3f115cc3aae4d320b26db05e9531f4e32da29b89", + "reference": "3f115cc3aae4d320b26db05e9531f4e32da29b89", "shasum": "" }, "require": { @@ -1620,11 +1575,11 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2018-06-25T08:36:56+00:00" + "time": "2018-07-16T13:57:19+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v3.4.12", + "version": "v3.4.13", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", @@ -1687,16 +1642,16 @@ }, { "name": "symfony/filesystem", - "version": "v3.4.12", + "version": "v3.4.13", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "8a721a5f2553c6c3482b1c5b22ed60fe94dd63ed" + "reference": "8dab220fec8fc904821485326b29a6c670286124" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/8a721a5f2553c6c3482b1c5b22ed60fe94dd63ed", - "reference": "8a721a5f2553c6c3482b1c5b22ed60fe94dd63ed", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/8dab220fec8fc904821485326b29a6c670286124", + "reference": "8dab220fec8fc904821485326b29a6c670286124", "shasum": "" }, "require": { @@ -1733,11 +1688,11 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2018-06-21T11:10:19+00:00" + "time": "2018-07-09T13:25:43+00:00" }, { "name": "symfony/finder", - "version": "v3.4.12", + "version": "v3.4.13", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", @@ -1900,16 +1855,16 @@ }, { "name": "symfony/process", - "version": "v3.4.12", + "version": "v3.4.13", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "acc5a37c706ace827962851b69705b24e71ca17c" + "reference": "f741672edfcfe3a2ea77569d419006f23281d909" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/acc5a37c706ace827962851b69705b24e71ca17c", - "reference": "acc5a37c706ace827962851b69705b24e71ca17c", + "url": "https://api.github.com/repos/symfony/process/zipball/f741672edfcfe3a2ea77569d419006f23281d909", + "reference": "f741672edfcfe3a2ea77569d419006f23281d909", "shasum": "" }, "require": { @@ -1945,20 +1900,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2018-05-30T04:24:30+00:00" + "time": "2018-07-09T09:01:07+00:00" }, { "name": "symfony/serializer", - "version": "v3.4.12", + "version": "v3.4.13", "source": { "type": "git", "url": "https://github.com/symfony/serializer.git", - "reference": "2e6d57dbbb37691f1480393440aff3a4b69dd9f7" + "reference": "2780569dd1ad2a88fd45fee427391a528f0ed826" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/serializer/zipball/2e6d57dbbb37691f1480393440aff3a4b69dd9f7", - "reference": "2e6d57dbbb37691f1480393440aff3a4b69dd9f7", + "url": "https://api.github.com/repos/symfony/serializer/zipball/2780569dd1ad2a88fd45fee427391a528f0ed826", + "reference": "2780569dd1ad2a88fd45fee427391a528f0ed826", "shasum": "" }, "require": { @@ -2024,20 +1979,20 @@ ], "description": "Symfony Serializer Component", "homepage": "https://symfony.com", - "time": "2018-06-22T08:58:39+00:00" + "time": "2018-07-08T19:14:58+00:00" }, { "name": "symfony/translation", - "version": "v3.4.12", + "version": "v3.4.13", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "7047f725e35eab768137c677f8c38e4a2a8e38fb" + "reference": "0d1c0965c3e82250b9786909cf584fd4a50c9c5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/7047f725e35eab768137c677f8c38e4a2a8e38fb", - "reference": "7047f725e35eab768137c677f8c38e4a2a8e38fb", + "url": "https://api.github.com/repos/symfony/translation/zipball/0d1c0965c3e82250b9786909cf584fd4a50c9c5b", + "reference": "0d1c0965c3e82250b9786909cf584fd4a50c9c5b", "shasum": "" }, "require": { @@ -2092,11 +2047,11 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2018-05-21T10:06:52+00:00" + "time": "2018-07-23T08:18:36+00:00" }, { "name": "symfony/yaml", - "version": "v3.4.12", + "version": "v3.4.13", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", @@ -3172,16 +3127,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.3.0", + "version": "3.3.1", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "d86873af43b4aa9d1f39a3601cc0cfcf02b25266" + "reference": "628a481780561150481a9ec74709092b9759b3ec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/d86873af43b4aa9d1f39a3601cc0cfcf02b25266", - "reference": "d86873af43b4aa9d1f39a3601cc0cfcf02b25266", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/628a481780561150481a9ec74709092b9759b3ec", + "reference": "628a481780561150481a9ec74709092b9759b3ec", "shasum": "" }, "require": { @@ -3219,11 +3174,11 @@ "phpcs", "standards" ], - "time": "2018-06-06T23:58:19+00:00" + "time": "2018-07-26T23:47:18+00:00" }, { "name": "symfony/class-loader", - "version": "v3.4.12", + "version": "v3.4.13", "source": { "type": "git", "url": "https://github.com/symfony/class-loader.git", @@ -3379,7 +3334,7 @@ "prefer-stable": true, "prefer-lowest": false, "platform": { - "php": ">=5.3.29" + "php": ">=7.0" }, "platform-dev": [], "platform-overrides": { From 8f570af5165eda07b5653c7aa560784d1bb28886 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 30 Jul 2018 11:24:55 +0530 Subject: [PATCH 0263/1044] Remove inclusion of array_coloumn package from phar Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- utils/make-phar.php | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/make-phar.php b/utils/make-phar.php index f40f7c7d1..bc6ed7c94 100644 --- a/utils/make-phar.php +++ b/utils/make-phar.php @@ -164,7 +164,6 @@ function get_composer_versions( $current_version ) { ->in(EE_VENDOR_DIR . '/mustache') ->in(EE_VENDOR_DIR . '/rmccue/requests') ->in(EE_VENDOR_DIR . '/composer') - ->in(EE_VENDOR_DIR . '/ramsey/array_column') ->in(EE_VENDOR_DIR . '/symfony/finder') ->in(EE_VENDOR_DIR . '/symfony/polyfill-mbstring') ->in(EE_VENDOR_DIR . '/symfony/polyfill-ctype') From 4149e828a4d115bce9435da381fef791e29ec933 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 30 Jul 2018 11:37:36 +0530 Subject: [PATCH 0264/1044] Update debugging for default_launch Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/utils.php | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/php/utils.php b/php/utils.php index f490ac8dd..70822520f 100644 --- a/php/utils.php +++ b/php/utils.php @@ -1412,11 +1412,14 @@ function delem_log( $log_data ) { /** * Format and print debug messages for EE::launch * - * @param Object $launch EE::Launch command object + * @param Object $launch EE::Launch command object. + * @param bool $skip_command Skip logging command. */ -function default_debug( $launch ) { - EE::debug( '-----------------------' ); - EE::debug( "COMMAND: $launch->command" ); +function default_debug( $launch, $skip_command = false ) { + if ( ! $skip_command ) { + EE::debug( '-----------------------' ); + EE::debug( "COMMAND: $launch->command" ); + } if ( ! empty( $launch->stdout ) ) { EE::debug( "STDOUT: $launch->stdout" ); } @@ -1431,25 +1434,32 @@ function default_debug( $launch ) { * Default Launch command. * This takes care of executing the command as well as debugging it to terminal as well as file. * - * @param string $command The command to be executed via EE::launch(); - * @param array $env Environment variables to set when running the command. - * @param string $cwd Directory to execute the command in. + * @param string $command The command to be executed via EE::launch(); + * @param bool $echo_stdout Print stdout to terminal. Default false. + * @param bool $echo_stderr Print stderr to terminal. Default false. + * @param array $env Environment variables to set when running the command. + * @param string $cwd Directory to execute the command in. * * @return bool True if executed successfully. False if failed. */ function default_launch( $command, $echo_stdout = false, $echo_stderr = false, $env = null, $cwd = null ) { + + EE::debug( '-----------------------' ); + EE::debug( "COMMAND: $command" ); + $launch = EE::launch( $command, false, true, $env, $cwd ); - default_debug( $launch ); + default_debug( $launch, true ); - if( $echo_stdout ) { + if ( $echo_stdout ) { echo $launch->stdout; } - if( $echo_stderr ) { + if ( $echo_stderr ) { echo $launch->stderr; } if ( ! $launch->return_code ) { return true; } + return false; } From b42e782c14379edbd2585d21b93e0a384c145b30 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 30 Jul 2018 11:40:05 +0530 Subject: [PATCH 0265/1044] Switch to default_launch for updated debugging Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/class-ee-docker.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php index 1bc610cf4..a21a9d53b 100644 --- a/php/class-ee-docker.php +++ b/php/class-ee-docker.php @@ -35,7 +35,7 @@ public static function container_status( $container ) { if ( $ret ) { EE::error( 'Docker is not installed. Please install Docker to run EasyEngine.' ); } - $status = EE::launch( "docker inspect -f '{{.State.Running}}' $container", false, true ); + $status = default_launch( "docker inspect -f '{{.State.Running}}' $container" ); default_debug( $status ); if ( ! $status->return_code ) { if ( preg_match( '/true/', $status->stdout ) ) { @@ -91,7 +91,7 @@ public static function restart_container( $container ) { */ public static function create_container( $container, $command ) { - $launch = EE::launch( $command, false, true ); + $launch = default_launch( $command ); default_debug( $launch ); if ( ! $launch->return_code ) { return true; From 727f2a99511b39b451fe0fc518a46bb812f3664b Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 30 Jul 2018 18:13:04 +0530 Subject: [PATCH 0266/1044] Add public static function to execute commands and debug Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/class-ee.php | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/php/class-ee.php b/php/class-ee.php index 8884976ed..a3aac0774 100644 --- a/php/class-ee.php +++ b/php/class-ee.php @@ -851,6 +851,47 @@ public static function launch( $command, $exit_on_error = true, $return_detailed return $results->return_code; } + /** + * Launch an arbitrary external process that takes over I/O. + * + * @access public + * @category Execution + * + * @param string $command External process to launch. + * @param bool $echo_stdout Print stdout to terminal. Default false. + * @param bool $echo_stderr Print stderr to terminal. Default false. + * + * @return bool True if executed successfully. False if failed. + */ + public static function exec( $command, $echo_stdout = false, $echo_stderr = false ) { + Utils\check_proc_available( 'exec' ); + + $proc = Process::create( $command, null, null ); + $results = $proc->run(); + + if ( - 1 == $results->return_code ) { + self::warning( "Spawned process returned exit code {$results->return_code}, which could be caused by a custom compiled version of PHP that uses the --enable-sigchild option." ); + } + + EE::debug( '-----------------------' ); + EE::debug( "COMMAND: $command" ); + + EE\Utils\default_debug( $results, true ); + + if ( $echo_stdout ) { + echo $results->stdout; + } + if ( $echo_stderr ) { + echo $results->stderr; + } + if ( ! $results->return_code ) { + return true; + } + + return false; + + } + /** * Run a EE command in a new process reusing the current runtime arguments. * From cd8b2735bba157377a044b4d391265ebda8ed59d Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 30 Jul 2018 18:28:14 +0530 Subject: [PATCH 0267/1044] Add exit on error option Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/class-ee.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/php/class-ee.php b/php/class-ee.php index a3aac0774..4d6f1db5a 100644 --- a/php/class-ee.php +++ b/php/class-ee.php @@ -857,13 +857,14 @@ public static function launch( $command, $exit_on_error = true, $return_detailed * @access public * @category Execution * - * @param string $command External process to launch. - * @param bool $echo_stdout Print stdout to terminal. Default false. - * @param bool $echo_stderr Print stderr to terminal. Default false. + * @param string $command External process to launch. + * @param bool $echo_stdout Print stdout to terminal. Default false. + * @param bool $echo_stderr Print stderr to terminal. Default false. + * @param boolean $exit_on_error Exit if the command returns an elevated return code with stderr. * * @return bool True if executed successfully. False if failed. */ - public static function exec( $command, $echo_stdout = false, $echo_stderr = false ) { + public static function exec( $command, $echo_stdout = false, $echo_stderr = false, $exit_on_error = false ) { Utils\check_proc_available( 'exec' ); $proc = Process::create( $command, null, null ); @@ -881,13 +882,15 @@ public static function exec( $command, $echo_stdout = false, $echo_stderr = fals if ( $echo_stdout ) { echo $results->stdout; } - if ( $echo_stderr ) { + if ( $echo_stderr && ! $exit_on_error ) { echo $results->stderr; } if ( ! $results->return_code ) { return true; } - + if( $exit_on_error ) { + EE::error( $results->stderr ); + } return false; } From 3d5824daed8a62eafb26a12d29b8439a492051dc Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 30 Jul 2018 18:32:02 +0530 Subject: [PATCH 0268/1044] Update to new exec function Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/class-ee-docker.php | 36 ++++++++++++++---------------------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php index a21a9d53b..76de6daa0 100644 --- a/php/class-ee-docker.php +++ b/php/class-ee-docker.php @@ -1,8 +1,6 @@ <?php use function \EE\Utils\default_debug; -use function \EE\Utils\default_launch; -use function \EE\Utils\mustache_render; class EE_DOCKER { @@ -23,7 +21,7 @@ public static function boot_container( $container, $command = '' ) { return true; } } else { - return self::create_container( $container, $command ); + return self::create_container( $command ); } } @@ -35,7 +33,7 @@ public static function container_status( $container ) { if ( $ret ) { EE::error( 'Docker is not installed. Please install Docker to run EasyEngine.' ); } - $status = default_launch( "docker inspect -f '{{.State.Running}}' $container" ); + $status = EE::launch( "docker inspect -f '{{.State.Running}}' $container" ); default_debug( $status ); if ( ! $status->return_code ) { if ( preg_match( '/true/', $status->stdout ) ) { @@ -56,7 +54,7 @@ public static function container_status( $container ) { * @return bool success. */ public static function start_container( $container ) { - return default_launch( "docker start $container" ); + return EE::exec( "docker start $container" ); } /** @@ -67,7 +65,7 @@ public static function start_container( $container ) { * @return bool success. */ public static function stop_container( $container ) { - return default_launch( "docker stop $container" ); + return EE::exec( "docker stop $container" ); } /** @@ -78,25 +76,19 @@ public static function stop_container( $container ) { * @return bool success. */ public static function restart_container( $container ) { - return default_launch( "docker restart $container" ); + return EE::exec( "docker restart $container" ); } /** * Function to create and start the container if it does not exist. * - * @param String $container Container to be created. * @param String $command Command to launch the container. * * @return bool success. */ - public static function create_container( $container, $command ) { + public static function create_container( $command ) { - $launch = default_launch( $command ); - default_debug( $launch ); - if ( ! $launch->return_code ) { - return true; - } - EE::error( $launch->stderr ); + return EE::exec( $command, true, true, true ); } /** @@ -107,7 +99,7 @@ public static function create_container( $container, $command ) { * @return bool success. */ public static function create_network( $name ) { - return default_launch( "docker network create $name" ); + return EE::exec( "docker network create $name" ); } /** @@ -119,7 +111,7 @@ public static function create_network( $name ) { * @return bool success. */ public static function connect_network( $name, $connect_to ) { - return default_launch( "docker network connect $name $connect_to" ); + return EE::exec( "docker network connect $name $connect_to" ); } /** @@ -130,7 +122,7 @@ public static function connect_network( $name, $connect_to ) { * @return bool success. */ public static function rm_network( $name ) { - return default_launch( "docker network rm $name" ); + return EE::exec( "docker network rm $name" ); } /** @@ -142,7 +134,7 @@ public static function rm_network( $name ) { * @return bool success. */ public static function disconnect_network( $name, $connected_to ) { - return default_launch( "docker network disconnect $name $connected_to" ); + return EE::exec( "docker network disconnect $name $connected_to" ); } @@ -183,11 +175,11 @@ public static function docker_compose_up( $dir, $services = [] ) { $chdir_return_code = chdir( $dir ); if ( $chdir_return_code ) { if ( empty( $services ) ) { - return default_launch( 'docker-compose up -d' ); + return EE::exec( 'docker-compose up -d' ); } else { $all_services = implode( ' ', $services ); - return default_launch( "docker-compose up -d $all_services" ); + return EE::exec( "docker-compose up -d $all_services" ); } } @@ -205,7 +197,7 @@ public static function docker_compose_down( $dir ) { $chdir_return_code = chdir( $dir ); if ( $chdir_return_code ) { - return default_launch( 'docker-compose down' ); + return EE::exec( 'docker-compose down' ); } return false; From e50699841c9f4da2119f263c925bf86afd0e2b4e Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 30 Jul 2018 18:59:50 +0530 Subject: [PATCH 0269/1044] Update compatibility version check Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- phpcs.xml.dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 5407e84f8..34d604597 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -26,7 +26,7 @@ <exclude name="PHPCompatibility.PHP.DeprecatedIniDirectives.magic_quotes_runtimeDeprecatedRemoved"/> <exclude name="PHPCompatibility.PHP.DeprecatedIniDirectives.magic_quotes_sybaseDeprecatedRemoved"/> </rule> - <config name="testVersion" value="5.3-"/> + <config name="testVersion" value="7.0-"/> <rule ref="WordPress-Core"> <exclude name="Squiz.PHP.DisallowMultipleAssignments.Found" /> From c78894c11f089c4960b64346f1fef649d767c1e4 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 31 Jul 2018 11:48:52 +0530 Subject: [PATCH 0270/1044] Move debugging completely to core from utilis Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/class-ee.php | 46 ++++++++++++++++++++++++++++++----------- php/utils.php | 54 ------------------------------------------------ 2 files changed, 34 insertions(+), 66 deletions(-) diff --git a/php/class-ee.php b/php/class-ee.php index 4d6f1db5a..968cf7ff9 100644 --- a/php/class-ee.php +++ b/php/class-ee.php @@ -830,12 +830,17 @@ public static function error_to_string( $errors ) { * * @return int|ProcessRun The command exit status, or a ProcessRun object for full details. */ - public static function launch( $command, $exit_on_error = true, $return_detailed = false, $env = null, $cwd = null ) { + public static function launch( $command, $exit_on_error = false, $return_detailed = true, $env = null, $cwd = null ) { Utils\check_proc_available( 'launch' ); + self::debug( '-----------------------' ); + self::debug( "COMMAND: $command" ); + $proc = Process::create( $command, $cwd, $env ); $results = $proc->run(); + self::debug_run_command( $results ); + if ( -1 == $results->return_code ) { self::warning( "Spawned process returned exit code {$results->return_code}, which could be caused by a custom compiled version of PHP that uses the --enable-sigchild option." ); } @@ -857,28 +862,28 @@ public static function launch( $command, $exit_on_error = true, $return_detailed * @access public * @category Execution * - * @param string $command External process to launch. - * @param bool $echo_stdout Print stdout to terminal. Default false. - * @param bool $echo_stderr Print stderr to terminal. Default false. - * @param boolean $exit_on_error Exit if the command returns an elevated return code with stderr. + * @param string $command External process to launch. + * @param bool $echo_stdout Print stdout to terminal. Default false. + * @param bool $echo_stderr Print stderr to terminal. Default false. + * @param boolean $exit_on_error Exit if the command returns an elevated return code with stderr. * * @return bool True if executed successfully. False if failed. */ public static function exec( $command, $echo_stdout = false, $echo_stderr = false, $exit_on_error = false ) { Utils\check_proc_available( 'exec' ); + self::debug( '-----------------------' ); + self::debug( "COMMAND: $command" ); + $proc = Process::create( $command, null, null ); $results = $proc->run(); + self::debug_run_command( $results ); + if ( - 1 == $results->return_code ) { self::warning( "Spawned process returned exit code {$results->return_code}, which could be caused by a custom compiled version of PHP that uses the --enable-sigchild option." ); } - EE::debug( '-----------------------' ); - EE::debug( "COMMAND: $command" ); - - EE\Utils\default_debug( $results, true ); - if ( $echo_stdout ) { echo $results->stdout; } @@ -888,9 +893,10 @@ public static function exec( $command, $echo_stdout = false, $echo_stderr = fals if ( ! $results->return_code ) { return true; } - if( $exit_on_error ) { - EE::error( $results->stderr ); + if ( $exit_on_error ) { + exit( $results->return_code ); } + return false; } @@ -950,6 +956,22 @@ public static function launch_self( $command, $args = array(), $assoc_args = arr return self::launch( $full_command, $exit_on_error, $return_detailed ); } + /** + * Format and print debug messages for external command launch. + * + * @param Object $launch external command object. + */ + private static function debug_run_command( $launch ) { + if ( ! empty( $launch->stdout ) ) { + self::debug( "STDOUT: $launch->stdout" ); + } + if ( ! empty( $launch->stderr ) ) { + self::debug( "STDERR: $launch->stderr" ); + } + self::debug( "RETURN CODE: $launch->return_code" ); + self::debug( '-----------------------' ); + } + /** * Get the path to the PHP binary used when executing EE. * diff --git a/php/utils.php b/php/utils.php index 70822520f..29ea5792a 100644 --- a/php/utils.php +++ b/php/utils.php @@ -1409,60 +1409,6 @@ function delem_log( $log_data ) { EE::get_file_logger()->info( "======================== $log_data ========================" ); } -/** - * Format and print debug messages for EE::launch - * - * @param Object $launch EE::Launch command object. - * @param bool $skip_command Skip logging command. - */ -function default_debug( $launch, $skip_command = false ) { - if ( ! $skip_command ) { - EE::debug( '-----------------------' ); - EE::debug( "COMMAND: $launch->command" ); - } - if ( ! empty( $launch->stdout ) ) { - EE::debug( "STDOUT: $launch->stdout" ); - } - if ( ! empty( $launch->stderr ) ) { - EE::debug( "STDERR: $launch->stderr" ); - } - EE::debug( "RETURN CODE: $launch->return_code" ); - EE::debug( '-----------------------' ); -} - -/** - * Default Launch command. - * This takes care of executing the command as well as debugging it to terminal as well as file. - * - * @param string $command The command to be executed via EE::launch(); - * @param bool $echo_stdout Print stdout to terminal. Default false. - * @param bool $echo_stderr Print stderr to terminal. Default false. - * @param array $env Environment variables to set when running the command. - * @param string $cwd Directory to execute the command in. - * - * @return bool True if executed successfully. False if failed. - */ -function default_launch( $command, $echo_stdout = false, $echo_stderr = false, $env = null, $cwd = null ) { - - EE::debug( '-----------------------' ); - EE::debug( "COMMAND: $command" ); - - $launch = EE::launch( $command, false, true, $env, $cwd ); - default_debug( $launch, true ); - - if ( $echo_stdout ) { - echo $launch->stdout; - } - if ( $echo_stderr ) { - echo $launch->stderr; - } - if ( ! $launch->return_code ) { - return true; - } - - return false; -} - /** * Function that takes care of executing the command as well as debugging it to terminal as well as file. * From ea9257be9cf620f73b3eaea6b07eddcafc410662 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 31 Jul 2018 11:53:43 +0530 Subject: [PATCH 0271/1044] Update function calls according to changes Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/class-ee-docker.php | 3 --- php/commands/src/CLI_Command.php | 8 ++++---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php index 76de6daa0..902edd434 100644 --- a/php/class-ee-docker.php +++ b/php/class-ee-docker.php @@ -1,7 +1,5 @@ <?php -use function \EE\Utils\default_debug; - class EE_DOCKER { /** @@ -34,7 +32,6 @@ public static function container_status( $container ) { EE::error( 'Docker is not installed. Please install Docker to run EasyEngine.' ); } $status = EE::launch( "docker inspect -f '{{.State.Running}}' $container" ); - default_debug( $status ); if ( ! $status->return_code ) { if ( preg_match( '/true/', $status->stdout ) ) { return 'running'; diff --git a/php/commands/src/CLI_Command.php b/php/commands/src/CLI_Command.php index 238a7038f..e2d719bf1 100644 --- a/php/commands/src/CLI_Command.php +++ b/php/commands/src/CLI_Command.php @@ -502,9 +502,9 @@ public function self_uninstall( $args, $assoc_args ) { EE::confirm("Are you sure you want to remove EasyEngine and all its sites(along with their data)?\nThis is an irreversible action. No backup will be kept.", $assoc_args); - Utils\default_launch("docker rm -f $(docker ps -aqf label=org.label-schema.vendor=\"EasyEngine\")"); + EE::exec("docker rm -f $(docker ps -aqf label=org.label-schema.vendor=\"EasyEngine\")"); $home = Utils\get_home_dir(); - Utils\default_launch("rm -rf $home/.ee/"); + EE::exec("rm -rf $home/.ee/"); $records = EE::db()->select(['site_path']); @@ -514,8 +514,8 @@ public function self_uninstall( $args, $assoc_args ) { $fs->remove($sites_paths); } - Utils\default_launch("rm -df $home/ee-sites/"); - Utils\default_launch("rm -rf /opt/easyengine/"); + EE::exec("rm -df $home/ee-sites/"); + EE::exec("rm -rf /opt/easyengine/"); if ( Utils\inside_phar() ) { unlink( realpath( $_SERVER['argv'][0] ) ); From dfa80a6ae27f19f8adc84a8c3e407ba726476ca9 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 31 Jul 2018 21:59:39 +0530 Subject: [PATCH 0272/1044] Remove extra space Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/class-ee.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/class-ee.php b/php/class-ee.php index 968cf7ff9..b05a80309 100644 --- a/php/class-ee.php +++ b/php/class-ee.php @@ -880,7 +880,7 @@ public static function exec( $command, $echo_stdout = false, $echo_stderr = fals self::debug_run_command( $results ); - if ( - 1 == $results->return_code ) { + if ( -1 == $results->return_code ) { self::warning( "Spawned process returned exit code {$results->return_code}, which could be caused by a custom compiled version of PHP that uses the --enable-sigchild option." ); } From 14dca49fffc82c56292e09fc329ebd7b037df5ae Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Wed, 25 Jul 2018 19:02:19 +0530 Subject: [PATCH 0273/1044] Move site functions to site utils Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/utils.php | 56 --------------------------------------------------- 1 file changed, 56 deletions(-) diff --git a/php/utils.php b/php/utils.php index f490ac8dd..5a8d8fe05 100644 --- a/php/utils.php +++ b/php/utils.php @@ -1549,62 +1549,6 @@ function format_table( $items ) { \EE::log( $delem ); } -/** - * Get the site-name from the path from where ee is running if it is a valid site path. - * - * @return bool|String Name of the site or false in failure. - */ -function get_site_name() { - $sites = EE::db()::select( array( 'sitename' ) ); - - if ( $sites ) { - $cwd = getcwd(); - $name_in_path = explode( '/', $cwd ); - $site_name = array_intersect( array_flatten( $sites ), $name_in_path ); - - if ( 1 === count( $site_name ) ) { - $name = reset( $site_name ); - $path = EE::db()::select( array( 'site_path' ), array( 'sitename' => $name ) ); - if ( $path ) { - $site_path = $path[0]['site_path']; - if ( $site_path === substr( $cwd, 0, strlen( $site_path ) ) ) { - return $name; - } - } - } - } - - return false; -} - -/** - * Function to set the site-name in the args when ee is running in a site folder and the site-name has not been passed in the args. If the site-name could not be found it will throw an error. - * - * @param array $args The passed arguments. - * @param String $command The command passing the arguments to auto-detect site-name. - * @param bool $arg_zero Site-name will be present in the first argument. Default true. - * - * @return array Arguments with site-name set. - */ -function set_site_arg( $args, $command, $arg_zero=true ) { - if ( isset( $args[0] ) ) { - if ( EE::db()::site_in_db( $args[0] ) ) { - return $args; - } - } - $site_name = get_site_name(); - if ( $site_name ) { - if ( isset( $args[0] ) && $arg_zero ) { - EE::error( $args[0] . " is not a valid site-name. Did you mean `ee $command $site_name`?" ); - } - array_unshift( $args, $site_name ); - } else { - EE::error( "Could not find the site you wish to run $command command on.\nEither pass it as an argument: `ee $command <site-name>` \nor run `ee $command` from inside the site folder." ); - } - - return $args; -} - /** * Function to flatten a multi-dimensional array. * From 4074fd160cbddd5dbc802223cd9878f478a116ec Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Wed, 25 Jul 2018 19:04:37 +0530 Subject: [PATCH 0274/1044] Add initial site utils Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/site-utils.php | 63 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 php/site-utils.php diff --git a/php/site-utils.php b/php/site-utils.php new file mode 100644 index 000000000..7adc2b95d --- /dev/null +++ b/php/site-utils.php @@ -0,0 +1,63 @@ +<?php + +namespace EE\SiteUtils; + +use \EE; +use \Symfony\Component\Filesystem\Filesystem; + +/** + * Get the site-name from the path from where ee is running if it is a valid site path. + * + * @return bool|String Name of the site or false in failure. + */ +function get_site_name() { + $sites = EE::db()::select( array( 'sitename' ) ); + + if ( $sites ) { + $cwd = getcwd(); + $name_in_path = explode( '/', $cwd ); + $site_name = array_intersect( EE\Utils\array_flatten( $sites ), $name_in_path ); + + if ( 1 === count( $site_name ) ) { + $name = reset( $site_name ); + $path = EE::db()::select( array( 'site_path' ), array( 'sitename' => $name ) ); + if ( $path ) { + $site_path = $path[0]['site_path']; + if ( $site_path === substr( $cwd, 0, strlen( $site_path ) ) ) { + return $name; + } + } + } + } + + return false; +} + +/** + * Function to set the site-name in the args when ee is running in a site folder and the site-name has not been passed in the args. If the site-name could not be found it will throw an error. + * + * @param array $args The passed arguments. + * @param String $command The command passing the arguments to auto-detect site-name. + * @param String $function The function passing the arguments to auto-detect site-name. + * @param bool $arg_zero Site-name will be present in the first argument. Default true. + * + * @return array Arguments with site-name set. + */ +function auto_site_name( $args, $command, $function, $arg_zero = true ) { + if ( isset( $args[0] ) ) { + if ( EE::db()::site_in_db( $args[0] ) ) { + return $args; + } + } + $site_name = get_site_name(); + if ( $site_name ) { + if ( isset( $args[0] ) && $arg_zero ) { + EE::error( $args[0] . " is not a valid site-name. Did you mean `ee $command $function $site_name`?" ); + } + array_unshift( $args, $site_name ); + } else { + EE::error( "Could not find the site you wish to run $command $function command on.\nEither pass it as an argument: `ee $command $function <site-name>` \nor run `ee $command $function` from inside the site folder." ); + } + + return $args; +} From dbc81940fdb72b3ead5722668d2fceb92bf4388d Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Wed, 25 Jul 2018 19:05:12 +0530 Subject: [PATCH 0275/1044] Add site command functions Update Exceptions Update to use symfony filesystem --- php/site-utils.php | 211 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 211 insertions(+) diff --git a/php/site-utils.php b/php/site-utils.php index 7adc2b95d..2b38d218d 100644 --- a/php/site-utils.php +++ b/php/site-utils.php @@ -61,3 +61,214 @@ function auto_site_name( $args, $command, $function, $arg_zero = true ) { return $args; } + + +/** + * Function to check all the required configurations needed to create the site. + * + * Boots up the container if it is stopped or not running. + */ +function init_checks() { + $proxy_type = EE_PROXY_TYPE; + if ( 'running' !== EE::docker()::container_status( $proxy_type ) ) { + /** + * Checking ports. + */ + @fsockopen( 'localhost', 80, $port_80_exit_status ); + @fsockopen( 'localhost', 443, $port_443_exit_status ); + + // if any/both the port/s is/are occupied. + if ( ! ( $port_80_exit_status && $port_443_exit_status ) ) { + EE::error( 'Cannot create/start proxy container. Please make sure port 80 and 443 are free.' ); + } else { + $EE_CONF_ROOT = EE_CONF_ROOT; + $ee_proxy_command = "docker run --name $proxy_type -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v $EE_CONF_ROOT/nginx/certs:/etc/nginx/certs -v $EE_CONF_ROOT/nginx/dhparam:/etc/nginx/dhparam -v $EE_CONF_ROOT/nginx/conf.d:/etc/nginx/conf.d -v $EE_CONF_ROOT/nginx/htpasswd:/etc/nginx/htpasswd -v $EE_CONF_ROOT/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v $EE_CONF_ROOT:/app/ee4 -v /usr/share/nginx/html easyengine/nginx-proxy:v" . EE_VERSION; + + + if ( EE::docker()::boot_container( $proxy_type, $ee_proxy_command ) ) { + EE::success( "$proxy_type container is up." ); + } else { + EE::error( "There was some error in starting $proxy_type container. Please check logs." ); + } + } + } +} + +/** + * Creates site root directory if does not exist. + * Throws error if it does exist. + * + * @param string $site_root Root directory of the site. + * @param string $site_name Name of the site. + */ +function create_site_root( $site_root, $site_name ) { + $fs = new Filesystem(); + if ( $fs->exists( $site_root ) ) { + EE::error( "Webroot directory for site $site_name already exists." ); + } + + $whoami = EE::launch( 'whoami', false, true ); + $terminal_username = rtrim( $whoami->stdout ); + + $fs->mkdir( $site_root ); + $fs->chown( $site_root, $terminal_username ); +} + +/** + * Function to setup site network. + * + * @param string $site_name Name of the site. + * + * @throws \Exception when network start fails. + */ +function setup_site_network( $site_name ) { + $proxy_type = EE_PROXY_TYPE; + if ( EE::docker()::create_network( $site_name ) ) { + EE::success( 'Network started.' ); + } else { + throw new \Exception( 'There was some error in starting the network.' ); + } + + EE::docker()::connect_site_network_to( $site_name, $proxy_type ); + +} + +/** + * Adds www to non-www redirection to site + * + * @param string $site_name Name of the site. + * @param bool $le Specifying if letsencrypt is enabled or not. + */ +function add_site_redirects( $site_name, $le ) { + $fs = new Filesystem(); + $confd_path = EE_CONF_ROOT . '/nginx/conf.d/'; + $config_file_path = $confd_path . $site_name . '-redirect.conf'; + $has_www = strpos( $site_name, 'www.' ) === 0; + + if ( $has_www ) { + $site_name_without_www = ltrim( $site_name, '.www' ); + // ee site create www.example.com --le + if ( $le ) { + $content = " +server { + listen 80; + listen 443; + server_name $site_name_without_www; + return 301 https://$site_name\$request_uri; +}"; + } // ee site create www.example.com + else { + $content = " +server { + listen 80; + server_name $site_name_without_www; + return 301 http://$site_name\$request_uri; +}"; + } + } else { + $site_name_with_www = 'www.' . $site_name; + // ee site create example.com --le + if ( $le ) { + + $content = " +server { + listen 80; + listen 443; + server_name $site_name_with_www; + return 301 https://$site_name\$request_uri; +}"; + } // ee site create example.com + else { + $content = " +server { + listen 80; + server_name $site_name_with_www; + return 301 http://$site_name\$request_uri; +}"; + } + } + $fs->dumpFile( $config_file_path, ltrim( $content, PHP_EOL ) ); +} + +/** + * Function to create entry in /etc/hosts. + * + * @param string $site_name Name of the site. + */ +function create_etc_hosts_entry( $site_name ) { + + $host_line = LOCALHOST_IP . "\t$site_name"; + $etc_hosts = file_get_contents( '/etc/hosts' ); + if ( ! preg_match( "/\s+$site_name\$/m", $etc_hosts ) ) { + if ( EE\Utils\default_launch( "/bin/bash -c 'echo \"$host_line\" >> /etc/hosts'" ) ) { + EE::success( 'Host entry successfully added.' ); + } else { + EE::warning( "Failed to add $site_name in host entry, Please do it manually!" ); + } + } else { + EE::log( 'Host entry already exists.' ); + } +} + + +/** + * Checking site is running or not. + * + * @param string $site_name Name of the site. + * + * @throws \Exception when fails to connect to site. + */ +function site_status_check( $site_name ) { + EE::log( 'Checking and verifying site-up status. This may take some time.' ); + $httpcode = 000; + $ch = curl_init( $site_name ); + curl_setopt( $ch, CURLOPT_HEADER, true ); + curl_setopt( $ch, CURLOPT_NOBODY, true ); + curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); + curl_setopt( $ch, CURLOPT_TIMEOUT, 10 ); + + $i = 0; + while ( 200 !== $httpcode && 302 !== $httpcode ) { + EE::debug( "$site_name status httpcode: $httpcode" ); + curl_exec( $ch ); + $httpcode = curl_getinfo( $ch, CURLINFO_HTTP_CODE ); + EE::log( '.' ); + sleep( 2 ); + if ( $i ++ > 60 ) { + break; + } + } + if ( 200 !== $httpcode && 302 !== $httpcode ) { + throw new \Exception( 'Problem connecting to site!' ); + } + +} + +/** + * Function to pull the latest images and bring up the site containers. + * + * @param string $site_root Root directory of the site. + * + * @throws \Exception when docker-compose up fails. + */ +function start_site_containers( $site_root ) { + EE::log( 'Pulling latest images. This may take some time.' ); + chdir( $site_root ); + \EE\Utils\default_launch( 'docker-compose pull' ); + EE::log( 'Starting site\'s services.' ); + if ( ! EE::docker()::docker_compose_up( $site_root ) ) { + throw new \Exception( 'There was some error in docker-compose up.' ); + } +} + + +/** + * Generic function to run a docker compose command. Must be ran inside correct directory. + */ +function run_compose_command( $action, $container, $action_to_display = null, $service_to_display = null ) { + $display_action = $action_to_display ? $action_to_display : $action; + $display_service = $service_to_display ? $service_to_display : $container; + + \EE::log( ucfirst( $display_action ) . 'ing ' . $display_service ); + \EE\Utils\default_launch( "docker-compose $action $container", true, true ); +} From 42a34a04600b939638146dc3052a89279c73bb6e Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Wed, 25 Jul 2018 19:06:18 +0530 Subject: [PATCH 0276/1044] Add loading of site utils Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Bootstrap/LoadSiteUtilityFunctions.php | 26 +++++++++++++++++++ php/bootstrap.php | 1 + 2 files changed, 27 insertions(+) create mode 100644 php/EE/Bootstrap/LoadSiteUtilityFunctions.php diff --git a/php/EE/Bootstrap/LoadSiteUtilityFunctions.php b/php/EE/Bootstrap/LoadSiteUtilityFunctions.php new file mode 100644 index 000000000..ae63d25af --- /dev/null +++ b/php/EE/Bootstrap/LoadSiteUtilityFunctions.php @@ -0,0 +1,26 @@ +<?php + +namespace EE\Bootstrap; + +/** + * Class LoadSiteUtilityFunctions. + * + * Loads the functions available through `EE\SiteUtils`. + * + * @package EE\Bootstrap + */ +final class LoadSiteUtilityFunctions implements BootstrapStep { + + /** + * Process this single bootstrapping step. + * + * @param BootstrapState $state Contextual state to pass into the step. + * + * @return BootstrapState Modified state to pass to the next step. + */ + public function process( BootstrapState $state ) { + require_once EE_ROOT . '/php/site-utils.php'; + + return $state; + } +} diff --git a/php/bootstrap.php b/php/bootstrap.php index 195efd818..dc14caa0a 100644 --- a/php/bootstrap.php +++ b/php/bootstrap.php @@ -26,6 +26,7 @@ function get_bootstrap_steps() { 'EE\Bootstrap\LoadRequiredCommand', 'EE\Bootstrap\IncludePackageAutoloader', 'EE\Bootstrap\IncludeBundledAutoloader', + 'EE\Bootstrap\LoadSiteUtilityFunctions', 'EE\Bootstrap\RegisterFrameworkCommands', 'EE\Bootstrap\IncludeFallbackAutoloader', 'EE\Bootstrap\RegisterDeferredCommands', From f0aa2cec53fb9d98d268f4e5144bd06f67f7ad31 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Wed, 25 Jul 2018 19:07:10 +0530 Subject: [PATCH 0277/1044] Add Abstract Class for Site Commands Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/class-ee-site.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 php/class-ee-site.php diff --git a/php/class-ee-site.php b/php/class-ee-site.php new file mode 100644 index 000000000..474bcc3ac --- /dev/null +++ b/php/class-ee-site.php @@ -0,0 +1,23 @@ +<?php + +/** + * Base class for Site command + * + * @package ee + */ +abstract class EE_Site_Command { + + public function __construct() {} + + public function _list( $args, $assoc_args ) {} + + public function delete( $args, $assoc_args ) {} + + public function create( $args, $assoc_args ) {} + + public function up( $args, $assoc_args ) {} + + public function down( $args, $assoc_args ) {} + +} + From 5696ab8aa766ce3616a5b40946b6f7e52728c267 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Wed, 25 Jul 2018 19:07:36 +0530 Subject: [PATCH 0278/1044] Add proxy type constant Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/init-ee.php | 1 + 1 file changed, 1 insertion(+) diff --git a/php/init-ee.php b/php/init-ee.php index 4c2565be0..bd4b88d39 100644 --- a/php/init-ee.php +++ b/php/init-ee.php @@ -10,6 +10,7 @@ define( 'EE_VERSION', trim( file_get_contents( EE_ROOT . '/VERSION' ) ) ); define( 'EE_START_MICROTIME', microtime( true ) ); define( 'EE_CONF_ROOT', '/opt/easyengine' ); +define( 'EE_PROXY_TYPE', 'ee-nginx-proxy' ); if ( file_exists( EE_ROOT . '/vendor/autoload.php' ) ) { define( 'EE_VENDOR_DIR', EE_ROOT . '/vendor' ); From 752b9531723be5a4cb6764c88f98e8086337e258 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 26 Jul 2018 15:55:31 +0530 Subject: [PATCH 0279/1044] Update doc parsing to inherit parent class doc Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Dispatcher/CommandFactory.php | 9 ++++++++- php/EE/DocParser.php | 11 +++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/php/EE/Dispatcher/CommandFactory.php b/php/EE/Dispatcher/CommandFactory.php index 4b3f5c165..6c3baf340 100644 --- a/php/EE/Dispatcher/CommandFactory.php +++ b/php/EE/Dispatcher/CommandFactory.php @@ -68,7 +68,14 @@ public static function clear_file_contents_cache() { */ private static function create_subcommand( $parent, $name, $callable, $reflection ) { $doc_comment = self::get_doc_comment( $reflection ); - $docparser = new \EE\DocParser( $doc_comment ); + $docparser = new \EE\DocParser( $doc_comment ); + + while ( $docparser->has_tag( 'inheritdoc' ) ) { + $inherited_method = $reflection->getDeclaringClass()->getParentClass()->getMethod( $reflection->name ); + + $doc_comment = self::get_doc_comment( $inherited_method ); + $docparser = new \EE\DocParser( $doc_comment ); + } if ( is_array( $callable ) ) { if ( ! $name ) { diff --git a/php/EE/DocParser.php b/php/EE/DocParser.php index 0255c1be4..6910b45a8 100644 --- a/php/EE/DocParser.php +++ b/php/EE/DocParser.php @@ -91,6 +91,17 @@ public function get_tag( $name ) { return ''; } + /** + * Check if a given tag is present (e.g. "@alias" or "@subcommand") + * + * @param string $name Name for the tag, without '@'. + * + * @return bool + */ + public function has_tag( $name ) { + return preg_match( '|^@' . $name . '|m', $this->docComment, $matches ); + } + /** * Get the command's synopsis. * From 2a07504ebc1e217af234fbf0d2469b14ed9c9963 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 26 Jul 2018 17:42:34 +0530 Subject: [PATCH 0280/1044] Update commandfactory to add @ignorecommand functionality Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Dispatcher/CommandFactory.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/php/EE/Dispatcher/CommandFactory.php b/php/EE/Dispatcher/CommandFactory.php index 6c3baf340..ff8d64b20 100644 --- a/php/EE/Dispatcher/CommandFactory.php +++ b/php/EE/Dispatcher/CommandFactory.php @@ -120,11 +120,12 @@ private static function create_composite_command( $parent, $name, $callable ) { $container = new CompositeCommand( $parent, $name, $docparser ); foreach ( $reflection->getMethods() as $method ) { - if ( ! self::is_good_method( $method ) ) { + $method_docparser = new \EE\DocParser( self::get_doc_comment( $method ) ); + if ( ! self::is_good_method( $method ) || self::should_ignore_method( $method_docparser ) ) { continue; } - $class = is_object( $callable ) ? $callable : $reflection->name; + $class = is_object( $callable ) ? $callable : $reflection->name; $subcommand = self::create_subcommand( $container, false, array( $class, $method->name ), $method ); $subcommand_name = $subcommand->get_name(); @@ -163,6 +164,17 @@ private static function is_good_method( $method ) { return $method->isPublic() && ! $method->isStatic() && 0 !== strpos( $method->getName(), '__' ); } + /** + * Check whether a method should be ignored. + * + * @param ReflectionMethod $method + * + * @return bool + */ + private static function should_ignore_method( $docparser ) { + return $docparser->has_tag( 'ignorecommand' ); + } + /** * Gets the document comment. Caters for PHP directive `opcache.save comments` being disabled. * From 111e042ec86f5000e0f7c1f4acf0711eb01897a8 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 26 Jul 2018 18:08:09 +0530 Subject: [PATCH 0281/1044] Update inheritdoc for ignorecommand Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Dispatcher/CommandFactory.php | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/php/EE/Dispatcher/CommandFactory.php b/php/EE/Dispatcher/CommandFactory.php index ff8d64b20..b476dc7ca 100644 --- a/php/EE/Dispatcher/CommandFactory.php +++ b/php/EE/Dispatcher/CommandFactory.php @@ -68,7 +68,7 @@ public static function clear_file_contents_cache() { */ private static function create_subcommand( $parent, $name, $callable, $reflection ) { $doc_comment = self::get_doc_comment( $reflection ); - $docparser = new \EE\DocParser( $doc_comment ); + $docparser = self::get_inherited_docparser( $doc_comment, $reflection ); while ( $docparser->has_tag( 'inheritdoc' ) ) { $inherited_method = $reflection->getDeclaringClass()->getParentClass()->getMethod( $reflection->name ); @@ -120,8 +120,8 @@ private static function create_composite_command( $parent, $name, $callable ) { $container = new CompositeCommand( $parent, $name, $docparser ); foreach ( $reflection->getMethods() as $method ) { - $method_docparser = new \EE\DocParser( self::get_doc_comment( $method ) ); - if ( ! self::is_good_method( $method ) || self::should_ignore_method( $method_docparser ) ) { + $method_doc_comment = self::get_doc_comment( $method ); + if ( ! self::is_good_method( $method ) || self::should_ignore_method( $method_doc_comment, $method ) ) { continue; } @@ -164,6 +164,22 @@ private static function is_good_method( $method ) { return $method->isPublic() && ! $method->isStatic() && 0 !== strpos( $method->getName(), '__' ); } + /** + * @param string $doc_comment + * @param ReflectionMethod $reflection + */ + private static function get_inherited_docparser( $doc_comment, $reflection ) { + $docparser = new \EE\DocParser( $doc_comment ); + while ( $docparser->has_tag( 'inheritdoc' ) ) { + $inherited_method = $reflection->getDeclaringClass()->getParentClass()->getMethod( $reflection->name ); + + $doc_comment = self::get_doc_comment( $inherited_method ); + $docparser = new \EE\DocParser( $doc_comment ); + } + + return $docparser; + } + /** * Check whether a method should be ignored. * @@ -171,7 +187,9 @@ private static function is_good_method( $method ) { * * @return bool */ - private static function should_ignore_method( $docparser ) { + private static function should_ignore_method( $doc_comment, $reflection ) { + $docparser = self::get_inherited_docparser( $doc_comment, $reflection ); + return $docparser->has_tag( 'ignorecommand' ); } From 06781189b633a4c31ef736539c01bb1f98e5f176 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 26 Jul 2018 20:36:34 +0530 Subject: [PATCH 0282/1044] Add variables Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/class-ee-site.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/php/class-ee-site.php b/php/class-ee-site.php index 474bcc3ac..c6b89215c 100644 --- a/php/class-ee-site.php +++ b/php/class-ee-site.php @@ -1,11 +1,19 @@ <?php +use \Symfony\Component\Filesystem\Filesystem; + /** * Base class for Site command * * @package ee */ abstract class EE_Site_Command { + private $fs; + private $le; + private $le_mail; + private $site_name; + private $site_root; + private $site_type; public function __construct() {} From d1d21239da92b188a6d07ccdce4f74867a02d619 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 26 Jul 2018 20:37:33 +0530 Subject: [PATCH 0283/1044] Implement list function Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/class-ee-site.php | 68 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 67 insertions(+), 1 deletion(-) diff --git a/php/class-ee-site.php b/php/class-ee-site.php index c6b89215c..1c65642ca 100644 --- a/php/class-ee-site.php +++ b/php/class-ee-site.php @@ -17,7 +17,73 @@ abstract class EE_Site_Command { public function __construct() {} - public function _list( $args, $assoc_args ) {} + /** + * Lists the created websites. + * abstract list + * + * [--enabled] + * : List only enabled sites. + * + * [--disabled] + * : List only disabled sites. + * + * [--format=<format>] + * : Render output in a particular format. + * --- + * default: table + * options: + * - table + * - csv + * - yaml + * - json + * - count + * - text + * --- + * + * @subcommand list + */ + public function _list( $args, $assoc_args ) { + \EE\Utils\delem_log( 'site list start' ); + $format = \EE\Utils\get_flag_value( $assoc_args, 'format' ); + $enabled = \EE\Utils\get_flag_value( $assoc_args, 'enabled' ); + $disabled = \EE\Utils\get_flag_value( $assoc_args, 'disabled' ); + + $where = array(); + + if ( $enabled && ! $disabled ) { + $where['is_enabled'] = 1; + } elseif ( $disabled && ! $enabled ) { + $where['is_enabled'] = 0; + } + + $sites = EE::db()::select( array( 'sitename', 'is_enabled' ), $where ); + + if ( ! $sites ) { + EE::error( 'No sites found!' ); + } + + if ( 'text' === $format ) { + foreach ( $sites as $site ) { + EE::log( $site['sitename'] ); + } + } else { + $result = array_map( + function ( $site ) { + $site['site'] = $site['sitename']; + $site['status'] = $site['is_enabled'] ? 'enabled' : 'disabled'; + + return $site; + }, $sites + ); + + $formatter = new \EE\Formatter( $assoc_args, [ 'site', 'status' ] ); + + $formatter->display_items( $result ); + } + + \EE\Utils\delem_log( 'site list end' ); + } + public function delete( $args, $assoc_args ) {} From 44bfb5337a41c211a343e7809e5758158dcb40e0 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 26 Jul 2018 20:38:51 +0530 Subject: [PATCH 0284/1044] Update delete for abstract class Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/class-ee-site.php | 96 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 95 insertions(+), 1 deletion(-) diff --git a/php/class-ee-site.php b/php/class-ee-site.php index 1c65642ca..7a67fb854 100644 --- a/php/class-ee-site.php +++ b/php/class-ee-site.php @@ -85,7 +85,101 @@ function ( $site ) { } - public function delete( $args, $assoc_args ) {} + /** + * Deletes a website. + * + * ## OPTIONS + * + * <site-name> + * : Name of website to be deleted. + * + * [--yes] + * : Do not prompt for confirmation. + */ + public function delete( $args, $assoc_args ) { + \EE\Utils\delem_log( 'site delete start' ); + $this->populate_site_info( $args ); + EE::confirm( "Are you sure you want to delete $this->site_name?", $assoc_args ); + $this->delete_site( 5, $this->site_name, $this->site_root ); + \EE\Utils\delem_log( 'site delete end' ); + } + + /** + * Function to delete the given site. + * + * @param int $level + * Level of deletion. + * Level - 0: No need of clean-up. + * Level - 1: Clean-up only the site-root. + * Level - 2: Try to remove network. The network may or may not have been created. + * Level - 3: Disconnect & remove network and try to remove containers. The containers may not have been created. + * Level - 4: Remove containers. + * Level - 5: Remove db entry. + * + * @ignorecommand + */ + public function delete_site( $level, $site_name, $site_root ) { + $this->fs = new Filesystem(); + $proxy_type = EE_PROXY_TYPE; + if ( $level >= 3 ) { + if ( EE::docker()::docker_compose_down( $site_root ) ) { + EE::log( "[$site_name] Docker Containers removed." ); + } else { + \EE\Utils\default_launch( "docker rm -f $(docker ps -q -f=label=created_by=EasyEngine -f=label=site_name=$site_name)" ); + if ( $level > 3 ) { + EE::warning( 'Error in removing docker containers.' ); + } + } + + EE::docker()::disconnect_site_network_from( $site_name, $proxy_type ); + } + + if ( $level >= 2 ) { + if ( EE::docker()::rm_network( $site_name ) ) { + EE::log( "[$site_name] Docker container removed from network $proxy_type." ); + } else { + if ( $level > 2 ) { + EE::warning( "Error in removing Docker container from network $proxy_type" ); + } + } + } + + if ( $this->fs->exists( $site_root ) ) { + try { + $this->fs->remove( $site_root ); + } + catch ( Exception $e ) { + EE::debug( $e ); + EE::error( 'Could not remove site root. Please check if you have sufficient rights.' ); + } + EE::log( "[$site_name] site root removed." ); + } + + if ( $level > 4 ) { + if ( $this->le ) { + EE::log( 'Removing ssl certs.' ); + $crt_file = EE_CONF_ROOT . "/nginx/certs/$site_name.crt"; + $key_file = EE_CONF_ROOT . "/nginx/certs/$site_name.key"; + $conf_certs = EE_CONF_ROOT . "/acme-conf/certs/$site_name"; + $conf_var = EE_CONF_ROOT . "/acme-conf/var/$site_name"; + + $cert_files = [ $conf_certs, $conf_var, $crt_file, $key_file ]; + try { + $this->fs->remove( $cert_files ); + } + catch ( Exception $e ) { + EE::warning( $e ); + } + + } + if ( EE::db()::delete( array( 'sitename' => $site_name ) ) ) { + EE::log( 'Removing database entry.' ); + } else { + EE::error( 'Could not remove the database entry' ); + } + } + EE::log( "Site $site_name deleted." ); + } public function create( $args, $assoc_args ) {} From fbda628f5fcf9ca04992ff36a762baf4adb1f010 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 26 Jul 2018 20:40:00 +0530 Subject: [PATCH 0285/1044] Implement up and down Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/class-ee-site.php | 46 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 43 insertions(+), 3 deletions(-) diff --git a/php/class-ee-site.php b/php/class-ee-site.php index 7a67fb854..a10d830b8 100644 --- a/php/class-ee-site.php +++ b/php/class-ee-site.php @@ -181,11 +181,51 @@ public function delete_site( $level, $site_name, $site_root ) { EE::log( "Site $site_name deleted." ); } - public function create( $args, $assoc_args ) {} + /** + * Enables a website. It will start the docker containers of the website if they are stopped. + * + * ## OPTIONS + * + * [<site-name>] + * : Name of website to be enabled. + */ + public function up( $args, $assoc_args ) { + \EE\Utils\delem_log( 'site enable start' ); + $args = \EE\SiteUtils\auto_site_name( $args, 'site', __FUNCTION__ ); + $this->populate_site_info( $args ); + EE::log( "Enabling site $this->site_name." ); + if ( EE::docker()::docker_compose_up( $this->site_root ) ) { + EE::db()::update( [ 'is_enabled' => '1' ], [ 'sitename' => $this->site_name ] ); + EE::success( "Site $this->site_name enabled." ); + } else { + EE::error( "There was error in enabling $this->site_name. Please check logs." ); + } + \EE\Utils\delem_log( 'site enable end' ); + } - public function up( $args, $assoc_args ) {} + /** + * Disables a website. It will stop and remove the docker containers of the website if they are running. + * + * ## OPTIONS + * + * [<site-name>] + * : Name of website to be disabled. + */ + public function down( $args, $assoc_args ) { + \EE\Utils\delem_log( 'site disable start' ); + $args = \EE\SiteUtils\auto_site_name( $args, 'site', __FUNCTION__ ); + $this->populate_site_info( $args ); + EE::log( "Disabling site $this->site_name." ); + if ( EE::docker()::docker_compose_down( $this->site_root ) ) { + EE::db()::update( [ 'is_enabled' => '0' ], [ 'sitename' => $this->site_name ] ); + EE::success( "Site $this->site_name disabled." ); + } else { + EE::error( "There was error in disabling $this->site_name. Please check logs." ); + } + \EE\Utils\delem_log( 'site disable end' ); + } - public function down( $args, $assoc_args ) {} + public function create( $args, $assoc_args ) {} } From 2295758ab2b2bab3d38792af7995d4fac70ae3f7 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 26 Jul 2018 20:40:58 +0530 Subject: [PATCH 0286/1044] Implement restart and reload Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/class-ee-site.php | 80 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/php/class-ee-site.php b/php/class-ee-site.php index a10d830b8..8e7b8231c 100644 --- a/php/class-ee-site.php +++ b/php/class-ee-site.php @@ -225,6 +225,86 @@ public function down( $args, $assoc_args ) { \EE\Utils\delem_log( 'site disable end' ); } + /** + * Restarts containers associated with site. + * When no service(--nginx etc.) is specified, all site containers will be restarted. + * + * [<site-name>] + * : Name of the site. + * + * [--all] + * : Restart all containers of site. + * + * [--nginx] + * : Restart nginx container of site. + */ + public function restart( $args, $assoc_args ) { + \EE\Utils\delem_log( 'site restart start' ); + $args = \EE\SiteUtils\auto_site_name( $args, 'site', __FUNCTION__ ); + $all = \EE\Utils\get_flag_value( $assoc_args, 'all' ); + $no_service_specified = count( $assoc_args ) === 0; + + $this->populate_site_info( $args ); + + chdir( $this->site_root ); + + if ( $all || $no_service_specified ) { + $containers = [ 'nginx' ]; + } else { + $containers = array_keys( $assoc_args ); + } + + foreach ( $containers as $container ) { + EE\Siteutils\run_compose_command( 'restart', $container, null, 'all services' ); + } + \EE\Utils\delem_log( 'site restart stop' ); + } + + /** + * Reload services in containers without restarting container(s) associated with site. + * When no service(--nginx etc.) is specified, all services will be reloaded. + * + * <site-name> + * : Name of the site. + * + * [--all] + * : Reload all services of site(which are supported). + * + * [--nginx] + * : Reload nginx service in container. + * + */ + public function reload( $args, $assoc_args ) { + \EE\Utils\delem_log( 'site reload start' ); + $args = \EE\SiteUtils\auto_site_name( $args, 'site', __FUNCTION__ ); + $all = \EE\Utils\get_flag_value( $assoc_args, 'all' ); + $no_service_specified = count( $assoc_args ) === 0; + + $this->populate_site_info( $args ); + + chdir( $this->site_root ); + + if ( $all || $no_service_specified ) { + $this->reload_services( [ 'nginx' ] ); + } else { + $this->reload_services( array_keys( $assoc_args ) ); + } + \EE\Utils\delem_log( 'site reload stop' ); + } + + /** + * Executes reload commands. It needs seperate handling as commands to reload each service is different. + */ + private function reload_services( $services ) { + $reload_command = [ + 'nginx' => 'nginx sh -c \'nginx -t && service openresty reload\'', + ]; + + foreach ( $services as $service ) { + \EE\SiteUtils\run_compose_command( 'exec', $reload_command[$service], 'reload', $service ); + } + } + public function create( $args, $assoc_args ) {} } From 2753da926484c5cc1a3fd0bc803bda5859f45f3c Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 26 Jul 2018 20:42:17 +0530 Subject: [PATCH 0287/1044] Add letsencrypt dependencies Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- composer.json | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 86d214c5e..262b33c46 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,10 @@ "easyengine/cron-command": "v1.0.0-beta.1", "easyengine/site-command": "v1.0.0", "easyengine/shell-command": "v1.0.0-beta.1", + "ext-openssl": "*", + "guzzlehttp/guzzle": "^6.0", "justinrainbow/json-schema": "~5.2.5", + "league/flysystem": "^1.0.19", "monolog/monolog": "^1.23", "mustache/mustache": "~2.4", "rmccue/requests": "~1.6", @@ -42,8 +45,10 @@ "symfony/filesystem": "^2.7|^3.0", "symfony/finder": "^2.7|^3.0", "symfony/process": "^2.1|^3.0", + "symfony/serializer": "^3.0", "symfony/translation": "^2.7|^3.0", "symfony/yaml": "^2.7|^3.0", + "webmozart/assert": "^1.0", "wp-cli/autoload-splitter": "^0.1.5", "wp-cli/mustangostang-spyc": "^0.6.3", "wp-cli/php-cli-tools": "~0.11.2" @@ -64,7 +69,8 @@ "EE": "php" }, "psr-4": { - "": "php/commands/src" + "": "php/commands/src", + "AcmePhp\\Cli\\": "php/AcmePhp/Cli" } }, "extra": { From db7460c417209e5123c1fa482d08fa5d72e77893 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 26 Jul 2018 20:42:36 +0530 Subject: [PATCH 0288/1044] Add acmephp files Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- .../Cli/Exception/AcmeCliActionException.php | 23 + .../Cli/Exception/AcmeCliException.php | 23 + .../Exception/AcmeDnsResolutionException.php | 23 + .../Cli/Exception/CommandFlowException.php | 55 +++ php/AcmePhp/Cli/Repository/Repository.php | 439 ++++++++++++++++++ .../Cli/Repository/RepositoryInterface.php | 198 ++++++++ .../Cli/Repository/RepositoryV2Interface.php | 51 ++ php/AcmePhp/Cli/Serializer/PemEncoder.php | 55 +++ php/AcmePhp/Cli/Serializer/PemNormalizer.php | 55 +++ 9 files changed, 922 insertions(+) create mode 100644 php/AcmePhp/Cli/Exception/AcmeCliActionException.php create mode 100644 php/AcmePhp/Cli/Exception/AcmeCliException.php create mode 100644 php/AcmePhp/Cli/Exception/AcmeDnsResolutionException.php create mode 100644 php/AcmePhp/Cli/Exception/CommandFlowException.php create mode 100644 php/AcmePhp/Cli/Repository/Repository.php create mode 100644 php/AcmePhp/Cli/Repository/RepositoryInterface.php create mode 100644 php/AcmePhp/Cli/Repository/RepositoryV2Interface.php create mode 100644 php/AcmePhp/Cli/Serializer/PemEncoder.php create mode 100644 php/AcmePhp/Cli/Serializer/PemNormalizer.php diff --git a/php/AcmePhp/Cli/Exception/AcmeCliActionException.php b/php/AcmePhp/Cli/Exception/AcmeCliActionException.php new file mode 100644 index 000000000..a18f3e6f4 --- /dev/null +++ b/php/AcmePhp/Cli/Exception/AcmeCliActionException.php @@ -0,0 +1,23 @@ +<?php + +/* + * This file is part of the Acme PHP project. + * + * (c) Titouan Galopin <galopintitouan@gmail.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace AcmePhp\Cli\Exception; + +/** + * @author Titouan Galopin <galopintitouan@gmail.com> + */ +class AcmeCliActionException extends AcmeCliException +{ + public function __construct($actionName, \Exception $previous = null) + { + parent::__construct(sprintf('An exception was thrown during action "%s"', $actionName), $previous); + } +} diff --git a/php/AcmePhp/Cli/Exception/AcmeCliException.php b/php/AcmePhp/Cli/Exception/AcmeCliException.php new file mode 100644 index 000000000..b5f4c0c7d --- /dev/null +++ b/php/AcmePhp/Cli/Exception/AcmeCliException.php @@ -0,0 +1,23 @@ +<?php + +/* + * This file is part of the Acme PHP project. + * + * (c) Titouan Galopin <galopintitouan@gmail.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace AcmePhp\Cli\Exception; + +/** + * @author Titouan Galopin <galopintitouan@gmail.com> + */ +class AcmeCliException extends \RuntimeException +{ + public function __construct($message, \Exception $previous = null) + { + parent::__construct($message, 0, $previous); + } +} diff --git a/php/AcmePhp/Cli/Exception/AcmeDnsResolutionException.php b/php/AcmePhp/Cli/Exception/AcmeDnsResolutionException.php new file mode 100644 index 000000000..a1137999b --- /dev/null +++ b/php/AcmePhp/Cli/Exception/AcmeDnsResolutionException.php @@ -0,0 +1,23 @@ +<?php + +/* + * This file is part of the Acme PHP project. + * + * (c) Titouan Galopin <galopintitouan@gmail.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace AcmePhp\Cli\Exception; + +/** + * @author Jérémy Derussé <jeremy@derusse.com> + */ +class AcmeDnsResolutionException extends AcmeCliException +{ + public function __construct($message, \Exception $previous = null) + { + parent::__construct(null === $message ? 'An exception was thrown during resolution of DNS' : $message, $previous); + } +} diff --git a/php/AcmePhp/Cli/Exception/CommandFlowException.php b/php/AcmePhp/Cli/Exception/CommandFlowException.php new file mode 100644 index 000000000..f03b5b295 --- /dev/null +++ b/php/AcmePhp/Cli/Exception/CommandFlowException.php @@ -0,0 +1,55 @@ +<?php + +/* + * This file is part of the Acme PHP project. + * + * (c) Titouan Galopin <galopintitouan@gmail.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace AcmePhp\Cli\Exception; + +/** + * @author Jérémy Derussé <jeremy@derusse.com> + */ +class CommandFlowException extends AcmeCliException +{ + /** + * @var string + */ + private $missing; + /** + * @var string + */ + private $command; + /** + * @var array + */ + private $arguments; + + /** + * @param string $missing Missing requirement to fix the flow + * @param string $command Name of the command to run in order to fix the flow + * @param array $arguments Optional list of missing arguments + * @param \Exception|null $previous + */ + public function __construct($missing, $command, array $arguments = [], \Exception $previous = null) + { + $this->missing = $missing; + $this->command = $command; + $this->arguments = $arguments; + + $message = trim(sprintf( + 'You have to %s first. Run the command%sphp %s %s %s', + $missing, + PHP_EOL.PHP_EOL, + $_SERVER['PHP_SELF'], + $command, + implode(' ', $arguments) + )); + + parent::__construct($message, $previous); + } +} diff --git a/php/AcmePhp/Cli/Repository/Repository.php b/php/AcmePhp/Cli/Repository/Repository.php new file mode 100644 index 000000000..29a54c189 --- /dev/null +++ b/php/AcmePhp/Cli/Repository/Repository.php @@ -0,0 +1,439 @@ +<?php + +/* + * This file is part of the Acme PHP project. + * + * (c) Titouan Galopin <galopintitouan@gmail.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace AcmePhp\Cli\Repository; + +use AcmePhp\Cli\Exception\AcmeCliException; +use AcmePhp\Cli\Serializer\PemEncoder; +use AcmePhp\Core\Protocol\AuthorizationChallenge; +use AcmePhp\Core\Protocol\CertificateOrder; +use AcmePhp\Ssl\Certificate; +use AcmePhp\Ssl\CertificateResponse; +use AcmePhp\Ssl\DistinguishedName; +use AcmePhp\Ssl\KeyPair; +use AcmePhp\Ssl\PrivateKey; +use AcmePhp\Ssl\PublicKey; +use League\Flysystem\FilesystemInterface; +use Symfony\Component\Serializer\Encoder\JsonEncoder; +use Symfony\Component\Serializer\SerializerInterface; + +/** + * @author Titouan Galopin <galopintitouan@gmail.com> + */ +class Repository implements RepositoryV2Interface +{ + const PATH_ACCOUNT_KEY_PRIVATE = 'account/key.private.pem'; + const PATH_ACCOUNT_KEY_PUBLIC = 'account/key.public.pem'; + + const PATH_DOMAIN_KEY_PUBLIC = 'certs/{domain}/private/key.public.pem'; + const PATH_DOMAIN_KEY_PRIVATE = 'certs/{domain}/private/key.private.pem'; + const PATH_DOMAIN_CERT_CERT = 'certs/{domain}/public/cert.pem'; + const PATH_DOMAIN_CERT_CHAIN = 'certs/{domain}/public/chain.pem'; + const PATH_DOMAIN_CERT_FULLCHAIN = 'certs/{domain}/public/fullchain.pem'; + const PATH_DOMAIN_CERT_COMBINED = 'certs/{domain}/private/combined.pem'; + + const PATH_CACHE_AUTHORIZATION_CHALLENGE = 'var/{domain}/authorization_challenge.json'; + const PATH_CACHE_DISTINGUISHED_NAME = 'var/{domain}/distinguished_name.json'; + const PATH_CACHE_CERTIFICATE_ORDER = 'var/{domains}/certificate_order.json'; + + /** + * @var SerializerInterface + */ + private $serializer; + + /** + * @var FilesystemInterface + */ + private $master; + + /** + * @var FilesystemInterface + */ + private $backup; + + /** + * @var bool + */ + private $enableBackup; + + /** + * @param SerializerInterface $serializer + * @param FilesystemInterface $master + * @param FilesystemInterface $backup + * @param bool $enableBackup + */ + public function __construct(SerializerInterface $serializer, FilesystemInterface $master, FilesystemInterface $backup, $enableBackup) + { + $this->serializer = $serializer; + $this->master = $master; + $this->backup = $backup; + $this->enableBackup = $enableBackup; + } + + /** + * {@inheritdoc} + */ + public function storeCertificateResponse(CertificateResponse $certificateResponse) + { + $distinguishedName = $certificateResponse->getCertificateRequest()->getDistinguishedName(); + $domain = $distinguishedName->getCommonName(); + + $this->storeDomainKeyPair($domain, $certificateResponse->getCertificateRequest()->getKeyPair()); + $this->storeDomainDistinguishedName($domain, $distinguishedName); + $this->storeDomainCertificate($domain, $certificateResponse->getCertificate()); + } + + /** + * {@inheritdoc} + */ + public function storeAccountKeyPair(KeyPair $keyPair) + { + try { + $this->save( + self::PATH_ACCOUNT_KEY_PUBLIC, + $this->serializer->serialize($keyPair->getPublicKey(), PemEncoder::FORMAT) + ); + + $this->save( + self::PATH_ACCOUNT_KEY_PRIVATE, + $this->serializer->serialize($keyPair->getPrivateKey(), PemEncoder::FORMAT) + ); + } catch (\Exception $e) { + throw new AcmeCliException('Storing of account key pair failed', $e); + } + } + + private function getPathForDomain($path, $domain) + { + return strtr($path, ['{domain}' => $this->normalizeDomain($domain)]); + } + + private function getPathForDomainList($path, array $domains) + { + return strtr($path, ['{domains}' => $this->normalizeDomainList($domains)]); + } + + /** + * {@inheritdoc} + */ + public function hasAccountKeyPair() + { + return $this->master->has(self::PATH_ACCOUNT_KEY_PRIVATE); + } + + /** + * {@inheritdoc} + */ + public function loadAccountKeyPair() + { + try { + $publicKeyPem = $this->master->read(self::PATH_ACCOUNT_KEY_PUBLIC); + $privateKeyPem = $this->master->read(self::PATH_ACCOUNT_KEY_PRIVATE); + + return new KeyPair( + $this->serializer->deserialize($publicKeyPem, PublicKey::class, PemEncoder::FORMAT), + $this->serializer->deserialize($privateKeyPem, PrivateKey::class, PemEncoder::FORMAT) + ); + } catch (\Exception $e) { + throw new AcmeCliException('Loading of account key pair failed', $e); + } + } + + /** + * {@inheritdoc} + */ + public function storeDomainKeyPair($domain, KeyPair $keyPair) + { + try { + $this->save( + $this->getPathForDomain(self::PATH_DOMAIN_KEY_PUBLIC, $domain), + $this->serializer->serialize($keyPair->getPublicKey(), PemEncoder::FORMAT) + ); + + $this->save( + $this->getPathForDomain(self::PATH_DOMAIN_KEY_PRIVATE, $domain), + $this->serializer->serialize($keyPair->getPrivateKey(), PemEncoder::FORMAT) + ); + } catch (\Exception $e) { + throw new AcmeCliException(sprintf('Storing of domain %s key pair failed', $domain), $e); + } + } + + /** + * {@inheritdoc} + */ + public function hasDomainKeyPair($domain) + { + return $this->master->has($this->getPathForDomain(self::PATH_DOMAIN_KEY_PRIVATE, $domain)); + } + + /** + * {@inheritdoc} + */ + public function loadDomainKeyPair($domain) + { + try { + $publicKeyPem = $this->master->read($this->getPathForDomain(self::PATH_DOMAIN_KEY_PUBLIC, $domain)); + $privateKeyPem = $this->master->read($this->getPathForDomain(self::PATH_DOMAIN_KEY_PRIVATE, $domain)); + + return new KeyPair( + $this->serializer->deserialize($publicKeyPem, PublicKey::class, PemEncoder::FORMAT), + $this->serializer->deserialize($privateKeyPem, PrivateKey::class, PemEncoder::FORMAT) + ); + } catch (\Exception $e) { + throw new AcmeCliException(sprintf('Loading of domain %s key pair failed', $domain), $e); + } + } + + /** + * {@inheritdoc} + */ + public function storeDomainAuthorizationChallenge($domain, AuthorizationChallenge $authorizationChallenge) + { + try { + $this->save( + $this->getPathForDomain(self::PATH_CACHE_AUTHORIZATION_CHALLENGE, $domain), + $this->serializer->serialize($authorizationChallenge, JsonEncoder::FORMAT) + ); + } catch (\Exception $e) { + throw new AcmeCliException(sprintf('Storing of domain %s authorization challenge failed', $domain), $e); + } + } + + /** + * {@inheritdoc} + */ + public function hasDomainAuthorizationChallenge($domain) + { + return $this->master->has($this->getPathForDomain(self::PATH_CACHE_AUTHORIZATION_CHALLENGE, $domain)); + } + + /** + * {@inheritdoc} + */ + public function loadDomainAuthorizationChallenge($domain) + { + try { + $json = $this->master->read($this->getPathForDomain(self::PATH_CACHE_AUTHORIZATION_CHALLENGE, $domain)); + + return $this->serializer->deserialize($json, AuthorizationChallenge::class, JsonEncoder::FORMAT); + } catch (\Exception $e) { + throw new AcmeCliException(sprintf('Loading of domain %s authorization challenge failed', $domain), $e); + } + } + + /** + * {@inheritdoc} + */ + public function storeDomainDistinguishedName($domain, DistinguishedName $distinguishedName) + { + try { + $this->save( + $this->getPathForDomain(self::PATH_CACHE_DISTINGUISHED_NAME, $domain), + $this->serializer->serialize($distinguishedName, JsonEncoder::FORMAT) + ); + } catch (\Exception $e) { + throw new AcmeCliException(sprintf('Storing of domain %s distinguished name failed', $domain), $e); + } + } + + /** + * {@inheritdoc} + */ + public function hasDomainDistinguishedName($domain) + { + return $this->master->has($this->getPathForDomain(self::PATH_CACHE_DISTINGUISHED_NAME, $domain)); + } + + /** + * {@inheritdoc} + */ + public function loadDomainDistinguishedName($domain) + { + try { + $json = $this->master->read($this->getPathForDomain(self::PATH_CACHE_DISTINGUISHED_NAME, $domain)); + + return $this->serializer->deserialize($json, DistinguishedName::class, JsonEncoder::FORMAT); + } catch (\Exception $e) { + throw new AcmeCliException(sprintf('Loading of domain %s distinguished name failed', $domain), $e); + } + } + + /** + * {@inheritdoc} + */ + public function storeDomainCertificate($domain, Certificate $certificate) + { + // Simple certificate + $certPem = $this->serializer->serialize($certificate, PemEncoder::FORMAT); + + // Issuer chain + $issuerChain = []; + $issuerCertificate = $certificate->getIssuerCertificate(); + + while (null !== $issuerCertificate) { + $issuerChain[] = $this->serializer->serialize($issuerCertificate, PemEncoder::FORMAT); + $issuerCertificate = $issuerCertificate->getIssuerCertificate(); + } + + $chainPem = implode("\n", $issuerChain); + + // Full chain + $fullChainPem = $certPem.$chainPem; + + // Combined + $keyPair = $this->loadDomainKeyPair($domain); + $combinedPem = $fullChainPem.$this->serializer->serialize($keyPair->getPrivateKey(), PemEncoder::FORMAT); + + // Save + $this->save($this->getPathForDomain(self::PATH_DOMAIN_CERT_CERT, $domain), $certPem); + $this->save($this->getPathForDomain(self::PATH_DOMAIN_CERT_CHAIN, $domain), $chainPem); + $this->save($this->getPathForDomain(self::PATH_DOMAIN_CERT_FULLCHAIN, $domain), $fullChainPem); + $this->save($this->getPathForDomain(self::PATH_DOMAIN_CERT_COMBINED, $domain), $combinedPem); + } + + /** + * {@inheritdoc} + */ + public function hasDomainCertificate($domain) + { + return $this->master->has($this->getPathForDomain(self::PATH_DOMAIN_CERT_FULLCHAIN, $domain)); + } + + /** + * {@inheritdoc} + */ + public function loadDomainCertificate($domain) + { + try { + $pems = explode('-----BEGIN CERTIFICATE-----', $this->master->read($this->getPathForDomain(self::PATH_DOMAIN_CERT_FULLCHAIN, $domain))); + } catch (\Exception $e) { + throw new AcmeCliException(sprintf('Loading of domain %s certificate failed', $domain), $e); + } + + $pems = array_map(function ($item) { + return trim(str_replace('-----END CERTIFICATE-----', '', $item)); + }, $pems); + array_shift($pems); + $pems = array_reverse($pems); + + $certificate = null; + + foreach ($pems as $pem) { + $certificate = new Certificate( + "-----BEGIN CERTIFICATE-----\n".$pem."\n-----END CERTIFICATE-----", + $certificate + ); + } + + return $certificate; + } + + /** + * {@inheritdoc} + */ + public function storeCertificateOrder(array $domains, CertificateOrder $order) + { + try { + $this->save( + $this->getPathForDomainList(self::PATH_CACHE_CERTIFICATE_ORDER, $domains), + $this->serializer->serialize($order, JsonEncoder::FORMAT) + ); + } catch (\Exception $e) { + throw new AcmeCliException(sprintf('Storing of domains %s certificate order failed', implode(', ', $domains)), $e); + } + } + + /** + * {@inheritdoc} + */ + public function hasCertificateOrder(array $domains) + { + return $this->master->has($this->getPathForDomainList(self::PATH_CACHE_CERTIFICATE_ORDER, $domains)); + } + + /** + * {@inheritdoc} + */ + public function loadCertificateOrder(array $domains) + { + try { + $json = $this->master->read($this->getPathForDomainList(self::PATH_CACHE_CERTIFICATE_ORDER, $domains)); + + return $this->serializer->deserialize($json, CertificateOrder::class, JsonEncoder::FORMAT); + } catch (\Exception $e) { + throw new AcmeCliException(sprintf('Loading of domains %s certificate order failed', implode(', ', $domains)), $e); + } + } + + /** + * {@inheritdoc} + */ + public function save($path, $content, $visibility = self::VISIBILITY_PRIVATE) + { + if (!$this->master->has($path)) { + // File creation: remove from backup if it existed and warm-up both master and backup + $this->createAndBackup($path, $content); + } else { + // File update: backup before writing + $this->backupAndUpdate($path, $content); + } + + if ($this->enableBackup) { + $this->backup->setVisibility($path, $visibility); + } + + $this->master->setVisibility($path, $visibility); + } + + private function createAndBackup($path, $content) + { + if ($this->enableBackup) { + if ($this->backup->has($path)) { + $this->backup->delete($path); + } + + $this->backup->write($path, $content); + } + + $this->master->write($path, $content); + } + + private function backupAndUpdate($path, $content) + { + if ($this->enableBackup) { + $oldContent = $this->master->read($path); + + if (false !== $oldContent) { + if ($this->backup->has($path)) { + $this->backup->update($path, $oldContent); + } else { + $this->backup->write($path, $oldContent); + } + } + } + + $this->master->update($path, $content); + } + + private function normalizeDomain($domain) + { + return $domain; + } + + private function normalizeDomainList(array $domains) + { + $normalizedDomains = array_unique(array_map([$this, 'normalizeDomain'], $domains)); + sort($normalizedDomains); + + return (isset($domains[0]) ? $this->normalizeDomain($domains[0]) : '-').'/'.sha1(json_encode($normalizedDomains)); + } +} diff --git a/php/AcmePhp/Cli/Repository/RepositoryInterface.php b/php/AcmePhp/Cli/Repository/RepositoryInterface.php new file mode 100644 index 000000000..f42c5277c --- /dev/null +++ b/php/AcmePhp/Cli/Repository/RepositoryInterface.php @@ -0,0 +1,198 @@ +<?php + +/* + * This file is part of the Acme PHP project. + * + * (c) Titouan Galopin <galopintitouan@gmail.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace AcmePhp\Cli\Repository; + +use AcmePhp\Cli\Exception\AcmeCliException; +use AcmePhp\Core\Protocol\AuthorizationChallenge; +use AcmePhp\Ssl\Certificate; +use AcmePhp\Ssl\CertificateResponse; +use AcmePhp\Ssl\DistinguishedName; +use AcmePhp\Ssl\KeyPair; + +/** + * @author Titouan Galopin <galopintitouan@gmail.com> + */ +interface RepositoryInterface +{ + const VISIBILITY_PUBLIC = 'public'; + const VISIBILITY_PRIVATE = 'private'; + + /** + * Extract important elements from the given certificate response and store them + * in the repository. + * + * This method will use the distinguished name common name as a domain to store: + * - the key pair + * - the certificate request + * - the certificate + * + * @param CertificateResponse $certificateResponse + * + * @throws AcmeCliException + */ + public function storeCertificateResponse(CertificateResponse $certificateResponse); + + /** + * Store a given key pair as the account key pair (the global key pair used to + * interact with the ACME server). + * + * @param KeyPair $keyPair + * + * @throws AcmeCliException + */ + public function storeAccountKeyPair(KeyPair $keyPair); + + /** + * Check if there is an account key pair in the repository. + * + * @return bool + */ + public function hasAccountKeyPair(); + + /** + * Load the account key pair. + * + * @throws AcmeCliException + * + * @return KeyPair + */ + public function loadAccountKeyPair(); + + /** + * Store a given key pair as associated to a given domain. + * + * @param string $domain + * @param KeyPair $keyPair + * + * @throws AcmeCliException + */ + public function storeDomainKeyPair($domain, KeyPair $keyPair); + + /** + * Check if there is a key pair associated to the given domain in the repository. + * + * @param string $domain + * + * @return bool + */ + public function hasDomainKeyPair($domain); + + /** + * Load the key pair associated to a given domain. + * + * @param string $domain + * + * @throws AcmeCliException + * + * @return KeyPair + */ + public function loadDomainKeyPair($domain); + + /** + * Store a given authorization challenge as associated to a given domain. + * + * @param string $domain + * @param AuthorizationChallenge $authorizationChallenge + * + * @throws AcmeCliException + */ + public function storeDomainAuthorizationChallenge($domain, AuthorizationChallenge $authorizationChallenge); + + /** + * Check if there is an authorization challenge associated to the given domain in the repository. + * + * @param string $domain + * + * @return bool + */ + public function hasDomainAuthorizationChallenge($domain); + + /** + * Load the authorization challenge associated to a given domain. + * + * @param string $domain + * + * @throws AcmeCliException + * + * @return AuthorizationChallenge + */ + public function loadDomainAuthorizationChallenge($domain); + + /** + * Store a given distinguished name as associated to a given domain. + * + * @param string $domain + * @param DistinguishedName $distinguishedName + * + * @throws AcmeCliException + */ + public function storeDomainDistinguishedName($domain, DistinguishedName $distinguishedName); + + /** + * Check if there is a distinguished name associated to the given domain in the repository. + * + * @param string $domain + * + * @return bool + */ + public function hasDomainDistinguishedName($domain); + + /** + * Load the distinguished name associated to a given domain. + * + * @param string $domain + * + * @throws AcmeCliException + * + * @return DistinguishedName + */ + public function loadDomainDistinguishedName($domain); + + /** + * Store a given certificate as associated to a given domain. + * + * @param string $domain + * @param Certificate $certificate + * + * @throws AcmeCliException + */ + public function storeDomainCertificate($domain, Certificate $certificate); + + /** + * Check if there is a certificate associated to the given domain in the repository. + * + * @param string $domain + * + * @return bool + */ + public function hasDomainCertificate($domain); + + /** + * Load the certificate associated to a given domain. + * + * @param string $domain + * + * @throws AcmeCliException + * + * @return Certificate + */ + public function loadDomainCertificate($domain); + + /** + * Save a given string into a given path handling backup. + * + * @param string $path + * @param string $content + * @param string $visibility the visibilty to use for this file + */ + public function save($path, $content, $visibility = self::VISIBILITY_PRIVATE); +} diff --git a/php/AcmePhp/Cli/Repository/RepositoryV2Interface.php b/php/AcmePhp/Cli/Repository/RepositoryV2Interface.php new file mode 100644 index 000000000..f3b67e032 --- /dev/null +++ b/php/AcmePhp/Cli/Repository/RepositoryV2Interface.php @@ -0,0 +1,51 @@ +<?php + +/* + * This file is part of the Acme PHP project. + * + * (c) Titouan Galopin <galopintitouan@gmail.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace AcmePhp\Cli\Repository; + +use AcmePhp\Cli\Exception\AcmeCliException; +use AcmePhp\Core\Protocol\CertificateOrder; + +/** + * @author Titouan Galopin <galopintitouan@gmail.com> + */ +interface RepositoryV2Interface extends RepositoryInterface +{ + /** + * Store a given certificate as associated to a given domain. + * + * @param array $domains + * @param CertificateOrder $order + * + * @throws AcmeCliException + */ + public function storeCertificateOrder(array $domains, CertificateOrder $order); + + /** + * Check if there is a certificate associated to the given domain in the repository. + * + * @param string $domain + * + * @return bool + */ + public function hasCertificateOrder(array $domains); + + /** + * Load the certificate associated to a given domain. + * + * @param string $domain + * + * @throws AcmeCliException + * + * @return CertificateOrder + */ + public function loadCertificateOrder(array $domains); +} diff --git a/php/AcmePhp/Cli/Serializer/PemEncoder.php b/php/AcmePhp/Cli/Serializer/PemEncoder.php new file mode 100644 index 000000000..01d3a15dd --- /dev/null +++ b/php/AcmePhp/Cli/Serializer/PemEncoder.php @@ -0,0 +1,55 @@ +<?php + +/* + * This file is part of the Acme PHP project. + * + * (c) Titouan Galopin <galopintitouan@gmail.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace AcmePhp\Cli\Serializer; + +use Symfony\Component\Serializer\Encoder\DecoderInterface; +use Symfony\Component\Serializer\Encoder\EncoderInterface; + +/** + * @author Titouan Galopin <galopintitouan@gmail.com> + */ +class PemEncoder implements EncoderInterface, DecoderInterface +{ + const FORMAT = 'pem'; + + /** + * {@inheritdoc} + */ + public function encode($data, $format, array $context = []) + { + return trim($data)."\n"; + } + + /** + * {@inheritdoc} + */ + public function decode($data, $format, array $context = []) + { + return trim($data)."\n"; + } + + /** + * {@inheritdoc} + */ + public function supportsEncoding($format) + { + return self::FORMAT === $format; + } + + /** + * {@inheritdoc} + */ + public function supportsDecoding($format) + { + return self::FORMAT === $format; + } +} diff --git a/php/AcmePhp/Cli/Serializer/PemNormalizer.php b/php/AcmePhp/Cli/Serializer/PemNormalizer.php new file mode 100644 index 000000000..564f1b937 --- /dev/null +++ b/php/AcmePhp/Cli/Serializer/PemNormalizer.php @@ -0,0 +1,55 @@ +<?php + +/* + * This file is part of the Acme PHP project. + * + * (c) Titouan Galopin <galopintitouan@gmail.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace AcmePhp\Cli\Serializer; + +use AcmePhp\Ssl\Certificate; +use AcmePhp\Ssl\Key; +use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; +use Symfony\Component\Serializer\Normalizer\NormalizerInterface; + +/** + * @author Titouan Galopin <galopintitouan@gmail.com> + */ +class PemNormalizer implements NormalizerInterface, DenormalizerInterface +{ + /** + * {@inheritdoc} + */ + public function normalize($object, $format = null, array $context = []) + { + return $object->getPEM(); + } + + /** + * {@inheritdoc} + */ + public function denormalize($data, $class, $format = null, array $context = []) + { + return new $class($data); + } + + /** + * {@inheritdoc} + */ + public function supportsNormalization($data, $format = null) + { + return is_object($data) && ($data instanceof Certificate || $data instanceof Key); + } + + /** + * {@inheritdoc} + */ + public function supportsDenormalization($data, $type, $format = null) + { + return is_string($data); + } +} From d516c72664a786ad730c5da3d2df20a170d942dc Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 26 Jul 2018 20:43:14 +0530 Subject: [PATCH 0289/1044] Add Site_Letsencrypt class in core Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/class-ee-site-letsencrypt.php | 537 ++++++++++++++++++++++++++++++ 1 file changed, 537 insertions(+) create mode 100644 php/class-ee-site-letsencrypt.php diff --git a/php/class-ee-site-letsencrypt.php b/php/class-ee-site-letsencrypt.php new file mode 100644 index 000000000..21dc89099 --- /dev/null +++ b/php/class-ee-site-letsencrypt.php @@ -0,0 +1,537 @@ +<?php + +use AcmePhp\Cli\Repository\Repository; +use AcmePhp\Cli\Serializer\PemEncoder; +use AcmePhp\Cli\Serializer\PemNormalizer; +use AcmePhp\Core\AcmeClient; +use AcmePhp\Core\Challenge\ChainValidator; +use AcmePhp\Core\Challenge\WaitingValidator; +use AcmePhp\Core\Challenge\Http\SimpleHttpSolver; +use AcmePhp\Core\Challenge\Http\HttpValidator; +use AcmePhp\Core\Challenge\Dns\SimpleDnsSolver; +use AcmePhp\Core\Challenge\Dns\DnsValidator; +use AcmePhp\Core\Exception\Protocol\ChallengeNotSupportedException; +use AcmePhp\Core\Http\SecureHttpClient; +use AcmePhp\Core\Http\Base64SafeEncoder; +use AcmePhp\Core\Http\ServerErrorHandler; +use AcmePhp\Ssl\Certificate; +use AcmePhp\Ssl\CertificateRequest; +use AcmePhp\Ssl\CertificateResponse; +use AcmePhp\Ssl\DistinguishedName; +use AcmePhp\Ssl\Parser\KeyParser; +use AcmePhp\Ssl\Parser\CertificateParser; +use AcmePhp\Ssl\Generator\KeyPairGenerator; +use AcmePhp\Ssl\Signer\CertificateRequestSigner; +use AcmePhp\Ssl\Signer\DataSigner; +use Symfony\Component\Console\Helper\Table; +use Symfony\Component\Console\Output\ConsoleOutput; +use Symfony\Component\Serializer\Encoder\JsonEncoder; +use Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer; +use Symfony\Component\Serializer\Serializer; +use League\Flysystem\Filesystem; +use League\Flysystem\Adapter\Local; +use League\Flysystem\Adapter\NullAdapter; +use GuzzleHttp\Client; + + +class Site_Letsencrypt { + + private $accountKeyPair; + private $httpClient; + private $base64SafeEncoder; + private $keyParser; + private $dataSigner; + private $serverErrorHandler; + private $serializer; + private $master; + private $backup; + private $client; + private $repository; + private $conf_dir; + + function __construct() { + $this->conf_dir = EE_CONF_ROOT . '/acme-conf'; + $this->setRepository(); + $this->setAcmeClient(); + } + + private function setAcmeClient() { + + if ( ! $this->repository->hasAccountKeyPair() ) { + EE::debug( 'No account key pair was found, generating one.' ); + EE::debug( 'Generating a key pair' ); + + $keygen = new KeyPairGenerator(); + $accountKeyPair = $keygen->generateKeyPair(); + EE::debug( 'Key pair generated, storing' ); + $this->repository->storeAccountKeyPair( $accountKeyPair ); + } else { + EE::debug( 'Loading account keypair' ); + $accountKeyPair = $this->repository->loadAccountKeyPair(); + } + + $this->accountKeyPair ?? $this->accountKeyPair = $accountKeyPair; + + $secureHttpClient = $this->getSecureHttpClient(); + $csrSigner = new CertificateRequestSigner(); + + $this->client = new AcmeClient( $secureHttpClient, 'https://acme-v02.api.letsencrypt.org/directory', $csrSigner ); + + } + + private function setRepository( $enable_backup = false ) { + $this->serializer ?? $this->serializer = new Serializer( + [ new PemNormalizer(), new GetSetMethodNormalizer() ], + [ new PemEncoder(), new JsonEncoder() ] + ); + $this->master ?? $this->master = new Filesystem( new Local( $this->conf_dir ) ); + $this->backup ?? $this->backup = new Filesystem( new NullAdapter() ); + + $this->repository = new Repository( $this->serializer, $this->master, $this->backup, $enable_backup ); + } + + private function getSecureHttpClient() { + $this->httpClient ?? $this->httpClient = new Client(); + $this->base64SafeEncoder ?? $this->base64SafeEncoder = new Base64SafeEncoder(); + $this->keyParser ?? $this->keyParser = new KeyParser(); + $this->dataSigner ?? $this->dataSigner = new DataSigner(); + $this->serverErrorHandler ?? $this->serverErrorHandler = new ServerErrorHandler(); + + return new SecureHttpClient( + $this->accountKeyPair, + $this->httpClient, + $this->base64SafeEncoder, + $this->keyParser, + $this->dataSigner, + $this->serverErrorHandler + ); + } + + + public function register( $email ) { + try { + $this->client->registerAccount( null, $email ); + } + catch ( Exception $e ) { + EE::warning( $e->getMessage() ); + EE::warning( 'It seems you\'re in local environment or there is some issue with network, please check logs. Skipping letsencrypt.' ); + + return false; + } + EE::debug( "Account with email id: $email registered successfully!" ); + return true; + } + + public function authorize( Array $domains, $site_root, $wildcard = false ) { + $solver = $wildcard ? new SimpleDnsSolver( null, new ConsoleOutput() ) : new SimpleHttpSolver(); + $solverName = $wildcard ? 'dns-01' : 'http-01'; + try { + $order = $this->client->requestOrder( $domains ); + } + catch ( Exception $e ) { + EE::warning( $e->getMessage() ); + EE::warning( 'It seems you\'re in local environment or using non-public domain, please check logs. Skipping letsencrypt.' ); + + return false; + } + + $authorizationChallengesToSolve = []; + foreach ( $order->getAuthorizationsChallenges() as $domainKey => $authorizationChallenges ) { + $authorizationChallenge = null; + foreach ( $authorizationChallenges as $candidate ) { + if ( $solver->supports( $candidate ) ) { + $authorizationChallenge = $candidate; + EE::debug( 'Authorization challenge supported by solver. Solver: ' . $solverName . ' Challenge: ' . $candidate->getType() ); + break; + } + // Should not get here as we are handling it. + EE::debug( 'Authorization challenge not supported by solver. Solver: ' . $solverName . ' Challenge: ' . $candidate->getType() ); + } + if ( null === $authorizationChallenge ) { + throw new ChallengeNotSupportedException(); + } + EE::debug( 'Storing authorization challenge. Domain: ' . $domainKey . ' Challenge: ' . print_r( $authorizationChallenge->toArray(), true ) ); + + $this->repository->storeDomainAuthorizationChallenge( $domainKey, $authorizationChallenge ); + $authorizationChallengesToSolve[] = $authorizationChallenge; + } + + /** @var AuthorizationChallenge $authorizationChallenge */ + foreach ( $authorizationChallengesToSolve as $authorizationChallenge ) { + EE::debug( 'Solving authorization challenge: Domain: ' . $authorizationChallenge->getDomain() . ' Challenge: ' . print_r( $authorizationChallenge->toArray(), true ) ); + $solver->solve( $authorizationChallenge ); + } + + $this->repository->storeCertificateOrder( $domains, $order ); + + if ( ! $wildcard ) { + $token = $authorizationChallenge->toArray()['token']; + $payload = $authorizationChallenge->toArray()['payload']; + EE::launch( "mkdir -p $site_root/app/src/.well-known/acme-challenge/" ); + EE::debug( "Creating challange file $site_root/app/src/.well-known/acme-challenge/$token" ); + file_put_contents( "$site_root/app/src/.well-known/acme-challenge/$token", $payload ); + EE::launch( "chown www-data: $site_root/app/src/.well-known/acme-challenge/$token" ); + } + return true; + } + + public function check( Array $domains, $wildcard = false ) { + EE::debug( 'Starting check with solver ' . $wildcard ? 'dns' : 'http' ); + $solver = $wildcard ? new SimpleDnsSolver( null, new ConsoleOutput() ) : new SimpleHttpSolver(); + $validator = new ChainValidator( + [ + new WaitingValidator( new HttpValidator() ), + new WaitingValidator( new DnsValidator() ) + ] + ); + + $order = null; + if ( $this->repository->hasCertificateOrder( $domains ) ) { + $order = $this->repository->loadCertificateOrder( $domains ); + EE::debug( sprintf( 'Loading the authorization token for domains %s ...', implode( ', ', $domains ) ) ); + } + + $authorizationChallengeToCleanup = []; + foreach ( $domains as $domain ) { + if ( $order ) { + $authorizationChallenge = null; + $authorizationChallenges = $order->getAuthorizationChallenges( $domain ); + foreach ( $authorizationChallenges as $challenge ) { + if ( $solver->supports( $challenge ) ) { + $authorizationChallenge = $challenge; + break; + } + } + if ( null === $authorizationChallenge ) { + throw new ChallengeNotSupportedException(); + } + } else { + if ( ! $this->repository->hasDomainAuthorizationChallenge( $domain ) ) { + EE::error( "Domain: $domain not yet authorized/has not been started of with EasyEngine letsencrypt site creation." ); + } + $authorizationChallenge = $this->repository->loadDomainAuthorizationChallenge( $domain ); + if ( ! $solver->supports( $authorizationChallenge ) ) { + throw new ChallengeNotSupportedException(); + } + } + EE::debug( 'Challenge loaded.' ); + + $authorizationChallenge = $this->client->reloadAuthorization( $authorizationChallenge ); + if ( ! $authorizationChallenge->isValid() ) { + EE::debug( sprintf( 'Testing the challenge for domain %s', $domain ) ); + if ( ! $validator->isValid( $authorizationChallenge ) ) { + EE::warning( sprintf( 'Can not valid challenge for domain %s', $domain ) ); + } + + EE::debug( sprintf( 'Requesting authorization check for domain %s', $domain ) ); + try { + $this->client->challengeAuthorization( $authorizationChallenge ); + } + catch ( Exception $e ) { + EE::debug( $e->getMessage() ); + EE::warning( 'Challange Authorization failed. Check logs and check if your domain is pointed correctly to this server.' ); + $site_name = isset( $domains[1] ) ? $domains[1] : $domains[0]; + EE::log( "Re-run `ee site le $site_name` after fixing the issue." ); + + return false; + } + $authorizationChallengeToCleanup[] = $authorizationChallenge; + } + } + + EE::log( 'The authorization check was successful!' ); + + if ( $solver instanceof MultipleChallengesSolverInterface ) { + $solver->cleanupAll( $authorizationChallengeToCleanup ); + } else { + /** @var AuthorizationChallenge $authorizationChallenge */ + foreach ( $authorizationChallengeToCleanup as $authorizationChallenge ) { + $solver->cleanup( $authorizationChallenge ); + } + } + return true; + } + + public function request( $domain, $altNames = [], $email, $force=false ) { + $alternativeNames = array_unique( $altNames ); + sort( $alternativeNames ); + + // Certificate renewal + if ( $this->hasValidCertificate( $domain, $alternativeNames ) ) { + EE::debug( "Certificate found for $domain, executing renewal" ); + + return $this->executeRenewal( $domain, $alternativeNames, $force ); + } + + EE::debug( "No certificate found, executing first request for $domain" ); + + // Certificate first request + return $this->executeFirstRequest( $domain, $alternativeNames, $email ); + } + + /** + * Request a first certificate for the given domain. + * + * @param string $domain + * @param array $alternativeNames + */ + private function executeFirstRequest( $domain, array $alternativeNames, $email ) { + EE::log( 'Executing first request.' ); + + // Generate domain key pair + $keygen = new KeyPairGenerator(); + $domainKeyPair = $keygen->generateKeyPair(); + $this->repository->storeDomainKeyPair( $domain, $domainKeyPair ); + + EE::debug( "$domain Domain key pair generated and stored" ); + + $distinguishedName = $this->getOrCreateDistinguishedName( $domain, $alternativeNames, $email ); + // TODO: ask them ;) + EE::debug( 'Distinguished name informations have been stored locally for this domain (they won\'t be asked on renewal).' ); + + // Order + $domains = array_merge( [ $domain ], $alternativeNames ); + EE::debug( sprintf( 'Loading the order related to the domains %s .', implode( ', ', $domains ) ) ); + if ( ! $this->repository->hasCertificateOrder( $domains ) ) { + EE::error( "$domain has not yet been authorized." ); + } + $order = $this->repository->loadCertificateOrder( $domains ); + + // Request + EE::log( sprintf( 'Requesting first certificate for domain %s.', $domain ) ); + $csr = new CertificateRequest( $distinguishedName, $domainKeyPair ); + $response = $this->client->finalizeOrder( $order, $csr ); + EE::log( 'Certificate received' ); + + // Store + $this->repository->storeDomainCertificate( $domain, $response->getCertificate() ); + EE::log( 'Certificate stored' ); + + // Post-generate actions + $this->moveCertsToNginxProxy( $response ); + } + + private function moveCertsToNginxProxy( CertificateResponse $response ) { + $domain = $response->getCertificateRequest()->getDistinguishedName()->getCommonName(); + $privateKey = $response->getCertificateRequest()->getKeyPair()->getPrivateKey(); + $certificate = $response->getCertificate(); + + // To handle wildcard certs + $domain = ltrim( $domain, '*.' ); + + file_put_contents( EE_CONF_ROOT . '/nginx/certs/' . $domain . '.key', $privateKey->getPEM() ); + + // Issuer chain + $issuerChain = array_map( + function ( Certificate $certificate ) { + return $certificate->getPEM(); + }, $certificate->getIssuerChain() + ); + + // Full chain + $fullChainPem = $certificate->getPEM() . "\n" . implode( "\n", $issuerChain ); + + file_put_contents( EE_CONF_ROOT . '/nginx/certs/' . $domain . '.crt', $fullChainPem ); + } + + /** + * Renew a given domain certificate. + * + * @param string $domain + * @param array $alternativeNames + * @param bool $force + */ + private function executeRenewal( $domain, array $alternativeNames, $force = false ) { + try { + // Check expiration date to avoid too much renewal + EE::log( "Loading current certificate for $domain" ); + + $certificate = $this->repository->loadDomainCertificate( $domain ); + + if ( ! $force ) { + $certificateParser = new CertificateParser(); + $parsedCertificate = $certificateParser->parse( $certificate ); + + if ( $parsedCertificate->getValidTo()->format( 'U' ) - time() >= 604800 ) { + + EE::log( + sprintf( + 'Current certificate is valid until %s, renewal is not necessary.', + $parsedCertificate->getValidTo()->format( 'Y-m-d H:i:s' ) + ) + ); + + return; + } + + EE::log( + sprintf( + 'Current certificate will expire in less than a week (%s), renewal is required.', + $parsedCertificate->getValidTo()->format( 'Y-m-d H:i:s' ) + ) + ); + } else { + EE::log( 'Forced renewal.' ); + } + + // Key pair + EE::debug( 'Loading domain key pair...' ); + $domainKeyPair = $this->repository->loadDomainKeyPair( $domain ); + + // Distinguished name + EE::debug( 'Loading domain distinguished name...' ); + $distinguishedName = $this->getOrCreateDistinguishedName( $domain, $alternativeNames ); + + // Order + $domains = array_merge( [ $domain ], $alternativeNames ); + EE::debug( sprintf( 'Loading the order related to the domains %s.', implode( ', ', $domains ) ) ); + if ( ! $this->repository->hasCertificateOrder( $domains ) ) { + EE::error( "$domain has not yet been authorized." ); + } + $order = $this->repository->loadCertificateOrder( $domains ); + + // Renewal + EE::log( sprintf( 'Renewing certificate for domain %s.', $domain ) ); + $csr = new CertificateRequest( $distinguishedName, $domainKeyPair ); + $response = $this->client->finalizeOrder( $order, $csr ); + EE::log( 'Certificate received' ); + + $this->repository->storeDomainCertificate( $domain, $response->getCertificate() ); + $this->log( 'Certificate stored' ); + + // Post-generate actions + $this->moveCertsToNginxProxy( $response ); + EE::log( 'Certificate renewed successfully!' ); + + } + catch ( \Exception $e ) { + EE::warning( 'A critical error occured during certificate renewal' ); + EE::debug( print_r( $e, true ) ); + + throw $e; + } + catch ( \Throwable $e ) { + EE::warning( 'A critical error occured during certificate renewal' ); + EE::debug( print_r( $e, true ) ); + + throw $e; + } + } + + private function hasValidCertificate( $domain, array $alternativeNames ) { + if ( ! $this->repository->hasDomainCertificate( $domain ) ) { + return false; + } + + if ( ! $this->repository->hasDomainKeyPair( $domain ) ) { + return false; + } + + if ( ! $this->repository->hasDomainDistinguishedName( $domain ) ) { + return false; + } + + if ( $this->repository->loadDomainDistinguishedName( $domain )->getSubjectAlternativeNames() !== $alternativeNames ) { + return false; + } + + return true; + } + + /** + * Retrieve the stored distinguishedName or create a new one if needed. + * + * @param string $domain + * @param array $alternativeNames + * + * @return DistinguishedName + */ + private function getOrCreateDistinguishedName( $domain, array $alternativeNames, $email ) { + if ( $this->repository->hasDomainDistinguishedName( $domain ) ) { + $original = $this->repository->loadDomainDistinguishedName( $domain ); + + $distinguishedName = new DistinguishedName( + $domain, + $original->getCountryName(), + $original->getStateOrProvinceName(), + $original->getLocalityName(), + $original->getOrganizationName(), + $original->getOrganizationalUnitName(), + $original->getEmailAddress(), + $alternativeNames + ); + } else { + // Ask DistinguishedName + $distinguishedName = new DistinguishedName( + $domain, + // TODO: Ask and fill these values properly + 'US', + 'CA', + 'Mountain View', + 'Let\'s Encrypt', + 'Let\'s Encrypt Authority X3', + $email, + $alternativeNames + ); + + } + + $this->repository->storeDomainDistinguishedName( $domain, $distinguishedName ); + + return $distinguishedName; + } + + + public function status() { + $this->master ?? $this->master = new Filesystem( new Local( $this->conf_dir ) ); + + $certificateParser = new CertificateParser(); + + $table = new Table( $output ); + $table->setHeaders( [ 'Domain', 'Issuer', 'Valid from', 'Valid to', 'Needs renewal?' ] ); + + $directories = $this->master->listContents( 'certs' ); + + foreach ( $directories as $directory ) { + if ( 'dir' !== $directory['type'] ) { + continue; + } + + $parsedCertificate = $certificateParser->parse( $this->repository->loadDomainCertificate( $directory['basename'] ) ); + if ( ! $input->getOption( 'all' ) && $parsedCertificate->isExpired() ) { + continue; + } + $domainString = $parsedCertificate->getSubject(); + + $alternativeNames = array_diff( $parsedCertificate->getSubjectAlternativeNames(), [ $parsedCertificate->getSubject() ] ); + if ( count( $alternativeNames ) ) { + sort( $alternativeNames ); + $last = array_pop( $alternativeNames ); + foreach ( $alternativeNames as $alternativeName ) { + $domainString .= "\n ├── " . $alternativeName; + } + $domainString .= "\n └── " . $last; + } + + $table->addRow( + [ + $domainString, + $parsedCertificate->getIssuer(), + $parsedCertificate->getValidFrom()->format( 'Y-m-d H:i:s' ), + $parsedCertificate->getValidTo()->format( 'Y-m-d H:i:s' ), + ( $parsedCertificate->getValidTo()->format( 'U' ) - time() < 604800 ) ? '<comment>Yes</comment>' : 'No', + ] + ); + } + + $table->render(); + } + + public function cleanup( $site_root ) { + $challange_dir = "$site_root/app/src/.well-known"; + if ( file_exists( "$site_root/app/src/.well-known" ) ) { + EE::debug( 'Cleaning up webroot files.' ); + EE\Utils\delete_dir( $challange_dir ); + } + } +} From caff956a64b48b1548807df1e91b170c2bd964ad Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 26 Jul 2018 20:43:51 +0530 Subject: [PATCH 0290/1044] Add loading of Site_Letsencrypt Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Bootstrap/LoadSiteUtilityFunctions.php | 1 + 1 file changed, 1 insertion(+) diff --git a/php/EE/Bootstrap/LoadSiteUtilityFunctions.php b/php/EE/Bootstrap/LoadSiteUtilityFunctions.php index ae63d25af..bb81a14d4 100644 --- a/php/EE/Bootstrap/LoadSiteUtilityFunctions.php +++ b/php/EE/Bootstrap/LoadSiteUtilityFunctions.php @@ -20,6 +20,7 @@ final class LoadSiteUtilityFunctions implements BootstrapStep { */ public function process( BootstrapState $state ) { require_once EE_ROOT . '/php/site-utils.php'; + require_once EE_ROOT . '/php/class-ee-site-letsencrypt.php'; return $state; } From 5267515dbd858e9570207ae74e52347d9d5b80ed Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 26 Jul 2018 20:45:11 +0530 Subject: [PATCH 0291/1044] Update letsencrypt functions for abstract class Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/class-ee-site.php | 72 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 71 insertions(+), 1 deletion(-) diff --git a/php/class-ee-site.php b/php/class-ee-site.php index 8e7b8231c..4c36869fb 100644 --- a/php/class-ee-site.php +++ b/php/class-ee-site.php @@ -304,7 +304,77 @@ private function reload_services( $services ) { \EE\SiteUtils\run_compose_command( 'exec', $reload_command[$service], 'reload', $service ); } } - + + /** + * Runs the acme le registration and authorization. + * + * @param string $site_name Name of the site for ssl. + * @param string $site_root Webroot of the site. + * @param bool $wildcard SSL with wildcard or not. + * + * @ignorecommand + */ + public function init_le( $site_name, $site_root, $wildcard = false ) { + $this->site_name = $site_name; + $this->site_root = $site_root; + $client = new Site_Letsencrypt(); + $this->le_mail = EE::get_runner()->config['le-mail'] ?? EE::input( 'Enter your mail id: ' ); + EE::get_runner()->ensure_present_in_config( 'le-mail', $this->le_mail ); + if ( ! $client->register( $this->le_mail ) ) { + $this->le = false; + + return; + } + + $domains = $wildcard ? [ "*.$this->site_name", $this->site_name ] : [ $this->site_name ]; + if ( ! $client->authorize( $domains, $this->site_root, $wildcard ) ) { + $this->le = false; + + return; + } + if ( $wildcard ) { + echo \cli\Colors::colorize( "%YIMPORTANT:%n Run `ee site le $this->site_name` once the dns changes have propogated to complete the certification generation and installation.", null ); + } else { + $this->le( [], [], $wildcard ); + } + } + + + /** + * Runs the acme le. + * + * ## OPTIONS + * + * <site-name> + * : Name of website. + * + * [--force] + * : Force renewal. + */ + public function le( $args = [], $assoc_args = [], $wildcard = false ) { + if ( ! isset( $this->site_name ) ) { + $this->populate_site_info( $args ); + } + if ( ! isset( $this->le_mail ) ) { + $this->le_mail = EE::get_config( 'le-mail' ) ?? EE::input( 'Enter your mail id: ' ); + } + $force = \EE\Utils\get_flag_value( $assoc_args, 'force' ); + $domains = $wildcard ? [ "*.$this->site_name", $this->site_name ] : [ $this->site_name ]; + $client = new Site_Letsencrypt(); + if ( ! $client->check( $domains, $wildcard ) ) { + $this->le = false; + + return; + } + if ( $wildcard ) { + $client->request( "*.$this->site_name", [ $this->site_name ], $this->le_mail, $force ); + } else { + $client->request( $this->site_name, [], $this->le_mail, $force ); + $client->cleanup( $this->site_root ); + } + EE::launch( 'docker exec ee-nginx-proxy sh -c "/app/docker-entrypoint.sh /usr/local/bin/docker-gen /app/nginx.tmpl /etc/nginx/conf.d/default.conf; /usr/sbin/nginx -s reload"' ); + } + public function create( $args, $assoc_args ) {} } From 791ba8940b79bf794dd3343eff1e5a4d008c8f19 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 26 Jul 2018 20:55:29 +0530 Subject: [PATCH 0292/1044] Update lock file acc to letsencrypt changes Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- composer.lock | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.lock b/composer.lock index 0d890ecae..b31aea784 100644 --- a/composer.lock +++ b/composer.lock @@ -3329,6 +3329,7 @@ "aliases": [], "minimum-stability": "dev", "stability-flags": { + "acmephp/core": 20, "roave/security-advisories": 20 }, "prefer-stable": true, From 08e4a9e0ef1186a66cd7800ca850c8a7304713d8 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Fri, 27 Jul 2018 12:11:33 +0530 Subject: [PATCH 0293/1044] Add shutdown function to core Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Bootstrap/LoadSiteUtilityFunctions.php | 1 + php/class-ee-site-shutdown-handler.php | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 php/class-ee-site-shutdown-handler.php diff --git a/php/EE/Bootstrap/LoadSiteUtilityFunctions.php b/php/EE/Bootstrap/LoadSiteUtilityFunctions.php index bb81a14d4..87827cff3 100644 --- a/php/EE/Bootstrap/LoadSiteUtilityFunctions.php +++ b/php/EE/Bootstrap/LoadSiteUtilityFunctions.php @@ -21,6 +21,7 @@ final class LoadSiteUtilityFunctions implements BootstrapStep { public function process( BootstrapState $state ) { require_once EE_ROOT . '/php/site-utils.php'; require_once EE_ROOT . '/php/class-ee-site-letsencrypt.php'; + require_once EE_ROOT . '/php/class-ee-site-shutdown-handler.php'; return $state; } diff --git a/php/class-ee-site-shutdown-handler.php b/php/class-ee-site-shutdown-handler.php new file mode 100644 index 000000000..2df3c30ee --- /dev/null +++ b/php/class-ee-site-shutdown-handler.php @@ -0,0 +1,19 @@ +<?php + +/** + * Class Shutdown_Handler + */ +class Shutdown_Handler { + + /** + * Handle fatal errors. This function was created as the register_shutdown_function requires the callable function to be public and any public function inside site-command would be callable directly through command-line. + * + * @param array $site_command having Site_Command object. + */ + public function cleanup( $site_command ) { + $reflector = new ReflectionObject( $site_command[0] ); + $method = $reflector->getMethod( 'shutDownFunction' ); + $method->setAccessible( true ); + $method->invoke( $site_command[0] ); + } +} From c71a1199a0f4f11ae46d89020eb8e2bdc9fc559c Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Fri, 27 Jul 2018 12:27:25 +0530 Subject: [PATCH 0294/1044] Update restart and reload to make them generic Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/class-ee-site.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/php/class-ee-site.php b/php/class-ee-site.php index 4c36869fb..6bca7d8c6 100644 --- a/php/class-ee-site.php +++ b/php/class-ee-site.php @@ -225,7 +225,7 @@ public function down( $args, $assoc_args ) { \EE\Utils\delem_log( 'site disable end' ); } - /** + /** * Restarts containers associated with site. * When no service(--nginx etc.) is specified, all site containers will be restarted. * @@ -238,7 +238,7 @@ public function down( $args, $assoc_args ) { * [--nginx] * : Restart nginx container of site. */ - public function restart( $args, $assoc_args ) { + public function restart( $args, $assoc_args, $whitelisted_containers = [] ) { \EE\Utils\delem_log( 'site restart start' ); $args = \EE\SiteUtils\auto_site_name( $args, 'site', __FUNCTION__ ); $all = \EE\Utils\get_flag_value( $assoc_args, 'all' ); @@ -249,7 +249,7 @@ public function restart( $args, $assoc_args ) { chdir( $this->site_root ); if ( $all || $no_service_specified ) { - $containers = [ 'nginx' ]; + $containers = $whitelisted_containers; } else { $containers = array_keys( $assoc_args ); } @@ -274,7 +274,7 @@ public function restart( $args, $assoc_args ) { * : Reload nginx service in container. * */ - public function reload( $args, $assoc_args ) { + public function reload( $args, $assoc_args, $whitelisted_containers = [] ) { \EE\Utils\delem_log( 'site reload start' ); $args = \EE\SiteUtils\auto_site_name( $args, 'site', __FUNCTION__ ); $all = \EE\Utils\get_flag_value( $assoc_args, 'all' ); @@ -285,7 +285,7 @@ public function reload( $args, $assoc_args ) { chdir( $this->site_root ); if ( $all || $no_service_specified ) { - $this->reload_services( [ 'nginx' ] ); + $this->reload_services( $whitelisted_containers ); } else { $this->reload_services( array_keys( $assoc_args ) ); } @@ -378,4 +378,3 @@ public function le( $args = [], $assoc_args = [], $wildcard = false ) { public function create( $args, $assoc_args ) {} } - From b38f6057964b6ce8079f3a96cab960bad79ddd83 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Fri, 27 Jul 2018 12:28:34 +0530 Subject: [PATCH 0295/1044] Add basic site info population function Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/class-ee-site.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/php/class-ee-site.php b/php/class-ee-site.php index 6bca7d8c6..538adee0a 100644 --- a/php/class-ee-site.php +++ b/php/class-ee-site.php @@ -375,6 +375,26 @@ public function le( $args = [], $assoc_args = [], $wildcard = false ) { EE::launch( 'docker exec ee-nginx-proxy sh -c "/app/docker-entrypoint.sh /usr/local/bin/docker-gen /app/nginx.tmpl /etc/nginx/conf.d/default.conf; /usr/sbin/nginx -s reload"' ); } + /** + * Populate basic site info from db. + */ + private function populate_site_info( $args ) { + + $this->site_name = \EE\Utils\remove_trailing_slash( $args[0] ); + + if ( EE::db()::site_in_db( $this->site_name ) ) { + + $db_select = EE::db()::select( [], array( 'sitename' => $this->site_name ) ); + + $this->site_type = $db_select[0]['site_type']; + $this->site_root = $db_select[0]['site_path']; + $this->le = $db_select[0]['is_ssl']; + + } else { + EE::error( "Site $this->site_name does not exist." ); + } + } + public function create( $args, $assoc_args ) {} } From aba7f2dc099ca5b0a214d602b8a9e2d03046aa51 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Fri, 27 Jul 2018 14:13:27 +0530 Subject: [PATCH 0296/1044] Make reload more generic Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/class-ee-site.php | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/php/class-ee-site.php b/php/class-ee-site.php index 538adee0a..a32ad4aca 100644 --- a/php/class-ee-site.php +++ b/php/class-ee-site.php @@ -274,10 +274,13 @@ public function restart( $args, $assoc_args, $whitelisted_containers = [] ) { * : Reload nginx service in container. * */ - public function reload( $args, $assoc_args, $whitelisted_containers = [] ) { + public function reload( $args, $assoc_args, $whitelisted_containers = [], $reload_commands = [] ) { \EE\Utils\delem_log( 'site reload start' ); - $args = \EE\SiteUtils\auto_site_name( $args, 'site', __FUNCTION__ ); - $all = \EE\Utils\get_flag_value( $assoc_args, 'all' ); + $args = \EE\SiteUtils\auto_site_name( $args, 'site', __FUNCTION__ ); + $all = \EE\Utils\get_flag_value( $assoc_args, 'all' ); + if ( ! array_key_exists( 'nginx', $reload_commands ) ) { + $reload_commands['nginx'] = 'nginx sh -c \'nginx -t && service openresty reload\''; + } $no_service_specified = count( $assoc_args ) === 0; $this->populate_site_info( $args ); @@ -285,9 +288,9 @@ public function reload( $args, $assoc_args, $whitelisted_containers = [] ) { chdir( $this->site_root ); if ( $all || $no_service_specified ) { - $this->reload_services( $whitelisted_containers ); + $this->reload_services( $whitelisted_containers, $reload_commands ); } else { - $this->reload_services( array_keys( $assoc_args ) ); + $this->reload_services( array_keys( $assoc_args ), $reload_commands ); } \EE\Utils\delem_log( 'site reload stop' ); } @@ -295,13 +298,9 @@ public function reload( $args, $assoc_args, $whitelisted_containers = [] ) { /** * Executes reload commands. It needs seperate handling as commands to reload each service is different. */ - private function reload_services( $services ) { - $reload_command = [ - 'nginx' => 'nginx sh -c \'nginx -t && service openresty reload\'', - ]; - + private function reload_services( $services, $reload_commands ) { foreach ( $services as $service ) { - \EE\SiteUtils\run_compose_command( 'exec', $reload_command[$service], 'reload', $service ); + \EE\SiteUtils\run_compose_command( 'exec', $reload_commands[$service], 'reload', $service ); } } From ba96043689947620dcd5f9caf702b3f2ddff01be Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 30 Jul 2018 03:08:55 +0530 Subject: [PATCH 0297/1044] Update site restart and reload Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/class-ee-site.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/php/class-ee-site.php b/php/class-ee-site.php index a32ad4aca..e7d63bfd1 100644 --- a/php/class-ee-site.php +++ b/php/class-ee-site.php @@ -255,7 +255,7 @@ public function restart( $args, $assoc_args, $whitelisted_containers = [] ) { } foreach ( $containers as $container ) { - EE\Siteutils\run_compose_command( 'restart', $container, null, 'all services' ); + EE\Siteutils\run_compose_command( 'restart', $container ); } \EE\Utils\delem_log( 'site restart stop' ); } @@ -264,7 +264,7 @@ public function restart( $args, $assoc_args, $whitelisted_containers = [] ) { * Reload services in containers without restarting container(s) associated with site. * When no service(--nginx etc.) is specified, all services will be reloaded. * - * <site-name> + * [<site-name>] * : Name of the site. * * [--all] From eb221b33fad69a70cb7e59deaf3f146918a34df3 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 30 Jul 2018 03:11:18 +0530 Subject: [PATCH 0298/1044] Add entry in db to register command type Add function to get command type --- php/class-ee-db.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/php/class-ee-db.php b/php/class-ee-db.php index f4697ea9e..d2611d3c0 100644 --- a/php/class-ee-db.php +++ b/php/class-ee-db.php @@ -38,6 +38,7 @@ public static function create() { sitename VARCHAR, site_type VARCHAR, site_title VARCHAR, + site_command VARCHAR, proxy_type VARCHAR, cache_type VARCHAR, site_path VARCHAR, @@ -281,6 +282,24 @@ public static function site_enabled( $site_name ) { return false; } + /** + * Get site type. + * + * @param String $site_name Name of the site. + * + * @return string type of site. + */ + public static function get_site_command( $site_name ) { + + if ( empty ( self::$db ) ) { + self::init_db(); + } + + $site = self::select( array( 'site_type' ), array( 'sitename' => $site_name ) ); + + return $site[0]['site_type']; + } + /** * Returns all migrations from table. */ From 72b0eb747675ee318ebb3969d733caa7c310eb6e Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 30 Jul 2018 03:17:10 +0530 Subject: [PATCH 0299/1044] Add function for loading site type routing in runner Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Bootstrap/RouteSiteCommands.php | 27 ++++++++++++++++++++++++++ php/bootstrap.php | 1 + 2 files changed, 28 insertions(+) create mode 100644 php/EE/Bootstrap/RouteSiteCommands.php diff --git a/php/EE/Bootstrap/RouteSiteCommands.php b/php/EE/Bootstrap/RouteSiteCommands.php new file mode 100644 index 000000000..08e6833b1 --- /dev/null +++ b/php/EE/Bootstrap/RouteSiteCommands.php @@ -0,0 +1,27 @@ +<?php + +namespace EE\Bootstrap; + +/** + * Class LaunchRunner. + * + * Kick off the Runner object that starts the actual commands. + * + * @package EE\Bootstrap + */ +final class RouteSiteCommands implements BootstrapStep { + + /** + * Process this single bootstrapping step. + * + * @param BootstrapState $state Contextual state to pass into the step. + * + * @return BootstrapState Modified state to pass to the next step. + */ + public function process( BootstrapState $state ) { + $runner = new RunnerInstance(); + $runner()->route(); + + return $state; + } +} diff --git a/php/bootstrap.php b/php/bootstrap.php index dc14caa0a..a116ac373 100644 --- a/php/bootstrap.php +++ b/php/bootstrap.php @@ -30,6 +30,7 @@ function get_bootstrap_steps() { 'EE\Bootstrap\RegisterFrameworkCommands', 'EE\Bootstrap\IncludeFallbackAutoloader', 'EE\Bootstrap\RegisterDeferredCommands', + 'EE\Bootstrap\RouteSiteCommands', 'EE\Bootstrap\LaunchRunner', ); } From 81c3c14a93601b69e0cd3f18041551aa8b82c367 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 30 Jul 2018 03:19:09 +0530 Subject: [PATCH 0300/1044] Add site type routing in runner Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Runner.php | 53 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index c0da2d064..41da0afe8 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -673,10 +673,61 @@ private function set_alias( $alias ) { } } - public function start() { + public function route() { $this->init_ee(); + if ( 'site' !== $this->arguments[0] && 'site' !== $this->arguments[1] ) { + return; + } + + if ( isset( $this->assoc_args['type'] ) ) { + $key = array_search( 'site', $this->arguments ); + $new_args = $this->arguments; + $new_args[$key] = $this->assoc_args['type']; + + if ( is_array( $this->find_command_to_run( $new_args ) ) ) { + $this->arguments = $new_args; + unset( $this->assoc_args['type'] ); + + return; + } + } + + $r = $this->find_command_to_run( $this->arguments ); + list( $command, $final_args, $cmd_path ) = $r; + + if ( is_string( $r ) ) { + EE::error( $r ); + } + + $synopsis = ( explode( ' ', $command->get_synopsis() ) ); + $command = array_shift( $cmd_path ); + $function = implode( ' ', $cmd_path ); + + $args_search_one = array_search( '[<site-name>]', $synopsis ); + $args_search_two = array_search( '<site-name>', $synopsis ); + $arg_position = false !== $args_search_one ? $args_search_one : $args_search_two; + + if ( false === $arg_position ) { + return; + } + + $site_name = \EE\SiteUtils\auto_site_name( $final_args, $command, $function, $arg_position )[$arg_position]; + + $type = EE::db()::get_site_command( $site_name ); + $key = array_search( 'site', $this->arguments ); + $new_args = $this->arguments; + $new_args[$key] = $type; + + if ( is_array( $this->find_command_to_run( $new_args ) ) ) { + $this->arguments = $new_args; + } + + } + + public function start() { + // Enable PHP error reporting to stderr if testing. if ( getenv( 'BEHAT_RUN' ) ) { $this->enable_error_reporting(); From 7fc7a7649ba65b20d14bdac73e40b57ad83f3f6f Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 30 Jul 2018 03:20:14 +0530 Subject: [PATCH 0301/1044] Update utility functions acc to routing changes Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/site-utils.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/php/site-utils.php b/php/site-utils.php index 2b38d218d..14e0266a0 100644 --- a/php/site-utils.php +++ b/php/site-utils.php @@ -36,25 +36,25 @@ function get_site_name() { /** * Function to set the site-name in the args when ee is running in a site folder and the site-name has not been passed in the args. If the site-name could not be found it will throw an error. * - * @param array $args The passed arguments. - * @param String $command The command passing the arguments to auto-detect site-name. - * @param String $function The function passing the arguments to auto-detect site-name. - * @param bool $arg_zero Site-name will be present in the first argument. Default true. + * @param array $args The passed arguments. + * @param String $command The command passing the arguments to auto-detect site-name. + * @param String $function The function passing the arguments to auto-detect site-name. + * @param integer $arg_pos Argument position where Site-name will be present. * * @return array Arguments with site-name set. */ -function auto_site_name( $args, $command, $function, $arg_zero = true ) { - if ( isset( $args[0] ) ) { - if ( EE::db()::site_in_db( $args[0] ) ) { +function auto_site_name( $args, $command, $function, $arg_pos = 0 ) { + if ( isset( $args[$arg_pos] ) ) { + if ( EE::db()::site_in_db( $args[$arg_pos] ) ) { return $args; } } $site_name = get_site_name(); if ( $site_name ) { - if ( isset( $args[0] ) && $arg_zero ) { - EE::error( $args[0] . " is not a valid site-name. Did you mean `ee $command $function $site_name`?" ); + if ( isset( $args[$arg_pos] ) ) { + EE::error( $args[$arg_pos] . " is not a valid site-name. Did you mean `ee $command $function $site_name`?" ); } - array_unshift( $args, $site_name ); + array_splice( $args, $arg_pos, 0, $site_name ); } else { EE::error( "Could not find the site you wish to run $command $function command on.\nEither pass it as an argument: `ee $command $function <site-name>` \nor run `ee $command $function` from inside the site folder." ); } From 94107ed0b9a4c6c872fa75019f0b0e75413a8b76 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 30 Jul 2018 16:02:08 +0530 Subject: [PATCH 0302/1044] Update to echo for same line printing in loop Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/site-utils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/site-utils.php b/php/site-utils.php index 14e0266a0..7d8d2d54b 100644 --- a/php/site-utils.php +++ b/php/site-utils.php @@ -232,7 +232,7 @@ function site_status_check( $site_name ) { EE::debug( "$site_name status httpcode: $httpcode" ); curl_exec( $ch ); $httpcode = curl_getinfo( $ch, CURLINFO_HTTP_CODE ); - EE::log( '.' ); + echo '.'; sleep( 2 ); if ( $i ++ > 60 ) { break; From f750840dd4c874a764802d831cc70938d2e6b1d6 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 31 Jul 2018 15:55:51 +0530 Subject: [PATCH 0303/1044] Add checks and force in site up Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/class-ee-site.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/php/class-ee-site.php b/php/class-ee-site.php index e7d63bfd1..c9a2a02b5 100644 --- a/php/class-ee-site.php +++ b/php/class-ee-site.php @@ -188,11 +188,18 @@ public function delete_site( $level, $site_name, $site_root ) { * * [<site-name>] * : Name of website to be enabled. + * + * [--force] + * : Force execution of site up. */ public function up( $args, $assoc_args ) { \EE\Utils\delem_log( 'site enable start' ); - $args = \EE\SiteUtils\auto_site_name( $args, 'site', __FUNCTION__ ); + $force = \EE\Utils\get_flag_value( $assoc_args, 'force' ); + $args = \EE\SiteUtils\auto_site_name( $args, 'site', __FUNCTION__ ); $this->populate_site_info( $args ); + if ( EE::db()::site_enabled( $this->site_name ) && ! $force ) { + EE::error( "$this->site_name is already enabled!" ); + } EE::log( "Enabling site $this->site_name." ); if ( EE::docker()::docker_compose_up( $this->site_root ) ) { EE::db()::update( [ 'is_enabled' => '1' ], [ 'sitename' => $this->site_name ] ); From a0cda2488aa22d08f50f8e76e62df14f11ebf93d Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 31 Jul 2018 18:57:08 +0530 Subject: [PATCH 0304/1044] Skip site check for create command Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Runner.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 41da0afe8..6ae423972 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -709,7 +709,7 @@ public function route() { $args_search_two = array_search( '<site-name>', $synopsis ); $arg_position = false !== $args_search_one ? $args_search_one : $args_search_two; - if ( false === $arg_position ) { + if ( false === $arg_position || 'create' === $function ) { return; } From 2e8eaf2cca24a3558b41b1edfe3e0aa433ed4881 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 31 Jul 2018 22:38:57 +0530 Subject: [PATCH 0305/1044] Use curl instead of fsockopen Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/site-utils.php | 44 +++++++++++++++++++++++++++++++------------- 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/php/site-utils.php b/php/site-utils.php index 7d8d2d54b..3a4febf91 100644 --- a/php/site-utils.php +++ b/php/site-utils.php @@ -74,11 +74,11 @@ function init_checks() { /** * Checking ports. */ - @fsockopen( 'localhost', 80, $port_80_exit_status ); - @fsockopen( 'localhost', 443, $port_443_exit_status ); + $port_80_status = get_curl_info( 'localhost', 80, true ); + $port_443_status = get_curl_info( 'localhost', 443, true ); // if any/both the port/s is/are occupied. - if ( ! ( $port_80_exit_status && $port_443_exit_status ) ) { + if ( ! ( $port_80_status && $port_443_status ) ) { EE::error( 'Cannot create/start proxy container. Please make sure port 80 and 443 are free.' ); } else { $EE_CONF_ROOT = EE_CONF_ROOT; @@ -220,18 +220,11 @@ function create_etc_hosts_entry( $site_name ) { */ function site_status_check( $site_name ) { EE::log( 'Checking and verifying site-up status. This may take some time.' ); - $httpcode = 000; - $ch = curl_init( $site_name ); - curl_setopt( $ch, CURLOPT_HEADER, true ); - curl_setopt( $ch, CURLOPT_NOBODY, true ); - curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); - curl_setopt( $ch, CURLOPT_TIMEOUT, 10 ); - - $i = 0; + $httpcode = get_curl_info( $site_name ); + $i = 0; while ( 200 !== $httpcode && 302 !== $httpcode ) { EE::debug( "$site_name status httpcode: $httpcode" ); - curl_exec( $ch ); - $httpcode = curl_getinfo( $ch, CURLINFO_HTTP_CODE ); + $httpcode = get_curl_info( $site_name ); echo '.'; sleep( 2 ); if ( $i ++ > 60 ) { @@ -244,6 +237,31 @@ function site_status_check( $site_name ) { } +/** + * Function to get httpcode or port occupancy info. + * + * @param string $url url to get info about. + * @param int $port The port to check. + * @param bool $port_info Return port info or httpcode. + * + * @return bool|int port occupied or httpcode. + */ +function get_curl_info( $url, $port = 80, $port_info = false ) { + + $ch = curl_init( $url ); + curl_setopt( $ch, CURLOPT_HEADER, true ); + curl_setopt( $ch, CURLOPT_NOBODY, true ); + curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); + curl_setopt( $ch, CURLOPT_TIMEOUT, 10 ); + curl_setopt( $ch, CURLOPT_PORT, $port ); + curl_exec( $ch ); + if ( $port_info ) { + return empty( curl_getinfo( $ch, CURLINFO_PRIMARY_IP ) ); + } + + return curl_getinfo( $ch, CURLINFO_HTTP_CODE ); +} + /** * Function to pull the latest images and bring up the site containers. * From fb7f1cc40fbda11be8b5f849001918d4418adaa6 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 31 Jul 2018 22:57:46 +0530 Subject: [PATCH 0306/1044] Add comments to routing and update it Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Runner.php | 39 ++++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 6ae423972..20c265207 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -677,23 +677,29 @@ public function route() { $this->init_ee(); - if ( 'site' !== $this->arguments[0] && 'site' !== $this->arguments[1] ) { + // Run routing only for `site` command. + if ( 'site' !== $this->arguments[0] ) { return; } if ( isset( $this->assoc_args['type'] ) ) { - $key = array_search( 'site', $this->arguments ); - $new_args = $this->arguments; - $new_args[$key] = $this->assoc_args['type']; - if ( is_array( $this->find_command_to_run( $new_args ) ) ) { - $this->arguments = $new_args; - unset( $this->assoc_args['type'] ); + $key = array_search( 'site', $this->arguments ); + $new_args = $this->arguments; + $new_args[ $key ] = $this->assoc_args['type']; - return; + // Check if the type is not default html and then search for a command registered with the type. + if ( ( 'html' !== $this->assoc_args['type'] ) && is_array( $this->find_command_to_run( $new_args ) ) ) { + // If the command with type is found. Update the arguments and replace `site` with value of type. + $this->arguments = $new_args; } + // Remove the type parameter. + unset( $this->assoc_args['type'] ); + + return; } + // If type parameter is not specified. Then type needs to be determined from site-name. $r = $this->find_command_to_run( $this->arguments ); list( $command, $final_args, $cmd_path ) = $r; @@ -701,24 +707,31 @@ public function route() { EE::error( $r ); } + // Get the command synopsis to figure out the position of site-name and get it. $synopsis = ( explode( ' ', $command->get_synopsis() ) ); $command = array_shift( $cmd_path ); $function = implode( ' ', $cmd_path ); + // Search for the site-name position in args. $args_search_one = array_search( '[<site-name>]', $synopsis ); $args_search_two = array_search( '<site-name>', $synopsis ); $arg_position = false !== $args_search_one ? $args_search_one : $args_search_two; + // return if site-name is not applicable or if it is create function as in create the site will not yet be registered in db. if ( false === $arg_position || 'create' === $function ) { return; } - $site_name = \EE\SiteUtils\auto_site_name( $final_args, $command, $function, $arg_position )[$arg_position]; + // Now that the position of site-name is figured, get the site-name. + $site_name = \EE\SiteUtils\auto_site_name( $final_args, $command, $function, $arg_position )[ $arg_position ]; + + // Getting the type of the respective site-name from database. + $type = EE::db()::get_site_command( $site_name ); - $type = EE::db()::get_site_command( $site_name ); - $key = array_search( 'site', $this->arguments ); - $new_args = $this->arguments; - $new_args[$key] = $type; + // Replacing `site` with appropriate type command if the function called for it exists. + $key = array_search( 'site', $this->arguments ); + $new_args = $this->arguments; + $new_args[ $key ] = $type; if ( is_array( $this->find_command_to_run( $new_args ) ) ) { $this->arguments = $new_args; From 8da0895a112070357199695d8bdecdd3866f5ab7 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 31 Jul 2018 23:50:21 +0530 Subject: [PATCH 0307/1044] Update for db select limit Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/class-ee-db.php | 10 ++++++++-- php/class-ee-site.php | 8 ++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/php/class-ee-db.php b/php/class-ee-db.php index d2611d3c0..c9f77ec04 100644 --- a/php/class-ee-db.php +++ b/php/class-ee-db.php @@ -125,6 +125,8 @@ public static function insert( $data, $table_name = 'sites' ) { /** * @param array $columns * @param array $where + * @param string $table_name + * @param int|null $limit * Select data from the database. * * @return array|bool @@ -169,6 +171,10 @@ public static function select( $columns = array(), $where = array(), $table_name return false; } + if ( 1 === $limit ) { + return $select_data[0]; + } + return $select_data; } @@ -295,9 +301,9 @@ public static function get_site_command( $site_name ) { self::init_db(); } - $site = self::select( array( 'site_type' ), array( 'sitename' => $site_name ) ); + $site = self::select( [ 'site_type' ], [ 'sitename' => $site_name ], 'sites', 1 ); - return $site[0]['site_type']; + return $site['site_type']; } /** diff --git a/php/class-ee-site.php b/php/class-ee-site.php index c9a2a02b5..16c0978e3 100644 --- a/php/class-ee-site.php +++ b/php/class-ee-site.php @@ -390,11 +390,11 @@ private function populate_site_info( $args ) { if ( EE::db()::site_in_db( $this->site_name ) ) { - $db_select = EE::db()::select( [], array( 'sitename' => $this->site_name ) ); + $db_select = $this->db::select( [], [ 'sitename' => $this->site_name ], 'sites', 1 ); - $this->site_type = $db_select[0]['site_type']; - $this->site_root = $db_select[0]['site_path']; - $this->le = $db_select[0]['is_ssl']; + $this->site_type = $db_select['site_type']; + $this->site_root = $db_select['site_path']; + $this->le = $db_select['is_ssl']; } else { EE::error( "Site $this->site_name does not exist." ); From 7d9c33a21c6e52e3e8a1b887d36180f71924b9d5 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Wed, 1 Aug 2018 00:02:18 +0530 Subject: [PATCH 0308/1044] Update functions to protected Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/class-ee-site.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/php/class-ee-site.php b/php/class-ee-site.php index 16c0978e3..1ac06b7d7 100644 --- a/php/class-ee-site.php +++ b/php/class-ee-site.php @@ -115,10 +115,8 @@ public function delete( $args, $assoc_args ) { * Level - 3: Disconnect & remove network and try to remove containers. The containers may not have been created. * Level - 4: Remove containers. * Level - 5: Remove db entry. - * - * @ignorecommand */ - public function delete_site( $level, $site_name, $site_root ) { + protected function delete_site( $level, $site_name, $site_root ) { $this->fs = new Filesystem(); $proxy_type = EE_PROXY_TYPE; if ( $level >= 3 ) { @@ -317,10 +315,8 @@ private function reload_services( $services, $reload_commands ) { * @param string $site_name Name of the site for ssl. * @param string $site_root Webroot of the site. * @param bool $wildcard SSL with wildcard or not. - * - * @ignorecommand */ - public function init_le( $site_name, $site_root, $wildcard = false ) { + protected function init_le( $site_name, $site_root, $wildcard = false ) { $this->site_name = $site_name; $this->site_root = $site_root; $client = new Site_Letsencrypt(); From 908ef428a0993ba20de47c6cc142a2daeeb81fd4 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Wed, 1 Aug 2018 01:42:22 +0530 Subject: [PATCH 0309/1044] Update db variable Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/class-ee-site.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/class-ee-site.php b/php/class-ee-site.php index 1ac06b7d7..b43a29308 100644 --- a/php/class-ee-site.php +++ b/php/class-ee-site.php @@ -386,7 +386,7 @@ private function populate_site_info( $args ) { if ( EE::db()::site_in_db( $this->site_name ) ) { - $db_select = $this->db::select( [], [ 'sitename' => $this->site_name ], 'sites', 1 ); + $db_select = EE::db()::select( [], [ 'sitename' => $this->site_name ], 'sites', 1 ); $this->site_type = $db_select['site_type']; $this->site_root = $db_select['site_path']; From 225c13ff96bfbad3652c9f6afbd7b8e4c7a0f85c Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Wed, 1 Aug 2018 11:23:52 +0530 Subject: [PATCH 0310/1044] Code refactoring and unification Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/class-ee-site.php | 77 ++++++++++++++++++++++++------------------- php/site-utils.php | 35 ++++++++++++++------ 2 files changed, 69 insertions(+), 43 deletions(-) diff --git a/php/class-ee-site.php b/php/class-ee-site.php index b43a29308..50a21f177 100644 --- a/php/class-ee-site.php +++ b/php/class-ee-site.php @@ -43,10 +43,11 @@ public function __construct() {} * @subcommand list */ public function _list( $args, $assoc_args ) { - \EE\Utils\delem_log( 'site list start' ); - $format = \EE\Utils\get_flag_value( $assoc_args, 'format' ); - $enabled = \EE\Utils\get_flag_value( $assoc_args, 'enabled' ); - $disabled = \EE\Utils\get_flag_value( $assoc_args, 'disabled' ); + + EE\Utils\delem_log( 'site list start' ); + $format = EE\Utils\get_flag_value( $assoc_args, 'format' ); + $enabled = EE\Utils\get_flag_value( $assoc_args, 'enabled' ); + $disabled = EE\Utils\get_flag_value( $assoc_args, 'disabled' ); $where = array(); @@ -76,12 +77,12 @@ function ( $site ) { }, $sites ); - $formatter = new \EE\Formatter( $assoc_args, [ 'site', 'status' ] ); + $formatter = new EE\Formatter( $assoc_args, [ 'site', 'status' ] ); $formatter->display_items( $result ); } - \EE\Utils\delem_log( 'site list end' ); + EE\Utils\delem_log( 'site list end' ); } @@ -97,11 +98,12 @@ function ( $site ) { * : Do not prompt for confirmation. */ public function delete( $args, $assoc_args ) { - \EE\Utils\delem_log( 'site delete start' ); + + EE\Utils\delem_log( 'site delete start' ); $this->populate_site_info( $args ); EE::confirm( "Are you sure you want to delete $this->site_name?", $assoc_args ); $this->delete_site( 5, $this->site_name, $this->site_root ); - \EE\Utils\delem_log( 'site delete end' ); + EE\Utils\delem_log( 'site delete end' ); } /** @@ -117,13 +119,14 @@ public function delete( $args, $assoc_args ) { * Level - 5: Remove db entry. */ protected function delete_site( $level, $site_name, $site_root ) { + $this->fs = new Filesystem(); $proxy_type = EE_PROXY_TYPE; if ( $level >= 3 ) { if ( EE::docker()::docker_compose_down( $site_root ) ) { EE::log( "[$site_name] Docker Containers removed." ); } else { - \EE\Utils\default_launch( "docker rm -f $(docker ps -q -f=label=created_by=EasyEngine -f=label=site_name=$site_name)" ); + EE\Utils\default_launch( "docker rm -f $(docker ps -q -f=label=created_by=EasyEngine -f=label=site_name=$site_name)" ); if ( $level > 3 ) { EE::warning( 'Error in removing docker containers.' ); } @@ -145,8 +148,7 @@ protected function delete_site( $level, $site_name, $site_root ) { if ( $this->fs->exists( $site_root ) ) { try { $this->fs->remove( $site_root ); - } - catch ( Exception $e ) { + } catch ( Exception $e ) { EE::debug( $e ); EE::error( 'Could not remove site root. Please check if you have sufficient rights.' ); } @@ -164,8 +166,7 @@ protected function delete_site( $level, $site_name, $site_root ) { $cert_files = [ $conf_certs, $conf_var, $crt_file, $key_file ]; try { $this->fs->remove( $cert_files ); - } - catch ( Exception $e ) { + } catch ( Exception $e ) { EE::warning( $e ); } @@ -191,9 +192,10 @@ protected function delete_site( $level, $site_name, $site_root ) { * : Force execution of site up. */ public function up( $args, $assoc_args ) { - \EE\Utils\delem_log( 'site enable start' ); - $force = \EE\Utils\get_flag_value( $assoc_args, 'force' ); - $args = \EE\SiteUtils\auto_site_name( $args, 'site', __FUNCTION__ ); + + EE\Utils\delem_log( 'site enable start' ); + $force = EE\Utils\get_flag_value( $assoc_args, 'force' ); + $args = EE\SiteUtils\auto_site_name( $args, 'site', __FUNCTION__ ); $this->populate_site_info( $args ); if ( EE::db()::site_enabled( $this->site_name ) && ! $force ) { EE::error( "$this->site_name is already enabled!" ); @@ -205,7 +207,7 @@ public function up( $args, $assoc_args ) { } else { EE::error( "There was error in enabling $this->site_name. Please check logs." ); } - \EE\Utils\delem_log( 'site enable end' ); + EE\Utils\delem_log( 'site enable end' ); } /** @@ -217,8 +219,9 @@ public function up( $args, $assoc_args ) { * : Name of website to be disabled. */ public function down( $args, $assoc_args ) { - \EE\Utils\delem_log( 'site disable start' ); - $args = \EE\SiteUtils\auto_site_name( $args, 'site', __FUNCTION__ ); + + EE\Utils\delem_log( 'site disable start' ); + $args = EE\SiteUtils\auto_site_name( $args, 'site', __FUNCTION__ ); $this->populate_site_info( $args ); EE::log( "Disabling site $this->site_name." ); if ( EE::docker()::docker_compose_down( $this->site_root ) ) { @@ -227,7 +230,7 @@ public function down( $args, $assoc_args ) { } else { EE::error( "There was error in disabling $this->site_name. Please check logs." ); } - \EE\Utils\delem_log( 'site disable end' ); + EE\Utils\delem_log( 'site disable end' ); } /** @@ -244,9 +247,10 @@ public function down( $args, $assoc_args ) { * : Restart nginx container of site. */ public function restart( $args, $assoc_args, $whitelisted_containers = [] ) { - \EE\Utils\delem_log( 'site restart start' ); - $args = \EE\SiteUtils\auto_site_name( $args, 'site', __FUNCTION__ ); - $all = \EE\Utils\get_flag_value( $assoc_args, 'all' ); + + EE\Utils\delem_log( 'site restart start' ); + $args = EE\SiteUtils\auto_site_name( $args, 'site', __FUNCTION__ ); + $all = EE\Utils\get_flag_value( $assoc_args, 'all' ); $no_service_specified = count( $assoc_args ) === 0; $this->populate_site_info( $args ); @@ -262,7 +266,7 @@ public function restart( $args, $assoc_args, $whitelisted_containers = [] ) { foreach ( $containers as $container ) { EE\Siteutils\run_compose_command( 'restart', $container ); } - \EE\Utils\delem_log( 'site restart stop' ); + EE\Utils\delem_log( 'site restart stop' ); } /** @@ -280,9 +284,10 @@ public function restart( $args, $assoc_args, $whitelisted_containers = [] ) { * */ public function reload( $args, $assoc_args, $whitelisted_containers = [], $reload_commands = [] ) { - \EE\Utils\delem_log( 'site reload start' ); - $args = \EE\SiteUtils\auto_site_name( $args, 'site', __FUNCTION__ ); - $all = \EE\Utils\get_flag_value( $assoc_args, 'all' ); + + EE\Utils\delem_log( 'site reload start' ); + $args = EE\SiteUtils\auto_site_name( $args, 'site', __FUNCTION__ ); + $all = EE\Utils\get_flag_value( $assoc_args, 'all' ); if ( ! array_key_exists( 'nginx', $reload_commands ) ) { $reload_commands['nginx'] = 'nginx sh -c \'nginx -t && service openresty reload\''; } @@ -297,15 +302,19 @@ public function reload( $args, $assoc_args, $whitelisted_containers = [], $reloa } else { $this->reload_services( array_keys( $assoc_args ), $reload_commands ); } - \EE\Utils\delem_log( 'site reload stop' ); + EE\Utils\delem_log( 'site reload stop' ); } /** - * Executes reload commands. It needs seperate handling as commands to reload each service is different. + * Executes reload commands. It needs separate handling as commands to reload each service is different. + * + * @param array $services Services to reload. + * @param array $reload_commands Commands to reload the services. */ private function reload_services( $services, $reload_commands ) { + foreach ( $services as $service ) { - \EE\SiteUtils\run_compose_command( 'exec', $reload_commands[$service], 'reload', $service ); + EE\SiteUtils\run_compose_command( 'exec', $reload_commands[ $service ], 'reload', $service ); } } @@ -314,9 +323,10 @@ private function reload_services( $services, $reload_commands ) { * * @param string $site_name Name of the site for ssl. * @param string $site_root Webroot of the site. - * @param bool $wildcard SSL with wildcard or not. + * @param bool $wildcard SSL with wildcard or not. */ protected function init_le( $site_name, $site_root, $wildcard = false ) { + $this->site_name = $site_name; $this->site_root = $site_root; $client = new Site_Letsencrypt(); @@ -354,13 +364,14 @@ protected function init_le( $site_name, $site_root, $wildcard = false ) { * : Force renewal. */ public function le( $args = [], $assoc_args = [], $wildcard = false ) { + if ( ! isset( $this->site_name ) ) { $this->populate_site_info( $args ); } if ( ! isset( $this->le_mail ) ) { $this->le_mail = EE::get_config( 'le-mail' ) ?? EE::input( 'Enter your mail id: ' ); } - $force = \EE\Utils\get_flag_value( $assoc_args, 'force' ); + $force = EE\Utils\get_flag_value( $assoc_args, 'force' ); $domains = $wildcard ? [ "*.$this->site_name", $this->site_name ] : [ $this->site_name ]; $client = new Site_Letsencrypt(); if ( ! $client->check( $domains, $wildcard ) ) { @@ -382,7 +393,7 @@ public function le( $args = [], $assoc_args = [], $wildcard = false ) { */ private function populate_site_info( $args ) { - $this->site_name = \EE\Utils\remove_trailing_slash( $args[0] ); + $this->site_name = EE\Utils\remove_trailing_slash( $args[0] ); if ( EE::db()::site_in_db( $this->site_name ) ) { diff --git a/php/site-utils.php b/php/site-utils.php index 3a4febf91..3c5598c09 100644 --- a/php/site-utils.php +++ b/php/site-utils.php @@ -11,6 +11,7 @@ * @return bool|String Name of the site or false in failure. */ function get_site_name() { + $sites = EE::db()::select( array( 'sitename' ) ); if ( $sites ) { @@ -34,25 +35,27 @@ function get_site_name() { } /** - * Function to set the site-name in the args when ee is running in a site folder and the site-name has not been passed in the args. If the site-name could not be found it will throw an error. + * Function to set the site-name in the args when ee is running in a site folder and the site-name has not been passed + * in the args. If the site-name could not be found it will throw an error. * - * @param array $args The passed arguments. - * @param String $command The command passing the arguments to auto-detect site-name. - * @param String $function The function passing the arguments to auto-detect site-name. - * @param integer $arg_pos Argument position where Site-name will be present. + * @param array $args The passed arguments. + * @param String $command The command passing the arguments to auto-detect site-name. + * @param String $function The function passing the arguments to auto-detect site-name. + * @param integer $arg_pos Argument position where Site-name will be present. * * @return array Arguments with site-name set. */ function auto_site_name( $args, $command, $function, $arg_pos = 0 ) { - if ( isset( $args[$arg_pos] ) ) { - if ( EE::db()::site_in_db( $args[$arg_pos] ) ) { + + if ( isset( $args[ $arg_pos ] ) ) { + if ( EE::db()::site_in_db( $args[ $arg_pos ] ) ) { return $args; } } $site_name = get_site_name(); if ( $site_name ) { - if ( isset( $args[$arg_pos] ) ) { - EE::error( $args[$arg_pos] . " is not a valid site-name. Did you mean `ee $command $function $site_name`?" ); + if ( isset( $args[ $arg_pos ] ) ) { + EE::error( $args[ $arg_pos ] . " is not a valid site-name. Did you mean `ee $command $function $site_name`?" ); } array_splice( $args, $arg_pos, 0, $site_name ); } else { @@ -69,6 +72,7 @@ function auto_site_name( $args, $command, $function, $arg_pos = 0 ) { * Boots up the container if it is stopped or not running. */ function init_checks() { + $proxy_type = EE_PROXY_TYPE; if ( 'running' !== EE::docker()::container_status( $proxy_type ) ) { /** @@ -102,6 +106,7 @@ function init_checks() { * @param string $site_name Name of the site. */ function create_site_root( $site_root, $site_name ) { + $fs = new Filesystem(); if ( $fs->exists( $site_root ) ) { EE::error( "Webroot directory for site $site_name already exists." ); @@ -122,6 +127,7 @@ function create_site_root( $site_root, $site_name ) { * @throws \Exception when network start fails. */ function setup_site_network( $site_name ) { + $proxy_type = EE_PROXY_TYPE; if ( EE::docker()::create_network( $site_name ) ) { EE::success( 'Network started.' ); @@ -137,9 +143,10 @@ function setup_site_network( $site_name ) { * Adds www to non-www redirection to site * * @param string $site_name Name of the site. - * @param bool $le Specifying if letsencrypt is enabled or not. + * @param bool $le Specifying if letsencrypt is enabled or not. */ function add_site_redirects( $site_name, $le ) { + $fs = new Filesystem(); $confd_path = EE_CONF_ROOT . '/nginx/conf.d/'; $config_file_path = $confd_path . $site_name . '-redirect.conf'; @@ -219,6 +226,7 @@ function create_etc_hosts_entry( $site_name ) { * @throws \Exception when fails to connect to site. */ function site_status_check( $site_name ) { + EE::log( 'Checking and verifying site-up status. This may take some time.' ); $httpcode = get_curl_info( $site_name ); $i = 0; @@ -270,6 +278,7 @@ function get_curl_info( $url, $port = 80, $port_info = false ) { * @throws \Exception when docker-compose up fails. */ function start_site_containers( $site_root ) { + EE::log( 'Pulling latest images. This may take some time.' ); chdir( $site_root ); \EE\Utils\default_launch( 'docker-compose pull' ); @@ -282,8 +291,14 @@ function start_site_containers( $site_root ) { /** * Generic function to run a docker compose command. Must be ran inside correct directory. + * + * @param string $action docker-compose action to run. + * @param string $container The container on which action has to be run. + * @param string $action_to_display The action message to be displayed. + * @param string $service_to_display The service message to be displayed. */ function run_compose_command( $action, $container, $action_to_display = null, $service_to_display = null ) { + $display_action = $action_to_display ? $action_to_display : $action; $display_service = $service_to_display ? $service_to_display : $container; From 4536129f7e18814e8c57068d1fda6fe9b7bee43b Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Wed, 1 Aug 2018 13:07:48 +0530 Subject: [PATCH 0311/1044] Update variables Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/class-ee-site.php | 111 ++++++++++++++++++++++++------------------ 1 file changed, 64 insertions(+), 47 deletions(-) diff --git a/php/class-ee-site.php b/php/class-ee-site.php index 50a21f177..d1e1c7d4f 100644 --- a/php/class-ee-site.php +++ b/php/class-ee-site.php @@ -8,14 +8,28 @@ * @package ee */ abstract class EE_Site_Command { + /** + * @var Filesystem $fs Symfony Filesystem object. + */ private $fs; + + /** + * @var bool $le Whether the site is letsencrypt or not. + */ private $le; + + /** + * @var string $le_mail Mail id to be used for letsencrypt registration and certificate generation. + */ private $le_mail; - private $site_name; - private $site_root; - private $site_type; - public function __construct() {} + /** + * @var array $site Associative array containing essential site related information. + */ + private $site; + + public function __construct() { + } /** * Lists the created websites. @@ -101,22 +115,22 @@ public function delete( $args, $assoc_args ) { EE\Utils\delem_log( 'site delete start' ); $this->populate_site_info( $args ); - EE::confirm( "Are you sure you want to delete $this->site_name?", $assoc_args ); - $this->delete_site( 5, $this->site_name, $this->site_root ); + EE::confirm( sprintf( 'Are you sure you want to delete %s?', $this->site['name'] ), $assoc_args ); + $this->delete_site( 5, $this->site['name'], $this->site['root'] ); EE\Utils\delem_log( 'site delete end' ); } /** * Function to delete the given site. * - * @param int $level - * Level of deletion. - * Level - 0: No need of clean-up. - * Level - 1: Clean-up only the site-root. - * Level - 2: Try to remove network. The network may or may not have been created. - * Level - 3: Disconnect & remove network and try to remove containers. The containers may not have been created. - * Level - 4: Remove containers. - * Level - 5: Remove db entry. + * @param int $level Level of deletion. + * Level - 0: No need of clean-up. + * Level - 1: Clean-up only the site-root. + * Level - 2: Try to remove network. The network may or may not have been created. + * Level - 3: Disconnect & remove network and try to remove containers. The containers may + * not have been created. Level - 4: Remove containers. Level - 5: Remove db entry. + * @param string $site_name Name of the site to be deleted. + * @param string $site_root Webroot of the site. */ protected function delete_site( $level, $site_name, $site_root ) { @@ -197,15 +211,15 @@ public function up( $args, $assoc_args ) { $force = EE\Utils\get_flag_value( $assoc_args, 'force' ); $args = EE\SiteUtils\auto_site_name( $args, 'site', __FUNCTION__ ); $this->populate_site_info( $args ); - if ( EE::db()::site_enabled( $this->site_name ) && ! $force ) { - EE::error( "$this->site_name is already enabled!" ); + if ( EE::db()::site_enabled( $this->site['name'] ) && ! $force ) { + EE::error( sprintf( '%s is already enabled!', $this->site['name'] ) ); } - EE::log( "Enabling site $this->site_name." ); - if ( EE::docker()::docker_compose_up( $this->site_root ) ) { - EE::db()::update( [ 'is_enabled' => '1' ], [ 'sitename' => $this->site_name ] ); - EE::success( "Site $this->site_name enabled." ); + EE::log( "Enabling site $this->site['name']." ); + if ( EE::docker()::docker_compose_up( $this->site['root'] ) ) { + EE::db()::update( [ 'is_enabled' => '1' ], [ 'sitename' => $this->site['name'] ] ); + EE::success( "Site $this->site['name'] enabled." ); } else { - EE::error( "There was error in enabling $this->site_name. Please check logs." ); + EE::error( sprintf( 'There was error in enabling %s. Please check logs.', $this->site['name'] ) ); } EE\Utils\delem_log( 'site enable end' ); } @@ -223,12 +237,12 @@ public function down( $args, $assoc_args ) { EE\Utils\delem_log( 'site disable start' ); $args = EE\SiteUtils\auto_site_name( $args, 'site', __FUNCTION__ ); $this->populate_site_info( $args ); - EE::log( "Disabling site $this->site_name." ); - if ( EE::docker()::docker_compose_down( $this->site_root ) ) { - EE::db()::update( [ 'is_enabled' => '0' ], [ 'sitename' => $this->site_name ] ); - EE::success( "Site $this->site_name disabled." ); + EE::log( sprintf( 'Disabling site %s.', $this->site['name'] ) ); + if ( EE::docker()::docker_compose_down( $this->site['root'] ) ) { + EE::db()::update( [ 'is_enabled' => '0' ], [ 'sitename' => $this->site['name'] ] ); + EE::success( sprintf( 'Site %s disabled.', $this->site['name'] ) ); } else { - EE::error( "There was error in disabling $this->site_name. Please check logs." ); + EE::error( sprintf( 'There was error in disabling %s. Please check logs.', $this->site['name'] ) ); } EE\Utils\delem_log( 'site disable end' ); } @@ -255,7 +269,7 @@ public function restart( $args, $assoc_args, $whitelisted_containers = [] ) { $this->populate_site_info( $args ); - chdir( $this->site_root ); + chdir( $this->site['root'] ); if ( $all || $no_service_specified ) { $containers = $whitelisted_containers; @@ -295,7 +309,7 @@ public function reload( $args, $assoc_args, $whitelisted_containers = [], $reloa $this->populate_site_info( $args ); - chdir( $this->site_root ); + chdir( $this->site['root'] ); if ( $all || $no_service_specified ) { $this->reload_services( $whitelisted_containers, $reload_commands ); @@ -327,10 +341,10 @@ private function reload_services( $services, $reload_commands ) { */ protected function init_le( $site_name, $site_root, $wildcard = false ) { - $this->site_name = $site_name; - $this->site_root = $site_root; - $client = new Site_Letsencrypt(); - $this->le_mail = EE::get_runner()->config['le-mail'] ?? EE::input( 'Enter your mail id: ' ); + $this->site['name'] = $site_name; + $this->site['root'] = $site_root; + $client = new Site_Letsencrypt(); + $this->le_mail = EE::get_runner()->config['le-mail'] ?? EE::input( 'Enter your mail id: ' ); EE::get_runner()->ensure_present_in_config( 'le-mail', $this->le_mail ); if ( ! $client->register( $this->le_mail ) ) { $this->le = false; @@ -338,14 +352,17 @@ protected function init_le( $site_name, $site_root, $wildcard = false ) { return; } - $domains = $wildcard ? [ "*.$this->site_name", $this->site_name ] : [ $this->site_name ]; - if ( ! $client->authorize( $domains, $this->site_root, $wildcard ) ) { + $domains = $wildcard ? [ + sprintf( '*.%s', $this->site['name'] ), + $this->site['name'] + ] : [ $this->site['name'] ]; + if ( ! $client->authorize( $domains, $this->site['root'], $wildcard ) ) { $this->le = false; return; } if ( $wildcard ) { - echo \cli\Colors::colorize( "%YIMPORTANT:%n Run `ee site le $this->site_name` once the dns changes have propogated to complete the certification generation and installation.", null ); + echo \cli\Colors::colorize( '%YIMPORTANT:%n Run `ee site le ' . $this->site['name'] . '` once the dns changes have propogated to complete the certification generation and installation.', null ); } else { $this->le( [], [], $wildcard ); } @@ -365,14 +382,14 @@ protected function init_le( $site_name, $site_root, $wildcard = false ) { */ public function le( $args = [], $assoc_args = [], $wildcard = false ) { - if ( ! isset( $this->site_name ) ) { + if ( ! isset( $this->site['name'] ) ) { $this->populate_site_info( $args ); } if ( ! isset( $this->le_mail ) ) { $this->le_mail = EE::get_config( 'le-mail' ) ?? EE::input( 'Enter your mail id: ' ); } $force = EE\Utils\get_flag_value( $assoc_args, 'force' ); - $domains = $wildcard ? [ "*.$this->site_name", $this->site_name ] : [ $this->site_name ]; + $domains = $wildcard ? [ "*.$this->site['name']", $this->site['name'] ] : [ $this->site['name'] ]; $client = new Site_Letsencrypt(); if ( ! $client->check( $domains, $wildcard ) ) { $this->le = false; @@ -380,10 +397,10 @@ public function le( $args = [], $assoc_args = [], $wildcard = false ) { return; } if ( $wildcard ) { - $client->request( "*.$this->site_name", [ $this->site_name ], $this->le_mail, $force ); + $client->request( "*.$this->site['name']", [ $this->site['name'] ], $this->le_mail, $force ); } else { - $client->request( $this->site_name, [], $this->le_mail, $force ); - $client->cleanup( $this->site_root ); + $client->request( $this->site['name'], [], $this->le_mail, $force ); + $client->cleanup( $this->site['root'] ); } EE::launch( 'docker exec ee-nginx-proxy sh -c "/app/docker-entrypoint.sh /usr/local/bin/docker-gen /app/nginx.tmpl /etc/nginx/conf.d/default.conf; /usr/sbin/nginx -s reload"' ); } @@ -393,18 +410,18 @@ public function le( $args = [], $assoc_args = [], $wildcard = false ) { */ private function populate_site_info( $args ) { - $this->site_name = EE\Utils\remove_trailing_slash( $args[0] ); + $this->site['name'] = EE\Utils\remove_trailing_slash( $args[0] ); - if ( EE::db()::site_in_db( $this->site_name ) ) { + if ( EE::db()::site_in_db( $this->site['name'] ) ) { - $db_select = EE::db()::select( [], [ 'sitename' => $this->site_name ], 'sites', 1 ); + $db_select = EE::db()::select( [], [ 'sitename' => $this->site['name'] ], 'sites', 1 ); - $this->site_type = $db_select['site_type']; - $this->site_root = $db_select['site_path']; - $this->le = $db_select['is_ssl']; + $this->site['type'] = $db_select['site_type']; + $this->site['root'] = $db_select['site_path']; + $this->le = $db_select['is_ssl']; } else { - EE::error( "Site $this->site_name does not exist." ); + EE::error( sprintf( 'Site %s does not exist.', $this->site['name'] ) ); } } From 363ae52d16eda66c4742990047ef358938ea9050 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Wed, 1 Aug 2018 13:10:39 +0530 Subject: [PATCH 0312/1044] Force extending create function Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/class-ee-site.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/class-ee-site.php b/php/class-ee-site.php index d1e1c7d4f..64472c206 100644 --- a/php/class-ee-site.php +++ b/php/class-ee-site.php @@ -425,6 +425,6 @@ private function populate_site_info( $args ) { } } - public function create( $args, $assoc_args ) {} + abstract public function create( $args, $assoc_args ); } From 3101c8bc3b959d1d6451f58ea6064644899b3f8a Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Wed, 1 Aug 2018 13:26:48 +0530 Subject: [PATCH 0313/1044] Upadte lock file for composer changes Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- composer.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.lock b/composer.lock index b31aea784..e169b66e8 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": "6f237f357e6d5533ab44375b7878885b", + "content-hash": "2df550edcb8b8698bd6442f881302533", "packages": [ { "name": "acmephp/core", @@ -3329,13 +3329,13 @@ "aliases": [], "minimum-stability": "dev", "stability-flags": { - "acmephp/core": 20, "roave/security-advisories": 20 }, "prefer-stable": true, "prefer-lowest": false, "platform": { - "php": ">=7.0" + "php": ">=7.0", + "ext-openssl": "*" }, "platform-dev": [], "platform-overrides": { From dda2733b4a7b4a3e6fb13f070cefadd752f5df90 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Wed, 1 Aug 2018 16:58:29 +0530 Subject: [PATCH 0314/1044] Made changes according to PR Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/EE/Migration/Containers.php | 179 +++++++++++++++++------------ php/EE/RevertableStepProcessor.php | 58 +++++----- php/commands/src/CLI_Command.php | 6 +- php/utils.php | 18 +++ 4 files changed, 158 insertions(+), 103 deletions(-) diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index 54731115f..97be08431 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -10,75 +10,96 @@ */ class Containers { - /** @var RevertableStepProcessor */ + /** @var RevertableStepProcessor $rsp Keeps track of */ private static $rsp; public static function start_container_migration() { + EE\Utils\delem_log( 'Starting container migration' ); + self::$rsp = new RevertableStepProcessor(); self::pull_new_images(); self::migrate_site_containers(); self::migrate_global_containers(); + if( ! self::$rsp->execute() ) { + throw new \Exception( "Unable to migrate sites to newer version" ); + } + + EE\Utils\delem_log( 'Container migration completed' ); } private static function migrate_global_containers() { // Upgrade nginx-proxy container $existing_nginx_proxy_image = EE::launch( 'docker inspect --format=\'{{.Config.Image}}\' ee-nginx-proxy', false, true ); - if ( $existing_nginx_proxy_image->return_code === 0 ) { - self::$rsp->execute_step( - function () { - $EE_CONF_ROOT = EE_CONF_ROOT; - $nginx_proxy_image = 'easyengine/nginx-proxy:v' . EE_VERSION ; - $ee_proxy_command = "docker run --name ee-nginx-proxy -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v $EE_CONF_ROOT/nginx/certs:/etc/nginx/certs -v $EE_CONF_ROOT/nginx/dhparam:/etc/nginx/dhparam -v $EE_CONF_ROOT/nginx/conf.d:/etc/nginx/conf.d -v $EE_CONF_ROOT/nginx/htpasswd:/etc/nginx/htpasswd -v $EE_CONF_ROOT/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v $EE_CONF_ROOT:/app/ee4 -v /usr/share/nginx/html $nginx_proxy_image" ; - - default_launch( 'docker rm -f ee-nginx-proxy', false, true ); - - if ( ! default_launch( $ee_proxy_command, false, true ) ) { - throw new \Exception( ' Unable to upgrade ee-nginx-proxy container' ); - } - }, - function () use ( $existing_nginx_proxy_image ) { - $EE_CONF_ROOT = EE_CONF_ROOT; - $nginx_proxy_image = trim( $existing_nginx_proxy_image->stout ); - $ee_proxy_command = "docker run --name ee-nginx-proxy -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v $EE_CONF_ROOT/nginx/certs:/etc/nginx/certs -v $EE_CONF_ROOT/nginx/dhparam:/etc/nginx/dhparam -v $EE_CONF_ROOT/nginx/conf.d:/etc/nginx/conf.d -v $EE_CONF_ROOT/nginx/htpasswd:/etc/nginx/htpasswd -v $EE_CONF_ROOT/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v $EE_CONF_ROOT:/app/ee4 -v /usr/share/nginx/html $nginx_proxy_image" ; - - default_launch( 'docker rm -f ee-nginx-proxy', false, true ); - - if ( ! default_launch( $ee_proxy_command, false, true ) ) { - throw new \Exception( ' Unable to restore ee-nginx-proxy container' ); - } - } + if ( 0 === $existing_nginx_proxy_image->return_code ) { + self::$rsp->add_step( + 'upgrade-nginxproxy-container', + 'EE\Migration\Containers::nginxproxy_container_up', + 'EE\Migration\Containers::nginxproxy_container_down', + null, + [ $existing_nginx_proxy_image ] ); } // Upgrade cron container $existing_cron_image = EE::launch( 'docker inspect --format=\'{{.Config.Image}}\' ee-cron-scheduler', false, true ); - if ( $existing_cron_image->return_code === 0 ) { - self::$rsp->execute_step( - function () { - $cron_image = 'easyengine/cron:v' . EE_VERSION; - $cron_scheduler_run_command = 'docker run --name ee-cron-scheduler --restart=always -d -v ' . EE_CONF_ROOT . '/cron:/etc/ofelia:ro -v /var/run/docker.sock:/var/run/docker.sock:ro ' . $cron_image ; - - default_launch( 'docker rm -f ee-cron-scheduler', false, true ); - - if ( ! default_launch( $cron_scheduler_run_command, false, true ) ) { - throw new \Exception( ' Unable to upgrade ee-cron-scheduler container' ); - } - }, - function () use ( $existing_cron_image ) { - $cron_image = trim( $existing_cron_image->stdout ); - $cron_scheduler_run_command = 'docker run --name ee-cron-scheduler --restart=always -d -v ' . EE_CONF_ROOT . '/cron:/etc/ofelia:ro -v /var/run/docker.sock:/var/run/docker.sock:ro ' . $cron_image ; - - default_launch( 'docker rm -f ee-cron-scheduler', false, true ); - - if ( ! default_launch( $cron_scheduler_run_command, false, true ) ) { - throw new \Exception( ' Unable to restore ee-cron-scheduler container' ); - } - } + if ( 0 === $existing_cron_image->return_code ) { + self::$rsp->add_step( + 'upgrade-cron-container', + 'EE\Migration\Containers::cron_container_up', + 'EE\Migration\Containers::cron_container_down', + null, + [ $existing_cron_image ] ); } } + public static function nginxproxy_container_up() { + $EE_CONF_ROOT = EE_CONF_ROOT; + $nginx_proxy_image = 'easyengine/nginx-proxy:v' . EE_VERSION ; + $ee_proxy_command = "docker run --name ee-nginx-proxy -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v $EE_CONF_ROOT/nginx/certs:/etc/nginx/certs -v $EE_CONF_ROOT/nginx/dhparam:/etc/nginx/dhparam -v $EE_CONF_ROOT/nginx/conf.d:/etc/nginx/conf.d -v $EE_CONF_ROOT/nginx/htpasswd:/etc/nginx/htpasswd -v $EE_CONF_ROOT/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v $EE_CONF_ROOT:/app/ee4 -v /usr/share/nginx/html $nginx_proxy_image" ; + + default_launch( 'docker rm -f ee-nginx-proxy', false, true ); + + if ( ! default_launch( $ee_proxy_command, false, true ) ) { + throw new \Exception( ' Unable to upgrade ee-nginx-proxy container' ); + } + + } + + public static function nginxproxy_container_down( $existing_nginx_proxy_image ) { + $EE_CONF_ROOT = EE_CONF_ROOT; + $nginx_proxy_image = trim( $existing_nginx_proxy_image->stout ); + $ee_proxy_command = "docker run --name ee-nginx-proxy -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v $EE_CONF_ROOT/nginx/certs:/etc/nginx/certs -v $EE_CONF_ROOT/nginx/dhparam:/etc/nginx/dhparam -v $EE_CONF_ROOT/nginx/conf.d:/etc/nginx/conf.d -v $EE_CONF_ROOT/nginx/htpasswd:/etc/nginx/htpasswd -v $EE_CONF_ROOT/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v $EE_CONF_ROOT:/app/ee4 -v /usr/share/nginx/html $nginx_proxy_image" ; + + default_launch( 'docker rm -f ee-nginx-proxy', false, true ); + + if ( ! default_launch( $ee_proxy_command, false, true ) ) { + throw new \Exception( ' Unable to restore ee-nginx-proxy container' ); + } + } + + public static function cron_container_up() { + $cron_image = 'easyengine/cron:v' . EE_VERSION; + $cron_scheduler_run_command = 'docker run --name ee-cron-scheduler --restart=always -d -v ' . EE_CONF_ROOT . '/cron:/etc/ofelia:ro -v /var/run/docker.sock:/var/run/docker.sock:ro ' . $cron_image ; + + default_launch( 'docker rm -f ee-cron-scheduler', false, true ); + + if ( ! default_launch( $cron_scheduler_run_command, false, true ) ) { + throw new \Exception( ' Unable to upgrade ee-cron-scheduler container' ); + } + } + public static function cron_container_down( $existing_cron_image ) { + $cron_image = trim( $existing_cron_image->stdout ); + $cron_scheduler_run_command = 'docker run --name ee-cron-scheduler --restart=always -d -v ' . EE_CONF_ROOT . '/cron:/etc/ofelia:ro -v /var/run/docker.sock:/var/run/docker.sock:ro ' . $cron_image ; + + default_launch( 'docker rm -f ee-cron-scheduler', false, true ); + + if ( ! default_launch( $cron_scheduler_run_command, false, true ) ) { + throw new \Exception( ' Unable to restore ee-cron-scheduler container' ); + } + } + /** * Migrates all containers of existing sites */ @@ -88,43 +109,54 @@ private static function migrate_site_containers() { foreach ( $sites as $site ) { + $data = []; $data[] = $site['site_type']; $data[] = $site['cache_type']; $data[] = $site['is_ssl']; $data[] = $site['db_host']; - $docker_compose_contents = $site_docker->generate_docker_compose_yml( $data ); - $docker_compose_path = $site['site_path'] . '/docker-compose.yml'; - $docker_compose_backup_path = $site['site_path'] . '/docker-compose.yml.bak'; + $docker_compose_contents = $site_docker->generate_docker_compose_yml( $data ); + $docker_compose_path = $site['site_path'] . '/docker-compose.yml'; + $docker_compose_backup_path = $site['site_path'] . '/docker-compose.yml.bak'; - self::$rsp->execute_step( - function () use ( $site, $docker_compose_path, $docker_compose_backup_path ) { - if ( ! default_launch( "cp $docker_compose_path $docker_compose_backup_path" ) ) { - throw new \Exception( "Unable to find docker-compose.yml in ${site['site_path']} or couldn't create it's backup file. Ensure that EasyEngine has permission to create file there" ); - } - }, function () {} + self::$rsp->add_step( + "upgrade-${site['sitename']}-copy-compose-file", + 'EE\Migration\Containers::site_copy_compose_file_up', + null, + [ $site, $docker_compose_path, $docker_compose_backup_path ] ); - self::$rsp->execute_step( - function () use ( $site, $docker_compose_backup_path, $docker_compose_path, $docker_compose_contents ) { + self::$rsp->add_step( + "upgrade-${site['sitename']}-containers", + 'EE\Migration\Containers::site_containers_up', + 'EE\Migration\Containers::site_containers_down', + [ $site, $docker_compose_backup_path, $docker_compose_path, $docker_compose_contents ], + [ $site, $docker_compose_backup_path, $docker_compose_path ] + ); + } + } + public static function site_copy_compose_file_up( $site, $docker_compose_path, $docker_compose_backup_path ) { + if ( ! default_launch( "cp $docker_compose_path $docker_compose_backup_path" ) ) { + throw new \Exception( "Unable to find docker-compose.yml in ${site['site_path']} or couldn't create it's backup file. Ensure that EasyEngine has permission to create file there" ); + } + } + public static function site_containers_up( $site, $docker_compose_backup_path, $docker_compose_path, $docker_compose_contents ) { + file_put_contents( $docker_compose_path, $docker_compose_contents ); + $container_upgraded = default_launch( "cd ${site['site_path']} && docker-compose up -d" ); - file_put_contents( $docker_compose_path, $docker_compose_contents ); - $container_upgraded = default_launch( "cd ${site['site_path']} && docker-compose up -d" ); + if ( ! $container_upgraded ) { + throw new \Exception( "Unable to upgrade containers of site: ${site['sitename']}. Please check logs for more details." ); + } - if ( ! $container_upgraded ) { - throw new \Exception( "Unable to upgrade containers of site: ${site['sitename']}. Please check logs for more details." ); - } + unlink( $docker_compose_backup_path ); - unlink( $docker_compose_backup_path ); - }, function () use ( $site, $docker_compose_backup_path, $docker_compose_path ) { - rename( $docker_compose_backup_path, $docker_compose_path ); - $container_downgraded = default_launch( "cd ${site['site_path']} && docker-compose up -d" ); + } + public static function site_containers_down( $site, $docker_compose_backup_path, $docker_compose_path ) { + rename( $docker_compose_backup_path, $docker_compose_path ); + $container_downgraded = default_launch( "cd ${site['site_path']} && docker-compose up -d" ); - if ( ! $container_downgraded ) { - throw new \Exception( "Unable to downgrade containers of ${site['sitename']} site. Please check logs for more details." ); - } - } - ); + if ( ! $container_downgraded ) { + throw new \Exception( "Unable to downgrade containers of ${site['sitename']} site. Please check logs for more details." ); } } @@ -136,6 +168,7 @@ private static function pull_new_images() { self::pull_or_error( 'easyengine/cron', 'v' . EE_VERSION ); self::pull_or_error( 'easyengine/redis', 'v' . EE_VERSION ); self::pull_or_error( 'easyengine/nginx', 'v' . EE_VERSION ); + self::pull_or_error( 'easyengine/postfix', 'v' . EE_VERSION ); self::pull_or_error( 'easyengine/mailhog', 'v' . EE_VERSION ); self::pull_or_error( 'easyengine/mariadb', 'v' . EE_VERSION ); self::pull_or_error( 'easyengine/phpmyadmin', 'v' . EE_VERSION ); @@ -144,7 +177,7 @@ private static function pull_new_images() { private static function pull_or_error( $image, $version ) { if ( ! default_launch( "docker pull $image:$version" ) ) { - EE::error( "Unable to pull $image. Please check logs for more details." ); + throw new \Exception( "Unable to pull $image. Please check logs for more details." ); } } } diff --git a/php/EE/RevertableStepProcessor.php b/php/EE/RevertableStepProcessor.php index 85763c1fb..456f77615 100644 --- a/php/EE/RevertableStepProcessor.php +++ b/php/EE/RevertableStepProcessor.php @@ -1,6 +1,7 @@ <?php namespace EE; +use EE; /** * RevertibleStepProcessor @@ -19,47 +20,45 @@ class RevertableStepProcessor { /** * Adds a new step. * + * @param string $context Context of step. It will be used to display error. * @param callable $up_step Callable that will be called when step is to be executed * @param callable $down_step Callable that will be called when step is to be reverted - * @param string $context Context of step. It will be used to display error. + * @param array $up_params Parameters to pass to $up_step function + * @param array $down_params Parameters to pass to $down_step function + * @return RevertableStepProcessor Returns current object for chaining methods. */ - public function add_step( callable $up_step, callable $down_step, string $context = null ) { + public function add_step( string $context, callable $up_step, callable $down_step = null, array $up_params = null, array $down_params = null ) { $this->steps[] = [ - 'up' => $up_step, - 'down' => $down_step, - 'context' => $context, + 'up' => $up_step, + 'up_params' => $up_params, + 'down' => $down_step, + 'down_params' => $down_params, + 'context' => $context, ]; return $this; // Returns this to enable method chaining } - /** - * Adds new step and executes pending steps. - * - * @param callable $up_step Callable that will be called when step is to be executed - * @param callable $down_step Callable that will be called when step is to be reverted - * @param string $context Context of step. It will be used to display error. - */ - public function execute_step( callable $up_step, callable $down_step, string $context = null ) { - $this->add_step( $up_step, $down_step, $context ); - return $this->execute(); - } - /** * Executes all pending steps. Reverts the steps if any one step throws error. + * @return boolean Returns if the pending steps were executed successfully. */ public function execute() { - for ( $i = $this->execution_index ; $i < count( $this->steps ); $i++ ) { - $context = $this->steps[ $i ]['context']; + $steps_to_execute = array_slice( $this->steps, $this->execution_index ); + + foreach ( $steps_to_execute as $step ) { + $context = $step['context']; try { - echo "Executing $context... "; - call_user_func( $this->steps[ $i ]['up'] ); + EE::debug( "Executing $context... " ); + call_user_func_array( $step['up'], $step['up_params'] ?? []); $this->execution_index++; - echo "done.\n"; + EE::debug( "Executed $context." ); } catch ( \Exception $e ) { $exception_message = $e->getMessage(); - echo "\nEncountered error while processing $context. Exception: $exception_message\n"; + $callable = EE\Utils\get_callable_name( $step['up'] ); + EE::error( "Encountered error while processing $context in $callable. Exception: $exception_message", false ); $this->rollback(); + $this->steps = []; return false; } } @@ -70,15 +69,18 @@ public function execute() { * Rolls back all executed steps. */ public function rollback() { - $context = $this->steps[ $this->execution_index ]['context']; while ( $this->execution_index >= 0 ) { + $step = $this->steps[ $this->execution_index ]; + $context = $step['context']; try { - echo "Reverting $context... "; - call_user_func( $this->steps[ $this->execution_index ]['down'] ); - echo "done.\n"; + EE::debug( "Reverting $context... " ); + if( null !== $step['down'] ) { + call_user_func_array( $step['down'], $step['down_params'] ?? [] ) ; + } + EE::debug( "Reverted $context" ); } catch ( \Exception $e ) { $exception_message = $e->getMessage(); - echo "\nEncountered error while reverting $context: $exception_message. If possible, do it manually\n" ; + EE::debug( "Encountered error while reverting $context: $exception_message. If possible, do it manually" ); } finally { $this->execution_index--; } diff --git a/php/commands/src/CLI_Command.php b/php/commands/src/CLI_Command.php index 3ddda7eba..24e981d33 100644 --- a/php/commands/src/CLI_Command.php +++ b/php/commands/src/CLI_Command.php @@ -163,8 +163,10 @@ public function info( $_, $assoc_args ) { * Function to run migrations required to upgrade to the newer version. Will always be invoked from the newer phar downloaded inside the /tmp folder */ private function migrate() { - EE\Migration\Containers::start_container_migration(); - EE\Migration\Executor::execute_migrations(); + $rsp = new \EE\RevertableStepProcessor(); + $rsp->add_step( 'ee-migrations', 'EE\Migration\Executor::execute_migrations' ); + $rsp->add_step( 'site-migration', 'EE\Migration\Containers::start_container_migration' ); + $rsp->execute(); } /** diff --git a/php/utils.php b/php/utils.php index f490ac8dd..b1033b74a 100644 --- a/php/utils.php +++ b/php/utils.php @@ -1622,3 +1622,21 @@ function array_flatten( array $array ) { return $return; } + +function get_callable_name(callable $callable) { + if (is_string($callable)) { + return trim($callable); + } else if (is_array($callable)) { + if (is_object($callable[0])) { + return sprintf("%s::%s", get_class($callable[0]), trim($callable[1])); + } else { + return sprintf("%s::%s", trim($callable[0]), trim($callable[1])); + } + } else if ($callable instanceof \Closure) { + return 'closure'; + } else { + return 'unknown'; + } +} + +function no_op() {} From 475158881f62859ebe4e3cee83875e276296bd1b Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Wed, 1 Aug 2018 19:57:59 +0530 Subject: [PATCH 0315/1044] Add support for ee3 site creation parameters Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Runner.php | 41 ++++++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 20c265207..70ae02d01 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -522,7 +522,7 @@ public function init_config() { // File config { - $this->global_config_path = $this->get_global_config_path(); + $this->global_config_path = $this->get_global_config_path(); $this->project_config_path = $this->get_project_config_path(); $configurator->merge_yml( $this->global_config_path, $this->alias ); @@ -545,21 +545,36 @@ public function init_config() { if ( empty( $args ) && isset( $assoc_args['version'] ) ) { array_unshift( $args, 'version' ); array_unshift( $args, 'cli' ); - unset( $assoc_args['version'] ); - } + unset( $assoc_args['version'] ); + } + + $ee3_compat_array_map_to_type = [ + 'wp' => 'wp', + 'wpsubdom' => 'wp', + 'wpsubdir' => 'wp', + 'wpredis' => 'wp', + 'html' => 'html', + ]; + + foreach ( $ee3_compat_array_map_to_type as $from => $to ) { + if ( isset( $assoc_args[ $from ] ) ) { + $assoc_args['type'] = $to; + unset( $assoc_args[ $from ] ); + } + } // ee3 backward compatibility flags - $wp_compat_array_map = array( + $wp_compat_array_map = [ 'user' => 'admin_user', 'pass' => 'admin_pass', 'email' => 'admin_email', 'le' => 'letsencrypt', - ); + ]; foreach ( $wp_compat_array_map as $from => $to ) { - if ( isset( $assoc_args[$from] ) ) { - $assoc_args[$to] = $assoc_args[$from]; - unset( $assoc_args[$from] ); + if ( isset( $assoc_args[ $from ] ) ) { + $assoc_args[ $to ] = $assoc_args[ $from ]; + unset( $assoc_args[ $from ] ); } } @@ -573,8 +588,8 @@ public function init_config() { $old_arg = array_intersect( $unsupported_create_old_args, array_keys( $assoc_args ) ); - $old_args = implode(' --',$old_arg); - if ( isset($args[1]) && 'create' === $args[1] && ! empty ($old_arg) ) { + $old_args = implode( ' --', $old_arg ); + if ( isset( $args[1] ) && 'create' === $args[1] && ! empty ( $old_arg ) ) { \EE::error( "Sorry, --$old_args flag/s is/are no longer supported in EE v4.\nPlease run `ee help " . implode( ' ', $args ) . '`.' ); } @@ -586,9 +601,9 @@ public function init_config() { list( $this->config, $this->extra_config ) = $configurator->to_array(); $this->aliases = $configurator->get_aliases(); if ( count( $this->aliases ) && ! isset( $this->aliases['@all'] ) ) { - $this->aliases = array_reverse( $this->aliases ); + $this->aliases = array_reverse( $this->aliases ); $this->aliases['@all'] = 'Run command against every registered alias.'; - $this->aliases = array_reverse( $this->aliases ); + $this->aliases = array_reverse( $this->aliases ); } //$this->_required_files['runtime'] = $this->config['require']; } @@ -678,7 +693,7 @@ public function route() { $this->init_ee(); // Run routing only for `site` command. - if ( 'site' !== $this->arguments[0] ) { + if ( ! isset( $this->arguments[0] ) || 'site' !== $this->arguments[0] ) { return; } From a9297f155958310b913695d3aad6ad893d7e40fb Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 2 Aug 2018 13:48:34 +0530 Subject: [PATCH 0316/1044] Add loading of logger for EE::launch in test Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- features/bootstrap/FeatureContext.php | 38 +++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/features/bootstrap/FeatureContext.php b/features/bootstrap/FeatureContext.php index 93dd27871..2fbedb28a 100644 --- a/features/bootstrap/FeatureContext.php +++ b/features/bootstrap/FeatureContext.php @@ -1,7 +1,41 @@ <?php -include_once(__DIR__ . '/../../php/class-ee.php'); -include_once(__DIR__ . '/../../php/utils.php'); +define('EE_ROOT',__DIR__ . '/../..'); + +include_once(EE_ROOT . '/php/class-ee.php'); +include_once(EE_ROOT . '/php/EE/Runner.php'); +include_once(EE_ROOT . '/php/utils.php'); + +// Can be used by plugins/themes to check if EE is running or not +define( 'EE', true ); +define( 'EE_VERSION', trim( file_get_contents( EE_ROOT . '/VERSION' ) ) ); +define( 'EE_CONF_ROOT', '/opt/easyengine' ); + +require_once EE_ROOT . '/php/bootstrap.php'; + +if ( ! class_exists( 'EE\Runner' ) ) { + require_once EE_ROOT . '/php/EE/Runner.php'; +} + +if ( ! class_exists( 'EE\Configurator' ) ) { + require_once EE_ROOT . '/php/EE/Configurator.php'; +} + +$logger_dir = EE_ROOT . '/php/EE/Loggers'; +$iterator = new \DirectoryIterator( $logger_dir ); + +// Make sure the base class is declared first. +include_once "$logger_dir/Base.php"; + +foreach ( $iterator as $filename ) { + if ( '.php' !== substr( $filename, - 4 ) ) { + continue; + } + + include_once "$logger_dir/$filename"; +} +$runner = \EE::get_runner(); +$runner->init_logger(); use Behat\Behat\Context\Context; use Behat\Behat\Hook\Scope\AfterFeatureScope; From e7237431d0af382ada086ce26b131043d81fa908 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 2 Aug 2018 14:04:59 +0530 Subject: [PATCH 0317/1044] Update function calls in site utils and class Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/class-ee-site.php | 2 +- php/site-utils.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/php/class-ee-site.php b/php/class-ee-site.php index 64472c206..9a594a0b6 100644 --- a/php/class-ee-site.php +++ b/php/class-ee-site.php @@ -140,7 +140,7 @@ protected function delete_site( $level, $site_name, $site_root ) { if ( EE::docker()::docker_compose_down( $site_root ) ) { EE::log( "[$site_name] Docker Containers removed." ); } else { - EE\Utils\default_launch( "docker rm -f $(docker ps -q -f=label=created_by=EasyEngine -f=label=site_name=$site_name)" ); + EE::exec( "docker rm -f $(docker ps -q -f=label=created_by=EasyEngine -f=label=site_name=$site_name)" ); if ( $level > 3 ) { EE::warning( 'Error in removing docker containers.' ); } diff --git a/php/site-utils.php b/php/site-utils.php index 3c5598c09..0ffccb682 100644 --- a/php/site-utils.php +++ b/php/site-utils.php @@ -207,7 +207,7 @@ function create_etc_hosts_entry( $site_name ) { $host_line = LOCALHOST_IP . "\t$site_name"; $etc_hosts = file_get_contents( '/etc/hosts' ); if ( ! preg_match( "/\s+$site_name\$/m", $etc_hosts ) ) { - if ( EE\Utils\default_launch( "/bin/bash -c 'echo \"$host_line\" >> /etc/hosts'" ) ) { + if ( EE::exec( "/bin/bash -c 'echo \"$host_line\" >> /etc/hosts'" ) ) { EE::success( 'Host entry successfully added.' ); } else { EE::warning( "Failed to add $site_name in host entry, Please do it manually!" ); @@ -281,7 +281,7 @@ function start_site_containers( $site_root ) { EE::log( 'Pulling latest images. This may take some time.' ); chdir( $site_root ); - \EE\Utils\default_launch( 'docker-compose pull' ); + \EE::exec( 'docker-compose pull' ); EE::log( 'Starting site\'s services.' ); if ( ! EE::docker()::docker_compose_up( $site_root ) ) { throw new \Exception( 'There was some error in docker-compose up.' ); @@ -303,5 +303,5 @@ function run_compose_command( $action, $container, $action_to_display = null, $s $display_service = $service_to_display ? $service_to_display : $container; \EE::log( ucfirst( $display_action ) . 'ing ' . $display_service ); - \EE\Utils\default_launch( "docker-compose $action $container", true, true ); + \EE::exec( "docker-compose $action $container", true, true ); } From 5b3cf33be37d29d2d6084ca3b5b2c06671336a62 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Thu, 2 Aug 2018 14:11:53 +0530 Subject: [PATCH 0318/1044] Made changes according to PR Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/EE/Migration/Containers.php | 204 +++++++++++++++++++---------- php/EE/RevertableStepProcessor.php | 31 +++-- php/utils.php | 56 ++++---- 3 files changed, 187 insertions(+), 104 deletions(-) diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index 97be08431..2fed51e41 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -1,6 +1,7 @@ <?php namespace EE\Migration; + use EE\RevertableStepProcessor; use function EE\Utils\default_launch; use EE; @@ -10,9 +11,14 @@ */ class Containers { - /** @var RevertableStepProcessor $rsp Keeps track of */ + /** @var RevertableStepProcessor $rsp Keeps track of migration state. Reverts on error */ private static $rsp; + /** + * Main entry point for the script. Migrates all containers + * + * @throws \Exception + */ public static function start_container_migration() { EE\Utils\delem_log( 'Starting container migration' ); @@ -20,13 +26,81 @@ public static function start_container_migration() { self::pull_new_images(); self::migrate_site_containers(); self::migrate_global_containers(); - if( ! self::$rsp->execute() ) { - throw new \Exception( "Unable to migrate sites to newer version" ); + if ( ! self::$rsp->execute() ) { + throw new \Exception( 'Unable to migrate sites to newer version' ); } EE\Utils\delem_log( 'Container migration completed' ); } + /** + * Pulls new images of all containers used by easyengine + */ + private static function pull_new_images() { + self::pull_or_error( 'easyengine/php', 'v' . EE_VERSION ); + self::pull_or_error( 'easyengine/cron', 'v' . EE_VERSION ); + self::pull_or_error( 'easyengine/redis', 'v' . EE_VERSION ); + self::pull_or_error( 'easyengine/nginx', 'v' . EE_VERSION ); + self::pull_or_error( 'easyengine/postfix', 'v' . EE_VERSION ); + self::pull_or_error( 'easyengine/mailhog', 'v' . EE_VERSION ); + self::pull_or_error( 'easyengine/mariadb', 'v' . EE_VERSION ); + self::pull_or_error( 'easyengine/phpmyadmin', 'v' . EE_VERSION ); + self::pull_or_error( 'easyengine/nginx-proxy', 'v' . EE_VERSION ); + } + + /** + * Helper method to ensure exception is thrown if image isn't pulled + * + * @param $image docker image to pull + * @param $version version of image to pull + * + * @throws \Exception + */ + private static function pull_or_error( $image, $version ) { + if ( ! default_launch( "docker pull $image:$version" ) ) { + throw new \Exception( "Unable to pull $image. Please check logs for more details." ); + } + } + + /** + * Migrates all containers of existing sites + */ + private static function migrate_site_containers() { + $sites = \EE_DB::select( [ 'sitename', 'site_path', 'site_type', 'cache_type', 'is_ssl', 'db_host' ] ); + $site_docker = new \Site_Docker(); + + foreach ( $sites as $site ) { + + $data = []; + $data[] = $site['site_type']; + $data[] = $site['cache_type']; + $data[] = $site['is_ssl']; + $data[] = $site['db_host']; + + $docker_compose_contents = $site_docker->generate_docker_compose_yml( $data ); + $docker_compose_path = $site['site_path'] . '/docker-compose.yml'; + $docker_compose_backup_path = $site['site_path'] . '/docker-compose.yml.bak'; + + self::$rsp->add_step( + "upgrade-${site['sitename']}-copy-compose-file", + 'EE\Migration\Containers::site_copy_compose_file_up', + null, + [ $site, $docker_compose_path, $docker_compose_backup_path ] + ); + + self::$rsp->add_step( + "upgrade-${site['sitename']}-containers", + 'EE\Migration\Containers::site_containers_up', + 'EE\Migration\Containers::site_containers_down', + [ $site, $docker_compose_backup_path, $docker_compose_path, $docker_compose_contents ], + [ $site, $docker_compose_backup_path, $docker_compose_path ] + ); + } + } + + /** + * Migrates global containers. These are container which are not created per site (i.e. ee-cron-scheduler) + */ private static function migrate_global_containers() { // Upgrade nginx-proxy container @@ -54,10 +128,15 @@ private static function migrate_global_containers() { } } + /** + * Upgrades nginx-proxy container + * + * @throws \Exception + */ public static function nginxproxy_container_up() { $EE_CONF_ROOT = EE_CONF_ROOT; - $nginx_proxy_image = 'easyengine/nginx-proxy:v' . EE_VERSION ; - $ee_proxy_command = "docker run --name ee-nginx-proxy -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v $EE_CONF_ROOT/nginx/certs:/etc/nginx/certs -v $EE_CONF_ROOT/nginx/dhparam:/etc/nginx/dhparam -v $EE_CONF_ROOT/nginx/conf.d:/etc/nginx/conf.d -v $EE_CONF_ROOT/nginx/htpasswd:/etc/nginx/htpasswd -v $EE_CONF_ROOT/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v $EE_CONF_ROOT:/app/ee4 -v /usr/share/nginx/html $nginx_proxy_image" ; + $nginx_proxy_image = 'easyengine/nginx-proxy:v' . EE_VERSION; + $ee_proxy_command = "docker run --name ee-nginx-proxy -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v $EE_CONF_ROOT/nginx/certs:/etc/nginx/certs -v $EE_CONF_ROOT/nginx/dhparam:/etc/nginx/dhparam -v $EE_CONF_ROOT/nginx/conf.d:/etc/nginx/conf.d -v $EE_CONF_ROOT/nginx/htpasswd:/etc/nginx/htpasswd -v $EE_CONF_ROOT/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v $EE_CONF_ROOT:/app/ee4 -v /usr/share/nginx/html $nginx_proxy_image"; default_launch( 'docker rm -f ee-nginx-proxy', false, true ); @@ -67,10 +146,17 @@ public static function nginxproxy_container_up() { } + /** + * Downgrades nginx-proxy container + * + * @param $existing_nginx_proxy_image Old nginx-proxy image name + * + * @throws \Exception + */ public static function nginxproxy_container_down( $existing_nginx_proxy_image ) { $EE_CONF_ROOT = EE_CONF_ROOT; $nginx_proxy_image = trim( $existing_nginx_proxy_image->stout ); - $ee_proxy_command = "docker run --name ee-nginx-proxy -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v $EE_CONF_ROOT/nginx/certs:/etc/nginx/certs -v $EE_CONF_ROOT/nginx/dhparam:/etc/nginx/dhparam -v $EE_CONF_ROOT/nginx/conf.d:/etc/nginx/conf.d -v $EE_CONF_ROOT/nginx/htpasswd:/etc/nginx/htpasswd -v $EE_CONF_ROOT/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v $EE_CONF_ROOT:/app/ee4 -v /usr/share/nginx/html $nginx_proxy_image" ; + $ee_proxy_command = "docker run --name ee-nginx-proxy -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v $EE_CONF_ROOT/nginx/certs:/etc/nginx/certs -v $EE_CONF_ROOT/nginx/dhparam:/etc/nginx/dhparam -v $EE_CONF_ROOT/nginx/conf.d:/etc/nginx/conf.d -v $EE_CONF_ROOT/nginx/htpasswd:/etc/nginx/htpasswd -v $EE_CONF_ROOT/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v $EE_CONF_ROOT:/app/ee4 -v /usr/share/nginx/html $nginx_proxy_image"; default_launch( 'docker rm -f ee-nginx-proxy', false, true ); @@ -79,9 +165,14 @@ public static function nginxproxy_container_down( $existing_nginx_proxy_image ) } } + /** + * Upgrades ee-cron-scheduler container + * + * @throws \Exception + */ public static function cron_container_up() { - $cron_image = 'easyengine/cron:v' . EE_VERSION; - $cron_scheduler_run_command = 'docker run --name ee-cron-scheduler --restart=always -d -v ' . EE_CONF_ROOT . '/cron:/etc/ofelia:ro -v /var/run/docker.sock:/var/run/docker.sock:ro ' . $cron_image ; + $cron_image = 'easyengine/cron:v' . EE_VERSION; + $cron_scheduler_run_command = 'docker run --name ee-cron-scheduler --restart=always -d -v ' . EE_CONF_ROOT . '/cron:/etc/ofelia:ro -v /var/run/docker.sock:/var/run/docker.sock:ro ' . $cron_image; default_launch( 'docker rm -f ee-cron-scheduler', false, true ); @@ -89,9 +180,17 @@ public static function cron_container_up() { throw new \Exception( ' Unable to upgrade ee-cron-scheduler container' ); } } + + /** + * Downgrades ee-cron-scheduler container + * + * @param $existing_cron_image Old nginx-proxy image name + * + * @throws \Exception + */ public static function cron_container_down( $existing_cron_image ) { - $cron_image = trim( $existing_cron_image->stdout ); - $cron_scheduler_run_command = 'docker run --name ee-cron-scheduler --restart=always -d -v ' . EE_CONF_ROOT . '/cron:/etc/ofelia:ro -v /var/run/docker.sock:/var/run/docker.sock:ro ' . $cron_image ; + $cron_image = trim( $existing_cron_image->stdout ); + $cron_scheduler_run_command = 'docker run --name ee-cron-scheduler --restart=always -d -v ' . EE_CONF_ROOT . '/cron:/etc/ofelia:ro -v /var/run/docker.sock:/var/run/docker.sock:ro ' . $cron_image; default_launch( 'docker rm -f ee-cron-scheduler', false, true ); @@ -101,45 +200,30 @@ public static function cron_container_down( $existing_cron_image ) { } /** - * Migrates all containers of existing sites + * Copies updated docker-compose file site root + * + * @param $site Name of site + * @param $docker_compose_path Path where docker-compose.yml is to be copied + * @param $docker_compose_backup_path Path old docker-compose.yml is to be copied for backup + * + * @throws \Exception */ - private static function migrate_site_containers() { - $sites = \EE_DB::select( [ 'sitename', 'site_path', 'site_type', 'cache_type', 'is_ssl', 'db_host' ] ); - $site_docker = new \Site_Docker(); - - foreach ( $sites as $site ) { - - $data = []; - $data[] = $site['site_type']; - $data[] = $site['cache_type']; - $data[] = $site['is_ssl']; - $data[] = $site['db_host']; - - $docker_compose_contents = $site_docker->generate_docker_compose_yml( $data ); - $docker_compose_path = $site['site_path'] . '/docker-compose.yml'; - $docker_compose_backup_path = $site['site_path'] . '/docker-compose.yml.bak'; - - self::$rsp->add_step( - "upgrade-${site['sitename']}-copy-compose-file", - 'EE\Migration\Containers::site_copy_compose_file_up', - null, - [ $site, $docker_compose_path, $docker_compose_backup_path ] - ); - - self::$rsp->add_step( - "upgrade-${site['sitename']}-containers", - 'EE\Migration\Containers::site_containers_up', - 'EE\Migration\Containers::site_containers_down', - [ $site, $docker_compose_backup_path, $docker_compose_path, $docker_compose_contents ], - [ $site, $docker_compose_backup_path, $docker_compose_path ] - ); - } - } public static function site_copy_compose_file_up( $site, $docker_compose_path, $docker_compose_backup_path ) { if ( ! default_launch( "cp $docker_compose_path $docker_compose_backup_path" ) ) { throw new \Exception( "Unable to find docker-compose.yml in ${site['site_path']} or couldn't create it's backup file. Ensure that EasyEngine has permission to create file there" ); } } + + /** + * Upgrades site container of a site + * + * @param $site Name of site + * @param $docker_compose_backup_path Path of old docker-compose.yml file + * @param $docker_compose_path Path of updated docker-compose.yml file + * @param $docker_compose_contents Contents of updated docker-compose.yml file + * + * @throws \Exception + */ public static function site_containers_up( $site, $docker_compose_backup_path, $docker_compose_path, $docker_compose_contents ) { file_put_contents( $docker_compose_path, $docker_compose_contents ); $container_upgraded = default_launch( "cd ${site['site_path']} && docker-compose up -d" ); @@ -147,10 +231,17 @@ public static function site_containers_up( $site, $docker_compose_backup_path, $ if ( ! $container_upgraded ) { throw new \Exception( "Unable to upgrade containers of site: ${site['sitename']}. Please check logs for more details." ); } - - unlink( $docker_compose_backup_path ); - } + + /** + * Downgrades container of a site. + * + * @param $site Name of site + * @param $docker_compose_backup_path Path of old docker-compose.yml file + * @param $docker_compose_path Path of updated docker-compose.yml file + * + * @throws \Exception + */ public static function site_containers_down( $site, $docker_compose_backup_path, $docker_compose_path ) { rename( $docker_compose_backup_path, $docker_compose_path ); $container_downgraded = default_launch( "cd ${site['site_path']} && docker-compose up -d" ); @@ -159,25 +250,4 @@ public static function site_containers_down( $site, $docker_compose_backup_path, throw new \Exception( "Unable to downgrade containers of ${site['sitename']} site. Please check logs for more details." ); } } - - /** - * Pulls new images of all containers used by easyengine - */ - private static function pull_new_images() { - self::pull_or_error( 'easyengine/php', 'v' . EE_VERSION ); - self::pull_or_error( 'easyengine/cron', 'v' . EE_VERSION ); - self::pull_or_error( 'easyengine/redis', 'v' . EE_VERSION ); - self::pull_or_error( 'easyengine/nginx', 'v' . EE_VERSION ); - self::pull_or_error( 'easyengine/postfix', 'v' . EE_VERSION ); - self::pull_or_error( 'easyengine/mailhog', 'v' . EE_VERSION ); - self::pull_or_error( 'easyengine/mariadb', 'v' . EE_VERSION ); - self::pull_or_error( 'easyengine/phpmyadmin', 'v' . EE_VERSION ); - self::pull_or_error( 'easyengine/nginx-proxy', 'v' . EE_VERSION ); - } - - private static function pull_or_error( $image, $version ) { - if ( ! default_launch( "docker pull $image:$version" ) ) { - throw new \Exception( "Unable to pull $image. Please check logs for more details." ); - } - } } diff --git a/php/EE/RevertableStepProcessor.php b/php/EE/RevertableStepProcessor.php index 456f77615..993062eb0 100644 --- a/php/EE/RevertableStepProcessor.php +++ b/php/EE/RevertableStepProcessor.php @@ -1,6 +1,7 @@ <?php namespace EE; + use EE; /** @@ -20,14 +21,15 @@ class RevertableStepProcessor { /** * Adds a new step. * - * @param string $context Context of step. It will be used to display error. - * @param callable $up_step Callable that will be called when step is to be executed - * @param callable $down_step Callable that will be called when step is to be reverted - * @param array $up_params Parameters to pass to $up_step function - * @param array $down_params Parameters to pass to $down_step function + * @param string $context Context of step. It will be used to display error. + * @param callable $up_step Callable that will be called when step is to be executed + * @param callable $down_step Callable that will be called when step is to be reverted + * @param array $up_params Parameters to pass to $up_step function + * @param array $down_params Parameters to pass to $down_step function + * * @return RevertableStepProcessor Returns current object for chaining methods. */ - public function add_step( string $context, callable $up_step, callable $down_step = null, array $up_params = null, array $down_params = null ) { + public function add_step( string $context, callable $up_step, callable $down_step = null, array $up_params = null, array $down_params = null ) { $this->steps[] = [ 'up' => $up_step, 'up_params' => $up_params, @@ -41,6 +43,7 @@ public function add_step( string $context, callable $up_step, callable $down_ste /** * Executes all pending steps. Reverts the steps if any one step throws error. + * * @return boolean Returns if the pending steps were executed successfully. */ public function execute() { @@ -50,18 +53,20 @@ public function execute() { $context = $step['context']; try { EE::debug( "Executing $context... " ); - call_user_func_array( $step['up'], $step['up_params'] ?? []); - $this->execution_index++; + call_user_func_array( $step['up'], $step['up_params'] ?? [] ); + $this->execution_index ++; EE::debug( "Executed $context." ); } catch ( \Exception $e ) { $exception_message = $e->getMessage(); - $callable = EE\Utils\get_callable_name( $step['up'] ); + $callable = EE\Utils\get_callable_name( $step['up'] ); EE::error( "Encountered error while processing $context in $callable. Exception: $exception_message", false ); $this->rollback(); $this->steps = []; + return false; } } + return true; } @@ -70,19 +75,19 @@ public function execute() { */ public function rollback() { while ( $this->execution_index >= 0 ) { - $step = $this->steps[ $this->execution_index ]; + $step = $this->steps[ $this->execution_index ]; $context = $step['context']; try { EE::debug( "Reverting $context... " ); - if( null !== $step['down'] ) { - call_user_func_array( $step['down'], $step['down_params'] ?? [] ) ; + if ( null !== $step['down'] ) { + call_user_func_array( $step['down'], $step['down_params'] ?? [] ); } EE::debug( "Reverted $context" ); } catch ( \Exception $e ) { $exception_message = $e->getMessage(); EE::debug( "Encountered error while reverting $context: $exception_message. If possible, do it manually" ); } finally { - $this->execution_index--; + $this->execution_index --; } } } diff --git a/php/utils.php b/php/utils.php index b1033b74a..7dfa6a6bb 100644 --- a/php/utils.php +++ b/php/utils.php @@ -1392,7 +1392,7 @@ function random_password( $length = 12 ) { $alphaLength = strlen( $alphabet ) - 1; for ( $i = 0; $i < $length; $i ++ ) { $n = rand( 0, $alphaLength ); - $pass[] = $alphabet[$n]; + $pass[] = $alphabet[ $n ]; } return implode( $pass ); @@ -1441,10 +1441,10 @@ function default_launch( $command, $echo_stdout = false, $echo_stderr = false, $ $launch = EE::launch( $command, false, true, $env, $cwd ); default_debug( $launch ); - if( $echo_stdout ) { + if ( $echo_stdout ) { echo $launch->stdout; } - if( $echo_stderr ) { + if ( $echo_stderr ) { echo $launch->stderr; } if ( ! $launch->return_code ) { @@ -1501,7 +1501,7 @@ function get_type( $assoc_args, $arg_types, $default = false ) { } if ( $cnt == 1 ) { return $type; - } else if ( $cnt == 0 ) { + } elseif ( $cnt == 0 ) { return $default; } else { return false; @@ -1564,7 +1564,11 @@ function get_site_name() { if ( 1 === count( $site_name ) ) { $name = reset( $site_name ); - $path = EE::db()::select( array( 'site_path' ), array( 'sitename' => $name ) ); + $path = EE::db()::select( + array( 'site_path' ), array( + 'sitename' => $name, + ) + ); if ( $path ) { $site_path = $path[0]['site_path']; if ( $site_path === substr( $cwd, 0, strlen( $site_path ) ) ) { @@ -1578,15 +1582,14 @@ function get_site_name() { } /** - * Function to set the site-name in the args when ee is running in a site folder and the site-name has not been passed in the args. If the site-name could not be found it will throw an error. + * @param $args + * @param $command + * @param bool $arg_zero * - * @param array $args The passed arguments. - * @param String $command The command passing the arguments to auto-detect site-name. - * @param bool $arg_zero Site-name will be present in the first argument. Default true. - * - * @return array Arguments with site-name set. + * @return mixed + * @throws EE\ExitException */ -function set_site_arg( $args, $command, $arg_zero=true ) { +function set_site_arg( $args, $command, $arg_zero = true ) { if ( isset( $args[0] ) ) { if ( EE::db()::site_in_db( $args[0] ) ) { return $args; @@ -1616,27 +1619,32 @@ function array_flatten( array $array ) { $return = array(); array_walk_recursive( $array, function ( $a ) use ( &$return ) { - $return[] = $a; - } + $return[] = $a; + } ); return $return; } -function get_callable_name(callable $callable) { - if (is_string($callable)) { - return trim($callable); - } else if (is_array($callable)) { - if (is_object($callable[0])) { - return sprintf("%s::%s", get_class($callable[0]), trim($callable[1])); +/** + * Gets name of callable in string. Helpful while displaying it in error messages + * + * @param callable $callable Callable object + * + * @return string + */ +function get_callable_name( callable $callable ) { + if ( is_string( $callable ) ) { + return trim( $callable ); + } elseif ( is_array( $callable ) ) { + if ( is_object( $callable[0] ) ) { + return sprintf( '%s::%s', get_class( $callable[0] ), trim( $callable[1] ) ); } else { - return sprintf("%s::%s", trim($callable[0]), trim($callable[1])); + return sprintf( '%s::%s', trim( $callable[0] ), trim( $callable[1] ) ); } - } else if ($callable instanceof \Closure) { + } elseif ( $callable instanceof \Closure ) { return 'closure'; } else { return 'unknown'; } } - -function no_op() {} From cbd23a3958cca6e893448589aae5f1e3079ad237 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Wed, 1 Aug 2018 20:28:06 +0530 Subject: [PATCH 0319/1044] Initial db refactoring code --- php/class-ee-db.php | 240 +++++++++++++++++++++++++------------------- php/class-ee.php | 6 +- 2 files changed, 137 insertions(+), 109 deletions(-) diff --git a/php/class-ee-db.php b/php/class-ee-db.php index c9f77ec04..9ccf221cc 100644 --- a/php/class-ee-db.php +++ b/php/class-ee-db.php @@ -3,6 +3,9 @@ class EE_DB { private static $db; + private $tables; + private $where; + private $limit; public function __construct() { if ( empty( self::$db ) ) { @@ -17,9 +20,9 @@ public function __destruct() { /** * Function to initialize db and db connection. */ - public static function init_db() { + private static function init_db() { if ( ! ( file_exists( DB ) ) ) { - self::$db = self::create(); + self::$db = self::create_required_tables(); } else { self::$db = new SQLite3( DB ); if ( ! self::$db ) { @@ -31,9 +34,9 @@ public static function init_db() { /** * Sqlite database creation. */ - public static function create() { + private static function create_required_tables() { self::$db = new SQLite3( DB ); - $query = "CREATE TABLE sites ( + $query = 'CREATE TABLE sites ( id INTEGER NOT NULL, sitename VARCHAR, site_type VARCHAR, @@ -61,14 +64,14 @@ public static function create() { UNIQUE (sitename), CHECK (is_enabled IN (0, 1)), CHECK (is_ssl IN (0, 1)) - );"; + );'; - $query .= "CREATE TABLE migrations ( + $query .= 'CREATE TABLE migrations ( migration VARCHAR, timestamp DATETIME - );"; + );'; - $query .= "CREATE TABLE services ( + $query .= 'CREATE TABLE services ( id INTEGER NOT NULL, sitename VARCHAR, phpmyadmin BOOLEAN DEFAULT 0, @@ -80,18 +83,30 @@ public static function create() { debug BOOLEAN DEFAULT 0, PRIMARY KEY (id), FOREIGN KEY (id) REFERENCES sites(id) - );"; + );'; - $query .= "CREATE TABLE cron ( + $query .= 'CREATE TABLE cron ( id INTEGER PRIMARY KEY AUTOINCREMENT, sitename VARCHAR, command VARCHAR, schedule VARCHAR - );"; + );'; self::$db->exec( $query ); } + /** + * Select table to do operation on. + * + * @param array $data in key value pair. + * + * @return bool + */ + public function table() { + $this->tables = func_get_args(); + return $this; + } + /** * Insert row in table. * @@ -99,83 +114,94 @@ public static function create() { * * @return bool */ - public static function insert( $data, $table_name = 'sites' ) { + public function where() { + $this->where = func_get_args(); + return $this; + } - if ( empty ( self::$db ) ) { - self::init_db(); - } + /** + * Insert row in table. + * + * @param array $data in key value pair. + * + * @return bool + */ + public function limit( $limit ) { + $this->limit = $limit; + return $this; + } + /** + * Insert row in table. + * + * @param array $data in key value pair. + * + * @return bool + */ + public function insert( $data ) { - $fields = '`' . implode( '`, `', array_keys( $data ) ) . '`'; - $formats = '"' . implode( '", "', $data ) . '"'; + $fields = implode( ', ', array_keys( $data ) ); + $values = '"' . implode( '", "', $data ) . '"'; - $insert_query = "INSERT INTO `$table_name` ($fields) VALUES ($formats);"; + if ( empty( $this->table ) ) { + throw new Exception( 'Insert: No table specified' ); + } + + if( count( $this->table ) > 1) { + throw new Exception( 'Insert: Multiple table specified' ); + } + $table = $this->tables[0]; - $insert_query_exec = self::$db->exec( $insert_query ); + $query = "INSERT INTO `$table` ($fields) VALUES ($values);"; - if ( ! $insert_query_exec ) { + $query_exec = self::$db->exec( $query ); + + if ( ! $query_exec ) { EE::debug( self::$db->lastErrorMsg() ); - } else { - return true; + return false; } - return false; + return true; } /** - * @param array $columns - * @param array $where - * @param string $table_name - * @param int|null $limit * Select data from the database. * - * @return array|bool + * @return array */ - public static function select( $columns = array(), $where = array(), $table_name = 'sites', $limit = null ) { + public function select( ...$args ) { - if ( empty ( self::$db ) ) { - self::init_db(); + if ( null === $this->tables ) { + throw new Exception( 'Select: No table specified' ); } - $conditions = array(); - if ( empty( $columns ) ) { + $tables = implode( ', ', $this->tables ); + + if ( empty( $args ) ) { $columns = '*'; } else { - $columns = implode( ', ', $columns ); - } - - foreach ( $where as $key => $value ) { - $conditions[] = "`$key`='" . $value . "'"; + $columns = implode( ', ', $args ); } - $conditions = implode( ' AND ', $conditions ); - - $select_data_query = "SELECT {$columns} FROM `$table_name`"; + $query = "SELECT $columns FROM $tables" ; - if ( ! empty( $conditions ) ) { - $select_data_query .= " WHERE $conditions"; + if ( null !== $this->where ) { + $conditions = implode( ' AND ', $this->where ); + $query .= " WHERE $conditions"; } - - if ( ! empty( $limit ) ) { - $select_data_query .= " LIMIT $limit"; + if ( null !== $this->limit ) { + $query .= ' LIMIT ' . $this->limit; } - $select_data_exec = self::$db->query( $select_data_query ); - $select_data = array(); - if ( $select_data_exec ) { - while ( $row = $select_data_exec->fetchArray( SQLITE3_ASSOC ) ) { - $select_data[] = $row; - } - } - if ( empty( $select_data ) ) { - return false; - } + $query_exec = self::$db->query( $query ); + $result = array(); - if ( 1 === $limit ) { - return $select_data[0]; + if ( $query_exec ) { + while ( $row = $query_exec->fetchArray( SQLITE3_ASSOC ) ) { + $result[] = $row; + } } - - return $select_data; + return $result; } @@ -187,32 +213,35 @@ public static function select( $columns = array(), $where = array(), $table_name * * @return bool */ - public static function update( $data, $where, $table_name = 'sites' ) { - if ( empty ( self::$db ) ) { - self::init_db(); + public function update( ...$values ) { + if ( empty( $this->tables ) ) { + throw new Exception( 'Update: No table specified' ); } - $fields = array(); - $conditions = array(); - foreach ( $data as $key => $value ) { - $fields[] = "`$key`='" . $value . "'"; + if ( empty( $this->where ) ) { + throw new Exception( 'Delete: No where clause specified' ); } - foreach ( $where as $key => $value ) { - $conditions[] = "`$key`='" . $value . "'"; + + if( count( $this->tables ) > 1) { + throw new Exception( 'Update: Multiple table specified' ); } - $fields = implode( ', ', $fields ); - $conditions = implode( ' AND ', $conditions ); - if ( ! empty( $fields ) ) { - $update_query = "UPDATE `$table_name` SET $fields WHERE $conditions"; - $update_query_exec = self::$db->exec( $update_query ); - if ( ! $update_query_exec ) { - EE::debug( self::$db->lastErrorMsg() ); - } else { - return true; - } + $table = $this->tables[0]; + + $values = implode( ', ', $values ); + $conditions = implode( ' AND ', $this->where ); + + if ( empty( $values ) ) { + return false; } - return false; + $table = $this->tables[0]; + $query = "UPDATE `$table` SET $values WHERE $conditions"; + $query_exec = self::$db->exec( $query ); + if ( ! $query_exec ) { + EE::debug( self::$db->lastErrorMsg() ); + return false; + } + return true; } /** @@ -222,19 +251,27 @@ public static function update( $data, $where, $table_name = 'sites' ) { * * @return bool */ - public static function delete( $where, $table_name = 'sites' ) { + public function delete() { + if ( empty( $this->tables ) ) { + throw new Exception( 'Delete: No table specified' ); + } + + if ( empty( $this->where ) ) { + throw new Exception( 'Delete: No where clause specified' ); + } - $conditions = array(); - foreach ( $where as $key => $value ) { - $conditions[] = "`$key`='" . $value . "'"; + if( count( $this->tables ) > 1) { + throw new Exception( 'Delete: Multiple table specified' ); } - $conditions = implode( ' AND ', $conditions ); - $delete_query = "DELETE FROM `$table_name` WHERE $conditions"; + $table = $this->tables[0]; - $delete_query_exec = self::$db->exec( $delete_query ); + $conditions = implode( ' AND ', $this->where ); + $query = "DELETE FROM `$table` WHERE $conditions"; - if ( ! $delete_query_exec ) { + $query_exec = self::$db->exec( $query ); + + if ( ! $query_exec ) { EE::debug( self::$db->lastErrorMsg() ); } else { return true; @@ -252,17 +289,16 @@ public static function delete( $where, $table_name = 'sites' ) { */ public static function site_in_db( $site_name ) { - if ( empty ( self::$db ) ) { - self::init_db(); - } - - $site = self::select( array( 'id' ), array( 'sitename' => $site_name ) ); + $site = self::select( + array( 'id' ), array( + 'sitename' => $site_name, + ) + ); if ( $site ) { return true; - } else { - return false; } + return false; } /** @@ -275,11 +311,11 @@ public static function site_in_db( $site_name ) { */ public static function site_enabled( $site_name ) { - if ( empty ( self::$db ) ) { - self::init_db(); - } - - $site = self::select( array( 'id', 'is_enabled' ), array( 'sitename' => $site_name ) ); + $site = self::select( + array( 'id', 'is_enabled' ), array( + 'sitename' => $site_name, + ) + ); if ( 1 === count( $site ) ) { return $site[0]['is_enabled']; @@ -311,10 +347,6 @@ public static function get_site_command( $site_name ) { */ public static function get_migrations() { - if ( empty ( self::$db ) ) { - self::init_db(); - } - $sites = self::select( [ 'migration' ], [], 'migrations' ); if ( empty( $sites ) ) { return []; diff --git a/php/class-ee.php b/php/class-ee.php index 8884976ed..293a62986 100644 --- a/php/class-ee.php +++ b/php/class-ee.php @@ -1132,11 +1132,7 @@ public static function run_command( $args, $assoc_args = array() ) { } public static function db() { - if ( empty( self::$db ) ) { - self::$db = new EE_DB(); - } - - return self::$db; + return new EE_DB(); } public static function docker() { From 46cb35f55102773ec4781dea82ebd77b1d340292 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 2 Aug 2018 15:20:02 +0530 Subject: [PATCH 0320/1044] Update scope Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/site-utils.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/php/site-utils.php b/php/site-utils.php index 0ffccb682..57871096c 100644 --- a/php/site-utils.php +++ b/php/site-utils.php @@ -281,7 +281,7 @@ function start_site_containers( $site_root ) { EE::log( 'Pulling latest images. This may take some time.' ); chdir( $site_root ); - \EE::exec( 'docker-compose pull' ); + EE::exec( 'docker-compose pull' ); EE::log( 'Starting site\'s services.' ); if ( ! EE::docker()::docker_compose_up( $site_root ) ) { throw new \Exception( 'There was some error in docker-compose up.' ); @@ -302,6 +302,6 @@ function run_compose_command( $action, $container, $action_to_display = null, $s $display_action = $action_to_display ? $action_to_display : $action; $display_service = $service_to_display ? $service_to_display : $container; - \EE::log( ucfirst( $display_action ) . 'ing ' . $display_service ); - \EE::exec( "docker-compose $action $container", true, true ); + EE::log( ucfirst( $display_action ) . 'ing ' . $display_service ); + EE::exec( "docker-compose $action $container", true, true ); } From 7c558bc072186eefdfc52945da1b172d5ef3a8a0 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 2 Aug 2018 16:01:30 +0530 Subject: [PATCH 0321/1044] Give sudo permission to create log file Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 85f688b3a..6df101e64 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,7 @@ install: before_script: - composer validate - - ./vendor/bin/behat + - sudo ./vendor/bin/behat - ./ci/prepare.sh jobs: From 7352e7a0f7656004ef3daa9d4ad78b03197438ed Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 2 Aug 2018 19:37:51 +0530 Subject: [PATCH 0322/1044] phpcbf run Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- features/bootstrap/FeatureContext.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/features/bootstrap/FeatureContext.php b/features/bootstrap/FeatureContext.php index 2fbedb28a..c8d502199 100644 --- a/features/bootstrap/FeatureContext.php +++ b/features/bootstrap/FeatureContext.php @@ -1,12 +1,11 @@ <?php -define('EE_ROOT',__DIR__ . '/../..'); +define( 'EE_ROOT', __DIR__ . '/../..' ); -include_once(EE_ROOT . '/php/class-ee.php'); -include_once(EE_ROOT . '/php/EE/Runner.php'); -include_once(EE_ROOT . '/php/utils.php'); +include_once( EE_ROOT . '/php/class-ee.php' ); +include_once( EE_ROOT . '/php/EE/Runner.php' ); +include_once( EE_ROOT . '/php/utils.php' ); -// Can be used by plugins/themes to check if EE is running or not define( 'EE', true ); define( 'EE_VERSION', trim( file_get_contents( EE_ROOT . '/VERSION' ) ) ); define( 'EE_CONF_ROOT', '/opt/easyengine' ); From 50cd100f18b09fd89f175e7f70e98ec27998a40a Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 2 Aug 2018 19:45:48 +0530 Subject: [PATCH 0323/1044] Remove extra wrapper Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/class-ee-docker.php | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php index 902edd434..f2ae5b9bf 100644 --- a/php/class-ee-docker.php +++ b/php/class-ee-docker.php @@ -19,7 +19,7 @@ public static function boot_container( $container, $command = '' ) { return true; } } else { - return self::create_container( $command ); + return EE::exec( $command ); } } @@ -76,18 +76,6 @@ public static function restart_container( $container ) { return EE::exec( "docker restart $container" ); } - /** - * Function to create and start the container if it does not exist. - * - * @param String $command Command to launch the container. - * - * @return bool success. - */ - public static function create_container( $command ) { - - return EE::exec( $command, true, true, true ); - } - /** * Create docker network. * From 97a7cd63a1343f1c3be985fe663c0afb4d31c62b Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 2 Aug 2018 20:05:18 +0530 Subject: [PATCH 0324/1044] Update acc to review Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- features/bootstrap/FeatureContext.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/features/bootstrap/FeatureContext.php b/features/bootstrap/FeatureContext.php index c8d502199..4238ab1fd 100644 --- a/features/bootstrap/FeatureContext.php +++ b/features/bootstrap/FeatureContext.php @@ -1,5 +1,11 @@ <?php +/** + * Behat tests. + * + * @package ee-cli + */ +/* Start: Loading required files to enable EE::launch() in tests. */ define( 'EE_ROOT', __DIR__ . '/../..' ); include_once( EE_ROOT . '/php/class-ee.php' ); @@ -27,7 +33,7 @@ include_once "$logger_dir/Base.php"; foreach ( $iterator as $filename ) { - if ( '.php' !== substr( $filename, - 4 ) ) { + if ( '.php' !== pathinfo( $filename, PATHINFO_EXTENSION ) ) { continue; } @@ -35,6 +41,7 @@ } $runner = \EE::get_runner(); $runner->init_logger(); +/* End. Loading required files to enable EE::launch() in tests. */ use Behat\Behat\Context\Context; use Behat\Behat\Hook\Scope\AfterFeatureScope; From 3f279e2accfc4906f4cb34e702fd7acb24b1175b Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Fri, 3 Aug 2018 12:29:43 +0530 Subject: [PATCH 0325/1044] Add site-wp-command to composer Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- composer.json | 1 + composer.lock | 177 ++++++++++++++++++++++++++++++-------------------- 2 files changed, 109 insertions(+), 69 deletions(-) diff --git a/composer.json b/composer.json index 262b33c46..fc6f13ad6 100644 --- a/composer.json +++ b/composer.json @@ -29,6 +29,7 @@ "composer/semver": "~1.0", "easyengine/cron-command": "v1.0.0-beta.1", "easyengine/site-command": "v1.0.0", + "easyengine/site-wp-command": "dev-develop", "easyengine/shell-command": "v1.0.0-beta.1", "ext-openssl": "*", "guzzlehttp/guzzle": "^6.0", diff --git a/composer.lock b/composer.lock index e169b66e8..54ab09b1a 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": "2df550edcb8b8698bd6442f881302533", + "content-hash": "9ebd9fc7860aeb09f61cd723c966f8a3", "packages": [ { "name": "acmephp/core", @@ -526,6 +526,43 @@ "homepage": "https://github.com/easyengine/site-command", "time": "2018-07-23T15:42:41+00:00" }, + { + "name": "easyengine/site-wp-command", + "version": "dev-develop", + "source": { + "type": "git", + "url": "https://github.com/EasyEngine/site-wp-command.git", + "reference": "804716ed48adb56d48bf2d13177e9f4ca815737f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/EasyEngine/site-wp-command/zipball/804716ed48adb56d48bf2d13177e9f4ca815737f", + "reference": "804716ed48adb56d48bf2d13177e9f4ca815737f", + "shasum": "" + }, + "type": "ee-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "site-wp-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "EasyEngine package for WordPress site creation.", + "homepage": "https://github.com/easyengine/site-wp-command", + "time": "2018-08-01T12:42:45+00:00" + }, { "name": "guzzlehttp/guzzle", "version": "6.3.3", @@ -1319,16 +1356,16 @@ }, { "name": "symfony/config", - "version": "v3.4.13", + "version": "v3.4.14", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "1fffdeb349ff36a25184e5564c25289b1dbfc402" + "reference": "7b08223b7f6abd859651c56bcabf900d1627d085" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/1fffdeb349ff36a25184e5564c25289b1dbfc402", - "reference": "1fffdeb349ff36a25184e5564c25289b1dbfc402", + "url": "https://api.github.com/repos/symfony/config/zipball/7b08223b7f6abd859651c56bcabf900d1627d085", + "reference": "7b08223b7f6abd859651c56bcabf900d1627d085", "shasum": "" }, "require": { @@ -1379,20 +1416,20 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2018-06-19T14:02:58+00:00" + "time": "2018-07-26T11:19:56+00:00" }, { "name": "symfony/console", - "version": "v3.4.13", + "version": "v3.4.14", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "e54f84c50e3b12972e7750edfc5ca84b2284c44e" + "reference": "6b217594552b9323bcdcfc14f8a0ce126e84cd73" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/e54f84c50e3b12972e7750edfc5ca84b2284c44e", - "reference": "e54f84c50e3b12972e7750edfc5ca84b2284c44e", + "url": "https://api.github.com/repos/symfony/console/zipball/6b217594552b9323bcdcfc14f8a0ce126e84cd73", + "reference": "6b217594552b9323bcdcfc14f8a0ce126e84cd73", "shasum": "" }, "require": { @@ -1448,20 +1485,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-07-10T14:02:11+00:00" + "time": "2018-07-26T11:19:56+00:00" }, { "name": "symfony/debug", - "version": "v3.4.13", + "version": "v3.4.14", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "0e3ca9cbde90fffec8038f4d4e16fd4046bbd018" + "reference": "d5a058ff6ecad26b30c1ba452241306ea34c65cc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/0e3ca9cbde90fffec8038f4d4e16fd4046bbd018", - "reference": "0e3ca9cbde90fffec8038f4d4e16fd4046bbd018", + "url": "https://api.github.com/repos/symfony/debug/zipball/d5a058ff6ecad26b30c1ba452241306ea34c65cc", + "reference": "d5a058ff6ecad26b30c1ba452241306ea34c65cc", "shasum": "" }, "require": { @@ -1504,20 +1541,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2018-06-26T08:45:54+00:00" + "time": "2018-07-26T11:19:56+00:00" }, { "name": "symfony/dependency-injection", - "version": "v3.4.13", + "version": "v3.4.14", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "3f115cc3aae4d320b26db05e9531f4e32da29b89" + "reference": "1c0e679e522591fd744fdf242fec41a43d62b2b1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/3f115cc3aae4d320b26db05e9531f4e32da29b89", - "reference": "3f115cc3aae4d320b26db05e9531f4e32da29b89", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/1c0e679e522591fd744fdf242fec41a43d62b2b1", + "reference": "1c0e679e522591fd744fdf242fec41a43d62b2b1", "shasum": "" }, "require": { @@ -1575,20 +1612,20 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2018-07-16T13:57:19+00:00" + "time": "2018-07-29T15:19:31+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v3.4.13", + "version": "v3.4.14", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "fdd5abcebd1061ec647089c6c41a07ed60af09f8" + "reference": "b2e1f19280c09a42dc64c0b72b80fe44dd6e88fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/fdd5abcebd1061ec647089c6c41a07ed60af09f8", - "reference": "fdd5abcebd1061ec647089c6c41a07ed60af09f8", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b2e1f19280c09a42dc64c0b72b80fe44dd6e88fb", + "reference": "b2e1f19280c09a42dc64c0b72b80fe44dd6e88fb", "shasum": "" }, "require": { @@ -1638,20 +1675,20 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2018-04-06T07:35:25+00:00" + "time": "2018-07-26T09:06:28+00:00" }, { "name": "symfony/filesystem", - "version": "v3.4.13", + "version": "v3.4.14", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "8dab220fec8fc904821485326b29a6c670286124" + "reference": "a59f917e3c5d82332514cb4538387638f5bde2d6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/8dab220fec8fc904821485326b29a6c670286124", - "reference": "8dab220fec8fc904821485326b29a6c670286124", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/a59f917e3c5d82332514cb4538387638f5bde2d6", + "reference": "a59f917e3c5d82332514cb4538387638f5bde2d6", "shasum": "" }, "require": { @@ -1688,20 +1725,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2018-07-09T13:25:43+00:00" + "time": "2018-07-26T11:19:56+00:00" }, { "name": "symfony/finder", - "version": "v3.4.13", + "version": "v3.4.14", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "3a8c3de91d2b2c68cd2d665cf9d00f7ef9eaa394" + "reference": "8a84fcb207451df0013b2c74cbbf1b62d47b999a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/3a8c3de91d2b2c68cd2d665cf9d00f7ef9eaa394", - "reference": "3a8c3de91d2b2c68cd2d665cf9d00f7ef9eaa394", + "url": "https://api.github.com/repos/symfony/finder/zipball/8a84fcb207451df0013b2c74cbbf1b62d47b999a", + "reference": "8a84fcb207451df0013b2c74cbbf1b62d47b999a", "shasum": "" }, "require": { @@ -1737,7 +1774,7 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2018-06-19T20:52:10+00:00" + "time": "2018-07-26T11:19:56+00:00" }, { "name": "symfony/polyfill-ctype", @@ -1855,16 +1892,16 @@ }, { "name": "symfony/process", - "version": "v3.4.13", + "version": "v3.4.14", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "f741672edfcfe3a2ea77569d419006f23281d909" + "reference": "0414db29bd770ec5a4152683e655f55efd4fa60f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/f741672edfcfe3a2ea77569d419006f23281d909", - "reference": "f741672edfcfe3a2ea77569d419006f23281d909", + "url": "https://api.github.com/repos/symfony/process/zipball/0414db29bd770ec5a4152683e655f55efd4fa60f", + "reference": "0414db29bd770ec5a4152683e655f55efd4fa60f", "shasum": "" }, "require": { @@ -1900,20 +1937,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2018-07-09T09:01:07+00:00" + "time": "2018-07-26T11:19:56+00:00" }, { "name": "symfony/serializer", - "version": "v3.4.13", + "version": "v3.4.14", "source": { "type": "git", "url": "https://github.com/symfony/serializer.git", - "reference": "2780569dd1ad2a88fd45fee427391a528f0ed826" + "reference": "40031683816470610af87c2d03ea86d1cf0f0104" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/serializer/zipball/2780569dd1ad2a88fd45fee427391a528f0ed826", - "reference": "2780569dd1ad2a88fd45fee427391a528f0ed826", + "url": "https://api.github.com/repos/symfony/serializer/zipball/40031683816470610af87c2d03ea86d1cf0f0104", + "reference": "40031683816470610af87c2d03ea86d1cf0f0104", "shasum": "" }, "require": { @@ -1979,20 +2016,20 @@ ], "description": "Symfony Serializer Component", "homepage": "https://symfony.com", - "time": "2018-07-08T19:14:58+00:00" + "time": "2018-07-26T11:58:24+00:00" }, { "name": "symfony/translation", - "version": "v3.4.13", + "version": "v3.4.14", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "0d1c0965c3e82250b9786909cf584fd4a50c9c5b" + "reference": "9749930bfc825139aadd2d28461ddbaed6577862" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/0d1c0965c3e82250b9786909cf584fd4a50c9c5b", - "reference": "0d1c0965c3e82250b9786909cf584fd4a50c9c5b", + "url": "https://api.github.com/repos/symfony/translation/zipball/9749930bfc825139aadd2d28461ddbaed6577862", + "reference": "9749930bfc825139aadd2d28461ddbaed6577862", "shasum": "" }, "require": { @@ -2047,20 +2084,20 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2018-07-23T08:18:36+00:00" + "time": "2018-07-26T11:19:56+00:00" }, { "name": "symfony/yaml", - "version": "v3.4.13", + "version": "v3.4.14", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "c5010cc1692ce1fa328b1fb666961eb3d4a85bb0" + "reference": "810af2d35fc72b6cf5c01116806d2b65ccaaf2e2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/c5010cc1692ce1fa328b1fb666961eb3d4a85bb0", - "reference": "c5010cc1692ce1fa328b1fb666961eb3d4a85bb0", + "url": "https://api.github.com/repos/symfony/yaml/zipball/810af2d35fc72b6cf5c01116806d2b65ccaaf2e2", + "reference": "810af2d35fc72b6cf5c01116806d2b65ccaaf2e2", "shasum": "" }, "require": { @@ -2106,7 +2143,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2018-05-03T23:18:14+00:00" + "time": "2018-07-26T11:19:56+00:00" }, { "name": "webmozart/assert", @@ -2961,12 +2998,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "053766d789f6393e5bc0896635d35abf8d2d362e" + "reference": "b3569bbd5257d4ae0885b14feb6e45e41e8184b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/053766d789f6393e5bc0896635d35abf8d2d362e", - "reference": "053766d789f6393e5bc0896635d35abf8d2d362e", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/b3569bbd5257d4ae0885b14feb6e45e41e8184b7", + "reference": "b3569bbd5257d4ae0885b14feb6e45e41e8184b7", "shasum": "" }, "conflict": { @@ -3053,7 +3090,7 @@ "symfony/dependency-injection": ">=2,<2.0.17", "symfony/form": ">=2.3,<2.3.35|>=2.4,<2.6.12|>=2.7,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", "symfony/framework-bundle": ">=2,<2.3.18|>=2.4,<2.4.8|>=2.5,<2.5.2", - "symfony/http-foundation": ">=2,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", + "symfony/http-foundation": ">=2,<2.7.49|>=2.8,<2.8.44|>=3,<3.3.18|>=3.4,<3.4.14|>=4,<4.0.14|>=4.1,<4.1.3", "symfony/http-kernel": ">=2,<2.3.29|>=2.4,<2.5.12|>=2.6,<2.6.8", "symfony/intl": ">=2.7,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", "symfony/routing": ">=2,<2.0.19", @@ -3064,7 +3101,7 @@ "symfony/security-guard": ">=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", "symfony/security-http": ">=2.3,<2.3.41|>=2.4,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", "symfony/serializer": ">=2,<2.0.11", - "symfony/symfony": ">=2,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", + "symfony/symfony": ">=2,<2.7.49|>=2.8,<2.8.44|>=3,<3.3.18|>=3.4,<3.4.14|>=4,<4.0.14|>=4.1,<4.1.3", "symfony/translation": ">=2,<2.0.17", "symfony/validator": ">=2,<2.0.24|>=2.1,<2.1.12|>=2.2,<2.2.5|>=2.3,<2.3.3", "symfony/web-profiler-bundle": ">=2,<2.3.19|>=2.4,<2.4.9|>=2.5,<2.5.4", @@ -3090,9 +3127,10 @@ "zendframework/zend-captcha": ">=2,<2.4.9|>=2.5,<2.5.2", "zendframework/zend-crypt": ">=2,<2.4.9|>=2.5,<2.5.2", "zendframework/zend-db": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.10|>=2.3,<2.3.5", - "zendframework/zend-diactoros": ">=1,<1.0.4", + "zendframework/zend-diactoros": ">=1,<1.8.4", + "zendframework/zend-feed": ">=1,<2.10.3", "zendframework/zend-form": ">=2,<2.2.7|>=2.3,<2.3.1", - "zendframework/zend-http": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.3,<2.3.8|>=2.4,<2.4.1", + "zendframework/zend-http": ">=1,<2.8.1", "zendframework/zend-json": ">=2.1,<2.1.6|>=2.2,<2.2.6", "zendframework/zend-ldap": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.8|>=2.3,<2.3.3", "zendframework/zend-mail": ">=2,<2.4.11|>=2.5,<2.7.2", @@ -3123,7 +3161,7 @@ } ], "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", - "time": "2018-07-18T13:51:34+00:00" + "time": "2018-08-02T11:57:59+00:00" }, { "name": "squizlabs/php_codesniffer", @@ -3178,16 +3216,16 @@ }, { "name": "symfony/class-loader", - "version": "v3.4.13", + "version": "v3.4.14", "source": { "type": "git", "url": "https://github.com/symfony/class-loader.git", - "reference": "e63c12699822bb3b667e7216ba07fbcc3a3e203e" + "reference": "31db283fc86d3143e7ff87e922177b457d909c30" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/class-loader/zipball/e63c12699822bb3b667e7216ba07fbcc3a3e203e", - "reference": "e63c12699822bb3b667e7216ba07fbcc3a3e203e", + "url": "https://api.github.com/repos/symfony/class-loader/zipball/31db283fc86d3143e7ff87e922177b457d909c30", + "reference": "31db283fc86d3143e7ff87e922177b457d909c30", "shasum": "" }, "require": { @@ -3230,7 +3268,7 @@ ], "description": "Symfony ClassLoader Component", "homepage": "https://symfony.com", - "time": "2018-01-03T07:37:34+00:00" + "time": "2018-07-26T11:19:56+00:00" }, { "name": "wimg/php-compatibility", @@ -3329,6 +3367,7 @@ "aliases": [], "minimum-stability": "dev", "stability-flags": { + "easyengine/site-wp-command": 20, "roave/security-advisories": 20 }, "prefer-stable": true, From 6259b5685b7cd71638696f2c4dc5573017255bf6 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Fri, 3 Aug 2018 13:46:49 +0530 Subject: [PATCH 0326/1044] Remove extra assoc_arg deleteion Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Runner.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 70ae02d01..9a182d824 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -559,7 +559,9 @@ public function init_config() { foreach ( $ee3_compat_array_map_to_type as $from => $to ) { if ( isset( $assoc_args[ $from ] ) ) { $assoc_args['type'] = $to; - unset( $assoc_args[ $from ] ); + if ( $to === $assoc_args[ $from ] ) { + unset( $assoc_args[ $from ] ); + } } } @@ -751,6 +753,8 @@ public function route() { if ( is_array( $this->find_command_to_run( $new_args ) ) ) { $this->arguments = $new_args; } + var_dump($this->arguments,$this->assoc_args); + EE::err(''); } From 09c2612eb5648166c91e7d308173314e0a8bbd00 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Fri, 3 Aug 2018 14:15:53 +0530 Subject: [PATCH 0327/1044] Remove debug line Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Runner.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 9a182d824..be6a864df 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -753,8 +753,6 @@ public function route() { if ( is_array( $this->find_command_to_run( $new_args ) ) ) { $this->arguments = $new_args; } - var_dump($this->arguments,$this->assoc_args); - EE::err(''); } From c5fa9f8975e0c38f99e9b77c13c69169b3424adf Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Fri, 3 Aug 2018 15:27:19 +0530 Subject: [PATCH 0328/1044] Remove update tests Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- features/cli.feature | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/features/cli.feature b/features/cli.feature index 165de3ff2..cda619557 100644 --- a/features/cli.feature +++ b/features/cli.feature @@ -1,20 +1,5 @@ Feature: CLI Command - Scenario: ee update nightly works properly - Given ee phar is generated - When I run 'sudo php ee.phar cli update --nightly --yes' - Then return value should be 0 - - Scenario: ee update stable works properly - Given ee phar is generated - When I run 'sudo php ee.phar cli update --stable --yes' - Then return value should be 0 - - Scenario: ee update works properly - Given ee phar is generated - When I run 'sudo php ee.phar cli update --yes' - Then return value should be 0 - Scenario: ee uninstall works properly When I run 'sudo bin/ee cli self-uninstall --yes' Then ee should be deleted From 5c73829f8c860d43652780a081dd61b918a288e4 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Fri, 3 Aug 2018 15:51:44 +0530 Subject: [PATCH 0329/1044] Remove extra merged functions Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/utils.php | 59 --------------------------------------------------- 1 file changed, 59 deletions(-) diff --git a/php/utils.php b/php/utils.php index d46a957d8..6f7684ec9 100644 --- a/php/utils.php +++ b/php/utils.php @@ -1505,65 +1505,6 @@ function format_table( $items ) { \EE::log( $delem ); } -/** - * Get the site-name from the path from where ee is running if it is a valid site path. - * - * @return bool|String Name of the site or false in failure. - */ -function get_site_name() { - $sites = EE::db()::select( array( 'sitename' ) ); - - if ( $sites ) { - $cwd = getcwd(); - $name_in_path = explode( '/', $cwd ); - $site_name = array_intersect( array_flatten( $sites ), $name_in_path ); - - if ( 1 === count( $site_name ) ) { - $name = reset( $site_name ); - $path = EE::db()::select( - array( 'site_path' ), array( - 'sitename' => $name, - ) - ); - if ( $path ) { - $site_path = $path[0]['site_path']; - if ( $site_path === substr( $cwd, 0, strlen( $site_path ) ) ) { - return $name; - } - } - } - } - - return false; -} - -/** - * @param $args - * @param $command - * @param bool $arg_zero - * - * @return mixed - * @throws EE\ExitException - */ -function set_site_arg( $args, $command, $arg_zero = true ) { - if ( isset( $args[0] ) ) { - if ( EE::db()::site_in_db( $args[0] ) ) { - return $args; - } - } - $site_name = get_site_name(); - if ( $site_name ) { - if ( isset( $args[0] ) && $arg_zero ) { - EE::error( $args[0] . " is not a valid site-name. Did you mean `ee $command $site_name`?" ); - } - array_unshift( $args, $site_name ); - } else { - EE::error( "Could not find the site you wish to run $command command on.\nEither pass it as an argument: `ee $command <site-name>` \nor run `ee $command` from inside the site folder." ); - } - - return $args; -} - /** * Function to flatten a multi-dimensional array. * From 7d69a54785645cf4850f4565dfe64835e710fc74 Mon Sep 17 00:00:00 2001 From: Rahul Bansal <rahul.bansal@rtcamp.com> Date: Fri, 3 Aug 2018 16:27:20 +0530 Subject: [PATCH 0330/1044] Fix logo path --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2282fb255..bc64d8cde 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ **Update:** [We are working on next major release (v4) which will be in PHP and based on WP-CLI](https://easyengine.io/blog/easyengine-v4-development-begins/). -<img src="https://d3qt5vpr7p9rgn.cloudfront.net/wp-content/uploads/2013/08/easy-engine-logo-2-RS1-240x184.png" alt="EasyEngine Logo" align="right" /> +<img src="https://easyengine.io/wp-content/uploads/2015/11/cropped-favicon-easyengine.png" alt="EasyEngine Logo" align="right" /> EasyEngine (ee) is a python tool, which makes it easy to manage your wordpress sites running on nginx web-server. From 01b765acdea3b54c5ecee8024c41146e341bd756 Mon Sep 17 00:00:00 2001 From: Rahul Bansal <rahul.bansal@rtcamp.com> Date: Fri, 3 Aug 2018 16:28:14 +0530 Subject: [PATCH 0331/1044] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bc64d8cde..3a75efaf1 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ # [EasyEngine](https://easyengine.io/) +<img src="https://easyengine.io/wp-content/uploads/2015/11/cropped-favicon-easyengine.png" alt="EasyEngine Logo" align="right" /> + [![Travis Build Status](https://travis-ci.org/EasyEngine/easyengine.svg)](https://travis-ci.org/EasyEngine/easyengine) [![Join EasyEngine Slack Channel](http://slack.easyengine.io/badge.svg)](http://slack.easyengine.io/) **Update:** [We are working on next major release (v4) which will be in PHP and based on WP-CLI](https://easyengine.io/blog/easyengine-v4-development-begins/). -<img src="https://easyengine.io/wp-content/uploads/2015/11/cropped-favicon-easyengine.png" alt="EasyEngine Logo" align="right" /> - EasyEngine (ee) is a python tool, which makes it easy to manage your wordpress sites running on nginx web-server. **EasyEngine currently supports:** From 6f050208c475682935bd76c536a0edb9b23da319 Mon Sep 17 00:00:00 2001 From: Rahul Bansal <rahul.bansal@rtcamp.com> Date: Fri, 3 Aug 2018 16:28:28 +0530 Subject: [PATCH 0332/1044] Update README.md --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 3a75efaf1..eb6a458f1 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ # [EasyEngine](https://easyengine.io/) -<img src="https://easyengine.io/wp-content/uploads/2015/11/cropped-favicon-easyengine.png" alt="EasyEngine Logo" align="right" /> - [![Travis Build Status](https://travis-ci.org/EasyEngine/easyengine.svg)](https://travis-ci.org/EasyEngine/easyengine) [![Join EasyEngine Slack Channel](http://slack.easyengine.io/badge.svg)](http://slack.easyengine.io/) **Update:** [We are working on next major release (v4) which will be in PHP and based on WP-CLI](https://easyengine.io/blog/easyengine-v4-development-begins/). From d585c103d554160c99c3f1923adf5bd81abd6281 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Sat, 4 Aug 2018 19:19:23 +0530 Subject: [PATCH 0333/1044] Update support for old syntax Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Runner.php | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index be6a864df..b42358629 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -549,19 +549,17 @@ public function init_config() { } $ee3_compat_array_map_to_type = [ - 'wp' => 'wp', - 'wpsubdom' => 'wp', - 'wpsubdir' => 'wp', - 'wpredis' => 'wp', - 'html' => 'html', + 'wp' => [ 'type' => 'wp' ], + 'wpsubdom' => [ 'type' => 'wp', 'mu' => 'subdom' ], + 'wpsubdir' => [ 'type' => 'wp', 'mu' => 'subdir' ], + 'wpredis' => [ 'type' => 'wp', 'cache' => true ], + 'html' => [ 'type' => 'html' ], ]; foreach ( $ee3_compat_array_map_to_type as $from => $to ) { if ( isset( $assoc_args[ $from ] ) ) { - $assoc_args['type'] = $to; - if ( $to === $assoc_args[ $from ] ) { - unset( $assoc_args[ $from ] ); - } + $assoc_args = array_merge( $assoc_args, $to ); + unset( $assoc_args[ $from ] ); } } From ffbc59eca907cdafc2b555324fd00fba67e61679 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Sat, 4 Aug 2018 19:24:26 +0530 Subject: [PATCH 0334/1044] Add .idea folder of phpstorm in gitignore Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index daa341b3d..f2cd166fe 100644 --- a/.gitignore +++ b/.gitignore @@ -17,4 +17,5 @@ php-test-framework.xml vcs.xml workspace.xml profiles_settings.xml -Project_Default.xml \ No newline at end of file +Project_Default.xml +.idea \ No newline at end of file From 712264505735872f9250ace21f1dea97795031db Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Sat, 4 Aug 2018 20:00:47 +0530 Subject: [PATCH 0335/1044] Update site utils for postfix Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/site-utils.php | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/php/site-utils.php b/php/site-utils.php index 57871096c..bbdd24042 100644 --- a/php/site-utils.php +++ b/php/site-utils.php @@ -305,3 +305,40 @@ function run_compose_command( $action, $container, $action_to_display = null, $s EE::log( ucfirst( $display_action ) . 'ing ' . $display_service ); EE::exec( "docker-compose $action $container", true, true ); } + +/** + * Function to copy and configure files needed for postfix. + * + * @param string $site_name Name of the site to configure postfix files for. + * @param string $site_conf_dir Configuration directory of the site `site_root/config`. + */ +function set_postfix_files( $site_name, $site_conf_dir ) { + + $fs = new Filesystem(); + $fs->mkdir( $site_conf_dir . '/postfix' ); + $fs->mkdir( $site_conf_dir . '/postfix/ssl' ); + $ssl_dir = $site_conf_dir . '/postfix/ssl'; + + if ( ! EE::exec( sprintf( "openssl req -new -x509 -nodes -days 365 -subj \"/CN=smtp.%s\" -out $ssl_dir/server.crt -keyout $ssl_dir/server.key", $site_name ) ) + && EE::exec( "chmod 0600 $ssl_dir/server.key" ) ) { + throw new Exception( 'Unable to generate ssl key for postfix' ); + } +} + +/** + * Function to execute docker-compose exec calls to postfix to get it configured and running for the site. + * + * @param string $site_name Name of the for which postfix has to be configured. + * @param strin $site_root Site root. + */ +function configure_postfix( $site_name, $site_root ) { + + chdir( $site_root ); + EE::exec( 'docker-compose exec postfix postconf -e \'relayhost =\'' ); + EE::exec( 'docker-compose exec postfix postconf -e \'smtpd_recipient_restrictions = permit_mynetworks\'' ); + $launch = EE::launch( sprintf( '$(docker inspect -f \'{{ with (index .IPAM.Config 0) }}{{ .Subnet }}{{ end }}\' %s', $site_name ) ); + $subnet_cidr = trim( $launch->stdout ); + EE::exec( sprintf( 'docker-compose exec postfix postconf -e \'mynetworks = %s 127.0.0.0/8\'', $subnet_cidr ) ); + EE::exec( sprintf( 'docker-compose exec postfix postconf -e \'myhostname = %s\'', $subnet_cidr ) ); + EE::exec( 'docker-compose exec postfix postconf -e \'syslog_name = $myhostname\'' ); +} From 72895bc9126654b8a11b99e676080cfdabf42849 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 6 Aug 2018 13:27:29 +0530 Subject: [PATCH 0336/1044] Update subnet_cidr command Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/site-utils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/site-utils.php b/php/site-utils.php index bbdd24042..cf252b2b2 100644 --- a/php/site-utils.php +++ b/php/site-utils.php @@ -336,7 +336,7 @@ function configure_postfix( $site_name, $site_root ) { chdir( $site_root ); EE::exec( 'docker-compose exec postfix postconf -e \'relayhost =\'' ); EE::exec( 'docker-compose exec postfix postconf -e \'smtpd_recipient_restrictions = permit_mynetworks\'' ); - $launch = EE::launch( sprintf( '$(docker inspect -f \'{{ with (index .IPAM.Config 0) }}{{ .Subnet }}{{ end }}\' %s', $site_name ) ); + $launch = EE::launch( sprintf( 'docker inspect -f \'{{ with (index .IPAM.Config 0) }}{{ .Subnet }}{{ end }}\' %s', $site_name ) ); $subnet_cidr = trim( $launch->stdout ); EE::exec( sprintf( 'docker-compose exec postfix postconf -e \'mynetworks = %s 127.0.0.0/8\'', $subnet_cidr ) ); EE::exec( sprintf( 'docker-compose exec postfix postconf -e \'myhostname = %s\'', $subnet_cidr ) ); From df1d92121fbe9877cfef7d0e4a9426d65a9c5ec9 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 6 Aug 2018 13:51:40 +0530 Subject: [PATCH 0337/1044] Update hostname Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/site-utils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/site-utils.php b/php/site-utils.php index cf252b2b2..e9b5878b9 100644 --- a/php/site-utils.php +++ b/php/site-utils.php @@ -339,6 +339,6 @@ function configure_postfix( $site_name, $site_root ) { $launch = EE::launch( sprintf( 'docker inspect -f \'{{ with (index .IPAM.Config 0) }}{{ .Subnet }}{{ end }}\' %s', $site_name ) ); $subnet_cidr = trim( $launch->stdout ); EE::exec( sprintf( 'docker-compose exec postfix postconf -e \'mynetworks = %s 127.0.0.0/8\'', $subnet_cidr ) ); - EE::exec( sprintf( 'docker-compose exec postfix postconf -e \'myhostname = %s\'', $subnet_cidr ) ); + EE::exec( sprintf( 'docker-compose exec postfix postconf -e \'myhostname = %s\'', $site_name ) ); EE::exec( 'docker-compose exec postfix postconf -e \'syslog_name = $myhostname\'' ); } From 68416f5ffea61867c9720d800aee0611dca8f358 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 6 Aug 2018 14:04:27 +0530 Subject: [PATCH 0338/1044] Add restarting of postfix container Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/site-utils.php | 1 + 1 file changed, 1 insertion(+) diff --git a/php/site-utils.php b/php/site-utils.php index e9b5878b9..1b4237ffa 100644 --- a/php/site-utils.php +++ b/php/site-utils.php @@ -341,4 +341,5 @@ function configure_postfix( $site_name, $site_root ) { EE::exec( sprintf( 'docker-compose exec postfix postconf -e \'mynetworks = %s 127.0.0.0/8\'', $subnet_cidr ) ); EE::exec( sprintf( 'docker-compose exec postfix postconf -e \'myhostname = %s\'', $site_name ) ); EE::exec( 'docker-compose exec postfix postconf -e \'syslog_name = $myhostname\'' ); + EE::exec( 'docker-compose restart postfix' ); } From 6e83a60986c6c078adb8f9d73eb31961f9ca053a Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 6 Aug 2018 16:18:00 +0530 Subject: [PATCH 0339/1044] Update get_site_command Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/class-ee-db.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/php/class-ee-db.php b/php/class-ee-db.php index c9f77ec04..eb1e2e6f1 100644 --- a/php/class-ee-db.php +++ b/php/class-ee-db.php @@ -301,9 +301,9 @@ public static function get_site_command( $site_name ) { self::init_db(); } - $site = self::select( [ 'site_type' ], [ 'sitename' => $site_name ], 'sites', 1 ); + $site = self::select( [ 'site_command' ], [ 'sitename' => $site_name ], 'sites', 1 ); - return $site['site_type']; + return $site['site_command']; } /** From 4195b718b8b3317d04623a23bbbfb1f7e417bb7d Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 6 Aug 2018 17:29:46 +0530 Subject: [PATCH 0340/1044] Update to support wildcard letsencrypt Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/class-ee-db.php | 1 + php/class-ee-site.php | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/php/class-ee-db.php b/php/class-ee-db.php index eb1e2e6f1..852c263df 100644 --- a/php/class-ee-db.php +++ b/php/class-ee-db.php @@ -45,6 +45,7 @@ public static function create() { created_on DATETIME, is_enabled BOOLEAN DEFAULT 1, is_ssl BOOLEAN DEFAULT 0, + is_ssl_wildcard BOOLEAN DEFAULT 0, storage_fs VARCHAR, storage_db VARCHAR, db_name VARCHAR, diff --git a/php/class-ee-site.php b/php/class-ee-site.php index 9a594a0b6..12f08b2a4 100644 --- a/php/class-ee-site.php +++ b/php/class-ee-site.php @@ -18,6 +18,11 @@ abstract class EE_Site_Command { */ private $le; + /** + * @var bool $wildcard Whether the site is letsencrypt type is wildcard or not. + */ + private $wildcard; + /** * @var string $le_mail Mail id to be used for letsencrypt registration and certificate generation. */ @@ -343,6 +348,7 @@ protected function init_le( $site_name, $site_root, $wildcard = false ) { $this->site['name'] = $site_name; $this->site['root'] = $site_root; + $this->wildcard = $wildcard; $client = new Site_Letsencrypt(); $this->le_mail = EE::get_runner()->config['le-mail'] ?? EE::input( 'Enter your mail id: ' ); EE::get_runner()->ensure_present_in_config( 'le-mail', $this->le_mail ); @@ -364,7 +370,7 @@ protected function init_le( $site_name, $site_root, $wildcard = false ) { if ( $wildcard ) { echo \cli\Colors::colorize( '%YIMPORTANT:%n Run `ee site le ' . $this->site['name'] . '` once the dns changes have propogated to complete the certification generation and installation.', null ); } else { - $this->le( [], [], $wildcard ); + $this->le( [], [] ); } } @@ -380,7 +386,7 @@ protected function init_le( $site_name, $site_root, $wildcard = false ) { * [--force] * : Force renewal. */ - public function le( $args = [], $assoc_args = [], $wildcard = false ) { + public function le( $args = [], $assoc_args = [] ) { if ( ! isset( $this->site['name'] ) ) { $this->populate_site_info( $args ); @@ -389,14 +395,14 @@ public function le( $args = [], $assoc_args = [], $wildcard = false ) { $this->le_mail = EE::get_config( 'le-mail' ) ?? EE::input( 'Enter your mail id: ' ); } $force = EE\Utils\get_flag_value( $assoc_args, 'force' ); - $domains = $wildcard ? [ "*.$this->site['name']", $this->site['name'] ] : [ $this->site['name'] ]; + $domains = $this->wildcard ? [ "*.$this->site['name']", $this->site['name'] ] : [ $this->site['name'] ]; $client = new Site_Letsencrypt(); - if ( ! $client->check( $domains, $wildcard ) ) { + if ( ! $client->check( $domains, $this->wildcard ) ) { $this->le = false; return; } - if ( $wildcard ) { + if ( $this->wildcard ) { $client->request( "*.$this->site['name']", [ $this->site['name'] ], $this->le_mail, $force ); } else { $client->request( $this->site['name'], [], $this->le_mail, $force ); @@ -419,6 +425,7 @@ private function populate_site_info( $args ) { $this->site['type'] = $db_select['site_type']; $this->site['root'] = $db_select['site_path']; $this->le = $db_select['is_ssl']; + $this->wildcard = $db_select['is_ssl_wildcard']; } else { EE::error( sprintf( 'Site %s does not exist.', $this->site['name'] ) ); From b066d3d3664c6fb016b8b600f1885d60db613c63 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 6 Aug 2018 17:55:38 +0530 Subject: [PATCH 0341/1044] Fix domain name parsing Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/class-ee-site.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/php/class-ee-site.php b/php/class-ee-site.php index 12f08b2a4..f1d816a93 100644 --- a/php/class-ee-site.php +++ b/php/class-ee-site.php @@ -395,7 +395,7 @@ public function le( $args = [], $assoc_args = [] ) { $this->le_mail = EE::get_config( 'le-mail' ) ?? EE::input( 'Enter your mail id: ' ); } $force = EE\Utils\get_flag_value( $assoc_args, 'force' ); - $domains = $this->wildcard ? [ "*.$this->site['name']", $this->site['name'] ] : [ $this->site['name'] ]; + $domains = $this->wildcard ? [ '*.' . $this->site['name'], $this->site['name'] ] : [ $this->site['name'] ]; $client = new Site_Letsencrypt(); if ( ! $client->check( $domains, $this->wildcard ) ) { $this->le = false; @@ -403,7 +403,7 @@ public function le( $args = [], $assoc_args = [] ) { return; } if ( $this->wildcard ) { - $client->request( "*.$this->site['name']", [ $this->site['name'] ], $this->le_mail, $force ); + $client->request( '*.' . $this->site['name'], [ $this->site['name'] ], $this->le_mail, $force ); } else { $client->request( $this->site['name'], [], $this->le_mail, $force ); $client->cleanup( $this->site['root'] ); From ce35d229d8b8ff47a52a4614f09dc5a38a53103f Mon Sep 17 00:00:00 2001 From: Mriyam Tamuli <mbtamuli@gmail.com> Date: Tue, 7 Aug 2018 03:15:40 +0530 Subject: [PATCH 0342/1044] Update composer for v4.0.0-beta.5 Signed-off-by: Mriyam Tamuli <mbtamuli@gmail.com> --- composer.json | 6 +- composer.lock | 301 ++++++++++++++------------------------------------ 2 files changed, 85 insertions(+), 222 deletions(-) diff --git a/composer.json b/composer.json index fc6f13ad6..522497cf5 100644 --- a/composer.json +++ b/composer.json @@ -27,9 +27,9 @@ "php": ">=7.0", "composer/composer": "^1.2.0", "composer/semver": "~1.0", - "easyengine/cron-command": "v1.0.0-beta.1", - "easyengine/site-command": "v1.0.0", - "easyengine/site-wp-command": "dev-develop", + "easyengine/cron-command": "v1.0.0-beta.2", + "easyengine/site-command": "v2.0.0", + "easyengine/site-wp-command": "v1.0.0-beta.1", "easyengine/shell-command": "v1.0.0-beta.1", "ext-openssl": "*", "guzzlehttp/guzzle": "^6.0", diff --git a/composer.lock b/composer.lock index 54ab09b1a..49de238d3 100644 --- a/composer.lock +++ b/composer.lock @@ -4,135 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "9ebd9fc7860aeb09f61cd723c966f8a3", + "content-hash": "ce373bec5efe99ef70c424b1b5960dd7", "packages": [ - { - "name": "acmephp/core", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/acmephp/core.git", - "reference": "910ca7b0edd25a54466050d9de276364f63cece1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/acmephp/core/zipball/910ca7b0edd25a54466050d9de276364f63cece1", - "reference": "910ca7b0edd25a54466050d9de276364f63cece1", - "shasum": "" - }, - "require": { - "acmephp/ssl": "^1.0-alpha2", - "ext-openssl": "*", - "guzzlehttp/guzzle": "^6.0", - "php": ">=5.5.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.22", - "symfony/process": "^3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "AcmePhp\\Core\\": "." - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Titouan Galopin", - "email": "galopintitouan@gmail.com", - "homepage": "http://titouangalopin.com" - }, - { - "name": "Jérémy Derussé", - "homepage": "https://twitter.com/jderusse" - } - ], - "description": "Raw implementation of the ACME protocol in PHP", - "homepage": "https://github.com/acmephp/core", - "keywords": [ - "acmephp", - "certificate", - "csr", - "encryption", - "https", - "letsencrypt", - "openssl", - "ssl", - "x509" - ], - "time": "2018-07-06T19:04:41+00:00" - }, - { - "name": "acmephp/ssl", - "version": "1.0.0-beta4", - "source": { - "type": "git", - "url": "https://github.com/acmephp/ssl.git", - "reference": "fef7a791ae3a2e2921cd47cdceb6c10790c880bc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/acmephp/ssl/zipball/fef7a791ae3a2e2921cd47cdceb6c10790c880bc", - "reference": "fef7a791ae3a2e2921cd47cdceb6c10790c880bc", - "shasum": "" - }, - "require": { - "ext-openssl": "*", - "php": ">=5.5.0", - "webmozart/assert": "^1.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.22", - "sllh/php-cs-fixer-styleci-bridge": "^1.5.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "AcmePhp\\Ssl\\": "." - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Titouan Galopin", - "email": "galopintitouan@gmail.com", - "homepage": "http://titouangalopin.com" - }, - { - "name": "Jérémy Derussé", - "homepage": "https://twitter.com/jderusse" - } - ], - "description": "PHP wrapper around OpenSSL extension providing SSL encoding, decoding, parsing and signing features", - "homepage": "https://github.com/acmephp/ssl", - "keywords": [ - "acmephp", - "certificate", - "csr", - "https", - "openssl", - "ssl", - "x509" - ], - "time": "2016-12-28T23:53:27+00:00" - }, { "name": "composer/ca-bundle", "version": "1.1.1", @@ -191,26 +64,26 @@ }, { "name": "composer/composer", - "version": "1.6.5", + "version": "1.7.0", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "b184a92419cc9a9c4c6a09db555a94d441cb11c9" + "reference": "39edb2f375679a4eba19e69e9c9491e302976983" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/b184a92419cc9a9c4c6a09db555a94d441cb11c9", - "reference": "b184a92419cc9a9c4c6a09db555a94d441cb11c9", + "url": "https://api.github.com/repos/composer/composer/zipball/39edb2f375679a4eba19e69e9c9491e302976983", + "reference": "39edb2f375679a4eba19e69e9c9491e302976983", "shasum": "" }, "require": { "composer/ca-bundle": "^1.0", "composer/semver": "^1.0", "composer/spdx-licenses": "^1.2", + "composer/xdebug-handler": "^1.1", "justinrainbow/json-schema": "^3.0 || ^4.0 || ^5.0", "php": "^5.3.2 || ^7.0", "psr/log": "^1.0", - "seld/cli-prompt": "^1.0", "seld/jsonlint": "^1.4", "seld/phar-utils": "^1.0", "symfony/console": "^2.7 || ^3.0 || ^4.0", @@ -236,7 +109,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6-dev" + "dev-master": "1.7-dev" } }, "autoload": { @@ -267,7 +140,7 @@ "dependency", "package" ], - "time": "2018-05-04T09:44:59+00:00" + "time": "2018-08-03T13:39:07+00:00" }, { "name": "composer/semver", @@ -392,18 +265,62 @@ ], "time": "2018-04-30T10:33:04+00:00" }, + { + "name": "composer/xdebug-handler", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "c919dc6c62e221fc6406f861ea13433c0aa24f08" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/c919dc6c62e221fc6406f861ea13433c0aa24f08", + "reference": "c919dc6c62e221fc6406f861ea13433c0aa24f08", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0", + "psr/log": "^1.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.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" + ], + "time": "2018-04-11T15:42:36+00:00" + }, { "name": "easyengine/cron-command", - "version": "v1.0.0-beta.1", + "version": "v1.0.0-beta.2", "source": { "type": "git", "url": "https://github.com/EasyEngine/cron-command.git", - "reference": "34b27c0b638a5dec73645eb39bd943850f7f973c" + "reference": "7dae17ada7c93c3d4cac7854baa996410302d46e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/cron-command/zipball/34b27c0b638a5dec73645eb39bd943850f7f973c", - "reference": "34b27c0b638a5dec73645eb39bd943850f7f973c", + "url": "https://api.github.com/repos/EasyEngine/cron-command/zipball/7dae17ada7c93c3d4cac7854baa996410302d46e", + "reference": "7dae17ada7c93c3d4cac7854baa996410302d46e", "shasum": "" }, "type": "ee-cli-package", @@ -433,7 +350,7 @@ ], "description": "Manages cron jobs in EasyEngine", "homepage": "https://github.com/easyengine/cron-command", - "time": "2018-07-23T15:34:42+00:00" + "time": "2018-08-06T19:59:01+00:00" }, { "name": "easyengine/shell-command", @@ -477,26 +394,18 @@ }, { "name": "easyengine/site-command", - "version": "v1.0.0", + "version": "v2.0.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "71fa9c5fae8022a9cc431f351e0100101c303dda" + "reference": "a3f5ba5ef7a9966958214a9ff38114da836a688d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/71fa9c5fae8022a9cc431f351e0100101c303dda", - "reference": "71fa9c5fae8022a9cc431f351e0100101c303dda", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/a3f5ba5ef7a9966958214a9ff38114da836a688d", + "reference": "a3f5ba5ef7a9966958214a9ff38114da836a688d", "shasum": "" }, - "require": { - "acmephp/core": "dev-master", - "ext-openssl": "*", - "guzzlehttp/guzzle": "^6.0", - "league/flysystem": "^1.0.19", - "symfony/serializer": "^3.0", - "webmozart/assert": "^1.0" - }, "type": "ee-cli-package", "extra": { "branch-alias": { @@ -524,20 +433,20 @@ "MIT" ], "homepage": "https://github.com/easyengine/site-command", - "time": "2018-07-23T15:42:41+00:00" + "time": "2018-08-06T19:23:14+00:00" }, { "name": "easyengine/site-wp-command", - "version": "dev-develop", + "version": "v1.0.0-beta.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-wp-command.git", - "reference": "804716ed48adb56d48bf2d13177e9f4ca815737f" + "reference": "8234aab6ca091969ce9950b5dccd75c0dedcc3f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-wp-command/zipball/804716ed48adb56d48bf2d13177e9f4ca815737f", - "reference": "804716ed48adb56d48bf2d13177e9f4ca815737f", + "url": "https://api.github.com/repos/EasyEngine/site-wp-command/zipball/8234aab6ca091969ce9950b5dccd75c0dedcc3f9", + "reference": "8234aab6ca091969ce9950b5dccd75c0dedcc3f9", "shasum": "" }, "type": "ee-cli-package", @@ -561,7 +470,7 @@ ], "description": "EasyEngine package for WordPress site creation.", "homepage": "https://github.com/easyengine/site-wp-command", - "time": "2018-08-01T12:42:45+00:00" + "time": "2018-08-06T18:28:59+00:00" }, { "name": "guzzlehttp/guzzle", @@ -1213,54 +1122,6 @@ ], "time": "2016-10-13T00:11:37+00:00" }, - { - "name": "seld/cli-prompt", - "version": "1.0.3", - "source": { - "type": "git", - "url": "https://github.com/Seldaek/cli-prompt.git", - "reference": "a19a7376a4689d4d94cab66ab4f3c816019ba8dd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Seldaek/cli-prompt/zipball/a19a7376a4689d4d94cab66ab4f3c816019ba8dd", - "reference": "a19a7376a4689d4d94cab66ab4f3c816019ba8dd", - "shasum": "" - }, - "require": { - "php": ">=5.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Seld\\CliPrompt\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be" - } - ], - "description": "Allows you to prompt for user input on the command line, and optionally hide the characters they type", - "keywords": [ - "cli", - "console", - "hidden", - "input", - "prompt" - ], - "time": "2017-03-18T11:32:45+00:00" - }, { "name": "seld/jsonlint", "version": "1.7.1", @@ -1778,25 +1639,28 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.8.0", + "version": "v1.9.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae" + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/7cc359f1b7b80fc25ed7796be7d96adc9b354bae", - "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", "shasum": "" }, "require": { "php": ">=5.3.3" }, + "suggest": { + "ext-ctype": "For best performance" + }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.8-dev" + "dev-master": "1.9-dev" } }, "autoload": { @@ -1829,20 +1693,20 @@ "polyfill", "portable" ], - "time": "2018-04-30T19:57:29+00:00" + "time": "2018-08-06T14:22:27+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.8.0", + "version": "v1.9.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "3296adf6a6454a050679cde90f95350ad604b171" + "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/3296adf6a6454a050679cde90f95350ad604b171", - "reference": "3296adf6a6454a050679cde90f95350ad604b171", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/d0cd638f4634c16d8df4508e847f14e9e43168b8", + "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8", "shasum": "" }, "require": { @@ -1854,7 +1718,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.8-dev" + "dev-master": "1.9-dev" } }, "autoload": { @@ -1888,7 +1752,7 @@ "portable", "shim" ], - "time": "2018-04-26T10:06:28+00:00" + "time": "2018-08-06T14:22:27+00:00" }, { "name": "symfony/process", @@ -3367,7 +3231,6 @@ "aliases": [], "minimum-stability": "dev", "stability-flags": { - "easyengine/site-wp-command": 20, "roave/security-advisories": 20 }, "prefer-stable": true, From 00f2046283a7acddb4fec5a277f657081d5c1334 Mon Sep 17 00:00:00 2001 From: Mriyam Tamuli <mbtamuli@gmail.com> Date: Tue, 7 Aug 2018 03:29:14 +0530 Subject: [PATCH 0343/1044] Update README Signed-off-by: Mriyam Tamuli <mbtamuli@gmail.com> --- README.md | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 7b68b870e..f2dbe1f87 100644 --- a/README.md +++ b/README.md @@ -31,18 +31,23 @@ chmod +x /usr/local/bin/ee To get started with EasyEngine and create a wordpress site, run ``` -ee site create example.com +ee site create example.com --type=wp ``` Need a wordpress site with caching? Try ``` -ee site create example.com --wpredis +ee site create example.com --type=wp --cache ``` Need a wordpress multi-site with page cache? ``` -ee site create example.com --wpsubdir --wpredis +ee site create example.com --type=wp --mu=wpsubdir --cache +``` + +Need a plain and simple html site? +``` +ee site create example.com ``` Want to play around with your new site? @@ -52,6 +57,8 @@ ee shell example.com Want to know more? Checkout readme of these commands - * [site command](https://github.com/EasyEngine/site-command/) + * [site-wp command](https://github.com/EasyEngine/site-wp-command/) + * [cron command](https://github.com/EasyEngine/cron-command/) * [shell command](https://github.com/EasyEngine/shell-command/) Note: :warning: EasyEngine will currently only run with root privileges. You can run `ee help`, `ee help site` and `ee help site create` to get all the details about the various commands and subcommands that you can run. @@ -62,7 +69,7 @@ Development of easyengine is done entirely on GitHub. We've used [wp-cli](https://github.com/wp-cli/wp-cli/) framework as a base and built EasyEngine on top of it. -This repo contains main core of easyengine (the framework). +This repo contains main core of easyengine (the framework). All top level commands(except `ee cli`) i.e. `ee site`, `ee shell` have their own repos. Currently we have following commands which are bundled by default in EasyEngine: From e889ee9f54e0d456214d1f95cdcb380f0443a6a6 Mon Sep 17 00:00:00 2001 From: Mriyam Tamuli <mbtamuli@gmail.com> Date: Tue, 7 Aug 2018 03:30:05 +0530 Subject: [PATCH 0344/1044] Bump version to v4.0.0-beta.5 Signed-off-by: Mriyam Tamuli <mbtamuli@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 42caa876d..e0ce22a94 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.0.0-beta.4 +4.0.0-beta.5 From 556eae586a02f3da86d222ca76053dd5affb17d4 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 7 Aug 2018 09:40:39 +0530 Subject: [PATCH 0345/1044] Fix acmephp require in composer Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- composer.json | 1 + composer.lock | 130 +++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 130 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 522497cf5..9a6127caf 100644 --- a/composer.json +++ b/composer.json @@ -25,6 +25,7 @@ "prefer-stable": true, "require": { "php": ">=7.0", + "acmephp/core": "dev-master", "composer/composer": "^1.2.0", "composer/semver": "~1.0", "easyengine/cron-command": "v1.0.0-beta.2", diff --git a/composer.lock b/composer.lock index 49de238d3..b2e50b641 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,135 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ce373bec5efe99ef70c424b1b5960dd7", + "content-hash": "64eddeb5dcc2884dacdcb4c2e199cdba", "packages": [ + { + "name": "acmephp/core", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/acmephp/core.git", + "reference": "910ca7b0edd25a54466050d9de276364f63cece1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/acmephp/core/zipball/910ca7b0edd25a54466050d9de276364f63cece1", + "reference": "910ca7b0edd25a54466050d9de276364f63cece1", + "shasum": "" + }, + "require": { + "acmephp/ssl": "^1.0-alpha2", + "ext-openssl": "*", + "guzzlehttp/guzzle": "^6.0", + "php": ">=5.5.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.22", + "symfony/process": "^3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "AcmePhp\\Core\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Titouan Galopin", + "email": "galopintitouan@gmail.com", + "homepage": "http://titouangalopin.com" + }, + { + "name": "Jérémy Derussé", + "homepage": "https://twitter.com/jderusse" + } + ], + "description": "Raw implementation of the ACME protocol in PHP", + "homepage": "https://github.com/acmephp/core", + "keywords": [ + "acmephp", + "certificate", + "csr", + "encryption", + "https", + "letsencrypt", + "openssl", + "ssl", + "x509" + ], + "time": "2018-07-06T19:04:41+00:00" + }, + { + "name": "acmephp/ssl", + "version": "1.0.0-beta4", + "source": { + "type": "git", + "url": "https://github.com/acmephp/ssl.git", + "reference": "fef7a791ae3a2e2921cd47cdceb6c10790c880bc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/acmephp/ssl/zipball/fef7a791ae3a2e2921cd47cdceb6c10790c880bc", + "reference": "fef7a791ae3a2e2921cd47cdceb6c10790c880bc", + "shasum": "" + }, + "require": { + "ext-openssl": "*", + "php": ">=5.5.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.22", + "sllh/php-cs-fixer-styleci-bridge": "^1.5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "AcmePhp\\Ssl\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Titouan Galopin", + "email": "galopintitouan@gmail.com", + "homepage": "http://titouangalopin.com" + }, + { + "name": "Jérémy Derussé", + "homepage": "https://twitter.com/jderusse" + } + ], + "description": "PHP wrapper around OpenSSL extension providing SSL encoding, decoding, parsing and signing features", + "homepage": "https://github.com/acmephp/ssl", + "keywords": [ + "acmephp", + "certificate", + "csr", + "https", + "openssl", + "ssl", + "x509" + ], + "time": "2016-12-28T23:53:27+00:00" + }, { "name": "composer/ca-bundle", "version": "1.1.1", @@ -3231,6 +3358,7 @@ "aliases": [], "minimum-stability": "dev", "stability-flags": { + "acmephp/core": 20, "roave/security-advisories": 20 }, "prefer-stable": true, From 15175c1a22abb7b0aee93dd26e3f2a7e6af4a785 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 7 Aug 2018 11:25:01 +0530 Subject: [PATCH 0346/1044] Fix message printing Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/class-ee-site.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/php/class-ee-site.php b/php/class-ee-site.php index f1d816a93..323bd5999 100644 --- a/php/class-ee-site.php +++ b/php/class-ee-site.php @@ -219,10 +219,10 @@ public function up( $args, $assoc_args ) { if ( EE::db()::site_enabled( $this->site['name'] ) && ! $force ) { EE::error( sprintf( '%s is already enabled!', $this->site['name'] ) ); } - EE::log( "Enabling site $this->site['name']." ); + EE::log( sprintf( 'Enabling site %s.', $this->site['name'] ) ); if ( EE::docker()::docker_compose_up( $this->site['root'] ) ) { EE::db()::update( [ 'is_enabled' => '1' ], [ 'sitename' => $this->site['name'] ] ); - EE::success( "Site $this->site['name'] enabled." ); + EE::success( sprintf( 'Site %s enabled.', $this->site['name'] ) ); } else { EE::error( sprintf( 'There was error in enabling %s. Please check logs.', $this->site['name'] ) ); } From a759f1ffbdaa92be7e6594d5f4b09361176b234b Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 7 Aug 2018 14:43:18 +0530 Subject: [PATCH 0347/1044] Add custom nginx configuration to ee-nginx-proxy Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/site-utils.php | 2 ++ templates/custom.conf.mustache | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 templates/custom.conf.mustache diff --git a/php/site-utils.php b/php/site-utils.php index 1b4237ffa..621a13640 100644 --- a/php/site-utils.php +++ b/php/site-utils.php @@ -90,6 +90,8 @@ function init_checks() { if ( EE::docker()::boot_container( $proxy_type, $ee_proxy_command ) ) { + $fs = new Filesystem(); + $fs->dumpFile( "$EE_CONF_ROOT/nginx/conf.d/custom.conf", file_get_contents( EE_ROOT . '/templates/custom.conf.mustache' ) ); EE::success( "$proxy_type container is up." ); } else { EE::error( "There was some error in starting $proxy_type container. Please check logs." ); diff --git a/templates/custom.conf.mustache b/templates/custom.conf.mustache new file mode 100644 index 000000000..115a3649a --- /dev/null +++ b/templates/custom.conf.mustache @@ -0,0 +1,2 @@ +server_tokens off; +client_max_body_size 100m; \ No newline at end of file From 2984c5aee06e3ffebfb654aedb574945e0a15f83 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 7 Aug 2018 19:36:20 +0530 Subject: [PATCH 0348/1044] Update phar creation Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- ci/prepare.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/prepare.sh b/ci/prepare.sh index 33580d6eb..7df4fca83 100755 --- a/ci/prepare.sh +++ b/ci/prepare.sh @@ -9,4 +9,4 @@ if [[ "$TRAVIS_BRANCH" == "develop-v4" ]]; then echo $version > VERSION fi -php -dphar.readonly=0 ./utils/make-phar.php easyengine.phar --quite > /dev/null \ No newline at end of file +php -dphar.readonly=0 ./utils/make-phar.php easyengine.phar --quiet \ No newline at end of file From 8cc8424fbb6cead4aa514231fd0806b8ffc9f1d9 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 7 Aug 2018 19:36:39 +0530 Subject: [PATCH 0349/1044] Add testing for all commands Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- .travis.yml | 8 +++++++- ci/test-commands.sh | 8 ++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100755 ci/test-commands.sh diff --git a/.travis.yml b/.travis.yml index 6df101e64..b0b0d6680 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,8 +22,14 @@ install: before_script: - composer validate - - sudo ./vendor/bin/behat + +script: - ./ci/prepare.sh + - sudo ./vendor/bin/behat + - ./ci/test-commands.sh + +after_script: +- cat /opt/easyengine/ee.log jobs: include: diff --git a/ci/test-commands.sh b/ci/test-commands.sh new file mode 100755 index 000000000..edfba9eb5 --- /dev/null +++ b/ci/test-commands.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +# called by Travis CI + +for repo in "$(find vendor/easyengine -type d -name 'features')"; do + rsync -a --delete $repo/ features + sudo ./vendor/bin/behat +done \ No newline at end of file From 582a5335cc8fe046783e031ee9113b90d39accf3 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 7 Aug 2018 19:51:14 +0530 Subject: [PATCH 0350/1044] Update indentation Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b0b0d6680..5a134f55c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,7 +29,7 @@ script: - ./ci/test-commands.sh after_script: -- cat /opt/easyengine/ee.log + - cat /opt/easyengine/ee.log jobs: include: From fc8a682eb4f2010346674544599f8fc41145a5c0 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 7 Aug 2018 19:59:18 +0530 Subject: [PATCH 0351/1044] Update flow Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5a134f55c..c1bb87e68 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,8 +22,6 @@ install: before_script: - composer validate - -script: - ./ci/prepare.sh - sudo ./vendor/bin/behat - ./ci/test-commands.sh From c387605dad285b4c61c4028a1223f43ce6ad92d2 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 7 Aug 2018 20:16:41 +0530 Subject: [PATCH 0352/1044] Add certificates Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- ci/test-commands.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ci/test-commands.sh b/ci/test-commands.sh index edfba9eb5..13a3bfbfd 100755 --- a/ci/test-commands.sh +++ b/ci/test-commands.sh @@ -2,6 +2,9 @@ # called by Travis CI +# Add certificates +./vendor/easyengine/site-command/ci/add-test-certs.sh + for repo in "$(find vendor/easyengine -type d -name 'features')"; do rsync -a --delete $repo/ features sudo ./vendor/bin/behat From 54ba8ae35b762c1a0bb0d0147e0f36690c75ace0 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 7 Aug 2018 20:27:05 +0530 Subject: [PATCH 0353/1044] Update display msgs Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- ci/test-commands.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ci/test-commands.sh b/ci/test-commands.sh index 13a3bfbfd..918f892b5 100755 --- a/ci/test-commands.sh +++ b/ci/test-commands.sh @@ -3,9 +3,10 @@ # called by Travis CI # Add certificates -./vendor/easyengine/site-command/ci/add-test-certs.sh +./vendor/easyengine/site-command/ci/add-test-certs.sh > /dev/null for repo in "$(find vendor/easyengine -type d -name 'features')"; do - rsync -a --delete $repo/ features + rsync -a --delete $repo/ features > /dev/null + echo "Running tests for $repo" sudo ./vendor/bin/behat done \ No newline at end of file From a0fe01a2572f21c2a2cf701063ea0be2068d41f5 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Tue, 7 Aug 2018 22:48:27 +0530 Subject: [PATCH 0354/1044] Finalize EE_DB refactoring Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/class-ee-db.php | 383 +++++++++++++++++++++++++++++++------------- phpcs.xml.dist | 3 +- 2 files changed, 278 insertions(+), 108 deletions(-) diff --git a/php/class-ee-db.php b/php/class-ee-db.php index 9ccf221cc..d8c42aeb8 100644 --- a/php/class-ee-db.php +++ b/php/class-ee-db.php @@ -2,32 +2,44 @@ class EE_DB { - private static $db; + /** + * @var PDO Instance of PDO class + */ + private static $pdo; private $tables; + private $select; private $where; private $limit; + private $offset; public function __construct() { - if ( empty( self::$db ) ) { + if ( empty( self::$pdo ) ) { self::init_db(); } - } - public function __destruct() { - self::$db->close(); + $this->select = ''; + $this->tables = ''; + $this->limit = ''; + $this->offset = ''; + $this->where = [ + 'query_string' => null, + 'binding' => null + ]; } /** * Function to initialize db and db connection. */ private static function init_db() { + try { + self::$pdo = new PDO( 'sqlite:' . DB ); + } + catch ( PDOException $exception ) { + EE::error( $exception->getMessage() ); + } + if ( ! ( file_exists( DB ) ) ) { - self::$db = self::create_required_tables(); - } else { - self::$db = new SQLite3( DB ); - if ( ! self::$db ) { - EE::error( self::$db->lastErrorMsg() ); - } + self::create_required_tables(); } } @@ -35,7 +47,6 @@ private static function init_db() { * Sqlite database creation. */ private static function create_required_tables() { - self::$db = new SQLite3( DB ); $query = 'CREATE TABLE sites ( id INTEGER NOT NULL, sitename VARCHAR, @@ -92,42 +103,129 @@ private static function create_required_tables() { schedule VARCHAR );'; - self::$db->exec( $query ); + try { + self::$pdo->exec( $query ); + } catch ( PDOException $exception) { + EE::error( 'Encountered Error while creating table: ' . $exception->getMessage() ); + } } /** - * Select table to do operation on. + * Selects table to do operation on. * - * @param array $data in key value pair. + * @param ...$args Tables to run query on. * - * @return bool + * @return EE_DB */ - public function table() { - $this->tables = func_get_args(); + public function table( ...$args ) { + $this->tables = implode(', ', $args); + return $this; } /** - * Insert row in table. + * Adds where condition in query. * - * @param array $data in key value pair. + * i.e. where('id', 100) or where('id', '>', 100) + * or where([ + * [ 'id', '<', 100 ], + * [ 'name', 'ee' ] + * ]) * - * @return bool + * Supported operators are: '=', '<', '>', '<=', '>=', '==', '!=', '<>', 'like', 'in' + * + * @param ...$args One or more where condition. + * + * @return EE_DB */ - public function where() { - $this->where = func_get_args(); + public function where( ...$args ) { + $args = func_get_args(); + $conditions = []; + + if ( 'array' === gettype( $args[0] ) ) { + foreach ( $args[0] as $condition ) { + $conditions[] = $this->getWhereCondition( $condition ); + } + } else { + $conditions[] = $this->getWhereCondition( $args ); + } + + $this->where = [ + 'query_string' => ' WHERE '. implode( ' AND ', array_column( $conditions, 'query_string' ) ), + 'bindings' => array_column( $conditions, 'binding' ), + ]; + return $this; } /** - * Insert row in table. + * Returns a query fragment for where clause * - * @param array $data in key value pair. + * If the param given is ['column', 100], it returns ['column = ?', 100] + * If the param given is ['column', '>', 100], it returns ['column > ?', 100] * - * @return bool + * @param array $condition An array of format [column, operator, value] or [column, value] + * + * @throws Exception + * + * @return array prepared query string and its corresponding binding + */ + private function get_where_fragment( $condition ) { + $column = $condition[0]; + $operator = '='; + + if ( 'string' !== gettype( $column ) ) { + throw new Exception( 'Where clause column must be of type string' ); + } + + if ( isset( $condition[2] ) ) { + $operator = $condition[1]; + $allowed_operators = [ '=', '<', '>', '<=', '>=', '==', '!=', '<>', 'like', 'in' ]; + + if ( ! in_array( strtolower( $operator ), $allowed_operators ) ) { + throw new Exception( 'Where clause operator should be in one of following: ' . implode( ' ', $allowed_operators ) ); + } + + $value = $condition[2]; + } elseif ( isset( $condition[1] ) ) { + $value = $condition[1]; + } else { + throw new Exception( 'Where clause value must be set' ); + } + + if ( 'string' !== gettype( $operator ) || ! in_array( gettype( $value ), [ 'string', 'integer' ], true ) ) { + throw new Exception( 'Where clause operator and value must be string' ); + } + + return [ + 'query_string' => "$column $operator ?", + 'binding' => $value, + ] ; + } + + /** + * Adds limit to query. + * + * @param int $limit Limit value. + * + * @return EE_DB */ - public function limit( $limit ) { - $this->limit = $limit; + public function limit( int $limit ) { + $this->limit = ' LIMIT ' . (string) $limit; + + return $this; + } + + /** + * Adds offset to query. + * + * @param int $offset Offset of query + * + * @return EE_DB + */ + public function offset ( int $offset ) { + $this->offset = ' OFFSET ' . (string) $offset; + return $this; } @@ -136,28 +234,34 @@ public function limit( $limit ) { * * @param array $data in key value pair. * + * @throws Exception If no table or more than one tables are specified + * * @return bool */ public function insert( $data ) { $fields = implode( ', ', array_keys( $data ) ); - $values = '"' . implode( '", "', $data ) . '"'; + $values = implode( array_fill(0, count( $data ), '?' ) ); - if ( empty( $this->table ) ) { + if ( empty( $this->tables ) ) { throw new Exception( 'Insert: No table specified' ); } - if( count( $this->table ) > 1) { + if( count( $this->tables ) > 1 ) { throw new Exception( 'Insert: Multiple table specified' ); } - $table = $this->tables[0]; - $query = "INSERT INTO `$table` ($fields) VALUES ($values);"; + $query = "INSERT INTO $this->tables ($fields) VALUES ($values);"; - $query_exec = self::$db->exec( $query ); + $pdo_statement = self::$pdo->prepare( $query ); + $bindings = array_values( $data ); - if ( ! $query_exec ) { - EE::debug( self::$db->lastErrorMsg() ); + foreach ( $bindings as $key => $value ) { + $pdo_statement->bindValue($key+1, $value ); + } + + if( ! $result ) { + EE::debug( self::$pdo->errorInfo() ); return false; } @@ -167,78 +271,142 @@ public function insert( $data ) { /** * Select data from the database. * - * @return array + * @param array $args Columns to select + * + * @throws Exception If no tables are specified + * + * @return EE_DB */ public function select( ...$args ) { - if ( null === $this->tables ) { - throw new Exception( 'Select: No table specified' ); - } - - $tables = implode( ', ', $this->tables ); - if ( empty( $args ) ) { $columns = '*'; } else { $columns = implode( ', ', $args ); } - $query = "SELECT $columns FROM $tables" ; + $this->select = $columns; - if ( null !== $this->where ) { - $conditions = implode( ' AND ', $this->where ); - $query .= " WHERE $conditions"; - } - if ( null !== $this->limit ) { - $query .= ' LIMIT ' . $this->limit; + return $this; + } + + /** + * Fetches all records from current query + * + * @return array All records + * @throws Exception + */ + public function get() { + $pdo_statement = $this->common_retrival_function(); + + if( !$pdo_statement ) { + return false; } - $query_exec = self::$db->query( $query ); - $result = array(); + return $pdo_statement->fetchAll(); + } - if ( $query_exec ) { - while ( $row = $query_exec->fetchArray( SQLITE3_ASSOC ) ) { - $result[] = $row; - } + /** + * Fetches first record from current query + * + * @return array Record + * @throws Exception + */ + public function first() { + $pdo_statement = $this->common_retrival_function(); + + if( !$pdo_statement ) { + return false; } - return $result; + + return $pdo_statement->fetch(); } + /** + * Common retrival function that runs current 'select' query. + * Other methods (like get and first) can use this to provide higher level functionality on top of it + * + * @return bool|PDOStatement + * @throws Exception + */ + private function common_retrival_function() { + if ( null === $this->tables ) { + throw new Exception( 'Select: No table specified' ); + } + + $where = $this->where['query_string']; + $this->select === '' ? $this->select = '*' : ''; + + $query = "SELECT $this->select FROM $this->tables{$where}{$this->limit}{$this->offset};" ; + + $pdo_statement = self::$pdo->prepare( $query ); + $pdo_statement ->setFetchMode( PDO::FETCH_ASSOC ); + + $bindings = $this->where['bindings'] ?? []; + + foreach ( $bindings as $key => $value ) { + $pdo_statement->bindValue($key+1, $value ); + } + + $result = $pdo_statement->execute(); + + if( ! $result ) { + EE::debug( self::$pdo->errorInfo() ); + return false; + } + + return $pdo_statement; + } /** * Update row in table. * - * @param $data - * @param $where + * @param array $values Associative array of columns and their values + * + * @throws Exception If no table are specified or multiple table are specified or no where clause are specified * * @return bool */ - public function update( ...$values ) { + public function update( $values ) { if ( empty( $this->tables ) ) { throw new Exception( 'Update: No table specified' ); } if ( empty( $this->where ) ) { - throw new Exception( 'Delete: No where clause specified' ); + throw new Exception( 'Update: No where clause specified' ); } - if( count( $this->tables ) > 1) { + if ( count( $this->tables ) > 1 ) { throw new Exception( 'Update: Multiple table specified' ); } - $table = $this->tables[0]; - - $values = implode( ', ', $values ); - $conditions = implode( ' AND ', $this->where ); if ( empty( $values ) ) { return false; } - $table = $this->tables[0]; - $query = "UPDATE `$table` SET $values WHERE $conditions"; - $query_exec = self::$db->exec( $query ); + $set_keys = array_keys( $values ); + $set_values = array_values( $values ); + $where_values = $this->where['binding']; + + $set_clause = implode( $set_keys, ' = ?, ' ) . ' = ?'; + + $query = "UPDATE $this->tables SET $set_clause{$this->where['query_string']}"; + $pdo_statement = self::$pdo->query( $query ); + + $counter = 0; //We need counter here as we need to bind values of both SET and WHERE clauses + + foreach ( $set_values as $value ) { + $pdo_statement->bindValue( ++ $counter, $value ); + } + + foreach ( $where_values as $value ) { + $pdo_statement->bindValue( ++ $counter, $value ); + } + + $result = $pdo_statement->execute(); + if ( ! $query_exec ) { - EE::debug( self::$db->lastErrorMsg() ); + EE::debug( self::$pdo->errorInfo() ); return false; } return true; @@ -247,9 +415,9 @@ public function update( ...$values ) { /** * Delete data from table. * - * @param $where + * @throws Exception If no table are specified or multiple table are specified or no where clause are specified * - * @return bool + * @return bool Success. */ public function delete() { if ( empty( $this->tables ) ) { @@ -260,40 +428,41 @@ public function delete() { throw new Exception( 'Delete: No where clause specified' ); } - if( count( $this->tables ) > 1) { + if( count( $this->tables ) > 1 ) { throw new Exception( 'Delete: Multiple table specified' ); } - $table = $this->tables[0]; + $query = "DELETE FROM $this->tables{$this->where['query_string']}"; - $conditions = implode( ' AND ', $this->where ); - $query = "DELETE FROM `$table` WHERE $conditions"; + $pdo_statement = self::$pdo->query( $query ); - $query_exec = self::$db->exec( $query ); + foreach ( $this->where['bindings'] as $key => $binding ) { + $pdo_statement->bindValue( $key+1, $value ); + } - if ( ! $query_exec ) { - EE::debug( self::$db->lastErrorMsg() ); - } else { - return true; + if ( ! $result ) { + EE::debug( self::$pdo->errorInfo() ); + return false; } - return false; + return true; } /** * Check if a site entry exists in the database. * - * @param String $site_name Name of the site to be checked. + * @param string $site_name Name of the site to be checked. + * + * @throws Exception * * @return bool Success. */ public static function site_in_db( $site_name ) { - $site = self::select( - array( 'id' ), array( - 'sitename' => $site_name, - ) - ); + $site = self::table( 'sites' ) + ->select( 'id' ) + ->where( 'sitename', $site_name ) + ->first(); if ( $site ) { return true; @@ -306,19 +475,20 @@ public static function site_in_db( $site_name ) { * * @param String $site_name Name of the site to be checked. * + * @throws Exception + * * @return bool true if site is enabled, * false if disabled or site does not exists. */ public static function site_enabled( $site_name ) { - $site = self::select( - array( 'id', 'is_enabled' ), array( - 'sitename' => $site_name, - ) - ); + $site = self::table( 'sites' ) + ->select( 'id', 'is_enabled' ) + ->where( 'sitename', $site_name ) + ->first(); - if ( 1 === count( $site ) ) { - return $site[0]['is_enabled']; + if ( $site ) { + return $site['is_enabled']; } return false; @@ -329,17 +499,17 @@ public static function site_enabled( $site_name ) { * * @param String $site_name Name of the site. * + * @throws Exception + * * @return string type of site. */ public static function get_site_command( $site_name ) { + $site = self::table( 'sites' ) + ->select( 'site_command' ) + ->where( 'sitename', $site_name ) + ->get(); - if ( empty ( self::$db ) ) { - self::init_db(); - } - - $site = self::select( [ 'site_type' ], [ 'sitename' => $site_name ], 'sites', 1 ); - - return $site['site_type']; + return $site['site_command']; } /** @@ -347,11 +517,10 @@ public static function get_site_command( $site_name ) { */ public static function get_migrations() { - $sites = self::select( [ 'migration' ], [], 'migrations' ); - if ( empty( $sites ) ) { - return []; - } + $migrations = self::table( 'migrations' ) + ->select( 'migration') + ->get(); - return array_column( $sites, 'migration' ); + return array_column( $migrations, 'migration' ); } } diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 34d604597..3b66dd4cf 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -1,6 +1,6 @@ <?xml version="1.0"?> <ruleset name="EE"> - <description>WordPress Coding Standards for EE</description> + <description>Coding Standards for EasyEngine</description> <!-- Show sniff codes in all reports, and progress while running --> <arg value="sp"/> @@ -33,6 +33,7 @@ <exclude name="WordPress.NamingConventions.ValidVariableName.NotSnakeCaseMemberVar" /> <exclude name="WordPress.NamingConventions.ValidVariableName.MemberNotSnakeCase" /> <exclude name="WordPress.NamingConventions.ValidVariableName.NotSnakeCase" /> + <exclude name="WordPress.DB.*" /> </rule> <rule ref="WordPress.Files.FileName"> <properties> From b07bd161919aed608c496ec80105ac45f2a818e8 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Tue, 7 Aug 2018 22:49:58 +0530 Subject: [PATCH 0355/1044] Fixed formatting Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/class-ee-db.php | 401 ++++++++++++++++++++++---------------------- 1 file changed, 204 insertions(+), 197 deletions(-) diff --git a/php/class-ee-db.php b/php/class-ee-db.php index d8c42aeb8..50b17189f 100644 --- a/php/class-ee-db.php +++ b/php/class-ee-db.php @@ -19,11 +19,11 @@ public function __construct() { $this->select = ''; $this->tables = ''; - $this->limit = ''; + $this->limit = ''; $this->offset = ''; - $this->where = [ + $this->where = [ 'query_string' => null, - 'binding' => null + 'binding' => null ]; } @@ -47,7 +47,7 @@ private static function init_db() { * Sqlite database creation. */ private static function create_required_tables() { - $query = 'CREATE TABLE sites ( + $query = 'CREATE TABLE sites ( id INTEGER NOT NULL, sitename VARCHAR, site_type VARCHAR, @@ -105,22 +105,86 @@ private static function create_required_tables() { try { self::$pdo->exec( $query ); - } catch ( PDOException $exception) { + } + catch ( PDOException $exception ) { EE::error( 'Encountered Error while creating table: ' . $exception->getMessage() ); } } /** - * Selects table to do operation on. + * Check if a site entry exists in the database. * - * @param ...$args Tables to run query on. + * @param string $site_name Name of the site to be checked. * - * @return EE_DB + * @throws Exception + * + * @return bool Success. */ - public function table( ...$args ) { - $this->tables = implode(', ', $args); + public static function site_in_db( $site_name ) { - return $this; + $site = self::table( 'sites' ) + ->select( 'id' ) + ->where( 'sitename', $site_name ) + ->first(); + + if ( $site ) { + return true; + } + + return false; + } + + /** + * Fetches first record from current query + * + * @return array Record + * @throws Exception + */ + public function first() { + $pdo_statement = $this->common_retrival_function(); + + if ( ! $pdo_statement ) { + return false; + } + + return $pdo_statement->fetch(); + } + + /** + * Common retrival function that runs current 'select' query. + * Other methods (like get and first) can use this to provide higher level functionality on top of it + * + * @return bool|PDOStatement + * @throws Exception + */ + private function common_retrival_function() { + if ( null === $this->tables ) { + throw new Exception( 'Select: No table specified' ); + } + + $where = $this->where['query_string']; + $this->select === '' ? $this->select = '*' : ''; + + $query = "SELECT $this->select FROM $this->tables{$where}{$this->limit}{$this->offset};"; + + $pdo_statement = self::$pdo->prepare( $query ); + $pdo_statement->setFetchMode( PDO::FETCH_ASSOC ); + + $bindings = $this->where['bindings'] ?? []; + + foreach ( $bindings as $key => $value ) { + $pdo_statement->bindValue( $key + 1, $value ); + } + + $result = $pdo_statement->execute(); + + if ( ! $result ) { + EE::debug( self::$pdo->errorInfo() ); + + return false; + } + + return $pdo_statement; } /** @@ -139,7 +203,7 @@ public function table( ...$args ) { * @return EE_DB */ public function where( ...$args ) { - $args = func_get_args(); + $args = func_get_args(); $conditions = []; if ( 'array' === gettype( $args[0] ) ) { @@ -151,143 +215,88 @@ public function where( ...$args ) { } $this->where = [ - 'query_string' => ' WHERE '. implode( ' AND ', array_column( $conditions, 'query_string' ) ), - 'bindings' => array_column( $conditions, 'binding' ), + 'query_string' => ' WHERE ' . implode( ' AND ', array_column( $conditions, 'query_string' ) ), + 'bindings' => array_column( $conditions, 'binding' ), ]; return $this; } /** - * Returns a query fragment for where clause - * - * If the param given is ['column', 100], it returns ['column = ?', 100] - * If the param given is ['column', '>', 100], it returns ['column > ?', 100] + * Select data from the database. * - * @param array $condition An array of format [column, operator, value] or [column, value] + * @param array $args Columns to select * - * @throws Exception + * @throws Exception If no tables are specified * - * @return array prepared query string and its corresponding binding + * @return EE_DB */ - private function get_where_fragment( $condition ) { - $column = $condition[0]; - $operator = '='; - - if ( 'string' !== gettype( $column ) ) { - throw new Exception( 'Where clause column must be of type string' ); - } - - if ( isset( $condition[2] ) ) { - $operator = $condition[1]; - $allowed_operators = [ '=', '<', '>', '<=', '>=', '==', '!=', '<>', 'like', 'in' ]; - - if ( ! in_array( strtolower( $operator ), $allowed_operators ) ) { - throw new Exception( 'Where clause operator should be in one of following: ' . implode( ' ', $allowed_operators ) ); - } + public function select( ...$args ) { - $value = $condition[2]; - } elseif ( isset( $condition[1] ) ) { - $value = $condition[1]; + if ( empty( $args ) ) { + $columns = '*'; } else { - throw new Exception( 'Where clause value must be set' ); - } - - if ( 'string' !== gettype( $operator ) || ! in_array( gettype( $value ), [ 'string', 'integer' ], true ) ) { - throw new Exception( 'Where clause operator and value must be string' ); + $columns = implode( ', ', $args ); } - return [ - 'query_string' => "$column $operator ?", - 'binding' => $value, - ] ; - } - - /** - * Adds limit to query. - * - * @param int $limit Limit value. - * - * @return EE_DB - */ - public function limit( int $limit ) { - $this->limit = ' LIMIT ' . (string) $limit; + $this->select = $columns; return $this; } /** - * Adds offset to query. + * Selects table to do operation on. * - * @param int $offset Offset of query + * @param ...$args Tables to run query on. * * @return EE_DB */ - public function offset ( int $offset ) { - $this->offset = ' OFFSET ' . (string) $offset; + public function table( ...$args ) { + $this->tables = implode( ', ', $args ); return $this; } /** - * Insert row in table. + * Check if a site entry exists in the database as well as if it is enbaled. * - * @param array $data in key value pair. + * @param String $site_name Name of the site to be checked. * - * @throws Exception If no table or more than one tables are specified + * @throws Exception * - * @return bool + * @return bool true if site is enabled, + * false if disabled or site does not exists. */ - public function insert( $data ) { - - $fields = implode( ', ', array_keys( $data ) ); - $values = implode( array_fill(0, count( $data ), '?' ) ); - - if ( empty( $this->tables ) ) { - throw new Exception( 'Insert: No table specified' ); - } - - if( count( $this->tables ) > 1 ) { - throw new Exception( 'Insert: Multiple table specified' ); - } - - $query = "INSERT INTO $this->tables ($fields) VALUES ($values);"; - - $pdo_statement = self::$pdo->prepare( $query ); - $bindings = array_values( $data ); + public static function site_enabled( $site_name ) { - foreach ( $bindings as $key => $value ) { - $pdo_statement->bindValue($key+1, $value ); - } + $site = self::table( 'sites' ) + ->select( 'id', 'is_enabled' ) + ->where( 'sitename', $site_name ) + ->first(); - if( ! $result ) { - EE::debug( self::$pdo->errorInfo() ); - return false; + if ( $site ) { + return $site['is_enabled']; } - return true; + return false; } /** - * Select data from the database. + * Get site type. * - * @param array $args Columns to select + * @param String $site_name Name of the site. * - * @throws Exception If no tables are specified + * @throws Exception * - * @return EE_DB + * @return string type of site. */ - public function select( ...$args ) { - - if ( empty( $args ) ) { - $columns = '*'; - } else { - $columns = implode( ', ', $args ); - } - - $this->select = $columns; + public static function get_site_command( $site_name ) { + $site = self::table( 'sites' ) + ->select( 'site_command' ) + ->where( 'sitename', $site_name ) + ->get(); - return $this; + return $site['site_command']; } /** @@ -299,7 +308,7 @@ public function select( ...$args ) { public function get() { $pdo_statement = $this->common_retrival_function(); - if( !$pdo_statement ) { + if ( ! $pdo_statement ) { return false; } @@ -307,55 +316,81 @@ public function get() { } /** - * Fetches first record from current query + * Returns all migrations from table. + */ + public static function get_migrations() { + + $migrations = self::table( 'migrations' ) + ->select( 'migration' ) + ->get(); + + return array_column( $migrations, 'migration' ); + } + + /** + * Adds limit to query. * - * @return array Record - * @throws Exception + * @param int $limit Limit value. + * + * @return EE_DB */ - public function first() { - $pdo_statement = $this->common_retrival_function(); + public function limit( int $limit ) { + $this->limit = ' LIMIT ' . (string) $limit; - if( !$pdo_statement ) { - return false; - } + return $this; + } - return $pdo_statement->fetch(); + /** + * Adds offset to query. + * + * @param int $offset Offset of query + * + * @return EE_DB + */ + public function offset( int $offset ) { + $this->offset = ' OFFSET ' . (string) $offset; + + return $this; } /** - * Common retrival function that runs current 'select' query. - * Other methods (like get and first) can use this to provide higher level functionality on top of it + * Insert row in table. * - * @return bool|PDOStatement - * @throws Exception + * @param array $data in key value pair. + * + * @throws Exception If no table or more than one tables are specified + * + * @return bool */ - private function common_retrival_function() { - if ( null === $this->tables ) { - throw new Exception( 'Select: No table specified' ); + public function insert( $data ) { + + $fields = implode( ', ', array_keys( $data ) ); + $values = implode( array_fill( 0, count( $data ), '?' ) ); + + if ( empty( $this->tables ) ) { + throw new Exception( 'Insert: No table specified' ); } - $where = $this->where['query_string']; - $this->select === '' ? $this->select = '*' : ''; + if ( count( $this->tables ) > 1 ) { + throw new Exception( 'Insert: Multiple table specified' ); + } - $query = "SELECT $this->select FROM $this->tables{$where}{$this->limit}{$this->offset};" ; + $query = "INSERT INTO $this->tables ($fields) VALUES ($values);"; $pdo_statement = self::$pdo->prepare( $query ); - $pdo_statement ->setFetchMode( PDO::FETCH_ASSOC ); - - $bindings = $this->where['bindings'] ?? []; + $bindings = array_values( $data ); foreach ( $bindings as $key => $value ) { - $pdo_statement->bindValue($key+1, $value ); + $pdo_statement->bindValue( $key + 1, $value ); } - $result = $pdo_statement->execute(); - - if( ! $result ) { + if ( ! $result ) { EE::debug( self::$pdo->errorInfo() ); + return false; } - return $pdo_statement; + return true; } /** @@ -384,8 +419,8 @@ public function update( $values ) { return false; } - $set_keys = array_keys( $values ); - $set_values = array_values( $values ); + $set_keys = array_keys( $values ); + $set_values = array_values( $values ); $where_values = $this->where['binding']; $set_clause = implode( $set_keys, ' = ?, ' ) . ' = ?'; @@ -407,8 +442,10 @@ public function update( $values ) { if ( ! $query_exec ) { EE::debug( self::$pdo->errorInfo() ); + return false; } + return true; } @@ -428,7 +465,7 @@ public function delete() { throw new Exception( 'Delete: No where clause specified' ); } - if( count( $this->tables ) > 1 ) { + if ( count( $this->tables ) > 1 ) { throw new Exception( 'Delete: Multiple table specified' ); } @@ -437,11 +474,12 @@ public function delete() { $pdo_statement = self::$pdo->query( $query ); foreach ( $this->where['bindings'] as $key => $binding ) { - $pdo_statement->bindValue( $key+1, $value ); + $pdo_statement->bindValue( $key + 1, $value ); } if ( ! $result ) { EE::debug( self::$pdo->errorInfo() ); + return false; } @@ -449,78 +487,47 @@ public function delete() { } /** - * Check if a site entry exists in the database. - * - * @param string $site_name Name of the site to be checked. - * - * @throws Exception + * Returns a query fragment for where clause * - * @return bool Success. - */ - public static function site_in_db( $site_name ) { - - $site = self::table( 'sites' ) - ->select( 'id' ) - ->where( 'sitename', $site_name ) - ->first(); - - if ( $site ) { - return true; - } - return false; - } - - /** - * Check if a site entry exists in the database as well as if it is enbaled. + * If the param given is ['column', 100], it returns ['column = ?', 100] + * If the param given is ['column', '>', 100], it returns ['column > ?', 100] * - * @param String $site_name Name of the site to be checked. + * @param array $condition An array of format [column, operator, value] or [column, value] * * @throws Exception * - * @return bool true if site is enabled, - * false if disabled or site does not exists. + * @return array prepared query string and its corresponding binding */ - public static function site_enabled( $site_name ) { - - $site = self::table( 'sites' ) - ->select( 'id', 'is_enabled' ) - ->where( 'sitename', $site_name ) - ->first(); + private function get_where_fragment( $condition ) { + $column = $condition[0]; + $operator = '='; - if ( $site ) { - return $site['is_enabled']; + if ( 'string' !== gettype( $column ) ) { + throw new Exception( 'Where clause column must be of type string' ); } - return false; - } - - /** - * Get site type. - * - * @param String $site_name Name of the site. - * - * @throws Exception - * - * @return string type of site. - */ - public static function get_site_command( $site_name ) { - $site = self::table( 'sites' ) - ->select( 'site_command' ) - ->where( 'sitename', $site_name ) - ->get(); + if ( isset( $condition[2] ) ) { + $operator = $condition[1]; + $allowed_operators = [ '=', '<', '>', '<=', '>=', '==', '!=', '<>', 'like', 'in' ]; - return $site['site_command']; - } + if ( ! in_array( strtolower( $operator ), $allowed_operators ) ) { + throw new Exception( 'Where clause operator should be in one of following: ' . implode( ' ', $allowed_operators ) ); + } - /** - * Returns all migrations from table. - */ - public static function get_migrations() { + $value = $condition[2]; + } elseif ( isset( $condition[1] ) ) { + $value = $condition[1]; + } else { + throw new Exception( 'Where clause value must be set' ); + } - $migrations = self::table( 'migrations' ) - ->select( 'migration') - ->get(); + if ( 'string' !== gettype( $operator ) || ! in_array( gettype( $value ), [ 'string', 'integer' ], true ) ) { + throw new Exception( 'Where clause operator and value must be string' ); + } - return array_column( $migrations, 'migration' ); + return [ + 'query_string' => "$column $operator ?", + 'binding' => $value, + ]; } } From 9d0a33da0b0878f79bee0696d5978f13094035d4 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Wed, 8 Aug 2018 13:32:04 +0530 Subject: [PATCH 0356/1044] Fix ee site command Fix function name in where Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/class-ee-db.php | 7 ++++--- php/class-ee-site.php | 18 ++++++++++-------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/php/class-ee-db.php b/php/class-ee-db.php index 50b17189f..1b0860a32 100644 --- a/php/class-ee-db.php +++ b/php/class-ee-db.php @@ -200,6 +200,7 @@ private function common_retrival_function() { * * @param ...$args One or more where condition. * + * @throws Exception * @return EE_DB */ public function where( ...$args ) { @@ -208,10 +209,10 @@ public function where( ...$args ) { if ( 'array' === gettype( $args[0] ) ) { foreach ( $args[0] as $condition ) { - $conditions[] = $this->getWhereCondition( $condition ); + $conditions[] = $this->get_where_fragment( $condition ); } } else { - $conditions[] = $this->getWhereCondition( $args ); + $conditions[] = $this->get_where_fragment( $args ); } $this->where = [ @@ -521,7 +522,7 @@ private function get_where_fragment( $condition ) { throw new Exception( 'Where clause value must be set' ); } - if ( 'string' !== gettype( $operator ) || ! in_array( gettype( $value ), [ 'string', 'integer' ], true ) ) { + if ( 'string' !== gettype( $operator ) || ! in_array( gettype( $value ), [ 'string', 'integer', 'boolean' ], true ) ) { throw new Exception( 'Where clause operator and value must be string' ); } diff --git a/php/class-ee-site.php b/php/class-ee-site.php index 64472c206..9bf420c10 100644 --- a/php/class-ee-site.php +++ b/php/class-ee-site.php @@ -63,17 +63,19 @@ public function _list( $args, $assoc_args ) { $enabled = EE\Utils\get_flag_value( $assoc_args, 'enabled' ); $disabled = EE\Utils\get_flag_value( $assoc_args, 'disabled' ); - $where = array(); + $query = EE::db() + ->table( 'sites' ) + ->select( 'sitename', 'is_enabled' ); if ( $enabled && ! $disabled ) { - $where['is_enabled'] = 1; + $query->where( 'is_enabled', true ); } elseif ( $disabled && ! $enabled ) { - $where['is_enabled'] = 0; + $query->where( 'is_enabled', false ); } - $sites = EE::db()::select( array( 'sitename', 'is_enabled' ), $where ); + $sites = $query->get(); - if ( ! $sites ) { + if ( empty ( $sites ) ) { EE::error( 'No sites found!' ); } @@ -185,7 +187,7 @@ protected function delete_site( $level, $site_name, $site_root ) { } } - if ( EE::db()::delete( array( 'sitename' => $site_name ) ) ) { + if ( EE::db()->table( 'sites' )->where( 'sitename', $site_name )->delete() ) { EE::log( 'Removing database entry.' ); } else { EE::error( 'Could not remove the database entry' ); @@ -211,12 +213,12 @@ public function up( $args, $assoc_args ) { $force = EE\Utils\get_flag_value( $assoc_args, 'force' ); $args = EE\SiteUtils\auto_site_name( $args, 'site', __FUNCTION__ ); $this->populate_site_info( $args ); - if ( EE::db()::site_enabled( $this->site['name'] ) && ! $force ) { + if ( EE::db()->site_enabled( $this->site['name'] ) && ! $force ) { EE::error( sprintf( '%s is already enabled!', $this->site['name'] ) ); } EE::log( "Enabling site $this->site['name']." ); if ( EE::docker()::docker_compose_up( $this->site['root'] ) ) { - EE::db()::update( [ 'is_enabled' => '1' ], [ 'sitename' => $this->site['name'] ] ); + EE::db()->table( 'site' )->where( 'sitename', $this->site['name'])->update( [ 'is_enabled' => '1' ] ); EE::success( "Site $this->site['name'] enabled." ); } else { EE::error( sprintf( 'There was error in enabling %s. Please check logs.', $this->site['name'] ) ); From 9ba053a26ca3115e10d667e132aa1ee35b85e107 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Wed, 8 Aug 2018 19:08:11 +0530 Subject: [PATCH 0357/1044] Fix EE_DB Commands Fix EE_Site_Command Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/class-ee-db.php | 57 ++++++++++++++++++++++------------------- php/class-ee-docker.php | 2 +- php/class-ee-site.php | 6 ++--- phpcs.xml.dist | 3 ++- 4 files changed, 36 insertions(+), 32 deletions(-) diff --git a/php/class-ee-db.php b/php/class-ee-db.php index 1b0860a32..b3ca8bfd9 100644 --- a/php/class-ee-db.php +++ b/php/class-ee-db.php @@ -23,7 +23,7 @@ public function __construct() { $this->offset = ''; $this->where = [ 'query_string' => null, - 'binding' => null + 'bindings' => null, ]; } @@ -33,8 +33,7 @@ public function __construct() { private static function init_db() { try { self::$pdo = new PDO( 'sqlite:' . DB ); - } - catch ( PDOException $exception ) { + } catch ( PDOException $exception ) { EE::error( $exception->getMessage() ); } @@ -105,8 +104,7 @@ private static function create_required_tables() { try { self::$pdo->exec( $query ); - } - catch ( PDOException $exception ) { + } catch ( PDOException $exception ) { EE::error( 'Encountered Error while creating table: ' . $exception->getMessage() ); } } @@ -121,8 +119,8 @@ private static function create_required_tables() { * @return bool Success. */ public static function site_in_db( $site_name ) { - - $site = self::table( 'sites' ) + $db = new EE_DB(); + $site = $db->table( 'sites' ) ->select( 'id' ) ->where( 'sitename', $site_name ) ->first(); @@ -141,7 +139,7 @@ public static function site_in_db( $site_name ) { * @throws Exception */ public function first() { - $pdo_statement = $this->common_retrival_function(); + $pdo_statement = $this->common_retrieval_function(); if ( ! $pdo_statement ) { return false; @@ -157,7 +155,7 @@ public function first() { * @return bool|PDOStatement * @throws Exception */ - private function common_retrival_function() { + private function common_retrieval_function() { if ( null === $this->tables ) { throw new Exception( 'Select: No table specified' ); } @@ -172,8 +170,8 @@ private function common_retrival_function() { $bindings = $this->where['bindings'] ?? []; - foreach ( $bindings as $key => $value ) { - $pdo_statement->bindValue( $key + 1, $value ); + foreach ( $bindings as $key => $binding ) { + $pdo_statement->bindValue( $key + 1, $binding ); } $result = $pdo_statement->execute(); @@ -270,7 +268,8 @@ public function table( ...$args ) { */ public static function site_enabled( $site_name ) { - $site = self::table( 'sites' ) + $db = new EE_DB(); + $site = $db->table( 'sites' ) ->select( 'id', 'is_enabled' ) ->where( 'sitename', $site_name ) ->first(); @@ -292,10 +291,11 @@ public static function site_enabled( $site_name ) { * @return string type of site. */ public static function get_site_command( $site_name ) { - $site = self::table( 'sites' ) + $db = new EE_DB(); + $site = $db->table( 'sites' ) ->select( 'site_command' ) ->where( 'sitename', $site_name ) - ->get(); + ->first(); return $site['site_command']; } @@ -307,7 +307,7 @@ public static function get_site_command( $site_name ) { * @throws Exception */ public function get() { - $pdo_statement = $this->common_retrival_function(); + $pdo_statement = $this->common_retrieval_function(); if ( ! $pdo_statement ) { return false; @@ -321,7 +321,8 @@ public function get() { */ public static function get_migrations() { - $migrations = self::table( 'migrations' ) + $db = new EE_DB(); + $migrations = $db->table( 'migrations' ) ->select( 'migration' ) ->get(); @@ -372,7 +373,7 @@ public function insert( $data ) { throw new Exception( 'Insert: No table specified' ); } - if ( count( $this->tables ) > 1 ) { + if ( strpos( $this->tables, ',' ) !== false ) { throw new Exception( 'Insert: Multiple table specified' ); } @@ -412,7 +413,7 @@ public function update( $values ) { throw new Exception( 'Update: No where clause specified' ); } - if ( count( $this->tables ) > 1 ) { + if ( strpos( $this->tables, ',' ) !== false ) { throw new Exception( 'Update: Multiple table specified' ); } @@ -421,8 +422,8 @@ public function update( $values ) { } $set_keys = array_keys( $values ); - $set_values = array_values( $values ); - $where_values = $this->where['binding']; + $set_bindings = array_values( $values ); + $where_bindings = $this->where['bindings']; $set_clause = implode( $set_keys, ' = ?, ' ) . ' = ?'; @@ -431,17 +432,17 @@ public function update( $values ) { $counter = 0; //We need counter here as we need to bind values of both SET and WHERE clauses - foreach ( $set_values as $value ) { - $pdo_statement->bindValue( ++ $counter, $value ); + foreach ( $set_bindings as $binding ) { + $pdo_statement->bindValue( ++ $counter, $binding ); } - foreach ( $where_values as $value ) { - $pdo_statement->bindValue( ++ $counter, $value ); + foreach ( $where_bindings as $binding ) { + $pdo_statement->bindValue( ++ $counter, $binding ); } $result = $pdo_statement->execute(); - if ( ! $query_exec ) { + if ( ! $result ) { EE::debug( self::$pdo->errorInfo() ); return false; @@ -466,7 +467,7 @@ public function delete() { throw new Exception( 'Delete: No where clause specified' ); } - if ( count( $this->tables ) > 1 ) { + if ( strpos( $this->tables, ',' ) !== false ) { throw new Exception( 'Delete: Multiple table specified' ); } @@ -475,9 +476,11 @@ public function delete() { $pdo_statement = self::$pdo->query( $query ); foreach ( $this->where['bindings'] as $key => $binding ) { - $pdo_statement->bindValue( $key + 1, $value ); + $pdo_statement->bindValue( $key + 1, $binding ); } + $result = $pdo_statement->execute(); + if ( ! $result ) { EE::debug( self::$pdo->errorInfo() ); diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php index 1bc610cf4..03f96c4d5 100644 --- a/php/class-ee-docker.php +++ b/php/class-ee-docker.php @@ -194,7 +194,7 @@ public static function docker_compose_up( $dir, $services = [] ) { return false; } - /** + /** * Function to destroy the containers. * * @param String $dir Path to docker-compose.yml. diff --git a/php/class-ee-site.php b/php/class-ee-site.php index 9bf420c10..6d3165520 100644 --- a/php/class-ee-site.php +++ b/php/class-ee-site.php @@ -241,7 +241,7 @@ public function down( $args, $assoc_args ) { $this->populate_site_info( $args ); EE::log( sprintf( 'Disabling site %s.', $this->site['name'] ) ); if ( EE::docker()::docker_compose_down( $this->site['root'] ) ) { - EE::db()::update( [ 'is_enabled' => '0' ], [ 'sitename' => $this->site['name'] ] ); + EE::db()->table( 'sites' )->where( 'sitename', $this->site['name'] )->update( [ 'is_enabled' => '0' ] ); EE::success( sprintf( 'Site %s disabled.', $this->site['name'] ) ); } else { EE::error( sprintf( 'There was error in disabling %s. Please check logs.', $this->site['name'] ) ); @@ -414,9 +414,9 @@ private function populate_site_info( $args ) { $this->site['name'] = EE\Utils\remove_trailing_slash( $args[0] ); - if ( EE::db()::site_in_db( $this->site['name'] ) ) { + if ( EE::db()->site_in_db( $this->site['name'] ) ) { - $db_select = EE::db()::select( [], [ 'sitename' => $this->site['name'] ], 'sites', 1 ); + $db_select = EE::db()->table( 'sites' )->where( 'sitename', $this->site['name'] )->first(); $this->site['type'] = $db_select['site_type']; $this->site['root'] = $db_select['site_path']; diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 3b66dd4cf..077ac221a 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -33,7 +33,8 @@ <exclude name="WordPress.NamingConventions.ValidVariableName.NotSnakeCaseMemberVar" /> <exclude name="WordPress.NamingConventions.ValidVariableName.MemberNotSnakeCase" /> <exclude name="WordPress.NamingConventions.ValidVariableName.NotSnakeCase" /> - <exclude name="WordPress.DB.*" /> + <exclude name="WordPress.DB.RestrictedFunctions" /> + <exclude name="WordPress.DB.RestrictedClasses" /> </rule> <rule ref="WordPress.Files.FileName"> <properties> From 141a0b4ea4e9b7e26ff886dc541e7931fc65ede1 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Wed, 8 Aug 2018 20:50:32 +0530 Subject: [PATCH 0358/1044] Refactor DB Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/class-ee-db.php | 50 ++++++++++++++------------------------------- 1 file changed, 15 insertions(+), 35 deletions(-) diff --git a/php/class-ee-db.php b/php/class-ee-db.php index dd5e8a58d..d5b5662e8 100644 --- a/php/class-ee-db.php +++ b/php/class-ee-db.php @@ -48,59 +48,39 @@ private static function init_db() { private static function create_required_tables() { $query = 'CREATE TABLE sites ( id INTEGER NOT NULL, - sitename VARCHAR, + site_name VARCHAR, site_type VARCHAR, - site_title VARCHAR, - site_command VARCHAR, - proxy_type VARCHAR, - cache_type VARCHAR, + cache_enabled VARCHAR, site_path VARCHAR, - created_on DATETIME, is_enabled BOOLEAN DEFAULT 1, is_ssl BOOLEAN DEFAULT 0, is_ssl_wildcard BOOLEAN DEFAULT 0, - storage_fs VARCHAR, - storage_db VARCHAR, - db_name VARCHAR, - db_user VARCHAR, - db_password VARCHAR, - db_root_password VARCHAR, - db_host VARCHAR, - db_port VARCHAR, - wp_user VARCHAR, - wp_pass VARCHAR, - email VARCHAR, - php_version VARCHAR, PRIMARY KEY (id), - UNIQUE (sitename), + UNIQUE (site_name), CHECK (is_enabled IN (0, 1)), CHECK (is_ssl IN (0, 1)) );'; + $query .= 'CREATE TABLE site_meta ( + id INTEGER NOT NULL, + site_id INTEGER NOT NULL, + meta_key VARCHAR, + meta_value VARCHAR, + PRIMARY KEY (id), + FOREIGN KEY (site_id) REFERENCES sites(id) + );'; + $query .= 'CREATE TABLE migrations ( migration VARCHAR, timestamp DATETIME );'; - $query .= 'CREATE TABLE services ( - id INTEGER NOT NULL, - sitename VARCHAR, - phpmyadmin BOOLEAN DEFAULT 0, - mailhog BOOLEAN DEFAULT 0, - postfix BOOLEAN DEFAULT 0, - phpredisadmin BOOLEAN DEFAULT 0, - adminer BOOLEAN DEFAULT 0, - anemometer BOOLEAN DEFAULT 0, - debug BOOLEAN DEFAULT 0, - PRIMARY KEY (id), - FOREIGN KEY (id) REFERENCES sites(id) - );'; - $query .= 'CREATE TABLE cron ( id INTEGER PRIMARY KEY AUTOINCREMENT, - sitename VARCHAR, + site_name VARCHAR, command VARCHAR, - schedule VARCHAR + schedule VARCHAR, + FOREIGN KEY (site_name) REFERENCES sites(site_name) );'; try { From 3c2c3c0ab0f3eeaf4365605e8fa57dfd0b9f6c14 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 9 Aug 2018 17:06:50 +0530 Subject: [PATCH 0359/1044] Update site-utils to start specific site conatainers Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/site-utils.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/php/site-utils.php b/php/site-utils.php index 621a13640..60ca611b1 100644 --- a/php/site-utils.php +++ b/php/site-utils.php @@ -275,17 +275,18 @@ function get_curl_info( $url, $port = 80, $port_info = false ) { /** * Function to pull the latest images and bring up the site containers. * - * @param string $site_root Root directory of the site. + * @param string $site_root Root directory of the site. + * @param array $containers The minimum required conatainers to start the site. Default null, leads to starting of all containers. * * @throws \Exception when docker-compose up fails. */ -function start_site_containers( $site_root ) { +function start_site_containers( $site_root, $containers = [] ) { EE::log( 'Pulling latest images. This may take some time.' ); chdir( $site_root ); EE::exec( 'docker-compose pull' ); EE::log( 'Starting site\'s services.' ); - if ( ! EE::docker()::docker_compose_up( $site_root ) ) { + if ( ! EE::docker()::docker_compose_up( $site_root, $containers ) ) { throw new \Exception( 'There was some error in docker-compose up.' ); } } From 55124bffca48465c9c897d065a482bfb5029f8e0 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 9 Aug 2018 18:25:57 +0530 Subject: [PATCH 0360/1044] Add info for tab completions Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index f2dbe1f87..cbc47f5f3 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,26 @@ wget -O /usr/local/bin/ee https://raw.githubusercontent.com/EasyEngine/easyengin chmod +x /usr/local/bin/ee ``` +### Tab completions + +EasyEngine also comes with a tab completion script for Bash and ZSH. Just download [ee-completion.bash](https://raw.githubusercontent.com/EasyEngine/easyengine/develop-v4/utils/ee-completion.bash) and source it from `~/.bash_profile`: + +```bash +source /FULL/PATH/TO/ee-completion.bash +``` + +Don't forget to run `source ~/.bash_profile` afterwards. + +If using zsh for your shell, you may need to load and start `bashcompinit` before sourcing. Put the following in your `.zshrc`: + +```bash +autoload bashcompinit +bashcompinit +source /FULL/PATH/TO/ee-completion.bash +``` + +Note: Currently tab completions will only work for users with `root` priviledges. + ## Usage To get started with EasyEngine and create a wordpress site, run From fed38ed6514841696382099c987187bdb51acd2b Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 9 Aug 2018 18:32:04 +0530 Subject: [PATCH 0361/1044] Remove redundant note Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index cbc47f5f3..dd73138ef 100644 --- a/README.md +++ b/README.md @@ -44,8 +44,6 @@ bashcompinit source /FULL/PATH/TO/ee-completion.bash ``` -Note: Currently tab completions will only work for users with `root` priviledges. - ## Usage To get started with EasyEngine and create a wordpress site, run From 2de3ba13049d198e0822b6085684ffb86851e997 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Thu, 9 Aug 2018 19:22:31 +0530 Subject: [PATCH 0362/1044] Update site tables Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/class-ee-db.php | 50 +++++++++++++++++++++++++++++++-------------- 1 file changed, 35 insertions(+), 15 deletions(-) diff --git a/php/class-ee-db.php b/php/class-ee-db.php index d5b5662e8..ec8cf3158 100644 --- a/php/class-ee-db.php +++ b/php/class-ee-db.php @@ -47,40 +47,60 @@ private static function init_db() { */ private static function create_required_tables() { $query = 'CREATE TABLE sites ( - id INTEGER NOT NULL, - site_name VARCHAR, + id INTEGER PRIMARY KEY AUTOINCREMENT, + site_url VARCHAR, site_type VARCHAR, - cache_enabled VARCHAR, - site_path VARCHAR, - is_enabled BOOLEAN DEFAULT 1, - is_ssl BOOLEAN DEFAULT 0, - is_ssl_wildcard BOOLEAN DEFAULT 0, - PRIMARY KEY (id), - UNIQUE (site_name), - CHECK (is_enabled IN (0, 1)), - CHECK (is_ssl IN (0, 1)) + site_fs_path VARCHAR, + site_enabled BOOLEAN, + site_ssl VARCHAR, + nginx_browser_cache VARCHAR, + nginx_fullpage_cache VARCHAR, + php_version VARCHAR, + php_opcache VARCHAR, + db_name VARCHAR, + db_user VARCHAR, + db_password VARCHAR, + db_root_password VARCHAR, + db_host VARCHAR, + db_port VARCHAR, + db_cache VARCHAR, + app_admin_url VARCHAR, + app_admin_email VARCHAR, + app_admin_username VARCHAR, + app_admin_password VARCHAR, + app_object_cache VARCHAR, + app_mail VARCHAR, + admin_tools VARCHAR, + created_on DATETIME, + modified_on DATETIME, + site_auth_scope VARCHAR, + site_auth_username VARCHAR, + site_auth_password VARCHAR, + UNIQUE (site_url), + CHECK (site_enabled IN (0, 1)), + CHECK (site_ssl IN (0, 1)) );'; $query .= 'CREATE TABLE site_meta ( - id INTEGER NOT NULL, + id INTEGER PRIMARY KEY AUTOINCREMENT, site_id INTEGER NOT NULL, meta_key VARCHAR, meta_value VARCHAR, - PRIMARY KEY (id), FOREIGN KEY (site_id) REFERENCES sites(id) );'; $query .= 'CREATE TABLE migrations ( + id INTEGER PRIMARY KEY AUTOINCREMENT, migration VARCHAR, timestamp DATETIME );'; $query .= 'CREATE TABLE cron ( id INTEGER PRIMARY KEY AUTOINCREMENT, - site_name VARCHAR, + site_url VARCHAR, command VARCHAR, schedule VARCHAR, - FOREIGN KEY (site_name) REFERENCES sites(site_name) + FOREIGN KEY (site_url) REFERENCES sites(site_url) );'; try { From ab6ee871de1f5b08f82beb5a702d26548acfcc25 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Fri, 10 Aug 2018 05:02:39 +0530 Subject: [PATCH 0363/1044] Add Models of EE Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/EE/Model/Base.php | 246 +++++++++++++++++++++++++++++++++++++ php/EE/Model/Cron.php | 12 ++ php/EE/Model/Migration.php | 25 ++++ php/EE/Model/Site.php | 90 ++++++++++++++ 4 files changed, 373 insertions(+) create mode 100644 php/EE/Model/Base.php create mode 100644 php/EE/Model/Cron.php create mode 100644 php/EE/Model/Migration.php create mode 100644 php/EE/Model/Site.php diff --git a/php/EE/Model/Base.php b/php/EE/Model/Base.php new file mode 100644 index 000000000..50b0214d5 --- /dev/null +++ b/php/EE/Model/Base.php @@ -0,0 +1,246 @@ +<?php + +namespace EE\Model; + +use EE; + +/** + * Base EE Model class. + */ +abstract class Base extends \ArrayObject +{ + + /** + * @var string Table that current model will write to + */ + protected static $table; + + /** + * @var string Primary key of current model + */ + protected static $primary_key; + + /** + * @var string It will contain an array of all fields that are present in database in table + */ + protected $fields; + + /** + * Base constructor. + * + * @param array $fields Array of fields containing fields from database + */ + public function __construct( array $fields = [] ) { + $this->fields = $fields; + } + + /** + * In model, every value is get in fields array. + * We populate it either during constructor or during find() method call + * + * This gives us benefit that models do not have to define properties in class + * They are automatically defined when fetched from database! + * + * @param string $name Name of property to get + * + * @throws \Exception + * + * @return mixed Value of property + */ + public function __get( string $name ) { + if ( isset( $this->fields[$name] ) ) { + return $this->fields[$name]; + } + + throw new \Exception( "Unable to find variable: $name" ); + } + + /** + * In model, every value is set in fields array. + * + * This gives us benefit that models do not have to define the logic of saving them in database. + * While saving models, we use the $fields array to save it in database + * + * + * @param string $name Name of property to set + * @param mixed $value Value of property to set + */ + public function __set( string $name, $value ) { + $this->fields[$name] = $value; + } + + /** + * Overriding isset for correct behaviour while using isset on model objects + * + * @param string|int $name Name of property to check + * + * @return bool + */ + public function __isset( $name ) { + return isset( $this->fields[ $name ] ); + } + + /** + * Overriding offsetGet for correct behaviour while accessing object properties by array index. + * + * @param string|int $index Name of property to check + * + * @throws \Exception + * + * @return bool + */ + public function offsetGet( $index ) { + return $this->__get( $index ); + } + + /** + * Overriding offsetGet for correct behaviour while saving object properties by array index. + * + * @param string|int $index Name of property to check + * + * @throws \Exception + * + * @return bool + */ + public function offsetSet( $index, $value ) { + return $this->__set( $index, $value ); + } + + /** + * Overriding offsetGet for correct behaviour while checking array_key_exists. + * + * @param string|int $index Name of property to check + * + * @throws \Exception + * + * @return bool + */ + public function offsetExists( $index ) { + return $this->__isset( $index ); + } + + /** + * Returns single model fetched by primary key + * + * @param string $pk primary key of model + * + * @throws \Exception + * + * @return mixed Model + */ + public static function find( string $pk ) { + return static::single_array_to_model( + EE::db() + ->table( static::$table ) + ->where( static::$primary_key, $pk ) + ->first() + ); + } + + /** + * @param string $pk + * + * @return static + * @throws \Exception + */ + public static function find_or_fail( string $pk ) { + $model = static::find( $pk ); + + if ( ! $model ) { + throw new \Exception( 'Unable to find ' . __CLASS__ . ' : ' ); + } + return $model; + } + + /** + * Returns all models. + * + * @param array $columns Columns to select + * + * @return array Array of models + * @throws \Exception + */ + public static function all( $columns = [] ) { + return static::many_array_to_model( + EE::db() + ->table( static::$table ) + ->select( ...$columns ) + ->get() + ); + } + + /** + * Saves current model into database + * + * @throws \Exception + * + * @return bool Model saved successfully + */ + public function save() { + return EE::db() + ->table( static::$table ) + ->where( static::$primary_key, $this[static::$primary_key] ) + ->update( $this->fields ); + } + + /** + * Saves current model into database + * + * @throws \Exception + * + * @return bool Model saved successfully + */ + public function delete() { + return EE::db() + ->table( static::$table ) + ->where( static::$primary_key, $this->id ) + ->delete(); + } + + /** + * Returns all model with condition + * + * @param string|array $column Column to search in + * @param string|int $value Value to match + * + * @throws \Exception + * + * @return array + */ + public static function where( $column, $value ) { + return static::many_array_to_model( + EE::db() + ->table( static::$table ) + ->where( $column, $value ) + ->all() + ); + } + + /** + * Converts single row fetched from database into model + * + * @param array $arr Associative array representing a row from database + * + * @return mixed + */ + protected static function single_array_to_model( array $arr ) { + return new static( $arr ); + } + + /** + * Converts an array of result from database to models + * + * @param array $arr Array of results from database + * + * @return array + */ + protected static function many_array_to_model( array $arr ) { + $result = []; + + foreach ( $arr as $model ) { + $result[] = static::single_array_to_model( $model ); + } + + return $result; + } +} diff --git a/php/EE/Model/Cron.php b/php/EE/Model/Cron.php new file mode 100644 index 000000000..887b842f0 --- /dev/null +++ b/php/EE/Model/Cron.php @@ -0,0 +1,12 @@ +<?php + +namespace EE\Model; + +/** + * Cron model class + */ +class Cron extends Base { + + protected static $table = 'cron'; + +} diff --git a/php/EE/Model/Migration.php b/php/EE/Model/Migration.php new file mode 100644 index 000000000..32a21d9bd --- /dev/null +++ b/php/EE/Model/Migration.php @@ -0,0 +1,25 @@ +<?php + +namespace EE\Model; + +/** + * Migration model class. + */ +class Migration extends Base { + + protected static $table = 'migrations'; + + /** + * Returns all migrations from table. + */ + public static function get_migrations() { + + $db = new EE_DB(); + $migrations = $db->table( 'migrations' ) + ->select( 'migration' ) + ->get(); + + return array_column( $migrations, 'migration' ); + } + +} diff --git a/php/EE/Model/Site.php b/php/EE/Model/Site.php new file mode 100644 index 000000000..a118dc0de --- /dev/null +++ b/php/EE/Model/Site.php @@ -0,0 +1,90 @@ +<?php + +namespace EE\Model; + +/** + * Site model class. + */ +class Site extends Base { + + protected static $table = 'sites'; + protected static $primary_key = 'site_url'; + + /** + * Check if a site entry exists in the database. + * + * @param string $site_name Name of the site to be checked. + * + * @throws Exception + * + * @return bool Success. + */ + public static function site_in_db( $site_name ) { + $db = new EE_DB(); + $site = $db->table( 'sites' ) + ->select( 'id' ) + ->where( 'site_name', $site_name ) + ->first(); + + if ( $site ) { + return true; + } + + return false; + } + + /** + * @param $url + * + * @return Site + * @throws \Exception + */ + public static function find_by_url( $url ) { + return Site::where( 'site_url', $url )->first(); + } + + /** + * Check if a site entry exists in the database as well as if it is enbaled. + * + * @param String $site_name Name of the site to be checked. + * + * @throws Exception + * + * @return bool true if site is enabled, + * false if disabled or site does not exists. + */ + public static function site_enabled( $site_name ) { + + $db = new EE_DB(); + $site = $db->table( 'sites' ) + ->select( 'id', 'site_enabled' ) + ->where( 'site_name', $site_name ) + ->first(); + + if ( $site ) { + return $site['site_enabled']; + } + + return false; + } + + /** + * Get site type. + * + * @param String $site_name Name of the site. + * + * @throws Exception + * + * @return string type of site. + */ + public static function get_site_command( $site_name ) { + $db = new EE_DB(); + $site = $db->table( 'sites' ) + ->select( 'site_command' ) + ->where( 'site_name', $site_name ) + ->first(); + + return $site['site_command']; + } + +} From ceaa99f353316df28a06a36b1b85c8cc059f34b3 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Fri, 10 Aug 2018 05:05:37 +0530 Subject: [PATCH 0364/1044] Made required changes in DB Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/class-ee-db.php | 119 ++++++++++++-------------------------------- 1 file changed, 32 insertions(+), 87 deletions(-) diff --git a/php/class-ee-db.php b/php/class-ee-db.php index ec8cf3158..e7a4e3b11 100644 --- a/php/class-ee-db.php +++ b/php/class-ee-db.php @@ -31,23 +31,33 @@ public function __construct() { * Function to initialize db and db connection. */ private static function init_db() { + + if ( ! ( file_exists( DB ) ) ) { + self::create_required_tables(); + return; + } + try { self::$pdo = new PDO( 'sqlite:' . DB ); + self::$pdo->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION ); } catch ( PDOException $exception ) { EE::error( $exception->getMessage() ); } - - if ( ! ( file_exists( DB ) ) ) { - self::create_required_tables(); - } } /** * Sqlite database creation. */ private static function create_required_tables() { + try { + self::$pdo = new PDO( 'sqlite:' . DB ); + self::$pdo->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION ); + } catch ( PDOException $exception ) { + EE::error( $exception->getMessage() ); + } + $query = 'CREATE TABLE sites ( - id INTEGER PRIMARY KEY AUTOINCREMENT, + id INTEGER, site_url VARCHAR, site_type VARCHAR, site_fs_path VARCHAR, @@ -76,30 +86,33 @@ private static function create_required_tables() { site_auth_scope VARCHAR, site_auth_username VARCHAR, site_auth_password VARCHAR, + PRIMARY KEY (id), UNIQUE (site_url), - CHECK (site_enabled IN (0, 1)), - CHECK (site_ssl IN (0, 1)) + CHECK (site_enabled IN (0, 1)) );'; $query .= 'CREATE TABLE site_meta ( - id INTEGER PRIMARY KEY AUTOINCREMENT, + id INTEGER, site_id INTEGER NOT NULL, meta_key VARCHAR, meta_value VARCHAR, + PRIMARY KEY (id), FOREIGN KEY (site_id) REFERENCES sites(id) );'; $query .= 'CREATE TABLE migrations ( - id INTEGER PRIMARY KEY AUTOINCREMENT, + id INTEGER, migration VARCHAR, - timestamp DATETIME + timestamp DATETIME, + PRIMARY KEY (id) );'; $query .= 'CREATE TABLE cron ( - id INTEGER PRIMARY KEY AUTOINCREMENT, + id INTEGER, site_url VARCHAR, command VARCHAR, schedule VARCHAR, + PRIMARY KEY (id), FOREIGN KEY (site_url) REFERENCES sites(site_url) );'; @@ -110,29 +123,6 @@ private static function create_required_tables() { } } - /** - * Check if a site entry exists in the database. - * - * @param string $site_name Name of the site to be checked. - * - * @throws Exception - * - * @return bool Success. - */ - public static function site_in_db( $site_name ) { - $db = new EE_DB(); - $site = $db->table( 'sites' ) - ->select( 'id' ) - ->where( 'sitename', $site_name ) - ->first(); - - if ( $site ) { - return true; - } - - return false; - } - /** * Fetches first record from current query * @@ -257,50 +247,6 @@ public function table( ...$args ) { return $this; } - /** - * Check if a site entry exists in the database as well as if it is enbaled. - * - * @param String $site_name Name of the site to be checked. - * - * @throws Exception - * - * @return bool true if site is enabled, - * false if disabled or site does not exists. - */ - public static function site_enabled( $site_name ) { - - $db = new EE_DB(); - $site = $db->table( 'sites' ) - ->select( 'id', 'is_enabled' ) - ->where( 'sitename', $site_name ) - ->first(); - - if ( $site ) { - return $site['is_enabled']; - } - - return false; - } - - /** - * Get site type. - * - * @param String $site_name Name of the site. - * - * @throws Exception - * - * @return string type of site. - */ - public static function get_site_command( $site_name ) { - $db = new EE_DB(); - $site = $db->table( 'sites' ) - ->select( 'site_command' ) - ->where( 'sitename', $site_name ) - ->first(); - - return $site['site_command']; - } - /** * Fetches all records from current query * @@ -318,16 +264,13 @@ public function get() { } /** - * Returns all migrations from table. + * Fetches all records from current query. + * + * @return array All records + * @throws Exception */ - public static function get_migrations() { - - $db = new EE_DB(); - $migrations = $db->table( 'migrations' ) - ->select( 'migration' ) - ->get(); - - return array_column( $migrations, 'migration' ); + public function all() { + return $this->get(); } /** @@ -387,6 +330,8 @@ public function insert( $data ) { $pdo_statement->bindValue( $key + 1, $value ); } + $result = $pdo_statement->execute(); + if ( ! $result ) { EE::debug( self::$pdo->errorInfo() ); From 402e95ba8b69511db84b43975e7805281ead28b0 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Fri, 10 Aug 2018 05:07:18 +0530 Subject: [PATCH 0365/1044] Apply refactor changes in EE_Site_Command Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/EE/Runner.php | 6 +- php/class-ee-site.php | 128 ++++++++++++++++--------------- php/commands/src/CLI_Command.php | 19 ++--- php/site-utils.php | 19 ++--- 4 files changed, 90 insertions(+), 82 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index b42358629..84117b400 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -8,9 +8,7 @@ use EE\Dispatcher\CompositeCommand; use Mustangostang\Spyc; use Monolog\Logger; -use Monolog\Handler\StreamHandler; -use Monolog\Formatter\LineFormatter; - +use EE\Model\Site; /** * Performs the execution of a command. * @@ -741,7 +739,7 @@ public function route() { $site_name = \EE\SiteUtils\auto_site_name( $final_args, $command, $function, $arg_position )[ $arg_position ]; // Getting the type of the respective site-name from database. - $type = EE::db()::get_site_command( $site_name ); + $type = Site::find( $site_name )->site_type; // Replacing `site` with appropriate type command if the function called for it exists. $key = array_search( 'site', $this->arguments ); diff --git a/php/class-ee-site.php b/php/class-ee-site.php index f884669a4..cb2cf7a96 100644 --- a/php/class-ee-site.php +++ b/php/class-ee-site.php @@ -1,13 +1,15 @@ <?php use \Symfony\Component\Filesystem\Filesystem; +use \EE\Model\Site; /** * Base class for Site command * * @package ee */ -abstract class EE_Site_Command { +abstract class EE_Site_Command +{ /** * @var Filesystem $fs Symfony Filesystem object. */ @@ -64,41 +66,37 @@ public function __construct() { public function _list( $args, $assoc_args ) { EE\Utils\delem_log( 'site list start' ); - $format = EE\Utils\get_flag_value( $assoc_args, 'format' ); - $enabled = EE\Utils\get_flag_value( $assoc_args, 'enabled' ); + $format = EE\Utils\get_flag_value( $assoc_args, 'format' ); + $enabled = EE\Utils\get_flag_value( $assoc_args, 'enabled' ); $disabled = EE\Utils\get_flag_value( $assoc_args, 'disabled' ); - $query = EE::db() - ->table( 'sites' ) - ->select( 'sitename', 'is_enabled' ); + $sites = Site::all(); - if ( $enabled && ! $disabled ) { - $query->where( 'is_enabled', true ); - } elseif ( $disabled && ! $enabled ) { - $query->where( 'is_enabled', false ); + if ( $enabled && !$disabled ) { + $sites = Site::where( 'is_enabled', true ); + } elseif ( $disabled && !$enabled ) { + $sites = Site::where( 'is_enabled', false ); } - $sites = $query->get(); - if ( empty ( $sites ) ) { EE::error( 'No sites found!' ); } if ( 'text' === $format ) { foreach ( $sites as $site ) { - EE::log( $site['sitename'] ); + EE::log( $site['site_url'] ); } } else { $result = array_map( function ( $site ) { - $site['site'] = $site['sitename']; - $site['status'] = $site['is_enabled'] ? 'enabled' : 'disabled'; + $site['site'] = $site['site_url']; + $site['status'] = $site['site_enabled'] ? 'enabled' : 'disabled'; return $site; }, $sites ); - $formatter = new EE\Formatter( $assoc_args, [ 'site', 'status' ] ); + $formatter = new EE\Formatter( $assoc_args, ['site', 'status'] ); $formatter->display_items( $result ); } @@ -130,7 +128,7 @@ public function delete( $args, $assoc_args ) { /** * Function to delete the given site. * - * @param int $level Level of deletion. + * @param int $level Level of deletion. * Level - 0: No need of clean-up. * Level - 1: Clean-up only the site-root. * Level - 2: Try to remove network. The network may or may not have been created. @@ -141,7 +139,7 @@ public function delete( $args, $assoc_args ) { */ protected function delete_site( $level, $site_name, $site_root ) { - $this->fs = new Filesystem(); + $this->fs = new Filesystem(); $proxy_type = EE_PROXY_TYPE; if ( $level >= 3 ) { if ( EE::docker()::docker_compose_down( $site_root ) ) { @@ -179,20 +177,20 @@ protected function delete_site( $level, $site_name, $site_root ) { if ( $level > 4 ) { if ( $this->le ) { EE::log( 'Removing ssl certs.' ); - $crt_file = EE_CONF_ROOT . "/nginx/certs/$site_name.crt"; - $key_file = EE_CONF_ROOT . "/nginx/certs/$site_name.key"; + $crt_file = EE_CONF_ROOT . "/nginx/certs/$site_name.crt"; + $key_file = EE_CONF_ROOT . "/nginx/certs/$site_name.key"; $conf_certs = EE_CONF_ROOT . "/acme-conf/certs/$site_name"; - $conf_var = EE_CONF_ROOT . "/acme-conf/var/$site_name"; + $conf_var = EE_CONF_ROOT . "/acme-conf/var/$site_name"; - $cert_files = [ $conf_certs, $conf_var, $crt_file, $key_file ]; + $cert_files = [$conf_certs, $conf_var, $crt_file, $key_file]; try { $this->fs->remove( $cert_files ); } catch ( Exception $e ) { EE::warning( $e ); } - } - if ( EE::db()->table( 'sites' )->where( 'sitename', $site_name )->delete() ) { + + if ( Site::find_by_url( $site_name )->delete() ) { EE::log( 'Removing database entry.' ); } else { EE::error( 'Could not remove the database entry' ); @@ -216,17 +214,22 @@ public function up( $args, $assoc_args ) { EE\Utils\delem_log( 'site enable start' ); $force = EE\Utils\get_flag_value( $assoc_args, 'force' ); - $args = EE\SiteUtils\auto_site_name( $args, 'site', __FUNCTION__ ); + $args = EE\SiteUtils\auto_site_name( $args, 'site', __FUNCTION__ ); $this->populate_site_info( $args ); - if ( EE::db()->site_enabled( $this->site['name'] ) && ! $force ) { - EE::error( sprintf( '%s is already enabled!', $this->site['name'] ) ); + $site = Site::find( $this->site['name'] ); + + if ( $site->site_enabled && ! $force ) { + EE::error( sprintf( '%s is already enabled!', $site->site_url ) ); } - EE::log( sprintf( 'Enabling site %s.', $this->site['name'] ) ); + + EE::log( sprintf( 'Enabling site %s.', $site->site_url ) ); + if ( EE::docker()::docker_compose_up( $this->site['root'] ) ) { - EE::db()->table( 'site' )->where( 'sitename', $this->site['name'])->update( [ 'is_enabled' => '1' ] ); - EE::success( "Site $this->site['name'] enabled." ); + $site->site_enabled = 1; + $site->save(); + EE::success( "Site $site->site_url enabled." ); } else { - EE::error( sprintf( 'There was error in enabling %s. Please check logs.', $this->site['name'] ) ); + EE::error( sprintf( 'There was error in enabling %s. Please check logs.', $site->site_url ) ); } EE\Utils\delem_log( 'site enable end' ); } @@ -244,9 +247,15 @@ public function down( $args, $assoc_args ) { EE\Utils\delem_log( 'site disable start' ); $args = EE\SiteUtils\auto_site_name( $args, 'site', __FUNCTION__ ); $this->populate_site_info( $args ); - EE::log( sprintf( 'Disabling site %s.', $this->site['name'] ) ); + + $site = Site::find($this->site['name']); + + EE::log( sprintf( 'Disabling site %s.', $site->site_url ) ); + if ( EE::docker()::docker_compose_down( $this->site['root'] ) ) { - EE::db()->table( 'sites' )->where( 'sitename', $this->site['name'] )->update( [ 'is_enabled' => '0' ] ); + $site->site_enabled = 0; + $site->save(); + EE::success( sprintf( 'Site %s disabled.', $this->site['name'] ) ); } else { EE::error( sprintf( 'There was error in disabling %s. Please check logs.', $this->site['name'] ) ); @@ -270,8 +279,8 @@ public function down( $args, $assoc_args ) { public function restart( $args, $assoc_args, $whitelisted_containers = [] ) { EE\Utils\delem_log( 'site restart start' ); - $args = EE\SiteUtils\auto_site_name( $args, 'site', __FUNCTION__ ); - $all = EE\Utils\get_flag_value( $assoc_args, 'all' ); + $args = EE\SiteUtils\auto_site_name( $args, 'site', __FUNCTION__ ); + $all = EE\Utils\get_flag_value( $assoc_args, 'all' ); $no_service_specified = count( $assoc_args ) === 0; $this->populate_site_info( $args ); @@ -308,8 +317,8 @@ public function reload( $args, $assoc_args, $whitelisted_containers = [], $reloa EE\Utils\delem_log( 'site reload start' ); $args = EE\SiteUtils\auto_site_name( $args, 'site', __FUNCTION__ ); - $all = EE\Utils\get_flag_value( $assoc_args, 'all' ); - if ( ! array_key_exists( 'nginx', $reload_commands ) ) { + $all = EE\Utils\get_flag_value( $assoc_args, 'all' ); + if ( !array_key_exists( 'nginx', $reload_commands ) ) { $reload_commands['nginx'] = 'nginx sh -c \'nginx -t && service openresty reload\''; } $no_service_specified = count( $assoc_args ) === 0; @@ -335,7 +344,7 @@ public function reload( $args, $assoc_args, $whitelisted_containers = [], $reloa private function reload_services( $services, $reload_commands ) { foreach ( $services as $service ) { - EE\SiteUtils\run_compose_command( 'exec', $reload_commands[ $service ], 'reload', $service ); + EE\SiteUtils\run_compose_command( 'exec', $reload_commands[$service], 'reload', $service ); } } @@ -344,17 +353,17 @@ private function reload_services( $services, $reload_commands ) { * * @param string $site_name Name of the site for ssl. * @param string $site_root Webroot of the site. - * @param bool $wildcard SSL with wildcard or not. + * @param bool $wildcard SSL with wildcard or not. */ protected function init_le( $site_name, $site_root, $wildcard = false ) { $this->site['name'] = $site_name; $this->site['root'] = $site_root; - $this->wildcard = $wildcard; - $client = new Site_Letsencrypt(); - $this->le_mail = EE::get_runner()->config['le-mail'] ?? EE::input( 'Enter your mail id: ' ); + $this->wildcard = $wildcard; + $client = new Site_Letsencrypt(); + $this->le_mail = EE::get_runner()->config['le-mail'] ?? EE::input( 'Enter your mail id: ' ); EE::get_runner()->ensure_present_in_config( 'le-mail', $this->le_mail ); - if ( ! $client->register( $this->le_mail ) ) { + if ( !$client->register( $this->le_mail ) ) { $this->le = false; return; @@ -363,8 +372,8 @@ protected function init_le( $site_name, $site_root, $wildcard = false ) { $domains = $wildcard ? [ sprintf( '*.%s', $this->site['name'] ), $this->site['name'] - ] : [ $this->site['name'] ]; - if ( ! $client->authorize( $domains, $this->site['root'], $wildcard ) ) { + ] : [$this->site['name']]; + if ( !$client->authorize( $domains, $this->site['root'], $wildcard ) ) { $this->le = false; return; @@ -390,22 +399,22 @@ protected function init_le( $site_name, $site_root, $wildcard = false ) { */ public function le( $args = [], $assoc_args = [] ) { - if ( ! isset( $this->site['name'] ) ) { + if ( !isset( $this->site['name'] ) ) { $this->populate_site_info( $args ); } - if ( ! isset( $this->le_mail ) ) { + if ( !isset( $this->le_mail ) ) { $this->le_mail = EE::get_config( 'le-mail' ) ?? EE::input( 'Enter your mail id: ' ); } - $force = EE\Utils\get_flag_value( $assoc_args, 'force' ); - $domains = $this->wildcard ? [ '*.' . $this->site['name'], $this->site['name'] ] : [ $this->site['name'] ]; - $client = new Site_Letsencrypt(); - if ( ! $client->check( $domains, $this->wildcard ) ) { + $force = EE\Utils\get_flag_value( $assoc_args, 'force' ); + $domains = $this->wildcard ? ['*.' . $this->site['name'], $this->site['name']] : [$this->site['name']]; + $client = new Site_Letsencrypt(); + if ( !$client->check( $domains, $this->wildcard ) ) { $this->le = false; return; } if ( $this->wildcard ) { - $client->request( '*.' . $this->site['name'], [ $this->site['name'] ], $this->le_mail, $force ); + $client->request( '*.' . $this->site['name'], [$this->site['name']], $this->le_mail, $force ); } else { $client->request( $this->site['name'], [], $this->le_mail, $force ); $client->cleanup( $this->site['root'] ); @@ -419,16 +428,15 @@ public function le( $args = [], $assoc_args = [] ) { private function populate_site_info( $args ) { $this->site['name'] = EE\Utils\remove_trailing_slash( $args[0] ); + $site = Site::find( $this->site['name'] ); + if ( $site ) { - if ( EE::db()->site_in_db( $this->site['name'] ) ) { - - $db_select = EE::db()->table( 'sites' )->where( 'sitename', $this->site['name'] )->first(); - - $this->site['type'] = $db_select['site_type']; - $this->site['root'] = $db_select['site_path']; - $this->le = $db_select['is_ssl']; - $this->wildcard = $db_select['is_ssl_wildcard']; + $db_select = $site->site_url; + $this->site['type'] = $site->site_type; + $this->site['root'] = $site->site_fs_path; + $this->le = $site->site_ssl !== 'no'; + $this->wildcard = $site->site_ssl === 'wildcard'; } else { EE::error( sprintf( 'Site %s does not exist.', $this->site['name'] ) ); } diff --git a/php/commands/src/CLI_Command.php b/php/commands/src/CLI_Command.php index c22e91faf..815d2af1a 100644 --- a/php/commands/src/CLI_Command.php +++ b/php/commands/src/CLI_Command.php @@ -3,6 +3,7 @@ use \Composer\Semver\Comparator; use \Symfony\Component\Filesystem\Filesystem; use \EE\Utils; +use \EE\Model\Site; /** * Review current EE info, check for updates, or see defined aliases. @@ -503,22 +504,22 @@ public function cmd_dump() { */ public function self_uninstall( $args, $assoc_args ) { - EE::confirm("Are you sure you want to remove EasyEngine and all its sites(along with their data)?\nThis is an irreversible action. No backup will be kept.", $assoc_args); + EE::confirm( "Are you sure you want to remove EasyEngine and all its sites(along with their data)?\nThis is an irreversible action. No backup will be kept.", $assoc_args ); - EE::exec("docker rm -f $(docker ps -aqf label=org.label-schema.vendor=\"EasyEngine\")"); + EE::exec( 'docker rm -f $(docker ps -aqf label=org.label-schema.vendor="EasyEngine")' ); $home = Utils\get_home_dir(); - EE::exec("rm -rf $home/.ee/"); + EE::exec( "rm -rf $home/.ee/" ); - $records = EE::db()->select(['site_path']); + $records = Site::all( [ 'site_fs_path' ] ); - if( $records !== false ) { - $sites_paths = array_column($records, 'site_path'); + if ( ! empty( $records ) ) { + $sites_paths = array_column( $records, 'site_fs_path' ); $fs = new Filesystem(); - $fs->remove($sites_paths); + $fs->remove( $sites_paths ); } - EE::exec("rm -df $home/ee-sites/"); - EE::exec("rm -rf /opt/easyengine/"); + EE::exec( "rm -df $home/ee-sites/" ); + EE::exec( "rm -rf /opt/easyengine/" ); if ( Utils\inside_phar() ) { unlink( realpath( $_SERVER['argv'][0] ) ); diff --git a/php/site-utils.php b/php/site-utils.php index 621a13640..b042a146a 100644 --- a/php/site-utils.php +++ b/php/site-utils.php @@ -3,6 +3,7 @@ namespace EE\SiteUtils; use \EE; +use EE\Model\Site; use \Symfony\Component\Filesystem\Filesystem; /** @@ -11,20 +12,20 @@ * @return bool|String Name of the site or false in failure. */ function get_site_name() { + $sites = Site::all( [ 'site_url' ] ); - $sites = EE::db()::select( array( 'sitename' ) ); - - if ( $sites ) { - $cwd = getcwd(); + if ( ! empty( $sites ) ) { + $cwd = getcwd(); $name_in_path = explode( '/', $cwd ); - $site_name = array_intersect( EE\Utils\array_flatten( $sites ), $name_in_path ); + + $site_name = array_intersect( array_column( $sites, 'site_url' ), $name_in_path ); if ( 1 === count( $site_name ) ) { $name = reset( $site_name ); - $path = EE::db()::select( array( 'site_path' ), array( 'sitename' => $name ) ); + $path = Site::find( $name ); if ( $path ) { - $site_path = $path[0]['site_path']; - if ( $site_path === substr( $cwd, 0, strlen( $site_path ) ) ) { + $site_path = $path['site_fs_path']; + if ( substr( $cwd, 0, strlen( $site_path ) ) === $site_path ) { return $name; } } @@ -48,7 +49,7 @@ function get_site_name() { function auto_site_name( $args, $command, $function, $arg_pos = 0 ) { if ( isset( $args[ $arg_pos ] ) ) { - if ( EE::db()::site_in_db( $args[ $arg_pos ] ) ) { + if ( Site::find( $args[ $arg_pos ] ) ) { return $args; } } From 49d4bf60fca13779e3848c75860f934f1f13ab47 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Fri, 10 Aug 2018 05:07:58 +0530 Subject: [PATCH 0366/1044] Apply refactoring changes in Migrations Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/EE/Migration/Executor.php | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/php/EE/Migration/Executor.php b/php/EE/Migration/Executor.php index ecdefa8a5..1de2a791c 100644 --- a/php/EE/Migration/Executor.php +++ b/php/EE/Migration/Executor.php @@ -3,6 +3,7 @@ namespace EE\Migration; use \EE; +use \EE\Model\Migration; use \EE\Utils; use Symfony\Component\Finder\Finder; @@ -45,10 +46,10 @@ private static function execute_migration_stack( $migrations ) { if( empty( $migrations ) ) { return; } - + $migration_path = self::get_migration_path( $migrations[0] ); $migration_class_name = self::get_migration_class_name( $migrations[0] ); - + if( ! file_exists( $migration_path ) ) { EE::error( "Unable to find migration file at $migration_path", false ); throw new Exception(); @@ -70,12 +71,14 @@ private static function execute_migration_stack( $migrations ) { try { EE::log( "Migrating: $migrations[0]" ); $migration->up(); - - \EE::db()->insert([ + + $migration_model = new Migration([ 'migration' => $migrations[0], - 'timestamp' => date('Y-m-d H:i:s') - ], 'migrations' ); - + 'timestamp' => date('Y-m-d H:i:s'), + ]); + + $migration_model->save(); + $migration->status = 'complete'; EE::log( "Migrated: $migrations[0]" ); $remaining_migrations = array_splice( $migrations, 1, count( $migrations ) ); @@ -93,7 +96,7 @@ private static function execute_migration_stack( $migrations ) { } private static function get_migrations_to_execute() { - return array_values( + return array_values( array_diff( self::get_migrations_from_fs(), self::get_migrations_from_db() @@ -102,7 +105,7 @@ private static function get_migrations_to_execute() { } private static function get_migrations_from_db() { - return \EE::db()->get_migrations(); + return Migration::all(); } private static function get_migrations_from_fs() { @@ -133,4 +136,4 @@ private static function camelize($input, $separator = '_') { return str_replace($separator, '', ucwords($input, $separator)); } -} \ No newline at end of file +} From d91c8a7b23551d0b4d2b3aceb97bb309020d94af Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Fri, 10 Aug 2018 06:17:26 +0530 Subject: [PATCH 0367/1044] Update base table. Add more moethods Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/EE/Migration/Executor.php | 4 +-- php/EE/Model/Base.php | 66 ++++++++++++++++++++++++++++++----- php/class-ee-db.php | 2 +- 3 files changed, 59 insertions(+), 13 deletions(-) diff --git a/php/EE/Migration/Executor.php b/php/EE/Migration/Executor.php index 1de2a791c..bcc0ebfef 100644 --- a/php/EE/Migration/Executor.php +++ b/php/EE/Migration/Executor.php @@ -72,13 +72,11 @@ private static function execute_migration_stack( $migrations ) { EE::log( "Migrating: $migrations[0]" ); $migration->up(); - $migration_model = new Migration([ + Migration::create([ 'migration' => $migrations[0], 'timestamp' => date('Y-m-d H:i:s'), ]); - $migration_model->save(); - $migration->status = 'complete'; EE::log( "Migrated: $migrations[0]" ); $remaining_migrations = array_splice( $migrations, 1, count( $migrations ) ); diff --git a/php/EE/Model/Base.php b/php/EE/Model/Base.php index 50b0214d5..2d655632d 100644 --- a/php/EE/Model/Base.php +++ b/php/EE/Model/Base.php @@ -48,8 +48,8 @@ public function __construct( array $fields = [] ) { * @return mixed Value of property */ public function __get( string $name ) { - if ( isset( $this->fields[$name] ) ) { - return $this->fields[$name]; + if ( isset( $this->fields[ $name ] ) ) { + return $this->fields[ $name ]; } throw new \Exception( "Unable to find variable: $name" ); @@ -66,7 +66,7 @@ public function __get( string $name ) { * @param mixed $value Value of property to set */ public function __set( string $name, $value ) { - $this->fields[$name] = $value; + $this->fields[ $name ] = $value; } /** @@ -126,7 +126,7 @@ public function offsetExists( $index ) { * * @throws \Exception * - * @return mixed Model + * @return static */ public static function find( string $pk ) { return static::single_array_to_model( @@ -138,16 +138,37 @@ public static function find( string $pk ) { } /** + * Throws exception if model is not found + * * @param string $pk * - * @return static * @throws \Exception + * + * @return static */ public static function find_or_fail( string $pk ) { $model = static::find( $pk ); if ( ! $model ) { - throw new \Exception( 'Unable to find ' . __CLASS__ . ' : ' ); + throw new \Exception( sprintf( 'Unable to find %s : with primary key: %s and value: %s', __CLASS__, static::$primary_key, $pk ) ); + } + return $model; + } + + /** + * Exits with error if model is not found + * + * @param string $pk + * + * @throws \Exception + * + * @return static + */ + public static function find_or_error( string $pk ) { + $model = static::find( $pk ); + + if ( ! $model ) { + EE::error( sprintf( 'Unable to find %s : with primary key: %s and value: %s', __CLASS__, static::$primary_key, $pk ) ); } return $model; } @@ -169,6 +190,19 @@ public static function all( $columns = [] ) { ); } + /** + * Creates new entity in DB + * + * @param array $columns Columns and values to insert + * + * @return static + * @throws \Exception + */ + public static function create( $columns = [] ) { + $new_model_id = EE::db()->table( static::$table )->insert( $columns ); + return self::find( $new_model_id ); + } + /** * Saves current model into database * @@ -179,16 +213,16 @@ public static function all( $columns = [] ) { public function save() { return EE::db() ->table( static::$table ) - ->where( static::$primary_key, $this[static::$primary_key] ) + ->where( static::$primary_key, $this[ static::$primary_key ] ) ->update( $this->fields ); } /** - * Saves current model into database + * Deletes current model from database * * @throws \Exception * - * @return bool Model saved successfully + * @return bool Model deleted` successfully */ public function delete() { return EE::db() @@ -197,6 +231,20 @@ public function delete() { ->delete(); } + /** + * Updates current model from database + * + * @throws \Exception + * + * @return bool Model updated successfully + */ + public function update( $columns ) { + return EE::db() + ->table( static::$table ) + ->where( static::$primary_key, $this->id ) + ->update( $columns ); + } + /** * Returns all model with condition * diff --git a/php/class-ee-db.php b/php/class-ee-db.php index e7a4e3b11..05fb58a1a 100644 --- a/php/class-ee-db.php +++ b/php/class-ee-db.php @@ -338,7 +338,7 @@ public function insert( $data ) { return false; } - return true; + return self::$pdo->lastInsertId(); } /** From edc8939c30e072478b15acebf22041ce32b85c1c Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Fri, 10 Aug 2018 15:52:09 +0530 Subject: [PATCH 0368/1044] Add docker-image version maintainer file Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- img-versions.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 img-versions.json diff --git a/img-versions.json b/img-versions.json new file mode 100644 index 000000000..5c0736e67 --- /dev/null +++ b/img-versions.json @@ -0,0 +1,10 @@ +{ + "easyengine/mailhog": "v4.0.0-beta.5", + "easyengine/mariadb": "v4.0.0-beta.5", + "easyengine/nginx-proxy": "v4.0.0-beta.5", + "easyengine/nginx": "v4.0.0-beta.5", + "easyengine/php": "v4.0.0-beta.5", + "easyengine/phpmyadmin": "v4.0.0-beta.5", + "easyengine/postfix": "v4.0.0-beta.5", + "easyengine/redis": "v4.0.0-beta.5" +} From c42f0bcdadf4aa9a7eae75efd69097f3ba08ee60 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Fri, 10 Aug 2018 15:52:30 +0530 Subject: [PATCH 0369/1044] Add function to get versions Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/utils.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/php/utils.php b/php/utils.php index 6f7684ec9..666369408 100644 --- a/php/utils.php +++ b/php/utils.php @@ -1545,3 +1545,13 @@ function get_callable_name( callable $callable ) { return 'unknown'; } } + +/** + * Function to get the docker image versions stored in img-versions.json file. + * + * @return array Docker image versions. + */ +function get_image_versions() { + + return json_decode( file_get_contents( EE_ROOT . '/img-versions.json' ), true ); +} From 3f1a0c4d3bfef24dc173209c9cefa04da92d049c Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Fri, 10 Aug 2018 15:53:16 +0530 Subject: [PATCH 0370/1044] Get image version from utils Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/site-utils.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/php/site-utils.php b/php/site-utils.php index 621a13640..5e9eaf7ac 100644 --- a/php/site-utils.php +++ b/php/site-utils.php @@ -86,7 +86,8 @@ function init_checks() { EE::error( 'Cannot create/start proxy container. Please make sure port 80 and 443 are free.' ); } else { $EE_CONF_ROOT = EE_CONF_ROOT; - $ee_proxy_command = "docker run --name $proxy_type -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v $EE_CONF_ROOT/nginx/certs:/etc/nginx/certs -v $EE_CONF_ROOT/nginx/dhparam:/etc/nginx/dhparam -v $EE_CONF_ROOT/nginx/conf.d:/etc/nginx/conf.d -v $EE_CONF_ROOT/nginx/htpasswd:/etc/nginx/htpasswd -v $EE_CONF_ROOT/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v $EE_CONF_ROOT:/app/ee4 -v /usr/share/nginx/html easyengine/nginx-proxy:v" . EE_VERSION; + $img_versions = EE\Utils\get_image_versions(); + $ee_proxy_command = "docker run --name $proxy_type -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v $EE_CONF_ROOT/nginx/certs:/etc/nginx/certs -v $EE_CONF_ROOT/nginx/dhparam:/etc/nginx/dhparam -v $EE_CONF_ROOT/nginx/conf.d:/etc/nginx/conf.d -v $EE_CONF_ROOT/nginx/htpasswd:/etc/nginx/htpasswd -v $EE_CONF_ROOT/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v $EE_CONF_ROOT:/app/ee4 -v /usr/share/nginx/html easyengine/nginx-proxy:" . $img_versions['easyengine/nginx-proxy']; if ( EE::docker()::boot_container( $proxy_type, $ee_proxy_command ) ) { From 8e51971fc2d9ba160713a40dcf2ca97e4cec8f85 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Fri, 10 Aug 2018 20:05:21 +0530 Subject: [PATCH 0371/1044] Update models Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/EE/Model/Base.php | 21 +++++++++++++++++++++ php/EE/Model/Site.php | 10 ---------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/php/EE/Model/Base.php b/php/EE/Model/Base.php index 2d655632d..bdd6fc31e 100644 --- a/php/EE/Model/Base.php +++ b/php/EE/Model/Base.php @@ -80,6 +80,16 @@ public function __isset( $name ) { return isset( $this->fields[ $name ] ); } + /** + * Removes a property from model + * It's done by removing it from $fields array + * + * @param string $name Name of property to unset + */ + public function __unset( $name ) { + unset( $this->fields[ $name ] ); + } + /** * Overriding offsetGet for correct behaviour while accessing object properties by array index. * @@ -119,6 +129,17 @@ public function offsetExists( $index ) { return $this->__isset( $index ); } + /** + * Overriding offsetUnset for correct behaviour while deleting object properties by array index. + * + * @param string|int $index Name of property to check + * + * @throws \Exception + */ + public function offsetUnset( $index ) { + $this->__unset( $index ); + } + /** * Returns single model fetched by primary key * diff --git a/php/EE/Model/Site.php b/php/EE/Model/Site.php index a118dc0de..1a85e5608 100644 --- a/php/EE/Model/Site.php +++ b/php/EE/Model/Site.php @@ -33,16 +33,6 @@ public static function site_in_db( $site_name ) { return false; } - /** - * @param $url - * - * @return Site - * @throws \Exception - */ - public static function find_by_url( $url ) { - return Site::where( 'site_url', $url )->first(); - } - /** * Check if a site entry exists in the database as well as if it is enbaled. * From 5a154b8d86e589554c3f37179ee950a75371e1c8 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Fri, 10 Aug 2018 20:06:36 +0530 Subject: [PATCH 0372/1044] Update DB and Site Command Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/class-ee-db.php | 57 +++++++++++++++++++++---------------------- php/class-ee-site.php | 10 ++++---- 2 files changed, 33 insertions(+), 34 deletions(-) diff --git a/php/class-ee-db.php b/php/class-ee-db.php index 05fb58a1a..603a95d0b 100644 --- a/php/class-ee-db.php +++ b/php/class-ee-db.php @@ -57,35 +57,34 @@ private static function create_required_tables() { } $query = 'CREATE TABLE sites ( - id INTEGER, - site_url VARCHAR, - site_type VARCHAR, - site_fs_path VARCHAR, - site_enabled BOOLEAN, - site_ssl VARCHAR, - nginx_browser_cache VARCHAR, - nginx_fullpage_cache VARCHAR, - php_version VARCHAR, - php_opcache VARCHAR, - db_name VARCHAR, - db_user VARCHAR, - db_password VARCHAR, - db_root_password VARCHAR, - db_host VARCHAR, - db_port VARCHAR, - db_cache VARCHAR, - app_admin_url VARCHAR, - app_admin_email VARCHAR, - app_admin_username VARCHAR, - app_admin_password VARCHAR, - app_object_cache VARCHAR, - app_mail VARCHAR, - admin_tools VARCHAR, - created_on DATETIME, - modified_on DATETIME, - site_auth_scope VARCHAR, - site_auth_username VARCHAR, - site_auth_password VARCHAR, + id INTEGER NOT NULL, + site_url VARCHAR NOT NULL, + site_type VARCHAR NOT NULL, + site_fs_path VARCHAR NOT NULL, + site_enabled BOOLEAN NOT NULL DEFAULT 1, + site_ssl VARCHAR, + cache_nginx_browser BOOLEAN NOT NULL DEFAULT 0, + cache_nginx_fullpage BOOLEAN NOT NULL DEFAULT 0, + cache_mysql_query BOOLEAN NOT NULL DEFAULT 0, + cache_app_object BOOLEAN NOT NULL DEFAULT 0, + php_version VARCHAR, + db_name VARCHAR, + db_user VARCHAR, + db_password VARCHAR, + db_root_password VARCHAR, + db_host VARCHAR, + db_port VARCHAR, + app_admin_url VARCHAR, + app_admin_email VARCHAR, + app_admin_username VARCHAR, + app_admin_password VARCHAR, + app_mail VARCHAR, + admin_tools BOOLEAN NOT NULL DEFAULT 0, + created_on DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + modified_on DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + site_auth_scope VARCHAR, + site_auth_username VARCHAR, + site_auth_password VARCHAR, PRIMARY KEY (id), UNIQUE (site_url), CHECK (site_enabled IN (0, 1)) diff --git a/php/class-ee-site.php b/php/class-ee-site.php index cb2cf7a96..710b1080b 100644 --- a/php/class-ee-site.php +++ b/php/class-ee-site.php @@ -72,13 +72,13 @@ public function _list( $args, $assoc_args ) { $sites = Site::all(); - if ( $enabled && !$disabled ) { + if ( $enabled && ! $disabled ) { $sites = Site::where( 'is_enabled', true ); - } elseif ( $disabled && !$enabled ) { + } elseif ( $disabled && ! $enabled ) { $sites = Site::where( 'is_enabled', false ); } - if ( empty ( $sites ) ) { + if ( empty( $sites ) ) { EE::error( 'No sites found!' ); } @@ -190,8 +190,8 @@ protected function delete_site( $level, $site_name, $site_root ) { } } - if ( Site::find_by_url( $site_name )->delete() ) { - EE::log( 'Removing database entry.' ); + if ( Site::find( $site_name )->delete() ) { + EE::log( 'Removed database entry.' ); } else { EE::error( 'Could not remove the database entry' ); } From 7ff362668bd3155cdf0533e28c9389bf5487af5e Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Mon, 13 Aug 2018 16:11:02 +0530 Subject: [PATCH 0373/1044] Correct insert method Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/class-ee-db.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/php/class-ee-db.php b/php/class-ee-db.php index 603a95d0b..be32ec3d9 100644 --- a/php/class-ee-db.php +++ b/php/class-ee-db.php @@ -74,6 +74,7 @@ private static function create_required_tables() { db_root_password VARCHAR, db_host VARCHAR, db_port VARCHAR, + app_site_type VARCHAR, app_admin_url VARCHAR, app_admin_email VARCHAR, app_admin_username VARCHAR, @@ -310,7 +311,7 @@ public function offset( int $offset ) { public function insert( $data ) { $fields = implode( ', ', array_keys( $data ) ); - $values = implode( array_fill( 0, count( $data ), '?' ) ); + $values = implode( ', ', array_fill( 0, count( $data ), '?' ) ); if ( empty( $this->tables ) ) { throw new Exception( 'Insert: No table specified' ); From 8ce01cd44c26924f353f92694aa413922491d28d Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Mon, 13 Aug 2018 16:12:14 +0530 Subject: [PATCH 0374/1044] Add parameter to find_* method Correct __get method Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/EE/Model/Base.php | 48 +++++++++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/php/EE/Model/Base.php b/php/EE/Model/Base.php index bdd6fc31e..366aff28f 100644 --- a/php/EE/Model/Base.php +++ b/php/EE/Model/Base.php @@ -48,7 +48,7 @@ public function __construct( array $fields = [] ) { * @return mixed Value of property */ public function __get( string $name ) { - if ( isset( $this->fields[ $name ] ) ) { + if ( array_key_exists( $name, $this->fields ) ) { return $this->fields[ $name ]; } @@ -104,9 +104,10 @@ public function offsetGet( $index ) { } /** - * Overriding offsetGet for correct behaviour while saving object properties by array index. + * Overriding offsetSet for correct behaviour while saving object properties by array index. * * @param string|int $index Name of property to check + * @param mixed $value Value of property to set * * @throws \Exception * @@ -143,35 +144,42 @@ public function offsetUnset( $index ) { /** * Returns single model fetched by primary key * - * @param string $pk primary key of model + * @param string $value value to find + * @param string $column Column to find in. Defaults to primary key * * @throws \Exception * * @return static */ - public static function find( string $pk ) { - return static::single_array_to_model( - EE::db() - ->table( static::$table ) - ->where( static::$primary_key, $pk ) - ->first() - ); + public static function find( string $value, string $column = null ) { + $primary_key_column = $column ?? static::$primary_key; + $model = EE::db() + ->table( static::$table ) + ->where( $primary_key_column, $value ) + ->first(); + + if( $model === false ) { + return false; + } + + return static::single_array_to_model( $model ); } /** * Throws exception if model is not found * - * @param string $pk + * @param string $value value to find + * @param string $column Column to find in. Defaults to primary key * * @throws \Exception * * @return static */ - public static function find_or_fail( string $pk ) { - $model = static::find( $pk ); + public static function find_or_fail( string $value, string $column = null ) { + $model = static::find( $value, $column ); if ( ! $model ) { - throw new \Exception( sprintf( 'Unable to find %s : with primary key: %s and value: %s', __CLASS__, static::$primary_key, $pk ) ); + throw new \Exception( sprintf( 'Unable to find %s : with primary key: %s and value: %s', __CLASS__, static::$primary_key, $value ) ); } return $model; } @@ -179,17 +187,18 @@ public static function find_or_fail( string $pk ) { /** * Exits with error if model is not found * - * @param string $pk + * @param string $value value to find + * @param string $column Column to find in. Defaults to primary key * * @throws \Exception * * @return static */ - public static function find_or_error( string $pk ) { - $model = static::find( $pk ); + public static function find_or_error( string $value, string $column = null ) { + $model = static::find( $value, $column ); if ( ! $model ) { - EE::error( sprintf( 'Unable to find %s : with primary key: %s and value: %s', __CLASS__, static::$primary_key, $pk ) ); + EE::error( sprintf( 'Unable to find %s : with primary key: %s and value: %s', __CLASS__, static::$primary_key, $value ) ); } return $model; } @@ -220,8 +229,7 @@ public static function all( $columns = [] ) { * @throws \Exception */ public static function create( $columns = [] ) { - $new_model_id = EE::db()->table( static::$table )->insert( $columns ); - return self::find( $new_model_id ); + return EE::db()->table( static::$table )->insert( $columns ); } /** From ec9c278286dc7acd750263828cd9ea2072067a3f Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Mon, 13 Aug 2018 16:12:32 +0530 Subject: [PATCH 0375/1044] Correct wildcard logic Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/class-ee-site.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/php/class-ee-site.php b/php/class-ee-site.php index 710b1080b..265384ce9 100644 --- a/php/class-ee-site.php +++ b/php/class-ee-site.php @@ -435,8 +435,8 @@ private function populate_site_info( $args ) { $this->site['type'] = $site->site_type; $this->site['root'] = $site->site_fs_path; - $this->le = $site->site_ssl !== 'no'; - $this->wildcard = $site->site_ssl === 'wildcard'; + $this->le = null !== $site->site_ssl; + $this->wildcard = 'wildcard' === $site->site_ssl; } else { EE::error( sprintf( 'Site %s does not exist.', $this->site['name'] ) ); } From 393a0e108ffb854a1f44b1e0e26d816958597632 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Mon, 13 Aug 2018 17:07:35 +0530 Subject: [PATCH 0376/1044] Rename app_site_type to app_sub_type Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/class-ee-db.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/class-ee-db.php b/php/class-ee-db.php index be32ec3d9..0d479ab53 100644 --- a/php/class-ee-db.php +++ b/php/class-ee-db.php @@ -74,7 +74,7 @@ private static function create_required_tables() { db_root_password VARCHAR, db_host VARCHAR, db_port VARCHAR, - app_site_type VARCHAR, + app_sub_type VARCHAR, app_admin_url VARCHAR, app_admin_email VARCHAR, app_admin_username VARCHAR, From b40ab481aed5b434b065aad92f595c97e08887b8 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Tue, 14 Aug 2018 13:15:49 +0530 Subject: [PATCH 0377/1044] Correct ssl behaviour Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/class-ee-db.php | 2 +- php/class-ee-site.php | 53 +++++++++++++++++++++++++++++++++++-------- php/site-utils.php | 8 +++---- 3 files changed, 48 insertions(+), 15 deletions(-) diff --git a/php/class-ee-db.php b/php/class-ee-db.php index 852c263df..c9db40a4c 100644 --- a/php/class-ee-db.php +++ b/php/class-ee-db.php @@ -45,7 +45,7 @@ public static function create() { created_on DATETIME, is_enabled BOOLEAN DEFAULT 1, is_ssl BOOLEAN DEFAULT 0, - is_ssl_wildcard BOOLEAN DEFAULT 0, + site_ssl_wildcard BOOLEAN DEFAULT 0, storage_fs VARCHAR, storage_db VARCHAR, db_name VARCHAR, diff --git a/php/class-ee-site.php b/php/class-ee-site.php index 323bd5999..36491338a 100644 --- a/php/class-ee-site.php +++ b/php/class-ee-site.php @@ -14,14 +14,14 @@ abstract class EE_Site_Command { private $fs; /** - * @var bool $le Whether the site is letsencrypt or not. + * @var bool $wildcard Whether the site is letsencrypt type is wildcard or not. */ - private $le; + private $wildcard; /** - * @var bool $wildcard Whether the site is letsencrypt type is wildcard or not. + * @var bool $ssl Whether the site has SSL or not. */ - private $wildcard; + private $ssl; /** * @var string $le_mail Mail id to be used for letsencrypt registration and certificate generation. @@ -175,7 +175,7 @@ protected function delete_site( $level, $site_name, $site_root ) { } if ( $level > 4 ) { - if ( $this->le ) { + if ( $this->ssl ) { EE::log( 'Removing ssl certs.' ); $crt_file = EE_CONF_ROOT . "/nginx/certs/$site_name.crt"; $key_file = EE_CONF_ROOT . "/nginx/certs/$site_name.key"; @@ -340,6 +340,39 @@ private function reload_services( $services, $reload_commands ) { /** * Runs the acme le registration and authorization. * + * @param string $site_name Name of the site for ssl. + * @param string $needs_wildcard Does site needs wildcard. + * + * @throws Exception + */ + protected function inherit_certs( $site_name, $needs_wildcard ) { + $parent_site_name = implode( '.', array_slice( explode( '.', $site_name ), 1 ) ); + $parent_site = EE::db()::select( [ 'is_ssl', 'site_ssl_wildcard' ], [ 'sitename' => $parent_site_name ] )[0]; + + if ( $needs_wildcard ) { + throw new Exception( '--wildcard cannot be used with --ssl=inherit' ); + } + + if ( ! $parent_site ) { + throw new Exception( 'Unable to find existing site: ' . $parent_site ); + } + + + if ( ! $parent_site['is_ssl'] ) { + throw new Exception( "Cannot inherit from $parent_site as site does not have SSL cert" ); + } + + if ( ! $parent_site['site_ssl_wildcard'] ) { + throw new Exception( "Cannot inherit from $parent_site as site does not have wildcard SSL cert" ); + } + + // We don't have to do anything now as nginx-proxy handles everything for us. + EE::success( 'Inherited certs from parent' ); + } + + /** + * Runs the acme le registration and authorization. + * * @param string $site_name Name of the site for ssl. * @param string $site_root Webroot of the site. * @param bool $wildcard SSL with wildcard or not. @@ -353,7 +386,7 @@ protected function init_le( $site_name, $site_root, $wildcard = false ) { $this->le_mail = EE::get_runner()->config['le-mail'] ?? EE::input( 'Enter your mail id: ' ); EE::get_runner()->ensure_present_in_config( 'le-mail', $this->le_mail ); if ( ! $client->register( $this->le_mail ) ) { - $this->le = false; + $this->ssl = false; return; } @@ -363,7 +396,7 @@ protected function init_le( $site_name, $site_root, $wildcard = false ) { $this->site['name'] ] : [ $this->site['name'] ]; if ( ! $client->authorize( $domains, $this->site['root'], $wildcard ) ) { - $this->le = false; + $this->ssl = false; return; } @@ -398,7 +431,7 @@ public function le( $args = [], $assoc_args = [] ) { $domains = $this->wildcard ? [ '*.' . $this->site['name'], $this->site['name'] ] : [ $this->site['name'] ]; $client = new Site_Letsencrypt(); if ( ! $client->check( $domains, $this->wildcard ) ) { - $this->le = false; + $this->ssl = false; return; } @@ -424,8 +457,8 @@ private function populate_site_info( $args ) { $this->site['type'] = $db_select['site_type']; $this->site['root'] = $db_select['site_path']; - $this->le = $db_select['is_ssl']; - $this->wildcard = $db_select['is_ssl_wildcard']; + $this->ssl = $db_select['is_ssl']; + $this->wildcard = $db_select['site_ssl_wildcard']; } else { EE::error( sprintf( 'Site %s does not exist.', $this->site['name'] ) ); diff --git a/php/site-utils.php b/php/site-utils.php index 621a13640..48e23f812 100644 --- a/php/site-utils.php +++ b/php/site-utils.php @@ -145,9 +145,9 @@ function setup_site_network( $site_name ) { * Adds www to non-www redirection to site * * @param string $site_name Name of the site. - * @param bool $le Specifying if letsencrypt is enabled or not. + * @param bool $ssl Specifying if ssl is enabled or not. */ -function add_site_redirects( $site_name, $le ) { +function add_site_redirects( $site_name, $ssl ) { $fs = new Filesystem(); $confd_path = EE_CONF_ROOT . '/nginx/conf.d/'; @@ -157,7 +157,7 @@ function add_site_redirects( $site_name, $le ) { if ( $has_www ) { $site_name_without_www = ltrim( $site_name, '.www' ); // ee site create www.example.com --le - if ( $le ) { + if ( $ssl ) { $content = " server { listen 80; @@ -177,7 +177,7 @@ function add_site_redirects( $site_name, $le ) { } else { $site_name_with_www = 'www.' . $site_name; // ee site create example.com --le - if ( $le ) { + if ( $ssl ) { $content = " server { From c4435250501b95aadb585886180cd8201529d5d4 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Tue, 14 Aug 2018 13:39:27 +0530 Subject: [PATCH 0378/1044] Add http code in status check Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/site-utils.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/php/site-utils.php b/php/site-utils.php index 48e23f812..c5cda774b 100644 --- a/php/site-utils.php +++ b/php/site-utils.php @@ -232,7 +232,7 @@ function site_status_check( $site_name ) { EE::log( 'Checking and verifying site-up status. This may take some time.' ); $httpcode = get_curl_info( $site_name ); $i = 0; - while ( 200 !== $httpcode && 302 !== $httpcode ) { + while ( 200 !== $httpcode && 302 !== $httpcode && 301 !== $httpcode ) { EE::debug( "$site_name status httpcode: $httpcode" ); $httpcode = get_curl_info( $site_name ); echo '.'; @@ -241,7 +241,7 @@ function site_status_check( $site_name ) { break; } } - if ( 200 !== $httpcode && 302 !== $httpcode ) { + if ( 200 !== $httpcode && 302 !== $httpcode && 301 !== $httpcode ) { throw new \Exception( 'Problem connecting to site!' ); } @@ -260,8 +260,8 @@ function get_curl_info( $url, $port = 80, $port_info = false ) { $ch = curl_init( $url ); curl_setopt( $ch, CURLOPT_HEADER, true ); - curl_setopt( $ch, CURLOPT_NOBODY, true ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); + curl_setopt( $ch, CURLOPT_NOBODY, true ); curl_setopt( $ch, CURLOPT_TIMEOUT, 10 ); curl_setopt( $ch, CURLOPT_PORT, $port ); curl_exec( $ch ); From 4ac562330048880514de4a128430544316d74c99 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Tue, 14 Aug 2018 16:59:22 +0530 Subject: [PATCH 0379/1044] Correct Exception messages Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/class-ee-site.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/php/class-ee-site.php b/php/class-ee-site.php index 36491338a..9522a955a 100644 --- a/php/class-ee-site.php +++ b/php/class-ee-site.php @@ -354,16 +354,16 @@ protected function inherit_certs( $site_name, $needs_wildcard ) { } if ( ! $parent_site ) { - throw new Exception( 'Unable to find existing site: ' . $parent_site ); + throw new Exception( 'Unable to find existing site: ' . $parent_site_name ); } if ( ! $parent_site['is_ssl'] ) { - throw new Exception( "Cannot inherit from $parent_site as site does not have SSL cert" ); + throw new Exception( "Cannot inherit from $parent_site_name as site does not have SSL cert" . var_dump( $parent_site ) ); } if ( ! $parent_site['site_ssl_wildcard'] ) { - throw new Exception( "Cannot inherit from $parent_site as site does not have wildcard SSL cert" ); + throw new Exception( "Cannot inherit from $parent_site_name as site does not have wildcard SSL cert" ); } // We don't have to do anything now as nginx-proxy handles everything for us. From 1d5e4e4105c3cca01ead3463709d767a7ec72ccf Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Tue, 14 Aug 2018 18:48:18 +0530 Subject: [PATCH 0380/1044] Made changes according to PR Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/EE/Model/Base.php | 35 +++++++++++--------- php/EE/Model/Site.php | 75 ++++++++++--------------------------------- php/class-ee-db.php | 68 ++++++++++++++++++++++----------------- php/class-ee-site.php | 7 ++-- 4 files changed, 78 insertions(+), 107 deletions(-) diff --git a/php/EE/Model/Base.php b/php/EE/Model/Base.php index 366aff28f..df8c41a3f 100644 --- a/php/EE/Model/Base.php +++ b/php/EE/Model/Base.php @@ -7,8 +7,7 @@ /** * Base EE Model class. */ -abstract class Base extends \ArrayObject -{ +abstract class Base extends \ArrayObject { /** * @var string Table that current model will write to @@ -133,9 +132,9 @@ public function offsetExists( $index ) { /** * Overriding offsetUnset for correct behaviour while deleting object properties by array index. * - * @param string|int $index Name of property to check - * * @throws \Exception + * + * @param string|int $index Name of property to check */ public function offsetUnset( $index ) { $this->__unset( $index ); @@ -208,16 +207,17 @@ public static function find_or_error( string $value, string $column = null ) { * * @param array $columns Columns to select * - * @return array Array of models * @throws \Exception + * + * @return array Array of models */ public static function all( $columns = [] ) { - return static::many_array_to_model( - EE::db() - ->table( static::$table ) - ->select( ...$columns ) - ->get() - ); + $models = EE::db() + ->table( static::$table ) + ->select( ...$columns ) + ->get(); + + return static::many_array_to_model( $models ); } /** @@ -225,11 +225,12 @@ public static function all( $columns = [] ) { * * @param array $columns Columns and values to insert * - * @return static * @throws \Exception + * + * @return bool Model created successfully */ public static function create( $columns = [] ) { - return EE::db()->table( static::$table )->insert( $columns ); + return EE::db()->table( static::$table )->insert( $columns ); } /** @@ -240,10 +241,14 @@ public static function create( $columns = [] ) { * @return bool Model saved successfully */ public function save() { + $fields = array_merge( $this->fields, [ + 'modified_on' => date( 'Y-m-d H:i:s' ), + ] ); + return EE::db() ->table( static::$table ) ->where( static::$primary_key, $this[ static::$primary_key ] ) - ->update( $this->fields ); + ->update( $fields ); } /** @@ -251,7 +256,7 @@ public function save() { * * @throws \Exception * - * @return bool Model deleted` successfully + * @return bool Model deleted successfully */ public function delete() { return EE::db() diff --git a/php/EE/Model/Site.php b/php/EE/Model/Site.php index 1a85e5608..ce986d9aa 100644 --- a/php/EE/Model/Site.php +++ b/php/EE/Model/Site.php @@ -7,74 +7,33 @@ */ class Site extends Base { - protected static $table = 'sites'; - protected static $primary_key = 'site_url'; - /** - * Check if a site entry exists in the database. - * - * @param string $site_name Name of the site to be checked. - * - * @throws Exception - * - * @return bool Success. + * @var string Table of the model from where it will be stored/retrived */ - public static function site_in_db( $site_name ) { - $db = new EE_DB(); - $site = $db->table( 'sites' ) - ->select( 'id' ) - ->where( 'site_name', $site_name ) - ->first(); - - if ( $site ) { - return true; - } - - return false; - } + protected static $table = 'sites'; /** - * Check if a site entry exists in the database as well as if it is enbaled. - * - * @param String $site_name Name of the site to be checked. - * - * @throws Exception - * - * @return bool true if site is enabled, - * false if disabled or site does not exists. + * @var string Primary/Unique key of the table */ - public static function site_enabled( $site_name ) { - - $db = new EE_DB(); - $site = $db->table( 'sites' ) - ->select( 'id', 'site_enabled' ) - ->where( 'site_name', $site_name ) - ->first(); - - if ( $site ) { - return $site['site_enabled']; - } - - return false; - } + protected static $primary_key = 'site_url'; /** - * Get site type. - * - * @param String $site_name Name of the site. + * Saves current model into database * - * @throws Exception + * @throws \Exception * - * @return string type of site. + * @return bool Model saved successfully */ - public static function get_site_command( $site_name ) { - $db = new EE_DB(); - $site = $db->table( 'sites' ) - ->select( 'site_command' ) - ->where( 'site_name', $site_name ) - ->first(); - - return $site['site_command']; + public function save() { + $fields = array_merge( $this->fields, [ + 'modified_on' => date( 'Y-m-d H:i:s' ), + ] ); + + return EE::db() + ->table( static::$table ) + ->where( static::$primary_key, $this[ static::$primary_key ] ) + ->update( $fields ); } + } diff --git a/php/class-ee-db.php b/php/class-ee-db.php index 0d479ab53..9dfc87c69 100644 --- a/php/class-ee-db.php +++ b/php/class-ee-db.php @@ -126,16 +126,13 @@ private static function create_required_tables() { /** * Fetches first record from current query * - * @return array Record * @throws Exception + * + * @return array Record */ public function first() { $pdo_statement = $this->common_retrieval_function(); - if ( ! $pdo_statement ) { - return false; - } - return $pdo_statement->fetch(); } @@ -143,8 +140,9 @@ public function first() { * Common retrival function that runs current 'select' query. * Other methods (like get and first) can use this to provide higher level functionality on top of it * - * @return bool|PDOStatement * @throws Exception + * + * @return bool|PDOStatement */ private function common_retrieval_function() { if ( null === $this->tables ) { @@ -152,7 +150,10 @@ private function common_retrieval_function() { } $where = $this->where['query_string']; - $this->select === '' ? $this->select = '*' : ''; + + if ( empty( $this->select ) ) { + $this->select = '*'; + } $query = "SELECT $this->select FROM $this->tables{$where}{$this->limit}{$this->offset};"; @@ -168,9 +169,9 @@ private function common_retrieval_function() { $result = $pdo_statement->execute(); if ( ! $result ) { - EE::debug( self::$pdo->errorInfo() ); + EE::debug( implode( ' ', self::$pdo->errorInfo() ) ); - return false; + throw new PDOException( self::$pdo->errorInfo() ); } return $pdo_statement; @@ -190,6 +191,7 @@ private function common_retrieval_function() { * @param ...$args One or more where condition. * * @throws Exception + * * @return EE_DB */ public function where( ...$args ) { @@ -234,24 +236,12 @@ public function select( ...$args ) { return $this; } - /** - * Selects table to do operation on. - * - * @param ...$args Tables to run query on. - * - * @return EE_DB - */ - public function table( ...$args ) { - $this->tables = implode( ', ', $args ); - - return $this; - } - /** * Fetches all records from current query * - * @return array All records * @throws Exception + * + * @return array All records */ public function get() { $pdo_statement = $this->common_retrieval_function(); @@ -263,11 +253,25 @@ public function get() { return $pdo_statement->fetchAll(); } + /** + * Selects table to do operation on. + * + * @param ...$args Tables to run query on. + * + * @return EE_DB + */ + public function table( ...$args ) { + $this->tables = implode( ', ', $args ); + + return $this; + } + /** * Fetches all records from current query. * - * @return array All records * @throws Exception + * + * @return array All records */ public function all() { return $this->get(); @@ -333,9 +337,9 @@ public function insert( $data ) { $result = $pdo_statement->execute(); if ( ! $result ) { - EE::debug( self::$pdo->errorInfo() ); + EE::debug( implode( ' ', self::$pdo->errorInfo() ) ); - return false; + throw new PDOException( self::$pdo->errorInfo() ); } return self::$pdo->lastInsertId(); @@ -389,9 +393,9 @@ public function update( $values ) { $result = $pdo_statement->execute(); if ( ! $result ) { - EE::debug( self::$pdo->errorInfo() ); + EE::debug( implode( ' ', self::$pdo->errorInfo() ) ); - return false; + throw new PDOException( self::$pdo->errorInfo() ); } return true; @@ -428,9 +432,9 @@ public function delete() { $result = $pdo_statement->execute(); if ( ! $result ) { - EE::debug( self::$pdo->errorInfo() ); + EE::debug( implode( ' ', self::$pdo->errorInfo() ) ); - return false; + throw new PDOException( self::$pdo->errorInfo() ); } return true; @@ -452,6 +456,10 @@ private function get_where_fragment( $condition ) { $column = $condition[0]; $operator = '='; + if ( ! is_array( $condition ) || empty( $condition ) || count( $condition ) > 3 ) { + throw new Exception( 'Where clause must non empty array with lets than 3 elements' ); + } + if ( 'string' !== gettype( $column ) ) { throw new Exception( 'Where clause column must be of type string' ); } diff --git a/php/class-ee-site.php b/php/class-ee-site.php index 265384ce9..1893e3d45 100644 --- a/php/class-ee-site.php +++ b/php/class-ee-site.php @@ -8,8 +8,7 @@ * * @package ee */ -abstract class EE_Site_Command -{ +abstract class EE_Site_Command { /** * @var Filesystem $fs Symfony Filesystem object. */ @@ -435,8 +434,8 @@ private function populate_site_info( $args ) { $this->site['type'] = $site->site_type; $this->site['root'] = $site->site_fs_path; - $this->le = null !== $site->site_ssl; - $this->wildcard = 'wildcard' === $site->site_ssl; + $this->le = ( null !== $site->site_ssl ); + $this->wildcard = ( 'wildcard' === $site->site_ssl ); } else { EE::error( sprintf( 'Site %s does not exist.', $this->site['name'] ) ); } From c57626365d16e2f3d863c9a6c8adae92a6b849c2 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Thu, 16 Aug 2018 12:48:59 +0530 Subject: [PATCH 0381/1044] Add WWW domain in cert Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/class-ee-site.php | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/php/class-ee-site.php b/php/class-ee-site.php index 9522a955a..aedb9bb93 100644 --- a/php/class-ee-site.php +++ b/php/class-ee-site.php @@ -391,12 +391,23 @@ protected function init_le( $site_name, $site_root, $wildcard = false ) { return; } - $domains = $wildcard ? [ - sprintf( '*.%s', $this->site['name'] ), - $this->site['name'] - ] : [ $this->site['name'] ]; + + $domains = [ $this->site['name'] ]; + $has_www = strpos( $site_name, 'www.' ) === 0; + + if ( $wildcard ) { + $domains[] = "*.{$this->site['name']}"; + } + + if ( $has_www ) { + $site_name_without_www = ltrim( $site_name, 'www.' ); + $domains[] = $site_name_without_www; + } else { + $site_name_with_www = 'www.' . $site_name; + $domains[] = $site_name_with_www; + } if ( ! $client->authorize( $domains, $this->site['root'], $wildcard ) ) { - $this->ssl = false; + $this->le = false; return; } From 17ada4d55de9914b65cbc86a65b98877bd47bdfb Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Thu, 16 Aug 2018 12:50:21 +0530 Subject: [PATCH 0382/1044] Add SSL cert config in www redirection block Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/site-utils.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/php/site-utils.php b/php/site-utils.php index c5cda774b..45b6047d3 100644 --- a/php/site-utils.php +++ b/php/site-utils.php @@ -161,7 +161,20 @@ function add_site_redirects( $site_name, $ssl ) { $content = " server { listen 80; + server_name $site_name_without_www; + return 301 https://$site_name\$request_uri; +} + +server { listen 443; + ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; + ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:!DSS'; + ssl_prefer_server_ciphers on; + ssl_session_timeout 5m; + ssl_session_cache shared:SSL:50m; + ssl_session_tickets off; + ssl_certificate /etc/nginx/certs/$site_name.crt; + ssl_certificate_key /etc/nginx/certs/$site_name.key; server_name $site_name_without_www; return 301 https://$site_name\$request_uri; }"; @@ -182,7 +195,20 @@ function add_site_redirects( $site_name, $ssl ) { $content = " server { listen 80; + server_name $site_name_with_www; + return 301 https://$site_name\$request_uri; +} + +server { listen 443; + ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; + ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:!DSS'; + ssl_prefer_server_ciphers on; + ssl_session_timeout 5m; + ssl_session_cache shared:SSL:50m; + ssl_session_tickets off; + ssl_certificate /etc/nginx/certs/$site_name.crt; + ssl_certificate_key /etc/nginx/certs/$site_name.key; server_name $site_name_with_www; return 301 https://$site_name\$request_uri; }"; From bc83e91253332201114a8faf088f4c28ba668552 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Thu, 16 Aug 2018 12:53:40 +0530 Subject: [PATCH 0383/1044] Correct docblock Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/EE/Model/Base.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/php/EE/Model/Base.php b/php/EE/Model/Base.php index df8c41a3f..c1ffd7934 100644 --- a/php/EE/Model/Base.php +++ b/php/EE/Model/Base.php @@ -132,9 +132,9 @@ public function offsetExists( $index ) { /** * Overriding offsetUnset for correct behaviour while deleting object properties by array index. * - * @throws \Exception - * * @param string|int $index Name of property to check + * + * @throws \Exception */ public function offsetUnset( $index ) { $this->__unset( $index ); From df06474af27731460ae33da1bb3625b4078835e0 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Thu, 16 Aug 2018 13:01:29 +0530 Subject: [PATCH 0384/1044] Add array type hint. Return early on args validation. Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/class-ee-db.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/php/class-ee-db.php b/php/class-ee-db.php index 9dfc87c69..09f98857c 100644 --- a/php/class-ee-db.php +++ b/php/class-ee-db.php @@ -452,14 +452,15 @@ public function delete() { * * @return array prepared query string and its corresponding binding */ - private function get_where_fragment( $condition ) { - $column = $condition[0]; - $operator = '='; + private function get_where_fragment( array $condition ) { - if ( ! is_array( $condition ) || empty( $condition ) || count( $condition ) > 3 ) { - throw new Exception( 'Where clause must non empty array with lets than 3 elements' ); + if ( empty( $condition ) || count( $condition ) > 3 ) { + throw new Exception( 'Where clause array must non empty with less than 3 elements' ); } + $column = $condition[0]; + $operator = '='; + if ( 'string' !== gettype( $column ) ) { throw new Exception( 'Where clause column must be of type string' ); } From c3c5dda476e08f05a697d72b5bf0101f884c2eea Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Thu, 16 Aug 2018 14:18:37 +0530 Subject: [PATCH 0385/1044] Remove inheritance from ArrayObject in Base class Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/EE/Model/Base.php | 53 +------------------------------------------ 1 file changed, 1 insertion(+), 52 deletions(-) diff --git a/php/EE/Model/Base.php b/php/EE/Model/Base.php index c1ffd7934..7d9c5b643 100644 --- a/php/EE/Model/Base.php +++ b/php/EE/Model/Base.php @@ -7,7 +7,7 @@ /** * Base EE Model class. */ -abstract class Base extends \ArrayObject { +abstract class Base { /** * @var string Table that current model will write to @@ -89,57 +89,6 @@ public function __unset( $name ) { unset( $this->fields[ $name ] ); } - /** - * Overriding offsetGet for correct behaviour while accessing object properties by array index. - * - * @param string|int $index Name of property to check - * - * @throws \Exception - * - * @return bool - */ - public function offsetGet( $index ) { - return $this->__get( $index ); - } - - /** - * Overriding offsetSet for correct behaviour while saving object properties by array index. - * - * @param string|int $index Name of property to check - * @param mixed $value Value of property to set - * - * @throws \Exception - * - * @return bool - */ - public function offsetSet( $index, $value ) { - return $this->__set( $index, $value ); - } - - /** - * Overriding offsetGet for correct behaviour while checking array_key_exists. - * - * @param string|int $index Name of property to check - * - * @throws \Exception - * - * @return bool - */ - public function offsetExists( $index ) { - return $this->__isset( $index ); - } - - /** - * Overriding offsetUnset for correct behaviour while deleting object properties by array index. - * - * @param string|int $index Name of property to check - * - * @throws \Exception - */ - public function offsetUnset( $index ) { - $this->__unset( $index ); - } - /** * Returns single model fetched by primary key * From 14b24b916af04c08c534b53a6559f760f5eaf433 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Thu, 16 Aug 2018 14:47:19 +0530 Subject: [PATCH 0386/1044] Fix phpcs errors Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/EE/Model/Base.php | 232 +++++++++++++++++++++--------------------- 1 file changed, 118 insertions(+), 114 deletions(-) diff --git a/php/EE/Model/Base.php b/php/EE/Model/Base.php index 7d9c5b643..025394f35 100644 --- a/php/EE/Model/Base.php +++ b/php/EE/Model/Base.php @@ -34,65 +34,29 @@ public function __construct( array $fields = [] ) { } /** - * In model, every value is get in fields array. - * We populate it either during constructor or during find() method call - * - * This gives us benefit that models do not have to define properties in class - * They are automatically defined when fetched from database! + * Throws exception if model is not found * - * @param string $name Name of property to get + * @param string $value value to find + * @param string $column Column to find in. Defaults to primary key * * @throws \Exception * - * @return mixed Value of property - */ - public function __get( string $name ) { - if ( array_key_exists( $name, $this->fields ) ) { - return $this->fields[ $name ]; - } - - throw new \Exception( "Unable to find variable: $name" ); - } - - /** - * In model, every value is set in fields array. - * - * This gives us benefit that models do not have to define the logic of saving them in database. - * While saving models, we use the $fields array to save it in database - * - * - * @param string $name Name of property to set - * @param mixed $value Value of property to set + * @return static */ - public function __set( string $name, $value ) { - $this->fields[ $name ] = $value; - } + public static function find_or_fail( string $value, string $column = null ) { + $model = static::find( $value, $column ); - /** - * Overriding isset for correct behaviour while using isset on model objects - * - * @param string|int $name Name of property to check - * - * @return bool - */ - public function __isset( $name ) { - return isset( $this->fields[ $name ] ); - } + if ( ! $model ) { + throw new \Exception( sprintf( 'Unable to find %s : with primary key: %s and value: %s', __CLASS__, static::$primary_key, $value ) ); + } - /** - * Removes a property from model - * It's done by removing it from $fields array - * - * @param string $name Name of property to unset - */ - public function __unset( $name ) { - unset( $this->fields[ $name ] ); + return $model; } /** * Returns single model fetched by primary key * - * @param string $value value to find + * @param string $value value to find * @param string $column Column to find in. Defaults to primary key * * @throws \Exception @@ -101,12 +65,12 @@ public function __unset( $name ) { */ public static function find( string $value, string $column = null ) { $primary_key_column = $column ?? static::$primary_key; - $model = EE::db() + $model = EE::db() ->table( static::$table ) ->where( $primary_key_column, $value ) ->first(); - if( $model === false ) { + if ( false === $model ) { return false; } @@ -114,28 +78,20 @@ public static function find( string $value, string $column = null ) { } /** - * Throws exception if model is not found - * - * @param string $value value to find - * @param string $column Column to find in. Defaults to primary key + * Converts single row fetched from database into model * - * @throws \Exception + * @param array $arr Associative array representing a row from database * - * @return static + * @return mixed */ - public static function find_or_fail( string $value, string $column = null ) { - $model = static::find( $value, $column ); - - if ( ! $model ) { - throw new \Exception( sprintf( 'Unable to find %s : with primary key: %s and value: %s', __CLASS__, static::$primary_key, $value ) ); - } - return $model; + protected static function single_array_to_model( array $arr ) { + return new static( $arr ); } /** * Exits with error if model is not found * - * @param string $value value to find + * @param string $value value to find * @param string $column Column to find in. Defaults to primary key * * @throws \Exception @@ -148,6 +104,7 @@ public static function find_or_error( string $value, string $column = null ) { if ( ! $model ) { EE::error( sprintf( 'Unable to find %s : with primary key: %s and value: %s', __CLASS__, static::$primary_key, $value ) ); } + return $model; } @@ -169,6 +126,23 @@ public static function all( $columns = [] ) { return static::many_array_to_model( $models ); } + /** + * Converts an array of result from database to models + * + * @param array $arr Array of results from database + * + * @return array + */ + protected static function many_array_to_model( array $arr ) { + $result = []; + + foreach ( $arr as $model ) { + $result[] = static::single_array_to_model( $model ); + } + + return $result; + } + /** * Creates new entity in DB * @@ -182,6 +156,81 @@ public static function create( $columns = [] ) { return EE::db()->table( static::$table )->insert( $columns ); } + /** + * Returns all model with condition + * + * @param string|array $column Column to search in + * @param string|int $value Value to match + * + * @throws \Exception + * + * @return array + */ + public static function where( $column, $value ) { + return static::many_array_to_model( + EE::db() + ->table( static::$table ) + ->where( $column, $value ) + ->all() + ); + } + + /** + * In model, every value is get in fields array. + * We populate it either during constructor or during find() method call + * + * This gives us benefit that models do not have to define properties in class + * They are automatically defined when fetched from database! + * + * @param string $name Name of property to get + * + * @throws \Exception + * + * @return mixed Value of property + */ + public function __get( string $name ) { + if ( array_key_exists( $name, $this->fields ) ) { + return $this->fields[$name]; + } + + throw new \Exception( "Unable to find variable: $name" ); + } + + /** + * In model, every value is set in fields array. + * + * This gives us benefit that models do not have to define the logic of saving them in database. + * While saving models, we use the $fields array to save it in database + * + * + * @param string $name Name of property to set + * @param mixed $value Value of property to set + */ + public function __set( string $name, $value ) { + $this->fields[$name] = $value; + } + + /** + * Overriding isset for correct behaviour while using isset on model objects + * + * @param string|int $name Name of property to check + * + * @return bool + */ + public function __isset( $name ) { + return isset( $this->fields[$name] ); + } + + /** + * Removes a property from model + * It's done by removing it from $fields array + * + * @param string $name Name of property to unset + */ + public function __unset( $name ) { + unset( $this->fields[$name] ); + } + /** * Saves current model into database * @@ -190,13 +239,15 @@ public static function create( $columns = [] ) { * @return bool Model saved successfully */ public function save() { - $fields = array_merge( $this->fields, [ - 'modified_on' => date( 'Y-m-d H:i:s' ), - ] ); + $fields = array_merge( + $this->fields, [ + 'modified_on' => date( 'Y-m-d H:i:s' ), + ] + ); return EE::db() ->table( static::$table ) - ->where( static::$primary_key, $this[ static::$primary_key ] ) + ->where( static::$primary_key, $this[static::$primary_key] ) ->update( $fields ); } @@ -227,51 +278,4 @@ public function update( $columns ) { ->where( static::$primary_key, $this->id ) ->update( $columns ); } - - /** - * Returns all model with condition - * - * @param string|array $column Column to search in - * @param string|int $value Value to match - * - * @throws \Exception - * - * @return array - */ - public static function where( $column, $value ) { - return static::many_array_to_model( - EE::db() - ->table( static::$table ) - ->where( $column, $value ) - ->all() - ); - } - - /** - * Converts single row fetched from database into model - * - * @param array $arr Associative array representing a row from database - * - * @return mixed - */ - protected static function single_array_to_model( array $arr ) { - return new static( $arr ); - } - - /** - * Converts an array of result from database to models - * - * @param array $arr Array of results from database - * - * @return array - */ - protected static function many_array_to_model( array $arr ) { - $result = []; - - foreach ( $arr as $model ) { - $result[] = static::single_array_to_model( $model ); - } - - return $result; - } } From 5d8a65c41ca40602ec5beb7302e755f1683f5064 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Thu, 16 Aug 2018 14:50:11 +0530 Subject: [PATCH 0387/1044] Fix phpcs errors Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/EE/Model/Base.php | 2 +- php/class-ee-db.php | 139 +++++++++++++++++++++--------------------- 2 files changed, 71 insertions(+), 70 deletions(-) diff --git a/php/EE/Model/Base.php b/php/EE/Model/Base.php index 025394f35..30a7a8e30 100644 --- a/php/EE/Model/Base.php +++ b/php/EE/Model/Base.php @@ -61,7 +61,7 @@ public static function find_or_fail( string $value, string $column = null ) { * * @throws \Exception * - * @return static + * @return bool|static */ public static function find( string $value, string $column = null ) { $primary_key_column = $column ?? static::$primary_key; diff --git a/php/class-ee-db.php b/php/class-ee-db.php index 09f98857c..812e9abcc 100644 --- a/php/class-ee-db.php +++ b/php/class-ee-db.php @@ -23,7 +23,7 @@ public function __construct() { $this->offset = ''; $this->where = [ 'query_string' => null, - 'bindings' => null, + 'bindings' => null, ]; } @@ -34,6 +34,7 @@ private static function init_db() { if ( ! ( file_exists( DB ) ) ) { self::create_required_tables(); + return; } @@ -214,6 +215,56 @@ public function where( ...$args ) { return $this; } + /** + * Returns a query fragment for where clause + * + * If the param given is ['column', 100], it returns ['column = ?', 100] + * If the param given is ['column', '>', 100], it returns ['column > ?', 100] + * + * @param array $condition An array of format [column, operator, value] or [column, value] + * + * @throws Exception + * + * @return array prepared query string and its corresponding binding + */ + private function get_where_fragment( array $condition ) { + + if ( empty( $condition ) || count( $condition ) > 3 ) { + throw new Exception( 'Where clause array must non empty with less than 3 elements' ); + } + + $column = $condition[0]; + $operator = '='; + + if ( 'string' !== gettype( $column ) ) { + throw new Exception( 'Where clause column must be of type string' ); + } + + if ( isset( $condition[2] ) ) { + $operator = $condition[1]; + $allowed_operators = [ '=', '<', '>', '<=', '>=', '==', '!=', '<>', 'like', 'in' ]; + + if ( ! in_array( strtolower( $operator ), $allowed_operators ) ) { + throw new Exception( 'Where clause operator should be in one of following: ' . implode( ' ', $allowed_operators ) ); + } + + $value = $condition[2]; + } elseif ( isset( $condition[1] ) ) { + $value = $condition[1]; + } else { + throw new Exception( 'Where clause value must be set' ); + } + + if ( 'string' !== gettype( $operator ) || ! in_array( gettype( $value ), [ 'string', 'integer', 'boolean' ], true ) ) { + throw new Exception( 'Where clause operator and value must be string' ); + } + + return [ + 'query_string' => "$column $operator ?", + 'binding' => $value, + ]; + } + /** * Select data from the database. * @@ -236,23 +287,6 @@ public function select( ...$args ) { return $this; } - /** - * Fetches all records from current query - * - * @throws Exception - * - * @return array All records - */ - public function get() { - $pdo_statement = $this->common_retrieval_function(); - - if ( ! $pdo_statement ) { - return false; - } - - return $pdo_statement->fetchAll(); - } - /** * Selects table to do operation on. * @@ -277,6 +311,23 @@ public function all() { return $this->get(); } + /** + * Fetches all records from current query + * + * @throws Exception + * + * @return array All records + */ + public function get() { + $pdo_statement = $this->common_retrieval_function(); + + if ( ! $pdo_statement ) { + return false; + } + + return $pdo_statement->fetchAll(); + } + /** * Adds limit to query. * @@ -371,7 +422,7 @@ public function update( $values ) { return false; } - $set_keys = array_keys( $values ); + $set_keys = array_keys( $values ); $set_bindings = array_values( $values ); $where_bindings = $this->where['bindings']; @@ -439,54 +490,4 @@ public function delete() { return true; } - - /** - * Returns a query fragment for where clause - * - * If the param given is ['column', 100], it returns ['column = ?', 100] - * If the param given is ['column', '>', 100], it returns ['column > ?', 100] - * - * @param array $condition An array of format [column, operator, value] or [column, value] - * - * @throws Exception - * - * @return array prepared query string and its corresponding binding - */ - private function get_where_fragment( array $condition ) { - - if ( empty( $condition ) || count( $condition ) > 3 ) { - throw new Exception( 'Where clause array must non empty with less than 3 elements' ); - } - - $column = $condition[0]; - $operator = '='; - - if ( 'string' !== gettype( $column ) ) { - throw new Exception( 'Where clause column must be of type string' ); - } - - if ( isset( $condition[2] ) ) { - $operator = $condition[1]; - $allowed_operators = [ '=', '<', '>', '<=', '>=', '==', '!=', '<>', 'like', 'in' ]; - - if ( ! in_array( strtolower( $operator ), $allowed_operators ) ) { - throw new Exception( 'Where clause operator should be in one of following: ' . implode( ' ', $allowed_operators ) ); - } - - $value = $condition[2]; - } elseif ( isset( $condition[1] ) ) { - $value = $condition[1]; - } else { - throw new Exception( 'Where clause value must be set' ); - } - - if ( 'string' !== gettype( $operator ) || ! in_array( gettype( $value ), [ 'string', 'integer', 'boolean' ], true ) ) { - throw new Exception( 'Where clause operator and value must be string' ); - } - - return [ - 'query_string' => "$column $operator ?", - 'binding' => $value, - ]; - } } From 686beba98562927d593a58122669ce5503eeb192 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Fri, 17 Aug 2018 11:24:35 +0530 Subject: [PATCH 0388/1044] Fix assoc-arg updates to apply only when site is primary arg Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Runner.php | 77 ++++++++++++++++++++++++----------------------- 1 file changed, 40 insertions(+), 37 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index b42358629..a60e8c8fc 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -548,49 +548,52 @@ public function init_config() { unset( $assoc_args['version'] ); } - $ee3_compat_array_map_to_type = [ - 'wp' => [ 'type' => 'wp' ], - 'wpsubdom' => [ 'type' => 'wp', 'mu' => 'subdom' ], - 'wpsubdir' => [ 'type' => 'wp', 'mu' => 'subdir' ], - 'wpredis' => [ 'type' => 'wp', 'cache' => true ], - 'html' => [ 'type' => 'html' ], - ]; - - foreach ( $ee3_compat_array_map_to_type as $from => $to ) { - if ( isset( $assoc_args[ $from ] ) ) { - $assoc_args = array_merge( $assoc_args, $to ); - unset( $assoc_args[ $from ] ); + if ( 'site' === $args[0] ) { + + $ee3_compat_array_map_to_type = [ + 'wp' => [ 'type' => 'wp' ], + 'wpsubdom' => [ 'type' => 'wp', 'mu' => 'subdom' ], + 'wpsubdir' => [ 'type' => 'wp', 'mu' => 'subdir' ], + 'wpredis' => [ 'type' => 'wp', 'cache' => true ], + 'html' => [ 'type' => 'html' ], + ]; + + foreach ( $ee3_compat_array_map_to_type as $from => $to ) { + if ( isset( $assoc_args[ $from ] ) ) { + $assoc_args = array_merge( $assoc_args, $to ); + unset( $assoc_args[ $from ] ); + } } - } - // ee3 backward compatibility flags - $wp_compat_array_map = [ - 'user' => 'admin_user', - 'pass' => 'admin_pass', - 'email' => 'admin_email', - 'le' => 'letsencrypt', - ]; - - foreach ( $wp_compat_array_map as $from => $to ) { - if ( isset( $assoc_args[ $from ] ) ) { - $assoc_args[ $to ] = $assoc_args[ $from ]; - unset( $assoc_args[ $from ] ); + // ee3 backward compatibility flags + $wp_compat_array_map = [ + 'user' => 'admin_user', + 'pass' => 'admin_pass', + 'email' => 'admin_email', + 'le' => 'letsencrypt', + ]; + + foreach ( $wp_compat_array_map as $from => $to ) { + if ( isset( $assoc_args[ $from ] ) ) { + $assoc_args[ $to ] = $assoc_args[ $from ]; + unset( $assoc_args[ $from ] ); + } } - } - // backward compatibility message - $unsupported_create_old_args = array( - 'w3tc', - 'wpsc', - 'wpfc', - 'pagespeed', - ); + // backward compatibility message + $unsupported_create_old_args = array( + 'w3tc', + 'wpsc', + 'wpfc', + 'pagespeed', + ); - $old_arg = array_intersect( $unsupported_create_old_args, array_keys( $assoc_args ) ); + $old_arg = array_intersect( $unsupported_create_old_args, array_keys( $assoc_args ) ); - $old_args = implode( ' --', $old_arg ); - if ( isset( $args[1] ) && 'create' === $args[1] && ! empty ( $old_arg ) ) { - \EE::error( "Sorry, --$old_args flag/s is/are no longer supported in EE v4.\nPlease run `ee help " . implode( ' ', $args ) . '`.' ); + $old_args = implode( ' --', $old_arg ); + if ( isset( $args[1] ) && 'create' === $args[1] && ! empty ( $old_arg ) ) { + \EE::error( "Sorry, --$old_args flag/s is/are no longer supported in EE v4.\nPlease run `ee help " . implode( ' ', $args ) . '`.' ); + } } list( $this->arguments, $this->assoc_args ) = [ $args, $assoc_args ]; From ce73d278ecc25170035238a22395a1bb2efa6104 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Fri, 17 Aug 2018 12:06:41 +0530 Subject: [PATCH 0389/1044] Remove array notation usage Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/EE/Model/Site.php | 7 ++++--- php/class-ee-site.php | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/php/EE/Model/Site.php b/php/EE/Model/Site.php index ce986d9aa..6b63fbd1b 100644 --- a/php/EE/Model/Site.php +++ b/php/EE/Model/Site.php @@ -1,6 +1,7 @@ <?php namespace EE\Model; +use EE; /** * Site model class. @@ -29,11 +30,11 @@ public function save() { 'modified_on' => date( 'Y-m-d H:i:s' ), ] ); + $primary_key_column = static::$primary_key; + return EE::db() ->table( static::$table ) - ->where( static::$primary_key, $this[ static::$primary_key ] ) + ->where( $primary_key_column, $this->$primary_key_column ) ->update( $fields ); } - - } diff --git a/php/class-ee-site.php b/php/class-ee-site.php index 1893e3d45..7b17935f6 100644 --- a/php/class-ee-site.php +++ b/php/class-ee-site.php @@ -88,8 +88,8 @@ public function _list( $args, $assoc_args ) { } else { $result = array_map( function ( $site ) { - $site['site'] = $site['site_url']; - $site['status'] = $site['site_enabled'] ? 'enabled' : 'disabled'; + $site->site = $site->site_url; + $site->status = $site->site_enabled ? 'enabled' : 'disabled'; return $site; }, $sites From 762f57ce88e890ee508a0b65f6628125431ba243 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Fri, 17 Aug 2018 12:45:44 +0530 Subject: [PATCH 0390/1044] Correct primary key usage Also corrected array usage Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/EE/Model/Base.php | 12 +++++++++--- php/class-ee-site.php | 4 ++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/php/EE/Model/Base.php b/php/EE/Model/Base.php index 30a7a8e30..026729e83 100644 --- a/php/EE/Model/Base.php +++ b/php/EE/Model/Base.php @@ -245,9 +245,11 @@ public function save() { ] ); + $primary_key_column = static::$primary_key; + return EE::db() ->table( static::$table ) - ->where( static::$primary_key, $this[static::$primary_key] ) + ->where( $primary_key_column, $this->$primary_key_column ) ->update( $fields ); } @@ -259,9 +261,11 @@ public function save() { * @return bool Model deleted successfully */ public function delete() { + $primary_key_column = static::$primary_key; + return EE::db() ->table( static::$table ) - ->where( static::$primary_key, $this->id ) + ->where( $primary_key_column, $this->$primary_key_column ) ->delete(); } @@ -273,9 +277,11 @@ public function delete() { * @return bool Model updated successfully */ public function update( $columns ) { + $primary_key_column = static::$primary_key; + return EE::db() ->table( static::$table ) - ->where( static::$primary_key, $this->id ) + ->where( $primary_key_column, $this->$primary_key_column ) ->update( $columns ); } } diff --git a/php/class-ee-site.php b/php/class-ee-site.php index 7b17935f6..b6ce5ddbd 100644 --- a/php/class-ee-site.php +++ b/php/class-ee-site.php @@ -83,7 +83,7 @@ public function _list( $args, $assoc_args ) { if ( 'text' === $format ) { foreach ( $sites as $site ) { - EE::log( $site['site_url'] ); + EE::log( $site->site_url ); } } else { $result = array_map( @@ -95,7 +95,7 @@ function ( $site ) { }, $sites ); - $formatter = new EE\Formatter( $assoc_args, ['site', 'status'] ); + $formatter = new EE\Formatter( $assoc_args, [ 'site', 'status' ] ); $formatter->display_items( $result ); } From 064685b591559331a17dc0890d7c4cd7cfab53cb Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 20 Aug 2018 13:52:32 +0530 Subject: [PATCH 0391/1044] Update travis flow and composer Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- .travis.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index c1bb87e68..d308824b4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,14 +15,17 @@ before_install: else echo "xdebug.ini does not exist" fi + - [ "$TRAVIS_BRANCH" != "master-v4" ] && sed -i '/easyengine.*/s/:\ \".*\"/:\ \"develop\"/' composer.json install: - - composer install --no-interaction + - [ "$TRAVIS_BRANCH" = "master-v4" ] && composer install --no-interaction || composer update - sudo ./ci/test-env-install.sh before_script: - composer validate - ./ci/prepare.sh + +script: - sudo ./vendor/bin/behat - ./ci/test-commands.sh @@ -33,7 +36,7 @@ jobs: include: - stage: deploy env: DEPLOY_BRANCH=master-v4 - script: ./ci/deploy.sh + after_success: ./ci/deploy.sh cache: directories: @@ -47,4 +50,4 @@ branches: notifications: email: on_success: never - on_failure: change \ No newline at end of file + on_failure: change From 140255da6d75deee671f37a095a4daa2e8227c9e Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 20 Aug 2018 13:57:17 +0530 Subject: [PATCH 0392/1044] Update if condition syntax for travis parsing Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- .travis.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index d308824b4..223841fa3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,10 +15,20 @@ before_install: else echo "xdebug.ini does not exist" fi - - [ "$TRAVIS_BRANCH" != "master-v4" ] && sed -i '/easyengine.*/s/:\ \".*\"/:\ \"develop\"/' composer.json + - | + # Update commands in composer.json to develop if branch is not master. + if [[ "$TRAVIS_BRANCH" != "master-v4" ]]; then + sed -i '/easyengine.*/s/:\ \".*\"/:\ \"develop\"/' composer.json + fi install: - - [ "$TRAVIS_BRANCH" = "master-v4" ] && composer install --no-interaction || composer update + - | + # Update commands in composer.json to develop if branch is not master. + if [[ "$TRAVIS_BRANCH" = "master-v4" ]]; then + composer install --no-interaction + else + composer update + fi - sudo ./ci/test-env-install.sh before_script: From ced7704e5e8afcae383ddb8481d7e3de11fa7f24 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 20 Aug 2018 14:06:59 +0530 Subject: [PATCH 0393/1044] Update comment and add debugging Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 223841fa3..6a592824b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,11 +19,12 @@ before_install: # Update commands in composer.json to develop if branch is not master. if [[ "$TRAVIS_BRANCH" != "master-v4" ]]; then sed -i '/easyengine.*/s/:\ \".*\"/:\ \"develop\"/' composer.json + cat composer.json fi install: - | - # Update commands in composer.json to develop if branch is not master. + # Run composer install for master else update. if [[ "$TRAVIS_BRANCH" = "master-v4" ]]; then composer install --no-interaction else From 534fffdb95ebbe1ed7f56bd960b0939645fb343a Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 20 Aug 2018 14:37:36 +0530 Subject: [PATCH 0394/1044] Update sed replace command Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6a592824b..2c4b7eace 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ before_install: - | # Update commands in composer.json to develop if branch is not master. if [[ "$TRAVIS_BRANCH" != "master-v4" ]]; then - sed -i '/easyengine.*/s/:\ \".*\"/:\ \"develop\"/' composer.json + sed -i 's/\(easyengine\/.*\):\ \".*\"/\1:\ \"dev-develop\"/' composer.json cat composer.json fi From 45b8a191a54c531682549254624da4553546bd87 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 20 Aug 2018 16:14:25 +0530 Subject: [PATCH 0395/1044] Remove extra debug lines Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2c4b7eace..07d487652 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,6 @@ before_install: # Update commands in composer.json to develop if branch is not master. if [[ "$TRAVIS_BRANCH" != "master-v4" ]]; then sed -i 's/\(easyengine\/.*\):\ \".*\"/\1:\ \"dev-develop\"/' composer.json - cat composer.json fi install: From 72ab8e670305adf15d01e6b3f76ececd65af1a7f Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 21 Aug 2018 12:33:07 +0530 Subject: [PATCH 0396/1044] Fix refactoring syntax update bug Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/site-utils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/site-utils.php b/php/site-utils.php index 7920226fe..2f71c400d 100644 --- a/php/site-utils.php +++ b/php/site-utils.php @@ -24,7 +24,7 @@ function get_site_name() { $name = reset( $site_name ); $path = Site::find( $name ); if ( $path ) { - $site_path = $path['site_fs_path']; + $site_path = $path->site_fs_path; if ( substr( $cwd, 0, strlen( $site_path ) ) === $site_path ) { return $name; } From f7ae513a2ff87c6f5a004e28fdd3a8720508fe48 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 21 Aug 2018 16:05:55 +0530 Subject: [PATCH 0397/1044] Get image versions in migrations from utils Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Migration/Containers.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index 2fed51e41..626186054 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -37,15 +37,17 @@ public static function start_container_migration() { * Pulls new images of all containers used by easyengine */ private static function pull_new_images() { - self::pull_or_error( 'easyengine/php', 'v' . EE_VERSION ); - self::pull_or_error( 'easyengine/cron', 'v' . EE_VERSION ); - self::pull_or_error( 'easyengine/redis', 'v' . EE_VERSION ); - self::pull_or_error( 'easyengine/nginx', 'v' . EE_VERSION ); - self::pull_or_error( 'easyengine/postfix', 'v' . EE_VERSION ); - self::pull_or_error( 'easyengine/mailhog', 'v' . EE_VERSION ); - self::pull_or_error( 'easyengine/mariadb', 'v' . EE_VERSION ); - self::pull_or_error( 'easyengine/phpmyadmin', 'v' . EE_VERSION ); - self::pull_or_error( 'easyengine/nginx-proxy', 'v' . EE_VERSION ); + + $img_versions = EE\Utils\get_image_versions(); + self::pull_or_error( 'easyengine/php', $img_versions['easyengine/php'] ); + self::pull_or_error( 'easyengine/cron', $img_versions['easyengine/cron'] ); + self::pull_or_error( 'easyengine/redis', $img_versions['easyengine/redis'] ); + self::pull_or_error( 'easyengine/nginx', $img_versions['easyengine/nginx'] ); + self::pull_or_error( 'easyengine/postfix', $img_versions['easyengine/postfix'] ); + self::pull_or_error( 'easyengine/mailhog', $img_versions['easyengine/mailhog'] ); + self::pull_or_error( 'easyengine/mariadb', $img_versions['easyengine/mariadb'] ); + self::pull_or_error( 'easyengine/phpmyadmin', $img_versions['easyengine/phpmyadmin'] ); + self::pull_or_error( 'easyengine/nginx-proxy', $img_versions['easyengine/nginx-proxy'] ); } /** From 5a02703afc1c30cdfa82dd50861e5485d789b462 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 21 Aug 2018 16:22:11 +0530 Subject: [PATCH 0398/1044] Update json handling validations Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/utils.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/php/utils.php b/php/utils.php index 666369408..3bf1140c8 100644 --- a/php/utils.php +++ b/php/utils.php @@ -1553,5 +1553,16 @@ function get_callable_name( callable $callable ) { */ function get_image_versions() { - return json_decode( file_get_contents( EE_ROOT . '/img-versions.json' ), true ); + $img_version_file = file_get_contents( EE_ROOT . '/img-versions.json' ); + if ( empty( $img_version_file ) ) { + EE::error( 'Image version file is empty. Can\'t proceed further.' ); + } + $img_versions = json_decode( $img_version_file, true ); + $json_error = json_last_error(); + if ( $json_error != JSON_ERROR_NONE ) { + EE::debug( 'Json last error: ' . $json_error ); + EE::error( 'Error decoding image version file.' ); + } + + return $img_versions; } From 5b41f5aaf2cba94660460e7307ca5b871e6cd3fb Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 21 Aug 2018 16:22:27 +0530 Subject: [PATCH 0399/1044] Add remaining images Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- img-versions.json | 1 + 1 file changed, 1 insertion(+) diff --git a/img-versions.json b/img-versions.json index 5c0736e67..eb24e2c9a 100644 --- a/img-versions.json +++ b/img-versions.json @@ -1,4 +1,5 @@ { + "easyengine/cron": "v4.0.0-beta.5", "easyengine/mailhog": "v4.0.0-beta.5", "easyengine/mariadb": "v4.0.0-beta.5", "easyengine/nginx-proxy": "v4.0.0-beta.5", From 192fdc45a18ab116834e8dd74ee9ecb4586f270a Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Tue, 21 Aug 2018 18:28:08 +0530 Subject: [PATCH 0400/1044] Add function to reload ee-nginx-proxy container Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/site-utils.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/php/site-utils.php b/php/site-utils.php index 45b6047d3..0940b1400 100644 --- a/php/site-utils.php +++ b/php/site-utils.php @@ -141,6 +141,15 @@ function setup_site_network( $site_name ) { } +/** + * Reloads configuration of ee-nginx-proxy container + * + * @return bool + */ +function reload_proxy_configuration() { + return EE::exec( 'docker exec ee-nginx-proxy sh -c "/app/docker-entrypoint.sh /usr/local/bin/docker-gen /app/nginx.tmpl /etc/nginx/conf.d/default.conf; /usr/sbin/nginx -s reload"' ); +} + /** * Adds www to non-www redirection to site * From e49083ac0f87a58635b6cd60e3c7488a8c477d0d Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Tue, 21 Aug 2018 18:29:53 +0530 Subject: [PATCH 0401/1044] Remove redirection file while deleting site Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/class-ee-site.php | 82 +++++++++++++++++++++++++++++++++---------- 1 file changed, 63 insertions(+), 19 deletions(-) diff --git a/php/class-ee-site.php b/php/class-ee-site.php index aedb9bb93..845772ecf 100644 --- a/php/class-ee-site.php +++ b/php/class-ee-site.php @@ -174,6 +174,18 @@ protected function delete_site( $level, $site_name, $site_root ) { EE::log( "[$site_name] site root removed." ); } + $config_file_path = EE_CONF_ROOT . '/nginx/conf.d/' . $site_name . '-redirect.conf'; + + if ( $this->fs->exists( $config_file_path ) ) { + try { + $this->fs->remove( $config_file_path ); + } catch ( Exception $e ) { + EE::debug( $e ); + EE::error( 'Could not remove site redirection file. Please check if you have sufficient rights.' ); + } + } + + if ( $level > 4 ) { if ( $this->ssl ) { EE::log( 'Removing ssl certs.' ); @@ -378,6 +390,7 @@ protected function inherit_certs( $site_name, $needs_wildcard ) { * @param bool $wildcard SSL with wildcard or not. */ protected function init_le( $site_name, $site_root, $wildcard = false ) { + EE::debug("Wildcard in init_le: $wildcard" ); $this->site['name'] = $site_name; $this->site['root'] = $site_root; @@ -391,21 +404,8 @@ protected function init_le( $site_name, $site_root, $wildcard = false ) { return; } + $domains = $this->get_cert_domains( $site_name, $wildcard ); - $domains = [ $this->site['name'] ]; - $has_www = strpos( $site_name, 'www.' ) === 0; - - if ( $wildcard ) { - $domains[] = "*.{$this->site['name']}"; - } - - if ( $has_www ) { - $site_name_without_www = ltrim( $site_name, 'www.' ); - $domains[] = $site_name_without_www; - } else { - $site_name_with_www = 'www.' . $site_name; - $domains[] = $site_name_with_www; - } if ( ! $client->authorize( $domains, $this->site['root'], $wildcard ) ) { $this->le = false; @@ -418,6 +418,44 @@ protected function init_le( $site_name, $site_root, $wildcard = false ) { } } + /** + * Returns all domains required by cert + * + * @param string $site_name Name of site + * @param $wildcard Wildcard cert required? + * + * @return array + */ + private function get_cert_domains( string $site_name, $wildcard ) : array { + $domains = [ $site_name ]; + $has_www = strpos( $site_name, 'www.' ) === 0; + + if ( $wildcard ) { + $domains[] = "*.{$site_name}"; + } else { + $domains[] = $this->get_www_domain( $site_name ); + } + return $domains; + } + + /** + * If the domain has www in it, returns a domain without www in it. + * Else returns a domain with www in it. + * + * @param string $site_name Name of site + * + * @return string Domain name with or without www + */ + private function get_www_domain( string $site_name ) : string { + $has_www = strpos( $site_name, 'www.' ) === 0; + + if ( $has_www ) { + return ltrim( $site_name, 'www.' ); + } else { + return 'www.' . $site_name; + } + } + /** * Runs the acme le. @@ -439,17 +477,23 @@ public function le( $args = [], $assoc_args = [] ) { $this->le_mail = EE::get_config( 'le-mail' ) ?? EE::input( 'Enter your mail id: ' ); } $force = EE\Utils\get_flag_value( $assoc_args, 'force' ); - $domains = $this->wildcard ? [ '*.' . $this->site['name'], $this->site['name'] ] : [ $this->site['name'] ]; + + EE::debug( "Wildcard in le() $this->wildcard" ); + + $domains = $this->get_cert_domains( $this->site['name'], $this->wildcard ); + $client = new Site_Letsencrypt(); if ( ! $client->check( $domains, $this->wildcard ) ) { $this->ssl = false; return; } - if ( $this->wildcard ) { - $client->request( '*.' . $this->site['name'], [ $this->site['name'] ], $this->le_mail, $force ); - } else { - $client->request( $this->site['name'], [], $this->le_mail, $force ); + + $san = array_values( array_diff( $domains, [ $this->site['name'] ] ) ); + + $client->request( $this->site['name'], $san, $this->le_mail, $force ); + + if ( ! $this->wildcard ) { $client->cleanup( $this->site['root'] ); } EE::launch( 'docker exec ee-nginx-proxy sh -c "/app/docker-entrypoint.sh /usr/local/bin/docker-gen /app/nginx.tmpl /etc/nginx/conf.d/default.conf; /usr/sbin/nginx -s reload"' ); From 83cc7b80f037a9ef07f781af5bd826fa1f5d03a9 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Tue, 21 Aug 2018 18:30:38 +0530 Subject: [PATCH 0402/1044] Add function for managing different SSL options Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/class-ee-site.php | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/php/class-ee-site.php b/php/class-ee-site.php index 845772ecf..11b7f8e2a 100644 --- a/php/class-ee-site.php +++ b/php/class-ee-site.php @@ -369,7 +369,6 @@ protected function inherit_certs( $site_name, $needs_wildcard ) { throw new Exception( 'Unable to find existing site: ' . $parent_site_name ); } - if ( ! $parent_site['is_ssl'] ) { throw new Exception( "Cannot inherit from $parent_site_name as site does not have SSL cert" . var_dump( $parent_site ) ); } @@ -382,7 +381,30 @@ protected function inherit_certs( $site_name, $needs_wildcard ) { EE::success( 'Inherited certs from parent' ); } - /** + /** + * Runs SSL procedure. + * + * @param string $site_name Name of the site for ssl. + * @param string $site_root Webroot of the site. + * @param string $ssl_type Type of ssl cert to issue. + * @param bool $wildcard SSL with wildcard or not. + * + * @throws \EE\ExitException If --ssl flag has unrecognized value + */ + protected function init_ssl( $site_name, $site_root, $ssl_type, $wildcard = false ) { + EE::debug( 'Starting SSL procedure' ); + if ( 'le' === $ssl_type ) { + EE::debug( 'Initializing LE' ); + $this->init_le( $site_name, $site_root, $wildcard ); + } elseif ( 'inherit' === $ssl_type ) { + EE::debug( 'Inheriting certs' ); + $this->inherit_certs( $site_name, $wildcard ); + } else { + EE::error( "Unrecognized value in --ssl flag: $ssl_type" ); + } + } + + /** * Runs the acme le registration and authorization. * * @param string $site_name Name of the site for ssl. From 6977a1df104fbcf4f788541d51e8d07d5ccc3314 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Tue, 21 Aug 2018 18:32:44 +0530 Subject: [PATCH 0403/1044] Create http challenge for each domain Correct solver debug message Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/class-ee-site-letsencrypt.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/php/class-ee-site-letsencrypt.php b/php/class-ee-site-letsencrypt.php index 21dc89099..8bf8486ec 100644 --- a/php/class-ee-site-letsencrypt.php +++ b/php/class-ee-site-letsencrypt.php @@ -160,23 +160,24 @@ public function authorize( Array $domains, $site_root, $wildcard = false ) { foreach ( $authorizationChallengesToSolve as $authorizationChallenge ) { EE::debug( 'Solving authorization challenge: Domain: ' . $authorizationChallenge->getDomain() . ' Challenge: ' . print_r( $authorizationChallenge->toArray(), true ) ); $solver->solve( $authorizationChallenge ); + + if ( ! $wildcard ) { + $token = $authorizationChallenge->toArray()['token']; + $payload = $authorizationChallenge->toArray()['payload']; + EE::launch( "mkdir -p $site_root/app/src/.well-known/acme-challenge/" ); + EE::debug( "Creating challange file $site_root/app/src/.well-known/acme-challenge/$token" ); + file_put_contents( "$site_root/app/src/.well-known/acme-challenge/$token", $payload ); + EE::launch( "chown www-data: $site_root/app/src/.well-known/acme-challenge/$token" ); + } } $this->repository->storeCertificateOrder( $domains, $order ); - if ( ! $wildcard ) { - $token = $authorizationChallenge->toArray()['token']; - $payload = $authorizationChallenge->toArray()['payload']; - EE::launch( "mkdir -p $site_root/app/src/.well-known/acme-challenge/" ); - EE::debug( "Creating challange file $site_root/app/src/.well-known/acme-challenge/$token" ); - file_put_contents( "$site_root/app/src/.well-known/acme-challenge/$token", $payload ); - EE::launch( "chown www-data: $site_root/app/src/.well-known/acme-challenge/$token" ); - } return true; } public function check( Array $domains, $wildcard = false ) { - EE::debug( 'Starting check with solver ' . $wildcard ? 'dns' : 'http' ); + EE::debug( ('Starting check with solver ') . ($wildcard ? 'dns' : 'http') ); $solver = $wildcard ? new SimpleDnsSolver( null, new ConsoleOutput() ) : new SimpleHttpSolver(); $validator = new ChainValidator( [ From f74c8e199030ba9103e3294558a67afa7db29398 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Tue, 21 Aug 2018 20:16:43 +0530 Subject: [PATCH 0404/1044] Add parent site name on inheriting certs Update doc comment Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/site-utils.php | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/php/site-utils.php b/php/site-utils.php index 0940b1400..a1f08093e 100644 --- a/php/site-utils.php +++ b/php/site-utils.php @@ -153,15 +153,21 @@ function reload_proxy_configuration() { /** * Adds www to non-www redirection to site * - * @param string $site_name Name of the site. - * @param bool $ssl Specifying if ssl is enabled or not. + * @param string $site_name name of the site. + * @param bool $ssl enable ssl or not. + * @param bool $inherit inherit cert or not. */ -function add_site_redirects( $site_name, $ssl ) { +function add_site_redirects( string $site_name, $ssl, $inherit ) { $fs = new Filesystem(); $confd_path = EE_CONF_ROOT . '/nginx/conf.d/'; $config_file_path = $confd_path . $site_name . '-redirect.conf'; $has_www = strpos( $site_name, 'www.' ) === 0; + $cert_site_name = $site_name; + + if ( $inherit ) { + $cert_site_name = implode( '.', array_slice( explode( '.', $site_name ), 1 ) ); + } if ( $has_www ) { $site_name_without_www = ltrim( $site_name, '.www' ); @@ -182,8 +188,8 @@ function add_site_redirects( $site_name, $ssl ) { ssl_session_timeout 5m; ssl_session_cache shared:SSL:50m; ssl_session_tickets off; - ssl_certificate /etc/nginx/certs/$site_name.crt; - ssl_certificate_key /etc/nginx/certs/$site_name.key; + ssl_certificate /etc/nginx/certs/$cert_site_name.crt; + ssl_certificate_key /etc/nginx/certs/$cert_site_name.key; server_name $site_name_without_www; return 301 https://$site_name\$request_uri; }"; @@ -216,8 +222,8 @@ function add_site_redirects( $site_name, $ssl ) { ssl_session_timeout 5m; ssl_session_cache shared:SSL:50m; ssl_session_tickets off; - ssl_certificate /etc/nginx/certs/$site_name.crt; - ssl_certificate_key /etc/nginx/certs/$site_name.key; + ssl_certificate /etc/nginx/certs/$cert_site_name.crt; + ssl_certificate_key /etc/nginx/certs/$cert_site_name.key; server_name $site_name_with_www; return 301 https://$site_name\$request_uri; }"; From acd873b9086527849f923e7913631e8c60bcb81e Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Tue, 21 Aug 2018 21:24:49 +0530 Subject: [PATCH 0405/1044] Correct ssl and ssl_wildcard values Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/class-ee-site.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/php/class-ee-site.php b/php/class-ee-site.php index d44dc80cf..57ae4be07 100644 --- a/php/class-ee-site.php +++ b/php/class-ee-site.php @@ -431,7 +431,7 @@ protected function init_le( $site_name, $site_root, $wildcard = false ) { $this->le_mail = EE::get_runner()->config['le-mail'] ?? EE::input( 'Enter your mail id: ' ); EE::get_runner()->ensure_present_in_config( 'le-mail', $this->le_mail ); if ( ! $client->register( $this->le_mail ) ) { - $this->ssl = false; + $this->ssl = null; return; } @@ -515,7 +515,7 @@ public function le( $args = [], $assoc_args = [] ) { $client = new Site_Letsencrypt(); if ( ! $client->check( $domains, $this->wildcard ) ) { - $this->ssl = false; + $this->ssl = null; return; } @@ -541,8 +541,8 @@ private function populate_site_info( $args ) { $this->site['type'] = $site->site_type; $this->site['root'] = $site->site_fs_path; - $this->ssl = ( null !== $site->site_ssl ); - $this->wildcard = ( 'wildcard' === $site->site_ssl ); + $this->ssl = $site->site_ssl; + $this->wildcard = $site->site_ssl_wildcard; } else { EE::error( sprintf( 'Site %s does not exist.', $this->site['name'] ) ); } From 7c4b52976db622518f6351b87faf628cb88d5c20 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Tue, 21 Aug 2018 21:38:38 +0530 Subject: [PATCH 0406/1044] Replace site['name'] eith site['url'] Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/class-ee-site.php | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/php/class-ee-site.php b/php/class-ee-site.php index 57ae4be07..b30e1610d 100644 --- a/php/class-ee-site.php +++ b/php/class-ee-site.php @@ -119,8 +119,8 @@ public function delete( $args, $assoc_args ) { EE\Utils\delem_log( 'site delete start' ); $this->populate_site_info( $args ); - EE::confirm( sprintf( 'Are you sure you want to delete %s?', $this->site['name'] ), $assoc_args ); - $this->delete_site( 5, $this->site['name'], $this->site['root'] ); + EE::confirm( sprintf( 'Are you sure you want to delete %s?', $this->site['url'] ), $assoc_args ); + $this->delete_site( 5, $this->site['url'], $this->site['root'] ); EE\Utils\delem_log( 'site delete end' ); } @@ -227,7 +227,7 @@ public function up( $args, $assoc_args ) { $force = EE\Utils\get_flag_value( $assoc_args, 'force' ); $args = EE\SiteUtils\auto_site_name( $args, 'site', __FUNCTION__ ); $this->populate_site_info( $args ); - $site = Site::find( $this->site['name'] ); + $site = Site::find( $this->site['url'] ); if ( $site->site_enabled && ! $force ) { EE::error( sprintf( '%s is already enabled!', $site->site_url ) ); @@ -259,7 +259,7 @@ public function down( $args, $assoc_args ) { $args = EE\SiteUtils\auto_site_name( $args, 'site', __FUNCTION__ ); $this->populate_site_info( $args ); - $site = Site::find($this->site['name']); + $site = Site::find($this->site['url']); EE::log( sprintf( 'Disabling site %s.', $site->site_url ) ); @@ -267,9 +267,9 @@ public function down( $args, $assoc_args ) { $site->site_enabled = 0; $site->save(); - EE::success( sprintf( 'Site %s disabled.', $this->site['name'] ) ); + EE::success( sprintf( 'Site %s disabled.', $this->site['url'] ) ); } else { - EE::error( sprintf( 'There was error in disabling %s. Please check logs.', $this->site['name'] ) ); + EE::error( sprintf( 'There was error in disabling %s. Please check logs.', $this->site['url'] ) ); } EE\Utils\delem_log( 'site disable end' ); } @@ -424,7 +424,7 @@ protected function init_ssl( $site_name, $site_root, $ssl_type, $wildcard = fals protected function init_le( $site_name, $site_root, $wildcard = false ) { EE::debug("Wildcard in init_le: $wildcard" ); - $this->site['name'] = $site_name; + $this->site['url'] = $site_name; $this->site['root'] = $site_root; $this->wildcard = $wildcard; $client = new Site_Letsencrypt(); @@ -444,7 +444,7 @@ protected function init_le( $site_name, $site_root, $wildcard = false ) { return; } if ( $wildcard ) { - echo \cli\Colors::colorize( '%YIMPORTANT:%n Run `ee site le ' . $this->site['name'] . '` once the dns changes have propogated to complete the certification generation and installation.', null ); + echo \cli\Colors::colorize( '%YIMPORTANT:%n Run `ee site le ' . $this->site['url'] . '` once the dns changes have propogated to complete the certification generation and installation.', null ); } else { $this->le( [], [] ); } @@ -502,7 +502,7 @@ private function get_www_domain( string $site_name ) : string { */ public function le( $args = [], $assoc_args = [] ) { - if ( !isset( $this->site['name'] ) ) { + if ( !isset( $this->site['url'] ) ) { $this->populate_site_info( $args ); } @@ -511,7 +511,7 @@ public function le( $args = [], $assoc_args = [] ) { } $force = EE\Utils\get_flag_value( $assoc_args, 'force' ); - $domains = $this->get_cert_domains( $this->site['name'], $this->wildcard ); + $domains = $this->get_cert_domains( $this->site['url'], $this->wildcard ); $client = new Site_Letsencrypt(); if ( ! $client->check( $domains, $this->wildcard ) ) { @@ -519,8 +519,8 @@ public function le( $args = [], $assoc_args = [] ) { return; } - $san = array_values( array_diff( $domains, [ $this->site['name'] ] ) ); - $client->request( $this->site['name'], $san, $this->le_mail, $force ); + $san = array_values( array_diff( $domains, [ $this->site['url'] ] ) ); + $client->request( $this->site['url'], $san, $this->le_mail, $force ); if ( ! $this->wildcard ) { $client->cleanup( $this->site['root'] ); @@ -533,8 +533,8 @@ public function le( $args = [], $assoc_args = [] ) { */ private function populate_site_info( $args ) { - $this->site['name'] = EE\Utils\remove_trailing_slash( $args[0] ); - $site = Site::find( $this->site['name'] ); + $this->site['url'] = EE\Utils\remove_trailing_slash( $args[0] ); + $site = Site::find( $this->site['url'] ); if ( $site ) { $db_select = $site->site_url; @@ -544,7 +544,7 @@ private function populate_site_info( $args ) { $this->ssl = $site->site_ssl; $this->wildcard = $site->site_ssl_wildcard; } else { - EE::error( sprintf( 'Site %s does not exist.', $this->site['name'] ) ); + EE::error( sprintf( 'Site %s does not exist.', $this->site['url'] ) ); } } From 588baaec8be905b2848fb162b2eae151c464f104 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Wed, 22 Aug 2018 12:34:49 +0530 Subject: [PATCH 0407/1044] Add validation check Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Runner.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index f9180e76b..765c1d16b 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -546,7 +546,7 @@ public function init_config() { unset( $assoc_args['version'] ); } - if ( 'site' === $args[0] ) { + if ( isset( $args[0] ) && 'site' === $args[0] ) { $ee3_compat_array_map_to_type = [ 'wp' => [ 'type' => 'wp' ], From 9e63b82e4d03d3069eb420002d09c5ef10a10085 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Wed, 22 Aug 2018 12:45:14 +0530 Subject: [PATCH 0408/1044] Change find() method to select columns Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/EE/Model/Base.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/php/EE/Model/Base.php b/php/EE/Model/Base.php index 026729e83..3b838613a 100644 --- a/php/EE/Model/Base.php +++ b/php/EE/Model/Base.php @@ -56,18 +56,19 @@ public static function find_or_fail( string $value, string $column = null ) { /** * Returns single model fetched by primary key * - * @param string $value value to find - * @param string $column Column to find in. Defaults to primary key + * @param string $value value to find + * @param array $columns Columns to select. * * @throws \Exception * * @return bool|static */ - public static function find( string $value, string $column = null ) { - $primary_key_column = $column ?? static::$primary_key; - $model = EE::db() + public static function find( string $value, array $columns = [] ) { + + $model = EE::db() ->table( static::$table ) - ->where( $primary_key_column, $value ) + ->select( ...$columns ) + ->where( static::$primary_key, $value ) ->first(); if ( false === $model ) { From 19106b5c84e779bd0ddaf68298edc56c808269ae Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Wed, 22 Aug 2018 12:45:44 +0530 Subject: [PATCH 0409/1044] Add enabled() static function to check if site is enabled Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/EE/Model/Site.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/php/EE/Model/Site.php b/php/EE/Model/Site.php index 6b63fbd1b..a2e4d8b4d 100644 --- a/php/EE/Model/Site.php +++ b/php/EE/Model/Site.php @@ -37,4 +37,23 @@ public function save() { ->where( $primary_key_column, $this->$primary_key_column ) ->update( $fields ); } + + + /** + * Returns if site is enabled + * + * @param string $site_url Name of site to check + * + * @throws \Exception + * + * @return bool Site enabled + */ + public static function enabled( string $site_url ) : bool { + $site = static::find( $site_url, [ 'site_enabled' ] ); + + if ( $site && $site->site_enabled ) { + return true; + } + return false; + } } From 111d5c12d89bd94ddc4408317a45c5ad74cc7278 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Wed, 22 Aug 2018 14:03:13 +0530 Subject: [PATCH 0410/1044] gg img-versions.json in phar Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- utils/make-phar.php | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/utils/make-phar.php b/utils/make-phar.php index bc6ed7c94..3872d4fcf 100644 --- a/utils/make-phar.php +++ b/utils/make-phar.php @@ -172,7 +172,6 @@ function get_composer_versions( $current_version ) { ->in(EE_VENDOR_DIR . '/acmephp') ->in(EE_VENDOR_DIR . '/league') ->in(EE_VENDOR_DIR . '/webmozart') - ->notName('behat-tags.php') ->notPath('#(?:[^/]+-command|php-cli-tools)/vendor/#') // For running locally, in case have composer installed or symlinked them. ->exclude('examples') @@ -180,8 +179,8 @@ function get_composer_versions( $current_version ) { ->exclude('test') ->exclude('tests') ->exclude('Test') - ->exclude('Tests') - ; + ->exclude('Tests'); + if ( 'cli' === BUILD ) { $finder ->in(EE_VENDOR_DIR . '/wp-cli/mustangostang-spyc') @@ -222,6 +221,21 @@ function get_composer_versions( $current_version ) { add_file( $phar, $file ); } +$finder = new Finder(); +$finder + ->files() + ->ignoreVCS(true) + ->name('img-versions.json') + ->in( EE_ROOT ) + ->exclude( EE_ROOT . 'php/') + ->exclude( EE_ROOT . 'templates/') + ->exclude( EE_ROOT . 'vendor/') +; + +foreach ( $finder as $file ) { + add_file( $phar, $file ); +} + $finder = new Finder(); $finder From aedf157265b17d01b964d0fe7d9b537a57529b46 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Wed, 22 Aug 2018 16:14:40 +0530 Subject: [PATCH 0411/1044] Remove wildcard from inherit_certs Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/class-ee-site.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/php/class-ee-site.php b/php/class-ee-site.php index b30e1610d..4006cb946 100644 --- a/php/class-ee-site.php +++ b/php/class-ee-site.php @@ -363,18 +363,13 @@ private function reload_services( $services, $reload_commands ) { * Runs the acme le registration and authorization. * * @param string $site_name Name of the site for ssl. - * @param string $needs_wildcard Does site needs wildcard. * * @throws Exception */ - protected function inherit_certs( $site_name, $needs_wildcard ) { + protected function inherit_certs( $site_name ) { $parent_site_name = implode( '.', array_slice( explode( '.', $site_name ), 1 ) ); $parent_site = Site::find( $parent_site_name, [ 'site_ssl', 'site_ssl_wildcard' ] ); - if ( $needs_wildcard ) { - throw new Exception( '--wildcard cannot be used with --ssl=inherit' ); - } - if ( ! $parent_site ) { throw new Exception( 'Unable to find existing site: ' . $parent_site_name ); } @@ -407,8 +402,11 @@ protected function init_ssl( $site_name, $site_root, $ssl_type, $wildcard = fals EE::debug( 'Initializing LE' ); $this->init_le( $site_name, $site_root, $wildcard ); } elseif ( 'inherit' === $ssl_type ) { + if ( $wildcard ) { + EE::error( 'Cannot use --wildcard with --ssl=inherit', false ); + } EE::debug( 'Inheriting certs' ); - $this->inherit_certs( $site_name, $wildcard ); + $this->inherit_certs( $site_name ); } else { EE::error( "Unrecognized value in --ssl flag: $ssl_type" ); } @@ -422,7 +420,7 @@ protected function init_ssl( $site_name, $site_root, $ssl_type, $wildcard = fals * @param bool $wildcard SSL with wildcard or not. */ protected function init_le( $site_name, $site_root, $wildcard = false ) { - EE::debug("Wildcard in init_le: $wildcard" ); + EE::debug( "Wildcard in init_le: $wildcard" ); $this->site['url'] = $site_name; $this->site['root'] = $site_root; From 487fe2bf7ec84581120ffb8c54538c03f1264f04 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Wed, 22 Aug 2018 16:15:39 +0530 Subject: [PATCH 0412/1044] encapsulate statements with parenthesis Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/class-ee-site.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/php/class-ee-site.php b/php/class-ee-site.php index 4006cb946..771c28952 100644 --- a/php/class-ee-site.php +++ b/php/class-ee-site.php @@ -458,7 +458,7 @@ protected function init_le( $site_name, $site_root, $wildcard = false ) { */ private function get_cert_domains( string $site_name, $wildcard ) : array { $domains = [ $site_name ]; - $has_www = strpos( $site_name, 'www.' ) === 0; + $has_www = ( strpos( $site_name, 'www.' ) === 0 ); if ( $wildcard ) { $domains[] = "*.{$site_name}"; @@ -477,7 +477,7 @@ private function get_cert_domains( string $site_name, $wildcard ) : array { * @return string Domain name with or without www */ private function get_www_domain( string $site_name ) : string { - $has_www = strpos( $site_name, 'www.' ) === 0; + $has_www = ( strpos( $site_name, 'www.' ) === 0 ); if ( $has_www ) { return ltrim( $site_name, 'www.' ); From ff005636f3592473baf50328e85db38014b91e01 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Wed, 22 Aug 2018 16:16:43 +0530 Subject: [PATCH 0413/1044] Move site redirect to mustache file Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/site-utils.php | 82 ++++++-------------------------- templates/redirect.conf.mustache | 20 ++++++++ 2 files changed, 34 insertions(+), 68 deletions(-) create mode 100644 templates/redirect.conf.mustache diff --git a/php/site-utils.php b/php/site-utils.php index 1b1038ad2..39e69203b 100644 --- a/php/site-utils.php +++ b/php/site-utils.php @@ -156,10 +156,10 @@ function reload_proxy_configuration() { * Adds www to non-www redirection to site * * @param string $site_name name of the site. - * @param bool $ssl enable ssl or not. - * @param bool $inherit inherit cert or not. + * @param bool $ssl enable ssl or not. + * @param bool $inherit inherit cert or not. */ -function add_site_redirects( string $site_name, $ssl, $inherit ) { +function add_site_redirects( string $site_name, bool $ssl, bool $inherit ) { $fs = new Filesystem(); $confd_path = EE_CONF_ROOT . '/nginx/conf.d/'; @@ -172,73 +172,19 @@ function add_site_redirects( string $site_name, $ssl, $inherit ) { } if ( $has_www ) { - $site_name_without_www = ltrim( $site_name, '.www' ); - // ee site create www.example.com --le - if ( $ssl ) { - $content = " -server { - listen 80; - server_name $site_name_without_www; - return 301 https://$site_name\$request_uri; -} - -server { - listen 443; - ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; - ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:!DSS'; - ssl_prefer_server_ciphers on; - ssl_session_timeout 5m; - ssl_session_cache shared:SSL:50m; - ssl_session_tickets off; - ssl_certificate /etc/nginx/certs/$cert_site_name.crt; - ssl_certificate_key /etc/nginx/certs/$cert_site_name.key; - server_name $site_name_without_www; - return 301 https://$site_name\$request_uri; -}"; - } // ee site create www.example.com - else { - $content = " -server { - listen 80; - server_name $site_name_without_www; - return 301 http://$site_name\$request_uri; -}"; - } + $server_name = ltrim( $site_name, '.www' ); } else { - $site_name_with_www = 'www.' . $site_name; - // ee site create example.com --le - if ( $ssl ) { - - $content = " -server { - listen 80; - server_name $site_name_with_www; - return 301 https://$site_name\$request_uri; -} - -server { - listen 443; - ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; - ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:!DSS'; - ssl_prefer_server_ciphers on; - ssl_session_timeout 5m; - ssl_session_cache shared:SSL:50m; - ssl_session_tickets off; - ssl_certificate /etc/nginx/certs/$cert_site_name.crt; - ssl_certificate_key /etc/nginx/certs/$cert_site_name.key; - server_name $site_name_with_www; - return 301 https://$site_name\$request_uri; -}"; - } // ee site create example.com - else { - $content = " -server { - listen 80; - server_name $site_name_with_www; - return 301 http://$site_name\$request_uri; -}"; - } + $server_name = 'www.' . $site_name; } + + $conf_data = [ + 'site_name' => $site_name, + 'cert_site_name' => $cert_site_name, + 'server_name' => $server_name, + 'ssl' => $ssl, + ]; + + $content = EE\Utils\mustache_render( EE_ROOT . '/templates/redirect.conf.mustache', $conf_data ); $fs->dumpFile( $config_file_path, ltrim( $content, PHP_EOL ) ); } diff --git a/templates/redirect.conf.mustache b/templates/redirect.conf.mustache new file mode 100644 index 000000000..933bed417 --- /dev/null +++ b/templates/redirect.conf.mustache @@ -0,0 +1,20 @@ +server { + listen 80; + server_name {{server_name}}; + return 301 {{#ssl}}https://{{/ssl}}{{^ssl}}http://{{/ssl}}{{site_name}}$request_uri; +} +{{#ssl}} +server { + listen 443; + ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; + ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:!DSS'; + ssl_prefer_server_ciphers on; + ssl_session_timeout 5m; + ssl_session_cache shared:SSL:50m; + ssl_session_tickets off; + ssl_certificate /etc/nginx/certs/{{cert_site_name}}.crt; + ssl_certificate_key /etc/nginx/certs/{{cert_site_name}}.key; + server_name {{server_name}}; + return 301 https://{{site_name}}$request_uri; +} +{{/ssl}} From 465fb83919d7d38a0b262830becf376c246c11ea Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Wed, 22 Aug 2018 16:25:48 +0530 Subject: [PATCH 0414/1044] Align assoc array Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/site-utils.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/php/site-utils.php b/php/site-utils.php index 39e69203b..efd9d950c 100644 --- a/php/site-utils.php +++ b/php/site-utils.php @@ -178,10 +178,10 @@ function add_site_redirects( string $site_name, bool $ssl, bool $inherit ) { } $conf_data = [ - 'site_name' => $site_name, + 'site_name' => $site_name, 'cert_site_name' => $cert_site_name, - 'server_name' => $server_name, - 'ssl' => $ssl, + 'server_name' => $server_name, + 'ssl' => $ssl, ]; $content = EE\Utils\mustache_render( EE_ROOT . '/templates/redirect.conf.mustache', $conf_data ); From 78a82c3c3d3167ff3775d7d736ce30a852f0da69 Mon Sep 17 00:00:00 2001 From: Rahul Prajapati <rahul.prajapati@rtcamp.com> Date: Wed, 22 Aug 2018 17:44:59 +0530 Subject: [PATCH 0415/1044] Update readme. 1. Add ee logo. 2. Add slack invite link. 3. Add donation link. --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index dd73138ef..fa2981b85 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ # EasyEngine v4 +<img width="150" height="150" src="https://easyengine.io/wp-content/uploads/2015/11/cropped-favicon-easyengine.png" alt="EasyEngine Logo" align="right" /> + [![Build Status](https://travis-ci.org/EasyEngine/easyengine.svg?branch=master-v4)](https://travis-ci.org/EasyEngine/easyengine) +[![Join EasyEngine Slack Channel](http://slack.easyengine.io/badge.svg)](http://slack.easyengine.io/) ## Requirements @@ -100,3 +103,8 @@ In future, community will be able to make their own packages and commands! ## Contributing We warmheartedly welcome all contributions however and in whatever capacity you can either through Pull Requests or by reporting Issues. You can contribute here or in any of the above mentioned commands repo. + +## Donations + +[![PayPal-Donate](https://cloud.githubusercontent.com/assets/4115/5297691/c7b50292-7bd7-11e4-987b-2dc21069e756.png)](http://rt.cx/eedonate) +[![BitCoin-Donate](https://bitpay.com/img/donate-button.svg)](https://bitpay.com/417008/donate) From 97b94a1db17515e00aff45245c04981f050397dd Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Wed, 22 Aug 2018 17:54:25 +0530 Subject: [PATCH 0416/1044] Remove composer caching Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- .travis.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 07d487652..3266726e4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -48,10 +48,6 @@ jobs: env: DEPLOY_BRANCH=master-v4 after_success: ./ci/deploy.sh -cache: - directories: - - $HOME/.composer/cache - branches: only: - develop-v4 From aad51a8cba416cca38ac602bd77d4c8e86fc8275 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Wed, 22 Aug 2018 18:27:32 +0530 Subject: [PATCH 0417/1044] Revert "Remove composer caching" This reverts commit 97b94a1db17515e00aff45245c04981f050397dd. --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 3266726e4..07d487652 100644 --- a/.travis.yml +++ b/.travis.yml @@ -48,6 +48,10 @@ jobs: env: DEPLOY_BRANCH=master-v4 after_success: ./ci/deploy.sh +cache: + directories: + - $HOME/.composer/cache + branches: only: - develop-v4 From 597e5b1b718ec8c6023a13c1ca929ce6c6e88765 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Wed, 22 Aug 2018 20:27:59 +0530 Subject: [PATCH 0418/1044] Add auth, admin-tools and mailhog command to composer Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- composer.json | 3 + composer.lock | 188 +++++++++++++++++++++++++++++++++++++++++--------- 2 files changed, 159 insertions(+), 32 deletions(-) diff --git a/composer.json b/composer.json index 9a6127caf..9024c0d9f 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,10 @@ "acmephp/core": "dev-master", "composer/composer": "^1.2.0", "composer/semver": "~1.0", + "easyengine/admin-tools-command": "dev-develop", + "easyengine/auth-command": "dev-develop", "easyengine/cron-command": "v1.0.0-beta.2", + "easyengine/mailhog-command": "dev-develop", "easyengine/site-command": "v2.0.0", "easyengine/site-wp-command": "v1.0.0-beta.1", "easyengine/shell-command": "v1.0.0-beta.1", diff --git a/composer.lock b/composer.lock index b2e50b641..2f7279cc4 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": "64eddeb5dcc2884dacdcb4c2e199cdba", + "content-hash": "db6490bde7710948c4d0123da2b6669f", "packages": [ { "name": "acmephp/core", @@ -12,12 +12,12 @@ "source": { "type": "git", "url": "https://github.com/acmephp/core.git", - "reference": "910ca7b0edd25a54466050d9de276364f63cece1" + "reference": "0d5221f1dbb00ad6686ec2cab5017cab8bc424f1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/acmephp/core/zipball/910ca7b0edd25a54466050d9de276364f63cece1", - "reference": "910ca7b0edd25a54466050d9de276364f63cece1", + "url": "https://api.github.com/repos/acmephp/core/zipball/0d5221f1dbb00ad6686ec2cab5017cab8bc424f1", + "reference": "0d5221f1dbb00ad6686ec2cab5017cab8bc424f1", "shasum": "" }, "require": { @@ -69,7 +69,7 @@ "ssl", "x509" ], - "time": "2018-07-06T19:04:41+00:00" + "time": "2018-08-15T17:41:08+00:00" }, { "name": "acmephp/ssl", @@ -135,16 +135,16 @@ }, { "name": "composer/ca-bundle", - "version": "1.1.1", + "version": "1.1.2", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "d2c0a83b7533d6912e8d516756ebd34f893e9169" + "reference": "46afded9720f40b9dc63542af4e3e43a1177acb0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/d2c0a83b7533d6912e8d516756ebd34f893e9169", - "reference": "d2c0a83b7533d6912e8d516756ebd34f893e9169", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/46afded9720f40b9dc63542af4e3e43a1177acb0", + "reference": "46afded9720f40b9dc63542af4e3e43a1177acb0", "shasum": "" }, "require": { @@ -187,20 +187,20 @@ "ssl", "tls" ], - "time": "2018-03-29T19:57:20+00:00" + "time": "2018-08-08T08:57:40+00:00" }, { "name": "composer/composer", - "version": "1.7.0", + "version": "1.7.2", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "39edb2f375679a4eba19e69e9c9491e302976983" + "reference": "576aab9b5abb2ed11a1c52353a759363216a4ad2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/39edb2f375679a4eba19e69e9c9491e302976983", - "reference": "39edb2f375679a4eba19e69e9c9491e302976983", + "url": "https://api.github.com/repos/composer/composer/zipball/576aab9b5abb2ed11a1c52353a759363216a4ad2", + "reference": "576aab9b5abb2ed11a1c52353a759363216a4ad2", "shasum": "" }, "require": { @@ -267,7 +267,7 @@ "dependency", "package" ], - "time": "2018-08-03T13:39:07+00:00" + "time": "2018-08-16T14:57:12+00:00" }, { "name": "composer/semver", @@ -394,16 +394,16 @@ }, { "name": "composer/xdebug-handler", - "version": "1.1.0", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "c919dc6c62e221fc6406f861ea13433c0aa24f08" + "reference": "e1809da56ce1bd1b547a752936817341ac244d8e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/c919dc6c62e221fc6406f861ea13433c0aa24f08", - "reference": "c919dc6c62e221fc6406f861ea13433c0aa24f08", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/e1809da56ce1bd1b547a752936817341ac244d8e", + "reference": "e1809da56ce1bd1b547a752936817341ac244d8e", "shasum": "" }, "require": { @@ -434,7 +434,87 @@ "Xdebug", "performance" ], - "time": "2018-04-11T15:42:36+00:00" + "time": "2018-08-16T10:54:23+00:00" + }, + { + "name": "easyengine/admin-tools-command", + "version": "dev-develop", + "source": { + "type": "git", + "url": "https://github.com/EasyEngine/admin-tools-command.git", + "reference": "e3b8effe80d9f6450919d4a7c539de8283135a2f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/EasyEngine/admin-tools-command/zipball/e3b8effe80d9f6450919d4a7c539de8283135a2f", + "reference": "e3b8effe80d9f6450919d4a7c539de8283135a2f", + "shasum": "" + }, + "type": "ee-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "admin-tools" + ] + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "admin-tools-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Commanad to enable disable admin tools for php based sites.", + "homepage": "https://github.com/easyengine/amdin-tools", + "time": "2018-08-22T07:04:13+00:00" + }, + { + "name": "easyengine/auth-command", + "version": "dev-develop", + "source": { + "type": "git", + "url": "https://github.com/EasyEngine/auth-command.git", + "reference": "707f03cdd91342e7c9fb69c81fde34e697ca5d91" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/EasyEngine/auth-command/zipball/707f03cdd91342e7c9fb69c81fde34e697ca5d91", + "reference": "707f03cdd91342e7c9fb69c81fde34e697ca5d91", + "shasum": "" + }, + "type": "ee-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "auth" + ] + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "auth-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Configure HTTP auth for EasyEngine site.", + "homepage": "https://github.com/easyengine/auth-command", + "time": "2018-08-22T06:36:14+00:00" }, { "name": "easyengine/cron-command", @@ -479,6 +559,46 @@ "homepage": "https://github.com/easyengine/cron-command", "time": "2018-08-06T19:59:01+00:00" }, + { + "name": "easyengine/mailhog-command", + "version": "dev-develop", + "source": { + "type": "git", + "url": "https://github.com/EasyEngine/mailhog-command.git", + "reference": "c797aa33db43c7cf684887f2fe85de11e6b319c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/EasyEngine/mailhog-command/zipball/c797aa33db43c7cf684887f2fe85de11e6b319c4", + "reference": "c797aa33db43c7cf684887f2fe85de11e6b319c4", + "shasum": "" + }, + "type": "ee-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "mailhog" + ] + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "mailhog-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Commanad to enable disable mailhog for sites.", + "homepage": "https://github.com/easyengine/mailhog-command", + "time": "2018-08-22T06:59:42+00:00" + }, { "name": "easyengine/shell-command", "version": "v1.0.0-beta.1", @@ -848,16 +968,16 @@ }, { "name": "league/flysystem", - "version": "1.0.45", + "version": "1.0.46", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "a99f94e63b512d75f851b181afcdf0ee9ebef7e6" + "reference": "f3e0d925c18b92cf3ce84ea5cc58d62a1762a2b2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/a99f94e63b512d75f851b181afcdf0ee9ebef7e6", - "reference": "a99f94e63b512d75f851b181afcdf0ee9ebef7e6", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/f3e0d925c18b92cf3ce84ea5cc58d62a1762a2b2", + "reference": "f3e0d925c18b92cf3ce84ea5cc58d62a1762a2b2", "shasum": "" }, "require": { @@ -869,7 +989,7 @@ "require-dev": { "ext-fileinfo": "*", "phpspec/phpspec": "^3.4", - "phpunit/phpunit": "^5.7" + "phpunit/phpunit": "^5.7.10" }, "suggest": { "ext-fileinfo": "Required for MimeType", @@ -928,7 +1048,7 @@ "sftp", "storage" ], - "time": "2018-05-07T08:44:23+00:00" + "time": "2018-08-22T07:45:22+00:00" }, { "name": "monolog/monolog", @@ -2989,12 +3109,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "b3569bbd5257d4ae0885b14feb6e45e41e8184b7" + "reference": "0abc14e0df387fe74b4b32e0b8647d1639256d38" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/b3569bbd5257d4ae0885b14feb6e45e41e8184b7", - "reference": "b3569bbd5257d4ae0885b14feb6e45e41e8184b7", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/0abc14e0df387fe74b4b32e0b8647d1639256d38", + "reference": "0abc14e0df387fe74b4b32e0b8647d1639256d38", "shasum": "" }, "conflict": { @@ -3037,11 +3157,12 @@ "gregwar/rst": "<1.0.3", "guzzlehttp/guzzle": ">=6,<6.2.1|>=4.0.0-rc2,<4.2.4|>=5,<5.3.1", "illuminate/auth": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.10", + "illuminate/cookie": ">=4,<=4.0.11|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.42|>=5.6,<5.6.30", "illuminate/database": ">=4,<4.0.99|>=4.1,<4.1.29", "illuminate/encryption": ">=4,<=4.0.11|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.40|>=5.6,<5.6.15", "joomla/session": "<1.3.1", "kreait/firebase-php": ">=3.2,<3.8.1", - "laravel/framework": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.40|>=5.6,<5.6.15", + "laravel/framework": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.42|>=5.6,<5.6.30", "laravel/socialite": ">=1,<1.0.99|>=2,<2.0.10", "magento/magento1ce": "<1.9.3.9", "magento/magento1ee": ">=1.9,<1.14.3.2", @@ -3130,7 +3251,7 @@ "zendframework/zend-validator": ">=2.3,<2.3.6", "zendframework/zend-view": ">=2,<2.2.7|>=2.3,<2.3.1", "zendframework/zend-xmlrpc": ">=2.1,<2.1.6|>=2.2,<2.2.6", - "zendframework/zendframework": ">=2,<2.4.11|>=2.5,<2.5.1", + "zendframework/zendframework": "<2.5.1", "zendframework/zendframework1": "<1.12.20", "zendframework/zendopenid": ">=2,<2.0.2", "zendframework/zendxml": ">=1,<1.0.1", @@ -3152,7 +3273,7 @@ } ], "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", - "time": "2018-08-02T11:57:59+00:00" + "time": "2018-08-14T15:39:17+00:00" }, { "name": "squizlabs/php_codesniffer", @@ -3359,6 +3480,9 @@ "minimum-stability": "dev", "stability-flags": { "acmephp/core": 20, + "easyengine/admin-tools-command": 20, + "easyengine/auth-command": 20, + "easyengine/mailhog-command": 20, "roave/security-advisories": 20 }, "prefer-stable": true, From 05f52eab7ae7922d10f0bf45e53277b01289bf52 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 23 Aug 2018 12:28:49 +0530 Subject: [PATCH 0419/1044] Add specific json files to phar Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- utils/make-phar.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/utils/make-phar.php b/utils/make-phar.php index 3872d4fcf..bfa4cc730 100644 --- a/utils/make-phar.php +++ b/utils/make-phar.php @@ -249,6 +249,16 @@ function get_composer_versions( $current_version ) { add_file( $phar, $file ); } +$finder + ->files() + ->ignoreDotFiles(false) + ->in(EE_VENDOR_DIR . '/easyengine/*-command/') + ->name('ee-*.json'); + +foreach ( $finder as $file ) { + add_file( $phar, $file ); +} + // other files $finder = new Finder(); $finder->files() From 2b988f9e4ba36d7138de089bcc0c7c3adb7c0d65 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 23 Aug 2018 13:37:40 +0530 Subject: [PATCH 0420/1044] Update logging of install logs Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- .travis.yml | 1 + ci/test-env-install.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 07d487652..62f2b5d61 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,6 +40,7 @@ script: - ./ci/test-commands.sh after_script: + - cat /opt/easyengine/install.log - cat /opt/easyengine/ee.log jobs: diff --git a/ci/test-env-install.sh b/ci/test-env-install.sh index 9c7361b7c..ebaaf8a2c 100755 --- a/ci/test-env-install.sh +++ b/ci/test-env-install.sh @@ -1,5 +1,6 @@ #!/usr/bin/env bash function setup_test_requirements() { + readonly LOG_FILE="/opt/easyengine/install.log" # Adding software-properties-common for add-apt-repository. apt-get install -y software-properties-common # Adding ondrej/php repository for installing php, this works for all ubuntu flavours. From cdb78c09af84f23f2aee2457062a4585074253a2 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 23 Aug 2018 15:23:14 +0530 Subject: [PATCH 0421/1044] Update images to nightly for non-deploy branches Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- ci/prepare.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ci/prepare.sh b/ci/prepare.sh index 7df4fca83..d7c152bf5 100755 --- a/ci/prepare.sh +++ b/ci/prepare.sh @@ -2,11 +2,12 @@ # called by Travis CI -if [[ "$TRAVIS_BRANCH" == "develop-v4" ]]; then +if [[ "$TRAVIS_BRANCH" != $DEPLOY_BRANCH ]]; then version=$(head -n 1 VERSION) version="$(echo $version | xargs)" version+="-nightly" echo $version > VERSION + sed -i 's/\:\ \"\(.*\)\"/\:\ \"\1-nightly\"/g' img-versions.json fi php -dphar.readonly=0 ./utils/make-phar.php easyengine.phar --quiet \ No newline at end of file From 08187dc757209c2b195e05f7c0df6122936d7e87 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Thu, 23 Aug 2018 15:44:08 +0530 Subject: [PATCH 0422/1044] Add OCSP stapling Copy chain file to enable ocsp stapling refactor moveCertsToNginxProxy function Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/class-ee-site-letsencrypt.php | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/php/class-ee-site-letsencrypt.php b/php/class-ee-site-letsencrypt.php index 8bf8486ec..8567ff292 100644 --- a/php/class-ee-site-letsencrypt.php +++ b/php/class-ee-site-letsencrypt.php @@ -309,30 +309,24 @@ private function executeFirstRequest( $domain, array $alternativeNames, $email ) EE::log( 'Certificate stored' ); // Post-generate actions - $this->moveCertsToNginxProxy( $response ); + $this->moveCertsToNginxProxy( $domain ); } - private function moveCertsToNginxProxy( CertificateResponse $response ) { - $domain = $response->getCertificateRequest()->getDistinguishedName()->getCommonName(); - $privateKey = $response->getCertificateRequest()->getKeyPair()->getPrivateKey(); - $certificate = $response->getCertificate(); - + private function moveCertsToNginxProxy( string $domain ) { // To handle wildcard certs $domain = ltrim( $domain, '*.' ); - file_put_contents( EE_CONF_ROOT . '/nginx/certs/' . $domain . '.key', $privateKey->getPEM() ); - - // Issuer chain - $issuerChain = array_map( - function ( Certificate $certificate ) { - return $certificate->getPEM(); - }, $certificate->getIssuerChain() - ); + $key_source_file = strtr( $this->conf_dir . '/' . Repository::PATH_DOMAIN_KEY_PRIVATE, [ '{domain}' => $domain ] ); + $crt_source_file = strtr( $this->conf_dir . '/' . Repository::PATH_DOMAIN_CERT_FULLCHAIN, [ '{domain}' => $domain ] ); + $chain_source_file = strtr( $this->conf_dir . '/' . Repository::PATH_DOMAIN_CERT_CHAIN, [ '{domain}' => $domain ] ); - // Full chain - $fullChainPem = $certificate->getPEM() . "\n" . implode( "\n", $issuerChain ); + $key_dest_file = EE_CONF_ROOT . '/nginx/certs/' . $domain . '.key'; + $crt_dest_file = EE_CONF_ROOT . '/nginx/certs/' . $domain . '.crt'; + $chain_dest_file = EE_CONF_ROOT . '/nginx/certs/' . $domain . '.chain.pem'; - file_put_contents( EE_CONF_ROOT . '/nginx/certs/' . $domain . '.crt', $fullChainPem ); + copy( $key_source_file, $key_dest_file ); + copy( $crt_source_file, $crt_dest_file ); + copy( $chain_source_file, $chain_dest_file ); } /** @@ -401,7 +395,7 @@ private function executeRenewal( $domain, array $alternativeNames, $force = fals $this->log( 'Certificate stored' ); // Post-generate actions - $this->moveCertsToNginxProxy( $response ); + $this->moveCertsToNginxProxy( $domain ); EE::log( 'Certificate renewed successfully!' ); } From 710bac26e0c2dddae02397b7ed7bc57509465c36 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Thu, 23 Aug 2018 15:50:16 +0530 Subject: [PATCH 0423/1044] Remove wildcard trimming Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/class-ee-site-letsencrypt.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/php/class-ee-site-letsencrypt.php b/php/class-ee-site-letsencrypt.php index 8567ff292..9c396b941 100644 --- a/php/class-ee-site-letsencrypt.php +++ b/php/class-ee-site-letsencrypt.php @@ -313,8 +313,6 @@ private function executeFirstRequest( $domain, array $alternativeNames, $email ) } private function moveCertsToNginxProxy( string $domain ) { - // To handle wildcard certs - $domain = ltrim( $domain, '*.' ); $key_source_file = strtr( $this->conf_dir . '/' . Repository::PATH_DOMAIN_KEY_PRIVATE, [ '{domain}' => $domain ] ); $crt_source_file = strtr( $this->conf_dir . '/' . Repository::PATH_DOMAIN_CERT_FULLCHAIN, [ '{domain}' => $domain ] ); From c77858aee5ea8c8c77656839778d3fc8255aa7f1 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 23 Aug 2018 15:55:38 +0530 Subject: [PATCH 0424/1044] Append commit hash to nightly versions Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- ci/prepare.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/prepare.sh b/ci/prepare.sh index d7c152bf5..7ae98d55f 100755 --- a/ci/prepare.sh +++ b/ci/prepare.sh @@ -5,7 +5,7 @@ if [[ "$TRAVIS_BRANCH" != $DEPLOY_BRANCH ]]; then version=$(head -n 1 VERSION) version="$(echo $version | xargs)" - version+="-nightly" + version+="-nightly-$(git rev-parse --short HEAD)" echo $version > VERSION sed -i 's/\:\ \"\(.*\)\"/\:\ \"\1-nightly\"/g' img-versions.json fi From 8ec76fb2307abc292e6a75cef491d236e9fe2bce Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Thu, 23 Aug 2018 21:34:50 +0530 Subject: [PATCH 0425/1044] Add function to check if network exist Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/class-ee-docker.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php index 3dd92c92f..3569797fe 100644 --- a/php/class-ee-docker.php +++ b/php/class-ee-docker.php @@ -171,6 +171,10 @@ public static function docker_compose_up( $dir, $services = [] ) { return false; } + public static function docker_network_exists( string $network ) { + return EE::exec( "docker network inspect $network" ); + } + /** * Function to destroy the containers. * From 6ceda53c7d9dfbde58b0d89015dddbc1036584f1 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Thu, 23 Aug 2018 21:36:20 +0530 Subject: [PATCH 0426/1044] Add ee-nginx-proxy in global docker-compose.yml Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/site-utils.php | 55 ++++++++++++++++++-- templates/global_docker_compose.yml.mustache | 55 ++++++++++++++++++++ 2 files changed, 105 insertions(+), 5 deletions(-) create mode 100644 templates/global_docker_compose.yml.mustache diff --git a/php/site-utils.php b/php/site-utils.php index efd9d950c..914a1e81a 100644 --- a/php/site-utils.php +++ b/php/site-utils.php @@ -86,13 +86,20 @@ function init_checks() { if ( ! ( $port_80_status && $port_443_status ) ) { EE::error( 'Cannot create/start proxy container. Please make sure port 80 and 443 are free.' ); } else { - $EE_CONF_ROOT = EE_CONF_ROOT; - $img_versions = EE\Utils\get_image_versions(); - $ee_proxy_command = "docker run --name $proxy_type -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v $EE_CONF_ROOT/nginx/certs:/etc/nginx/certs -v $EE_CONF_ROOT/nginx/dhparam:/etc/nginx/dhparam -v $EE_CONF_ROOT/nginx/conf.d:/etc/nginx/conf.d -v $EE_CONF_ROOT/nginx/htpasswd:/etc/nginx/htpasswd -v $EE_CONF_ROOT/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v $EE_CONF_ROOT:/app/ee4 -v /usr/share/nginx/html easyengine/nginx-proxy:" . $img_versions['easyengine/nginx-proxy']; + $fs = new Filesystem(); - if ( EE::docker()::boot_container( $proxy_type, $ee_proxy_command ) ) { - $fs = new Filesystem(); + if ( ! $fs->exists( EE_CONF_ROOT . '/docker-compose.yml' ) ) { + generate_global_docker_compose_yml( $fs ); + } + + $EE_CONF_ROOT = EE_CONF_ROOT; + if ( ! EE::docker()::docker_network_exists( 'ee-global-network' ) ) { + if ( ! EE::exec( 'docker network create ee-global-network' ) ) { + EE::error( 'Unable to create network ee-global-network' ); + } + } + if ( EE::docker()::docker_compose_up( EE_CONF_ROOT, [ 'nginx-proxy' ] ) ) { $fs->dumpFile( "$EE_CONF_ROOT/nginx/conf.d/custom.conf", file_get_contents( EE_ROOT . '/templates/custom.conf.mustache' ) ); EE::success( "$proxy_type container is up." ); } else { @@ -102,6 +109,44 @@ function init_checks() { } } + +function generate_global_docker_compose_yml( Filesystem $fs ) { + $img_versions = EE\Utils\get_image_versions(); + + $data = [ + 'services' => [ + 'name' => 'nginx-proxy', + 'container_name' => 'ee-nginx-proxy', + 'image' => 'easyengine/nginx-proxy:' . $img_versions['easyengine/nginx-proxy'], + 'restart' => 'always', + 'ports' => [ + '80:80', + '443:443', + ], + 'environment' => [ + 'LOCAL_USER_ID=' . posix_geteuid(), + 'LOCAL_GROUP_ID=' . posix_getegid(), + ], + 'volumes' => [ + EE_CONF_ROOT . '/nginx/certs:/etc/nginx/certs ', + EE_CONF_ROOT . '/nginx/dhparam:/etc/nginx/dhparam', + EE_CONF_ROOT . '/nginx/conf.d:/etc/nginx/conf.d', + EE_CONF_ROOT . '/nginx/htpasswd:/etc/nginx/htpasswd', + EE_CONF_ROOT . '/nginx/vhost.d:/etc/nginx/vhost.d', + EE_CONF_ROOT . ':/app/ee4', + '/usr/share/nginx/html', + '/var/run/docker.sock:/tmp/docker.sock:ro', + ], + 'networks' => [ + 'global-network', + 'site-network', + ], + ], + ]; + $contents = EE\Utils\mustache_render( EE_ROOT . '/templates/global_docker_compose.yml.mustache', $data ); + $fs->dumpFile( EE_CONF_ROOT . '/docker-compose.yml', $contents ); +} + /** * Creates site root directory if does not exist. * Throws error if it does exist. diff --git a/templates/global_docker_compose.yml.mustache b/templates/global_docker_compose.yml.mustache new file mode 100644 index 000000000..9dd896272 --- /dev/null +++ b/templates/global_docker_compose.yml.mustache @@ -0,0 +1,55 @@ +version: '3' + +services: + +{{#services}} + {{name}}: + container_name: {{container_name}} + image: {{image}} + {{#ports.0}} + ports: + {{#ports}} + - "{{.}}" + {{/ports}} + {{/ports.0}} + {{#depends_on}} + depends_on: + - {{.}} + {{/depends_on}} + {{#restart}} + restart: {{.}} + {{/restart}} + {{#command}} + command: {{.}} + {{/command}} + {{#labels.0}} + labels: + {{#labels}} + - "{{.}}" + {{/labels}} + {{/labels.0}} + {{#volumes.0}} + volumes: + {{#volumes}} + - "{{.}}" + {{/volumes}} + {{/volumes.0}} + {{#environment.0}} + environment: + {{#environment}} + - {{.}} + {{/environment}} + {{/environment.0}} + {{#networks.0}} + networks: + {{#networks}} + - {{.}} + {{/networks}} + {{/networks.0}} +{{/services}} + +networks: + site-network: + global-network: + external: + name: ee-global-network From f4bbc1b1f63142b454317618f3bef3f9c64baeb0 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Fri, 24 Aug 2018 14:11:17 +0530 Subject: [PATCH 0427/1044] Remove setup_site_network function Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/site-utils.php | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/php/site-utils.php b/php/site-utils.php index 914a1e81a..c582ebdda 100644 --- a/php/site-utils.php +++ b/php/site-utils.php @@ -139,7 +139,6 @@ function generate_global_docker_compose_yml( Filesystem $fs ) { ], 'networks' => [ 'global-network', - 'site-network', ], ], ]; @@ -168,26 +167,6 @@ function create_site_root( $site_root, $site_name ) { $fs->chown( $site_root, $terminal_username ); } -/** - * Function to setup site network. - * - * @param string $site_name Name of the site. - * - * @throws \Exception when network start fails. - */ -function setup_site_network( $site_name ) { - - $proxy_type = EE_PROXY_TYPE; - if ( EE::docker()::create_network( $site_name ) ) { - EE::success( 'Network started.' ); - } else { - throw new \Exception( 'There was some error in starting the network.' ); - } - - EE::docker()::connect_site_network_to( $site_name, $proxy_type ); - -} - /** * Reloads configuration of ee-nginx-proxy container * From fa6e52ed7ed483b3179af850d072472a66253f74 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Fri, 24 Aug 2018 14:12:25 +0530 Subject: [PATCH 0428/1044] Modify site delete logic Remove site network disconnection and site network remove(now will be handled by docker-compose) Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/class-ee-site.php | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/php/class-ee-site.php b/php/class-ee-site.php index 771c28952..1dcbae7a1 100644 --- a/php/class-ee-site.php +++ b/php/class-ee-site.php @@ -149,18 +149,6 @@ protected function delete_site( $level, $site_name, $site_root ) { EE::warning( 'Error in removing docker containers.' ); } } - - EE::docker()::disconnect_site_network_from( $site_name, $proxy_type ); - } - - if ( $level >= 2 ) { - if ( EE::docker()::rm_network( $site_name ) ) { - EE::log( "[$site_name] Docker container removed from network $proxy_type." ); - } else { - if ( $level > 2 ) { - EE::warning( "Error in removing Docker container from network $proxy_type" ); - } - } } if ( $this->fs->exists( $site_root ) ) { From 1f282348dbb20a3d78914ad34210d1371f0d64da Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Fri, 24 Aug 2018 14:12:54 +0530 Subject: [PATCH 0429/1044] Remove site-network from global docker-compose Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- templates/global_docker_compose.yml.mustache | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/global_docker_compose.yml.mustache b/templates/global_docker_compose.yml.mustache index 9dd896272..9833abcac 100644 --- a/templates/global_docker_compose.yml.mustache +++ b/templates/global_docker_compose.yml.mustache @@ -49,7 +49,6 @@ services: {{/services}} networks: - site-network: global-network: external: name: ee-global-network From e7b052217c10185766ba50d283ee3c86c1becb84 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Fri, 24 Aug 2018 14:14:57 +0530 Subject: [PATCH 0430/1044] Use EE::docker()::create_network() function Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/site-utils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/site-utils.php b/php/site-utils.php index c582ebdda..447ebceb3 100644 --- a/php/site-utils.php +++ b/php/site-utils.php @@ -95,7 +95,7 @@ function init_checks() { $EE_CONF_ROOT = EE_CONF_ROOT; if ( ! EE::docker()::docker_network_exists( 'ee-global-network' ) ) { - if ( ! EE::exec( 'docker network create ee-global-network' ) ) { + if ( ! EE::docker()::create_network( 'ee-global-network' ) ) { EE::error( 'Unable to create network ee-global-network' ); } } From 510ab3e9db7cd44c9b259b4df872fef6800bbbc9 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Fri, 24 Aug 2018 16:43:02 +0530 Subject: [PATCH 0431/1044] Remove space Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/site-utils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/site-utils.php b/php/site-utils.php index 447ebceb3..289077d06 100644 --- a/php/site-utils.php +++ b/php/site-utils.php @@ -128,7 +128,7 @@ function generate_global_docker_compose_yml( Filesystem $fs ) { 'LOCAL_GROUP_ID=' . posix_getegid(), ], 'volumes' => [ - EE_CONF_ROOT . '/nginx/certs:/etc/nginx/certs ', + EE_CONF_ROOT . '/nginx/certs:/etc/nginx/certs', EE_CONF_ROOT . '/nginx/dhparam:/etc/nginx/dhparam', EE_CONF_ROOT . '/nginx/conf.d:/etc/nginx/conf.d', EE_CONF_ROOT . '/nginx/htpasswd:/etc/nginx/htpasswd', From 9544bddcb1947998ad87cebfaaf0be4a062c03d6 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Fri, 24 Aug 2018 18:14:44 +0530 Subject: [PATCH 0432/1044] Add comments in function Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/class-ee-docker.php | 7 +++++++ php/site-utils.php | 7 ++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php index 3569797fe..400baca1f 100644 --- a/php/class-ee-docker.php +++ b/php/class-ee-docker.php @@ -171,6 +171,13 @@ public static function docker_compose_up( $dir, $services = [] ) { return false; } + /** + * Function to check if a network exists + * + * @param string $network Name/ID of network to check + * + * @return bool Network exists or not + */ public static function docker_network_exists( string $network ) { return EE::exec( "docker network inspect $network" ); } diff --git a/php/site-utils.php b/php/site-utils.php index 289077d06..2c6d269a3 100644 --- a/php/site-utils.php +++ b/php/site-utils.php @@ -109,7 +109,11 @@ function init_checks() { } } - +/** + * Generates global docker-compose.yml at EE_CONF_ROOT + * + * @param Filesystem $fs Filesystem object to write file + */ function generate_global_docker_compose_yml( Filesystem $fs ) { $img_versions = EE\Utils\get_image_versions(); @@ -142,6 +146,7 @@ function generate_global_docker_compose_yml( Filesystem $fs ) { ], ], ]; + $contents = EE\Utils\mustache_render( EE_ROOT . '/templates/global_docker_compose.yml.mustache', $data ); $fs->dumpFile( EE_CONF_ROOT . '/docker-compose.yml', $contents ); } From dd2b55629f7e10ca5ac7452fdbc6ce4811072d37 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Fri, 24 Aug 2018 20:16:13 +0530 Subject: [PATCH 0433/1044] Remove /app/ee4 from nginx-proxy Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/site-utils.php | 1 - 1 file changed, 1 deletion(-) diff --git a/php/site-utils.php b/php/site-utils.php index 2c6d269a3..1aaed7f52 100644 --- a/php/site-utils.php +++ b/php/site-utils.php @@ -137,7 +137,6 @@ function generate_global_docker_compose_yml( Filesystem $fs ) { EE_CONF_ROOT . '/nginx/conf.d:/etc/nginx/conf.d', EE_CONF_ROOT . '/nginx/htpasswd:/etc/nginx/htpasswd', EE_CONF_ROOT . '/nginx/vhost.d:/etc/nginx/vhost.d', - EE_CONF_ROOT . ':/app/ee4', '/usr/share/nginx/html', '/var/run/docker.sock:/tmp/docker.sock:ro', ], From 277b534ea01ce153264cdca5c2726089bfe08e28 Mon Sep 17 00:00:00 2001 From: Thrijith Thankachan <thrijith13@gmail.com> Date: Mon, 27 Aug 2018 17:45:57 +0530 Subject: [PATCH 0434/1044] Add vendor label in network creation --- php/class-ee-docker.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php index 400baca1f..d623b2b15 100644 --- a/php/class-ee-docker.php +++ b/php/class-ee-docker.php @@ -84,7 +84,7 @@ public static function restart_container( $container ) { * @return bool success. */ public static function create_network( $name ) { - return EE::exec( "docker network create $name" ); + return EE::exec( "docker network create $name --label=org.label-schema.vendor=\"EasyEngine\" " ); } /** From 5aeb6ea3593c31a65515aa59cb53abe1ac229ad9 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Mon, 27 Aug 2018 18:30:56 +0530 Subject: [PATCH 0435/1044] Update docker-compose.yml and .travis.yml Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- .travis.yml | 6 ++++++ templates/global_docker_compose.yml.mustache | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 62f2b5d61..5e218271c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,7 @@ env: - PATH="$TRAVIS_BUILD_DIR/vendor/bin:$PATH" before_install: + - sudo curl -L https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose - | # Remove Xdebug for a huge performance increase: if [ -f ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini ]; then @@ -62,3 +63,8 @@ notifications: email: on_success: never on_failure: change + +addons: + apt: + packages: + - docker-ce diff --git a/templates/global_docker_compose.yml.mustache b/templates/global_docker_compose.yml.mustache index 9833abcac..bb231c723 100644 --- a/templates/global_docker_compose.yml.mustache +++ b/templates/global_docker_compose.yml.mustache @@ -1,4 +1,4 @@ -version: '3' +version: '3.5' services: From 457a3ecab2808fd1200daa58e4169c3204b6d765 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 28 Aug 2018 17:03:14 +0530 Subject: [PATCH 0436/1044] Move AcmePhp from core to site-command Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- .../Cli/Exception/AcmeCliActionException.php | 23 - .../Cli/Exception/AcmeCliException.php | 23 - .../Exception/AcmeDnsResolutionException.php | 23 - .../Cli/Exception/CommandFlowException.php | 55 --- php/AcmePhp/Cli/Repository/Repository.php | 439 ------------------ .../Cli/Repository/RepositoryInterface.php | 198 -------- .../Cli/Repository/RepositoryV2Interface.php | 51 -- php/AcmePhp/Cli/Serializer/PemEncoder.php | 55 --- php/AcmePhp/Cli/Serializer/PemNormalizer.php | 55 --- 9 files changed, 922 deletions(-) delete mode 100644 php/AcmePhp/Cli/Exception/AcmeCliActionException.php delete mode 100644 php/AcmePhp/Cli/Exception/AcmeCliException.php delete mode 100644 php/AcmePhp/Cli/Exception/AcmeDnsResolutionException.php delete mode 100644 php/AcmePhp/Cli/Exception/CommandFlowException.php delete mode 100644 php/AcmePhp/Cli/Repository/Repository.php delete mode 100644 php/AcmePhp/Cli/Repository/RepositoryInterface.php delete mode 100644 php/AcmePhp/Cli/Repository/RepositoryV2Interface.php delete mode 100644 php/AcmePhp/Cli/Serializer/PemEncoder.php delete mode 100644 php/AcmePhp/Cli/Serializer/PemNormalizer.php diff --git a/php/AcmePhp/Cli/Exception/AcmeCliActionException.php b/php/AcmePhp/Cli/Exception/AcmeCliActionException.php deleted file mode 100644 index a18f3e6f4..000000000 --- a/php/AcmePhp/Cli/Exception/AcmeCliActionException.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -/* - * This file is part of the Acme PHP project. - * - * (c) Titouan Galopin <galopintitouan@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace AcmePhp\Cli\Exception; - -/** - * @author Titouan Galopin <galopintitouan@gmail.com> - */ -class AcmeCliActionException extends AcmeCliException -{ - public function __construct($actionName, \Exception $previous = null) - { - parent::__construct(sprintf('An exception was thrown during action "%s"', $actionName), $previous); - } -} diff --git a/php/AcmePhp/Cli/Exception/AcmeCliException.php b/php/AcmePhp/Cli/Exception/AcmeCliException.php deleted file mode 100644 index b5f4c0c7d..000000000 --- a/php/AcmePhp/Cli/Exception/AcmeCliException.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -/* - * This file is part of the Acme PHP project. - * - * (c) Titouan Galopin <galopintitouan@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace AcmePhp\Cli\Exception; - -/** - * @author Titouan Galopin <galopintitouan@gmail.com> - */ -class AcmeCliException extends \RuntimeException -{ - public function __construct($message, \Exception $previous = null) - { - parent::__construct($message, 0, $previous); - } -} diff --git a/php/AcmePhp/Cli/Exception/AcmeDnsResolutionException.php b/php/AcmePhp/Cli/Exception/AcmeDnsResolutionException.php deleted file mode 100644 index a1137999b..000000000 --- a/php/AcmePhp/Cli/Exception/AcmeDnsResolutionException.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -/* - * This file is part of the Acme PHP project. - * - * (c) Titouan Galopin <galopintitouan@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace AcmePhp\Cli\Exception; - -/** - * @author Jérémy Derussé <jeremy@derusse.com> - */ -class AcmeDnsResolutionException extends AcmeCliException -{ - public function __construct($message, \Exception $previous = null) - { - parent::__construct(null === $message ? 'An exception was thrown during resolution of DNS' : $message, $previous); - } -} diff --git a/php/AcmePhp/Cli/Exception/CommandFlowException.php b/php/AcmePhp/Cli/Exception/CommandFlowException.php deleted file mode 100644 index f03b5b295..000000000 --- a/php/AcmePhp/Cli/Exception/CommandFlowException.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -/* - * This file is part of the Acme PHP project. - * - * (c) Titouan Galopin <galopintitouan@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace AcmePhp\Cli\Exception; - -/** - * @author Jérémy Derussé <jeremy@derusse.com> - */ -class CommandFlowException extends AcmeCliException -{ - /** - * @var string - */ - private $missing; - /** - * @var string - */ - private $command; - /** - * @var array - */ - private $arguments; - - /** - * @param string $missing Missing requirement to fix the flow - * @param string $command Name of the command to run in order to fix the flow - * @param array $arguments Optional list of missing arguments - * @param \Exception|null $previous - */ - public function __construct($missing, $command, array $arguments = [], \Exception $previous = null) - { - $this->missing = $missing; - $this->command = $command; - $this->arguments = $arguments; - - $message = trim(sprintf( - 'You have to %s first. Run the command%sphp %s %s %s', - $missing, - PHP_EOL.PHP_EOL, - $_SERVER['PHP_SELF'], - $command, - implode(' ', $arguments) - )); - - parent::__construct($message, $previous); - } -} diff --git a/php/AcmePhp/Cli/Repository/Repository.php b/php/AcmePhp/Cli/Repository/Repository.php deleted file mode 100644 index 29a54c189..000000000 --- a/php/AcmePhp/Cli/Repository/Repository.php +++ /dev/null @@ -1,439 +0,0 @@ -<?php - -/* - * This file is part of the Acme PHP project. - * - * (c) Titouan Galopin <galopintitouan@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace AcmePhp\Cli\Repository; - -use AcmePhp\Cli\Exception\AcmeCliException; -use AcmePhp\Cli\Serializer\PemEncoder; -use AcmePhp\Core\Protocol\AuthorizationChallenge; -use AcmePhp\Core\Protocol\CertificateOrder; -use AcmePhp\Ssl\Certificate; -use AcmePhp\Ssl\CertificateResponse; -use AcmePhp\Ssl\DistinguishedName; -use AcmePhp\Ssl\KeyPair; -use AcmePhp\Ssl\PrivateKey; -use AcmePhp\Ssl\PublicKey; -use League\Flysystem\FilesystemInterface; -use Symfony\Component\Serializer\Encoder\JsonEncoder; -use Symfony\Component\Serializer\SerializerInterface; - -/** - * @author Titouan Galopin <galopintitouan@gmail.com> - */ -class Repository implements RepositoryV2Interface -{ - const PATH_ACCOUNT_KEY_PRIVATE = 'account/key.private.pem'; - const PATH_ACCOUNT_KEY_PUBLIC = 'account/key.public.pem'; - - const PATH_DOMAIN_KEY_PUBLIC = 'certs/{domain}/private/key.public.pem'; - const PATH_DOMAIN_KEY_PRIVATE = 'certs/{domain}/private/key.private.pem'; - const PATH_DOMAIN_CERT_CERT = 'certs/{domain}/public/cert.pem'; - const PATH_DOMAIN_CERT_CHAIN = 'certs/{domain}/public/chain.pem'; - const PATH_DOMAIN_CERT_FULLCHAIN = 'certs/{domain}/public/fullchain.pem'; - const PATH_DOMAIN_CERT_COMBINED = 'certs/{domain}/private/combined.pem'; - - const PATH_CACHE_AUTHORIZATION_CHALLENGE = 'var/{domain}/authorization_challenge.json'; - const PATH_CACHE_DISTINGUISHED_NAME = 'var/{domain}/distinguished_name.json'; - const PATH_CACHE_CERTIFICATE_ORDER = 'var/{domains}/certificate_order.json'; - - /** - * @var SerializerInterface - */ - private $serializer; - - /** - * @var FilesystemInterface - */ - private $master; - - /** - * @var FilesystemInterface - */ - private $backup; - - /** - * @var bool - */ - private $enableBackup; - - /** - * @param SerializerInterface $serializer - * @param FilesystemInterface $master - * @param FilesystemInterface $backup - * @param bool $enableBackup - */ - public function __construct(SerializerInterface $serializer, FilesystemInterface $master, FilesystemInterface $backup, $enableBackup) - { - $this->serializer = $serializer; - $this->master = $master; - $this->backup = $backup; - $this->enableBackup = $enableBackup; - } - - /** - * {@inheritdoc} - */ - public function storeCertificateResponse(CertificateResponse $certificateResponse) - { - $distinguishedName = $certificateResponse->getCertificateRequest()->getDistinguishedName(); - $domain = $distinguishedName->getCommonName(); - - $this->storeDomainKeyPair($domain, $certificateResponse->getCertificateRequest()->getKeyPair()); - $this->storeDomainDistinguishedName($domain, $distinguishedName); - $this->storeDomainCertificate($domain, $certificateResponse->getCertificate()); - } - - /** - * {@inheritdoc} - */ - public function storeAccountKeyPair(KeyPair $keyPair) - { - try { - $this->save( - self::PATH_ACCOUNT_KEY_PUBLIC, - $this->serializer->serialize($keyPair->getPublicKey(), PemEncoder::FORMAT) - ); - - $this->save( - self::PATH_ACCOUNT_KEY_PRIVATE, - $this->serializer->serialize($keyPair->getPrivateKey(), PemEncoder::FORMAT) - ); - } catch (\Exception $e) { - throw new AcmeCliException('Storing of account key pair failed', $e); - } - } - - private function getPathForDomain($path, $domain) - { - return strtr($path, ['{domain}' => $this->normalizeDomain($domain)]); - } - - private function getPathForDomainList($path, array $domains) - { - return strtr($path, ['{domains}' => $this->normalizeDomainList($domains)]); - } - - /** - * {@inheritdoc} - */ - public function hasAccountKeyPair() - { - return $this->master->has(self::PATH_ACCOUNT_KEY_PRIVATE); - } - - /** - * {@inheritdoc} - */ - public function loadAccountKeyPair() - { - try { - $publicKeyPem = $this->master->read(self::PATH_ACCOUNT_KEY_PUBLIC); - $privateKeyPem = $this->master->read(self::PATH_ACCOUNT_KEY_PRIVATE); - - return new KeyPair( - $this->serializer->deserialize($publicKeyPem, PublicKey::class, PemEncoder::FORMAT), - $this->serializer->deserialize($privateKeyPem, PrivateKey::class, PemEncoder::FORMAT) - ); - } catch (\Exception $e) { - throw new AcmeCliException('Loading of account key pair failed', $e); - } - } - - /** - * {@inheritdoc} - */ - public function storeDomainKeyPair($domain, KeyPair $keyPair) - { - try { - $this->save( - $this->getPathForDomain(self::PATH_DOMAIN_KEY_PUBLIC, $domain), - $this->serializer->serialize($keyPair->getPublicKey(), PemEncoder::FORMAT) - ); - - $this->save( - $this->getPathForDomain(self::PATH_DOMAIN_KEY_PRIVATE, $domain), - $this->serializer->serialize($keyPair->getPrivateKey(), PemEncoder::FORMAT) - ); - } catch (\Exception $e) { - throw new AcmeCliException(sprintf('Storing of domain %s key pair failed', $domain), $e); - } - } - - /** - * {@inheritdoc} - */ - public function hasDomainKeyPair($domain) - { - return $this->master->has($this->getPathForDomain(self::PATH_DOMAIN_KEY_PRIVATE, $domain)); - } - - /** - * {@inheritdoc} - */ - public function loadDomainKeyPair($domain) - { - try { - $publicKeyPem = $this->master->read($this->getPathForDomain(self::PATH_DOMAIN_KEY_PUBLIC, $domain)); - $privateKeyPem = $this->master->read($this->getPathForDomain(self::PATH_DOMAIN_KEY_PRIVATE, $domain)); - - return new KeyPair( - $this->serializer->deserialize($publicKeyPem, PublicKey::class, PemEncoder::FORMAT), - $this->serializer->deserialize($privateKeyPem, PrivateKey::class, PemEncoder::FORMAT) - ); - } catch (\Exception $e) { - throw new AcmeCliException(sprintf('Loading of domain %s key pair failed', $domain), $e); - } - } - - /** - * {@inheritdoc} - */ - public function storeDomainAuthorizationChallenge($domain, AuthorizationChallenge $authorizationChallenge) - { - try { - $this->save( - $this->getPathForDomain(self::PATH_CACHE_AUTHORIZATION_CHALLENGE, $domain), - $this->serializer->serialize($authorizationChallenge, JsonEncoder::FORMAT) - ); - } catch (\Exception $e) { - throw new AcmeCliException(sprintf('Storing of domain %s authorization challenge failed', $domain), $e); - } - } - - /** - * {@inheritdoc} - */ - public function hasDomainAuthorizationChallenge($domain) - { - return $this->master->has($this->getPathForDomain(self::PATH_CACHE_AUTHORIZATION_CHALLENGE, $domain)); - } - - /** - * {@inheritdoc} - */ - public function loadDomainAuthorizationChallenge($domain) - { - try { - $json = $this->master->read($this->getPathForDomain(self::PATH_CACHE_AUTHORIZATION_CHALLENGE, $domain)); - - return $this->serializer->deserialize($json, AuthorizationChallenge::class, JsonEncoder::FORMAT); - } catch (\Exception $e) { - throw new AcmeCliException(sprintf('Loading of domain %s authorization challenge failed', $domain), $e); - } - } - - /** - * {@inheritdoc} - */ - public function storeDomainDistinguishedName($domain, DistinguishedName $distinguishedName) - { - try { - $this->save( - $this->getPathForDomain(self::PATH_CACHE_DISTINGUISHED_NAME, $domain), - $this->serializer->serialize($distinguishedName, JsonEncoder::FORMAT) - ); - } catch (\Exception $e) { - throw new AcmeCliException(sprintf('Storing of domain %s distinguished name failed', $domain), $e); - } - } - - /** - * {@inheritdoc} - */ - public function hasDomainDistinguishedName($domain) - { - return $this->master->has($this->getPathForDomain(self::PATH_CACHE_DISTINGUISHED_NAME, $domain)); - } - - /** - * {@inheritdoc} - */ - public function loadDomainDistinguishedName($domain) - { - try { - $json = $this->master->read($this->getPathForDomain(self::PATH_CACHE_DISTINGUISHED_NAME, $domain)); - - return $this->serializer->deserialize($json, DistinguishedName::class, JsonEncoder::FORMAT); - } catch (\Exception $e) { - throw new AcmeCliException(sprintf('Loading of domain %s distinguished name failed', $domain), $e); - } - } - - /** - * {@inheritdoc} - */ - public function storeDomainCertificate($domain, Certificate $certificate) - { - // Simple certificate - $certPem = $this->serializer->serialize($certificate, PemEncoder::FORMAT); - - // Issuer chain - $issuerChain = []; - $issuerCertificate = $certificate->getIssuerCertificate(); - - while (null !== $issuerCertificate) { - $issuerChain[] = $this->serializer->serialize($issuerCertificate, PemEncoder::FORMAT); - $issuerCertificate = $issuerCertificate->getIssuerCertificate(); - } - - $chainPem = implode("\n", $issuerChain); - - // Full chain - $fullChainPem = $certPem.$chainPem; - - // Combined - $keyPair = $this->loadDomainKeyPair($domain); - $combinedPem = $fullChainPem.$this->serializer->serialize($keyPair->getPrivateKey(), PemEncoder::FORMAT); - - // Save - $this->save($this->getPathForDomain(self::PATH_DOMAIN_CERT_CERT, $domain), $certPem); - $this->save($this->getPathForDomain(self::PATH_DOMAIN_CERT_CHAIN, $domain), $chainPem); - $this->save($this->getPathForDomain(self::PATH_DOMAIN_CERT_FULLCHAIN, $domain), $fullChainPem); - $this->save($this->getPathForDomain(self::PATH_DOMAIN_CERT_COMBINED, $domain), $combinedPem); - } - - /** - * {@inheritdoc} - */ - public function hasDomainCertificate($domain) - { - return $this->master->has($this->getPathForDomain(self::PATH_DOMAIN_CERT_FULLCHAIN, $domain)); - } - - /** - * {@inheritdoc} - */ - public function loadDomainCertificate($domain) - { - try { - $pems = explode('-----BEGIN CERTIFICATE-----', $this->master->read($this->getPathForDomain(self::PATH_DOMAIN_CERT_FULLCHAIN, $domain))); - } catch (\Exception $e) { - throw new AcmeCliException(sprintf('Loading of domain %s certificate failed', $domain), $e); - } - - $pems = array_map(function ($item) { - return trim(str_replace('-----END CERTIFICATE-----', '', $item)); - }, $pems); - array_shift($pems); - $pems = array_reverse($pems); - - $certificate = null; - - foreach ($pems as $pem) { - $certificate = new Certificate( - "-----BEGIN CERTIFICATE-----\n".$pem."\n-----END CERTIFICATE-----", - $certificate - ); - } - - return $certificate; - } - - /** - * {@inheritdoc} - */ - public function storeCertificateOrder(array $domains, CertificateOrder $order) - { - try { - $this->save( - $this->getPathForDomainList(self::PATH_CACHE_CERTIFICATE_ORDER, $domains), - $this->serializer->serialize($order, JsonEncoder::FORMAT) - ); - } catch (\Exception $e) { - throw new AcmeCliException(sprintf('Storing of domains %s certificate order failed', implode(', ', $domains)), $e); - } - } - - /** - * {@inheritdoc} - */ - public function hasCertificateOrder(array $domains) - { - return $this->master->has($this->getPathForDomainList(self::PATH_CACHE_CERTIFICATE_ORDER, $domains)); - } - - /** - * {@inheritdoc} - */ - public function loadCertificateOrder(array $domains) - { - try { - $json = $this->master->read($this->getPathForDomainList(self::PATH_CACHE_CERTIFICATE_ORDER, $domains)); - - return $this->serializer->deserialize($json, CertificateOrder::class, JsonEncoder::FORMAT); - } catch (\Exception $e) { - throw new AcmeCliException(sprintf('Loading of domains %s certificate order failed', implode(', ', $domains)), $e); - } - } - - /** - * {@inheritdoc} - */ - public function save($path, $content, $visibility = self::VISIBILITY_PRIVATE) - { - if (!$this->master->has($path)) { - // File creation: remove from backup if it existed and warm-up both master and backup - $this->createAndBackup($path, $content); - } else { - // File update: backup before writing - $this->backupAndUpdate($path, $content); - } - - if ($this->enableBackup) { - $this->backup->setVisibility($path, $visibility); - } - - $this->master->setVisibility($path, $visibility); - } - - private function createAndBackup($path, $content) - { - if ($this->enableBackup) { - if ($this->backup->has($path)) { - $this->backup->delete($path); - } - - $this->backup->write($path, $content); - } - - $this->master->write($path, $content); - } - - private function backupAndUpdate($path, $content) - { - if ($this->enableBackup) { - $oldContent = $this->master->read($path); - - if (false !== $oldContent) { - if ($this->backup->has($path)) { - $this->backup->update($path, $oldContent); - } else { - $this->backup->write($path, $oldContent); - } - } - } - - $this->master->update($path, $content); - } - - private function normalizeDomain($domain) - { - return $domain; - } - - private function normalizeDomainList(array $domains) - { - $normalizedDomains = array_unique(array_map([$this, 'normalizeDomain'], $domains)); - sort($normalizedDomains); - - return (isset($domains[0]) ? $this->normalizeDomain($domains[0]) : '-').'/'.sha1(json_encode($normalizedDomains)); - } -} diff --git a/php/AcmePhp/Cli/Repository/RepositoryInterface.php b/php/AcmePhp/Cli/Repository/RepositoryInterface.php deleted file mode 100644 index f42c5277c..000000000 --- a/php/AcmePhp/Cli/Repository/RepositoryInterface.php +++ /dev/null @@ -1,198 +0,0 @@ -<?php - -/* - * This file is part of the Acme PHP project. - * - * (c) Titouan Galopin <galopintitouan@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace AcmePhp\Cli\Repository; - -use AcmePhp\Cli\Exception\AcmeCliException; -use AcmePhp\Core\Protocol\AuthorizationChallenge; -use AcmePhp\Ssl\Certificate; -use AcmePhp\Ssl\CertificateResponse; -use AcmePhp\Ssl\DistinguishedName; -use AcmePhp\Ssl\KeyPair; - -/** - * @author Titouan Galopin <galopintitouan@gmail.com> - */ -interface RepositoryInterface -{ - const VISIBILITY_PUBLIC = 'public'; - const VISIBILITY_PRIVATE = 'private'; - - /** - * Extract important elements from the given certificate response and store them - * in the repository. - * - * This method will use the distinguished name common name as a domain to store: - * - the key pair - * - the certificate request - * - the certificate - * - * @param CertificateResponse $certificateResponse - * - * @throws AcmeCliException - */ - public function storeCertificateResponse(CertificateResponse $certificateResponse); - - /** - * Store a given key pair as the account key pair (the global key pair used to - * interact with the ACME server). - * - * @param KeyPair $keyPair - * - * @throws AcmeCliException - */ - public function storeAccountKeyPair(KeyPair $keyPair); - - /** - * Check if there is an account key pair in the repository. - * - * @return bool - */ - public function hasAccountKeyPair(); - - /** - * Load the account key pair. - * - * @throws AcmeCliException - * - * @return KeyPair - */ - public function loadAccountKeyPair(); - - /** - * Store a given key pair as associated to a given domain. - * - * @param string $domain - * @param KeyPair $keyPair - * - * @throws AcmeCliException - */ - public function storeDomainKeyPair($domain, KeyPair $keyPair); - - /** - * Check if there is a key pair associated to the given domain in the repository. - * - * @param string $domain - * - * @return bool - */ - public function hasDomainKeyPair($domain); - - /** - * Load the key pair associated to a given domain. - * - * @param string $domain - * - * @throws AcmeCliException - * - * @return KeyPair - */ - public function loadDomainKeyPair($domain); - - /** - * Store a given authorization challenge as associated to a given domain. - * - * @param string $domain - * @param AuthorizationChallenge $authorizationChallenge - * - * @throws AcmeCliException - */ - public function storeDomainAuthorizationChallenge($domain, AuthorizationChallenge $authorizationChallenge); - - /** - * Check if there is an authorization challenge associated to the given domain in the repository. - * - * @param string $domain - * - * @return bool - */ - public function hasDomainAuthorizationChallenge($domain); - - /** - * Load the authorization challenge associated to a given domain. - * - * @param string $domain - * - * @throws AcmeCliException - * - * @return AuthorizationChallenge - */ - public function loadDomainAuthorizationChallenge($domain); - - /** - * Store a given distinguished name as associated to a given domain. - * - * @param string $domain - * @param DistinguishedName $distinguishedName - * - * @throws AcmeCliException - */ - public function storeDomainDistinguishedName($domain, DistinguishedName $distinguishedName); - - /** - * Check if there is a distinguished name associated to the given domain in the repository. - * - * @param string $domain - * - * @return bool - */ - public function hasDomainDistinguishedName($domain); - - /** - * Load the distinguished name associated to a given domain. - * - * @param string $domain - * - * @throws AcmeCliException - * - * @return DistinguishedName - */ - public function loadDomainDistinguishedName($domain); - - /** - * Store a given certificate as associated to a given domain. - * - * @param string $domain - * @param Certificate $certificate - * - * @throws AcmeCliException - */ - public function storeDomainCertificate($domain, Certificate $certificate); - - /** - * Check if there is a certificate associated to the given domain in the repository. - * - * @param string $domain - * - * @return bool - */ - public function hasDomainCertificate($domain); - - /** - * Load the certificate associated to a given domain. - * - * @param string $domain - * - * @throws AcmeCliException - * - * @return Certificate - */ - public function loadDomainCertificate($domain); - - /** - * Save a given string into a given path handling backup. - * - * @param string $path - * @param string $content - * @param string $visibility the visibilty to use for this file - */ - public function save($path, $content, $visibility = self::VISIBILITY_PRIVATE); -} diff --git a/php/AcmePhp/Cli/Repository/RepositoryV2Interface.php b/php/AcmePhp/Cli/Repository/RepositoryV2Interface.php deleted file mode 100644 index f3b67e032..000000000 --- a/php/AcmePhp/Cli/Repository/RepositoryV2Interface.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php - -/* - * This file is part of the Acme PHP project. - * - * (c) Titouan Galopin <galopintitouan@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace AcmePhp\Cli\Repository; - -use AcmePhp\Cli\Exception\AcmeCliException; -use AcmePhp\Core\Protocol\CertificateOrder; - -/** - * @author Titouan Galopin <galopintitouan@gmail.com> - */ -interface RepositoryV2Interface extends RepositoryInterface -{ - /** - * Store a given certificate as associated to a given domain. - * - * @param array $domains - * @param CertificateOrder $order - * - * @throws AcmeCliException - */ - public function storeCertificateOrder(array $domains, CertificateOrder $order); - - /** - * Check if there is a certificate associated to the given domain in the repository. - * - * @param string $domain - * - * @return bool - */ - public function hasCertificateOrder(array $domains); - - /** - * Load the certificate associated to a given domain. - * - * @param string $domain - * - * @throws AcmeCliException - * - * @return CertificateOrder - */ - public function loadCertificateOrder(array $domains); -} diff --git a/php/AcmePhp/Cli/Serializer/PemEncoder.php b/php/AcmePhp/Cli/Serializer/PemEncoder.php deleted file mode 100644 index 01d3a15dd..000000000 --- a/php/AcmePhp/Cli/Serializer/PemEncoder.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -/* - * This file is part of the Acme PHP project. - * - * (c) Titouan Galopin <galopintitouan@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace AcmePhp\Cli\Serializer; - -use Symfony\Component\Serializer\Encoder\DecoderInterface; -use Symfony\Component\Serializer\Encoder\EncoderInterface; - -/** - * @author Titouan Galopin <galopintitouan@gmail.com> - */ -class PemEncoder implements EncoderInterface, DecoderInterface -{ - const FORMAT = 'pem'; - - /** - * {@inheritdoc} - */ - public function encode($data, $format, array $context = []) - { - return trim($data)."\n"; - } - - /** - * {@inheritdoc} - */ - public function decode($data, $format, array $context = []) - { - return trim($data)."\n"; - } - - /** - * {@inheritdoc} - */ - public function supportsEncoding($format) - { - return self::FORMAT === $format; - } - - /** - * {@inheritdoc} - */ - public function supportsDecoding($format) - { - return self::FORMAT === $format; - } -} diff --git a/php/AcmePhp/Cli/Serializer/PemNormalizer.php b/php/AcmePhp/Cli/Serializer/PemNormalizer.php deleted file mode 100644 index 564f1b937..000000000 --- a/php/AcmePhp/Cli/Serializer/PemNormalizer.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -/* - * This file is part of the Acme PHP project. - * - * (c) Titouan Galopin <galopintitouan@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace AcmePhp\Cli\Serializer; - -use AcmePhp\Ssl\Certificate; -use AcmePhp\Ssl\Key; -use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; -use Symfony\Component\Serializer\Normalizer\NormalizerInterface; - -/** - * @author Titouan Galopin <galopintitouan@gmail.com> - */ -class PemNormalizer implements NormalizerInterface, DenormalizerInterface -{ - /** - * {@inheritdoc} - */ - public function normalize($object, $format = null, array $context = []) - { - return $object->getPEM(); - } - - /** - * {@inheritdoc} - */ - public function denormalize($data, $class, $format = null, array $context = []) - { - return new $class($data); - } - - /** - * {@inheritdoc} - */ - public function supportsNormalization($data, $format = null) - { - return is_object($data) && ($data instanceof Certificate || $data instanceof Key); - } - - /** - * {@inheritdoc} - */ - public function supportsDenormalization($data, $type, $format = null) - { - return is_string($data); - } -} From ade4049fc210c4b5c17a1377433fa5ac43ce25bd Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 28 Aug 2018 17:04:51 +0530 Subject: [PATCH 0437/1044] Remove site-type routing from core Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Bootstrap/LoadSiteUtilityFunctions.php | 28 -------- php/EE/Runner.php | 66 +------------------ php/bootstrap.php | 1 - 3 files changed, 1 insertion(+), 94 deletions(-) delete mode 100644 php/EE/Bootstrap/LoadSiteUtilityFunctions.php diff --git a/php/EE/Bootstrap/LoadSiteUtilityFunctions.php b/php/EE/Bootstrap/LoadSiteUtilityFunctions.php deleted file mode 100644 index 87827cff3..000000000 --- a/php/EE/Bootstrap/LoadSiteUtilityFunctions.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -namespace EE\Bootstrap; - -/** - * Class LoadSiteUtilityFunctions. - * - * Loads the functions available through `EE\SiteUtils`. - * - * @package EE\Bootstrap - */ -final class LoadSiteUtilityFunctions implements BootstrapStep { - - /** - * Process this single bootstrapping step. - * - * @param BootstrapState $state Contextual state to pass into the step. - * - * @return BootstrapState Modified state to pass to the next step. - */ - public function process( BootstrapState $state ) { - require_once EE_ROOT . '/php/site-utils.php'; - require_once EE_ROOT . '/php/class-ee-site-letsencrypt.php'; - require_once EE_ROOT . '/php/class-ee-site-shutdown-handler.php'; - - return $state; - } -} diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 765c1d16b..f1c59026c 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -689,74 +689,10 @@ private function set_alias( $alias ) { } } - public function route() { + public function start() { $this->init_ee(); - // Run routing only for `site` command. - if ( ! isset( $this->arguments[0] ) || 'site' !== $this->arguments[0] ) { - return; - } - - if ( isset( $this->assoc_args['type'] ) ) { - - $key = array_search( 'site', $this->arguments ); - $new_args = $this->arguments; - $new_args[ $key ] = $this->assoc_args['type']; - - // Check if the type is not default html and then search for a command registered with the type. - if ( ( 'html' !== $this->assoc_args['type'] ) && is_array( $this->find_command_to_run( $new_args ) ) ) { - // If the command with type is found. Update the arguments and replace `site` with value of type. - $this->arguments = $new_args; - } - // Remove the type parameter. - unset( $this->assoc_args['type'] ); - - return; - } - - // If type parameter is not specified. Then type needs to be determined from site-name. - $r = $this->find_command_to_run( $this->arguments ); - list( $command, $final_args, $cmd_path ) = $r; - - if ( is_string( $r ) ) { - EE::error( $r ); - } - - // Get the command synopsis to figure out the position of site-name and get it. - $synopsis = ( explode( ' ', $command->get_synopsis() ) ); - $command = array_shift( $cmd_path ); - $function = implode( ' ', $cmd_path ); - - // Search for the site-name position in args. - $args_search_one = array_search( '[<site-name>]', $synopsis ); - $args_search_two = array_search( '<site-name>', $synopsis ); - $arg_position = false !== $args_search_one ? $args_search_one : $args_search_two; - - // return if site-name is not applicable or if it is create function as in create the site will not yet be registered in db. - if ( false === $arg_position || 'create' === $function ) { - return; - } - - // Now that the position of site-name is figured, get the site-name. - $site_name = \EE\SiteUtils\auto_site_name( $final_args, $command, $function, $arg_position )[ $arg_position ]; - - // Getting the type of the respective site-name from database. - $type = Site::find( $site_name )->site_type; - - // Replacing `site` with appropriate type command if the function called for it exists. - $key = array_search( 'site', $this->arguments ); - $new_args = $this->arguments; - $new_args[ $key ] = $type; - - if ( is_array( $this->find_command_to_run( $new_args ) ) ) { - $this->arguments = $new_args; - } - - } - - public function start() { - // Enable PHP error reporting to stderr if testing. if ( getenv( 'BEHAT_RUN' ) ) { $this->enable_error_reporting(); diff --git a/php/bootstrap.php b/php/bootstrap.php index a116ac373..d2aa9a608 100644 --- a/php/bootstrap.php +++ b/php/bootstrap.php @@ -26,7 +26,6 @@ function get_bootstrap_steps() { 'EE\Bootstrap\LoadRequiredCommand', 'EE\Bootstrap\IncludePackageAutoloader', 'EE\Bootstrap\IncludeBundledAutoloader', - 'EE\Bootstrap\LoadSiteUtilityFunctions', 'EE\Bootstrap\RegisterFrameworkCommands', 'EE\Bootstrap\IncludeFallbackAutoloader', 'EE\Bootstrap\RegisterDeferredCommands', From 17ef295ceb092337b585c66b18b42033e35b4ed1 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 28 Aug 2018 17:06:41 +0530 Subject: [PATCH 0438/1044] Move site related files to site-command Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/class-ee-site-letsencrypt.php | 530 ------------------------ php/class-ee-site-shutdown-handler.php | 19 - php/class-ee-site.php | 539 ------------------------- php/site-utils.php | 365 ----------------- 4 files changed, 1453 deletions(-) delete mode 100644 php/class-ee-site-letsencrypt.php delete mode 100644 php/class-ee-site-shutdown-handler.php delete mode 100644 php/class-ee-site.php delete mode 100644 php/site-utils.php diff --git a/php/class-ee-site-letsencrypt.php b/php/class-ee-site-letsencrypt.php deleted file mode 100644 index 9c396b941..000000000 --- a/php/class-ee-site-letsencrypt.php +++ /dev/null @@ -1,530 +0,0 @@ -<?php - -use AcmePhp\Cli\Repository\Repository; -use AcmePhp\Cli\Serializer\PemEncoder; -use AcmePhp\Cli\Serializer\PemNormalizer; -use AcmePhp\Core\AcmeClient; -use AcmePhp\Core\Challenge\ChainValidator; -use AcmePhp\Core\Challenge\WaitingValidator; -use AcmePhp\Core\Challenge\Http\SimpleHttpSolver; -use AcmePhp\Core\Challenge\Http\HttpValidator; -use AcmePhp\Core\Challenge\Dns\SimpleDnsSolver; -use AcmePhp\Core\Challenge\Dns\DnsValidator; -use AcmePhp\Core\Exception\Protocol\ChallengeNotSupportedException; -use AcmePhp\Core\Http\SecureHttpClient; -use AcmePhp\Core\Http\Base64SafeEncoder; -use AcmePhp\Core\Http\ServerErrorHandler; -use AcmePhp\Ssl\Certificate; -use AcmePhp\Ssl\CertificateRequest; -use AcmePhp\Ssl\CertificateResponse; -use AcmePhp\Ssl\DistinguishedName; -use AcmePhp\Ssl\Parser\KeyParser; -use AcmePhp\Ssl\Parser\CertificateParser; -use AcmePhp\Ssl\Generator\KeyPairGenerator; -use AcmePhp\Ssl\Signer\CertificateRequestSigner; -use AcmePhp\Ssl\Signer\DataSigner; -use Symfony\Component\Console\Helper\Table; -use Symfony\Component\Console\Output\ConsoleOutput; -use Symfony\Component\Serializer\Encoder\JsonEncoder; -use Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer; -use Symfony\Component\Serializer\Serializer; -use League\Flysystem\Filesystem; -use League\Flysystem\Adapter\Local; -use League\Flysystem\Adapter\NullAdapter; -use GuzzleHttp\Client; - - -class Site_Letsencrypt { - - private $accountKeyPair; - private $httpClient; - private $base64SafeEncoder; - private $keyParser; - private $dataSigner; - private $serverErrorHandler; - private $serializer; - private $master; - private $backup; - private $client; - private $repository; - private $conf_dir; - - function __construct() { - $this->conf_dir = EE_CONF_ROOT . '/acme-conf'; - $this->setRepository(); - $this->setAcmeClient(); - } - - private function setAcmeClient() { - - if ( ! $this->repository->hasAccountKeyPair() ) { - EE::debug( 'No account key pair was found, generating one.' ); - EE::debug( 'Generating a key pair' ); - - $keygen = new KeyPairGenerator(); - $accountKeyPair = $keygen->generateKeyPair(); - EE::debug( 'Key pair generated, storing' ); - $this->repository->storeAccountKeyPair( $accountKeyPair ); - } else { - EE::debug( 'Loading account keypair' ); - $accountKeyPair = $this->repository->loadAccountKeyPair(); - } - - $this->accountKeyPair ?? $this->accountKeyPair = $accountKeyPair; - - $secureHttpClient = $this->getSecureHttpClient(); - $csrSigner = new CertificateRequestSigner(); - - $this->client = new AcmeClient( $secureHttpClient, 'https://acme-v02.api.letsencrypt.org/directory', $csrSigner ); - - } - - private function setRepository( $enable_backup = false ) { - $this->serializer ?? $this->serializer = new Serializer( - [ new PemNormalizer(), new GetSetMethodNormalizer() ], - [ new PemEncoder(), new JsonEncoder() ] - ); - $this->master ?? $this->master = new Filesystem( new Local( $this->conf_dir ) ); - $this->backup ?? $this->backup = new Filesystem( new NullAdapter() ); - - $this->repository = new Repository( $this->serializer, $this->master, $this->backup, $enable_backup ); - } - - private function getSecureHttpClient() { - $this->httpClient ?? $this->httpClient = new Client(); - $this->base64SafeEncoder ?? $this->base64SafeEncoder = new Base64SafeEncoder(); - $this->keyParser ?? $this->keyParser = new KeyParser(); - $this->dataSigner ?? $this->dataSigner = new DataSigner(); - $this->serverErrorHandler ?? $this->serverErrorHandler = new ServerErrorHandler(); - - return new SecureHttpClient( - $this->accountKeyPair, - $this->httpClient, - $this->base64SafeEncoder, - $this->keyParser, - $this->dataSigner, - $this->serverErrorHandler - ); - } - - - public function register( $email ) { - try { - $this->client->registerAccount( null, $email ); - } - catch ( Exception $e ) { - EE::warning( $e->getMessage() ); - EE::warning( 'It seems you\'re in local environment or there is some issue with network, please check logs. Skipping letsencrypt.' ); - - return false; - } - EE::debug( "Account with email id: $email registered successfully!" ); - return true; - } - - public function authorize( Array $domains, $site_root, $wildcard = false ) { - $solver = $wildcard ? new SimpleDnsSolver( null, new ConsoleOutput() ) : new SimpleHttpSolver(); - $solverName = $wildcard ? 'dns-01' : 'http-01'; - try { - $order = $this->client->requestOrder( $domains ); - } - catch ( Exception $e ) { - EE::warning( $e->getMessage() ); - EE::warning( 'It seems you\'re in local environment or using non-public domain, please check logs. Skipping letsencrypt.' ); - - return false; - } - - $authorizationChallengesToSolve = []; - foreach ( $order->getAuthorizationsChallenges() as $domainKey => $authorizationChallenges ) { - $authorizationChallenge = null; - foreach ( $authorizationChallenges as $candidate ) { - if ( $solver->supports( $candidate ) ) { - $authorizationChallenge = $candidate; - EE::debug( 'Authorization challenge supported by solver. Solver: ' . $solverName . ' Challenge: ' . $candidate->getType() ); - break; - } - // Should not get here as we are handling it. - EE::debug( 'Authorization challenge not supported by solver. Solver: ' . $solverName . ' Challenge: ' . $candidate->getType() ); - } - if ( null === $authorizationChallenge ) { - throw new ChallengeNotSupportedException(); - } - EE::debug( 'Storing authorization challenge. Domain: ' . $domainKey . ' Challenge: ' . print_r( $authorizationChallenge->toArray(), true ) ); - - $this->repository->storeDomainAuthorizationChallenge( $domainKey, $authorizationChallenge ); - $authorizationChallengesToSolve[] = $authorizationChallenge; - } - - /** @var AuthorizationChallenge $authorizationChallenge */ - foreach ( $authorizationChallengesToSolve as $authorizationChallenge ) { - EE::debug( 'Solving authorization challenge: Domain: ' . $authorizationChallenge->getDomain() . ' Challenge: ' . print_r( $authorizationChallenge->toArray(), true ) ); - $solver->solve( $authorizationChallenge ); - - if ( ! $wildcard ) { - $token = $authorizationChallenge->toArray()['token']; - $payload = $authorizationChallenge->toArray()['payload']; - EE::launch( "mkdir -p $site_root/app/src/.well-known/acme-challenge/" ); - EE::debug( "Creating challange file $site_root/app/src/.well-known/acme-challenge/$token" ); - file_put_contents( "$site_root/app/src/.well-known/acme-challenge/$token", $payload ); - EE::launch( "chown www-data: $site_root/app/src/.well-known/acme-challenge/$token" ); - } - } - - $this->repository->storeCertificateOrder( $domains, $order ); - - return true; - } - - public function check( Array $domains, $wildcard = false ) { - EE::debug( ('Starting check with solver ') . ($wildcard ? 'dns' : 'http') ); - $solver = $wildcard ? new SimpleDnsSolver( null, new ConsoleOutput() ) : new SimpleHttpSolver(); - $validator = new ChainValidator( - [ - new WaitingValidator( new HttpValidator() ), - new WaitingValidator( new DnsValidator() ) - ] - ); - - $order = null; - if ( $this->repository->hasCertificateOrder( $domains ) ) { - $order = $this->repository->loadCertificateOrder( $domains ); - EE::debug( sprintf( 'Loading the authorization token for domains %s ...', implode( ', ', $domains ) ) ); - } - - $authorizationChallengeToCleanup = []; - foreach ( $domains as $domain ) { - if ( $order ) { - $authorizationChallenge = null; - $authorizationChallenges = $order->getAuthorizationChallenges( $domain ); - foreach ( $authorizationChallenges as $challenge ) { - if ( $solver->supports( $challenge ) ) { - $authorizationChallenge = $challenge; - break; - } - } - if ( null === $authorizationChallenge ) { - throw new ChallengeNotSupportedException(); - } - } else { - if ( ! $this->repository->hasDomainAuthorizationChallenge( $domain ) ) { - EE::error( "Domain: $domain not yet authorized/has not been started of with EasyEngine letsencrypt site creation." ); - } - $authorizationChallenge = $this->repository->loadDomainAuthorizationChallenge( $domain ); - if ( ! $solver->supports( $authorizationChallenge ) ) { - throw new ChallengeNotSupportedException(); - } - } - EE::debug( 'Challenge loaded.' ); - - $authorizationChallenge = $this->client->reloadAuthorization( $authorizationChallenge ); - if ( ! $authorizationChallenge->isValid() ) { - EE::debug( sprintf( 'Testing the challenge for domain %s', $domain ) ); - if ( ! $validator->isValid( $authorizationChallenge ) ) { - EE::warning( sprintf( 'Can not valid challenge for domain %s', $domain ) ); - } - - EE::debug( sprintf( 'Requesting authorization check for domain %s', $domain ) ); - try { - $this->client->challengeAuthorization( $authorizationChallenge ); - } - catch ( Exception $e ) { - EE::debug( $e->getMessage() ); - EE::warning( 'Challange Authorization failed. Check logs and check if your domain is pointed correctly to this server.' ); - $site_name = isset( $domains[1] ) ? $domains[1] : $domains[0]; - EE::log( "Re-run `ee site le $site_name` after fixing the issue." ); - - return false; - } - $authorizationChallengeToCleanup[] = $authorizationChallenge; - } - } - - EE::log( 'The authorization check was successful!' ); - - if ( $solver instanceof MultipleChallengesSolverInterface ) { - $solver->cleanupAll( $authorizationChallengeToCleanup ); - } else { - /** @var AuthorizationChallenge $authorizationChallenge */ - foreach ( $authorizationChallengeToCleanup as $authorizationChallenge ) { - $solver->cleanup( $authorizationChallenge ); - } - } - return true; - } - - public function request( $domain, $altNames = [], $email, $force=false ) { - $alternativeNames = array_unique( $altNames ); - sort( $alternativeNames ); - - // Certificate renewal - if ( $this->hasValidCertificate( $domain, $alternativeNames ) ) { - EE::debug( "Certificate found for $domain, executing renewal" ); - - return $this->executeRenewal( $domain, $alternativeNames, $force ); - } - - EE::debug( "No certificate found, executing first request for $domain" ); - - // Certificate first request - return $this->executeFirstRequest( $domain, $alternativeNames, $email ); - } - - /** - * Request a first certificate for the given domain. - * - * @param string $domain - * @param array $alternativeNames - */ - private function executeFirstRequest( $domain, array $alternativeNames, $email ) { - EE::log( 'Executing first request.' ); - - // Generate domain key pair - $keygen = new KeyPairGenerator(); - $domainKeyPair = $keygen->generateKeyPair(); - $this->repository->storeDomainKeyPair( $domain, $domainKeyPair ); - - EE::debug( "$domain Domain key pair generated and stored" ); - - $distinguishedName = $this->getOrCreateDistinguishedName( $domain, $alternativeNames, $email ); - // TODO: ask them ;) - EE::debug( 'Distinguished name informations have been stored locally for this domain (they won\'t be asked on renewal).' ); - - // Order - $domains = array_merge( [ $domain ], $alternativeNames ); - EE::debug( sprintf( 'Loading the order related to the domains %s .', implode( ', ', $domains ) ) ); - if ( ! $this->repository->hasCertificateOrder( $domains ) ) { - EE::error( "$domain has not yet been authorized." ); - } - $order = $this->repository->loadCertificateOrder( $domains ); - - // Request - EE::log( sprintf( 'Requesting first certificate for domain %s.', $domain ) ); - $csr = new CertificateRequest( $distinguishedName, $domainKeyPair ); - $response = $this->client->finalizeOrder( $order, $csr ); - EE::log( 'Certificate received' ); - - // Store - $this->repository->storeDomainCertificate( $domain, $response->getCertificate() ); - EE::log( 'Certificate stored' ); - - // Post-generate actions - $this->moveCertsToNginxProxy( $domain ); - } - - private function moveCertsToNginxProxy( string $domain ) { - - $key_source_file = strtr( $this->conf_dir . '/' . Repository::PATH_DOMAIN_KEY_PRIVATE, [ '{domain}' => $domain ] ); - $crt_source_file = strtr( $this->conf_dir . '/' . Repository::PATH_DOMAIN_CERT_FULLCHAIN, [ '{domain}' => $domain ] ); - $chain_source_file = strtr( $this->conf_dir . '/' . Repository::PATH_DOMAIN_CERT_CHAIN, [ '{domain}' => $domain ] ); - - $key_dest_file = EE_CONF_ROOT . '/nginx/certs/' . $domain . '.key'; - $crt_dest_file = EE_CONF_ROOT . '/nginx/certs/' . $domain . '.crt'; - $chain_dest_file = EE_CONF_ROOT . '/nginx/certs/' . $domain . '.chain.pem'; - - copy( $key_source_file, $key_dest_file ); - copy( $crt_source_file, $crt_dest_file ); - copy( $chain_source_file, $chain_dest_file ); - } - - /** - * Renew a given domain certificate. - * - * @param string $domain - * @param array $alternativeNames - * @param bool $force - */ - private function executeRenewal( $domain, array $alternativeNames, $force = false ) { - try { - // Check expiration date to avoid too much renewal - EE::log( "Loading current certificate for $domain" ); - - $certificate = $this->repository->loadDomainCertificate( $domain ); - - if ( ! $force ) { - $certificateParser = new CertificateParser(); - $parsedCertificate = $certificateParser->parse( $certificate ); - - if ( $parsedCertificate->getValidTo()->format( 'U' ) - time() >= 604800 ) { - - EE::log( - sprintf( - 'Current certificate is valid until %s, renewal is not necessary.', - $parsedCertificate->getValidTo()->format( 'Y-m-d H:i:s' ) - ) - ); - - return; - } - - EE::log( - sprintf( - 'Current certificate will expire in less than a week (%s), renewal is required.', - $parsedCertificate->getValidTo()->format( 'Y-m-d H:i:s' ) - ) - ); - } else { - EE::log( 'Forced renewal.' ); - } - - // Key pair - EE::debug( 'Loading domain key pair...' ); - $domainKeyPair = $this->repository->loadDomainKeyPair( $domain ); - - // Distinguished name - EE::debug( 'Loading domain distinguished name...' ); - $distinguishedName = $this->getOrCreateDistinguishedName( $domain, $alternativeNames ); - - // Order - $domains = array_merge( [ $domain ], $alternativeNames ); - EE::debug( sprintf( 'Loading the order related to the domains %s.', implode( ', ', $domains ) ) ); - if ( ! $this->repository->hasCertificateOrder( $domains ) ) { - EE::error( "$domain has not yet been authorized." ); - } - $order = $this->repository->loadCertificateOrder( $domains ); - - // Renewal - EE::log( sprintf( 'Renewing certificate for domain %s.', $domain ) ); - $csr = new CertificateRequest( $distinguishedName, $domainKeyPair ); - $response = $this->client->finalizeOrder( $order, $csr ); - EE::log( 'Certificate received' ); - - $this->repository->storeDomainCertificate( $domain, $response->getCertificate() ); - $this->log( 'Certificate stored' ); - - // Post-generate actions - $this->moveCertsToNginxProxy( $domain ); - EE::log( 'Certificate renewed successfully!' ); - - } - catch ( \Exception $e ) { - EE::warning( 'A critical error occured during certificate renewal' ); - EE::debug( print_r( $e, true ) ); - - throw $e; - } - catch ( \Throwable $e ) { - EE::warning( 'A critical error occured during certificate renewal' ); - EE::debug( print_r( $e, true ) ); - - throw $e; - } - } - - private function hasValidCertificate( $domain, array $alternativeNames ) { - if ( ! $this->repository->hasDomainCertificate( $domain ) ) { - return false; - } - - if ( ! $this->repository->hasDomainKeyPair( $domain ) ) { - return false; - } - - if ( ! $this->repository->hasDomainDistinguishedName( $domain ) ) { - return false; - } - - if ( $this->repository->loadDomainDistinguishedName( $domain )->getSubjectAlternativeNames() !== $alternativeNames ) { - return false; - } - - return true; - } - - /** - * Retrieve the stored distinguishedName or create a new one if needed. - * - * @param string $domain - * @param array $alternativeNames - * - * @return DistinguishedName - */ - private function getOrCreateDistinguishedName( $domain, array $alternativeNames, $email ) { - if ( $this->repository->hasDomainDistinguishedName( $domain ) ) { - $original = $this->repository->loadDomainDistinguishedName( $domain ); - - $distinguishedName = new DistinguishedName( - $domain, - $original->getCountryName(), - $original->getStateOrProvinceName(), - $original->getLocalityName(), - $original->getOrganizationName(), - $original->getOrganizationalUnitName(), - $original->getEmailAddress(), - $alternativeNames - ); - } else { - // Ask DistinguishedName - $distinguishedName = new DistinguishedName( - $domain, - // TODO: Ask and fill these values properly - 'US', - 'CA', - 'Mountain View', - 'Let\'s Encrypt', - 'Let\'s Encrypt Authority X3', - $email, - $alternativeNames - ); - - } - - $this->repository->storeDomainDistinguishedName( $domain, $distinguishedName ); - - return $distinguishedName; - } - - - public function status() { - $this->master ?? $this->master = new Filesystem( new Local( $this->conf_dir ) ); - - $certificateParser = new CertificateParser(); - - $table = new Table( $output ); - $table->setHeaders( [ 'Domain', 'Issuer', 'Valid from', 'Valid to', 'Needs renewal?' ] ); - - $directories = $this->master->listContents( 'certs' ); - - foreach ( $directories as $directory ) { - if ( 'dir' !== $directory['type'] ) { - continue; - } - - $parsedCertificate = $certificateParser->parse( $this->repository->loadDomainCertificate( $directory['basename'] ) ); - if ( ! $input->getOption( 'all' ) && $parsedCertificate->isExpired() ) { - continue; - } - $domainString = $parsedCertificate->getSubject(); - - $alternativeNames = array_diff( $parsedCertificate->getSubjectAlternativeNames(), [ $parsedCertificate->getSubject() ] ); - if ( count( $alternativeNames ) ) { - sort( $alternativeNames ); - $last = array_pop( $alternativeNames ); - foreach ( $alternativeNames as $alternativeName ) { - $domainString .= "\n ├── " . $alternativeName; - } - $domainString .= "\n └── " . $last; - } - - $table->addRow( - [ - $domainString, - $parsedCertificate->getIssuer(), - $parsedCertificate->getValidFrom()->format( 'Y-m-d H:i:s' ), - $parsedCertificate->getValidTo()->format( 'Y-m-d H:i:s' ), - ( $parsedCertificate->getValidTo()->format( 'U' ) - time() < 604800 ) ? '<comment>Yes</comment>' : 'No', - ] - ); - } - - $table->render(); - } - - public function cleanup( $site_root ) { - $challange_dir = "$site_root/app/src/.well-known"; - if ( file_exists( "$site_root/app/src/.well-known" ) ) { - EE::debug( 'Cleaning up webroot files.' ); - EE\Utils\delete_dir( $challange_dir ); - } - } -} diff --git a/php/class-ee-site-shutdown-handler.php b/php/class-ee-site-shutdown-handler.php deleted file mode 100644 index 2df3c30ee..000000000 --- a/php/class-ee-site-shutdown-handler.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * Class Shutdown_Handler - */ -class Shutdown_Handler { - - /** - * Handle fatal errors. This function was created as the register_shutdown_function requires the callable function to be public and any public function inside site-command would be callable directly through command-line. - * - * @param array $site_command having Site_Command object. - */ - public function cleanup( $site_command ) { - $reflector = new ReflectionObject( $site_command[0] ); - $method = $reflector->getMethod( 'shutDownFunction' ); - $method->setAccessible( true ); - $method->invoke( $site_command[0] ); - } -} diff --git a/php/class-ee-site.php b/php/class-ee-site.php deleted file mode 100644 index 1dcbae7a1..000000000 --- a/php/class-ee-site.php +++ /dev/null @@ -1,539 +0,0 @@ -<?php - -use \Symfony\Component\Filesystem\Filesystem; -use \EE\Model\Site; - -/** - * Base class for Site command - * - * @package ee - */ -abstract class EE_Site_Command { - /** - * @var Filesystem $fs Symfony Filesystem object. - */ - private $fs; - - /** - * @var bool $wildcard Whether the site is letsencrypt type is wildcard or not. - */ - private $wildcard; - - /** - * @var bool $ssl Whether the site has SSL or not. - */ - private $ssl; - - /** - * @var string $le_mail Mail id to be used for letsencrypt registration and certificate generation. - */ - private $le_mail; - - /** - * @var array $site Associative array containing essential site related information. - */ - private $site; - - public function __construct() { - } - - /** - * Lists the created websites. - * abstract list - * - * [--enabled] - * : List only enabled sites. - * - * [--disabled] - * : List only disabled sites. - * - * [--format=<format>] - * : Render output in a particular format. - * --- - * default: table - * options: - * - table - * - csv - * - yaml - * - json - * - count - * - text - * --- - * - * @subcommand list - */ - public function _list( $args, $assoc_args ) { - - EE\Utils\delem_log( 'site list start' ); - $format = EE\Utils\get_flag_value( $assoc_args, 'format' ); - $enabled = EE\Utils\get_flag_value( $assoc_args, 'enabled' ); - $disabled = EE\Utils\get_flag_value( $assoc_args, 'disabled' ); - - $sites = Site::all(); - - if ( $enabled && ! $disabled ) { - $sites = Site::where( 'is_enabled', true ); - } elseif ( $disabled && ! $enabled ) { - $sites = Site::where( 'is_enabled', false ); - } - - if ( empty( $sites ) ) { - EE::error( 'No sites found!' ); - } - - if ( 'text' === $format ) { - foreach ( $sites as $site ) { - EE::log( $site->site_url ); - } - } else { - $result = array_map( - function ( $site ) { - $site->site = $site->site_url; - $site->status = $site->site_enabled ? 'enabled' : 'disabled'; - - return $site; - }, $sites - ); - - $formatter = new EE\Formatter( $assoc_args, [ 'site', 'status' ] ); - - $formatter->display_items( $result ); - } - - EE\Utils\delem_log( 'site list end' ); - } - - - /** - * Deletes a website. - * - * ## OPTIONS - * - * <site-name> - * : Name of website to be deleted. - * - * [--yes] - * : Do not prompt for confirmation. - */ - public function delete( $args, $assoc_args ) { - - EE\Utils\delem_log( 'site delete start' ); - $this->populate_site_info( $args ); - EE::confirm( sprintf( 'Are you sure you want to delete %s?', $this->site['url'] ), $assoc_args ); - $this->delete_site( 5, $this->site['url'], $this->site['root'] ); - EE\Utils\delem_log( 'site delete end' ); - } - - /** - * Function to delete the given site. - * - * @param int $level Level of deletion. - * Level - 0: No need of clean-up. - * Level - 1: Clean-up only the site-root. - * Level - 2: Try to remove network. The network may or may not have been created. - * Level - 3: Disconnect & remove network and try to remove containers. The containers may - * not have been created. Level - 4: Remove containers. Level - 5: Remove db entry. - * @param string $site_name Name of the site to be deleted. - * @param string $site_root Webroot of the site. - */ - protected function delete_site( $level, $site_name, $site_root ) { - - $this->fs = new Filesystem(); - $proxy_type = EE_PROXY_TYPE; - if ( $level >= 3 ) { - if ( EE::docker()::docker_compose_down( $site_root ) ) { - EE::log( "[$site_name] Docker Containers removed." ); - } else { - EE::exec( "docker rm -f $(docker ps -q -f=label=created_by=EasyEngine -f=label=site_name=$site_name)" ); - if ( $level > 3 ) { - EE::warning( 'Error in removing docker containers.' ); - } - } - } - - if ( $this->fs->exists( $site_root ) ) { - try { - $this->fs->remove( $site_root ); - } catch ( Exception $e ) { - EE::debug( $e ); - EE::error( 'Could not remove site root. Please check if you have sufficient rights.' ); - } - EE::log( "[$site_name] site root removed." ); - } - - $config_file_path = EE_CONF_ROOT . '/nginx/conf.d/' . $site_name . '-redirect.conf'; - - if ( $this->fs->exists( $config_file_path ) ) { - try { - $this->fs->remove( $config_file_path ); - } catch ( Exception $e ) { - EE::debug( $e ); - EE::error( 'Could not remove site redirection file. Please check if you have sufficient rights.' ); - } - } - - - if ( $level > 4 ) { - if ( $this->ssl ) { - EE::log( 'Removing ssl certs.' ); - $crt_file = EE_CONF_ROOT . "/nginx/certs/$site_name.crt"; - $key_file = EE_CONF_ROOT . "/nginx/certs/$site_name.key"; - $conf_certs = EE_CONF_ROOT . "/acme-conf/certs/$site_name"; - $conf_var = EE_CONF_ROOT . "/acme-conf/var/$site_name"; - - $cert_files = [$conf_certs, $conf_var, $crt_file, $key_file]; - try { - $this->fs->remove( $cert_files ); - } catch ( Exception $e ) { - EE::warning( $e ); - } - } - - if ( Site::find( $site_name )->delete() ) { - EE::log( 'Removed database entry.' ); - } else { - EE::error( 'Could not remove the database entry' ); - } - } - EE::log( "Site $site_name deleted." ); - } - - /** - * Enables a website. It will start the docker containers of the website if they are stopped. - * - * ## OPTIONS - * - * [<site-name>] - * : Name of website to be enabled. - * - * [--force] - * : Force execution of site up. - */ - public function up( $args, $assoc_args ) { - - EE\Utils\delem_log( 'site enable start' ); - $force = EE\Utils\get_flag_value( $assoc_args, 'force' ); - $args = EE\SiteUtils\auto_site_name( $args, 'site', __FUNCTION__ ); - $this->populate_site_info( $args ); - $site = Site::find( $this->site['url'] ); - - if ( $site->site_enabled && ! $force ) { - EE::error( sprintf( '%s is already enabled!', $site->site_url ) ); - } - - EE::log( sprintf( 'Enabling site %s.', $site->site_url ) ); - - if ( EE::docker()::docker_compose_up( $this->site['root'] ) ) { - $site->site_enabled = 1; - $site->save(); - EE::success( "Site $site->site_url enabled." ); - } else { - EE::error( sprintf( 'There was error in enabling %s. Please check logs.', $site->site_url ) ); - } - EE\Utils\delem_log( 'site enable end' ); - } - - /** - * Disables a website. It will stop and remove the docker containers of the website if they are running. - * - * ## OPTIONS - * - * [<site-name>] - * : Name of website to be disabled. - */ - public function down( $args, $assoc_args ) { - - EE\Utils\delem_log( 'site disable start' ); - $args = EE\SiteUtils\auto_site_name( $args, 'site', __FUNCTION__ ); - $this->populate_site_info( $args ); - - $site = Site::find($this->site['url']); - - EE::log( sprintf( 'Disabling site %s.', $site->site_url ) ); - - if ( EE::docker()::docker_compose_down( $this->site['root'] ) ) { - $site->site_enabled = 0; - $site->save(); - - EE::success( sprintf( 'Site %s disabled.', $this->site['url'] ) ); - } else { - EE::error( sprintf( 'There was error in disabling %s. Please check logs.', $this->site['url'] ) ); - } - EE\Utils\delem_log( 'site disable end' ); - } - - /** - * Restarts containers associated with site. - * When no service(--nginx etc.) is specified, all site containers will be restarted. - * - * [<site-name>] - * : Name of the site. - * - * [--all] - * : Restart all containers of site. - * - * [--nginx] - * : Restart nginx container of site. - */ - public function restart( $args, $assoc_args, $whitelisted_containers = [] ) { - - EE\Utils\delem_log( 'site restart start' ); - $args = EE\SiteUtils\auto_site_name( $args, 'site', __FUNCTION__ ); - $all = EE\Utils\get_flag_value( $assoc_args, 'all' ); - $no_service_specified = count( $assoc_args ) === 0; - - $this->populate_site_info( $args ); - - chdir( $this->site['root'] ); - - if ( $all || $no_service_specified ) { - $containers = $whitelisted_containers; - } else { - $containers = array_keys( $assoc_args ); - } - - foreach ( $containers as $container ) { - EE\Siteutils\run_compose_command( 'restart', $container ); - } - EE\Utils\delem_log( 'site restart stop' ); - } - - /** - * Reload services in containers without restarting container(s) associated with site. - * When no service(--nginx etc.) is specified, all services will be reloaded. - * - * [<site-name>] - * : Name of the site. - * - * [--all] - * : Reload all services of site(which are supported). - * - * [--nginx] - * : Reload nginx service in container. - * - */ - public function reload( $args, $assoc_args, $whitelisted_containers = [], $reload_commands = [] ) { - - EE\Utils\delem_log( 'site reload start' ); - $args = EE\SiteUtils\auto_site_name( $args, 'site', __FUNCTION__ ); - $all = EE\Utils\get_flag_value( $assoc_args, 'all' ); - if ( !array_key_exists( 'nginx', $reload_commands ) ) { - $reload_commands['nginx'] = 'nginx sh -c \'nginx -t && service openresty reload\''; - } - $no_service_specified = count( $assoc_args ) === 0; - - $this->populate_site_info( $args ); - - chdir( $this->site['root'] ); - - if ( $all || $no_service_specified ) { - $this->reload_services( $whitelisted_containers, $reload_commands ); - } else { - $this->reload_services( array_keys( $assoc_args ), $reload_commands ); - } - EE\Utils\delem_log( 'site reload stop' ); - } - - /** - * Executes reload commands. It needs separate handling as commands to reload each service is different. - * - * @param array $services Services to reload. - * @param array $reload_commands Commands to reload the services. - */ - private function reload_services( $services, $reload_commands ) { - - foreach ( $services as $service ) { - EE\SiteUtils\run_compose_command( 'exec', $reload_commands[$service], 'reload', $service ); - } - } - - /** - * Runs the acme le registration and authorization. - * - * @param string $site_name Name of the site for ssl. - * - * @throws Exception - */ - protected function inherit_certs( $site_name ) { - $parent_site_name = implode( '.', array_slice( explode( '.', $site_name ), 1 ) ); - $parent_site = Site::find( $parent_site_name, [ 'site_ssl', 'site_ssl_wildcard' ] ); - - if ( ! $parent_site ) { - throw new Exception( 'Unable to find existing site: ' . $parent_site_name ); - } - - if ( ! $parent_site->site_ssl ) { - throw new Exception( "Cannot inherit from $parent_site_name as site does not have SSL cert" . var_dump( $parent_site ) ); - } - - if ( ! $parent_site->site_ssl_wildcard ) { - throw new Exception( "Cannot inherit from $parent_site_name as site does not have wildcard SSL cert" ); - } - - // We don't have to do anything now as nginx-proxy handles everything for us. - EE::success( 'Inherited certs from parent' ); - } - - /** - * Runs SSL procedure. - * - * @param string $site_name Name of the site for ssl. - * @param string $site_root Webroot of the site. - * @param string $ssl_type Type of ssl cert to issue. - * @param bool $wildcard SSL with wildcard or not. - * - * @throws \EE\ExitException If --ssl flag has unrecognized value - */ - protected function init_ssl( $site_name, $site_root, $ssl_type, $wildcard = false ) { - EE::debug( 'Starting SSL procedure' ); - if ( 'le' === $ssl_type ) { - EE::debug( 'Initializing LE' ); - $this->init_le( $site_name, $site_root, $wildcard ); - } elseif ( 'inherit' === $ssl_type ) { - if ( $wildcard ) { - EE::error( 'Cannot use --wildcard with --ssl=inherit', false ); - } - EE::debug( 'Inheriting certs' ); - $this->inherit_certs( $site_name ); - } else { - EE::error( "Unrecognized value in --ssl flag: $ssl_type" ); - } - } - - /** - * Runs the acme le registration and authorization. - * - * @param string $site_name Name of the site for ssl. - * @param string $site_root Webroot of the site. - * @param bool $wildcard SSL with wildcard or not. - */ - protected function init_le( $site_name, $site_root, $wildcard = false ) { - EE::debug( "Wildcard in init_le: $wildcard" ); - - $this->site['url'] = $site_name; - $this->site['root'] = $site_root; - $this->wildcard = $wildcard; - $client = new Site_Letsencrypt(); - $this->le_mail = EE::get_runner()->config['le-mail'] ?? EE::input( 'Enter your mail id: ' ); - EE::get_runner()->ensure_present_in_config( 'le-mail', $this->le_mail ); - if ( ! $client->register( $this->le_mail ) ) { - $this->ssl = null; - - return; - } - - $domains = $this->get_cert_domains( $site_name, $wildcard ); - - if ( ! $client->authorize( $domains, $this->site['root'], $wildcard ) ) { - $this->le = false; - - return; - } - if ( $wildcard ) { - echo \cli\Colors::colorize( '%YIMPORTANT:%n Run `ee site le ' . $this->site['url'] . '` once the dns changes have propogated to complete the certification generation and installation.', null ); - } else { - $this->le( [], [] ); - } - } - - /** - * Returns all domains required by cert - * - * @param string $site_name Name of site - * @param $wildcard Wildcard cert required? - * - * @return array - */ - private function get_cert_domains( string $site_name, $wildcard ) : array { - $domains = [ $site_name ]; - $has_www = ( strpos( $site_name, 'www.' ) === 0 ); - - if ( $wildcard ) { - $domains[] = "*.{$site_name}"; - } else { - $domains[] = $this->get_www_domain( $site_name ); - } - return $domains; - } - - /** - * If the domain has www in it, returns a domain without www in it. - * Else returns a domain with www in it. - * - * @param string $site_name Name of site - * - * @return string Domain name with or without www - */ - private function get_www_domain( string $site_name ) : string { - $has_www = ( strpos( $site_name, 'www.' ) === 0 ); - - if ( $has_www ) { - return ltrim( $site_name, 'www.' ); - } else { - return 'www.' . $site_name; - } - } - - - /** - * Runs the acme le. - * - * ## OPTIONS - * - * <site-name> - * : Name of website. - * - * [--force] - * : Force renewal. - */ - public function le( $args = [], $assoc_args = [] ) { - - if ( !isset( $this->site['url'] ) ) { - $this->populate_site_info( $args ); - } - - if ( !isset( $this->le_mail ) ) { - $this->le_mail = EE::get_config( 'le-mail' ) ?? EE::input( 'Enter your mail id: ' ); - } - - $force = EE\Utils\get_flag_value( $assoc_args, 'force' ); - $domains = $this->get_cert_domains( $this->site['url'], $this->wildcard ); - $client = new Site_Letsencrypt(); - - if ( ! $client->check( $domains, $this->wildcard ) ) { - $this->ssl = null; - return; - } - - $san = array_values( array_diff( $domains, [ $this->site['url'] ] ) ); - $client->request( $this->site['url'], $san, $this->le_mail, $force ); - - if ( ! $this->wildcard ) { - $client->cleanup( $this->site['root'] ); - } - EE::launch( 'docker exec ee-nginx-proxy sh -c "/app/docker-entrypoint.sh /usr/local/bin/docker-gen /app/nginx.tmpl /etc/nginx/conf.d/default.conf; /usr/sbin/nginx -s reload"' ); - } - - /** - * Populate basic site info from db. - */ - private function populate_site_info( $args ) { - - $this->site['url'] = EE\Utils\remove_trailing_slash( $args[0] ); - $site = Site::find( $this->site['url'] ); - if ( $site ) { - - $db_select = $site->site_url; - - $this->site['type'] = $site->site_type; - $this->site['root'] = $site->site_fs_path; - $this->ssl = $site->site_ssl; - $this->wildcard = $site->site_ssl_wildcard; - } else { - EE::error( sprintf( 'Site %s does not exist.', $this->site['url'] ) ); - } - } - - abstract public function create( $args, $assoc_args ); - -} diff --git a/php/site-utils.php b/php/site-utils.php deleted file mode 100644 index 1aaed7f52..000000000 --- a/php/site-utils.php +++ /dev/null @@ -1,365 +0,0 @@ -<?php - -namespace EE\SiteUtils; - -use \EE; -use EE\Model\Site; -use \Symfony\Component\Filesystem\Filesystem; - -/** - * Get the site-name from the path from where ee is running if it is a valid site path. - * - * @return bool|String Name of the site or false in failure. - */ -function get_site_name() { - $sites = Site::all( [ 'site_url' ] ); - - if ( ! empty( $sites ) ) { - $cwd = getcwd(); - $name_in_path = explode( '/', $cwd ); - - $site_name = array_intersect( array_column( $sites, 'site_url' ), $name_in_path ); - - if ( 1 === count( $site_name ) ) { - $name = reset( $site_name ); - $path = Site::find( $name ); - if ( $path ) { - $site_path = $path->site_fs_path; - if ( substr( $cwd, 0, strlen( $site_path ) ) === $site_path ) { - return $name; - } - } - } - } - - return false; -} - -/** - * Function to set the site-name in the args when ee is running in a site folder and the site-name has not been passed - * in the args. If the site-name could not be found it will throw an error. - * - * @param array $args The passed arguments. - * @param String $command The command passing the arguments to auto-detect site-name. - * @param String $function The function passing the arguments to auto-detect site-name. - * @param integer $arg_pos Argument position where Site-name will be present. - * - * @return array Arguments with site-name set. - */ -function auto_site_name( $args, $command, $function, $arg_pos = 0 ) { - - if ( isset( $args[ $arg_pos ] ) ) { - if ( Site::find( $args[ $arg_pos ] ) ) { - return $args; - } - } - $site_name = get_site_name(); - if ( $site_name ) { - if ( isset( $args[ $arg_pos ] ) ) { - EE::error( $args[ $arg_pos ] . " is not a valid site-name. Did you mean `ee $command $function $site_name`?" ); - } - array_splice( $args, $arg_pos, 0, $site_name ); - } else { - EE::error( "Could not find the site you wish to run $command $function command on.\nEither pass it as an argument: `ee $command $function <site-name>` \nor run `ee $command $function` from inside the site folder." ); - } - - return $args; -} - - -/** - * Function to check all the required configurations needed to create the site. - * - * Boots up the container if it is stopped or not running. - */ -function init_checks() { - - $proxy_type = EE_PROXY_TYPE; - if ( 'running' !== EE::docker()::container_status( $proxy_type ) ) { - /** - * Checking ports. - */ - $port_80_status = get_curl_info( 'localhost', 80, true ); - $port_443_status = get_curl_info( 'localhost', 443, true ); - - // if any/both the port/s is/are occupied. - if ( ! ( $port_80_status && $port_443_status ) ) { - EE::error( 'Cannot create/start proxy container. Please make sure port 80 and 443 are free.' ); - } else { - - $fs = new Filesystem(); - - if ( ! $fs->exists( EE_CONF_ROOT . '/docker-compose.yml' ) ) { - generate_global_docker_compose_yml( $fs ); - } - - $EE_CONF_ROOT = EE_CONF_ROOT; - if ( ! EE::docker()::docker_network_exists( 'ee-global-network' ) ) { - if ( ! EE::docker()::create_network( 'ee-global-network' ) ) { - EE::error( 'Unable to create network ee-global-network' ); - } - } - if ( EE::docker()::docker_compose_up( EE_CONF_ROOT, [ 'nginx-proxy' ] ) ) { - $fs->dumpFile( "$EE_CONF_ROOT/nginx/conf.d/custom.conf", file_get_contents( EE_ROOT . '/templates/custom.conf.mustache' ) ); - EE::success( "$proxy_type container is up." ); - } else { - EE::error( "There was some error in starting $proxy_type container. Please check logs." ); - } - } - } -} - -/** - * Generates global docker-compose.yml at EE_CONF_ROOT - * - * @param Filesystem $fs Filesystem object to write file - */ -function generate_global_docker_compose_yml( Filesystem $fs ) { - $img_versions = EE\Utils\get_image_versions(); - - $data = [ - 'services' => [ - 'name' => 'nginx-proxy', - 'container_name' => 'ee-nginx-proxy', - 'image' => 'easyengine/nginx-proxy:' . $img_versions['easyengine/nginx-proxy'], - 'restart' => 'always', - 'ports' => [ - '80:80', - '443:443', - ], - 'environment' => [ - 'LOCAL_USER_ID=' . posix_geteuid(), - 'LOCAL_GROUP_ID=' . posix_getegid(), - ], - 'volumes' => [ - EE_CONF_ROOT . '/nginx/certs:/etc/nginx/certs', - EE_CONF_ROOT . '/nginx/dhparam:/etc/nginx/dhparam', - EE_CONF_ROOT . '/nginx/conf.d:/etc/nginx/conf.d', - EE_CONF_ROOT . '/nginx/htpasswd:/etc/nginx/htpasswd', - EE_CONF_ROOT . '/nginx/vhost.d:/etc/nginx/vhost.d', - '/usr/share/nginx/html', - '/var/run/docker.sock:/tmp/docker.sock:ro', - ], - 'networks' => [ - 'global-network', - ], - ], - ]; - - $contents = EE\Utils\mustache_render( EE_ROOT . '/templates/global_docker_compose.yml.mustache', $data ); - $fs->dumpFile( EE_CONF_ROOT . '/docker-compose.yml', $contents ); -} - -/** - * Creates site root directory if does not exist. - * Throws error if it does exist. - * - * @param string $site_root Root directory of the site. - * @param string $site_name Name of the site. - */ -function create_site_root( $site_root, $site_name ) { - - $fs = new Filesystem(); - if ( $fs->exists( $site_root ) ) { - EE::error( "Webroot directory for site $site_name already exists." ); - } - - $whoami = EE::launch( 'whoami', false, true ); - $terminal_username = rtrim( $whoami->stdout ); - - $fs->mkdir( $site_root ); - $fs->chown( $site_root, $terminal_username ); -} - -/** - * Reloads configuration of ee-nginx-proxy container - * - * @return bool - */ -function reload_proxy_configuration() { - return EE::exec( 'docker exec ee-nginx-proxy sh -c "/app/docker-entrypoint.sh /usr/local/bin/docker-gen /app/nginx.tmpl /etc/nginx/conf.d/default.conf; /usr/sbin/nginx -s reload"' ); -} - -/** - * Adds www to non-www redirection to site - * - * @param string $site_name name of the site. - * @param bool $ssl enable ssl or not. - * @param bool $inherit inherit cert or not. - */ -function add_site_redirects( string $site_name, bool $ssl, bool $inherit ) { - - $fs = new Filesystem(); - $confd_path = EE_CONF_ROOT . '/nginx/conf.d/'; - $config_file_path = $confd_path . $site_name . '-redirect.conf'; - $has_www = strpos( $site_name, 'www.' ) === 0; - $cert_site_name = $site_name; - - if ( $inherit ) { - $cert_site_name = implode( '.', array_slice( explode( '.', $site_name ), 1 ) ); - } - - if ( $has_www ) { - $server_name = ltrim( $site_name, '.www' ); - } else { - $server_name = 'www.' . $site_name; - } - - $conf_data = [ - 'site_name' => $site_name, - 'cert_site_name' => $cert_site_name, - 'server_name' => $server_name, - 'ssl' => $ssl, - ]; - - $content = EE\Utils\mustache_render( EE_ROOT . '/templates/redirect.conf.mustache', $conf_data ); - $fs->dumpFile( $config_file_path, ltrim( $content, PHP_EOL ) ); -} - -/** - * Function to create entry in /etc/hosts. - * - * @param string $site_name Name of the site. - */ -function create_etc_hosts_entry( $site_name ) { - - $host_line = LOCALHOST_IP . "\t$site_name"; - $etc_hosts = file_get_contents( '/etc/hosts' ); - if ( ! preg_match( "/\s+$site_name\$/m", $etc_hosts ) ) { - if ( EE::exec( "/bin/bash -c 'echo \"$host_line\" >> /etc/hosts'" ) ) { - EE::success( 'Host entry successfully added.' ); - } else { - EE::warning( "Failed to add $site_name in host entry, Please do it manually!" ); - } - } else { - EE::log( 'Host entry already exists.' ); - } -} - - -/** - * Checking site is running or not. - * - * @param string $site_name Name of the site. - * - * @throws \Exception when fails to connect to site. - */ -function site_status_check( $site_name ) { - - EE::log( 'Checking and verifying site-up status. This may take some time.' ); - $httpcode = get_curl_info( $site_name ); - $i = 0; - while ( 200 !== $httpcode && 302 !== $httpcode && 301 !== $httpcode ) { - EE::debug( "$site_name status httpcode: $httpcode" ); - $httpcode = get_curl_info( $site_name ); - echo '.'; - sleep( 2 ); - if ( $i ++ > 60 ) { - break; - } - } - if ( 200 !== $httpcode && 302 !== $httpcode && 301 !== $httpcode ) { - throw new \Exception( 'Problem connecting to site!' ); - } - -} - -/** - * Function to get httpcode or port occupancy info. - * - * @param string $url url to get info about. - * @param int $port The port to check. - * @param bool $port_info Return port info or httpcode. - * - * @return bool|int port occupied or httpcode. - */ -function get_curl_info( $url, $port = 80, $port_info = false ) { - - $ch = curl_init( $url ); - curl_setopt( $ch, CURLOPT_HEADER, true ); - curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); - curl_setopt( $ch, CURLOPT_NOBODY, true ); - curl_setopt( $ch, CURLOPT_TIMEOUT, 10 ); - curl_setopt( $ch, CURLOPT_PORT, $port ); - curl_exec( $ch ); - if ( $port_info ) { - return empty( curl_getinfo( $ch, CURLINFO_PRIMARY_IP ) ); - } - - return curl_getinfo( $ch, CURLINFO_HTTP_CODE ); -} - -/** - * Function to pull the latest images and bring up the site containers. - * - * @param string $site_root Root directory of the site. - * @param array $containers The minimum required conatainers to start the site. Default null, leads to starting of all containers. - * - * @throws \Exception when docker-compose up fails. - */ -function start_site_containers( $site_root, $containers = [] ) { - - EE::log( 'Pulling latest images. This may take some time.' ); - chdir( $site_root ); - EE::exec( 'docker-compose pull' ); - EE::log( 'Starting site\'s services.' ); - if ( ! EE::docker()::docker_compose_up( $site_root, $containers ) ) { - throw new \Exception( 'There was some error in docker-compose up.' ); - } -} - - -/** - * Generic function to run a docker compose command. Must be ran inside correct directory. - * - * @param string $action docker-compose action to run. - * @param string $container The container on which action has to be run. - * @param string $action_to_display The action message to be displayed. - * @param string $service_to_display The service message to be displayed. - */ -function run_compose_command( $action, $container, $action_to_display = null, $service_to_display = null ) { - - $display_action = $action_to_display ? $action_to_display : $action; - $display_service = $service_to_display ? $service_to_display : $container; - - EE::log( ucfirst( $display_action ) . 'ing ' . $display_service ); - EE::exec( "docker-compose $action $container", true, true ); -} - -/** - * Function to copy and configure files needed for postfix. - * - * @param string $site_name Name of the site to configure postfix files for. - * @param string $site_conf_dir Configuration directory of the site `site_root/config`. - */ -function set_postfix_files( $site_name, $site_conf_dir ) { - - $fs = new Filesystem(); - $fs->mkdir( $site_conf_dir . '/postfix' ); - $fs->mkdir( $site_conf_dir . '/postfix/ssl' ); - $ssl_dir = $site_conf_dir . '/postfix/ssl'; - - if ( ! EE::exec( sprintf( "openssl req -new -x509 -nodes -days 365 -subj \"/CN=smtp.%s\" -out $ssl_dir/server.crt -keyout $ssl_dir/server.key", $site_name ) ) - && EE::exec( "chmod 0600 $ssl_dir/server.key" ) ) { - throw new Exception( 'Unable to generate ssl key for postfix' ); - } -} - -/** - * Function to execute docker-compose exec calls to postfix to get it configured and running for the site. - * - * @param string $site_name Name of the for which postfix has to be configured. - * @param strin $site_root Site root. - */ -function configure_postfix( $site_name, $site_root ) { - - chdir( $site_root ); - EE::exec( 'docker-compose exec postfix postconf -e \'relayhost =\'' ); - EE::exec( 'docker-compose exec postfix postconf -e \'smtpd_recipient_restrictions = permit_mynetworks\'' ); - $launch = EE::launch( sprintf( 'docker inspect -f \'{{ with (index .IPAM.Config 0) }}{{ .Subnet }}{{ end }}\' %s', $site_name ) ); - $subnet_cidr = trim( $launch->stdout ); - EE::exec( sprintf( 'docker-compose exec postfix postconf -e \'mynetworks = %s 127.0.0.0/8\'', $subnet_cidr ) ); - EE::exec( sprintf( 'docker-compose exec postfix postconf -e \'myhostname = %s\'', $site_name ) ); - EE::exec( 'docker-compose exec postfix postconf -e \'syslog_name = $myhostname\'' ); - EE::exec( 'docker-compose restart postfix' ); -} From 5eb29eba93424e1ca99ba2b9ba8663f8ecb23d33 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 28 Aug 2018 17:10:10 +0530 Subject: [PATCH 0439/1044] Remove site related dependencies Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- composer.json | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/composer.json b/composer.json index 9024c0d9f..9c523a321 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,6 @@ "prefer-stable": true, "require": { "php": ">=7.0", - "acmephp/core": "dev-master", "composer/composer": "^1.2.0", "composer/semver": "~1.0", "easyengine/admin-tools-command": "dev-develop", @@ -35,10 +34,7 @@ "easyengine/site-command": "v2.0.0", "easyengine/site-wp-command": "v1.0.0-beta.1", "easyengine/shell-command": "v1.0.0-beta.1", - "ext-openssl": "*", - "guzzlehttp/guzzle": "^6.0", "justinrainbow/json-schema": "~5.2.5", - "league/flysystem": "^1.0.19", "monolog/monolog": "^1.23", "mustache/mustache": "~2.4", "rmccue/requests": "~1.6", @@ -50,10 +46,8 @@ "symfony/filesystem": "^2.7|^3.0", "symfony/finder": "^2.7|^3.0", "symfony/process": "^2.1|^3.0", - "symfony/serializer": "^3.0", "symfony/translation": "^2.7|^3.0", "symfony/yaml": "^2.7|^3.0", - "webmozart/assert": "^1.0", "wp-cli/autoload-splitter": "^0.1.5", "wp-cli/mustangostang-spyc": "^0.6.3", "wp-cli/php-cli-tools": "~0.11.2" @@ -74,8 +68,7 @@ "EE": "php" }, "psr-4": { - "": "php/commands/src", - "AcmePhp\\Cli\\": "php/AcmePhp/Cli" + "": "php/commands/src" } }, "extra": { From 40e8991b0e26d0a33e01fa41cc4949d507648580 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 28 Aug 2018 17:10:26 +0530 Subject: [PATCH 0440/1044] Add args and assoc_args in hook Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Dispatcher/Subcommand.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/php/EE/Dispatcher/Subcommand.php b/php/EE/Dispatcher/Subcommand.php index 4f462f951..76e7b049e 100644 --- a/php/EE/Dispatcher/Subcommand.php +++ b/php/EE/Dispatcher/Subcommand.php @@ -413,14 +413,14 @@ public function invoke( $args, $assoc_args, $extra_args ) { unset( $assoc_args[ $key ] ); } - $path = get_path( $this->get_parent() ); + $path = get_path( $this->get_parent() ); $parent = implode( ' ', array_slice( $path, 1 ) ); - $cmd = $this->name; + $cmd = $this->name; if ( $parent ) { - EE::do_hook( "before_invoke:{$parent}" ); + EE::do_hook( "before_invoke:{$parent}", $args, $assoc_args ); $cmd = $parent . ' ' . $cmd; } - EE::do_hook( "before_invoke:{$cmd}" ); + EE::do_hook( "before_invoke:{$cmd}", $args, $assoc_args ); call_user_func( $this->when_invoked, $args, array_merge( $extra_args, $assoc_args ) ); From 48e58b80f0f53a668cdab7f21885a957c676537e Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 28 Aug 2018 18:33:01 +0530 Subject: [PATCH 0441/1044] Move template to site-command Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- templates/global_docker_compose.yml.mustache | 54 -------------------- 1 file changed, 54 deletions(-) delete mode 100644 templates/global_docker_compose.yml.mustache diff --git a/templates/global_docker_compose.yml.mustache b/templates/global_docker_compose.yml.mustache deleted file mode 100644 index bb231c723..000000000 --- a/templates/global_docker_compose.yml.mustache +++ /dev/null @@ -1,54 +0,0 @@ -version: '3.5' - -services: - -{{#services}} - {{name}}: - container_name: {{container_name}} - image: {{image}} - {{#ports.0}} - ports: - {{#ports}} - - "{{.}}" - {{/ports}} - {{/ports.0}} - {{#depends_on}} - depends_on: - - {{.}} - {{/depends_on}} - {{#restart}} - restart: {{.}} - {{/restart}} - {{#command}} - command: {{.}} - {{/command}} - {{#labels.0}} - labels: - {{#labels}} - - "{{.}}" - {{/labels}} - {{/labels.0}} - {{#volumes.0}} - volumes: - {{#volumes}} - - "{{.}}" - {{/volumes}} - {{/volumes.0}} - {{#environment.0}} - environment: - {{#environment}} - - {{.}} - {{/environment}} - {{/environment.0}} - {{#networks.0}} - networks: - {{#networks}} - - {{.}} - {{/networks}} - {{/networks.0}} -{{/services}} - -networks: - global-network: - external: - name: ee-global-network From 78c7fc88ed43534162891838b98618688e5effb1 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 28 Aug 2018 21:04:51 +0530 Subject: [PATCH 0442/1044] Remove routing from bootstraping Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Bootstrap/RouteSiteCommands.php | 27 -------------------------- php/bootstrap.php | 1 - 2 files changed, 28 deletions(-) delete mode 100644 php/EE/Bootstrap/RouteSiteCommands.php diff --git a/php/EE/Bootstrap/RouteSiteCommands.php b/php/EE/Bootstrap/RouteSiteCommands.php deleted file mode 100644 index 08e6833b1..000000000 --- a/php/EE/Bootstrap/RouteSiteCommands.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -namespace EE\Bootstrap; - -/** - * Class LaunchRunner. - * - * Kick off the Runner object that starts the actual commands. - * - * @package EE\Bootstrap - */ -final class RouteSiteCommands implements BootstrapStep { - - /** - * Process this single bootstrapping step. - * - * @param BootstrapState $state Contextual state to pass into the step. - * - * @return BootstrapState Modified state to pass to the next step. - */ - public function process( BootstrapState $state ) { - $runner = new RunnerInstance(); - $runner()->route(); - - return $state; - } -} diff --git a/php/bootstrap.php b/php/bootstrap.php index d2aa9a608..195efd818 100644 --- a/php/bootstrap.php +++ b/php/bootstrap.php @@ -29,7 +29,6 @@ function get_bootstrap_steps() { 'EE\Bootstrap\RegisterFrameworkCommands', 'EE\Bootstrap\IncludeFallbackAutoloader', 'EE\Bootstrap\RegisterDeferredCommands', - 'EE\Bootstrap\RouteSiteCommands', 'EE\Bootstrap\LaunchRunner', ); } From d455c2fa718977e41a923d2944541012c50f3dd4 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Fri, 31 Aug 2018 19:27:44 +0530 Subject: [PATCH 0443/1044] Add auth table Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/class-ee-db.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/php/class-ee-db.php b/php/class-ee-db.php index e00d79fc8..f5ed80551 100644 --- a/php/class-ee-db.php +++ b/php/class-ee-db.php @@ -118,6 +118,16 @@ private static function create_required_tables() { FOREIGN KEY (site_url) REFERENCES sites(site_url) );'; + $query .= 'CREATE TABLE auth_users ( + id INTEGER, + site_url VARCHAR NOT NULL, + username VARCHAR NOT NULL, + password VARCHAR NOT NULL, + scope VARCHAR NOT NULL, + PRIMARY KEY (id), + CHECK (scope IN (\'admin-tools\', \'site\', \'custom\')) + );'; + try { self::$pdo->exec( $query ); } catch ( PDOException $exception ) { From b3eb81c6a6e762d8fdcedd7eb1a9438b3f216e4d Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Fri, 31 Aug 2018 19:28:21 +0530 Subject: [PATCH 0444/1044] Add support for associative args in where condition Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/class-ee-db.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/php/class-ee-db.php b/php/class-ee-db.php index f5ed80551..2e9cf9052 100644 --- a/php/class-ee-db.php +++ b/php/class-ee-db.php @@ -197,6 +197,10 @@ private function common_retrieval_function() { * [ 'id', '<', 100 ], * [ 'name', 'ee' ] * ]) + * or where([ + * 'id' => 100, + * 'name' => 'ee', + * ]) * * Supported operators are: '=', '<', '>', '<=', '>=', '==', '!=', '<>', 'like', 'in' * @@ -211,8 +215,15 @@ public function where( ...$args ) { $conditions = []; if ( 'array' === gettype( $args[0] ) ) { - foreach ( $args[0] as $condition ) { - $conditions[] = $this->get_where_fragment( $condition ); + if ( \EE\Utils\is_assoc( $args[0] ) ) { + $condition_keys = array_keys( $args[0] ); + foreach ( $condition_keys as $key ) { + $conditions[] = $this->get_where_fragment( [ $key, $args[0][ $key ] ] ); + } + } else { + foreach ( $args[0] as $condition ) { + $conditions[] = $this->get_where_fragment( $condition ); + } } } else { $conditions[] = $this->get_where_fragment( $args ); From 483b0957e98e1cc84e5e4b5c7d842fbd51e09525 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Fri, 31 Aug 2018 19:28:49 +0530 Subject: [PATCH 0445/1044] Update modified_on conditionally Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/EE/Model/Base.php | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/php/EE/Model/Base.php b/php/EE/Model/Base.php index 3b838613a..846cfdb00 100644 --- a/php/EE/Model/Base.php +++ b/php/EE/Model/Base.php @@ -17,13 +17,18 @@ abstract class Base { /** * @var string Primary key of current model */ - protected static $primary_key; + protected static $primary_key = 'id'; /** * @var string It will contain an array of all fields that are present in database in table */ protected $fields; + /** + * @var bool Weather the model needs timestamp whenever it's updated + */ + protected static $needs_update_timestamp = false; + /** * Base constructor. * @@ -161,13 +166,13 @@ public static function create( $columns = [] ) { * Returns all model with condition * * @param string|array $column Column to search in - * @param string|int $value Value to match + * @param string $value Value to match * * @throws \Exception * * @return array */ - public static function where( $column, $value ) { + public static function where( $column, $value='' ) { return static::many_array_to_model( EE::db() ->table( static::$table ) @@ -240,11 +245,15 @@ public function __unset( $name ) { * @return bool Model saved successfully */ public function save() { - $fields = array_merge( - $this->fields, [ - 'modified_on' => date( 'Y-m-d H:i:s' ), - ] - ); + $fields = $this->fields; + + if ( static::$needs_update_timestamp ) { + $fields = array_merge( + $fields, [ + 'modified_on' => date( 'Y-m-d H:i:s' ), + ] + ); + } $primary_key_column = static::$primary_key; From f33c3215aadcb832e37a3cda87990a893d6505ab Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Fri, 31 Aug 2018 19:29:10 +0530 Subject: [PATCH 0446/1044] Add is_assoc util function Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/utils.php | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/php/utils.php b/php/utils.php index 3bf1140c8..eac9ce55a 100644 --- a/php/utils.php +++ b/php/utils.php @@ -4,11 +4,10 @@ namespace EE\Utils; -use \Composer\Semver\Comparator; -use \Composer\Semver\Semver; -use \EE; -use \EE\Dispatcher; -use \EE\Iterators\Transform; +use Composer\Semver\Comparator; +use Composer\Semver\Semver; +use EE; +use EE\Iterators\Transform; const PHAR_STREAM_PREFIX = 'phar://'; @@ -423,6 +422,20 @@ function make_progress_bar( $message, $count, $interval = 100 ) { return new \cli\progress\Bar( $message, $count, $interval ); } +/** + * Checks if an array is associative array + * @param array $arr array to check + * + * @return bool + */ +function is_assoc( array $arr ) { + if ( array() === $arr ) { + return false; + } + + return array_keys( $arr ) !== range( 0, count( $arr ) - 1 ); +} + function parse_url( $url ) { $url_parts = \parse_url( $url ); From 5ccc287ecdd6c1dfc7068700cdb9e14838f6196d Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Fri, 31 Aug 2018 20:11:27 +0530 Subject: [PATCH 0447/1044] Remove unused params from launch_self Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/class-ee.php | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/php/class-ee.php b/php/class-ee.php index 0696350e0..7e15a15d6 100644 --- a/php/class-ee.php +++ b/php/class-ee.php @@ -1,10 +1,10 @@ <?php -use \EE\ExitException; -use \EE\Dispatcher; -use \EE\FileCache; -use \EE\Process; -use \EE\Utils; +use EE\Dispatcher; +use EE\ExitException; +use EE\FileCache; +use EE\Process; +use EE\Utils; use Mustangostang\Spyc; /** @@ -919,20 +919,6 @@ public static function exec( $command, $echo_stdout = false, $echo_stderr = fals * @return int|ProcessRun The command exit status, or a ProcessRun instance */ public static function launch_self( $command, $args = array(), $assoc_args = array(), $exit_on_error = true, $return_detailed = false, $runtime_args = array() ) { - $reused_runtime_args = array( - 'path', - 'url', - 'user', - ); - - foreach ( $reused_runtime_args as $key ) { - if ( isset( $runtime_args[ $key ] ) ) { - $assoc_args[ $key ] = $runtime_args[ $key ]; - } elseif ( $value = self::get_runner()->config[ $key ] ) { - $assoc_args[ $key ] = $value; - } - } - $php_bin = escapeshellarg( Utils\get_php_binary() ); $script_path = $GLOBALS['argv'][0]; From 4c847a5d4f487d9ada8d5fadbf99209b99deaac9 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Tue, 4 Sep 2018 19:03:16 +0530 Subject: [PATCH 0448/1044] Remove check SQL constraint Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/class-ee-db.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/php/class-ee-db.php b/php/class-ee-db.php index 2e9cf9052..0533eb362 100644 --- a/php/class-ee-db.php +++ b/php/class-ee-db.php @@ -124,8 +124,7 @@ private static function create_required_tables() { username VARCHAR NOT NULL, password VARCHAR NOT NULL, scope VARCHAR NOT NULL, - PRIMARY KEY (id), - CHECK (scope IN (\'admin-tools\', \'site\', \'custom\')) + PRIMARY KEY (id) );'; try { From d5123cf29fd27f7fb38145db3cd7a0a2eebae3b6 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Tue, 4 Sep 2018 20:45:43 +0530 Subject: [PATCH 0449/1044] Improve is_assoc function Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/utils.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/php/utils.php b/php/utils.php index eac9ce55a..f73cccab2 100644 --- a/php/utils.php +++ b/php/utils.php @@ -424,16 +424,23 @@ function make_progress_bar( $message, $count, $interval = 100 ) { /** * Checks if an array is associative array + * * @param array $arr array to check * * @return bool */ -function is_assoc( array $arr ) { - if ( array() === $arr ) { - return false; +function is_assoc( $arr ) { + + $is_assoc = false; + + foreach ( $arr as $key => $value ) { + if ( is_string( $key ) ) { + $is_assoc = true; + break; + } } - return array_keys( $arr ) !== range( 0, count( $arr ) - 1 ); + return $is_assoc; } function parse_url( $url ) { From 4ec2e65ebdb90144a9f29a52f80006596aa0c976 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 6 Sep 2018 11:07:07 +0530 Subject: [PATCH 0450/1044] Update line, exec and launch for obfuscation Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/class-ee.php | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/php/class-ee.php b/php/class-ee.php index 7e15a15d6..472af447b 100644 --- a/php/class-ee.php +++ b/php/class-ee.php @@ -480,19 +480,20 @@ public static function remove_deferred_addition( $name ) { } /** - * Display informational message without prefix, and ignore `--quiet`. + * Display informational message without prefix. * - * Message is written to STDOUT. `EE::log()` is typically recommended; - * `EE::line()` is included for historical compat. + * Should only be used for displaying sensitive info which should be skipped from log file. + * `EE::log()` is typically recommended for everything else. * - * @access public + * @access public * @category Output * * @param string $message Message to display to the end user. + * * @return null */ public static function line( $message = '' ) { - echo $message . "\n"; + self::$logger->info( $message ); } /** @@ -818,19 +819,21 @@ public static function error_to_string( $errors ) { * @access public * @category Execution * - * @param string $command External process to launch. + * @param string $command External process to launch. * @param boolean $exit_on_error Whether to exit if the command returns an elevated return code. * @param boolean $return_detailed Whether to return an exit status (default) or detailed execution results. - * @param array $env Environment variables to set when running the command. - * @param string $cwd Directory to execute the command in. + * @param array $obfuscate Parts of the command that need to be obfuscated. + * @param array $env Environment variables to set when running the command. + * @param string $cwd Directory to execute the command in. * * @return int|ProcessRun The command exit status, or a ProcessRun object for full details. */ - public static function launch( $command, $exit_on_error = false, $return_detailed = true, $env = null, $cwd = null ) { + public static function launch( $command, $exit_on_error = false, $return_detailed = true, $obfuscate = [], $env = null, $cwd = null ) { Utils\check_proc_available( 'launch' ); + $command_to_log = empty( $obfuscate ) ? $command : str_replace( $obfuscate, '******', $command ); self::debug( '-----------------------' ); - self::debug( "COMMAND: $command" ); + self::debug( "COMMAND: $command_to_log" ); $proc = Process::create( $command, $cwd, $env ); $results = $proc->run(); @@ -858,18 +861,20 @@ public static function launch( $command, $exit_on_error = false, $return_detaile * @access public * @category Execution * - * @param string $command External process to launch. - * @param bool $echo_stdout Print stdout to terminal. Default false. - * @param bool $echo_stderr Print stderr to terminal. Default false. + * @param string $command External process to launch. + * @param bool $echo_stdout Print stdout to terminal. Default false. + * @param bool $echo_stderr Print stderr to terminal. Default false. + * @param array $obfuscate Parts of the command that need to be obfuscated. * @param boolean $exit_on_error Exit if the command returns an elevated return code with stderr. * * @return bool True if executed successfully. False if failed. */ - public static function exec( $command, $echo_stdout = false, $echo_stderr = false, $exit_on_error = false ) { + public static function exec( $command, $echo_stdout = false, $echo_stderr = false, $obfuscate = [], $exit_on_error = false ) { Utils\check_proc_available( 'exec' ); + $command_to_log = empty( $obfuscate ) ? $command : str_replace( $obfuscate, '******', $command ); self::debug( '-----------------------' ); - self::debug( "COMMAND: $command" ); + self::debug( "COMMAND: $command_to_log" ); $proc = Process::create( $command, null, null ); $results = $proc->run(); From 0304efb018c52b8b7c7d9fdd89256127147859a8 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 6 Sep 2018 11:31:24 +0530 Subject: [PATCH 0451/1044] Update format_table to add option for skipping log file Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/utils.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/php/utils.php b/php/utils.php index f73cccab2..1e42520fe 100644 --- a/php/utils.php +++ b/php/utils.php @@ -1508,10 +1508,11 @@ function get_type( $assoc_args, $arg_types, $default = false ) { * # +------+--------+ * ``` * - * @param array $items An array of items to output. + * @param array $items An array of items to output. + * @param bool $log_data To log table in file or not. * */ -function format_table( $items ) { +function format_table( $items, $log_in_file = false ) { $item_table = new \cli\Table(); $item_table->setRows( $items ); $item_table->setRenderer( new \cli\table\Ascii() ); @@ -1519,8 +1520,13 @@ function format_table( $items ) { array_pop( $lines ); $delem = $item_table->getDisplayLines()[0]; foreach ( $lines as $line ) { - \EE::log( $delem ); - \EE::log( $line ); + if ( $log_in_file ) { + \EE::log( $delem ); + \EE::log( $line ); + } else { + \EE::line( $delem ); + \EE::line( $line ); + } } \EE::log( $delem ); } From a343a6caa59e8b38359865f30b48974a2b9e4ecb Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 6 Sep 2018 13:00:24 +0530 Subject: [PATCH 0452/1044] Move compatibility of site args to site-command Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Runner.php | 48 ----------------------------------------------- 1 file changed, 48 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index f1c59026c..248f042f5 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -546,54 +546,6 @@ public function init_config() { unset( $assoc_args['version'] ); } - if ( isset( $args[0] ) && 'site' === $args[0] ) { - - $ee3_compat_array_map_to_type = [ - 'wp' => [ 'type' => 'wp' ], - 'wpsubdom' => [ 'type' => 'wp', 'mu' => 'subdom' ], - 'wpsubdir' => [ 'type' => 'wp', 'mu' => 'subdir' ], - 'wpredis' => [ 'type' => 'wp', 'cache' => true ], - 'html' => [ 'type' => 'html' ], - ]; - - foreach ( $ee3_compat_array_map_to_type as $from => $to ) { - if ( isset( $assoc_args[ $from ] ) ) { - $assoc_args = array_merge( $assoc_args, $to ); - unset( $assoc_args[ $from ] ); - } - } - - // ee3 backward compatibility flags - $wp_compat_array_map = [ - 'user' => 'admin_user', - 'pass' => 'admin_pass', - 'email' => 'admin_email', - 'le' => 'letsencrypt', - ]; - - foreach ( $wp_compat_array_map as $from => $to ) { - if ( isset( $assoc_args[ $from ] ) ) { - $assoc_args[ $to ] = $assoc_args[ $from ]; - unset( $assoc_args[ $from ] ); - } - } - - // backward compatibility message - $unsupported_create_old_args = array( - 'w3tc', - 'wpsc', - 'wpfc', - 'pagespeed', - ); - - $old_arg = array_intersect( $unsupported_create_old_args, array_keys( $assoc_args ) ); - - $old_args = implode( ' --', $old_arg ); - if ( isset( $args[1] ) && 'create' === $args[1] && ! empty ( $old_arg ) ) { - \EE::error( "Sorry, --$old_args flag/s is/are no longer supported in EE v4.\nPlease run `ee help " . implode( ' ', $args ) . '`.' ); - } - } - list( $this->arguments, $this->assoc_args ) = [ $args, $assoc_args ]; $configurator->merge_array( $this->runtime_config ); From 561ce307b7ed03454dacb68ed5ade8259b6a3678 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 6 Sep 2018 19:44:37 +0530 Subject: [PATCH 0453/1044] Update composer with latest tagged repos Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- composer.json | 17 +-- composer.lock | 316 +++++++++++++++++++++++++++++++++++--------------- 2 files changed, 230 insertions(+), 103 deletions(-) diff --git a/composer.json b/composer.json index 9c523a321..17cf14496 100644 --- a/composer.json +++ b/composer.json @@ -27,13 +27,16 @@ "php": ">=7.0", "composer/composer": "^1.2.0", "composer/semver": "~1.0", - "easyengine/admin-tools-command": "dev-develop", - "easyengine/auth-command": "dev-develop", - "easyengine/cron-command": "v1.0.0-beta.2", - "easyengine/mailhog-command": "dev-develop", - "easyengine/site-command": "v2.0.0", - "easyengine/site-wp-command": "v1.0.0-beta.1", - "easyengine/shell-command": "v1.0.0-beta.1", + "easyengine/admin-tools-command": "v1.0.0-beta.1", + "easyengine/auth-command": "v1.0.0-beta.1", + "easyengine/config-command": "v1.0.0-beta.1", + "easyengine/cron-command": "v1.0.0-beta.3", + "easyengine/mailhog-command": "v1.0.0-beta.1", + "easyengine/site-command": "v2.1.0", + "easyengine/site-type-wp": "v1.0.0-beta.2", + "easyengine/site-type-php": "v1.0.0-beta.1", + "easyengine/service-command": "v1.0.0-beta.1", + "easyengine/shell-command" : "v1.0.0-beta.2", "justinrainbow/json-schema": "~5.2.5", "monolog/monolog": "^1.23", "mustache/mustache": "~2.4", diff --git a/composer.lock b/composer.lock index 2f7279cc4..0663ee106 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": "db6490bde7710948c4d0123da2b6669f", + "content-hash": "51972052d5e6ca19e292d24211fa5721", "packages": [ { "name": "acmephp/core", @@ -394,16 +394,16 @@ }, { "name": "composer/xdebug-handler", - "version": "1.2.0", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "e1809da56ce1bd1b547a752936817341ac244d8e" + "reference": "b8e9745fb9b06ea6664d8872c4505fb16df4611c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/e1809da56ce1bd1b547a752936817341ac244d8e", - "reference": "e1809da56ce1bd1b547a752936817341ac244d8e", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/b8e9745fb9b06ea6664d8872c4505fb16df4611c", + "reference": "b8e9745fb9b06ea6664d8872c4505fb16df4611c", "shasum": "" }, "require": { @@ -434,20 +434,20 @@ "Xdebug", "performance" ], - "time": "2018-08-16T10:54:23+00:00" + "time": "2018-08-31T19:07:57+00:00" }, { "name": "easyengine/admin-tools-command", - "version": "dev-develop", + "version": "v1.0.0-beta.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/admin-tools-command.git", - "reference": "e3b8effe80d9f6450919d4a7c539de8283135a2f" + "reference": "1114683aa73f8b30d5e445a41961a52b0fcb1894" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/admin-tools-command/zipball/e3b8effe80d9f6450919d4a7c539de8283135a2f", - "reference": "e3b8effe80d9f6450919d4a7c539de8283135a2f", + "url": "https://api.github.com/repos/EasyEngine/admin-tools-command/zipball/1114683aa73f8b30d5e445a41961a52b0fcb1894", + "reference": "1114683aa73f8b30d5e445a41961a52b0fcb1894", "shasum": "" }, "type": "ee-cli-package", @@ -474,20 +474,20 @@ ], "description": "Commanad to enable disable admin tools for php based sites.", "homepage": "https://github.com/easyengine/amdin-tools", - "time": "2018-08-22T07:04:13+00:00" + "time": "2018-09-06T12:06:41+00:00" }, { "name": "easyengine/auth-command", - "version": "dev-develop", + "version": "v1.0.0-beta.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/auth-command.git", - "reference": "707f03cdd91342e7c9fb69c81fde34e697ca5d91" + "reference": "df7051c02175076a3e9966b76ad7a46ac9e5a9ff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/auth-command/zipball/707f03cdd91342e7c9fb69c81fde34e697ca5d91", - "reference": "707f03cdd91342e7c9fb69c81fde34e697ca5d91", + "url": "https://api.github.com/repos/EasyEngine/auth-command/zipball/df7051c02175076a3e9966b76ad7a46ac9e5a9ff", + "reference": "df7051c02175076a3e9966b76ad7a46ac9e5a9ff", "shasum": "" }, "type": "ee-cli-package", @@ -502,9 +502,11 @@ }, "autoload": { "psr-4": { - "": "src/" + "": "src/", + "\\EE\\Model\\": "src/db/" }, "files": [ + "src/auth-utils.php", "auth-command.php" ] }, @@ -514,20 +516,60 @@ ], "description": "Configure HTTP auth for EasyEngine site.", "homepage": "https://github.com/easyengine/auth-command", - "time": "2018-08-22T06:36:14+00:00" + "time": "2018-09-06T12:09:03+00:00" + }, + { + "name": "easyengine/config-command", + "version": "v1.0.0-beta.1", + "source": { + "type": "git", + "url": "https://github.com/EasyEngine/config-command.git", + "reference": "c4d66fb12875dd4c60e9b3a8dddfb1180301aef9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/EasyEngine/config-command/zipball/c4d66fb12875dd4c60e9b3a8dddfb1180301aef9", + "reference": "c4d66fb12875dd4c60e9b3a8dddfb1180301aef9", + "shasum": "" + }, + "type": "ee-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "config" + ] + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "config-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Manages EasyEngine configuration", + "homepage": "https://github.com/easyengine/config-command", + "time": "2018-09-04T14:02:35+00:00" }, { "name": "easyengine/cron-command", - "version": "v1.0.0-beta.2", + "version": "v1.0.0-beta.3", "source": { "type": "git", "url": "https://github.com/EasyEngine/cron-command.git", - "reference": "7dae17ada7c93c3d4cac7854baa996410302d46e" + "reference": "79b9f25dd21d5242a0b71d14c629c687f349af1f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/cron-command/zipball/7dae17ada7c93c3d4cac7854baa996410302d46e", - "reference": "7dae17ada7c93c3d4cac7854baa996410302d46e", + "url": "https://api.github.com/repos/EasyEngine/cron-command/zipball/79b9f25dd21d5242a0b71d14c629c687f349af1f", + "reference": "79b9f25dd21d5242a0b71d14c629c687f349af1f", "shasum": "" }, "type": "ee-cli-package", @@ -557,20 +599,20 @@ ], "description": "Manages cron jobs in EasyEngine", "homepage": "https://github.com/easyengine/cron-command", - "time": "2018-08-06T19:59:01+00:00" + "time": "2018-09-06T12:09:27+00:00" }, { "name": "easyengine/mailhog-command", - "version": "dev-develop", + "version": "v1.0.0-beta.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/mailhog-command.git", - "reference": "c797aa33db43c7cf684887f2fe85de11e6b319c4" + "reference": "39cd0661c97321ce40805fd86f3a826aa359037c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/mailhog-command/zipball/c797aa33db43c7cf684887f2fe85de11e6b319c4", - "reference": "c797aa33db43c7cf684887f2fe85de11e6b319c4", + "url": "https://api.github.com/repos/EasyEngine/mailhog-command/zipball/39cd0661c97321ce40805fd86f3a826aa359037c", + "reference": "39cd0661c97321ce40805fd86f3a826aa359037c", "shasum": "" }, "type": "ee-cli-package", @@ -597,20 +639,63 @@ ], "description": "Commanad to enable disable mailhog for sites.", "homepage": "https://github.com/easyengine/mailhog-command", - "time": "2018-08-22T06:59:42+00:00" + "time": "2018-09-06T12:09:41+00:00" }, { - "name": "easyengine/shell-command", + "name": "easyengine/service-command", "version": "v1.0.0-beta.1", + "source": { + "type": "git", + "url": "https://github.com/EasyEngine/service-command.git", + "reference": "dac1013e520f506280b91378c28c238d1aa7db53" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/dac1013e520f506280b91378c28c238d1aa7db53", + "reference": "dac1013e520f506280b91378c28c238d1aa7db53", + "shasum": "" + }, + "type": "ee-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "service start", + "service stop", + "service restart", + "service reload" + ] + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "service-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Command to manager global containers/services in EasyEngine", + "homepage": "https://github.com/easyengine/service-command", + "time": "2018-09-06T12:09:55+00:00" + }, + { + "name": "easyengine/shell-command", + "version": "v1.0.0-beta.2", "source": { "type": "git", "url": "https://github.com/EasyEngine/shell-command.git", - "reference": "d0e8bac82c812dd871a0fbb0e901be15c76e55a7" + "reference": "13674e596c6c4f8c6b787fd488922a5089b3dbda" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/shell-command/zipball/d0e8bac82c812dd871a0fbb0e901be15c76e55a7", - "reference": "d0e8bac82c812dd871a0fbb0e901be15c76e55a7", + "url": "https://api.github.com/repos/EasyEngine/shell-command/zipball/13674e596c6c4f8c6b787fd488922a5089b3dbda", + "reference": "13674e596c6c4f8c6b787fd488922a5089b3dbda", "shasum": "" }, "type": "ee-cli-package", @@ -637,34 +722,36 @@ ], "description": "Shell to run helpful commands inside containers.", "homepage": "https://github.com/easyengine/shell-command", - "time": "2018-06-25T14:38:55+00:00" + "time": "2018-09-06T12:10:15+00:00" }, { "name": "easyengine/site-command", - "version": "v2.0.0", + "version": "v2.1.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "a3f5ba5ef7a9966958214a9ff38114da836a688d" + "reference": "0ee669443650de346afcfbfc0aa6e9e358b00f01" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/a3f5ba5ef7a9966958214a9ff38114da836a688d", - "reference": "a3f5ba5ef7a9966958214a9ff38114da836a688d", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/0ee669443650de346afcfbfc0aa6e9e358b00f01", + "reference": "0ee669443650de346afcfbfc0aa6e9e358b00f01", "shasum": "" }, + "require": { + "acmephp/core": "dev-master", + "ext-openssl": "*", + "guzzlehttp/guzzle": "^6.0", + "league/flysystem": "^1.0.19", + "symfony/serializer": "^3.0", + "webmozart/assert": "^1.0" + }, "type": "ee-cli-package", "extra": { "branch-alias": { "dev-master": "1.x-dev" }, - "bundled": true, - "commands": [ - "site", - "site create", - "site list", - "site delete" - ] + "bundled": true }, "autoload": { "psr-4": { @@ -672,6 +759,8 @@ "AcmePhp\\Cli\\": "AcmePhp/Cli" }, "files": [ + "src/helper/hooks.php", + "src/helper/site-utils.php", "site-command.php" ] }, @@ -680,22 +769,62 @@ "MIT" ], "homepage": "https://github.com/easyengine/site-command", - "time": "2018-08-06T19:23:14+00:00" + "time": "2018-09-06T12:10:30+00:00" }, { - "name": "easyengine/site-wp-command", + "name": "easyengine/site-type-php", "version": "v1.0.0-beta.1", "source": { "type": "git", - "url": "https://github.com/EasyEngine/site-wp-command.git", - "reference": "8234aab6ca091969ce9950b5dccd75c0dedcc3f9" + "url": "https://github.com/EasyEngine/site-type-php.git", + "reference": "8440ab9351148ccb5977f654450e9ba8dbc26fe9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/8440ab9351148ccb5977f654450e9ba8dbc26fe9", + "reference": "8440ab9351148ccb5977f654450e9ba8dbc26fe9", + "shasum": "" + }, + "require-dev": { + "wp-cli/mustangostang-spyc": "^0.6.3" + }, + "type": "ee-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true + }, + "autoload": { + "psr-4": { + "": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "EasyEngine package for PHP site creation.", + "homepage": "https://github.com/easyengine/site-type-php", + "time": "2018-09-06T12:10:44+00:00" + }, + { + "name": "easyengine/site-type-wp", + "version": "v1.0.0-beta.2", + "source": { + "type": "git", + "url": "https://github.com/EasyEngine/site-type-wp.git", + "reference": "d8f52b1bbf36d44b8917e7764da206b4c296720f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-wp-command/zipball/8234aab6ca091969ce9950b5dccd75c0dedcc3f9", - "reference": "8234aab6ca091969ce9950b5dccd75c0dedcc3f9", + "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/d8f52b1bbf36d44b8917e7764da206b4c296720f", + "reference": "d8f52b1bbf36d44b8917e7764da206b4c296720f", "shasum": "" }, + "require-dev": { + "wp-cli/mustangostang-spyc": "^0.6.3" + }, "type": "ee-cli-package", "extra": { "branch-alias": { @@ -708,16 +837,16 @@ "": "src/" }, "files": [ - "site-wp-command.php" + "site-type-wp.php" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "EasyEngine package for WordPress site creation.", - "homepage": "https://github.com/easyengine/site-wp-command", - "time": "2018-08-06T18:28:59+00:00" + "description": "EasyEngine site type package for WordPress site creation.", + "homepage": "https://github.com/easyengine/site-type-wp", + "time": "2018-09-06T12:10:58+00:00" }, { "name": "guzzlehttp/guzzle", @@ -1464,7 +1593,7 @@ }, { "name": "symfony/config", - "version": "v3.4.14", + "version": "v3.4.15", "source": { "type": "git", "url": "https://github.com/symfony/config.git", @@ -1528,7 +1657,7 @@ }, { "name": "symfony/console", - "version": "v3.4.14", + "version": "v3.4.15", "source": { "type": "git", "url": "https://github.com/symfony/console.git", @@ -1597,16 +1726,16 @@ }, { "name": "symfony/debug", - "version": "v3.4.14", + "version": "v3.4.15", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "d5a058ff6ecad26b30c1ba452241306ea34c65cc" + "reference": "c4625e75341e4fb309ce0c049cbf7fb84b8897cd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/d5a058ff6ecad26b30c1ba452241306ea34c65cc", - "reference": "d5a058ff6ecad26b30c1ba452241306ea34c65cc", + "url": "https://api.github.com/repos/symfony/debug/zipball/c4625e75341e4fb309ce0c049cbf7fb84b8897cd", + "reference": "c4625e75341e4fb309ce0c049cbf7fb84b8897cd", "shasum": "" }, "require": { @@ -1649,20 +1778,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2018-07-26T11:19:56+00:00" + "time": "2018-08-03T10:42:44+00:00" }, { "name": "symfony/dependency-injection", - "version": "v3.4.14", + "version": "v3.4.15", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "1c0e679e522591fd744fdf242fec41a43d62b2b1" + "reference": "09d7df7bf06c1393b6afc85875993cbdbdf897a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/1c0e679e522591fd744fdf242fec41a43d62b2b1", - "reference": "1c0e679e522591fd744fdf242fec41a43d62b2b1", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/09d7df7bf06c1393b6afc85875993cbdbdf897a0", + "reference": "09d7df7bf06c1393b6afc85875993cbdbdf897a0", "shasum": "" }, "require": { @@ -1720,11 +1849,11 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2018-07-29T15:19:31+00:00" + "time": "2018-08-08T11:42:34+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v3.4.14", + "version": "v3.4.15", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", @@ -1787,16 +1916,16 @@ }, { "name": "symfony/filesystem", - "version": "v3.4.14", + "version": "v3.4.15", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "a59f917e3c5d82332514cb4538387638f5bde2d6" + "reference": "285ce5005cb01a0aeaa5b0cf590bd0cc40bb631c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/a59f917e3c5d82332514cb4538387638f5bde2d6", - "reference": "a59f917e3c5d82332514cb4538387638f5bde2d6", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/285ce5005cb01a0aeaa5b0cf590bd0cc40bb631c", + "reference": "285ce5005cb01a0aeaa5b0cf590bd0cc40bb631c", "shasum": "" }, "require": { @@ -1833,11 +1962,11 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2018-07-26T11:19:56+00:00" + "time": "2018-08-10T07:29:05+00:00" }, { "name": "symfony/finder", - "version": "v3.4.14", + "version": "v3.4.15", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", @@ -2003,16 +2132,16 @@ }, { "name": "symfony/process", - "version": "v3.4.14", + "version": "v3.4.15", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "0414db29bd770ec5a4152683e655f55efd4fa60f" + "reference": "4d6b125d5293cbceedc2aa10f2c71617e76262e7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/0414db29bd770ec5a4152683e655f55efd4fa60f", - "reference": "0414db29bd770ec5a4152683e655f55efd4fa60f", + "url": "https://api.github.com/repos/symfony/process/zipball/4d6b125d5293cbceedc2aa10f2c71617e76262e7", + "reference": "4d6b125d5293cbceedc2aa10f2c71617e76262e7", "shasum": "" }, "require": { @@ -2048,11 +2177,11 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2018-07-26T11:19:56+00:00" + "time": "2018-08-03T10:42:44+00:00" }, { "name": "symfony/serializer", - "version": "v3.4.14", + "version": "v3.4.15", "source": { "type": "git", "url": "https://github.com/symfony/serializer.git", @@ -2131,7 +2260,7 @@ }, { "name": "symfony/translation", - "version": "v3.4.14", + "version": "v3.4.15", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", @@ -2199,16 +2328,16 @@ }, { "name": "symfony/yaml", - "version": "v3.4.14", + "version": "v3.4.15", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "810af2d35fc72b6cf5c01116806d2b65ccaaf2e2" + "reference": "c2f4812ead9f847cb69e90917ca7502e6892d6b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/810af2d35fc72b6cf5c01116806d2b65ccaaf2e2", - "reference": "810af2d35fc72b6cf5c01116806d2b65ccaaf2e2", + "url": "https://api.github.com/repos/symfony/yaml/zipball/c2f4812ead9f847cb69e90917ca7502e6892d6b8", + "reference": "c2f4812ead9f847cb69e90917ca7502e6892d6b8", "shasum": "" }, "require": { @@ -2254,7 +2383,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2018-07-26T11:19:56+00:00" + "time": "2018-08-10T07:34:36+00:00" }, { "name": "webmozart/assert", @@ -2397,16 +2526,16 @@ }, { "name": "wp-cli/php-cli-tools", - "version": "v0.11.9", + "version": "v0.11.10", "source": { "type": "git", "url": "https://github.com/wp-cli/php-cli-tools.git", - "reference": "766653b45f99c817edb2b05dc23f7ee9a893768d" + "reference": "f99308f92487efe18b5aac2057240fe5bb542374" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/php-cli-tools/zipball/766653b45f99c817edb2b05dc23f7ee9a893768d", - "reference": "766653b45f99c817edb2b05dc23f7ee9a893768d", + "url": "https://api.github.com/repos/wp-cli/php-cli-tools/zipball/f99308f92487efe18b5aac2057240fe5bb542374", + "reference": "f99308f92487efe18b5aac2057240fe5bb542374", "shasum": "" }, "require": { @@ -2443,7 +2572,7 @@ "cli", "console" ], - "time": "2018-04-20T08:11:30+00:00" + "time": "2018-08-22T10:11:06+00:00" } ], "packages-dev": [ @@ -3328,7 +3457,7 @@ }, { "name": "symfony/class-loader", - "version": "v3.4.14", + "version": "v3.4.15", "source": { "type": "git", "url": "https://github.com/symfony/class-loader.git", @@ -3479,17 +3608,12 @@ "aliases": [], "minimum-stability": "dev", "stability-flags": { - "acmephp/core": 20, - "easyengine/admin-tools-command": 20, - "easyengine/auth-command": 20, - "easyengine/mailhog-command": 20, "roave/security-advisories": 20 }, "prefer-stable": true, "prefer-lowest": false, "platform": { - "php": ">=7.0", - "ext-openssl": "*" + "php": ">=7.0" }, "platform-dev": [], "platform-overrides": { From 308fe434806e56d91298c6998890c643b2bfa91d Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Fri, 7 Sep 2018 15:16:14 +0530 Subject: [PATCH 0454/1044] Bring if condition check outside the loop Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/utils.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/php/utils.php b/php/utils.php index 1e42520fe..cc8659420 100644 --- a/php/utils.php +++ b/php/utils.php @@ -1519,11 +1519,13 @@ function format_table( $items, $log_in_file = false ) { $lines = array_slice( $item_table->getDisplayLines(), 3 ); array_pop( $lines ); $delem = $item_table->getDisplayLines()[0]; - foreach ( $lines as $line ) { - if ( $log_in_file ) { + if ( $log_in_file ) { + foreach ( $lines as $line ) { \EE::log( $delem ); \EE::log( $line ); - } else { + } + } else { + foreach ( $lines as $line ) { \EE::line( $delem ); \EE::line( $line ); } From 2deeeacfb6f0c0f5fb002384c94fd05c08310b48 Mon Sep 17 00:00:00 2001 From: sagar <sagar.nasit@rtcamp.com> Date: Mon, 10 Sep 2018 11:47:06 +0530 Subject: [PATCH 0455/1044] Move migration execution to individual packages --- php/EE/Migration/Executor.php | 104 ++++++++++++++++++++++------------ php/EE/Model/Migration.php | 2 +- php/class-ee-db.php | 56 +----------------- 3 files changed, 70 insertions(+), 92 deletions(-) diff --git a/php/EE/Migration/Executor.php b/php/EE/Migration/Executor.php index bcc0ebfef..fb847612d 100644 --- a/php/EE/Migration/Executor.php +++ b/php/EE/Migration/Executor.php @@ -9,34 +9,59 @@ class Executor { - const MIGRATION_PATH = EE_ROOT . '/migrations'; + /** + * Executes all pending migrations + */ + public static function execute_migrations() { - /** - * Executes all pending migrations - */ - public static function execute_migrations() { + Utils\delem_log( "ee migration start" ); + EE::log( "Migrating EasyEngine data to new version" ); - Utils\delem_log( "ee migration start" ); - EE::log( "Migrating EasyEngine data to new version" ); + $migration_paths = self::get_migration_paths(); - $migrations = self::get_migrations_to_execute(); + if ( empty( $migration_paths ) ) { + EE::success( 'Nothing to migrate' ); + exit( 0 ); + } - if( empty( $migrations ) ) { - EE::success( "Noting to migrate" ); - exit( 0 ); - } + $migrations = []; - sort( $migrations ); + foreach ( $migration_paths as $package_path ) { + $migrations[] = self::get_migrations_to_execute( $package_path ); + } - try { - self::execute_migration_stack( $migrations ); - } catch( \Throwable $e ) { - Utils\delem_log( "ee migration ended abruptly" ); - exit( 1 ); - } + $migrations = array_merge( ...$migrations ); - EE::success( "Successfully migrated EasyEngine" ); - } + if ( empty( $migrations ) ) { + EE::success( 'Nothing to migrate' ); + } + + sort( $migrations ); + + try { + self::execute_migration_stack( $migrations ); + } catch ( \Throwable $e ) { + Utils\delem_log( 'ee migration ended abruptly' ); + exit( 1 ); + } + + EE::success( "Successfully migrated EasyEngine" ); + } + + /** + * @return array of available migration paths + */ + private static function get_migration_paths() { + + $migration_paths = glob( EE_ROOT . '/vendor/easyengine/*/migrations' ); + $ee_path = glob( EE_ROOT . '/migrations' ); + + // set migration path for easyengine. + if ( ! empty( $ee_path ) ) { + $migration_paths[] = $ee_path[0]; + } + return $migration_paths; + } /** * Executes all migrations passed to it recursively. @@ -47,7 +72,7 @@ private static function execute_migration_stack( $migrations ) { return; } - $migration_path = self::get_migration_path( $migrations[0] ); + $migration_path = self:: get_migration_path( $migrations[0] ); $migration_class_name = self::get_migration_class_name( $migrations[0] ); if( ! file_exists( $migration_path ) ) { @@ -93,39 +118,46 @@ private static function execute_migration_stack( $migrations ) { } } - private static function get_migrations_to_execute() { + private static function get_migrations_to_execute( $path ) { return array_values( array_diff( - self::get_migrations_from_fs(), + self::get_migrations_from_fs( $path ), self::get_migrations_from_db() ) ); } private static function get_migrations_from_db() { - return Migration::all(); + return Migration::get_migrations(); } - private static function get_migrations_from_fs() { + private static function get_migrations_from_fs( $path ) { // array_slice is used to remove . and .. returned by scandir() - $migrations = array_slice( scandir( self::MIGRATION_PATH ), 2 ); + $migrations = array_slice( scandir( $path ), 2 ); array_walk( $migrations, function( &$migration, $index ) { $migration = rtrim( $migration, '.php' ); }); return $migrations; } - private static function get_migration_path( $migration_name ) { - return self::MIGRATION_PATH . $migration_name . '.php' ; - } + private static function get_migration_path( $migration_name ) { + preg_match( '/^\d*[_]([a-zA-Z-]*)[_]/', $migration_name, $matches ); + + if ( 'easyengine' === $matches[1] ) { + return EE_ROOT . "/migrations/$migration_name.php"; + } else { + return EE_ROOT . "/vendor/easyengine/$matches[1]/migrations/$migration_name.php"; + } + + } private static function get_migration_class_name( $migration_name ) { - // Convet snake_case to CamelCase - $class_name = self::camelize( $migration_name ); - // Replace dot with underscore - $class_name = str_replace( '.', '_', $class_name ); - // Remove date from it - $class_name = preg_replace( '/^\d*(?=[A-Z])/', '', $class_name ); + // Remove date and package name from it + $class_name = preg_replace( '/(^\d*)[_]([a-zA-Z-]*[_])/', '', $migration_name ); + // Convet snake_case to CamelCase + $class_name = self::camelize( $class_name ); + // Replace dot with underscore + $class_name = str_replace( '.', '_', $class_name ); return "\EE\Migration\\$class_name"; } diff --git a/php/EE/Model/Migration.php b/php/EE/Model/Migration.php index 32a21d9bd..5991d7a07 100644 --- a/php/EE/Model/Migration.php +++ b/php/EE/Model/Migration.php @@ -14,7 +14,7 @@ class Migration extends Base { */ public static function get_migrations() { - $db = new EE_DB(); + $db = new \EE_DB(); $migrations = $db->table( 'migrations' ) ->select( 'migration' ) ->get(); diff --git a/php/class-ee-db.php b/php/class-ee-db.php index 0533eb362..4ac332af8 100644 --- a/php/class-ee-db.php +++ b/php/class-ee-db.php @@ -57,67 +57,13 @@ private static function create_required_tables() { EE::error( $exception->getMessage() ); } - $query = 'CREATE TABLE sites ( - id INTEGER NOT NULL, - site_url VARCHAR NOT NULL, - site_type VARCHAR NOT NULL, - site_fs_path VARCHAR NOT NULL, - site_enabled BOOLEAN NOT NULL DEFAULT 1, - site_ssl VARCHAR, - site_ssl_wildcard BOOLEAN NOT NULL DEFAULT 0, - cache_nginx_browser BOOLEAN NOT NULL DEFAULT 0, - cache_nginx_fullpage BOOLEAN NOT NULL DEFAULT 0, - cache_mysql_query BOOLEAN NOT NULL DEFAULT 0, - cache_app_object BOOLEAN NOT NULL DEFAULT 0, - php_version VARCHAR, - db_name VARCHAR, - db_user VARCHAR, - db_password VARCHAR, - db_root_password VARCHAR, - db_host VARCHAR, - db_port VARCHAR, - app_sub_type VARCHAR, - app_admin_url VARCHAR, - app_admin_email VARCHAR, - app_admin_username VARCHAR, - app_admin_password VARCHAR, - app_mail VARCHAR, - admin_tools BOOLEAN NOT NULL DEFAULT 0, - created_on DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - modified_on DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - site_auth_scope VARCHAR, - site_auth_username VARCHAR, - site_auth_password VARCHAR, - PRIMARY KEY (id), - UNIQUE (site_url), - CHECK (site_enabled IN (0, 1)) - );'; - - $query .= 'CREATE TABLE site_meta ( - id INTEGER, - site_id INTEGER NOT NULL, - meta_key VARCHAR, - meta_value VARCHAR, - PRIMARY KEY (id), - FOREIGN KEY (site_id) REFERENCES sites(id) - );'; - - $query .= 'CREATE TABLE migrations ( + $query = 'CREATE TABLE migrations ( id INTEGER, migration VARCHAR, timestamp DATETIME, PRIMARY KEY (id) );'; - $query .= 'CREATE TABLE cron ( - id INTEGER, - site_url VARCHAR, - command VARCHAR, - schedule VARCHAR, - PRIMARY KEY (id), - FOREIGN KEY (site_url) REFERENCES sites(site_url) - );'; - $query .= 'CREATE TABLE auth_users ( id INTEGER, site_url VARCHAR NOT NULL, From 43183edecb1be01785070c4e3fc23f53f53ed06f Mon Sep 17 00:00:00 2001 From: sagar <sagar.nasit@rtcamp.com> Date: Mon, 10 Sep 2018 12:14:28 +0530 Subject: [PATCH 0456/1044] Add doc blocks --- php/EE/Migration/Executor.php | 26 ++++++++++++++++++++++++++ php/class-ee-db.php | 9 --------- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/php/EE/Migration/Executor.php b/php/EE/Migration/Executor.php index fb847612d..6fc214f2f 100644 --- a/php/EE/Migration/Executor.php +++ b/php/EE/Migration/Executor.php @@ -118,6 +118,13 @@ private static function execute_migration_stack( $migrations ) { } } + /** + * Get migrations need to be executed. + * + * @param $path path to the migration directory. + * + * @return array + */ private static function get_migrations_to_execute( $path ) { return array_values( array_diff( @@ -127,10 +134,22 @@ private static function get_migrations_to_execute( $path ) { ); } + /** + * Get already migrated migrations. + * + * @return array + */ private static function get_migrations_from_db() { return Migration::get_migrations(); } + /** + * Get migrations from filesystem. + * + * @param $path path to the migrations on filesystem. + * + * @return array + */ private static function get_migrations_from_fs( $path ) { // array_slice is used to remove . and .. returned by scandir() $migrations = array_slice( scandir( $path ), 2 ); @@ -140,6 +159,13 @@ private static function get_migrations_from_fs( $path ) { return $migrations; } + /** + * Get path of the migration file. + * + * @param $migration_name name of a migration file. + * + * @return string path of a migration file. + */ private static function get_migration_path( $migration_name ) { preg_match( '/^\d*[_]([a-zA-Z-]*)[_]/', $migration_name, $matches ); diff --git a/php/class-ee-db.php b/php/class-ee-db.php index 4ac332af8..0156fd711 100644 --- a/php/class-ee-db.php +++ b/php/class-ee-db.php @@ -64,15 +64,6 @@ private static function create_required_tables() { PRIMARY KEY (id) );'; - $query .= 'CREATE TABLE auth_users ( - id INTEGER, - site_url VARCHAR NOT NULL, - username VARCHAR NOT NULL, - password VARCHAR NOT NULL, - scope VARCHAR NOT NULL, - PRIMARY KEY (id) - );'; - try { self::$pdo->exec( $query ); } catch ( PDOException $exception ) { From 4fd8bc5ee34ee7648978b2097387872308bd920e Mon Sep 17 00:00:00 2001 From: sagar <sagar.nasit@rtcamp.com> Date: Mon, 10 Sep 2018 12:19:17 +0530 Subject: [PATCH 0457/1044] Fix phpcs on php/EE/Migration/Executor.php --- php/EE/Migration/Executor.php | 179 +++++++++++++++++----------------- 1 file changed, 88 insertions(+), 91 deletions(-) diff --git a/php/EE/Migration/Executor.php b/php/EE/Migration/Executor.php index 6fc214f2f..b1372064f 100644 --- a/php/EE/Migration/Executor.php +++ b/php/EE/Migration/Executor.php @@ -14,8 +14,8 @@ class Executor { */ public static function execute_migrations() { - Utils\delem_log( "ee migration start" ); - EE::log( "Migrating EasyEngine data to new version" ); + Utils\delem_log( 'ee migration start' ); + EE::log( 'Migrating EasyEngine data to new version' ); $migration_paths = self::get_migration_paths(); @@ -45,7 +45,7 @@ public static function execute_migrations() { exit( 1 ); } - EE::success( "Successfully migrated EasyEngine" ); + EE::success( 'Successfully migrated EasyEngine' ); } /** @@ -63,60 +63,58 @@ private static function get_migration_paths() { return $migration_paths; } - /** - * Executes all migrations passed to it recursively. - * Also undo'es all migration if there was error executing any migration - */ - private static function execute_migration_stack( $migrations ) { - if( empty( $migrations ) ) { - return; - } - - $migration_path = self:: get_migration_path( $migrations[0] ); - $migration_class_name = self::get_migration_class_name( $migrations[0] ); - - if( ! file_exists( $migration_path ) ) { - EE::error( "Unable to find migration file at $migration_path", false ); - throw new Exception(); - } - - require( $migration_path ); - - try { - $migration = new $migration_class_name; - if( ! $migration instanceof Base ) { - throw new \Exception( "$migration_class_name is not a instance of base migration class" ); - } - } - catch( \Throwable $e ) { - EE::error( $e->getMessage(), false ); - throw $e; - } - - try { - EE::log( "Migrating: $migrations[0]" ); - $migration->up(); - - Migration::create([ - 'migration' => $migrations[0], - 'timestamp' => date('Y-m-d H:i:s'), - ]); - - $migration->status = 'complete'; - EE::log( "Migrated: $migrations[0]" ); - $remaining_migrations = array_splice( $migrations, 1, count( $migrations ) ); - self::execute_migration_stack( $remaining_migrations ); - } - catch( \Throwable $e ) { - if( $migration->status !== 'complete' ) { - EE::error( "Errors were encountered while processing: $migrations[0]\n" . $e->getMessage(), false ); - } - EE::log( "Reverting: $migrations[0]" ); - $migration->down(); - EE::log( "Reverted: $migrations[0]" ); - throw $e; - } - } + /** + * Executes all migrations passed to it recursively. + * Also undo'es all migration if there was error executing any migration + */ + private static function execute_migration_stack( $migrations ) { + if ( empty( $migrations ) ) { + return; + } + + $migration_path = self::get_migration_path( $migrations[0] ); + $migration_class_name = self::get_migration_class_name( $migrations[0] ); + + if ( ! file_exists( $migration_path ) ) { + EE::error( "Unable to find migration file at $migration_path", false ); + throw new Exception(); + } + + require( $migration_path ); + + try { + $migration = new $migration_class_name; + if ( ! $migration instanceof Base ) { + throw new \Exception( "$migration_class_name is not a instance of base migration class" ); + } + } catch ( \Throwable $e ) { + EE::error( $e->getMessage(), false ); + throw $e; + } + + try { + EE::log( "Migrating: $migrations[0]" ); + $migration->up(); + + Migration::create( [ + 'migration' => $migrations[0], + 'timestamp' => date( 'Y-m-d H:i:s' ), + ] ); + + $migration->status = 'complete'; + EE::log( "Migrated: $migrations[0]" ); + $remaining_migrations = array_splice( $migrations, 1, count( $migrations ) ); + self::execute_migration_stack( $remaining_migrations ); + } catch ( \Throwable $e ) { + if ( 'complete' !== $migration->status ) { + EE::error( "Errors were encountered while processing: $migrations[0]\n" . $e->getMessage(), false ); + } + EE::log( "Reverting: $migrations[0]" ); + $migration->down(); + EE::log( "Reverted: $migrations[0]" ); + throw $e; + } + } /** * Get migrations need to be executed. @@ -125,23 +123,23 @@ private static function execute_migration_stack( $migrations ) { * * @return array */ - private static function get_migrations_to_execute( $path ) { - return array_values( - array_diff( - self::get_migrations_from_fs( $path ), - self::get_migrations_from_db() - ) - ); - } + private static function get_migrations_to_execute( $path ) { + return array_values( + array_diff( + self::get_migrations_from_fs( $path ), + self::get_migrations_from_db() + ) + ); + } /** * Get already migrated migrations. * * @return array */ - private static function get_migrations_from_db() { - return Migration::get_migrations(); - } + private static function get_migrations_from_db() { + return Migration::get_migrations(); + } /** * Get migrations from filesystem. @@ -150,14 +148,14 @@ private static function get_migrations_from_db() { * * @return array */ - private static function get_migrations_from_fs( $path ) { - // array_slice is used to remove . and .. returned by scandir() - $migrations = array_slice( scandir( $path ), 2 ); - array_walk( $migrations, function( &$migration, $index ) { - $migration = rtrim( $migration, '.php' ); - }); - return $migrations; - } + private static function get_migrations_from_fs( $path ) { + // array_slice is used to remove . and .. returned by scandir() + $migrations = array_slice( scandir( $path ), 2 ); + array_walk( $migrations, function ( &$migration, $index ) { + $migration = rtrim( $migration, '.php' ); + } ); + return $migrations; + } /** * Get path of the migration file. @@ -177,19 +175,18 @@ private static function get_migration_path( $migration_name ) { } - private static function get_migration_class_name( $migration_name ) { - // Remove date and package name from it - $class_name = preg_replace( '/(^\d*)[_]([a-zA-Z-]*[_])/', '', $migration_name ); - // Convet snake_case to CamelCase - $class_name = self::camelize( $class_name ); - // Replace dot with underscore - $class_name = str_replace( '.', '_', $class_name ); - - return "\EE\Migration\\$class_name"; - } - - private static function camelize($input, $separator = '_') - { - return str_replace($separator, '', ucwords($input, $separator)); - } + private static function get_migration_class_name( $migration_name ) { + // Remove date and package name from it + $class_name = preg_replace( '/(^\d*)[_]([a-zA-Z-]*[_])/', '', $migration_name ); + // Convet snake_case to CamelCase + $class_name = self::camelize( $class_name ); + // Replace dot with underscore + $class_name = str_replace( '.', '_', $class_name ); + + return "\EE\Migration\\$class_name"; + } + + private static function camelize( $input, $separator = '_' ) { + return str_replace( $separator, '', ucwords( $input, $separator ) ); + } } From 9263c689c1fcb481d2872cd9b481d3341082714e Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 10 Sep 2018 17:02:14 +0530 Subject: [PATCH 0458/1044] Add template folder for site-types in phar Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- utils/make-phar.php | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/make-phar.php b/utils/make-phar.php index bfa4cc730..7e4ef7d91 100644 --- a/utils/make-phar.php +++ b/utils/make-phar.php @@ -242,6 +242,7 @@ function get_composer_versions( $current_version ) { ->files() ->ignoreDotFiles(false) ->in(EE_VENDOR_DIR . '/easyengine/*-command/templates') + ->in(EE_VENDOR_DIR . '/easyengine/site-type-*/templates') ->name('*.mustache') ->name('.env.mustache'); From b207b6ce2747d33d35b63314ac16d8bf4987c102 Mon Sep 17 00:00:00 2001 From: Mriyam Tamuli <mbtamuli@gmail.com> Date: Mon, 10 Sep 2018 18:09:37 +0530 Subject: [PATCH 0459/1044] Bump ee version and docker image version Signed-off-by: Mriyam Tamuli <mbtamuli@gmail.com> --- VERSION | 2 +- img-versions.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index e0ce22a94..93699eec6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.0.0-beta.5 +4.0.0-beta.6 diff --git a/img-versions.json b/img-versions.json index eb24e2c9a..ad075590b 100644 --- a/img-versions.json +++ b/img-versions.json @@ -2,9 +2,9 @@ "easyengine/cron": "v4.0.0-beta.5", "easyengine/mailhog": "v4.0.0-beta.5", "easyengine/mariadb": "v4.0.0-beta.5", - "easyengine/nginx-proxy": "v4.0.0-beta.5", + "easyengine/nginx-proxy": "v4.0.0-beta.6", "easyengine/nginx": "v4.0.0-beta.5", - "easyengine/php": "v4.0.0-beta.5", + "easyengine/php": "v4.0.0-beta.6", "easyengine/phpmyadmin": "v4.0.0-beta.5", "easyengine/postfix": "v4.0.0-beta.5", "easyengine/redis": "v4.0.0-beta.5" From cef11227da024dbc54da076172d23878eecc2e34 Mon Sep 17 00:00:00 2001 From: Mriyam Tamuli <mbtamuli@gmail.com> Date: Mon, 10 Sep 2018 20:40:00 +0530 Subject: [PATCH 0460/1044] Update composer.lock Signed-off-by: Mriyam Tamuli <mbtamuli@gmail.com> --- composer.lock | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/composer.lock b/composer.lock index 0663ee106..e23cd6c34 100644 --- a/composer.lock +++ b/composer.lock @@ -777,12 +777,12 @@ "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-php.git", - "reference": "8440ab9351148ccb5977f654450e9ba8dbc26fe9" + "reference": "a1b4154d2a53d83c19c7ad1ca17017119b401678" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/8440ab9351148ccb5977f654450e9ba8dbc26fe9", - "reference": "8440ab9351148ccb5977f654450e9ba8dbc26fe9", + "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/a1b4154d2a53d83c19c7ad1ca17017119b401678", + "reference": "a1b4154d2a53d83c19c7ad1ca17017119b401678", "shasum": "" }, "require-dev": { @@ -798,7 +798,10 @@ "autoload": { "psr-4": { "": "src/" - } + }, + "files": [ + "site-type-php.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -806,7 +809,7 @@ ], "description": "EasyEngine package for PHP site creation.", "homepage": "https://github.com/easyengine/site-type-php", - "time": "2018-09-06T12:10:44+00:00" + "time": "2018-09-10T14:58:43+00:00" }, { "name": "easyengine/site-type-wp", From 4aeab9208b99ec562a45f4c9624ce16e89be6d89 Mon Sep 17 00:00:00 2001 From: Abhijit Rakas <abhijit.rakas@rtcamp.com> Date: Wed, 12 Sep 2018 16:21:02 +0530 Subject: [PATCH 0461/1044] Add badge poser for EE --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fa2981b85..ec7b616b0 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ <img width="150" height="150" src="https://easyengine.io/wp-content/uploads/2015/11/cropped-favicon-easyengine.png" alt="EasyEngine Logo" align="right" /> [![Build Status](https://travis-ci.org/EasyEngine/easyengine.svg?branch=master-v4)](https://travis-ci.org/EasyEngine/easyengine) -[![Join EasyEngine Slack Channel](http://slack.easyengine.io/badge.svg)](http://slack.easyengine.io/) +[![Join EasyEngine Slack Channel](http://slack.easyengine.io/badge.svg)](http://slack.easyengine.io/) [![Latest Stable Version](https://poser.pugx.org/easyengine/easyengine/v/stable)](https://packagist.org/packages/easyengine/easyengine) [![Latest Unstable Version](https://poser.pugx.org/easyengine/easyengine/v/unstable)](https://packagist.org/packages/easyengine/easyengine) [![License](https://poser.pugx.org/easyengine/easyengine/license)](https://packagist.org/packages/easyengine/easyengine) ## Requirements From ee74260b60874514ab988e221ddeb16e4b2e6a38 Mon Sep 17 00:00:00 2001 From: sagar <sagar.nasit@rtcamp.com> Date: Thu, 13 Sep 2018 18:27:16 +0530 Subject: [PATCH 0462/1044] Update paths of config,db,logs, and sites --- .travis.yml | 4 ++-- ci/test-env-install.sh | 2 +- features/bootstrap/FeatureContext.php | 2 +- php/EE/Migration/Containers.php | 12 +++++------ php/EE/Runner.php | 31 +++++++++++---------------- php/class-ee.php | 2 +- php/init-ee.php | 2 +- 7 files changed, 25 insertions(+), 30 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5e218271c..c77225114 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,8 +41,8 @@ script: - ./ci/test-commands.sh after_script: - - cat /opt/easyengine/install.log - - cat /opt/easyengine/ee.log + - cat /opt/easyengine/logs/install.log + - cat /opt/easyengine/logs/ee.log jobs: include: diff --git a/ci/test-env-install.sh b/ci/test-env-install.sh index ebaaf8a2c..19054439d 100755 --- a/ci/test-env-install.sh +++ b/ci/test-env-install.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash function setup_test_requirements() { - readonly LOG_FILE="/opt/easyengine/install.log" + readonly LOG_FILE="/opt/easyengine/logs/install.log" # Adding software-properties-common for add-apt-repository. apt-get install -y software-properties-common # Adding ondrej/php repository for installing php, this works for all ubuntu flavours. diff --git a/features/bootstrap/FeatureContext.php b/features/bootstrap/FeatureContext.php index 4238ab1fd..11801a10e 100644 --- a/features/bootstrap/FeatureContext.php +++ b/features/bootstrap/FeatureContext.php @@ -14,7 +14,7 @@ define( 'EE', true ); define( 'EE_VERSION', trim( file_get_contents( EE_ROOT . '/VERSION' ) ) ); -define( 'EE_CONF_ROOT', '/opt/easyengine' ); +define( 'EE_OPT_ROOT', '/opt/easyengine' ); require_once EE_ROOT . '/php/bootstrap.php'; diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index 626186054..57a3673df 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -136,9 +136,9 @@ private static function migrate_global_containers() { * @throws \Exception */ public static function nginxproxy_container_up() { - $EE_CONF_ROOT = EE_CONF_ROOT; + $EE_OPT_ROOT = EE_OPT_ROOT; $nginx_proxy_image = 'easyengine/nginx-proxy:v' . EE_VERSION; - $ee_proxy_command = "docker run --name ee-nginx-proxy -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v $EE_CONF_ROOT/nginx/certs:/etc/nginx/certs -v $EE_CONF_ROOT/nginx/dhparam:/etc/nginx/dhparam -v $EE_CONF_ROOT/nginx/conf.d:/etc/nginx/conf.d -v $EE_CONF_ROOT/nginx/htpasswd:/etc/nginx/htpasswd -v $EE_CONF_ROOT/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v $EE_CONF_ROOT:/app/ee4 -v /usr/share/nginx/html $nginx_proxy_image"; + $ee_proxy_command = "docker run --name ee-nginx-proxy -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v $EE_OPT_ROOT/nginx/certs:/etc/nginx/certs -v $EE_OPT_ROOT/nginx/dhparam:/etc/nginx/dhparam -v $EE_OPT_ROOT/nginx/conf.d:/etc/nginx/conf.d -v $EE_OPT_ROOT/nginx/htpasswd:/etc/nginx/htpasswd -v $EE_OPT_ROOT/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v $EE_OPT_ROOT:/app/ee4 -v /usr/share/nginx/html $nginx_proxy_image"; default_launch( 'docker rm -f ee-nginx-proxy', false, true ); @@ -156,9 +156,9 @@ public static function nginxproxy_container_up() { * @throws \Exception */ public static function nginxproxy_container_down( $existing_nginx_proxy_image ) { - $EE_CONF_ROOT = EE_CONF_ROOT; + $EE_OPT_ROOT = EE_OPT_ROOT; $nginx_proxy_image = trim( $existing_nginx_proxy_image->stout ); - $ee_proxy_command = "docker run --name ee-nginx-proxy -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v $EE_CONF_ROOT/nginx/certs:/etc/nginx/certs -v $EE_CONF_ROOT/nginx/dhparam:/etc/nginx/dhparam -v $EE_CONF_ROOT/nginx/conf.d:/etc/nginx/conf.d -v $EE_CONF_ROOT/nginx/htpasswd:/etc/nginx/htpasswd -v $EE_CONF_ROOT/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v $EE_CONF_ROOT:/app/ee4 -v /usr/share/nginx/html $nginx_proxy_image"; + $ee_proxy_command = "docker run --name ee-nginx-proxy -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v $EE_OPT_ROOT/nginx/certs:/etc/nginx/certs -v $EE_OPT_ROOT/nginx/dhparam:/etc/nginx/dhparam -v $EE_OPT_ROOT/nginx/conf.d:/etc/nginx/conf.d -v $EE_OPT_ROOT/nginx/htpasswd:/etc/nginx/htpasswd -v $EE_OPT_ROOT/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v $EE_OPT_ROOT:/app/ee4 -v /usr/share/nginx/html $nginx_proxy_image"; default_launch( 'docker rm -f ee-nginx-proxy', false, true ); @@ -174,7 +174,7 @@ public static function nginxproxy_container_down( $existing_nginx_proxy_image ) */ public static function cron_container_up() { $cron_image = 'easyengine/cron:v' . EE_VERSION; - $cron_scheduler_run_command = 'docker run --name ee-cron-scheduler --restart=always -d -v ' . EE_CONF_ROOT . '/cron:/etc/ofelia:ro -v /var/run/docker.sock:/var/run/docker.sock:ro ' . $cron_image; + $cron_scheduler_run_command = 'docker run --name ee-cron-scheduler --restart=always -d -v ' . EE_OPT_ROOT . '/cron:/etc/ofelia:ro -v /var/run/docker.sock:/var/run/docker.sock:ro ' . $cron_image; default_launch( 'docker rm -f ee-cron-scheduler', false, true ); @@ -192,7 +192,7 @@ public static function cron_container_up() { */ public static function cron_container_down( $existing_cron_image ) { $cron_image = trim( $existing_cron_image->stdout ); - $cron_scheduler_run_command = 'docker run --name ee-cron-scheduler --restart=always -d -v ' . EE_CONF_ROOT . '/cron:/etc/ofelia:ro -v /var/run/docker.sock:/var/run/docker.sock:ro ' . $cron_image; + $cron_scheduler_run_command = 'docker run --name ee-cron-scheduler --restart=always -d -v ' . EE_OPT_ROOT . '/cron:/etc/ofelia:ro -v /var/run/docker.sock:/var/run/docker.sock:ro ' . $cron_image; default_launch( 'docker rm -f ee-cron-scheduler', false, true ); diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 248f042f5..059fbe665 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -49,15 +49,10 @@ public function __get( $key ) { */ private function init_ee() { - $this->ensure_present_in_config( 'sites_path', Utils\get_home_dir(). '/ee-sites' ); $this->ensure_present_in_config( 'locale', 'en_US' ); $this->ensure_present_in_config( 'ee_installer_version', 'stable' ); - if ( ! is_dir( $this->config['sites_path'] ) ) { - mkdir( $this->config['sites_path'] ); - } - define( 'WEBROOT', \EE\Utils\trailingslashit( $this->config['sites_path'] ) ); - define( 'DB', EE_CONF_ROOT.'/ee.sqlite' ); + define( 'DB', EE_OPT_ROOT.'/db/ee.sqlite' ); define( 'LOCALHOST_IP', '127.0.0.1' ); } @@ -116,7 +111,7 @@ public function get_global_config_path() { $config_path = getenv( 'EE_CONFIG_PATH' ); $this->_global_config_path_debug = 'Using global config from EE_CONFIG_PATH env var: ' . $config_path; } else { - $config_path = EE_CONF_ROOT . '/config.yml'; + $config_path = EE_OPT_ROOT . '/config/config.yml'; $this->_global_config_path_debug = 'Using default global config: ' . $config_path; } @@ -138,8 +133,8 @@ public function get_global_config_path() { */ public function get_project_config_path() { $config_files = array( - 'ee.local.yml', - 'ee.yml', + '/config/ee.local.yml', + '/config/ee.yml', ); // Stop looking upward when we find we have emerged from a subdirectory @@ -170,7 +165,7 @@ public function get_packages_dir_path() { if ( getenv( 'EE_PACKAGES_DIR' ) ) { $packages_dir = Utils\trailingslashit( getenv( 'EE_PACKAGES_DIR' ) ); } else { - $packages_dir = EE_CONF_ROOT . '/packages'; + $packages_dir = EE_OPT_ROOT . '/packages'; } return $packages_dir; } @@ -478,25 +473,25 @@ public function init_logger() { EE::set_logger( $logger ); // Create the config directory if not exist for file logger to initialize. - if ( ! is_dir( EE_CONF_ROOT ) ) { - shell_exec('mkdir -p ' . EE_CONF_ROOT); + if ( ! is_dir( EE_OPT_ROOT ) ) { + shell_exec('mkdir -p ' . EE_OPT_ROOT); } - if ( ! is_writable( EE_CONF_ROOT ) ) { - EE::err( 'Config root: ' . EE_CONF_ROOT . ' is not writable by EasyEngine' ); + if ( ! is_writable( EE_OPT_ROOT ) ) { + EE::err( 'Config root: ' . EE_OPT_ROOT . ' is not writable by EasyEngine' ); } if ( !empty( $this->arguments[0] ) && 'cli' === $this->arguments[0] && ! empty( $this->arguments[1] ) && 'info' === $this->arguments[1] ) { $file_logging_path = '/dev/null'; } else { - $file_logging_path = EE_CONF_ROOT . '/ee.log'; + $file_logging_path = EE_OPT_ROOT . '/logs/ee.log'; } $dateFormat = 'd-m-Y H:i:s'; $output = "[%datetime%] %channel%.%level_name%: %message% %context% %extra%\n"; $formatter = new \Monolog\Formatter\LineFormatter( $output, $dateFormat, false, true ); - $stream = new \Monolog\Handler\StreamHandler( EE_CONF_ROOT . '/ee.log', Logger::DEBUG ); + $stream = new \Monolog\Handler\StreamHandler( EE_OPT_ROOT . '/logs/ee.log', Logger::DEBUG ); $stream->setFormatter( $formatter ); $file_logger = new \Monolog\Logger( 'ee' ); $file_logger->pushHandler( $stream ); @@ -569,7 +564,7 @@ public function init_config() { * @param $default Default value to use if $var is not set. */ public function ensure_present_in_config( $var, $default ) { - $config_file_path = getenv( 'EE_CONFIG_PATH' ) ? getenv( 'EE_CONFIG_PATH' ) : EE_CONF_ROOT . '/config.yml'; + $config_file_path = getenv( 'EE_CONFIG_PATH' ) ? getenv( 'EE_CONFIG_PATH' ) : EE_OPT_ROOT . '/config/config.yml'; $existing_config = Spyc::YAMLLoad( $config_file_path ); if ( ! isset( $existing_config[$var] ) ) { $this->config[$var] = $default; @@ -615,7 +610,7 @@ private function run_alias_group( $aliases ) { if ( getenv( 'EE_CONFIG_PATH' ) ) { $config_path = getenv( 'EE_CONFIG_PATH' ); } else { - $config_path = EE_CONF_ROOT . '/config.yml'; + $config_path = EE_OPT_ROOT . '/config/config.yml'; } $config_path = escapeshellarg( $config_path ); diff --git a/php/class-ee.php b/php/class-ee.php index 472af447b..65b358b1b 100644 --- a/php/class-ee.php +++ b/php/class-ee.php @@ -931,7 +931,7 @@ public static function launch_self( $command, $args = array(), $assoc_args = arr if ( getenv( 'EE_CONFIG_PATH' ) ) { $config_path = getenv( 'EE_CONFIG_PATH' ); } else { - $config_path = EE_CONF_ROOT . '/config.yml'; + $config_path = EE_OPT_ROOT . '/config/config.yml'; } $config_path = escapeshellarg( $config_path ); diff --git a/php/init-ee.php b/php/init-ee.php index d0f389148..c500186a5 100644 --- a/php/init-ee.php +++ b/php/init-ee.php @@ -4,7 +4,7 @@ define( 'EE', true ); define( 'EE_VERSION', trim( file_get_contents( EE_ROOT . '/VERSION' ) ) ); define( 'EE_START_MICROTIME', microtime( true ) ); -define( 'EE_CONF_ROOT', '/opt/easyengine' ); +define( 'EE_OPT_ROOT', '/opt/easyengine' ); define( 'EE_PROXY_TYPE', 'ee-nginx-proxy' ); if ( file_exists( EE_ROOT . '/vendor/autoload.php' ) ) { From 0a7a295fc6e42cb9b377a671553e05b3d09dc4a0 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Thu, 13 Sep 2018 22:22:01 +0530 Subject: [PATCH 0463/1044] Correct update method Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/EE/Model/Base.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/php/EE/Model/Base.php b/php/EE/Model/Base.php index 846cfdb00..2d8ee3baf 100644 --- a/php/EE/Model/Base.php +++ b/php/EE/Model/Base.php @@ -172,7 +172,7 @@ public static function create( $columns = [] ) { * * @return array */ - public static function where( $column, $value='' ) { + public static function where( $column, $value = '' ) { return static::many_array_to_model( EE::db() ->table( static::$table ) @@ -196,7 +196,7 @@ public static function where( $column, $value='' ) { */ public function __get( string $name ) { if ( array_key_exists( $name, $this->fields ) ) { - return $this->fields[$name]; + return $this->fields[ $name ]; } throw new \Exception( "Unable to find variable: $name" ); @@ -282,16 +282,18 @@ public function delete() { /** * Updates current model from database * + * @param array $where Where conditions to update + * @param array $updated_values Updated values + * * @throws \Exception * * @return bool Model updated successfully */ - public function update( $columns ) { - $primary_key_column = static::$primary_key; + public static function update( array $where, array $updated_values ) { return EE::db() ->table( static::$table ) - ->where( $primary_key_column, $this->$primary_key_column ) - ->update( $columns ); + ->where( $where ) + ->update( $updated_values ); } } From ddc8f872dfe38529f9b6f9cb98832ff20400d69e Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Thu, 13 Sep 2018 22:22:33 +0530 Subject: [PATCH 0464/1044] Add auth_ips table Remove scope column Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/class-ee-db.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/php/class-ee-db.php b/php/class-ee-db.php index 0533eb362..d0534cde4 100644 --- a/php/class-ee-db.php +++ b/php/class-ee-db.php @@ -123,7 +123,14 @@ private static function create_required_tables() { site_url VARCHAR NOT NULL, username VARCHAR NOT NULL, password VARCHAR NOT NULL, - scope VARCHAR NOT NULL, + PRIMARY KEY (id) + );'; + + $query .= 'CREATE TABLE auth_ips ( + id INTEGER, + site_url VARCHAR NOT NULL, + ip VARCHAR NOT NULL, + UNIQUE (site_url, ip), PRIMARY KEY (id) );'; From 82ec28dfcad5cc5a5a43f5beba2a25eff67c879d Mon Sep 17 00:00:00 2001 From: sagar <sagar.nasit@rtcamp.com> Date: Fri, 14 Sep 2018 11:46:25 +0530 Subject: [PATCH 0465/1044] Change EE_OPT_ROOT to EE_ROOT_DIR --- features/bootstrap/FeatureContext.php | 2 +- php/EE/Migration/Containers.php | 12 ++++++------ php/EE/Runner.php | 22 +++++++++++----------- php/class-ee.php | 2 +- php/init-ee.php | 2 +- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/features/bootstrap/FeatureContext.php b/features/bootstrap/FeatureContext.php index 11801a10e..be17f11f9 100644 --- a/features/bootstrap/FeatureContext.php +++ b/features/bootstrap/FeatureContext.php @@ -14,7 +14,7 @@ define( 'EE', true ); define( 'EE_VERSION', trim( file_get_contents( EE_ROOT . '/VERSION' ) ) ); -define( 'EE_OPT_ROOT', '/opt/easyengine' ); +define( 'EE_ROOT_DIR', '/opt/easyengine' ); require_once EE_ROOT . '/php/bootstrap.php'; diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index 57a3673df..66502340b 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -136,9 +136,9 @@ private static function migrate_global_containers() { * @throws \Exception */ public static function nginxproxy_container_up() { - $EE_OPT_ROOT = EE_OPT_ROOT; + $EE_ROOT_DIR = EE_ROOT_DIR; $nginx_proxy_image = 'easyengine/nginx-proxy:v' . EE_VERSION; - $ee_proxy_command = "docker run --name ee-nginx-proxy -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v $EE_OPT_ROOT/nginx/certs:/etc/nginx/certs -v $EE_OPT_ROOT/nginx/dhparam:/etc/nginx/dhparam -v $EE_OPT_ROOT/nginx/conf.d:/etc/nginx/conf.d -v $EE_OPT_ROOT/nginx/htpasswd:/etc/nginx/htpasswd -v $EE_OPT_ROOT/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v $EE_OPT_ROOT:/app/ee4 -v /usr/share/nginx/html $nginx_proxy_image"; + $ee_proxy_command = "docker run --name ee-nginx-proxy -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v $EE_ROOT_DIR/nginx/certs:/etc/nginx/certs -v $EE_ROOT_DIR/nginx/dhparam:/etc/nginx/dhparam -v $EE_ROOT_DIR/nginx/conf.d:/etc/nginx/conf.d -v $EE_ROOT_DIR/nginx/htpasswd:/etc/nginx/htpasswd -v $EE_ROOT_DIR/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v $EE_ROOT_DIR:/app/ee4 -v /usr/share/nginx/html $nginx_proxy_image"; default_launch( 'docker rm -f ee-nginx-proxy', false, true ); @@ -156,9 +156,9 @@ public static function nginxproxy_container_up() { * @throws \Exception */ public static function nginxproxy_container_down( $existing_nginx_proxy_image ) { - $EE_OPT_ROOT = EE_OPT_ROOT; + $EE_ROOT_DIR = EE_ROOT_DIR; $nginx_proxy_image = trim( $existing_nginx_proxy_image->stout ); - $ee_proxy_command = "docker run --name ee-nginx-proxy -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v $EE_OPT_ROOT/nginx/certs:/etc/nginx/certs -v $EE_OPT_ROOT/nginx/dhparam:/etc/nginx/dhparam -v $EE_OPT_ROOT/nginx/conf.d:/etc/nginx/conf.d -v $EE_OPT_ROOT/nginx/htpasswd:/etc/nginx/htpasswd -v $EE_OPT_ROOT/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v $EE_OPT_ROOT:/app/ee4 -v /usr/share/nginx/html $nginx_proxy_image"; + $ee_proxy_command = "docker run --name ee-nginx-proxy -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v $EE_ROOT_DIR/nginx/certs:/etc/nginx/certs -v $EE_ROOT_DIR/nginx/dhparam:/etc/nginx/dhparam -v $EE_ROOT_DIR/nginx/conf.d:/etc/nginx/conf.d -v $EE_ROOT_DIR/nginx/htpasswd:/etc/nginx/htpasswd -v $EE_ROOT_DIR/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v $EE_ROOT_DIR:/app/ee4 -v /usr/share/nginx/html $nginx_proxy_image"; default_launch( 'docker rm -f ee-nginx-proxy', false, true ); @@ -174,7 +174,7 @@ public static function nginxproxy_container_down( $existing_nginx_proxy_image ) */ public static function cron_container_up() { $cron_image = 'easyengine/cron:v' . EE_VERSION; - $cron_scheduler_run_command = 'docker run --name ee-cron-scheduler --restart=always -d -v ' . EE_OPT_ROOT . '/cron:/etc/ofelia:ro -v /var/run/docker.sock:/var/run/docker.sock:ro ' . $cron_image; + $cron_scheduler_run_command = 'docker run --name ee-cron-scheduler --restart=always -d -v ' . EE_ROOT_DIR . '/cron:/etc/ofelia:ro -v /var/run/docker.sock:/var/run/docker.sock:ro ' . $cron_image; default_launch( 'docker rm -f ee-cron-scheduler', false, true ); @@ -192,7 +192,7 @@ public static function cron_container_up() { */ public static function cron_container_down( $existing_cron_image ) { $cron_image = trim( $existing_cron_image->stdout ); - $cron_scheduler_run_command = 'docker run --name ee-cron-scheduler --restart=always -d -v ' . EE_OPT_ROOT . '/cron:/etc/ofelia:ro -v /var/run/docker.sock:/var/run/docker.sock:ro ' . $cron_image; + $cron_scheduler_run_command = 'docker run --name ee-cron-scheduler --restart=always -d -v ' . EE_ROOT_DIR . '/cron:/etc/ofelia:ro -v /var/run/docker.sock:/var/run/docker.sock:ro ' . $cron_image; default_launch( 'docker rm -f ee-cron-scheduler', false, true ); diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 059fbe665..0f4c270ee 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -52,7 +52,7 @@ private function init_ee() { $this->ensure_present_in_config( 'locale', 'en_US' ); $this->ensure_present_in_config( 'ee_installer_version', 'stable' ); - define( 'DB', EE_OPT_ROOT.'/db/ee.sqlite' ); + define( 'DB', EE_ROOT_DIR.'/db/ee.sqlite' ); define( 'LOCALHOST_IP', '127.0.0.1' ); } @@ -111,7 +111,7 @@ public function get_global_config_path() { $config_path = getenv( 'EE_CONFIG_PATH' ); $this->_global_config_path_debug = 'Using global config from EE_CONFIG_PATH env var: ' . $config_path; } else { - $config_path = EE_OPT_ROOT . '/config/config.yml'; + $config_path = EE_ROOT_DIR . '/config/config.yml'; $this->_global_config_path_debug = 'Using default global config: ' . $config_path; } @@ -165,7 +165,7 @@ public function get_packages_dir_path() { if ( getenv( 'EE_PACKAGES_DIR' ) ) { $packages_dir = Utils\trailingslashit( getenv( 'EE_PACKAGES_DIR' ) ); } else { - $packages_dir = EE_OPT_ROOT . '/packages'; + $packages_dir = EE_ROOT_DIR . '/packages'; } return $packages_dir; } @@ -473,25 +473,25 @@ public function init_logger() { EE::set_logger( $logger ); // Create the config directory if not exist for file logger to initialize. - if ( ! is_dir( EE_OPT_ROOT ) ) { - shell_exec('mkdir -p ' . EE_OPT_ROOT); + if ( ! is_dir( EE_ROOT_DIR ) ) { + shell_exec('mkdir -p ' . EE_ROOT_DIR); } - if ( ! is_writable( EE_OPT_ROOT ) ) { - EE::err( 'Config root: ' . EE_OPT_ROOT . ' is not writable by EasyEngine' ); + if ( ! is_writable( EE_ROOT_DIR ) ) { + EE::err( 'Config root: ' . EE_ROOT_DIR . ' is not writable by EasyEngine' ); } if ( !empty( $this->arguments[0] ) && 'cli' === $this->arguments[0] && ! empty( $this->arguments[1] ) && 'info' === $this->arguments[1] ) { $file_logging_path = '/dev/null'; } else { - $file_logging_path = EE_OPT_ROOT . '/logs/ee.log'; + $file_logging_path = EE_ROOT_DIR . '/logs/ee.log'; } $dateFormat = 'd-m-Y H:i:s'; $output = "[%datetime%] %channel%.%level_name%: %message% %context% %extra%\n"; $formatter = new \Monolog\Formatter\LineFormatter( $output, $dateFormat, false, true ); - $stream = new \Monolog\Handler\StreamHandler( EE_OPT_ROOT . '/logs/ee.log', Logger::DEBUG ); + $stream = new \Monolog\Handler\StreamHandler( EE_ROOT_DIR . '/logs/ee.log', Logger::DEBUG ); $stream->setFormatter( $formatter ); $file_logger = new \Monolog\Logger( 'ee' ); $file_logger->pushHandler( $stream ); @@ -564,7 +564,7 @@ public function init_config() { * @param $default Default value to use if $var is not set. */ public function ensure_present_in_config( $var, $default ) { - $config_file_path = getenv( 'EE_CONFIG_PATH' ) ? getenv( 'EE_CONFIG_PATH' ) : EE_OPT_ROOT . '/config/config.yml'; + $config_file_path = getenv( 'EE_CONFIG_PATH' ) ? getenv( 'EE_CONFIG_PATH' ) : EE_ROOT_DIR . '/config/config.yml'; $existing_config = Spyc::YAMLLoad( $config_file_path ); if ( ! isset( $existing_config[$var] ) ) { $this->config[$var] = $default; @@ -610,7 +610,7 @@ private function run_alias_group( $aliases ) { if ( getenv( 'EE_CONFIG_PATH' ) ) { $config_path = getenv( 'EE_CONFIG_PATH' ); } else { - $config_path = EE_OPT_ROOT . '/config/config.yml'; + $config_path = EE_ROOT_DIR . '/config/config.yml'; } $config_path = escapeshellarg( $config_path ); diff --git a/php/class-ee.php b/php/class-ee.php index 65b358b1b..a61425189 100644 --- a/php/class-ee.php +++ b/php/class-ee.php @@ -931,7 +931,7 @@ public static function launch_self( $command, $args = array(), $assoc_args = arr if ( getenv( 'EE_CONFIG_PATH' ) ) { $config_path = getenv( 'EE_CONFIG_PATH' ); } else { - $config_path = EE_OPT_ROOT . '/config/config.yml'; + $config_path = EE_ROOT_DIR . '/config/config.yml'; } $config_path = escapeshellarg( $config_path ); diff --git a/php/init-ee.php b/php/init-ee.php index c500186a5..896f3324a 100644 --- a/php/init-ee.php +++ b/php/init-ee.php @@ -4,7 +4,7 @@ define( 'EE', true ); define( 'EE_VERSION', trim( file_get_contents( EE_ROOT . '/VERSION' ) ) ); define( 'EE_START_MICROTIME', microtime( true ) ); -define( 'EE_OPT_ROOT', '/opt/easyengine' ); +define( 'EE_ROOT_DIR', '/opt/easyengine' ); define( 'EE_PROXY_TYPE', 'ee-nginx-proxy' ); if ( file_exists( EE_ROOT . '/vendor/autoload.php' ) ) { From e0d8b4ac816bf78c0d2ae85ab838a5625fd3589a Mon Sep 17 00:00:00 2001 From: sagar <sagar.nasit@rtcamp.com> Date: Fri, 14 Sep 2018 12:59:48 +0530 Subject: [PATCH 0466/1044] Add config DIR check --- php/EE/Runner.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 0f4c270ee..e18b04adf 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -570,6 +570,10 @@ public function ensure_present_in_config( $var, $default ) { $this->config[$var] = $default; $config_dir_path = dirname( $config_file_path ); + if ( ! is_dir( $config_dir_path ) ) { + mkdir( $config_dir_path ); + } + if ( file_exists( $config_file_path ) ) { if ( is_readable( $config_file_path ) ) { if ( is_writable( $config_file_path ) ) { From 5a603df1734f776519dcf04fc4337cb2a6a387a7 Mon Sep 17 00:00:00 2001 From: sagar <sagar.nasit@rtcamp.com> Date: Fri, 14 Sep 2018 13:23:21 +0530 Subject: [PATCH 0467/1044] Fix DB directory issue --- php/EE/Runner.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index e18b04adf..0634891e5 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -54,6 +54,11 @@ private function init_ee() { define( 'DB', EE_ROOT_DIR.'/db/ee.sqlite' ); define( 'LOCALHOST_IP', '127.0.0.1' ); + + $db_dir = dirname( DB ); + if ( ! is_dir( $db_dir ) ) { + mkdir( $db_dir ); + } } /** From e585e0e10669f50f26a61dd126d6c931357ce5f7 Mon Sep 17 00:00:00 2001 From: sagar <sagar.nasit@rtcamp.com> Date: Fri, 14 Sep 2018 15:16:32 +0530 Subject: [PATCH 0468/1044] fix config_file array content --- php/EE/Runner.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 0634891e5..8a05171d0 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -138,8 +138,8 @@ public function get_global_config_path() { */ public function get_project_config_path() { $config_files = array( - '/config/ee.local.yml', - '/config/ee.yml', + 'ee.local.yml', + 'ee.yml', ); // Stop looking upward when we find we have emerged from a subdirectory From 29d87bea0185db6051a8f72a8714062f3fd1436e Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Mon, 17 Sep 2018 18:56:01 +0530 Subject: [PATCH 0469/1044] Add placeholder migration Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- migrations/1_blank.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 migrations/1_blank.php diff --git a/migrations/1_blank.php b/migrations/1_blank.php new file mode 100644 index 000000000..aafb96fa8 --- /dev/null +++ b/migrations/1_blank.php @@ -0,0 +1,16 @@ +<?php + +namespace EE\Migration; + +/** + * Placeholder migration as we need migration directory in phar but we don't have any migration files. + * + * @package EE\Migration + */ +class Blank extends \EE\Migration\Base { + public function up() { + } + + public function down() { + } +} From f936fbe0c4e4ef14323d86781539c2596a9c6a81 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Mon, 17 Sep 2018 18:56:21 +0530 Subject: [PATCH 0470/1044] Change cache directory path Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/class-ee.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/class-ee.php b/php/class-ee.php index 472af447b..ae1353a0c 100644 --- a/php/class-ee.php +++ b/php/class-ee.php @@ -94,7 +94,7 @@ public static function get_cache() { if ( ! $cache ) { $home = Utils\get_home_dir(); - $dir = getenv( 'EE_CACHE_DIR' ) ? : "$home/.ee/cache"; + $dir = getenv( 'EE_CACHE_DIR' ) ? : '/opt/easyengine/.cache/'; // 6 months, 300mb $cache = new FileCache( $dir, 15552000, 314572800 ); From 0579330dde5d5f63f2c8067cbb12a63dc068fb6a Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Mon, 17 Sep 2018 18:57:00 +0530 Subject: [PATCH 0471/1044] Invalidate cache before update don't migrate after put in /tmp Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/commands/src/CLI_Command.php | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/php/commands/src/CLI_Command.php b/php/commands/src/CLI_Command.php index 815d2af1a..eb02033c7 100644 --- a/php/commands/src/CLI_Command.php +++ b/php/commands/src/CLI_Command.php @@ -1,9 +1,9 @@ <?php -use \Composer\Semver\Comparator; -use \Symfony\Component\Filesystem\Filesystem; -use \EE\Utils; -use \EE\Model\Site; +use Composer\Semver\Comparator; +use EE\Model\Site; +use EE\Utils; +use Symfony\Component\Filesystem\Filesystem; /** * Review current EE info, check for updates, or see defined aliases. @@ -154,20 +154,6 @@ public function info( $_, $assoc_args ) { \EE::line( $line ); } } - - if ( '/tmp' === getcwd() ) { - $this->migrate(); - } - } - - /** - * Function to run migrations required to upgrade to the newer version. Will always be invoked from the newer phar downloaded inside the /tmp folder - */ - private function migrate() { - $rsp = new \EE\RevertableStepProcessor(); - $rsp->add_step( 'ee-migrations', 'EE\Migration\Executor::execute_migrations' ); - $rsp->add_step( 'site-migration', 'EE\Migration\Containers::start_container_migration' ); - $rsp->execute(); } /** @@ -319,6 +305,10 @@ public function update( $_, $assoc_args ) { } else { EE::error( "md5 hash for download ({$md5_file}) is different than the release hash ({$release_hash})." ); } + + $cache = EE::get_cache(); + $cache->write( 'migrated', '0' ); + $php_binary = Utils\get_php_binary(); $process = EE\Process::create( "{$php_binary} $temp cli info" ); $result = $process->run(); From ec07dc87226985e17bbf0bed80b57e715b07115a Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Mon, 17 Sep 2018 18:57:17 +0530 Subject: [PATCH 0472/1044] Fix migrations Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/EE/Migration/Executor.php | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/php/EE/Migration/Executor.php b/php/EE/Migration/Executor.php index bcc0ebfef..3587b0c40 100644 --- a/php/EE/Migration/Executor.php +++ b/php/EE/Migration/Executor.php @@ -2,14 +2,13 @@ namespace EE\Migration; -use \EE; -use \EE\Model\Migration; -use \EE\Utils; -use Symfony\Component\Finder\Finder; +use EE; +use EE\Model\Migration; +use EE\Utils; class Executor { - const MIGRATION_PATH = EE_ROOT . '/migrations'; + const MIGRATION_PATH = EE_ROOT . '/migrations/'; /** * Executes all pending migrations @@ -17,13 +16,12 @@ class Executor { public static function execute_migrations() { Utils\delem_log( "ee migration start" ); - EE::log( "Migrating EasyEngine data to new version" ); + EE::log( "Executing migrations" ); $migrations = self::get_migrations_to_execute(); if( empty( $migrations ) ) { EE::success( "Noting to migrate" ); - exit( 0 ); } sort( $migrations ); @@ -103,13 +101,18 @@ private static function get_migrations_to_execute() { } private static function get_migrations_from_db() { - return Migration::all(); + return array_column( Migration::all(), 'migration' ); } private static function get_migrations_from_fs() { // array_slice is used to remove . and .. returned by scandir() - $migrations = array_slice( scandir( self::MIGRATION_PATH ), 2 ); - array_walk( $migrations, function( &$migration, $index ) { + $migrations = scandir( self::MIGRATION_PATH ); + + if( ! Utils\inside_phar() ) { + $migrations = array_slice( scandir( self::MIGRATION_PATH ), 2 ); + } + + array_walk( $migrations, function( &$migration, $index ) { $migration = rtrim( $migration, '.php' ); }); return $migrations; From f8e79e28e92a4d944ecd8230ba17d63b2bc86611 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Mon, 17 Sep 2018 18:58:09 +0530 Subject: [PATCH 0473/1044] Add cached call to verify migration have ran Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/EE/Runner.php | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 248f042f5..9f4bf4d53 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -3,12 +3,12 @@ namespace EE; use EE; -use EE\Utils; use EE\Dispatcher; use EE\Dispatcher\CompositeCommand; -use Mustangostang\Spyc; +use EE\Utils; use Monolog\Logger; -use EE\Model\Site; +use Mustangostang\Spyc; + /** * Performs the execution of a command. * @@ -59,6 +59,24 @@ private function init_ee() { define( 'WEBROOT', \EE\Utils\trailingslashit( $this->config['sites_path'] ) ); define( 'DB', EE_CONF_ROOT.'/ee.sqlite' ); define( 'LOCALHOST_IP', '127.0.0.1' ); + + $cache = EE::get_cache(); + + if ( ! $cache->has( 'migrated' ) || '1' !== $cache->read( 'migrated' ) ) { + if ( ! $this->migrate() ) { + EE::error( 'There was some error while migrating.' ); + } + $cache->write( 'migrated', '1' ); + } + } + + /** + * Function to run migrations required to upgrade to the newer version. Will always be invoked from the newer phar downloaded inside the /tmp folder + */ + private function migrate() { + $rsp = new \EE\RevertableStepProcessor(); + $rsp->add_step( 'ee-migrations', 'EE\Migration\Executor::execute_migrations' ); + return $rsp->execute(); } /** From 490d6927ad764524b25b7e092c2f36e8589ab6b7 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Mon, 17 Sep 2018 18:58:25 +0530 Subject: [PATCH 0474/1044] Correct make phar for migration Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- utils/make-phar.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/utils/make-phar.php b/utils/make-phar.php index 7e4ef7d91..866c46ab1 100644 --- a/utils/make-phar.php +++ b/utils/make-phar.php @@ -16,9 +16,9 @@ require EE_VENDOR_DIR . '/autoload.php'; require EE_ROOT . '/php/utils.php'; -use Symfony\Component\Finder\Finder; -use EE\Utils; use EE\Configurator; +use EE\Utils; +use Symfony\Component\Finder\Finder; $configurator = new Configurator( EE_ROOT . '/utils/make-phar-spec.php' ); @@ -161,6 +161,7 @@ function get_composer_versions( $current_version ) { ->ignoreVCS(true) ->name('*.php') ->in(EE_ROOT . '/php') + ->in(EE_ROOT . '/migrations') ->in(EE_VENDOR_DIR . '/mustache') ->in(EE_VENDOR_DIR . '/rmccue/requests') ->in(EE_VENDOR_DIR . '/composer') @@ -221,6 +222,15 @@ function get_composer_versions( $current_version ) { add_file( $phar, $file ); } +if( 2 === count( scandir(__DIR__ . '/../migrations') ) ) { + $finder = new Finder(); + $finder->directories()->name('migrations')->in(EE_ROOT); + + foreach ( $finder as $file ) { + add_file( $phar, $file ); + } +} + $finder = new Finder(); $finder ->files() From c9b211ba5259c099276239ebe73ebd82c2e49f15 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Tue, 18 Sep 2018 14:15:52 +0530 Subject: [PATCH 0475/1044] Add option table and migration Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/EE/Model/Option.php | 53 +++++++++++++++++++++++++++++++++++++++++ php/class-ee-db.php | 6 +++++ 2 files changed, 59 insertions(+) create mode 100644 php/EE/Model/Option.php diff --git a/php/EE/Model/Option.php b/php/EE/Model/Option.php new file mode 100644 index 000000000..f026b0a87 --- /dev/null +++ b/php/EE/Model/Option.php @@ -0,0 +1,53 @@ +<?php + +namespace EE\Model; + +/** + * Option model class. + */ +class Option extends Base { + + protected static $table = 'options'; + + protected static $primary_key = 'key'; + + /** + * Sets a key on options table + * + * @param string $key Key of option + * @param string $value Value of option + * + * @throws \Exception + * @return bool Key set or not + */ + public function set( string $key, string $value ) { + $existing_key = static::find( $key ); + + if ( empty( $existing_key ) ) { + return static::create( + [ + 'key' => $key, + 'value' => $value, + ] + ); + } + + $existing_key->value = $value; + + return $existing_key->save(); + } + + /** + * Gets a key from options table + * + * @param string $key Key of option + * + * @throws \Exception + * @return bool|Option + */ + public function get( string $key ) { + $option = static::find( $key ); + + return false === $option ? false : $option->value; + } +} diff --git a/php/class-ee-db.php b/php/class-ee-db.php index 0533eb362..6461fb301 100644 --- a/php/class-ee-db.php +++ b/php/class-ee-db.php @@ -127,6 +127,12 @@ private static function create_required_tables() { PRIMARY KEY (id) );'; + $query .= 'CREATE TABLE options ( + key VARCHAR NOT NULL, + value VARCHAR NOT NULL, + PRIMARY KEY (key) + );'; + try { self::$pdo->exec( $query ); } catch ( PDOException $exception ) { From 2ce1a036e76540623ac39a4db091f4a422a27f10 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Tue, 18 Sep 2018 14:16:18 +0530 Subject: [PATCH 0476/1044] Update migration trigger logic Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/EE/Runner.php | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 9f4bf4d53..f69057989 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -2,9 +2,11 @@ namespace EE; +use Composer\Semver\Comparator; use EE; use EE\Dispatcher; use EE\Dispatcher\CompositeCommand; +use EE\Model\Option; use EE\Utils; use Monolog\Logger; use Mustangostang\Spyc; @@ -60,14 +62,7 @@ private function init_ee() { define( 'DB', EE_CONF_ROOT.'/ee.sqlite' ); define( 'LOCALHOST_IP', '127.0.0.1' ); - $cache = EE::get_cache(); - - if ( ! $cache->has( 'migrated' ) || '1' !== $cache->read( 'migrated' ) ) { - if ( ! $this->migrate() ) { - EE::error( 'There was some error while migrating.' ); - } - $cache->write( 'migrated', '1' ); - } + $this->maybe_trigger_migration(); } /** @@ -796,6 +791,23 @@ private function auto_check_update() { exit; } + /** + * Triggers migration if current phar version > version in ee_option table + */ + private function maybe_trigger_migration() { + $db_version = Option::get( 'version' ); + $current_version = preg_replace( '/-nightly$/', '', EE_VERSION ); + + if ( Comparator::lessThan( $current_version, $db_version ) ) { + EE::error( 'It seems you\'re not running latest version. Please download and run latest version of EasyEngine' ); + } elseif ( Comparator::greaterThan( $current_version, $db_version ) ) { + if ( ! $this->migrate() ) { + EE::error( 'There was some error while migrating. Please check logs.' ); + } + Option::set( 'version', $current_version ); + } + } + /** * Get a suggestion on similar (sub)commands when the user entered an * unknown (sub)command. From f9da1486bb178d73c23cdb8f150b1f468e4ade0a Mon Sep 17 00:00:00 2001 From: sagar <sagar.nasit@rtcamp.com> Date: Wed, 19 Sep 2018 13:02:18 +0530 Subject: [PATCH 0477/1044] Remove db entry while reverting migrations --- php/EE/Migration/Executor.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/php/EE/Migration/Executor.php b/php/EE/Migration/Executor.php index b1372064f..e7bf56b10 100644 --- a/php/EE/Migration/Executor.php +++ b/php/EE/Migration/Executor.php @@ -111,6 +111,12 @@ private static function execute_migration_stack( $migrations ) { } EE::log( "Reverting: $migrations[0]" ); $migration->down(); + // remove db entry in 'migration' table when reverting migrations. + $migrated = Migration::where( 'migration', $migrations[0] ); + if ( ! empty( $migrated ) ) { + $migrated[0]->delete(); + } + EE::log( "Reverted: $migrations[0]" ); throw $e; } From 66fb18e834c8f15a945976461a77a84a153ef609 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Wed, 19 Sep 2018 13:10:27 +0530 Subject: [PATCH 0478/1044] Removed cache write call Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/commands/src/CLI_Command.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/php/commands/src/CLI_Command.php b/php/commands/src/CLI_Command.php index eb02033c7..dc41e8613 100644 --- a/php/commands/src/CLI_Command.php +++ b/php/commands/src/CLI_Command.php @@ -306,9 +306,6 @@ public function update( $_, $assoc_args ) { EE::error( "md5 hash for download ({$md5_file}) is different than the release hash ({$release_hash})." ); } - $cache = EE::get_cache(); - $cache->write( 'migrated', '0' ); - $php_binary = Utils\get_php_binary(); $process = EE\Process::create( "{$php_binary} $temp cli info" ); $result = $process->run(); From de53431fb8f00733a02b6720eb22b78d395dd62f Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Wed, 19 Sep 2018 13:10:56 +0530 Subject: [PATCH 0479/1044] Remove repetetive scandir call Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/EE/Migration/Executor.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/php/EE/Migration/Executor.php b/php/EE/Migration/Executor.php index 3587b0c40..560226826 100644 --- a/php/EE/Migration/Executor.php +++ b/php/EE/Migration/Executor.php @@ -22,6 +22,7 @@ public static function execute_migrations() { if( empty( $migrations ) ) { EE::success( "Noting to migrate" ); + return; } sort( $migrations ); @@ -105,11 +106,11 @@ private static function get_migrations_from_db() { } private static function get_migrations_from_fs() { - // array_slice is used to remove . and .. returned by scandir() $migrations = scandir( self::MIGRATION_PATH ); if( ! Utils\inside_phar() ) { - $migrations = array_slice( scandir( self::MIGRATION_PATH ), 2 ); + // array_slice is used to remove . and .. returned by scandir() + $migrations = array_slice( $migrations, 2 ); } array_walk( $migrations, function( &$migration, $index ) { From c1adcfaa0ef9942f975b69cb9eb31bd36bf0823d Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Wed, 19 Sep 2018 13:11:14 +0530 Subject: [PATCH 0480/1044] Align = sign Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/EE/Runner.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index f69057989..5cf21ee9d 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -795,7 +795,7 @@ private function auto_check_update() { * Triggers migration if current phar version > version in ee_option table */ private function maybe_trigger_migration() { - $db_version = Option::get( 'version' ); + $db_version = Option::get( 'version' ); $current_version = preg_replace( '/-nightly$/', '', EE_VERSION ); if ( Comparator::lessThan( $current_version, $db_version ) ) { From dc0af0bcb5b163f415f348e44041fc6a7740e2ed Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Wed, 19 Sep 2018 13:18:56 +0530 Subject: [PATCH 0481/1044] Fix typo Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/EE/Migration/Executor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/EE/Migration/Executor.php b/php/EE/Migration/Executor.php index 560226826..f4e33d8f1 100644 --- a/php/EE/Migration/Executor.php +++ b/php/EE/Migration/Executor.php @@ -21,7 +21,7 @@ public static function execute_migrations() { $migrations = self::get_migrations_to_execute(); if( empty( $migrations ) ) { - EE::success( "Noting to migrate" ); + EE::success( "Nothing to migrate" ); return; } From 2e40c68eccf065df29ded08888e15b6af9064414 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Wed, 19 Sep 2018 13:25:31 +0530 Subject: [PATCH 0482/1044] Renamed changed log to debug Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/EE/Migration/Executor.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/php/EE/Migration/Executor.php b/php/EE/Migration/Executor.php index f4e33d8f1..78c7e82f8 100644 --- a/php/EE/Migration/Executor.php +++ b/php/EE/Migration/Executor.php @@ -16,12 +16,12 @@ class Executor { public static function execute_migrations() { Utils\delem_log( "ee migration start" ); - EE::log( "Executing migrations" ); + EE::debug( "Executing migrations" ); $migrations = self::get_migrations_to_execute(); if( empty( $migrations ) ) { - EE::success( "Nothing to migrate" ); + EE::debug( "Nothing to migrate" ); return; } @@ -34,7 +34,7 @@ public static function execute_migrations() { exit( 1 ); } - EE::success( "Successfully migrated EasyEngine" ); + EE::debug( "Successfully migrated EasyEngine" ); } /** @@ -68,7 +68,7 @@ private static function execute_migration_stack( $migrations ) { } try { - EE::log( "Migrating: $migrations[0]" ); + EE::debug( "Migrating: $migrations[0]" ); $migration->up(); Migration::create([ @@ -77,7 +77,7 @@ private static function execute_migration_stack( $migrations ) { ]); $migration->status = 'complete'; - EE::log( "Migrated: $migrations[0]" ); + EE::debug( "Migrated: $migrations[0]" ); $remaining_migrations = array_splice( $migrations, 1, count( $migrations ) ); self::execute_migration_stack( $remaining_migrations ); } @@ -85,9 +85,9 @@ private static function execute_migration_stack( $migrations ) { if( $migration->status !== 'complete' ) { EE::error( "Errors were encountered while processing: $migrations[0]\n" . $e->getMessage(), false ); } - EE::log( "Reverting: $migrations[0]" ); + EE::debug( "Reverting: $migrations[0]" ); $migration->down(); - EE::log( "Reverted: $migrations[0]" ); + EE::debug( "Reverted: $migrations[0]" ); throw $e; } } From 425ff14dcaaa7f60668a3f9129e6b7b6c7461881 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Wed, 19 Sep 2018 13:59:52 +0530 Subject: [PATCH 0483/1044] Added log message before updating or migrating Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/EE/Runner.php | 20 +++++++++++++++----- php/commands/src/CLI_Command.php | 2 ++ 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 5cf21ee9d..4d381c2c5 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -796,16 +796,26 @@ private function auto_check_update() { */ private function maybe_trigger_migration() { $db_version = Option::get( 'version' ); - $current_version = preg_replace( '/-nightly$/', '', EE_VERSION ); + $current_version = preg_replace( '/-nightly.*$/', '', EE_VERSION ); + + if ( ! $db_version ) { + $this->trigger_migration( $current_version ); + return; + } if ( Comparator::lessThan( $current_version, $db_version ) ) { EE::error( 'It seems you\'re not running latest version. Please download and run latest version of EasyEngine' ); } elseif ( Comparator::greaterThan( $current_version, $db_version ) ) { - if ( ! $this->migrate() ) { - EE::error( 'There was some error while migrating. Please check logs.' ); - } - Option::set( 'version', $current_version ); + EE::log( 'Executing migrations. This might take some time.' ); + $this->trigger_migration( $current_version ); + } + } + + private function trigger_migration( $version ) { + if ( ! $this->migrate() ) { + EE::error( 'There was some error while migrating. Please check logs.' ); } + Option::set( 'version', $version ); } /** diff --git a/php/commands/src/CLI_Command.php b/php/commands/src/CLI_Command.php index dc41e8613..5254a633d 100644 --- a/php/commands/src/CLI_Command.php +++ b/php/commands/src/CLI_Command.php @@ -306,6 +306,8 @@ public function update( $_, $assoc_args ) { EE::error( "md5 hash for download ({$md5_file}) is different than the release hash ({$release_hash})." ); } + EE::log( 'Updating EasyEngine to new version. This might take some time.' ); + $php_binary = Utils\get_php_binary(); $process = EE\Process::create( "{$php_binary} $temp cli info" ); $result = $process->run(); From 0c5d984234d0da0b360df602c9f43c54ab10e3e0 Mon Sep 17 00:00:00 2001 From: sagarnasit <sagarnasit@gmail.com> Date: Mon, 24 Sep 2018 11:22:15 +0530 Subject: [PATCH 0484/1044] Change constant value --- php/init-ee.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/init-ee.php b/php/init-ee.php index d0f389148..f50046f0b 100644 --- a/php/init-ee.php +++ b/php/init-ee.php @@ -5,7 +5,7 @@ define( 'EE_VERSION', trim( file_get_contents( EE_ROOT . '/VERSION' ) ) ); define( 'EE_START_MICROTIME', microtime( true ) ); define( 'EE_CONF_ROOT', '/opt/easyengine' ); -define( 'EE_PROXY_TYPE', 'ee-nginx-proxy' ); +define( 'EE_PROXY_TYPE', 'ee-global-nginx-proxy' ); if ( file_exists( EE_ROOT . '/vendor/autoload.php' ) ) { define( 'EE_VENDOR_DIR', EE_ROOT . '/vendor' ); From c9e124cefc5f76535be0f9b2d03fb95e14131bec Mon Sep 17 00:00:00 2001 From: sagarnasit <sagarnasit@gmail.com> Date: Mon, 24 Sep 2018 11:34:25 +0530 Subject: [PATCH 0485/1044] Fix phpcs errors --- php/EE/Migration/Executor.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/php/EE/Migration/Executor.php b/php/EE/Migration/Executor.php index 5c6067cc6..f7ce72d1a 100644 --- a/php/EE/Migration/Executor.php +++ b/php/EE/Migration/Executor.php @@ -14,12 +14,12 @@ class Executor { public static function execute_migrations() { Utils\delem_log( 'ee migration start' ); - EE::debug( "Executing migrations" ); + EE::debug( 'Executing migrations' ); $migration_paths = self::get_migration_paths(); if ( empty( $migration_paths ) ) { - EE::debug( "Nothing to migrate" ); + EE::debug( 'Nothing to migrate' ); return; } @@ -158,7 +158,7 @@ private static function get_migrations_from_fs( $path ) { // array_slice is used to remove . and .. returned by scandir() $migrations = scandir( $path ); - if( ! Utils\inside_phar() ) { + if ( ! Utils\inside_phar() ) { // array_slice is used to remove . and .. returned by scandir() $migrations = array_slice( $migrations, 2 ); } From 273617ecdd63cdf073db507ce861a6a1e75ffcb6 Mon Sep 17 00:00:00 2001 From: sagarnasit <sagarnasit@gmail.com> Date: Mon, 24 Sep 2018 15:34:56 +0530 Subject: [PATCH 0486/1044] Use Constant instead of hard coded value --- php/EE/Migration/Containers.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index 626186054..fb7daa462 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -106,7 +106,7 @@ private static function migrate_site_containers() { private static function migrate_global_containers() { // Upgrade nginx-proxy container - $existing_nginx_proxy_image = EE::launch( 'docker inspect --format=\'{{.Config.Image}}\' ee-nginx-proxy', false, true ); + $existing_nginx_proxy_image = EE::launch( sprintf( 'docker inspect --format=\'{{.Config.Image}}\' %1$s', EE_PROXY_TYPE ), false, true ); if ( 0 === $existing_nginx_proxy_image->return_code ) { self::$rsp->add_step( 'upgrade-nginxproxy-container', @@ -138,12 +138,12 @@ private static function migrate_global_containers() { public static function nginxproxy_container_up() { $EE_CONF_ROOT = EE_CONF_ROOT; $nginx_proxy_image = 'easyengine/nginx-proxy:v' . EE_VERSION; - $ee_proxy_command = "docker run --name ee-nginx-proxy -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v $EE_CONF_ROOT/nginx/certs:/etc/nginx/certs -v $EE_CONF_ROOT/nginx/dhparam:/etc/nginx/dhparam -v $EE_CONF_ROOT/nginx/conf.d:/etc/nginx/conf.d -v $EE_CONF_ROOT/nginx/htpasswd:/etc/nginx/htpasswd -v $EE_CONF_ROOT/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v $EE_CONF_ROOT:/app/ee4 -v /usr/share/nginx/html $nginx_proxy_image"; + $ee_proxy_command = sprintf( 'docker run --name %1$s -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v %2%s/nginx/certs:/etc/nginx/certs -v %2$s/nginx/dhparam:/etc/nginx/dhparam -v %2$s/nginx/conf.d:/etc/nginx/conf.d -v %2$s/nginx/htpasswd:/etc/nginx/htpasswd -v %2$s/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v %2$s:/app/ee4 -v /usr/share/nginx/html %3$s', EE_PROXY_TYPE, $EE_CONF_ROOT, $nginx_proxy_image ); - default_launch( 'docker rm -f ee-nginx-proxy', false, true ); + default_launch( sprintf( 'docker rm -f %1$s', EE_PROXY_TYPE ), false, true ); if ( ! default_launch( $ee_proxy_command, false, true ) ) { - throw new \Exception( ' Unable to upgrade ee-nginx-proxy container' ); + throw new \Exception( sprintf( 'Unable to upgrade %1$s container', EE_PROXY_TYPE ) ); } } @@ -158,12 +158,12 @@ public static function nginxproxy_container_up() { public static function nginxproxy_container_down( $existing_nginx_proxy_image ) { $EE_CONF_ROOT = EE_CONF_ROOT; $nginx_proxy_image = trim( $existing_nginx_proxy_image->stout ); - $ee_proxy_command = "docker run --name ee-nginx-proxy -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v $EE_CONF_ROOT/nginx/certs:/etc/nginx/certs -v $EE_CONF_ROOT/nginx/dhparam:/etc/nginx/dhparam -v $EE_CONF_ROOT/nginx/conf.d:/etc/nginx/conf.d -v $EE_CONF_ROOT/nginx/htpasswd:/etc/nginx/htpasswd -v $EE_CONF_ROOT/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v $EE_CONF_ROOT:/app/ee4 -v /usr/share/nginx/html $nginx_proxy_image"; + $ee_proxy_command = sprintf( 'docker run --name %1$s -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v %2$s/nginx/certs:/etc/nginx/certs -v %2$s/nginx/dhparam:/etc/nginx/dhparam -v %2$s/nginx/conf.d:/etc/nginx/conf.d -v %2$s/nginx/htpasswd:/etc/nginx/htpasswd -v %2$s/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v %2$s:/app/ee4 -v /usr/share/nginx/html %3$s', EE_PROXY_TYPE, $EE_CONF_ROOT, $nginx_proxy_image ); - default_launch( 'docker rm -f ee-nginx-proxy', false, true ); + default_launch( sprintf( 'docker rm -f %1$s', EE_PROXY_TYPE ), false, true ); if ( ! default_launch( $ee_proxy_command, false, true ) ) { - throw new \Exception( ' Unable to restore ee-nginx-proxy container' ); + throw new \Exception( sprintf( 'Unable to restore %1$s container', EE_PROXY_TYPE ) ); } } From d015d6c69b00a2acf031e263162dc47f757eeaae Mon Sep 17 00:00:00 2001 From: sagarnasit <sagarnasit@gmail.com> Date: Mon, 24 Sep 2018 15:43:25 +0530 Subject: [PATCH 0487/1044] Fix typo --- php/EE/Migration/Containers.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index fb7daa462..6574daa58 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -138,7 +138,7 @@ private static function migrate_global_containers() { public static function nginxproxy_container_up() { $EE_CONF_ROOT = EE_CONF_ROOT; $nginx_proxy_image = 'easyengine/nginx-proxy:v' . EE_VERSION; - $ee_proxy_command = sprintf( 'docker run --name %1$s -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v %2%s/nginx/certs:/etc/nginx/certs -v %2$s/nginx/dhparam:/etc/nginx/dhparam -v %2$s/nginx/conf.d:/etc/nginx/conf.d -v %2$s/nginx/htpasswd:/etc/nginx/htpasswd -v %2$s/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v %2$s:/app/ee4 -v /usr/share/nginx/html %3$s', EE_PROXY_TYPE, $EE_CONF_ROOT, $nginx_proxy_image ); + $ee_proxy_command = sprintf( 'docker run --name %1$s -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v %2$s/nginx/certs:/etc/nginx/certs -v %2$s/nginx/dhparam:/etc/nginx/dhparam -v %2$s/nginx/conf.d:/etc/nginx/conf.d -v %2$s/nginx/htpasswd:/etc/nginx/htpasswd -v %2$s/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v %2$s:/app/ee4 -v /usr/share/nginx/html %3$s', EE_PROXY_TYPE, $EE_CONF_ROOT, $nginx_proxy_image ); default_launch( sprintf( 'docker rm -f %1$s', EE_PROXY_TYPE ), false, true ); From 1eac70ec03381fec41a833eec40ca9d7bb831bd1 Mon Sep 17 00:00:00 2001 From: sagarnasit <sagarnasit@gmail.com> Date: Mon, 24 Sep 2018 21:20:38 +0530 Subject: [PATCH 0488/1044] Move config.yml to config/nginx-proxy directoy --- php/EE/Runner.php | 8 ++++---- php/class-ee.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 15fa0f800..838b02d64 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -128,7 +128,7 @@ public function get_global_config_path() { $config_path = getenv( 'EE_CONFIG_PATH' ); $this->_global_config_path_debug = 'Using global config from EE_CONFIG_PATH env var: ' . $config_path; } else { - $config_path = EE_ROOT_DIR . '/config/config.yml'; + $config_path = EE_ROOT_DIR . '/config/nginx-proxy/config.yml'; $this->_global_config_path_debug = 'Using default global config: ' . $config_path; } @@ -581,14 +581,14 @@ public function init_config() { * @param $default Default value to use if $var is not set. */ public function ensure_present_in_config( $var, $default ) { - $config_file_path = getenv( 'EE_CONFIG_PATH' ) ? getenv( 'EE_CONFIG_PATH' ) : EE_ROOT_DIR . '/config/config.yml'; + $config_file_path = getenv( 'EE_CONFIG_PATH' ) ? getenv( 'EE_CONFIG_PATH' ) : EE_ROOT_DIR . '/config/nginx-proxy/config.yml'; $existing_config = Spyc::YAMLLoad( $config_file_path ); if ( ! isset( $existing_config[$var] ) ) { $this->config[$var] = $default; $config_dir_path = dirname( $config_file_path ); if ( ! is_dir( $config_dir_path ) ) { - mkdir( $config_dir_path ); + mkdir( $config_dir_path, 0777, true ); } if ( file_exists( $config_file_path ) ) { @@ -631,7 +631,7 @@ private function run_alias_group( $aliases ) { if ( getenv( 'EE_CONFIG_PATH' ) ) { $config_path = getenv( 'EE_CONFIG_PATH' ); } else { - $config_path = EE_ROOT_DIR . '/config/config.yml'; + $config_path = EE_ROOT_DIR . '/config/nginx-proxy/config.yml'; } $config_path = escapeshellarg( $config_path ); diff --git a/php/class-ee.php b/php/class-ee.php index eb143dce2..108ac3025 100644 --- a/php/class-ee.php +++ b/php/class-ee.php @@ -931,7 +931,7 @@ public static function launch_self( $command, $args = array(), $assoc_args = arr if ( getenv( 'EE_CONFIG_PATH' ) ) { $config_path = getenv( 'EE_CONFIG_PATH' ); } else { - $config_path = EE_ROOT_DIR . '/config/config.yml'; + $config_path = EE_ROOT_DIR . '/config/nginx-proxy/config.yml'; } $config_path = escapeshellarg( $config_path ); From 7f6dcdb3f13179fe42fe1bba5f46ba840f90c79e Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Wed, 26 Sep 2018 12:20:24 +0530 Subject: [PATCH 0489/1044] Move get_curl_info to EE utils Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/utils.php | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/php/utils.php b/php/utils.php index cc8659420..4be714003 100644 --- a/php/utils.php +++ b/php/utils.php @@ -1594,3 +1594,32 @@ function get_image_versions() { return $img_versions; } + +/** + * Function to get httpcode or port occupancy info. + * + * @param string $url url to get info about. + * @param int $port The port to check. + * @param bool $port_info Return port info or httpcode. + * @param mixed $auth Send http auth with passed value if not false. + * + * @return bool|int port occupied or httpcode. + */ +function get_curl_info( $url, $port = 80, $port_info = false, $auth = false ) { + + $ch = curl_init( $url ); + curl_setopt( $ch, CURLOPT_HEADER, true ); + curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); + curl_setopt( $ch, CURLOPT_NOBODY, true ); + curl_setopt( $ch, CURLOPT_TIMEOUT, 10 ); + curl_setopt( $ch, CURLOPT_PORT, $port ); + if ( $auth ) { + curl_setopt( $ch, CURLOPT_USERPWD, $auth ); + } + curl_exec( $ch ); + if ( $port_info ) { + return empty( curl_getinfo( $ch, CURLINFO_PRIMARY_IP ) ); + } + + return curl_getinfo( $ch, CURLINFO_HTTP_CODE ); +} From 3c7c6c2755ad3c32bfa6664b4548427e0abd6230 Mon Sep 17 00:00:00 2001 From: sagarnasit <sagarnasit@gmail.com> Date: Wed, 26 Sep 2018 12:52:07 +0530 Subject: [PATCH 0490/1044] Update config.yml path --- php/EE/Runner.php | 6 +++--- php/class-ee.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 838b02d64..9480877ed 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -128,7 +128,7 @@ public function get_global_config_path() { $config_path = getenv( 'EE_CONFIG_PATH' ); $this->_global_config_path_debug = 'Using global config from EE_CONFIG_PATH env var: ' . $config_path; } else { - $config_path = EE_ROOT_DIR . '/config/nginx-proxy/config.yml'; + $config_path = EE_ROOT_DIR . '/config/config.yml'; $this->_global_config_path_debug = 'Using default global config: ' . $config_path; } @@ -581,7 +581,7 @@ public function init_config() { * @param $default Default value to use if $var is not set. */ public function ensure_present_in_config( $var, $default ) { - $config_file_path = getenv( 'EE_CONFIG_PATH' ) ? getenv( 'EE_CONFIG_PATH' ) : EE_ROOT_DIR . '/config/nginx-proxy/config.yml'; + $config_file_path = getenv( 'EE_CONFIG_PATH' ) ? getenv( 'EE_CONFIG_PATH' ) : EE_ROOT_DIR . '/config/config.yml'; $existing_config = Spyc::YAMLLoad( $config_file_path ); if ( ! isset( $existing_config[$var] ) ) { $this->config[$var] = $default; @@ -631,7 +631,7 @@ private function run_alias_group( $aliases ) { if ( getenv( 'EE_CONFIG_PATH' ) ) { $config_path = getenv( 'EE_CONFIG_PATH' ); } else { - $config_path = EE_ROOT_DIR . '/config/nginx-proxy/config.yml'; + $config_path = EE_ROOT_DIR . '/config/config.yml'; } $config_path = escapeshellarg( $config_path ); diff --git a/php/class-ee.php b/php/class-ee.php index 108ac3025..eb143dce2 100644 --- a/php/class-ee.php +++ b/php/class-ee.php @@ -931,7 +931,7 @@ public static function launch_self( $command, $args = array(), $assoc_args = arr if ( getenv( 'EE_CONFIG_PATH' ) ) { $config_path = getenv( 'EE_CONFIG_PATH' ); } else { - $config_path = EE_ROOT_DIR . '/config/nginx-proxy/config.yml'; + $config_path = EE_ROOT_DIR . '/config/config.yml'; } $config_path = escapeshellarg( $config_path ); From 4cca7ca9535353cd4538e18247f7d87803d7d9e7 Mon Sep 17 00:00:00 2001 From: sagarnasit <sagarnasit@gmail.com> Date: Wed, 26 Sep 2018 15:43:58 +0530 Subject: [PATCH 0491/1044] Remove Cron and Site models --- php/EE/Model/Cron.php | 12 --------- php/EE/Model/Site.php | 59 ------------------------------------------- 2 files changed, 71 deletions(-) delete mode 100644 php/EE/Model/Cron.php delete mode 100644 php/EE/Model/Site.php diff --git a/php/EE/Model/Cron.php b/php/EE/Model/Cron.php deleted file mode 100644 index 887b842f0..000000000 --- a/php/EE/Model/Cron.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -namespace EE\Model; - -/** - * Cron model class - */ -class Cron extends Base { - - protected static $table = 'cron'; - -} diff --git a/php/EE/Model/Site.php b/php/EE/Model/Site.php deleted file mode 100644 index a2e4d8b4d..000000000 --- a/php/EE/Model/Site.php +++ /dev/null @@ -1,59 +0,0 @@ -<?php - -namespace EE\Model; -use EE; - -/** - * Site model class. - */ -class Site extends Base { - - /** - * @var string Table of the model from where it will be stored/retrived - */ - protected static $table = 'sites'; - - /** - * @var string Primary/Unique key of the table - */ - protected static $primary_key = 'site_url'; - - /** - * Saves current model into database - * - * @throws \Exception - * - * @return bool Model saved successfully - */ - public function save() { - $fields = array_merge( $this->fields, [ - 'modified_on' => date( 'Y-m-d H:i:s' ), - ] ); - - $primary_key_column = static::$primary_key; - - return EE::db() - ->table( static::$table ) - ->where( $primary_key_column, $this->$primary_key_column ) - ->update( $fields ); - } - - - /** - * Returns if site is enabled - * - * @param string $site_url Name of site to check - * - * @throws \Exception - * - * @return bool Site enabled - */ - public static function enabled( string $site_url ) : bool { - $site = static::find( $site_url, [ 'site_enabled' ] ); - - if ( $site && $site->site_enabled ) { - return true; - } - return false; - } -} From 22fcdd6003613872c8152f068c6a667a2729bb85 Mon Sep 17 00:00:00 2001 From: sagarnasit <sagarnasit@gmail.com> Date: Thu, 27 Sep 2018 12:36:20 +0530 Subject: [PATCH 0492/1044] Use specified migration path --- php/EE/Migration/Executor.php | 55 +++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 25 deletions(-) diff --git a/php/EE/Migration/Executor.php b/php/EE/Migration/Executor.php index f7ce72d1a..34af48b96 100644 --- a/php/EE/Migration/Executor.php +++ b/php/EE/Migration/Executor.php @@ -5,6 +5,7 @@ use EE; use EE\Model\Migration; use EE\Utils; +use Symfony\Component\Finder\Finder; class Executor { @@ -16,20 +17,7 @@ public static function execute_migrations() { Utils\delem_log( 'ee migration start' ); EE::debug( 'Executing migrations' ); - $migration_paths = self::get_migration_paths(); - - if ( empty( $migration_paths ) ) { - EE::debug( 'Nothing to migrate' ); - return; - } - - $migrations = []; - - foreach ( $migration_paths as $package_path ) { - $migrations[] = self::get_migrations_to_execute( $package_path ); - } - - $migrations = array_merge( ...$migrations ); + $migrations = self::get_all_migrations(); if ( empty( $migrations ) ) { EE::debug( 'Nothing to migrate' ); @@ -49,18 +37,35 @@ public static function execute_migrations() { } /** - * @return array of available migration paths + * @return array of available migrations */ - private static function get_migration_paths() { - - $migration_paths = glob( EE_ROOT . '/vendor/easyengine/*/migrations' ); - $ee_path = glob( EE_ROOT . '/migrations' ); + private static function get_all_migrations() { + + $packages_path = scandir( EE_VENDOR_DIR . '/easyengine' ); + $packages_path = array_slice( $packages_path, 2 ); + + // get migrations from packages. + if ( ! empty( $packages_path ) ) { + foreach ( $packages_path as $package ) { + if ( is_file( $package ) ) { + continue; + } + + $migration_path = EE_VENDOR_DIR . '/easyengine/' . $package . '/migrations'; + if ( is_dir( $migration_path ) ) { + $migrations[] = array_slice( scandir( $migration_path ), 2 ); + } + } + } - // set migration path for easyengine. - if ( ! empty( $ee_path ) ) { - $migration_paths[] = $ee_path[0]; + // get migrations from core. + if ( is_dir( EE_ROOT . '/migrations' ) ) { + $migrations[] = array_slice( scandir( EE_ROOT . '/migrations' ), 2 ); } - return $migration_paths; + + $migrations = array_merge( ...$migrations ); + + return self::get_migrations_to_execute( $migrations ); } /** @@ -129,10 +134,10 @@ private static function execute_migration_stack( $migrations ) { * * @return array */ - private static function get_migrations_to_execute( $path ) { + private static function get_migrations_to_execute( $migrations ) { return array_values( array_diff( - self::get_migrations_from_fs( $path ), + $migrations, self::get_migrations_from_db() ) ); From a3bbd99a5ca2c1eabc2b417f9c7b8c401f16815c Mon Sep 17 00:00:00 2001 From: sagarnasit <sagarnasit@gmail.com> Date: Thu, 27 Sep 2018 12:52:44 +0530 Subject: [PATCH 0493/1044] Fix getting wrong classname error --- php/EE/Migration/Executor.php | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/php/EE/Migration/Executor.php b/php/EE/Migration/Executor.php index 34af48b96..8e428331c 100644 --- a/php/EE/Migration/Executor.php +++ b/php/EE/Migration/Executor.php @@ -152,28 +152,6 @@ private static function get_migrations_from_db() { return array_column( Migration::all(), 'migration' ); } - /** - * Get migrations from filesystem. - * - * @param $path path to the migrations on filesystem. - * - * @return array - */ - private static function get_migrations_from_fs( $path ) { - // array_slice is used to remove . and .. returned by scandir() - $migrations = scandir( $path ); - - if ( ! Utils\inside_phar() ) { - // array_slice is used to remove . and .. returned by scandir() - $migrations = array_slice( $migrations, 2 ); - } - - array_walk( $migrations, function ( &$migration, $index ) { - $migration = rtrim( $migration, '.php' ); - } ); - return $migrations; - } - /** * Get path of the migration file. * @@ -185,16 +163,16 @@ private static function get_migration_path( $migration_name ) { preg_match( '/^\d*[_]([a-zA-Z-]*)[_]/', $migration_name, $matches ); if ( 'easyengine' === $matches[1] ) { - return EE_ROOT . "/migrations/$migration_name.php"; + return EE_ROOT . "/migrations/$migration_name"; } else { - return EE_ROOT . "/vendor/easyengine/$matches[1]/migrations/$migration_name.php"; + return EE_ROOT . "/vendor/easyengine/$matches[1]/migrations/$migration_name"; } } private static function get_migration_class_name( $migration_name ) { // Remove date and package name from it - $class_name = preg_replace( '/(^\d*)[_]([a-zA-Z-]*[_])/', '', $migration_name ); + $class_name = preg_replace( '/(^\d*)[_]([a-zA-Z-]*[_])/', '', rtrim( $migration_name, '.php' ) ); // Convet snake_case to CamelCase $class_name = self::camelize( $class_name ); // Replace dot with underscore From 9dd98ec209b1ac4a7b44050bf0d3a672f6725b62 Mon Sep 17 00:00:00 2001 From: sagarnasit <sagarnasit@gmail.com> Date: Thu, 27 Sep 2018 16:33:40 +0530 Subject: [PATCH 0494/1044] Add phar check in migration --- php/EE/Migration/Executor.php | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/php/EE/Migration/Executor.php b/php/EE/Migration/Executor.php index 8e428331c..5f6477d73 100644 --- a/php/EE/Migration/Executor.php +++ b/php/EE/Migration/Executor.php @@ -42,25 +42,34 @@ public static function execute_migrations() { private static function get_all_migrations() { $packages_path = scandir( EE_VENDOR_DIR . '/easyengine' ); - $packages_path = array_slice( $packages_path, 2 ); // get migrations from packages. if ( ! empty( $packages_path ) ) { foreach ( $packages_path as $package ) { - if ( is_file( $package ) ) { + if ( '.' === $package || '..' === $package || is_file( $package ) ) { continue; } $migration_path = EE_VENDOR_DIR . '/easyengine/' . $package . '/migrations'; if ( is_dir( $migration_path ) ) { - $migrations[] = array_slice( scandir( $migration_path ), 2 ); + $files = scandir( $migration_path ); + if ( \EE\Utils\inside_phar() ) { + $migrations[] = $files; + } else{ + $migrations[] = array_slice( $files,2); + } } } } // get migrations from core. - if ( is_dir( EE_ROOT . '/migrations' ) ) { - $migrations[] = array_slice( scandir( EE_ROOT . '/migrations' ), 2 ); + if ( file_exists( EE_ROOT . '/migrations' ) ) { + $files = scandir( EE_ROOT . '/migrations' ); + if ( \EE\Utils\inside_phar() ) { + $migrations[] = $files; + } else{ + $migrations[] = array_slice( $files,2); + } } $migrations = array_merge( ...$migrations ); From 8383ed8bfef43eed8b5e65d419b6820e3d3d5423 Mon Sep 17 00:00:00 2001 From: sagarnasit <sagarnasit@gmail.com> Date: Thu, 27 Sep 2018 16:37:55 +0530 Subject: [PATCH 0495/1044] Move migration logs to debug --- php/EE/Migration/Executor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/EE/Migration/Executor.php b/php/EE/Migration/Executor.php index 5f6477d73..a850e13b9 100644 --- a/php/EE/Migration/Executor.php +++ b/php/EE/Migration/Executor.php @@ -116,7 +116,7 @@ private static function execute_migration_stack( $migrations ) { ] ); $migration->status = 'complete'; - EE::log( "Migrated: $migrations[0]" ); + EE::debug( "Migrated: $migrations[0]" ); $remaining_migrations = array_splice( $migrations, 1, count( $migrations ) ); self::execute_migration_stack( $remaining_migrations ); } catch ( \Throwable $e ) { From 0f0ed5883176de1f78d97e0ae08bdc457790dece Mon Sep 17 00:00:00 2001 From: sagarnasit <sagarnasit@gmail.com> Date: Fri, 28 Sep 2018 13:11:24 +0530 Subject: [PATCH 0496/1044] Remove test migration --- migrations/20180921123650_easyengine_test.php | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 migrations/20180921123650_easyengine_test.php diff --git a/migrations/20180921123650_easyengine_test.php b/migrations/20180921123650_easyengine_test.php deleted file mode 100644 index 6b4203fa3..000000000 --- a/migrations/20180921123650_easyengine_test.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -namespace EE\Migration; - -/** - * Placeholder migration as we need migration directory in phar but we don't have any migration files. - * - * @package EE\Migration - */ -class Test extends \EE\Migration\Base { - public function up() { - } - - public function down() { - } -} From 98d9f574b0f8d44451520d891c223e39bc14643f Mon Sep 17 00:00:00 2001 From: sagarnasit <sagarnasit@gmail.com> Date: Fri, 28 Sep 2018 13:38:54 +0530 Subject: [PATCH 0497/1044] Declare migration array before use --- php/EE/Migration/Executor.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/php/EE/Migration/Executor.php b/php/EE/Migration/Executor.php index a850e13b9..50e644246 100644 --- a/php/EE/Migration/Executor.php +++ b/php/EE/Migration/Executor.php @@ -40,7 +40,7 @@ public static function execute_migrations() { * @return array of available migrations */ private static function get_all_migrations() { - + $migrations = []; $packages_path = scandir( EE_VENDOR_DIR . '/easyengine' ); // get migrations from packages. @@ -63,7 +63,7 @@ private static function get_all_migrations() { } // get migrations from core. - if ( file_exists( EE_ROOT . '/migrations' ) ) { + if ( is_dir( EE_ROOT . '/migrations' ) ) { $files = scandir( EE_ROOT . '/migrations' ); if ( \EE\Utils\inside_phar() ) { $migrations[] = $files; @@ -72,7 +72,9 @@ private static function get_all_migrations() { } } - $migrations = array_merge( ...$migrations ); + if ( ! empty( $migrations ) ) { + $migrations = array_merge( ...$migrations ); + } return self::get_migrations_to_execute( $migrations ); } From 544231c3e17001f2faebc11faeb45dd49a42f1c2 Mon Sep 17 00:00:00 2001 From: sagarnasit <sagarnasit@gmail.com> Date: Fri, 28 Sep 2018 18:28:54 +0530 Subject: [PATCH 0498/1044] Fix phar for creating migration --- utils/make-phar.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/utils/make-phar.php b/utils/make-phar.php index 866c46ab1..625b55d18 100644 --- a/utils/make-phar.php +++ b/utils/make-phar.php @@ -222,15 +222,6 @@ function get_composer_versions( $current_version ) { add_file( $phar, $file ); } -if( 2 === count( scandir(__DIR__ . '/../migrations') ) ) { - $finder = new Finder(); - $finder->directories()->name('migrations')->in(EE_ROOT); - - foreach ( $finder as $file ) { - add_file( $phar, $file ); - } -} - $finder = new Finder(); $finder ->files() @@ -256,6 +247,12 @@ function get_composer_versions( $current_version ) { ->name('*.mustache') ->name('.env.mustache'); +$finder + ->files() + ->ignoreDotFiles(false) + ->in(EE_VENDOR_DIR . '/easyengine/*/migrations') + ->name('*.php'); + foreach ( $finder as $file ) { add_file( $phar, $file ); } From a6e668268ab1483066c516721e3fff67d1a647a7 Mon Sep 17 00:00:00 2001 From: sagarnasit <sagarnasit@gmail.com> Date: Fri, 28 Sep 2018 22:55:54 +0530 Subject: [PATCH 0499/1044] Move revert call if migration has db record --- php/EE/Migration/Executor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/EE/Migration/Executor.php b/php/EE/Migration/Executor.php index 50e644246..e40140c1a 100644 --- a/php/EE/Migration/Executor.php +++ b/php/EE/Migration/Executor.php @@ -126,10 +126,10 @@ private static function execute_migration_stack( $migrations ) { EE::error( "Errors were encountered while processing: $migrations[0]\n" . $e->getMessage(), false ); } EE::debug( "Reverting: $migrations[0]" ); - $migration->down(); // remove db entry in 'migration' table when reverting migrations. $migrated = Migration::where( 'migration', $migrations[0] ); if ( ! empty( $migrated ) ) { + $migration->down(); $migrated[0]->delete(); } From f348112072abc48a83f0762be13b3f992851fbd2 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Mon, 1 Oct 2018 11:50:05 +0530 Subject: [PATCH 0500/1044] Make get and set methods of Option model static Signed-off-by: Kirtan Gajjar <kirtangajjar95@gmail.com> --- php/EE/Model/Option.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/php/EE/Model/Option.php b/php/EE/Model/Option.php index f026b0a87..3900193d2 100644 --- a/php/EE/Model/Option.php +++ b/php/EE/Model/Option.php @@ -20,7 +20,7 @@ class Option extends Base { * @throws \Exception * @return bool Key set or not */ - public function set( string $key, string $value ) { + public static function set( string $key, string $value ) { $existing_key = static::find( $key ); if ( empty( $existing_key ) ) { @@ -45,7 +45,7 @@ public function set( string $key, string $value ) { * @throws \Exception * @return bool|Option */ - public function get( string $key ) { + public static function get( string $key ) { $option = static::find( $key ); return false === $option ? false : $option->value; From d3026ef99a5d13f426259875498ab5c821084375 Mon Sep 17 00:00:00 2001 From: sagarnasit <sagarnasit@gmail.com> Date: Wed, 3 Oct 2018 12:17:02 +0530 Subject: [PATCH 0501/1044] Add .gitkeep in migrations directory --- migrations/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 migrations/.gitkeep diff --git a/migrations/.gitkeep b/migrations/.gitkeep new file mode 100644 index 000000000..e69de29bb From 131b70f3b8076bf4c52f02dcc2a181a9f70a2f65 Mon Sep 17 00:00:00 2001 From: sagarnasit <sagarnasit@gmail.com> Date: Wed, 3 Oct 2018 15:02:25 +0530 Subject: [PATCH 0502/1044] Eliminate none migration files from migration stack --- php/EE/Migration/Executor.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/php/EE/Migration/Executor.php b/php/EE/Migration/Executor.php index e40140c1a..bcb2073b8 100644 --- a/php/EE/Migration/Executor.php +++ b/php/EE/Migration/Executor.php @@ -76,7 +76,14 @@ private static function get_all_migrations() { $migrations = array_merge( ...$migrations ); } - return self::get_migrations_to_execute( $migrations ); + $migrations = self::get_migrations_to_execute( $migrations ); + + return array_filter( $migrations, function ( $file_name ) { + if ( preg_match( '/^\d*[_]([a-zA-Z-]*)[_].*(\.php)$/', $file_name ) ) { + return true; + } + return false; + } ); } /** @@ -173,6 +180,9 @@ private static function get_migrations_from_db() { private static function get_migration_path( $migration_name ) { preg_match( '/^\d*[_]([a-zA-Z-]*)[_]/', $migration_name, $matches ); + if ( empty( $matches[1] ) ) { + return ''; + } if ( 'easyengine' === $matches[1] ) { return EE_ROOT . "/migrations/$migration_name"; } else { From 4efc8ae420efe4f835cc29b92e08bd71a52bc5fe Mon Sep 17 00:00:00 2001 From: sagarnasit <sagarnasit@gmail.com> Date: Thu, 4 Oct 2018 15:20:50 +0530 Subject: [PATCH 0503/1044] Change old column names with new name --- php/EE/Migration/Containers.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index d4f1dedb5..189b968e5 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -68,30 +68,30 @@ private static function pull_or_error( $image, $version ) { * Migrates all containers of existing sites */ private static function migrate_site_containers() { - $sites = \EE_DB::select( [ 'sitename', 'site_path', 'site_type', 'cache_type', 'is_ssl', 'db_host' ] ); + $sites = \EE_DB::select( [ 'site_url', 'site_fs_path', 'site_type', 'cache_nginx_browser', 'site_ssl', 'db_host' ] ); $site_docker = new \Site_Docker(); foreach ( $sites as $site ) { $data = []; $data[] = $site['site_type']; - $data[] = $site['cache_type']; - $data[] = $site['is_ssl']; + $data[] = $site['cache_nginx_browser']; + $data[] = $site['site_ssl']; $data[] = $site['db_host']; $docker_compose_contents = $site_docker->generate_docker_compose_yml( $data ); - $docker_compose_path = $site['site_path'] . '/docker-compose.yml'; - $docker_compose_backup_path = $site['site_path'] . '/docker-compose.yml.bak'; + $docker_compose_path = $site['site_fs_path'] . '/docker-compose.yml'; + $docker_compose_backup_path = $site['site_fs_path'] . '/docker-compose.yml.bak'; self::$rsp->add_step( - "upgrade-${site['sitename']}-copy-compose-file", + "upgrade-${site['site_url']}-copy-compose-file", 'EE\Migration\Containers::site_copy_compose_file_up', null, [ $site, $docker_compose_path, $docker_compose_backup_path ] ); self::$rsp->add_step( - "upgrade-${site['sitename']}-containers", + "upgrade-${site['site_url']}-containers", 'EE\Migration\Containers::site_containers_up', 'EE\Migration\Containers::site_containers_down', [ $site, $docker_compose_backup_path, $docker_compose_path, $docker_compose_contents ], @@ -212,7 +212,7 @@ public static function cron_container_down( $existing_cron_image ) { */ public static function site_copy_compose_file_up( $site, $docker_compose_path, $docker_compose_backup_path ) { if ( ! default_launch( "cp $docker_compose_path $docker_compose_backup_path" ) ) { - throw new \Exception( "Unable to find docker-compose.yml in ${site['site_path']} or couldn't create it's backup file. Ensure that EasyEngine has permission to create file there" ); + throw new \Exception( "Unable to find docker-compose.yml in ${site['site_fs_path']} or couldn't create it's backup file. Ensure that EasyEngine has permission to create file there" ); } } @@ -228,10 +228,10 @@ public static function site_copy_compose_file_up( $site, $docker_compose_path, $ */ public static function site_containers_up( $site, $docker_compose_backup_path, $docker_compose_path, $docker_compose_contents ) { file_put_contents( $docker_compose_path, $docker_compose_contents ); - $container_upgraded = default_launch( "cd ${site['site_path']} && docker-compose up -d" ); + $container_upgraded = default_launch( "cd ${site['site_fs_path']} && docker-compose up -d" ); if ( ! $container_upgraded ) { - throw new \Exception( "Unable to upgrade containers of site: ${site['sitename']}. Please check logs for more details." ); + throw new \Exception( "Unable to upgrade containers of site: ${site['site_url']}. Please check logs for more details." ); } } @@ -246,10 +246,10 @@ public static function site_containers_up( $site, $docker_compose_backup_path, $ */ public static function site_containers_down( $site, $docker_compose_backup_path, $docker_compose_path ) { rename( $docker_compose_backup_path, $docker_compose_path ); - $container_downgraded = default_launch( "cd ${site['site_path']} && docker-compose up -d" ); + $container_downgraded = default_launch( "cd ${site['site_fs_path']} && docker-compose up -d" ); if ( ! $container_downgraded ) { - throw new \Exception( "Unable to downgrade containers of ${site['sitename']} site. Please check logs for more details." ); + throw new \Exception( "Unable to downgrade containers of ${site['site_url']} site. Please check logs for more details." ); } } } From 4c70aa2d46f33c6ca36b03729f20ec767b324717 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Wed, 10 Oct 2018 16:17:48 +0530 Subject: [PATCH 0504/1044] Fix saving and getting boolean value Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Model/Base.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/php/EE/Model/Base.php b/php/EE/Model/Base.php index 2d8ee3baf..cb187beed 100644 --- a/php/EE/Model/Base.php +++ b/php/EE/Model/Base.php @@ -166,13 +166,18 @@ public static function create( $columns = [] ) { * Returns all model with condition * * @param string|array $column Column to search in - * @param string $value Value to match + * @param string $value Value to match * * @throws \Exception * * @return array */ public static function where( $column, $value = '' ) { + + if ( is_bool( $value ) ) { + $value = (int) $value; + } + return static::many_array_to_model( EE::db() ->table( static::$table ) @@ -245,8 +250,15 @@ public function __unset( $name ) { * @return bool Model saved successfully */ public function save() { + $fields = $this->fields; + foreach ( $fields as $key => $value ) { + if ( is_bool( $value ) ) { + $fields[ $key ] = (int) $value; + } + } + if ( static::$needs_update_timestamp ) { $fields = array_merge( $fields, [ From a3bb7eecd894b3c633abc02d0be473993ba55d3b Mon Sep 17 00:00:00 2001 From: sagarnasit <sagarnasit@gmail.com> Date: Thu, 11 Oct 2018 11:57:25 +0530 Subject: [PATCH 0505/1044] Update ee-cron-scheduler with constant --- php/EE/Migration/Containers.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index 189b968e5..fe8a973ce 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -118,7 +118,7 @@ private static function migrate_global_containers() { } // Upgrade cron container - $existing_cron_image = EE::launch( 'docker inspect --format=\'{{.Config.Image}}\' ee-cron-scheduler', false, true ); + $existing_cron_image = EE::launch( 'docker inspect --format=\'{{.Config.Image}}\' ' . EE_CRON_SCHEDULER, false, true ); if ( 0 === $existing_cron_image->return_code ) { self::$rsp->add_step( 'upgrade-cron-container', @@ -174,12 +174,12 @@ public static function nginxproxy_container_down( $existing_nginx_proxy_image ) */ public static function cron_container_up() { $cron_image = 'easyengine/cron:v' . EE_VERSION; - $cron_scheduler_run_command = 'docker run --name ee-cron-scheduler --restart=always -d -v ' . EE_ROOT_DIR . '/cron:/etc/ofelia:ro -v /var/run/docker.sock:/var/run/docker.sock:ro ' . $cron_image; + $cron_scheduler_run_command = 'docker run --name ' . EE_CRON_SCHEDULER . ' --restart=always -d -v ' . EE_ROOT_DIR . '/cron:/etc/ofelia:ro -v /var/run/docker.sock:/var/run/docker.sock:ro ' . $cron_image; - default_launch( 'docker rm -f ee-cron-scheduler', false, true ); + default_launch( 'docker rm -f ' . EE_CRON_SCHEDULER, false, true ); if ( ! default_launch( $cron_scheduler_run_command, false, true ) ) { - throw new \Exception( ' Unable to upgrade ee-cron-scheduler container' ); + throw new \Exception( ' Unable to upgrade ' . EE_CRON_SCHEDULER . ' container' ); } } @@ -192,12 +192,12 @@ public static function cron_container_up() { */ public static function cron_container_down( $existing_cron_image ) { $cron_image = trim( $existing_cron_image->stdout ); - $cron_scheduler_run_command = 'docker run --name ee-cron-scheduler --restart=always -d -v ' . EE_ROOT_DIR . '/cron:/etc/ofelia:ro -v /var/run/docker.sock:/var/run/docker.sock:ro ' . $cron_image; + $cron_scheduler_run_command = 'docker run --name ' . EE_CRON_SCHEDULER . ' --restart=always -d -v ' . EE_ROOT_DIR . '/cron:/etc/ofelia:ro -v /var/run/docker.sock:/var/run/docker.sock:ro ' . $cron_image; - default_launch( 'docker rm -f ee-cron-scheduler', false, true ); + default_launch( 'docker rm -f ' . EE_CRON_SCHEDULER, false, true ); if ( ! default_launch( $cron_scheduler_run_command, false, true ) ) { - throw new \Exception( ' Unable to restore ee-cron-scheduler container' ); + throw new \Exception( ' Unable to restore ' . EE_CRON_SCHEDULER . ' container' ); } } From 9902fa7b0df39eb7a2820eb6c9516b6f04273ce7 Mon Sep 17 00:00:00 2001 From: sagarnasit <sagarnasit@gmail.com> Date: Tue, 16 Oct 2018 19:06:23 +0530 Subject: [PATCH 0506/1044] Add docker image info migration --- ...asyengine_insert_docker_images_version.php | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 migrations/20181016052850_easyengine_insert_docker_images_version.php diff --git a/migrations/20181016052850_easyengine_insert_docker_images_version.php b/migrations/20181016052850_easyengine_insert_docker_images_version.php new file mode 100644 index 000000000..aaa359c0f --- /dev/null +++ b/migrations/20181016052850_easyengine_insert_docker_images_version.php @@ -0,0 +1,74 @@ +<?php + +namespace EE\Migration; + +use EE; +use EE\Migration\Base; + +class InsertDockerImagesVersion extends Base { + + private static $pdo; + + public function __construct() { + + try { + self::$pdo = new \PDO( 'sqlite:' . DB ); + self::$pdo->setAttribute( \PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION ); + } catch ( \PDOException $exception ) { + EE::error( $exception->getMessage() ); + } + + } + + /** + * Execute create table query for site and sitemeta table. + * + * @throws EE\ExitException + */ + public function up() { + + EE::log( 'Checking/Pulling required images' ); + $images = [ + 'easyengine/cron' => 'v4.0.0-beta.5', + 'easyengine/mailhog' => 'v4.0.0-beta.5', + 'easyengine/mariadb' => 'v4.0.0-beta.5', + 'easyengine/nginx-proxy' => 'v4.0.0-beta.6', + 'easyengine/nginx' => 'v4.0.0-beta.5', + 'easyengine/php' => 'v4.0.0-beta.6', + 'easyengine/phpmyadmin' => 'v4.0.0-beta.5', + 'easyengine/postfix' => 'v4.0.0-beta.5', + 'easyengine/redis' => 'v4.0.0-beta.5', + ]; + + $query = ''; + foreach ( $images as $image => $tag ) { + EE::debug( "Checking/Pulling docker image $image:$tag" ); + if ( ! \EE::exec( "docker pull ${image}:${tag}" ) ) { + throw new \Exception( "Unable to pull ${image}:${tag}. Please check logs for more details." ); + } + $query .= "INSERT INTO options VALUES( '${image}', '${tag}' );"; + } + + try { + self::$pdo->exec( $query ); + } catch ( PDOException $exception ) { + EE::error( 'Encountered Error while inserting in "options" table: ' . $exception->getMessage(), false ); + } + } + + /** + * Execute drop table query for site and sitemeta table. + * + * @throws EE\ExitException + */ + public function down() { + + $query = "DELETE FROM options WHERE key LIKE 'easyengine/%';"; + + try { + self::$pdo->exec( $query ); + } catch ( PDOException $exception ) { + EE::error( 'Encountered Error while deleting from "options" table: ' . $exception->getMessage(), false ); + } + } +} From 871a3bb5f1b0e93069e9817083f648c21ccfb858 Mon Sep 17 00:00:00 2001 From: sagarnasit <sagarnasit@gmail.com> Date: Tue, 16 Oct 2018 22:27:27 +0530 Subject: [PATCH 0507/1044] Check image version difference for image migration --- php/EE/Migration/Containers.php | 58 ++++++++++++++++++++++++--------- php/EE/Runner.php | 3 +- 2 files changed, 44 insertions(+), 17 deletions(-) diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index fe8a973ce..3a5604b0b 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -22,8 +22,8 @@ class Containers { public static function start_container_migration() { EE\Utils\delem_log( 'Starting container migration' ); - self::$rsp = new RevertableStepProcessor(); - self::pull_new_images(); +// self::$rsp = new RevertableStepProcessor(); + self::docker_image_migration(); self::migrate_site_containers(); self::migrate_global_containers(); if ( ! self::$rsp->execute() ) { @@ -34,20 +34,27 @@ public static function start_container_migration() { } /** - * Pulls new images of all containers used by easyengine + * Migrate all docker images with new version. */ - private static function pull_new_images() { - - $img_versions = EE\Utils\get_image_versions(); - self::pull_or_error( 'easyengine/php', $img_versions['easyengine/php'] ); - self::pull_or_error( 'easyengine/cron', $img_versions['easyengine/cron'] ); - self::pull_or_error( 'easyengine/redis', $img_versions['easyengine/redis'] ); - self::pull_or_error( 'easyengine/nginx', $img_versions['easyengine/nginx'] ); - self::pull_or_error( 'easyengine/postfix', $img_versions['easyengine/postfix'] ); - self::pull_or_error( 'easyengine/mailhog', $img_versions['easyengine/mailhog'] ); - self::pull_or_error( 'easyengine/mariadb', $img_versions['easyengine/mariadb'] ); - self::pull_or_error( 'easyengine/phpmyadmin', $img_versions['easyengine/phpmyadmin'] ); - self::pull_or_error( 'easyengine/nginx-proxy', $img_versions['easyengine/nginx-proxy'] ); + private static function docker_image_migration() { + + $img_versions = EE\Utils\get_image_versions(); + $current_versions = self::get_current_docker_images_versions(); + + $changed_images = []; + foreach ( $img_versions as $img => $version ) { + if ( $current_versions[ $img ] !== $version ) { + $changed_images[ $img ] = $version; + self::pull_or_error( $img, $version ); + } + } + + if( empty( $changed_images) ) { + return; + } + + self::migrate_global_containers(); + } /** @@ -59,11 +66,30 @@ private static function pull_new_images() { * @throws \Exception */ private static function pull_or_error( $image, $version ) { - if ( ! default_launch( "docker pull $image:$version" ) ) { + if ( ! \EE::exec( "docker pull $image:$version" ) ) { throw new \Exception( "Unable to pull $image. Please check logs for more details." ); } } + /** + * Get current docker images versions. + * + * @return array + * @throws \Exception + */ + private static function get_current_docker_images_versions() { + $images = EE::db() + ->table( 'options' ) + ->where( 'key', 'like', 'easyengine/%' ) + ->all(); + + $images = array_map( function ( $image ) { + return [ $image['key'] => $image['value'] ]; + }, $images ); + + return array_merge( ...$images ); + } + /** * Migrates all containers of existing sites */ diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 9480877ed..6eed6d75a 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -69,7 +69,8 @@ private function init_ee() { */ private function migrate() { $rsp = new \EE\RevertableStepProcessor(); - $rsp->add_step( 'ee-migrations', 'EE\Migration\Executor::execute_migrations' ); + $rsp->add_step( 'ee-db-migrations', 'EE\Migration\Executor::execute_migrations' ); + $rsp->add_step( 'ee-container-migrations', 'EE\Migration\Containers::start_container_migration' ); return $rsp->execute(); } From d0cc1e530975cbc9951e13f9924f4d4d3553b17a Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Wed, 17 Oct 2018 12:08:26 +0530 Subject: [PATCH 0508/1044] Add service check Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/class-ee-docker.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php index d623b2b15..a91fcf2e5 100644 --- a/php/class-ee-docker.php +++ b/php/class-ee-docker.php @@ -199,4 +199,19 @@ public static function docker_compose_down( $dir ) { return false; } + /** + * Check if a particular service exists in given docker-compose.yml. + * + * @param string $service Service whose availability needs to be checked. + * @param string $site_fs_path Path to the site root where docker-compose.yml file is present. + * + * @return bool Whether service is available or not. + */ + public static function service_exists( $service, $site_fs_path ) { + chdir( $site_fs_path ); + $launch = EE::launch( 'docker-compose config --services' ); + $services = explode( PHP_EOL, trim( $launch->stdout ) ); + + return in_array( $service, $services, true ); + } } From c2458ec57c8f1f7d6c8a0cc31f436b3e0f31fa87 Mon Sep 17 00:00:00 2001 From: sagarnasit <sagarnasit@gmail.com> Date: Thu, 18 Oct 2018 00:29:35 +0530 Subject: [PATCH 0509/1044] Add global container migration --- ...asyengine_insert_docker_images_version.php | 12 +- php/EE/Migration/Containers.php | 225 +++++++++++++++--- php/EE/Runner.php | 6 +- 3 files changed, 193 insertions(+), 50 deletions(-) diff --git a/migrations/20181016052850_easyengine_insert_docker_images_version.php b/migrations/20181016052850_easyengine_insert_docker_images_version.php index aaa359c0f..bcd75f2b3 100644 --- a/migrations/20181016052850_easyengine_insert_docker_images_version.php +++ b/migrations/20181016052850_easyengine_insert_docker_images_version.php @@ -28,17 +28,7 @@ public function __construct() { public function up() { EE::log( 'Checking/Pulling required images' ); - $images = [ - 'easyengine/cron' => 'v4.0.0-beta.5', - 'easyengine/mailhog' => 'v4.0.0-beta.5', - 'easyengine/mariadb' => 'v4.0.0-beta.5', - 'easyengine/nginx-proxy' => 'v4.0.0-beta.6', - 'easyengine/nginx' => 'v4.0.0-beta.5', - 'easyengine/php' => 'v4.0.0-beta.6', - 'easyengine/phpmyadmin' => 'v4.0.0-beta.5', - 'easyengine/postfix' => 'v4.0.0-beta.5', - 'easyengine/redis' => 'v4.0.0-beta.5', - ]; + $images = EE\Utils\get_image_versions(); $query = ''; foreach ( $images as $image => $tag ) { diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index 3a5604b0b..b3e65a29c 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -22,10 +22,11 @@ class Containers { public static function start_container_migration() { EE\Utils\delem_log( 'Starting container migration' ); -// self::$rsp = new RevertableStepProcessor(); + self::$rsp = new RevertableStepProcessor(); self::docker_image_migration(); - self::migrate_site_containers(); - self::migrate_global_containers(); + // @todo: add doc blocks. + // @todo: update database after image migration. +// self::migrate_site_containers(); if ( ! self::$rsp->execute() ) { throw new \Exception( 'Unable to migrate sites to newer version' ); } @@ -44,7 +45,7 @@ private static function docker_image_migration() { $changed_images = []; foreach ( $img_versions as $img => $version ) { if ( $current_versions[ $img ] !== $version ) { - $changed_images[ $img ] = $version; + $changed_images[] = $img; self::pull_or_error( $img, $version ); } } @@ -53,7 +54,7 @@ private static function docker_image_migration() { return; } - self::migrate_global_containers(); + self::migrate_global_containers( $changed_images ); } @@ -94,7 +95,8 @@ private static function get_current_docker_images_versions() { * Migrates all containers of existing sites */ private static function migrate_site_containers() { - $sites = \EE_DB::select( [ 'site_url', 'site_fs_path', 'site_type', 'cache_nginx_browser', 'site_ssl', 'db_host' ] ); + $db = new \EE_DB(); + $sites = $db->select( 'site_url', 'site_fs_path', 'site_type', 'cache_nginx_browser', 'site_ssl', 'db_host' ); $site_docker = new \Site_Docker(); foreach ( $sites as $site ) { @@ -129,31 +131,141 @@ private static function migrate_site_containers() { /** * Migrates global containers. These are container which are not created per site (i.e. ee-cron-scheduler) */ - private static function migrate_global_containers() { + private static function migrate_global_containers( $changes_images ) { + + self::$rsp->add_step( + 'backup-global-docker-compose-file', + 'EE\Migration\Containers::backup_global_compose_file', + 'EE\Migration\Containers::revert_global_containers', + null, + null + ); + + self::$rsp->add_step( + 'stop-global-containers', + 'EE\Migration\Containers::down_global_containers', + null, + [ $changes_images ], + null + ); + + self::$rsp->add_step( + 'generate-global-docker-compose-file', + 'EE\Service\Utils\generate_global_docker_compose_yml', + null, + [ new \Symfony\Component\Filesystem\Filesystem() ], + null + ); // Upgrade nginx-proxy container $existing_nginx_proxy_image = EE::launch( sprintf( 'docker inspect --format=\'{{.Config.Image}}\' %1$s', EE_PROXY_TYPE ), false, true ); - if ( 0 === $existing_nginx_proxy_image->return_code ) { + if ( in_array( 'easyengine/nginx-proxy', $changes_images, true ) && 0 === $existing_nginx_proxy_image->return_code ) { self::$rsp->add_step( 'upgrade-nginxproxy-container', 'EE\Migration\Containers::nginxproxy_container_up', 'EE\Migration\Containers::nginxproxy_container_down', null, - [ $existing_nginx_proxy_image ] + null + ); + } + + // Upgrade global-db container + $existing_db_image = EE::launch( 'docker inspect --format=\'{{.Config.Image}}\' ' . GLOBAL_DB_CONTAINER, false, true ); + if ( in_array( 'easyengine/mariadb', $changes_images, true ) && 0 === $existing_db_image->return_code ) { + self::$rsp->add_step( + 'upgrade-global-db-container', + 'EE\Migration\Containers::global_db_container_up', + 'EE\Migration\Containers::global_db_container_down', + null, + null ); } // Upgrade cron container $existing_cron_image = EE::launch( 'docker inspect --format=\'{{.Config.Image}}\' ' . EE_CRON_SCHEDULER, false, true ); - if ( 0 === $existing_cron_image->return_code ) { + if ( in_array( 'easyengine/cron', $changes_images, true ) && 0 === $existing_cron_image->return_code ) { self::$rsp->add_step( 'upgrade-cron-container', 'EE\Migration\Containers::cron_container_up', 'EE\Migration\Containers::cron_container_down', null, - [ $existing_cron_image ] + null ); } + + // Upgrade redis container + $existing_redis_image = EE::launch( 'docker inspect --format=\'{{.Config.Image}}\' ' . GLOBAL_REDIS_CONTAINER, false, true ); + if ( in_array( 'easyengine/cron', $changes_images, true ) && 0 === $existing_redis_image->return_code ) { + self::$rsp->add_step( + 'upgrade-global-redis-container', + 'EE\Migration\Containers::global_redis_container_up', + 'EE\Migration\Containers::global_redis_container_down', + null, + null + ); + } + } + + public static function down_global_containers( $changed_images ) { + + chdir( EE_ROOT_DIR . '/services' ); + + if ( in_array( 'easyengine/nginx-proxy', $changed_images, true ) ) { + if ( ! EE::exec( 'docker-compose stop global-nginx-proxy && docker-compose rm -f global-nginx-proxy' ) ) { + throw new \Exception( 'Unable to stop ' . EE_PROXY_TYPE . ' container' ); + } + } + + if ( in_array( 'easyengine/mariadb', $changed_images, true ) ) { + if ( ! EE::exec( 'docker-compose stop global-db && docker-compose rm -f global-db' ) ) { + throw new \Exception( 'Unable to stop ' . GLOBAL_DB_CONTAINER . 'container' ); + } + } + + if ( in_array( 'easyengine/redis', $changed_images, true ) ) { + if ( ! EE::exec( 'docker-compose stop global-redis && docker-compose rm -f global-redis' ) ) { + throw new \Exception( 'Unable to stop ' . GLOBAL_REDIS_CONTAINER . 'container' ); + } + } + + if ( in_array( 'easyengine/cron', $changed_images, true ) ) { + if ( ! EE::exec( 'docker-compose stop cron-scheduler && docker-compose rm -f cron-scheduler' ) ) { + throw new \Exception( 'Unable to stop ' . GLOBAL_REDIS_CONTAINER . 'container' ); + } + } + + } + + /** + * Take backup of current global docker-compose.yml file. + * + * @throws \Exception + */ + public static function backup_global_compose_file() { + $global_compose_file_path = EE_ROOT_DIR . '/services/docker-compose.yml'; + $global_compose_backup_file_path = EE_ROOT_DIR . '/services/docker-compose.yml.backup'; + + if ( ! EE::exec( "cp $global_compose_file_path $global_compose_backup_file_path" ) ) { + throw new \Exception( "Unable to find docker-compose.yml or couldn't create it's backup file. Ensure that EasyEngine has permission to create file there" ); + } + } + + /** + * Revert to backed up docker-compose.yml file. + * + * @throws \Exception + */ + public static function revert_global_containers() { + $global_compose_file_path = EE_ROOT_DIR . '/services/docker-compose.yml'; + $global_compose_backup_file_path = EE_ROOT_DIR . '/services/docker-compose.yml.backup'; + + rename( $global_compose_backup_file_path, $global_compose_file_path ); + chdir( EE_ROOT_DIR . '/services' ); + $container_downgraded = EE::exec( 'docker-compose up -d' ); + + if ( ! $container_downgraded ) { + throw new \Exception( 'Unable to downgrade global containers. Please check logs for more details.' ); + } } /** @@ -162,16 +274,18 @@ private static function migrate_global_containers() { * @throws \Exception */ public static function nginxproxy_container_up() { - $EE_ROOT_DIR = EE_ROOT_DIR; - $nginx_proxy_image = 'easyengine/nginx-proxy:v' . EE_VERSION; - $ee_proxy_command = sprintf( 'docker run --name %1$s -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v %2$s/nginx/certs:/etc/nginx/certs -v %2$s/nginx/dhparam:/etc/nginx/dhparam -v %2$s/nginx/conf.d:/etc/nginx/conf.d -v %2$s/nginx/htpasswd:/etc/nginx/htpasswd -v %2$s/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v %2$s:/app/ee4 -v /usr/share/nginx/html %3$s', EE_PROXY_TYPE, $EE_ROOT_DIR, $nginx_proxy_image ); + $default_conf_path = EE_ROOT_DIR . '/services/nginx-proxy/conf.d/default.conf'; + $fs = new \Symfony\Component\Filesystem\Filesystem(); - default_launch( sprintf( 'docker rm -f %1$s', EE_PROXY_TYPE ), false, true ); - - if ( ! default_launch( $ee_proxy_command, false, true ) ) { - throw new \Exception( sprintf( 'Unable to upgrade %1$s container', EE_PROXY_TYPE ) ); + if ( $fs->exists( $default_conf_path ) ) { + $fs->remove( $default_conf_path ); } + chdir( EE_ROOT_DIR . '/services' ); + if( ! EE::exec( 'docker-compose up -d global-nginx-proxy ' ) ) { + throw new \Exception( sprintf( 'Unable to restart %1$s container', EE_PROXY_TYPE ) ); + }; + } /** @@ -182,15 +296,55 @@ public static function nginxproxy_container_up() { * @throws \Exception */ public static function nginxproxy_container_down( $existing_nginx_proxy_image ) { - $EE_ROOT_DIR = EE_ROOT_DIR; - $nginx_proxy_image = trim( $existing_nginx_proxy_image->stout ); - $ee_proxy_command = sprintf( 'docker run --name %1$s -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` --restart=always -d -p 80:80 -p 443:443 -v %2$s/nginx/certs:/etc/nginx/certs -v %2$s/nginx/dhparam:/etc/nginx/dhparam -v %2$s/nginx/conf.d:/etc/nginx/conf.d -v %2$s/nginx/htpasswd:/etc/nginx/htpasswd -v %2$s/nginx/vhost.d:/etc/nginx/vhost.d -v /var/run/docker.sock:/tmp/docker.sock:ro -v %2$s:/app/ee4 -v /usr/share/nginx/html %3$s', EE_PROXY_TYPE, $EE_ROOT_DIR, $nginx_proxy_image ); + chdir( EE_ROOT_DIR . '/services' ); - default_launch( sprintf( 'docker rm -f %1$s', EE_PROXY_TYPE ), false, true ); + if ( ! EE::exec('docker-compose stop global-nginx-proxy && docker-compose rm -f global-nginx-proxy') ) { + throw new \Exception( sprintf( 'Unable to stop %1$s container', EE_PROXY_TYPE ) ); + } + + $default_conf_path = EE_ROOT_DIR . '/services/nginx-proxy/conf.d/default.conf'; + $fs = new \Symfony\Component\Filesystem\Filesystem(); - if ( ! default_launch( $ee_proxy_command, false, true ) ) { - throw new \Exception( sprintf( 'Unable to restore %1$s container', EE_PROXY_TYPE ) ); + if ( $fs->exists( $default_conf_path ) ) { + $fs->remove( $default_conf_path ); } + + self::revert_global_containers(); + } + + public static function global_db_container_up() { + chdir( EE_ROOT_DIR . '/services' ); + + if( ! EE::exec( 'docker-compose up -d global-db' ) ) { + throw new \Exception( sprintf( 'Unable to restart %1$s container', GLOBAL_DB_CONTAINER ) ); + }; + } + + public static function global_db_container_down() { + chdir( EE_ROOT_DIR . '/services' ); + + if( ! EE::exec( 'docker-compose stop global-db && docker-compose rm -f global-db' ) ) { + throw new \Exception( sprintf( 'Unable to restart %1$s container', GLOBAL_DB_CONTAINER ) ); + }; + + self::revert_global_containers(); + } + + public static function global_redis_container_up() { + chdir( EE_ROOT_DIR . '/services' ); + + if( ! EE::exec( 'docker-compose up -d global-redis' ) ) { + throw new \Exception( sprintf( 'Unable to restart %1$s container', GLOBAL_REDIS_CONTAINER ) ); + }; + } + + public static function global_redis_container_down() { + chdir( EE_ROOT_DIR . '/services' ); + + if( ! EE::exec( 'docker-compose stop global-redis && docker-compose rm -f global-redis' ) ) { + throw new \Exception( sprintf( 'Unable to restart %1$s container', GLOBAL_REDIS_CONTAINER ) ); + }; + self::revert_global_containers(); } /** @@ -199,14 +353,11 @@ public static function nginxproxy_container_down( $existing_nginx_proxy_image ) * @throws \Exception */ public static function cron_container_up() { - $cron_image = 'easyengine/cron:v' . EE_VERSION; - $cron_scheduler_run_command = 'docker run --name ' . EE_CRON_SCHEDULER . ' --restart=always -d -v ' . EE_ROOT_DIR . '/cron:/etc/ofelia:ro -v /var/run/docker.sock:/var/run/docker.sock:ro ' . $cron_image; + chdir( EE_ROOT_DIR . '/services' ); - default_launch( 'docker rm -f ' . EE_CRON_SCHEDULER, false, true ); - - if ( ! default_launch( $cron_scheduler_run_command, false, true ) ) { - throw new \Exception( ' Unable to upgrade ' . EE_CRON_SCHEDULER . ' container' ); - } + if( ! EE::exec( 'docker-compose up -d docker-compose' ) ) { + throw new \Exception( sprintf( 'Unable to restart %1$s container', EE_CRON_SCHEDULER ) ); + }; } /** @@ -217,14 +368,12 @@ public static function cron_container_up() { * @throws \Exception */ public static function cron_container_down( $existing_cron_image ) { - $cron_image = trim( $existing_cron_image->stdout ); - $cron_scheduler_run_command = 'docker run --name ' . EE_CRON_SCHEDULER . ' --restart=always -d -v ' . EE_ROOT_DIR . '/cron:/etc/ofelia:ro -v /var/run/docker.sock:/var/run/docker.sock:ro ' . $cron_image; + chdir( EE_ROOT_DIR . '/services' ); - default_launch( 'docker rm -f ' . EE_CRON_SCHEDULER, false, true ); - - if ( ! default_launch( $cron_scheduler_run_command, false, true ) ) { - throw new \Exception( ' Unable to restore ' . EE_CRON_SCHEDULER . ' container' ); - } + if( ! EE::exec( 'docker-compose stop cron-scheduler && docker-compose rm -f cron-scheduler' ) ) { + throw new \Exception( sprintf( 'Unable to restart %1$s container', EE_CRON_SCHEDULER ) ); + }; + self::revert_global_containers(); } /** diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 6eed6d75a..f8dda3942 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -70,7 +70,11 @@ private function init_ee() { private function migrate() { $rsp = new \EE\RevertableStepProcessor(); $rsp->add_step( 'ee-db-migrations', 'EE\Migration\Executor::execute_migrations' ); - $rsp->add_step( 'ee-container-migrations', 'EE\Migration\Containers::start_container_migration' ); + + $version = Option::where( 'key', 'version' ); + if ( ! empty( $version ) ) { + $rsp->add_step( 'ee-container-migrations', 'EE\Migration\Containers::start_container_migration' ); + } return $rsp->execute(); } From 14b65197f59b466c65d3baf94727c6b496d2ea87 Mon Sep 17 00:00:00 2001 From: sagarnasit <sagarnasit@gmail.com> Date: Thu, 18 Oct 2018 15:53:15 +0530 Subject: [PATCH 0510/1044] Add site container migration --- php/EE/Migration/Containers.php | 129 ++++++++++++++++++---------- php/EE/Migration/SiteContainers.php | 122 ++++++++++++++++++++++++++ 2 files changed, 205 insertions(+), 46 deletions(-) create mode 100644 php/EE/Migration/SiteContainers.php diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index b3e65a29c..8c40cfdb3 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -23,10 +23,9 @@ public static function start_container_migration() { EE\Utils\delem_log( 'Starting container migration' ); self::$rsp = new RevertableStepProcessor(); - self::docker_image_migration(); + self::migrate_all_docker_images(); // @todo: add doc blocks. // @todo: update database after image migration. -// self::migrate_site_containers(); if ( ! self::$rsp->execute() ) { throw new \Exception( 'Unable to migrate sites to newer version' ); } @@ -37,7 +36,7 @@ public static function start_container_migration() { /** * Migrate all docker images with new version. */ - private static function docker_image_migration() { + private static function migrate_all_docker_images() { $img_versions = EE\Utils\get_image_versions(); $current_versions = self::get_current_docker_images_versions(); @@ -46,7 +45,7 @@ private static function docker_image_migration() { foreach ( $img_versions as $img => $version ) { if ( $current_versions[ $img ] !== $version ) { $changed_images[] = $img; - self::pull_or_error( $img, $version ); +// self::pull_or_error( $img, $version ); } } @@ -55,6 +54,7 @@ private static function docker_image_migration() { } self::migrate_global_containers( $changed_images ); + self::migrate_site_containers( $changed_images ); } @@ -92,46 +92,13 @@ private static function get_current_docker_images_versions() { } /** - * Migrates all containers of existing sites + * Migrates global containers. These are container which are not created per site (i.e. ee-cron-scheduler) */ - private static function migrate_site_containers() { - $db = new \EE_DB(); - $sites = $db->select( 'site_url', 'site_fs_path', 'site_type', 'cache_nginx_browser', 'site_ssl', 'db_host' ); - $site_docker = new \Site_Docker(); - - foreach ( $sites as $site ) { - - $data = []; - $data[] = $site['site_type']; - $data[] = $site['cache_nginx_browser']; - $data[] = $site['site_ssl']; - $data[] = $site['db_host']; + private static function migrate_global_containers( $changed_images ) { - $docker_compose_contents = $site_docker->generate_docker_compose_yml( $data ); - $docker_compose_path = $site['site_fs_path'] . '/docker-compose.yml'; - $docker_compose_backup_path = $site['site_fs_path'] . '/docker-compose.yml.bak'; - - self::$rsp->add_step( - "upgrade-${site['site_url']}-copy-compose-file", - 'EE\Migration\Containers::site_copy_compose_file_up', - null, - [ $site, $docker_compose_path, $docker_compose_backup_path ] - ); - - self::$rsp->add_step( - "upgrade-${site['site_url']}-containers", - 'EE\Migration\Containers::site_containers_up', - 'EE\Migration\Containers::site_containers_down', - [ $site, $docker_compose_backup_path, $docker_compose_path, $docker_compose_contents ], - [ $site, $docker_compose_backup_path, $docker_compose_path ] - ); + if ( ! self::is_global_container_image_changed( $changed_images ) ) { + return; } - } - - /** - * Migrates global containers. These are container which are not created per site (i.e. ee-cron-scheduler) - */ - private static function migrate_global_containers( $changes_images ) { self::$rsp->add_step( 'backup-global-docker-compose-file', @@ -145,7 +112,7 @@ private static function migrate_global_containers( $changes_images ) { 'stop-global-containers', 'EE\Migration\Containers::down_global_containers', null, - [ $changes_images ], + [ $changed_images ], null ); @@ -159,7 +126,7 @@ private static function migrate_global_containers( $changes_images ) { // Upgrade nginx-proxy container $existing_nginx_proxy_image = EE::launch( sprintf( 'docker inspect --format=\'{{.Config.Image}}\' %1$s', EE_PROXY_TYPE ), false, true ); - if ( in_array( 'easyengine/nginx-proxy', $changes_images, true ) && 0 === $existing_nginx_proxy_image->return_code ) { + if ( in_array( 'easyengine/nginx-proxy', $changed_images, true ) && 0 === $existing_nginx_proxy_image->return_code ) { self::$rsp->add_step( 'upgrade-nginxproxy-container', 'EE\Migration\Containers::nginxproxy_container_up', @@ -171,7 +138,7 @@ private static function migrate_global_containers( $changes_images ) { // Upgrade global-db container $existing_db_image = EE::launch( 'docker inspect --format=\'{{.Config.Image}}\' ' . GLOBAL_DB_CONTAINER, false, true ); - if ( in_array( 'easyengine/mariadb', $changes_images, true ) && 0 === $existing_db_image->return_code ) { + if ( in_array( 'easyengine/mariadb', $changed_images, true ) && 0 === $existing_db_image->return_code ) { self::$rsp->add_step( 'upgrade-global-db-container', 'EE\Migration\Containers::global_db_container_up', @@ -183,7 +150,7 @@ private static function migrate_global_containers( $changes_images ) { // Upgrade cron container $existing_cron_image = EE::launch( 'docker inspect --format=\'{{.Config.Image}}\' ' . EE_CRON_SCHEDULER, false, true ); - if ( in_array( 'easyengine/cron', $changes_images, true ) && 0 === $existing_cron_image->return_code ) { + if ( in_array( 'easyengine/cron', $changed_images, true ) && 0 === $existing_cron_image->return_code ) { self::$rsp->add_step( 'upgrade-cron-container', 'EE\Migration\Containers::cron_container_up', @@ -195,7 +162,7 @@ private static function migrate_global_containers( $changes_images ) { // Upgrade redis container $existing_redis_image = EE::launch( 'docker inspect --format=\'{{.Config.Image}}\' ' . GLOBAL_REDIS_CONTAINER, false, true ); - if ( in_array( 'easyengine/cron', $changes_images, true ) && 0 === $existing_redis_image->return_code ) { + if ( in_array( 'easyengine/cron', $changed_images, true ) && 0 === $existing_redis_image->return_code ) { self::$rsp->add_step( 'upgrade-global-redis-container', 'EE\Migration\Containers::global_redis_container_up', @@ -206,6 +173,60 @@ private static function migrate_global_containers( $changes_images ) { } } + public static function migrate_site_containers( $changed_images ){ + + $db = new \EE_DB(); + $sites = ($db->table('sites')->all()); + + foreach ( $sites as $key => $site ) { + + $docker_yml = $site['site_fs_path'] . '/docker-compose.yml'; + $docker_yml_backup = $site['site_fs_path'] . '/docker-compose.yml.backup'; + + if ( ! SiteContainers::is_site_service_image_changed( $changed_images, $site ) ) { + continue; + } + + $ee_site_object = SiteContainers::get_site_object( $site['site_type'] ); + + if( $site['site_enabled'] ) { + self::$rsp->add_step( + "disable-${site['site_url']}-containers", + 'EE\Migration\SiteContainers::disable_site', + 'EE\Migration\SiteContainers::enable_site', + [ $site, $ee_site_object ], + [ $site, $ee_site_object ] + ); + } + + self::$rsp->add_step( + "take-${site['site_url']}-docker-compose-backup", + 'EE\Migration\SiteContainers::backup_site_docker_compose_file', + 'EE\Migration\SiteContainers::revert_site_docker_compose_file', + [ $docker_yml, $docker_yml_backup ], + [ $docker_yml_backup, $docker_yml ] + ); + + self::$rsp->add_step( + "generate-${site['site_url']}-docker-compose", + 'EE\Migration\SiteContainers::generate_site_docker_compose_file', + null, + [ $site ], + null + ); + + if( $site['site_enabled']) { + self::$rsp->add_step( + "upgrade-${site['site_url']}-containers", + 'EE\Migration\SiteContainers::enable_site', + null, + [ $site, $ee_site_object ], + null + ); + } + } + } + public static function down_global_containers( $changed_images ) { chdir( EE_ROOT_DIR . '/services' ); @@ -347,6 +368,22 @@ public static function global_redis_container_down() { self::revert_global_containers(); } + public static function is_global_container_image_changed( $changed_image ) { + $global_images = [ + 'easyengine/mariadb', + 'easyengine/mariadb', + 'easyengine/redis', + 'easyengine/cron', + ]; + + $commom_images = array_intersect( $changed_image, $global_images ); + + if ( ! empty( $commom_images ) ) { + return true; + } + return false; + } + /** * Upgrades ee-cron-scheduler container * diff --git a/php/EE/Migration/SiteContainers.php b/php/EE/Migration/SiteContainers.php new file mode 100644 index 000000000..58f61f191 --- /dev/null +++ b/php/EE/Migration/SiteContainers.php @@ -0,0 +1,122 @@ +<?php + +namespace EE\Migration; + +use EE; +use Symfony\Component\Filesystem\Filesystem; + +/** + * Migrates existing containers to new image + */ +class SiteContainers { + + public static function backup_site_docker_compose_file( $source_path, $dest_path ) { + if ( ! EE::exec( "cp $source_path $dest_path" ) ) { + throw new \Exception( "Unable to find site's docker-compose.yml or couldn't create it's backup file. Ensure that EasyEngine has permission to create file there" ); + } + } + + public static function revert_site_docker_compose_file($source_path, $dest_path ) { + rename( $source_path, $dest_path ); + + } + + public static function is_site_service_image_changed( $changed_images, $site_info ) { + chdir( $site_info['site_fs_path'] ); + $launch = EE::launch( 'docker-compose config --services' ); + $services = explode( PHP_EOL, trim( $launch->stdout ) ); + + $site_images = array_map( function ( $service ) { + return 'easyengine/' . $service; + }, $services ); + + $common_image = array_intersect( $changed_images, $site_images ); + + if ( ! empty( $common_image ) ) { + return true; + } + return false; + } + + public static function generate_site_docker_compose_file( $site_info ) { + + $filters = self::get_site_filters( $site_info ); + + $site_docker = self::get_site_docker_object( $site_info['site_type'] ); + + $docker_yml_content = $site_docker->generate_docker_compose_yml($filters); + + $fs = new Filesystem(); + $fs->dumpFile( $site_info['site_fs_path'] . '/docker-compose.yml', $docker_yml_content ); + + } + + public static function enable_site( $site_info, $site_object ) { + $site_object->enable( [ $site_info['site_url'] ], [] ); + + } + + public static function disable_site( $site_info, $site_object ) { + $site_object->disable( [ $site_info['site_url'] ], [] ); + } + + public static function get_site_object($site_type) { + switch($site_type) { + case 'html': + return new EE\Site\Type\HTML(); + + case 'php': + return new EE\Site\Type\PHP(); + + case 'wp': + return new EE\Site\Type\WordPress(); + } + } + + public static function get_site_filters($site) { + $filters = []; + + switch( $site['site_type']) { + case 'html': + $filters[] = $site['site_type']; + break; + + case 'php': + $filters[] = $site['cache_host']; + if( 'mysql' === $site['app_sub_type']) { + $filters[] = $site['db_host']; + } + + break; + + case 'wordpress': + $filters[] = $site['app_sub_type']; + $filters[] = $site['cache_host']; + $filters[] = $site['db_host']; + + break; + } + + $filters['nohttps'] = false; + + if( 1 === $site['site_ssl']) { + $filters['nohttps'] = true; + } + + return $filters; + } + + public static function get_site_docker_object( $site_type ){ + + switch ($site_type) { + case 'html': + return new EE\Site\Type\Site_HTML_Docker(); + + case 'php': + return new EE\Site\Type\Site_PHP_Docker(); + + case 'wp': + return new EE\Site\Type\Site_WP_Docker(); + } + } +} From 916869c0622da6153bce9cc1c173d3643b1f030f Mon Sep 17 00:00:00 2001 From: sagarnasit <sagarnasit@gmail.com> Date: Thu, 18 Oct 2018 16:06:46 +0530 Subject: [PATCH 0511/1044] Remove extra code --- php/EE/Migration/Containers.php | 63 ++------------------------------- 1 file changed, 3 insertions(+), 60 deletions(-) diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index 8c40cfdb3..755466d91 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -3,7 +3,6 @@ namespace EE\Migration; use EE\RevertableStepProcessor; -use function EE\Utils\default_launch; use EE; /** @@ -24,6 +23,7 @@ public static function start_container_migration() { self::$rsp = new RevertableStepProcessor(); self::migrate_all_docker_images(); + self::migrate_custom_container_migrations(); // @todo: add doc blocks. // @todo: update database after image migration. if ( ! self::$rsp->execute() ) { @@ -45,7 +45,7 @@ private static function migrate_all_docker_images() { foreach ( $img_versions as $img => $version ) { if ( $current_versions[ $img ] !== $version ) { $changed_images[] = $img; -// self::pull_or_error( $img, $version ); + self::pull_or_error( $img, $version ); } } @@ -329,8 +329,6 @@ public static function nginxproxy_container_down( $existing_nginx_proxy_image ) if ( $fs->exists( $default_conf_path ) ) { $fs->remove( $default_conf_path ); } - - self::revert_global_containers(); } public static function global_db_container_up() { @@ -347,8 +345,6 @@ public static function global_db_container_down() { if( ! EE::exec( 'docker-compose stop global-db && docker-compose rm -f global-db' ) ) { throw new \Exception( sprintf( 'Unable to restart %1$s container', GLOBAL_DB_CONTAINER ) ); }; - - self::revert_global_containers(); } public static function global_redis_container_up() { @@ -364,8 +360,7 @@ public static function global_redis_container_down() { if( ! EE::exec( 'docker-compose stop global-redis && docker-compose rm -f global-redis' ) ) { throw new \Exception( sprintf( 'Unable to restart %1$s container', GLOBAL_REDIS_CONTAINER ) ); - }; - self::revert_global_containers(); + } } public static function is_global_container_image_changed( $changed_image ) { @@ -409,59 +404,7 @@ public static function cron_container_down( $existing_cron_image ) { if( ! EE::exec( 'docker-compose stop cron-scheduler && docker-compose rm -f cron-scheduler' ) ) { throw new \Exception( sprintf( 'Unable to restart %1$s container', EE_CRON_SCHEDULER ) ); - }; - self::revert_global_containers(); - } - - /** - * Copies updated docker-compose file site root - * - * @param $site Name of site - * @param $docker_compose_path Path where docker-compose.yml is to be copied - * @param $docker_compose_backup_path Path old docker-compose.yml is to be copied for backup - * - * @throws \Exception - */ - public static function site_copy_compose_file_up( $site, $docker_compose_path, $docker_compose_backup_path ) { - if ( ! default_launch( "cp $docker_compose_path $docker_compose_backup_path" ) ) { - throw new \Exception( "Unable to find docker-compose.yml in ${site['site_fs_path']} or couldn't create it's backup file. Ensure that EasyEngine has permission to create file there" ); - } - } - - /** - * Upgrades site container of a site - * - * @param $site Name of site - * @param $docker_compose_backup_path Path of old docker-compose.yml file - * @param $docker_compose_path Path of updated docker-compose.yml file - * @param $docker_compose_contents Contents of updated docker-compose.yml file - * - * @throws \Exception - */ - public static function site_containers_up( $site, $docker_compose_backup_path, $docker_compose_path, $docker_compose_contents ) { - file_put_contents( $docker_compose_path, $docker_compose_contents ); - $container_upgraded = default_launch( "cd ${site['site_fs_path']} && docker-compose up -d" ); - - if ( ! $container_upgraded ) { - throw new \Exception( "Unable to upgrade containers of site: ${site['site_url']}. Please check logs for more details." ); } } - /** - * Downgrades container of a site. - * - * @param $site Name of site - * @param $docker_compose_backup_path Path of old docker-compose.yml file - * @param $docker_compose_path Path of updated docker-compose.yml file - * - * @throws \Exception - */ - public static function site_containers_down( $site, $docker_compose_backup_path, $docker_compose_path ) { - rename( $docker_compose_backup_path, $docker_compose_path ); - $container_downgraded = default_launch( "cd ${site['site_fs_path']} && docker-compose up -d" ); - - if ( ! $container_downgraded ) { - throw new \Exception( "Unable to downgrade containers of ${site['site_url']} site. Please check logs for more details." ); - } - } } From 5415e81211114dc2b400599cb5c91f35798434d5 Mon Sep 17 00:00:00 2001 From: sagarnasit <sagarnasit@gmail.com> Date: Thu, 18 Oct 2018 16:08:54 +0530 Subject: [PATCH 0512/1044] Remove extra code --- php/EE/Migration/Containers.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index 755466d91..b3bc39460 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -305,7 +305,7 @@ public static function nginxproxy_container_up() { chdir( EE_ROOT_DIR . '/services' ); if( ! EE::exec( 'docker-compose up -d global-nginx-proxy ' ) ) { throw new \Exception( sprintf( 'Unable to restart %1$s container', EE_PROXY_TYPE ) ); - }; + } } @@ -336,7 +336,7 @@ public static function global_db_container_up() { if( ! EE::exec( 'docker-compose up -d global-db' ) ) { throw new \Exception( sprintf( 'Unable to restart %1$s container', GLOBAL_DB_CONTAINER ) ); - }; + } } public static function global_db_container_down() { @@ -344,7 +344,7 @@ public static function global_db_container_down() { if( ! EE::exec( 'docker-compose stop global-db && docker-compose rm -f global-db' ) ) { throw new \Exception( sprintf( 'Unable to restart %1$s container', GLOBAL_DB_CONTAINER ) ); - }; + } } public static function global_redis_container_up() { @@ -352,7 +352,7 @@ public static function global_redis_container_up() { if( ! EE::exec( 'docker-compose up -d global-redis' ) ) { throw new \Exception( sprintf( 'Unable to restart %1$s container', GLOBAL_REDIS_CONTAINER ) ); - }; + } } public static function global_redis_container_down() { @@ -389,7 +389,7 @@ public static function cron_container_up() { if( ! EE::exec( 'docker-compose up -d docker-compose' ) ) { throw new \Exception( sprintf( 'Unable to restart %1$s container', EE_CRON_SCHEDULER ) ); - }; + } } /** From 96fd3d9ba9eb91c91645da7dab460f06f80247de Mon Sep 17 00:00:00 2001 From: sagarnasit <sagarnasit@gmail.com> Date: Thu, 18 Oct 2018 17:54:45 +0530 Subject: [PATCH 0513/1044] Add custom container migration --- .../container/20181018_easyengine_test.php | 41 ++++ ...asyengine_insert_docker_images_version.php | 0 php/EE/Migration/Containers.php | 29 ++- .../Migration/CustomContainerMigrations.php | 208 ++++++++++++++++++ php/EE/Migration/Executor.php | 8 +- php/EE/Runner.php | 3 +- 6 files changed, 282 insertions(+), 7 deletions(-) create mode 100644 migrations/container/20181018_easyengine_test.php rename migrations/{ => db}/20181016052850_easyengine_insert_docker_images_version.php (100%) create mode 100644 php/EE/Migration/CustomContainerMigrations.php diff --git a/migrations/container/20181018_easyengine_test.php b/migrations/container/20181018_easyengine_test.php new file mode 100644 index 000000000..c1e40adb9 --- /dev/null +++ b/migrations/container/20181018_easyengine_test.php @@ -0,0 +1,41 @@ +<?php + +namespace EE\Migration; + +use EE; +use EE\Migration\Base; + +class Test extends Base { + + private static $pdo; + + public function __construct() { + + try { + self::$pdo = new \PDO( 'sqlite:' . DB ); + self::$pdo->setAttribute( \PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION ); + } catch ( \PDOException $exception ) { + EE::error( $exception->getMessage() ); + } + + } + + /** + * Execute create table query for site and sitemeta table. + * + * @throws EE\ExitException + */ + public function up() { + + EE::success('****************************Testing Container***************************'); + } + + /** + * Execute drop table query for site and sitemeta table. + * + * @throws EE\ExitException + */ + public function down() { + EE::success('****************************Testing fail Container***************************'); + } +} diff --git a/migrations/20181016052850_easyengine_insert_docker_images_version.php b/migrations/db/20181016052850_easyengine_insert_docker_images_version.php similarity index 100% rename from migrations/20181016052850_easyengine_insert_docker_images_version.php rename to migrations/db/20181016052850_easyengine_insert_docker_images_version.php diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index b3bc39460..d98b7263d 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -23,7 +23,6 @@ public static function start_container_migration() { self::$rsp = new RevertableStepProcessor(); self::migrate_all_docker_images(); - self::migrate_custom_container_migrations(); // @todo: add doc blocks. // @todo: update database after image migration. if ( ! self::$rsp->execute() ) { @@ -45,7 +44,7 @@ private static function migrate_all_docker_images() { foreach ( $img_versions as $img => $version ) { if ( $current_versions[ $img ] !== $version ) { $changed_images[] = $img; - self::pull_or_error( $img, $version ); +// self::pull_or_error( $img, $version ); } } @@ -55,9 +54,35 @@ private static function migrate_all_docker_images() { self::migrate_global_containers( $changed_images ); self::migrate_site_containers( $changed_images ); + self::save_upgraded_image_versions($current_versions, $img_versions, $changed_images); } + private static function save_upgraded_image_versions( $current_versions, $new_versions, $changed_images) { + + self::$rsp->add_step( + 'save-image-verions-in-database', + 'EE\Migration\Containers::create_database_entry', + 'EE\Migration\Containers::revert_database_entry', + [$new_versions, $changed_images], + [$current_versions, $changed_images] + + ); + + } + + public static function create_database_entry($new_versions, $changed_images) { + foreach($changed_images as $image) { + EE\Model\Option::update( [ [ 'key', $image ] ], [ 'value' => $new_versions[ $image ] ] ); + } + } + + public static function revert_database_entry($old_version, $changed_images) { + foreach($changed_images as $image) { + EE\Model\Option::update( [ [ 'key', $image ] ], [ 'value' => $old_version[ $image ] ] ); + } + } + /** * Helper method to ensure exception is thrown if image isn't pulled * diff --git a/php/EE/Migration/CustomContainerMigrations.php b/php/EE/Migration/CustomContainerMigrations.php new file mode 100644 index 000000000..108fffb52 --- /dev/null +++ b/php/EE/Migration/CustomContainerMigrations.php @@ -0,0 +1,208 @@ +<?php + +namespace EE\Migration; + +use EE; +use EE\Model\Migration; +use EE\Utils; +use Symfony\Component\Finder\Finder; + +class CustomContainerMigrations { + + /** + * Executes all pending migrations + */ + public static function execute_migrations() { + + Utils\delem_log( 'ee migration start' ); + EE::debug( 'Executing custom container migrations' ); + + $migrations = self::get_all_migrations(); + + if ( empty( $migrations ) ) { + EE::debug( 'No custom container migration' ); + return; + } + + sort( $migrations ); + + try { + self::execute_migration_stack( $migrations ); + } catch ( \Throwable $e ) { + Utils\delem_log( 'ee migration ended abruptly' ); + exit( 1 ); + } + + EE::debug( 'Successfully migrated EasyEngine' ); + } + + /** + * @return array of available migrations + */ + private static function get_all_migrations() { + $migrations = []; + $packages_path = scandir( EE_VENDOR_DIR . '/easyengine' ); + + // get migrations from packages. + if ( ! empty( $packages_path ) ) { + foreach ( $packages_path as $package ) { + if ( '.' === $package || '..' === $package || is_file( $package ) ) { + continue; + } + + $migration_path = EE_VENDOR_DIR . '/easyengine/' . $package . '/migrations/container'; + if ( is_dir( $migration_path ) ) { + $files = scandir( $migration_path ); + if ( \EE\Utils\inside_phar() ) { + $migrations[] = $files; + } else{ + $migrations[] = array_slice( $files,2); + } + } + } + } + + // get migrations from core. + if ( is_dir( EE_ROOT . '/migrations/container' ) ) { + $files = scandir( EE_ROOT . '/migrations/container' ); + if ( \EE\Utils\inside_phar() ) { + $migrations[] = $files; + } else{ + $migrations[] = array_slice( $files,2); + } + } + + if ( ! empty( $migrations ) ) { + $migrations = array_merge( ...$migrations ); + } + + $migrations = self::get_migrations_to_execute( $migrations ); + + return array_filter( $migrations, function ( $file_name ) { + if ( preg_match( '/^\d*[_]([a-zA-Z-]*)[_].*(\.php)$/', $file_name ) ) { + return true; + } + return false; + } ); + } + + /** + * Executes all migrations passed to it recursively. + * Also undo'es all migration if there was error executing any migration + */ + private static function execute_migration_stack( $migrations ) { + if ( empty( $migrations ) ) { + return; + } + + $migration_path = self::get_migration_path( $migrations[0] ); + $migration_class_name = self::get_migration_class_name( $migrations[0] ); + + if ( ! file_exists( $migration_path ) ) { + EE::error( "Unable to find migration file at $migration_path", false ); + throw new Exception(); + } + + require( $migration_path ); + + try { + $migration = new $migration_class_name; + if ( ! $migration instanceof Base ) { + throw new \Exception( "$migration_class_name is not a instance of base migration class" ); + } + } catch ( \Throwable $e ) { + EE::error( $e->getMessage(), false ); + throw $e; + } + + try { + EE::debug( "Migrating: $migrations[0]" ); + $migration->up(); + + Migration::create( [ + 'migration' => $migrations[0], + 'timestamp' => date( 'Y-m-d H:i:s' ), + ] ); + + $migration->status = 'complete'; + EE::debug( "Migrated: $migrations[0]" ); + $remaining_migrations = array_splice( $migrations, 1, count( $migrations ) ); + self::execute_migration_stack( $remaining_migrations ); + } catch ( \Throwable $e ) { + if ( 'complete' !== $migration->status ) { + EE::error( "Errors were encountered while processing: $migrations[0]\n" . $e->getMessage(), false ); + } + EE::debug( "Reverting: $migrations[0]" ); + // remove db entry in 'migration' table when reverting migrations. + $migrated = Migration::where( 'migration', $migrations[0] ); + if ( ! empty( $migrated ) ) { + $migration->down(); + $migrated[0]->delete(); + } + + EE::debug( "Reverted: $migrations[0]" ); + throw $e; + } + } + + /** + * Get migrations need to be executed. + * + * @param $path path to the migration directory. + * + * @return array + */ + private static function get_migrations_to_execute( $migrations ) { + return array_values( + array_diff( + $migrations, + self::get_migrations_from_db() + ) + ); + } + + /** + * Get already migrated migrations from database. + * + * @return array + */ + private static function get_migrations_from_db() { + return array_column( Migration::all(), 'migration' ); + } + + /** + * Get path of the migration file. + * + * @param $migration_name name of a migration file. + * + * @return string path of a migration file. + */ + private static function get_migration_path( $migration_name ) { + preg_match( '/^\d*[_]([a-zA-Z-]*)[_]/', $migration_name, $matches ); + + if ( empty( $matches[1] ) ) { + return ''; + } + if ( 'easyengine' === $matches[1] ) { + return EE_ROOT . "/migrations/container/$migration_name"; + } else { + return EE_ROOT . "/vendor/easyengine/$matches[1]/migrations/container/$migration_name"; + } + + } + + private static function get_migration_class_name( $migration_name ) { + // Remove date and package name from it + $class_name = preg_replace( '/(^\d*)[_]([a-zA-Z-]*[_])/', '', rtrim( $migration_name, '.php' ) ); + // Convet snake_case to CamelCase + $class_name = self::camelize( $class_name ); + // Replace dot with underscore + $class_name = str_replace( '.', '_', $class_name ); + + return "\EE\Migration\\$class_name"; + } + + private static function camelize( $input, $separator = '_' ) { + return str_replace( $separator, '', ucwords( $input, $separator ) ); + } +} diff --git a/php/EE/Migration/Executor.php b/php/EE/Migration/Executor.php index bcb2073b8..a859e6c71 100644 --- a/php/EE/Migration/Executor.php +++ b/php/EE/Migration/Executor.php @@ -50,7 +50,7 @@ private static function get_all_migrations() { continue; } - $migration_path = EE_VENDOR_DIR . '/easyengine/' . $package . '/migrations'; + $migration_path = EE_VENDOR_DIR . '/easyengine/' . $package . '/migrations/db'; if ( is_dir( $migration_path ) ) { $files = scandir( $migration_path ); if ( \EE\Utils\inside_phar() ) { @@ -64,7 +64,7 @@ private static function get_all_migrations() { // get migrations from core. if ( is_dir( EE_ROOT . '/migrations' ) ) { - $files = scandir( EE_ROOT . '/migrations' ); + $files = scandir( EE_ROOT . '/migrations/db' ); if ( \EE\Utils\inside_phar() ) { $migrations[] = $files; } else{ @@ -184,9 +184,9 @@ private static function get_migration_path( $migration_name ) { return ''; } if ( 'easyengine' === $matches[1] ) { - return EE_ROOT . "/migrations/$migration_name"; + return EE_ROOT . "/migrations/db/$migration_name"; } else { - return EE_ROOT . "/vendor/easyengine/$matches[1]/migrations/$migration_name"; + return EE_ROOT . "/vendor/easyengine/$matches[1]/migrations/db/$migration_name"; } } diff --git a/php/EE/Runner.php b/php/EE/Runner.php index f8dda3942..74410cf85 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -73,7 +73,8 @@ private function migrate() { $version = Option::where( 'key', 'version' ); if ( ! empty( $version ) ) { - $rsp->add_step( 'ee-container-migrations', 'EE\Migration\Containers::start_container_migration' ); + $rsp->add_step( 'ee-docker-image-migrations', 'EE\Migration\Containers::start_container_migration' ); + $rsp->add_step( 'ee-custom-container-migrations', 'EE\Migration\CustomContainerMigrations::execute_migrations' ); } return $rsp->execute(); } From 67731732651bddf814b07b0ceafb169be0400b02 Mon Sep 17 00:00:00 2001 From: sagarnasit <sagarnasit@gmail.com> Date: Thu, 18 Oct 2018 23:29:32 +0530 Subject: [PATCH 0514/1044] Use separate classes for cntainer migrations --- php/EE/Migration/Containers.php | 239 ++++-------------- .../Migration/CustomContainerMigrations.php | 1 - php/EE/Migration/GlobalContainers.php | 219 ++++++++++++++++ 3 files changed, 264 insertions(+), 195 deletions(-) create mode 100644 php/EE/Migration/GlobalContainers.php diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index d98b7263d..0366a2153 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -24,7 +24,6 @@ public static function start_container_migration() { self::$rsp = new RevertableStepProcessor(); self::migrate_all_docker_images(); // @todo: add doc blocks. - // @todo: update database after image migration. if ( ! self::$rsp->execute() ) { throw new \Exception( 'Unable to migrate sites to newer version' ); } @@ -58,6 +57,13 @@ private static function migrate_all_docker_images() { } + /** + * Save updated image version in database. + * + * @param $current_versions array of current image versions. + * @param $new_versions array of new image version. + * @param $changed_images array of updated images. + */ private static function save_upgraded_image_versions( $current_versions, $new_versions, $changed_images) { self::$rsp->add_step( @@ -71,12 +77,28 @@ private static function save_upgraded_image_versions( $current_versions, $new_ve } + /** + * Update database entry of images + * + * @param $new_versions array of new image versions. + * @param $changed_images array of updated images. + * + * @throws \Exception + */ public static function create_database_entry($new_versions, $changed_images) { foreach($changed_images as $image) { EE\Model\Option::update( [ [ 'key', $image ] ], [ 'value' => $new_versions[ $image ] ] ); } } + /** + * Revert database entry in case of exception. + * + * @param $old_version array of old image versions. + * @param $changed_images array of updated images. + * + * @throws \Exception + */ public static function revert_database_entry($old_version, $changed_images) { foreach($changed_images as $image) { EE\Model\Option::update( [ [ 'key', $image ] ], [ 'value' => $old_version[ $image ] ] ); @@ -117,25 +139,27 @@ private static function get_current_docker_images_versions() { } /** - * Migrates global containers. These are container which are not created per site (i.e. ee-cron-scheduler) + * Migrates global containers. These are container which are not created per site (i.e. ee-cron-scheduler). + * + * @param $changed_images array of updated images. */ private static function migrate_global_containers( $changed_images ) { - if ( ! self::is_global_container_image_changed( $changed_images ) ) { + if ( ! GlobalContainers::is_global_container_image_changed( $changed_images ) ) { return; } self::$rsp->add_step( 'backup-global-docker-compose-file', - 'EE\Migration\Containers::backup_global_compose_file', - 'EE\Migration\Containers::revert_global_containers', + 'EE\Migration\GlobalContainers::backup_global_compose_file', + 'EE\Migration\GlobalContainers::revert_global_containers', null, null ); self::$rsp->add_step( 'stop-global-containers', - 'EE\Migration\Containers::down_global_containers', + 'EE\Migration\GlobalContainers::down_global_containers', null, [ $changed_images ], null @@ -154,8 +178,8 @@ private static function migrate_global_containers( $changed_images ) { if ( in_array( 'easyengine/nginx-proxy', $changed_images, true ) && 0 === $existing_nginx_proxy_image->return_code ) { self::$rsp->add_step( 'upgrade-nginxproxy-container', - 'EE\Migration\Containers::nginxproxy_container_up', - 'EE\Migration\Containers::nginxproxy_container_down', + 'EE\Migration\GlobalContainers::nginxproxy_container_up', + 'EE\Migration\GlobalContainers::nginxproxy_container_down', null, null ); @@ -166,8 +190,8 @@ private static function migrate_global_containers( $changed_images ) { if ( in_array( 'easyengine/mariadb', $changed_images, true ) && 0 === $existing_db_image->return_code ) { self::$rsp->add_step( 'upgrade-global-db-container', - 'EE\Migration\Containers::global_db_container_up', - 'EE\Migration\Containers::global_db_container_down', + 'EE\Migration\GlobalContainers::global_db_container_up', + 'EE\Migration\GlobalContainers::global_db_container_down', null, null ); @@ -178,8 +202,8 @@ private static function migrate_global_containers( $changed_images ) { if ( in_array( 'easyengine/cron', $changed_images, true ) && 0 === $existing_cron_image->return_code ) { self::$rsp->add_step( 'upgrade-cron-container', - 'EE\Migration\Containers::cron_container_up', - 'EE\Migration\Containers::cron_container_down', + 'EE\Migration\GlobalContainers::cron_container_up', + 'EE\Migration\GlobalContainers::cron_container_down', null, null ); @@ -190,14 +214,21 @@ private static function migrate_global_containers( $changed_images ) { if ( in_array( 'easyengine/cron', $changed_images, true ) && 0 === $existing_redis_image->return_code ) { self::$rsp->add_step( 'upgrade-global-redis-container', - 'EE\Migration\Containers::global_redis_container_up', - 'EE\Migration\Containers::global_redis_container_down', + 'EE\Migration\GlobalContainers::global_redis_container_up', + 'EE\Migration\GlobalContainers::global_redis_container_down', null, null ); } } + /** + * Migrate site specific container. + * + * @param $changed_images array of updated images + * + * @throws \Exception + */ public static function migrate_site_containers( $changed_images ){ $db = new \EE_DB(); @@ -252,184 +283,4 @@ public static function migrate_site_containers( $changed_images ){ } } - public static function down_global_containers( $changed_images ) { - - chdir( EE_ROOT_DIR . '/services' ); - - if ( in_array( 'easyengine/nginx-proxy', $changed_images, true ) ) { - if ( ! EE::exec( 'docker-compose stop global-nginx-proxy && docker-compose rm -f global-nginx-proxy' ) ) { - throw new \Exception( 'Unable to stop ' . EE_PROXY_TYPE . ' container' ); - } - } - - if ( in_array( 'easyengine/mariadb', $changed_images, true ) ) { - if ( ! EE::exec( 'docker-compose stop global-db && docker-compose rm -f global-db' ) ) { - throw new \Exception( 'Unable to stop ' . GLOBAL_DB_CONTAINER . 'container' ); - } - } - - if ( in_array( 'easyengine/redis', $changed_images, true ) ) { - if ( ! EE::exec( 'docker-compose stop global-redis && docker-compose rm -f global-redis' ) ) { - throw new \Exception( 'Unable to stop ' . GLOBAL_REDIS_CONTAINER . 'container' ); - } - } - - if ( in_array( 'easyengine/cron', $changed_images, true ) ) { - if ( ! EE::exec( 'docker-compose stop cron-scheduler && docker-compose rm -f cron-scheduler' ) ) { - throw new \Exception( 'Unable to stop ' . GLOBAL_REDIS_CONTAINER . 'container' ); - } - } - - } - - /** - * Take backup of current global docker-compose.yml file. - * - * @throws \Exception - */ - public static function backup_global_compose_file() { - $global_compose_file_path = EE_ROOT_DIR . '/services/docker-compose.yml'; - $global_compose_backup_file_path = EE_ROOT_DIR . '/services/docker-compose.yml.backup'; - - if ( ! EE::exec( "cp $global_compose_file_path $global_compose_backup_file_path" ) ) { - throw new \Exception( "Unable to find docker-compose.yml or couldn't create it's backup file. Ensure that EasyEngine has permission to create file there" ); - } - } - - /** - * Revert to backed up docker-compose.yml file. - * - * @throws \Exception - */ - public static function revert_global_containers() { - $global_compose_file_path = EE_ROOT_DIR . '/services/docker-compose.yml'; - $global_compose_backup_file_path = EE_ROOT_DIR . '/services/docker-compose.yml.backup'; - - rename( $global_compose_backup_file_path, $global_compose_file_path ); - chdir( EE_ROOT_DIR . '/services' ); - $container_downgraded = EE::exec( 'docker-compose up -d' ); - - if ( ! $container_downgraded ) { - throw new \Exception( 'Unable to downgrade global containers. Please check logs for more details.' ); - } - } - - /** - * Upgrades nginx-proxy container - * - * @throws \Exception - */ - public static function nginxproxy_container_up() { - $default_conf_path = EE_ROOT_DIR . '/services/nginx-proxy/conf.d/default.conf'; - $fs = new \Symfony\Component\Filesystem\Filesystem(); - - if ( $fs->exists( $default_conf_path ) ) { - $fs->remove( $default_conf_path ); - } - - chdir( EE_ROOT_DIR . '/services' ); - if( ! EE::exec( 'docker-compose up -d global-nginx-proxy ' ) ) { - throw new \Exception( sprintf( 'Unable to restart %1$s container', EE_PROXY_TYPE ) ); - } - - } - - /** - * Downgrades nginx-proxy container - * - * @param $existing_nginx_proxy_image Old nginx-proxy image name - * - * @throws \Exception - */ - public static function nginxproxy_container_down( $existing_nginx_proxy_image ) { - chdir( EE_ROOT_DIR . '/services' ); - - if ( ! EE::exec('docker-compose stop global-nginx-proxy && docker-compose rm -f global-nginx-proxy') ) { - throw new \Exception( sprintf( 'Unable to stop %1$s container', EE_PROXY_TYPE ) ); - } - - $default_conf_path = EE_ROOT_DIR . '/services/nginx-proxy/conf.d/default.conf'; - $fs = new \Symfony\Component\Filesystem\Filesystem(); - - if ( $fs->exists( $default_conf_path ) ) { - $fs->remove( $default_conf_path ); - } - } - - public static function global_db_container_up() { - chdir( EE_ROOT_DIR . '/services' ); - - if( ! EE::exec( 'docker-compose up -d global-db' ) ) { - throw new \Exception( sprintf( 'Unable to restart %1$s container', GLOBAL_DB_CONTAINER ) ); - } - } - - public static function global_db_container_down() { - chdir( EE_ROOT_DIR . '/services' ); - - if( ! EE::exec( 'docker-compose stop global-db && docker-compose rm -f global-db' ) ) { - throw new \Exception( sprintf( 'Unable to restart %1$s container', GLOBAL_DB_CONTAINER ) ); - } - } - - public static function global_redis_container_up() { - chdir( EE_ROOT_DIR . '/services' ); - - if( ! EE::exec( 'docker-compose up -d global-redis' ) ) { - throw new \Exception( sprintf( 'Unable to restart %1$s container', GLOBAL_REDIS_CONTAINER ) ); - } - } - - public static function global_redis_container_down() { - chdir( EE_ROOT_DIR . '/services' ); - - if( ! EE::exec( 'docker-compose stop global-redis && docker-compose rm -f global-redis' ) ) { - throw new \Exception( sprintf( 'Unable to restart %1$s container', GLOBAL_REDIS_CONTAINER ) ); - } - } - - public static function is_global_container_image_changed( $changed_image ) { - $global_images = [ - 'easyengine/mariadb', - 'easyengine/mariadb', - 'easyengine/redis', - 'easyengine/cron', - ]; - - $commom_images = array_intersect( $changed_image, $global_images ); - - if ( ! empty( $commom_images ) ) { - return true; - } - return false; - } - - /** - * Upgrades ee-cron-scheduler container - * - * @throws \Exception - */ - public static function cron_container_up() { - chdir( EE_ROOT_DIR . '/services' ); - - if( ! EE::exec( 'docker-compose up -d docker-compose' ) ) { - throw new \Exception( sprintf( 'Unable to restart %1$s container', EE_CRON_SCHEDULER ) ); - } - } - - /** - * Downgrades ee-cron-scheduler container - * - * @param $existing_cron_image Old nginx-proxy image name - * - * @throws \Exception - */ - public static function cron_container_down( $existing_cron_image ) { - chdir( EE_ROOT_DIR . '/services' ); - - if( ! EE::exec( 'docker-compose stop cron-scheduler && docker-compose rm -f cron-scheduler' ) ) { - throw new \Exception( sprintf( 'Unable to restart %1$s container', EE_CRON_SCHEDULER ) ); - } - } - } diff --git a/php/EE/Migration/CustomContainerMigrations.php b/php/EE/Migration/CustomContainerMigrations.php index 108fffb52..33f7c839c 100644 --- a/php/EE/Migration/CustomContainerMigrations.php +++ b/php/EE/Migration/CustomContainerMigrations.php @@ -5,7 +5,6 @@ use EE; use EE\Model\Migration; use EE\Utils; -use Symfony\Component\Finder\Finder; class CustomContainerMigrations { diff --git a/php/EE/Migration/GlobalContainers.php b/php/EE/Migration/GlobalContainers.php new file mode 100644 index 000000000..069d1b150 --- /dev/null +++ b/php/EE/Migration/GlobalContainers.php @@ -0,0 +1,219 @@ +<?php + +namespace EE\Migration; + +use EE; + +/** + * Upgrade existing global containers to new docker-image + */ +class GlobalContainers { + + /** + * @param $updated_images array of updated docker-images + * + * @return bool + */ + public static function is_global_container_image_changed( $updated_images ) { + $global_images = [ + 'easyengine/mariadb', + 'easyengine/mariadb', + 'easyengine/redis', + 'easyengine/cron', + ]; + + $commom_images = array_intersect( $updated_images, $global_images ); + + if ( ! empty( $commom_images ) ) { + return true; + } + return false; + } + + /** + * Take backup of current global docker-compose.yml file. + * + * @throws \Exception + */ + public static function backup_global_compose_file() { + $global_compose_file_path = EE_ROOT_DIR . '/services/docker-compose.yml'; + $global_compose_backup_file_path = EE_ROOT_DIR . '/services/docker-compose.yml.backup'; + + if ( ! EE::exec( "cp $global_compose_file_path $global_compose_backup_file_path" ) ) { + throw new \Exception( "Unable to find docker-compose.yml or couldn't create it's backup file. Ensure that EasyEngine has permission to create file there" ); + } + } + + /** + * Revert to backed up docker-compose.yml file. + * + * @throws \Exception + */ + public static function revert_global_containers() { + $global_compose_file_path = EE_ROOT_DIR . '/services/docker-compose.yml'; + $global_compose_backup_file_path = EE_ROOT_DIR . '/services/docker-compose.yml.backup'; + + rename( $global_compose_backup_file_path, $global_compose_file_path ); + chdir( EE_ROOT_DIR . '/services' ); + $container_downgraded = EE::exec( 'docker-compose up -d' ); + + if ( ! $container_downgraded ) { + throw new \Exception( 'Unable to downgrade global containers. Please check logs for more details.' ); + } + } + + /** + * @param $updated_image array of updated images. + * + * @throws \Exception + */ + public static function down_global_containers( $updated_image ) { + + chdir( EE_ROOT_DIR . '/services' ); + + if ( in_array( 'easyengine/nginx-proxy', $updated_image, true ) ) { + if ( ! EE::exec( 'docker-compose stop global-nginx-proxy && docker-compose rm -f global-nginx-proxy' ) ) { + throw new \Exception( 'Unable to stop ' . EE_PROXY_TYPE . ' container' ); + } + } + + if ( in_array( 'easyengine/mariadb', $updated_image, true ) ) { + if ( ! EE::exec( 'docker-compose stop global-db && docker-compose rm -f global-db' ) ) { + throw new \Exception( 'Unable to stop ' . GLOBAL_DB_CONTAINER . 'container' ); + } + } + + if ( in_array( 'easyengine/redis', $updated_image, true ) ) { + if ( ! EE::exec( 'docker-compose stop global-redis && docker-compose rm -f global-redis' ) ) { + throw new \Exception( 'Unable to stop ' . GLOBAL_REDIS_CONTAINER . 'container' ); + } + } + + if ( in_array( 'easyengine/cron', $updated_image, true ) ) { + if ( ! EE::exec( 'docker-compose stop cron-scheduler && docker-compose rm -f cron-scheduler' ) ) { + throw new \Exception( 'Unable to stop ' . GLOBAL_REDIS_CONTAINER . 'container' ); + } + } + } + + /** + * Upgrades nginx-proxy container + * + * @throws \Exception + */ + public static function nginxproxy_container_up() { + $default_conf_path = EE_ROOT_DIR . '/services/nginx-proxy/conf.d/default.conf'; + $fs = new \Symfony\Component\Filesystem\Filesystem(); + + if ( $fs->exists( $default_conf_path ) ) { + $fs->remove( $default_conf_path ); + } + + chdir( EE_ROOT_DIR . '/services' ); + if( ! EE::exec( 'docker-compose up -d global-nginx-proxy ' ) ) { + throw new \Exception( sprintf( 'Unable to restart %1$s container', EE_PROXY_TYPE ) ); + } + } + + /** + * Downgrades nginx-proxy container + * + * @param $existing_nginx_proxy_image Old nginx-proxy image name + * + * @throws \Exception + */ + public static function nginxproxy_container_down( $existing_nginx_proxy_image ) { + chdir( EE_ROOT_DIR . '/services' ); + + if ( ! EE::exec('docker-compose stop global-nginx-proxy && docker-compose rm -f global-nginx-proxy') ) { + throw new \Exception( sprintf( 'Unable to stop %1$s container', EE_PROXY_TYPE ) ); + } + + $default_conf_path = EE_ROOT_DIR . '/services/nginx-proxy/conf.d/default.conf'; + $fs = new \Symfony\Component\Filesystem\Filesystem(); + + if ( $fs->exists( $default_conf_path ) ) { + $fs->remove( $default_conf_path ); + } + } + + /** + * Upgrade global db container. + * + * @throws \Exception + */ + public static function global_db_container_up() { + chdir( EE_ROOT_DIR . '/services' ); + + if( ! EE::exec( 'docker-compose up -d global-db' ) ) { + throw new \Exception( sprintf( 'Unable to restart %1$s container', GLOBAL_DB_CONTAINER ) ); + } + } + + /** + * Remove upgraded global db container. + * + * @throws \Exception + */ + public static function global_db_container_down() { + chdir( EE_ROOT_DIR . '/services' ); + + if( ! EE::exec( 'docker-compose stop global-db && docker-compose rm -f global-db' ) ) { + throw new \Exception( sprintf( 'Unable to restart %1$s container', GLOBAL_DB_CONTAINER ) ); + } + } + + /** + * Upgrades ee-cron-scheduler container + * + * @throws \Exception + */ + public static function cron_container_up() { + chdir( EE_ROOT_DIR . '/services' ); + + if( ! EE::exec( 'docker-compose up -d docker-compose' ) ) { + throw new \Exception( sprintf( 'Unable to restart %1$s container', EE_CRON_SCHEDULER ) ); + } + } + + /** + * Downgrades ee-cron-scheduler container + * + * @param $existing_cron_image Old nginx-proxy image name + * + * @throws \Exception + */ + public static function cron_container_down( $existing_cron_image ) { + chdir( EE_ROOT_DIR . '/services' ); + + if( ! EE::exec( 'docker-compose stop cron-scheduler && docker-compose rm -f cron-scheduler' ) ) { + throw new \Exception( sprintf( 'Unable to restart %1$s container', EE_CRON_SCHEDULER ) ); + } + } + + /** + * Upgrade global redis container. + * + * @throws \Exception + */ + public static function global_redis_container_up() { + chdir( EE_ROOT_DIR . '/services' ); + + if( ! EE::exec( 'docker-compose up -d global-redis' ) ) { + throw new \Exception( sprintf( 'Unable to restart %1$s container', GLOBAL_REDIS_CONTAINER ) ); + } + } + + /** + * Remove upgraded global redis container. + * + * @throws \Exception + */ + public static function global_redis_container_down() { + chdir( EE_ROOT_DIR . '/services' ); + + if( ! EE::exec( 'docker-compose stop global-redis && docker-compose rm -f global-redis' ) ) { + throw new \Exception( sprintf( 'Unable to restart %1$s container', GLOBAL_REDIS_CONTAINER ) ); + } + } +} From 0196cf252af39e4b211b689c9f98fc0e87808176 Mon Sep 17 00:00:00 2001 From: sagarnasit <sagarnasit@gmail.com> Date: Fri, 19 Oct 2018 10:53:01 +0530 Subject: [PATCH 0515/1044] Use site type wp instead of wordpress --- php/EE/Migration/SiteContainers.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/php/EE/Migration/SiteContainers.php b/php/EE/Migration/SiteContainers.php index 58f61f191..bb14c3d88 100644 --- a/php/EE/Migration/SiteContainers.php +++ b/php/EE/Migration/SiteContainers.php @@ -79,6 +79,7 @@ public static function get_site_filters($site) { switch( $site['site_type']) { case 'html': $filters[] = $site['site_type']; + break; case 'php': @@ -89,19 +90,14 @@ public static function get_site_filters($site) { break; - case 'wordpress': + case 'wp': $filters[] = $site['app_sub_type']; $filters[] = $site['cache_host']; $filters[] = $site['db_host']; break; } - - $filters['nohttps'] = false; - - if( 1 === $site['site_ssl']) { - $filters['nohttps'] = true; - } + $filters['nohttps'] = $site['site_ssl'] ? false:true; return $filters; } From cee3a5aa391e20e1ea94794539c70d501f0ea752 Mon Sep 17 00:00:00 2001 From: sagarnasit <sagarnasit@gmail.com> Date: Fri, 19 Oct 2018 11:21:26 +0530 Subject: [PATCH 0516/1044] Add type column in migrations table --- migrations/.gitkeep | 0 ...asyengine_insert_docker_images_version.php | 64 +++++++++++++++++++ php/EE/Migration/Executor.php | 21 +++--- php/class-ee-db.php | 1 + 4 files changed, 76 insertions(+), 10 deletions(-) delete mode 100644 migrations/.gitkeep create mode 100644 migrations/db/20181016052850_easyengine_insert_docker_images_version.php diff --git a/migrations/.gitkeep b/migrations/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/migrations/db/20181016052850_easyengine_insert_docker_images_version.php b/migrations/db/20181016052850_easyengine_insert_docker_images_version.php new file mode 100644 index 000000000..bcd75f2b3 --- /dev/null +++ b/migrations/db/20181016052850_easyengine_insert_docker_images_version.php @@ -0,0 +1,64 @@ +<?php + +namespace EE\Migration; + +use EE; +use EE\Migration\Base; + +class InsertDockerImagesVersion extends Base { + + private static $pdo; + + public function __construct() { + + try { + self::$pdo = new \PDO( 'sqlite:' . DB ); + self::$pdo->setAttribute( \PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION ); + } catch ( \PDOException $exception ) { + EE::error( $exception->getMessage() ); + } + + } + + /** + * Execute create table query for site and sitemeta table. + * + * @throws EE\ExitException + */ + public function up() { + + EE::log( 'Checking/Pulling required images' ); + $images = EE\Utils\get_image_versions(); + + $query = ''; + foreach ( $images as $image => $tag ) { + EE::debug( "Checking/Pulling docker image $image:$tag" ); + if ( ! \EE::exec( "docker pull ${image}:${tag}" ) ) { + throw new \Exception( "Unable to pull ${image}:${tag}. Please check logs for more details." ); + } + $query .= "INSERT INTO options VALUES( '${image}', '${tag}' );"; + } + + try { + self::$pdo->exec( $query ); + } catch ( PDOException $exception ) { + EE::error( 'Encountered Error while inserting in "options" table: ' . $exception->getMessage(), false ); + } + } + + /** + * Execute drop table query for site and sitemeta table. + * + * @throws EE\ExitException + */ + public function down() { + + $query = "DELETE FROM options WHERE key LIKE 'easyengine/%';"; + + try { + self::$pdo->exec( $query ); + } catch ( PDOException $exception ) { + EE::error( 'Encountered Error while deleting from "options" table: ' . $exception->getMessage(), false ); + } + } +} diff --git a/php/EE/Migration/Executor.php b/php/EE/Migration/Executor.php index bcb2073b8..249e00df9 100644 --- a/php/EE/Migration/Executor.php +++ b/php/EE/Migration/Executor.php @@ -40,7 +40,7 @@ public static function execute_migrations() { * @return array of available migrations */ private static function get_all_migrations() { - $migrations = []; + $migrations = []; $packages_path = scandir( EE_VENDOR_DIR . '/easyengine' ); // get migrations from packages. @@ -50,13 +50,13 @@ private static function get_all_migrations() { continue; } - $migration_path = EE_VENDOR_DIR . '/easyengine/' . $package . '/migrations'; + $migration_path = EE_VENDOR_DIR . '/easyengine/' . $package . '/migrations/db'; if ( is_dir( $migration_path ) ) { $files = scandir( $migration_path ); if ( \EE\Utils\inside_phar() ) { $migrations[] = $files; - } else{ - $migrations[] = array_slice( $files,2); + } else { + $migrations[] = array_slice( $files, 2 ); } } } @@ -64,11 +64,11 @@ private static function get_all_migrations() { // get migrations from core. if ( is_dir( EE_ROOT . '/migrations' ) ) { - $files = scandir( EE_ROOT . '/migrations' ); + $files = scandir( EE_ROOT . '/migrations/db' ); if ( \EE\Utils\inside_phar() ) { $migrations[] = $files; - } else{ - $migrations[] = array_slice( $files,2); + } else { + $migrations[] = array_slice( $files, 2 ); } } @@ -121,6 +121,7 @@ private static function execute_migration_stack( $migrations ) { Migration::create( [ 'migration' => $migrations[0], + 'type' => 'db', 'timestamp' => date( 'Y-m-d H:i:s' ), ] ); @@ -167,7 +168,7 @@ private static function get_migrations_to_execute( $migrations ) { * @return array */ private static function get_migrations_from_db() { - return array_column( Migration::all(), 'migration' ); + return array_column( Migration::where( 'type', 'db' ), 'migration' ); } /** @@ -184,9 +185,9 @@ private static function get_migration_path( $migration_name ) { return ''; } if ( 'easyengine' === $matches[1] ) { - return EE_ROOT . "/migrations/$migration_name"; + return EE_ROOT . "/migrations/db/$migration_name"; } else { - return EE_ROOT . "/vendor/easyengine/$matches[1]/migrations/$migration_name"; + return EE_ROOT . "/vendor/easyengine/$matches[1]/migrations/db/$migration_name"; } } diff --git a/php/class-ee-db.php b/php/class-ee-db.php index 8b8939600..14d08942b 100644 --- a/php/class-ee-db.php +++ b/php/class-ee-db.php @@ -60,6 +60,7 @@ private static function create_required_tables() { $query = 'CREATE TABLE migrations ( id INTEGER, migration VARCHAR, + type VARCHAR, timestamp DATETIME, PRIMARY KEY (id) );'; From f0b28322de3beff028192034121b0ecc9b55a6db Mon Sep 17 00:00:00 2001 From: sagarnasit <sagarnasit@gmail.com> Date: Fri, 19 Oct 2018 12:23:07 +0530 Subject: [PATCH 0517/1044] Add type column changes for container migrations --- php/EE/Migration/CustomContainerMigrations.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/php/EE/Migration/CustomContainerMigrations.php b/php/EE/Migration/CustomContainerMigrations.php index 33f7c839c..9df9258cb 100644 --- a/php/EE/Migration/CustomContainerMigrations.php +++ b/php/EE/Migration/CustomContainerMigrations.php @@ -39,7 +39,7 @@ public static function execute_migrations() { * @return array of available migrations */ private static function get_all_migrations() { - $migrations = []; + $migrations = []; $packages_path = scandir( EE_VENDOR_DIR . '/easyengine' ); // get migrations from packages. @@ -54,8 +54,8 @@ private static function get_all_migrations() { $files = scandir( $migration_path ); if ( \EE\Utils\inside_phar() ) { $migrations[] = $files; - } else{ - $migrations[] = array_slice( $files,2); + } else { + $migrations[] = array_slice( $files, 2 ); } } } @@ -66,8 +66,8 @@ private static function get_all_migrations() { $files = scandir( EE_ROOT . '/migrations/container' ); if ( \EE\Utils\inside_phar() ) { $migrations[] = $files; - } else{ - $migrations[] = array_slice( $files,2); + } else { + $migrations[] = array_slice( $files, 2 ); } } @@ -120,6 +120,7 @@ private static function execute_migration_stack( $migrations ) { Migration::create( [ 'migration' => $migrations[0], + 'type' => 'container', 'timestamp' => date( 'Y-m-d H:i:s' ), ] ); @@ -166,7 +167,7 @@ private static function get_migrations_to_execute( $migrations ) { * @return array */ private static function get_migrations_from_db() { - return array_column( Migration::all(), 'migration' ); + return array_column( Migration::where( 'type', 'container' ), 'migration' ); } /** From e57a5b40059cae85d0b3114ce6455dd117376249 Mon Sep 17 00:00:00 2001 From: sagarnasit <sagarnasit@gmail.com> Date: Fri, 19 Oct 2018 15:56:06 +0530 Subject: [PATCH 0518/1044] Add dock-blocks in container migration files. --- .../container/20181018_easyengine_test.php | 41 ------- php/EE/Migration/Containers.php | 107 +++++++++--------- .../Migration/CustomContainerMigrations.php | 30 ++++- php/EE/Migration/GlobalContainers.php | 56 ++++----- php/EE/Migration/SiteContainers.php | 98 ++++++++++++---- 5 files changed, 188 insertions(+), 144 deletions(-) delete mode 100644 migrations/container/20181018_easyengine_test.php diff --git a/migrations/container/20181018_easyengine_test.php b/migrations/container/20181018_easyengine_test.php deleted file mode 100644 index c1e40adb9..000000000 --- a/migrations/container/20181018_easyengine_test.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php - -namespace EE\Migration; - -use EE; -use EE\Migration\Base; - -class Test extends Base { - - private static $pdo; - - public function __construct() { - - try { - self::$pdo = new \PDO( 'sqlite:' . DB ); - self::$pdo->setAttribute( \PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION ); - } catch ( \PDOException $exception ) { - EE::error( $exception->getMessage() ); - } - - } - - /** - * Execute create table query for site and sitemeta table. - * - * @throws EE\ExitException - */ - public function up() { - - EE::success('****************************Testing Container***************************'); - } - - /** - * Execute drop table query for site and sitemeta table. - * - * @throws EE\ExitException - */ - public function down() { - EE::success('****************************Testing fail Container***************************'); - } -} diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index 0366a2153..2553871fb 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -6,7 +6,7 @@ use EE; /** - * Migrates existing containers to new image + * Upgrade existing containers to new docker-image */ class Containers { @@ -22,38 +22,38 @@ public static function start_container_migration() { EE\Utils\delem_log( 'Starting container migration' ); self::$rsp = new RevertableStepProcessor(); - self::migrate_all_docker_images(); - // @todo: add doc blocks. - if ( ! self::$rsp->execute() ) { - throw new \Exception( 'Unable to migrate sites to newer version' ); - } - - EE\Utils\delem_log( 'Container migration completed' ); - } - - /** - * Migrate all docker images with new version. - */ - private static function migrate_all_docker_images() { $img_versions = EE\Utils\get_image_versions(); $current_versions = self::get_current_docker_images_versions(); + $updated_images = []; - $changed_images = []; foreach ( $img_versions as $img => $version ) { if ( $current_versions[ $img ] !== $version ) { - $changed_images[] = $img; -// self::pull_or_error( $img, $version ); + $updated_images[] = $img; + self::pull_or_error( $img, $version ); } } - if( empty( $changed_images) ) { + if ( empty( $updated_images ) ) { return; } - self::migrate_global_containers( $changed_images ); - self::migrate_site_containers( $changed_images ); - self::save_upgraded_image_versions($current_versions, $img_versions, $changed_images); + self::migrate_global_containers( $updated_images ); + self::migrate_site_containers( $updated_images ); + self::save_upgraded_image_versions( $current_versions, $img_versions, $updated_images ); + + if ( ! self::$rsp->execute() ) { + throw new \Exception( 'Unable to migrate sites to newer version' ); + } + + EE\Utils\delem_log( 'Container migration completed' ); + } + + /** + * Migrate all docker images with new version. + */ + private static function migrate_all_docker_images() { + } @@ -61,17 +61,17 @@ private static function migrate_all_docker_images() { * Save updated image version in database. * * @param $current_versions array of current image versions. - * @param $new_versions array of new image version. - * @param $changed_images array of updated images. + * @param $new_versions array of new image version. + * @param $updated_images array of updated images. */ - private static function save_upgraded_image_versions( $current_versions, $new_versions, $changed_images) { + private static function save_upgraded_image_versions( $current_versions, $new_versions, $updated_images ) { self::$rsp->add_step( 'save-image-verions-in-database', 'EE\Migration\Containers::create_database_entry', 'EE\Migration\Containers::revert_database_entry', - [$new_versions, $changed_images], - [$current_versions, $changed_images] + [ $new_versions, $updated_images ], + [ $current_versions, $updated_images ] ); @@ -80,13 +80,13 @@ private static function save_upgraded_image_versions( $current_versions, $new_ve /** * Update database entry of images * - * @param $new_versions array of new image versions. - * @param $changed_images array of updated images. + * @param $new_versions array of new image versions. + * @param $updated_images array of updated images. * * @throws \Exception */ - public static function create_database_entry($new_versions, $changed_images) { - foreach($changed_images as $image) { + public static function create_database_entry( $new_versions, $updated_images ) { + foreach ( $updated_images as $image ) { EE\Model\Option::update( [ [ 'key', $image ] ], [ 'value' => $new_versions[ $image ] ] ); } } @@ -94,13 +94,13 @@ public static function create_database_entry($new_versions, $changed_images) { /** * Revert database entry in case of exception. * - * @param $old_version array of old image versions. - * @param $changed_images array of updated images. + * @param $old_version array of old image versions. + * @param $updated_images array of updated images. * * @throws \Exception */ - public static function revert_database_entry($old_version, $changed_images) { - foreach($changed_images as $image) { + public static function revert_database_entry( $old_version, $updated_images ) { + foreach ( $updated_images as $image ) { EE\Model\Option::update( [ [ 'key', $image ] ], [ 'value' => $old_version[ $image ] ] ); } } @@ -141,27 +141,30 @@ private static function get_current_docker_images_versions() { /** * Migrates global containers. These are container which are not created per site (i.e. ee-cron-scheduler). * - * @param $changed_images array of updated images. + * @param $updated_images array of updated images. */ - private static function migrate_global_containers( $changed_images ) { + private static function migrate_global_containers( $updated_images ) { - if ( ! GlobalContainers::is_global_container_image_changed( $changed_images ) ) { + if ( ! GlobalContainers::is_global_container_image_changed( $updated_images ) ) { return; } + $global_compose_file_path = EE_ROOT_DIR . '/services/docker-compose.yml'; + $global_compose_file_backup_path = EE_ROOT_DIR . '/services/docker-compose.yml.backup'; + self::$rsp->add_step( 'backup-global-docker-compose-file', 'EE\Migration\GlobalContainers::backup_global_compose_file', 'EE\Migration\GlobalContainers::revert_global_containers', - null, - null + [ $global_compose_file_path, $global_compose_file_backup_path ], + [ $global_compose_file_backup_path, $global_compose_file_path ] ); self::$rsp->add_step( 'stop-global-containers', 'EE\Migration\GlobalContainers::down_global_containers', null, - [ $changed_images ], + [ $updated_images ], null ); @@ -175,7 +178,7 @@ private static function migrate_global_containers( $changed_images ) { // Upgrade nginx-proxy container $existing_nginx_proxy_image = EE::launch( sprintf( 'docker inspect --format=\'{{.Config.Image}}\' %1$s', EE_PROXY_TYPE ), false, true ); - if ( in_array( 'easyengine/nginx-proxy', $changed_images, true ) && 0 === $existing_nginx_proxy_image->return_code ) { + if ( in_array( 'easyengine/nginx-proxy', $updated_images, true ) && 0 === $existing_nginx_proxy_image->return_code ) { self::$rsp->add_step( 'upgrade-nginxproxy-container', 'EE\Migration\GlobalContainers::nginxproxy_container_up', @@ -187,7 +190,7 @@ private static function migrate_global_containers( $changed_images ) { // Upgrade global-db container $existing_db_image = EE::launch( 'docker inspect --format=\'{{.Config.Image}}\' ' . GLOBAL_DB_CONTAINER, false, true ); - if ( in_array( 'easyengine/mariadb', $changed_images, true ) && 0 === $existing_db_image->return_code ) { + if ( in_array( 'easyengine/mariadb', $updated_images, true ) && 0 === $existing_db_image->return_code ) { self::$rsp->add_step( 'upgrade-global-db-container', 'EE\Migration\GlobalContainers::global_db_container_up', @@ -199,7 +202,7 @@ private static function migrate_global_containers( $changed_images ) { // Upgrade cron container $existing_cron_image = EE::launch( 'docker inspect --format=\'{{.Config.Image}}\' ' . EE_CRON_SCHEDULER, false, true ); - if ( in_array( 'easyengine/cron', $changed_images, true ) && 0 === $existing_cron_image->return_code ) { + if ( in_array( 'easyengine/cron', $updated_images, true ) && 0 === $existing_cron_image->return_code ) { self::$rsp->add_step( 'upgrade-cron-container', 'EE\Migration\GlobalContainers::cron_container_up', @@ -211,7 +214,7 @@ private static function migrate_global_containers( $changed_images ) { // Upgrade redis container $existing_redis_image = EE::launch( 'docker inspect --format=\'{{.Config.Image}}\' ' . GLOBAL_REDIS_CONTAINER, false, true ); - if ( in_array( 'easyengine/cron', $changed_images, true ) && 0 === $existing_redis_image->return_code ) { + if ( in_array( 'easyengine/cron', $updated_images, true ) && 0 === $existing_redis_image->return_code ) { self::$rsp->add_step( 'upgrade-global-redis-container', 'EE\Migration\GlobalContainers::global_redis_container_up', @@ -225,27 +228,27 @@ private static function migrate_global_containers( $changed_images ) { /** * Migrate site specific container. * - * @param $changed_images array of updated images + * @param $updated_images array of updated images * * @throws \Exception */ - public static function migrate_site_containers( $changed_images ){ + public static function migrate_site_containers( $updated_images ) { - $db = new \EE_DB(); - $sites = ($db->table('sites')->all()); + $db = new \EE_DB(); + $sites = ( $db->table( 'sites' )->all() ); foreach ( $sites as $key => $site ) { - $docker_yml = $site['site_fs_path'] . '/docker-compose.yml'; + $docker_yml = $site['site_fs_path'] . '/docker-compose.yml'; $docker_yml_backup = $site['site_fs_path'] . '/docker-compose.yml.backup'; - if ( ! SiteContainers::is_site_service_image_changed( $changed_images, $site ) ) { + if ( ! SiteContainers::is_site_service_image_changed( $updated_images, $site ) ) { continue; } $ee_site_object = SiteContainers::get_site_object( $site['site_type'] ); - if( $site['site_enabled'] ) { + if ( $site['site_enabled'] ) { self::$rsp->add_step( "disable-${site['site_url']}-containers", 'EE\Migration\SiteContainers::disable_site', @@ -271,7 +274,7 @@ public static function migrate_site_containers( $changed_images ){ null ); - if( $site['site_enabled']) { + if ( $site['site_enabled'] ) { self::$rsp->add_step( "upgrade-${site['site_url']}-containers", 'EE\Migration\SiteContainers::enable_site', diff --git a/php/EE/Migration/CustomContainerMigrations.php b/php/EE/Migration/CustomContainerMigrations.php index 9df9258cb..53feb8dd3 100644 --- a/php/EE/Migration/CustomContainerMigrations.php +++ b/php/EE/Migration/CustomContainerMigrations.php @@ -9,7 +9,7 @@ class CustomContainerMigrations { /** - * Executes all pending migrations + * Executes pending migrations of container. */ public static function execute_migrations() { @@ -88,6 +88,11 @@ private static function get_all_migrations() { /** * Executes all migrations passed to it recursively. * Also undo'es all migration if there was error executing any migration + * + * @param $migrations array of new migrations. + * + * @throws EE\ExitException + * @throws \Throwable */ private static function execute_migration_stack( $migrations ) { if ( empty( $migrations ) ) { @@ -146,11 +151,12 @@ private static function execute_migration_stack( $migrations ) { } /** - * Get migrations need to be executed. + * Get migrations to be executed. * - * @param $path path to the migration directory. + * @param $migrations array of all migrations. * * @return array + * @throws \Exception */ private static function get_migrations_to_execute( $migrations ) { return array_values( @@ -164,7 +170,8 @@ private static function get_migrations_to_execute( $migrations ) { /** * Get already migrated migrations from database. * - * @return array + * @return array|void + * @throws \Exception */ private static function get_migrations_from_db() { return array_column( Migration::where( 'type', 'container' ), 'migration' ); @@ -191,6 +198,13 @@ private static function get_migration_path( $migration_name ) { } + /** + * Get class name from name of migration file. + * + * @param $migration_name string name of migration file. + * + * @return string + */ private static function get_migration_class_name( $migration_name ) { // Remove date and package name from it $class_name = preg_replace( '/(^\d*)[_]([a-zA-Z-]*[_])/', '', rtrim( $migration_name, '.php' ) ); @@ -202,6 +216,14 @@ private static function get_migration_class_name( $migration_name ) { return "\EE\Migration\\$class_name"; } + /** + * Convert string in camelcase format. + * + * @param $input string to be camelized. + * @param string $separator string of separator. + * + * @return mixed + */ private static function camelize( $input, $separator = '_' ) { return str_replace( $separator, '', ucwords( $input, $separator ) ); } diff --git a/php/EE/Migration/GlobalContainers.php b/php/EE/Migration/GlobalContainers.php index 069d1b150..a1012650d 100644 --- a/php/EE/Migration/GlobalContainers.php +++ b/php/EE/Migration/GlobalContainers.php @@ -33,37 +33,43 @@ public static function is_global_container_image_changed( $updated_images ) { /** * Take backup of current global docker-compose.yml file. * + * @param $source_path string path of global docker-compose.yml + * @param $dest_path string path of backup file. + * * @throws \Exception */ - public static function backup_global_compose_file() { - $global_compose_file_path = EE_ROOT_DIR . '/services/docker-compose.yml'; - $global_compose_backup_file_path = EE_ROOT_DIR . '/services/docker-compose.yml.backup'; + public static function backup_global_compose_file( $source_path, $dest_path ) { - if ( ! EE::exec( "cp $global_compose_file_path $global_compose_backup_file_path" ) ) { + if ( ! EE::exec( "cp $source_path $dest_path" ) ) { throw new \Exception( "Unable to find docker-compose.yml or couldn't create it's backup file. Ensure that EasyEngine has permission to create file there" ); } } /** - * Revert to backed up docker-compose.yml file. + * * Restore backed up docker-compose.yml file. + * + * @param $source_path string path of backup file. + * @param $dest_path string path of global docker-compose.yml * * @throws \Exception */ - public static function revert_global_containers() { - $global_compose_file_path = EE_ROOT_DIR . '/services/docker-compose.yml'; - $global_compose_backup_file_path = EE_ROOT_DIR . '/services/docker-compose.yml.backup'; + public static function revert_global_containers( $source_path, $dest_path ) { + + if ( ! EE::exec( "mv $source_path $dest_path" ) ) { + throw new \Exception( 'Unable to restore backup of docker-compose.yml' ); + } - rename( $global_compose_backup_file_path, $global_compose_file_path ); chdir( EE_ROOT_DIR . '/services' ); - $container_downgraded = EE::exec( 'docker-compose up -d' ); - if ( ! $container_downgraded ) { + if ( ! EE::exec( 'docker-compose up -d' ) ) { throw new \Exception( 'Unable to downgrade global containers. Please check logs for more details.' ); } } /** - * @param $updated_image array of updated images. + * Stop global container and remove them. + * + * @param $updated_image array of newly available images. * * @throws \Exception */ @@ -110,22 +116,20 @@ public static function nginxproxy_container_up() { } chdir( EE_ROOT_DIR . '/services' ); - if( ! EE::exec( 'docker-compose up -d global-nginx-proxy ' ) ) { + if ( ! EE::exec( 'docker-compose up -d global-nginx-proxy ' ) ) { throw new \Exception( sprintf( 'Unable to restart %1$s container', EE_PROXY_TYPE ) ); } } /** - * Downgrades nginx-proxy container - * - * @param $existing_nginx_proxy_image Old nginx-proxy image name + * Remove nginx-proxy container * * @throws \Exception */ - public static function nginxproxy_container_down( $existing_nginx_proxy_image ) { + public static function nginxproxy_container_down() { chdir( EE_ROOT_DIR . '/services' ); - if ( ! EE::exec('docker-compose stop global-nginx-proxy && docker-compose rm -f global-nginx-proxy') ) { + if ( ! EE::exec( 'docker-compose stop global-nginx-proxy && docker-compose rm -f global-nginx-proxy' ) ) { throw new \Exception( sprintf( 'Unable to stop %1$s container', EE_PROXY_TYPE ) ); } @@ -145,7 +149,7 @@ public static function nginxproxy_container_down( $existing_nginx_proxy_image ) public static function global_db_container_up() { chdir( EE_ROOT_DIR . '/services' ); - if( ! EE::exec( 'docker-compose up -d global-db' ) ) { + if ( ! EE::exec( 'docker-compose up -d global-db' ) ) { throw new \Exception( sprintf( 'Unable to restart %1$s container', GLOBAL_DB_CONTAINER ) ); } } @@ -158,26 +162,26 @@ public static function global_db_container_up() { public static function global_db_container_down() { chdir( EE_ROOT_DIR . '/services' ); - if( ! EE::exec( 'docker-compose stop global-db && docker-compose rm -f global-db' ) ) { + if ( ! EE::exec( 'docker-compose stop global-db && docker-compose rm -f global-db' ) ) { throw new \Exception( sprintf( 'Unable to restart %1$s container', GLOBAL_DB_CONTAINER ) ); } } /** - * Upgrades ee-cron-scheduler container + * Remove ee-cron-scheduler container * * @throws \Exception */ public static function cron_container_up() { chdir( EE_ROOT_DIR . '/services' ); - if( ! EE::exec( 'docker-compose up -d docker-compose' ) ) { + if ( ! EE::exec( 'docker-compose up -d docker-compose' ) ) { throw new \Exception( sprintf( 'Unable to restart %1$s container', EE_CRON_SCHEDULER ) ); } } /** - * Downgrades ee-cron-scheduler container + * Remove ee-cron-scheduler container * * @param $existing_cron_image Old nginx-proxy image name * @@ -186,7 +190,7 @@ public static function cron_container_up() { public static function cron_container_down( $existing_cron_image ) { chdir( EE_ROOT_DIR . '/services' ); - if( ! EE::exec( 'docker-compose stop cron-scheduler && docker-compose rm -f cron-scheduler' ) ) { + if ( ! EE::exec( 'docker-compose stop cron-scheduler && docker-compose rm -f cron-scheduler' ) ) { throw new \Exception( sprintf( 'Unable to restart %1$s container', EE_CRON_SCHEDULER ) ); } } @@ -199,7 +203,7 @@ public static function cron_container_down( $existing_cron_image ) { public static function global_redis_container_up() { chdir( EE_ROOT_DIR . '/services' ); - if( ! EE::exec( 'docker-compose up -d global-redis' ) ) { + if ( ! EE::exec( 'docker-compose up -d global-redis' ) ) { throw new \Exception( sprintf( 'Unable to restart %1$s container', GLOBAL_REDIS_CONTAINER ) ); } } @@ -212,7 +216,7 @@ public static function global_redis_container_up() { public static function global_redis_container_down() { chdir( EE_ROOT_DIR . '/services' ); - if( ! EE::exec( 'docker-compose stop global-redis && docker-compose rm -f global-redis' ) ) { + if ( ! EE::exec( 'docker-compose stop global-redis && docker-compose rm -f global-redis' ) ) { throw new \Exception( sprintf( 'Unable to restart %1$s container', GLOBAL_REDIS_CONTAINER ) ); } } diff --git a/php/EE/Migration/SiteContainers.php b/php/EE/Migration/SiteContainers.php index bb14c3d88..06131f9e0 100644 --- a/php/EE/Migration/SiteContainers.php +++ b/php/EE/Migration/SiteContainers.php @@ -6,22 +6,43 @@ use Symfony\Component\Filesystem\Filesystem; /** - * Migrates existing containers to new image + * Migrate site specific containers to new images. */ class SiteContainers { + /** + * Take backup of site's docker-compose.yml file + * + * @param $source_path string path of docker-compose.yml + * @param $dest_path string backup path for docker-compose.yml + * + * @throws \Exception + */ public static function backup_site_docker_compose_file( $source_path, $dest_path ) { if ( ! EE::exec( "cp $source_path $dest_path" ) ) { throw new \Exception( "Unable to find site's docker-compose.yml or couldn't create it's backup file. Ensure that EasyEngine has permission to create file there" ); } } - public static function revert_site_docker_compose_file($source_path, $dest_path ) { + /** + * Revert docker-compose.yml file from backup. + * + * @param $source_path string path of backed up docker-compose.yml + * @param $dest_path string original path of docker-compose.yml + */ + public static function revert_site_docker_compose_file( $source_path, $dest_path ) { rename( $source_path, $dest_path ); - } - public static function is_site_service_image_changed( $changed_images, $site_info ) { + /** + * Check if new image is available for site's services. + * + * @param $updated_images array of updated images. + * @param $site_info array of site info + * + * @return bool + */ + public static function is_site_service_image_changed( $updated_images, $site_info ) { chdir( $site_info['site_fs_path'] ); $launch = EE::launch( 'docker-compose config --services' ); $services = explode( PHP_EOL, trim( $launch->stdout ) ); @@ -30,38 +51,58 @@ public static function is_site_service_image_changed( $changed_images, $site_inf return 'easyengine/' . $service; }, $services ); - $common_image = array_intersect( $changed_images, $site_images ); + $common_image = array_intersect( $updated_images, $site_images ); if ( ! empty( $common_image ) ) { return true; } + return false; } + /** + * Generate docker-compose.yml for specific site. + * + * @param $site_info array of site information. + */ public static function generate_site_docker_compose_file( $site_info ) { - - $filters = self::get_site_filters( $site_info ); - - $site_docker = self::get_site_docker_object( $site_info['site_type'] ); - - $docker_yml_content = $site_docker->generate_docker_compose_yml($filters); + $site_docker = self::get_site_docker_object( $site_info['site_type'] ); + $filters = self::get_site_filters( $site_info ); + $docker_yml_content = $site_docker->generate_docker_compose_yml( $filters ); $fs = new Filesystem(); $fs->dumpFile( $site_info['site_fs_path'] . '/docker-compose.yml', $docker_yml_content ); - } + /** + * Enable site. + * + * @param $site_info array of site information. + * @param $site_object object of site-type( HTML, PHP, Wordpress ). + */ public static function enable_site( $site_info, $site_object ) { $site_object->enable( [ $site_info['site_url'] ], [] ); - } + /** + * Disable site. + * + * @param $site_info array of site information. + * @param $site_object object of site-type( HTML, PHP, Wordpress ). + */ public static function disable_site( $site_info, $site_object ) { $site_object->disable( [ $site_info['site_url'] ], [] ); } - public static function get_site_object($site_type) { - switch($site_type) { + /** + * Get object of supported site type. + * + * @param $site_type string type of site. + * + * @return EE\Site\Type\HTML|EE\Site\Type\PHP|EE\Site\Type\WordPress + */ + public static function get_site_object( $site_type ) { + switch ( $site_type ) { case 'html': return new EE\Site\Type\HTML(); @@ -73,10 +114,17 @@ public static function get_site_object($site_type) { } } - public static function get_site_filters($site) { + /** + * Get site type specific filters. + * + * @param $site array of site information. + * + * @return array + */ + public static function get_site_filters( $site ) { $filters = []; - switch( $site['site_type']) { + switch ( $site['site_type'] ) { case 'html': $filters[] = $site['site_type']; @@ -84,7 +132,7 @@ public static function get_site_filters($site) { case 'php': $filters[] = $site['cache_host']; - if( 'mysql' === $site['app_sub_type']) { + if ( 'mysql' === $site['app_sub_type'] ) { $filters[] = $site['db_host']; } @@ -97,14 +145,22 @@ public static function get_site_filters($site) { break; } - $filters['nohttps'] = $site['site_ssl'] ? false:true; + + $filters['nohttps'] = $site['site_ssl'] ? false : true; return $filters; } - public static function get_site_docker_object( $site_type ){ + /** + * get site docker object of specific site type. + * + * @param $site_type string type of site. + * + * @return EE\Site\Type\Site_HTML_Docker|EE\Site\Type\Site_PHP_Docker|EE\Site\Type\Site_WP_Docker + */ + public static function get_site_docker_object( $site_type ) { - switch ($site_type) { + switch ( $site_type ) { case 'html': return new EE\Site\Type\Site_HTML_Docker(); From 17b9a70c2ad04212ee5aff43a6cfc034c99c397d Mon Sep 17 00:00:00 2001 From: sagarnasit <sagarnasit@gmail.com> Date: Fri, 19 Oct 2018 16:21:29 +0530 Subject: [PATCH 0519/1044] Remove unused function --- php/EE/Migration/Containers.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index 2553871fb..65b4cb2a6 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -49,14 +49,6 @@ public static function start_container_migration() { EE\Utils\delem_log( 'Container migration completed' ); } - /** - * Migrate all docker images with new version. - */ - private static function migrate_all_docker_images() { - - - } - /** * Save updated image version in database. * From 7648a211ee0592c9385bb066b0d83d25bcf49cb3 Mon Sep 17 00:00:00 2001 From: sagarnasit <sagarnasit@gmail.com> Date: Fri, 19 Oct 2018 17:37:19 +0530 Subject: [PATCH 0520/1044] Add global-nginx-proxy in global list of array --- php/EE/Migration/GlobalContainers.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/EE/Migration/GlobalContainers.php b/php/EE/Migration/GlobalContainers.php index a1012650d..35d31ba1a 100644 --- a/php/EE/Migration/GlobalContainers.php +++ b/php/EE/Migration/GlobalContainers.php @@ -16,7 +16,7 @@ class GlobalContainers { */ public static function is_global_container_image_changed( $updated_images ) { $global_images = [ - 'easyengine/mariadb', + 'easyengine/nginx-proxy', 'easyengine/mariadb', 'easyengine/redis', 'easyengine/cron', From 8a5d16ca46ce327a8a55d442c1c900f0a770ba06 Mon Sep 17 00:00:00 2001 From: sagarnasit <sagarnasit@gmail.com> Date: Mon, 22 Oct 2018 14:10:18 +0530 Subject: [PATCH 0521/1044] Use container_status for insect container running --- php/EE/Migration/Containers.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index 65b4cb2a6..7a9a0c8c5 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -30,7 +30,7 @@ public static function start_container_migration() { foreach ( $img_versions as $img => $version ) { if ( $current_versions[ $img ] !== $version ) { $updated_images[] = $img; - self::pull_or_error( $img, $version ); +// self::pull_or_error( $img, $version ); } } @@ -169,9 +169,9 @@ private static function migrate_global_containers( $updated_images ) { ); // Upgrade nginx-proxy container - $existing_nginx_proxy_image = EE::launch( sprintf( 'docker inspect --format=\'{{.Config.Image}}\' %1$s', EE_PROXY_TYPE ), false, true ); - if ( in_array( 'easyengine/nginx-proxy', $updated_images, true ) && 0 === $existing_nginx_proxy_image->return_code ) { - self::$rsp->add_step( + $existing_nginx_proxy_image = \EE_DOCKER::container_status( EE_PROXY_TYPE ); + if ( in_array( 'easyengine/nginx-proxy', $updated_images, true ) && false !== $existing_nginx_proxy_image ) { + self::$rsp->add_stelaunchlaunchp( 'upgrade-nginxproxy-container', 'EE\Migration\GlobalContainers::nginxproxy_container_up', 'EE\Migration\GlobalContainers::nginxproxy_container_down', @@ -181,8 +181,8 @@ private static function migrate_global_containers( $updated_images ) { } // Upgrade global-db container - $existing_db_image = EE::launch( 'docker inspect --format=\'{{.Config.Image}}\' ' . GLOBAL_DB_CONTAINER, false, true ); - if ( in_array( 'easyengine/mariadb', $updated_images, true ) && 0 === $existing_db_image->return_code ) { + $existing_db_image = \EE_DOCKER::container_status( GLOBAL_DB_CONTAINER ); + if ( in_array( 'easyengine/mariadb', $updated_images, true ) && false !== $existing_db_image ) { self::$rsp->add_step( 'upgrade-global-db-container', 'EE\Migration\GlobalContainers::global_db_container_up', @@ -193,8 +193,8 @@ private static function migrate_global_containers( $updated_images ) { } // Upgrade cron container - $existing_cron_image = EE::launch( 'docker inspect --format=\'{{.Config.Image}}\' ' . EE_CRON_SCHEDULER, false, true ); - if ( in_array( 'easyengine/cron', $updated_images, true ) && 0 === $existing_cron_image->return_code ) { + $existing_cron_image = \EE_DOCKER::container_status( EE_CRON_SCHEDULER ); + if ( in_array( 'easyengine/cron', $updated_images, true ) && false !== $existing_cron_image ) { self::$rsp->add_step( 'upgrade-cron-container', 'EE\Migration\GlobalContainers::cron_container_up', @@ -205,8 +205,8 @@ private static function migrate_global_containers( $updated_images ) { } // Upgrade redis container - $existing_redis_image = EE::launch( 'docker inspect --format=\'{{.Config.Image}}\' ' . GLOBAL_REDIS_CONTAINER, false, true ); - if ( in_array( 'easyengine/cron', $updated_images, true ) && 0 === $existing_redis_image->return_code ) { + $existing_redis_image = \EE_DOCKER::container_status( GLOBAL_REDIS_CONTAINER ); + if ( in_array( 'easyengine/cron', $updated_images, true ) && false !== $existing_redis_image ) { self::$rsp->add_step( 'upgrade-global-redis-container', 'EE\Migration\GlobalContainers::global_redis_container_up', From 5222c98633f67d5cf2a06032f6ca33f2d08de1bc Mon Sep 17 00:00:00 2001 From: sagarnasit <sagarnasit@gmail.com> Date: Mon, 22 Oct 2018 17:50:44 +0530 Subject: [PATCH 0522/1044] Optimize global container migration code --- php/EE/Migration/Containers.php | 71 +++++++----------------- php/EE/Migration/GlobalContainers.php | 79 +++++++++++++-------------- 2 files changed, 59 insertions(+), 91 deletions(-) diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index 7a9a0c8c5..c3d671578 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -30,7 +30,7 @@ public static function start_container_migration() { foreach ( $img_versions as $img => $version ) { if ( $current_versions[ $img ] !== $version ) { $updated_images[] = $img; -// self::pull_or_error( $img, $version ); + self::pull_or_error( $img, $version ); } } @@ -137,7 +137,8 @@ private static function get_current_docker_images_versions() { */ private static function migrate_global_containers( $updated_images ) { - if ( ! GlobalContainers::is_global_container_image_changed( $updated_images ) ) { + $updated_global_images = GlobalContainers::get_updated_global_images( $updated_images ); + if ( empty( $updated_global_images ) ) { return; } @@ -156,7 +157,7 @@ private static function migrate_global_containers( $updated_images ) { 'stop-global-containers', 'EE\Migration\GlobalContainers::down_global_containers', null, - [ $updated_images ], + [ $updated_global_images ], null ); @@ -168,52 +169,20 @@ private static function migrate_global_containers( $updated_images ) { null ); - // Upgrade nginx-proxy container - $existing_nginx_proxy_image = \EE_DOCKER::container_status( EE_PROXY_TYPE ); - if ( in_array( 'easyengine/nginx-proxy', $updated_images, true ) && false !== $existing_nginx_proxy_image ) { - self::$rsp->add_stelaunchlaunchp( - 'upgrade-nginxproxy-container', - 'EE\Migration\GlobalContainers::nginxproxy_container_up', - 'EE\Migration\GlobalContainers::nginxproxy_container_down', - null, - null - ); - } + $all_global_images = GlobalContainers::get_all_global_images_with_service_name(); + foreach ( $updated_global_images as $image_name ) { + $global_container_name = $all_global_images[ $image_name ]; + $global_service_name = str_replace( '-', '_', ltrim( $global_container_name, 'ee-' ) ); - // Upgrade global-db container - $existing_db_image = \EE_DOCKER::container_status( GLOBAL_DB_CONTAINER ); - if ( in_array( 'easyengine/mariadb', $updated_images, true ) && false !== $existing_db_image ) { - self::$rsp->add_step( - 'upgrade-global-db-container', - 'EE\Migration\GlobalContainers::global_db_container_up', - 'EE\Migration\GlobalContainers::global_db_container_down', - null, - null - ); - } - - // Upgrade cron container - $existing_cron_image = \EE_DOCKER::container_status( EE_CRON_SCHEDULER ); - if ( in_array( 'easyengine/cron', $updated_images, true ) && false !== $existing_cron_image ) { - self::$rsp->add_step( - 'upgrade-cron-container', - 'EE\Migration\GlobalContainers::cron_container_up', - 'EE\Migration\GlobalContainers::cron_container_down', - null, - null - ); - } - - // Upgrade redis container - $existing_redis_image = \EE_DOCKER::container_status( GLOBAL_REDIS_CONTAINER ); - if ( in_array( 'easyengine/cron', $updated_images, true ) && false !== $existing_redis_image ) { - self::$rsp->add_step( - 'upgrade-global-redis-container', - 'EE\Migration\GlobalContainers::global_redis_container_up', - 'EE\Migration\GlobalContainers::global_redis_container_down', - null, - null - ); + if ( false !== \EE_DOCKER::container_status( $global_container_name ) ) { + self::$rsp->add_step( + "upgrade-$global_container_name-container", + "EE\Migration\GlobalContainers::${global_service_name}_up", + "EE\Migration\GlobalContainers::${global_service_name}_down", + null, + null + ); + } } } @@ -229,7 +198,7 @@ public static function migrate_site_containers( $updated_images ) { $db = new \EE_DB(); $sites = ( $db->table( 'sites' )->all() ); - foreach ( $sites as $key => $site ) { + foreach ( $sites as $site ) { $docker_yml = $site['site_fs_path'] . '/docker-compose.yml'; $docker_yml_backup = $site['site_fs_path'] . '/docker-compose.yml.backup'; @@ -270,9 +239,9 @@ public static function migrate_site_containers( $updated_images ) { self::$rsp->add_step( "upgrade-${site['site_url']}-containers", 'EE\Migration\SiteContainers::enable_site', - null, + 'EE\Migration\SiteContainers::enable_site', [ $site, $ee_site_object ], - null + [ $site, $ee_site_object ] ); } } diff --git a/php/EE/Migration/GlobalContainers.php b/php/EE/Migration/GlobalContainers.php index 35d31ba1a..f0eef9066 100644 --- a/php/EE/Migration/GlobalContainers.php +++ b/php/EE/Migration/GlobalContainers.php @@ -10,11 +10,13 @@ class GlobalContainers { /** + * Get global containers which has new image update. + * * @param $updated_images array of updated docker-images * - * @return bool + * @return array */ - public static function is_global_container_image_changed( $updated_images ) { + public static function get_updated_global_images( $updated_images ) { $global_images = [ 'easyengine/nginx-proxy', 'easyengine/mariadb', @@ -22,12 +24,7 @@ public static function is_global_container_image_changed( $updated_images ) { 'easyengine/cron', ]; - $commom_images = array_intersect( $updated_images, $global_images ); - - if ( ! empty( $commom_images ) ) { - return true; - } - return false; + return array_intersect( $updated_images, $global_images ); } /** @@ -69,35 +66,23 @@ public static function revert_global_containers( $source_path, $dest_path ) { /** * Stop global container and remove them. * - * @param $updated_image array of newly available images. + * @param $updated_images array of newly available images. * * @throws \Exception */ - public static function down_global_containers( $updated_image ) { + public static function down_global_containers( $updated_images ) { chdir( EE_ROOT_DIR . '/services' ); + $all_global_images = self::get_all_global_images_with_service_name(); - if ( in_array( 'easyengine/nginx-proxy', $updated_image, true ) ) { - if ( ! EE::exec( 'docker-compose stop global-nginx-proxy && docker-compose rm -f global-nginx-proxy' ) ) { - throw new \Exception( 'Unable to stop ' . EE_PROXY_TYPE . ' container' ); - } - } - - if ( in_array( 'easyengine/mariadb', $updated_image, true ) ) { - if ( ! EE::exec( 'docker-compose stop global-db && docker-compose rm -f global-db' ) ) { - throw new \Exception( 'Unable to stop ' . GLOBAL_DB_CONTAINER . 'container' ); - } - } + foreach ( $updated_images as $image_name ) { + $global_container_name = $all_global_images[ $image_name ]; + $global_service_name = ltrim( $global_container_name, 'ee-' ); - if ( in_array( 'easyengine/redis', $updated_image, true ) ) { - if ( ! EE::exec( 'docker-compose stop global-redis && docker-compose rm -f global-redis' ) ) { - throw new \Exception( 'Unable to stop ' . GLOBAL_REDIS_CONTAINER . 'container' ); - } - } - - if ( in_array( 'easyengine/cron', $updated_image, true ) ) { - if ( ! EE::exec( 'docker-compose stop cron-scheduler && docker-compose rm -f cron-scheduler' ) ) { - throw new \Exception( 'Unable to stop ' . GLOBAL_REDIS_CONTAINER . 'container' ); + if ( false !== \EE_DOCKER::container_status( $global_container_name ) ) { + if ( ! EE::exec( "docker-compose stop $global_service_name && docker-compose rm -f $global_service_name" ) ) { + throw new \Exception( "Unable to stop $global_container_name container" ); + } } } } @@ -107,7 +92,7 @@ public static function down_global_containers( $updated_image ) { * * @throws \Exception */ - public static function nginxproxy_container_up() { + public static function global_nginx_proxy_up() { $default_conf_path = EE_ROOT_DIR . '/services/nginx-proxy/conf.d/default.conf'; $fs = new \Symfony\Component\Filesystem\Filesystem(); @@ -126,7 +111,7 @@ public static function nginxproxy_container_up() { * * @throws \Exception */ - public static function nginxproxy_container_down() { + public static function global_nginx_proxy_down() { chdir( EE_ROOT_DIR . '/services' ); if ( ! EE::exec( 'docker-compose stop global-nginx-proxy && docker-compose rm -f global-nginx-proxy' ) ) { @@ -146,7 +131,7 @@ public static function nginxproxy_container_down() { * * @throws \Exception */ - public static function global_db_container_up() { + public static function global_db_up() { chdir( EE_ROOT_DIR . '/services' ); if ( ! EE::exec( 'docker-compose up -d global-db' ) ) { @@ -159,7 +144,7 @@ public static function global_db_container_up() { * * @throws \Exception */ - public static function global_db_container_down() { + public static function global_db_down() { chdir( EE_ROOT_DIR . '/services' ); if ( ! EE::exec( 'docker-compose stop global-db && docker-compose rm -f global-db' ) ) { @@ -172,7 +157,8 @@ public static function global_db_container_down() { * * @throws \Exception */ - public static function cron_container_up() { + public static function cron_scheduler_up() { + return; chdir( EE_ROOT_DIR . '/services' ); if ( ! EE::exec( 'docker-compose up -d docker-compose' ) ) { @@ -183,11 +169,9 @@ public static function cron_container_up() { /** * Remove ee-cron-scheduler container * - * @param $existing_cron_image Old nginx-proxy image name - * * @throws \Exception */ - public static function cron_container_down( $existing_cron_image ) { + public static function cron_scheduler_down() { chdir( EE_ROOT_DIR . '/services' ); if ( ! EE::exec( 'docker-compose stop cron-scheduler && docker-compose rm -f cron-scheduler' ) ) { @@ -200,7 +184,7 @@ public static function cron_container_down( $existing_cron_image ) { * * @throws \Exception */ - public static function global_redis_container_up() { + public static function global_redis_up() { chdir( EE_ROOT_DIR . '/services' ); if ( ! EE::exec( 'docker-compose up -d global-redis' ) ) { @@ -213,11 +197,26 @@ public static function global_redis_container_up() { * * @throws \Exception */ - public static function global_redis_container_down() { + public static function global_redis_down() { chdir( EE_ROOT_DIR . '/services' ); if ( ! EE::exec( 'docker-compose stop global-redis && docker-compose rm -f global-redis' ) ) { throw new \Exception( sprintf( 'Unable to restart %1$s container', GLOBAL_REDIS_CONTAINER ) ); } } + + /** + * Get all global images with it's service name. + * + * @return array + */ + public static function get_all_global_images() { + return [ + 'easyengine/nginx-proxy' => EE_PROXY_TYPE, + 'easyengine/mariadb' => GLOBAL_DB_CONTAINER, + 'easyengine/redis' => GLOBAL_REDIS_CONTAINER, +// 'easyengine/cron' => EE_CRON_SCHEDULER, + + ]; + } } From ece975e59b3681600f8069edb34f53c61296a5b8 Mon Sep 17 00:00:00 2001 From: sagarnasit <sagarnasit@gmail.com> Date: Mon, 22 Oct 2018 18:55:10 +0530 Subject: [PATCH 0523/1044] Add debug logs --- php/EE/Migration/GlobalContainers.php | 30 ++++++++++++++++++++++----- php/EE/Migration/SiteContainers.php | 25 +++++++++++++++++++--- 2 files changed, 47 insertions(+), 8 deletions(-) diff --git a/php/EE/Migration/GlobalContainers.php b/php/EE/Migration/GlobalContainers.php index f0eef9066..1c09b6eaa 100644 --- a/php/EE/Migration/GlobalContainers.php +++ b/php/EE/Migration/GlobalContainers.php @@ -36,10 +36,11 @@ public static function get_updated_global_images( $updated_images ) { * @throws \Exception */ public static function backup_global_compose_file( $source_path, $dest_path ) { - + EE::debug( 'Start backing up of global docker-compose.yml file' ); if ( ! EE::exec( "cp $source_path $dest_path" ) ) { throw new \Exception( "Unable to find docker-compose.yml or couldn't create it's backup file. Ensure that EasyEngine has permission to create file there" ); } + EE::debug( 'Complete backing up of global docker-compose.yml file' ); } /** @@ -51,7 +52,7 @@ public static function backup_global_compose_file( $source_path, $dest_path ) { * @throws \Exception */ public static function revert_global_containers( $source_path, $dest_path ) { - + EE::debug( 'Start restoring global docker-compose.yml file from backup' ); if ( ! EE::exec( "mv $source_path $dest_path" ) ) { throw new \Exception( 'Unable to restore backup of docker-compose.yml' ); } @@ -61,6 +62,7 @@ public static function revert_global_containers( $source_path, $dest_path ) { if ( ! EE::exec( 'docker-compose up -d' ) ) { throw new \Exception( 'Unable to downgrade global containers. Please check logs for more details.' ); } + EE::debug( 'Complete restoring global docker-compose.yml file from backup' ); } /** @@ -71,13 +73,14 @@ public static function revert_global_containers( $source_path, $dest_path ) { * @throws \Exception */ public static function down_global_containers( $updated_images ) { - + EE::debug( 'Start removing global containers' ); chdir( EE_ROOT_DIR . '/services' ); $all_global_images = self::get_all_global_images_with_service_name(); foreach ( $updated_images as $image_name ) { $global_container_name = $all_global_images[ $image_name ]; $global_service_name = ltrim( $global_container_name, 'ee-' ); + EE::debug( "Removing $global_container_name" ); if ( false !== \EE_DOCKER::container_status( $global_container_name ) ) { if ( ! EE::exec( "docker-compose stop $global_service_name && docker-compose rm -f $global_service_name" ) ) { @@ -85,6 +88,7 @@ public static function down_global_containers( $updated_images ) { } } } + EE::debug( 'Complete removing global containers' ); } /** @@ -93,6 +97,7 @@ public static function down_global_containers( $updated_images ) { * @throws \Exception */ public static function global_nginx_proxy_up() { + EE::debug( 'Start ' . EE_PROXY_TYPE . ' container up' ); $default_conf_path = EE_ROOT_DIR . '/services/nginx-proxy/conf.d/default.conf'; $fs = new \Symfony\Component\Filesystem\Filesystem(); @@ -104,6 +109,7 @@ public static function global_nginx_proxy_up() { if ( ! EE::exec( 'docker-compose up -d global-nginx-proxy ' ) ) { throw new \Exception( sprintf( 'Unable to restart %1$s container', EE_PROXY_TYPE ) ); } + EE::debug( 'Complete ' . EE_PROXY_TYPE . ' container up' );; } /** @@ -112,6 +118,7 @@ public static function global_nginx_proxy_up() { * @throws \Exception */ public static function global_nginx_proxy_down() { + EE::debug( 'Start ' . EE_PROXY_TYPE . ' container removing' ); chdir( EE_ROOT_DIR . '/services' ); if ( ! EE::exec( 'docker-compose stop global-nginx-proxy && docker-compose rm -f global-nginx-proxy' ) ) { @@ -124,6 +131,7 @@ public static function global_nginx_proxy_down() { if ( $fs->exists( $default_conf_path ) ) { $fs->remove( $default_conf_path ); } + EE::debug( 'Complete ' . EE_PROXY_TYPE . ' container removing' ); } /** @@ -132,11 +140,13 @@ public static function global_nginx_proxy_down() { * @throws \Exception */ public static function global_db_up() { + EE::debug( 'Start ' . GLOBAL_DB_CONTAINER . ' container up' ); chdir( EE_ROOT_DIR . '/services' ); if ( ! EE::exec( 'docker-compose up -d global-db' ) ) { throw new \Exception( sprintf( 'Unable to restart %1$s container', GLOBAL_DB_CONTAINER ) ); } + EE::debug( 'Complete' . GLOBAL_DB_CONTAINER . ' container up' ); } /** @@ -145,11 +155,13 @@ public static function global_db_up() { * @throws \Exception */ public static function global_db_down() { + EE::debug( 'Start ' . GLOBAL_DB_CONTAINER . ' container removing' ); chdir( EE_ROOT_DIR . '/services' ); if ( ! EE::exec( 'docker-compose stop global-db && docker-compose rm -f global-db' ) ) { throw new \Exception( sprintf( 'Unable to restart %1$s container', GLOBAL_DB_CONTAINER ) ); } + EE::debug( 'Complete ' . GLOBAL_DB_CONTAINER . ' container removing' ); } /** @@ -158,12 +170,14 @@ public static function global_db_down() { * @throws \Exception */ public static function cron_scheduler_up() { - return; + EE::debug( 'Start ' . EE_CRON_SCHEDULER . ' container up' ); + chdir( EE_ROOT_DIR . '/services' ); if ( ! EE::exec( 'docker-compose up -d docker-compose' ) ) { throw new \Exception( sprintf( 'Unable to restart %1$s container', EE_CRON_SCHEDULER ) ); } + EE::debug( 'Complete ' . EE_CRON_SCHEDULER . ' container up' ); } /** @@ -172,11 +186,13 @@ public static function cron_scheduler_up() { * @throws \Exception */ public static function cron_scheduler_down() { + EE::debug( 'Start ' . EE_CRON_SCHEDULER . ' container removing' ); chdir( EE_ROOT_DIR . '/services' ); if ( ! EE::exec( 'docker-compose stop cron-scheduler && docker-compose rm -f cron-scheduler' ) ) { throw new \Exception( sprintf( 'Unable to restart %1$s container', EE_CRON_SCHEDULER ) ); } + EE::debug( 'Complete ' . EE_CRON_SCHEDULER . ' container removing' ); } /** @@ -185,11 +201,13 @@ public static function cron_scheduler_down() { * @throws \Exception */ public static function global_redis_up() { + EE::debug( 'Start ' . GLOBAL_REDIS_CONTAINER . ' container up' ); chdir( EE_ROOT_DIR . '/services' ); if ( ! EE::exec( 'docker-compose up -d global-redis' ) ) { throw new \Exception( sprintf( 'Unable to restart %1$s container', GLOBAL_REDIS_CONTAINER ) ); } + EE::debug( 'Complete ' . GLOBAL_REDIS_CONTAINER . ' container up' ); } /** @@ -198,11 +216,13 @@ public static function global_redis_up() { * @throws \Exception */ public static function global_redis_down() { + EE::debug( 'Start ' . GLOBAL_REDIS_CONTAINER . ' container removing' ); chdir( EE_ROOT_DIR . '/services' ); if ( ! EE::exec( 'docker-compose stop global-redis && docker-compose rm -f global-redis' ) ) { throw new \Exception( sprintf( 'Unable to restart %1$s container', GLOBAL_REDIS_CONTAINER ) ); } + EE::debug( 'Complete ' . GLOBAL_REDIS_CONTAINER . ' container removing' ); } /** @@ -210,7 +230,7 @@ public static function global_redis_down() { * * @return array */ - public static function get_all_global_images() { + public static function get_all_global_images_with_service_name() { return [ 'easyengine/nginx-proxy' => EE_PROXY_TYPE, 'easyengine/mariadb' => GLOBAL_DB_CONTAINER, diff --git a/php/EE/Migration/SiteContainers.php b/php/EE/Migration/SiteContainers.php index 06131f9e0..6ae391f6e 100644 --- a/php/EE/Migration/SiteContainers.php +++ b/php/EE/Migration/SiteContainers.php @@ -19,9 +19,13 @@ class SiteContainers { * @throws \Exception */ public static function backup_site_docker_compose_file( $source_path, $dest_path ) { - if ( ! EE::exec( "cp $source_path $dest_path" ) ) { - throw new \Exception( "Unable to find site's docker-compose.yml or couldn't create it's backup file. Ensure that EasyEngine has permission to create file there" ); + EE::debug( 'Start backing up site\'s docker-compose.yml' ); + $fs = new Filesystem(); + if ( ! $fs->exists( $source_path ) ) { + throw new \Exception( ' site\'s docker-compose.yml does not exist' ); } + $fs->copy( $source_path, $dest_path, true ); + EE::debug( 'Complete backing up site\'s docker-compose.yml' ); } /** @@ -29,9 +33,18 @@ public static function backup_site_docker_compose_file( $source_path, $dest_path * * @param $source_path string path of backed up docker-compose.yml * @param $dest_path string original path of docker-compose.yml + * + * @throws \Exception */ public static function revert_site_docker_compose_file( $source_path, $dest_path ) { - rename( $source_path, $dest_path ); + EE::debug( 'Start restoring site\'s docker-compose.yml' ); + $fs = new Filesystem(); + if ( ! $fs->exists( $source_path ) ) { + throw new \Exception( ' site\'s docker-compose.yml.backup does not exist' ); + } + $fs->copy( $source_path, $dest_path, true ); + $fs->remove( $source_path ); + EE::debug( 'Complete restoring site\'s docker-compose.yml' ); } /** @@ -66,12 +79,14 @@ public static function is_site_service_image_changed( $updated_images, $site_inf * @param $site_info array of site information. */ public static function generate_site_docker_compose_file( $site_info ) { + EE::debug( "Start generating news docker-compose.yml for ${site_info['site_url']}" ); $site_docker = self::get_site_docker_object( $site_info['site_type'] ); $filters = self::get_site_filters( $site_info ); $docker_yml_content = $site_docker->generate_docker_compose_yml( $filters ); $fs = new Filesystem(); $fs->dumpFile( $site_info['site_fs_path'] . '/docker-compose.yml', $docker_yml_content ); + EE::debug( "Complete generating news docker-compose.yml for ${site_info['site_url']}" ); } /** @@ -81,7 +96,9 @@ public static function generate_site_docker_compose_file( $site_info ) { * @param $site_object object of site-type( HTML, PHP, Wordpress ). */ public static function enable_site( $site_info, $site_object ) { + EE::debug( "Start enabling ${site_info['site_url']}" ); $site_object->enable( [ $site_info['site_url'] ], [] ); + EE::debug( "Complete enabling ${site_info['site_url']}" ); } /** @@ -91,7 +108,9 @@ public static function enable_site( $site_info, $site_object ) { * @param $site_object object of site-type( HTML, PHP, Wordpress ). */ public static function disable_site( $site_info, $site_object ) { + EE::debug( "Start disabling ${site_info['site_url']}" ); $site_object->disable( [ $site_info['site_url'] ], [] ); + EE::debug( "Complete disabling ${site_info['site_url']}" ); } /** From 47c0ae51b96fe1c81e975ba14957fa5cb559e23b Mon Sep 17 00:00:00 2001 From: sagarnasit <sagarnasit@gmail.com> Date: Tue, 23 Oct 2018 15:38:00 +0530 Subject: [PATCH 0524/1044] Add cron info in array --- php/EE/Migration/GlobalContainers.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/php/EE/Migration/GlobalContainers.php b/php/EE/Migration/GlobalContainers.php index 1c09b6eaa..6be58e76e 100644 --- a/php/EE/Migration/GlobalContainers.php +++ b/php/EE/Migration/GlobalContainers.php @@ -235,8 +235,7 @@ public static function get_all_global_images_with_service_name() { 'easyengine/nginx-proxy' => EE_PROXY_TYPE, 'easyengine/mariadb' => GLOBAL_DB_CONTAINER, 'easyengine/redis' => GLOBAL_REDIS_CONTAINER, -// 'easyengine/cron' => EE_CRON_SCHEDULER, - + 'easyengine/cron' => EE_CRON_SCHEDULER, ]; } } From fe0ffdc839954920c800fdc1f80b3c75c8ba3528 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Wed, 24 Oct 2018 12:35:15 +0530 Subject: [PATCH 0525/1044] Add docker volume functions Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/class-ee-docker.php | 61 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php index a91fcf2e5..7dcde88c3 100644 --- a/php/class-ee-docker.php +++ b/php/class-ee-docker.php @@ -1,5 +1,7 @@ <?php +use Symfony\Component\Filesystem\Filesystem; + class EE_DOCKER { /** @@ -214,4 +216,63 @@ public static function service_exists( $service, $site_fs_path ) { return in_array( $service, $services, true ); } + + /** + * Gets a dockerized prefix created for site. + * + * @param string $site_url Name of the site. + * + * @return string prefix derived from the name. + */ + public static function get_docker_style_prefix( $site_url ) { + return str_replace( [ '.', '-' ], '', $site_url ); + } + + /** + * Function to create external docker volumes and related symlinks. + * + * @param string $prefix Prefix by volumes have to be created. + * @param array $volumes The volumes to be created. + * $volumes[$key]['name'] => specifies the name of volume to be created. + * $volumes[$key]['path_to_symlink'] => specifies the path to symlink the created volume. + * @param bool $update_to_docker_prefix Update the prefix in dockerized style. + */ + public static function create_volumes( $prefix, $volumes, $update_to_docker_prefix = true ) { + + $volume_prefix = $update_to_docker_prefix ? self::get_docker_style_prefix( $prefix ) : $prefix; + $fs = new Filesystem(); + + // This command will get the root directory for Docker, generally `/var/lib/docker`. + $launch = EE::launch( "docker info 2> /dev/null | awk '/Docker Root Dir/ {print $4}'" ); + $docker_root_dir = trim( $launch->stdout ); + + foreach ( $volumes as $volume ) { + $fs->mkdir( dirname( $volume['path_to_symlink'] ) ); + EE::exec( + sprintf( + 'docker volume create \ + --label "org.label-schema.vendor=EasyEngine" \ + --label "io.easyengine.site=%s" \ + %s_%s', + $prefix, + $volume_prefix, + $volume['name'] + ) + ); + $fs->symlink( sprintf( '%s/volumes/%s_%s/_data', $docker_root_dir, $volume_prefix, $volume['name'] ), $volume['path_to_symlink'] ); + } + } + + /** + * Function to get all the volumes with a specific label. + * + * @param string $label The label to search for. + * + * @return array Found containers. + */ + public static function get_volumes_by_label( $label ) { + $launch = EE::launch( sprintf( 'docker volume ls --filter="label=org.label-schema.vendor=EasyEngine" --filter="label=io.easyengine.site=%s" -q', $label ) ); + + return explode( PHP_EOL, trim( $launch->stdout ) ); + } } From a8febcfc2d29d1cbd7057bd16ca36e9daa8304fc Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Wed, 24 Oct 2018 12:58:24 +0530 Subject: [PATCH 0526/1044] Filter and remove empty results Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/class-ee-docker.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php index 7dcde88c3..287e63679 100644 --- a/php/class-ee-docker.php +++ b/php/class-ee-docker.php @@ -273,6 +273,6 @@ public static function create_volumes( $prefix, $volumes, $update_to_docker_pref public static function get_volumes_by_label( $label ) { $launch = EE::launch( sprintf( 'docker volume ls --filter="label=org.label-schema.vendor=EasyEngine" --filter="label=io.easyengine.site=%s" -q', $label ) ); - return explode( PHP_EOL, trim( $launch->stdout ) ); + return array_filter( explode( PHP_EOL, trim( $launch->stdout ) ), 'trim' ); } } From 7bcf5e1e0780e231eeafff3ffbf232cf2369cc94 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 25 Oct 2018 12:00:00 +0530 Subject: [PATCH 0527/1044] Add utility function to get values from config file Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/utils.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/php/utils.php b/php/utils.php index 4be714003..7ece5f04f 100644 --- a/php/utils.php +++ b/php/utils.php @@ -1623,3 +1623,19 @@ function get_curl_info( $url, $port = 80, $port_info = false, $auth = false ) { return curl_getinfo( $ch, CURLINFO_HTTP_CODE ); } + +/** + * Function to get config value for a given key. + * + * @param string $key Key to search in config file. + * @param string|null $default Default value of the given key. + * + * @return string|null value of the asked key. + */ +function get_config_value( $key, $default = null ) { + + $config_file_path = getenv( 'EE_CONFIG_PATH' ) ? getenv( 'EE_CONFIG_PATH' ) : EE_ROOT_DIR . '/config/config.yml'; + $existing_config = Spyc::YAMLLoad( $config_file_path ); + + return empty( $existing_config[ $key ] ) ? $default : $existing_config[ $key ]; +} From 96e3fe6ca77fc30c616f70ace12f25ad0a6668cd Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 25 Oct 2018 12:27:12 +0530 Subject: [PATCH 0528/1044] Add required use statement Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/utils.php | 1 + 1 file changed, 1 insertion(+) diff --git a/php/utils.php b/php/utils.php index 7ece5f04f..571a655d0 100644 --- a/php/utils.php +++ b/php/utils.php @@ -8,6 +8,7 @@ use Composer\Semver\Semver; use EE; use EE\Iterators\Transform; +use Mustangostang\Spyc; const PHAR_STREAM_PREFIX = 'phar://'; From 11cd78b0d54c6ac3b350d75e1a930a722cfda46a Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 29 Oct 2018 16:25:04 +0530 Subject: [PATCH 0529/1044] Remove custom conf as moved to nginx image tmpl Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- templates/custom.conf.mustache | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 templates/custom.conf.mustache diff --git a/templates/custom.conf.mustache b/templates/custom.conf.mustache deleted file mode 100644 index 115a3649a..000000000 --- a/templates/custom.conf.mustache +++ /dev/null @@ -1,2 +0,0 @@ -server_tokens off; -client_max_body_size 100m; \ No newline at end of file From 508cb6f7936a8602839942654b399659c0e7e0b7 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 30 Oct 2018 16:56:05 +0530 Subject: [PATCH 0530/1044] Fix migration triggering for nightly Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Runner.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 9480877ed..d4b9679aa 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -795,20 +795,26 @@ private function auto_check_update() { } /** - * Triggers migration if current phar version > version in ee_option table + * Triggers migration if current phar version > version in ee_option table. + * Also, trigger migrations if phar version >= version in ee_option table but nightly version differ. */ private function maybe_trigger_migration() { + $db_version = Option::get( 'version' ); - $current_version = preg_replace( '/-nightly.*$/', '', EE_VERSION ); + $current_version = EE_VERSION; if ( ! $db_version ) { $this->trigger_migration( $current_version ); + return; } - if ( Comparator::lessThan( $current_version, $db_version ) ) { - EE::error( 'It seems you\'re not running latest version. Please download and run latest version of EasyEngine' ); - } elseif ( Comparator::greaterThan( $current_version, $db_version ) ) { + $base_db_version = preg_replace( '/-nightly.*$/', '', $db_version ); + $base_current_version = preg_replace( '/-nightly.*$/', '', EE_VERSION ); + + if ( Comparator::lessThan( $base_current_version, $base_db_version ) ) { + EE::error( 'It seems you\'re not running latest version. Please download and run latest version of EasyEngine.' ); + } elseif ( $db_version !== $current_version ) { EE::log( 'Executing migrations. This might take some time.' ); $this->trigger_migration( $current_version ); } From 4a5440536c33a175ef9d65db59737bfb6844b815 Mon Sep 17 00:00:00 2001 From: Mriyam Tamuli <mbtamuli@gmail.com> Date: Tue, 30 Oct 2018 18:00:38 +0530 Subject: [PATCH 0531/1044] Bump versions for v4.0.0-rc.1 Signed-off-by: Mriyam Tamuli <mbtamuli@gmail.com> --- VERSION | 2 +- composer.json | 20 +-- composer.lock | 373 +++++++++++++++++++++++++++------------------- img-versions.json | 18 +-- 4 files changed, 238 insertions(+), 175 deletions(-) diff --git a/VERSION b/VERSION index 93699eec6..78fd5f0ed 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.0.0-beta.6 +4.0.0-rc.1 diff --git a/composer.json b/composer.json index 17cf14496..f4b2ae177 100644 --- a/composer.json +++ b/composer.json @@ -27,16 +27,16 @@ "php": ">=7.0", "composer/composer": "^1.2.0", "composer/semver": "~1.0", - "easyengine/admin-tools-command": "v1.0.0-beta.1", - "easyengine/auth-command": "v1.0.0-beta.1", - "easyengine/config-command": "v1.0.0-beta.1", - "easyengine/cron-command": "v1.0.0-beta.3", - "easyengine/mailhog-command": "v1.0.0-beta.1", - "easyengine/site-command": "v2.1.0", - "easyengine/site-type-wp": "v1.0.0-beta.2", - "easyengine/site-type-php": "v1.0.0-beta.1", - "easyengine/service-command": "v1.0.0-beta.1", - "easyengine/shell-command" : "v1.0.0-beta.2", + "easyengine/admin-tools-command": "v1.0.0-rc.1", + "easyengine/auth-command": "v1.0.0-rc.1", + "easyengine/config-command": "v1.0.0-rc.1", + "easyengine/cron-command": "v1.0.0-rc.1", + "easyengine/mailhog-command": "v1.0.0-rc.1", + "easyengine/site-command": "v2.2.0", + "easyengine/site-type-wp": "v1.0.0-rc.1", + "easyengine/site-type-php": "v1.0.0-rc.1", + "easyengine/service-command": "v1.0.0-rc.1", + "easyengine/shell-command" : "v1.0.0-rc.1", "justinrainbow/json-schema": "~5.2.5", "monolog/monolog": "^1.23", "mustache/mustache": "~2.4", diff --git a/composer.lock b/composer.lock index e23cd6c34..a6799a9cf 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": "51972052d5e6ca19e292d24211fa5721", + "content-hash": "afc0f1cbc13e6d9120745d286b0be863", "packages": [ { "name": "acmephp/core", @@ -12,12 +12,12 @@ "source": { "type": "git", "url": "https://github.com/acmephp/core.git", - "reference": "0d5221f1dbb00ad6686ec2cab5017cab8bc424f1" + "reference": "aa84037654073a2840c2425acb599567d3d2f3e7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/acmephp/core/zipball/0d5221f1dbb00ad6686ec2cab5017cab8bc424f1", - "reference": "0d5221f1dbb00ad6686ec2cab5017cab8bc424f1", + "url": "https://api.github.com/repos/acmephp/core/zipball/aa84037654073a2840c2425acb599567d3d2f3e7", + "reference": "aa84037654073a2840c2425acb599567d3d2f3e7", "shasum": "" }, "require": { @@ -69,20 +69,20 @@ "ssl", "x509" ], - "time": "2018-08-15T17:41:08+00:00" + "time": "2018-10-14T09:29:59+00:00" }, { "name": "acmephp/ssl", - "version": "1.0.0-beta4", + "version": "1.0.0", "source": { "type": "git", "url": "https://github.com/acmephp/ssl.git", - "reference": "fef7a791ae3a2e2921cd47cdceb6c10790c880bc" + "reference": "bd070b7de809293bedd3a3ce6d3efc4c1eb996c3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/acmephp/ssl/zipball/fef7a791ae3a2e2921cd47cdceb6c10790c880bc", - "reference": "fef7a791ae3a2e2921cd47cdceb6c10790c880bc", + "url": "https://api.github.com/repos/acmephp/ssl/zipball/bd070b7de809293bedd3a3ce6d3efc4c1eb996c3", + "reference": "bd070b7de809293bedd3a3ce6d3efc4c1eb996c3", "shasum": "" }, "require": { @@ -91,8 +91,7 @@ "webmozart/assert": "^1.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.22", - "sllh/php-cs-fixer-styleci-bridge": "^1.5.0" + "phpunit/phpunit": "^4.8.22" }, "type": "library", "extra": { @@ -131,20 +130,20 @@ "ssl", "x509" ], - "time": "2016-12-28T23:53:27+00:00" + "time": "2018-10-14T09:29:59+00:00" }, { "name": "composer/ca-bundle", - "version": "1.1.2", + "version": "1.1.3", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "46afded9720f40b9dc63542af4e3e43a1177acb0" + "reference": "8afa52cd417f4ec417b4bfe86b68106538a87660" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/46afded9720f40b9dc63542af4e3e43a1177acb0", - "reference": "46afded9720f40b9dc63542af4e3e43a1177acb0", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/8afa52cd417f4ec417b4bfe86b68106538a87660", + "reference": "8afa52cd417f4ec417b4bfe86b68106538a87660", "shasum": "" }, "require": { @@ -187,7 +186,7 @@ "ssl", "tls" ], - "time": "2018-08-08T08:57:40+00:00" + "time": "2018-10-18T06:09:13+00:00" }, { "name": "composer/composer", @@ -438,16 +437,16 @@ }, { "name": "easyengine/admin-tools-command", - "version": "v1.0.0-beta.1", + "version": "v1.0.0-rc.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/admin-tools-command.git", - "reference": "1114683aa73f8b30d5e445a41961a52b0fcb1894" + "reference": "375f5630e928591569629f04e67637c4e61bcc91" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/admin-tools-command/zipball/1114683aa73f8b30d5e445a41961a52b0fcb1894", - "reference": "1114683aa73f8b30d5e445a41961a52b0fcb1894", + "url": "https://api.github.com/repos/EasyEngine/admin-tools-command/zipball/375f5630e928591569629f04e67637c4e61bcc91", + "reference": "375f5630e928591569629f04e67637c4e61bcc91", "shasum": "" }, "type": "ee-cli-package", @@ -457,7 +456,10 @@ }, "bundled": true, "commands": [ - "admin-tools" + "admin-tools", + "admin-tools install", + "admin-tools enable", + "admin-tools disable" ] }, "autoload": { @@ -472,22 +474,22 @@ "license": [ "MIT" ], - "description": "Commanad to enable disable admin tools for php based sites.", + "description": "Command to manage admin tools for php based sites.", "homepage": "https://github.com/easyengine/amdin-tools", - "time": "2018-09-06T12:06:41+00:00" + "time": "2018-10-30T08:26:49+00:00" }, { "name": "easyengine/auth-command", - "version": "v1.0.0-beta.1", + "version": "v1.0.0-rc.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/auth-command.git", - "reference": "df7051c02175076a3e9966b76ad7a46ac9e5a9ff" + "reference": "a82f10b3d5cb26136b953c9723c3fed6d2479af7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/auth-command/zipball/df7051c02175076a3e9966b76ad7a46ac9e5a9ff", - "reference": "df7051c02175076a3e9966b76ad7a46ac9e5a9ff", + "url": "https://api.github.com/repos/EasyEngine/auth-command/zipball/a82f10b3d5cb26136b953c9723c3fed6d2479af7", + "reference": "a82f10b3d5cb26136b953c9723c3fed6d2479af7", "shasum": "" }, "type": "ee-cli-package", @@ -497,7 +499,12 @@ }, "bundled": true, "commands": [ - "auth" + "auth", + "auth create", + "auth delete", + "auth list", + "auth update", + "auth whitelist" ] }, "autoload": { @@ -507,6 +514,7 @@ }, "files": [ "src/auth-utils.php", + "src/helper/hooks.php", "auth-command.php" ] }, @@ -514,22 +522,22 @@ "license": [ "MIT" ], - "description": "Configure HTTP auth for EasyEngine site.", + "description": "Configure HTTP Authentication and whitelisting for EasyEngine site", "homepage": "https://github.com/easyengine/auth-command", - "time": "2018-09-06T12:09:03+00:00" + "time": "2018-10-30T08:30:28+00:00" }, { "name": "easyengine/config-command", - "version": "v1.0.0-beta.1", + "version": "v1.0.0-rc.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/config-command.git", - "reference": "c4d66fb12875dd4c60e9b3a8dddfb1180301aef9" + "reference": "cd1f3423413414d6a46f3e89bbce910d16dc1ee6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/config-command/zipball/c4d66fb12875dd4c60e9b3a8dddfb1180301aef9", - "reference": "c4d66fb12875dd4c60e9b3a8dddfb1180301aef9", + "url": "https://api.github.com/repos/EasyEngine/config-command/zipball/cd1f3423413414d6a46f3e89bbce910d16dc1ee6", + "reference": "cd1f3423413414d6a46f3e89bbce910d16dc1ee6", "shasum": "" }, "type": "ee-cli-package", @@ -556,20 +564,20 @@ ], "description": "Manages EasyEngine configuration", "homepage": "https://github.com/easyengine/config-command", - "time": "2018-09-04T14:02:35+00:00" + "time": "2018-10-30T08:38:08+00:00" }, { "name": "easyengine/cron-command", - "version": "v1.0.0-beta.3", + "version": "v1.0.0-rc.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/cron-command.git", - "reference": "79b9f25dd21d5242a0b71d14c629c687f349af1f" + "reference": "cd31aafade5bc68e4f7c1041af9bba65a6f1083a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/cron-command/zipball/79b9f25dd21d5242a0b71d14c629c687f349af1f", - "reference": "79b9f25dd21d5242a0b71d14c629c687f349af1f", + "url": "https://api.github.com/repos/EasyEngine/cron-command/zipball/cd31aafade5bc68e4f7c1041af9bba65a6f1083a", + "reference": "cd31aafade5bc68e4f7c1041af9bba65a6f1083a", "shasum": "" }, "type": "ee-cli-package", @@ -590,7 +598,8 @@ "": "src/" }, "files": [ - "cron-command.php" + "cron-command.php", + "src/helper/hooks.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -599,20 +608,20 @@ ], "description": "Manages cron jobs in EasyEngine", "homepage": "https://github.com/easyengine/cron-command", - "time": "2018-09-06T12:09:27+00:00" + "time": "2018-10-30T08:44:54+00:00" }, { "name": "easyengine/mailhog-command", - "version": "v1.0.0-beta.1", + "version": "v1.0.0-rc.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/mailhog-command.git", - "reference": "39cd0661c97321ce40805fd86f3a826aa359037c" + "reference": "0761d7833b738da32d155d3e3ba7b67be3d51954" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/mailhog-command/zipball/39cd0661c97321ce40805fd86f3a826aa359037c", - "reference": "39cd0661c97321ce40805fd86f3a826aa359037c", + "url": "https://api.github.com/repos/EasyEngine/mailhog-command/zipball/0761d7833b738da32d155d3e3ba7b67be3d51954", + "reference": "0761d7833b738da32d155d3e3ba7b67be3d51954", "shasum": "" }, "type": "ee-cli-package", @@ -622,7 +631,10 @@ }, "bundled": true, "commands": [ - "mailhog" + "mailhog", + "mailhog enable", + "mailhog disable", + "mailhog status" ] }, "autoload": { @@ -637,22 +649,22 @@ "license": [ "MIT" ], - "description": "Commanad to enable disable mailhog for sites.", + "description": "Command to manage mailhog", "homepage": "https://github.com/easyengine/mailhog-command", - "time": "2018-09-06T12:09:41+00:00" + "time": "2018-10-30T08:46:52+00:00" }, { "name": "easyengine/service-command", - "version": "v1.0.0-beta.1", + "version": "v1.0.0-rc.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/service-command.git", - "reference": "dac1013e520f506280b91378c28c238d1aa7db53" + "reference": "745d82fce02e0a8f124566af6a86022e5b3dd5ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/dac1013e520f506280b91378c28c238d1aa7db53", - "reference": "dac1013e520f506280b91378c28c238d1aa7db53", + "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/745d82fce02e0a8f124566af6a86022e5b3dd5ba", + "reference": "745d82fce02e0a8f124566af6a86022e5b3dd5ba", "shasum": "" }, "type": "ee-cli-package", @@ -662,6 +674,7 @@ }, "bundled": true, "commands": [ + "service", "service start", "service stop", "service restart", @@ -673,6 +686,7 @@ "": "src/" }, "files": [ + "src/helper/service-utils.php", "service-command.php" ] }, @@ -682,20 +696,20 @@ ], "description": "Command to manager global containers/services in EasyEngine", "homepage": "https://github.com/easyengine/service-command", - "time": "2018-09-06T12:09:55+00:00" + "time": "2018-10-30T08:48:25+00:00" }, { "name": "easyengine/shell-command", - "version": "v1.0.0-beta.2", + "version": "v1.0.0-rc.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/shell-command.git", - "reference": "13674e596c6c4f8c6b787fd488922a5089b3dbda" + "reference": "98859d0e3002e2a65a82f53bc3771cc973886354" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/shell-command/zipball/13674e596c6c4f8c6b787fd488922a5089b3dbda", - "reference": "13674e596c6c4f8c6b787fd488922a5089b3dbda", + "url": "https://api.github.com/repos/EasyEngine/shell-command/zipball/98859d0e3002e2a65a82f53bc3771cc973886354", + "reference": "98859d0e3002e2a65a82f53bc3771cc973886354", "shasum": "" }, "type": "ee-cli-package", @@ -722,20 +736,20 @@ ], "description": "Shell to run helpful commands inside containers.", "homepage": "https://github.com/easyengine/shell-command", - "time": "2018-09-06T12:10:15+00:00" + "time": "2018-10-30T08:48:54+00:00" }, { "name": "easyengine/site-command", - "version": "v2.1.0", + "version": "v2.2.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "0ee669443650de346afcfbfc0aa6e9e358b00f01" + "reference": "793292a8679116b27a473626395dfeaa306cee58" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/0ee669443650de346afcfbfc0aa6e9e358b00f01", - "reference": "0ee669443650de346afcfbfc0aa6e9e358b00f01", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/793292a8679116b27a473626395dfeaa306cee58", + "reference": "793292a8679116b27a473626395dfeaa306cee58", "shasum": "" }, "require": { @@ -751,7 +765,19 @@ "branch-alias": { "dev-master": "1.x-dev" }, - "bundled": true + "bundled": true, + "commands": [ + "site create --type=html", + "site delete", + "site info --type=html", + "site enable", + "site disable", + "site info", + "site ssl", + "site list", + "site reload --type=html", + "site restart --type=html" + ] }, "autoload": { "psr-4": { @@ -769,20 +795,20 @@ "MIT" ], "homepage": "https://github.com/easyengine/site-command", - "time": "2018-09-06T12:10:30+00:00" + "time": "2018-10-30T12:22:15+00:00" }, { "name": "easyengine/site-type-php", - "version": "v1.0.0-beta.1", + "version": "v1.0.0-rc.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-php.git", - "reference": "a1b4154d2a53d83c19c7ad1ca17017119b401678" + "reference": "deb061ac8760a58bd4f5891a49bbe3e5132a8147" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/a1b4154d2a53d83c19c7ad1ca17017119b401678", - "reference": "a1b4154d2a53d83c19c7ad1ca17017119b401678", + "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/deb061ac8760a58bd4f5891a49bbe3e5132a8147", + "reference": "deb061ac8760a58bd4f5891a49bbe3e5132a8147", "shasum": "" }, "require-dev": { @@ -809,20 +835,20 @@ ], "description": "EasyEngine package for PHP site creation.", "homepage": "https://github.com/easyengine/site-type-php", - "time": "2018-09-10T14:58:43+00:00" + "time": "2018-10-30T10:39:27+00:00" }, { "name": "easyengine/site-type-wp", - "version": "v1.0.0-beta.2", + "version": "v1.0.0-rc.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-wp.git", - "reference": "d8f52b1bbf36d44b8917e7764da206b4c296720f" + "reference": "50f8ffc54467c54d50456740e437762a8e802225" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/d8f52b1bbf36d44b8917e7764da206b4c296720f", - "reference": "d8f52b1bbf36d44b8917e7764da206b4c296720f", + "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/50f8ffc54467c54d50456740e437762a8e802225", + "reference": "50f8ffc54467c54d50456740e437762a8e802225", "shasum": "" }, "require-dev": { @@ -833,7 +859,19 @@ "branch-alias": { "dev-master": "1.x-dev" }, - "bundled": true + "bundled": true, + "commands": [ + "site create --type=wp", + "site delete", + "site info --type=wp", + "site enable", + "site disable", + "site info", + "site ssl", + "site list", + "site reload --type=wp", + "site restart --type=wp" + ] }, "autoload": { "psr-4": { @@ -849,7 +887,7 @@ ], "description": "EasyEngine site type package for WordPress site creation.", "homepage": "https://github.com/easyengine/site-type-wp", - "time": "2018-09-06T12:10:58+00:00" + "time": "2018-10-30T10:38:57+00:00" }, { "name": "guzzlehttp/guzzle", @@ -1100,26 +1138,26 @@ }, { "name": "league/flysystem", - "version": "1.0.46", + "version": "1.0.48", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "f3e0d925c18b92cf3ce84ea5cc58d62a1762a2b2" + "reference": "a6ded5b2f6055e2db97b4b859fdfca2b952b78aa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/f3e0d925c18b92cf3ce84ea5cc58d62a1762a2b2", - "reference": "f3e0d925c18b92cf3ce84ea5cc58d62a1762a2b2", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/a6ded5b2f6055e2db97b4b859fdfca2b952b78aa", + "reference": "a6ded5b2f6055e2db97b4b859fdfca2b952b78aa", "shasum": "" }, "require": { + "ext-fileinfo": "*", "php": ">=5.5.9" }, "conflict": { "league/flysystem-sftp": "<1.0.6" }, "require-dev": { - "ext-fileinfo": "*", "phpspec/phpspec": "^3.4", "phpunit/phpunit": "^5.7.10" }, @@ -1180,7 +1218,7 @@ "sftp", "storage" ], - "time": "2018-08-22T07:45:22+00:00" + "time": "2018-10-15T13:53:10+00:00" }, { "name": "monolog/monolog", @@ -1596,16 +1634,16 @@ }, { "name": "symfony/config", - "version": "v3.4.15", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "7b08223b7f6abd859651c56bcabf900d1627d085" + "reference": "e5389132dc6320682de3643091121c048ff796b3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/7b08223b7f6abd859651c56bcabf900d1627d085", - "reference": "7b08223b7f6abd859651c56bcabf900d1627d085", + "url": "https://api.github.com/repos/symfony/config/zipball/e5389132dc6320682de3643091121c048ff796b3", + "reference": "e5389132dc6320682de3643091121c048ff796b3", "shasum": "" }, "require": { @@ -1656,20 +1694,20 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2018-07-26T11:19:56+00:00" + "time": "2018-09-08T13:15:14+00:00" }, { "name": "symfony/console", - "version": "v3.4.15", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "6b217594552b9323bcdcfc14f8a0ce126e84cd73" + "reference": "3b2b415d4c48fbefca7dc742aa0a0171bfae4e0b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/6b217594552b9323bcdcfc14f8a0ce126e84cd73", - "reference": "6b217594552b9323bcdcfc14f8a0ce126e84cd73", + "url": "https://api.github.com/repos/symfony/console/zipball/3b2b415d4c48fbefca7dc742aa0a0171bfae4e0b", + "reference": "3b2b415d4c48fbefca7dc742aa0a0171bfae4e0b", "shasum": "" }, "require": { @@ -1725,20 +1763,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-07-26T11:19:56+00:00" + "time": "2018-10-02T16:33:53+00:00" }, { "name": "symfony/debug", - "version": "v3.4.15", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "c4625e75341e4fb309ce0c049cbf7fb84b8897cd" + "reference": "0a612e9dfbd2ccce03eb174365f31ecdca930ff6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/c4625e75341e4fb309ce0c049cbf7fb84b8897cd", - "reference": "c4625e75341e4fb309ce0c049cbf7fb84b8897cd", + "url": "https://api.github.com/repos/symfony/debug/zipball/0a612e9dfbd2ccce03eb174365f31ecdca930ff6", + "reference": "0a612e9dfbd2ccce03eb174365f31ecdca930ff6", "shasum": "" }, "require": { @@ -1781,20 +1819,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2018-08-03T10:42:44+00:00" + "time": "2018-10-02T16:33:53+00:00" }, { "name": "symfony/dependency-injection", - "version": "v3.4.15", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "09d7df7bf06c1393b6afc85875993cbdbdf897a0" + "reference": "aea20fef4e92396928b5db175788b90234c0270d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/09d7df7bf06c1393b6afc85875993cbdbdf897a0", - "reference": "09d7df7bf06c1393b6afc85875993cbdbdf897a0", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/aea20fef4e92396928b5db175788b90234c0270d", + "reference": "aea20fef4e92396928b5db175788b90234c0270d", "shasum": "" }, "require": { @@ -1852,11 +1890,11 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2018-08-08T11:42:34+00:00" + "time": "2018-10-02T12:28:39+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v3.4.15", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", @@ -1919,16 +1957,16 @@ }, { "name": "symfony/filesystem", - "version": "v3.4.15", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "285ce5005cb01a0aeaa5b0cf590bd0cc40bb631c" + "reference": "d69930fc337d767607267d57c20a7403d0a822a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/285ce5005cb01a0aeaa5b0cf590bd0cc40bb631c", - "reference": "285ce5005cb01a0aeaa5b0cf590bd0cc40bb631c", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/d69930fc337d767607267d57c20a7403d0a822a4", + "reference": "d69930fc337d767607267d57c20a7403d0a822a4", "shasum": "" }, "require": { @@ -1965,20 +2003,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2018-08-10T07:29:05+00:00" + "time": "2018-10-02T12:28:39+00:00" }, { "name": "symfony/finder", - "version": "v3.4.15", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "8a84fcb207451df0013b2c74cbbf1b62d47b999a" + "reference": "54ba444dddc5bd5708a34bd095ea67c6eb54644d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/8a84fcb207451df0013b2c74cbbf1b62d47b999a", - "reference": "8a84fcb207451df0013b2c74cbbf1b62d47b999a", + "url": "https://api.github.com/repos/symfony/finder/zipball/54ba444dddc5bd5708a34bd095ea67c6eb54644d", + "reference": "54ba444dddc5bd5708a34bd095ea67c6eb54644d", "shasum": "" }, "require": { @@ -2014,7 +2052,7 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2018-07-26T11:19:56+00:00" + "time": "2018-10-03T08:46:40+00:00" }, { "name": "symfony/polyfill-ctype", @@ -2135,16 +2173,16 @@ }, { "name": "symfony/process", - "version": "v3.4.15", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "4d6b125d5293cbceedc2aa10f2c71617e76262e7" + "reference": "1dc2977afa7d70f90f3fefbcd84152813558910e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/4d6b125d5293cbceedc2aa10f2c71617e76262e7", - "reference": "4d6b125d5293cbceedc2aa10f2c71617e76262e7", + "url": "https://api.github.com/repos/symfony/process/zipball/1dc2977afa7d70f90f3fefbcd84152813558910e", + "reference": "1dc2977afa7d70f90f3fefbcd84152813558910e", "shasum": "" }, "require": { @@ -2180,20 +2218,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2018-08-03T10:42:44+00:00" + "time": "2018-10-02T12:28:39+00:00" }, { "name": "symfony/serializer", - "version": "v3.4.15", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/serializer.git", - "reference": "40031683816470610af87c2d03ea86d1cf0f0104" + "reference": "8bc00ef47a428bfebc4641f29d158e7c56137fcb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/serializer/zipball/40031683816470610af87c2d03ea86d1cf0f0104", - "reference": "40031683816470610af87c2d03ea86d1cf0f0104", + "url": "https://api.github.com/repos/symfony/serializer/zipball/8bc00ef47a428bfebc4641f29d158e7c56137fcb", + "reference": "8bc00ef47a428bfebc4641f29d158e7c56137fcb", "shasum": "" }, "require": { @@ -2259,20 +2297,20 @@ ], "description": "Symfony Serializer Component", "homepage": "https://symfony.com", - "time": "2018-07-26T11:58:24+00:00" + "time": "2018-10-02T12:28:39+00:00" }, { "name": "symfony/translation", - "version": "v3.4.15", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "9749930bfc825139aadd2d28461ddbaed6577862" + "reference": "94bc3a79008e6640defedf5e14eb3b4f20048352" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/9749930bfc825139aadd2d28461ddbaed6577862", - "reference": "9749930bfc825139aadd2d28461ddbaed6577862", + "url": "https://api.github.com/repos/symfony/translation/zipball/94bc3a79008e6640defedf5e14eb3b4f20048352", + "reference": "94bc3a79008e6640defedf5e14eb3b4f20048352", "shasum": "" }, "require": { @@ -2327,20 +2365,20 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2018-07-26T11:19:56+00:00" + "time": "2018-10-02T16:33:53+00:00" }, { "name": "symfony/yaml", - "version": "v3.4.15", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "c2f4812ead9f847cb69e90917ca7502e6892d6b8" + "reference": "640b6c27fed4066d64b64d5903a86043f4a4de7f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/c2f4812ead9f847cb69e90917ca7502e6892d6b8", - "reference": "c2f4812ead9f847cb69e90917ca7502e6892d6b8", + "url": "https://api.github.com/repos/symfony/yaml/zipball/640b6c27fed4066d64b64d5903a86043f4a4de7f", + "reference": "640b6c27fed4066d64b64d5903a86043f4a4de7f", "shasum": "" }, "require": { @@ -2386,7 +2424,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2018-08-10T07:34:36+00:00" + "time": "2018-10-02T16:33:53+00:00" }, { "name": "webmozart/assert", @@ -2927,21 +2965,24 @@ }, { "name": "phpunit/php-file-iterator", - "version": "2.0.1", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "cecbc684605bb0cc288828eb5d65d93d5c676d3c" + "reference": "050bedf145a257b1ff02746c31894800e5122946" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cecbc684605bb0cc288828eb5d65d93d5c676d3c", - "reference": "cecbc684605bb0cc288828eb5d65d93d5c676d3c", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/050bedf145a257b1ff02746c31894800e5122946", + "reference": "050bedf145a257b1ff02746c31894800e5122946", "shasum": "" }, "require": { "php": "^7.1" }, + "require-dev": { + "phpunit/phpunit": "^7.1" + }, "type": "library", "extra": { "branch-alias": { @@ -2970,7 +3011,7 @@ "filesystem", "iterator" ], - "time": "2018-06-11T11:44:00+00:00" + "time": "2018-09-13T20:33:42+00:00" }, { "name": "phpunit/php-text-template", @@ -3241,21 +3282,23 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "0abc14e0df387fe74b4b32e0b8647d1639256d38" + "reference": "0d96c6cd7cee8572be836fca71f9f01c8b1c0cb2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/0abc14e0df387fe74b4b32e0b8647d1639256d38", - "reference": "0abc14e0df387fe74b4b32e0b8647d1639256d38", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/0d96c6cd7cee8572be836fca71f9f01c8b1c0cb2", + "reference": "0d96c6cd7cee8572be836fca71f9f01c8b1c0cb2", "shasum": "" }, "conflict": { "3f/pygmentize": "<1.2", "adodb/adodb-php": "<5.20.12", + "alterphp/easyadmin-extension-bundle": ">=1.2,<1.2.11|>=1.3,<1.3.1", "amphp/artax": "<1.0.6|>=2,<2.0.6", "amphp/http": "<1.0.1", "asymmetricrypt/asymmetricrypt": ">=0,<9.9.99", "aws/aws-sdk-php": ">=3,<3.2.1", + "brightlocal/phpwhois": "<=4.2.5", "bugsnag/bugsnag-laravel": ">=2,<2.0.2", "cakephp/cakephp": ">=1.3,<1.3.18|>=2,<2.4.99|>=2.5,<2.5.99|>=2.6,<2.6.12|>=2.7,<2.7.6|>=3,<3.0.15|>=3.1,<3.1.4|>=3.4,<3.4.14|>=3.5,<3.5.17|>=3.6,<3.6.4", "cart2quote/module-quotation": ">=4.1.6,<=4.4.5|>=5,<5.4.4", @@ -3267,6 +3310,7 @@ "contao/core-bundle": ">=4,<4.4.18|>=4.5,<4.5.8", "contao/listing-bundle": ">=4,<4.4.8", "contao/newsletter-bundle": ">=4,<4.1", + "david-garcia/phpwhois": "<=4.3.1", "doctrine/annotations": ">=1,<1.2.7", "doctrine/cache": ">=1,<1.3.2|>=1.4,<1.4.2", "doctrine/common": ">=2,<2.4.3|>=2.5,<2.5.1", @@ -3277,11 +3321,14 @@ "doctrine/mongodb-odm-bundle": ">=2,<3.0.1", "doctrine/orm": ">=2,<2.4.8|>=2.5,<2.5.1", "dompdf/dompdf": ">=0.6,<0.6.2", - "drupal/core": ">=7,<7.59|>=8,<8.4.8|>=8.5,<8.5.3", - "drupal/drupal": ">=7,<7.59|>=8,<8.4.8|>=8.5,<8.5.3", + "drupal/core": ">=7,<7.60|>=8,<8.5.8|>=8.6,<8.6.2", + "drupal/drupal": ">=7,<7.60|>=8,<8.5.8|>=8.6,<8.6.2", "erusev/parsedown": "<1.7", "ezsystems/ezpublish-legacy": ">=5.3,<5.3.12.3|>=5.4,<5.4.11.3|>=2017.8,<2017.8.1.1|>=2017.12,<2017.12.2.1", + "ezyang/htmlpurifier": "<4.1.1", "firebase/php-jwt": "<2", + "fooman/tcpdf": "<6.2.22", + "fossar/tcpdf-parser": "<6.2.22", "friendsofsymfony/rest-bundle": ">=1.2,<1.2.2", "friendsofsymfony/user-bundle": ">=1.2,<1.3.5", "fuel/core": "<1.8.1", @@ -3292,16 +3339,22 @@ "illuminate/cookie": ">=4,<=4.0.11|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.42|>=5.6,<5.6.30", "illuminate/database": ">=4,<4.0.99|>=4.1,<4.1.29", "illuminate/encryption": ">=4,<=4.0.11|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.40|>=5.6,<5.6.15", + "ivankristianto/phpwhois": "<=4.3", + "james-heinrich/getid3": "<1.9.9", "joomla/session": "<1.3.1", + "jsmitty12/phpwhois": "<5.1", + "kazist/phpwhois": "<=4.2.6", "kreait/firebase-php": ">=3.2,<3.8.1", + "la-haute-societe/tcpdf": "<6.2.22", "laravel/framework": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.42|>=5.6,<5.6.30", "laravel/socialite": ">=1,<1.0.99|>=2,<2.0.10", "magento/magento1ce": "<1.9.3.9", "magento/magento1ee": ">=1.9,<1.14.3.2", - "magento/product-community-edition": ">=2,<2.2.5", + "magento/product-community-edition": ">=2,<2.2.6", "monolog/monolog": ">=1.8,<1.12", "namshi/jose": "<2.2", "onelogin/php-saml": "<2.10.4", + "openid/php-openid": "<2.3", "oro/crm": ">=1.7,<1.7.4", "oro/platform": ">=1.7,<1.7.4", "padraic/humbug_get_contents": "<1.1.2", @@ -3310,22 +3363,28 @@ "paypal/merchant-sdk-php": "<3.12", "phpmailer/phpmailer": ">=5,<5.2.24", "phpunit/phpunit": ">=4.8.19,<4.8.28|>=5.0.10,<5.6.3", + "phpwhois/phpwhois": "<=4.2.5", "phpxmlrpc/extras": "<0.6.1", "propel/propel": ">=2.0.0-alpha1,<=2.0.0-alpha7", "propel/propel1": ">=1,<=1.7.1", "pusher/pusher-php-server": "<2.2.1", + "robrichards/xmlseclibs": ">=1,<3.0.2", "sabre/dav": ">=1.6,<1.6.99|>=1.7,<1.7.11|>=1.8,<1.8.9", "sensiolabs/connect": "<4.2.3", + "serluck/phpwhois": "<=4.2.6", "shopware/shopware": "<5.3.7", "silverstripe/cms": ">=3,<=3.0.11|>=3.1,<3.1.11", "silverstripe/forum": "<=0.6.1|>=0.7,<=0.7.3", "silverstripe/framework": ">=3,<3.3", "silverstripe/userforms": "<3", + "simple-updates/phpwhois": "<=1", "simplesamlphp/saml2": "<1.10.6|>=2,<2.3.8|>=3,<3.1.4", "simplesamlphp/simplesamlphp": "<1.15.2", "simplesamlphp/simplesamlphp-module-infocard": "<1.0.1", "slim/slim": "<2.6", + "smarty/smarty": "<3.1.33", "socalnick/scn-social-auth": "<1.15.2", + "spoonity/tcpdf": "<6.2.22", "squizlabs/php_codesniffer": ">=1,<2.8.1|>=3,<3.0.1", "stormpath/sdk": ">=0,<9.9.99", "swiftmailer/swiftmailer": ">=4,<5.4.5", @@ -3350,14 +3409,18 @@ "symfony/validator": ">=2,<2.0.24|>=2.1,<2.1.12|>=2.2,<2.2.5|>=2.3,<2.3.3", "symfony/web-profiler-bundle": ">=2,<2.3.19|>=2.4,<2.4.9|>=2.5,<2.5.4", "symfony/yaml": ">=2,<2.0.22|>=2.1,<2.1.7", + "tecnickcom/tcpdf": "<6.2.22", "thelia/backoffice-default-template": ">=2.1,<2.1.2", "thelia/thelia": ">=2.1,<2.1.2|>=2.1.0-beta1,<2.1.3", + "theonedemon/phpwhois": "<=4.2.5", "titon/framework": ">=0,<9.9.99", + "truckersmp/phpwhois": "<=4.3.1", "twig/twig": "<1.20", "typo3/cms": ">=6.2,<6.2.30|>=7,<7.6.30|>=8,<8.7.17|>=9,<9.3.2", "typo3/cms-core": ">=8,<8.7.17|>=9,<9.3.2", "typo3/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.10|>=3.1,<3.1.7|>=3.2,<3.2.7|>=3.3,<3.3.5", "typo3/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4", + "wallabag/tcpdf": "<6.2.22", "willdurand/js-translation-bundle": "<2.1.1", "yiisoft/yii": ">=1.1.14,<1.1.15", "yiisoft/yii2": "<2.0.15", @@ -3405,20 +3468,20 @@ } ], "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", - "time": "2018-08-14T15:39:17+00:00" + "time": "2018-10-21T18:01:48+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.3.1", + "version": "3.3.2", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "628a481780561150481a9ec74709092b9759b3ec" + "reference": "6ad28354c04b364c3c71a34e4a18b629cc3b231e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/628a481780561150481a9ec74709092b9759b3ec", - "reference": "628a481780561150481a9ec74709092b9759b3ec", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/6ad28354c04b364c3c71a34e4a18b629cc3b231e", + "reference": "6ad28354c04b364c3c71a34e4a18b629cc3b231e", "shasum": "" }, "require": { @@ -3456,20 +3519,20 @@ "phpcs", "standards" ], - "time": "2018-07-26T23:47:18+00:00" + "time": "2018-09-23T23:08:17+00:00" }, { "name": "symfony/class-loader", - "version": "v3.4.15", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/class-loader.git", - "reference": "31db283fc86d3143e7ff87e922177b457d909c30" + "reference": "f31333bdff54c7595f834d510a6d2325573ddb36" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/class-loader/zipball/31db283fc86d3143e7ff87e922177b457d909c30", - "reference": "31db283fc86d3143e7ff87e922177b457d909c30", + "url": "https://api.github.com/repos/symfony/class-loader/zipball/f31333bdff54c7595f834d510a6d2325573ddb36", + "reference": "f31333bdff54c7595f834d510a6d2325573ddb36", "shasum": "" }, "require": { @@ -3512,7 +3575,7 @@ ], "description": "Symfony ClassLoader Component", "homepage": "https://symfony.com", - "time": "2018-07-26T11:19:56+00:00" + "time": "2018-10-02T12:28:39+00:00" }, { "name": "wimg/php-compatibility", diff --git a/img-versions.json b/img-versions.json index ad075590b..eb85f0a31 100644 --- a/img-versions.json +++ b/img-versions.json @@ -1,11 +1,11 @@ { - "easyengine/cron": "v4.0.0-beta.5", - "easyengine/mailhog": "v4.0.0-beta.5", - "easyengine/mariadb": "v4.0.0-beta.5", - "easyengine/nginx-proxy": "v4.0.0-beta.6", - "easyengine/nginx": "v4.0.0-beta.5", - "easyengine/php": "v4.0.0-beta.6", - "easyengine/phpmyadmin": "v4.0.0-beta.5", - "easyengine/postfix": "v4.0.0-beta.5", - "easyengine/redis": "v4.0.0-beta.5" + "easyengine/cron": "v4.0.0-rc.1", + "easyengine/mailhog": "v4.0.0-rc.1", + "easyengine/mariadb": "v4.0.0-rc.1", + "easyengine/nginx-proxy": "v4.0.0-rc.1", + "easyengine/nginx": "v4.0.0-rc.1", + "easyengine/php": "v4.0.0-rc.1", + "easyengine/phpmyadmin": "v4.0.0-rc.1", + "easyengine/postfix": "v4.0.0-rc.1", + "easyengine/redis": "v4.0.0-rc.1" } From 05fad870b74694bfb663a83a747d5482c455d47d Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Fri, 2 Nov 2018 18:40:06 +0530 Subject: [PATCH 0532/1044] Add frequently required checks and variables Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Migration/Base.php | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/php/EE/Migration/Base.php b/php/EE/Migration/Base.php index a8f6f4e78..ae5c53f79 100644 --- a/php/EE/Migration/Base.php +++ b/php/EE/Migration/Base.php @@ -2,10 +2,26 @@ namespace EE\Migration; +use Symfony\Component\Filesystem\Filesystem; + abstract class Base { - public $status = 'incomplete'; + public $status = 'incomplete'; + protected $is_first_execution; + protected $skip_this_migration; + protected $backup_dir; + protected $backup_file; + protected $fs; + + public function __construct() { + $this->fs = new Filesystem(); + $this->skip_this_migration = false; + $this->is_first_execution = ! \EE\Model\Option::get( 'version' ); + $this->backup_dir = EE_ROOT_DIR . '/.backup'; + $this->fs->mkdir( $this->backup_dir ); + } + + abstract public function up(); - abstract public function up(); - abstract public function down(); -} \ No newline at end of file + abstract public function down(); +} From 4de76876c879e867d9ad02d406ee139485d7c1f5 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 5 Nov 2018 19:04:59 +0530 Subject: [PATCH 0533/1044] Fix getting site-type object Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Migration/SiteContainers.php | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/php/EE/Migration/SiteContainers.php b/php/EE/Migration/SiteContainers.php index 6ae391f6e..7d054cf2d 100644 --- a/php/EE/Migration/SiteContainers.php +++ b/php/EE/Migration/SiteContainers.php @@ -116,21 +116,15 @@ public static function disable_site( $site_info, $site_object ) { /** * Get object of supported site type. * - * @param $site_type string type of site. + * @param string $site_type type of site. * * @return EE\Site\Type\HTML|EE\Site\Type\PHP|EE\Site\Type\WordPress */ public static function get_site_object( $site_type ) { - switch ( $site_type ) { - case 'html': - return new EE\Site\Type\HTML(); + $site_command = new \Site_Command(); + $site_class = $site_command::get_site_types()[ $site_type ]; - case 'php': - return new EE\Site\Type\PHP(); - - case 'wp': - return new EE\Site\Type\WordPress(); - } + return new $site_class; } /** From f62e2c8596671eb5a9819aa387ea1e3c4821c0b8 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 5 Nov 2018 20:14:54 +0530 Subject: [PATCH 0534/1044] Fix generation of docker-compose yml Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Migration/SiteContainers.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/php/EE/Migration/SiteContainers.php b/php/EE/Migration/SiteContainers.php index 7d054cf2d..da9599bd5 100644 --- a/php/EE/Migration/SiteContainers.php +++ b/php/EE/Migration/SiteContainers.php @@ -76,16 +76,13 @@ public static function is_site_service_image_changed( $updated_images, $site_inf /** * Generate docker-compose.yml for specific site. * - * @param $site_info array of site information. + * @param array $site_info of site information. + * @param object $site_obj Object of the particular site-type. */ - public static function generate_site_docker_compose_file( $site_info ) { + public static function generate_site_docker_compose_file( $site_info, $site_obj ) { + $site_obj->populate_site_info( $site_info['site_url'] ); EE::debug( "Start generating news docker-compose.yml for ${site_info['site_url']}" ); - $site_docker = self::get_site_docker_object( $site_info['site_type'] ); - $filters = self::get_site_filters( $site_info ); - $docker_yml_content = $site_docker->generate_docker_compose_yml( $filters ); - - $fs = new Filesystem(); - $fs->dumpFile( $site_info['site_fs_path'] . '/docker-compose.yml', $docker_yml_content ); + $site_obj->dump_docker_compose_yml( [ 'nohttps' => $site_info['site_ssl'] ] ); EE::debug( "Complete generating news docker-compose.yml for ${site_info['site_url']}" ); } From 40cc4dcc9d4cf2d195871712f07a8eda303bda66 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 5 Nov 2018 20:18:26 +0530 Subject: [PATCH 0535/1044] Remove unncessary functions Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Migration/SiteContainers.php | 72 ----------------------------- 1 file changed, 72 deletions(-) diff --git a/php/EE/Migration/SiteContainers.php b/php/EE/Migration/SiteContainers.php index da9599bd5..408a97877 100644 --- a/php/EE/Migration/SiteContainers.php +++ b/php/EE/Migration/SiteContainers.php @@ -109,76 +109,4 @@ public static function disable_site( $site_info, $site_object ) { $site_object->disable( [ $site_info['site_url'] ], [] ); EE::debug( "Complete disabling ${site_info['site_url']}" ); } - - /** - * Get object of supported site type. - * - * @param string $site_type type of site. - * - * @return EE\Site\Type\HTML|EE\Site\Type\PHP|EE\Site\Type\WordPress - */ - public static function get_site_object( $site_type ) { - $site_command = new \Site_Command(); - $site_class = $site_command::get_site_types()[ $site_type ]; - - return new $site_class; - } - - /** - * Get site type specific filters. - * - * @param $site array of site information. - * - * @return array - */ - public static function get_site_filters( $site ) { - $filters = []; - - switch ( $site['site_type'] ) { - case 'html': - $filters[] = $site['site_type']; - - break; - - case 'php': - $filters[] = $site['cache_host']; - if ( 'mysql' === $site['app_sub_type'] ) { - $filters[] = $site['db_host']; - } - - break; - - case 'wp': - $filters[] = $site['app_sub_type']; - $filters[] = $site['cache_host']; - $filters[] = $site['db_host']; - - break; - } - - $filters['nohttps'] = $site['site_ssl'] ? false : true; - - return $filters; - } - - /** - * get site docker object of specific site type. - * - * @param $site_type string type of site. - * - * @return EE\Site\Type\Site_HTML_Docker|EE\Site\Type\Site_PHP_Docker|EE\Site\Type\Site_WP_Docker - */ - public static function get_site_docker_object( $site_type ) { - - switch ( $site_type ) { - case 'html': - return new EE\Site\Type\Site_HTML_Docker(); - - case 'php': - return new EE\Site\Type\Site_PHP_Docker(); - - case 'wp': - return new EE\Site\Type\Site_WP_Docker(); - } - } } From 451f196339401dfc0a5ad2a87bd105e262af7d2b Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 5 Nov 2018 20:19:40 +0530 Subject: [PATCH 0536/1044] Update params passed to docker-compose generation Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Migration/Containers.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index c3d671578..f788633da 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -231,7 +231,7 @@ public static function migrate_site_containers( $updated_images ) { "generate-${site['site_url']}-docker-compose", 'EE\Migration\SiteContainers::generate_site_docker_compose_file', null, - [ $site ], + [ $site, $ee_site_object ], null ); From c6eeee469ac123fbc7ef96ee547643234d8600ac Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 5 Nov 2018 20:34:09 +0530 Subject: [PATCH 0537/1044] Add exception handling and proper reverting for enable Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Migration/SiteContainers.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/php/EE/Migration/SiteContainers.php b/php/EE/Migration/SiteContainers.php index 408a97877..b610daa0e 100644 --- a/php/EE/Migration/SiteContainers.php +++ b/php/EE/Migration/SiteContainers.php @@ -89,12 +89,18 @@ public static function generate_site_docker_compose_file( $site_info, $site_obj /** * Enable site. * - * @param $site_info array of site information. - * @param $site_object object of site-type( HTML, PHP, Wordpress ). + * @param array $site_info of site information. + * @param object $site_object of site-type( HTML, PHP, WordPress ). + * + * @throws \Exception */ public static function enable_site( $site_info, $site_object ) { EE::debug( "Start enabling ${site_info['site_url']}" ); - $site_object->enable( [ $site_info['site_url'] ], [] ); + try { + $site_object->enable( [ $site_info['site_url'] ], [], false ); + } catch ( \Exception $e ) { + throw new \Exception( $e->getMessage() ); + } EE::debug( "Complete enabling ${site_info['site_url']}" ); } From 265e30e01ecd1478ae16eb60b837cd2187a70ad4 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 6 Nov 2018 13:17:53 +0530 Subject: [PATCH 0538/1044] Restore getting site-type object Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Migration/SiteContainers.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/php/EE/Migration/SiteContainers.php b/php/EE/Migration/SiteContainers.php index b610daa0e..d264afc27 100644 --- a/php/EE/Migration/SiteContainers.php +++ b/php/EE/Migration/SiteContainers.php @@ -10,6 +10,20 @@ */ class SiteContainers { + /** + * Get object of supported site type. + * + * @param string $site_type type of site. + * + * @return EE\Site\Type\HTML|EE\Site\Type\PHP|EE\Site\Type\WordPress + */ + public static function get_site_object( $site_type ) { + $site_command = new \Site_Command(); + $site_class = $site_command::get_site_types()[ $site_type ]; + + return new $site_class; + } + /** * Take backup of site's docker-compose.yml file * From 30618e1503776822b115094c12576c24656132bf Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 6 Nov 2018 13:21:06 +0530 Subject: [PATCH 0539/1044] Add revertible steps for volume creation and deletion Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Migration/SiteContainers.php | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/php/EE/Migration/SiteContainers.php b/php/EE/Migration/SiteContainers.php index d264afc27..9bb51fea6 100644 --- a/php/EE/Migration/SiteContainers.php +++ b/php/EE/Migration/SiteContainers.php @@ -129,4 +129,34 @@ public static function disable_site( $site_info, $site_object ) { $site_object->disable( [ $site_info['site_url'] ], [] ); EE::debug( "Complete disabling ${site_info['site_url']}" ); } + + /** + * Function to delete given volume. + * + * @param string $volume_name Name of the volume to be deleted. + * @param string $symlink_path Corresponding symlink to be removed. + */ + public static function delete_volume( $volume_name, $symlink_path ) { + $fs = new Filesystem(); + \EE::exec( 'docker volume rm ' . $volume_name ); + $fs->remove( $symlink_path ); + } + + /** + * Function to create given volume. + * + * @param string|array $site Name of the site or array of site having site_url. + * @param string $volume_name Name of the volume to be created. + * @param string $symlink_path Corresponding symlink to be created. + */ + public static function create_volume( $site, $volume_name, $symlink_path ) { + $site_url = is_array( $site ) ? $site['site_url'] : $site; + $volumes = [ + [ + 'name' => $volume_name, + 'path_to_symlink' => $symlink_path, + ], + ]; + \EE::docker()->create_volumes( $site_url, $volumes ); + } } From 860fd8ac863e8a4d712d85b7295932a103c7ff1a Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 6 Nov 2018 13:23:31 +0530 Subject: [PATCH 0540/1044] Add backup and restore revertible steps Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Migration/SiteContainers.php | 37 +++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/php/EE/Migration/SiteContainers.php b/php/EE/Migration/SiteContainers.php index 9bb51fea6..33dcbcdc8 100644 --- a/php/EE/Migration/SiteContainers.php +++ b/php/EE/Migration/SiteContainers.php @@ -159,4 +159,41 @@ public static function create_volume( $site, $volume_name, $symlink_path ) { ]; \EE::docker()->create_volumes( $site_url, $volumes ); } + + /** + * Function to backup given file or directory. + * + * @param Path to the file/directory in need of backup. + */ + public static function backup_files( $path ) { + $fs = new Filesystem(); + $backup_dir = EE_ROOT_DIR . '/.backup'; + + $dest = $backup_dir . '/' . basename( $path ); + EE::debug( "Backing up file: $path to $dest" ); + $fs->remove( $dest ); + if ( is_file( $path ) ) { + $fs->copy( $path, $dest ); + } else { + $fs->mirror( $path, $dest ); + } + } + + /** + * Function to restore file/directory from backup source. + * + * @param string $destination + * @param string $source + */ + public static function restore_files( $destination, $source = '' ) { + $fs = new Filesystem(); + $backup_dir = EE_ROOT_DIR . '/.backup'; + $source = empty( $source ) ? $backup_dir . '/' . basename( $destination ) : $source; + EE::debug( "Restoring files from: $source to $destination" ); + if ( is_file( $source ) ) { + $fs->copy( $source, $destination ); + } else { + $fs->mirror( $source, $destination ); + } + } } From 3fd7a05aa3e17b5d6b06e30de16cde65cfd06cbc Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 6 Nov 2018 16:10:11 +0530 Subject: [PATCH 0541/1044] Update variable names and phpcs fixes Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Migration/SiteContainers.php | 61 ++++++++++------------------- 1 file changed, 21 insertions(+), 40 deletions(-) diff --git a/php/EE/Migration/SiteContainers.php b/php/EE/Migration/SiteContainers.php index 33dcbcdc8..974bf95e4 100644 --- a/php/EE/Migration/SiteContainers.php +++ b/php/EE/Migration/SiteContainers.php @@ -21,42 +21,42 @@ public static function get_site_object( $site_type ) { $site_command = new \Site_Command(); $site_class = $site_command::get_site_types()[ $site_type ]; - return new $site_class; + return new $site_class(); } /** * Take backup of site's docker-compose.yml file * - * @param $source_path string path of docker-compose.yml - * @param $dest_path string backup path for docker-compose.yml + * @param string $source_path path of docker-compose.yml. + * @param string $destination_path backup path for docker-compose.yml. * - * @throws \Exception + * @throws \Exception. */ - public static function backup_site_docker_compose_file( $source_path, $dest_path ) { + public static function backup_site_docker_compose_file( $source_path, $destination_path ) { EE::debug( 'Start backing up site\'s docker-compose.yml' ); $fs = new Filesystem(); if ( ! $fs->exists( $source_path ) ) { throw new \Exception( ' site\'s docker-compose.yml does not exist' ); } - $fs->copy( $source_path, $dest_path, true ); + $fs->copy( $source_path, $destination_path, true ); EE::debug( 'Complete backing up site\'s docker-compose.yml' ); } /** * Revert docker-compose.yml file from backup. * - * @param $source_path string path of backed up docker-compose.yml - * @param $dest_path string original path of docker-compose.yml + * @param string $source_path path of backed up docker-compose.yml. + * @param string $destination_path original path of docker-compose.yml. * * @throws \Exception */ - public static function revert_site_docker_compose_file( $source_path, $dest_path ) { + public static function revert_site_docker_compose_file( $source_path, $destination_path ) { EE::debug( 'Start restoring site\'s docker-compose.yml' ); $fs = new Filesystem(); if ( ! $fs->exists( $source_path ) ) { throw new \Exception( ' site\'s docker-compose.yml.backup does not exist' ); } - $fs->copy( $source_path, $dest_path, true ); + $fs->copy( $source_path, $destination_path, true ); $fs->remove( $source_path ); EE::debug( 'Complete restoring site\'s docker-compose.yml' ); } @@ -64,8 +64,8 @@ public static function revert_site_docker_compose_file( $source_path, $dest_path /** * Check if new image is available for site's services. * - * @param $updated_images array of updated images. - * @param $site_info array of site info + * @param array $updated_images array of updated images. + * @param array $site_info array of site info. * * @return bool */ @@ -90,21 +90,21 @@ public static function is_site_service_image_changed( $updated_images, $site_inf /** * Generate docker-compose.yml for specific site. * - * @param array $site_info of site information. - * @param object $site_obj Object of the particular site-type. + * @param array $site_info array of site information. + * @param object $site_object Object of the particular site-type. */ - public static function generate_site_docker_compose_file( $site_info, $site_obj ) { - $site_obj->populate_site_info( $site_info['site_url'] ); + public static function generate_site_docker_compose_file( $site_info, $site_object ) { + $site_object->populate_site_info( $site_info['site_url'] ); EE::debug( "Start generating news docker-compose.yml for ${site_info['site_url']}" ); - $site_obj->dump_docker_compose_yml( [ 'nohttps' => $site_info['site_ssl'] ] ); + $site_object->dump_docker_compose_yml( [ 'nohttps' => $site_info['site_ssl'] ] ); EE::debug( "Complete generating news docker-compose.yml for ${site_info['site_url']}" ); } /** * Enable site. * - * @param array $site_info of site information. - * @param object $site_object of site-type( HTML, PHP, WordPress ). + * @param array $site_info array of site information. + * @param object $site_object object of site-type( HTML, PHP, WordPress ). * * @throws \Exception */ @@ -121,8 +121,8 @@ public static function enable_site( $site_info, $site_object ) { /** * Disable site. * - * @param $site_info array of site information. - * @param $site_object object of site-type( HTML, PHP, Wordpress ). + * @param array $site_info array of site information. + * @param object $site_object object of site-type( HTML, PHP, Wordpress ). */ public static function disable_site( $site_info, $site_object ) { EE::debug( "Start disabling ${site_info['site_url']}" ); @@ -160,25 +160,6 @@ public static function create_volume( $site, $volume_name, $symlink_path ) { \EE::docker()->create_volumes( $site_url, $volumes ); } - /** - * Function to backup given file or directory. - * - * @param Path to the file/directory in need of backup. - */ - public static function backup_files( $path ) { - $fs = new Filesystem(); - $backup_dir = EE_ROOT_DIR . '/.backup'; - - $dest = $backup_dir . '/' . basename( $path ); - EE::debug( "Backing up file: $path to $dest" ); - $fs->remove( $dest ); - if ( is_file( $path ) ) { - $fs->copy( $path, $dest ); - } else { - $fs->mirror( $path, $dest ); - } - } - /** * Function to restore file/directory from backup source. * From 3a6741c588b80c4d3ab0af5634f3d241d0e43f3b Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 6 Nov 2018 18:12:41 +0530 Subject: [PATCH 0542/1044] Add constant for backup directory Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/init-ee.php | 1 + 1 file changed, 1 insertion(+) diff --git a/php/init-ee.php b/php/init-ee.php index 4bdecb0f2..53dbd6ef1 100644 --- a/php/init-ee.php +++ b/php/init-ee.php @@ -5,6 +5,7 @@ define( 'EE_VERSION', trim( file_get_contents( EE_ROOT . '/VERSION' ) ) ); define( 'EE_START_MICROTIME', microtime( true ) ); define( 'EE_ROOT_DIR', '/opt/easyengine' ); +define( 'EE_BACKUP_DIR', '/opt/easyengine/.backup' ); define( 'EE_PROXY_TYPE', 'ee-global-nginx-proxy' ); if ( file_exists( EE_ROOT . '/vendor/autoload.php' ) ) { From af1faf17e6d4c33a71ed033d2df90adaf6ad2c94 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 6 Nov 2018 18:14:13 +0530 Subject: [PATCH 0543/1044] Update backup and restore of files Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Migration/Containers.php | 12 ++++++------ php/EE/Migration/SiteContainers.php | 24 ++++++++++++++---------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index f788633da..d6362f188 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -119,9 +119,9 @@ private static function pull_or_error( $image, $version ) { */ private static function get_current_docker_images_versions() { $images = EE::db() - ->table( 'options' ) - ->where( 'key', 'like', 'easyengine/%' ) - ->all(); + ->table( 'options' ) + ->where( 'key', 'like', 'easyengine/%' ) + ->all(); $images = array_map( function ( $image ) { return [ $image['key'] => $image['value'] ]; @@ -201,7 +201,7 @@ public static function migrate_site_containers( $updated_images ) { foreach ( $sites as $site ) { $docker_yml = $site['site_fs_path'] . '/docker-compose.yml'; - $docker_yml_backup = $site['site_fs_path'] . '/docker-compose.yml.backup'; + $docker_yml_backup = EE_BACKUP_DIR . '/' . $site['site_url'] . '/docker-compose.yml.backup'; if ( ! SiteContainers::is_site_service_image_changed( $updated_images, $site ) ) { continue; @@ -221,8 +221,8 @@ public static function migrate_site_containers( $updated_images ) { self::$rsp->add_step( "take-${site['site_url']}-docker-compose-backup", - 'EE\Migration\SiteContainers::backup_site_docker_compose_file', - 'EE\Migration\SiteContainers::revert_site_docker_compose_file', + 'EE\Migration\SiteContainers::backup_restore', + 'EE\Migration\SiteContainers::backup_restore', [ $docker_yml, $docker_yml_backup ], [ $docker_yml_backup, $docker_yml ] ); diff --git a/php/EE/Migration/SiteContainers.php b/php/EE/Migration/SiteContainers.php index 974bf95e4..00700ad3a 100644 --- a/php/EE/Migration/SiteContainers.php +++ b/php/EE/Migration/SiteContainers.php @@ -161,20 +161,24 @@ public static function create_volume( $site, $volume_name, $symlink_path ) { } /** - * Function to restore file/directory from backup source. + * Function to backup and restore file/directory. * - * @param string $destination - * @param string $source + * @param string $destination Destination path. + * @param string $source Source path. + * @param bool $delete_different Delete files in $destination that are not there in source. */ - public static function restore_files( $destination, $source = '' ) { - $fs = new Filesystem(); - $backup_dir = EE_ROOT_DIR . '/.backup'; - $source = empty( $source ) ? $backup_dir . '/' . basename( $destination ) : $source; - EE::debug( "Restoring files from: $source to $destination" ); + public static function backup_restore( $source, $destination = '', $delete_different = true ) { + $fs = new Filesystem(); + $destination = empty( $destination ) ? EE_BACKUP_DIR . '/' . basename( $source ) : $destination; + EE::debug( "Copying files from: $source to $destination" ); if ( is_file( $source ) ) { - $fs->copy( $source, $destination ); + $fs->copy( $source, $destination, true ); } else { - $fs->mirror( $source, $destination ); + $copy_options = [ + 'override' => true, + 'delete' => $delete_different, + ]; + $fs->mirror( $source, $destination, null, $copy_options ); } } } From ccd3e06c24616231edf533079bf716a78ad2d200 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 6 Nov 2018 22:30:27 +0530 Subject: [PATCH 0544/1044] Add nginx reload step Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Migration/SiteContainers.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/php/EE/Migration/SiteContainers.php b/php/EE/Migration/SiteContainers.php index 00700ad3a..a9675c738 100644 --- a/php/EE/Migration/SiteContainers.php +++ b/php/EE/Migration/SiteContainers.php @@ -181,4 +181,18 @@ public static function backup_restore( $source, $destination = '', $delete_diffe $fs->mirror( $source, $destination, null, $copy_options ); } } + + /** + * Function to reload site's nginx. + * + * @param string $site_fs_path Directory containing site's docker-compose.yml. + */ + public static function reload_nginx( $site_fs_path ) { + + chdir( $site_fs_path ); + $success = EE::exec( "docker-compose exec nginx sh -c 'nginx -t && service openresty reload'" ); + if ( ! $success ) { + throw new \Exception( 'Could not reload nginx. Check logs.' ); + } + } } From a8e67c36053d173e649c18d8357ad9f6fb71ae1f Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 6 Nov 2018 22:31:53 +0530 Subject: [PATCH 0545/1044] Add docker-compose pulling step Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Migration/SiteContainers.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/php/EE/Migration/SiteContainers.php b/php/EE/Migration/SiteContainers.php index a9675c738..aac71b2ff 100644 --- a/php/EE/Migration/SiteContainers.php +++ b/php/EE/Migration/SiteContainers.php @@ -195,4 +195,18 @@ public static function reload_nginx( $site_fs_path ) { throw new \Exception( 'Could not reload nginx. Check logs.' ); } } + + /** + * Function to pull site docker-compose images. + * + * @param string $site_fs_path Directory containing site's docker-compose.yml. + */ + public static function docker_compose_pull( $site_fs_path ) { + + chdir( $site_fs_path ); + $success = EE::exec( "docker-compose pull" ); + if ( ! $success ) { + throw new \Exception( 'Could pull given images.' ); + } + } } From 32febb18d0b080da970aeb75298c22a027c1d82a Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Wed, 7 Nov 2018 12:18:18 +0530 Subject: [PATCH 0546/1044] Update to backup dir constant Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Migration/Base.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/EE/Migration/Base.php b/php/EE/Migration/Base.php index ae5c53f79..5008036aa 100644 --- a/php/EE/Migration/Base.php +++ b/php/EE/Migration/Base.php @@ -17,7 +17,7 @@ public function __construct() { $this->fs = new Filesystem(); $this->skip_this_migration = false; $this->is_first_execution = ! \EE\Model\Option::get( 'version' ); - $this->backup_dir = EE_ROOT_DIR . '/.backup'; + $this->backup_dir = EE_BACKUP_DIR; $this->fs->mkdir( $this->backup_dir ); } From 6c3a0f8a783ff9976b826faf7b68318916152bef Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Wed, 7 Nov 2018 12:24:21 +0530 Subject: [PATCH 0547/1044] Update migration flow Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Runner.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index f4c6788fe..d580a3510 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -69,13 +69,13 @@ private function init_ee() { */ private function migrate() { $rsp = new \EE\RevertableStepProcessor(); - $rsp->add_step( 'ee-db-migrations', 'EE\Migration\Executor::execute_migrations' ); $version = Option::where( 'key', 'version' ); if ( ! empty( $version ) ) { - $rsp->add_step( 'ee-docker-image-migrations', 'EE\Migration\Containers::start_container_migration' ); $rsp->add_step( 'ee-custom-container-migrations', 'EE\Migration\CustomContainerMigrations::execute_migrations' ); + $rsp->add_step( 'ee-docker-image-migrations', 'EE\Migration\Containers::start_container_migration' ); } + $rsp->add_step( 'ee-db-migrations', 'EE\Migration\Executor::execute_migrations' ); return $rsp->execute(); } From ddf79219f90d326b614e194e55cdd29ac44b2626 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Wed, 7 Nov 2018 12:28:17 +0530 Subject: [PATCH 0548/1044] Update triggering of migrations to always for nightly Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Runner.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index d580a3510..5f9a97c26 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -823,6 +823,8 @@ private function maybe_trigger_migration() { } elseif ( $db_version !== $current_version ) { EE::log( 'Executing migrations. This might take some time.' ); $this->trigger_migration( $current_version ); + } elseif ( false !== strpos( $current_version, 'nightly' ) ) { + $this->trigger_migration( $current_version ); } } From e9dc91eaaf0dbb1e1da5c22cbb0eef7539d78e97 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Wed, 7 Nov 2018 12:37:37 +0530 Subject: [PATCH 0549/1044] Allow execution of cli commands for older version Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Runner.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 5f9a97c26..05d3436ad 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -819,7 +819,11 @@ private function maybe_trigger_migration() { $base_current_version = preg_replace( '/-nightly.*$/', '', EE_VERSION ); if ( Comparator::lessThan( $base_current_version, $base_db_version ) ) { - EE::error( 'It seems you\'re not running latest version. Please download and run latest version of EasyEngine.' ); + if ( ! empty( $this->arguments ) && 'cli' === $this->arguments[0] ) { + EE::warning( 'It seems you\'re not running latest version. Update EasyEngine using `ee cli update --stable --yes`.' ); + } else { + EE::error( 'It seems you\'re not running latest version. Update EasyEngine using `ee cli update --stable --yes`.' ); + } } elseif ( $db_version !== $current_version ) { EE::log( 'Executing migrations. This might take some time.' ); $this->trigger_migration( $current_version ); From b78a3d8b83a9e4824d4ebda6bf1079a1054e35f2 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Thu, 8 Nov 2018 16:34:27 +0530 Subject: [PATCH 0550/1044] Update Issue template for v4 --- .github/ISSUE_TEMPLATE.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 11f07cc10..e7e4fd4a5 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,9 +1,7 @@ This issue tracker is only for issues related to EasyEngine. Please use http://community.rtcamp.com/c/easyengine for support questions. -If you feel the issue is a EasyEngine core specific issue, please attach the output of the following commands. +If you feel the issue is a EasyEngine specific issue, please attach the output of the following commands. System Information - [ ] lsb_release -a -- [ ] ee cli version - [ ] ee cli info -- [ ] wp --allow-root --info From e924a30b516d4c81e82c07bb25e5304fbd0b0cb0 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 12 Nov 2018 09:41:33 +0530 Subject: [PATCH 0551/1044] Make reusable functions public Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Migration/Containers.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index d6362f188..6e9e063bd 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -56,7 +56,7 @@ public static function start_container_migration() { * @param $new_versions array of new image version. * @param $updated_images array of updated images. */ - private static function save_upgraded_image_versions( $current_versions, $new_versions, $updated_images ) { + public static function save_upgraded_image_versions( $current_versions, $new_versions, $updated_images ) { self::$rsp->add_step( 'save-image-verions-in-database', @@ -105,7 +105,7 @@ public static function revert_database_entry( $old_version, $updated_images ) { * * @throws \Exception */ - private static function pull_or_error( $image, $version ) { + public static function pull_or_error( $image, $version ) { if ( ! \EE::exec( "docker pull $image:$version" ) ) { throw new \Exception( "Unable to pull $image. Please check logs for more details." ); } @@ -117,7 +117,7 @@ private static function pull_or_error( $image, $version ) { * @return array * @throws \Exception */ - private static function get_current_docker_images_versions() { + public static function get_current_docker_images_versions() { $images = EE::db() ->table( 'options' ) ->where( 'key', 'like', 'easyengine/%' ) From c78692c09ab3a4a323889d844a315381b6dfbe48 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 12 Nov 2018 11:15:29 +0530 Subject: [PATCH 0552/1044] Fix getting list of updated global images Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Migration/Containers.php | 17 +++++++---------- php/EE/Migration/GlobalContainers.php | 18 ++++++++++-------- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index 6e9e063bd..bc09fcd5b 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -173,16 +173,13 @@ private static function migrate_global_containers( $updated_images ) { foreach ( $updated_global_images as $image_name ) { $global_container_name = $all_global_images[ $image_name ]; $global_service_name = str_replace( '-', '_', ltrim( $global_container_name, 'ee-' ) ); - - if ( false !== \EE_DOCKER::container_status( $global_container_name ) ) { - self::$rsp->add_step( - "upgrade-$global_container_name-container", - "EE\Migration\GlobalContainers::${global_service_name}_up", - "EE\Migration\GlobalContainers::${global_service_name}_down", - null, - null - ); - } + self::$rsp->add_step( + "upgrade-$global_container_name-container", + "EE\Migration\GlobalContainers::${global_service_name}_up", + "EE\Migration\GlobalContainers::${global_service_name}_down", + null, + null + ); } } diff --git a/php/EE/Migration/GlobalContainers.php b/php/EE/Migration/GlobalContainers.php index 6be58e76e..d1cc86f1a 100644 --- a/php/EE/Migration/GlobalContainers.php +++ b/php/EE/Migration/GlobalContainers.php @@ -17,14 +17,16 @@ class GlobalContainers { * @return array */ public static function get_updated_global_images( $updated_images ) { - $global_images = [ - 'easyengine/nginx-proxy', - 'easyengine/mariadb', - 'easyengine/redis', - 'easyengine/cron', - ]; - return array_intersect( $updated_images, $global_images ); + $global_images = self::get_all_global_images_with_service_name(); + $running_global_services = []; + foreach ( $global_images as $image => $container_name ) { + if ( 'running' === \EE_DOCKER::container_status( $container_name ) ) { + $running_global_services[] = $image; + } + } + + return array_intersect( $running_global_services, $updated_images ); } /** @@ -235,7 +237,7 @@ public static function get_all_global_images_with_service_name() { 'easyengine/nginx-proxy' => EE_PROXY_TYPE, 'easyengine/mariadb' => GLOBAL_DB_CONTAINER, 'easyengine/redis' => GLOBAL_REDIS_CONTAINER, - 'easyengine/cron' => EE_CRON_SCHEDULER, + // 'easyengine/cron' => EE_CRON_SCHEDULER, //TODO: Add it to global docker-compose. ]; } } From faf62125bf3c0fdf0fba0253a5705012734dcb4c Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 12 Nov 2018 11:32:27 +0530 Subject: [PATCH 0553/1044] Fix updating global images Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Migration/Containers.php | 8 +- php/EE/Migration/GlobalContainers.php | 130 +++----------------------- 2 files changed, 17 insertions(+), 121 deletions(-) diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index bc09fcd5b..223f45622 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -175,10 +175,10 @@ private static function migrate_global_containers( $updated_images ) { $global_service_name = str_replace( '-', '_', ltrim( $global_container_name, 'ee-' ) ); self::$rsp->add_step( "upgrade-$global_container_name-container", - "EE\Migration\GlobalContainers::${global_service_name}_up", - "EE\Migration\GlobalContainers::${global_service_name}_down", - null, - null + "EE\Migration\GlobalContainers::global_service_up", + "EE\Migration\GlobalContainers::global_service_down", + $global_service_name, + $global_service_name ); } } diff --git a/php/EE/Migration/GlobalContainers.php b/php/EE/Migration/GlobalContainers.php index d1cc86f1a..9efa9eb3c 100644 --- a/php/EE/Migration/GlobalContainers.php +++ b/php/EE/Migration/GlobalContainers.php @@ -94,138 +94,34 @@ public static function down_global_containers( $updated_images ) { } /** - * Upgrades nginx-proxy container + * Upgrade global service container. * * @throws \Exception */ - public static function global_nginx_proxy_up() { - EE::debug( 'Start ' . EE_PROXY_TYPE . ' container up' ); - $default_conf_path = EE_ROOT_DIR . '/services/nginx-proxy/conf.d/default.conf'; - $fs = new \Symfony\Component\Filesystem\Filesystem(); - - if ( $fs->exists( $default_conf_path ) ) { - $fs->remove( $default_conf_path ); - } - - chdir( EE_ROOT_DIR . '/services' ); - if ( ! EE::exec( 'docker-compose up -d global-nginx-proxy ' ) ) { - throw new \Exception( sprintf( 'Unable to restart %1$s container', EE_PROXY_TYPE ) ); - } - EE::debug( 'Complete ' . EE_PROXY_TYPE . ' container up' );; - } - - /** - * Remove nginx-proxy container - * - * @throws \Exception - */ - public static function global_nginx_proxy_down() { - EE::debug( 'Start ' . EE_PROXY_TYPE . ' container removing' ); - chdir( EE_ROOT_DIR . '/services' ); - - if ( ! EE::exec( 'docker-compose stop global-nginx-proxy && docker-compose rm -f global-nginx-proxy' ) ) { - throw new \Exception( sprintf( 'Unable to stop %1$s container', EE_PROXY_TYPE ) ); - } - - $default_conf_path = EE_ROOT_DIR . '/services/nginx-proxy/conf.d/default.conf'; - $fs = new \Symfony\Component\Filesystem\Filesystem(); - - if ( $fs->exists( $default_conf_path ) ) { - $fs->remove( $default_conf_path ); + public static function global_service_up( $service_name ) { + EE::debug( 'Start ' . $service_name . ' container up' ); + if ( 'global-nginx-proxy' === $service_name ) { + \EE\Service\Utils\nginx_proxy_check(); + } else { + \EE\Service\Utils\init_global_container( $service_name ); } - EE::debug( 'Complete ' . EE_PROXY_TYPE . ' container removing' ); } /** - * Upgrade global db container. + * Remove upgraded global service container. * * @throws \Exception */ - public static function global_db_up() { - EE::debug( 'Start ' . GLOBAL_DB_CONTAINER . ' container up' ); + public static function global_service_down( $service_name ) { + EE::debug( 'Start ' . $service_name . ' container removing' ); chdir( EE_ROOT_DIR . '/services' ); - if ( ! EE::exec( 'docker-compose up -d global-db' ) ) { - throw new \Exception( sprintf( 'Unable to restart %1$s container', GLOBAL_DB_CONTAINER ) ); + if ( ! EE::exec( "docker-compose stop $service_name && docker-compose rm -f $service_name" ) ) { + throw new \Exception( sprintf( 'Unable to remove %1$s container', $service_name ) ); } - EE::debug( 'Complete' . GLOBAL_DB_CONTAINER . ' container up' ); + EE::debug( 'Complete ' . $service_name . ' container removing' ); } - /** - * Remove upgraded global db container. - * - * @throws \Exception - */ - public static function global_db_down() { - EE::debug( 'Start ' . GLOBAL_DB_CONTAINER . ' container removing' ); - chdir( EE_ROOT_DIR . '/services' ); - - if ( ! EE::exec( 'docker-compose stop global-db && docker-compose rm -f global-db' ) ) { - throw new \Exception( sprintf( 'Unable to restart %1$s container', GLOBAL_DB_CONTAINER ) ); - } - EE::debug( 'Complete ' . GLOBAL_DB_CONTAINER . ' container removing' ); - } - - /** - * Remove ee-cron-scheduler container - * - * @throws \Exception - */ - public static function cron_scheduler_up() { - EE::debug( 'Start ' . EE_CRON_SCHEDULER . ' container up' ); - - chdir( EE_ROOT_DIR . '/services' ); - - if ( ! EE::exec( 'docker-compose up -d docker-compose' ) ) { - throw new \Exception( sprintf( 'Unable to restart %1$s container', EE_CRON_SCHEDULER ) ); - } - EE::debug( 'Complete ' . EE_CRON_SCHEDULER . ' container up' ); - } - - /** - * Remove ee-cron-scheduler container - * - * @throws \Exception - */ - public static function cron_scheduler_down() { - EE::debug( 'Start ' . EE_CRON_SCHEDULER . ' container removing' ); - chdir( EE_ROOT_DIR . '/services' ); - - if ( ! EE::exec( 'docker-compose stop cron-scheduler && docker-compose rm -f cron-scheduler' ) ) { - throw new \Exception( sprintf( 'Unable to restart %1$s container', EE_CRON_SCHEDULER ) ); - } - EE::debug( 'Complete ' . EE_CRON_SCHEDULER . ' container removing' ); - } - - /** - * Upgrade global redis container. - * - * @throws \Exception - */ - public static function global_redis_up() { - EE::debug( 'Start ' . GLOBAL_REDIS_CONTAINER . ' container up' ); - chdir( EE_ROOT_DIR . '/services' ); - - if ( ! EE::exec( 'docker-compose up -d global-redis' ) ) { - throw new \Exception( sprintf( 'Unable to restart %1$s container', GLOBAL_REDIS_CONTAINER ) ); - } - EE::debug( 'Complete ' . GLOBAL_REDIS_CONTAINER . ' container up' ); - } - - /** - * Remove upgraded global redis container. - * - * @throws \Exception - */ - public static function global_redis_down() { - EE::debug( 'Start ' . GLOBAL_REDIS_CONTAINER . ' container removing' ); - chdir( EE_ROOT_DIR . '/services' ); - - if ( ! EE::exec( 'docker-compose stop global-redis && docker-compose rm -f global-redis' ) ) { - throw new \Exception( sprintf( 'Unable to restart %1$s container', GLOBAL_REDIS_CONTAINER ) ); - } - EE::debug( 'Complete ' . GLOBAL_REDIS_CONTAINER . ' container removing' ); - } /** * Get all global images with it's service name. From 7e45478fed02f25a7c358932f5f8ecf8cd6140f2 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 12 Nov 2018 13:09:00 +0530 Subject: [PATCH 0554/1044] Fix reverting of global container migration Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Migration/Containers.php | 4 ++-- php/EE/Migration/GlobalContainers.php | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index 223f45622..1ef516502 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -143,14 +143,14 @@ private static function migrate_global_containers( $updated_images ) { } $global_compose_file_path = EE_ROOT_DIR . '/services/docker-compose.yml'; - $global_compose_file_backup_path = EE_ROOT_DIR . '/services/docker-compose.yml.backup'; + $global_compose_file_backup_path = EE_BACKUP_DIR . '/services/docker-compose.yml.backup'; self::$rsp->add_step( 'backup-global-docker-compose-file', 'EE\Migration\GlobalContainers::backup_global_compose_file', 'EE\Migration\GlobalContainers::revert_global_containers', [ $global_compose_file_path, $global_compose_file_backup_path ], - [ $global_compose_file_backup_path, $global_compose_file_path ] + [ $global_compose_file_backup_path, $global_compose_file_path, $updated_global_images ] ); self::$rsp->add_step( diff --git a/php/EE/Migration/GlobalContainers.php b/php/EE/Migration/GlobalContainers.php index 9efa9eb3c..0317924ce 100644 --- a/php/EE/Migration/GlobalContainers.php +++ b/php/EE/Migration/GlobalContainers.php @@ -53,7 +53,17 @@ public static function backup_global_compose_file( $source_path, $dest_path ) { * * @throws \Exception */ - public static function revert_global_containers( $source_path, $dest_path ) { + public static function revert_global_containers( $source_path, $dest_path, $updated_images ) { + + $services_to_regenerate = ''; + $all_global_images = self::get_all_global_images_with_service_name(); + foreach ( $updated_global_images as $image_name ) { + $global_container_name = $all_global_images[ $image_name ]; + $services_to_regenerate .= str_replace( '-', '_', ltrim( $global_container_name, 'ee-' ) ) . ' '; + } + if ( empty( trim( $services_to_regenerate ) ) ) { + return; + } EE::debug( 'Start restoring global docker-compose.yml file from backup' ); if ( ! EE::exec( "mv $source_path $dest_path" ) ) { throw new \Exception( 'Unable to restore backup of docker-compose.yml' ); @@ -61,7 +71,7 @@ public static function revert_global_containers( $source_path, $dest_path ) { chdir( EE_ROOT_DIR . '/services' ); - if ( ! EE::exec( 'docker-compose up -d' ) ) { + if ( ! EE::exec( 'docker-compose up -d ' . $services_to_regenerate ) ) { throw new \Exception( 'Unable to downgrade global containers. Please check logs for more details.' ); } EE::debug( 'Complete restoring global docker-compose.yml file from backup' ); From 190c390da957861a13fbac821b70d2f12966b9be Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 12 Nov 2018 14:41:33 +0530 Subject: [PATCH 0555/1044] Update passing of params Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Migration/Containers.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index 1ef516502..b41b36258 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -177,8 +177,8 @@ private static function migrate_global_containers( $updated_images ) { "upgrade-$global_container_name-container", "EE\Migration\GlobalContainers::global_service_up", "EE\Migration\GlobalContainers::global_service_down", - $global_service_name, - $global_service_name + [ $global_service_name ], + [ $global_service_name ] ); } } From 30c5234fd97ef6083545d4af84ab47019f73c6ae Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 12 Nov 2018 15:02:14 +0530 Subject: [PATCH 0556/1044] Update backing up of docker-compose file Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Migration/Containers.php | 2 +- php/EE/Migration/GlobalContainers.php | 21 ++------------------- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index b41b36258..5a3a4a332 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -147,7 +147,7 @@ private static function migrate_global_containers( $updated_images ) { self::$rsp->add_step( 'backup-global-docker-compose-file', - 'EE\Migration\GlobalContainers::backup_global_compose_file', + 'EE\Migration\SiteContainers::backup_restore', 'EE\Migration\GlobalContainers::revert_global_containers', [ $global_compose_file_path, $global_compose_file_backup_path ], [ $global_compose_file_backup_path, $global_compose_file_path, $updated_global_images ] diff --git a/php/EE/Migration/GlobalContainers.php b/php/EE/Migration/GlobalContainers.php index 0317924ce..881a03113 100644 --- a/php/EE/Migration/GlobalContainers.php +++ b/php/EE/Migration/GlobalContainers.php @@ -29,22 +29,6 @@ public static function get_updated_global_images( $updated_images ) { return array_intersect( $running_global_services, $updated_images ); } - /** - * Take backup of current global docker-compose.yml file. - * - * @param $source_path string path of global docker-compose.yml - * @param $dest_path string path of backup file. - * - * @throws \Exception - */ - public static function backup_global_compose_file( $source_path, $dest_path ) { - EE::debug( 'Start backing up of global docker-compose.yml file' ); - if ( ! EE::exec( "cp $source_path $dest_path" ) ) { - throw new \Exception( "Unable to find docker-compose.yml or couldn't create it's backup file. Ensure that EasyEngine has permission to create file there" ); - } - EE::debug( 'Complete backing up of global docker-compose.yml file' ); - } - /** * * Restore backed up docker-compose.yml file. * @@ -65,9 +49,8 @@ public static function revert_global_containers( $source_path, $dest_path, $upda return; } EE::debug( 'Start restoring global docker-compose.yml file from backup' ); - if ( ! EE::exec( "mv $source_path $dest_path" ) ) { - throw new \Exception( 'Unable to restore backup of docker-compose.yml' ); - } + $fs = new Filesystem(); + $fs->copy( $source_path, $dest_path, true ); chdir( EE_ROOT_DIR . '/services' ); From 03eac32c3e89e34569faae15a8716763cd60ae66 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 12 Nov 2018 15:14:09 +0530 Subject: [PATCH 0557/1044] Update getting service name Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Migration/Containers.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index 5a3a4a332..271156058 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -172,7 +172,7 @@ private static function migrate_global_containers( $updated_images ) { $all_global_images = GlobalContainers::get_all_global_images_with_service_name(); foreach ( $updated_global_images as $image_name ) { $global_container_name = $all_global_images[ $image_name ]; - $global_service_name = str_replace( '-', '_', ltrim( $global_container_name, 'ee-' ) ); + $global_service_name = ltrim( $global_container_name, 'ee-' ); self::$rsp->add_step( "upgrade-$global_container_name-container", "EE\Migration\GlobalContainers::global_service_up", From 090b3bd1dfdcfcf6640c75643fed14a8bcee6641 Mon Sep 17 00:00:00 2001 From: Mriyam Tamuli <mbtamuli@gmail.com> Date: Tue, 13 Nov 2018 11:41:35 +0530 Subject: [PATCH 0558/1044] Update img-versions for rc.2 Signed-off-by: Mriyam Tamuli <mbtamuli@gmail.com> --- img-versions.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/img-versions.json b/img-versions.json index eb85f0a31..11faeec9b 100644 --- a/img-versions.json +++ b/img-versions.json @@ -2,9 +2,9 @@ "easyengine/cron": "v4.0.0-rc.1", "easyengine/mailhog": "v4.0.0-rc.1", "easyengine/mariadb": "v4.0.0-rc.1", - "easyengine/nginx-proxy": "v4.0.0-rc.1", + "easyengine/nginx-proxy": "v4.0.0-rc.2", "easyengine/nginx": "v4.0.0-rc.1", - "easyengine/php": "v4.0.0-rc.1", + "easyengine/php": "v4.0.0-rc.2", "easyengine/phpmyadmin": "v4.0.0-rc.1", "easyengine/postfix": "v4.0.0-rc.1", "easyengine/redis": "v4.0.0-rc.1" From 550fe5d268f74f31551ea2508d33e8b2c6098c71 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 13 Nov 2018 14:12:37 +0530 Subject: [PATCH 0559/1044] Fix process creation environment Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/commands/src/CLI_Command.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/commands/src/CLI_Command.php b/php/commands/src/CLI_Command.php index 5254a633d..fbac8fa20 100644 --- a/php/commands/src/CLI_Command.php +++ b/php/commands/src/CLI_Command.php @@ -309,7 +309,7 @@ public function update( $_, $assoc_args ) { EE::log( 'Updating EasyEngine to new version. This might take some time.' ); $php_binary = Utils\get_php_binary(); - $process = EE\Process::create( "{$php_binary} $temp cli info" ); + $process = EE\Process::create( "{$php_binary} $temp cli info", null, null ); $result = $process->run(); if ( 0 !== $result->return_code || false === stripos( $result->stdout, 'EE version' ) ) { $multi_line = explode( PHP_EOL, $result->stderr ); From fe26768020271b78e1430cfda8ccc761a1e46d56 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 13 Nov 2018 14:20:14 +0530 Subject: [PATCH 0560/1044] Remove obsolete iamges Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- img-versions.json | 1 - 1 file changed, 1 deletion(-) diff --git a/img-versions.json b/img-versions.json index 11faeec9b..31d2ccbab 100644 --- a/img-versions.json +++ b/img-versions.json @@ -5,7 +5,6 @@ "easyengine/nginx-proxy": "v4.0.0-rc.2", "easyengine/nginx": "v4.0.0-rc.1", "easyengine/php": "v4.0.0-rc.2", - "easyengine/phpmyadmin": "v4.0.0-rc.1", "easyengine/postfix": "v4.0.0-rc.1", "easyengine/redis": "v4.0.0-rc.1" } From a7dd302c59a676cfb6c11a715af3f54e17ce7ea4 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 13 Nov 2018 14:28:21 +0530 Subject: [PATCH 0561/1044] Update postfix to latest version Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- img-versions.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/img-versions.json b/img-versions.json index 31d2ccbab..2a3acbdde 100644 --- a/img-versions.json +++ b/img-versions.json @@ -5,6 +5,6 @@ "easyengine/nginx-proxy": "v4.0.0-rc.2", "easyengine/nginx": "v4.0.0-rc.1", "easyengine/php": "v4.0.0-rc.2", - "easyengine/postfix": "v4.0.0-rc.1", + "easyengine/postfix": "v4.0.0-rc.2", "easyengine/redis": "v4.0.0-rc.1" } From 5c9b4df9d7b651d53347ddc9c8cfaf22d5adcd15 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 13 Nov 2018 16:13:36 +0530 Subject: [PATCH 0562/1044] Fix nohttps in docker-compose generation Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Migration/SiteContainers.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/EE/Migration/SiteContainers.php b/php/EE/Migration/SiteContainers.php index aac71b2ff..d7a8ef47b 100644 --- a/php/EE/Migration/SiteContainers.php +++ b/php/EE/Migration/SiteContainers.php @@ -96,7 +96,7 @@ public static function is_site_service_image_changed( $updated_images, $site_inf public static function generate_site_docker_compose_file( $site_info, $site_object ) { $site_object->populate_site_info( $site_info['site_url'] ); EE::debug( "Start generating news docker-compose.yml for ${site_info['site_url']}" ); - $site_object->dump_docker_compose_yml( [ 'nohttps' => $site_info['site_ssl'] ] ); + $site_object->dump_docker_compose_yml( [ 'nohttps' => ! $site_info['site_ssl'] ] ); EE::debug( "Complete generating news docker-compose.yml for ${site_info['site_url']}" ); } From c8257d545de8185f1e0449632bf7cce9f3d8561a Mon Sep 17 00:00:00 2001 From: Mriyam Tamuli <mbtamuli@gmail.com> Date: Tue, 13 Nov 2018 17:26:50 +0530 Subject: [PATCH 0563/1044] Bump version to 4.0.0-rc.2 Signed-off-by: Mriyam Tamuli <mbtamuli@gmail.com> --- VERSION | 2 +- composer.json | 8 +-- composer.lock | 187 +++++++++++++++++++++++++------------------------- 3 files changed, 100 insertions(+), 97 deletions(-) diff --git a/VERSION b/VERSION index 78fd5f0ed..cd46fc977 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.0.0-rc.1 +4.0.0-rc.2 diff --git a/composer.json b/composer.json index f4b2ae177..6010ba31b 100644 --- a/composer.json +++ b/composer.json @@ -28,13 +28,13 @@ "composer/composer": "^1.2.0", "composer/semver": "~1.0", "easyengine/admin-tools-command": "v1.0.0-rc.1", - "easyengine/auth-command": "v1.0.0-rc.1", + "easyengine/auth-command": "v1.0.0-rc.2", "easyengine/config-command": "v1.0.0-rc.1", - "easyengine/cron-command": "v1.0.0-rc.1", + "easyengine/cron-command": "v1.0.0-rc.2", "easyengine/mailhog-command": "v1.0.0-rc.1", - "easyengine/site-command": "v2.2.0", + "easyengine/site-command": "v2.2.1", "easyengine/site-type-wp": "v1.0.0-rc.1", - "easyengine/site-type-php": "v1.0.0-rc.1", + "easyengine/site-type-php": "v1.0.0-rc.2", "easyengine/service-command": "v1.0.0-rc.1", "easyengine/shell-command" : "v1.0.0-rc.1", "justinrainbow/json-schema": "~5.2.5", diff --git a/composer.lock b/composer.lock index a6799a9cf..bf657c78d 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": "afc0f1cbc13e6d9120745d286b0be863", + "content-hash": "18ea186f7d6d208e9573caad5d886bd4", "packages": [ { "name": "acmephp/core", @@ -190,16 +190,16 @@ }, { "name": "composer/composer", - "version": "1.7.2", + "version": "1.7.3", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "576aab9b5abb2ed11a1c52353a759363216a4ad2" + "reference": "e965b9aaa8854c3067f1ed2ae45f436572d73eb7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/576aab9b5abb2ed11a1c52353a759363216a4ad2", - "reference": "576aab9b5abb2ed11a1c52353a759363216a4ad2", + "url": "https://api.github.com/repos/composer/composer/zipball/e965b9aaa8854c3067f1ed2ae45f436572d73eb7", + "reference": "e965b9aaa8854c3067f1ed2ae45f436572d73eb7", "shasum": "" }, "require": { @@ -266,7 +266,7 @@ "dependency", "package" ], - "time": "2018-08-16T14:57:12+00:00" + "time": "2018-11-01T09:05:06+00:00" }, { "name": "composer/semver", @@ -332,16 +332,16 @@ }, { "name": "composer/spdx-licenses", - "version": "1.4.0", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/composer/spdx-licenses.git", - "reference": "cb17687e9f936acd7e7245ad3890f953770dec1b" + "reference": "7a9556b22bd9d4df7cad89876b00af58ef20d3a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/cb17687e9f936acd7e7245ad3890f953770dec1b", - "reference": "cb17687e9f936acd7e7245ad3890f953770dec1b", + "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/7a9556b22bd9d4df7cad89876b00af58ef20d3a2", + "reference": "7a9556b22bd9d4df7cad89876b00af58ef20d3a2", "shasum": "" }, "require": { @@ -389,7 +389,7 @@ "spdx", "validator" ], - "time": "2018-04-30T10:33:04+00:00" + "time": "2018-11-01T09:45:54+00:00" }, { "name": "composer/xdebug-handler", @@ -480,16 +480,16 @@ }, { "name": "easyengine/auth-command", - "version": "v1.0.0-rc.1", + "version": "v1.0.0-rc.2", "source": { "type": "git", "url": "https://github.com/EasyEngine/auth-command.git", - "reference": "a82f10b3d5cb26136b953c9723c3fed6d2479af7" + "reference": "1a6356e4ca4f9d917e4f5e414752a1e50a9651a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/auth-command/zipball/a82f10b3d5cb26136b953c9723c3fed6d2479af7", - "reference": "a82f10b3d5cb26136b953c9723c3fed6d2479af7", + "url": "https://api.github.com/repos/EasyEngine/auth-command/zipball/1a6356e4ca4f9d917e4f5e414752a1e50a9651a2", + "reference": "1a6356e4ca4f9d917e4f5e414752a1e50a9651a2", "shasum": "" }, "type": "ee-cli-package", @@ -524,7 +524,7 @@ ], "description": "Configure HTTP Authentication and whitelisting for EasyEngine site", "homepage": "https://github.com/easyengine/auth-command", - "time": "2018-10-30T08:30:28+00:00" + "time": "2018-11-13T11:27:18+00:00" }, { "name": "easyengine/config-command", @@ -568,16 +568,16 @@ }, { "name": "easyengine/cron-command", - "version": "v1.0.0-rc.1", + "version": "v1.0.0-rc.2", "source": { "type": "git", "url": "https://github.com/EasyEngine/cron-command.git", - "reference": "cd31aafade5bc68e4f7c1041af9bba65a6f1083a" + "reference": "f6ba3754adf9e60baa63bd8ae1b96228c3999fce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/cron-command/zipball/cd31aafade5bc68e4f7c1041af9bba65a6f1083a", - "reference": "cd31aafade5bc68e4f7c1041af9bba65a6f1083a", + "url": "https://api.github.com/repos/EasyEngine/cron-command/zipball/f6ba3754adf9e60baa63bd8ae1b96228c3999fce", + "reference": "f6ba3754adf9e60baa63bd8ae1b96228c3999fce", "shasum": "" }, "type": "ee-cli-package", @@ -599,7 +599,8 @@ }, "files": [ "cron-command.php", - "src/helper/hooks.php" + "src/helper/hooks.php", + "src/helper/utils.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -608,7 +609,7 @@ ], "description": "Manages cron jobs in EasyEngine", "homepage": "https://github.com/easyengine/cron-command", - "time": "2018-10-30T08:44:54+00:00" + "time": "2018-11-13T11:31:12+00:00" }, { "name": "easyengine/mailhog-command", @@ -740,16 +741,16 @@ }, { "name": "easyengine/site-command", - "version": "v2.2.0", + "version": "v2.2.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "793292a8679116b27a473626395dfeaa306cee58" + "reference": "68ac8377e4775b1d9d5a730bcbb0177ced16da02" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/793292a8679116b27a473626395dfeaa306cee58", - "reference": "793292a8679116b27a473626395dfeaa306cee58", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/68ac8377e4775b1d9d5a730bcbb0177ced16da02", + "reference": "68ac8377e4775b1d9d5a730bcbb0177ced16da02", "shasum": "" }, "require": { @@ -795,20 +796,20 @@ "MIT" ], "homepage": "https://github.com/easyengine/site-command", - "time": "2018-10-30T12:22:15+00:00" + "time": "2018-11-13T11:32:41+00:00" }, { "name": "easyengine/site-type-php", - "version": "v1.0.0-rc.1", + "version": "v1.0.0-rc.2", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-php.git", - "reference": "deb061ac8760a58bd4f5891a49bbe3e5132a8147" + "reference": "4e103135c11ce3b7f70f8f11749ffa38299b2255" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/deb061ac8760a58bd4f5891a49bbe3e5132a8147", - "reference": "deb061ac8760a58bd4f5891a49bbe3e5132a8147", + "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/4e103135c11ce3b7f70f8f11749ffa38299b2255", + "reference": "4e103135c11ce3b7f70f8f11749ffa38299b2255", "shasum": "" }, "require-dev": { @@ -835,7 +836,7 @@ ], "description": "EasyEngine package for PHP site creation.", "homepage": "https://github.com/easyengine/site-type-php", - "time": "2018-10-30T10:39:27+00:00" + "time": "2018-11-13T11:35:17+00:00" }, { "name": "easyengine/site-type-wp", @@ -843,12 +844,12 @@ "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-wp.git", - "reference": "50f8ffc54467c54d50456740e437762a8e802225" + "reference": "f2978da56ba16b9be9b0b7b91228569a932c1f1b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/50f8ffc54467c54d50456740e437762a8e802225", - "reference": "50f8ffc54467c54d50456740e437762a8e802225", + "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/f2978da56ba16b9be9b0b7b91228569a932c1f1b", + "reference": "f2978da56ba16b9be9b0b7b91228569a932c1f1b", "shasum": "" }, "require-dev": { @@ -1222,16 +1223,16 @@ }, { "name": "monolog/monolog", - "version": "1.23.0", + "version": "1.24.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "fd8c787753b3a2ad11bc60c063cff1358a32a3b4" + "reference": "bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/fd8c787753b3a2ad11bc60c063cff1358a32a3b4", - "reference": "fd8c787753b3a2ad11bc60c063cff1358a32a3b4", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266", + "reference": "bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266", "shasum": "" }, "require": { @@ -1296,7 +1297,7 @@ "logging", "psr-3" ], - "time": "2017-06-19T01:22:40+00:00" + "time": "2018-11-05T09:00:11+00:00" }, { "name": "mustache/mustache", @@ -1634,16 +1635,16 @@ }, { "name": "symfony/config", - "version": "v3.4.17", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "e5389132dc6320682de3643091121c048ff796b3" + "reference": "99b2fa8acc244e656cdf324ff419fbe6fd300a4d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/e5389132dc6320682de3643091121c048ff796b3", - "reference": "e5389132dc6320682de3643091121c048ff796b3", + "url": "https://api.github.com/repos/symfony/config/zipball/99b2fa8acc244e656cdf324ff419fbe6fd300a4d", + "reference": "99b2fa8acc244e656cdf324ff419fbe6fd300a4d", "shasum": "" }, "require": { @@ -1694,20 +1695,20 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2018-09-08T13:15:14+00:00" + "time": "2018-10-31T09:06:03+00:00" }, { "name": "symfony/console", - "version": "v3.4.17", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "3b2b415d4c48fbefca7dc742aa0a0171bfae4e0b" + "reference": "1d228fb4602047d7b26a0554e0d3efd567da5803" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/3b2b415d4c48fbefca7dc742aa0a0171bfae4e0b", - "reference": "3b2b415d4c48fbefca7dc742aa0a0171bfae4e0b", + "url": "https://api.github.com/repos/symfony/console/zipball/1d228fb4602047d7b26a0554e0d3efd567da5803", + "reference": "1d228fb4602047d7b26a0554e0d3efd567da5803", "shasum": "" }, "require": { @@ -1763,20 +1764,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-10-02T16:33:53+00:00" + "time": "2018-10-30T16:50:50+00:00" }, { "name": "symfony/debug", - "version": "v3.4.17", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "0a612e9dfbd2ccce03eb174365f31ecdca930ff6" + "reference": "fe9793af008b651c5441bdeab21ede8172dab097" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/0a612e9dfbd2ccce03eb174365f31ecdca930ff6", - "reference": "0a612e9dfbd2ccce03eb174365f31ecdca930ff6", + "url": "https://api.github.com/repos/symfony/debug/zipball/fe9793af008b651c5441bdeab21ede8172dab097", + "reference": "fe9793af008b651c5441bdeab21ede8172dab097", "shasum": "" }, "require": { @@ -1819,20 +1820,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2018-10-02T16:33:53+00:00" + "time": "2018-10-31T09:06:03+00:00" }, { "name": "symfony/dependency-injection", - "version": "v3.4.17", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "aea20fef4e92396928b5db175788b90234c0270d" + "reference": "9c98452ac7fff4b538956775630bc9701f5384ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/aea20fef4e92396928b5db175788b90234c0270d", - "reference": "aea20fef4e92396928b5db175788b90234c0270d", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/9c98452ac7fff4b538956775630bc9701f5384ba", + "reference": "9c98452ac7fff4b538956775630bc9701f5384ba", "shasum": "" }, "require": { @@ -1890,20 +1891,20 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2018-10-02T12:28:39+00:00" + "time": "2018-10-31T10:49:51+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v3.4.17", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "b2e1f19280c09a42dc64c0b72b80fe44dd6e88fb" + "reference": "db9e829c8f34c3d35cf37fcd4cdb4293bc4a2f14" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b2e1f19280c09a42dc64c0b72b80fe44dd6e88fb", - "reference": "b2e1f19280c09a42dc64c0b72b80fe44dd6e88fb", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/db9e829c8f34c3d35cf37fcd4cdb4293bc4a2f14", + "reference": "db9e829c8f34c3d35cf37fcd4cdb4293bc4a2f14", "shasum": "" }, "require": { @@ -1953,11 +1954,11 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2018-07-26T09:06:28+00:00" + "time": "2018-10-30T16:50:50+00:00" }, { "name": "symfony/filesystem", - "version": "v3.4.17", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", @@ -2007,7 +2008,7 @@ }, { "name": "symfony/finder", - "version": "v3.4.17", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", @@ -2056,7 +2057,7 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.9.0", + "version": "v1.10.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", @@ -2114,16 +2115,16 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.9.0", + "version": "v1.10.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8" + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/d0cd638f4634c16d8df4508e847f14e9e43168b8", - "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", "shasum": "" }, "require": { @@ -2169,20 +2170,20 @@ "portable", "shim" ], - "time": "2018-08-06T14:22:27+00:00" + "time": "2018-09-21T13:07:52+00:00" }, { "name": "symfony/process", - "version": "v3.4.17", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "1dc2977afa7d70f90f3fefbcd84152813558910e" + "reference": "35c2914a9f50519bd207164c353ae4d59182c2cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/1dc2977afa7d70f90f3fefbcd84152813558910e", - "reference": "1dc2977afa7d70f90f3fefbcd84152813558910e", + "url": "https://api.github.com/repos/symfony/process/zipball/35c2914a9f50519bd207164c353ae4d59182c2cb", + "reference": "35c2914a9f50519bd207164c353ae4d59182c2cb", "shasum": "" }, "require": { @@ -2218,11 +2219,11 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2018-10-02T12:28:39+00:00" + "time": "2018-10-14T17:33:21+00:00" }, { "name": "symfony/serializer", - "version": "v3.4.17", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/serializer.git", @@ -2301,7 +2302,7 @@ }, { "name": "symfony/translation", - "version": "v3.4.17", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", @@ -2369,7 +2370,7 @@ }, { "name": "symfony/yaml", - "version": "v3.4.17", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", @@ -3282,12 +3283,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "0d96c6cd7cee8572be836fca71f9f01c8b1c0cb2" + "reference": "74a42b8d8d9f9cd672be58e7d1c65094da4ae971" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/0d96c6cd7cee8572be836fca71f9f01c8b1c0cb2", - "reference": "0d96c6cd7cee8572be836fca71f9f01c8b1c0cb2", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/74a42b8d8d9f9cd672be58e7d1c65094da4ae971", + "reference": "74a42b8d8d9f9cd672be58e7d1c65094da4ae971", "shasum": "" }, "conflict": { @@ -3324,7 +3325,7 @@ "drupal/core": ">=7,<7.60|>=8,<8.5.8|>=8.6,<8.6.2", "drupal/drupal": ">=7,<7.60|>=8,<8.5.8|>=8.6,<8.6.2", "erusev/parsedown": "<1.7", - "ezsystems/ezpublish-legacy": ">=5.3,<5.3.12.3|>=5.4,<5.4.11.3|>=2017.8,<2017.8.1.1|>=2017.12,<2017.12.2.1", + "ezsystems/ezpublish-legacy": ">=5.3,<5.3.12.5|>=5.4,<5.4.12.2|>=2017.8,<2017.8.1.1|>=2017.12,<2017.12.4.2|>=2018.6,<2018.6.1.3|>=2018.9,<2018.9.1.2", "ezyang/htmlpurifier": "<4.1.1", "firebase/php-jwt": "<2", "fooman/tcpdf": "<6.2.22", @@ -3396,6 +3397,8 @@ "symfony/http-foundation": ">=2,<2.7.49|>=2.8,<2.8.44|>=3,<3.3.18|>=3.4,<3.4.14|>=4,<4.0.14|>=4.1,<4.1.3", "symfony/http-kernel": ">=2,<2.3.29|>=2.4,<2.5.12|>=2.6,<2.6.8", "symfony/intl": ">=2.7,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", + "symfony/polyfill": ">=1,<1.10", + "symfony/polyfill-php55": ">=1,<1.10", "symfony/routing": ">=2,<2.0.19", "symfony/security": ">=2,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", "symfony/security-bundle": ">=2,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", @@ -3411,7 +3414,7 @@ "symfony/yaml": ">=2,<2.0.22|>=2.1,<2.1.7", "tecnickcom/tcpdf": "<6.2.22", "thelia/backoffice-default-template": ">=2.1,<2.1.2", - "thelia/thelia": ">=2.1,<2.1.2|>=2.1.0-beta1,<2.1.3", + "thelia/thelia": ">=2.1.0-beta1,<2.1.3|>=2.1,<2.1.2", "theonedemon/phpwhois": "<=4.2.5", "titon/framework": ">=0,<9.9.99", "truckersmp/phpwhois": "<=4.3.1", @@ -3468,7 +3471,7 @@ } ], "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", - "time": "2018-10-21T18:01:48+00:00" + "time": "2018-11-01T18:39:28+00:00" }, { "name": "squizlabs/php_codesniffer", @@ -3523,16 +3526,16 @@ }, { "name": "symfony/class-loader", - "version": "v3.4.17", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/class-loader.git", - "reference": "f31333bdff54c7595f834d510a6d2325573ddb36" + "reference": "5605edec7b8f034ead2497ff4aab17bb70d558c1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/class-loader/zipball/f31333bdff54c7595f834d510a6d2325573ddb36", - "reference": "f31333bdff54c7595f834d510a6d2325573ddb36", + "url": "https://api.github.com/repos/symfony/class-loader/zipball/5605edec7b8f034ead2497ff4aab17bb70d558c1", + "reference": "5605edec7b8f034ead2497ff4aab17bb70d558c1", "shasum": "" }, "require": { @@ -3575,7 +3578,7 @@ ], "description": "Symfony ClassLoader Component", "homepage": "https://symfony.com", - "time": "2018-10-02T12:28:39+00:00" + "time": "2018-10-31T09:06:03+00:00" }, { "name": "wimg/php-compatibility", From 0781ff4b090a358082c18f38ed7e7135b1adc10c Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 15 Nov 2018 11:24:52 +0530 Subject: [PATCH 0564/1044] Update nginx-proxy version conf on migration Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Runner.php | 1 + 1 file changed, 1 insertion(+) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 05d3436ad..20732a32d 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -837,6 +837,7 @@ private function trigger_migration( $version ) { EE::error( 'There was some error while migrating. Please check logs.' ); } Option::set( 'version', $version ); + \EE\Service\Utils\set_nginx_proxy_version_conf(); } /** From 31e9b3da6abfed198b31cf128c7bb0c8df815713 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Fri, 16 Nov 2018 11:44:40 +0530 Subject: [PATCH 0565/1044] Add IS_DARWIN variable Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/init-ee.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/php/init-ee.php b/php/init-ee.php index 53dbd6ef1..6b3ba0c3c 100644 --- a/php/init-ee.php +++ b/php/init-ee.php @@ -4,8 +4,9 @@ define( 'EE', true ); define( 'EE_VERSION', trim( file_get_contents( EE_ROOT . '/VERSION' ) ) ); define( 'EE_START_MICROTIME', microtime( true ) ); +define( 'IS_DARWIN', 'Darwin' === php_uname( 's' ) ); define( 'EE_ROOT_DIR', '/opt/easyengine' ); -define( 'EE_BACKUP_DIR', '/opt/easyengine/.backup' ); +define( 'EE_BACKUP_DIR', EE_ROOT_DIR . '/.backup' ); define( 'EE_PROXY_TYPE', 'ee-global-nginx-proxy' ); if ( file_exists( EE_ROOT . '/vendor/autoload.php' ) ) { From e65e6efafa4dda1db09328a2384533bd739e00b3 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Fri, 16 Nov 2018 11:45:22 +0530 Subject: [PATCH 0566/1044] Update EE_ROOT_DIR for Darwin Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/init-ee.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/php/init-ee.php b/php/init-ee.php index 6b3ba0c3c..e7cd0481b 100644 --- a/php/init-ee.php +++ b/php/init-ee.php @@ -5,7 +5,13 @@ define( 'EE_VERSION', trim( file_get_contents( EE_ROOT . '/VERSION' ) ) ); define( 'EE_START_MICROTIME', microtime( true ) ); define( 'IS_DARWIN', 'Darwin' === php_uname( 's' ) ); -define( 'EE_ROOT_DIR', '/opt/easyengine' ); + +if ( IS_DARWIN ) { + define( 'EE_ROOT_DIR', rtrim( getenv( 'HOME' ), '/\\' ) . '/easyengine' ); +} else { + define( 'EE_ROOT_DIR', '/opt/easyengine' ); +} + define( 'EE_BACKUP_DIR', EE_ROOT_DIR . '/.backup' ); define( 'EE_PROXY_TYPE', 'ee-global-nginx-proxy' ); From a9f5ac7df8d01b1571a6c2070b781a0b28be0733 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Fri, 16 Nov 2018 11:47:38 +0530 Subject: [PATCH 0567/1044] Add functionality to skip volume creation Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/class-ee-docker.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php index 287e63679..3836ba65e 100644 --- a/php/class-ee-docker.php +++ b/php/class-ee-docker.php @@ -153,8 +153,8 @@ public static function disconnect_site_network_from( $site_name, $from_container /** * Function to boot the containers. * - * @param String $dir Path to docker-compose.yml. - * @param array $services Services to bring up. + * @param String $dir Path to docker-compose.yml. + * @param array $services Services to bring up. * * @return bool success. */ @@ -187,7 +187,7 @@ public static function docker_network_exists( string $network ) { /** * Function to destroy the containers. * - * @param String $dir Path to docker-compose.yml. + * @param String $dir Path to docker-compose.yml. * * @return bool success. */ @@ -234,7 +234,10 @@ public static function get_docker_style_prefix( $site_url ) { * @param string $prefix Prefix by volumes have to be created. * @param array $volumes The volumes to be created. * $volumes[$key]['name'] => specifies the name of volume to be created. - * $volumes[$key]['path_to_symlink'] => specifies the path to symlink the created volume. + * $volumes[$key]['path_to_symlink'] => specifies the path to symlink the + * created volume. + * $volumes[$key]['skip_volume'] => if set to `true` will skip volume creation + * for that entry. * @param bool $update_to_docker_prefix Update the prefix in dockerized style. */ public static function create_volumes( $prefix, $volumes, $update_to_docker_prefix = true ) { @@ -247,6 +250,9 @@ public static function create_volumes( $prefix, $volumes, $update_to_docker_pref $docker_root_dir = trim( $launch->stdout ); foreach ( $volumes as $volume ) { + if ( ! empty( $volume['skip_volume'] ) && true === $volume['skip_volume'] ) { + continue; + } $fs->mkdir( dirname( $volume['path_to_symlink'] ) ); EE::exec( sprintf( From ee5cceb616c2bd2e26ec0cb75b4f5362d3357fbb Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Fri, 16 Nov 2018 11:54:45 +0530 Subject: [PATCH 0568/1044] Add functionality for easy docker-compose generation in linux and darwin Helps in generating bind mounted docker-compose generation for darwin. And volume created volumes in linux. Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/class-ee-docker.php | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php index 3836ba65e..4664736eb 100644 --- a/php/class-ee-docker.php +++ b/php/class-ee-docker.php @@ -281,4 +281,33 @@ public static function get_volumes_by_label( $label ) { return array_filter( explode( PHP_EOL, trim( $launch->stdout ) ), 'trim' ); } + + /** + * Function to return minimal docker-compose `host:container` volume mounting array. + * + * @param array $extended_vols : + * $extended_vols['name'] - Host path for docker-compose generation in linux + * $extended_vols['path_to_symlink'] - Host path for docker-compose generation in + * darwin. + * $extended_vols['container_path'] - Path inside container, common for linux and + * darwin. + * $extended_vols['skip_darwin'] - if set to true skips that volume for darwin. + * $extended_vols['skip_linux'] - if set to true skips that volume for linux. + * + * @return array having docker-compose `host:container` volume mounting. + */ + public static function get_mounting_volume_array( $extended_vols ) { + + $volume_gen_key = IS_DARWIN ? 'path_to_symlink' : 'name'; + $skip_key = IS_DARWIN ? 'skip_darwin' : 'skip_linux'; + $final_mount_volumes = []; + foreach ( $extended_vols as $extended_vol ) { + if ( ! empty( $extended_vol[ $skip_key ] ) && true === $extended_vol[ $skip_key ] ) { + continue; + } + $final_mount_volumes[] = $extended_vol[ $volume_gen_key ] . ':' . $extended_vol['container_path']; + } + + return $final_mount_volumes; + } } From 33189835464514d1a061da32311bf837bdf203cf Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Fri, 16 Nov 2018 14:47:54 +0530 Subject: [PATCH 0569/1044] Replace use of /opt/easyengine with constant EE_ROOT_DIR Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/class-ee.php | 2 +- php/commands/src/CLI_Command.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/php/class-ee.php b/php/class-ee.php index eb143dce2..3a84061d6 100644 --- a/php/class-ee.php +++ b/php/class-ee.php @@ -94,7 +94,7 @@ public static function get_cache() { if ( ! $cache ) { $home = Utils\get_home_dir(); - $dir = getenv( 'EE_CACHE_DIR' ) ? : '/opt/easyengine/.cache/'; + $dir = getenv( 'EE_CACHE_DIR' ) ? : EE_ROOT_DIR . '/.cache/'; // 6 months, 300mb $cache = new FileCache( $dir, 15552000, 314572800 ); diff --git a/php/commands/src/CLI_Command.php b/php/commands/src/CLI_Command.php index fbac8fa20..c1bafea71 100644 --- a/php/commands/src/CLI_Command.php +++ b/php/commands/src/CLI_Command.php @@ -507,8 +507,7 @@ public function self_uninstall( $args, $assoc_args ) { $fs->remove( $sites_paths ); } - EE::exec( "rm -df $home/ee-sites/" ); - EE::exec( "rm -rf /opt/easyengine/" ); + EE::exec( "rm -rf " . EE_ROOT_DIR ); if ( Utils\inside_phar() ) { unlink( realpath( $_SERVER['argv'][0] ) ); From bbc79237a6129c660db6f3e91a88fe931d387c76 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 19 Nov 2018 15:33:54 +0530 Subject: [PATCH 0570/1044] Define EasyEngine service directory Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/init-ee.php | 1 + 1 file changed, 1 insertion(+) diff --git a/php/init-ee.php b/php/init-ee.php index e7cd0481b..b54bee8fe 100644 --- a/php/init-ee.php +++ b/php/init-ee.php @@ -13,6 +13,7 @@ } define( 'EE_BACKUP_DIR', EE_ROOT_DIR . '/.backup' ); +define( 'EE_SERVICE_DIR', EE_ROOT_DIR . '/services' ); define( 'EE_PROXY_TYPE', 'ee-global-nginx-proxy' ); if ( file_exists( EE_ROOT . '/vendor/autoload.php' ) ) { From 2e4bf0210fc19ea355f4d31c67c96c8024ecc4dd Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Mon, 19 Nov 2018 18:54:32 +0530 Subject: [PATCH 0571/1044] Add docker info --- .github/ISSUE_TEMPLATE.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index e7e4fd4a5..514bb5542 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -3,5 +3,7 @@ This issue tracker is only for issues related to EasyEngine. Please use http://c If you feel the issue is a EasyEngine specific issue, please attach the output of the following commands. System Information -- [ ] lsb_release -a - [ ] ee cli info +- [ ] docker -v +- [ ] docker version +- [ ] docker-compose version From 0c86f294396103c9c9d873f62ece47f15353113b Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Mon, 19 Nov 2018 18:55:25 +0530 Subject: [PATCH 0572/1044] Update ISSUE_TEMPLATE.md --- .github/ISSUE_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 514bb5542..633ce175d 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -4,6 +4,6 @@ If you feel the issue is a EasyEngine specific issue, please attach the output o System Information - [ ] ee cli info -- [ ] docker -v +- [ ] lsb_release -a - [ ] docker version - [ ] docker-compose version From 540e8850c6b59530ca40021fbd3792b2ab360e43 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 19 Nov 2018 20:44:01 +0530 Subject: [PATCH 0573/1044] Check for minimum requirements Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Runner.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 20732a32d..395391acc 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -51,10 +51,25 @@ public function __get( $key ) { */ private function init_ee() { + // Minimum requirement checks. + $docker_running = 'docker ps > /dev/null'; + if ( ! EE::exec( $docker_running ) ) { + EE::error( 'docker not installed or not running.' ); + } + + $docker_compose_installed = 'command -v docker-compose > /dev/null'; + if ( ! EE::exec( $docker_compose_installed ) ) { + EE::error( 'EasyEngine requires docker-compose.' ); + } + + if ( version_compare( PHP_VERSION, '7.2.0' ) < 0 ) { + EE::error( 'EasyEngine requires minimum PHP 7.2.0 to run.' ); + } + $this->ensure_present_in_config( 'locale', 'en_US' ); $this->ensure_present_in_config( 'ee_installer_version', 'stable' ); - define( 'DB', EE_ROOT_DIR.'/db/ee.sqlite' ); + define( 'DB', EE_ROOT_DIR . '/db/ee.sqlite' ); define( 'LOCALHOST_IP', '127.0.0.1' ); $db_dir = dirname( DB ); From b4d53a1fba5f9ec9746062e3a9c89b05be27c3b5 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 19 Nov 2018 20:49:56 +0530 Subject: [PATCH 0574/1044] Add verbose output of image pulling Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- ...181016052850_easyengine_insert_docker_images_version.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/migrations/db/20181016052850_easyengine_insert_docker_images_version.php b/migrations/db/20181016052850_easyengine_insert_docker_images_version.php index bcd75f2b3..80f20c3af 100644 --- a/migrations/db/20181016052850_easyengine_insert_docker_images_version.php +++ b/migrations/db/20181016052850_easyengine_insert_docker_images_version.php @@ -27,13 +27,13 @@ public function __construct() { */ public function up() { - EE::log( 'Checking/Pulling required images' ); + EE::log( 'Checking and Pulling required images. This may take some time.' ); $images = EE\Utils\get_image_versions(); $query = ''; foreach ( $images as $image => $tag ) { - EE::debug( "Checking/Pulling docker image $image:$tag" ); - if ( ! \EE::exec( "docker pull ${image}:${tag}" ) ) { + EE::log( "Checking and Pulling docker image $image:$tag" ); + if ( ! \EE::exec( "docker pull ${image}:${tag}", true, true ) ) { throw new \Exception( "Unable to pull ${image}:${tag}. Please check logs for more details." ); } $query .= "INSERT INTO options VALUES( '${image}', '${tag}' );"; From 3fe7c86e4fc6a21dd79131ddc6745dc45c8cc29a Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 20 Nov 2018 01:20:25 +0530 Subject: [PATCH 0575/1044] Update execution of custom container migrations Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Runner.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 20732a32d..fee163c5c 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -71,10 +71,8 @@ private function migrate() { $rsp = new \EE\RevertableStepProcessor(); $version = Option::where( 'key', 'version' ); - if ( ! empty( $version ) ) { - $rsp->add_step( 'ee-custom-container-migrations', 'EE\Migration\CustomContainerMigrations::execute_migrations' ); - $rsp->add_step( 'ee-docker-image-migrations', 'EE\Migration\Containers::start_container_migration' ); - } + $rsp->add_step( 'ee-custom-container-migrations', 'EE\Migration\CustomContainerMigrations::execute_migrations' ); + $rsp->add_step( 'ee-docker-image-migrations', 'EE\Migration\Containers::start_container_migration' ); $rsp->add_step( 'ee-db-migrations', 'EE\Migration\Executor::execute_migrations' ); return $rsp->execute(); } From e4a436a74c1dcaaacc0302663941864f3b534055 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 20 Nov 2018 01:20:51 +0530 Subject: [PATCH 0576/1044] Add files and directories delete function for migrations Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Migration/SiteContainers.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/php/EE/Migration/SiteContainers.php b/php/EE/Migration/SiteContainers.php index d7a8ef47b..523e20cdf 100644 --- a/php/EE/Migration/SiteContainers.php +++ b/php/EE/Migration/SiteContainers.php @@ -182,6 +182,16 @@ public static function backup_restore( $source, $destination = '', $delete_diffe } } + /** + * Function to delete file/directory. + * + * @param string|array $path_to_delete File(s)/Director(y/ies) to be deleted. + */ + public static function delete( $path_to_delete ) { + $fs = new Filesystem(); + $fs->remove( $path_to_delete ); + } + /** * Function to reload site's nginx. * From 2426d3295facb6b33dceb5ce54444d608a13bf83 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 20 Nov 2018 01:41:44 +0530 Subject: [PATCH 0577/1044] Update migration execution flow Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Runner.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index fee163c5c..7c1ec5a83 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -71,9 +71,9 @@ private function migrate() { $rsp = new \EE\RevertableStepProcessor(); $version = Option::where( 'key', 'version' ); + $rsp->add_step( 'ee-db-migrations', 'EE\Migration\Executor::execute_migrations' ); $rsp->add_step( 'ee-custom-container-migrations', 'EE\Migration\CustomContainerMigrations::execute_migrations' ); $rsp->add_step( 'ee-docker-image-migrations', 'EE\Migration\Containers::start_container_migration' ); - $rsp->add_step( 'ee-db-migrations', 'EE\Migration\Executor::execute_migrations' ); return $rsp->execute(); } From 294a656a92bd301d6fb9f53e30234dae2285b1bd Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 20 Nov 2018 01:55:35 +0530 Subject: [PATCH 0578/1044] Remove unnecessary variable Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Runner.php | 1 - 1 file changed, 1 deletion(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 7c1ec5a83..96b4cb32a 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -70,7 +70,6 @@ private function init_ee() { private function migrate() { $rsp = new \EE\RevertableStepProcessor(); - $version = Option::where( 'key', 'version' ); $rsp->add_step( 'ee-db-migrations', 'EE\Migration\Executor::execute_migrations' ); $rsp->add_step( 'ee-custom-container-migrations', 'EE\Migration\CustomContainerMigrations::execute_migrations' ); $rsp->add_step( 'ee-docker-image-migrations', 'EE\Migration\Containers::start_container_migration' ); From 829fb334322e741d2b65c94f90968f94662d0bdf Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 20 Nov 2018 12:46:58 +0530 Subject: [PATCH 0579/1044] Skip checks and migrations on 'ee help' and 'ee cli' commands Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Runner.php | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index d66ac1891..1081d5c10 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -51,21 +51,6 @@ public function __get( $key ) { */ private function init_ee() { - // Minimum requirement checks. - $docker_running = 'docker ps > /dev/null'; - if ( ! EE::exec( $docker_running ) ) { - EE::error( 'docker not installed or not running.' ); - } - - $docker_compose_installed = 'command -v docker-compose > /dev/null'; - if ( ! EE::exec( $docker_compose_installed ) ) { - EE::error( 'EasyEngine requires docker-compose.' ); - } - - if ( version_compare( PHP_VERSION, '7.2.0' ) < 0 ) { - EE::error( 'EasyEngine requires minimum PHP 7.2.0 to run.' ); - } - $this->ensure_present_in_config( 'locale', 'en_US' ); $this->ensure_present_in_config( 'ee_installer_version', 'stable' ); @@ -76,7 +61,30 @@ private function init_ee() { if ( ! is_dir( $db_dir ) ) { mkdir( $db_dir ); } - $this->maybe_trigger_migration(); + + if ( + ! empty( $this->arguments ) && + ( ! in_array( $this->arguments[0], [ 'cli', 'help' ], true ) || + $this->arguments === [ 'cli', 'update' ] ) + ) { + + // Minimum requirement checks. + $docker_running = 'docker ps > /dev/null'; + if ( ! EE::exec( $docker_running ) ) { + EE::error( 'docker not installed or not running.' ); + } + + $docker_compose_installed = 'command -v docker-compose > /dev/null'; + if ( ! EE::exec( $docker_compose_installed ) ) { + EE::error( 'EasyEngine requires docker-compose.' ); + } + + if ( version_compare( PHP_VERSION, '7.2.0' ) < 0 ) { + EE::error( 'EasyEngine requires minimum PHP 7.2.0 to run.' ); + } + + $this->maybe_trigger_migration(); + } } /** From 8bbc93a33e81a9366badc5a36a9889727e4164f3 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 20 Nov 2018 15:05:56 +0530 Subject: [PATCH 0580/1044] Add self-uninstall in exception Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Runner.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 1081d5c10..953411843 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -65,7 +65,8 @@ private function init_ee() { if ( ! empty( $this->arguments ) && ( ! in_array( $this->arguments[0], [ 'cli', 'help' ], true ) || - $this->arguments === [ 'cli', 'update' ] ) + $this->arguments === [ 'cli', 'update' ] || + $this->arguments === [ 'cli', 'self-uninstall' ] ) ) { // Minimum requirement checks. From 3aaa591b906619f3e8c4fb7c37b5ab9ed5079330 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 20 Nov 2018 16:44:45 +0530 Subject: [PATCH 0581/1044] Skip migrations and checks only on 'ee help' and 'ee cli version' Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Runner.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 953411843..436a4b16b 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -64,10 +64,10 @@ private function init_ee() { if ( ! empty( $this->arguments ) && - ( ! in_array( $this->arguments[0], [ 'cli', 'help' ], true ) || - $this->arguments === [ 'cli', 'update' ] || - $this->arguments === [ 'cli', 'self-uninstall' ] ) - ) { + ( 'help' !== $this->arguments[0] ) + && $this->arguments !== [ 'cli', 'version' ] + ) + { // Minimum requirement checks. $docker_running = 'docker ps > /dev/null'; From b432c7110ba805a610bc62a9d07e242c98ef8467 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 20 Nov 2018 16:52:48 +0530 Subject: [PATCH 0582/1044] Fix revert-global containers variable Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Migration/GlobalContainers.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/EE/Migration/GlobalContainers.php b/php/EE/Migration/GlobalContainers.php index 881a03113..12f80ab89 100644 --- a/php/EE/Migration/GlobalContainers.php +++ b/php/EE/Migration/GlobalContainers.php @@ -41,7 +41,7 @@ public static function revert_global_containers( $source_path, $dest_path, $upda $services_to_regenerate = ''; $all_global_images = self::get_all_global_images_with_service_name(); - foreach ( $updated_global_images as $image_name ) { + foreach ( $updated_images as $image_name ) { $global_container_name = $all_global_images[ $image_name ]; $services_to_regenerate .= str_replace( '-', '_', ltrim( $global_container_name, 'ee-' ) ) . ' '; } From 105cfedcbe5ddabc6d163441e8c0123001a7b639 Mon Sep 17 00:00:00 2001 From: Mriyam Tamuli <mbtamuli@gmail.com> Date: Tue, 20 Nov 2018 19:07:15 +0530 Subject: [PATCH 0583/1044] Update composer dependencies and docker image versions Signed-off-by: Mriyam Tamuli <mbtamuli@gmail.com> --- composer.json | 14 ++++---- composer.lock | 88 +++++++++++++++++++++++------------------------ img-versions.json | 16 ++++----- 3 files changed, 59 insertions(+), 59 deletions(-) diff --git a/composer.json b/composer.json index 6010ba31b..6c405720c 100644 --- a/composer.json +++ b/composer.json @@ -27,15 +27,15 @@ "php": ">=7.0", "composer/composer": "^1.2.0", "composer/semver": "~1.0", - "easyengine/admin-tools-command": "v1.0.0-rc.1", - "easyengine/auth-command": "v1.0.0-rc.2", + "easyengine/admin-tools-command": "v1.0.0", + "easyengine/auth-command": "v1.0.0", "easyengine/config-command": "v1.0.0-rc.1", "easyengine/cron-command": "v1.0.0-rc.2", - "easyengine/mailhog-command": "v1.0.0-rc.1", - "easyengine/site-command": "v2.2.1", - "easyengine/site-type-wp": "v1.0.0-rc.1", - "easyengine/site-type-php": "v1.0.0-rc.2", - "easyengine/service-command": "v1.0.0-rc.1", + "easyengine/mailhog-command": "v1.0.0", + "easyengine/site-command": "v2.2.2", + "easyengine/site-type-wp": "v1.0.0", + "easyengine/site-type-php": "v1.0.0", + "easyengine/service-command": "v1.0.0", "easyengine/shell-command" : "v1.0.0-rc.1", "justinrainbow/json-schema": "~5.2.5", "monolog/monolog": "^1.23", diff --git a/composer.lock b/composer.lock index bf657c78d..e066b17de 100644 --- a/composer.lock +++ b/composer.lock @@ -4,11 +4,11 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "18ea186f7d6d208e9573caad5d886bd4", + "content-hash": "db5360d5481a14c4735e65361adb0e64", "packages": [ { "name": "acmephp/core", - "version": "dev-master", + "version": "1.0.0", "source": { "type": "git", "url": "https://github.com/acmephp/core.git", @@ -437,16 +437,16 @@ }, { "name": "easyengine/admin-tools-command", - "version": "v1.0.0-rc.1", + "version": "v1.0.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/admin-tools-command.git", - "reference": "375f5630e928591569629f04e67637c4e61bcc91" + "reference": "e5f608d89351aa59e6aa811cbe78a937a306d2b2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/admin-tools-command/zipball/375f5630e928591569629f04e67637c4e61bcc91", - "reference": "375f5630e928591569629f04e67637c4e61bcc91", + "url": "https://api.github.com/repos/EasyEngine/admin-tools-command/zipball/e5f608d89351aa59e6aa811cbe78a937a306d2b2", + "reference": "e5f608d89351aa59e6aa811cbe78a937a306d2b2", "shasum": "" }, "type": "ee-cli-package", @@ -476,20 +476,20 @@ ], "description": "Command to manage admin tools for php based sites.", "homepage": "https://github.com/easyengine/amdin-tools", - "time": "2018-10-30T08:26:49+00:00" + "time": "2018-11-20T12:18:53+00:00" }, { "name": "easyengine/auth-command", - "version": "v1.0.0-rc.2", + "version": "v1.0.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/auth-command.git", - "reference": "1a6356e4ca4f9d917e4f5e414752a1e50a9651a2" + "reference": "4fb77a34be9e735ad2325475602fcbf5a4e148cc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/auth-command/zipball/1a6356e4ca4f9d917e4f5e414752a1e50a9651a2", - "reference": "1a6356e4ca4f9d917e4f5e414752a1e50a9651a2", + "url": "https://api.github.com/repos/EasyEngine/auth-command/zipball/4fb77a34be9e735ad2325475602fcbf5a4e148cc", + "reference": "4fb77a34be9e735ad2325475602fcbf5a4e148cc", "shasum": "" }, "type": "ee-cli-package", @@ -524,7 +524,7 @@ ], "description": "Configure HTTP Authentication and whitelisting for EasyEngine site", "homepage": "https://github.com/easyengine/auth-command", - "time": "2018-11-13T11:27:18+00:00" + "time": "2018-11-20T12:20:49+00:00" }, { "name": "easyengine/config-command", @@ -613,16 +613,16 @@ }, { "name": "easyengine/mailhog-command", - "version": "v1.0.0-rc.1", + "version": "v1.0.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/mailhog-command.git", - "reference": "0761d7833b738da32d155d3e3ba7b67be3d51954" + "reference": "8bdcd4b82cba57fc414ff0a443271b51452ee8c0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/mailhog-command/zipball/0761d7833b738da32d155d3e3ba7b67be3d51954", - "reference": "0761d7833b738da32d155d3e3ba7b67be3d51954", + "url": "https://api.github.com/repos/EasyEngine/mailhog-command/zipball/8bdcd4b82cba57fc414ff0a443271b51452ee8c0", + "reference": "8bdcd4b82cba57fc414ff0a443271b51452ee8c0", "shasum": "" }, "type": "ee-cli-package", @@ -652,20 +652,20 @@ ], "description": "Command to manage mailhog", "homepage": "https://github.com/easyengine/mailhog-command", - "time": "2018-10-30T08:46:52+00:00" + "time": "2018-11-20T12:40:06+00:00" }, { "name": "easyengine/service-command", - "version": "v1.0.0-rc.1", + "version": "v1.0.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/service-command.git", - "reference": "745d82fce02e0a8f124566af6a86022e5b3dd5ba" + "reference": "0e7537e98b21b92fcf4492981e38643e1f94809d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/745d82fce02e0a8f124566af6a86022e5b3dd5ba", - "reference": "745d82fce02e0a8f124566af6a86022e5b3dd5ba", + "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/0e7537e98b21b92fcf4492981e38643e1f94809d", + "reference": "0e7537e98b21b92fcf4492981e38643e1f94809d", "shasum": "" }, "type": "ee-cli-package", @@ -697,7 +697,7 @@ ], "description": "Command to manager global containers/services in EasyEngine", "homepage": "https://github.com/easyengine/service-command", - "time": "2018-10-30T08:48:25+00:00" + "time": "2018-11-20T12:41:28+00:00" }, { "name": "easyengine/shell-command", @@ -741,20 +741,20 @@ }, { "name": "easyengine/site-command", - "version": "v2.2.1", + "version": "v2.2.2", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "68ac8377e4775b1d9d5a730bcbb0177ced16da02" + "reference": "687801e8357ee8bfbd17ee943af47efb443290d6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/68ac8377e4775b1d9d5a730bcbb0177ced16da02", - "reference": "68ac8377e4775b1d9d5a730bcbb0177ced16da02", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/687801e8357ee8bfbd17ee943af47efb443290d6", + "reference": "687801e8357ee8bfbd17ee943af47efb443290d6", "shasum": "" }, "require": { - "acmephp/core": "dev-master", + "acmephp/core": "1.0.0", "ext-openssl": "*", "guzzlehttp/guzzle": "^6.0", "league/flysystem": "^1.0.19", @@ -796,20 +796,20 @@ "MIT" ], "homepage": "https://github.com/easyengine/site-command", - "time": "2018-11-13T11:32:41+00:00" + "time": "2018-11-20T13:08:35+00:00" }, { "name": "easyengine/site-type-php", - "version": "v1.0.0-rc.2", + "version": "v1.0.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-php.git", - "reference": "4e103135c11ce3b7f70f8f11749ffa38299b2255" + "reference": "e776037e6bc99ce6bbb588d6332b5be4d8360b80" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/4e103135c11ce3b7f70f8f11749ffa38299b2255", - "reference": "4e103135c11ce3b7f70f8f11749ffa38299b2255", + "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/e776037e6bc99ce6bbb588d6332b5be4d8360b80", + "reference": "e776037e6bc99ce6bbb588d6332b5be4d8360b80", "shasum": "" }, "require-dev": { @@ -836,20 +836,20 @@ ], "description": "EasyEngine package for PHP site creation.", "homepage": "https://github.com/easyengine/site-type-php", - "time": "2018-11-13T11:35:17+00:00" + "time": "2018-11-20T12:58:39+00:00" }, { "name": "easyengine/site-type-wp", - "version": "v1.0.0-rc.1", + "version": "v1.0.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-wp.git", - "reference": "f2978da56ba16b9be9b0b7b91228569a932c1f1b" + "reference": "fb2bcbe5aa3eb33fe3f111c746ba626d31e6f10f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/f2978da56ba16b9be9b0b7b91228569a932c1f1b", - "reference": "f2978da56ba16b9be9b0b7b91228569a932c1f1b", + "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/fb2bcbe5aa3eb33fe3f111c746ba626d31e6f10f", + "reference": "fb2bcbe5aa3eb33fe3f111c746ba626d31e6f10f", "shasum": "" }, "require-dev": { @@ -888,7 +888,7 @@ ], "description": "EasyEngine site type package for WordPress site creation.", "homepage": "https://github.com/easyengine/site-type-wp", - "time": "2018-10-30T10:38:57+00:00" + "time": "2018-11-20T12:58:28+00:00" }, { "name": "guzzlehttp/guzzle", @@ -3283,12 +3283,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "74a42b8d8d9f9cd672be58e7d1c65094da4ae971" + "reference": "fd696a6dc1b30ec46ec4ca16831ca24ef22bb970" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/74a42b8d8d9f9cd672be58e7d1c65094da4ae971", - "reference": "74a42b8d8d9f9cd672be58e7d1c65094da4ae971", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/fd696a6dc1b30ec46ec4ca16831ca24ef22bb970", + "reference": "fd696a6dc1b30ec46ec4ca16831ca24ef22bb970", "shasum": "" }, "conflict": { @@ -3362,7 +3362,7 @@ "pagarme/pagarme-php": ">=0,<3", "paragonie/random_compat": "<2", "paypal/merchant-sdk-php": "<3.12", - "phpmailer/phpmailer": ">=5,<5.2.24", + "phpmailer/phpmailer": ">=5,<5.2.27|>=6,<6.0.6", "phpunit/phpunit": ">=4.8.19,<4.8.28|>=5.0.10,<5.6.3", "phpwhois/phpwhois": "<=4.2.5", "phpxmlrpc/extras": "<0.6.1", @@ -3414,7 +3414,7 @@ "symfony/yaml": ">=2,<2.0.22|>=2.1,<2.1.7", "tecnickcom/tcpdf": "<6.2.22", "thelia/backoffice-default-template": ">=2.1,<2.1.2", - "thelia/thelia": ">=2.1.0-beta1,<2.1.3|>=2.1,<2.1.2", + "thelia/thelia": ">=2.1,<2.1.2|>=2.1.0-beta1,<2.1.3", "theonedemon/phpwhois": "<=4.2.5", "titon/framework": ">=0,<9.9.99", "truckersmp/phpwhois": "<=4.3.1", @@ -3471,7 +3471,7 @@ } ], "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", - "time": "2018-11-01T18:39:28+00:00" + "time": "2018-11-16T03:31:38+00:00" }, { "name": "squizlabs/php_codesniffer", diff --git a/img-versions.json b/img-versions.json index 2a3acbdde..e591450b3 100644 --- a/img-versions.json +++ b/img-versions.json @@ -1,10 +1,10 @@ { - "easyengine/cron": "v4.0.0-rc.1", - "easyengine/mailhog": "v4.0.0-rc.1", - "easyengine/mariadb": "v4.0.0-rc.1", - "easyengine/nginx-proxy": "v4.0.0-rc.2", - "easyengine/nginx": "v4.0.0-rc.1", - "easyengine/php": "v4.0.0-rc.2", - "easyengine/postfix": "v4.0.0-rc.2", - "easyengine/redis": "v4.0.0-rc.1" + "easyengine/cron": "v4.0.0", + "easyengine/mailhog": "v4.0.0", + "easyengine/mariadb": "v4.0.0", + "easyengine/nginx-proxy": "v4.0.0", + "easyengine/nginx": "v4.0.0", + "easyengine/php": "v4.0.0", + "easyengine/postfix": "v4.0.0", + "easyengine/redis": "v4.0.0" } From 2a17500a1c0fbc90c3477081ee9c9f3e9c19a029 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 20 Nov 2018 20:38:55 +0530 Subject: [PATCH 0584/1044] Force enable site in migrations Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Migration/SiteContainers.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/EE/Migration/SiteContainers.php b/php/EE/Migration/SiteContainers.php index 523e20cdf..4d22e76e8 100644 --- a/php/EE/Migration/SiteContainers.php +++ b/php/EE/Migration/SiteContainers.php @@ -111,7 +111,7 @@ public static function generate_site_docker_compose_file( $site_info, $site_obje public static function enable_site( $site_info, $site_object ) { EE::debug( "Start enabling ${site_info['site_url']}" ); try { - $site_object->enable( [ $site_info['site_url'] ], [], false ); + $site_object->enable( [ $site_info['site_url'] ], [ 'force' => true ], false ); } catch ( \Exception $e ) { throw new \Exception( $e->getMessage() ); } From 2d55ae8ea14405b59346aa23c6f636d333ff410f Mon Sep 17 00:00:00 2001 From: Rahul Bansal <rahul.bansal@rtcamp.com> Date: Tue, 20 Nov 2018 20:57:48 +0530 Subject: [PATCH 0585/1044] Delete build-and-release.md --- docs/build-and-release.md | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 docs/build-and-release.md diff --git a/docs/build-and-release.md b/docs/build-and-release.md deleted file mode 100644 index 1229879aa..000000000 --- a/docs/build-and-release.md +++ /dev/null @@ -1,10 +0,0 @@ -Build and Release Process -=== - -Currently EasyEngine v4 is in development stage. Hence the main branch for v4 is [master-v4](https://github.com/easyengine/easyengine/tree/master-v4) and the ongoing development branch is [develop-v4](https://github.com/easyengine/easyengine/tree/develop-v4). - -The current build and release process uses [travis-ci](https://travis-ci.org/). - -* Whenever any commit is pushed or merged into the `develop-v4` branch, it triggers the travis-ci to generate a `nightly phar` and commits it to the [easyengine-builds](https://github.com/easyengine/easyengine-builds) repository. - -* Similarly, whenever any commit is pushed or merged into the `releas/v4` branch, it triggers the travis-ci to generate a `stable phar` and commits it to the [easyengine-builds](https://github.com/easyengine/easyengine-builds) repository. \ No newline at end of file From d8ea4786f8c2aca67b7591df490229ccf4e9a5af Mon Sep 17 00:00:00 2001 From: Rahul Bansal <rahul.bansal@rtcamp.com> Date: Tue, 20 Nov 2018 20:58:34 +0530 Subject: [PATCH 0586/1044] Delete developer-docs.md --- docs/developer-docs.md | 91 ------------------------------------------ 1 file changed, 91 deletions(-) delete mode 100644 docs/developer-docs.md diff --git a/docs/developer-docs.md b/docs/developer-docs.md deleted file mode 100644 index 1cef66755..000000000 --- a/docs/developer-docs.md +++ /dev/null @@ -1,91 +0,0 @@ -EasyEngine Developer Docs -========================= - -## Requirements - -* Git -* PHP -* Composer - -Before starting refer the [core repository structure](core-repo-structure.md) and the [structure for multiple repositories](structure-for-multiple-repos.md). - -## Steps for working on core repository - -1. Fork the EasyEngine core repository, clone it locally and checkout the development branch. -```bash -git clone git@github.com:your-username/easyengine.git && git checkout develop-v4 -``` -2. Run `composer install` in the core repository after this. - -3. Make required changes and check them by running it locally using the following from the easyengine repository root: - -```bash -$ ./bin/ee command -``` - -## Steps for working on existing commands - -1. Clone the EasyEngine core repository locally and checkout the development branch. -```bash -git clone git@github.com:EasyEngine/easyengine.git && git checkout develop-v4 -``` - -2. Fork the command you want to work on. - -3. Update the `composer.json` in the EasyEngine core repository, replace that command from `require` block to have your command name. For example lets replace site command: - -~~```"easyengine/site-command": "dev-master"```~~ - -```"your-username/site-command": "dev-master"``` - -4. Append the following section in the `composer.json` for development, eg. for site-command: -``` -"repositories": { - "janedoe/site-command": { - "type": "path", - "url": "path/to/your/forked/repository" - } -} -``` - -5. Run `composer update` in the core repository after this. - -6. Then, run your commands locally using the following from the easyengine repository root: -```bash -$ ./bin/ee command -``` - -## Steps for creating a new command - -1. Fork the [command template repository](https://github.com/EasyEngine/command-template) and rename it to the command you want to create. This will now look like `author/command-name` in your github. - -2. Update the `name` and `homepage` in the `composer.json` of the cloned repository. If the name is not updated properly then composer update/install with it will fail. - -3. Clone the EasyEngine core repository locally and checkout the development branch. -```bash -git clone git@github.com:EasyEngine/easyengine.git && git checkout develop-v4 -``` -4. Update the `composer.json` in the EasyEngine core repository, add the following in `require`: -``` -"author/command-name": "dev-master" -``` -Also, append the following section in the `composer.json` for development: -``` -"repositories": { - "author/command-name": { - "type": "path", - "url": "path/to/your/forked/repository" - } -} -``` - -Or, you can add your repository to packagist and run `composer reqiure author/command-name`. - -5. Run `composer update` in the core repository after this. -6. After that, try running the default command `hello-world` given in the template, it should give a success message as below by running it from the easyengine repository root: -```bash -$ ./bin/ee hello-world -Success: Hello world. -``` - -Note: These manual steps for setting up a new EasyEngine command will be replaced by a scaffold command. \ No newline at end of file From d4bd08151986ce00d85246bc21f22734b89c271a Mon Sep 17 00:00:00 2001 From: Rahul Bansal <rahul.bansal@rtcamp.com> Date: Tue, 20 Nov 2018 20:58:52 +0530 Subject: [PATCH 0587/1044] Delete docker-files.md --- docs/docker-files.md | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 docs/docker-files.md diff --git a/docs/docker-files.md b/docs/docker-files.md deleted file mode 100644 index fe18bc76a..000000000 --- a/docs/docker-files.md +++ /dev/null @@ -1,16 +0,0 @@ -Docker Files -============ - -1. traefik: EasyEngine traefik uses [traefik](https://github.com/containous/traefik) for load-balancing. Træfik is a modern HTTP reverse proxy and load balancer that makes deploying microservices easy. - -2. nginx: EasyEngine nginx image uses [openresty](https://github.com/openresty/docker-openresty) as the base. It is a full-fledged web application nginx server. Multiple additional modules have been added to make it similar to the EasyEngine version 3 nginx server as well as to add EasyEngine's custom configuration on top of it. - -3. php: EasyEngine php image uses [wordpress](https://github.com/docker-library/wordpress) as the base image. Additional php extension that may be required have been added on top of it, also the permissions of the site data on the host machine is given to the user creating the site in this image. - -4. redis: EasyEngine redis image uses [redis](https://github.com/docker-library/redis) image. - -5. mail: EasyEngine mail image uses [mailhog](https://github.com/mailhog/MailHog) image. - -6. db: EasyEngine db image uses [mariadb](https://github.com/docker-library/mariadb/) image. - -7. phpmyadmin: EasyEngine db image uses [phpmyadmin](https://github.com/phpmyadmin/docker) image. \ No newline at end of file From 28f8bee57aacb581b953c4b202049c0c8e74bfb2 Mon Sep 17 00:00:00 2001 From: Rahul Bansal <rahul.bansal@rtcamp.com> Date: Tue, 20 Nov 2018 20:59:08 +0530 Subject: [PATCH 0588/1044] Delete structure-for-multiple-repos.md --- docs/structure-for-multiple-repos.md | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 docs/structure-for-multiple-repos.md diff --git a/docs/structure-for-multiple-repos.md b/docs/structure-for-multiple-repos.md deleted file mode 100644 index c4cfad164..000000000 --- a/docs/structure-for-multiple-repos.md +++ /dev/null @@ -1,12 +0,0 @@ -Structure For Multiple Reops -============================ - -EasyEngine v4 follows [WP-CLI](https://github.com/wp-cli/wp-cli) as the base of creation, hence it consists of multiple repos. The core repo [EasyEngine](https://github.com/EasyEngine/easyengine) contains the main structure and cli interface to facilitate the execution of all the commands. - -Each command has a separate repository like: [site-command](https://github.com/easyengine/site-command), [wp-command](https://github.com/easyengine/wp-command) etc., and they are added as commands to EasyEngine via composer packages. - -Apart from the commands, there are also other miscellaneous repositories like: - -* [easyengine-builds](https://github.com/easyengine/easyengine-builds) that contains the stable, as well as nightly builds of phar generated from the main repository. -* [dockerfiles](https://github.com/easyengine/dockerfiles) repository contains all the dockerfiles that are in use by EasyEngine. -* [installer](https://github.com/easyengine/installer) containing the installer scripts for EasyEngine. \ No newline at end of file From 774736895744b98e1d2d964c48992ed7114a7939 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 20 Nov 2018 22:06:29 +0530 Subject: [PATCH 0589/1044] Update nginx proxy version conf only on change Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Runner.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 436a4b16b..c7227ae16 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -857,8 +857,10 @@ private function trigger_migration( $version ) { if ( ! $this->migrate() ) { EE::error( 'There was some error while migrating. Please check logs.' ); } - Option::set( 'version', $version ); - \EE\Service\Utils\set_nginx_proxy_version_conf(); + if ( $version !== Option::get( 'version' ) ) { + Option::set( 'version', $version ); + \EE\Service\Utils\set_nginx_proxy_version_conf(); + } } /** From af4a663d7c7a0aae5b37b0542d32bc69af30ffa0 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Wed, 21 Nov 2018 17:31:46 +0530 Subject: [PATCH 0590/1044] Add php5.6 image version Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- img-versions.json | 1 + 1 file changed, 1 insertion(+) diff --git a/img-versions.json b/img-versions.json index e591450b3..3d9ee513f 100644 --- a/img-versions.json +++ b/img-versions.json @@ -5,6 +5,7 @@ "easyengine/nginx-proxy": "v4.0.0", "easyengine/nginx": "v4.0.0", "easyengine/php": "v4.0.0", + "easyengine/php5.6": "v4.0.0", "easyengine/postfix": "v4.0.0", "easyengine/redis": "v4.0.0" } From 8bff8e0a757751fe0c67bb0ee1388e8ad9902c63 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Wed, 21 Nov 2018 19:16:09 +0530 Subject: [PATCH 0591/1044] Skip pulling of 5.6 image temporarily Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- .../20181016052850_easyengine_insert_docker_images_version.php | 3 +++ php/EE/Migration/Containers.php | 3 +++ 2 files changed, 6 insertions(+) diff --git a/migrations/db/20181016052850_easyengine_insert_docker_images_version.php b/migrations/db/20181016052850_easyengine_insert_docker_images_version.php index 80f20c3af..5a8674327 100644 --- a/migrations/db/20181016052850_easyengine_insert_docker_images_version.php +++ b/migrations/db/20181016052850_easyengine_insert_docker_images_version.php @@ -32,6 +32,9 @@ public function up() { $query = ''; foreach ( $images as $image => $tag ) { + if ( 'easyengine/php5.6' === $image ) { + continue; + } EE::log( "Checking and Pulling docker image $image:$tag" ); if ( ! \EE::exec( "docker pull ${image}:${tag}", true, true ) ) { throw new \Exception( "Unable to pull ${image}:${tag}. Please check logs for more details." ); diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index 271156058..88a3e6e1a 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -30,6 +30,9 @@ public static function start_container_migration() { foreach ( $img_versions as $img => $version ) { if ( $current_versions[ $img ] !== $version ) { $updated_images[] = $img; + if ( 'easyengine/php5.6' === $img ) { + continue; + } self::pull_or_error( $img, $version ); } } From 6891a702e0e97122b77935bafc4cc19d290e8049 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Wed, 21 Nov 2018 19:33:27 +0530 Subject: [PATCH 0592/1044] Update 5.6 image check Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Migration/Containers.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index 88a3e6e1a..cf881acc1 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -28,11 +28,11 @@ public static function start_container_migration() { $updated_images = []; foreach ( $img_versions as $img => $version ) { + if ( 'easyengine/php5.6' === $img ) { + continue; + } if ( $current_versions[ $img ] !== $version ) { $updated_images[] = $img; - if ( 'easyengine/php5.6' === $img ) { - continue; - } self::pull_or_error( $img, $version ); } } From 9b9dd8ac240d66970e3ef9f4fef72637fce88dc8 Mon Sep 17 00:00:00 2001 From: Mriyam Tamuli <mbtamuli@gmail.com> Date: Wed, 21 Nov 2018 21:04:01 +0530 Subject: [PATCH 0593/1044] Update composer dependencies Signed-off-by: Mriyam Tamuli <mbtamuli@gmail.com> --- composer.lock | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/composer.lock b/composer.lock index e066b17de..eaa050dfd 100644 --- a/composer.lock +++ b/composer.lock @@ -660,12 +660,12 @@ "source": { "type": "git", "url": "https://github.com/EasyEngine/service-command.git", - "reference": "0e7537e98b21b92fcf4492981e38643e1f94809d" + "reference": "e9c6374a997d31f9f9584b636e25bc009640bd8d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/0e7537e98b21b92fcf4492981e38643e1f94809d", - "reference": "0e7537e98b21b92fcf4492981e38643e1f94809d", + "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/e9c6374a997d31f9f9584b636e25bc009640bd8d", + "reference": "e9c6374a997d31f9f9584b636e25bc009640bd8d", "shasum": "" }, "type": "ee-cli-package", @@ -745,12 +745,12 @@ "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "687801e8357ee8bfbd17ee943af47efb443290d6" + "reference": "49222c5fc19f96be5beec5833b9d720163b16e28" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/687801e8357ee8bfbd17ee943af47efb443290d6", - "reference": "687801e8357ee8bfbd17ee943af47efb443290d6", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/49222c5fc19f96be5beec5833b9d720163b16e28", + "reference": "49222c5fc19f96be5beec5833b9d720163b16e28", "shasum": "" }, "require": { @@ -804,12 +804,12 @@ "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-php.git", - "reference": "e776037e6bc99ce6bbb588d6332b5be4d8360b80" + "reference": "019e3d9ae678b5b179ef5ca9541a4d43bf4e3856" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/e776037e6bc99ce6bbb588d6332b5be4d8360b80", - "reference": "e776037e6bc99ce6bbb588d6332b5be4d8360b80", + "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/019e3d9ae678b5b179ef5ca9541a4d43bf4e3856", + "reference": "019e3d9ae678b5b179ef5ca9541a4d43bf4e3856", "shasum": "" }, "require-dev": { @@ -844,12 +844,12 @@ "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-wp.git", - "reference": "fb2bcbe5aa3eb33fe3f111c746ba626d31e6f10f" + "reference": "96a13b42fb64ac857071079557e01268e71f4c4f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/fb2bcbe5aa3eb33fe3f111c746ba626d31e6f10f", - "reference": "fb2bcbe5aa3eb33fe3f111c746ba626d31e6f10f", + "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/96a13b42fb64ac857071079557e01268e71f4c4f", + "reference": "96a13b42fb64ac857071079557e01268e71f4c4f", "shasum": "" }, "require-dev": { @@ -1446,16 +1446,16 @@ }, { "name": "psr/log", - "version": "1.0.2", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", "shasum": "" }, "require": { @@ -1489,7 +1489,7 @@ "psr", "psr-3" ], - "time": "2016-10-10T12:19:37+00:00" + "time": "2018-11-20T15:27:04+00:00" }, { "name": "rmccue/requests", @@ -3283,12 +3283,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "fd696a6dc1b30ec46ec4ca16831ca24ef22bb970" + "reference": "d71acf1340f7fb24b3469a892c130263c08e0a43" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/fd696a6dc1b30ec46ec4ca16831ca24ef22bb970", - "reference": "fd696a6dc1b30ec46ec4ca16831ca24ef22bb970", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/d71acf1340f7fb24b3469a892c130263c08e0a43", + "reference": "d71acf1340f7fb24b3469a892c130263c08e0a43", "shasum": "" }, "conflict": { @@ -3363,6 +3363,7 @@ "paragonie/random_compat": "<2", "paypal/merchant-sdk-php": "<3.12", "phpmailer/phpmailer": ">=5,<5.2.27|>=6,<6.0.6", + "phpoffice/phpspreadsheet": "<=1.5", "phpunit/phpunit": ">=4.8.19,<4.8.28|>=5.0.10,<5.6.3", "phpwhois/phpwhois": "<=4.2.5", "phpxmlrpc/extras": "<0.6.1", @@ -3471,7 +3472,7 @@ } ], "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", - "time": "2018-11-16T03:31:38+00:00" + "time": "2018-11-21T13:18:22+00:00" }, { "name": "squizlabs/php_codesniffer", From 9eca376c5027d199e07442689999bee107982cb4 Mon Sep 17 00:00:00 2001 From: Mriyam Tamuli <mbtamuli@gmail.com> Date: Wed, 21 Nov 2018 22:22:30 +0530 Subject: [PATCH 0594/1044] Update composer dependencies Signed-off-by: Mriyam Tamuli <mbtamuli@gmail.com> --- composer.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.lock b/composer.lock index eaa050dfd..6fa48ff3e 100644 --- a/composer.lock +++ b/composer.lock @@ -660,12 +660,12 @@ "source": { "type": "git", "url": "https://github.com/EasyEngine/service-command.git", - "reference": "e9c6374a997d31f9f9584b636e25bc009640bd8d" + "reference": "547de8e72d1e2ff8cae1746c3f56f8d362042b79" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/e9c6374a997d31f9f9584b636e25bc009640bd8d", - "reference": "e9c6374a997d31f9f9584b636e25bc009640bd8d", + "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/547de8e72d1e2ff8cae1746c3f56f8d362042b79", + "reference": "547de8e72d1e2ff8cae1746c3f56f8d362042b79", "shasum": "" }, "type": "ee-cli-package", From bde6d382090a32a5fd3cf6bb3137c0e7717d491a Mon Sep 17 00:00:00 2001 From: Rahul Prajapati <rahul.prajapati@live.in> Date: Thu, 22 Nov 2018 02:09:13 +0530 Subject: [PATCH 0595/1044] Cleanup EE v3 to merge v4. --- .github/CONTRIBUTING.md | 34 - .github/ISSUE_TEMPLATE.md | 9 - .gitignore | 66 - .travis.yml | 114 - CHANGELOG.txt | 470 --- LICENSE | 21 - README.md | 122 - config/bash_completion.d/ee_auto.rc | 384 --- config/ee.conf | 82 - config/plugins.d/clean.conf | 8 - config/plugins.d/debug.conf | 8 - config/plugins.d/import_slow_log.conf | 8 - config/plugins.d/info.conf | 11 - config/plugins.d/log.conf | 8 - config/plugins.d/secure.conf | 8 - config/plugins.d/site.conf | 8 - config/plugins.d/stack.conf | 8 - config/plugins.d/update.conf | 8 - docs/ee.8 | 333 -- ee/__init__.py | 1 - ee/cli/__init__.py | 0 ee/cli/bootstrap.py | 11 - ee/cli/controllers/__init__.py | 0 ee/cli/controllers/base.py | 25 - ee/cli/ext/__init__.py | 0 ee/cli/ext/ee_outputhandler.py | 20 - ee/cli/main.py | 135 - ee/cli/plugins/__init__.py | 0 ee/cli/plugins/clean.py | 108 - ee/cli/plugins/debug.py | 858 ----- ee/cli/plugins/import_slow_log.py | 34 - ee/cli/plugins/info.py | 290 -- ee/cli/plugins/log.py | 578 ---- ee/cli/plugins/models.py | 59 - ee/cli/plugins/secure.py | 145 - ee/cli/plugins/site.py | 1890 ----------- ee/cli/plugins/site_functions.py | 1498 --------- ee/cli/plugins/sitedb.py | 129 - ee/cli/plugins/stack.py | 2794 ----------------- ee/cli/plugins/stack_migrate.py | 126 - ee/cli/plugins/stack_services.py | 475 --- ee/cli/plugins/stack_upgrade.py | 270 -- ee/cli/plugins/sync.py | 95 - ee/cli/plugins/update.py | 45 - .../templates/15-content_filter_mode.mustache | 27 - ee/cli/templates/22222.mustache | 64 - ee/cli/templates/50-user.mustache | 17 - ee/cli/templates/__init__.py | 0 ee/cli/templates/acl.mustache | 8 - ee/cli/templates/anemometer.mustache | 255 -- ee/cli/templates/auth-sql-conf.mustache | 11 - ee/cli/templates/blockips.mustache | 2 - ee/cli/templates/default-sieve.mustache | 4 - ee/cli/templates/dovecot-sql-conf.mustache | 12 - ee/cli/templates/dovecot.mustache | 60 - ee/cli/templates/ee-plus.mustache | 84 - ee/cli/templates/fastcgi.mustache | 10 - ee/cli/templates/info_mysql.mustache | 10 - ee/cli/templates/info_nginx.mustache | 10 - ee/cli/templates/info_php.mustache | 35 - ee/cli/templates/locations-php7.mustache | 68 - ee/cli/templates/locations.mustache | 68 - ee/cli/templates/nginx-core.mustache | 60 - ee/cli/templates/pagespeed-common.mustache | 44 - ee/cli/templates/pagespeed-global.mustache | 21 - ee/cli/templates/php-fpm.mustache | 5 - ee/cli/templates/php-hhvm.mustache | 10 - ee/cli/templates/php.mustache | 10 - ee/cli/templates/php7.mustache | 10 - ee/cli/templates/redis-hhvm.mustache | 58 - ee/cli/templates/redis-php7.mustache | 56 - ee/cli/templates/redis.mustache | 57 - ee/cli/templates/siteinfo.mustache | 15 - ee/cli/templates/upstream.mustache | 26 - ee/cli/templates/vimbadmin.mustache | 662 ---- ee/cli/templates/virtual_alias_maps.mustache | 5 - .../templates/virtual_domains_maps.mustache | 5 - .../templates/virtual_mailbox_maps.mustache | 7 - ee/cli/templates/virtualconf-php7.mustache | 49 - ee/cli/templates/virtualconf.mustache | 48 - ee/cli/templates/w3tc-hhvm.mustache | 31 - ee/cli/templates/w3tc-php7.mustache | 31 - ee/cli/templates/w3tc.mustache | 31 - ee/cli/templates/wpcommon-php7.mustache | 21 - ee/cli/templates/wpcommon.mustache | 21 - ee/cli/templates/wpfc-hhvm.mustache | 37 - ee/cli/templates/wpfc-php7.mustache | 37 - ee/cli/templates/wpfc.mustache | 37 - ee/cli/templates/wpsc-hhvm.mustache | 31 - ee/cli/templates/wpsc-php7.mustache | 31 - ee/cli/templates/wpsc.mustache | 31 - ee/cli/templates/wpsubdir.mustache | 10 - ee/core/__init__.py | 0 ee/core/addswap.py | 48 - ee/core/apt_repo.py | 91 - ee/core/aptget.py | 231 -- ee/core/checkfqdn.py | 23 - ee/core/cron.py | 32 - ee/core/database.py | 28 - ee/core/domainvalidate.py | 24 - ee/core/download.py | 45 - ee/core/exc.py | 26 - ee/core/extract.py | 21 - ee/core/fileutils.py | 268 -- ee/core/git.py | 57 - ee/core/logging.py | 47 - ee/core/logwatch.py | 195 -- ee/core/mysql.py | 136 - ee/core/nginxhashbucket.py | 44 - ee/core/sendmail.py | 33 - ee/core/services.py | 134 - ee/core/shellexec.py | 83 - ee/core/sslutils.py | 43 - ee/core/variables.py | 230 -- ee/utils/__init__.py | 0 ee/utils/test.py | 15 - install | 806 ----- requirements.txt | 1 - setup.cfg | 9 - setup.py | 103 - tests/__init__.py | 0 tests/cli/13_test_stack.py | 76 - tests/cli/2_test_stack_services_start.py | 52 - tests/cli/3_test_stack_services_status.py | 52 - tests/cli/4_test_stack_services_stop.py | 52 - tests/cli/5_test_stack_services_restart.py | 52 - tests/cli/8_test_site_create.py | 73 - tests/cli/91_test_site_info.py | 16 - tests/cli/93_test_site_list.py | 22 - tests/cli/95_test_site_show.py | 16 - tests/cli/97_test_site_update.py | 73 - tests/cli/9_test_site_enable.py | 16 - tests/cli/__init__.py | 0 tests/cli/a_test_site_disable.py | 16 - tests/cli/ext/__init__.py | 0 tests/cli/plugins/__init__.py | 0 tests/cli/plugins/test_example.py | 8 - tests/cli/test_clean.py | 40 - tests/cli/test_debug.py | 95 - tests/cli/test_info.py | 28 - tests/cli/test_secure.py | 28 - tests/cli/test_site_delete.py | 38 - tests/cli/test_stack_purge.py | 76 - tests/cli/test_stack_remove.py | 76 - tests/core/__init__.py | 0 145 files changed, 17216 deletions(-) delete mode 100644 .github/CONTRIBUTING.md delete mode 100644 .github/ISSUE_TEMPLATE.md delete mode 100644 .gitignore delete mode 100644 .travis.yml delete mode 100644 CHANGELOG.txt delete mode 100644 LICENSE delete mode 100644 README.md delete mode 100644 config/bash_completion.d/ee_auto.rc delete mode 100644 config/ee.conf delete mode 100644 config/plugins.d/clean.conf delete mode 100644 config/plugins.d/debug.conf delete mode 100644 config/plugins.d/import_slow_log.conf delete mode 100644 config/plugins.d/info.conf delete mode 100644 config/plugins.d/log.conf delete mode 100644 config/plugins.d/secure.conf delete mode 100644 config/plugins.d/site.conf delete mode 100644 config/plugins.d/stack.conf delete mode 100644 config/plugins.d/update.conf delete mode 100644 docs/ee.8 delete mode 100644 ee/__init__.py delete mode 100644 ee/cli/__init__.py delete mode 100644 ee/cli/bootstrap.py delete mode 100644 ee/cli/controllers/__init__.py delete mode 100644 ee/cli/controllers/base.py delete mode 100644 ee/cli/ext/__init__.py delete mode 100644 ee/cli/ext/ee_outputhandler.py delete mode 100644 ee/cli/main.py delete mode 100644 ee/cli/plugins/__init__.py delete mode 100644 ee/cli/plugins/clean.py delete mode 100644 ee/cli/plugins/debug.py delete mode 100644 ee/cli/plugins/import_slow_log.py delete mode 100644 ee/cli/plugins/info.py delete mode 100644 ee/cli/plugins/log.py delete mode 100644 ee/cli/plugins/models.py delete mode 100644 ee/cli/plugins/secure.py delete mode 100644 ee/cli/plugins/site.py delete mode 100644 ee/cli/plugins/site_functions.py delete mode 100644 ee/cli/plugins/sitedb.py delete mode 100644 ee/cli/plugins/stack.py delete mode 100644 ee/cli/plugins/stack_migrate.py delete mode 100644 ee/cli/plugins/stack_services.py delete mode 100644 ee/cli/plugins/stack_upgrade.py delete mode 100644 ee/cli/plugins/sync.py delete mode 100644 ee/cli/plugins/update.py delete mode 100644 ee/cli/templates/15-content_filter_mode.mustache delete mode 100644 ee/cli/templates/22222.mustache delete mode 100644 ee/cli/templates/50-user.mustache delete mode 100644 ee/cli/templates/__init__.py delete mode 100644 ee/cli/templates/acl.mustache delete mode 100644 ee/cli/templates/anemometer.mustache delete mode 100644 ee/cli/templates/auth-sql-conf.mustache delete mode 100644 ee/cli/templates/blockips.mustache delete mode 100644 ee/cli/templates/default-sieve.mustache delete mode 100644 ee/cli/templates/dovecot-sql-conf.mustache delete mode 100644 ee/cli/templates/dovecot.mustache delete mode 100644 ee/cli/templates/ee-plus.mustache delete mode 100644 ee/cli/templates/fastcgi.mustache delete mode 100644 ee/cli/templates/info_mysql.mustache delete mode 100644 ee/cli/templates/info_nginx.mustache delete mode 100644 ee/cli/templates/info_php.mustache delete mode 100644 ee/cli/templates/locations-php7.mustache delete mode 100644 ee/cli/templates/locations.mustache delete mode 100644 ee/cli/templates/nginx-core.mustache delete mode 100644 ee/cli/templates/pagespeed-common.mustache delete mode 100644 ee/cli/templates/pagespeed-global.mustache delete mode 100644 ee/cli/templates/php-fpm.mustache delete mode 100644 ee/cli/templates/php-hhvm.mustache delete mode 100644 ee/cli/templates/php.mustache delete mode 100644 ee/cli/templates/php7.mustache delete mode 100644 ee/cli/templates/redis-hhvm.mustache delete mode 100644 ee/cli/templates/redis-php7.mustache delete mode 100644 ee/cli/templates/redis.mustache delete mode 100644 ee/cli/templates/siteinfo.mustache delete mode 100644 ee/cli/templates/upstream.mustache delete mode 100644 ee/cli/templates/vimbadmin.mustache delete mode 100644 ee/cli/templates/virtual_alias_maps.mustache delete mode 100644 ee/cli/templates/virtual_domains_maps.mustache delete mode 100644 ee/cli/templates/virtual_mailbox_maps.mustache delete mode 100644 ee/cli/templates/virtualconf-php7.mustache delete mode 100644 ee/cli/templates/virtualconf.mustache delete mode 100644 ee/cli/templates/w3tc-hhvm.mustache delete mode 100644 ee/cli/templates/w3tc-php7.mustache delete mode 100644 ee/cli/templates/w3tc.mustache delete mode 100644 ee/cli/templates/wpcommon-php7.mustache delete mode 100644 ee/cli/templates/wpcommon.mustache delete mode 100644 ee/cli/templates/wpfc-hhvm.mustache delete mode 100644 ee/cli/templates/wpfc-php7.mustache delete mode 100644 ee/cli/templates/wpfc.mustache delete mode 100644 ee/cli/templates/wpsc-hhvm.mustache delete mode 100644 ee/cli/templates/wpsc-php7.mustache delete mode 100644 ee/cli/templates/wpsc.mustache delete mode 100644 ee/cli/templates/wpsubdir.mustache delete mode 100644 ee/core/__init__.py delete mode 100644 ee/core/addswap.py delete mode 100644 ee/core/apt_repo.py delete mode 100644 ee/core/aptget.py delete mode 100644 ee/core/checkfqdn.py delete mode 100644 ee/core/cron.py delete mode 100644 ee/core/database.py delete mode 100644 ee/core/domainvalidate.py delete mode 100644 ee/core/download.py delete mode 100644 ee/core/exc.py delete mode 100644 ee/core/extract.py delete mode 100644 ee/core/fileutils.py delete mode 100644 ee/core/git.py delete mode 100644 ee/core/logging.py delete mode 100644 ee/core/logwatch.py delete mode 100644 ee/core/mysql.py delete mode 100644 ee/core/nginxhashbucket.py delete mode 100644 ee/core/sendmail.py delete mode 100644 ee/core/services.py delete mode 100644 ee/core/shellexec.py delete mode 100644 ee/core/sslutils.py delete mode 100644 ee/core/variables.py delete mode 100644 ee/utils/__init__.py delete mode 100644 ee/utils/test.py delete mode 100644 install delete mode 100644 requirements.txt delete mode 100644 setup.cfg delete mode 100644 setup.py delete mode 100644 tests/__init__.py delete mode 100644 tests/cli/13_test_stack.py delete mode 100644 tests/cli/2_test_stack_services_start.py delete mode 100644 tests/cli/3_test_stack_services_status.py delete mode 100644 tests/cli/4_test_stack_services_stop.py delete mode 100644 tests/cli/5_test_stack_services_restart.py delete mode 100644 tests/cli/8_test_site_create.py delete mode 100644 tests/cli/91_test_site_info.py delete mode 100644 tests/cli/93_test_site_list.py delete mode 100644 tests/cli/95_test_site_show.py delete mode 100644 tests/cli/97_test_site_update.py delete mode 100644 tests/cli/9_test_site_enable.py delete mode 100644 tests/cli/__init__.py delete mode 100644 tests/cli/a_test_site_disable.py delete mode 100644 tests/cli/ext/__init__.py delete mode 100644 tests/cli/plugins/__init__.py delete mode 100644 tests/cli/plugins/test_example.py delete mode 100644 tests/cli/test_clean.py delete mode 100644 tests/cli/test_debug.py delete mode 100644 tests/cli/test_info.py delete mode 100644 tests/cli/test_secure.py delete mode 100644 tests/cli/test_site_delete.py delete mode 100644 tests/cli/test_stack_purge.py delete mode 100644 tests/cli/test_stack_remove.py delete mode 100644 tests/core/__init__.py diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md deleted file mode 100644 index 7f557a8e2..000000000 --- a/.github/CONTRIBUTING.md +++ /dev/null @@ -1,34 +0,0 @@ -# Community Guidelines - -This guide details how to get involve in EasyEngine commmunity. Please read this carefully. - - - -## How to get help? - -Please attach the output of following command when open a new support request. - -```bash -lsb_release -a -ee -v -ee info -wp --allow-root --info -``` - -### Where to create issue? - -For free support, please use - http://community.rtcamp.com/c/easyengine - -Please do NOT clutter github issue tracker here with support requests. It hampers development speed of this project. - - -### Pull Requests - -When submitting your code please follow this coding standerds - http://docs.rtcamp.com/easyengine/dev/python/ - - -### EasyEngine Chat - -Developer & contributor discussion: https://gitter.im/rtCamp/easyengine - -Please do NOT use chat for technical support. Chat is limited to developer & contributor disucssion related to EasyEngine future. diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index b2e446cb8..000000000 --- a/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,9 +0,0 @@ -This issue tracker is only for issues related to EasyEngine. Please use http://community.rtcamp.com/c/easyengine for support questions. - -If you feel the issue is a EasyEngine core specific issue, please attach the output of the following commands. - -System Information -- [ ] lsb_release -a -- [ ] ee -v -- [ ] ee info -- [ ] wp --allow-root --info diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 41b775bf7..000000000 --- a/.gitignore +++ /dev/null @@ -1,66 +0,0 @@ -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -.idea/ - -# C extensions -*.so - -# Distribution / packaging -.Python -env/ -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -*.egg-info/ -.installed.cfg -*.egg - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.coverage -.cache -nosetests.xml -coverage.xml - -# Translations -*.mo -*.pot - -# Django stuff: -*.log - -# Sphinx documentation -docs/_build/ - -# PyBuilder -target/ - - -# Vim .swp file -*.swp - -# Folder created for Nose testing -bin/ -coverage_report/ -include/ -local/ -man/ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b487e3ff5..000000000 --- a/.travis.yml +++ /dev/null @@ -1,114 +0,0 @@ -notifications: - slack: easyengine:76AI30tP8P8AcNTaWaQ9ZAT7 - webhooks: - urls: - - https://webhooks.gitter.im/e/bd77a26eab56de803949 - - https://webhooks.gitter.im/e/e3e2feb8384c77bf1a8a - on_success: always # options: [always|never|change] default: always - on_failure: always # options: [always|never|change] default: always - on_start: false # default: false - -language: bash - -before_install: - - rm -rf ~/.gnupg - -before_script: - - sudo rm -rf /etc/mysql/ - - sudo bash -c 'echo example.com > /etc/hostname' - - sudo service hostname restart - - sudo apt-get -qq purge mysql* graphviz* - - sudo apt-get -qq autoremove - - sudo apt-get update - -script: - - lsb_release -a - - unset LANG - - sudo bash -c 'echo -e "[user]\n\tname = abc\n\temail = root@localhost.com" > /home/travis/.gitconfig' - - sudo echo "Travis Banch = $TRAVIS_BRANCH" - - sudo apt-get install -y --force-yes git python3-setuptools python3-dev python3-apt - - sudo bash install $TRAVIS_BRANCH - - sudo ee --help - - sudo ee stack install || sudo tail -n50 /var/log/ee/ee.log - - sudo ee stack install --web || sudo tail -n50 /var/log/ee/ee.log - - sudo ee stack install --admin || sudo tail -n50 /var/log/ee/ee.log - - - sudo ee site create html.net --html || sudo tail -n50 /var/log/ee/ee.log - - sudo ee site create php.com --php || sudo tail -n50 /var/log/ee/ee.log - - sudo ee site create mysql.com --mysql || sudo tail -n50 /var/log/ee/ee.log - - sudo ee site create site1.com --wp || sudo tail -n50 /var/log/ee/ee.log - - - sudo ee site create site2.net --wp --wpsc || sudo tail -n50 /var/log/ee/ee.log - - sudo ee site create site3.net --wp --w3tc || sudo tail -n50 /var/log/ee/ee.log - - sudo ee site create site4.com --wpfc || sudo tail -n50 /var/log/ee/ee.log - - sudo ee site create site4.net --wp --wpfc || sudo tail -n50 /var/log/ee/ee.log - - sudo ee site create site4.org --wpfc --wp || sudo tail -n50 /var/log/ee/ee.log - - sudo ee site create site5.com --wpsubdir || sudo tail -n50 /var/log/ee/ee.log - - - sudo ee site create site6.com --wpsubdir --wpsc || sudo tail -n50 /var/log/ee/ee.log - - sudo ee site create site7.com --wpsubdir --w3tc || sudo tail -n50 /var/log/ee/ee.log - - sudo ee site create site8.com --wpsubdir --wpfc || sudo tail -n50 /var/log/ee/ee.log - - sudo ee site create site8.net --wpfc --wpsubdir || sudo tail -n50 /var/log/ee/ee.log - - sudo ee site create site9.com --wpsubdomain || sudo tail -n50 /var/log/ee/ee.log - - - sudo ee site create site10.org --wpsubdomain --wpsc || sudo tail -n50 /var/log/ee/ee.log - - sudo ee site create site11.org --wpsubdomain --w3tc || sudo tail -n50 /var/log/ee/ee.log - - sudo ee site create site12.org --wpsubdomain --wpfc || sudo tail -n50 /var/log/ee/ee.log - - sudo ee site create site12.in --wpfc --wpsubdomain || sudo tail -n50 /var/log/ee/ee.log - - - yes | sudo ee site create site.hhvm.pagespeed2.com --wpsc --hhvm || sudo tail -n50 /var/log/ee/ee.log - - yes | sudo ee site create site.hhvm.pagespeed4.com --wpfc --hhvm || sudo tail -n50 /var/log/ee/ee.log - - yes | sudo ee site create site.hhvm.pagespeed5.com --wpsubdir --hhvm || sudo tail -n50 /var/log/ee/ee.log - - yes | sudo ee site create site.hhvm.pagespeed6.com --wpsubdir --wpsc --hhvm || sudo tail -n50 /var/log/ee/ee.log - - yes | sudo ee site create site.hhvm.pagespeed8.com --wpsubdir --wpfc --hhvm || sudo tail -n50 /var/log/ee/ee.log - - yes | sudo ee site create site.hhvm.pagespeed9.com --wpsubdomain --hhvm || sudo tail -n50 /var/log/ee/ee.log - - yes | sudo ee site create site.hhvm.pagespeed10.org --wpsubdomain --wpsc --hhvm || sudo tail -n50 /var/log/ee/ee.log - - yes | sudo ee site create site.hhvm.pagespeed12.in --wpfc --wpsubdomain --hhvm || sudo tail -n50 /var/log/ee/ee.log - - - sudo ee site create site1.localtest.me --php --mysql || sudo tail -n50 /var/log/ee/ee.log - - sudo ee site create site2.localtest.me --mysql --html || sudo tail -n50 /var/log/ee/ee.log - - sudo ee site create site3.localtest.me --php --html || sudo tail -n50 /var/log/ee/ee.log - - sudo ee site create site4.localtest.me --wp --wpsubdomain || sudo tail -n50 /var/log/ee/ee.log - - sudo ee site create site5.localtest.me --wp --wpsubdir --wpfc || sudo tail -n50 /var/log/ee/ee.log - - yes | sudo ee site create site6.localtest.me --wpredis || sudo tail -n50 /var/log/ee/ee.log - - yes | sudo ee site create site7.localtest.me --wpsubdomain --wpredis || sudo tail -n50 /var/log/ee/ee.log - - yes | sudo ee site create site8.localtest.me --wpsubdir --wpredis || sudo tail -n50 /var/log/ee/ee.log - - - - sudo ee debug --all || sudo tail -n50 /var/log/ee/ee.log - - sudo ee debug --all=off || sudo tail -n50 /var/log/ee/ee.log - - sudo ee debug site12.net || sudo tail -n50 /var/log/ee/ee.log - - sudo ee debug site12.net --all=off || sudo tail -n50 /var/log/ee/ee.log - - sudo ee site create 1.com --html || sudo tail -n50 /var/log/ee/ee.log - - sudo ee site create 2.com --php || sudo tail -n50 /var/log/ee/ee.log - - sudo ee site create 3.com --mysql || sudo tail -n50 /var/log/ee/ee.log - - - sudo ee site update 1.com --wp || sudo tail -n50 /var/log/ee/ee.log - - sudo ee site update 2.com --wpsubdir || sudo tail -n50 /var/log/ee/ee.log - - sudo ee site update 3.com --wpsubdomain || sudo tail -n50 /var/log/ee/ee.log - - - sudo ee site update site1.com --wp --wpfc || sudo tail -n50 /var/log/ee/ee.log - - sudo ee site update site1.com --wp --w3tc || sudo tail -n50 /var/log/ee/ee.log - - sudo ee site update site1.com --wp --wpsc || sudo tail -n50 /var/log/ee/ee.log - - yes | sudo ee site update site1.com --wpredis || sudo tail -n50 /var/log/ee/ee.log - - - sudo ee site update site5.com --wpsubdir --wpfc || sudo tail -n50 /var/log/ee/ee.log - - sudo ee site update site5.com --wpsubdir --wpsc || sudo tail -n50 /var/log/ee/ee.log - - - sudo ee site update site9.com --wpsubdomain --wpfc || sudo tail -n50 /var/log/ee/ee.log - - sudo ee site update site9.com --wpsubdomain --wpsc || sudo tail -n50 /var/log/ee/ee.log - - yes | sudo ee site update site.hhvm.pagespeed12.in --hhvm=off || sudo tail -n50 /var/log/ee/ee.log - - yes | sudo ee site update site9.com --hhvm || sudo tail -n50 /var/log/ee/ee.log - - sudo ee site info site.hhvm.pagespeed12.in || sudo tail -n50 /var/log/ee/ee.log - - sudo ee site info site9.com || sudo tail -n50 /var/log/ee/ee.log - - - sudo ee site create www.site-1.com --wp || sudo tail -n50 /var/log/ee/ee.log|| sudo tail -n50 /var/log/ee/ee.log - - sudo ee site create www.subsite.site-1.com --wpfc || sudo tail -n50 /var/log/ee/ee.log - - sudo ee site update www.subsite.site-1.com --wp || sudo tail -n50 /var/log/ee/ee.log - - sudo ee site delete www.subsite.site-1.com --all --no-prompt || sudo tail -n50 /var/log/ee/ee.log - - - sudo ee site delete site12.in --all --no-prompt || sudo tail -n50 /var/log/ee/ee.log - - - sudo ls /var/www/ - - sudo wp --allow-root --info - - sudo bash -c 'cat /var/log/ee/ee.log' diff --git a/CHANGELOG.txt b/CHANGELOG.txt deleted file mode 100644 index 81e34d77a..000000000 --- a/CHANGELOG.txt +++ /dev/null @@ -1,470 +0,0 @@ -v3.8.1 - May 30, 2018 -- Fix update command -- Fix issue with admin tools urls - -v3.8.0 - May 29, 2018 -- Add support for Ubuntu 18.04 and remove support for Ubuntu 12.04 -- Nginx build for EasyEngine updated to 1.14.0 -- Update WP-CLI version to 1.5.1 -- Update Roundcube to 1.3.6 -- Update Adminer to 4.6.2 - -v3.7.5 - Mar 30, 2018 -- Replace pymysql3 with PyMySQL [critical] -- Upgrade wp-cli version to 1.4.1 -- Update templates to skip cache for more plugins - -v3.7.4 - Aug 29, 2016 -- Fix phpmemcacheadmin download urls [critical] - -v3.7.3 - Aug 17, 2016 -- Fix wp-cli compatibility with WordPress 4.6 [critical] - -v3.7.2 - Jul 20, 2016 -- CGI Vulnerability HTTPOXY Patch - -v3.7.1 - Jul 1, 2016 -- Fix PHP7 support for debian jessie -- Fix PHP7 debug log - -v3.7.0 - Jun 22, 2016 -- PHP7 support for debian jessie -- Fixed Issue #729, #724 - -v3.6.2 - Jun 03, 2016 -- Fix Issue #726,#723,#727 -- Update Adminer to v4.2.5 -- Check for already installed nginx package - -v3.6.1 - May 20, 2016 -- Fix HHVM Support on Ubuntu Xenial - -v3.6.0 - May 16, 2016 -- Add support for Ubuntu 16.04 LTS - Xenial. -- Updated Nginx to the latest stable version (1.10.1) -- Updated OpenSSL to v1.0.2g for HTTP/2 support -- Drop support for spdy module. Move existing spdy sites to http2. -- Drop support for ngx_pagespeed module. -- Drop support for Nginx Mainline builds. -- Fix Let's Encrypt Auto renew issue - -v3.5.6 - May 5, 2016 -- Patch for ImageMagick vulnerability CVE-2016–3714 - https://imagetragick.com/ -- Minor Fix for letsencrypt - -v3.5.5 - Apr 13, 2016 -- WP-CLI support for wordpress v4.5, PR #701 -- PR #686 -- Fix #702 -- Minor Fixes - -v3.5.4 - Mar 15, 2016 -- Fixed Vimbadmin installation issue -- PR #684 -- Minor fixes - -v3.5.3 - Feb 25, 2016 -- Fixed #650 -- Fixed #681 - -v3.5.2 - Feb 25, 2016 -- Fixed PHP package dependency (Trusty) - -v3.5.1 - Feb 25, 2016 -- Fixed #680 - -v3.5.0 - Feb 24, 2016 -- Added PHP 7.0 support for Ubuntu(Trusty) -- Dual support for PHP 5.6 + PHP 7.0 -- Fixed minor issues - -v3.4.1 - Jan 20, 2016 -- Fixed and update ee stack install --nginx/--nginxmainline -- Fixed --letsencrypt minor issues -- Fixed #665 #659 -- Fixed other minor bug - -v3.4.0 - Jan 6, 2016 -- Added Let's Encrypt support - - ee site create example.com [--wp/..] --letsencrypt - - ee site update example.com --letsencrypt=on/off/renew - - Automatic renew of certs through cron - - Mail notification added on certs renew - - Alias command: --le -- Added HTTP/2 support - - ee stack install/remove/purge --nginxmainline -- Check SSL cert status/expiry date in site info - - ee site info example.com -- Update autocompletion and man page - -v3.3.15 - Dec 9, 2015 -- Upgrade wp-cli version to 0.21.1 - -v 3.3.14 - Nov 10, 2015 -- Fix EasyEngine installation issue - -v 3.3.13 - Nov 10, 2015 -- Security Fix in redis.conf -- Update wp-cli version - -v 3.3.12 - Nov 3, 2015 -- Fix #637 -- Updated wp-cli version - -v 3.3.11 - Oct 26, 2015 -- Updated MySql version -- Added new repository for MySql -- Minor fix for redis cache in debian jessie -- Security Fix in location.conf - -v 3.3.10 - Oct 19, 2015 -- Fix #630 -- Fix #631 -- Updated wp-cli version - -v 3.3.9 - Oct 9, 2015 -- Fix #625 -- Fix #627 -- Fix phpmyadmin for remote mysql server - -v 3.3.8 - Sep 9, 2015 -- # Fix White screen for NGINX PLUS users - -v 3.3.7 - Sep 9, 2015 -- EasyEngine + NGINX PLUS (http://docs.rtcamp.com/easyengine/nginx-plus/) - -v 3.3.6 - Sep 4, 2015 -- Fix #611 - -v 3.3.5 - Sep 2, 2015 -- Introduced new support of --force/-f in delete command of site - - Removes database entry or nginx configuration of site from system - - ee site delete example.com --force/-f - - ee site delete example.com --force/-f --db/--files -- Moved ~/.my.cnf to /etc/mysql/conf.d/my.cnf - - Fixed MySQL credential issue -- Fixed Bug in cache clean --all command -- Improved 404 handling for static HTML sites #561 -- Improved cleanup action while site create command fail -- Updated wpfc config #543 -- Improved ee sync command https://github.com/rtCamp/easyengine/issues/575#issuecomment-126293815 -- Bug Fix #486 -- Bug Fix #555 -- Updated man page -- Fixed bug in ee update site to --wpredis -- Fixed Autocompletion Issue #519 -- Fixed minor bug in update --password -- Minor fix and improvements - -v 3.3.4 - Aug 12, 2015 -- Bug Fix for https://github.com/rtCamp/easyengine/issues/598#issue-98354466 - -v 3.3.3 - Jul 28, 2015 -- Bug Fix for https://github.com/rtCamp/easyengine/issues/593#issuecomment-125274633 - -v 3.3.2 - Jul 27, 2015 -- Bug Fix #593 -- Fix package authentication problems -- Version update roundcube 1.1.2 -- Version update vimbadmin to 3.0.12 - -v 3.3.1 - Jul 23, 2015 -- Fixed redis query expiration timeout limit -- Updated redis cache header to more informative - -v 3.3.0 - Jul 13, 2015 -- Added support for Redis full page cache -- Added support to update WPCLI -- Added support for custom WPCLI location -- Updated WPCLI to v0.19.2 -- Refined ee site update command -- autoconfigure nginx-helper plugin - -v 3.2.2 - Jun 19, 2015 -- Fixed bug that was preventing disabling debug - -v 3.2.1 - Jun 19, 2015 -- Improved experimental HHVM and Pagespeed handling, fixes #564, #562 -- Fixed missing link for Proxy sites #571 -- Added hhvm.server.ip for HHVM config #567 - -v 3.2.0 - May 28, 2015 -- Now using openSuse builder to build Nginx package for both Ubuntu and Debian -- Minor fixes and improvements - -v 3.1.9 - May 23, 2015 -- Fixed "ssl_prefer_server_ciphers" directive is duplicate after ee stack upgrade on Debian #552 - -v 3.1.8 - May 22, 2015 -- Fixed PHP Failed to Restart after Upgrade #550 -- Improved ee stack services command -- Minor fix and improvements - -v 3.1.7 - May 21, 2015 -- Fixed site blank issue after nginx stack upgrade on Debian -- Improved update script - -v 3.1.6 - May 19, 2015 -- Added Debian 8 support, see #524 -- EasyEngine now uses dphys-swapfile for swap creation, see #359 -- Minor bug fixes and improvements. - -v 3.1.5 - May 14, 2015 -- Fixed Debain 7 stack issues. see #538 #539 #540 #435 #546 -- Updated MySQLTuner see #484 -- Minor fixes and improvements. - -v 3.1.4 - May 7, 2015 -- Fixed XSS Vulnerability found in some WordPress themes and plugins - -v 3.1.3 - May 6, 2015 -- EasyEngine now fixes missing GPG keys automatically, fixes #470 -- Fixed Nginx hash bucket issue, fixes #449 - -v 3.1.2 - April 29, 2015 -- Updated PHP version from PHP 5.5 to PHP 5.6 #425 -- Added ee stack upgrade command for stack upgrade #458 -- Added support for Proxy site creation #389 -- Added extra parameters such as User, Password and EMail during site creation #453 -- Fixed timezone related warnings and errors #451 - - -v 3.1.1 - April 21, 2015 -- Feature: update all site at once #491 -- Tweaked import-slow-log command #322 -- Fixed HHVM installation without Nginx #492 -- Fixed HHVM not running after reboot #498 -- Fixed Nginx config on Debian causing failure in site creation #499 -- Now support for existing HHVM on server -- Minor fixes and improvements - -v 3.1.0 - April 16, 2015 -- Added HHVM support #199 -- Added Pagespeed support #473 -- EasyEngine log command now suppots more subcommand #448 -- Before stack purge or remove, EasyEngine now asks confirmation #485 -- Minor fixes and improvements - -v 3.0.10 - April 10, 2015 -- Fixed regression issue introduced in 3.0.9 - -v 3.0.9 - April 10, 2015 -- Fixed #483, now Xdebug is enabled during ee debug only and disabled by default -- Introduced ee sync command to sync EasyEngine database with Site information -- Minor fixes and improvement - -v 3.0.8 - April 9,2015 -- Fixed regression issue introduced in 3.0.7 - -v 3.0.7 - April 9,2015 -- Fixed #445 -- Fixed #413 -- Small bug fixes. -- Improvements in core functionality. - -v 3.0.6 - April 2,2015 -- Added `update` command to update EasyEngine. - -v 3.0.5 - March 18,2015 -- Changed Database from Percona MySQL to MariaDB #362 -- Better arguments for ee debug command -- Improved installation script -- Small bug fixes and improvements - -v 3.0.4 - Feb 25,2015 -- Fixed #406, install Wp Query Monitor on wp debug option -- Fixed #429, added `log` command -- Fixed #442 -- Fixed bug in delete command for site -- Small bug fixes and improvements - -v 3.0.3 - Feb 23,2015 -- Fixed remote MySQL supports, #428, #427, thanks to @joshlyford #432 -- Fixed ascii encoding issue #414 -- Fixed bug in debug pool #426 -- Added admin tools to default stack -- Added more MIME types,thanks to @cborgia #423 -- Small bugs fixes and improvements - -v 3.0.2 - Feb 14,2015 -- Fixed #413 -- Improved installation script -- Fixed Percona key not importing -- Small bug fixes and improvements - -v 3.0.1 - Feb 12,2015 -- Fixed #411, #40, #409 -- Improved installation script - -v 3.0.0 - Feb 11,2015 -- Refactored complete code in Python 3 -- Updated WP-CLI to 0.18 -- Update RoundCube to 1.1 -- Update ViMbAdmin to 3.0.11 - -v 2.2.3 - Feb 01,2015 -- Fixed installation issue of Percona Mysql - -v 2.2.2 - Dec 03,2014 -- Fixed installation issue of Percona Mysql on Debian -- Fixed error during ViMbAdmin installation -- Fixed alias in ViMbAdmin are not working -- Updated WP-CLI to 0.17.1 - -v 2.2.1 - Oct 16,2014 -- Fixed update script issue for remote MySQL #323 -- Fixed remote MySQL delete user issue by @brennentsmith #324 -- Improved auto-completion - -v 2.2.0 - Oct 13, 2014 -- Percona Mysql 5.6 support on Fresh installation. #107 -- RAM Based Optimization for PHP5-FPM,OpCache and Memcache -- Introduced following new commands for - - ee site cd example.com # Change Directory to example.com Webroot - - ee site log example.com # Real time log monitoring for example.com access and error logs - - ee site update example.com <parameters> # update example.com cache and convert site - - ee clean # Clean cache NGINX FastCGI, Memcache, OPcache. -- Change WordPress user password easily ( ee site update example.com --password) #315 -- Added PHP5-GeoIP Support -- Auto Swap creation for low RAM servers. -- Fixed Better autocompletion feature. Fixed #311. -- Fixed phpMyAdmin (blowfish_secret) error #301 -- Simplified way to update EasyEngine. #307 - -v 2.1.0 - Sept 3, 2014 - - Added Mail Server Package installation #65 - - Fixed incorrect log file path during debug #299 - - Added support for pt-query-advisor #189 - - Fixed Firefox cross-domain fonts - - Fixed ee site edit command on Nano editor - -v 2.0.2 - Aug 13, 2014 - - Remote MySQL Support - -v 2.0.1 - July 21, 2014 - - Fixed wp-cli installation #289 - -v 2.0.0 - July 14, 2014 - - Completly rewritten code - - Updated wp-cli to 0.16.0 - - Introduced ee secure command - - Changed the way to update EasyEngine #179 - - Fixed security on 22222 port by @RenzoF #263 - - Fixed MySQL stopped in ee stack status #233 - - Added WordPress SEO Yoast plugin support in wpcommon.conf #165 - - Depricated ee system command with ee stack command - - -v 1.3.8 - May 26, 2014 - - Fixed phpMyAdmin download issue #251 - - Fixed swap issue #223 by @Swingline0 - - Delete website without prompt by @edwinvandeven #239 - - -v 1.3.7 - Apr 29, 2014 - - Fixed EasyEngine Update Problem - - Fixed Issue #206 - - Update nginx version 1.6.0 - - Update wp-cli version 0.14.1 - - -v 1.3.6 - Apr 24, 2014 - - Fixed Nginx Update Problem #201 - - Automate Testing Using Travis-ci - - -v 1.3.5 - Apr 22, 2014 - - Update nginx to the latest stable version (1.4.7) - - -v 1.3.4 - Apr 22, 2014 - - Supports Ubuntu 12.04, 12.10, 13.10 & 14.04 ( Fixed Issue #94 #195 ) - - Change FPM process management from dynamic to ondemand #184 - - Fixed Issue #188 - - Fixed Debian 6 wget command issue - - -v 1.3.3 - Apr 16, 2014 - - Fixed issue #186 - - Fixed issue #187 - - -v 1.3.2 - Apr 14, 2014 - - Fixed ee update - - -v 1.3.1 - Apr 14, 2014 - - Fixed Autocompletion Issue #185 - - ee info command display php5-fpm process manager details (dynamic/ondemand) - - -v 1.3.0 - Apr 11, 2014 - - Introduce `ee debug` command - - Introduce `ee system [status|stop|start|restart]` command - - - EasyEngine Admin Tools shifted on port `22222` with self signed SSL Certificate #124 - - Setup Separate PHP5-FPM Pool on Port 9001 for debugging purpose - - Polish `ee site edit` command #157 - - Fixed MySQL Username Character Limit #113 - - Nginx Settings #100 - - -v 1.2.2 - Mar 18, 2014 - - Check/Install bc command - - Fixed EasyEngine Update Issue #134 #148 - - Automatic set WordPress Permalink Structure by @UmeshSingla - - Fixed @WP-CLI version to 0.14.1 - - Correct Typo Mistake, Thanks to @sdenike on pull request #155 - - Introduce ee site edit command by @Mermouy on pull request #153 - - Auto Switch the site create options - - Better way to detect Linux Ditribution - - -v 1.2.1 - Mar 3, 2014 - - Fixed Debian Issue #136 - - -v 1.2 - Feb 20, 2014 - - Debian 6 and Debian 7 support added - - -v 1.1.5 - Feb 17, 2014 - - Fixed WordPress multisite issue (#127). - - -v 1.1.4 - Feb 14, 2014 - - Fixed wp-cli issue with --allow-root error. - - -v 1.1.3 - Jan 28, 2014 - - Added GPL License. Ref - https://rtcamp.com/easyengine-is-gpl/ - - -v 1.1.2 - Jan 28, 2014 - - Fix White-list IP Address - - Fix ee info command - - Fix site delete issue (#111) - - -v 1.1.1 - Jan 17, 2014 - - IP-detcect issue. (#108) - - -v 1.1 - Jan 16, 2014 - - Handling redirects from “non-www to www” and vice-versa. (#71) - - Automating mysql setup. Every site which needs a database gets a new mysql user and password automatically. mysql root is not used anymore for new sites. (#72) - - Automated postfix installation. (#72) - - Added “ee info” command (#69) - - Secured /ee locations (#60 and https://rtcamp.com/tutorials/nginx/ssl-pci-compliance-performance/) - - SSL Session cache for nginx (#56) - - -v 1.0.1 - Dec 17, 2013 - - Fix wp-cli issue - - -v 1.0.0 - Oct 1, 2013 - - First Release - - Support for Standard WordPress and multisite WordPress - - Support for Nginx Fastcgi-Cache, W3 Total Cache and WP Super Cache - - Support for PHP and HTML sites diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 054750809..000000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 rtCamp Solutions Private Limited - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/README.md b/README.md deleted file mode 100644 index eb6a458f1..000000000 --- a/README.md +++ /dev/null @@ -1,122 +0,0 @@ -# [EasyEngine](https://easyengine.io/) - -[![Travis Build Status](https://travis-ci.org/EasyEngine/easyengine.svg)](https://travis-ci.org/EasyEngine/easyengine) [![Join EasyEngine Slack Channel](http://slack.easyengine.io/badge.svg)](http://slack.easyengine.io/) - -**Update:** [We are working on next major release (v4) which will be in PHP and based on WP-CLI](https://easyengine.io/blog/easyengine-v4-development-begins/). - -EasyEngine (ee) is a python tool, which makes it easy to manage your wordpress sites running on nginx web-server. - -**EasyEngine currently supports:** - -- Ubuntu 12.04 & 14.04 & 16.04 -- Debian 7 & 8 - -**Port Requirements:** - -| Name | Port Number | Inbound | Outbound | -|:-----:|:-----------:|:-------:|:---------:| -|SSH |22 | ✓ |✓ | -|HTTP |80 | ✓ |✓ | -|HTTPS/SSL |443 | ✓ |✓ | -|EE Admin |22222 | ✓ | | -|GPG Key Server |11371 | |✓ | - -## Quick Start - -```bash -wget -qO ee rt.cx/ee && sudo bash ee # Install easyengine 3 -sudo ee site create example.com --wp # Install required packages & setup WordPress on example.com -``` - -## Update EasyEngine - - -Update procedure for EasyEngine to latest version - -#### For current installed version prior to 3.0.6 -```bash -wget -qO ee rt.cx/ee && sudo bash ee - -``` -#### If current version is after than 3.0.6 -``` -ee update -``` - -## More Site Creation Commands - -### Standard WordPress Sites - -```bash -ee site create example.com --wp # install wordpress without any page caching -ee site create example.com --w3tc # install wordpress with w3-total-cache plugin -ee site create example.com --wpsc # install wordpress with wp-super-cache plugin -ee site create example.com --wpfc # install wordpress + nginx fastcgi_cache -ee site create example.com --wpredis # install wordpress + nginx redis_cache -``` - -### WordPress Multsite with subdirectory - -```bash -ee site create example.com --wpsubdir # install wpmu-subdirectory without any page caching -ee site create example.com --wpsubdir --w3tc # install wpmu-subdirectory with w3-total-cache plugin -ee site create example.com --wpsubdir --wpsc # install wpmu-subdirectory with wp-super-cache plugin -ee site create example.com --wpsubdir --wpfc # install wpmu-subdirectory + nginx fastcgi_cache -ee site create example.com --wpsubdir --wpredis # install wpmu-subdirectory + nginx redis_cache -``` - -### WordPress Multsite with subdomain - -```bash -ee site create example.com --wpsubdomain # install wpmu-subdomain without any page caching -ee site create example.com --wpsubdomain --w3tc # install wpmu-subdomain with w3-total-cache plugin -ee site create example.com --wpsubdomain --wpsc # install wpmu-subdomain with wp-super-cache plugin -ee site create example.com --wpsubdomain --wpfc # install wpmu-subdomain + nginx fastcgi_cache -ee site create example.com --wpsubdomain --wpredis # install wpmu-subdomain + nginx redis_cache -``` - -### Non-WordPress Sites -```bash -ee site create example.com --html # create example.com for static/html sites -ee site create example.com --php # create example.com with php support -ee site create example.com --mysql # create example.com with php & mysql support -``` - -### HHVM Enabled Sites -```bash -ee site create example.com --wp --hhvm # create example.com WordPress site with HHVM support -ee site create example.com --php --hhvm # create example.com php site with HHVM support -``` - -### PageSpeed Enabled Sites -```bash -ee site create example.com --wp --pagespeed # create example.com WordPress site with PageSpeed support -ee site create example.com --php --pagespeed # create example.com php site with PageSpeed support -``` - -## Cheatsheet - Site creation - - -| | Single Site | Multisite w/ Subdir | Multisite w/ Subdom | -|--------------------|---------------|-----------------------|--------------------------| -| **NO Cache** | --wp | --wpsubdir | --wpsubdomain | -| **WP Super Cache** | --wpsc | --wpsubdir --wpsc | --wpsubdomain --wpsc | -| **W3 Total Cache** | --w3tc | --wpsubdir --w3tc | --wpsubdomain --w3tc | -| **Nginx cache** | --wpfc | --wpsubdir --wpfc | --wpsubdomain --wpfc | -| **Redis cache** | --wpredis | --wpsubdir --wpredis | --wpsubdomain --wpredis | - -## Useful Links -- [Documentation](https://easyengine.io/docs/) -- [FAQ](https://easyengine.io/faq/) -- [Conventions used](https://easyengine.io/wordpress-nginx/tutorials/conventions/) - -## Community Guides -- [Develop and Deploy with EasyEngine + VVV + Wordmove](https://github.com/joeguilmette/ee-vvv-wordmove) - -## Donations - -[![PayPal-Donate](https://cloud.githubusercontent.com/assets/4115/5297691/c7b50292-7bd7-11e4-987b-2dc21069e756.png)](http://rt.cx/eedonate) -[![BitCoin-Donate](https://bitpay.com/img/donate-button.svg)](https://bitpay.com/417008/donate) - -## License -[MIT](http://opensource.org/licenses/MIT) diff --git a/config/bash_completion.d/ee_auto.rc b/config/bash_completion.d/ee_auto.rc deleted file mode 100644 index c771dfff9..000000000 --- a/config/bash_completion.d/ee_auto.rc +++ /dev/null @@ -1,384 +0,0 @@ -_ee_complete() -{ - local cur prev BASE_LEVEL - - COMPREPLY=() - cur=${COMP_WORDS[COMP_CWORD]} - prev=${COMP_WORDS[COMP_CWORD-1]} - mprev=${COMP_WORDS[COMP_CWORD-2]} - - - # SETUP THE BASE LEVEL (everything after "ee") - if [ $COMP_CWORD -eq 1 ]; then - COMPREPLY=( $(compgen \ - -W "stack site debug clean secure import-slow-log log update sync info --version --help --quiet" \ - -- $cur) ) - - - # SETUP THE SECOND LEVEL (EVERYTHING AFTER "ee second") - elif [ $COMP_CWORD -eq 2 ]; then - case "$prev" in - - # HANDLE EVERYTHING AFTER THE SECOND LEVEL NAMESPACE - "clean") - COMPREPLY=( $(compgen \ - -W "--memcache --opcache --fastcgi --redis --all" \ - -- $cur) ) - ;; - - # IF YOU HAD ANOTHER CONTROLLER, YOU'D HANDLE THAT HERE - "debug") - COMPREPLY=( $(compgen \ - -W "$(command find /etc/nginx/sites-enabled/ -type l -printf "%P " 2> /dev/null) --nginx --php --php7 --fpm --fpm7 --mysql -i --interactive --all --import-slow-log --import-slow-log-interval= --nginx=off --php=off --php7=off --fpm=off --fpm7=off --mysql=off --all=off " \ - -- $cur) ) - ;; - - "stack") - COMPREPLY=( $(compgen \ - -W "upgrade install purge reload remove restart start status stop migrate" \ - -- $cur) ) - ;; - - "site") - COMPREPLY=( $(compgen \ - -W "cd create delete disable edit enable info list log show update" \ - -- $cur) ) - ;; - - "secure") - COMPREPLY=( $(compgen \ - -W "--auth --port --ip" \ - -- $cur) ) - ;; - - "info") - COMPREPLY=( $(compgen \ - -W "--mysql --php --php7 --nginx" \ - -- $cur) ) - ;; - - "log") - COMPREPLY=( $(compgen \ - -W "show reset gzip mail" \ - -- $cur) ) - ;; - - # EVERYTHING ELSE - *) - ;; - esac - - # SETUP THE THIRD LEVEL (EVERYTHING AFTER "ee second third") - elif [ $COMP_CWORD -eq 3 ]; then - case "$prev" in - # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "install" | "purge" | "remove" ) - COMPREPLY=( $(compgen \ - -W "--web --admin --mail --nginx --php --php7 --mysql --postfix --wpcli --phpmyadmin --adminer --utils --all --mailscanner --hhvm --redis --phpredisadmin" \ - -- $cur) ) - ;; - "upgrade" ) - COMPREPLY=( $(compgen \ - -W "--web --mail --nginx --php --php7 --mysql --postfix --all --hhvm --php56 --no-prompt --wpcli" \ - -- $cur) ) - ;; - "start" | "stop" | "reload" | "restart" | "status") - COMPREPLY=( $(compgen \ - -W "--nginx --php --php7 --mysql --postfix --memcache --dovecot --redis" \ - -- $cur) ) - ;; - "migrate") - COMPREPLY=( $(compgen \ - -W "--mariadb" \ - -- $cur) ) - ;; - "list") - COMPREPLY=( $(compgen \ - -W "--enabled --disabled" \ - -- $cur) ) - ;; - - "edit" | "enable" | "info" | "log" | "show" | "cd" | "delete") - if [ ${COMP_WORDS[1]} == "log" ]; then - COMPREPLY=( $(compgen \ - -W "$(find /etc/nginx/sites-available/ -type f -printf "%P " 2> /dev/null) --nginx --php --fpm --mysql --access" \ - -- $cur) ) - else - COMPREPLY=( $(compgen \ - -W "$(find /etc/nginx/sites-available/ -type f -printf "%P " 2> /dev/null)" \ - -- $cur) ) - fi - ;; - "update") - COMPREPLY=( $(compgen \ - -W "$(find /etc/nginx/sites-available/ -type f -printf "%P " 2> /dev/null) --all" \ - -- $cur) ) - ;; - "gzip") - COMPREPLY=( $(compgen \ - -W "$(find /etc/nginx/sites-available/ -type f -printf "%P " 2> /dev/null) --nginx --php --fpm --mysql --access" \ - -- $cur) ) - ;; - - "mail") - COMPREPLY=( $(compgen \ - -W "$(find /etc/nginx/sites-available/ -type f -printf "%P " 2> /dev/null) --nginx --php --fpm --mysql --access --to=" \ - -- $cur) ) - ;; - - "reset") - COMPREPLY=( $(compgen \ - -W "$(find /etc/nginx/sites-available/ -type f -printf "%P " 2> /dev/null) --nginx --php --fpm --mysql --wp --access --slow-log-db" \ - -- $cur) ) - ;; - - "disable") - COMPREPLY=( $(compgen \ - -W "$(command find /etc/nginx/sites-enabled/ -type l -printf "%P " 2> /dev/null)" \ - -- $cur) ) - ;; - - *) - ;; - esac - - if [ ${COMP_WORDS[1]} == "debug" ] && ([ "$prev" != "--start" ] && [ "$prev" != "--nginx" ] && [ "$prev" != "--php" ] && [ "$prev" != "--php7" ] && [ "$prev" != "--fpm" ] && [ "$prev" != "--fpm7" ] && [ "$prev" != "--mysql" ] && [ "$prev" != "-i" ] && [ "$prev" != "--interactive" ] && [ "$prev" != "--import-slow-log" ] && [ "$prev" != "--stop" ]); then - retlist="--all --wp --rewrite -i --all=off --wp=off --rewrite=off" - ret="${retlist[@]/$prev}" - COMPREPLY=( $(compgen \ - -W "$(echo $ret)" \ - -- $cur) ) - fi - - #if [ ${COMP_WORDS[1]} == "log" ] && ([ "$prev" != "--access" ] || [ "$prev" != "--nginx" ] || [ "$prev" != "--php" ] || [ "$prev" != "--fpm" ] || [ "$prev" != "--mysql" ] || [ "$prev" != "-i" ] || ["$prev" != "--interactive" ] || ["$prev" != "--stop" ]); then - # retlist="--all --wp --rewrite -i --all=off --wp=off --rewrite=off" - # ret="${retlist[@]/$prev}" - # COMPREPLY=( $(compgen \ - # -W "$(echo $ret)" \ - # -- $cur) ) - #fi - - - elif [ $COMP_CWORD -eq 4 ]; then - case "$mprev" in - # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - - "create") - COMPREPLY=( $(compgen \ - -W "--user --pass --email --html --php --php7 --mysql --wp --wpsubdir --wpsubdomain --w3tc --wpfc --wpsc --hhvm --proxy= --wpredis --letsencrypt -le" \ - -- $cur) ) - ;; - - "update") - COMPREPLY=( $(compgen \ - -W "--password --php --php7 --mysql --wp --wpsubdir --wpsubdomain --w3tc --wpfc --wpsc --hhvm --hhvm=off --wpredis --letsencrypt --letsencrypt=off --letsencrypt=renew" \ - -- $cur) ) - ;; - "delete") - COMPREPLY=( $(compgen \ - -W "--db --files --all --no-prompt --force -f" \ - -- $cur) ) - ;; - "show") - COMPREPLY=( $(compgen \ - -W "--wp --nginx --php --fpm --mysql --access" \ - -- $cur) ) - ;; - - "gzip") - COMPREPLY=( $(compgen \ - -W "--wp --nginx --php --fpm --mysql --access" \ - -- $cur) ) - ;; - - "mail") - COMPREPLY=( $(compgen \ - -W "--wp --nginx --php --fpm --mysql --access --to=" \ - -- $cur) ) - ;; - - "reset") - COMPREPLY=( $(compgen \ - -W "--wp --nginx --php --fpm --mysql --wp --access --slow-log-db" \ - -- $cur) ) - ;; - edit) - COMPREPLY=( $(compgen \ - - -- $cur) ) - ;; - *) - ;; - esac - - fi - - case "$prev" in - "--wp") - if [ ${COMP_WORDS[1]} != "debug" ]; then - if [ ${COMP_WORDS[2]} == "create" ]; then - retlist="--wp --wpsc --w3tc --wpfc --hhvm --user --email --pass --wpredis --letsencrypt --php7" - elif [ ${COMP_WORDS[2]} == "update" ]; then - retlist="--wp --w3tc --wpfc --wpsc --php7 --php7=off --hhvm --hhvm=off --wpredis --letsencrypt --letsencrypt=off --letsencrypt=renew" - else - retlist="" - fi - else - retlist="--wp --wp=off --rewrite --rewrite=off -i --interactive" - fi - - ret="${retlist[@]/$prev}" - COMPREPLY=( $(compgen \ - -W "$(echo $ret)" \ - -- $cur) ) - ;; - - "--wpsubdir" | "--wpsubdomain") - if [ ${COMP_WORDS[1]} != "debug" ]; then - if [ ${COMP_WORDS[2]} == "create" ]; then - retlist="--wpsc --w3tc --wpfc --hhvm --user --email --pass --wpredis --letsencrypt --php7" - elif [ ${COMP_WORDS[2]} == "update" ]; then - retlist="--w3tc --wpfc --wpsc --php7 --php7=off --hhvm --hhvm=off --wpredis --letsencrypt --letsencrypt=off --letsencrypt=renew" - else - retlist="" - fi - else - retlist="--wp=off --rewrite --rewrite=off -i --interactive" - fi - - ret="${retlist[@]/$prev}" - COMPREPLY=( $(compgen \ - -W "$(echo $ret)" \ - -- $cur) ) - ;; - - "--hhvm" | "--wpredis" | "--w3tc" | "--wpfc" | "--wpsc" | "--wpsubdir" | "--wpsubdomain" | "--user" | "--pass" | "--email" | "--wp") - if [ ${COMP_WORDS[2]} == "create" ]; then - retlist="--user --pass --email --wp --wpsubdir --wpsubdomain --w3tc --wpfc --wpsc --hhvm --experimenal --wpredis --php7 --letsencrypt " - else - retlist="" - fi - - ret="${retlist[@]/$prev}" - COMPREPLY=( $(compgen \ - -W "$(echo $ret)" \ - -- $cur) ) - ;; - - "--hhvm" | "--wpredis" | "--w3tc" | "--wpfc") - if [ ${COMP_WORDS[2]} == "update" ]; then - retlist="--password --php --php7 --mysql --wp --wpsubdir --wpsubdomain --w3tc --wpfc --wpsc --hhvm --hhvm=off --experimenal --wpredis --letsencrypt --letsencrypt=off --letsencrypt=renew" - else - retlist="" - fi - - ret="${retlist[@]/$prev}" - COMPREPLY=( $(compgen \ - -W "$(echo $ret)" \ - -- $cur) ) - ;; - - "--web" | "--admin" | "--mail" | "--nginx" | "--php" | "--php7" | "--mysql" | "--postfix" | "--wpcli" | "--phpmyadmin" | "--adminer" | "--utils" | "--memcache" | "--dovecot" | "--redis | --phpredisadmin") - if [[ ${COMP_WORDS[2]} == "install" || ${COMP_WORDS[2]} == "purge" || ${COMP_WORDS[2]} == "remove" ]]; then - retlist="--web --admin --mail --nginx --php --php7 --mysql --postfix --wpcli --phpmyadmin --adminer --utils --memcache --dovecot --redis --phpredisadmin" - elif [[ ${COMP_WORDS[2]} == "start" || ${COMP_WORDS[2]} == "reload" || ${COMP_WORDS[2]} == "restart" || ${COMP_WORDS[2]} == "stop" ]]; then - retlist="--nginx --php --php7 --mysql --postfix --memcache --dovecot --redis" - elif [[ ${COMP_WORDS[1]} == "debug" ]]; then - retlist="--start --nginx --php --php7 --fpm --fpm7 --mysql -i --interactive -stop --import-slow-log --import-slow-log-interval= -" - if [[ $prev == '--mysql' ]]; then - retlist="--start --nginx --php --php7 --fpm --fpm7 --mysql -i --interactive --stop --import-slow-log" - fi - elif [[ ${COMP_WORDS[1]} == "log" ]]; then - if [ ${COMP_WORDS[2]} == "show" ]; then - retlist="--access --nginx --php --mysql --fpm --wp" - - elif [ ${COMP_WORDS[2]} == "reset" ]; then - retlist="--access --nginx --php --mysql --fpm --wp --slow-log-db" - - elif [ ${COMP_WORDS[2]} == "mail" ]; then - retlist="--access --nginx --php --mysql --fpm --wp --to=" - - fi - fi - ret="${retlist[@]/$prev}" - COMPREPLY=( $(compgen \ - -W "$(echo $ret)" \ - -- $cur) ) - ;; - - "--db" | "--files" | "--force") - retlist="--db --files --all --force" - ret="${retlist[@]/$prev}" - COMPREPLY=( $(compgen \ - -W "$(echo $ret)" \ - -- $cur) ) - ;; - - "--all") - if [ ${COMP_WORDS[1]} == "clean" ]; then - retlist="--memcache --opcache --fastcgi --redis" - elif [ ${COMP_WORDS[2]} == "delete" ]; then - retlist="--db --files --force" - elif [ ${COMP_WORDS[2]} == "update" ]; then - retlist="--password --php --mysql --wp --wpsubdir --wpsubdomain --w3tc --wpfc --wpsc --hhvm --hhvm=off --wpredis --letsencrypt --letsencrypt=off --letsencrypt=renew" - else - retlist="" - fi - ret="${retlist[@]/$prev}" - COMPREPLY=( $(compgen \ - -W "$(echo $ret)" \ - -- $cur) ) - ;; - - "--memcache" | "--opcache" | "--fastcgi" | "--all" | "--redis") - retlist="--memcache --opcache --fastcgi --redis --all" - ret="${retlist[@]/$prev}" - COMPREPLY=( $(compgen \ - -W "$(echo $ret)" \ - -- $cur) ) - ;; - "--auth" | "--port" | "--ip") - retlist="--auth --port --ip" - ret="${retlist[@]/$prev}" - COMPREPLY=( $(compgen \ - -W "$(echo $ret)" \ - -- $cur) ) - ;; - "--access" | "--fpm" | "--wp" | "--slow-log-db") - if [[ ${COMP_WORDS[1]} == "log" ]]; then - if [ ${COMP_WORDS[2]} == "show" ]; then - retlist="--access --nginx --php --mysql --fpm --wp" - - elif [ ${COMP_WORDS[2]} == "reset" ]; then - retlist="--access --nginx --php --mysql --fpm --wp --slow-log-db" - - - elif [ ${COMP_WORDS[2]} == "mail" ]; then - retlist="--access --nginx --php --mysql --fpm --wp --to=" - - fi - fi - ret="${retlist[@]/$prev}" - COMPREPLY=( $(compgen \ - -W "$(echo $ret)" \ - -- $cur) ) - ;; - *) - ;; - esac - case "$mprev" in - "--user" | "--email" | "--pass") - if [ ${COMP_WORDS[2]} == "create" ]; then - retlist="--user --pass --email --html --php --php7 --mysql --wp --wpsubdir --wpsubdomain --w3tc --wpfc --wpsc --hhvm --wpredis --letsencrypt" - fi - ret="${retlist[@]/$prev}" - COMPREPLY=( $(compgen \ - -W "$(echo $ret)" \ - -- $cur) ) - ;; - esac - - return 0 - -} && -complete -F _ee_complete ee diff --git a/config/ee.conf b/config/ee.conf deleted file mode 100644 index 9d94df02a..000000000 --- a/config/ee.conf +++ /dev/null @@ -1,82 +0,0 @@ -# EasyEngine Configuration -# -# All commented values are the application default -# - -[ee] - -### Toggle application level debug (does not toggle framework debugging) -# debug = false - -### Where external (third-party) plugins are loaded from -# plugin_dir = /var/lib/ee/plugins/ - -### Where all plugin configurations are loaded from -# plugin_config_dir = /etc/ee/plugins.d/ - -### Where external templates are loaded from -# template_dir = /var/lib/ee/templates/ - - -[log.logging] - -### Where the log file lives (no log file by default) -file = /var/log/ee/ee.log - -### The level for which to log. One of: info, warn, error, fatal, debug -level = debug - -### Whether or not to log to console -to_console = false - -### Whether or not to rotate the log file when it reaches `max_bytes` -rotate = true - -### Max size in bytes that a log file can grow until it is rotated. -max_bytes = 512000 - -### The maximun number of log files to maintain when rotating -max_files = 7 - -[stack] - -### IP address that will be used in Nginx configurations while installing -ip-address = 127.0.0.1 - -[mysql] - -### MySQL database grant host name -grant-host = localhost - -### Ask for MySQL db name while site creation -db-name = False - -### Ask for MySQL user name while site creation -db-user = False - -[wordpress] - -### Ask for WordPress prefix while site creation -prefix = False - -### User name for WordPress sites -user = - -### Password for WordPress sites -password = - -### EMail for WordPress sites -email = - -[update] - -### If enabled, load a plugin named `update` either from the Python module -### `ee.cli.plugins.example` or from the file path -### `/var/lib/ee/plugins/example.py` -enable_plugin = true - -[sync] -### If enabled, load a plugin named `update` either from the Python module -### `ee.cli.plugins.example` or from the file path -### `/var/lib/ee/plugins/example.py` -enable_plugin = true diff --git a/config/plugins.d/clean.conf b/config/plugins.d/clean.conf deleted file mode 100644 index be8343484..000000000 --- a/config/plugins.d/clean.conf +++ /dev/null @@ -1,8 +0,0 @@ -### Example Plugin Configuration for EasyEngine - -[clean] - -### If enabled, load a plugin named `example` either from the Python module -### `ee.cli.plugins.example` or from the file path -### `/var/lib/ee/plugins/example.py` -enable_plugin = true diff --git a/config/plugins.d/debug.conf b/config/plugins.d/debug.conf deleted file mode 100644 index 9ccdf1067..000000000 --- a/config/plugins.d/debug.conf +++ /dev/null @@ -1,8 +0,0 @@ -### Example Plugin Configuration for EasyEngine - -[debug] - -### If enabled, load a plugin named `example` either from the Python module -### `ee.cli.plugins.example` or from the file path -### `/var/lib/ee/plugins/example.py` -enable_plugin = true diff --git a/config/plugins.d/import_slow_log.conf b/config/plugins.d/import_slow_log.conf deleted file mode 100644 index d7841dbeb..000000000 --- a/config/plugins.d/import_slow_log.conf +++ /dev/null @@ -1,8 +0,0 @@ -### Example Plugin Configuration for EasyEngine - -[import_slow_log] - -### If enabled, load a plugin named `example` either from the Python module -### `ee.cli.plugins.example` or from the file path -### `/var/lib/ee/plugins/example.py` -enable_plugin = true diff --git a/config/plugins.d/info.conf b/config/plugins.d/info.conf deleted file mode 100644 index 59f51a036..000000000 --- a/config/plugins.d/info.conf +++ /dev/null @@ -1,11 +0,0 @@ -### Example Plugin Configuration for EasyEngine - -[info] - -### If enabled, load a plugin named `example` either from the Python module -### `ee.cli.plugins.example` or from the file path -### `/var/lib/ee/plugins/example.py` -enable_plugin = true - -### Additional plugin configuration settings -foo = bar diff --git a/config/plugins.d/log.conf b/config/plugins.d/log.conf deleted file mode 100644 index a17893f56..000000000 --- a/config/plugins.d/log.conf +++ /dev/null @@ -1,8 +0,0 @@ -### Example Plugin Configuration for EasyEngine - -[log] - -### If enabled, load a plugin named `example` either from the Python module -### `ee.cli.plugins.example` or from the file path -### `/var/lib/ee/plugins/example.py` -enable_plugin = true diff --git a/config/plugins.d/secure.conf b/config/plugins.d/secure.conf deleted file mode 100644 index b70f167b0..000000000 --- a/config/plugins.d/secure.conf +++ /dev/null @@ -1,8 +0,0 @@ -### Example Plugin Configuration for EasyEngine - -[secure] - -### If enabled, load a plugin named `example` either from the Python module -### `ee.cli.plugins.example` or from the file path -### `/var/lib/ee/plugins/example.py` -enable_plugin = true diff --git a/config/plugins.d/site.conf b/config/plugins.d/site.conf deleted file mode 100644 index 2fb468fe9..000000000 --- a/config/plugins.d/site.conf +++ /dev/null @@ -1,8 +0,0 @@ -### Example Plugin Configuration for EasyEngine - -[site] - -### If enabled, load a plugin named `example` either from the Python module -### `ee.cli.plugins.example` or from the file path -### `/var/lib/ee/plugins/example.py` -enable_plugin = true diff --git a/config/plugins.d/stack.conf b/config/plugins.d/stack.conf deleted file mode 100644 index f7bf9b800..000000000 --- a/config/plugins.d/stack.conf +++ /dev/null @@ -1,8 +0,0 @@ -### Example Plugin Configuration for EasyEngine - -[stack] - -### If enabled, load a plugin named `example` either from the Python module -### `ee.cli.plugins.example` or from the file path -### `/var/lib/ee/plugins/example.py` -enable_plugin = true diff --git a/config/plugins.d/update.conf b/config/plugins.d/update.conf deleted file mode 100644 index 27e9c53a3..000000000 --- a/config/plugins.d/update.conf +++ /dev/null @@ -1,8 +0,0 @@ -### Example Plugin Configuration for EasyEngine - -[update] - -### If enabled, load a plugin named `example` either from the Python module -### `ee.cli.plugins.example` or from the file path -### `/var/lib/ee/plugins/example.py` -enable_plugin = true diff --git a/docs/ee.8 b/docs/ee.8 deleted file mode 100644 index 42fa61baa..000000000 --- a/docs/ee.8 +++ /dev/null @@ -1,333 +0,0 @@ -.TH ee 8 "EasyEngine (ee) version: 3.3.8" "Sep 10,2015" "EasyEngine" -.SH NAME -.B EasyEngine (ee) -\- Manage Nginx Based Websites. -.SH SYNOPSIS -ee [ --version | --help | info | stack | site | debug | update | clean | import_slow_log | log | secure | sync] -.TP -ee stack [ install | remove | purge | migrate | upgrade] [ --web | --mail | --all | --nginx | --php | --php7 | --mysql | --admin | --postfix | --mailscanner | --adminer | --redis | --hhvm | --phpmyadmin | --phpredisadmin | --wpcli | --utils ] -.TP -ee stack [ status | start | stop | reload | restart ] [--all | --nginx | --php | --php7 |--mysql | --devcot | --web | --postfix | --memcache | --redis] -.TP -ee site [ list | info | show | enable | disable | edit | cd | show ] [ example.com ] -.TP -ee site create example.com [ --html | --php | --php7 | --mysql] [[--wp | --wpsubdir | --wpsubdomain ] [--wpsc | --w3tc | --wpfc | --wpredis | --hhvm | --letsencrypt/-le]] -.TP -ee site update example.com [ --php | --php7 |--mysql] [[--wp | --wpsubdir | --wpsubdomain ] [--wpsc | --w3tc | --wpfc | --wpredis | --hhvm ] [--password] [--letsencrypt=on/off/renew]] -.TP -ee site delete example.com [--db | --files | --all | --no-prompt | --force/-f ] -.TP -ee debug [ -i | --all=on/off |--nginx=on/off | --rewrite=on/off | --php=on/off | --fpm=on/off | --mysql=on/off ] -.TP -ee debug example.com [ -i | --all=on/off | --nginx=on/off | --rewrite=on/off | --wp=on/off ] -.TP -ee secure [ --auth | --port | --ip ] -.SH DESCRIPTION -EasyEngine aka ee is the opensource project developed with the purpose to automate web-server configuration. -.br -EasyEngine is the collection of python script that provides automation for the web-server -.br -installation, site creation, services debugging & monitoring. -.SH OPTIONS -.TP -.B --version -.br -Display easyengine (ee) version information. -.TP -.B info -.br -ee info - Display Nginx, PHP, MySQL and ee common location information -.br -ee site info - Diplay given website details like enable, disable. weboot and log files. -.TP -.B --help -.br -Display easyengine (ee) help. -.TP -.B stack -.TP -.B install [ --all | --web | --mail | --nginx | --php | --php7 |--mysql | --redis | --postfix | --adminer | --phpmyadmin | --phpredismyadmin | --wpcli | --utils ] -.br -Install Nginx PHP5 MySQL Postfix stack Packages if not used with -.br -any options.Installs specific package if used with option. -.TP -.B remove [ --all | --web | --mail | --nginx | --php | --php7 |--mysql | --redis | --postfix | --adminer | --phpmyadmin | --phpredismyadmin | --wpcli | --utils ] -.br -Remove Nginx PHP5 MySQL Postfix stack Packages if not used with -.br -any options. Remove specific package if used with option. -.TP -.B purge [ --all | --web | --mail | --nginx | --php | --php7 |--mysql | --redis | --postfix | --adminer | --phpmyadmin | --phpredismyadmin | --wpcli | --utils ] -.br -Purge Nginx PHP5 MySQL Postfix stack Packages if not used with any -.br -options.Purge specific package if used with option. -.TP -.B status -.br -Display status of NGINX, PHP5-FPM, MySQL, Postfix, Redis-Server services. -.TP -.B start -.br -Start services NGINX, PHP5-FPM, MySQL, Postfix, Redis-Server. -.TP -.B stop -.br -Stop services NGINX, PHP5-FPM, MySQL, Postfix, Redis-Server. -.TP -.B reload -.br -Reload services NGINX, PHP5-FPM, MySQL, Postfix, Redis-Server. -.TP -.B restart -.br -Restart services NGINX, PHP5-FPM, MySQL, Postfix, Redis-Server. -.TP -.B site -.br -.TP -.B cd [ example.com ] -.br -Change directory to webroot of specified site in subshell. -.TP -.B log [ example.com ] -.br -monitor access and error logs for site specified. -.TP -.B list [ --enabled | --disabled ] -.br -Lists all available sites from /etc/nginx/sites-enabled/ -.br -by default & enable argument. Display sites list from -.br -/etc/nginx/sites-available/ if used with available option. -.TP -.B info [ example.com ] -.br -prints information about site such as access log, error log -.br -location and type of site. -.TP -.B show [ example.com ] -.br -Display NGINX configuration of site. -.TP -.B enable [ example.com ] -.br -Enable site by creating softlink with site file in -.br -/etc/nginx/sites-available to /etc/nginx/sites-enabled/. -.TP -.B disable [ example.com ] -.br -Disable site by Destroying softlink with site file in -.br -/etc/nginx/sites-available to /etc/nginx/sites-enabled/. -.TP -.B edit [ example.com ] -.br -Edit NGINX configuration of site. -.TP -.B create [ example.com ] [ --html | --php | --php7 |--mysql] [[--wp | --wpsubdir | --wpsubdomain ] [--wpsc | --w3tc | --wpfc | --wpredis | --hhvm ]] -.br -Create new site according to given options. If no options provided -.br -create static site with html only. -.TP -.B update [ example.com ] [ --html | --php | --php7 |--mysql] [[--wp | --wpsubdir | --wpsubdomain ] [ --wpsc | --w3tc | --wpfc | --wpredis | --hhvm ] [--password]] -.br -Update site configuration according to specified options. -.TP -.B delete [ example.com ] [--no-prompt ] [--force/-f] [ --db | --files | --all ] -.br -Delete site i.e webroot, database, ad configuration permanently. -.TP -.B debug [ -i | --nginx=on/off | --php=on/off | --php7=on/off | --mysql=on/off | --rewrite=on/off | --fpm=on/off | --fpm7=on/off ] -.br -Starts server level debugging. If this is used without arguments it will start debugging -.br -all services.Else it will debug only service provided with argument.This will Stop -.br -Debugging if used with --all=off argument. -.TP -.B debug example.com [ -i | --nginx=on/off | --rewrite=on/off | --wp=on/off | --all=on/off ] -.br -Starts site level debugging. If this is used without arguments it will start debugging all -.br -services.Else it will debug only service provided with argument.This will Stop Debugging -.br -if used with --all=off argument. -.TP -.B secure [ --auth | --port | --ip ] -.br -Update security settings. -.TP -.B clean [ --fastcgi | --opcache | --memcache | --redis | --all ] -.br -Clean NGINX fastCGI cache, Opcache, Memcache, Redis cache. -.br -Clean NGINX fastCGI cache if no option specified. -.SH ARGUMENTS -.TP -.B -i -.br -setup intractive mode while used with debug. -.TP -.B --nginx=on/off -.br -used with ee debug command. used to start or stop nginx debugging. -.TP -.B --php=on/off -.br -used with ee debug command. used to start or stop php debugging. -.TP -.B --php7=on/off -.br -used with ee debug command. used to start or stop php7 debugging. -.TP -.B --mysql=on/off -.br -used with ee debug command. used to start or stop mysql debugging. -.TP -.B --rewrite=on/off -.br -used with ee debug command. used to start or stop nginx rewrite rules debugging. -.TP -.B --fpm=on/off -.br -used with ee debug command. used to start or stop fpm debugging. -.TP -.B --wp=on/off -.br -used with ee debug command. used to start or stop wordpress site debugging. -.TP -.B --all=on/off -.br -used with ee debug command. used to stop debugging. -.TP -.B --all=off -.br -used with ee debug command. used to stop debugging. -.TP -.B --html -.br -Create a HTML website. -.TP -.B --php -.br -Create a PHP website. -.TP -.B --mysql -.br -Create a PHP+MySQL website. -.TP -.B --wp -.br -Create a WordPress Website. -.TP -.B --wpsubdir -.br -Create a Wordpress Multisite with Sub Directories Setup. -.TP -.B --wpsubdomain -.br -Create a Wordpress Multisite with Sub Domains Setup. -.br -.TP -.B --db -.br -Delete website database. -.br -.TP -.B --files -.br -Delete website webroot. -.br -.TP -.B --no-prompt -.br -Does not prompt for confirmation when delete command used. -.br -.TP -.B --force/-f -.br -Delete website webroot and database forcefully.Remove nginx configuration for site. -.br -.TP -.B --auth -.br -used with ee secure command. Update credential of HTTP authentication -.TP -.B --port -.br -used with ee secure command. Change EasyEngine admin port 22222. -.TP -.B --ip -.br -used with ee secure command. Update whitelist IP address -.SH WORDPRESS CACHING OPTIONS -.TP -.B --w3tc -.br -Install and activate Nginx-helper and W3 Total Cache plugin. -.TP -.B --wpsc -.br -Install and activate Nginx-helper and WP Super Cache plugin. -.TP -.B --wpfc -.br -Install and activate Nginx-helper and W3 Total Cache plugin with -.br -Nginx FastCGI cache. -.TP -.B --wpredis -.br -Install, activate, configure Nginx-helper and Redis Object Cache Plugin, Configure NGINX for Redis Page Caching. -.TP -.B --hhvm -.br -Install, activate Nginx-helper and configure NGINX for HHVM. -.SH FILES -.br -/etc/ee/ee.conf -.SH BUGS -Report bugs at <http://github.com/rtCamp/easyengine/issues/> -.SH AUTHOR -.br -.B rtCamp Team -.I \<admin@rtcamp.com\> -.br -.B Mitesh Shah -.I \<Mitesh.Shah@rtcamp.com\> -.br -.B Manish -.I \<Manish.Songirkar@rtcamp.com\> -.br -.B Gaurav -.I \<Gaurav.Astikar@rtcamp.com\> -.br -.B Harshad -.I \<harshad.yeola@rtcamp.com> -.br -.B Prabuddha -.I \<prabuddha.chakraborty@rtcamp.com\> -.br -.B Shital -.I \<shital.patil@rtcamp.com\> -.br -.B Rajdeep Sharma -.I \<rajdeep.sharma@rtcamp.com\> -.br - -.SH "SEE ALSO" -.br -EE: -.I https://rtcamp.com/easyengine/ -.br -FAQ: -.I https://rtcamp.com/easyengine/faq/ -.br -DOCS: -.I https://rtcamp.com/easyengine/docs/ diff --git a/ee/__init__.py b/ee/__init__.py deleted file mode 100644 index de40ea7ca..000000000 --- a/ee/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__('pkg_resources').declare_namespace(__name__) diff --git a/ee/cli/__init__.py b/ee/cli/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/ee/cli/bootstrap.py b/ee/cli/bootstrap.py deleted file mode 100644 index a5ce6d75f..000000000 --- a/ee/cli/bootstrap.py +++ /dev/null @@ -1,11 +0,0 @@ -"""EasyEngine bootstrapping.""" - -# All built-in application controllers should be imported, and registered -# in this file in the same way as EEBaseController. - -from cement.core import handler -from ee.cli.controllers.base import EEBaseController - - -def load(app): - handler.register(EEBaseController) diff --git a/ee/cli/controllers/__init__.py b/ee/cli/controllers/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/ee/cli/controllers/base.py b/ee/cli/controllers/base.py deleted file mode 100644 index 603115a28..000000000 --- a/ee/cli/controllers/base.py +++ /dev/null @@ -1,25 +0,0 @@ -"""EasyEngine base controller.""" - -from cement.core.controller import CementBaseController, expose -from ee.core.variables import EEVariables -VERSION = EEVariables.ee_version - -BANNER = """ -EasyEngine v%s -Copyright (c) 2016 rtCamp Solutions Pvt. Ltd. -""" % VERSION - - -class EEBaseController(CementBaseController): - class Meta: - label = 'base' - description = ("EasyEngine is the commandline tool to manage your" - " websites based on WordPress and Nginx with easy to" - " use commands") - arguments = [ - (['-v', '--version'], dict(action='version', version=BANNER)), - ] - - @expose(hide=True) - def default(self): - self.app.args.print_help() diff --git a/ee/cli/ext/__init__.py b/ee/cli/ext/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/ee/cli/ext/ee_outputhandler.py b/ee/cli/ext/ee_outputhandler.py deleted file mode 100644 index 89e397d46..000000000 --- a/ee/cli/ext/ee_outputhandler.py +++ /dev/null @@ -1,20 +0,0 @@ -# Based on https://github.com/datafolklabs/cement/issues/295 -# To avoid encoding releated error,we defined our custom output handler -# I hope we will remove this when we upgarde to Cement 2.6 (Not released yet) -import os -from cement.utils import fs -from cement.ext.ext_mustache import MustacheOutputHandler - - -class EEOutputHandler(MustacheOutputHandler): - class Meta: - label = 'ee_output_handler' - - def _load_template_from_file(self, path): - for templ_dir in self.app._meta.template_dirs: - full_path = fs.abspath(os.path.join(templ_dir, path)) - if os.path.exists(full_path): - self.app.log.debug('loading template file %s' % full_path) - return open(full_path, encoding='utf-8', mode='r').read() - else: - continue diff --git a/ee/cli/main.py b/ee/cli/main.py deleted file mode 100644 index cd72f0d1e..000000000 --- a/ee/cli/main.py +++ /dev/null @@ -1,135 +0,0 @@ -"""EasyEngine main application entry point.""" -import sys -import os - -# this has to happen after you import sys, but before you import anything -# from Cement "source: https://github.com/datafolklabs/cement/issues/290" -if '--debug' in sys.argv: - sys.argv.remove('--debug') - TOGGLE_DEBUG = True -else: - TOGGLE_DEBUG = False - -from cement.core import foundation -from cement.utils.misc import init_defaults -from cement.core.exc import FrameworkError, CaughtSignal -from cement.ext.ext_argparse import ArgParseArgumentHandler -from ee.core import exc -from ee.cli.ext.ee_outputhandler import EEOutputHandler - -# Application default. Should update config/ee.conf to reflect any -# changes, or additions here. -defaults = init_defaults('ee') - -# All internal/external plugin configurations are loaded from here -defaults['ee']['plugin_config_dir'] = '/etc/ee/plugins.d' - -# External plugins (generally, do not ship with application code) -defaults['ee']['plugin_dir'] = '/var/lib/ee/plugins' - -# External templates (generally, do not ship with application code) -defaults['ee']['template_dir'] = '/var/lib/ee/templates' - - -class EEArgHandler(ArgParseArgumentHandler): - class Meta: - label = 'ee_args_handler' - - def error(self, message): - super(EEArgHandler, self).error("unknown args") - - -class EEApp(foundation.CementApp): - class Meta: - label = 'ee' - - config_defaults = defaults - - # All built-in application bootstrapping (always run) - bootstrap = 'ee.cli.bootstrap' - - # Optional plugin bootstrapping (only run if plugin is enabled) - plugin_bootstrap = 'ee.cli.plugins' - - # Internal templates (ship with application code) - template_module = 'ee.cli.templates' - - # Internal plugins (ship with application code) - plugin_bootstrap = 'ee.cli.plugins' - - extensions = ['mustache'] - - # default output handler - output_handler = EEOutputHandler - - arg_handler = EEArgHandler - - debug = TOGGLE_DEBUG - - -class EETestApp(EEApp): - """A test app that is better suited for testing.""" - class Meta: - argv = [] - config_files = [] - - -# Define the applicaiton object outside of main, as some libraries might wish -# to import it as a global (rather than passing it into another class/func) -app = EEApp() - - -def main(): - try: - global sys - # Default our exit status to 0 (non-error) - code = 0 - - # if not root...kick out - if not os.geteuid() == 0: - print("\nOnly root or sudo user can run this EasyEngine\n") - app.close(1) - - # Setup the application - app.setup() - - # Dump all arguments into ee log - app.log.debug(sys.argv) - - # Run the application - app.run() - except exc.EEError as e: - # Catch our application errors and exit 1 (error) - code = 1 - print(e) - except FrameworkError as e: - # Catch framework errors and exit 1 (error) - code = 1 - print(e) - except CaughtSignal as e: - # Default Cement signals are SIGINT and SIGTERM, exit 0 (non-error) - code = 0 - print(e) - except Exception as e: - code = 1 - print(e) - finally: - # Print an exception (if it occurred) and --debug was passed - if app.debug: - import sys - import traceback - - exc_type, exc_value, exc_traceback = sys.exc_info() - if exc_traceback is not None: - traceback.print_exc() - - # # Close the application - app.close(code) - - -def get_test_app(**kw): - app = EEApp(**kw) - return app - -if __name__ == '__main__': - main() diff --git a/ee/cli/plugins/__init__.py b/ee/cli/plugins/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/ee/cli/plugins/clean.py b/ee/cli/plugins/clean.py deleted file mode 100644 index 177abe523..000000000 --- a/ee/cli/plugins/clean.py +++ /dev/null @@ -1,108 +0,0 @@ -"""Clean Plugin for EasyEngine.""" - -from ee.core.shellexec import EEShellExec -from ee.core.aptget import EEAptGet -from ee.core.services import EEService -from ee.core.logging import Log -from cement.core.controller import CementBaseController, expose -from cement.core import handler, hook -import os -import urllib.request - - -def ee_clean_hook(app): - # do something with the ``app`` object here. - pass - - -class EECleanController(CementBaseController): - class Meta: - label = 'clean' - stacked_on = 'base' - stacked_type = 'nested' - description = ('Clean NGINX FastCGI cache, Opcacache, Memcache, Pagespeed Cache, Redis Cache') - arguments = [ - (['--all'], - dict(help='Clean all cache', action='store_true')), - (['--fastcgi'], - dict(help='Clean FastCGI cache', action='store_true')), - (['--memcache'], - dict(help='Clean MemCache', action='store_true')), - (['--opcache'], - dict(help='Clean OpCache', action='store_true')), - (['--redis'], - dict(help='Clean Redis Cache', action='store_true')), - ] - usage = "ee clean [options]" - - @expose(hide=True) - def default(self): - if (not (self.app.pargs.all or self.app.pargs.fastcgi or - self.app.pargs.memcache or self.app.pargs.opcache or - self.app.pargs.redis)): - self.clean_fastcgi() - if self.app.pargs.all: - self.clean_memcache() - self.clean_fastcgi() - self.clean_opcache() - self.clean_redis() - if self.app.pargs.fastcgi: - self.clean_fastcgi() - if self.app.pargs.memcache: - self.clean_memcache() - if self.app.pargs.opcache: - self.clean_opcache() - if self.app.pargs.redis: - self.clean_redis() - @expose(hide=True) - def clean_redis(self): - """This function clears Redis cache""" - if(EEAptGet.is_installed(self, "redis-server")): - Log.info(self, "Cleaning Redis cache") - EEShellExec.cmd_exec(self, "redis-cli flushall") - else: - Log.info(self, "Redis is not installed") - - @expose(hide=True) - def clean_memcache(self): - """This function Clears memcache """ - try: - if(EEAptGet.is_installed(self, "memcached")): - EEService.restart_service(self, "memcached") - Log.info(self, "Cleaning MemCache") - else: - Log.info(self, "Memcache not installed") - except Exception as e: - Log.debug(self, "{0}".format(e)) - Log.error(self, "Unable to restart Memcached", False) - - @expose(hide=True) - def clean_fastcgi(self): - """This function clears Fastcgi cache""" - if(os.path.isdir("/var/run/nginx-cache")): - Log.info(self, "Cleaning NGINX FastCGI cache") - EEShellExec.cmd_exec(self, "rm -rf /var/run/nginx-cache/*") - else: - Log.error(self, "Unable to clean FastCGI cache", False) - - @expose(hide=True) - def clean_opcache(self): - """This function clears opcache""" - try: - Log.info(self, "Cleaning opcache") - wp = urllib.request.urlopen(" https://127.0.0.1:22222/cache" - "/opcache/opgui.php?page=reset").read() - except Exception as e: - Log.debug(self, "{0}".format(e)) - Log.debug(self, "Unable hit url, " - " https://127.0.0.1:22222/cache/opcache/opgui.php?page=reset," - " please check you have admin tools installed") - Log.debug(self, "please check you have admin tools installed," - " or install them with `ee stack install --admin`") - Log.error(self, "Unable to clean opcache", False) - -def load(app): - # register the plugin class.. this only happens if the plugin is enabled - handler.register(EECleanController) - # register a hook (function) to run after arguments are parsed. - hook.register('post_argument_parsing', ee_clean_hook) diff --git a/ee/cli/plugins/debug.py b/ee/cli/plugins/debug.py deleted file mode 100644 index 57b4d92d8..000000000 --- a/ee/cli/plugins/debug.py +++ /dev/null @@ -1,858 +0,0 @@ -"""Debug Plugin for EasyEngine""" - -from cement.core.controller import CementBaseController, expose -from cement.core import handler, hook -from ee.core.aptget import EEAptGet -from ee.core.shellexec import * -from ee.core.mysql import EEMysql -from ee.core.services import EEService -from ee.core.logging import Log -from ee.cli.plugins.site_functions import logwatch -from ee.core.variables import EEVariables -from ee.core.fileutils import EEFileUtils -from pynginxconfig import NginxConfig -import os -import configparser -import glob -import signal -import subprocess - - -def ee_debug_hook(app): - # do something with the ``app`` object here. - pass - - -class EEDebugController(CementBaseController): - class Meta: - label = 'debug' - description = 'Used for server level debugging' - stacked_on = 'base' - stacked_type = 'nested' - arguments = [ - (['--stop'], - dict(help='Stop debug', action='store_true')), - (['--start'], - dict(help='Start debug', action='store_true')), - (['--import-slow-log'], - dict(help='Import MySQL slow log to Anemometer database', - action='store_true')), - (['--nginx'], - dict(help='start/stop debugging nginx server ' - 'configuration for site', - action='store' or 'store_const', - choices=('on', 'off'), const='on', nargs='?')), - (['--php'], - dict(help='start/stop debugging server php configuration', - action='store' or 'store_const', - choices=('on', 'off'), const='on', nargs='?')), - (['--fpm'], - dict(help='start/stop debugging fastcgi configuration', - action='store' or 'store_const', - choices=('on', 'off'), const='on', nargs='?')), - (['--php7'], - dict(help='start/stop debugging server php 7.0 configuration', - action='store' or 'store_const', - choices=('on', 'off'), const='on', nargs='?')), - (['--fpm7'], - dict(help='start/stop debugging fastcgi 7.0 configuration', - action='store' or 'store_const', - choices=('on', 'off'), const='on', nargs='?')), - (['--mysql'], - dict(help='start/stop debugging mysql server', - action='store' or 'store_const', - choices=('on', 'off'), const='on', nargs='?')), - (['--wp'], - dict(help='start/stop wordpress debugging for site', - action='store' or 'store_const', choices=('on', 'off'), - const='on', nargs='?')), - (['--rewrite'], - dict(help='start/stop debugging nginx rewrite rules for site', - action='store' or 'store_const', choices=('on', 'off'), - const='on', nargs='?')), - (['--all'], - dict(help='start/stop debugging all server parameters', - action='store' or 'store_const', choices=('on', 'off'), - const='on', nargs='?')), - (['-i', '--interactive'], - dict(help='Interactive debug', action='store_true')), - (['--import-slow-log-interval'], - dict(help='Import MySQL slow log to Anemometer', - action='store', dest='interval')), - (['site_name'], - dict(help='Website Name', nargs='?', default=None)) - ] - usage = "ee debug [<site_name>] [options] " - - @expose(hide=True) - def debug_nginx(self): - """Start/Stop Nginx debug""" - # start global debug - if (self.app.pargs.nginx == 'on' and not self.app.pargs.site_name): - try: - debug_address = (self.app.config.get('stack', 'ip-address') - .split()) - except Exception as e: - debug_address = ['0.0.0.0/0'] - - # Check if IP address is 127.0.0.1 then enable debug globally - if debug_address == ['127.0.0.1'] or debug_address == []: - debug_address = ['0.0.0.0/0'] - - for ip_addr in debug_address: - if not ("debug_connection "+ip_addr in open('/etc/nginx/' - 'nginx.conf', encoding='utf-8').read()): - Log.info(self, "Setting up Nginx debug connection" - " for "+ip_addr) - EEShellExec.cmd_exec(self, "sed -i \"/events {{/a\\ \\ \\ " - "\\ $(echo debug_connection " - "{ip}\;)\" /etc/nginx/" - "nginx.conf".format(ip=ip_addr)) - self.trigger_nginx = True - - if not self.trigger_nginx: - Log.info(self, "Nginx debug connection already enabled") - - self.msg = self.msg + ["/var/log/nginx/*.error.log"] - - # stop global debug - elif (self.app.pargs.nginx == 'off' and not self.app.pargs.site_name): - if "debug_connection " in open('/etc/nginx/nginx.conf', - encoding='utf-8').read(): - Log.info(self, "Disabling Nginx debug connections") - EEShellExec.cmd_exec(self, "sed -i \"/debug_connection.*/d\"" - " /etc/nginx/nginx.conf") - self.trigger_nginx = True - else: - Log.info(self, "Nginx debug connection already disabled") - - # start site specific debug - elif (self.app.pargs.nginx == 'on' and self.app.pargs.site_name): - config_path = ("/etc/nginx/sites-available/{0}" - .format(self.app.pargs.site_name)) - if os.path.isfile(config_path): - if not EEShellExec.cmd_exec(self, "grep \"error.log debug\" " - "{0}".format(config_path)): - Log.info(self, "Starting NGINX debug connection for " - "{0}".format(self.app.pargs.site_name)) - EEShellExec.cmd_exec(self, "sed -i \"s/error.log;/" - "error.log " - "debug;/\" {0}".format(config_path)) - self.trigger_nginx = True - - else: - Log.info(self, "Nginx debug for site already enabled") - - self.msg = self.msg + ['{0}{1}/logs/error.log' - .format(EEVariables.ee_webroot, - self.app.pargs.site_name)] - - else: - Log.info(self, "{0} domain not valid" - .format(self.app.pargs.site_name)) - - # stop site specific debug - elif (self.app.pargs.nginx == 'off' and self.app.pargs.site_name): - config_path = ("/etc/nginx/sites-available/{0}" - .format(self.app.pargs.site_name)) - if os.path.isfile(config_path): - if EEShellExec.cmd_exec(self, "grep \"error.log debug\" {0}" - .format(config_path)): - Log.info(self, "Stoping NGINX debug connection for {0}" - .format(self.app.pargs.site_name)) - EEShellExec.cmd_exec(self, "sed -i \"s/error.log debug;/" - "error.log;/\" {0}" - .format(config_path)) - self.trigger_nginx = True - - else: - - Log.info(self, "Nginx debug for site already disabled") - else: - Log.info(self, "{0} domain not valid" - .format(self.app.pargs.site_name)) - - @expose(hide=True) - def debug_php(self): - """Start/Stop PHP debug""" - # PHP global debug start - - if (self.app.pargs.php == 'on' and not self.app.pargs.site_name): - if not (EEShellExec.cmd_exec(self, "sed -n \"/upstream php" - "{/,/}/p \" /etc/nginx/" - "conf.d/upstream.conf " - "| grep 9001")): - - Log.info(self, "Enabling PHP debug") - - # Change upstream.conf - nc = NginxConfig() - nc.loadf('/etc/nginx/conf.d/upstream.conf') - nc.set([('upstream','php',), 'server'], '127.0.0.1:9001') - if os.path.isfile("/etc/nginx/common/wpfc-hhvm.conf"): - nc.set([('upstream','hhvm',), 'server'], '127.0.0.1:9001') - nc.savef('/etc/nginx/conf.d/upstream.conf') - - # Enable xdebug - EEFileUtils.searchreplace(self, "/etc/{0}/mods-available/".format("php/5.6" if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic') else "php5") + - "xdebug.ini", - ";zend_extension", - "zend_extension") - - # Fix slow log is not enabled default in PHP5.6 - config = configparser.ConfigParser() - config.read('/etc/{0}/fpm/pool.d/debug.conf'.format("php/5.6" if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic') else "php5")) - config['debug']['slowlog'] = '/var/log/{0}/slow.log'.format("php/5.6" if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic') else "php5") - config['debug']['request_slowlog_timeout'] = '10s' - with open('/etc/{0}/fpm/pool.d/debug.conf'.format("php/5.6" if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic') else "php5"), - encoding='utf-8', mode='w') as confifile: - Log.debug(self, "Writting debug.conf configuration into " - "/etc/{0}/fpm/pool.d/debug.conf".format("php/5.6" if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic') else "php5")) - config.write(confifile) - - self.trigger_php = True - self.trigger_nginx = True - else: - Log.info(self, "PHP debug is already enabled") - - self.msg = self.msg + ['/var/log/{0}/slow.log'.format("php/5.6" if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic') else "php5")] - - # PHP global debug stop - elif (self.app.pargs.php == 'off' and not self.app.pargs.site_name): - if EEShellExec.cmd_exec(self, " sed -n \"/upstream php {/,/}/p\" " - "/etc/nginx/conf.d/upstream.conf " - "| grep 9001"): - Log.info(self, "Disabling PHP debug") - - # Change upstream.conf - nc = NginxConfig() - nc.loadf('/etc/nginx/conf.d/upstream.conf') - nc.set([('upstream','php',), 'server'], '127.0.0.1:9000') - if os.path.isfile("/etc/nginx/common/wpfc-hhvm.conf"): - nc.set([('upstream','hhvm',), 'server'], '127.0.0.1:8000') - nc.savef('/etc/nginx/conf.d/upstream.conf') - - # Disable xdebug - EEFileUtils.searchreplace(self, "/etc/{0}/mods-available/".format("php/5.6" if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic') else "php5") + - "xdebug.ini", - "zend_extension", - ";zend_extension") - - self.trigger_php = True - self.trigger_nginx = True - else: - Log.info(self, "PHP debug is already disabled") - - @expose(hide=True) - def debug_fpm(self): - """Start/Stop PHP5-FPM debug""" - # PHP5-FPM start global debug - if (self.app.pargs.fpm == 'on' and not self.app.pargs.site_name): - if not EEShellExec.cmd_exec(self, "grep \"log_level = debug\" " - "/etc/{0}/fpm/php-fpm.conf".format("php/5.6" if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic') else "php5")): - Log.info(self, "Setting up PHP5-FPM log_level = debug") - config = configparser.ConfigParser() - config.read('/etc/{0}/fpm/php-fpm.conf'.format("php/5.6" if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic') else "php5")) - config.remove_option('global', 'include') - config['global']['log_level'] = 'debug' - config['global']['include'] = '/etc/{0}/fpm/pool.d/*.conf'.format("php/5.6" if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic') else "php5") - with open('/etc/{0}/fpm/php-fpm.conf'.format("php/5.6" if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic') else "php5"), - encoding='utf-8', mode='w') as configfile: - Log.debug(self, "Writting php5-FPM configuration into " - "/etc/{0}/fpm/php-fpm.conf".format("php/5.6" if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic') else "php5")) - config.write(configfile) - self.trigger_php = True - else: - Log.info(self, "PHP5-FPM log_level = debug already setup") - - self.msg = self.msg + ['/var/log/{0}/fpm.log'.format("php/5.6" if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic') else "php5")] - - # PHP5-FPM stop global debug - elif (self.app.pargs.fpm == 'off' and not self.app.pargs.site_name): - if EEShellExec.cmd_exec(self, "grep \"log_level = debug\" " - "/etc/{0}/fpm/php-fpm.conf".format("php/5.6" if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic') else "php5")): - Log.info(self, "Disabling PHP5-FPM log_level = debug") - config = configparser.ConfigParser() - config.read('/etc/{0}/fpm/php-fpm.conf'.format("php/5.6" if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic') else "php5")) - config.remove_option('global', 'include') - config['global']['log_level'] = 'notice' - config['global']['include'] = '/etc/{0}/fpm/pool.d/*.conf'.format("php/5.6" if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic') else "php5") - with open('/etc/{0}/fpm/php-fpm.conf'.format("php/5.6" if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic') else "php5"), - encoding='utf-8', mode='w') as configfile: - Log.debug(self, "writting php5 configuration into " - "/etc/{0}/fpm/php-fpm.conf".format("php/5.6" if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic') else "php5")) - config.write(configfile) - - self.trigger_php = True - else: - Log.info(self, "PHP5-FPM log_level = debug already disabled") - - @expose(hide=True) - def debug_php7(self): - """Start/Stop PHP debug""" - # PHP global debug start - - if (self.app.pargs.php7 == 'on' and not self.app.pargs.site_name): - if (EEVariables.ee_platform_codename == 'wheezy' or EEVariables.ee_platform_codename == 'precise'): - Log.error(self,"PHP 7.0 not supported.") - if not (EEShellExec.cmd_exec(self, "sed -n \"/upstream php7" - "{/,/}/p \" /etc/nginx/" - "conf.d/upstream.conf " - "| grep 9170")): - - Log.info(self, "Enabling PHP 7.0 debug") - - # Change upstream.conf - nc = NginxConfig() - nc.loadf('/etc/nginx/conf.d/upstream.conf') - nc.set([('upstream','php7',), 'server'], '127.0.0.1:9170') - if os.path.isfile("/etc/nginx/common/wpfc-hhvm.conf"): - nc.set([('upstream','hhvm',), 'server'], '127.0.0.1:9170') - nc.savef('/etc/nginx/conf.d/upstream.conf') - - # Enable xdebug - EEFileUtils.searchreplace(self, "/etc/php/7.0/mods-available/" - "xdebug.ini", - ";zend_extension", - "zend_extension") - - # Fix slow log is not enabled default in PHP5.6 - config = configparser.ConfigParser() - config.read('/etc/php/7.0/fpm/pool.d/debug.conf') - config['debug']['slowlog'] = '/var/log/php/7.0/slow.log' - config['debug']['request_slowlog_timeout'] = '10s' - with open('/etc/php/7.0/fpm/pool.d/debug.conf', - encoding='utf-8', mode='w') as confifile: - Log.debug(self, "Writting debug.conf configuration into " - "/etc/php/7.0/fpm/pool.d/debug.conf") - config.write(confifile) - - self.trigger_php = True - self.trigger_nginx = True - else: - Log.info(self, "PHP debug is already enabled") - - self.msg = self.msg + ['/var/log/php/7.0/slow.log'] - - # PHP global debug stop - elif (self.app.pargs.php7 == 'off' and not self.app.pargs.site_name): - if EEShellExec.cmd_exec(self, " sed -n \"/upstream php7 {/,/}/p\" " - "/etc/nginx/conf.d/upstream.conf " - "| grep 9170"): - Log.info(self, "Disabling PHP 7.0 debug") - - # Change upstream.conf - nc = NginxConfig() - nc.loadf('/etc/nginx/conf.d/upstream.conf') - nc.set([('upstream','php7',), 'server'], '127.0.0.1:9070') - if os.path.isfile("/etc/nginx/common/wpfc-hhvm.conf"): - nc.set([('upstream','hhvm',), 'server'], '127.0.0.1:8000') - nc.savef('/etc/nginx/conf.d/upstream.conf') - - # Disable xdebug - EEFileUtils.searchreplace(self, "/etc/php/7.0/mods-available/" - "xdebug.ini", - "zend_extension", - ";zend_extension") - - self.trigger_php = True - self.trigger_nginx = True - else: - Log.info(self, "PHP 7.0 debug is already disabled") - - @expose(hide=True) - def debug_fpm7(self): - """Start/Stop PHP5-FPM debug""" - # PHP5-FPM start global debug - if (self.app.pargs.fpm7 == 'on' and not self.app.pargs.site_name): - if not EEShellExec.cmd_exec(self, "grep \"log_level = debug\" " - "/etc/php/7.0/fpm/php-fpm.conf"): - Log.info(self, "Setting up PHP7.0-FPM log_level = debug") - config = configparser.ConfigParser() - config.read('/etc/php/7.0/fpm/php-fpm.conf') - config.remove_option('global', 'include') - config['global']['log_level'] = 'debug' - config['global']['include'] = '/etc/php/7.0/fpm/pool.d/*.conf' - with open('/etc/php/7.0/fpm/php-fpm.conf', - encoding='utf-8', mode='w') as configfile: - Log.debug(self, "Writting php7.0-FPM configuration into " - "/etc/php/7.0/fpm/php-fpm.conf") - config.write(configfile) - self.trigger_php = True - else: - Log.info(self, "PHP7.0-FPM log_level = debug already setup") - - self.msg = self.msg + ['/var/log/php/7.0/fpm.log'] - - # PHP5-FPM stop global debug - elif (self.app.pargs.fpm7 == 'off' and not self.app.pargs.site_name): - if EEShellExec.cmd_exec(self, "grep \"log_level = debug\" " - "/etc/php/7.0/fpm/php-fpm.conf"): - Log.info(self, "Disabling PHP7.0-FPM log_level = debug") - config = configparser.ConfigParser() - config.read('/etc/php/7.0/fpm/php-fpm.conf') - config.remove_option('global', 'include') - config['global']['log_level'] = 'notice' - config['global']['include'] = '/etc/php/7.0/fpm/pool.d/*.conf' - with open('/etc/php/7.0/fpm/php-fpm.conf', - encoding='utf-8', mode='w') as configfile: - Log.debug(self, "writting php7.0 configuration into " - "/etc/php/7.0/fpm/php-fpm.conf") - config.write(configfile) - self.trigger_php = True - else: - Log.info(self, "PHP7.0-FPM log_level = debug already disabled") - - @expose(hide=True) - def debug_mysql(self): - """Start/Stop MySQL debug""" - # MySQL start global debug - if (self.app.pargs.mysql == 'on' and not self.app.pargs.site_name): - if not EEShellExec.cmd_exec(self, "mysql -e \"show variables like" - " \'slow_query_log\';\" | " - "grep ON"): - Log.info(self, "Setting up MySQL slow log") - EEMysql.execute(self, "set global slow_query_log = " - "\'ON\';") - EEMysql.execute(self, "set global slow_query_log_file = " - "\'/var/log/mysql/mysql-slow.log\';") - EEMysql.execute(self, "set global long_query_time = 2;") - EEMysql.execute(self, "set global log_queries_not_using" - "_indexes = \'ON\';") - else: - Log.info(self, "MySQL slow log is already enabled") - - self.msg = self.msg + ['/var/log/mysql/mysql-slow.log'] - - # MySQL stop global debug - elif (self.app.pargs.mysql == 'off' and not self.app.pargs.site_name): - if EEShellExec.cmd_exec(self, "mysql -e \"show variables like \'" - "slow_query_log\';\" | grep ON"): - Log.info(self, "Disabling MySQL slow log") - EEMysql.execute(self, "set global slow_query_log = \'OFF\';") - EEMysql.execute(self, "set global slow_query_log_file = \'" - "/var/log/mysql/mysql-slow.log\';") - EEMysql.execute(self, "set global long_query_time = 10;") - EEMysql.execute(self, "set global log_queries_not_using_index" - "es = \'OFF\';") - EEShellExec.cmd_exec(self, "crontab -l | sed \'/#EasyEngine " - "start/,/#EasyEngine end/d\' | crontab -") - else: - Log.info(self, "MySQL slow log already disabled") - - @expose(hide=True) - def debug_wp(self): - """Start/Stop WordPress debug""" - if (self.app.pargs.wp == 'on' and self.app.pargs.site_name): - wp_config = ("{0}/{1}/wp-config.php" - .format(EEVariables.ee_webroot, - self.app.pargs.site_name)) - webroot = "{0}{1}".format(EEVariables.ee_webroot, - self.app.pargs.site_name) - # Check wp-config.php file into htdocs folder - if not os.path.isfile(wp_config): - wp_config = ("{0}/{1}/htdocs/wp-config.php" - .format(EEVariables.ee_webroot, - self.app.pargs.site_name)) - if os.path.isfile(wp_config): - if not EEShellExec.cmd_exec(self, "grep \"\'WP_DEBUG\'\" {0} |" - " grep true".format(wp_config)): - Log.info(self, "Starting WordPress debug") - open("{0}/htdocs/wp-content/debug.log".format(webroot), - encoding='utf-8', mode='a').close() - EEShellExec.cmd_exec(self, "chown {1}: {0}/htdocs/wp-" - "content/debug.log" - "".format(webroot, - EEVariables.ee_php_user)) - EEShellExec.cmd_exec(self, "sed -i \"s/define(\'WP_DEBUG\'" - ".*/define(\'WP_DEBUG\', true);\\n" - "define(\'WP_DEBUG_DISPLAY\', false);" - "\\ndefine(\'WP_DEBUG_LOG\', true);" - "\\ndefine(\'SAVEQUERIES\', true);/\"" - " {0}".format(wp_config)) - EEShellExec.cmd_exec(self, "cd {0}/htdocs/ && wp" - " plugin --allow-root install " - "developer query-monitor" - .format(webroot)) - EEShellExec.cmd_exec(self, "chown -R {1}: {0}/htdocs/" - "wp-content/plugins" - .format(webroot, - EEVariables.ee_php_user)) - - self.msg = self.msg + ['{0}{1}/htdocs/wp-content' - '/debug.log' - .format(EEVariables.ee_webroot, - self.app.pargs.site_name)] - - else: - Log.info(self, "Unable to find wp-config.php for site: {0}" - .format(self.app.pargs.site_name)) - - elif (self.app.pargs.wp == 'off' and self.app.pargs.site_name): - wp_config = ("{0}{1}/wp-config.php" - .format(EEVariables.ee_webroot, - self.app.pargs.site_name)) - webroot = "{0}{1}".format(EEVariables.ee_webroot, - self.app.pargs.site_name) - # Check wp-config.php file into htdocs folder - if not os.path.isfile(wp_config): - wp_config = ("{0}/{1}/htdocs/wp-config.php" - .format(EEVariables.ee_webroot, - self.app.pargs.site_name)) - if os.path.isfile(wp_config): - if EEShellExec.cmd_exec(self, "grep \"\'WP_DEBUG\'\" {0} | " - "grep true".format(wp_config)): - Log.info(self, "Disabling WordPress debug") - EEShellExec.cmd_exec(self, "sed -i \"s/define(\'WP_DEBUG\'" - ", true);/define(\'WP_DEBUG\', " - "false);/\" {0}".format(wp_config)) - EEShellExec.cmd_exec(self, "sed -i \"/define(\'" - "WP_DEBUG_DISPLAY\', false);/d\" {0}" - .format(wp_config)) - EEShellExec.cmd_exec(self, "sed -i \"/define(\'" - "WP_DEBUG_LOG\', true);/d\" {0}" - .format(wp_config)) - EEShellExec.cmd_exec(self, "sed -i \"/define(\'" - "SAVEQUERIES\', " - "true);/d\" {0}".format(wp_config)) - else: - Log.info(self, "WordPress debug all already disabled") - else: - Log.error(self, "Missing argument site name") - - @expose(hide=True) - def debug_rewrite(self): - """Start/Stop Nginx rewrite rules debug""" - # Start Nginx rewrite debug globally - if (self.app.pargs.rewrite == 'on' and not self.app.pargs.site_name): - if not EEShellExec.cmd_exec(self, "grep \"rewrite_log on;\" " - "/etc/nginx/nginx.conf"): - Log.info(self, "Setting up Nginx rewrite logs") - EEShellExec.cmd_exec(self, "sed -i \'/http {/a \\\\t" - "rewrite_log on;\' /etc/nginx/nginx.conf") - self.trigger_nginx = True - else: - Log.info(self, "Nginx rewrite logs already enabled") - - if '/var/log/nginx/*.error.log' not in self.msg: - self.msg = self.msg + ['/var/log/nginx/*.error.log'] - - # Stop Nginx rewrite debug globally - elif (self.app.pargs.rewrite == 'off' - and not self.app.pargs.site_name): - if EEShellExec.cmd_exec(self, "grep \"rewrite_log on;\" " - "/etc/nginx/nginx.conf"): - Log.info(self, "Disabling Nginx rewrite logs") - EEShellExec.cmd_exec(self, "sed -i \"/rewrite_log.*/d\"" - " /etc/nginx/nginx.conf") - self.trigger_nginx = True - else: - Log.info(self, "Nginx rewrite logs already disabled") - # Start Nginx rewrite for site - elif (self.app.pargs.rewrite == 'on' and self.app.pargs.site_name): - config_path = ("/etc/nginx/sites-available/{0}" - .format(self.app.pargs.site_name)) - if not EEShellExec.cmd_exec(self, "grep \"rewrite_log on;\" {0}" - .format(config_path)): - Log.info(self, "Setting up Nginx rewrite logs for {0}" - .format(self.app.pargs.site_name)) - EEShellExec.cmd_exec(self, "sed -i \"/access_log/i \\\\\\t" - "rewrite_log on;\" {0}" - .format(config_path)) - self.trigger_nginx = True - else: - Log.info(self, "Nginx rewrite logs for {0} already setup" - .format(self.app.pargs.site_name)) - - if ('{0}{1}/logs/error.log'.format(EEVariables.ee_webroot, - self.app.pargs.site_name) - not in self.msg): - self.msg = self.msg + ['{0}{1}/logs/error.log' - .format(EEVariables.ee_webroot, - self.app.pargs.site_name)] - - # Stop Nginx rewrite for site - elif (self.app.pargs.rewrite == 'off' and self.app.pargs.site_name): - config_path = ("/etc/nginx/sites-available/{0}" - .format(self.app.pargs.site_name)) - if EEShellExec.cmd_exec(self, "grep \"rewrite_log on;\" {0}" - .format(config_path)): - Log.info(self, "Disabling Nginx rewrite logs for {0}" - .format(self.app.pargs.site_name)) - EEShellExec.cmd_exec(self, "sed -i \"/rewrite_log.*/d\" {0}" - .format(config_path)) - self.trigger_nginx = True - else: - Log.info(self, "Nginx rewrite logs for {0} already " - " disabled".format(self.app.pargs.site_name)) - - @expose(hide=True) - def signal_handler(self, signal, frame): - """Handle Ctrl+c hevent for -i option of debug""" - self.start = False - if self.app.pargs.nginx: - self.app.pargs.nginx = 'off' - self.debug_nginx() - if self.app.pargs.php: - self.app.pargs.php = 'off' - self.debug_php() - if self.app.pargs.php7: - self.app.pargs.php7 = 'off' - self.debug_php7() - if self.app.pargs.fpm: - self.app.pargs.fpm = 'off' - self.debug_fpm() - if self.app.pargs.fpm7: - self.app.pargs.fpm7 = 'off' - self.debug_fpm7() - if self.app.pargs.mysql: - # MySQL debug will not work for remote MySQL - if EEVariables.ee_mysql_host is "localhost": - self.app.pargs.mysql = 'off' - self.debug_mysql() - else: - Log.warn(self, "Remote MySQL found, EasyEngine will not " - "enable remote debug") - if self.app.pargs.wp: - self.app.pargs.wp = 'off' - self.debug_wp() - if self.app.pargs.rewrite: - self.app.pargs.rewrite = 'off' - self.debug_rewrite() - - # Reload Nginx - if self.trigger_nginx: - EEService.reload_service(self, 'nginx') - - # Reload PHP - if self.trigger_php: - if EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic': - if EEAptGet.is_installed(self,'php5.6-fpm'): - EEService.reload_service(self, 'php5.6-fpm') - if EEAptGet.is_installed(self,'php7.0-fpm'): - EEService.reload_service(self, 'php7.0-fpm') - else: - EEService.reload_service(self, 'php5-fpm') - self.app.close(0) - - @expose(hide=True) - def default(self): - """Default function of debug""" - # self.start = True - self.interactive = False - self.msg = [] - self.trigger_nginx = False - self.trigger_php = False - - if ((not self.app.pargs.nginx) and (not self.app.pargs.php) and (not self.app.pargs.php7) - and (not self.app.pargs.fpm) and (not self.app.pargs.fpm7) and (not self.app.pargs.mysql) - and (not self.app.pargs.wp) and (not self.app.pargs.rewrite) - and (not self.app.pargs.all) - and (not self.app.pargs.site_name) - and (not self.app.pargs.import_slow_log) - and (not self.app.pargs.interval)): - if self.app.pargs.stop or self.app.pargs.start: - print("--start/stop option is deprecated since ee3.0.5") - self.app.args.print_help() - else: - self.app.args.print_help() - - if self.app.pargs.import_slow_log: - self.import_slow_log() - - if self.app.pargs.interval: - try: - cron_time = int(self.app.pargs.interval) - except Exception as e: - cron_time = 5 - - try: - if not EEShellExec.cmd_exec(self, "crontab -l | grep " - "'ee debug --import-slow-log'"): - if not cron_time == 0: - Log.info(self, "setting up crontab entry," - " please wait...") - EEShellExec.cmd_exec(self, "/bin/bash -c \"crontab -l " - "2> /dev/null | {{ cat; echo -e" - " \\\"#EasyEngine start MySQL " - "slow log \\n*/{0} * * * * " - "/usr/local/bin/ee debug" - " --import-slow-log\\n" - "#EasyEngine end MySQL slow log" - "\\\"; }} | crontab -\"" - .format(cron_time)) - else: - if not cron_time == 0: - Log.info(self, "updating crontab entry," - " please wait...") - if not EEShellExec.cmd_exec(self, "/bin/bash -c " - "\"crontab " - "-l | sed '/EasyEngine " - "start MySQL slow " - "log/!b;n;c\*\/{0} " - "\* \* \* " - "\* \/usr" - "\/local\/bin\/ee debug " - "--import\-slow\-log' " - "| crontab -\"" - .format(cron_time)): - Log.error(self, "failed to update crontab entry") - else: - Log.info(self, "removing crontab entry," - " please wait...") - if not EEShellExec.cmd_exec(self, "/bin/bash -c " - "\"crontab " - "-l | sed '/EasyEngine " - "start MySQL slow " - "log/,+2d'" - "| crontab -\"" - .format(cron_time)): - Log.error(self, "failed to remove crontab entry") - except CommandExecutionError as e: - Log.debug(self, str(e)) - - if self.app.pargs.all == 'on': - if self.app.pargs.site_name: - self.app.pargs.wp = 'on' - self.app.pargs.nginx = 'on' - self.app.pargs.php = 'on' - self.app.pargs.fpm = 'on' - if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic') and EEAptGet.is_installed(self,'php7.0-fpm'): - self.app.pargs.php7 = 'on' - self.app.pargs.fpm7 = 'on' - self.app.pargs.mysql = 'on' - self.app.pargs.rewrite = 'on' - - if self.app.pargs.all == 'off': - if self.app.pargs.site_name: - self.app.pargs.wp = 'off' - self.app.pargs.nginx = 'off' - self.app.pargs.php = 'off' - self.app.pargs.fpm = 'off' - if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic') and EEAptGet.is_installed(self,'php7.0-fpm'): - self.app.pargs.php7 = 'off' - self.app.pargs.fpm7 = 'off' - self.app.pargs.mysql = 'off' - self.app.pargs.rewrite = 'off' - - if ((not self.app.pargs.nginx) and (not self.app.pargs.php) and (not self.app.pargs.php7) - and (not self.app.pargs.fpm) and (not self.app.pargs.fpm7) and (not self.app.pargs.mysql) - and (not self.app.pargs.wp) and (not self.app.pargs.rewrite) - and self.app.pargs.site_name): - self.app.args.print_help() - # self.app.pargs.nginx = 'on' - # self.app.pargs.wp = 'on' - # self.app.pargs.rewrite = 'on' - - if self.app.pargs.nginx: - self.debug_nginx() - if self.app.pargs.php: - self.debug_php() - if self.app.pargs.fpm: - self.debug_fpm() - if self.app.pargs.php7: - self.debug_php7() - if self.app.pargs.fpm7: - self.debug_fpm7() - if self.app.pargs.mysql: - # MySQL debug will not work for remote MySQL - if EEVariables.ee_mysql_host is "localhost": - self.debug_mysql() - else: - Log.warn(self, "Remote MySQL found, EasyEngine will not " - "enable remote debug") - if self.app.pargs.wp: - self.debug_wp() - if self.app.pargs.rewrite: - self.debug_rewrite() - - if self.app.pargs.interactive: - self.interactive = True - - # Reload Nginx - if self.trigger_nginx: - EEService.reload_service(self, 'nginx') - # Reload PHP - if self.trigger_php: - if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic'): - if EEAptGet.is_installed(self,'php5.6-fpm'): - EEService.restart_service(self, 'php5.6-fpm') - if EEAptGet.is_installed(self,'php7.0-fpm'): - EEService.restart_service(self, 'php7.0-fpm') - else: - EEService.restart_service(self, 'php5-fpm') - if EEVariables.ee_platform_codename == 'jessie': - EEService.restart_service(self, 'php7.0-fpm') - - if len(self.msg) > 0: - if not self.app.pargs.interactive: - disp_msg = ' '.join(self.msg) - Log.info(self, "Use following command to check debug logs:\n" - + Log.ENDC + "tail -f {0}".format(disp_msg)) - else: - signal.signal(signal.SIGINT, self.signal_handler) - watch_list = [] - for w_list in self.msg: - watch_list = watch_list + glob.glob(w_list) - - logwatch(self, watch_list) - - @expose(hide=True) - def import_slow_log(self): - """Default function for import slow log""" - if os.path.isdir("{0}22222/htdocs/db/anemometer" - .format(EEVariables.ee_webroot)): - if os.path.isfile("/var/log/mysql/mysql-slow.log"): - # Get Anemometer user name and password - Log.info(self, "Importing MySQL slow log to Anemometer") - host = os.popen("grep -e \"\'host\'\" {0}22222/htdocs/" - .format(EEVariables.ee_webroot) - + "db/anemometer/conf/config.inc.php " - "| head -1 | cut -d\\\' -f4 | " - "tr -d '\n'").read() - user = os.popen("grep -e \"\'user\'\" {0}22222/htdocs/" - .format(EEVariables.ee_webroot) - + "db/anemometer/conf/config.inc.php " - "| head -1 | cut -d\\\' -f4 | " - "tr -d '\n'").read() - password = os.popen("grep -e \"\'password\'\" {0}22222/" - .format(EEVariables.ee_webroot) - + "htdocs/db/anemometer/conf" - "/config.inc.php " - "| head -1 | cut -d\\\' -f4 | " - "tr -d '\n'").read() - - # Import slow log Anemometer using pt-query-digest - try: - EEShellExec.cmd_exec(self, "pt-query-digest --user={0} " - "--password={1} " - "--review D=slow_query_log," - "t=global_query_review " - "--history D=slow_query_log,t=" - "global_query_review_history " - "--no-report --limit=0% " - "--filter=\" \\$event->{{Bytes}} = " - "length(\\$event->{{arg}}) " - "and \\$event->{{hostname}}=\\\"" - "{2}\\\"\" " - "/var/log/mysql/mysql-slow.log" - .format(user, password, host)) - except CommandExecutionError as e: - Log.debug(self, str(e)) - Log.error(self, "MySQL slow log import failed.") - else: - Log.error(self, "MySQL slow log file not found," - " so not imported slow logs") - else: - Log.error(self, "Anemometer is not installed." + - Log.ENDC + "\nYou can install Anemometer with " - "this command " - + Log.BOLD + "\n `ee stack install --utils`" - + Log.ENDC) - - -def load(app): - # register the plugin class.. this only happens if the plugin is enabled - handler.register(EEDebugController) - # register a hook (function) to run after arguments are parsed. - hook.register('post_argument_parsing', ee_debug_hook) diff --git a/ee/cli/plugins/import_slow_log.py b/ee/cli/plugins/import_slow_log.py deleted file mode 100644 index ea035aee0..000000000 --- a/ee/cli/plugins/import_slow_log.py +++ /dev/null @@ -1,34 +0,0 @@ -from cement.core.controller import CementBaseController, expose -from cement.core import handler, hook -from ee.core.shellexec import EEShellExec -from ee.core.logging import Log -from ee.core.variables import EEVariables -import os - - -def ee_import_slow_log_hook(app): - pass - - -class EEImportslowlogController(CementBaseController): - class Meta: - label = 'import_slow_log' - stacked_on = 'base' - stacked_type = 'nested' - description = 'Import MySQL slow log to Anemometer database' - usage = "ee import-slow-log" - - @expose(hide=True) - def default(self): - Log.info(self, "This command is deprecated." - " You can use this command instead, " + - Log.ENDC + Log.BOLD + "\n`ee debug --import-slow-log`" + - Log.ENDC) - - -def load(app): - # register the plugin class.. this only happens if the plugin is enabled - handler.register(EEImportslowlogController) - - # register a hook (function) to run after arguments are parsed. - hook.register('post_argument_parsing', ee_import_slow_log_hook) diff --git a/ee/cli/plugins/info.py b/ee/cli/plugins/info.py deleted file mode 100644 index be2446731..000000000 --- a/ee/cli/plugins/info.py +++ /dev/null @@ -1,290 +0,0 @@ -"""EEInfo Plugin for EasyEngine.""" - -from cement.core.controller import CementBaseController, expose -from cement.core import handler, hook -from ee.core.variables import EEVariables -from pynginxconfig import NginxConfig -from ee.core.aptget import EEAptGet -from ee.core.shellexec import EEShellExec -from ee.core.logging import Log -import os -import configparser - - -def ee_info_hook(app): - # do something with the ``app`` object here. - pass - - -class EEInfoController(CementBaseController): - class Meta: - label = 'info' - stacked_on = 'base' - stacked_type = 'nested' - description = ('Display configuration information related to Nginx,' - ' PHP and MySQL') - arguments = [ - (['--mysql'], - dict(help='Get MySQL configuration information', - action='store_true')), - (['--php'], - dict(help='Get PHP configuration information', - action='store_true')), - (['--php7'], - dict(help='Get PHP 7.0 configuration information', - action='store_true')), - (['--nginx'], - dict(help='Get Nginx configuration information', - action='store_true')), - ] - usage = "ee info [options]" - - @expose(hide=True) - def info_nginx(self): - """Display Nginx information""" - version = os.popen("nginx -v 2>&1 | cut -d':' -f2 | cut -d' ' -f2 | " - "cut -d'/' -f2 | tr -d '\n'").read() - allow = os.popen("grep ^allow /etc/nginx/common/acl.conf | " - "cut -d' ' -f2 | cut -d';' -f1 | tr '\n' ' '").read() - nc = NginxConfig() - nc.loadf('/etc/nginx/nginx.conf') - user = nc.get('user')[1] - worker_processes = nc.get('worker_processes')[1] - worker_connections = nc.get([('events',), 'worker_connections'])[1] - keepalive_timeout = nc.get([('http',), 'keepalive_timeout'])[1] - fastcgi_read_timeout = nc.get([('http',), - 'fastcgi_read_timeout'])[1] - client_max_body_size = nc.get([('http',), - 'client_max_body_size'])[1] - data = dict(version=version, allow=allow, user=user, - worker_processes=worker_processes, - keepalive_timeout=keepalive_timeout, - worker_connections=worker_connections, - fastcgi_read_timeout=fastcgi_read_timeout, - client_max_body_size=client_max_body_size) - self.app.render((data), 'info_nginx.mustache') - - @expose(hide=True) - def info_php(self): - """Display PHP information""" - version = os.popen("{0} -v 2>/dev/null | head -n1 | cut -d' ' -f2 |".format("php5.6" if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic') else "php") + - " cut -d'+' -f1 | tr -d '\n'").read - config = configparser.ConfigParser() - config.read('/etc/{0}/fpm/php.ini'.format("php/5.6" if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic') else "php5")) - expose_php = config['PHP']['expose_php'] - memory_limit = config['PHP']['memory_limit'] - post_max_size = config['PHP']['post_max_size'] - upload_max_filesize = config['PHP']['upload_max_filesize'] - max_execution_time = config['PHP']['max_execution_time'] - - config.read('/etc/{0}/fpm/pool.d/www.conf'.format("php/5.6" if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic') else "php5")) - www_listen = config['www']['listen'] - www_ping_path = config['www']['ping.path'] - www_pm_status_path = config['www']['pm.status_path'] - www_pm = config['www']['pm'] - www_pm_max_requests = config['www']['pm.max_requests'] - www_pm_max_children = config['www']['pm.max_children'] - www_pm_start_servers = config['www']['pm.start_servers'] - www_pm_min_spare_servers = config['www']['pm.min_spare_servers'] - www_pm_max_spare_servers = config['www']['pm.max_spare_servers'] - www_request_terminate_time = (config['www'] - ['request_terminate_timeout']) - try: - www_xdebug = (config['www']['php_admin_flag[xdebug.profiler_enable' - '_trigger]']) - except Exception as e: - www_xdebug = 'off' - - config.read('/etc/{0}/fpm/pool.d/debug.conf'.format("php/5.6" if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic') else "php5")) - debug_listen = config['debug']['listen'] - debug_ping_path = config['debug']['ping.path'] - debug_pm_status_path = config['debug']['pm.status_path'] - debug_pm = config['debug']['pm'] - debug_pm_max_requests = config['debug']['pm.max_requests'] - debug_pm_max_children = config['debug']['pm.max_children'] - debug_pm_start_servers = config['debug']['pm.start_servers'] - debug_pm_min_spare_servers = config['debug']['pm.min_spare_servers'] - debug_pm_max_spare_servers = config['debug']['pm.max_spare_servers'] - debug_request_terminate = (config['debug'] - ['request_terminate_timeout']) - try: - debug_xdebug = (config['debug']['php_admin_flag[xdebug.profiler_' - 'enable_trigger]']) - except Exception as e: - debug_xdebug = 'off' - - data = dict(version=version, expose_php=expose_php, - memory_limit=memory_limit, post_max_size=post_max_size, - upload_max_filesize=upload_max_filesize, - max_execution_time=max_execution_time, - www_listen=www_listen, www_ping_path=www_ping_path, - www_pm_status_path=www_pm_status_path, www_pm=www_pm, - www_pm_max_requests=www_pm_max_requests, - www_pm_max_children=www_pm_max_children, - www_pm_start_servers=www_pm_start_servers, - www_pm_min_spare_servers=www_pm_min_spare_servers, - www_pm_max_spare_servers=www_pm_max_spare_servers, - www_request_terminate_timeout=www_request_terminate_time, - www_xdebug_profiler_enable_trigger=www_xdebug, - debug_listen=debug_listen, debug_ping_path=debug_ping_path, - debug_pm_status_path=debug_pm_status_path, - debug_pm=debug_pm, - debug_pm_max_requests=debug_pm_max_requests, - debug_pm_max_children=debug_pm_max_children, - debug_pm_start_servers=debug_pm_start_servers, - debug_pm_min_spare_servers=debug_pm_min_spare_servers, - debug_pm_max_spare_servers=debug_pm_max_spare_servers, - debug_request_terminate_timeout=debug_request_terminate, - debug_xdebug_profiler_enable_trigger=debug_xdebug) - self.app.render((data), 'info_php.mustache') - - @expose(hide=True) - def info_php7(self): - """Display PHP information""" - version = os.popen("php7.0 -v 2>/dev/null | head -n1 | cut -d' ' -f2 |" - " cut -d'+' -f1 | tr -d '\n'").read - config = configparser.ConfigParser() - config.read('/etc/php/7.0/fpm/php.ini') - expose_php = config['PHP']['expose_php'] - memory_limit = config['PHP']['memory_limit'] - post_max_size = config['PHP']['post_max_size'] - upload_max_filesize = config['PHP']['upload_max_filesize'] - max_execution_time = config['PHP']['max_execution_time'] - - config.read('/etc/php/7.0/fpm/pool.d/www.conf') - www_listen = config['www']['listen'] - www_ping_path = config['www']['ping.path'] - www_pm_status_path = config['www']['pm.status_path'] - www_pm = config['www']['pm'] - www_pm_max_requests = config['www']['pm.max_requests'] - www_pm_max_children = config['www']['pm.max_children'] - www_pm_start_servers = config['www']['pm.start_servers'] - www_pm_min_spare_servers = config['www']['pm.min_spare_servers'] - www_pm_max_spare_servers = config['www']['pm.max_spare_servers'] - www_request_terminate_time = (config['www'] - ['request_terminate_timeout']) - try: - www_xdebug = (config['www']['php_admin_flag[xdebug.profiler_enable' - '_trigger]']) - except Exception as e: - www_xdebug = 'off' - - config.read('/etc/php/7.0/fpm/pool.d/debug.conf') - debug_listen = config['debug']['listen'] - debug_ping_path = config['debug']['ping.path'] - debug_pm_status_path = config['debug']['pm.status_path'] - debug_pm = config['debug']['pm'] - debug_pm_max_requests = config['debug']['pm.max_requests'] - debug_pm_max_children = config['debug']['pm.max_children'] - debug_pm_start_servers = config['debug']['pm.start_servers'] - debug_pm_min_spare_servers = config['debug']['pm.min_spare_servers'] - debug_pm_max_spare_servers = config['debug']['pm.max_spare_servers'] - debug_request_terminate = (config['debug'] - ['request_terminate_timeout']) - try: - debug_xdebug = (config['debug']['php_admin_flag[xdebug.profiler_' - 'enable_trigger]']) - except Exception as e: - debug_xdebug = 'off' - - data = dict(version=version, expose_php=expose_php, - memory_limit=memory_limit, post_max_size=post_max_size, - upload_max_filesize=upload_max_filesize, - max_execution_time=max_execution_time, - www_listen=www_listen, www_ping_path=www_ping_path, - www_pm_status_path=www_pm_status_path, www_pm=www_pm, - www_pm_max_requests=www_pm_max_requests, - www_pm_max_children=www_pm_max_children, - www_pm_start_servers=www_pm_start_servers, - www_pm_min_spare_servers=www_pm_min_spare_servers, - www_pm_max_spare_servers=www_pm_max_spare_servers, - www_request_terminate_timeout=www_request_terminate_time, - www_xdebug_profiler_enable_trigger=www_xdebug, - debug_listen=debug_listen, debug_ping_path=debug_ping_path, - debug_pm_status_path=debug_pm_status_path, - debug_pm=debug_pm, - debug_pm_max_requests=debug_pm_max_requests, - debug_pm_max_children=debug_pm_max_children, - debug_pm_start_servers=debug_pm_start_servers, - debug_pm_min_spare_servers=debug_pm_min_spare_servers, - debug_pm_max_spare_servers=debug_pm_max_spare_servers, - debug_request_terminate_timeout=debug_request_terminate, - debug_xdebug_profiler_enable_trigger=debug_xdebug) - self.app.render((data), 'info_php.mustache') - - @expose(hide=True) - def info_mysql(self): - """Display MySQL information""" - version = os.popen("mysql -V | awk '{print($5)}' | cut -d ',' " - "-f1 | tr -d '\n'").read() - host = "localhost" - port = os.popen("mysql -e \"show variables\" | grep ^port | awk " - "'{print($2)}' | tr -d '\n'").read() - wait_timeout = os.popen("mysql -e \"show variables\" | grep " - "^wait_timeout | awk '{print($2)}' | " - "tr -d '\n'").read() - interactive_timeout = os.popen("mysql -e \"show variables\" | grep " - "^interactive_timeout | awk " - "'{print($2)}' | tr -d '\n'").read() - max_used_connections = os.popen("mysql -e \"show global status\" | " - "grep Max_used_connections | awk " - "'{print($2)}' | tr -d '\n'").read() - datadir = os.popen("mysql -e \"show variables\" | grep datadir | awk" - " '{print($2)}' | tr -d '\n'").read() - socket = os.popen("mysql -e \"show variables\" | grep \"^socket\" | " - "awk '{print($2)}' | tr -d '\n'").read() - data = dict(version=version, host=host, port=port, - wait_timeout=wait_timeout, - interactive_timeout=interactive_timeout, - max_used_connections=max_used_connections, - datadir=datadir, socket=socket) - self.app.render((data), 'info_mysql.mustache') - - @expose(hide=True) - def default(self): - """default function for info""" - if (not self.app.pargs.nginx and not self.app.pargs.php - and not self.app.pargs.mysql and not self.app.pargs.php7): - self.app.pargs.nginx = True - self.app.pargs.php = True - self.app.pargs.mysql = True - if EEAptGet.is_installed(self, 'php7.0-fpm'): - self.app.pargs.php = True - - if self.app.pargs.nginx: - if EEAptGet.is_installed(self, 'nginx-custom') or EEAptGet.is_installed(self, 'nginx-common'): - self.info_nginx() - else: - Log.error(self, "Nginx is not installed") - - if self.app.pargs.php: - if (EEVariables.ee_platform_distro == 'debian' or EEVariables.ee_platform_codename == 'precise'): - if EEAptGet.is_installed(self, 'php5-fpm'): - self.info_php() - else: - Log.error(self, "PHP5 is not installed") - else: - if EEAptGet.is_installed(self, 'php5.6-fpm'): - self.info_php() - else: - Log.error(self, "PHP5.6 is not installed") - - if self.app.pargs.php7: - if EEAptGet.is_installed(self, 'php7.0-fpm'): - self.info_php7() - else: - Log.error(self, "PHP 7.0 is not installed") - - if self.app.pargs.mysql: - if EEShellExec.cmd_exec(self, "mysqladmin ping"): - self.info_mysql() - else: - Log.error(self, "MySQL is not installed") - - -def load(app): - # register the plugin class.. this only happens if the plugin is enabled - handler.register(EEInfoController) - - # register a hook (function) to run after arguments are parsed. - hook.register('post_argument_parsing', ee_info_hook) diff --git a/ee/cli/plugins/log.py b/ee/cli/plugins/log.py deleted file mode 100644 index fbaffd94b..000000000 --- a/ee/cli/plugins/log.py +++ /dev/null @@ -1,578 +0,0 @@ -"""Debug Plugin for EasyEngine""" - -from cement.core.controller import CementBaseController, expose -from cement.core import handler, hook -from ee.core.logging import Log -from ee.cli.plugins.site_functions import logwatch -from ee.core.variables import EEVariables -from ee.core.fileutils import EEFileUtils -from ee.core.shellexec import EEShellExec -from ee.core.sendmail import EESendMail -from ee.core.mysql import EEMysql -import os -import glob -import gzip - - -def ee_log_hook(app): - # do something with the ``app`` object here. - pass - - -class EELogController(CementBaseController): - class Meta: - label = 'log' - description = 'Perform operations on Nginx, PHP, MySQL log file' - stacked_on = 'base' - stacked_type = 'nested' - usage = "ee log [<site_name>] [options]" - - @expose(hide=True) - def default(self): - self.app.args.print_help() - - -class EELogShowController(CementBaseController): - class Meta: - label = 'show' - description = 'Show Nginx, PHP, MySQL log file' - stacked_on = 'log' - stacked_type = 'nested' - arguments = [ - (['--all'], - dict(help='Show All logs file', action='store_true')), - (['--nginx'], - dict(help='Show Nginx Error logs file', action='store_true')), - (['--php'], - dict(help='Show PHP Error logs file', action='store_true')), - (['--fpm'], - dict(help='Show PHP5-fpm slow logs file', - action='store_true')), - (['--mysql'], - dict(help='Show MySQL logs file', action='store_true')), - (['--wp'], - dict(help='Show Site specific WordPress logs file', - action='store_true')), - (['--access'], - dict(help='Show Nginx access log file', - action='store_true')), - (['site_name'], - dict(help='Website Name', nargs='?', default=None)) - ] - usage = "ee log show [<site_name>] [options]" - - @expose(hide=True) - def default(self): - """Default function of log show""" - self.msg = [] - - if self.app.pargs.php: - self.app.pargs.nginx = True - - if ((not self.app.pargs.nginx) and (not self.app.pargs.fpm) - and (not self.app.pargs.mysql) and (not self.app.pargs.access) - and (not self.app.pargs.wp) and (not self.app.pargs.site_name)): - self.app.pargs.nginx = True - self.app.pargs.fpm = True - self.app.pargs.mysql = True - self.app.pargs.access = True - - if ((not self.app.pargs.nginx) and (not self.app.pargs.fpm) - and (not self.app.pargs.mysql) and (not self.app.pargs.access) - and (not self.app.pargs.wp) and (self.app.pargs.site_name)): - self.app.pargs.nginx = True - self.app.pargs.wp = True - self.app.pargs.access = True - self.app.pargs.mysql = True - - if self.app.pargs.nginx and (not self.app.pargs.site_name): - self.msg = self.msg + ["/var/log/nginx/*error.log"] - - if self.app.pargs.access and (not self.app.pargs.site_name): - self.msg = self.msg + ["/var/log/nginx/*access.log"] - - if self.app.pargs.fpm: - open('/var/log/php5/slow.log', 'a').close() - open('/var/log/php5/fpm.log', 'a').close() - self.msg = self.msg + ['/var/log/php5/slow.log', - '/var/log/php5/fpm.log'] - if self.app.pargs.mysql: - # MySQL debug will not work for remote MySQL - if EEVariables.ee_mysql_host is "localhost": - if os.path.isfile('/var/log/mysql/mysql-slow.log'): - self.msg = self.msg + ['/var/log/mysql/mysql-slow.log'] - else: - Log.info(self, "MySQL slow-log not found, skipped") - else: - Log.warn(self, "Remote MySQL found, EasyEngine is not able to" - "show MySQL log file") - - if self.app.pargs.site_name: - webroot = "{0}{1}".format(EEVariables.ee_webroot, - self.app.pargs.site_name) - - if not os.path.isdir(webroot): - Log.error(self, "Site not present, quitting") - if self.app.pargs.access: - self.msg = self.msg + ["{0}/{1}/logs/access.log" - .format(EEVariables.ee_webroot, - self.app.pargs.site_name)] - if self.app.pargs.nginx: - self.msg = self.msg + ["{0}/{1}/logs/error.log" - .format(EEVariables.ee_webroot, - self.app.pargs.site_name)] - if self.app.pargs.wp: - if os.path.isdir('{0}/htdocs/wp-content'.format(webroot)): - if not os.path.isfile('{0}/logs/debug.log' - .format(webroot)): - if not os.path.isfile('{0}/htdocs/wp-content/debug.log' - .format(webroot)): - open("{0}/htdocs/wp-content/debug.log" - .format(webroot), - encoding='utf-8', mode='a').close() - EEShellExec.cmd_exec(self, "chown {1}: {0}/htdocs/" - "wp-content/debug.log" - "".format(webroot, - EEVariables - .ee_php_user) - ) - # create symbolic link for debug log - EEFileUtils.create_symlink(self, ["{0}/htdocs/wp-content/" - "debug.log" - .format(webroot), - '{0}/logs/debug.log' - .format(webroot)]) - - self.msg = self.msg + ["{0}/{1}/logs/debug.log" - .format(EEVariables.ee_webroot, - self.app.pargs.site_name)] - else: - Log.info(self, "Site is not WordPress site, skipping " - "WordPress logs") - - watch_list = [] - for w_list in self.msg: - watch_list = watch_list + glob.glob(w_list) - - logwatch(self, watch_list) - - -class EELogResetController(CementBaseController): - class Meta: - label = 'reset' - description = 'Reset Nginx, PHP, MySQL log file' - stacked_on = 'log' - stacked_type = 'nested' - arguments = [ - (['--all'], - dict(help='Reset All logs file', action='store_true')), - (['--nginx'], - dict(help='Reset Nginx Error logs file', action='store_true')), - (['--php'], - dict(help='Reset PHP Error logs file', action='store_true')), - (['--fpm'], - dict(help='Reset PHP5-fpm slow logs file', - action='store_true')), - (['--mysql'], - dict(help='Reset MySQL logs file', action='store_true')), - (['--wp'], - dict(help='Reset Site specific WordPress logs file', - action='store_true')), - (['--access'], - dict(help='Reset Nginx access log file', - action='store_true')), - (['--slow-log-db'], - dict(help='Drop all rows from slowlog table in database', - action='store_true')), - (['site_name'], - dict(help='Website Name', nargs='?', default=None)) - ] - usage = "ee log reset [<site_name>] [options]" - - @expose(hide=True) - def default(self): - """Default function of log reset""" - self.msg = [] - - if self.app.pargs.php: - self.app.pargs.nginx = True - - if ((not self.app.pargs.nginx) and (not self.app.pargs.fpm) - and (not self.app.pargs.mysql) and (not self.app.pargs.access) - and (not self.app.pargs.wp) and (not self.app.pargs.site_name) - and (not self.app.pargs.slow_log_db)): - self.app.pargs.nginx = True - self.app.pargs.fpm = True - self.app.pargs.mysql = True - self.app.pargs.access = True - self.app.pargs.slow_log_db = True - - if ((not self.app.pargs.nginx) and (not self.app.pargs.fpm) - and (not self.app.pargs.mysql) and (not self.app.pargs.access) - and (not self.app.pargs.wp) and (self.app.pargs.site_name) - and (not self.app.pargs.slow-log-db)): - self.app.pargs.nginx = True - self.app.pargs.wp = True - self.app.pargs.access = True - self.app.pargs.mysql = True - - if self.app.pargs.slow_log_db: - if os.path.isdir("/var/www/22222/htdocs/db/anemometer"): - Log.info(self, "Resetting MySQL slow_query_log database table") - EEMysql.execute(self, "TRUNCATE TABLE " - "slow_query_log.global_query_review_history") - EEMysql.execute(self, "TRUNCATE TABLE " - "slow_query_log.global_query_review") - - if self.app.pargs.nginx and (not self.app.pargs.site_name): - self.msg = self.msg + ["/var/log/nginx/*error.log"] - - if self.app.pargs.access and (not self.app.pargs.site_name): - self.msg = self.msg + ["/var/log/nginx/*access.log"] - - if self.app.pargs.fpm: - open('/var/log/php5/slow.log', 'a').close() - open('/var/log/php5/fpm.log', 'a').close() - self.msg = self.msg + ['/var/log/php5/slow.log', - '/var/log/php5/fpm.log'] - if self.app.pargs.mysql: - # MySQL debug will not work for remote MySQL - if EEVariables.ee_mysql_host is "localhost": - if os.path.isfile('/var/log/mysql/mysql-slow.log'): - self.msg = self.msg + ['/var/log/mysql/mysql-slow.log'] - else: - Log.info(self, "MySQL slow-log not found, skipped") - else: - Log.warn(self, "Remote MySQL found, EasyEngine is not able to" - "show MySQL log file") - - if self.app.pargs.site_name: - webroot = "{0}{1}".format(EEVariables.ee_webroot, - self.app.pargs.site_name) - - if not os.path.isdir(webroot): - Log.error(self, "Site not present, quitting") - if self.app.pargs.access: - self.msg = self.msg + ["{0}/{1}/logs/access.log" - .format(EEVariables.ee_webroot, - self.app.pargs.site_name)] - if self.app.pargs.nginx: - self.msg = self.msg + ["{0}/{1}/logs/error.log" - .format(EEVariables.ee_webroot, - self.app.pargs.site_name)] - if self.app.pargs.wp: - if os.path.isdir('{0}/htdocs/wp-content'.format(webroot)): - if not os.path.isfile('{0}/logs/debug.log' - .format(webroot)): - if not os.path.isfile('{0}/htdocs/wp-content/debug.log' - .format(webroot)): - open("{0}/htdocs/wp-content/debug.log" - .format(webroot), - encoding='utf-8', mode='a').close() - EEShellExec.cmd_exec(self, "chown {1}: {0}/htdocs/" - "wp-content/debug.log" - "".format(webroot, - EEVariables - .ee_php_user) - ) - # create symbolic link for debug log - EEFileUtils.create_symlink(self, ["{0}/htdocs/wp-content/" - "debug.log" - .format(webroot), - '{0}/logs/debug.log' - .format(webroot)]) - - self.msg = self.msg + ["{0}/{1}/logs/debug.log" - .format(EEVariables.ee_webroot, - self.app.pargs.site_name)] - else: - Log.info(self, "Site is not WordPress site, skipping " - "WordPress logs") - - reset_list = [] - for r_list in self.msg: - reset_list = reset_list + glob.glob(r_list) - - # Clearing content of file - for r_list in reset_list: - Log.info(self, "Resetting file {file}".format(file=r_list)) - open(r_list, 'w').close() - - -class EELogGzipController(CementBaseController): - class Meta: - label = 'gzip' - description = 'GZip Nginx, PHP, MySQL log file' - stacked_on = 'log' - stacked_type = 'nested' - arguments = [ - (['--all'], - dict(help='GZip All logs file', action='store_true')), - (['--nginx'], - dict(help='GZip Nginx Error logs file', action='store_true')), - (['--php'], - dict(help='GZip PHP Error logs file', action='store_true')), - (['--fpm'], - dict(help='GZip PHP5-fpm slow logs file', - action='store_true')), - (['--mysql'], - dict(help='GZip MySQL logs file', action='store_true')), - (['--wp'], - dict(help='GZip Site specific WordPress logs file', - action='store_true')), - (['--access'], - dict(help='GZip Nginx access log file', - action='store_true')), - (['site_name'], - dict(help='Website Name', nargs='?', default=None)) - ] - usage = "ee log gzip [<site_name>] [options]" - - @expose(hide=True) - def default(self): - """Default function of log GZip""" - self.msg = [] - - if self.app.pargs.php: - self.app.pargs.nginx = True - - if ((not self.app.pargs.nginx) and (not self.app.pargs.fpm) - and (not self.app.pargs.mysql) and (not self.app.pargs.access) - and (not self.app.pargs.wp) and (not self.app.pargs.site_name)): - self.app.pargs.nginx = True - self.app.pargs.fpm = True - self.app.pargs.mysql = True - self.app.pargs.access = True - - if ((not self.app.pargs.nginx) and (not self.app.pargs.fpm) - and (not self.app.pargs.mysql) and (not self.app.pargs.access) - and (not self.app.pargs.wp) and (self.app.pargs.site_name)): - self.app.pargs.nginx = True - self.app.pargs.wp = True - self.app.pargs.access = True - self.app.pargs.mysql = True - - if self.app.pargs.nginx and (not self.app.pargs.site_name): - self.msg = self.msg + ["/var/log/nginx/*error.log"] - - if self.app.pargs.access and (not self.app.pargs.site_name): - self.msg = self.msg + ["/var/log/nginx/*access.log"] - - if self.app.pargs.fpm: - open('/var/log/php5/slow.log', 'a').close() - open('/var/log/php5/fpm.log', 'a').close() - self.msg = self.msg + ['/var/log/php5/slow.log', - '/var/log/php5/fpm.log'] - if self.app.pargs.mysql: - # MySQL debug will not work for remote MySQL - if EEVariables.ee_mysql_host is "localhost": - if os.path.isfile('/var/log/mysql/mysql-slow.log'): - self.msg = self.msg + ['/var/log/mysql/mysql-slow.log'] - else: - Log.info(self, "MySQL slow-log not found, skipped") - - else: - Log.warn(self, "Remote MySQL found, EasyEngine is not able to" - "show MySQL log file") - - if self.app.pargs.site_name: - webroot = "{0}{1}".format(EEVariables.ee_webroot, - self.app.pargs.site_name) - - if not os.path.isdir(webroot): - Log.error(self, "Site not present, quitting") - if self.app.pargs.access: - self.msg = self.msg + ["{0}/{1}/logs/access.log" - .format(EEVariables.ee_webroot, - self.app.pargs.site_name)] - if self.app.pargs.nginx: - self.msg = self.msg + ["{0}/{1}/logs/error.log" - .format(EEVariables.ee_webroot, - self.app.pargs.site_name)] - if self.app.pargs.wp: - if os.path.isdir('{0}/htdocs/wp-content'.format(webroot)): - if not os.path.isfile('{0}/logs/debug.log' - .format(webroot)): - if not os.path.isfile('{0}/htdocs/wp-content/debug.log' - .format(webroot)): - open("{0}/htdocs/wp-content/debug.log" - .format(webroot), - encoding='utf-8', mode='a').close() - EEShellExec.cmd_exec(self, "chown {1}: {0}/htdocs/" - "wp-content/debug.log" - "".format(webroot, - EEVariables - .ee_php_user) - ) - # create symbolic link for debug log - EEFileUtils.create_symlink(self, ["{0}/htdocs/wp-content/" - "debug.log" - .format(webroot), - '{0}/logs/debug.log' - .format(webroot)]) - - self.msg = self.msg + ["{0}/{1}/logs/debug.log" - .format(EEVariables.ee_webroot, - self.app.pargs.site_name)] - else: - Log.info(self, "Site is not WordPress site, skipping " - "WordPress logs") - - gzip_list = [] - for g_list in self.msg: - gzip_list = gzip_list + glob.glob(g_list) - - # Gzip content of file - for g_list in gzip_list: - Log.info(self, "Gzipping file {file}".format(file=g_list)) - in_file = g_list - in_data = open(in_file, "rb").read() - out_gz = g_list + ".gz" - gzf = gzip.open(out_gz, "wb") - gzf.write(in_data) - gzf.close() - - -class EELogMailController(CementBaseController): - class Meta: - label = 'mail' - description = 'Mail Nginx, PHP, MySQL log file' - stacked_on = 'log' - stacked_type = 'nested' - arguments = [ - (['--all'], - dict(help='Mail All logs file', action='store_true')), - (['--nginx'], - dict(help='Mail Nginx Error logs file', action='store_true')), - (['--php'], - dict(help='Mail PHP Error logs file', action='store_true')), - (['--fpm'], - dict(help='Mail PHP5-fpm slow logs file', - action='store_true')), - (['--mysql'], - dict(help='Mail MySQL logs file', action='store_true')), - (['--wp'], - dict(help='Mail Site specific WordPress logs file', - action='store_true')), - (['--access'], - dict(help='Mail Nginx access log file', - action='store_true')), - (['site_name'], - dict(help='Website Name', nargs='?', default=None)), - (['--to'], - dict(help='EMail addresses to send log files', action='append', - dest='to', nargs=1, required=True)), - ] - usage = "ee log mail [<site_name>] [options]" - - @expose(hide=True) - def default(self): - """Default function of log Mail""" - self.msg = [] - - if self.app.pargs.php: - self.app.pargs.nginx = True - - if ((not self.app.pargs.nginx) and (not self.app.pargs.fpm) - and (not self.app.pargs.mysql) and (not self.app.pargs.access) - and (not self.app.pargs.wp) and (not self.app.pargs.site_name)): - self.app.pargs.nginx = True - self.app.pargs.fpm = True - self.app.pargs.mysql = True - self.app.pargs.access = True - - if ((not self.app.pargs.nginx) and (not self.app.pargs.fpm) - and (not self.app.pargs.mysql) and (not self.app.pargs.access) - and (not self.app.pargs.wp) and (self.app.pargs.site_name)): - self.app.pargs.nginx = True - self.app.pargs.wp = True - self.app.pargs.access = True - self.app.pargs.mysql = True - - if self.app.pargs.nginx and (not self.app.pargs.site_name): - self.msg = self.msg + ["/var/log/nginx/*error.log"] - - if self.app.pargs.access and (not self.app.pargs.site_name): - self.msg = self.msg + ["/var/log/nginx/*access.log"] - - if self.app.pargs.fpm: - open('/var/log/php5/slow.log', 'a').close() - open('/var/log/php5/fpm.log', 'a').close() - self.msg = self.msg + ['/var/log/php5/slow.log', - '/var/log/php5/fpm.log'] - if self.app.pargs.mysql: - # MySQL debug will not work for remote MySQL - if EEVariables.ee_mysql_host is "localhost": - if os.path.isfile('/var/log/mysql/mysql-slow.log'): - self.msg = self.msg + ['/var/log/mysql/mysql-slow.log'] - else: - Log.info(self, "MySQL slow-log not found, skipped") - else: - Log.warn(self, "Remote MySQL found, EasyEngine is not able to" - "show MySQL log file") - - if self.app.pargs.site_name: - webroot = "{0}{1}".format(EEVariables.ee_webroot, - self.app.pargs.site_name) - - if not os.path.isdir(webroot): - Log.error(self, "Site not present, quitting") - if self.app.pargs.access: - self.msg = self.msg + ["{0}/{1}/logs/access.log" - .format(EEVariables.ee_webroot, - self.app.pargs.site_name)] - if self.app.pargs.nginx: - self.msg = self.msg + ["{0}/{1}/logs/error.log" - .format(EEVariables.ee_webroot, - self.app.pargs.site_name)] - if self.app.pargs.wp: - if os.path.isdir('{0}/htdocs/wp-content'.format(webroot)): - if not os.path.isfile('{0}/logs/debug.log' - .format(webroot)): - if not os.path.isfile('{0}/htdocs/wp-content/debug.log' - .format(webroot)): - open("{0}/htdocs/wp-content/debug.log" - .format(webroot), - encoding='utf-8', mode='a').close() - EEShellExec.cmd_exec(self, "chown {1}: {0}/htdocs/" - "wp-content/debug.log" - "".format(webroot, - EEVariables - .ee_php_user) - ) - # create symbolic link for debug log - EEFileUtils.create_symlink(self, ["{0}/htdocs/wp-content/" - "debug.log" - .format(webroot), - '{0}/logs/debug.log' - .format(webroot)]) - - self.msg = self.msg + ["{0}/{1}/logs/debug.log" - .format(EEVariables.ee_webroot, - self.app.pargs.site_name)] - else: - Log.info(self, "Site is not WordPress site, skipping " - "WordPress logs") - - mail_list = [] - for m_list in self.msg: - mail_list = mail_list + glob.glob(m_list) - - for tomail in self.app.pargs.to: - Log.info(self, "Sending mail to {0}".format(tomail[0])) - EESendMail("easyengine", tomail[0], "{0} Log Files" - .format(EEVariables.ee_fqdn), - "Hey Hi,\n Please find attached server log files" - "\n\n\nYour's faithfully,\nEasyEngine", - files=mail_list, port=25, isTls=False) - - -def load(app): - # register the plugin class.. this only happens if the plugin is enabled - handler.register(EELogController) - handler.register(EELogShowController) - handler.register(EELogResetController) - handler.register(EELogGzipController) - handler.register(EELogMailController) - # register a hook (function) to run after arguments are parsed. - hook.register('post_argument_parsing', ee_log_hook) diff --git a/ee/cli/plugins/models.py b/ee/cli/plugins/models.py deleted file mode 100644 index 0aa3ff9b6..000000000 --- a/ee/cli/plugins/models.py +++ /dev/null @@ -1,59 +0,0 @@ -from sqlalchemy import Column, DateTime, String, Integer, Boolean, func -from ee.core.database import Base - - -class SiteDB(Base): - """ - Databse model for site table - """ - __tablename__ = 'sites' - __table_args__ = {'extend_existing': True} - id = Column(Integer, primary_key=True) - sitename = Column(String, unique=True) - - site_type = Column(String) - cache_type = Column(String) - site_path = Column(String) - - # Use default=func.now() to set the default created time - # of a site to be the current time when a - # Site record was created - - created_on = Column(DateTime, default=func.now()) - is_enabled = Column(Boolean, unique=False, default=True, nullable=False) - is_ssl = Column(Boolean, unique=False, default=False) - storage_fs = Column(String) - storage_db = Column(String) - db_name = Column(String) - db_user = Column(String) - db_password = Column(String) - db_host = Column(String) - is_hhvm = Column(Boolean, unique=False, default=False) - is_pagespeed = Column(Boolean, unique=False, default=False) - php_version = Column(String) - - def __init__(self, sitename=None, site_type=None, cache_type=None, - site_path=None, site_enabled=None, - is_ssl=None, storage_fs=None, storage_db=None, db_name=None, - db_user=None, db_password=None, db_host='localhost', - hhvm=None, pagespeed=None, php_version=None): - self.sitename = sitename - self.site_type = site_type - self.cache_type = cache_type - self.site_path = site_path - self.is_enabled = site_enabled - self.is_ssl = is_ssl - self.storage_fs = storage_fs - self.storage_db = storage_db - self.db_name = db_name - self.db_user = db_user - self.db_password = db_password - self.db_host = db_host - self.is_hhvm = hhvm - self.is_pagespeed = pagespeed - self.php_version = php_version - # def __repr__(self): - # return '<Site %r>' % (self.site_type) - # - # def getType(self): - # return '%r>' % (self.site_type) diff --git a/ee/cli/plugins/secure.py b/ee/cli/plugins/secure.py deleted file mode 100644 index c87e65900..000000000 --- a/ee/cli/plugins/secure.py +++ /dev/null @@ -1,145 +0,0 @@ -from cement.core.controller import CementBaseController, expose -from cement.core import handler, hook -from ee.core.aptget import EEAptGet -from ee.core.shellexec import EEShellExec -from ee.core.variables import EEVariables -from ee.core.logging import Log -from ee.core.git import EEGit -from ee.core.services import EEService -import string -import random -import sys -import hashlib -import getpass - - -def ee_secure_hook(app): - # do something with the ``app`` object here. - pass - - -class EESecureController(CementBaseController): - class Meta: - label = 'secure' - stacked_on = 'base' - stacked_type = 'nested' - description = ('Secure command secure auth, ip and port') - arguments = [ - (['--auth'], - dict(help='secure auth', action='store_true')), - (['--port'], - dict(help='secure port', action='store_true')), - (['--ip'], - dict(help='secure ip', action='store_true')), - (['user_input'], - dict(help='user input', nargs='?', default=None)), - (['user_pass'], - dict(help='user pass', nargs='?', default=None))] - usage = "ee secure [options]" - - @expose(hide=True) - def default(self): - if self.app.pargs.auth: - self.secure_auth() - if self.app.pargs.port: - self.secure_port() - if self.app.pargs.ip: - self.secure_ip() - - @expose(hide=True) - def secure_auth(self): - """This function Secures authentication""" - passwd = ''.join([random.choice - (string.ascii_letters + string.digits) - for n in range(6)]) - if not self.app.pargs.user_input: - username = input("Provide HTTP authentication user " - "name [{0}] :".format(EEVariables.ee_user)) - self.app.pargs.user_input = username - if username == "": - self.app.pargs.user_input = EEVariables.ee_user - if not self.app.pargs.user_pass: - password = getpass.getpass("Provide HTTP authentication " - "password [{0}] :".format(passwd)) - self.app.pargs.user_pass = password - if password == "": - self.app.pargs.user_pass = passwd - Log.debug(self, "printf username:" - "$(openssl passwd -crypt " - "password 2> /dev/null)\n\"" - "> /etc/nginx/htpasswd-ee 2>/dev/null") - EEShellExec.cmd_exec(self, "printf \"{username}:" - "$(openssl passwd -crypt " - "{password} 2> /dev/null)\n\"" - "> /etc/nginx/htpasswd-ee 2>/dev/null" - .format(username=self.app.pargs.user_input, - password=self.app.pargs.user_pass), - log=False) - EEGit.add(self, ["/etc/nginx"], - msg="Adding changed secure auth into Git") - - @expose(hide=True) - def secure_port(self): - """This function Secures port""" - if self.app.pargs.user_input: - while not self.app.pargs.user_input.isdigit(): - Log.info(self, "Please Enter valid port number ") - self.app.pargs.user_input = input("EasyEngine " - "admin port [22222]:") - if not self.app.pargs.user_input: - port = input("EasyEngine admin port [22222]:") - if port == "": - self.app.pargs.user_input = 22222 - while not port.isdigit() and port != "": - Log.info(self, "Please Enter valid port number :") - port = input("EasyEngine admin port [22222]:") - self.app.pargs.user_input = port - if EEVariables.ee_platform_distro == 'ubuntu': - EEShellExec.cmd_exec(self, "sed -i \"s/listen.*/listen " - "{port} default_server ssl http2;/\" " - "/etc/nginx/sites-available/22222" - .format(port=self.app.pargs.user_input)) - if EEVariables.ee_platform_distro == 'debian': - EEShellExec.cmd_exec(self, "sed -i \"s/listen.*/listen " - "{port} default_server ssl http2;/\" " - "/etc/nginx/sites-available/22222" - .format(port=self.app.pargs.user_input)) - EEGit.add(self, ["/etc/nginx"], - msg="Adding changed secure port into Git") - if not EEService.reload_service(self, 'nginx'): - Log.error(self, "service nginx reload failed. " - "check issues with `nginx -t` command") - Log.info(self, "Successfully port changed {port}" - .format(port=self.app.pargs.user_input)) - - @expose(hide=True) - def secure_ip(self): - """This function Secures IP""" - # TODO:remaining with ee.conf updation in file - newlist = [] - if not self.app.pargs.user_input: - ip = input("Enter the comma separated IP addresses " - "to white list [127.0.0.1]:") - self.app.pargs.user_input = ip - try: - user_ip = self.app.pargs.user_input.split(',') - except Exception as e: - user_ip = ['127.0.0.1'] - for ip_addr in user_ip: - if not ("exist_ip_address "+ip_addr in open('/etc/nginx/common/' - 'acl.conf').read()): - EEShellExec.cmd_exec(self, "sed -i " - "\"/deny/i allow {whitelist_adre}\;\"" - " /etc/nginx/common/acl.conf" - .format(whitelist_adre=ip_addr)) - EEGit.add(self, ["/etc/nginx"], - msg="Adding changed secure ip into Git") - - Log.info(self, "Successfully added IP address in acl.conf file") - - -def load(app): - # register the plugin class.. this only happens if the plugin is enabled - handler.register(EESecureController) - # register a hook (function) to run after arguments are parsed. - hook.register('post_argument_parsing', ee_secure_hook) diff --git a/ee/cli/plugins/site.py b/ee/cli/plugins/site.py deleted file mode 100644 index 7ac6654d9..000000000 --- a/ee/cli/plugins/site.py +++ /dev/null @@ -1,1890 +0,0 @@ -# """EasyEngine site controller.""" -from cement.core.controller import CementBaseController, expose -from cement.core import handler, hook -from ee.core.cron import EECron -from ee.core.sslutils import SSL -from ee.core.variables import EEVariables -from ee.core.domainvalidate import ValidateDomain -from ee.core.fileutils import EEFileUtils -from ee.cli.plugins.site_functions import * -from ee.core.services import EEService -from ee.cli.plugins.sitedb import * -from ee.core.git import EEGit -from subprocess import Popen -from ee.core.nginxhashbucket import hashbucket -import sys -import os -import glob -import subprocess - - -def ee_site_hook(app): - # do something with the ``app`` object here. - from ee.core.database import init_db - import ee.cli.plugins.models - init_db(app) - - -class EESiteController(CementBaseController): - class Meta: - label = 'site' - stacked_on = 'base' - stacked_type = 'nested' - description = ('Performs website specific operations') - arguments = [ - (['site_name'], - dict(help='Website name', nargs='?')), - ] - usage = "ee site (command) <site_name> [options]" - - @expose(hide=True) - def default(self): - self.app.args.print_help() - - @expose(help="Enable site example.com") - def enable(self): - if not self.app.pargs.site_name: - try: - while not self.app.pargs.site_name: - self.app.pargs.site_name = (input('Enter site name : ') - .strip()) - except IOError as e: - Log.error(self, 'could not input site name') - - self.app.pargs.site_name = self.app.pargs.site_name.strip() - # validate domain name - (ee_domain, ee_www_domain) = ValidateDomain(self.app.pargs.site_name) - - # check if site exists - if not check_domain_exists(self, ee_domain): - Log.error(self, "site {0} does not exist".format(ee_domain)) - if os.path.isfile('/etc/nginx/sites-available/{0}' - .format(ee_domain)): - Log.info(self, "Enable domain {0:10} \t".format(ee_domain), end='') - EEFileUtils.create_symlink(self, - ['/etc/nginx/sites-available/{0}' - .format(ee_domain), - '/etc/nginx/sites-enabled/{0}' - .format(ee_domain)]) - EEGit.add(self, ["/etc/nginx"], - msg="Enabled {0} " - .format(ee_domain)) - updateSiteInfo(self, ee_domain, enabled=True) - Log.info(self, "[" + Log.ENDC + "OK" + Log.OKBLUE + "]") - if not EEService.reload_service(self, 'nginx'): - Log.error(self, "service nginx reload failed. " - "check issues with `nginx -t` command") - else: - Log.error(self, "nginx configuration file does not exist" - .format(ee_domain)) - - @expose(help="Disable site example.com") - def disable(self): - if not self.app.pargs.site_name: - try: - while not self.app.pargs.site_name: - self.app.pargs.site_name = (input('Enter site name : ') - .strip()) - - except IOError as e: - Log.error(self, 'could not input site name') - self.app.pargs.site_name = self.app.pargs.site_name.strip() - (ee_domain, ee_www_domain) = ValidateDomain(self.app.pargs.site_name) - # check if site exists - if not check_domain_exists(self, ee_domain): - Log.error(self, "site {0} does not exist".format(ee_domain)) - - if os.path.isfile('/etc/nginx/sites-available/{0}' - .format(ee_domain)): - Log.info(self, "Disable domain {0:10} \t" - .format(ee_domain), end='') - if not os.path.isfile('/etc/nginx/sites-enabled/{0}' - .format(ee_domain)): - Log.debug(self, "Site {0} already disabled".format(ee_domain)) - Log.info(self, "[" + Log.FAIL + "Failed" + Log.OKBLUE+"]") - else: - EEFileUtils.remove_symlink(self, - '/etc/nginx/sites-enabled/{0}' - .format(ee_domain)) - EEGit.add(self, ["/etc/nginx"], - msg="Disabled {0} " - .format(ee_domain)) - updateSiteInfo(self, ee_domain, enabled=False) - Log.info(self, "[" + Log.ENDC + "OK" + Log.OKBLUE + "]") - if not EEService.reload_service(self, 'nginx'): - Log.error(self, "service nginx reload failed. " - "check issues with `nginx -t` command") - else: - Log.error(self, "nginx configuration file does not exist" - .format(ee_domain)) - - @expose(help="Get example.com information") - def info(self): - if not self.app.pargs.site_name: - try: - while not self.app.pargs.site_name: - self.app.pargs.site_name = (input('Enter site name : ') - .strip()) - except IOError as e: - Log.error(self, 'could not input site name') - self.app.pargs.site_name = self.app.pargs.site_name.strip() - (ee_domain, ee_www_domain) = ValidateDomain(self.app.pargs.site_name) - ee_db_name = '' - ee_db_user = '' - ee_db_pass = '' - hhvm = '' - - if not check_domain_exists(self, ee_domain): - Log.error(self, "site {0} does not exist".format(ee_domain)) - if os.path.isfile('/etc/nginx/sites-available/{0}' - .format(ee_domain)): - siteinfo = getSiteInfo(self, ee_domain) - - sitetype = siteinfo.site_type - cachetype = siteinfo.cache_type - ee_site_webroot = siteinfo.site_path - access_log = (ee_site_webroot + '/logs/access.log') - error_log = (ee_site_webroot + '/logs/error.log') - ee_db_name = siteinfo.db_name - ee_db_user = siteinfo.db_user - ee_db_pass = siteinfo.db_password - ee_db_host = siteinfo.db_host - if sitetype != "html": - hhvm = ("enabled" if siteinfo.is_hhvm else "disabled") - if sitetype == "proxy": - access_log = "/var/log/nginx/{0}.access.log".format(ee_domain) - error_log = "/var/log/nginx/{0}.error.log".format(ee_domain) - ee_site_webroot = '' - - php_version = siteinfo.php_version -# pagespeed = ("enabled" if siteinfo.is_pagespeed else "disabled") - ssl = ("enabled" if siteinfo.is_ssl else "disabled") - if (ssl == "enabled"): - sslprovider = "Lets Encrypt" - sslexpiry = str(SSL.getExpirationDate(self,ee_domain)) - else: - sslprovider = '' - sslexpiry = '' - data = dict(domain=ee_domain, webroot=ee_site_webroot, - accesslog=access_log, errorlog=error_log, - dbname=ee_db_name, dbuser=ee_db_user,php_version=php_version, - dbpass=ee_db_pass, hhvm=hhvm, - ssl=ssl, sslprovider=sslprovider, sslexpiry= sslexpiry, - type=sitetype + " " + cachetype + " ({0})" - .format("enabled" if siteinfo.is_enabled else - "disabled")) - self.app.render((data), 'siteinfo.mustache') - else: - Log.error(self, "nginx configuration file does not exist" - .format(ee_domain)) - - @expose(help="Monitor example.com logs") - def log(self): - self.app.pargs.site_name = self.app.pargs.site_name.strip() - (ee_domain, ee_www_domain) = ValidateDomain(self.app.pargs.site_name) - ee_site_webroot = getSiteInfo(self, ee_domain).site_path - - if not check_domain_exists(self, ee_domain): - Log.error(self, "site {0} does not exist".format(ee_domain)) - logfiles = glob.glob(ee_site_webroot + '/logs/*.log') - if logfiles: - logwatch(self, logfiles) - - @expose(help="Display Nginx configuration of example.com") - def show(self): - if not self.app.pargs.site_name: - try: - while not self.app.pargs.site_name: - self.app.pargs.site_name = (input('Enter site name : ') - .strip()) - except IOError as e: - Log.error(self, 'could not input site name') - # TODO Write code for ee site edit command here - self.app.pargs.site_name = self.app.pargs.site_name.strip() - (ee_domain, ee_www_domain) = ValidateDomain(self.app.pargs.site_name) - - if not check_domain_exists(self, ee_domain): - Log.error(self, "site {0} does not exist".format(ee_domain)) - - if os.path.isfile('/etc/nginx/sites-available/{0}' - .format(ee_domain)): - Log.info(self, "Display NGINX configuration for {0}" - .format(ee_domain)) - f = open('/etc/nginx/sites-available/{0}'.format(ee_domain), - encoding='utf-8', mode='r') - text = f.read() - Log.info(self, Log.ENDC + text) - f.close() - else: - Log.error(self, "nginx configuration file does not exists" - .format(ee_domain)) - - @expose(help="Change directory to site webroot") - def cd(self): - if not self.app.pargs.site_name: - try: - while not self.app.pargs.site_name: - self.app.pargs.site_name = (input('Enter site name : ') - .strip()) - except IOError as e: - Log.error(self, 'Unable to read input, please try again') - - self.app.pargs.site_name = self.app.pargs.site_name.strip() - (ee_domain, ee_www_domain) = ValidateDomain(self.app.pargs.site_name) - - if not check_domain_exists(self, ee_domain): - Log.error(self, "site {0} does not exist".format(ee_domain)) - - ee_site_webroot = getSiteInfo(self, ee_domain).site_path - EEFileUtils.chdir(self, ee_site_webroot) - - try: - subprocess.call(['bash']) - except OSError as e: - Log.debug(self, "{0}{1}".format(e.errno, e.strerror)) - Log.error(self, "unable to change directory") - - -class EESiteEditController(CementBaseController): - class Meta: - label = 'edit' - stacked_on = 'site' - stacked_type = 'nested' - description = ('Edit Nginx configuration of site') - arguments = [ - (['site_name'], - dict(help='domain name for the site', - nargs='?')), - (['--pagespeed'], - dict(help="edit pagespeed configuration for site", - action='store_true')), - ] - - @expose(hide=True) - def default(self): - if not self.app.pargs.site_name: - try: - while not self.app.pargs.site_name: - self.app.pargs.site_name = (input('Enter site name : ') - .strip()) - except IOError as e: - Log.error(self, 'Unable to read input, Please try again') - - self.app.pargs.site_name = self.app.pargs.site_name.strip() - (ee_domain, ee_www_domain) = ValidateDomain(self.app.pargs.site_name) - - if not check_domain_exists(self, ee_domain): - Log.error(self, "site {0} does not exist".format(ee_domain)) - - ee_site_webroot = EEVariables.ee_webroot + ee_domain - - if not self.app.pargs.pagespeed: - if os.path.isfile('/etc/nginx/sites-available/{0}' - .format(ee_domain)): - try: - EEShellExec.invoke_editor(self, '/etc/nginx/sites-availa' - 'ble/{0}'.format(ee_domain)) - except CommandExecutionError as e: - Log.error(self, "Failed invoke editor") - if (EEGit.checkfilestatus(self, "/etc/nginx", - '/etc/nginx/sites-available/{0}'.format(ee_domain))): - EEGit.add(self, ["/etc/nginx"], msg="Edit website: {0}" - .format(ee_domain)) - # Reload NGINX - if not EEService.reload_service(self, 'nginx'): - Log.error(self, "service nginx reload failed. " - "check issues with `nginx -t` command") - else: - Log.error(self, "nginx configuration file does not exists" - .format(ee_domain)) - - elif self.app.pargs.pagespeed: - Log.error(self, "Pagespeed support has been dropped since EasyEngine v3.6.0",False) - Log.error(self, "Please run command again without `--pagespeed`",False) - Log.error(self, "For more details, read - https://easyengine.io/blog/disabling-pagespeed/") - - ''' - if os.path.isfile('{0}/conf/nginx/pagespeed.conf' - .format(ee_site_webroot)): - try: - EEShellExec.invoke_editor(self, '{0}/conf/nginx/' - 'pagespeed.conf' - .format(ee_site_webroot)) - except CommandExecutionError as e: - Log.error(self, "Failed invoke editor") - if (EEGit.checkfilestatus(self, "{0}/conf/nginx" - .format(ee_site_webroot), - '{0}/conf/nginx/pagespeed.conf'.format(ee_site_webroot))): - EEGit.add(self, ["{0}/conf/nginx".format(ee_site_webroot)], - msg="Edit Pagespped config of site: {0}" - .format(ee_domain)) - # Reload NGINX - if not EEService.reload_service(self, 'nginx'): - Log.error(self, "service nginx reload failed. " - "check issues with `nginx -t` command") - else: - Log.error(self, "Pagespeed configuration file does not exists" - .format(ee_domain)) - ''' - -class EESiteCreateController(CementBaseController): - class Meta: - label = 'create' - stacked_on = 'site' - stacked_type = 'nested' - description = ('this commands set up configuration and installs ' - 'required files as options are provided') - arguments = [ - (['site_name'], - dict(help='domain name for the site to be created.', - nargs='?')), - (['--html'], - dict(help="create html site", action='store_true')), - (['--php'], - dict(help="create php site", action='store_true')), - (['--php7'], - dict(help="create php 7.0 site", action='store_true')), - (['--mysql'], - dict(help="create mysql site", action='store_true')), - (['--wp'], - dict(help="create wordpress single site", - action='store_true')), - (['--wpsubdir'], - dict(help="create wordpress multisite with subdirectory setup", - action='store_true')), - (['--wpsubdomain'], - dict(help="create wordpress multisite with subdomain setup", - action='store_true')), - (['--w3tc'], - dict(help="create wordpress single/multi site with w3tc cache", - action='store_true')), - (['--wpfc'], - dict(help="create wordpress single/multi site with wpfc cache", - action='store_true')), - (['--wpsc'], - dict(help="create wordpress single/multi site with wpsc cache", - action='store_true')), - (['--wpredis'], - dict(help="create wordpress single/multi site with redis cache", - action='store_true')), - (['--hhvm'], - dict(help="create HHVM site", action='store_true')), - (['--pagespeed'], - dict(help="create pagespeed site", action='store_true')), - (['-le','--letsencrypt'], - dict(help="configure letsencrypt ssl for the site", action='store_true')), - (['--user'], - dict(help="provide user for wordpress site")), - (['--email'], - dict(help="provide email address for wordpress site")), - (['--pass'], - dict(help="provide password for wordpress user", - dest='wppass')), - (['--proxy'], - dict(help="create proxy for site", nargs='+')), - (['--experimental'], - dict(help="Enable Experimenal packages without prompt", - action='store_true')), - ] - - @expose(hide=True) - def default(self): - #Remove Pagespeed Support Since EE 3.6.0 - if self.app.pargs.pagespeed: - Log.error(self, "Pagespeed support has been dropped since EasyEngine v3.6.0",False) - Log.error(self, "Please run command again without `--pagespeed`",False) - Log.error(self, "For more details, read - https://easyengine.io/blog/disabling-pagespeed/") - # self.app.render((data), 'default.mustache') - # Check domain name validation - data = dict() - host, port = None, None - try: - stype, cache = detSitePar(vars(self.app.pargs)) - except RuntimeError as e: - Log.debug(self, str(e)) - Log.error(self, "Please provide valid options to creating site") - - if stype is None and self.app.pargs.proxy: - stype, cache = 'proxy', '' - proxyinfo = self.app.pargs.proxy[0].strip() - if not proxyinfo: - Log.error(self, "Please provide proxy server host information") - proxyinfo = proxyinfo.split(':') - host = proxyinfo[0].strip() - port = '80' if len(proxyinfo) < 2 else proxyinfo[1].strip() - elif stype is None and not self.app.pargs.proxy: - stype, cache = 'html', 'basic' - elif stype and self.app.pargs.proxy: - Log.error(self, "proxy should not be used with other site types") - if (self.app.pargs.proxy and self.app.pargs.hhvm): - Log.error(self, "Proxy site can not run on hhvm") - - if not self.app.pargs.site_name: - try: - while not self.app.pargs.site_name: - # preprocessing before finalize site name - self.app.pargs.site_name = (input('Enter site name : ') - .strip()) - except IOError as e: - Log.debug(self, str(e)) - Log.error(self, "Unable to input site name, Please try again!") - - self.app.pargs.site_name = self.app.pargs.site_name.strip() - (ee_domain, ee_www_domain) = ValidateDomain(self.app.pargs.site_name) - - if not ee_domain.strip(): - Log.error("Invalid domain name, " - "Provide valid domain name") - - ee_site_webroot = EEVariables.ee_webroot + ee_domain - - if check_domain_exists(self, ee_domain): - Log.error(self, "site {0} already exists".format(ee_domain)) - elif os.path.isfile('/etc/nginx/sites-available/{0}' - .format(ee_domain)): - Log.error(self, "Nginx configuration /etc/nginx/sites-available/" - "{0} already exists".format(ee_domain)) - - if stype == 'proxy': - data['site_name'] = ee_domain - data['www_domain'] = ee_www_domain - data['proxy'] = True - data['host'] = host - data['port'] = port - ee_site_webroot = "" - - if self.app.pargs.php7: - data = dict(site_name=ee_domain, www_domain=ee_www_domain, - static=False, basic=False, php7=True, wp=False, w3tc=False, - wpfc=False, wpsc=False, multisite=False, - wpsubdir=False, webroot=ee_site_webroot) - data['basic'] = True - - if stype in ['html', 'php' ]: - data = dict(site_name=ee_domain, www_domain=ee_www_domain, - static=True, basic=False, php7=False, wp=False, w3tc=False, - wpfc=False, wpsc=False, multisite=False, - wpsubdir=False, webroot=ee_site_webroot) - - if stype == 'php': - data['static'] = False - data['basic'] = True - - elif stype in ['mysql', 'wp', 'wpsubdir', 'wpsubdomain']: - - data = dict(site_name=ee_domain, www_domain=ee_www_domain, - static=False, basic=True, wp=False, w3tc=False, - wpfc=False, wpsc=False, wpredis=False, multisite=False, - wpsubdir=False, webroot=ee_site_webroot, - ee_db_name='', ee_db_user='', ee_db_pass='', - ee_db_host='') - - if stype in ['wp', 'wpsubdir', 'wpsubdomain']: - data['wp'] = True - data['basic'] = False - data[cache] = True - data['wp-user'] = self.app.pargs.user - data['wp-email'] = self.app.pargs.email - data['wp-pass'] = self.app.pargs.wppass - if stype in ['wpsubdir', 'wpsubdomain']: - data['multisite'] = True - if stype == 'wpsubdir': - data['wpsubdir'] = True - else: - pass - - if stype == "html" and self.app.pargs.hhvm: - Log.error(self, "Can not create HTML site with HHVM") - - if data and self.app.pargs.php7: - if (not self.app.pargs.experimental): - Log.info(self, "PHP7.0 is experimental feature and it may not " - "work with all CSS/JS/Cache of your site.\nDo you wish" - " to install PHP 7.0 now for {0}?".format(ee_domain)) - - # Check prompt - check_prompt = input("Type \"y\" to continue [n]:") - if check_prompt != "Y" and check_prompt != "y": - Log.info(self, "Not using PHP 7.0 for site.") - data['php7'] = False - data['basic'] = True - php7 = 0 - self.app.pargs.php7 = False - else: - data['php7'] = True - php7 = 1 - else: - data['php7'] = True - php7 = 1 - elif data: - data['php7'] = False - php7 = 0 - - if (not self.app.pargs.w3tc) and\ - (not self.app.pargs.wpfc) and (not self.app.pargs.wpsc) and (not self.app.pargs.wpredis) \ - and (not self.app.pargs.hhvm): - data['basic'] = True - - #for debug purpose - #for key, value in data.items() : - # print (key, value) - - - if data and self.app.pargs.hhvm: - if (not self.app.pargs.experimental): - Log.info(self, "HHVM is experimental feature and it may not " - "work with all plugins of your site.\nYou can " - "disable it by passing --hhvm=off later.\nDo you wish" - " to enable HHVM now for {0}?".format(ee_domain)) - - # Check prompt - check_prompt = input("Type \"y\" to continue [n]:") - if check_prompt != "Y" and check_prompt != "y": - Log.info(self, "Not using HHVM for site.") - data['hhvm'] = False - hhvm = 0 - self.app.pargs.hhvm = False - else: - data['hhvm'] = True - hhvm = 1 - else: - data['hhvm'] = True - hhvm = 1 - - elif data: - data['hhvm'] = False - hhvm = 0 - -# if data and self.app.pargs.pagespeed: -# if (not self.app.pargs.experimental): -# Log.info(self, "PageSpeed is experimental feature and it may not " -# "work with all CSS/JS/Cache of your site.\nYou can " -# "disable it by passing --pagespeed=off later.\nDo you wish" -# " to enable PageSpeed now for {0}?".format(ee_domain)) - - # Check prompt -# check_prompt = input("Type \"y\" to continue [n]:") -# if check_prompt != "Y" and check_prompt != "y": -# Log.info(self, "Not using PageSpeed for site.") -# data['pagespeed'] = False -# pagespeed = 0 -# self.app.pargs.pagespeed = False -# else: -# data['pagespeed'] = True -# pagespeed = 1 -# else: -# data['pagespeed'] = True -# pagespeed = 1 -# elif data: -# data['pagespeed'] = False -# pagespeed = 0 - - if (cache == 'wpredis' and (not self.app.pargs.experimental)): - Log.info(self, "Redis is experimental feature and it may not " - "work with all CSS/JS/Cache of your site.\nYou can " - "disable it by changing cache later.\nDo you wish" - " to enable Redis now for {0}?".format(ee_domain)) - - # Check prompt - check_prompt = input("Type \"y\" to continue [n]:") - if check_prompt != "Y" and check_prompt != "y": - Log.error(self, "Not using Redis for site") - cache = 'basic' - data['wpredis'] = False - data['basic'] = True - self.app.pargs.wpredis = False - - # Check rerequired packages are installed or not - ee_auth = site_package_check(self, stype) - - try: - pre_run_checks(self) - except SiteError as e: - Log.debug(self, str(e)) - Log.error(self, "NGINX configuration check failed.") - - try: - try: - # setup NGINX configuration, and webroot - setupdomain(self, data) - - # Fix Nginx Hashbucket size error - hashbucket(self) - except SiteError as e: - # call cleanup actions on failure - Log.info(self, Log.FAIL + "Oops Something went wrong !!") - Log.info(self, Log.FAIL + "Calling cleanup actions ...") - doCleanupAction(self, domain=ee_domain, - webroot=data['webroot']) - Log.debug(self, str(e)) - Log.error(self, "Check logs for reason " - "`tail /var/log/ee/ee.log` & Try Again!!!") - - if 'proxy' in data.keys() and data['proxy']: - addNewSite(self, ee_domain, stype, cache, ee_site_webroot) - # Service Nginx Reload - if not EEService.reload_service(self, 'nginx'): - Log.info(self, Log.FAIL + "Oops Something went wrong !!") - Log.info(self, Log.FAIL + "Calling cleanup actions ...") - doCleanupAction(self, domain=ee_domain) - deleteSiteInfo(self, ee_domain) - Log.error(self, "service nginx reload failed. " - "check issues with `nginx -t` command") - Log.error(self, "Check logs for reason " - "`tail /var/log/ee/ee.log` & Try Again!!!") - if ee_auth and len(ee_auth): - for msg in ee_auth: - Log.info(self, Log.ENDC + msg, log=False) - Log.info(self, "Successfully created site" - " http://{0}".format(ee_domain)) - return - # Update pagespeed config -# if self.app.pargs.pagespeed: -# operateOnPagespeed(self, data) - - if data['php7']: - php_version = "7.0" - else: - php_version = "5.6" - - - addNewSite(self, ee_domain, stype, cache, ee_site_webroot, - hhvm=hhvm, php_version=php_version) - - # Setup database for MySQL site - if 'ee_db_name' in data.keys() and not data['wp']: - try: - data = setupdatabase(self, data) - # Add database information for site into database - updateSiteInfo(self, ee_domain, db_name=data['ee_db_name'], - db_user=data['ee_db_user'], - db_password=data['ee_db_pass'], - db_host=data['ee_db_host']) - except SiteError as e: - # call cleanup actions on failure - Log.debug(self, str(e)) - Log.info(self, Log.FAIL + "Oops Something went wrong !!") - Log.info(self, Log.FAIL + "Calling cleanup actions ...") - doCleanupAction(self, domain=ee_domain, - webroot=data['webroot'], - dbname=data['ee_db_name'], - dbuser=data['ee_db_user'], - dbhost=data['ee_db_host']) - deleteSiteInfo(self, ee_domain) - Log.error(self, "Check logs for reason " - "`tail /var/log/ee/ee.log` & Try Again!!!") - - try: - eedbconfig = open("{0}/ee-config.php" - .format(ee_site_webroot), - encoding='utf-8', mode='w') - eedbconfig.write("<?php \ndefine('DB_NAME', '{0}');" - "\ndefine('DB_USER', '{1}'); " - "\ndefine('DB_PASSWORD', '{2}');" - "\ndefine('DB_HOST', '{3}');\n?>" - .format(data['ee_db_name'], - data['ee_db_user'], - data['ee_db_pass'], - data['ee_db_host'])) - eedbconfig.close() - stype = 'mysql' - except IOError as e: - Log.debug(self, str(e)) - Log.debug(self, "Error occured while generating " - "ee-config.php") - Log.info(self, Log.FAIL + "Oops Something went wrong !!") - Log.info(self, Log.FAIL + "Calling cleanup actions ...") - doCleanupAction(self, domain=ee_domain, - webroot=data['webroot'], - dbname=data['ee_db_name'], - dbuser=data['ee_db_user'], - dbhost=data['ee_db_host']) - deleteSiteInfo(self, ee_domain) - Log.error(self, "Check logs for reason " - "`tail /var/log/ee/ee.log` & Try Again!!!") - - # Setup WordPress if Wordpress site - if data['wp']: - try: - ee_wp_creds = setupwordpress(self, data) - # Add database information for site into database - updateSiteInfo(self, ee_domain, db_name=data['ee_db_name'], - db_user=data['ee_db_user'], - db_password=data['ee_db_pass'], - db_host=data['ee_db_host']) - except SiteError as e: - # call cleanup actions on failure - Log.debug(self, str(e)) - Log.info(self, Log.FAIL + "Oops Something went wrong !!") - Log.info(self, Log.FAIL + "Calling cleanup actions ...") - doCleanupAction(self, domain=ee_domain, - webroot=data['webroot'], - dbname=data['ee_db_name'], - dbuser=data['ee_db_user'], - dbhost=data['ee_mysql_grant_host']) - deleteSiteInfo(self, ee_domain) - Log.error(self, "Check logs for reason " - "`tail /var/log/ee/ee.log` & Try Again!!!") - - # Service Nginx Reload call cleanup if failed to reload nginx - if not EEService.reload_service(self, 'nginx'): - Log.info(self, Log.FAIL + "Oops Something went wrong !!") - Log.info(self, Log.FAIL + "Calling cleanup actions ...") - doCleanupAction(self, domain=ee_domain, - webroot=data['webroot']) - if 'ee_db_name' in data.keys(): - doCleanupAction(self, domain=ee_domain, - dbname=data['ee_db_name'], - dbuser=data['ee_db_user'], - dbhost=data['ee_mysql_grant_host']) - deleteSiteInfo(self, ee_domain) - Log.info(self, Log.FAIL + "service nginx reload failed." - " check issues with `nginx -t` command.") - Log.error(self, "Check logs for reason " - "`tail /var/log/ee/ee.log` & Try Again!!!") - - EEGit.add(self, ["/etc/nginx"], - msg="{0} created with {1} {2}" - .format(ee_www_domain, stype, cache)) - # Setup Permissions for webroot - try: - setwebrootpermissions(self, data['webroot']) - except SiteError as e: - Log.debug(self, str(e)) - Log.info(self, Log.FAIL + "Oops Something went wrong !!") - Log.info(self, Log.FAIL + "Calling cleanup actions ...") - doCleanupAction(self, domain=ee_domain, - webroot=data['webroot']) - if 'ee_db_name' in data.keys(): - print("Inside db cleanup") - doCleanupAction(self, domain=ee_domain, - dbname=data['ee_db_name'], - dbuser=data['ee_db_user'], - dbhost=data['ee_mysql_grant_host']) - deleteSiteInfo(self, ee_domain) - Log.error(self, "Check logs for reason " - "`tail /var/log/ee/ee.log` & Try Again!!!") - - if ee_auth and len(ee_auth): - for msg in ee_auth: - Log.info(self, Log.ENDC + msg, log=False) - - if data['wp']: - Log.info(self, Log.ENDC + "WordPress admin user :" - " {0}".format(ee_wp_creds['wp_user']), log=False) - Log.info(self, Log.ENDC + "WordPress admin user password : {0}" - .format(ee_wp_creds['wp_pass']), log=False) - - display_cache_settings(self, data) - - Log.info(self, "Successfully created site" - " http://{0}".format(ee_domain)) - except SiteError as e: - Log.error(self, "Check logs for reason " - "`tail /var/log/ee/ee.log` & Try Again!!!") - - if self.app.pargs.letsencrypt : - if (not self.app.pargs.experimental): - if stype in ['wpsubdomain']: - Log.warn(self, "Wildcard domains are not supported in Lets Encrypt.\nWP SUBDOMAIN site will get SSL for primary site only.") - - Log.info(self, "Letsencrypt is currently in beta phase." - " \nDo you wish" - " to enable SSl now for {0}?".format(ee_domain)) - - # Check prompt - check_prompt = input("Type \"y\" to continue [n]:") - if check_prompt != "Y" and check_prompt != "y": - data['letsencrypt'] = False - letsencrypt = False - else: - data['letsencrypt'] = True - letsencrypt = True - else: - data['letsencrypt'] = True - letsencrypt = True - - if data['letsencrypt'] is True: - setupLetsEncrypt(self, ee_domain) - httpsRedirect(self,ee_domain) - Log.info(self,"Creating Cron Job for cert auto-renewal") - EECron.setcron_weekly(self,'ee site update --le=renew --all 2> /dev/null'.format(ee_domain),'Renew all' - ' letsencrypt SSL cert. Set by EasyEngine') - - if not EEService.reload_service(self, 'nginx'): - Log.error(self, "service nginx reload failed. " - "check issues with `nginx -t` command") - - Log.info(self, "Congratulations! Successfully Configured SSl for Site " - " https://{0}".format(ee_domain)) - - if (SSL.getExpirationDays(self,ee_domain)>0): - Log.info(self, "Your cert will expire within " + str(SSL.getExpirationDays(self,ee_domain)) + " days.") - else: - Log.warn(self, "Your cert already EXPIRED ! .PLEASE renew soon . ") - - # Add nginx conf folder into GIT - EEGit.add(self, ["{0}/conf/nginx".format(ee_site_webroot)], - msg="Adding letsencrypts config of site: {0}" - .format(ee_domain)) - updateSiteInfo(self, ee_domain, ssl=letsencrypt) - - elif data['letsencrypt'] is False: - Log.info(self, "Not using Let\'s encrypt for Site " - " http://{0}".format(ee_domain)) - - - - -class EESiteUpdateController(CementBaseController): - class Meta: - label = 'update' - stacked_on = 'site' - stacked_type = 'nested' - description = ('This command updates websites configuration to ' - 'another as per the options are provided') - arguments = [ - (['site_name'], - dict(help='domain name for the site to be updated', - nargs='?')), - (['--password'], - dict(help="update to password for wordpress site user", - action='store_true')), - (['--html'], - dict(help="update to html site", action='store_true')), - (['--php'], - dict(help="update to php site", action='store_true')), - (['--php7'], - dict(help="update to php7 site", - action='store' or 'store_const', - choices=('on', 'off'), const='on', nargs='?')), - (['--mysql'], - dict(help="update to mysql site", action='store_true')), - (['--wp'], - dict(help="update to wordpress single site", - action='store_true')), - (['--wpsubdir'], - dict(help="update to wpsubdir site", action='store_true')), - (['--wpsubdomain'], - dict(help="update to wpsubdomain site", action='store_true')), - (['--w3tc'], - dict(help="update to w3tc cache", action='store_true')), - (['--wpfc'], - dict(help="update to wpfc cache", action='store_true')), - (['--wpsc'], - dict(help="update to wpsc cache", action='store_true')), - (['--wpredis'], - dict(help="update to redis cache", action='store_true')), - (['--hhvm'], - dict(help='Use HHVM for site', - action='store' or 'store_const', - choices=('on', 'off'), const='on', nargs='?')), - (['--pagespeed'], - dict(help='Use PageSpeed for site', - action='store' or 'store_const', - choices=('on', 'off'), const='on', nargs='?')), - (['-le','--letsencrypt'], - dict(help="configure letsencrypt ssl for the site", - action='store' or 'store_const', - choices=('on', 'off', 'renew'), const='on', nargs='?')), - (['--proxy'], - dict(help="update to proxy site", nargs='+')), - (['--experimental'], - dict(help="Enable Experimenal packages without prompt", - action='store_true')), - (['--all'], - dict(help="update all sites", action='store_true')), - ] - - @expose(help="Update site type or cache") - def default(self): - pargs = self.app.pargs - - if self.app.pargs.pagespeed: - Log.error(self, "Pagespeed support has been dropped since EasyEngine v3.6.0",False) - Log.error(self, "Please run command again without `--pagespeed`",False) - Log.error(self, "For more details, read - https://easyengine.io/blog/disabling-pagespeed/") - - if pargs.all: - if pargs.site_name: - Log.error(self, "`--all` option cannot be used with site name" - " provided") - if pargs.html: - Log.error(self, "No site can be updated to html") - - if not (pargs.php or pargs.php7 or - pargs.mysql or pargs.wp or pargs.wpsubdir or - pargs.wpsubdomain or pargs.w3tc or pargs.wpfc or - pargs.wpsc or pargs.hhvm or pargs.wpredis or pargs.letsencrypt): - Log.error(self, "Please provide options to update sites.") - - if pargs.all: - if pargs.site_name: - Log.error(self, "`--all` option cannot be used with site name" - " provided") - - sites = getAllsites(self) - if not sites: - pass - else: - for site in sites: - pargs.site_name = site.sitename - Log.info(self, Log.ENDC + Log.BOLD + "Updating site {0}," - " please wait..." - .format(pargs.site_name)) - self.doupdatesite(pargs) - print("\n") - else: - self.doupdatesite(pargs) - - def doupdatesite(self, pargs): - hhvm = None - # pagespeed = None - letsencrypt = False - php7 = None - - - data = dict() - try: - stype, cache = detSitePar(vars(pargs)) - except RuntimeError as e: - Log.debug(self, str(e)) - Log.error(self, "Please provide valid options combination for" - " site update") - - if stype is None and pargs.proxy: - stype, cache = 'proxy', '' - proxyinfo = pargs.proxy[0].strip() - if not proxyinfo: - Log.error(self, "Please provide proxy server host information") - proxyinfo = proxyinfo.split(':') - host = proxyinfo[0].strip() - port = '80' if len(proxyinfo) < 2 else proxyinfo[1].strip() - elif stype is None and not (pargs.proxy or pargs.letsencrypt): - stype, cache = 'html', 'basic' - elif stype and pargs.proxy: - Log.error(self, "--proxy can not be used with other site types") - if (pargs.proxy and pargs.hhvm): - Log.error(self, "Proxy site can not run on hhvm") - - if not pargs.site_name: - try: - while not pargs.site_name: - pargs.site_name = (input('Enter site name : ').strip()) - except IOError as e: - Log.error(self, 'Unable to input site name, Please try again!') - - pargs.site_name = pargs.site_name.strip() - (ee_domain, - ee_www_domain, ) = ValidateDomain(pargs.site_name) - ee_site_webroot = EEVariables.ee_webroot + ee_domain - - check_site = getSiteInfo(self, ee_domain) - - if check_site is None: - Log.error(self, " Site {0} does not exist.".format(ee_domain)) - else: - oldsitetype = check_site.site_type - oldcachetype = check_site.cache_type - old_hhvm = check_site.is_hhvm - # old_pagespeed = check_site.is_pagespeed - check_ssl = check_site.is_ssl - check_php_version = check_site.php_version - - if check_php_version == "7.0": - old_php7 = True - else: - old_php7 = False - - if (pargs.password and not (pargs.html or - pargs.php or pargs.php7 or pargs.mysql or pargs.wp or - pargs.w3tc or pargs.wpfc or pargs.wpsc - or pargs.wpsubdir or pargs.wpsubdomain)): - try: - updatewpuserpassword(self, ee_domain, ee_site_webroot) - except SiteError as e: - Log.debug(self, str(e)) - Log.info(self, "\nPassword Unchanged.") - return 0 - - if ((stype == "proxy" and stype == oldsitetype and self.app.pargs.hhvm) - or (stype == "proxy" and - stype == oldsitetype )): - Log.info(self, Log.FAIL + - "Can not update proxy site to HHVM") - return 1 - if stype == "html" and stype == oldsitetype and self.app.pargs.hhvm: - Log.info(self, Log.FAIL + "Can not update HTML site to HHVM") - return 1 - - if ((stype == 'php' and oldsitetype not in ['html', 'proxy', 'php7']) or - # (stype == 'php7' and oldsitetype not in ['html', 'mysql', 'php', 'php7', 'wp', 'wpsubdir', 'wpsubdomain', ]) or - (stype == 'mysql' and oldsitetype not in ['html', 'php', - 'proxy','php7']) or - (stype == 'wp' and oldsitetype not in ['html', 'php', 'mysql', - 'proxy', 'wp', 'php7']) or - (stype == 'wpsubdir' and oldsitetype in ['wpsubdomain']) or - (stype == 'wpsubdomain' and oldsitetype in ['wpsubdir']) or - (stype == oldsitetype and cache == oldcachetype) and - not pargs.php7): - Log.info(self, Log.FAIL + "can not update {0} {1} to {2} {3}". - format(oldsitetype, oldcachetype, stype, cache)) - return 1 - - if stype == 'proxy': - data['site_name'] = ee_domain - data['www_domain'] = ee_www_domain - data['proxy'] = True - data['host'] = host - data['port'] = port -# pagespeed = False - hhvm = False - data['webroot'] = ee_site_webroot - data['currsitetype'] = oldsitetype - data['currcachetype'] = oldcachetype - - if stype == 'php': - data = dict(site_name=ee_domain, www_domain=ee_www_domain, - static=False, basic=True, wp=False, w3tc=False, - wpfc=False, wpsc=False, wpredis=False, multisite=False, - wpsubdir=False, webroot=ee_site_webroot, - currsitetype=oldsitetype, currcachetype=oldcachetype) - - elif stype in ['mysql', 'wp', 'wpsubdir', 'wpsubdomain']: - - data = dict(site_name=ee_domain, www_domain=ee_www_domain, - static=False, basic=True, wp=False, w3tc=False, - wpfc=False, wpsc=False, wpredis=False, multisite=False, - wpsubdir=False, webroot=ee_site_webroot, - ee_db_name='', ee_db_user='', ee_db_pass='', - ee_db_host='', - currsitetype=oldsitetype, currcachetype=oldcachetype) - - if stype in ['wp', 'wpsubdir', 'wpsubdomain']: - data['wp'] = True - data['basic'] = False - data[cache] = True - if stype in ['wpsubdir', 'wpsubdomain']: - data['multisite'] = True - if stype == 'wpsubdir': - data['wpsubdir'] = True - - if pargs.hhvm or pargs.php7: - if not data: - data = dict(site_name=ee_domain, www_domain=ee_www_domain, - currsitetype=oldsitetype, - currcachetype=oldcachetype, - webroot=ee_site_webroot) - stype = oldsitetype - cache = oldcachetype - if oldsitetype == 'html' or oldsitetype == 'proxy': - data['static'] = True - data['wp'] = False - data['multisite'] = False - data['wpsubdir'] = False - elif oldsitetype == 'php' or oldsitetype == 'mysql': - data['static'] = False - data['wp'] = False - data['multisite'] = False - data['wpsubdir'] = False - elif oldsitetype == 'wp': - data['static'] = False - data['wp'] = True - data['multisite'] = False - data['wpsubdir'] = False - elif oldsitetype == 'wpsubdir': - data['static'] = False - data['wp'] = True - data['multisite'] = True - data['wpsubdir'] = True - elif oldsitetype == 'wpsubdomain': - data['static'] = False - data['wp'] = True - data['multisite'] = True - data['wpsubdir'] = False - - if oldcachetype == 'basic': - data['basic'] = True - data['w3tc'] = False - data['wpfc'] = False - data['wpsc'] = False - data['wpredis'] = False - elif oldcachetype == 'w3tc': - data['basic'] = False - data['w3tc'] = True - data['wpfc'] = False - data['wpsc'] = False - data['wpredis'] = False - elif oldcachetype == 'wpfc': - data['basic'] = False - data['w3tc'] = False - data['wpfc'] = True - data['wpsc'] = False - data['wpredis'] = False - elif oldcachetype == 'wpsc': - data['basic'] = False - data['w3tc'] = False - data['wpfc'] = False - data['wpsc'] = True - data['wpredis'] = False - elif oldcachetype == 'wpredis': - data['basic'] = False - data['w3tc'] = False - data['wpfc'] = False - data['wpsc'] = False - data['wpredis'] = True - - if pargs.hhvm != 'off': - data['hhvm'] = True - hhvm = True - elif pargs.hhvm == 'off': - data['hhvm'] = False - hhvm = False - -# if pargs.pagespeed != 'off': -# data['pagespeed'] = True -# pagespeed = True -# elif pargs.pagespeed == 'off': -# data['pagespeed'] = False -# pagespeed = False - - if pargs.php7 == 'on' : - data['php7'] = True - php7 = True - check_php_version= '7.0' - elif pargs.php7 == 'off': - data['php7'] = False - php7 = False - check_php_version = '5.6' - -# if pargs.pagespeed: -# if pagespeed is old_pagespeed: -# if pagespeed is False: -# Log.info(self, "Pagespeed is already disabled for given " -# "site") -# elif pagespeed is True: -# Log.info(self, "Pagespeed is already enabled for given " -# "site") -# pargs.pagespeed = False - - if pargs.php7: - if php7 is old_php7: - if php7 is False: - Log.info(self, "PHP 7.0 is already disabled for given " - "site") - elif php7 is True: - Log.info(self, "PHP 7.0 is already enabled for given " - "site") - pargs.php7 = False - - #--letsencrypt=renew code goes here - if pargs.letsencrypt == "renew" and not pargs.all: - expiry_days = SSL.getExpirationDays(self,ee_domain) - min_expiry_days = 30 - if check_ssl: - if (expiry_days <= min_expiry_days): - renewLetsEncrypt(self,ee_domain) - else: - Log.error(self,"More than 30 days left for certificate Expiry. Not renewing now.") - - else: - Log.error(self,"Cannot RENEW ! SSL is not configured for given site .") - - if not EEService.reload_service(self, 'nginx'): - Log.error(self, "service nginx reload failed. " - "check issues with `nginx -t` command") - Log.info(self, "SUCCESS: Certificate was successfully renewed For" - " https://{0}".format(ee_domain)) - if (SSL.getExpirationDays(self,ee_domain)>0): - Log.info(self, "Your cert will expire within " + str(SSL.getExpirationDays(self,ee_domain)) + " days.") - Log.info(self, "Expiration DATE: " + str(SSL.getExpirationDate(self,ee_domain))) - - else: - Log.warn(self, "Your cert already EXPIRED !. PLEASE renew soon . ") - return 0 - - if pargs.all and pargs.letsencrypt == "renew": - - if check_ssl: - expiry_days = SSL.getExpirationDays(self,ee_domain,True) - if expiry_days < 0: - return 0 - min_expiry_days = 30 - if (expiry_days <= min_expiry_days): - renewLetsEncrypt(self,ee_domain) - if not EEService.reload_service(self, 'nginx'): - Log.error(self, "service nginx reload failed. " - "check issues with `nginx -t` command") - Log.info(self, "SUCCESS: Certificate was successfully renewed For" - " https://{0}".format(ee_domain)) - else: - Log.info(self,"More than 30 days left for certificate Expiry. Not renewing now.\n") - - if (SSL.getExpirationDays(self,ee_domain)>0): - Log.info(self, "Your cert will expire within " + str(SSL.getExpirationDays(self,ee_domain)) + " days.") - Log.info(self, "Expiration DATE: \n\n" + str(SSL.getExpirationDate(self,ee_domain))) - return 0 - #else: - # Log.warn(self, "Your cert already EXPIRED ! .PLEASE renew soon . ") - else: - Log.info(self,"SSL not configured for site http://{0}".format(ee_domain)) - return 0 - - if pargs.all and pargs.letsencrypt == "off": - if letsencrypt is check_ssl: - if letsencrypt is False: - Log.error(self, "SSl is not configured for given " - "site",False) - return 0 - pass - - if pargs.letsencrypt: - if pargs.letsencrypt == 'on': - data['letsencrypt'] = True - letsencrypt = True - elif pargs.letsencrypt == 'off': - data['letsencrypt'] = False - letsencrypt = False - - if letsencrypt is check_ssl: - if letsencrypt is False: - Log.error(self, "SSl is not configured for given " - "site") - elif letsencrypt is True: - Log.error(self, "SSl is already configured for given " - "site") - pargs.letsencrypt = False - - if pargs.hhvm: - if hhvm is old_hhvm: - if hhvm is False: - Log.info(self, "HHVM is allready disabled for given " - "site") - elif hhvm is True: - Log.info(self, "HHVM is allready enabled for given " - "site") - - pargs.hhvm = False - - if data and (not pargs.hhvm): - if old_hhvm is True: - data['hhvm'] = True - hhvm = True - else: - data['hhvm'] = False - hhvm = False - -# if data and (not pargs.pagespeed): -# if old_pagespeed is True: -# data['pagespeed'] = True -# pagespeed = True -# else: -# data['pagespeed'] = False -# pagespeed = False - - if data and (not pargs.php7): - if old_php7 is True: - data['php7'] = True - php7 = True - else: - data['php7'] = False - php7 = False - - if pargs.hhvm=="on" or pargs.letsencrypt=="on" or pargs.php7=="on": - if pargs.php7 == "on": - if (not pargs.experimental): - Log.info(self, "PHP7.0 is experimental feature and it may not" - " work with all plugins of your site.\nYou can " - "disable it by passing --php7=off later.\nDo you wish" - " to enable PHP now for {0}?".format(ee_domain)) - - # Check prompt - check_prompt = input("Type \"y\" to continue [n]:") - if check_prompt != "Y" and check_prompt != "y": - Log.info(self, "Not using PHP 7.0 for site") - data['php7'] = False - php7 = False - else: - data['php7'] = True - php7 = True - else: - data['php7'] = True - php7 = True - - if pargs.hhvm == "on": - if (not pargs.experimental): - Log.info(self, "HHVM is experimental feature and it may not" - " work with all plugins of your site.\nYou can " - "disable it by passing --hhvm=off later.\nDo you wish" - " to enable HHVM now for {0}?".format(ee_domain)) - - # Check prompt - check_prompt = input("Type \"y\" to continue [n]:") - if check_prompt != "Y" and check_prompt != "y": - Log.info(self, "Not using HHVM for site") - data['hhvm'] = False - hhvm = False - else: - data['hhvm'] = True - hhvm = True - else: - data['hhvm'] = True - hhvm = True - - if pargs.letsencrypt == "on": - - if (not pargs.experimental): - - if oldsitetype in ['wpsubdomain']: - Log.warn(self, "Wildcard domains are not supported in Lets Encrypt.\nWP SUBDOMAIN site will get SSL for primary site only.") - - Log.info(self, "Letsencrypt is currently in beta phase." - " \nDo you wish" - " to enable SSl now for {0}?".format(ee_domain)) - - # Check prompt - check_prompt = input("Type \"y\" to continue [n]:") - if check_prompt != "Y" and check_prompt != "y": - Log.info(self, "Not using letsencrypt for site") - data['letsencrypt'] = False - letsencrypt = False - else: - data['letsencrypt'] = True - letsencrypt = True - else: - data['letsencrypt'] = True - letsencrypt = True - - - - if pargs.wpredis and data['currcachetype'] != 'wpredis': - if (not pargs.experimental): - Log.info(self, "Redis is experimental feature and it may not" - " work with all plugins of your site.\nYou can " - "disable it by changing cache type later.\nDo you wish" - " to enable Redis now for {0}?".format(ee_domain)) - - # Check prompt - check_prompt = input("Type \"y\" to continue [n]: ") - if check_prompt != "Y" and check_prompt != "y": - Log.error(self, "Not using Redis for site") - data['wpredis'] = False - data['basic'] = True - cache = 'basic' - - if ((hhvm is old_hhvm) and (php7 is old_php7) and - (stype == oldsitetype and cache == oldcachetype)): - return 1 - - if not data: - Log.error(self, "Cannot update {0}, Invalid Options" - .format(ee_domain)) - - ee_auth = site_package_check(self, stype) - data['ee_db_name'] = check_site.db_name - data['ee_db_user'] = check_site.db_user - data['ee_db_pass'] = check_site.db_password - data['ee_db_host'] = check_site.db_host -# data['old_pagespeed_status'] = check_site.is_pagespeed - - if not pargs.letsencrypt: - try: - pre_run_checks(self) - except SiteError as e: - Log.debug(self, str(e)) - Log.error(self, "NGINX configuration check failed.") - - try: - sitebackup(self, data) - except Exception as e: - Log.debug(self, str(e)) - Log.info(self, Log.FAIL + "Check logs for reason " - "`tail /var/log/ee/ee.log` & Try Again!!!") - return 1 - - # setup NGINX configuration, and webroot - try: - setupdomain(self, data) - except SiteError as e: - Log.debug(self, str(e)) - Log.info(self, Log.FAIL + "Update site failed." - "Check logs for reason" - "`tail /var/log/ee/ee.log` & Try Again!!!") - return 1 - - if 'proxy' in data.keys() and data['proxy']: - updateSiteInfo(self, ee_domain, stype=stype, cache=cache, - hhvm=hhvm,ssl=True if check_site.is_ssl else False) - Log.info(self, "Successfully updated site" - " http://{0}".format(ee_domain)) - return 0 - - # Update pagespeed config -# if pargs.pagespeed: -# operateOnPagespeed(self, data) - - if pargs.letsencrypt: - if data['letsencrypt'] is True: - if not os.path.isfile("{0}/conf/nginx/ssl.conf.disabled" - .format(ee_site_webroot)): - setupLetsEncrypt(self, ee_domain) - - else: - EEFileUtils.mvfile(self, "{0}/conf/nginx/ssl.conf.disabled" - .format(ee_site_webroot), - '{0}/conf/nginx/ssl.conf' - .format(ee_site_webroot)) - - httpsRedirect(self,ee_domain) - Log.info(self,"Creating Cron Job for cert auto-renewal") - EECron.setcron_weekly(self,'ee site update --le=renew --all 2> /dev/null'.format(ee_domain),'Renew all' - ' letsencrypt SSL cert. Set by EasyEngine') - - if not EEService.reload_service(self, 'nginx'): - Log.error(self, "service nginx reload failed. " - "check issues with `nginx -t` command") - - Log.info(self, "Congratulations! Successfully Configured SSl for Site " - " https://{0}".format(ee_domain)) - - if (SSL.getExpirationDays(self,ee_domain)>0): - Log.info(self, "Your cert will expire within " + str(SSL.getExpirationDays(self,ee_domain)) + " days.") - else: - Log.warn(self, "Your cert already EXPIRED ! .PLEASE renew soon . ") - - elif data['letsencrypt'] is False: - if os.path.isfile("{0}/conf/nginx/ssl.conf" - .format(ee_site_webroot)): - Log.info(self,'Setting Nginx configuration') - EEFileUtils.mvfile(self, "{0}/conf/nginx/ssl.conf" - .format(ee_site_webroot), - '{0}/conf/nginx/ssl.conf.disabled' - .format(ee_site_webroot)) - httpsRedirect(self,ee_domain,False) - if not EEService.reload_service(self, 'nginx'): - Log.error(self, "service nginx reload failed. " - "check issues with `nginx -t` command") - #Log.info(self,"Removing Cron Job set for cert auto-renewal") - #EECron.remove_cron(self,'ee site update {0} --le=renew --min_expiry_limit 30 2> \/dev\/null'.format(ee_domain)) - Log.info(self, "Successfully Disabled SSl for Site " - " http://{0}".format(ee_domain)) - - - # Add nginx conf folder into GIT - EEGit.add(self, ["{0}/conf/nginx".format(ee_site_webroot)], - msg="Adding letsencrypts config of site: {0}" - .format(ee_domain)) - updateSiteInfo(self, ee_domain, ssl=letsencrypt) - return 0 - - if stype == oldsitetype and cache == oldcachetype: - - # Service Nginx Reload - if not EEService.reload_service(self, 'nginx'): - Log.error(self, "service nginx reload failed. " - "check issues with `nginx -t` command") - - updateSiteInfo(self, ee_domain, stype=stype, cache=cache, - hhvm=hhvm, ssl=True if check_site.is_ssl else False, php_version=check_php_version) - - Log.info(self, "Successfully updated site" - " http://{0}".format(ee_domain)) - return 0 - - #if data['ee_db_name'] and not data['wp']: - if 'ee_db_name' in data.keys() and not data['wp']: - try: - data = setupdatabase(self, data) - except SiteError as e: - Log.debug(self, str(e)) - Log.info(self, Log.FAIL + "Update site failed." - "Check logs for reason" - "`tail /var/log/ee/ee.log` & Try Again!!!") - return 1 - try: - eedbconfig = open("{0}/ee-config.php".format(ee_site_webroot), - encoding='utf-8', mode='w') - eedbconfig.write("<?php \ndefine('DB_NAME', '{0}');" - "\ndefine('DB_USER', '{1}'); " - "\ndefine('DB_PASSWORD', '{2}');" - "\ndefine('DB_HOST', '{3}');\n?>" - .format(data['ee_db_name'], - data['ee_db_user'], - data['ee_db_pass'], - data['ee_db_host'])) - eedbconfig.close() - except IOError as e: - Log.debug(self, str(e)) - Log.debug(self, "creating ee-config.php failed.") - Log.info(self, Log.FAIL + "Update site failed. " - "Check logs for reason " - "`tail /var/log/ee/ee.log` & Try Again!!!") - return 1 - - # Setup WordPress if old sites are html/php/mysql sites - if data['wp'] and oldsitetype in ['html', 'proxy', 'php', 'mysql']: - try: - ee_wp_creds = setupwordpress(self, data) - except SiteError as e: - Log.debug(self, str(e)) - Log.info(self, Log.FAIL + "Update site failed." - "Check logs for reason " - "`tail /var/log/ee/ee.log` & Try Again!!!") - return 1 - - # Uninstall unnecessary plugins - if oldsitetype in ['wp', 'wpsubdir', 'wpsubdomain']: - # Setup WordPress Network if update option is multisite - # and oldsite is WordPress single site - if data['multisite'] and oldsitetype == 'wp': - try: - setupwordpressnetwork(self, data) - except SiteError as e: - Log.debug(self, str(e)) - Log.info(self, Log.FAIL + "Update site failed. " - "Check logs for reason" - " `tail /var/log/ee/ee.log` & Try Again!!!") - return 1 - - if (oldcachetype == 'w3tc' or oldcachetype == 'wpfc' and - not (data['w3tc'] or data['wpfc'])): - try: - uninstallwp_plugin(self, 'w3-total-cache', data) - except SiteError as e: - Log.debug(self, str(e)) - Log.info(self, Log.FAIL + "Update site failed. " - "Check logs for reason" - " `tail /var/log/ee/ee.log` & Try Again!!!") - return 1 - - if ((oldcachetype in ['w3tc', 'wpsc', 'basic', 'wpredis'] and - (data['wpfc'])) or (oldsitetype == 'wp' and data['multisite'] and data['wpfc'])): - try: - plugin_data = '{"log_level":"INFO","log_filesize":5,"enable_purge":1,"enable_map":0,"enable_log":0,"enable_stamp":0,"purge_homepage_on_new":1,"purge_homepage_on_edit":1,"purge_homepage_on_del":1,"purge_archive_on_new":1,"purge_archive_on_edit":0,"purge_archive_on_del":0,"purge_archive_on_new_comment":0,"purge_archive_on_deleted_comment":0,"purge_page_on_mod":1,"purge_page_on_new_comment":1,"purge_page_on_deleted_comment":1,"cache_method":"enable_fastcgi","purge_method":"get_request","redis_hostname":"127.0.0.1","redis_port":"6379","redis_prefix":"nginx-cache:"}' - setupwp_plugin(self, 'nginx-helper', 'rt_wp_nginx_helper_options', plugin_data, data) - except SiteError as e: - Log.debug(self, str(e)) - Log.info(self, Log.FAIL + "Update nginx-helper settings failed. " - "Check logs for reason" - " `tail /var/log/ee/ee.log` & Try Again!!!") - return 1 - - elif ((oldcachetype in ['w3tc', 'wpsc', 'basic', 'wpfc'] and - (data['wpredis'])) or (oldsitetype == 'wp' and data['multisite'] and data['wpredis'])): - try: - plugin_data = '{"log_level":"INFO","log_filesize":5,"enable_purge":1,"enable_map":0,"enable_log":0,"enable_stamp":0,"purge_homepage_on_new":1,"purge_homepage_on_edit":1,"purge_homepage_on_del":1,"purge_archive_on_new":1,"purge_archive_on_edit":0,"purge_archive_on_del":0,"purge_archive_on_new_comment":0,"purge_archive_on_deleted_comment":0,"purge_page_on_mod":1,"purge_page_on_new_comment":1,"purge_page_on_deleted_comment":1,"cache_method":"enable_redis","purge_method":"get_request","redis_hostname":"127.0.0.1","redis_port":"6379","redis_prefix":"nginx-cache:"}' - setupwp_plugin(self, 'nginx-helper', 'rt_wp_nginx_helper_options', plugin_data, data) - except SiteError as e: - Log.debug(self, str(e)) - Log.info(self, Log.FAIL + "Update nginx-helper settings failed. " - "Check logs for reason" - " `tail /var/log/ee/ee.log` & Try Again!!!") - return 1 - else: - try: - plugin_data = '{"log_level":"INFO","log_filesize":5,"enable_purge":0,"enable_map":0,"enable_log":0,"enable_stamp":0,"purge_homepage_on_new":1,"purge_homepage_on_edit":1,"purge_homepage_on_del":1,"purge_archive_on_new":1,"purge_archive_on_edit":0,"purge_archive_on_del":0,"purge_archive_on_new_comment":0,"purge_archive_on_deleted_comment":0,"purge_page_on_mod":1,"purge_page_on_new_comment":1,"purge_page_on_deleted_comment":1,"cache_method":"enable_redis","purge_method":"get_request","redis_hostname":"127.0.0.1","redis_port":"6379","redis_prefix":"nginx-cache:"}' - setupwp_plugin(self, 'nginx-helper', 'rt_wp_nginx_helper_options', plugin_data, data) - except SiteError as e: - Log.debug(self, str(e)) - Log.info(self, Log.FAIL + "Update nginx-helper settings failed. " - "Check logs for reason" - " `tail /var/log/ee/ee.log` & Try Again!!!") - return 1 - - if oldcachetype == 'wpsc' and not data['wpsc']: - try: - uninstallwp_plugin(self, 'wp-super-cache', data) - except SiteError as e: - Log.debug(self, str(e)) - Log.info(self, Log.FAIL + "Update site failed." - "Check logs for reason" - " `tail /var/log/ee/ee.log` & Try Again!!!") - return 1 - - if oldcachetype == 'wpredis' and not data['wpredis']: - try: - uninstallwp_plugin(self, 'redis-cache', data) - except SiteError as e: - Log.debug(self, str(e)) - Log.info(self, Log.FAIL + "Update site failed." - "Check logs for reason" - " `tail /var/log/ee/ee.log` & Try Again!!!") - return 1 - - if (oldcachetype != 'w3tc' or oldcachetype != 'wpfc') and (data['w3tc'] - or data['wpfc']): - try: - installwp_plugin(self, 'w3-total-cache', data) - except SiteError as e: - Log.debug(self, str(e)) - Log.info(self, Log.FAIL + "Update site failed." - "Check logs for reason" - " `tail /var/log/ee/ee.log` & Try Again!!!") - return 1 - - if oldcachetype != 'wpsc' and data['wpsc']: - try: - installwp_plugin(self, 'wp-super-cache', data) - except SiteError as e: - Log.debug(self, str(e)) - Log.info(self, Log.FAIL + "Update site failed." - "Check logs for reason " - "`tail /var/log/ee/ee.log` & Try Again!!!") - return 1 - - if oldcachetype != 'wpredis' and data['wpredis']: - try: - if installwp_plugin(self, 'redis-cache', data): - #search for wp-config.php - if EEFileUtils.isexist(self,"{0}/wp-config.php".format(ee_site_webroot)): - config_path = '{0}/wp-config.php'.format(ee_site_webroot) - elif EEFileUtils.isexist(self,"{0}/htdocs/wp-config.php".format(ee_site_webroot)): - config_path = '{0}/htdocs/wp-config.php'.format(ee_site_webroot) - else: - Log.debug(self, "Updating wp-config.php failed. File could not be located.") - Log.error(self,"wp-config.php could not be located !!") - raise SiteError - - if EEShellExec.cmd_exec(self, "grep -q \"WP_CACHE_KEY_SALT\" {0}" - .format(config_path)): - pass - else: - try: - wpconfig = open("{0}".format(config_path), - encoding='utf-8', mode='a') - wpconfig.write("\n\ndefine( \'WP_CACHE_KEY_SALT\', \'{0}:\' );" - .format(ee_domain)) - wpconfig.close() - except IOError as e: - Log.debug(self, str(e)) - Log.debug(self, "Updating wp-config.php failed.") - Log.warn(self, "Updating wp-config.php failed. " - "Could not append:" - "\ndefine( \'WP_CACHE_KEY_SALT\', \'{0}:\' );".format(ee_domain) + - "\nPlease add manually") - except SiteError as e: - Log.debug(self, str(e)) - Log.info(self, Log.FAIL + "Update site failed." - "Check logs for reason " - "`tail /var/log/ee/ee.log` & Try Again!!!") - return 1 - - # Service Nginx Reload - if not EEService.reload_service(self, 'nginx'): - Log.error(self, "service nginx reload failed. " - "check issues with `nginx -t` command") - - EEGit.add(self, ["/etc/nginx"], - msg="{0} updated with {1} {2}" - .format(ee_www_domain, stype, cache)) - # Setup Permissions for webroot - try: - setwebrootpermissions(self, data['webroot']) - except SiteError as e: - Log.debug(self, str(e)) - Log.info(self, Log.FAIL + "Update site failed." - "Check logs for reason " - "`tail /var/log/ee/ee.log` & Try Again!!!") - return 1 - - if ee_auth and len(ee_auth): - for msg in ee_auth: - Log.info(self, Log.ENDC + msg) - - display_cache_settings(self, data) - if data['wp'] and oldsitetype in ['html', 'php', 'mysql']: - Log.info(self, "\n\n" + Log.ENDC + "WordPress admin user :" - " {0}".format(ee_wp_creds['wp_user'])) - Log.info(self, Log.ENDC + "WordPress admin password : {0}" - .format(ee_wp_creds['wp_pass']) + "\n\n") - if oldsitetype in ['html', 'php'] and stype != 'php': - updateSiteInfo(self, ee_domain, stype=stype, cache=cache, - db_name=data['ee_db_name'], - db_user=data['ee_db_user'], - db_password=data['ee_db_pass'], - db_host=data['ee_db_host'], hhvm=hhvm, - ssl=True if check_site.is_ssl else False,php_version=check_php_version) - else: - updateSiteInfo(self, ee_domain, stype=stype, cache=cache, - hhvm=hhvm, ssl=True if check_site.is_ssl else False,php_version=check_php_version) - Log.info(self, "Successfully updated site" - " http://{0}".format(ee_domain)) - return 0 - - -class EESiteDeleteController(CementBaseController): - class Meta: - label = 'delete' - stacked_on = 'site' - stacked_type = 'nested' - description = 'delete an existing website' - arguments = [ - (['site_name'], - dict(help='domain name to be deleted', nargs='?')), - (['--no-prompt'], - dict(help="doesnt ask permission for delete", - action='store_true')), - (['-f','--force'], - dict(help="forcefully delete site and configuration", - action='store_true')), - (['--all'], - dict(help="delete all", action='store_true')), - (['--db'], - dict(help="delete db only", action='store_true')), - (['--files'], - dict(help="delete webroot only", action='store_true')), - ] - - @expose(help="Delete website configuration and files") - @expose(hide=True) - def default(self): - if not self.app.pargs.site_name: - try: - while not self.app.pargs.site_name: - self.app.pargs.site_name = (input('Enter site name : ') - .strip()) - except IOError as e: - Log.error(self, 'could not input site name') - - self.app.pargs.site_name = self.app.pargs.site_name.strip() - (ee_domain, ee_www_domain) = ValidateDomain(self.app.pargs.site_name) - ee_db_name = '' - ee_prompt = '' - ee_nginx_prompt = '' - mark_db_delete_prompt = False - mark_webroot_delete_prompt = False - mark_db_deleted = False - mark_webroot_deleted = False - if not check_domain_exists(self, ee_domain): - Log.error(self, "site {0} does not exist".format(ee_domain)) - - if ((not self.app.pargs.db) and (not self.app.pargs.files) and - (not self.app.pargs.all)): - self.app.pargs.all = True - - # Gather information from ee-db for ee_domain - check_site = getSiteInfo(self, ee_domain) - ee_site_type = check_site.site_type - ee_site_webroot = check_site.site_path - if ee_site_webroot == 'deleted': - mark_webroot_deleted = True - if ee_site_type in ['mysql', 'wp', 'wpsubdir', 'wpsubdomain']: - ee_db_name = check_site.db_name - ee_db_user = check_site.db_user - ee_mysql_grant_host = self.app.config.get('mysql', 'grant-host') - if ee_db_name == 'deleted': - mark_db_deleted = True - if self.app.pargs.all: - self.app.pargs.db = True - self.app.pargs.files = True - else: - if self.app.pargs.all: - mark_db_deleted = True - self.app.pargs.files = True - - # Delete website database - if self.app.pargs.db: - if ee_db_name != 'deleted' and ee_db_name != '': - if not self.app.pargs.no_prompt: - ee_db_prompt = input('Are you sure, you want to delete' - ' database [y/N]: ') - else: - ee_db_prompt = 'Y' - mark_db_delete_prompt = True - - if ee_db_prompt == 'Y' or ee_db_prompt == 'y': - mark_db_delete_prompt = True - Log.info(self, "Deleting Database, {0}, user {1}" - .format(ee_db_name, ee_db_user)) - deleteDB(self, ee_db_name, ee_db_user, ee_mysql_grant_host, False) - updateSiteInfo(self, ee_domain, - db_name='deleted', - db_user='deleted', - db_password='deleted') - mark_db_deleted = True - Log.info(self, "Deleted Database successfully.") - else: - mark_db_deleted = True - Log.info(self, "Does not seems to have database for this site." - ) - - # Delete webroot - if self.app.pargs.files: - if ee_site_webroot != 'deleted': - if not self.app.pargs.no_prompt: - ee_web_prompt = input('Are you sure, you want to delete ' - 'webroot [y/N]: ') - else: - ee_web_prompt = 'Y' - mark_webroot_delete_prompt = True - - if ee_web_prompt == 'Y' or ee_web_prompt == 'y': - mark_webroot_delete_prompt = True - Log.info(self, "Deleting Webroot, {0}" - .format(ee_site_webroot)) - deleteWebRoot(self, ee_site_webroot) - updateSiteInfo(self, ee_domain, webroot='deleted') - mark_webroot_deleted = True - Log.info(self, "Deleted webroot successfully") - else: - mark_webroot_deleted = True - Log.info(self, "Webroot seems to be already deleted") - - if not self.app.pargs.force: - if (mark_webroot_deleted and mark_db_deleted): - # TODO Delete nginx conf - removeNginxConf(self, ee_domain) - deleteSiteInfo(self, ee_domain) - Log.info(self, "Deleted site {0}".format(ee_domain)) - # else: - # Log.error(self, " site {0} does not exists".format(ee_domain)) - else: - if (mark_db_delete_prompt or mark_webroot_delete_prompt or (mark_webroot_deleted and mark_db_deleted)): - # TODO Delete nginx conf - removeNginxConf(self, ee_domain) - deleteSiteInfo(self, ee_domain) - Log.info(self, "Deleted site {0}".format(ee_domain)) - - -class EESiteListController(CementBaseController): - class Meta: - label = 'list' - stacked_on = 'site' - stacked_type = 'nested' - description = 'List websites' - arguments = [ - (['--enabled'], - dict(help='List enabled websites', action='store_true')), - (['--disabled'], - dict(help="List disabled websites", action='store_true')), - ] - - @expose(help="Lists websites") - def default(self): - sites = getAllsites(self) - if not sites: - pass - - if self.app.pargs.enabled: - for site in sites: - if site.is_enabled: - Log.info(self, "{0}".format(site.sitename)) - elif self.app.pargs.disabled: - for site in sites: - if not site.is_enabled: - Log.info(self, "{0}".format(site.sitename)) - else: - for site in sites: - Log.info(self, "{0}".format(site.sitename)) - - -def load(app): - # register the plugin class.. this only happens if the plugin is enabled - handler.register(EESiteController) - handler.register(EESiteCreateController) - handler.register(EESiteUpdateController) - handler.register(EESiteDeleteController) - handler.register(EESiteListController) - handler.register(EESiteEditController) - # register a hook (function) to run after arguments are parsed. - hook.register('post_argument_parsing', ee_site_hook) diff --git a/ee/cli/plugins/site_functions.py b/ee/cli/plugins/site_functions.py deleted file mode 100644 index 149ed430b..000000000 --- a/ee/cli/plugins/site_functions.py +++ /dev/null @@ -1,1498 +0,0 @@ -from ee.cli.plugins.stack import EEStackController -from ee.core.fileutils import EEFileUtils -from ee.core.mysql import * -from ee.core.shellexec import * -from ee.core.sslutils import SSL -from ee.core.variables import EEVariables -from ee.cli.plugins.sitedb import * -from ee.core.aptget import EEAptGet -from ee.core.git import EEGit -from ee.core.logging import Log -from ee.core.sendmail import EESendMail -from ee.core.services import EEService -import subprocess -from subprocess import CalledProcessError -import os -import random -import string -import sys -import getpass -import glob -import re -import platform - - -class SiteError(Exception): - """Custom Exception Occured when setting up site""" - def __init__(self, message): - self.message = message - - def __str__(self): - return repr(self.message) - - -def pre_run_checks(self): - - # Check nginx configuration - Log.info(self, "Running pre-update checks, please wait...") - try: - Log.debug(self, "checking NGINX configuration ...") - FNULL = open('/dev/null', 'w') - ret = subprocess.check_call(["nginx", "-t"], stdout=FNULL, - stderr=subprocess.STDOUT) - except CalledProcessError as e: - Log.debug(self, "{0}".format(str(e))) - raise SiteError("nginx configuration check failed.") - - -def check_domain_exists(self, domain): - if getSiteInfo(self, domain): - return True - else: - return False - - -def setupdomain(self, data): - - #for debug purpose - # for key, value in data.items() : - # print (key, value) - - ee_domain_name = data['site_name'] - ee_site_webroot = data['webroot'] if 'webroot' in data.keys() else '' - - # Check if nginx configuration already exists - # if os.path.isfile('/etc/nginx/sites-available/{0}' - # .format(ee_domain_name)): - # raise SiteError("nginx configuration already exists for site") - - Log.info(self, "Setting up NGINX configuration \t", end='') - # write nginx config for file - try: - ee_site_nginx_conf = open('/etc/nginx/sites-available/{0}' - .format(ee_domain_name), encoding='utf-8', - mode='w') - if not data['php7']: - self.app.render((data), 'virtualconf.mustache', - out=ee_site_nginx_conf) - else: - self.app.render((data), 'virtualconf-php7.mustache', - out=ee_site_nginx_conf) - ee_site_nginx_conf.close() - except IOError as e: - Log.debug(self, "{0}".format(e)) - raise SiteError("create nginx configuration failed for site") - except Exception as e: - Log.debug(self, "{0}".format(e)) - raise SiteError("create nginx configuration failed for site") - finally: - # Check nginx -t and return status over it - try: - Log.debug(self, "Checking generated nginx conf, please wait...") - FNULL = open('/dev/null', 'w') - ret = subprocess.check_call(["nginx", "-t"], stdout=FNULL, - stderr=subprocess.STDOUT) - Log.info(self, "[" + Log.ENDC + "Done" + Log.OKBLUE + "]") - except CalledProcessError as e: - Log.debug(self, "{0}".format(str(e))) - Log.info(self, "[" + Log.ENDC + Log.FAIL + "Fail" - + Log.OKBLUE + "]") - raise SiteError("created nginx configuration failed for site." - " check with `nginx -t`") - - - # create symbolic link for - EEFileUtils.create_symlink(self, ['/etc/nginx/sites-available/{0}' - .format(ee_domain_name), - '/etc/nginx/sites-enabled/{0}' - .format(ee_domain_name)]) - - if 'proxy' in data.keys() and data['proxy']: - return - - # Creating htdocs & logs directory - Log.info(self, "Setting up webroot \t\t", end='') - try: - if not os.path.exists('{0}/htdocs'.format(ee_site_webroot)): - os.makedirs('{0}/htdocs'.format(ee_site_webroot)) - if not os.path.exists('{0}/logs'.format(ee_site_webroot)): - os.makedirs('{0}/logs'.format(ee_site_webroot)) - if not os.path.exists('{0}/conf/nginx'.format(ee_site_webroot)): - os.makedirs('{0}/conf/nginx'.format(ee_site_webroot)) - - EEFileUtils.create_symlink(self, ['/var/log/nginx/{0}.access.log' - .format(ee_domain_name), - '{0}/logs/access.log' - .format(ee_site_webroot)]) - EEFileUtils.create_symlink(self, ['/var/log/nginx/{0}.error.log' - .format(ee_domain_name), - '{0}/logs/error.log' - .format(ee_site_webroot)]) - except Exception as e: - Log.debug(self, "{0}".format(e)) - raise SiteError("setup webroot failed for site") - finally: - # TODO Check if directories are setup - if (os.path.exists('{0}/htdocs'.format(ee_site_webroot)) and - os.path.exists('{0}/logs'.format(ee_site_webroot))): - Log.info(self, "[" + Log.ENDC + "Done" + Log.OKBLUE + "]") - else: - Log.info(self, "[" + Log.ENDC + "Fail" + Log.OKBLUE + "]") - raise SiteError("setup webroot failed for site") - - -def setupdatabase(self, data): - ee_domain_name = data['site_name'] - ee_random = (''.join(random.sample(string.ascii_uppercase + - string.ascii_lowercase + string.digits, 15))) - ee_replace_dot = ee_domain_name.replace('.', '_') - prompt_dbname = self.app.config.get('mysql', 'db-name') - prompt_dbuser = self.app.config.get('mysql', 'db-user') - ee_mysql_grant_host = self.app.config.get('mysql', 'grant-host') - ee_db_name = '' - ee_db_username = '' - ee_db_password = '' - - if prompt_dbname == 'True' or prompt_dbname == 'true': - try: - ee_db_name = input('Enter the MySQL database name [{0}]: ' - .format(ee_replace_dot)) - except EOFError as e: - Log.debug(self, "{0}".format(e)) - raise SiteError("Unable to input database name") - - if not ee_db_name: - ee_db_name = ee_replace_dot - - if prompt_dbuser == 'True' or prompt_dbuser == 'true': - try: - ee_db_username = input('Enter the MySQL database user name [{0}]: ' - .format(ee_replace_dot)) - ee_db_password = getpass.getpass(prompt='Enter the MySQL database' - ' password [{0}]: ' - .format(ee_random)) - except EOFError as e: - Log.debug(self, "{0}".format(e)) - raise SiteError("Unable to input database credentials") - - if not ee_db_username: - ee_db_username = ee_replace_dot - if not ee_db_password: - ee_db_password = ee_random - - if len(ee_db_username) > 16: - Log.debug(self, 'Autofix MySQL username (ERROR 1470 (HY000)),' - ' please wait') - ee_db_username = (ee_db_name[0:6] + generate_random()) - - # create MySQL database - Log.info(self, "Setting up database\t\t", end='') - Log.debug(self, "Creating database {0}".format(ee_db_name)) - try: - if EEMysql.check_db_exists(self, ee_db_name): - Log.debug(self, "Database already exists, Updating DB_NAME .. ") - ee_db_name = (ee_db_name[0:6] + generate_random()) - ee_db_username = (ee_db_name[0:6] + generate_random()) - except MySQLConnectionError as e: - raise SiteError("MySQL Connectivity problem occured") - - try: - EEMysql.execute(self, "create database `{0}`" - .format(ee_db_name)) - except StatementExcecutionError as e: - Log.info(self, "[" + Log.ENDC + Log.FAIL + "Failed" + Log.OKBLUE + "]") - raise SiteError("create database execution failed") - # Create MySQL User - Log.debug(self, "Creating user {0}".format(ee_db_username)) - Log.debug(self, "create user `{0}`@`{1}` identified by ''" - .format(ee_db_username, ee_mysql_grant_host)) - try: - EEMysql.execute(self, - "create user `{0}`@`{1}` identified by '{2}'" - .format(ee_db_username, ee_mysql_grant_host, - ee_db_password), log=False) - except StatementExcecutionError as e: - Log.info(self, "[" + Log.ENDC + Log.FAIL + "Failed" + Log.OKBLUE + "]") - raise SiteError("creating user failed for database") - - # Grant permission - Log.debug(self, "Setting up user privileges") - try: - EEMysql.execute(self, - "grant all privileges on `{0}`.* to `{1}`@`{2}`" - .format(ee_db_name, - ee_db_username, ee_mysql_grant_host)) - except StatementExcecutionError as e: - Log.info(self, "[" + Log.ENDC + Log.FAIL + "Failed" + Log.OKBLUE + "]") - SiteError("grant privileges to user failed for database ") - - Log.info(self, "[" + Log.ENDC + "Done" + Log.OKBLUE + "]") - - data['ee_db_name'] = ee_db_name - data['ee_db_user'] = ee_db_username - data['ee_db_pass'] = ee_db_password - data['ee_db_host'] = EEVariables.ee_mysql_host - data['ee_mysql_grant_host'] = ee_mysql_grant_host - return(data) - - -def setupwordpress(self, data): - ee_domain_name = data['site_name'] - ee_site_webroot = data['webroot'] - prompt_wpprefix = self.app.config.get('wordpress', 'prefix') - ee_wp_user = self.app.config.get('wordpress', 'user') - ee_wp_pass = self.app.config.get('wordpress', 'password') - ee_wp_email = self.app.config.get('wordpress', 'email') - # Random characters - ee_random = (''.join(random.sample(string.ascii_uppercase + - string.ascii_lowercase + string.digits, 15))) - ee_wp_prefix = '' - # ee_wp_user = '' - # ee_wp_pass = '' - - if 'wp-user' in data.keys() and data['wp-user']: - ee_wp_user = data['wp-user'] - if 'wp-email' in data.keys() and data['wp-email']: - ee_wp_email = data['wp-email'] - if 'wp-pass' in data.keys() and data['wp-pass']: - ee_wp_pass = data['wp-pass'] - - Log.info(self, "Downloading WordPress \t\t", end='') - EEFileUtils.chdir(self, '{0}/htdocs/'.format(ee_site_webroot)) - try: - if EEShellExec.cmd_exec(self, "wp --allow-root core" - " download"): - pass - else: - Log.info(self, "[" + Log.ENDC + Log.FAIL + "Fail" + Log.OKBLUE + "]") - raise SiteError("download WordPress core failed") - except CommandExecutionError as e: - Log.info(self, "[" + Log.ENDC + Log.FAIL + "Fail" + Log.OKBLUE + "]") - raise SiteError(self, "download WordPress core failed") - - Log.info(self, "[" + Log.ENDC + "Done" + Log.OKBLUE + "]") - - if not (data['ee_db_name'] and data['ee_db_user'] and data['ee_db_pass']): - data = setupdatabase(self, data) - if prompt_wpprefix == 'True' or prompt_wpprefix == 'true': - try: - ee_wp_prefix = input('Enter the WordPress table prefix [wp_]: ') - while not re.match('^[A-Za-z0-9_]*$', ee_wp_prefix): - Log.warn(self, "table prefix can only " - "contain numbers, letters, and underscores") - ee_wp_prefix = input('Enter the WordPress table prefix [wp_]: ' - ) - except EOFError as e: - Log.debug(self, "{0}".format(e)) - raise SiteError("input table prefix failed") - - if not ee_wp_prefix: - ee_wp_prefix = 'wp_' - - # Modify wp-config.php & move outside the webroot - - EEFileUtils.chdir(self, '{0}/htdocs/'.format(ee_site_webroot)) - Log.debug(self, "Setting up wp-config file") - if not data['multisite']: - Log.debug(self, "Generating wp-config for WordPress Single site") - Log.debug(self, "bash -c \"php {0} --allow-root " - .format(EEVariables.ee_wpcli_path) - + "core config " - + "--dbname=\'{0}\' --dbprefix=\'{1}\' --dbuser=\'{2}\' " - "--dbhost=\'{3}\' " - .format(data['ee_db_name'], ee_wp_prefix, - data['ee_db_user'], data['ee_db_host']) - + "--dbpass= " - "--extra-php<<PHP \n {1}\nPHP\"" - .format(data['ee_db_pass'], - "\n\ndefine(\'WP_DEBUG\', false);")) - try: - if EEShellExec.cmd_exec(self, "bash -c \"php {0} --allow-root" - .format(EEVariables.ee_wpcli_path) - + " core config " - + "--dbname=\'{0}\' --dbprefix=\'{1}\' " - "--dbuser=\'{2}\' --dbhost=\'{3}\' " - .format(data['ee_db_name'], ee_wp_prefix, - data['ee_db_user'], data['ee_db_host'] - ) - + "--dbpass=\'{0}\' " - "--extra-php<<PHP \n {1} {redissalt}\nPHP\"" - .format(data['ee_db_pass'], - "\n\ndefine(\'WP_DEBUG\', false);", - redissalt="\n\ndefine( \'WP_CACHE_KEY_SALT\', \'{0}:\' );" - .format(ee_domain_name) if data['wpredis'] - else ''), - log=False - ): - pass - else : - raise SiteError("generate wp-config failed for wp single site") - except CommandExecutionError as e: - raise SiteError("generate wp-config failed for wp single site") - else: - Log.debug(self, "Generating wp-config for WordPress multisite") - Log.debug(self, "bash -c \"php {0} --allow-root " - .format(EEVariables.ee_wpcli_path) - + "core config " - + "--dbname=\'{0}\' --dbprefix=\'{1}\' --dbhost=\'{2}\' " - .format(data['ee_db_name'], ee_wp_prefix, data['ee_db_host']) - + "--dbuser=\'{0}\' --dbpass= " - "--extra-php<<PHP \n {2} {3} {4}\nPHP\"" - .format(data['ee_db_user'], data['ee_db_pass'], - "\ndefine(\'WP_ALLOW_MULTISITE\', " - "true);", - "\ndefine(\'WPMU_ACCEL_REDIRECT\'," - " true);", - "\n\ndefine(\'WP_DEBUG\', false);")) - try: - if EEShellExec.cmd_exec(self, "bash -c \"php {0} --allow-root" - .format(EEVariables.ee_wpcli_path) - + " core config " - + "--dbname=\'{0}\' --dbprefix=\'{1}\' " - "--dbhost=\'{2}\' " - .format(data['ee_db_name'], ee_wp_prefix, - data['ee_db_host']) - + "--dbuser=\'{0}\' --dbpass=\'{1}\' " - "--extra-php<<PHP \n {2} {3} {4} {redissalt}\nPHP\"" - .format(data['ee_db_user'], - data['ee_db_pass'], - "\ndefine(\'WP_ALLOW_MULTISITE\', " - "true);", - "\ndefine(\'WPMU_ACCEL_REDIRECT\'," - " true);", - "\n\ndefine(\'WP_DEBUG\', false);", - redissalt="\n\ndefine( \'WP_CACHE_KEY_SALT\', \'{0}:\' );" - .format(ee_domain_name) if data['wpredis'] - else ''), - log=False - ): - pass - else: - raise SiteError("generate wp-config failed for wp multi site") - except CommandExecutionError as e: - raise SiteError("generate wp-config failed for wp multi site") - - #EEFileUtils.mvfile(self, os.getcwd()+'/wp-config.php', - # os.path.abspath(os.path.join(os.getcwd(), os.pardir))) - - try: - import shutil - - Log.debug(self, "Moving file from {0} to {1}".format(os.getcwd()+'/wp-config.php',os.path.abspath(os.path.join(os.getcwd(), os.pardir)))) - shutil.move(os.getcwd()+'/wp-config.php',os.path.abspath(os.path.join(os.getcwd(), os.pardir))) - except Exception as e: - Log.error(self, 'Unable to move file from {0} to {1}' - .format(os.getcwd()+'/wp-config.php', os.path.abspath(os.path.join(os.getcwd(), os.pardir))),False) - raise SiteError("Unable to move wp-config.php") - - - if not ee_wp_user: - ee_wp_user = EEVariables.ee_user - while not ee_wp_user: - Log.warn(self, "Username can have only alphanumeric" - "characters, spaces, underscores, hyphens," - "periods and the @ symbol.") - try: - ee_wp_user = input('Enter WordPress username: ') - except EOFError as e: - Log.debug(self, "{0}".format(e)) - raise SiteError("input WordPress username failed") - if not ee_wp_pass: - ee_wp_pass = ee_random - - if not ee_wp_email: - ee_wp_email = EEVariables.ee_email - while not ee_wp_email: - try: - ee_wp_email = input('Enter WordPress email: ') - except EOFError as e: - Log.debug(self, "{0}".format(e)) - raise SiteError("input WordPress username failed") - - try: - while not re.match(r"^[A-Za-z0-9\.\+_-]+@[A-Za-z0-9\._-]+\.[a-zA-Z]*$", - ee_wp_email): - Log.info(self, "EMail not Valid in config, " - "Please provide valid email id") - ee_wp_email = input("Enter your email: ") - except EOFError as e: - Log.debug(self, "{0}".format(e)) - raise SiteError("input WordPress user email failed") - - Log.debug(self, "Setting up WordPress tables") - - if not data['multisite']: - Log.debug(self, "Creating tables for WordPress Single site") - Log.debug(self, "php {0} --allow-root core install " - .format(EEVariables.ee_wpcli_path) - + "--url=\'{0}\' --title=\'{0}\' --admin_name=\'{1}\' " - .format(data['www_domain'], ee_wp_user) - + "--admin_password= --admin_email=\'{1}\'" - .format(ee_wp_pass, ee_wp_email)) - try: - if EEShellExec.cmd_exec(self, "php {0} --allow-root core " - .format(EEVariables.ee_wpcli_path) - + "install --url=\'{0}\' --title=\'{0}\' " - "--admin_name=\'{1}\' " - .format(data['www_domain'], ee_wp_user) - + "--admin_password=\'{0}\' " - "--admin_email=\'{1}\'" - .format(ee_wp_pass, ee_wp_email), - log=False): - pass - else: - raise SiteError("setup WordPress tables failed for single site") - except CommandExecutionError as e: - raise SiteError("setup WordPress tables failed for single site") - else: - Log.debug(self, "Creating tables for WordPress multisite") - Log.debug(self, "php {0} --allow-root " - .format(EEVariables.ee_wpcli_path) - + "core multisite-install " - "--url=\'{0}\' --title=\'{0}\' --admin_name=\'{1}\' " - .format(data['www_domain'], ee_wp_user) - + "--admin_password= --admin_email=\'{1}\' " - "{subdomains}" - .format(ee_wp_pass, ee_wp_email, - subdomains='--subdomains' - if not data['wpsubdir'] else '')) - try: - if EEShellExec.cmd_exec(self, "php {0} --allow-root " - .format(EEVariables.ee_wpcli_path) - + "core multisite-install " - "--url=\'{0}\' --title=\'{0}\' " - "--admin_name=\'{1}\' " - .format(data['www_domain'], ee_wp_user) - + "--admin_password=\'{0}\' " - "--admin_email=\'{1}\' " - "{subdomains}" - .format(ee_wp_pass, ee_wp_email, - subdomains='--subdomains' - if not data['wpsubdir'] else ''), - log=False): - pass - else: - raise SiteError("setup WordPress tables failed for wp multi site") - except CommandExecutionError as e: - raise SiteError("setup WordPress tables failed for wp multi site") - - Log.debug(self, "Updating WordPress permalink") - try: - EEShellExec.cmd_exec(self, " php {0} --allow-root " - .format(EEVariables.ee_wpcli_path) - + "rewrite structure " - "/%year%/%monthnum%/%day%/%postname%/") - except CommandExecutionError as e: - raise SiteError("Update wordpress permalinks failed") - - """Install nginx-helper plugin """ - installwp_plugin(self, 'nginx-helper', data) - if data['wpfc']: - plugin_data = '{"log_level":"INFO","log_filesize":5,"enable_purge":1,"enable_map":0,"enable_log":0,"enable_stamp":0,"purge_homepage_on_new":1,"purge_homepage_on_edit":1,"purge_homepage_on_del":1,"purge_archive_on_new":1,"purge_archive_on_edit":0,"purge_archive_on_del":0,"purge_archive_on_new_comment":0,"purge_archive_on_deleted_comment":0,"purge_page_on_mod":1,"purge_page_on_new_comment":1,"purge_page_on_deleted_comment":1,"cache_method":"enable_fastcgi","purge_method":"get_request","redis_hostname":"127.0.0.1","redis_port":"6379","redis_prefix":"nginx-cache:"}' - setupwp_plugin(self, 'nginx-helper', 'rt_wp_nginx_helper_options', plugin_data, data) - elif data['wpredis']: - plugin_data = '{"log_level":"INFO","log_filesize":5,"enable_purge":1,"enable_map":0,"enable_log":0,"enable_stamp":0,"purge_homepage_on_new":1,"purge_homepage_on_edit":1,"purge_homepage_on_del":1,"purge_archive_on_new":1,"purge_archive_on_edit":0,"purge_archive_on_del":0,"purge_archive_on_new_comment":0,"purge_archive_on_deleted_comment":0,"purge_page_on_mod":1,"purge_page_on_new_comment":1,"purge_page_on_deleted_comment":1,"cache_method":"enable_redis","purge_method":"get_request","redis_hostname":"127.0.0.1","redis_port":"6379","redis_prefix":"nginx-cache:"}' - setupwp_plugin(self, 'nginx-helper', 'rt_wp_nginx_helper_options', plugin_data, data) - - """Install Wp Super Cache""" - if data['wpsc']: - installwp_plugin(self, 'wp-super-cache', data) - - """Install Redis Cache""" - if data['wpredis']: - installwp_plugin(self, 'redis-cache', data) - - """Install W3 Total Cache""" - if data['w3tc'] or data['wpfc']: - installwp_plugin(self, 'w3-total-cache', data) - - wp_creds = dict(wp_user=ee_wp_user, wp_pass=ee_wp_pass, - wp_email=ee_wp_email) - - return(wp_creds) - - -def setupwordpressnetwork(self, data): - ee_site_webroot = data['webroot'] - EEFileUtils.chdir(self, '{0}/htdocs/'.format(ee_site_webroot)) - Log.info(self, "Setting up WordPress Network \t", end='') - try: - if EEShellExec.cmd_exec(self, 'wp --allow-root core multisite-convert' - ' --title=\'{0}\' {subdomains}' - .format(data['www_domain'], - subdomains='--subdomains' - if not data['wpsubdir'] else '')): - pass - else: - Log.info(self, "[" + Log.ENDC + Log.FAIL + "Fail" + Log.OKBLUE + "]") - raise SiteError("setup WordPress network failed") - - except CommandExecutionError as e: - Log.info(self, "[" + Log.ENDC + Log.FAIL + "Fail" + Log.OKBLUE + "]") - raise SiteError("setup WordPress network failed") - Log.info(self, "[" + Log.ENDC + "Done" + Log.OKBLUE + "]") - - -def installwp_plugin(self, plugin_name, data): - ee_site_webroot = data['webroot'] - Log.info(self, "Installing plugin {0}, please wait..." - .format(plugin_name)) - EEFileUtils.chdir(self, '{0}/htdocs/'.format(ee_site_webroot)) - try: - EEShellExec.cmd_exec(self, "php {0} plugin " - .format(EEVariables.ee_wpcli_path) - + "--allow-root install " - "{0}".format(plugin_name)) - except CommandExecutionError as e: - raise SiteError("plugin installation failed") - - try: - EEShellExec.cmd_exec(self, "php {0} plugin " - .format(EEVariables.ee_wpcli_path) - + "--allow-root activate " - "{0} {na}" - .format(plugin_name, - na='--network' if data['multisite'] - else '' - )) - except CommandExecutionError as e: - raise SiteError("plugin activation failed") - - return 1 - - -def uninstallwp_plugin(self, plugin_name, data): - ee_site_webroot = data['webroot'] - Log.debug(self, "Uninstalling plugin {0}, please wait..." - .format(plugin_name)) - EEFileUtils.chdir(self, '{0}/htdocs/'.format(ee_site_webroot)) - Log.info(self, "Uninstalling plugin {0}, please wait..." - .format(plugin_name)) - try: - EEShellExec.cmd_exec(self, "php {0} plugin " - .format(EEVariables.ee_wpcli_path) - + "--allow-root deactivate " - "{0}".format(plugin_name)) - - EEShellExec.cmd_exec(self, "php {0} plugin " - .format(EEVariables.ee_wpcli_path) - + "--allow-root uninstall " - "{0}".format(plugin_name)) - except CommandExecutionError as e: - raise SiteError("plugin uninstall failed") - -def setupwp_plugin(self, plugin_name, plugin_option, plugin_data, data): - ee_site_webroot = data['webroot'] - Log.info(self, "Setting plugin {0}, please wait..." - .format(plugin_name)) - EEFileUtils.chdir(self, '{0}/htdocs/'.format(ee_site_webroot)) - - if not data['multisite']: - try: - EEShellExec.cmd_exec(self, "php {0} " - .format(EEVariables.ee_wpcli_path) - + "--allow-root option update " - "{0} \'{1}\' --format=json".format(plugin_option, plugin_data)) - except CommandExecutionError as e: - raise SiteError("plugin setup failed") - else: - try: - EEShellExec.cmd_exec(self, "php {0} " - .format(EEVariables.ee_wpcli_path) - + "--allow-root network meta update 1 " - "{0} \'{1}\' --format=json" - .format(plugin_option, plugin_data - )) - except CommandExecutionError as e: - raise SiteError("plugin setup failed") - - -def setwebrootpermissions(self, webroot): - Log.debug(self, "Setting up permissions") - try: - EEFileUtils.chown(self, webroot, EEVariables.ee_php_user, - EEVariables.ee_php_user, recursive=True) - except Exception as e: - Log.debug(self, str(e)) - raise SiteError("problem occured while setting up webroot permissions") - - -def sitebackup(self, data): - ee_site_webroot = data['webroot'] - backup_path = ee_site_webroot + '/backup/{0}'.format(EEVariables.ee_date) - if not EEFileUtils.isexist(self, backup_path): - EEFileUtils.mkdir(self, backup_path) - Log.info(self, "Backup location : {0}".format(backup_path)) - EEFileUtils.copyfile(self, '/etc/nginx/sites-available/{0}' - .format(data['site_name']), backup_path) - - if data['currsitetype'] in ['html', 'php', 'proxy', 'mysql']: - if data['php7'] is True and not data['wp']: - Log.info(self, "Backing up Webroot \t\t", end='') - EEFileUtils.copyfiles(self, ee_site_webroot + '/htdocs', backup_path + '/htdocs') - Log.info(self, "[" + Log.ENDC + "Done" + Log.OKBLUE + "]") - else: - Log.info(self, "Backing up Webroot \t\t", end='') - EEFileUtils.mvfile(self, ee_site_webroot + '/htdocs', backup_path) - Log.info(self, "[" + Log.ENDC + "Done" + Log.OKBLUE + "]") - - configfiles = glob.glob(ee_site_webroot + '/*-config.php') - if not configfiles: - #search for wp-config.php inside htdocs/ - Log.debug(self, "Config files not found in {0}/ " - .format(ee_site_webroot)) - if data['currsitetype'] in ['mysql']: - pass - else: - Log.debug(self, "Searching wp-config.php in {0}/htdocs/ " - .format(ee_site_webroot)) - configfiles = glob.glob(ee_site_webroot + '/htdocs/wp-config.php') - - # if configfiles and EEFileUtils.isexist(self, configfiles[0]): - # ee_db_name = (EEFileUtils.grep(self, configfiles[0], - # 'DB_NAME').split(',')[1] - # .split(')')[0].strip().replace('\'', '')) - if data['ee_db_name']: - Log.info(self, 'Backing up database \t\t', end='') - try: - if not EEShellExec.cmd_exec(self, "mysqldump {0} > {1}/{0}.sql" - .format(data['ee_db_name'], - backup_path)): - Log.info(self, - "[" + Log.ENDC + Log.FAIL + "Fail" + Log.OKBLUE + "]") - raise SiteError("mysqldump failed to backup database") - except CommandExecutionError as e: - Log.info(self, "[" + Log.ENDC + "Fail" + Log.OKBLUE + "]") - raise SiteError("mysqldump failed to backup database") - Log.info(self, "[" + Log.ENDC + "Done" + Log.OKBLUE + "]") - # move wp-config.php/ee-config.php to backup - if data['currsitetype'] in ['mysql', 'proxy']: - if data['php7'] is True and not data['wp']: - EEFileUtils.copyfile(self, configfiles[0], backup_path) - else: - EEFileUtils.mvfile(self, configfiles[0], backup_path) - else: - EEFileUtils.copyfile(self, configfiles[0], backup_path) - - -def site_package_check(self, stype): - apt_packages = [] - packages = [] - stack = EEStackController() - stack.app = self.app - if stype in ['html', 'proxy', 'php', 'mysql', 'wp', 'wpsubdir', - 'wpsubdomain', 'php7']: - Log.debug(self, "Setting apt_packages variable for Nginx") - - # Check if server has nginx-custom package - if not (EEAptGet.is_installed(self, 'nginx-custom') or EEAptGet.is_installed(self, 'nginx-mainline')): - # check if Server has nginx-plus installed - if EEAptGet.is_installed(self, 'nginx-plus'): - # do something - # do post nginx installation configuration - Log.info(self, "NGINX PLUS Detected ...") - apt = ["nginx-plus"] + EEVariables.ee_nginx - #apt_packages = apt_packages + EEVariables.ee_nginx - stack.post_pref(apt, packages) - elif EEAptGet.is_installed(self, 'nginx'): - Log.info(self, "EasyEngine detected a previously installed Nginx package. " - "It may or may not have required modules. " - "\nIf you need help, please create an issue at https://github.com/EasyEngine/easyengine/issues/ \n") - apt = ["nginx"] + EEVariables.ee_nginx - #apt_packages = apt_packages + EEVariables.ee_nginx - stack.post_pref(apt, packages) - else: - apt_packages = apt_packages + EEVariables.ee_nginx - else: - # Fix for Nginx white screen death - if not EEFileUtils.grep(self, '/etc/nginx/fastcgi_params', - 'SCRIPT_FILENAME'): - with open('/etc/nginx/fastcgi_params', encoding='utf-8', - mode='a') as ee_nginx: - ee_nginx.write('fastcgi_param \tSCRIPT_FILENAME ' - '\t$request_filename;\n') - - if self.app.pargs.php and self.app.pargs.php7: - Log.error(self,"INVALID OPTION: PHP 7.0 provided with PHP 5.0") - - if not self.app.pargs.php7 and stype in ['php', 'mysql', 'wp', 'wpsubdir', 'wpsubdomain']: - Log.debug(self, "Setting apt_packages variable for PHP") - if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic'): - if not EEAptGet.is_installed(self, 'php5.6-fpm'): - apt_packages = apt_packages + EEVariables.ee_php5_6 + EEVariables.ee_php_extra - else: - if not EEAptGet.is_installed(self, 'php5-fpm'): - apt_packages = apt_packages + EEVariables.ee_php - - if self.app.pargs.php7 and stype in [ 'mysql', 'wp', 'wpsubdir', 'wpsubdomain']: - if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic'): - Log.debug(self, "Setting apt_packages variable for PHP 5.6") - if not EEAptGet.is_installed(self, 'php5.6-fpm'): - apt_packages = apt_packages + EEVariables.ee_php5_6 - Log.debug(self, "Setting apt_packages variable for PHP 7.0") - if not EEAptGet.is_installed(self, 'php7.0-fpm'): - apt_packages = apt_packages + EEVariables.ee_php7_0 + EEVariables.ee_php_extra - else: - if EEVariables.ee_platform_codename == 'wheezy': - Log.warn(self, "PHP 7.0 not available for your system.") - Log.info(self,"Creating site with PHP 5.6") - if not EEAptGet.is_installed(self, 'php5-fpm'): - Log.info(self, "Setting apt_packages variable for PHP") - Log.debug(self, "Setting apt_packages variable for PHP") - apt_packages = apt_packages + EEVariables.ee_php - else: - Log.debug(self, "Setting apt_packages variable for PHP 7.0") - if not EEAptGet.is_installed(self, 'php7.0-fpm'): - apt_packages = apt_packages + EEVariables.ee_php7_0 - - if stype in ['mysql', 'wp', 'wpsubdir', 'wpsubdomain']: - Log.debug(self, "Setting apt_packages variable for MySQL") - if not EEShellExec.cmd_exec(self, "mysqladmin ping"): - apt_packages = apt_packages + EEVariables.ee_mysql - packages = packages + [["https://raw.githubusercontent.com/" - "major/MySQLTuner-perl/master/" - "mysqltuner.pl", "/usr/bin/mysqltuner", - "MySQLTuner"]] - - if stype in ['php', 'mysql', 'wp', 'wpsubdir', 'wpsubdomain']: - Log.debug(self, "Setting apt_packages variable for Postfix") - if not EEAptGet.is_installed(self, 'postfix'): - apt_packages = apt_packages + EEVariables.ee_postfix - - if stype in ['wp', 'wpsubdir', 'wpsubdomain']: - Log.debug(self, "Setting packages variable for WP-CLI") - if not EEShellExec.cmd_exec(self, "which wp"): - packages = packages + [["https://github.com/wp-cli/wp-cli/" - "releases/download/v{0}/" - "wp-cli-{0}.phar" - .format(EEVariables.ee_wp_cli), - "/usr/bin/wp", "WP-CLI"]] - if self.app.pargs.wpredis: - Log.debug(self, "Setting apt_packages variable for redis") - if not EEAptGet.is_installed(self, 'redis-server'): - apt_packages = apt_packages + EEVariables.ee_redis - - if os.path.isfile("/etc/nginx/nginx.conf") and (not - os.path.isfile("/etc/nginx/common/redis.conf")): - - data = dict() - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/redis.conf') - ee_nginx = open('/etc/nginx/common/redis.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'redis.mustache', - out=ee_nginx) - ee_nginx.close() - - if os.path.isfile("/etc/nginx/nginx.conf") and (not - os.path.isfile("/etc/nginx/common/redis-hhvm.conf")): - - data = dict() - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/redis-hhvm.conf') - ee_nginx = open('/etc/nginx/common/redis-hhvm.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'redis-hhvm.mustache', - out=ee_nginx) - ee_nginx.close() - - if os.path.isfile("/etc/nginx/conf.d/upstream.conf"): - if not EEFileUtils.grep(self, "/etc/nginx/conf.d/" - "upstream.conf", - "redis"): - with open("/etc/nginx/conf.d/upstream.conf", - "a") as redis_file: - redis_file.write("upstream redis {\n" - " server 127.0.0.1:6379;\n" - " keepalive 10;\n}") - - if os.path.isfile("/etc/nginx/nginx.conf") and (not - os.path.isfile("/etc/nginx/conf.d/redis.conf")): - with open("/etc/nginx/conf.d/redis.conf", "a") as redis_file: - redis_file.write("# Log format Settings\n" - "log_format rt_cache_redis '$remote_addr $upstream_response_time $srcache_fetch_status [$time_local] '\n" - "'$http_host \"$request\" $status $body_bytes_sent '\n" - "'\"$http_referer\" \"$http_user_agent\"';\n") - - if self.app.pargs.hhvm: - if platform.architecture()[0] is '32bit': - Log.error(self, "HHVM is not supported by 32bit system") - Log.debug(self, "Setting apt_packages variable for HHVM") - if not EEAptGet.is_installed(self, 'hhvm'): - apt_packages = apt_packages + EEVariables.ee_hhvm - - if os.path.isdir("/etc/nginx/common") and (not - os.path.isfile("/etc/nginx/common/php-hhvm.conf")): - data = dict() - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/php-hhvm.conf') - ee_nginx = open('/etc/nginx/common/php-hhvm.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'php-hhvm.mustache', - out=ee_nginx) - ee_nginx.close() - - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/w3tc-hhvm.conf') - ee_nginx = open('/etc/nginx/common/w3tc-hhvm.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'w3tc-hhvm.mustache', out=ee_nginx) - ee_nginx.close() - - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/wpfc-hhvm.conf') - ee_nginx = open('/etc/nginx/common/wpfc-hhvm.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'wpfc-hhvm.mustache', - out=ee_nginx) - ee_nginx.close() - - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/wpsc-hhvm.conf') - ee_nginx = open('/etc/nginx/common/wpsc-hhvm.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'wpsc-hhvm.mustache', - out=ee_nginx) - ee_nginx.close() - - if os.path.isfile("/etc/nginx/conf.d/upstream.conf"): - if not EEFileUtils.grep(self, "/etc/nginx/conf.d/upstream.conf", - "hhvm"): - with open("/etc/nginx/conf.d/upstream.conf", "a") as hhvm_file: - hhvm_file.write("upstream hhvm {\nserver 127.0.0.1:8000;\n" - "server 127.0.0.1:9000 backup;\n}\n") - - if self.app.pargs.php7: - if (EEVariables.ee_platform_codename == 'wheezy' or EEVariables.ee_platform_codename == 'precise'): - Log.error(self,"PHP 7.0 is not supported in your Platform") - - Log.debug(self, "Setting apt_packages variable for PHP 7.0") - if not EEAptGet.is_installed(self, 'php7.0-fpm'): - apt_packages = apt_packages + EEVariables.ee_php7_0 + EEVariables.ee_php_extra - - if os.path.isdir("/etc/nginx/common") and (not - os.path.isfile("/etc/nginx/common/php7.conf")): - data = dict() - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/locations-php7.conf') - ee_nginx = open('/etc/nginx/common/locations-php7.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'locations-php7.mustache', - out=ee_nginx) - ee_nginx.close() - - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/php7.conf') - ee_nginx = open('/etc/nginx/common/php7.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'php7.mustache', - out=ee_nginx) - ee_nginx.close() - - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/w3tc-php7.conf') - ee_nginx = open('/etc/nginx/common/w3tc-php7.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'w3tc-php7.mustache', out=ee_nginx) - ee_nginx.close() - - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/wpcommon-php7.conf') - ee_nginx = open('/etc/nginx/common/wpcommon-php7.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'wpcommon-php7.mustache', - out=ee_nginx) - ee_nginx.close() - - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/wpfc-php7.conf') - ee_nginx = open('/etc/nginx/common/wpfc-php7.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'wpfc-php7.mustache', - out=ee_nginx) - ee_nginx.close() - - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/wpsc-php7.conf') - ee_nginx = open('/etc/nginx/common/wpsc-php7.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'wpsc-php7.mustache', - out=ee_nginx) - ee_nginx.close() - - if os.path.isfile("/etc/nginx/nginx.conf") and (not - os.path.isfile("/etc/nginx/common/redis-php7.conf")): - data = dict() - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/redis-php7.conf') - ee_nginx = open('/etc/nginx/common/redis-php7.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'redis-php7.mustache', - out=ee_nginx) - ee_nginx.close() - - if os.path.isfile("/etc/nginx/conf.d/upstream.conf"): - if not EEFileUtils.grep(self, "/etc/nginx/conf.d/upstream.conf", - "php7"): - with open("/etc/nginx/conf.d/upstream.conf", "a") as php_file: - php_file.write("upstream php7 {\nserver 127.0.0.1:9070;\n}\n" - "upstream debug7 {\nserver 127.0.0.1:9170;\n}\n") - - - # Check if Nginx is allready installed and Pagespeed config there or not - # If not then copy pagespeed config -# if self.app.pargs.pagespeed: -# if (os.path.isfile('/etc/nginx/nginx.conf') and -# (not os.path.isfile('/etc/nginx/conf.d/pagespeed.conf'))): - # Pagespeed configuration -# data = dict() -# Log.debug(self, 'Writting the Pagespeed Global ' -# 'configuration to file /etc/nginx/conf.d/' -# 'pagespeed.conf') -# ee_nginx = open('/etc/nginx/conf.d/pagespeed.conf', -# encoding='utf-8', mode='w') -# self.app.render((data), 'pagespeed-global.mustache', -# out=ee_nginx) -# ee_nginx.close() - - return(stack.install(apt_packages=apt_packages, packages=packages, - disp_msg=False)) - - -def updatewpuserpassword(self, ee_domain, ee_site_webroot): - - ee_wp_user = '' - ee_wp_pass = '' - EEFileUtils.chdir(self, '{0}/htdocs/'.format(ee_site_webroot)) - - # Check if ee_domain is wordpress install - try: - is_wp = EEShellExec.cmd_exec(self, "wp --allow-root core" - " version") - except CommandExecutionError as e: - raise SiteError("is WordPress site? check command failed ") - - # Exit if ee_domain is not wordpress install - if not is_wp: - Log.error(self, "{0} does not seem to be a WordPress site" - .format(ee_domain)) - - try: - ee_wp_user = input("Provide WordPress user name [admin]: ") - except Exception as e: - Log.debug(self, "{0}".format(e)) - Log.error(self, "\nCould not update password") - - if ee_wp_user == "?": - Log.info(self, "Fetching WordPress user list") - try: - EEShellExec.cmd_exec(self, "wp --allow-root user list " - "--fields=user_login | grep -v user_login") - except CommandExecutionError as e: - raise SiteError("fetch wp userlist command failed") - - if not ee_wp_user: - ee_wp_user = 'admin' - - try: - is_user_exist = EEShellExec.cmd_exec(self, "wp --allow-root user list " - "--fields=user_login | grep {0}$ " - .format(ee_wp_user)) - except CommandExecutionError as e: - raise SiteError("if wp user exists check command failed") - - if is_user_exist: - try: - ee_wp_pass = getpass.getpass(prompt="Provide password for " - "{0} user: " - .format(ee_wp_user)) - - while not ee_wp_pass: - ee_wp_pass = getpass.getpass(prompt="Provide password for " - "{0} user: " - .format(ee_wp_user)) - except Exception as e: - Log.debug(self, "{0}".format(e)) - raise SiteError("failed to read password input ") - - try: - EEShellExec.cmd_exec(self, "wp --allow-root user update {0}" - " --user_pass={1}" - .format(ee_wp_user, ee_wp_pass)) - except CommandExecutionError as e: - raise SiteError("wp user password update command failed") - Log.info(self, "Password updated successfully") - - else: - Log.error(self, "Invalid WordPress user {0} for {1}." - .format(ee_wp_user, ee_domain)) - - -def display_cache_settings(self, data): - if data['wpsc']: - if data['multisite']: - Log.info(self, "Configure WPSC:" - "\t\thttp://{0}/wp-admin/network/settings.php?" - "page=wpsupercache" - .format(data['site_name'])) - else: - Log.info(self, "Configure WPSC:" - "\t\thttp://{0}/wp-admin/options-general.php?" - "page=wpsupercache" - .format(data['site_name'])) - - if data['wpredis']: - if data['multisite']: - Log.info(self, "Configure redis-cache:" - "\thttp://{0}/wp-admin/network/settings.php?" - "page=redis-cache".format(data['site_name'])) - else: - Log.info(self, "Configure redis-cache:" - "\thttp://{0}/wp-admin/options-general.php?" - "page=redis-cache".format(data['site_name'])) - Log.info(self, "Object Cache:\t\tEnable") - - if data['wpfc'] or data['w3tc']: - if data['multisite']: - Log.info(self, "Configure W3TC:" - "\t\thttp://{0}/wp-admin/network/admin.php?" - "page=w3tc_general".format(data['site_name'])) - else: - Log.info(self, "Configure W3TC:" - "\t\thttp://{0}/wp-admin/admin.php?" - "page=w3tc_general".format(data['site_name'])) - - if data['wpfc']: - Log.info(self, "Page Cache:\t\tDisable") - elif data['w3tc']: - Log.info(self, "Page Cache:\t\tDisk Enhanced") - Log.info(self, "Database Cache:\t\tMemcached") - Log.info(self, "Object Cache:\t\tMemcached") - Log.info(self, "Browser Cache:\t\tDisable") - - -def logwatch(self, logfiles): - import zlib - import base64 - import time - from ee.core import logwatch - - def callback(filename, lines): - for line in lines: - if line.find(':::') == -1: - print(line) - else: - data = line.split(':::') - try: - print(data[0], data[1], - zlib.decompress(base64.decodestring(data[2]))) - except Exception as e: - Log.info(time.time(), - 'caught exception rendering a new log line in %s' - % filename) - - l = logwatch.LogWatcher(logfiles, callback) - l.loop() - - -def detSitePar(opts): - """ - Takes dictionary of parsed arguments - 1.returns sitetype and cachetype - 2. raises RuntimeError when wrong combination is used like - "--wp --wpsubdir" or "--html --wp" - """ - sitetype, cachetype = '', '' - typelist = list() - cachelist = list() - for key, val in opts.items(): - if val and key in ['html', 'php', 'mysql', 'wp', - 'wpsubdir', 'wpsubdomain','php7']: - typelist.append(key) - elif val and key in ['wpfc', 'wpsc', 'w3tc', 'wpredis']: - cachelist.append(key) - - if len(typelist) > 1 or len(cachelist) > 1: - if len(cachelist) > 1: - raise RuntimeError("Could not determine cache type.Multiple cache parameter entered") - elif False not in [x in ('php','mysql','html') for x in typelist]: - sitetype = 'mysql' - if not cachelist: - cachetype = 'basic' - else: - cachetype = cachelist[0] - elif False not in [x in ('php7','mysql','html') for x in typelist]: - sitetype = 'mysql' - if not cachelist: - cachetype = 'basic' - else: - cachetype = cachelist[0] - elif False not in [x in ('php','mysql') for x in typelist]: - sitetype = 'mysql' - if not cachelist: - cachetype = 'basic' - else: - cachetype = cachelist[0] - elif False not in [x in ('php7','mysql') for x in typelist]: - sitetype = 'mysql' - if not cachelist: - cachetype = 'basic' - else: - cachetype = cachelist[0] - elif False not in [x in ('html','mysql') for x in typelist]: - sitetype = 'mysql' - if not cachelist: - cachetype = 'basic' - else: - cachetype = cachelist[0] - elif False not in [x in ('php','html') for x in typelist]: - sitetype = 'php' - if not cachelist: - cachetype = 'basic' - else: - cachetype = cachelist[0] - elif False not in [x in ('php7','html') for x in typelist]: - sitetype = 'php7' - if not cachelist: - cachetype = 'basic' - else: - cachetype = cachelist[0] - elif False not in [x in ('wp','wpsubdir') for x in typelist]: - sitetype = 'wpsubdir' - if not cachelist: - cachetype = 'basic' - else: - cachetype = cachelist[0] - elif False not in [x in ('wp','wpsubdomain') for x in typelist]: - sitetype = 'wpsubdomain' - if not cachelist: - cachetype = 'basic' - else: - cachetype = cachelist[0] - elif False not in [x in ('wp','php7') for x in typelist]: - sitetype = 'wp' - if not cachelist: - cachetype = 'basic' - else: - cachetype = cachelist[0] - elif False not in [x in ('wpsubdir','php7') for x in typelist]: - sitetype = 'wpsubdir' - if not cachelist: - cachetype = 'basic' - else: - cachetype = cachelist[0] - elif False not in [x in ('wpsubdomain','php7') for x in typelist]: - sitetype = 'wpsubdomain' - if not cachelist: - cachetype = 'basic' - else: - cachetype = cachelist[0] - else: - raise RuntimeError("could not determine site and cache type") - else: - if not typelist and not cachelist: - sitetype = None - cachetype = None - elif (not typelist or "php7" in typelist) and cachelist: - sitetype = 'wp' - cachetype = cachelist[0] - elif typelist and (not cachelist): - sitetype = typelist[0] - cachetype = 'basic' - else: - sitetype = typelist[0] - cachetype = cachelist[0] - - return (sitetype, cachetype) - - -def generate_random(): - ee_random10 = (''.join(random.sample(string.ascii_uppercase + - string.ascii_lowercase + string.digits, 10))) - return ee_random10 - - -def deleteDB(self, dbname, dbuser, dbhost, exit=True): - try: - # Check if Database exists - try: - if EEMysql.check_db_exists(self, dbname): - # Drop database if exists - Log.debug(self, "dropping database `{0}`".format(dbname)) - EEMysql.execute(self, - "drop database `{0}`".format(dbname), - errormsg='Unable to drop database {0}' - .format(dbname)) - except StatementExcecutionError as e: - Log.debug(self, "drop database failed") - Log.info(self, "Database {0} not dropped".format(dbname)) - - except MySQLConnectionError as e: - Log.debug(self, "Mysql Connection problem occured") - - if dbuser != 'root': - Log.debug(self, "dropping user `{0}`".format(dbuser)) - try: - EEMysql.execute(self, - "drop user `{0}`@`{1}`" - .format(dbuser, dbhost)) - except StatementExcecutionError as e: - Log.debug(self, "drop database user failed") - Log.info(self, "Database {0} not dropped".format(dbuser)) - try: - EEMysql.execute(self, "flush privileges") - except StatementExcecutionError as e: - Log.debug(self, "drop database failed") - Log.info(self, "Database {0} not dropped".format(dbname)) - except Exception as e: - Log.error(self, "Error occured while deleting database", exit) - - -def deleteWebRoot(self, webroot): - # do some preprocessing before proceeding - webroot = webroot.strip() - if (webroot == "/var/www/" or webroot == "/var/www" - or webroot == "/var/www/.." or webroot == "/var/www/."): - Log.debug(self, "Tried to remove {0}, but didn't remove it" - .format(webroot)) - return False - - if os.path.isdir(webroot): - Log.debug(self, "Removing {0}".format(webroot)) - EEFileUtils.rm(self, webroot) - return True - else: - Log.debug(self, "{0} does not exist".format(webroot)) - return False - - -def removeNginxConf(self, domain): - if os.path.isfile('/etc/nginx/sites-available/{0}' - .format(domain)): - Log.debug(self, "Removing Nginx configuration") - EEFileUtils.rm(self, '/etc/nginx/sites-enabled/{0}' - .format(domain)) - EEFileUtils.rm(self, '/etc/nginx/sites-available/{0}' - .format(domain)) - EEService.reload_service(self, 'nginx') - EEGit.add(self, ["/etc/nginx"], - msg="Deleted {0} " - .format(domain)) - - -def doCleanupAction(self, domain='', webroot='', dbname='', dbuser='', - dbhost=''): - """ - Removes the nginx configuration and database for the domain provided. - doCleanupAction(self, domain='sitename', webroot='', - dbname='', dbuser='', dbhost='') - """ - if domain: - if os.path.isfile('/etc/nginx/sites-available/{0}' - .format(domain)): - removeNginxConf(self, domain) - if webroot: - deleteWebRoot(self, webroot) - - if dbname: - if not dbuser: - raise SiteError("dbuser not provided") - if not dbhost: - raise SiteError("dbhost not provided") - deleteDB(self, dbname, dbuser, dbhost) - -def cloneLetsEncrypt(self): - letsencrypt_repo = "https://github.com/letsencrypt/letsencrypt" - if not os.path.isdir("/opt"): - EEFileUtils.mkdir(self,"/opt") - try: - Log.info(self, "Downloading {0:20}".format("LetsEncrypt"), end=' ') - EEFileUtils.chdir(self, '/opt/') - EEShellExec.cmd_exec(self, "git clone {0}".format(letsencrypt_repo)) - Log.info(self, "{0}".format("[" + Log.ENDC + "Done" - + Log.OKBLUE + "]")) - return True - except Exception as e: - Log.debug(self, "[{err}]".format(err=str(e.reason))) - Log.error(self, "Unable to download file, LetsEncrypt") - return False - -def setupLetsEncrypt(self, ee_domain_name): - ee_wp_email = EEVariables.ee_email - while not ee_wp_email: - try: - ee_wp_email = input('Enter WordPress email: ') - except EOFError as e: - Log.debug(self, "{0}".format(e)) - raise SiteError("input WordPress username failed") - - if not os.path.isdir("/opt/letsencrypt"): - cloneLetsEncrypt(self) - EEFileUtils.chdir(self, '/opt/letsencrypt') - EEShellExec.cmd_exec(self, "git pull") - - if os.path.isfile("/etc/letsencrypt/renewal/{0}.conf".format(ee_domain_name)): - Log.debug(self, "LetsEncrypt SSL Certificate found for the domain {0}" - .format(ee_domain_name)) - ssl= archivedCertificateHandle(self,ee_domain_name,ee_wp_email) - else: - Log.warn(self,"Please Wait while we fetch SSL Certificate for your site.\nIt may take time depending upon network.") - ssl = EEShellExec.cmd_exec(self, "./letsencrypt-auto certonly --webroot -w /var/www/{0}/htdocs/ -d {0} -d www.{0} " - .format(ee_domain_name) - + "--email {0} --text --agree-tos".format(ee_wp_email)) - if ssl: - Log.info(self, "Let's Encrypt successfully setup for your site") - Log.info(self, "Your certificate and chain have been saved at " - "/etc/letsencrypt/live/{0}/fullchain.pem".format(ee_domain_name)) - Log.info(self, "Configuring Nginx SSL configuration") - - try: - Log.info(self, "Adding /var/www/{0}/conf/nginx/ssl.conf".format(ee_domain_name)) - - sslconf = open("/var/www/{0}/conf/nginx/ssl.conf" - .format(ee_domain_name), - encoding='utf-8', mode='w') - sslconf.write("listen 443 ssl http2;\n" - "ssl on;\n" - "ssl_certificate /etc/letsencrypt/live/{0}/fullchain.pem;\n" - "ssl_certificate_key /etc/letsencrypt/live/{0}/privkey.pem;\n" - .format(ee_domain_name)) - sslconf.close() - # updateSiteInfo(self, ee_domain_name, ssl=True) - - EEGit.add(self, ["/etc/letsencrypt"], - msg="Adding letsencrypt folder") - - except IOError as e: - Log.debug(self, str(e)) - Log.debug(self, "Error occured while generating " - "ssl.conf") - else: - Log.error(self, "Unable to setup, Let\'s Encrypt", False) - Log.error(self, "Please make sure that your site is pointed to \n" - "same server on which you are running Let\'s Encrypt Client " - "\n to allow it to verify the site automatically.") - -def renewLetsEncrypt(self, ee_domain_name): - - ee_wp_email = EEVariables.ee_email - while not ee_wp_email: - try: - ee_wp_email = input('Enter email address: ') - except EOFError as e: - Log.debug(self, "{0}".format(e)) - raise SiteError("Input WordPress email failed") - - if not os.path.isdir("/opt/letsencrypt"): - cloneLetsEncrypt(self) - EEFileUtils.chdir(self, '/opt/letsencrypt') - EEShellExec.cmd_exec(self, "git pull") - - Log.info(self, "Renewing SSl cert for https://{0}".format(ee_domain_name)) - - ssl = EEShellExec.cmd_exec(self, "./letsencrypt-auto --renew-by-default certonly --webroot -w /var/www/{0}/htdocs/ -d {0} -d www.{0} " - .format(ee_domain_name) - + "--email {0} --text --agree-tos".format(ee_wp_email)) - mail_list = '' - if not ssl: - Log.error(self,"ERROR : Cannot RENEW SSL cert !",False) - if (SSL.getExpirationDays(self,ee_domain_name)>0): - Log.error(self, "Your current cert will expire within " + str(SSL.getExpirationDays(self,ee_domain_name)) + " days.",False) - else: - Log.error(self, "Your current cert already EXPIRED !",False) - - EESendMail("easyengine@{0}".format(ee_domain_name), ee_wp_email, "[FAIL] SSL cert renewal {0}".format(ee_domain_name), - "Hey Hi,\n\nSSL Certificate renewal for https://{0} was unsuccessful.".format(ee_domain_name) + - "\nPlease check easyengine log for reason. Your SSL Expiry date : " + - str(SSL.getExpirationDate(self,ee_domain_name)) + - "\n\nFor support visit https://easyengine.io/support/ .\n\nYour's faithfully,\nEasyEngine",files=mail_list, - port=25, isTls=False) - Log.error(self, "Check logs for reason " - "`tail /var/log/ee/ee.log` & Try Again!!!") - - EEGit.add(self, ["/etc/letsencrypt"], - msg="Adding letsencrypt folder") - EESendMail("easyengine@{0}".format(ee_domain_name), ee_wp_email, "[SUCCESS] SSL cert renewal {0}".format(ee_domain_name), - "Hey Hi,\n\nYour SSL Certificate has been renewed for https://{0} .".format(ee_domain_name) + - "\nYour SSL will Expire on : " + - str(SSL.getExpirationDate(self,ee_domain_name)) + - "\n\nYour's faithfully,\nEasyEngine",files=mail_list, - port=25, isTls=False) - -#redirect= False to disable https redirection -def httpsRedirect(self,ee_domain_name,redirect=True): - if redirect: - if os.path.isfile("/etc/nginx/conf.d/force-ssl-{0}.conf.disabled".format(ee_domain_name)): - EEFileUtils.mvfile(self, "/etc/nginx/conf.d/force-ssl-{0}.conf.disabled".format(ee_domain_name), - "/etc/nginx/conf.d/force-ssl-{0}.conf".format(ee_domain_name)) - else: - try: - Log.info(self, "Adding /etc/nginx/conf.d/force-ssl-{0}.conf".format(ee_domain_name)) - - sslconf = open("/etc/nginx/conf.d/force-ssl-{0}.conf" - .format(ee_domain_name), - encoding='utf-8', mode='w') - sslconf.write("server {\n" - "\tlisten 80;\n" + - "\tserver_name www.{0} {0};\n".format(ee_domain_name) + - "\treturn 301 https://{0}".format(ee_domain_name)+"$request_uri;\n}" ) - sslconf.close() - # Nginx Configation into GIT - except IOError as e: - Log.debug(self, str(e)) - Log.debug(self, "Error occured while generating " - "/etc/nginx/conf.d/force-ssl-{0}.conf".format(ee_domain_name)) - - Log.info(self, "Added HTTPS Force Redirection for Site " - " http://{0}".format(ee_domain_name)) - EEGit.add(self, - ["/etc/nginx"], msg="Adding /etc/nginx/conf.d/force-ssl-{0}.conf".format(ee_domain_name)) - else: - if os.path.isfile("/etc/nginx/conf.d/force-ssl-{0}.conf".format(ee_domain_name)): - EEFileUtils.mvfile(self, "/etc/nginx/conf.d/force-ssl-{0}.conf".format(ee_domain_name), - "/etc/nginx/conf.d/force-ssl-{0}.conf.disabled".format(ee_domain_name)) - Log.info(self, "Disabled HTTPS Force Redirection for Site " - " http://{0}".format(ee_domain_name)) - -def archivedCertificateHandle(self,domain,ee_wp_email): - Log.warn(self,"You already have an existing certificate for the domain requested.\n" - "(ref: /etc/letsencrypt/renewal/{0}.conf)".format(domain) + - "\nPlease select an option from below?" - "\n\t1: Reinstall existing certificate" - "\n\t2: Keep the existing certificate for now" - "\n\t3: Renew & replace the certificate (limit ~5 per 7 days)" - "") - check_prompt = input("\nType the appropriate number [1-3] or any other key to cancel: ") - if not os.path.isfile("/etc/letsencrypt/live/{0}/cert.pem".format(domain)): - Log.error(self,"/etc/letsencrypt/live/{0}/cert.pem file is missing.".format(domain)) - if check_prompt == "1": - Log.info(self,"Please Wait while we reinstall SSL Certificate for your site.\nIt may take time depending upon network.") - ssl = EEShellExec.cmd_exec(self, "./letsencrypt-auto certonly --reinstall --webroot -w /var/www/{0}/htdocs/ -d {0} -d www.{0} " - .format(domain) - + "--email {0} --text --agree-tos".format(ee_wp_email)) - elif check_prompt == "2" : - Log.info(self,"Using Existing Certificate files") - if not (os.path.isfile("/etc/letsencrypt/live/{0}/fullchain.pem".format(domain)) or - os.path.isfile("/etc/letsencrypt/live/{0}/privkey.pem".format(domain))): - Log.error(self,"Certificate files not found. Skipping.\n" - "Please check if following file exist\n\t/etc/letsencrypt/live/{0}/fullchain.pem\n\t" - "/etc/letsencrypt/live/{0}/privkey.pem".format(domain)) - ssl = True - - elif check_prompt == "3": - Log.info(self,"Please Wait while we renew SSL Certificate for your site.\nIt may take time depending upon network.") - ssl = EEShellExec.cmd_exec(self, "./letsencrypt-auto --renew-by-default certonly --webroot -w /var/www/{0}/htdocs/ -d {0} -d www.{0} " - .format(domain) - + "--email {0} --text --agree-tos".format(ee_wp_email)) - else: - Log.error(self,"Operation cancelled by user.") - - if os.path.isfile("{0}/conf/nginx/ssl.conf" - .format(domain)): - Log.info(self, "Existing ssl.conf . Backing it up ..") - EEFileUtils.mvfile(self, "/var/www/{0}/conf/nginx/ssl.conf" - .format(domain), - '/var/www/{0}/conf/nginx/ssl.conf.bak' - .format(domain)) - - return ssl diff --git a/ee/cli/plugins/sitedb.py b/ee/cli/plugins/sitedb.py deleted file mode 100644 index b3cca14e0..000000000 --- a/ee/cli/plugins/sitedb.py +++ /dev/null @@ -1,129 +0,0 @@ -from sqlalchemy import Column, DateTime, String, Integer, Boolean -from sqlalchemy import ForeignKey, func -from sqlalchemy.orm import relationship, backref -from sqlalchemy.ext.declarative import declarative_base -from ee.core.logging import Log -from ee.core.database import db_session -from ee.cli.plugins.models import SiteDB -import sys -import glob - - -def addNewSite(self, site, stype, cache, path, - enabled=True, ssl=False, fs='ext4', db='mysql', - db_name=None, db_user=None, db_password=None, - db_host='localhost', hhvm=0, pagespeed=0, php_version='5.5'): - """ - Add New Site record information into ee database. - """ - try: - newRec = SiteDB(site, stype, cache, path, enabled, ssl, fs, db, - db_name, db_user, db_password, db_host, hhvm, - pagespeed, php_version) - db_session.add(newRec) - db_session.commit() - except Exception as e: - Log.debug(self, "{0}".format(e)) - Log.error(self, "Unable to add site to database") - - -def getSiteInfo(self, site): - """ - Retrieves site record from ee databse - """ - try: - q = SiteDB.query.filter(SiteDB.sitename == site).first() - return q - except Exception as e: - Log.debug(self, "{0}".format(e)) - Log.error(self, "Unable to query database for site info") - - -def updateSiteInfo(self, site, stype='', cache='', webroot='', - enabled=True, ssl=False, fs='', db='', db_name=None, - db_user=None, db_password=None, db_host=None, hhvm=None, - pagespeed=None, php_version=''): - """updates site record in database""" - try: - q = SiteDB.query.filter(SiteDB.sitename == site).first() - except Exception as e: - Log.debug(self, "{0}".format(e)) - Log.error(self, "Unable to query database for site info") - - if not q: - Log.error(self, "{0} does not exist in database".format(site)) - - # Check if new record matches old if not then only update database - if stype and q.site_type != stype: - q.site_type = stype - - if cache and q.cache_type != cache: - q.cache_type = cache - - if q.is_enabled != enabled: - q.is_enabled = enabled - - if q.is_ssl != ssl: - q.is_ssl = ssl - - if db_name and q.db_name != db_name: - q.db_name = db_name - - if db_user and q.db_user != db_user: - q.db_user = db_user - - if db_user and q.db_password != db_password: - q.db_password = db_password - - if db_host and q.db_host != db_host: - q.db_host = db_host - - if webroot and q.site_path != webroot: - q.site_path = webroot - - if (hhvm is not None) and (q.is_hhvm is not hhvm): - q.is_hhvm = hhvm - - if (pagespeed is not None) and (q.is_pagespeed is not pagespeed): - q.is_pagespeed = pagespeed - - if php_version and q.php_version != php_version: - q.php_version = php_version - - try: - q.created_on = func.now() - db_session.commit() - except Exception as e: - Log.debug(self, "{0}".format(e)) - Log.error(self, "Unable to update site info in application database.") - - -def deleteSiteInfo(self, site): - """Delete site record in database""" - try: - q = SiteDB.query.filter(SiteDB.sitename == site).first() - except Exception as e: - Log.debug(self, "{0}".format(e)) - Log.error(self, "Unable to query database") - - if not q: - Log.error(self, "{0} does not exist in database".format(site)) - - try: - db_session.delete(q) - db_session.commit() - except Exception as e: - Log.debug(self, "{0}".format(e)) - Log.error(self, "Unable to delete site from application database.") - - -def getAllsites(self): - """ - 1. returns all records from ee database - """ - try: - q = SiteDB.query.all() - return q - except Exception as e: - Log.debug(self, "{0}".format(e)) - Log.error(self, "Unable to query database") diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py deleted file mode 100644 index 6fa39a0d2..000000000 --- a/ee/cli/plugins/stack.py +++ /dev/null @@ -1,2794 +0,0 @@ -"""Stack Plugin for EasyEngine.""" - -from cement.core.controller import CementBaseController, expose -from cement.core import handler, hook -from ee.cli.plugins.site_functions import * -from ee.core.variables import EEVariables -from ee.core.aptget import EEAptGet -from ee.core.download import EEDownload -from ee.core.shellexec import EEShellExec, CommandExecutionError -from ee.core.fileutils import EEFileUtils -from ee.core.apt_repo import EERepo -from ee.core.extract import EEExtract -from ee.core.mysql import EEMysql -from ee.core.addswap import EESwap -from ee.core.git import EEGit -from ee.core.checkfqdn import check_fqdn -from pynginxconfig import NginxConfig -from ee.core.services import EEService -from ee.core.variables import EEVariables -import random -import string -import configparser -import time -import shutil -import os -import pwd -import grp -import codecs -import platform -from ee.cli.plugins.stack_services import EEStackStatusController -from ee.cli.plugins.stack_migrate import EEStackMigrateController -from ee.cli.plugins.stack_upgrade import EEStackUpgradeController -from ee.core.logging import Log -from ee.cli.plugins.sitedb import * - - -def ee_stack_hook(app): - # do something with the ``app`` object here. - pass - - -class EEStackController(CementBaseController): - class Meta: - label = 'stack' - stacked_on = 'base' - stacked_type = 'nested' - description = 'Stack command manages stack operations' - arguments = [ - (['--all'], - dict(help='Install all stack', action='store_true')), - (['--web'], - dict(help='Install web stack', action='store_true')), - (['--admin'], - dict(help='Install admin tools stack', action='store_true')), - (['--mail'], - dict(help='Install mail server stack', action='store_true')), - (['--mailscanner'], - dict(help='Install mail scanner stack', action='store_true')), - (['--nginx'], - dict(help='Install Nginx stack', action='store_true')), -# (['--nginxmainline'], -# dict(help='Install Nginx mainline stack', action='store_true')), - (['--php'], - dict(help='Install PHP stack', action='store_true')), - (['--php7'], - dict(help='Install PHP 7.0 stack', action='store_true')), - (['--mysql'], - dict(help='Install MySQL stack', action='store_true')), - (['--hhvm'], - dict(help='Install HHVM stack', action='store_true')), - (['--postfix'], - dict(help='Install Postfix stack', action='store_true')), - (['--wpcli'], - dict(help='Install WPCLI stack', action='store_true')), - (['--phpmyadmin'], - dict(help='Install PHPMyAdmin stack', action='store_true')), - (['--adminer'], - dict(help='Install Adminer stack', action='store_true')), - (['--utils'], - dict(help='Install Utils stack', action='store_true')), - (['--pagespeed'], - dict(help='Install Pagespeed', action='store_true')), - (['--redis'], - dict(help='Install Redis', action='store_true')), - (['--phpredisadmin'], - dict(help='Install phpRedisAdmin', action='store_true')), - ] - usage = "ee stack (command) [options]" - - @expose(hide=True) - def default(self): - """default action of ee stack command""" - if self.app.pargs.pagespeed: - Log.error(self, "Pagespeed support has been dropped since EasyEngine v3.6.0",False) - Log.error(self, "Please run command again without `--pagespeed`",False) - Log.error(self, "For more details, read - https://easyengine.io/blog/disabling-pagespeed/") - else: - self.app.args.print_help() - - @expose(hide=True) - def pre_pref(self, apt_packages): - """Pre settings to do before installation packages""" - if set(EEVariables.ee_postfix).issubset(set(apt_packages)): - Log.debug(self, "Pre-seeding Postfix") - try: - EEShellExec.cmd_exec(self, "echo \"postfix postfix" - "/main_mailer_type string \'Internet Site" - "\'\"" - " | debconf-set-selections") - EEShellExec.cmd_exec(self, "echo \"postfix postfix/mailname" - " string $(hostname -f)\" | " - "debconf-set-selections") - except CommandExecutionError as e: - Log.error(self, "Failed to intialize postfix package") - - if set(EEVariables.ee_mysql).issubset(set(apt_packages)): - Log.info(self, "Adding repository for MySQL, please wait...") - mysql_pref = ("Package: *\nPin: origin sfo1.mirrors.digitalocean.com" - "\nPin-Priority: 1000\n") - with open('/etc/apt/preferences.d/' - 'MariaDB.pref', 'w') as mysql_pref_file: - mysql_pref_file.write(mysql_pref) - EERepo.add(self, repo_url=EEVariables.ee_mysql_repo) - Log.debug(self, 'Adding key for {0}' - .format(EEVariables.ee_mysql_repo)) - EERepo.add_key(self, '0xcbcb082a1bb943db', - keyserver="keyserver.ubuntu.com") - EERepo.add_key(self, '0xF1656F24C74CD1D8', - keyserver="keyserver.ubuntu.com") - chars = ''.join(random.sample(string.ascii_letters, 8)) - Log.debug(self, "Pre-seeding MySQL") - Log.debug(self, "echo \"mariadb-server-10.1 " - "mysql-server/root_password " - "password \" | " - "debconf-set-selections") - try: - EEShellExec.cmd_exec(self, "echo \"mariadb-server-10.1 " - "mysql-server/root_password " - "password {chars}\" | " - "debconf-set-selections" - .format(chars=chars), - log=False) - except CommandExecutionError as e: - Log.error("Failed to initialize MySQL package") - - Log.debug(self, "echo \"mariadb-server-10.1 " - "mysql-server/root_password_again " - "password \" | " - "debconf-set-selections") - try: - EEShellExec.cmd_exec(self, "echo \"mariadb-server-10.1 " - "mysql-server/root_password_again " - "password {chars}\" | " - "debconf-set-selections" - .format(chars=chars), - log=False) - except CommandExecutionError as e: - Log.error("Failed to initialize MySQL package") - - mysql_config = """ - [client] - user = root - password = {chars} - """.format(chars=chars) - config = configparser.ConfigParser() - config.read_string(mysql_config) - Log.debug(self, 'Writting configuration into MySQL file') - conf_path = "/etc/mysql/conf.d/my.cnf" - os.makedirs(os.path.dirname(conf_path), exist_ok=True) - with open(conf_path, encoding='utf-8', - mode='w') as configfile: - config.write(configfile) - Log.debug(self, 'Setting my.cnf permission') - EEFileUtils.chmod(self, "/etc/mysql/conf.d/my.cnf", 0o600) - - if set(EEVariables.ee_nginx).issubset(set(apt_packages)): - Log.info(self, "Adding repository for NGINX, please wait...") - EERepo.add(self, repo_url=EEVariables.ee_nginx_repo) - Log.debug(self, 'Adding ppa of Nginx') - EERepo.add_key(self, EEVariables.ee_nginx_key) - - if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic'): - if set(EEVariables.ee_php7_0).issubset(set(apt_packages)) \ - or set(EEVariables.ee_php5_6).issubset(set(apt_packages)): - Log.info(self, "Adding repository for PHP, please wait...") - Log.debug(self, 'Adding ppa for PHP') - EERepo.add(self, ppa=EEVariables.ee_php_repo) - else: - if set(EEVariables.ee_php).issubset(set(apt_packages)): - Log.info(self, "Adding repository for PHP, please wait...") - # Add repository for php - if EEVariables.ee_platform_distro == 'debian': - if EEVariables.ee_platform_codename != 'jessie': - Log.debug(self, 'Adding repo_url of php for debian') - EERepo.add(self, repo_url=EEVariables.ee_php_repo) - Log.debug(self, 'Adding Dotdeb/php GPG key') - EERepo.add_key(self, '89DF5277') - else: - Log.debug(self, 'Adding ppa for PHP') - EERepo.add(self, ppa=EEVariables.ee_php_repo) - - if EEVariables.ee_platform_codename == 'jessie': - if set(EEVariables.ee_php7_0).issubset(set(apt_packages)): - Log.debug(self, 'Adding repo_url of php 7.0 for debian') - EERepo.add(self, repo_url=EEVariables.ee_php_repo) - Log.debug(self, 'Adding Dotdeb/php GPG key') - EERepo.add_key(self, '89DF5277') - - if set(EEVariables.ee_hhvm).issubset(set(apt_packages)): - if (EEVariables.ee_platform_codename != 'xenial' or EEVariables.ee_platform_codename != 'bionic'): - Log.info(self, "Adding repository for HHVM, please wait...") - if EEVariables.ee_platform_codename == 'precise': - Log.debug(self, 'Adding PPA for Boost') - EERepo.add(self, ppa=EEVariables.ee_boost_repo) - Log.debug(self, 'Adding ppa repo for HHVM') - EERepo.add(self, repo_url=EEVariables.ee_hhvm_repo) - Log.debug(self, 'Adding HHVM GPG Key') - EERepo.add_key(self, '0x5a16e7281be7a449') - else: - Log.info(self, "Using default Ubuntu repository for HHVM") - - if set(EEVariables.ee_mail).issubset(set(apt_packages)): - Log.debug(self, 'Executing the command debconf-set-selections.') - try: - EEShellExec.cmd_exec(self, "echo \"dovecot-core dovecot-core/" - "create-ssl-cert boolean yes\" " - "| debconf-set-selections") - EEShellExec.cmd_exec(self, "echo \"dovecot-core dovecot-core" - "/ssl-cert-name string $(hostname -f)\"" - " | debconf-set-selections") - except CommandExecutionError as e: - Log.error("Failed to initialize dovecot packages") - - if set(EEVariables.ee_redis).issubset(set(apt_packages)): - Log.info(self, "Adding repository for Redis, please wait...") - if EEVariables.ee_platform_distro == 'debian': - Log.debug(self, 'Adding repo_url of redis for debian') - EERepo.add(self, repo_url=EEVariables.ee_redis_repo) - Log.debug(self, 'Adding Dotdeb GPG key') - EERepo.add_key(self, '89DF5277') - else: - Log.debug(self, 'Adding ppa for redis') - EERepo.add(self, ppa=EEVariables.ee_redis_repo) - - @expose(hide=True) - def post_pref(self, apt_packages, packages): - """Post activity after installation of packages""" - if len(apt_packages): - if set(EEVariables.ee_postfix).issubset(set(apt_packages)): - EEGit.add(self, ["/etc/postfix"], - msg="Adding Postfix into Git") - EEService.reload_service(self, 'postfix') - - if set(EEVariables.ee_nginx).issubset(set(apt_packages)): - if set(["nginx-plus"]).issubset(set(apt_packages)) or set(["nginx"]).issubset(set(apt_packages)): - # Fix for white screen death with NGINX PLUS - if not EEFileUtils.grep(self, '/etc/nginx/fastcgi_params', - 'SCRIPT_FILENAME'): - with open('/etc/nginx/fastcgi_params', encoding='utf-8', - mode='a') as ee_nginx: - ee_nginx.write('fastcgi_param \tSCRIPT_FILENAME ' - '\t$request_filename;\n') - - if not (os.path.isfile('/etc/nginx/common/wpfc.conf')): - # Change EasyEngine Version in nginx.conf file - EEFileUtils.searchreplace(self, "/etc/nginx/nginx.conf", - "# add_header", - "add_header") - - EEFileUtils.searchreplace(self, "/etc/nginx/nginx.conf", - "\"EasyEngine\"", - "\"EasyEngine {0}\"" - .format(EEVariables.ee_version)) - data = dict() - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/conf.d/blockips.conf') - ee_nginx = open('/etc/nginx/conf.d/blockips.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'blockips.mustache', out=ee_nginx) - ee_nginx.close() - - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/conf.d/fastcgi.conf') - ee_nginx = open('/etc/nginx/conf.d/fastcgi.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'fastcgi.mustache', out=ee_nginx) - ee_nginx.close() - - data = dict(php="9000", debug="9001", hhvm="8000",php7="9070",debug7="9170", - hhvmconf=False, php7conf= True if EEAptGet.is_installed(self,'php7.0-fpm') else False ) - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/conf.d/upstream.conf') - ee_nginx = open('/etc/nginx/conf.d/upstream.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'upstream.mustache', out=ee_nginx) - ee_nginx.close() - - # Setup Nginx common directory - if not os.path.exists('/etc/nginx/common'): - Log.debug(self, 'Creating directory' - '/etc/nginx/common') - os.makedirs('/etc/nginx/common') - - # http2 = ("http2" if set(["nginx-mainline"]).issubset(set(apt_packages)) else "spdy") - data = dict(webroot=EEVariables.ee_webroot) - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/acl.conf') - ee_nginx = open('/etc/nginx/common/acl.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'acl.mustache', - out=ee_nginx) - ee_nginx.close() - - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/locations.conf') - ee_nginx = open('/etc/nginx/common/locations.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'locations.mustache', - out=ee_nginx) - ee_nginx.close() - - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/php.conf') - ee_nginx = open('/etc/nginx/common/php.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'php.mustache', - out=ee_nginx) - ee_nginx.close() - - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/w3tc.conf') - ee_nginx = open('/etc/nginx/common/w3tc.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'w3tc.mustache', - out=ee_nginx) - ee_nginx.close() - - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/wpcommon.conf') - ee_nginx = open('/etc/nginx/common/wpcommon.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'wpcommon.mustache', - out=ee_nginx) - ee_nginx.close() - - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/wpfc.conf') - ee_nginx = open('/etc/nginx/common/wpfc.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'wpfc.mustache', - out=ee_nginx) - ee_nginx.close() - - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/wpsc.conf') - ee_nginx = open('/etc/nginx/common/wpsc.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'wpsc.mustache', - out=ee_nginx) - ee_nginx.close() - - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/wpsubdir.conf') - ee_nginx = open('/etc/nginx/common/wpsubdir.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'wpsubdir.mustache', - out=ee_nginx) - ee_nginx.close() - - #php7 conf - if (EEVariables.ee_platform_codename == 'jessie' or EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic') and (not - os.path.isfile("/etc/nginx/common/php7.conf")): - #data = dict() - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/locations-php7.conf') - ee_nginx = open('/etc/nginx/common/locations-php7.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'locations-php7.mustache', - out=ee_nginx) - ee_nginx.close() - - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/php7.conf') - ee_nginx = open('/etc/nginx/common/php7.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'php7.mustache', - out=ee_nginx) - ee_nginx.close() - - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/w3tc-php7.conf') - ee_nginx = open('/etc/nginx/common/w3tc-php7.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'w3tc-php7.mustache', out=ee_nginx) - ee_nginx.close() - - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/wpcommon-php7.conf') - ee_nginx = open('/etc/nginx/common/wpcommon-php7.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'wpcommon-php7.mustache', - out=ee_nginx) - ee_nginx.close() - - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/wpfc-php7.conf') - ee_nginx = open('/etc/nginx/common/wpfc-php7.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'wpfc-php7.mustache', - out=ee_nginx) - ee_nginx.close() - - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/wpsc-php7.conf') - ee_nginx = open('/etc/nginx/common/wpsc-php7.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'wpsc-php7.mustache', - out=ee_nginx) - ee_nginx.close() - - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/redis-php7.conf') - ee_nginx = open('/etc/nginx/common/redis-php7.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'redis-php7.mustache', - out=ee_nginx) - ee_nginx.close() - - # Nginx-Plus does not have nginx package structure like this - # So creating directories - if set(["nginx-plus"]).issubset(set(apt_packages)) or set(["nginx"]).issubset(set(apt_packages)): - Log.info(self, - "Installing EasyEngine Configurations for" "NGINX") - if not os.path.exists('/etc/nginx/sites-available'): - Log.debug(self, 'Creating directory' - '/etc/nginx/sites-available') - os.makedirs('/etc/nginx/sites-available') - - if not os.path.exists('/etc/nginx/sites-enabled'): - Log.debug(self, 'Creating directory' - '/etc/nginx/sites-available') - os.makedirs('/etc/nginx/sites-enabled') - - # 22222 port settings - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/sites-available/' - '22222') - ee_nginx = open('/etc/nginx/sites-available/22222', - encoding='utf-8', mode='w') - self.app.render((data), '22222.mustache', - out=ee_nginx) - ee_nginx.close() - - passwd = ''.join([random.choice - (string.ascii_letters + string.digits) - for n in range(6)]) - try: - EEShellExec.cmd_exec(self, "printf \"easyengine:" - "$(openssl passwd -crypt " - "{password} 2> /dev/null)\n\"" - "> /etc/nginx/htpasswd-ee " - "2>/dev/null" - .format(password=passwd)) - except CommandExecutionError as e: - Log.error(self, "Failed to save HTTP Auth") - - # Create Symbolic link for 22222 - EEFileUtils.create_symlink(self, ['/etc/nginx/' - 'sites-available/' - '22222', - '/etc/nginx/' - 'sites-enabled/' - '22222']) - # Create log and cert folder and softlinks - if not os.path.exists('{0}22222/logs' - .format(EEVariables.ee_webroot)): - Log.debug(self, "Creating directory " - "{0}22222/logs " - .format(EEVariables.ee_webroot)) - os.makedirs('{0}22222/logs' - .format(EEVariables.ee_webroot)) - - if not os.path.exists('{0}22222/cert' - .format(EEVariables.ee_webroot)): - Log.debug(self, "Creating directory " - "{0}22222/cert" - .format(EEVariables.ee_webroot)) - os.makedirs('{0}22222/cert' - .format(EEVariables.ee_webroot)) - - EEFileUtils.create_symlink(self, ['/var/log/nginx/' - '22222.access.log', - '{0}22222/' - 'logs/access.log' - .format(EEVariables.ee_webroot)] - ) - - EEFileUtils.create_symlink(self, ['/var/log/nginx/' - '22222.error.log', - '{0}22222/' - 'logs/error.log' - .format(EEVariables.ee_webroot)] - ) - - try: - EEShellExec.cmd_exec(self, "openssl genrsa -out " - "{0}22222/cert/22222.key 2048" - .format(EEVariables.ee_webroot)) - EEShellExec.cmd_exec(self, "openssl req -new -batch " - "-subj /commonName=127.0.0.1/ " - "-key {0}22222/cert/22222.key " - "-out {0}22222/cert/" - "22222.csr" - .format(EEVariables.ee_webroot)) - - EEFileUtils.mvfile(self, "{0}22222/cert/22222.key" - .format(EEVariables.ee_webroot), - "{0}22222/cert/" - "22222.key.org" - .format(EEVariables.ee_webroot)) - - EEShellExec.cmd_exec(self, "openssl rsa -in " - "{0}22222/cert/" - "22222.key.org -out " - "{0}22222/cert/22222.key" - .format(EEVariables.ee_webroot)) - - EEShellExec.cmd_exec(self, "openssl x509 -req -days " - "3652 -in {0}22222/cert/" - "22222.csr -signkey {0}" - "22222/cert/22222.key -out " - "{0}22222/cert/22222.crt" - .format(EEVariables.ee_webroot)) - - except CommandExecutionError as e: - Log.error(self, "Failed to generate SSL for 22222") - - # Nginx Configation into GIT - EEGit.add(self, - ["/etc/nginx"], msg="Adding Nginx into Git") - EEService.reload_service(self, 'nginx') - if set(["nginx-plus"]).issubset(set(apt_packages)) or set(["nginx"]).issubset(set(apt_packages)): - EEShellExec.cmd_exec(self, "sed -i -e 's/^user/#user/'" - " -e '/^#user/a user" - "\ www-data\;'" - " /etc/nginx/nginx.conf") - if not EEShellExec.cmd_exec(self, "cat /etc/nginx/" - "nginx.conf | grep -q " - "'/etc/nginx/sites-enabled'"): - EEShellExec.cmd_exec(self, "sed -i '/\/etc\/" - "nginx\/conf\.d\/\*" - "\.conf/a \ include" - "\ \/etc\/nginx\/sites-enabled" - "\/*;' /etc/nginx/nginx.conf") - - # EasyEngine config for NGINX plus - data['version'] = EEVariables.ee_version - Log.debug(self, 'Writting for nginx plus configuration' - ' to file /etc/nginx/conf.d/ee-plus.conf') - ee_nginx = open('/etc/nginx/conf.d/ee-plus.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'ee-plus.mustache', - out=ee_nginx) - ee_nginx.close() - - print("HTTP Auth User Name: easyengine" - + "\nHTTP Auth Password : {0}".format(passwd)) - EEService.reload_service(self, 'nginx') - else: - self.msg = (self.msg + ["HTTP Auth User Name: easyengine"] - + ["HTTP Auth Password : {0}".format(passwd)]) - else: - EEService.restart_service(self, 'nginx') - - if EEAptGet.is_installed(self,'redis-server'): - if os.path.isfile("/etc/nginx/nginx.conf") and (not - os.path.isfile("/etc/nginx/common/redis.conf")): - - data = dict() - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/redis.conf') - ee_nginx = open('/etc/nginx/common/redis.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'redis.mustache', - out=ee_nginx) - ee_nginx.close() - - if os.path.isfile("/etc/nginx/nginx.conf") and (not - os.path.isfile("/etc/nginx/common/redis-hhvm.conf")): - - data = dict() - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/redis-hhvm.conf') - ee_nginx = open('/etc/nginx/common/redis-hhvm.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'redis-hhvm.mustache', - out=ee_nginx) - ee_nginx.close() - - if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic'): - if os.path.isfile("/etc/nginx/nginx.conf") and (not - os.path.isfile("/etc/nginx/common/redis-php7.conf")): - data = dict() - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/redis-php7.conf') - ee_nginx = open('/etc/nginx/common/redis-php7.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'redis-php7.mustache', - out=ee_nginx) - ee_nginx.close() - - if os.path.isfile("/etc/nginx/conf.d/upstream.conf"): - if not EEFileUtils.grep(self, "/etc/nginx/conf.d/" - "upstream.conf", - "redis"): - with open("/etc/nginx/conf.d/upstream.conf", - "a") as redis_file: - redis_file.write("upstream redis {\n" - " server 127.0.0.1:6379;\n" - " keepalive 10;\n}\n") - - if os.path.isfile("/etc/nginx/nginx.conf") and (not - os.path.isfile("/etc/nginx/conf.d/redis.conf")): - with open("/etc/nginx/conf.d/redis.conf", "a") as redis_file: - redis_file.write("# Log format Settings\n" - "log_format rt_cache_redis '$remote_addr $upstream_response_time $srcache_fetch_status [$time_local] '\n" - "'$http_host \"$request\" $status $body_bytes_sent '\n" - "'\"$http_referer\" \"$http_user_agent\"';\n") - #setup nginx common folder for php7 - if self.app.pargs.php7: - if os.path.isdir("/etc/nginx/common") and (not - os.path.isfile("/etc/nginx/common/php7.conf")): - data = dict() - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/locations-php7.conf') - ee_nginx = open('/etc/nginx/common/locations-php7.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'locations-php7.mustache', - out=ee_nginx) - ee_nginx.close() - - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/php7.conf') - ee_nginx = open('/etc/nginx/common/php7.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'php7.mustache', - out=ee_nginx) - ee_nginx.close() - - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/w3tc-php7.conf') - ee_nginx = open('/etc/nginx/common/w3tc-php7.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'w3tc-php7.mustache', out=ee_nginx) - ee_nginx.close() - - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/wpcommon-php7.conf') - ee_nginx = open('/etc/nginx/common/wpcommon-php7.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'wpcommon-php7.mustache', - out=ee_nginx) - ee_nginx.close() - - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/wpfc-php7.conf') - ee_nginx = open('/etc/nginx/common/wpfc-php7.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'wpfc-php7.mustache', - out=ee_nginx) - ee_nginx.close() - - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/wpsc-php7.conf') - ee_nginx = open('/etc/nginx/common/wpsc-php7.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'wpsc-php7.mustache', - out=ee_nginx) - ee_nginx.close() - - if os.path.isdir("/etc/nginx/common") and (not os.path.isfile("/etc/nginx/common/redis-php7.conf")): - data = dict() - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/redis-php7.conf') - ee_nginx = open('/etc/nginx/common/redis-php7.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'redis-php7.mustache', - out=ee_nginx) - ee_nginx.close() - - if os.path.isfile("/etc/nginx/conf.d/upstream.conf"): - if not EEFileUtils.grep(self, "/etc/nginx/conf.d/upstream.conf", - "php7"): - with open("/etc/nginx/conf.d/upstream.conf", "a") as php_file: - php_file.write("upstream php7 {\nserver 127.0.0.1:9070;\n}\n" - "upstream debug7 {\nserver 127.0.0.1:9170;\n}\n") - - # Set up pagespeed config - if self.app.pargs.pagespeed: - if (os.path.isfile('/etc/nginx/nginx.conf') and - (not os.path.isfile('/etc/nginx/conf.d/pagespeed.conf'))): - # Pagespeed configuration - data = dict() - Log.debug(self, 'Writting the Pagespeed Global ' - 'configuration to file /etc/nginx/conf.d/' - 'pagespeed.conf') - ee_nginx = open('/etc/nginx/conf.d/pagespeed.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'pagespeed-global.mustache', - out=ee_nginx) - ee_nginx.close() - - if set(EEVariables.ee_hhvm).issubset(set(apt_packages)): - - EEShellExec.cmd_exec(self, "update-rc.d hhvm defaults") - - EEFileUtils.searchreplace(self, "/etc/hhvm/server.ini", - "9000", "8000") - if (EEVariables.ee_platform_codename != 'xenial' or EEVariables.ee_platform_codename != 'bionic'): - EEFileUtils.searchreplace(self, "/etc/nginx/hhvm.conf", - "9000", "8000") - - with open("/etc/hhvm/php.ini", "a") as hhvm_file: - hhvm_file.write("hhvm.log.header = true\n" - "hhvm.log.natives_stack_trace = true\n" - "hhvm.mysql.socket = " - "/var/run/mysqld/mysqld.sock\n" - "hhvm.pdo_mysql.socket = " - "/var/run/mysqld/mysqld.sock\n" - "hhvm.mysqli.socket = " - "/var/run/mysqld/mysqld.sock\n") - - with open("/etc/hhvm/server.ini", "a") as hhvm_file: - hhvm_file.write("hhvm.server.ip = 127.0.0.1\n") - - if os.path.isfile("/etc/nginx/conf.d/fastcgi.conf"): - if not EEFileUtils.grep(self, "/etc/nginx/conf.d/" - "fastcgi.conf", - "fastcgi_keep_conn"): - with open("/etc/nginx/conf.d/fastcgi.conf", - "a") as hhvm_file: - hhvm_file.write("fastcgi_keep_conn on;\n") - - if os.path.isfile("/etc/nginx/conf.d/upstream.conf"): - if not EEFileUtils.grep(self, "/etc/nginx/conf.d/" - "upstream.conf", - "hhvm"): - with open("/etc/nginx/conf.d/upstream.conf", - "a") as hhvm_file: - hhvm_file.write("upstream hhvm {\nserver " - "127.0.0.1:8000;\n" - "server 127.0.0.1:9000 backup;\n}" - "\n") - - EEGit.add(self, ["/etc/hhvm"], msg="Adding HHVM into Git") - EEService.restart_service(self, 'hhvm') - - if os.path.isfile("/etc/nginx/nginx.conf") and (not - os.path.isfile("/etc/nginx/common/php-hhvm.conf")): - - data = dict() - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/php-hhvm.conf') - ee_nginx = open('/etc/nginx/common/php-hhvm.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'php-hhvm.mustache', - out=ee_nginx) - ee_nginx.close() - - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/w3tc-hhvm.conf') - ee_nginx = open('/etc/nginx/common/w3tc-hhvm.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'w3tc-hhvm.mustache', - out=ee_nginx) - ee_nginx.close() - - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/wpfc-hhvm.conf') - ee_nginx = open('/etc/nginx/common/wpfc-hhvm.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'wpfc-hhvm.mustache', - out=ee_nginx) - ee_nginx.close() - - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/wpsc-hhvm.conf') - ee_nginx = open('/etc/nginx/common/wpsc-hhvm.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'wpsc-hhvm.mustache', - out=ee_nginx) - ee_nginx.close() - - if not EEService.reload_service(self, 'nginx'): - Log.error(self, "Failed to reload Nginx, please check " - "output of `nginx -t`") - - if set(EEVariables.ee_redis).issubset(set(apt_packages)): - if os.path.isfile("/etc/nginx/nginx.conf") and (not - os.path.isfile("/etc/nginx/common/redis.conf")): - - data = dict() - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/redis.conf') - ee_nginx = open('/etc/nginx/common/redis.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'redis.mustache', - out=ee_nginx) - ee_nginx.close() - - if os.path.isfile("/etc/nginx/nginx.conf") and (not - os.path.isfile("/etc/nginx/common/redis-hhvm.conf")): - - data = dict() - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/redis-hhvm.conf') - ee_nginx = open('/etc/nginx/common/redis-hhvm.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'redis-hhvm.mustache', - out=ee_nginx) - ee_nginx.close() - - if os.path.isfile("/etc/nginx/conf.d/upstream.conf"): - if not EEFileUtils.grep(self, "/etc/nginx/conf.d/" - "upstream.conf", - "redis"): - with open("/etc/nginx/conf.d/upstream.conf", - "a") as redis_file: - redis_file.write("upstream redis {\n" - " server 127.0.0.1:6379;\n" - " keepalive 10;\n}\n") - - if os.path.isfile("/etc/nginx/nginx.conf") and (not - os.path.isfile("/etc/nginx/conf.d/redis.conf")): - with open("/etc/nginx/conf.d/redis.conf", "a") as redis_file: - redis_file.write("# Log format Settings\n" - "log_format rt_cache_redis '$remote_addr $upstream_response_time $srcache_fetch_status [$time_local] '\n" - "'$http_host \"$request\" $status $body_bytes_sent '\n" - "'\"$http_referer\" \"$http_user_agent\"';\n") - - if (EEVariables.ee_platform_distro == 'debian' or EEVariables.ee_platform_codename == 'precise') and set(EEVariables.ee_php).issubset(set(apt_packages)): - # Create log directories - if not os.path.exists('/var/log/php5/'): - Log.debug(self, 'Creating directory /var/log/php5/') - os.makedirs('/var/log/php5/') - - # For debian install xdebug - - if (EEVariables.ee_platform_distro == "debian" and - EEVariables.ee_platform_codename == 'wheezy'): - EEShellExec.cmd_exec(self, "pecl install xdebug") - - with open("/etc/php5/mods-available/xdebug.ini", - encoding='utf-8', mode='a') as myfile: - myfile.write("zend_extension=/usr/lib/php5/20131226/" - "xdebug.so\n") - - EEFileUtils.create_symlink(self, ["/etc/php5/" - "mods-available/xdebug.ini", - "/etc/php5/fpm/conf.d" - "/20-xedbug.ini"]) - - # Parse etc/php5/fpm/php.ini - config = configparser.ConfigParser() - Log.debug(self, "configuring php file /etc/php5/fpm/php.ini") - config.read('/etc/php5/fpm/php.ini') - config['PHP']['expose_php'] = 'Off' - config['PHP']['post_max_size'] = '100M' - config['PHP']['upload_max_filesize'] = '100M' - config['PHP']['max_execution_time'] = '300' - config['PHP']['date.timezone'] = EEVariables.ee_timezone - with open('/etc/php5/fpm/php.ini', - encoding='utf-8', mode='w') as configfile: - Log.debug(self, "Writting php configuration into " - "/etc/php5/fpm/php.ini") - config.write(configfile) - - #configure /etc/php5/fpm/php-fpm.conf - data = dict(pid="/run/php5-fpm.pid", error_log="/var/log/php5/fpm.log", - include="/etc/php5/fpm/pool.d/*.conf") - Log.debug(self, "writting php configuration into " - "/etc/php5/fpm/php-fpm.conf") - ee_php_fpm = open('/etc/php5/fpm/php-fpm.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'php-fpm.mustache', out=ee_php_fpm) - ee_php_fpm.close() - - - # Parse /etc/php5/fpm/pool.d/www.conf - config = configparser.ConfigParser() - config.read_file(codecs.open('/etc/php5/fpm/pool.d/www.conf', - "r", "utf8")) - config['www']['ping.path'] = '/ping' - config['www']['pm.status_path'] = '/status' - config['www']['pm.max_requests'] = '500' - config['www']['pm.max_children'] = '100' - config['www']['pm.start_servers'] = '20' - config['www']['pm.min_spare_servers'] = '10' - config['www']['pm.max_spare_servers'] = '30' - config['www']['request_terminate_timeout'] = '300' - config['www']['pm'] = 'ondemand' - config['www']['listen'] = '127.0.0.1:9000' - with codecs.open('/etc/php5/fpm/pool.d/www.conf', - encoding='utf-8', mode='w') as configfile: - Log.debug(self, "writting PHP5 configuration into " - "/etc/php5/fpm/pool.d/www.conf") - config.write(configfile) - - # Generate /etc/php5/fpm/pool.d/debug.conf - EEFileUtils.copyfile(self, "/etc/php5/fpm/pool.d/www.conf", - "/etc/php5/fpm/pool.d/debug.conf") - EEFileUtils.searchreplace(self, "/etc/php5/fpm/pool.d/" - "debug.conf", "[www]", "[debug]") - config = configparser.ConfigParser() - config.read('/etc/php5/fpm/pool.d/debug.conf') - config['debug']['listen'] = '127.0.0.1:9001' - config['debug']['rlimit_core'] = 'unlimited' - config['debug']['slowlog'] = '/var/log/php5/slow.log' - config['debug']['request_slowlog_timeout'] = '10s' - with open('/etc/php5/fpm/pool.d/debug.conf', - encoding='utf-8', mode='w') as confifile: - Log.debug(self, "writting PHP5 configuration into " - "/etc/php5/fpm/pool.d/debug.conf") - config.write(confifile) - - with open("/etc/php5/fpm/pool.d/debug.conf", - encoding='utf-8', mode='a') as myfile: - myfile.write("php_admin_value[xdebug.profiler_output_dir] " - "= /tmp/ \nphp_admin_value[xdebug.profiler_" - "output_name] = cachegrind.out.%p-%H-%R " - "\nphp_admin_flag[xdebug.profiler_enable" - "_trigger] = on \nphp_admin_flag[xdebug." - "profiler_enable] = off\n") - - # Disable xdebug - EEFileUtils.searchreplace(self, "/etc/php5/mods-available/" - "xdebug.ini", - "zend_extension", - ";zend_extension") - - # PHP and Debug pull configuration - if not os.path.exists('{0}22222/htdocs/fpm/status/' - .format(EEVariables.ee_webroot)): - Log.debug(self, 'Creating directory ' - '{0}22222/htdocs/fpm/status/ ' - .format(EEVariables.ee_webroot)) - os.makedirs('{0}22222/htdocs/fpm/status/' - .format(EEVariables.ee_webroot)) - open('{0}22222/htdocs/fpm/status/debug' - .format(EEVariables.ee_webroot), - encoding='utf-8', mode='a').close() - open('{0}22222/htdocs/fpm/status/php' - .format(EEVariables.ee_webroot), - encoding='utf-8', mode='a').close() - - # Write info.php - if not os.path.exists('{0}22222/htdocs/php/' - .format(EEVariables.ee_webroot)): - Log.debug(self, 'Creating directory ' - '{0}22222/htdocs/php/ ' - .format(EEVariables.ee_webroot)) - os.makedirs('{0}22222/htdocs/php' - .format(EEVariables.ee_webroot)) - - with open("{0}22222/htdocs/php/info.php" - .format(EEVariables.ee_webroot), - encoding='utf-8', mode='w') as myfile: - myfile.write("<?php\nphpinfo();\n?>") - - EEFileUtils.chown(self, "{0}22222" - .format(EEVariables.ee_webroot), - EEVariables.ee_php_user, - EEVariables.ee_php_user, recursive=True) - - EEGit.add(self, ["/etc/php5"], msg="Adding PHP into Git") - EEService.restart_service(self, 'php5-fpm') - - - if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic') and set(EEVariables.ee_php5_6).issubset(set(apt_packages)): - # Create log directories - if not os.path.exists('/var/log/php/5.6/'): - Log.debug(self, 'Creating directory /var/log/php/5.6/') - os.makedirs('/var/log/php/5.6/') - - # Parse etc/php/5.6/fpm/php.ini - config = configparser.ConfigParser() - Log.debug(self, "configuring php file /etc/php/5.6/fpm/php.ini") - config.read('/etc/php/5.6/fpm/php.ini') - config['PHP']['expose_php'] = 'Off' - config['PHP']['post_max_size'] = '100M' - config['PHP']['upload_max_filesize'] = '100M' - config['PHP']['max_execution_time'] = '300' - config['PHP']['date.timezone'] = EEVariables.ee_timezone - with open('/etc/php/5.6/fpm/php.ini', - encoding='utf-8', mode='w') as configfile: - Log.debug(self, "Writting php configuration into " - "/etc/php/5.6/fpm/php.ini") - config.write(configfile) - - # Parse /etc/php/5.6/fpm/php-fpm.conf - data = dict(pid="/run/php/php5.6-fpm.pid", error_log="/var/log/php/5.6/fpm.log", - include="/etc/php/5.6/fpm/pool.d/*.conf") - Log.debug(self, "writting php5 configuration into " - "/etc/php/5.6/fpm/php-fpm.conf") - ee_php_fpm = open('/etc/php/5.6/fpm/php-fpm.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'php-fpm.mustache', out=ee_php_fpm) - ee_php_fpm.close() - - # Parse /etc/php/5.6/fpm/pool.d/www.conf - config = configparser.ConfigParser() - config.read_file(codecs.open('/etc/php/5.6/fpm/pool.d/www.conf', - "r", "utf8")) - config['www']['ping.path'] = '/ping' - config['www']['pm.status_path'] = '/status' - config['www']['pm.max_requests'] = '500' - config['www']['pm.max_children'] = '100' - config['www']['pm.start_servers'] = '20' - config['www']['pm.min_spare_servers'] = '10' - config['www']['pm.max_spare_servers'] = '30' - config['www']['request_terminate_timeout'] = '300' - config['www']['pm'] = 'ondemand' - config['www']['listen'] = '127.0.0.1:9000' - with codecs.open('/etc/php/5.6/fpm/pool.d/www.conf', - encoding='utf-8', mode='w') as configfile: - Log.debug(self, "writting PHP5 configuration into " - "/etc/php/5.6/fpm/pool.d/www.conf") - config.write(configfile) - - # Generate /etc/php/5.6/fpm/pool.d/debug.conf - EEFileUtils.copyfile(self, "/etc/php/5.6/fpm/pool.d/www.conf", - "/etc/php/5.6/fpm/pool.d/debug.conf") - EEFileUtils.searchreplace(self, "/etc/php/5.6/fpm/pool.d/" - "debug.conf", "[www]", "[debug]") - config = configparser.ConfigParser() - config.read('/etc/php/5.6/fpm/pool.d/debug.conf') - config['debug']['listen'] = '127.0.0.1:9001' - config['debug']['rlimit_core'] = 'unlimited' - config['debug']['slowlog'] = '/var/log/php/5.6/slow.log' - config['debug']['request_slowlog_timeout'] = '10s' - with open('/etc/php/5.6/fpm/pool.d/debug.conf', - encoding='utf-8', mode='w') as confifile: - Log.debug(self, "writting PHP5 configuration into " - "/etc/php/5.6/fpm/pool.d/debug.conf") - config.write(confifile) - - with open("/etc/php/5.6/fpm/pool.d/debug.conf", - encoding='utf-8', mode='a') as myfile: - myfile.write("php_admin_value[xdebug.profiler_output_dir] " - "= /tmp/ \nphp_admin_value[xdebug.profiler_" - "output_name] = cachegrind.out.%p-%H-%R " - "\nphp_admin_flag[xdebug.profiler_enable" - "_trigger] = on \nphp_admin_flag[xdebug." - "profiler_enable] = off\n") - - # Disable xdebug - if not EEShellExec.cmd_exec(self, "grep -q \';zend_extension\' /etc/php/5.6/mods-available/xdebug.ini"): - EEFileUtils.searchreplace(self, "/etc/php/5.6/mods-available/" - "xdebug.ini", - "zend_extension", - ";zend_extension") - - # PHP and Debug pull configuration - if not os.path.exists('{0}22222/htdocs/fpm/status/' - .format(EEVariables.ee_webroot)): - Log.debug(self, 'Creating directory ' - '{0}22222/htdocs/fpm/status/ ' - .format(EEVariables.ee_webroot)) - os.makedirs('{0}22222/htdocs/fpm/status/' - .format(EEVariables.ee_webroot)) - open('{0}22222/htdocs/fpm/status/debug' - .format(EEVariables.ee_webroot), - encoding='utf-8', mode='a').close() - open('{0}22222/htdocs/fpm/status/php' - .format(EEVariables.ee_webroot), - encoding='utf-8', mode='a').close() - - # Write info.php - if not os.path.exists('{0}22222/htdocs/php/' - .format(EEVariables.ee_webroot)): - Log.debug(self, 'Creating directory ' - '{0}22222/htdocs/php/ ' - .format(EEVariables.ee_webroot)) - os.makedirs('{0}22222/htdocs/php' - .format(EEVariables.ee_webroot)) - - with open("{0}22222/htdocs/php/info.php" - .format(EEVariables.ee_webroot), - encoding='utf-8', mode='w') as myfile: - myfile.write("<?php\nphpinfo();\n?>") - - EEFileUtils.chown(self, "{0}22222" - .format(EEVariables.ee_webroot), - EEVariables.ee_php_user, - EEVariables.ee_php_user, recursive=True) - - EEGit.add(self, ["/etc/php"], msg="Adding PHP into Git") - EEService.restart_service(self, 'php5.6-fpm') - - #PHP7.0 configuration for debian - if (EEVariables.ee_platform_codename == 'jessie' ) and set(EEVariables.ee_php7_0).issubset(set(apt_packages)): - # Create log directories - if not os.path.exists('/var/log/php/7.0/'): - Log.debug(self, 'Creating directory /var/log/php/7.0/') - os.makedirs('/var/log/php/7.0/') - - # Parse etc/php/7.0/fpm/php.ini - config = configparser.ConfigParser() - Log.debug(self, "configuring php file /etc/php/7.0/fpm/php.ini") - config.read('/etc/php/7.0/fpm/php.ini') - config['PHP']['expose_php'] = 'Off' - config['PHP']['post_max_size'] = '100M' - config['PHP']['upload_max_filesize'] = '100M' - config['PHP']['max_execution_time'] = '300' - config['PHP']['date.timezone'] = EEVariables.ee_timezone - with open('/etc/php/7.0/fpm/php.ini', - encoding='utf-8', mode='w') as configfile: - Log.debug(self, "Writting php configuration into " - "/etc/php/7.0/fpm/php.ini") - config.write(configfile) - - # Parse /etc/php/7.0/fpm/php-fpm.conf - data = dict(pid="/run/php/php7.0-fpm.pid", error_log="/var/log/php7.0-fpm.log", - include="/etc/php/7.0/fpm/pool.d/*.conf") - Log.debug(self, "writting php 7.0 configuration into " - "/etc/php/7.0/fpm/php-fpm.conf") - ee_php_fpm = open('/etc/php/7.0/fpm/php-fpm.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'php-fpm.mustache', out=ee_php_fpm) - ee_php_fpm.close() - - # Parse /etc/php/7.0/fpm/pool.d/www.conf - config = configparser.ConfigParser() - config.read_file(codecs.open('/etc/php/7.0/fpm/pool.d/www.conf', - "r", "utf8")) - config['www']['ping.path'] = '/ping' - config['www']['pm.status_path'] = '/status' - config['www']['pm.max_requests'] = '500' - config['www']['pm.max_children'] = '100' - config['www']['pm.start_servers'] = '20' - config['www']['pm.min_spare_servers'] = '10' - config['www']['pm.max_spare_servers'] = '30' - config['www']['request_terminate_timeout'] = '300' - config['www']['pm'] = 'ondemand' - config['www']['listen'] = '127.0.0.1:9070' - with codecs.open('/etc/php/7.0/fpm/pool.d/www.conf', - encoding='utf-8', mode='w') as configfile: - Log.debug(self, "writting PHP5 configuration into " - "/etc/php/7.0/fpm/pool.d/www.conf") - config.write(configfile) - - # Generate /etc/php/7.0/fpm/pool.d/debug.conf - EEFileUtils.copyfile(self, "/etc/php/7.0/fpm/pool.d/www.conf", - "/etc/php/7.0/fpm/pool.d/debug.conf") - EEFileUtils.searchreplace(self, "/etc/php/7.0/fpm/pool.d/" - "debug.conf", "[www]", "[debug]") - config = configparser.ConfigParser() - config.read('/etc/php/7.0/fpm/pool.d/debug.conf') - config['debug']['listen'] = '127.0.0.1:9170' - config['debug']['rlimit_core'] = 'unlimited' - config['debug']['slowlog'] = '/var/log/php/7.0/slow.log' - config['debug']['request_slowlog_timeout'] = '10s' - with open('/etc/php/7.0/fpm/pool.d/debug.conf', - encoding='utf-8', mode='w') as confifile: - Log.debug(self, "writting PHP5 configuration into " - "/etc/php/7.0/fpm/pool.d/debug.conf") - config.write(confifile) - - with open("/etc/php/7.0/fpm/pool.d/debug.conf", - encoding='utf-8', mode='a') as myfile: - myfile.write("php_admin_value[xdebug.profiler_output_dir] " - "= /tmp/ \nphp_admin_value[xdebug.profiler_" - "output_name] = cachegrind.out.%p-%H-%R " - "\nphp_admin_flag[xdebug.profiler_enable" - "_trigger] = on \nphp_admin_flag[xdebug." - "profiler_enable] = off\n") - - # Disable xdebug - if not EEShellExec.cmd_exec(self, "grep -q \';zend_extension\' /etc/php/7.0/mods-available/xdebug.ini"): - EEFileUtils.searchreplace(self, "/etc/php/7.0/mods-available/" - "xdebug.ini", - "zend_extension", - ";zend_extension") - - # PHP and Debug pull configuration - if not os.path.exists('{0}22222/htdocs/fpm/status/' - .format(EEVariables.ee_webroot)): - Log.debug(self, 'Creating directory ' - '{0}22222/htdocs/fpm/status/ ' - .format(EEVariables.ee_webroot)) - os.makedirs('{0}22222/htdocs/fpm/status/' - .format(EEVariables.ee_webroot)) - open('{0}22222/htdocs/fpm/status/debug' - .format(EEVariables.ee_webroot), - encoding='utf-8', mode='a').close() - open('{0}22222/htdocs/fpm/status/php' - .format(EEVariables.ee_webroot), - encoding='utf-8', mode='a').close() - - # Write info.php - if not os.path.exists('{0}22222/htdocs/php/' - .format(EEVariables.ee_webroot)): - Log.debug(self, 'Creating directory ' - '{0}22222/htdocs/php/ ' - .format(EEVariables.ee_webroot)) - os.makedirs('{0}22222/htdocs/php' - .format(EEVariables.ee_webroot)) - - with open("{0}22222/htdocs/php/info.php" - .format(EEVariables.ee_webroot), - encoding='utf-8', mode='w') as myfile: - myfile.write("<?php\nphpinfo();\n?>") - - EEFileUtils.chown(self, "{0}22222" - .format(EEVariables.ee_webroot), - EEVariables.ee_php_user, - EEVariables.ee_php_user, recursive=True) - - EEGit.add(self, ["/etc/php"], msg="Adding PHP into Git") - EEService.restart_service(self, 'php7.0-fpm') - - #preconfiguration for php7.0 - if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic') and set(EEVariables.ee_php7_0).issubset(set(apt_packages)): - # Create log directories - if not os.path.exists('/var/log/php/7.0/'): - Log.debug(self, 'Creating directory /var/log/php/7.0/') - os.makedirs('/var/log/php/7.0/') - - # Parse etc/php/7.0/fpm/php.ini - config = configparser.ConfigParser() - Log.debug(self, "configuring php file /etc/php/7.0/fpm/php.ini") - config.read('/etc/php/7.0/fpm/php.ini') - config['PHP']['expose_php'] = 'Off' - config['PHP']['post_max_size'] = '100M' - config['PHP']['upload_max_filesize'] = '100M' - config['PHP']['max_execution_time'] = '300' - config['PHP']['date.timezone'] = EEVariables.ee_timezone - with open('/etc/php/7.0/fpm/php.ini', - encoding='utf-8', mode='w') as configfile: - Log.debug(self, "Writting php configuration into " - "/etc/php/7.0/fpm/php.ini") - config.write(configfile) - - # Parse /etc/php/7.0/fpm/php-fpm.conf - data = dict(pid="/run/php/php7.0-fpm.pid", error_log="/var/log/php/7.0/fpm.log", - include="/etc/php/7.0/fpm/pool.d/*.conf") - Log.debug(self, "writting php 7.0 configuration into " - "/etc/php/7.0/fpm/php-fpm.conf") - ee_php_fpm = open('/etc/php/7.0/fpm/php-fpm.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'php-fpm.mustache', out=ee_php_fpm) - ee_php_fpm.close() - - # Parse /etc/php/7.0/fpm/pool.d/www.conf - config = configparser.ConfigParser() - config.read_file(codecs.open('/etc/php/7.0/fpm/pool.d/www.conf', - "r", "utf8")) - config['www']['ping.path'] = '/ping' - config['www']['pm.status_path'] = '/status' - config['www']['pm.max_requests'] = '500' - config['www']['pm.max_children'] = '100' - config['www']['pm.start_servers'] = '20' - config['www']['pm.min_spare_servers'] = '10' - config['www']['pm.max_spare_servers'] = '30' - config['www']['request_terminate_timeout'] = '300' - config['www']['pm'] = 'ondemand' - config['www']['listen'] = '127.0.0.1:9070' - with codecs.open('/etc/php/7.0/fpm/pool.d/www.conf', - encoding='utf-8', mode='w') as configfile: - Log.debug(self, "writting PHP5 configuration into " - "/etc/php/7.0/fpm/pool.d/www.conf") - config.write(configfile) - - # Generate /etc/php/7.0/fpm/pool.d/debug.conf - EEFileUtils.copyfile(self, "/etc/php/7.0/fpm/pool.d/www.conf", - "/etc/php/7.0/fpm/pool.d/debug.conf") - EEFileUtils.searchreplace(self, "/etc/php/7.0/fpm/pool.d/" - "debug.conf", "[www]", "[debug]") - config = configparser.ConfigParser() - config.read('/etc/php/7.0/fpm/pool.d/debug.conf') - config['debug']['listen'] = '127.0.0.1:9170' - config['debug']['rlimit_core'] = 'unlimited' - config['debug']['slowlog'] = '/var/log/php/7.0/slow.log' - config['debug']['request_slowlog_timeout'] = '10s' - with open('/etc/php/7.0/fpm/pool.d/debug.conf', - encoding='utf-8', mode='w') as confifile: - Log.debug(self, "writting PHP5 configuration into " - "/etc/php/7.0/fpm/pool.d/debug.conf") - config.write(confifile) - - with open("/etc/php/7.0/fpm/pool.d/debug.conf", - encoding='utf-8', mode='a') as myfile: - myfile.write("php_admin_value[xdebug.profiler_output_dir] " - "= /tmp/ \nphp_admin_value[xdebug.profiler_" - "output_name] = cachegrind.out.%p-%H-%R " - "\nphp_admin_flag[xdebug.profiler_enable" - "_trigger] = on \nphp_admin_flag[xdebug." - "profiler_enable] = off\n") - - # Disable xdebug - if not EEShellExec.cmd_exec(self, "grep -q \';zend_extension\' /etc/php/7.0/mods-available/xdebug.ini"): - EEFileUtils.searchreplace(self, "/etc/php/7.0/mods-available/" - "xdebug.ini", - "zend_extension", - ";zend_extension") - - # PHP and Debug pull configuration - if not os.path.exists('{0}22222/htdocs/fpm/status/' - .format(EEVariables.ee_webroot)): - Log.debug(self, 'Creating directory ' - '{0}22222/htdocs/fpm/status/ ' - .format(EEVariables.ee_webroot)) - os.makedirs('{0}22222/htdocs/fpm/status/' - .format(EEVariables.ee_webroot)) - open('{0}22222/htdocs/fpm/status/debug' - .format(EEVariables.ee_webroot), - encoding='utf-8', mode='a').close() - open('{0}22222/htdocs/fpm/status/php' - .format(EEVariables.ee_webroot), - encoding='utf-8', mode='a').close() - - # Write info.php - if not os.path.exists('{0}22222/htdocs/php/' - .format(EEVariables.ee_webroot)): - Log.debug(self, 'Creating directory ' - '{0}22222/htdocs/php/ ' - .format(EEVariables.ee_webroot)) - os.makedirs('{0}22222/htdocs/php' - .format(EEVariables.ee_webroot)) - - with open("{0}22222/htdocs/php/info.php" - .format(EEVariables.ee_webroot), - encoding='utf-8', mode='w') as myfile: - myfile.write("<?php\nphpinfo();\n?>") - - EEFileUtils.chown(self, "{0}22222" - .format(EEVariables.ee_webroot), - EEVariables.ee_php_user, - EEVariables.ee_php_user, recursive=True) - - EEGit.add(self, ["/etc/php"], msg="Adding PHP into Git") - EEService.restart_service(self, 'php7.0-fpm') - - - - if set(EEVariables.ee_mysql).issubset(set(apt_packages)): - # TODO: Currently we are using, we need to remove it in future - # config = configparser.ConfigParser() - # config.read('/etc/mysql/my.cnf') - # config['mysqld']['wait_timeout'] = 30 - # config['mysqld']['interactive_timeout'] = 60 - # config['mysqld']['performance_schema'] = 0 - # with open('/etc/mysql/my.cnf', 'w') as configfile: - # config.write(configfile) - if not os.path.isfile("/etc/mysql/my.cnf"): - config = ("[mysqld]\nwait_timeout = 30\n" - "interactive_timeout=60\nperformance_schema = 0" - "\nquery_cache_type = 1") - config_file = open("/etc/mysql/my.cnf", - encoding='utf-8', mode='w') - config_file.write(config) - config_file.close() - else: - try: - EEShellExec.cmd_exec(self, "sed -i \"/#max_conn" - "ections/a wait_timeout = 30 \\n" - "interactive_timeout = 60 \\n" - "performance_schema = 0\\n" - "query_cache_type = 1 \" " - "/etc/mysql/my.cnf") - except CommandExecutionError as e: - Log.error(self, "Unable to update MySQL file") - - # Set MySQLTuner permission - EEFileUtils.chmod(self, "/usr/bin/mysqltuner", 0o775) - - EEGit.add(self, ["/etc/mysql"], msg="Adding MySQL into Git") - EEService.reload_service(self, 'mysql') - - if set(EEVariables.ee_mail).issubset(set(apt_packages)): - Log.debug(self, "Adding user") - try: - EEShellExec.cmd_exec(self, "adduser --uid 5000 --home /var" - "/vmail --disabled-password --gecos " - "'' vmail") - except CommandExecutionError as e: - Log.error(self, "Unable to add vmail user for mail server") - try: - EEShellExec.cmd_exec(self, "openssl req -new -x509 -days" - " 3650 " - "-nodes -subj /commonName={hostname}" - "/emailAddress={email} -out /etc/ssl" - "/certs/dovecot." - "pem -keyout " - "/etc/ssl/private/dovecot.pem" - .format(hostname=EEVariables.ee_fqdn, - email=EEVariables.ee_email)) - except CommandExecutionError as e: - Log.error(self, "Unable to generate PEM key for dovecot") - Log.debug(self, "Setting Privileges to " - "/etc/ssl/private/dovecot.pem file ") - EEFileUtils.chmod(self, "/etc/ssl/private/dovecot.pem", 0o600) - - # Custom Dovecot configuration by EasyEngine - data = dict() - Log.debug(self, "Writting configuration into file" - "/etc/dovecot/conf.d/auth-sql.conf.ext ") - ee_dovecot = open('/etc/dovecot/conf.d/auth-sql.conf.ext', - encoding='utf-8', mode='w') - self.app.render((data), 'auth-sql-conf.mustache', - out=ee_dovecot) - ee_dovecot.close() - - data = dict(email=EEVariables.ee_email) - Log.debug(self, "Writting configuration into file" - "/etc/dovecot/conf.d/99-ee.conf ") - ee_dovecot = open('/etc/dovecot/conf.d/99-ee.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'dovecot.mustache', out=ee_dovecot) - ee_dovecot.close() - try: - EEShellExec.cmd_exec(self, "sed -i \"s/\\!include " - "auth-system.conf.ext/#\\!include " - "auth-system.conf.ext/\" " - "/etc/dovecot/conf.d/10-auth.conf") - - EEShellExec.cmd_exec(self, "sed -i \"s\'/etc/dovecot/" - "dovecot.pem\'/etc/ssl/certs/" - "dovecot.pem" - "\'\" /etc/dovecot/conf.d/" - "10-ssl.conf") - EEShellExec.cmd_exec(self, "sed -i \"s\'/etc/dovecot/" - "private/dovecot.pem\'/etc/ssl/" - "private" - "/dovecot.pem\'\" /etc/dovecot/" - "conf.d/" - "10-ssl.conf") - - # Custom Postfix configuration needed with Dovecot - # Changes in master.cf - # TODO: Find alternative for sed in Python - EEShellExec.cmd_exec(self, "sed -i \'s/#submission/" - "submission/\'" - " /etc/postfix/master.cf") - EEShellExec.cmd_exec(self, "sed -i \'s/#smtps/smtps/\'" - " /etc/postfix/master.cf") - - EEShellExec.cmd_exec(self, "postconf -e \"smtpd_sasl_type " - "= dovecot\"") - EEShellExec.cmd_exec(self, "postconf -e \"smtpd_sasl_path " - "= private/auth\"") - EEShellExec.cmd_exec(self, "postconf -e \"" - "smtpd_sasl_auth_enable = " - "yes\"") - EEShellExec.cmd_exec(self, "postconf -e \"" - " smtpd_relay_restrictions =" - " permit_sasl_authenticated, " - " permit_mynetworks, " - " reject_unauth_destination\"") - - EEShellExec.cmd_exec(self, "postconf -e \"" - "smtpd_tls_mandatory_" - "protocols = !SSLv2,!SSLv3\"") - EEShellExec.cmd_exec(self, "postconf -e \"smtp_tls_" - "mandatory_protocols = !SSLv2," - "!SSLv3\"") - EEShellExec.cmd_exec(self, "postconf -e \"smtpd_tls" - "_protocols = !SSLv2,!SSLv3\"") - EEShellExec.cmd_exec(self, "postconf -e \"smtp_tls" - "_protocols = !SSLv2,!SSLv3\"") - EEShellExec.cmd_exec(self, "postconf -e \"mydestination " - "= localhost\"") - EEShellExec.cmd_exec(self, "postconf -e \"virtual" - "_transport " - "= lmtp:unix:private/dovecot-lmtp\"") - EEShellExec.cmd_exec(self, "postconf -e \"virtual_uid_" - "maps = static:5000\"") - EEShellExec.cmd_exec(self, "postconf -e \"virtual_gid_" - "maps = static:5000\"") - EEShellExec.cmd_exec(self, "postconf -e \"" - " virtual_mailbox_domains = " - "mysql:/etc/postfix/mysql/virtual_" - "domains_maps.cf\"") - EEShellExec.cmd_exec(self, "postconf -e \"virtual_mailbox" - "_maps" - " = mysql:/etc/postfix/mysql/virtual_" - "mailbox_maps.cf\"") - EEShellExec.cmd_exec(self, "postconf -e \"virtual_alias" - "_maps " - "= mysql:/etc/postfix/mysql/virtual_" - "alias_maps.cf\"") - EEShellExec.cmd_exec(self, "openssl req -new -x509 -days " - " 3650 -nodes -subj /commonName=" - "{hostname}/emailAddress={email}" - " -out /etc/ssl/certs/postfix.pem" - " -keyout /etc/ssl/private/" - "postfix.pem" - .format(hostname=EEVariables.ee_fqdn, - email=EEVariables.ee_email)) - EEShellExec.cmd_exec(self, "chmod 0600 /etc/ssl/private" - "/postfix.pem") - EEShellExec.cmd_exec(self, "postconf -e \"smtpd_tls_cert_" - "file = /etc/ssl/certs/postfix.pem\"") - EEShellExec.cmd_exec(self, "postconf -e \"smtpd_tls_key_" - "file = /etc/ssl/private/" - "postfix.pem\"") - - except CommandExecutionError as e: - Log.Error(self, "Failed to update Dovecot configuration") - - # Sieve configuration - if not os.path.exists('/var/lib/dovecot/sieve/'): - Log.debug(self, 'Creating directory ' - '/var/lib/dovecot/sieve/ ') - os.makedirs('/var/lib/dovecot/sieve/') - - # Custom sieve configuration by EasyEngine - data = dict() - Log.debug(self, "Writting configuration of EasyEngine into " - "file /var/lib/dovecot/sieve/default.sieve") - ee_sieve = open('/var/lib/dovecot/sieve/default.sieve', - encoding='utf-8', mode='w') - self.app.render((data), 'default-sieve.mustache', - out=ee_sieve) - ee_sieve.close() - - # Compile sieve rules - Log.debug(self, "Setting Privileges to dovecot ") - # EEShellExec.cmd_exec(self, "chown -R vmail:vmail /var/lib" - # "/dovecot") - EEFileUtils.chown(self, "/var/lib/dovecot", 'vmail', 'vmail', - recursive=True) - try: - EEShellExec.cmd_exec(self, "sievec /var/lib/dovecot/" - "/sieve/default.sieve") - except CommandExecutionError as e: - raise SiteError("Failed to compile default.sieve") - - EEGit.add(self, ["/etc/postfix", "/etc/dovecot"], - msg="Installed mail server") - EEService.restart_service(self, 'dovecot') - EEService.reload_service(self, 'postfix') - - if set(EEVariables.ee_mailscanner).issubset(set(apt_packages)): - # Set up Custom amavis configuration - data = dict() - Log.debug(self, "Configuring file /etc/amavis/conf.d" - "/15-content_filter_mode") - ee_amavis = open('/etc/amavis/conf.d/15-content_filter_mode', - encoding='utf-8', mode='w') - self.app.render((data), '15-content_filter_mode.mustache', - out=ee_amavis) - ee_amavis.close() - - # Amavis ViMbadmin configuration - if os.path.isfile("/etc/postfix/mysql/virtual_alias_maps.cf"): - vm_host = os.popen("grep hosts /etc/postfix/mysql/virtual_" - "alias_maps.cf | awk \'{ print $3 }\' |" - " tr -d '\\n'").read() - vm_pass = os.popen("grep password /etc/postfix/mysql/" - "virtual_alias_maps.cf | awk \'{ print " - "$3 }\' | tr -d '\\n'").read() - - data = dict(host=vm_host, password=vm_pass) - vm_config = open('/etc/amavis/conf.d/50-user', - encoding='utf-8', mode='w') - self.app.render((data), '50-user.mustache', out=vm_config) - vm_config.close() - - # Amavis postfix configuration - try: - EEShellExec.cmd_exec(self, "postconf -e \"content_filter =" - " smtp-amavis:[127.0.0.1]:10024\"") - EEShellExec.cmd_exec(self, "sed -i \"s/1 pickup/1 " - " pickup" - "\\n -o content_filter=\\n " - " -o receive_override_options=" - "no_header_body" - "_checks/\" /etc/postfix/master.cf") - except CommandExecutionError as e: - raise SiteError("Failed to update Amavis-Postfix config") - - amavis_master = ("""smtp-amavis unix - - n - 2 smtp - -o smtp_data_done_timeout=1200 - -o smtp_send_xforward_command=yes - -o disable_dns_lookups=yes - -o max_use=20 -127.0.0.1:10025 inet n - n - - smtpd - -o content_filter= - -o smtpd_delay_reject=no - -o smtpd_client_restrictions=permit_mynetworks,reject - -o smtpd_helo_restrictions= - -o smtpd_sender_restrictions= - -o smtpd_recipient_restrictions=permit_mynetworks,reject - -o smtpd_data_restrictions=reject_unauth_pipelining - -o smtpd_end_of_data_restrictions= - -o smtpd_restriction_classes= - -o mynetworks=127.0.0.0/8 - -o smtpd_error_sleep_time=0 - -o smtpd_soft_error_limit=1001 - -o smtpd_hard_error_limit=1000 - -o smtpd_client_connection_count_limit=0 - -o smtpd_client_connection_rate_limit=0 - -o local_header_rewrite_clients=""") - - with open("/etc/postfix/master.cf", - encoding='utf-8', mode='a') as am_config: - am_config.write(amavis_master) - - try: - # Amavis ClamAV configuration - Log.debug(self, "Adding new user clamav amavis") - EEShellExec.cmd_exec(self, "adduser clamav amavis") - Log.debug(self, "Adding new user amavis clamav") - EEShellExec.cmd_exec(self, "adduser amavis clamav") - Log.debug(self, "Setting Privileges to /var/lib/amavis" - "/tmp") - EEFileUtils.chmod(self, "/var/lib/amavis/tmp", 0o755) - - # Update ClamAV database - Log.debug(self, "Updating database") - EEShellExec.cmd_exec(self, "freshclam") - except CommandExecutionError as e: - raise SiteError(" Unable to update ClamAV-Amavis config") - - EEGit.add(self, ["/etc/amavis"], msg="Adding Amavis into Git") - EEService.restart_service(self, 'dovecot') - EEService.reload_service(self, 'postfix') - EEService.restart_service(self, 'amavis') - - if len(packages): - if any('/usr/bin/wp' == x[1] for x in packages): - Log.debug(self, "Setting Privileges to /usr/bin/wp file ") - EEFileUtils.chmod(self, "/usr/bin/wp", 0o775) - - if any('/tmp/pma.tar.gz' == x[1] - for x in packages): - EEExtract.extract(self, '/tmp/pma.tar.gz', '/tmp/') - Log.debug(self, 'Extracting file /tmp/pma.tar.gz to ' - 'location /tmp/') - if not os.path.exists('{0}22222/htdocs/db' - .format(EEVariables.ee_webroot)): - Log.debug(self, "Creating new directory " - "{0}22222/htdocs/db" - .format(EEVariables.ee_webroot)) - os.makedirs('{0}22222/htdocs/db' - .format(EEVariables.ee_webroot)) - shutil.move('/tmp/phpmyadmin-STABLE/', - '{0}22222/htdocs/db/pma/' - .format(EEVariables.ee_webroot)) - shutil.copyfile('{0}22222/htdocs/db/pma/config.sample.inc.php' - .format(EEVariables.ee_webroot), - '{0}22222/htdocs/db/pma/config.inc.php' - .format(EEVariables.ee_webroot)) - Log.debug(self, 'Setting Blowfish Secret Key FOR COOKIE AUTH to ' - '{0}22222/htdocs/db/pma/config.inc.php file ' - .format(EEVariables.ee_webroot)) - blowfish_key = ''.join([random.choice - (string.ascii_letters + string.digits) - for n in range(10)]) - EEFileUtils.searchreplace(self, - '{0}22222/htdocs/db/pma/config.inc.php' - .format(EEVariables.ee_webroot), - "$cfg[\'blowfish_secret\'] = \'\';","$cfg[\'blowfish_secret\'] = \'{0}\';" - .format(blowfish_key)) - Log.debug(self, 'Setting HOST Server For Mysql to ' - '{0}22222/htdocs/db/pma/config.inc.php file ' - .format(EEVariables.ee_webroot)) - EEFileUtils.searchreplace(self, - '{0}22222/htdocs/db/pma/config.inc.php' - .format(EEVariables.ee_webroot), - "$cfg[\'Servers\'][$i][\'host\'] = \'localhost\';","$cfg[\'Servers\'][$i][\'host\'] = \'{0}\';" - .format(EEVariables.ee_mysql_host)) - Log.debug(self, 'Setting Privileges of webroot permission to ' - '{0}22222/htdocs/db/pma file ' - .format(EEVariables.ee_webroot)) - EEFileUtils.chown(self, '{0}22222' - .format(EEVariables.ee_webroot), - EEVariables.ee_php_user, - EEVariables.ee_php_user, - recursive=True) - if any('/tmp/memcache.tar.gz' == x[1] - for x in packages): - Log.debug(self, "Extracting memcache.tar.gz to location" - " {0}22222/htdocs/cache/memcache " - .format(EEVariables.ee_webroot)) - EEExtract.extract(self, '/tmp/memcache.tar.gz', - '{0}22222/htdocs/cache/memcache' - .format(EEVariables.ee_webroot)) - Log.debug(self, "Setting Privileges to " - "{0}22222/htdocs/cache/memcache file" - .format(EEVariables.ee_webroot)) - EEFileUtils.chown(self, '{0}22222' - .format(EEVariables.ee_webroot), - EEVariables.ee_php_user, - EEVariables.ee_php_user, - recursive=True) - - if any('/tmp/webgrind.tar.gz' == x[1] - for x in packages): - Log.debug(self, "Extracting file webgrind.tar.gz to " - "location /tmp/ ") - EEExtract.extract(self, '/tmp/webgrind.tar.gz', '/tmp/') - if not os.path.exists('{0}22222/htdocs/php' - .format(EEVariables.ee_webroot)): - Log.debug(self, "Creating directroy " - "{0}22222/htdocs/php" - .format(EEVariables.ee_webroot)) - os.makedirs('{0}22222/htdocs/php' - .format(EEVariables.ee_webroot)) - shutil.move('/tmp/webgrind-master/', - '{0}22222/htdocs/php/webgrind' - .format(EEVariables.ee_webroot)) - - EEFileUtils.searchreplace(self, "{0}22222/htdocs/php/webgrind/" - "config.php" - .format(EEVariables.ee_webroot), - "/usr/local/bin/dot", "/usr/bin/dot") - EEFileUtils.searchreplace(self, "{0}22222/htdocs/php/webgrind/" - "config.php" - .format(EEVariables.ee_webroot), - "Europe/Copenhagen", - EEVariables.ee_timezone) - - EEFileUtils.searchreplace(self, "{0}22222/htdocs/php/webgrind/" - "config.php" - .format(EEVariables.ee_webroot), - "90", "100") - - Log.debug(self, "Setting Privileges of webroot permission to " - "{0}22222/htdocs/php/webgrind/ file " - .format(EEVariables.ee_webroot)) - EEFileUtils.chown(self, '{0}22222' - .format(EEVariables.ee_webroot), - EEVariables.ee_php_user, - EEVariables.ee_php_user, - recursive=True) - - if any('/tmp/anemometer.tar.gz' == x[1] - for x in packages): - Log.debug(self, "Extracting file anemometer.tar.gz to " - "location /tmp/ ") - EEExtract.extract(self, '/tmp/anemometer.tar.gz', '/tmp/') - if not os.path.exists('{0}22222/htdocs/db/' - .format(EEVariables.ee_webroot)): - Log.debug(self, "Creating directory") - os.makedirs('{0}22222/htdocs/db/' - .format(EEVariables.ee_webroot)) - shutil.move('/tmp/Anemometer-master', - '{0}22222/htdocs/db/anemometer' - .format(EEVariables.ee_webroot)) - chars = ''.join(random.sample(string.ascii_letters, 8)) - try: - EEShellExec.cmd_exec(self, 'mysql < {0}22222/htdocs/db' - '/anemometer/install.sql' - .format(EEVariables.ee_webroot)) - except CommandExecutionError as e: - raise SiteError("Unable to import Anemometer database") - - EEMysql.execute(self, 'grant select on *.* to \'anemometer\'' - '@\'{0}\' IDENTIFIED' - ' BY \'{1}\''.format(self.app.config.get('mysql', - 'grant-host'),chars)) - Log.debug(self, "grant all on slow-query-log.*" - " to anemometer@root_user IDENTIFIED BY password ") - EEMysql.execute(self, 'grant all on slow_query_log.* to' - '\'anemometer\'@\'{0}\' IDENTIFIED' - ' BY \'{1}\''.format(self.app.config.get( - 'mysql', 'grant-host'), - chars), - errormsg="cannot grant priviledges", log=False) - - # Custom Anemometer configuration - Log.debug(self, "configration Anemometer") - data = dict(host=EEVariables.ee_mysql_host, port='3306', - user='anemometer', password=chars) - ee_anemometer = open('{0}22222/htdocs/db/anemometer' - '/conf/config.inc.php' - .format(EEVariables.ee_webroot), - encoding='utf-8', mode='w') - self.app.render((data), 'anemometer.mustache', - out=ee_anemometer) - ee_anemometer.close() - - if any('/usr/bin/pt-query-advisor' == x[1] - for x in packages): - EEFileUtils.chmod(self, "/usr/bin/pt-query-advisor", 0o775) - - if any('/tmp/vimbadmin.tar.gz' == x[1] for x in packages): - # Extract ViMbAdmin - Log.debug(self, "Extracting ViMbAdmin.tar.gz to " - "location /tmp/") - EEExtract.extract(self, '/tmp/vimbadmin.tar.gz', '/tmp/') - if not os.path.exists('{0}22222/htdocs/' - .format(EEVariables.ee_webroot)): - Log.debug(self, "Creating directory " - "{0}22222/htdocs/" - .format(EEVariables.ee_webroot)) - os.makedirs('{0}22222/htdocs/' - .format(EEVariables.ee_webroot)) - shutil.move('/tmp/ViMbAdmin-{0}/' - .format(EEVariables.ee_vimbadmin), - '{0}22222/htdocs/vimbadmin/' - .format(EEVariables.ee_webroot)) - - # Donwload composer and install ViMbAdmin - Log.debug(self, "Downloading composer " - "https://getcomposer.org/installer | php ") - try: - EEShellExec.cmd_exec(self, "cd {0}22222/htdocs" - "/vimbadmin; curl" - " -sS https://getcomposer.org/" - "installer |" - " php".format(EEVariables.ee_webroot)) - Log.debug(self, "Installating of composer") - EEShellExec.cmd_exec(self, "cd {0}22222/htdocs" - "/vimbadmin && " - "php composer.phar install " - "--prefer-dist" - " --no-dev && rm -f {1}22222/htdocs" - "/vimbadmin/composer.phar" - .format(EEVariables.ee_webroot, - EEVariables.ee_webroot)) - except CommandExecutionError as e: - raise SiteError("Failed to setup ViMbAdmin") - - # Configure vimbadmin database - vm_passwd = ''.join(random.sample(string.ascii_letters, 8)) - Log.debug(self, "Creating vimbadmin database if not exist") - EEMysql.execute(self, "create database if not exists" - " vimbadmin") - Log.debug(self, " grant all privileges on `vimbadmin`.* to" - " `vimbadmin`@`{0}` IDENTIFIED BY" - " ' '".format(self.app.config.get('mysql', - 'grant-host'))) - EEMysql.execute(self, "grant all privileges on `vimbadmin`.* " - " to `vimbadmin`@`{0}` IDENTIFIED BY" - " '{1}'".format(self.app.config.get('mysql', - 'grant-host'), vm_passwd), - errormsg="Cannot grant " - "user privileges", log=False) - vm_salt = (''.join(random.sample(string.ascii_letters + - string.ascii_letters, 64))) - - # Custom Vimbadmin configuration by EasyEngine - data = dict(salt=vm_salt, host=EEVariables.ee_mysql_host, - password=vm_passwd, - php_user=EEVariables.ee_php_user) - Log.debug(self, 'Writting the ViMbAdmin configuration to ' - 'file {0}22222/htdocs/vimbadmin/application/' - 'configs/application.ini' - .format(EEVariables.ee_webroot)) - ee_vmb = open('{0}22222/htdocs/vimbadmin/application/' - 'configs/application.ini' - .format(EEVariables.ee_webroot), - encoding='utf-8', mode='w') - self.app.render((data), 'vimbadmin.mustache', - out=ee_vmb) - ee_vmb.close() - - shutil.copyfile("{0}22222/htdocs/vimbadmin/public/" - ".htaccess.dist" - .format(EEVariables.ee_webroot), - "{0}22222/htdocs/vimbadmin/public/" - ".htaccess".format(EEVariables.ee_webroot)) - Log.debug(self, "Executing command " - "{0}22222/htdocs/vimbadmin/bin" - "/doctrine2-cli.php orm:schema-tool:" - "create".format(EEVariables.ee_webroot)) - try: - EEShellExec.cmd_exec(self, "{0}22222/htdocs/vimbadmin" - "/bin/doctrine2-cli.php " - "orm:schema-tool:create" - .format(EEVariables.ee_webroot)) - except CommandExecutionError as e: - raise SiteError("Unable to create ViMbAdmin schema") - - EEFileUtils.chown(self, '{0}22222' - .format(EEVariables.ee_webroot), - EEVariables.ee_php_user, - EEVariables.ee_php_user, - recursive=True) - - # Copy Dovecot and Postfix templates which are depednet on - # Vimbadmin - - if not os.path.exists('/etc/postfix/mysql/'): - Log.debug(self, "Creating directory " - "/etc/postfix/mysql/") - os.makedirs('/etc/postfix/mysql/') - - if EEVariables.ee_mysql_host is "localhost": - data = dict(password=vm_passwd, host="127.0.0.1") - else: - data = dict(password=vm_passwd, - host=EEVariables.ee_mysql_host) - - vm_config = open('/etc/postfix/mysql/virtual_alias_maps.cf', - encoding='utf-8', mode='w') - self.app.render((data), 'virtual_alias_maps.mustache', - out=vm_config) - vm_config.close() - - Log.debug(self, "Writting configuration to " - "/etc/postfix/mysql" - "/virtual_domains_maps.cf file") - vm_config = open('/etc/postfix/mysql/virtual_domains_maps.cf', - encoding='utf-8', mode='w') - self.app.render((data), 'virtual_domains_maps.mustache', - out=vm_config) - vm_config.close() - - Log.debug(self, "Writting configuration to " - "/etc/postfix/mysql" - "/virtual_mailbox_maps.cf file") - vm_config = open('/etc/postfix/mysql/virtual_mailbox_maps.cf', - encoding='utf-8', mode='w') - self.app.render((data), 'virtual_mailbox_maps.mustache', - out=vm_config) - vm_config.close() - - Log.debug(self, "Writting configration" - " to /etc/dovecot/dovecot-sql.conf.ext file ") - vm_config = open('/etc/dovecot/dovecot-sql.conf.ext', - encoding='utf-8', mode='w') - self.app.render((data), 'dovecot-sql-conf.mustache', - out=vm_config) - vm_config.close() - - # If Amavis is going to be installed then configure Vimabadmin - # Amvis settings - if set(EEVariables.ee_mailscanner).issubset(set(apt_packages)): - vm_config = open('/etc/amavis/conf.d/50-user', - encoding='utf-8', mode='w') - self.app.render((data), '50-user.mustache', - out=vm_config) - vm_config.close() - EEService.restart_service(self, 'dovecot') - EEService.reload_service(self, 'nginx') - if (EEVariables.ee_platform_distro == 'debian' or EEVariables.ee_platform_codename == 'precise'): - EEService.reload_service(self, 'php5-fpm') - else: - EEService.reload_service(self, 'php5.6-fpm') - if EEAptGet.is_installed(self, 'php7.0-fpm'): - EEService.reload_service(self, 'php7.0-fpm') - self.msg = (self.msg + ["Configure ViMbAdmin:\thttps://{0}:" - "22222/vimbadmin".format(EEVariables.ee_fqdn)] - + ["Security Salt: {0}".format(vm_salt)]) - - if any('/tmp/roundcube.tar.gz' == x[1] for x in packages): - # Extract RoundCubemail - Log.debug(self, "Extracting file /tmp/roundcube.tar.gz " - "to location /tmp/ ") - EEExtract.extract(self, '/tmp/roundcube.tar.gz', '/tmp/') - if not os.path.exists('{0}roundcubemail' - .format(EEVariables.ee_webroot)): - Log.debug(self, "Creating new directory " - " {0}roundcubemail/" - .format(EEVariables.ee_webroot)) - os.makedirs('{0}roundcubemail/' - .format(EEVariables.ee_webroot)) - shutil.move('/tmp/roundcubemail-{0}/' - .format(EEVariables.ee_roundcube), - '{0}roundcubemail/htdocs' - .format(EEVariables.ee_webroot)) - - #Fix pear install config for trusty - if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic'): - EEShellExec.cmd_exec(self, "pear config-set php_dir /usr/share/php") - EEShellExec.cmd_exec(self, "pear config-set doc_dir /lib/php/pear/docs") - EEShellExec.cmd_exec(self, "pear config-set cfg_dir /lib/php/pear/cfg") - EEShellExec.cmd_exec(self, "pear config-set data_dir /lib/php/pear/data") - EEShellExec.cmd_exec(self, "pear config-set test_dir /lib/php/pear/tests") - EEShellExec.cmd_exec(self, "pear config-set www_dir /lib/php/pear/www") - # Install Roundcube depednet pear packages - EEShellExec.cmd_exec(self, "pear install Mail_Mime Net_SMTP" - " Mail_mimeDecode Net_IDNA2-beta " - "Auth_SASL Net_Sieve Crypt_GPG") - - # pear install Mail_Mime Net_SMTP Mail_mimeDecode Net_IDNA2-beta Auth_SASL Net_Sieve Crypt_GPG - - # Configure roundcube database - rc_passwd = ''.join(random.sample(string.ascii_letters, 8)) - Log.debug(self, "Creating Database roundcubemail") - EEMysql.execute(self, "create database if not exists " - " roundcubemail") - Log.debug(self, "grant all privileges" - " on `roundcubemail`.* to " - " `roundcube`@`{0}` IDENTIFIED BY " - "' '".format(self.app.config.get( - 'mysql', 'grant-host'))) - EEMysql.execute(self, "grant all privileges" - " on `roundcubemail`.* to " - " `roundcube`@`{0}` IDENTIFIED BY " - "'{1}'".format(self.app.config.get( - 'mysql', 'grant-host'), - rc_passwd)) - EEShellExec.cmd_exec(self, "mysql roundcubemail < {0}" - "roundcubemail/htdocs/SQL/mysql" - ".initial.sql" - .format(EEVariables.ee_webroot)) - - shutil.copyfile("{0}roundcubemail/htdocs/config/" - "config.inc.php.sample" - .format(EEVariables.ee_webroot), - "{0}roundcubemail/htdocs/config/" - "config.inc.php" - .format(EEVariables.ee_webroot)) - EEShellExec.cmd_exec(self, "sed -i \"s\'mysql://roundcube:" - "pass@localhost/roundcubemail\'mysql://" - "roundcube:{0}@{1}/" - "roundcubemail\'\" {2}roundcubemail" - "/htdocs/config/config." - "inc.php" - .format(rc_passwd, - EEVariables.ee_mysql_host, - EEVariables.ee_webroot)) - - # Sieve plugin configuration in roundcube - EEShellExec.cmd_exec(self, "bash -c \"sed -i \\\"s:\$config\[" - "\'plugins\'\] " - "= array(:\$config\['plugins'\] = " - "array(\\n \'sieverules\',:\\\" " - "{0}roundcubemail/htdocs/config" - .format(EEVariables.ee_webroot) - + "/config.inc.php\"") - EEShellExec.cmd_exec(self, "echo \"\$config['sieverules_port']" - "=4190;\" >> {0}roundcubemail" - .format(EEVariables.ee_webroot) - + "/htdocs/config/config.inc.php") - - data = dict(site_name='webmail', www_domain='webmail', - static=False, - basic=True, wp=False, w3tc=False, wpfc=False, - wpsc=False, multisite=False, wpsubdir=False, - webroot=EEVariables.ee_webroot, ee_db_name='', - ee_db_user='', ee_db_pass='', ee_db_host='', - rc=True) - - Log.debug(self, 'Writting the nginx configuration for ' - 'RoundCubemail') - ee_rc = open('/etc/nginx/sites-available/webmail', - encoding='utf-8', mode='w') - self.app.render((data), 'virtualconf.mustache', - out=ee_rc) - ee_rc.close() - - # Create Symbolic link for webmail - EEFileUtils.create_symlink(self, ['/etc/nginx/sites-available' - '/webmail', - '/etc/nginx/sites-enabled/' - 'webmail']) - # Create log folder and softlinks - if not os.path.exists('{0}roundcubemail/logs' - .format(EEVariables.ee_webroot)): - os.makedirs('{0}roundcubemail/logs' - .format(EEVariables.ee_webroot)) - - EEFileUtils.create_symlink(self, ['/var/log/nginx/' - 'webmail.access.log', - '{0}roundcubemail/' - 'logs/access.log' - .format(EEVariables.ee_webroot)]) - - EEFileUtils.create_symlink(self, ['/var/log/nginx/' - 'webmail.error.log', - '{0}roundcubemail/' - 'logs/error.log' - .format(EEVariables.ee_webroot)]) - # Remove roundcube installer - EEService.reload_service(self, 'nginx') - EEFileUtils.remove(self, ["{0}roundcubemail/htdocs/installer" - .format(EEVariables.ee_webroot)]) - EEFileUtils.chown(self, '{0}roundcubemail' - .format(EEVariables.ee_webroot), - EEVariables.ee_php_user, - EEVariables.ee_php_user, - recursive=True) - - if any('/tmp/pra.tar.gz' == x[1] - for x in packages): - Log.debug(self, 'Extracting file /tmp/pra.tar.gz to ' - 'loaction /tmp/') - EEExtract.extract(self, '/tmp/pra.tar.gz', '/tmp/') - if not os.path.exists('{0}22222/htdocs/cache/redis' - .format(EEVariables.ee_webroot)): - Log.debug(self, "Creating new directory " - "{0}22222/htdocs/cache/redis" - .format(EEVariables.ee_webroot)) - os.makedirs('{0}22222/htdocs/cache/redis' - .format(EEVariables.ee_webroot)) - shutil.move('/tmp/phpRedisAdmin-master/', - '{0}22222/htdocs/cache/redis/phpRedisAdmin' - .format(EEVariables.ee_webroot)) - - Log.debug(self, 'Extracting file /tmp/predis.tar.gz to ' - 'loaction /tmp/') - EEExtract.extract(self, '/tmp/predis.tar.gz', '/tmp/') - shutil.move('/tmp/predis-1.0.1/', - '{0}22222/htdocs/cache/redis/phpRedisAdmin/vendor' - .format(EEVariables.ee_webroot)) - - Log.debug(self, 'Setting Privileges of webroot permission to ' - '{0}22222/htdocs/cache/ file ' - .format(EEVariables.ee_webroot)) - EEFileUtils.chown(self, '{0}22222' - .format(EEVariables.ee_webroot), - EEVariables.ee_php_user, - EEVariables.ee_php_user, - recursive=True) - - @expose(help="Install packages") - def install(self, packages=[], apt_packages=[], disp_msg=True): - """Start installation of packages""" - if self.app.pargs.pagespeed: - Log.error(self, "Pagespeed support has been dropped since EasyEngine v3.6.0",False) - Log.error(self, "Please run command again without `--pagespeed`",False) - Log.error(self, "For more details, read - https://easyengine.io/blog/disabling-pagespeed/") - self.msg = [] - try: - # Default action for stack installation - if ((not self.app.pargs.web) and (not self.app.pargs.admin) and - (not self.app.pargs.mail) and (not self.app.pargs.nginx) and - (not self.app.pargs.php) and (not self.app.pargs.mysql) and - (not self.app.pargs.postfix) and (not self.app.pargs.wpcli) and - (not self.app.pargs.phpmyadmin) and (not self.app.pargs.hhvm) - and (not self.app.pargs.pagespeed) and - (not self.app.pargs.adminer) and (not self.app.pargs.utils) and - (not self.app.pargs.mailscanner) and (not self.app.pargs.all) - and (not self.app.pargs.redis) and - (not self.app.pargs.phpredisadmin) and (not self.app.pargs.php7)): - self.app.pargs.web = True - self.app.pargs.admin = True - - if self.app.pargs.all: - self.app.pargs.web = True - self.app.pargs.admin = True - self.app.pargs.mail = True - - if self.app.pargs.web: - self.app.pargs.nginx = True - self.app.pargs.php = True - self.app.pargs.mysql = True - self.app.pargs.wpcli = True - self.app.pargs.postfix = True - - if self.app.pargs.admin: - self.app.pargs.nginx = True - self.app.pargs.php = True - self.app.pargs.mysql = True - self.app.pargs.adminer = True - self.app.pargs.phpmyadmin = True - self.app.pargs.utils = True - - if self.app.pargs.mail: - self.app.pargs.nginx = True - self.app.pargs.php = True - self.app.pargs.mysql = True - self.app.pargs.postfix = True - - if not EEAptGet.is_installed(self, 'dovecot-core'): - check_fqdn(self, - os.popen("hostname -f | tr -d '\n'").read()) - Log.debug(self, "Setting apt_packages variable for mail") - apt_packages = apt_packages + EEVariables.ee_mail - - # https://github.com/EasyEngine/ViMbAdmin/archive/3.0.13.tar.gz - packages = packages + [["https://github.com/opensolutions/" - "ViMbAdmin/archive/{0}.tar.gz" - .format(EEVariables.ee_vimbadmin), - "/tmp/vimbadmin.tar.gz", - "ViMbAdmin"], - ["https://github.com/roundcube/" - "roundcubemail/releases/download/" - "{0}/roundcubemail-{0}.tar.gz" - .format(EEVariables.ee_roundcube), - "/tmp/roundcube.tar.gz", - "Roundcube"]] - - if EEVariables.ee_ram > 1024: - self.app.pargs.mailscanner = True - else: - Log.info(self, "System RAM is less than 1GB\nMail " - "scanner packages are not going to install" - " automatically") - else: - Log.info(self, "Mail server is already installed") - - - if self.app.pargs.redis: - if not EEAptGet.is_installed(self, 'redis-server'): - apt_packages = apt_packages + EEVariables.ee_redis - self.app.pargs.php = True - else: - Log.info(self, "Redis already installed") - - if self.app.pargs.nginx: - Log.debug(self, "Setting apt_packages variable for Nginx") - - if not (EEAptGet.is_installed(self, 'nginx-custom')): - if not (EEAptGet.is_installed(self, 'nginx-plus') or EEAptGet.is_installed(self, 'nginx')): - apt_packages = apt_packages + EEVariables.ee_nginx - else: - if EEAptGet.is_installed(self, 'nginx-plus'): - Log.info(self, "NGINX PLUS Detected ...") - apt = ["nginx-plus"] + EEVariables.ee_nginx - self.post_pref(apt, packages) - elif EEAptGet.is_installed(self, 'nginx'): - Log.info(self, "EasyEngine detected a previously installed Nginx package. " - "It may or may not have required modules. " - "\nIf you need help, please create an issue at https://github.com/EasyEngine/easyengine/issues/ \n") - apt = ["nginx"] + EEVariables.ee_nginx - self.post_pref(apt, packages) - else: - Log.debug(self, "Nginx Stable already installed") - - if self.app.pargs.php: - Log.debug(self, "Setting apt_packages variable for PHP") - if not (EEAptGet.is_installed(self, 'php5-fpm') or EEAptGet.is_installed(self, 'php5.6-fpm')): - if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic'): - apt_packages = apt_packages + EEVariables.ee_php5_6 + EEVariables.ee_php_extra - else: - apt_packages = apt_packages + EEVariables.ee_php - else: - Log.debug(self, "PHP already installed") - Log.info(self, "PHP already installed") - - #PHP 7.0 for Debian (jessie+) - if self.app.pargs.php7 and EEVariables.ee_platform_distro == 'debian': - if (EEVariables.ee_platform_codename == 'jessie'): - Log.debug(self, "Setting apt_packages variable for PHP 7.0") - if not EEAptGet.is_installed(self, 'php7.0-fpm') : - apt_packages = apt_packages + EEVariables.ee_php7_0 - if not EEAptGet.is_installed(self, 'php5-fpm'): - apt_packages = apt_packages + EEVariables.ee_php - else: - Log.debug(self, "PHP 7.0 already installed") - Log.info(self, "PHP 7.0 already installed") - else: - Log.debug(self, "PHP 7.0 Not Available for your Distribution") - Log.info(self, "PHP 7.0 Not Available for your Distribution") - - #PHP 7.0 for Ubuntu - if self.app.pargs.php7 and not EEVariables.ee_platform_distro == 'debian': - if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic'): - Log.debug(self, "Setting apt_packages variable for PHP 7.0") - if not EEAptGet.is_installed(self, 'php7.0-fpm') : - apt_packages = apt_packages + EEVariables.ee_php7_0 + EEVariables.ee_php_extra - if not EEAptGet.is_installed(self, 'php5.6-fpm'): - apt_packages = apt_packages + EEVariables.ee_php5_6 + EEVariables.ee_php_extra - else: - Log.debug(self, "PHP 7.0 already installed") - Log.info(self, "PHP 7.0 already installed") - else: - Log.debug(self, "PHP 7.0 Not Available for your Distribution") - Log.info(self, "PHP 7.0 Not Available for your Distribution") - - - if self.app.pargs.hhvm: - Log.debug(self, "Setting apt packages variable for HHVM") - if platform.architecture()[0] is '32bit': - Log.error(self, "HHVM is not supported by 32bit system") - if not EEAptGet.is_installed(self, 'hhvm'): - apt_packages = apt_packages + EEVariables.ee_hhvm - else: - Log.debug(self, "HHVM already installed") - Log.info(self, "HHVM already installed") - - if self.app.pargs.mysql: - Log.debug(self, "Setting apt_packages variable for MySQL") - if not EEShellExec.cmd_exec(self, "mysqladmin ping"): - apt_packages = apt_packages + EEVariables.ee_mysql - packages = packages + [["https://raw." - "githubusercontent.com/" - "major/MySQLTuner-perl" - "/master/mysqltuner.pl", - "/usr/bin/mysqltuner", - "MySQLTuner"]] - - else: - Log.debug(self, "MySQL connection is already alive") - Log.info(self, "MySQL connection is already alive") - if self.app.pargs.postfix: - Log.debug(self, "Setting apt_packages variable for Postfix") - if not EEAptGet.is_installed(self, 'postfix'): - apt_packages = apt_packages + EEVariables.ee_postfix - else: - Log.debug(self, "Postfix is already installed") - Log.info(self, "Postfix is already installed") - if self.app.pargs.wpcli: - Log.debug(self, "Setting packages variable for WP-CLI") - if not EEShellExec.cmd_exec(self, "which wp"): - packages = packages + [["https://github.com/wp-cli/wp-cli/" - "releases/download/v{0}/" - "wp-cli-{0}.phar" - "".format(EEVariables.ee_wp_cli), - "/usr/bin/wp", - "WP-CLI"]] - else: - Log.debug(self, "WP-CLI is already installed") - Log.info(self, "WP-CLI is already installed") - if self.app.pargs.phpmyadmin: - Log.debug(self, "Setting packages varible for phpMyAdmin ") - packages = packages + [["https://github.com/phpmyadmin/" - "phpmyadmin/archive/STABLE.tar.gz", - "/tmp/pma.tar.gz", "phpMyAdmin"]] - - if self.app.pargs.phpredisadmin: - Log.debug(self, "Setting packages varible for phpRedisAdmin") - packages = packages + [["https://github.com/ErikDubbelboer/" - "phpRedisAdmin/archive/master.tar.gz", - "/tmp/pra.tar.gz","phpRedisAdmin"], - ["https://github.com/nrk/predis/" - "archive/v1.0.1.tar.gz", - "/tmp/predis.tar.gz", "Predis"]] - - if self.app.pargs.adminer: - Log.debug(self, "Setting packages variable for Adminer ") - packages = packages + [["https://www.adminer.org/static/download/" - "{0}/adminer-{0}.php" - "".format(EEVariables.ee_adminer), - "{0}22222/" - "htdocs/db/adminer/index.php" - .format(EEVariables.ee_webroot), - "Adminer"]] - - if self.app.pargs.mailscanner: - if not EEAptGet.is_installed(self, 'amavisd-new'): - if (EEAptGet.is_installed(self, 'dovecot-core') or - self.app.pargs.mail): - apt_packages = (apt_packages + - EEVariables.ee_mailscanner) - else: - Log.error(self, "Failed to find installed Dovecot") - else: - Log.error(self, "Mail scanner already installed") - - if self.app.pargs.utils: - Log.debug(self, "Setting packages variable for utils") - packages = packages + [["https://storage.googleapis.com/google-code-archive-downloads/" - "v2/code.google.com/phpmemcacheadmin/" - "phpMemcachedAdmin-1.2.2-r262.tar.gz", '/tmp/memcache.tar.gz', - 'phpMemcachedAdmin'], - ["https://raw.githubusercontent.com" - "/rtCamp/eeadmin/master/cache/nginx/" - "clean.php", - "{0}22222/htdocs/cache/" - "nginx/clean.php" - .format(EEVariables.ee_webroot), - "clean.php"], - ["https://raw.github.com/rlerdorf/" - "opcache-status/master/opcache.php", - "{0}22222/htdocs/cache/" - "opcache/opcache.php" - .format(EEVariables.ee_webroot), - "opcache.php"], - ["https://raw.github.com/amnuts/" - "opcache-gui/master/index.php", - "{0}22222/htdocs/" - "cache/opcache/opgui.php" - .format(EEVariables.ee_webroot), - "Opgui"], - ["https://gist.github.com/ck-on/4959032" - "/raw/0b871b345fd6cfcd6d2be030c1f33d1" - "ad6a475cb/ocp.php", - "{0}22222/htdocs/cache/" - "opcache/ocp.php" - .format(EEVariables.ee_webroot), - "OCP.php"], - ["https://github.com/jokkedk/webgrind/" - "archive/master.tar.gz", - '/tmp/webgrind.tar.gz', 'Webgrind'], - ["http://bazaar.launchpad.net/~" - "percona-toolkit-dev/percona-toolkit/" - "2.1/download/head:/ptquerydigest-" - "20110624220137-or26tn4" - "expb9ul2a-16/pt-query-digest", - "/usr/bin/pt-query-advisor", - "pt-query-advisor"], - ["https://github.com/box/Anemometer/" - "archive/master.tar.gz", - '/tmp/anemometer.tar.gz', 'Anemometer'] - ] - except Exception as e: - pass - - if len(apt_packages) or len(packages): - Log.debug(self, "Calling pre_pref") - self.pre_pref(apt_packages) - if len(apt_packages): - EESwap.add(self) - Log.info(self, "Updating apt-cache, please wait...") - EEAptGet.update(self) - Log.info(self, "Installing packages, please wait...") - EEAptGet.install(self, apt_packages) - if len(packages): - Log.debug(self, "Downloading following: {0}".format(packages)) - EEDownload.download(self, packages) - Log.debug(self, "Calling post_pref") - self.post_pref(apt_packages, packages) - if 'redis-server' in apt_packages: - # set redis.conf parameter - # set maxmemory 10% for ram below 512MB and 20% for others - # set maxmemory-policy allkeys-lru - if os.path.isfile("/etc/redis/redis.conf"): - if EEVariables.ee_ram < 512: - Log.debug(self, "Setting maxmemory variable to {0} in redis.conf" - .format(int(EEVariables.ee_ram*1024*1024*0.1))) - EEShellExec.cmd_exec(self, "sed -i 's/# maxmemory <bytes>/maxmemory {0}/' /etc/redis/redis.conf" - .format(int(EEVariables.ee_ram*1024*1024*0.1))) - Log.debug(self, "Setting maxmemory-policy variable to allkeys-lru in redis.conf") - EEShellExec.cmd_exec(self, "sed -i 's/# maxmemory-policy.*/maxmemory-policy allkeys-lru/' " - "/etc/redis/redis.conf") - EEService.restart_service(self, 'redis-server') - else: - Log.debug(self, "Setting maxmemory variable to {0} in redis.conf" - .format(int(EEVariables.ee_ram*1024*1024*0.2))) - EEShellExec.cmd_exec(self, "sed -i 's/# maxmemory <bytes>/maxmemory {0}/' /etc/redis/redis.conf" - .format(int(EEVariables.ee_ram*1024*1024*0.2))) - Log.debug(self, "Setting maxmemory-policy variable to allkeys-lru in redis.conf") - EEShellExec.cmd_exec(self, "sed -i 's/# maxmemory-policy.*/maxmemory-policy allkeys-lru/' " - "/etc/redis/redis.conf") - EEService.restart_service(self, 'redis-server') - if disp_msg: - if len(self.msg): - for msg in self.msg: - Log.info(self, Log.ENDC + msg) - Log.info(self, "Successfully installed packages") - else: - return self.msg - - @expose(help="Remove packages") - def remove(self): - """Start removal of packages""" - apt_packages = [] - packages = [] - - if self.app.pargs.pagespeed: - Log.error(self, "Pagespeed support has been dropped since EasyEngine v3.6.0",False) - Log.error(self, "Please run command again without `--pagespeed`",False) - Log.error(self, "For more details, read - https://easyengine.io/blog/disabling-pagespeed/") - - - # Default action for stack remove - if ((not self.app.pargs.web) and (not self.app.pargs.admin) and - (not self.app.pargs.mail) and (not self.app.pargs.nginx) and - (not self.app.pargs.php) and (not self.app.pargs.php7) and (not self.app.pargs.mysql) and - (not self.app.pargs.postfix) and (not self.app.pargs.wpcli) and - (not self.app.pargs.phpmyadmin) and (not self.app.pargs.hhvm) and - (not self.app.pargs.adminer) and (not self.app.pargs.utils) and - (not self.app.pargs.mailscanner) and (not self.app.pargs.all) and - (not self.app.pargs.pagespeed) and (not self.app.pargs.redis) and - (not self.app.pargs.phpredisadmin)): - self.app.pargs.web = True - self.app.pargs.admin = True - - if self.app.pargs.all: - self.app.pargs.web = True - self.app.pargs.admin = True - self.app.pargs.mail = True - if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic'): - self.app.pargs.php7 = True - - if self.app.pargs.web: - self.app.pargs.nginx = True - self.app.pargs.php = True - self.app.pargs.mysql = True - self.app.pargs.wpcli = True - self.app.pargs.postfix = True - - if self.app.pargs.admin: - self.app.pargs.adminer = True - self.app.pargs.phpmyadmin = True - self.app.pargs.utils = True - - if self.app.pargs.mail: - Log.debug(self, "Removing mail server packages") - apt_packages = apt_packages + EEVariables.ee_mail - apt_packages = apt_packages + EEVariables.ee_mailscanner - packages = packages + ["{0}22222/htdocs/vimbadmin" - .format(EEVariables.ee_webroot), - "{0}roundcubemail" - .format(EEVariables.ee_webroot)] - if EEShellExec.cmd_exec(self, "mysqladmin ping"): - EEMysql.execute(self, "drop database IF EXISTS vimbadmin") - EEMysql.execute(self, "drop database IF EXISTS roundcubemail") - - if self.app.pargs.mailscanner: - apt_packages = (apt_packages + EEVariables.ee_mailscanner) - - if self.app.pargs.pagespeed: - Log.debug(self, "Removing packages varible of Pagespeed") - packages = packages + ['/etc/nginx/conf.d/pagespeed.conf'] - - if self.app.pargs.nginx: - if EEAptGet.is_installed(self, 'nginx-custom'): - Log.debug(self, "Removing apt_packages variable of Nginx") - apt_packages = apt_packages + EEVariables.ee_nginx - else: - Log.error(self,"Cannot Remove! Nginx Stable version not found.") - if self.app.pargs.php: - Log.debug(self, "Removing apt_packages variable of PHP") - if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic'): - apt_packages = apt_packages + EEVariables.ee_php5_6 - if not EEAptGet.is_installed(self, 'php7.0-fpm'): - apt_packages = apt_packages + EEVariables.ee_php_extra - else: - apt_packages = apt_packages + EEVariables.ee_php - - #PHP7.0 for debian(jessie+) - if self.app.pargs.php7: - if (EEVariables.ee_platform_codename == 'jessie'): - Log.debug(self, "Removing apt_packages variable of PHP 7.0") - apt_packages = apt_packages + EEVariables.ee_php7_0 - if not EEAptGet.is_installed(self, 'php5-fpm'): - apt_packages = apt_packages + EEVariables.ee_php_extra - else: - Log.info(self,"PHP 7.0 not supported.") - - if self.app.pargs.php7: - if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic'): - Log.debug(self, "Removing apt_packages variable of PHP 7.0") - apt_packages = apt_packages + EEVariables.ee_php7_0 - if not EEAptGet.is_installed(self, 'php5.6-fpm'): - apt_packages = apt_packages + EEVariables.ee_php_extra - else: - Log.info(self,"PHP 7.0 not supported.") - - if self.app.pargs.hhvm: - if EEAptGet.is_installed(self, 'hhvm'): - Log.debug(self, "Removing apt_packages variable of HHVM") - apt_packages = apt_packages + EEVariables.ee_hhvm - if self.app.pargs.redis: - Log.debug(self, "Remove apt_packages variable of Redis") - apt_packages = apt_packages + EEVariables.ee_redis - if self.app.pargs.mysql: - Log.debug(self, "Removing apt_packages variable of MySQL") - apt_packages = apt_packages + EEVariables.ee_mysql - packages = packages + ['/usr/bin/mysqltuner'] - if self.app.pargs.postfix: - Log.debug(self, "Removing apt_packages variable of Postfix") - apt_packages = apt_packages + EEVariables.ee_postfix - if self.app.pargs.wpcli: - Log.debug(self, "Removing package variable of WPCLI ") - if os.path.isfile('/usr/bin/wp'): - packages = packages + ['/usr/bin/wp'] - else: - Log.warn(self, "WP-CLI is not installed with EasyEngine") - if self.app.pargs.phpmyadmin: - Log.debug(self, "Removing package variable of phpMyAdmin ") - packages = packages + ['{0}22222/htdocs/db/pma' - .format(EEVariables.ee_webroot)] - if self.app.pargs.phpredisadmin: - Log.debug(self, "Removing package variable of phpRedisAdmin ") - packages = packages + ['{0}22222/htdocs/cache/redis/phpRedisAdmin' - .format(EEVariables.ee_webroot)] - if self.app.pargs.adminer: - Log.debug(self, "Removing package variable of Adminer ") - packages = packages + ['{0}22222/htdocs/db/adminer' - .format(EEVariables.ee_webroot)] - if self.app.pargs.utils: - Log.debug(self, "Removing package variable of utils ") - packages = packages + ['{0}22222/htdocs/php/webgrind/' - .format(EEVariables.ee_webroot), - '{0}22222/htdocs/cache/opcache' - .format(EEVariables.ee_webroot), - '{0}22222/htdocs/cache/nginx/' - 'clean.php'.format(EEVariables.ee_webroot), - '{0}22222/htdocs/cache/memcache' - .format(EEVariables.ee_webroot), - '/usr/bin/pt-query-advisor', - '{0}22222/htdocs/db/anemometer' - .format(EEVariables.ee_webroot)] - - if len(packages) or len(apt_packages): - ee_prompt = input('Are you sure you to want to' - ' remove from server.' - '\nPackage configuration will remain' - ' on server after this operation.\n' - 'Any answer other than ' - '"yes" will be stop this' - ' operation : ') - - if ee_prompt == 'YES' or ee_prompt == 'yes': - - if (set(["nginx-custom"]).issubset(set(apt_packages))) : - EEService.stop_service(self, 'nginx') - - if len(packages): - EEFileUtils.remove(self, packages) - EEAptGet.auto_remove(self) - - if len(apt_packages): - Log.debug(self, "Removing apt_packages") - Log.info(self, "Removing packages, please wait...") - EEAptGet.remove(self, apt_packages) - EEAptGet.auto_remove(self) - - - Log.info(self, "Successfully removed packages") - - #Added for Ondrej Repo missing package Fix - if self.app.pargs.php7: - if EEAptGet.is_installed(self, 'php5.6-fpm'): - Log.info(self, "PHP5.6-fpm found on system.") - Log.info(self, "Verifying and installing missing packages,") - EEShellExec.cmd_exec(self, "apt-get install -y php-memcached php-igbinary") - - - @expose(help="Purge packages") - def purge(self): - """Start purging of packages""" - apt_packages = [] - packages = [] - - if self.app.pargs.pagespeed: - Log.error(self, "Pagespeed support has been dropped since EasyEngine v3.6.0",False) - Log.error(self, "Please run command again without `--pagespeed`",False) - Log.error(self, "For more details, read - https://easyengine.io/blog/disabling-pagespeed/") - - # Default action for stack purge - if ((not self.app.pargs.web) and (not self.app.pargs.admin) and - (not self.app.pargs.mail) and (not self.app.pargs.nginx) and - (not self.app.pargs.php) and (not self.app.pargs.php7) and (not self.app.pargs.mysql) and - (not self.app.pargs.postfix) and (not self.app.pargs.wpcli) and - (not self.app.pargs.phpmyadmin) and (not self.app.pargs.hhvm) and - (not self.app.pargs.adminer) and (not self.app.pargs.utils) and - (not self.app.pargs.mailscanner) and (not self.app.pargs.all) and - (not self.app.pargs.pagespeed) and (not self.app.pargs.redis) and - (not self.app.pargs.phpredisadmin)): - self.app.pargs.web = True - self.app.pargs.admin = True - - if self.app.pargs.all: - self.app.pargs.web = True - self.app.pargs.admin = True - self.app.pargs.mail = True - if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic'): - self.app.pargs.php7 = True - - if self.app.pargs.web: - self.app.pargs.nginx = True - self.app.pargs.php = True - self.app.pargs.mysql = True - self.app.pargs.wpcli = True - self.app.pargs.postfix = True - - if self.app.pargs.admin: - self.app.pargs.adminer = True - self.app.pargs.phpmyadmin = True - self.app.pargs.utils = True - - if self.app.pargs.mail: - Log.debug(self, "Removing mail server packages") - apt_packages = apt_packages + EEVariables.ee_mail - apt_packages = apt_packages + EEVariables.ee_mailscanner - packages = packages + ["{0}22222/htdocs/vimbadmin" - .format(EEVariables.ee_webroot), - "{0}roundcubemail" - .format(EEVariables.ee_webroot)] - if EEShellExec.cmd_exec(self, "mysqladmin ping"): - EEMysql.execute(self, "drop database IF EXISTS vimbadmin") - EEMysql.execute(self, "drop database IF EXISTS roundcubemail") - - if self.app.pargs.mailscanner: - apt_packages = (apt_packages + EEVariables.ee_mailscanner) - - if self.app.pargs.pagespeed: - Log.debug(self, "Purge packages varible of Pagespeed") - packages = packages + ['/etc/nginx/conf.d/pagespeed.conf'] - - if self.app.pargs.nginx: - if EEAptGet.is_installed(self, 'nginx-custom'): - Log.debug(self, "Purge apt_packages variable of Nginx") - apt_packages = apt_packages + EEVariables.ee_nginx - else: - Log.error(self,"Cannot Purge! Nginx Stable version not found.") - if self.app.pargs.php: - Log.debug(self, "Purge apt_packages variable PHP") - if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic'): - apt_packages = apt_packages + EEVariables.ee_php5_6 - if not EEAptGet.is_installed(self, 'php7.0-fpm'): - apt_packages = apt_packages + EEVariables.ee_php_extra - else: - apt_packages = apt_packages + EEVariables.ee_php - - #For debian --php7 - if self.app.pargs.php7: - if (EEVariables.ee_platform_codename == 'jessie'): - Log.debug(self, "Removing apt_packages variable of PHP 7.0") - apt_packages = apt_packages + EEVariables.ee_php7_0 - if not EEAptGet.is_installed(self, 'php5-fpm'): - apt_packages = apt_packages + EEVariables.ee_php_extra - else: - Log.info(self,"PHP 7.0 not supported.") - - if self.app.pargs.php7: - if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic'): - Log.debug(self, "Removing apt_packages variable of PHP 7.0") - apt_packages = apt_packages + EEVariables.ee_php7_0 - if not EEAptGet.is_installed(self, 'php5.6-fpm'): - apt_packages = apt_packages + EEVariables.ee_php_extra - else: - Log.info(self,"PHP 7.0 not supported.") - if self.app.pargs.hhvm: - if EEAptGet.is_installed(self, 'hhvm'): - Log.debug(self, "Purge apt_packages varible of HHVM") - apt_packages = apt_packages + EEVariables.ee_hhvm - if self.app.pargs.redis: - Log.debug(self, "Purge apt_packages variable of Redis") - apt_packages = apt_packages + EEVariables.ee_redis - if self.app.pargs.mysql: - Log.debug(self, "Purge apt_packages variable MySQL") - apt_packages = apt_packages + EEVariables.ee_mysql - packages = packages + ['/usr/bin/mysqltuner'] - if self.app.pargs.postfix: - Log.debug(self, "Purge apt_packages variable PostFix") - apt_packages = apt_packages + EEVariables.ee_postfix - if self.app.pargs.wpcli: - Log.debug(self, "Purge package variable WPCLI") - if os.path.isfile('/usr/bin/wp'): - packages = packages + ['/usr/bin/wp'] - else: - Log.warn(self, "WP-CLI is not installed with EasyEngine") - if self.app.pargs.phpmyadmin: - packages = packages + ['{0}22222/htdocs/db/pma'. - format(EEVariables.ee_webroot)] - Log.debug(self, "Purge package variable phpMyAdmin") - if self.app.pargs.phpredisadmin: - Log.debug(self, "Removing package variable of phpRedisAdmin ") - packages = packages + ['{0}22222/htdocs/cache/redis/phpRedisAdmin' - .format(EEVariables.ee_webroot)] - if self.app.pargs.adminer: - Log.debug(self, "Purge package variable Adminer") - packages = packages + ['{0}22222/htdocs/db/adminer' - .format(EEVariables.ee_webroot)] - if self.app.pargs.utils: - Log.debug(self, "Purge package variable utils") - packages = packages + ['{0}22222/htdocs/php/webgrind/' - .format(EEVariables.ee_webroot), - '{0}22222/htdocs/cache/opcache' - .format(EEVariables.ee_webroot), - '{0}22222/htdocs/cache/nginx/' - 'clean.php'.format(EEVariables.ee_webroot), - '{0}22222/htdocs/cache/memcache' - .format(EEVariables.ee_webroot), - '/usr/bin/pt-query-advisor', - '{0}22222/htdocs/db/anemometer' - .format(EEVariables.ee_webroot) - ] - - if len(packages) or len(apt_packages): - ee_prompt = input('Are you sure you to want to purge ' - 'from server ' - 'along with their configuration' - ' packages,\nAny answer other than ' - '"yes" will be stop this ' - 'operation :') - - if ee_prompt == 'YES' or ee_prompt == 'yes': - - if (set(["nginx-custom"]).issubset(set(apt_packages))) : - EEService.stop_service(self, 'nginx') - - if len(apt_packages): - Log.info(self, "Purging packages, please wait...") - EEAptGet.remove(self, apt_packages, purge=True) - EEAptGet.auto_remove(self) - - if len(packages): - EEFileUtils.remove(self, packages) - EEAptGet.auto_remove(self) - - - Log.info(self, "Successfully purged packages") - - #Added for php Ondrej repo missing package fix - if self.app.pargs.php7: - if EEAptGet.is_installed(self, 'php5.6-fpm'): - Log.info(self, "PHP5.6-fpm found on system.") - Log.info(self, "Verifying and installing missing packages,") - EEShellExec.cmd_exec(self, "apt-get install -y php-memcached php-igbinary") - - - -def load(app): - # register the plugin class.. this only happens if the plugin is enabled - handler.register(EEStackController) - handler.register(EEStackStatusController) - handler.register(EEStackMigrateController) - handler.register(EEStackUpgradeController) - - # register a hook (function) to run after arguments are parsed. - hook.register('post_argument_parsing', ee_stack_hook) diff --git a/ee/cli/plugins/stack_migrate.py b/ee/cli/plugins/stack_migrate.py deleted file mode 100644 index 05ed62d69..000000000 --- a/ee/cli/plugins/stack_migrate.py +++ /dev/null @@ -1,126 +0,0 @@ -from cement.core.controller import CementBaseController, expose -from cement.core import handler, hook -from ee.core.mysql import EEMysql -from ee.core.logging import Log -from ee.core.variables import EEVariables -from ee.core.aptget import EEAptGet -from ee.core.shellexec import EEShellExec -from ee.core.apt_repo import EERepo -from ee.core.services import EEService -import configparser -import os - - -class EEStackMigrateController(CementBaseController): - class Meta: - label = 'migrate' - stacked_on = 'stack' - stacked_type = 'nested' - description = ('Migrate stack safely') - arguments = [ - (['--mariadb'], - dict(help="Migrate database to MariaDB", - action='store_true')), - ] - - @expose(hide=True) - def migrate_mariadb(self): - # Backup all database - EEMysql.backupAll(self) - - # Add MariaDB repo - Log.info(self, "Adding repository for MariaDB, please wait...") - - mysql_pref = ("Package: *\nPin: origin sfo1.mirrors.digitalocean.com" - "\nPin-Priority: 1000\n") - with open('/etc/apt/preferences.d/' - 'MariaDB.pref', 'w') as mysql_pref_file: - mysql_pref_file.write(mysql_pref) - - EERepo.add(self, repo_url=EEVariables.ee_mysql_repo) - Log.debug(self, 'Adding key for {0}' - .format(EEVariables.ee_mysql_repo)) - EERepo.add_key(self, '0xcbcb082a1bb943db', - keyserver="keyserver.ubuntu.com") - - config = configparser.ConfigParser() - if os.path.exists('/etc/mysql/conf.d/my.cnf'): - config.read('/etc/mysql/conf.d/my.cnf') - else: - config.read(os.path.expanduser("~")+'/.my.cnf') - - try: - chars = config['client']['password'] - except Exception as e: - Log.error(self, "Error: process exited with error %s" - % e) - - Log.debug(self, "Pre-seeding MariaDB") - Log.debug(self, "echo \"mariadb-server-10.0 " - "mysql-server/root_password " - "password \" | " - "debconf-set-selections") - EEShellExec.cmd_exec(self, "echo \"mariadb-server-10.0 " - "mysql-server/root_password " - "password {chars}\" | " - "debconf-set-selections" - .format(chars=chars), - log=False) - Log.debug(self, "echo \"mariadb-server-10.0 " - "mysql-server/root_password_again " - "password \" | " - "debconf-set-selections") - EEShellExec.cmd_exec(self, "echo \"mariadb-server-10.0 " - "mysql-server/root_password_again " - "password {chars}\" | " - "debconf-set-selections" - .format(chars=chars), - log=False) - - # Install MariaDB - apt_packages = EEVariables.ee_mysql - - # If PHP is installed then install php5-mysql - if EEAptGet.is_installed(self, "php5-fpm"): - apt_packages = apt_packages + ["php5-mysql"] - - # If mail server is installed then install dovecot-sql and postfix-sql - if EEAptGet.is_installed(self, "dovecot-core"): - apt_packages = apt_packages + ["dovecot-mysql", "postfix-mysql", - "libclass-dbi-mysql-perl"] - - Log.info(self, "Updating apt-cache, please wait...") - EEAptGet.update(self) - Log.info(self, "Installing MariaDB, please wait...") - EEAptGet.remove(self, ["mysql-common", "libmysqlclient18"]) - EEAptGet.auto_remove(self) - EEAptGet.install(self, apt_packages) - - # Restart dovecot and postfix if installed - if EEAptGet.is_installed(self, "dovecot-core"): - EEService.restart_service(self, 'dovecot') - EEService.restart_service(self, 'postfix') - - @expose(hide=True) - def default(self): - if ((not self.app.pargs.mariadb)): - self.app.args.print_help() - if self.app.pargs.mariadb: - if EEVariables.ee_mysql_host is not "localhost": - Log.error(self, "Remote MySQL found, EasyEngine will not " - "install MariaDB") - - if EEShellExec.cmd_exec(self, "mysqladmin ping") and (not - EEAptGet.is_installed(self, 'mariadb-server')): - - Log.info(self, "If your database size is big, " - "migration may take some time.") - Log.info(self, "During migration non nginx-cached parts of " - "your site may remain down") - start_migrate = input("Type \"mariadb\" to continue:") - if start_migrate != "mariadb": - Log.error(self, "Not starting migration") - self.migrate_mariadb() - else: - Log.error(self, "Your current MySQL is not alive or " - "you allready installed MariaDB") diff --git a/ee/cli/plugins/stack_services.py b/ee/cli/plugins/stack_services.py deleted file mode 100644 index acb0cf1a2..000000000 --- a/ee/cli/plugins/stack_services.py +++ /dev/null @@ -1,475 +0,0 @@ -from cement.core.controller import CementBaseController, expose -from cement.core import handler, hook -from ee.core.services import EEService -from ee.core.logging import Log -from ee.core.variables import EEVariables -from ee.core.aptget import EEAptGet - - -class EEStackStatusController(CementBaseController): - class Meta: - label = 'stack_services' - stacked_on = 'stack' - stacked_type = 'embedded' - description = 'Get status of stack' - arguments = [ - (['--memcache'], - dict(help='start/stop/restart memcache', action='store_true')), - (['--dovecot'], - dict(help='start/stop/restart dovecot', action='store_true')), - ] - - @expose(help="Start stack services") - def start(self): - """Start services""" - services = [] - if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php7 - or self.app.pargs.mysql or self.app.pargs.postfix - or self.app.pargs.hhvm or self.app.pargs.memcache - or self.app.pargs.dovecot or self.app.pargs.redis): - self.app.pargs.nginx = True - self.app.pargs.php = True - self.app.pargs.mysql = True - self.app.pargs.postfix = True - - if self.app.pargs.nginx: - if EEAptGet.is_installed(self, 'nginx-custom') or EEAptGet.is_installed(self,'nginx-mainline'): - services = services + ['nginx'] - else: - Log.info(self, "Nginx is not installed") - - if self.app.pargs.php: - if (EEVariables.ee_platform_distro == 'debian' or EEVariables.ee_platform_codename == 'precise'): - if EEAptGet.is_installed(self, 'php5-fpm'): - services = services + ['php5-fpm'] - else: - Log.info(self, "PHP5-FPM is not installed") - else: - if EEAptGet.is_installed(self, 'php5.6-fpm'): - services = services + ['php5.6-fpm'] - else: - Log.info(self, "PHP5.6-FPM is not installed") - - if EEAptGet.is_installed(self, 'php7.0-fpm'): - services = services + ['php7.0-fpm'] - else: - Log.info(self, "PHP7.0-FPM is not installed") - - if self.app.pargs.php7: - if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic'): - if EEAptGet.is_installed(self, 'php7.0-fpm'): - services = services + ['php7.0-fpm'] - else: - Log.info(self, "PHP7.0-FPM is not installed") - else: - Log.info(self, "Your platform does not support PHP 7") - - if self.app.pargs.mysql: - if ((EEVariables.ee_mysql_host is "localhost") or - (EEVariables.ee_mysql_host is "127.0.0.1")): - if (EEAptGet.is_installed(self, 'mysql-server') or - EEAptGet.is_installed(self, 'percona-server-server-5.6') or - EEAptGet.is_installed(self, 'mariadb-server')): - services = services + ['mysql'] - else: - Log.info(self, "MySQL is not installed") - else: - Log.warn(self, "Remote MySQL found, " - "Unable to check MySQL service status") - - if self.app.pargs.postfix: - if EEAptGet.is_installed(self, 'postfix'): - services = services + ['postfix'] - else: - Log.info(self, "Postfix is not installed") - - if self.app.pargs.hhvm: - if EEAptGet.is_installed(self, 'hhvm'): - services = services + ['hhvm'] - else: - Log.info(self, "HHVM is not installed") - if self.app.pargs.memcache: - if EEAptGet.is_installed(self, 'memcached'): - services = services + ['memcached'] - else: - Log.info(self, "Memcache is not installed") - - if self.app.pargs.dovecot: - if EEAptGet.is_installed(self, 'dovecot-core'): - services = services + ['dovecot'] - else: - Log.info(self, "Mail server is not installed") - - if self.app.pargs.redis: - if EEAptGet.is_installed(self, 'redis-server'): - services = services + ['redis-server'] - else: - Log.info(self, "Redis server is not installed") - - for service in services: - Log.debug(self, "Starting service: {0}".format(service)) - EEService.start_service(self, service) - - @expose(help="Stop stack services") - def stop(self): - """Stop services""" - services = [] - if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php7 - or self.app.pargs.mysql or self.app.pargs.postfix - or self.app.pargs.hhvm or self.app.pargs.memcache - or self.app.pargs.dovecot or self.app.pargs.redis): - self.app.pargs.nginx = True - self.app.pargs.php = True - self.app.pargs.mysql = True - self.app.pargs.postfix = True - - if self.app.pargs.nginx: - if EEAptGet.is_installed(self, 'nginx-custom') or EEAptGet.is_installed(self,'nginx-mainline'): - services = services + ['nginx'] - else: - Log.info(self, "Nginx is not installed") - - if self.app.pargs.php: - if (EEVariables.ee_platform_distro == 'debian' or EEVariables.ee_platform_codename == 'precise'): - if EEAptGet.is_installed(self, 'php5-fpm'): - services = services + ['php5-fpm'] - else: - Log.info(self, "PHP5-FPM is not installed") - else: - if EEAptGet.is_installed(self, 'php5.6-fpm'): - services = services + ['php5.6-fpm'] - else: - Log.info(self, "PHP5.6-FPM is not installed") - - if EEAptGet.is_installed(self, 'php7.0-fpm'): - services = services + ['php7.0-fpm'] - else: - Log.info(self, "PHP7.0-FPM is not installed") - - if self.app.pargs.php7: - if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic'): - if EEAptGet.is_installed(self, 'php7.0-fpm'): - services = services + ['php7.0-fpm'] - else: - Log.info(self, "PHP7.0-FPM is not installed") - else: - Log.info(self, "Your platform does not support PHP 7") - - if self.app.pargs.mysql: - if ((EEVariables.ee_mysql_host is "localhost") or - (EEVariables.ee_mysql_host is "127.0.0.1")): - if (EEAptGet.is_installed(self, 'mysql-server') or - EEAptGet.is_installed(self, 'percona-server-server-5.6') or - EEAptGet.is_installed(self, 'mariadb-server')): - services = services + ['mysql'] - else: - Log.info(self, "MySQL is not installed") - else: - Log.warn(self, "Remote MySQL found, " - "Unable to check MySQL service status") - - if self.app.pargs.postfix: - if EEAptGet.is_installed(self, 'postfix'): - services = services + ['postfix'] - else: - Log.info(self, "Postfix is not installed") - - if self.app.pargs.hhvm: - if EEAptGet.is_installed(self, 'hhvm'): - services = services + ['hhvm'] - else: - Log.info(self, "HHVM is not installed") - if self.app.pargs.memcache: - if EEAptGet.is_installed(self, 'memcached'): - services = services + ['memcached'] - else: - Log.info(self, "Memcache is not installed") - - if self.app.pargs.dovecot: - if EEAptGet.is_installed(self, 'dovecot-core'): - services = services + ['dovecot'] - else: - Log.info(self, "Mail server is not installed") - - if self.app.pargs.redis: - if EEAptGet.is_installed(self, 'redis-server'): - services = services + ['redis-server'] - else: - Log.info(self, "Redis server is not installed") - - for service in services: - Log.debug(self, "Stopping service: {0}".format(service)) - EEService.stop_service(self, service) - - @expose(help="Restart stack services") - def restart(self): - """Restart services""" - services = [] - if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php7 - or self.app.pargs.mysql or self.app.pargs.postfix - or self.app.pargs.hhvm or self.app.pargs.memcache - or self.app.pargs.dovecot or self.app.pargs.redis): - self.app.pargs.nginx = True - self.app.pargs.php = True - self.app.pargs.mysql = True - self.app.pargs.postfix = True - - if self.app.pargs.nginx: - if EEAptGet.is_installed(self, 'nginx-custom') or EEAptGet.is_installed(self,'nginx-mainline'): - services = services + ['nginx'] - else: - Log.info(self, "Nginx is not installed") - - if self.app.pargs.php: - if (EEVariables.ee_platform_distro == 'debian' or EEVariables.ee_platform_codename == 'precise'): - if EEAptGet.is_installed(self, 'php5-fpm'): - services = services + ['php5-fpm'] - else: - Log.info(self, "PHP5-FPM is not installed") - else: - if EEAptGet.is_installed(self, 'php5.6-fpm'): - services = services + ['php5.6-fpm'] - else: - Log.info(self, "PHP5.6-FPM is not installed") - - if EEAptGet.is_installed(self, 'php7.0-fpm'): - services = services + ['php7.0-fpm'] - else: - Log.info(self, "PHP7.0-FPM is not installed") - - if self.app.pargs.php7: - if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic'): - if EEAptGet.is_installed(self, 'php7.0-fpm'): - services = services + ['php7.0-fpm'] - else: - Log.info(self, "PHP7.0-FPM is not installed") - else: - Log.info(self, "Your platform does not support PHP 7") - - - if self.app.pargs.mysql: - if ((EEVariables.ee_mysql_host is "localhost") or - (EEVariables.ee_mysql_host is "127.0.0.1")): - if (EEAptGet.is_installed(self, 'mysql-server') or - EEAptGet.is_installed(self, 'percona-server-server-5.6') or - EEAptGet.is_installed(self, 'mariadb-server')): - services = services + ['mysql'] - else: - Log.info(self, "MySQL is not installed") - else: - Log.warn(self, "Remote MySQL found, " - "Unable to check MySQL service status") - - if self.app.pargs.postfix: - if EEAptGet.is_installed(self, 'postfix'): - services = services + ['postfix'] - else: - Log.info(self, "Postfix is not installed") - - if self.app.pargs.hhvm: - if EEAptGet.is_installed(self, 'hhvm'): - services = services + ['hhvm'] - else: - Log.info(self, "HHVM is not installed") - if self.app.pargs.memcache: - if EEAptGet.is_installed(self, 'memcached'): - services = services + ['memcached'] - else: - Log.info(self, "Memcache is not installed") - - if self.app.pargs.dovecot: - if EEAptGet.is_installed(self, 'dovecot-core'): - services = services + ['dovecot'] - else: - Log.info(self, "Mail server is not installed") - - if self.app.pargs.redis: - if EEAptGet.is_installed(self, 'redis-server'): - services = services + ['redis-server'] - else: - Log.info(self, "Redis server is not installed") - - for service in services: - Log.debug(self, "Restarting service: {0}".format(service)) - EEService.restart_service(self, service) - - @expose(help="Get stack status") - def status(self): - """Status of services""" - services = [] - if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php7 - or self.app.pargs.mysql or self.app.pargs.postfix - or self.app.pargs.hhvm or self.app.pargs.memcache - or self.app.pargs.dovecot or self.app.pargs.redis): - self.app.pargs.nginx = True - self.app.pargs.php = True - self.app.pargs.mysql = True - self.app.pargs.postfix = True - self.app.pargs.hhvm = True - - if self.app.pargs.nginx: - if EEAptGet.is_installed(self, 'nginx-custom') or EEAptGet.is_installed(self,'nginx-mainline'): - services = services + ['nginx'] - else: - Log.info(self, "Nginx is not installed") - - if self.app.pargs.php: - if (EEVariables.ee_platform_distro == 'debian' or EEVariables.ee_platform_codename == 'precise'): - if EEAptGet.is_installed(self, 'php5-fpm'): - services = services + ['php5-fpm'] - else: - Log.info(self, "PHP5-FPM is not installed") - else: - if EEAptGet.is_installed(self, 'php5.6-fpm'): - services = services + ['php5.6-fpm'] - else: - Log.info(self, "PHP5.6-FPM is not installed") - - if EEAptGet.is_installed(self, 'php7.0-fpm'): - services = services + ['php7.0-fpm'] - else: - Log.info(self, "PHP7.0-FPM is not installed") - - if self.app.pargs.php7: - if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic'): - if EEAptGet.is_installed(self, 'php7.0-fpm'): - services = services + ['php7.0-fpm'] - else: - Log.info(self, "PHP7.0-FPM is not installed") - else: - Log.info(self, "Your platform does not support PHP 7") - - if self.app.pargs.mysql: - if ((EEVariables.ee_mysql_host is "localhost") or - (EEVariables.ee_mysql_host is "127.0.0.1")): - if (EEAptGet.is_installed(self, 'mysql-server') or - EEAptGet.is_installed(self, 'percona-server-server-5.6') or - EEAptGet.is_installed(self, 'mariadb-server')): - services = services + ['mysql'] - else: - Log.info(self, "MySQL is not installed") - else: - Log.warn(self, "Remote MySQL found, " - "Unable to check MySQL service status") - - if self.app.pargs.postfix: - if EEAptGet.is_installed(self, 'postfix'): - services = services + ['postfix'] - else: - Log.info(self, "Postfix is not installed") - - if self.app.pargs.hhvm: - if EEAptGet.is_installed(self, 'hhvm'): - services = services + ['hhvm'] - else: - Log.info(self, "HHVM is not installed") - if self.app.pargs.memcache: - if EEAptGet.is_installed(self, 'memcached'): - services = services + ['memcached'] - else: - Log.info(self, "Memcache is not installed") - - if self.app.pargs.dovecot: - if EEAptGet.is_installed(self, 'dovecot-core'): - services = services + ['dovecot'] - else: - Log.info(self, "Mail server is not installed") - - if self.app.pargs.redis: - if EEAptGet.is_installed(self, 'redis-server'): - services = services + ['redis-server'] - else: - Log.info(self, "Redis server is not installed") - - for service in services: - if EEService.get_service_status(self, service): - Log.info(self, "{0:10}: {1}".format(service, "Running")) - - @expose(help="Reload stack services") - def reload(self): - """Reload service""" - services = [] - if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php7 - or self.app.pargs.mysql or self.app.pargs.postfix - or self.app.pargs.hhvm or self.app.pargs.memcache - or self.app.pargs.dovecot or self.app.pargs.redis): - self.app.pargs.nginx = True - self.app.pargs.php = True - self.app.pargs.mysql = True - self.app.pargs.postfix = True - - if self.app.pargs.nginx: - if EEAptGet.is_installed(self, 'nginx-custom') or EEAptGet.is_installed(self,'nginx-mainline'): - services = services + ['nginx'] - else: - Log.info(self, "Nginx is not installed") - - if self.app.pargs.php: - if (EEVariables.ee_platform_distro == 'debian' or EEVariables.ee_platform_codename == 'precise'): - if EEAptGet.is_installed(self, 'php5-fpm'): - services = services + ['php5-fpm'] - else: - Log.info(self, "PHP5-FPM is not installed") - else: - if EEAptGet.is_installed(self, 'php5.6-fpm'): - services = services + ['php5.6-fpm'] - else: - Log.info(self, "PHP5.6-FPM is not installed") - - if EEAptGet.is_installed(self, 'php7.0-fpm'): - services = services + ['php7.0-fpm'] - else: - Log.info(self, "PHP7.0-FPM is not installed") - - if self.app.pargs.php7: - if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic'): - if EEAptGet.is_installed(self, 'php7.0-fpm'): - services = services + ['php7.0-fpm'] - else: - Log.info(self, "PHP7.0-FPM is not installed") - else: - Log.info(self, "Your platform does not support PHP 7") - - if self.app.pargs.mysql: - if ((EEVariables.ee_mysql_host is "localhost") or - (EEVariables.ee_mysql_host is "127.0.0.1")): - if (EEAptGet.is_installed(self, 'mysql-server') or - EEAptGet.is_installed(self, 'percona-server-server-5.6') or - EEAptGet.is_installed(self, 'mariadb-server')): - services = services + ['mysql'] - else: - Log.info(self, "MySQL is not installed") - else: - Log.warn(self, "Remote MySQL found, " - "Unable to check MySQL service status") - - if self.app.pargs.postfix: - if EEAptGet.is_installed(self, 'postfix'): - services = services + ['postfix'] - else: - Log.info(self, "Postfix is not installed") - - if self.app.pargs.hhvm: - Log.info(self, "HHVM does not support to reload") - - if self.app.pargs.memcache: - if EEAptGet.is_installed(self, 'memcached'): - services = services + ['memcached'] - else: - Log.info(self, "Memcache is not installed") - - if self.app.pargs.dovecot: - if EEAptGet.is_installed(self, 'dovecot-core'): - services = services + ['dovecot'] - else: - Log.info(self, "Mail server is not installed") - - if self.app.pargs.redis: - if EEAptGet.is_installed(self, 'redis-server'): - services = services + ['redis-server'] - else: - Log.info(self, "Redis server is not installed") - - for service in services: - Log.debug(self, "Reloading service: {0}".format(service)) - EEService.reload_service(self, service) diff --git a/ee/cli/plugins/stack_upgrade.py b/ee/cli/plugins/stack_upgrade.py deleted file mode 100644 index 8d025faf8..000000000 --- a/ee/cli/plugins/stack_upgrade.py +++ /dev/null @@ -1,270 +0,0 @@ -from cement.core.controller import CementBaseController, expose -from cement.core import handler, hook -from ee.core.logging import Log -from ee.core.variables import EEVariables -from ee.core.aptget import EEAptGet -from ee.core.apt_repo import EERepo -from ee.core.services import EEService -from ee.core.fileutils import EEFileUtils -from ee.core.shellexec import EEShellExec -from ee.core.git import EEGit -from ee.core.download import EEDownload -import configparser -import os - - -class EEStackUpgradeController(CementBaseController): - class Meta: - label = 'upgrade' - stacked_on = 'stack' - stacked_type = 'nested' - description = ('Upgrade stack safely') - arguments = [ - (['--all'], - dict(help='Upgrade all stack', action='store_true')), - (['--web'], - dict(help='Upgrade web stack', action='store_true')), - (['--admin'], - dict(help='Upgrade admin tools stack', action='store_true')), - (['--mail'], - dict(help='Upgrade mail server stack', action='store_true')), - (['--mailscanner'], - dict(help='Upgrade mail scanner stack', action='store_true')), - (['--nginx'], - dict(help='Upgrade Nginx stack', action='store_true')), - (['--nginxmainline'], - dict(help='Upgrade Nginx Mainline stack', action='store_true')), - (['--php'], - dict(help='Upgrade PHP stack', action='store_true')), - (['--mysql'], - dict(help='Upgrade MySQL stack', action='store_true')), - (['--hhvm'], - dict(help='Upgrade HHVM stack', action='store_true')), - (['--postfix'], - dict(help='Upgrade Postfix stack', action='store_true')), - (['--wpcli'], - dict(help='Upgrade WPCLI', action='store_true')), - (['--redis'], - dict(help='Upgrade Redis', action='store_true')), - (['--php56'], - dict(help="Upgrade to PHP5.6 from PHP5.5", - action='store_true')), - (['--no-prompt'], - dict(help="Upgrade Packages without any prompt", - action='store_true')), - ] - - @expose(hide=True) - def upgrade_php56(self): - if EEVariables.ee_platform_distro == "ubuntu": - if os.path.isfile("/etc/apt/sources.list.d/ondrej-php5-5_6-{0}." - "list".format(EEVariables.ee_platform_codename)): - Log.error(self, "Unable to find PHP 5.5") - else: - if not(os.path.isfile(EEVariables.ee_repo_file_path) and - EEFileUtils.grep(self, EEVariables.ee_repo_file_path, - "php55")): - Log.error(self, "Unable to find PHP 5.5") - - Log.info(self, "During PHP update process non nginx-cached" - " parts of your site may remain down.") - - # Check prompt - if (not self.app.pargs.no_prompt): - start_upgrade = input("Do you want to continue:[y/N]") - if start_upgrade != "Y" and start_upgrade != "y": - Log.error(self, "Not starting PHP package update") - - if EEVariables.ee_platform_distro == "ubuntu": - EERepo.remove(self, ppa="ppa:ondrej/php5") - EERepo.add(self, ppa=EEVariables.ee_php_repo) - else: - EEAptGet.remove(self, ["php5-xdebug"]) - EEFileUtils.searchreplace(self, EEVariables.ee_repo_file_path, - "php55", "php56") - - Log.info(self, "Updating apt-cache, please wait...") - EEAptGet.update(self) - Log.info(self, "Installing packages, please wait ...") - if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial' or EEVariables.ee_platform_codename == 'bionic'): - EEAptGet.install(self, EEVariables.ee_php5_6 + EEVariables.ee_php_extra) - else: - EEAptGet.install(self, EEVariables.ee_php) - - if EEVariables.ee_platform_distro == "debian": - EEShellExec.cmd_exec(self, "pecl install xdebug") - - with open("/etc/php5/mods-available/xdebug.ini", - encoding='utf-8', mode='a') as myfile: - myfile.write(";zend_extension=/usr/lib/php5/20131226/" - "xdebug.so\n") - - EEFileUtils.create_symlink(self, ["/etc/php5/mods-available/" - "xdebug.ini", "/etc/php5/fpm/conf.d" - "/20-xedbug.ini"]) - - Log.info(self, "Successfully upgraded from PHP 5.5 to PHP 5.6") - - @expose(hide=True) - def default(self): - # All package update - if ((not self.app.pargs.php56)): - - apt_packages = [] - packages = [] - - if ((not self.app.pargs.web) and (not self.app.pargs.nginx) and - (not self.app.pargs.php) and (not self.app.pargs.mysql) and - (not self.app.pargs.postfix) and (not self.app.pargs.hhvm) and - (not self.app.pargs.mailscanner) and (not self.app.pargs.all) - and (not self.app.pargs.wpcli) and (not self.app.pargs.redis) and (not self.app.pargs.nginxmainline)): - self.app.pargs.web = True - - if self.app.pargs.all: - self.app.pargs.web = True - self.app.pargs.mail = True - - if self.app.pargs.web: - if EEAptGet.is_installed(self, 'nginx-custom'): - self.app.pargs.nginx = True - else: - Log.info(self, "Nginx is not already installed") - self.app.pargs.php = True - self.app.pargs.mysql = True - self.app.pargs.postfix = True - self.app.pargs.wpcli = True - - if self.app.pargs.mail: - self.app.pargs.nginx = True - self.app.pargs.php = True - self.app.pargs.mysql = True - self.app.pargs.wpcli = True - self.app.pargs.postfix = True - - if EEAptGet.is_installed(self, 'dovecot-core'): - apt_packages = apt_packages + EEVariables.ee_mail - self.app.pargs.mailscanner = True - else: - Log.info(self, "Mail server is not installed") - - if self.app.pargs.nginx : - if EEAptGet.is_installed(self, 'nginx-custom'): - apt_packages = apt_packages + EEVariables.ee_nginx - else: - Log.info(self, "Nginx Stable is not already installed") - - if self.app.pargs.php: - if (EEVariables.ee_platform_distro == 'debian' or EEVariables.ee_platform_codename == 'precise'): - if EEAptGet.is_installed(self, 'php5-fpm'): - apt_packages = apt_packages + EEVariables.ee_php - else: - Log.info(self, "PHP is not installed") - if EEAptGet.is_installed(self, 'php7.0-fpm'): - apt_packages = apt_packages + EEVariables.ee_php7_0 - else: - if EEAptGet.is_installed(self, 'php5.6-fpm'): - apt_packages = apt_packages + EEVariables.ee_php5_6 + EEVariables.ee_php_extra - else: - Log.info(self, "PHP 5.6 is not installed") - if EEAptGet.is_installed(self, 'php7.0-fpm'): - apt_packages = apt_packages + EEVariables.ee_php7_0 + EEVariables.ee_php_extra - else: - Log.info(self, "PHP 7.0 is not installed") - - if self.app.pargs.hhvm: - if EEAptGet.is_installed(self, 'hhvm'): - apt_packages = apt_packages + EEVariables.ee_hhvm - else: - Log.info(self, "HHVM is not installed") - - if self.app.pargs.mysql: - if EEAptGet.is_installed(self, 'mariadb-server'): - apt_packages = apt_packages + EEVariables.ee_mysql - else: - Log.info(self, "MariaDB is not installed") - - if self.app.pargs.postfix: - if EEAptGet.is_installed(self, 'postfix'): - apt_packages = apt_packages + EEVariables.ee_postfix - else: - Log.info(self, "Postfix is not installed") - - if self.app.pargs.redis: - if EEAptGet.is_installed(self, 'redis-server'): - apt_packages = apt_packages + EEVariables.ee_redis - else: - Log.info(self, "Redis is not installed") - - if self.app.pargs.wpcli: - if os.path.isfile('/usr/bin/wp'): - packages = packages + [["https://github.com/wp-cli/wp-cli/" - "releases/download/v{0}/" - "wp-cli-{0}.phar" - "".format(EEVariables.ee_wp_cli), - "/usr/bin/wp", - "WP-CLI"]] - else: - Log.info(self, "WPCLI is not installed with EasyEngine") - - if self.app.pargs.mailscanner: - if EEAptGet.is_installed(self, 'amavisd-new'): - apt_packages = (apt_packages + EEVariables.ee_mailscanner) - else: - Log.info(self, "MailScanner is not installed") - - if len(packages) or len(apt_packages): - - Log.info(self, "During package update process non nginx-cached" - " parts of your site may remain down") - # Check prompt - if (not self.app.pargs.no_prompt): - start_upgrade = input("Do you want to continue:[y/N]") - if start_upgrade != "Y" and start_upgrade != "y": - Log.error(self, "Not starting package update") - - Log.info(self, "Updating packages, please wait...") - if len(apt_packages): - # apt-get update - EEAptGet.update(self) - # Update packages - EEAptGet.install(self, apt_packages) - - # Post Actions after package updates - if (set(EEVariables.ee_nginx).issubset(set(apt_packages))): - EEService.restart_service(self, 'nginx') - if (EEVariables.ee_platform_distro == 'debian' or EEVariables.ee_platform_codename == 'precise'): - if set(EEVariables.ee_php).issubset(set(apt_packages)): - EEService.restart_service(self, 'php5-fpm') - else: - if set(EEVariables.ee_php5_6).issubset(set(apt_packages)): - EEService.restart_service(self, 'php5.6-fpm') - if set(EEVariables.ee_php7_0).issubset(set(apt_packages)): - EEService.restart_service(self, 'php7.0-fpm') - if set(EEVariables.ee_hhvm).issubset(set(apt_packages)): - EEService.restart_service(self, 'hhvm') - if set(EEVariables.ee_postfix).issubset(set(apt_packages)): - EEService.restart_service(self, 'postfix') - if set(EEVariables.ee_mysql).issubset(set(apt_packages)): - EEService.restart_service(self, 'mysql') - if set(EEVariables.ee_mail).issubset(set(apt_packages)): - EEService.restart_service(self, 'dovecot') - if set(EEVariables.ee_redis).issubset(set(apt_packages)): - EEService.restart_service(self, 'redis-server') - - if len(packages): - if self.app.pargs.wpcli: - EEFileUtils.remove(self,['/usr/bin/wp']) - - Log.debug(self, "Downloading following: {0}".format(packages)) - EEDownload.download(self, packages) - - if self.app.pargs.wpcli: - EEFileUtils.chmod(self, "/usr/bin/wp", 0o775) - - Log.info(self, "Successfully updated packages") - - # PHP 5.6 to 5.6 - elif (self.app.pargs.php56): - self.upgrade_php56() - else: - self.app.args.print_help() diff --git a/ee/cli/plugins/sync.py b/ee/cli/plugins/sync.py deleted file mode 100644 index dd89dfed6..000000000 --- a/ee/cli/plugins/sync.py +++ /dev/null @@ -1,95 +0,0 @@ -from cement.core.controller import CementBaseController, expose -from cement.core import handler, hook -from ee.core.fileutils import EEFileUtils -from ee.cli.plugins.sitedb import * -from ee.core.mysql import * -from ee.core.logging import Log - - -def ee_sync_hook(app): - # do something with the ``app`` object here. - pass - - -class EESyncController(CementBaseController): - class Meta: - label = 'sync' - stacked_on = 'base' - stacked_type = 'nested' - description = 'synchronize EasyEngine database' - - @expose(hide=True) - def default(self): - self.sync() - - @expose(hide=True) - def sync(self): - """ - 1. reads database information from wp/ee-config.php - 2. updates records into ee database accordingly. - """ - Log.info(self, "Synchronizing ee database, please wait...") - sites = getAllsites(self) - if not sites: - pass - for site in sites: - if site.site_type in ['mysql', 'wp', 'wpsubdir', 'wpsubdomain']: - ee_site_webroot = site.site_path - # Read config files - configfiles = glob.glob(ee_site_webroot + '/*-config.php') - - #search for wp-config.php inside htdocs/ - if not configfiles: - Log.debug(self, "Config files not found in {0}/ " - .format(ee_site_webroot)) - if site.site_type != 'mysql': - Log.debug(self, "Searching wp-config.php in {0}/htdocs/ " - .format(ee_site_webroot)) - configfiles = glob.glob(ee_site_webroot + '/htdocs/wp-config.php') - - if configfiles: - if EEFileUtils.isexist(self, configfiles[0]): - ee_db_name = (EEFileUtils.grep(self, configfiles[0], - 'DB_NAME').split(',')[1] - .split(')')[0].strip().replace('\'', '')) - ee_db_user = (EEFileUtils.grep(self, configfiles[0], - 'DB_USER').split(',')[1] - .split(')')[0].strip().replace('\'', '')) - ee_db_pass = (EEFileUtils.grep(self, configfiles[0], - 'DB_PASSWORD').split(',')[1] - .split(')')[0].strip().replace('\'', '')) - ee_db_host = (EEFileUtils.grep(self, configfiles[0], - 'DB_HOST').split(',')[1] - .split(')')[0].strip().replace('\'', '')) - - # Check if database really exist - try: - if not EEMysql.check_db_exists(self, ee_db_name): - # Mark it as deleted if not exist - ee_db_name = 'deleted' - ee_db_user = 'deleted' - ee_db_pass = 'deleted' - except StatementExcecutionError as e: - Log.debug(self, str(e)) - except Exception as e: - Log.debug(self, str(e)) - - if site.db_name != ee_db_name: - # update records if any mismatch found - Log.debug(self, "Updating ee db record for {0}" - .format(site.sitename)) - updateSiteInfo(self, site.sitename, - db_name=ee_db_name, - db_user=ee_db_user, - db_password=ee_db_pass, - db_host=ee_db_host) - else: - Log.debug(self, "Config files not found for {0} " - .format(site.sitename)) - - -def load(app): - # register the plugin class.. this only happens if the plugin is enabled - handler.register(EESyncController) - # register a hook (function) to run after arguments are parsed. - hook.register('post_argument_parsing', ee_sync_hook) diff --git a/ee/cli/plugins/update.py b/ee/cli/plugins/update.py deleted file mode 100644 index 8680d68ef..000000000 --- a/ee/cli/plugins/update.py +++ /dev/null @@ -1,45 +0,0 @@ -from cement.core.controller import CementBaseController, expose -from cement.core import handler, hook -from ee.core.download import EEDownload -from ee.core.logging import Log -import time -import os - - -def ee_update_hook(app): - # do something with the ``app`` object here. - pass - - -class EEUpdateController(CementBaseController): - class Meta: - label = 'ee_update' - stacked_on = 'base' - aliases = ['update'] - aliases_only = True - stacked_type = 'nested' - description = ('update EasyEngine to latest version') - usage = "ee update" - - @expose(hide=True) - def default(self): - filename = "eeupdate" + time.strftime("%Y%m%d-%H%M%S") - EEDownload.download(self, [["http://rt.cx/eeup", - "/tmp/{0}".format(filename), - "update script"]]) - try: - Log.info(self, "updating EasyEngine, please wait...") - os.system("bash /tmp/{0}".format(filename)) - except OSError as e: - Log.debug(self, str(e)) - Log.error(self, "EasyEngine update failed !") - except Exception as e: - Log.debug(self, str(e)) - Log.error(self, "EasyEngine update failed !") - - -def load(app): - # register the plugin class.. this only happens if the plugin is enabled - handler.register(EEUpdateController) - # register a hook (function) to run after arguments are parsed. - hook.register('post_argument_parsing', ee_update_hook) diff --git a/ee/cli/templates/15-content_filter_mode.mustache b/ee/cli/templates/15-content_filter_mode.mustache deleted file mode 100644 index 6fd8f218e..000000000 --- a/ee/cli/templates/15-content_filter_mode.mustache +++ /dev/null @@ -1,27 +0,0 @@ -use strict; - -# You can modify this file to re-enable SPAM checking through spamassassin -# and to re-enable antivirus checking. - -# -# Default antivirus checking mode -# Please note, that anti-virus checking is DISABLED by -# default. -# If You wish to enable it, please uncomment the following lines: - - -@bypass_virus_checks_maps = ( - \%bypass_virus_checks, \@bypass_virus_checks_acl, \$bypass_virus_checks_re); - - -# -# Default SPAM checking mode -# Please note, that anti-spam checking is DISABLED by -# default. -# If You wish to enable it, please uncomment the following lines: - - -@bypass_spam_checks_maps = ( - \%bypass_spam_checks, \@bypass_spam_checks_acl, \$bypass_spam_checks_re); - -1; # ensure a defined return diff --git a/ee/cli/templates/22222.mustache b/ee/cli/templates/22222.mustache deleted file mode 100644 index 21dbcd1a3..000000000 --- a/ee/cli/templates/22222.mustache +++ /dev/null @@ -1,64 +0,0 @@ -# EasyEngine admin NGINX CONFIGURATION - -server { - - listen 22222 default_server ssl http2; - - access_log /var/log/nginx/22222.access.log rt_cache; - error_log /var/log/nginx/22222.error.log; - - ssl_certificate {{webroot}}22222/cert/22222.crt; - ssl_certificate_key {{webroot}}22222/cert/22222.key; - - # Force HTTP to HTTPS - error_page 497 =200 https://$host:22222$request_uri; - - root {{webroot}}22222/htdocs; - index index.php index.htm index.html; - - # Turn on directory listing - autoindex on; - - # HTTP Authentication on port 22222 - include common/acl.conf; - - location / { - try_files $uri $uri/ /index.php?$args; - } - - # Display menu at location /fpm/status/ - location = /fpm/status/ {} - - location ~ /fpm/status/(.*) { - try_files $uri =404; - include fastcgi_params; - fastcgi_param SCRIPT_NAME /status; - fastcgi_pass $1; - } - - location ~ \.php$ { - try_files $uri =404; - include fastcgi_params; - fastcgi_pass php; - } - - # ViMbAdmin Rules - location = /vimbadmin/ { - return 301 $scheme://$host:22222/vimbadmin/public/; - } - - location ~* \.(js|css|jpg|gif|png)$ { - root {{webroot}}22222/htdocs/; - } - - location ~* /vimbadmin/public/(.*)/(.*) { - root {{webroot}}22222/htdocs/vimbadmin/public; - try_files $uri $uri/ /vimbadmin/public/index.php?$args; - } - - location ~* /vimbadmin/public/(.*) { - root {{webroot}}22222/htdocs/vimbadmin/public; - try_files $uri $uri/ /vimbadmin/public/index.php?$args; - } - -} diff --git a/ee/cli/templates/50-user.mustache b/ee/cli/templates/50-user.mustache deleted file mode 100644 index 0cee70fbd..000000000 --- a/ee/cli/templates/50-user.mustache +++ /dev/null @@ -1,17 +0,0 @@ -use strict; -$sa_spam_subject_tag = undef; -$spam_quarantine_to = undef; -$sa_tag_level_deflt = undef; - -# Prevent spams from automatically rejected by mail-server -$final_spam_destiny = D_PASS; - -# We need to provide list of domains for which filtering need to be done -@lookup_sql_dsn = ( -['DBI:mysql:database=vimbadmin;host={{host}};port=3306', -'vimbadmin', -'{{password}}']); - -$sql_select_policy = 'SELECT domain FROM domain WHERE CONCAT("@",domain) IN (%k)'; - -1; # ensure a defined return diff --git a/ee/cli/templates/__init__.py b/ee/cli/templates/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/ee/cli/templates/acl.mustache b/ee/cli/templates/acl.mustache deleted file mode 100644 index 122675f9c..000000000 --- a/ee/cli/templates/acl.mustache +++ /dev/null @@ -1,8 +0,0 @@ -# EasyEngine (ee) protect locations using -# HTTP authentication || IP address -satisfy any; -auth_basic "Restricted Area"; -auth_basic_user_file htpasswd-ee; -# Allowed IP Address List -allow 127.0.0.1; -deny all; diff --git a/ee/cli/templates/anemometer.mustache b/ee/cli/templates/anemometer.mustache deleted file mode 100644 index 7b85a6a7d..000000000 --- a/ee/cli/templates/anemometer.mustache +++ /dev/null @@ -1,255 +0,0 @@ -<?php -$conf['datasources']['localhost'] = array( - 'host' => '{{host}}', - 'port' => '{{port}}', - 'db' => 'slow_query_log', - 'user' => '{{user}}', - 'password' => '{{password}}', - 'tables' => array( - 'global_query_review' => 'fact', - 'global_query_review_history' => 'dimension' - ), - 'source_type' => 'slow_query_log' -); - -$conf['default_report_action'] = 'report'; - -$conf['reviewers'] = array( 'dba1','dba2'); -$conf['review_types'] = array( 'good', 'bad', 'ticket-created', 'needs-fix', 'fixed', 'needs-analysis', 'review-again'); - -$conf['history_defaults'] = array( - 'output' => 'table', - 'fact-group' => 'date', - 'fact-order' => 'date DESC', - 'fact-limit' => '90', - 'dimension-ts_min_start' => date("Y-m-d H:i:s", strtotime( '-90 day')), - 'dimension-ts_min_end' => date("Y-m-d H:i:s"), - 'table_fields' => array('date', 'index_ratio','query_time_avg','rows_sent_avg','ts_cnt','Query_time_sum','Lock_time_sum','Rows_sent_sum','Rows_examined_sum','Tmp_table_sum','Filesort_sum','Full_scan_sum') -); - -$conf['report_defaults'] = array( - 'fact-group' => 'checksum', - 'fact-order' => 'Query_time_sum DESC', - 'fact-limit' => '20', - 'dimension-ts_min_start' => date("Y-m-d H:i:s", strtotime( '-1 day')), - 'dimension-ts_min_end' => date("Y-m-d H:i:s"), - 'table_fields' => array('checksum','snippet', 'index_ratio','query_time_avg','rows_sent_avg','ts_cnt','Query_time_sum','Lock_time_sum','Rows_sent_sum','Rows_examined_sum','Tmp_table_sum','Filesort_sum','Full_scan_sum'), - 'dimension-pivot-hostname_max' => null -); - -$conf['graph_defaults'] = array( - 'fact-group' => 'minute_ts', - 'fact-order' => 'minute_ts', - 'fact-limit' => '', - 'dimension-ts_min_start' => date("Y-m-d H:i:s", strtotime( '-7 day')), - 'dimension-ts_min_end' => date("Y-m-d H:i:s"), - 'table_fields' => array('minute_ts'), - 'plot_field' => 'Query_time_sum', -); - -$conf['report_defaults']['performance_schema'] = array( - 'fact-order' => 'SUM_TIMER_WAIT DESC', - 'fact-limit' => '20', - 'fact-group' => 'DIGEST', - 'table_fields' => array( 'DIGEST', 'snippet', 'index_ratio', 'COUNT_STAR', 'SUM_TIMER_WAIT', 'SUM_LOCK_TIME','SUM_ROWS_AFFECTED','SUM_ROWS_SENT','SUM_ROWS_EXAMINED','SUM_CREATED_TMP_TABLES','SUM_SORT_SCAN','SUM_NO_INDEX_USED' ) -); - -$conf['history_defaults']['performance_schema'] = array( - 'fact-order' => 'SUM_TIMER_WAIT DESC', - 'fact-limit' => '20', - 'fact-group' => 'DIGEST', - 'table_fields' => array( 'DIGEST', 'index_ratio', 'COUNT_STAR', 'SUM_LOCK_TIME','SUM_ROWS_AFFECTED','SUM_ROWS_SENT','SUM_ROWS_EXAMINED','SUM_CREATED_TMP_TABLES','SUM_SORT_SCAN','SUM_NO_INDEX_USED' ) -); - -$conf['report_defaults']['performance_schema_history'] = array( - 'fact-group' => 'DIGEST', - 'fact-order' => 'SUM_TIMER_WAIT DESC', - 'fact-limit' => '20', - 'dimension-FIRST_SEEN_start' => date("Y-m-d H:i:s", strtotime( '-1 day')), - 'dimension-FIRST_SEEN_end' => date("Y-m-d H:i:s"), - 'table_fields' => array( 'DIGEST', 'snippet', 'index_ratio', 'COUNT_STAR', 'SUM_LOCK_TIME','SUM_ROWS_AFFECTED','SUM_ROWS_SENT','SUM_ROWS_EXAMINED','SUM_CREATED_TMP_TABLES','SUM_SORT_SCAN','SUM_NO_INDEX_USED' ) -); - -$conf['graph_defaults']['performance_schema_history'] = array( - 'fact-group' => 'minute_ts', - 'fact-order' => 'minute_ts', - 'fact-limit' => '', - 'dimension-FIRST_SEEN_start' => date("Y-m-d H:i:s", strtotime( '-7 day')), - 'dimension-FIRST_SEEN_end' => date("Y-m-d H:i:s"), - 'table_fields' => array('minute_ts'), - 'plot_field' => 'SUM_TIMER_WAIT', - 'dimension-pivot-hostname_max' => null -); - -$conf['history_defaults']['performance_schema_history'] = array( - 'output' => 'table', - 'fact-group' => 'date', - 'fact-order' => 'date DESC', - 'fact-limit' => '90', - 'dimension-FIRST_SEEN_start' => date("Y-m-d H:i:s", strtotime( '-90 day')), - 'dimension-FIRST_SEEN_end' => date("Y-m-d H:i:s"), - 'table_fields' => array( 'date', 'snippet', 'index_ratio', 'COUNT_STAR', 'SUM_LOCK_TIME','SUM_ROWS_AFFECTED','SUM_ROWS_SENT','SUM_ROWS_EXAMINED','SUM_CREATED_TMP_TABLES','SUM_SORT_SCAN','SUM_NO_INDEX_USED' ) -); -$conf['plugins'] = array( - - 'visual_explain' => '/usr/bin/pt-visual-explain', - 'query_advisor' => '/usr/bin/pt-query-advisor', - - 'show_create' => true, - 'show_status' => true, - - 'explain' => function ($sample) { - $conn = array(); - - if (!array_key_exists('hostname_max',$sample) or strlen($sample['hostname_max']) < 5) - { - return; - } - - $pos = strpos($sample['hostname_max'], ':'); - if ($pos === false) - { - $conn['port'] = 3306; - $conn['host'] = $sample['hostname_max']; - } - else - { - $parts = preg_split("/:/", $sample['hostname_max']); - $conn['host'] = $parts[0]; - $conn['port'] = $parts[1]; - } - - $conn['db'] = 'mysql'; - if ($sample['db_max'] != '') - { - $conn['db'] = $sample['db_max']; - } - - $conn['user'] = '{{user}}'; - $conn['password'] = '{{password}}'; - - return $conn; - }, -); - -$conf['reports']['slow_query_log'] = array( - 'join' => array ( - 'dimension' => 'USING (`checksum`)' - ), - 'fields' => array( - 'fact' => array( - 'group' => 'group', - 'order' => 'order', - 'having' => 'having', - 'limit' => 'limit', - 'first_seen'=> 'clear|reldate|ge|where', - 'where' => 'raw_where', - 'sample' => 'clear|like|where', - 'checksum' => 'clear|where', - 'reviewed_status' => 'clear|where', - - ), - - 'dimension' => array( - 'extra_fields' => 'where', - 'hostname_max' => 'clear|where', - 'ts_min' => 'date_range|reldate|clear|where', - 'pivot-hostname_max' => 'clear|pivot|select', - 'pivot-checksum' => 'clear|pivot|select', - ), - ), - 'custom_fields' => array( - 'checksum' => 'checksum', - 'date' => 'DATE(ts_min)', - 'hour' => 'substring(ts_min,1,13)', - 'hour_ts' => 'round(unix_timestamp(substring(ts_min,1,13)))', - 'minute_ts' => 'round(unix_timestamp(substring(ts_min,1,16)))', - 'minute' => 'substring(ts_min,1,16)', - 'snippet' => 'LEFT(dimension.sample,20)', - 'index_ratio' =>'ROUND(SUM(Rows_examined_sum)/SUM(rows_sent_sum),2)', - 'query_time_avg' => 'SUM(Query_time_sum) / SUM(ts_cnt)', - 'rows_sent_avg' => 'ROUND(SUM(Rows_sent_sum)/SUM(ts_cnt),0)', - ), - - 'callbacks' => array( - 'table' => array( - 'date' => function ($x) { $type=''; if ( date('N',strtotime($x)) >= 6) { $type = 'weekend'; } return array($x,$type); }, - 'checksum' => function ($x) { return array(dec2hex($x), ''); } - ) - ) - -); - -$conf['reports']['performance_schema'] = array( - 'fields' => array( - 'fact' => array( - 'order' => 'order', - 'having' => 'having', - 'limit' => 'limit', - 'first_seen' => 'date_range|reldate|clear|where', - 'where' => 'raw_where', - 'DIGEST' => 'clear|where', - 'DIGEST_TEXT' => 'clear|like|where', - 'group' => 'group', - ), - ), - 'custom_fields' => array( - 'snippet' => 'LEFT(fact.DIGEST_TEXT,20)', - 'index_ratio' =>'ROUND(SUM_ROWS_EXAMINED/SUM_ROWS_SENT,2)', - 'rows_sent_avg' => 'ROUND(SUM_ROWS_SENT/COUNT_STAR,0)', - - ), - - 'special_field_names' => array( - 'time' => 'FIRST_SEEN', - 'checksum' => 'DIGEST', - 'sample' => 'DIGEST_TEXT', - 'fingerprint' => 'DIGEST_TEXT', - ), -); - -$conf['reports']['performance_schema_history'] = array( - 'join' => array ( - 'dimension' => 'USING (`DIGEST`)' - ), - 'fields' => array( - 'fact' => array( - 'group' => 'group', - 'order' => 'order', - 'having' => 'having', - 'limit' => 'limit', - 'first_seen'=> 'clear|reldate|ge|where', - 'where' => 'raw_where', - 'DIGEST_TEXT' => 'clear|like|where', - 'DIGEST' => 'clear|where', - 'reviewed_status' => 'clear|where', - - ), - - 'dimension' => array( - 'extra_fields' => 'where', - 'hostname' => 'clear|where', - 'FIRST_SEEN' => 'date_range|reldate|clear|where', - 'pivot-hostname' => 'clear|pivot|select', - ), - ), - 'custom_fields' => array( - 'date' => 'DATE(fact.FIRST_SEEN)', - 'snippet' => 'LEFT(fact.DIGEST_TEXT,20)', - 'index_ratio' =>'ROUND(SUM_ROWS_EXAMINED/SUM_ROWS_SENT,2)', - 'rows_sent_avg' => 'ROUND(SUM_ROWS_SENT/COUNT_STAR,0)', - 'hour' => 'substring(dimension.FIRST_SEEN,1,13)', - 'hour_ts' => 'round(unix_timestamp(substring(dimension.FIRST_SEEN,1,13)))', - 'minute_ts' => 'round(unix_timestamp(substring(dimension.FIRST_SEEN,1,16)))', - 'minute' => 'substring(dimension.FIRST_SEEN,1,16)', - ), - - 'special_field_names' => array( - 'time' => 'FIRST_SEEN', - 'checksum' => 'DIGEST', - 'hostname' => 'hostname', - 'sample' => 'DIGEST_TEXT' - ), -); - -?> diff --git a/ee/cli/templates/auth-sql-conf.mustache b/ee/cli/templates/auth-sql-conf.mustache deleted file mode 100644 index 8854747ba..000000000 --- a/ee/cli/templates/auth-sql-conf.mustache +++ /dev/null @@ -1,11 +0,0 @@ -passdb { - driver = sql - args = /etc/dovecot/dovecot-sql.conf.ext -} -userdb { - driver = prefetch -} -userdb { - driver = sql - args = /etc/dovecot/dovecot-sql.conf.ext -} diff --git a/ee/cli/templates/blockips.mustache b/ee/cli/templates/blockips.mustache deleted file mode 100644 index 8228bedbb..000000000 --- a/ee/cli/templates/blockips.mustache +++ /dev/null @@ -1,2 +0,0 @@ -# Block IP Address -# deny 1.1.1.1; diff --git a/ee/cli/templates/default-sieve.mustache b/ee/cli/templates/default-sieve.mustache deleted file mode 100644 index 625323223..000000000 --- a/ee/cli/templates/default-sieve.mustache +++ /dev/null @@ -1,4 +0,0 @@ -require "fileinto"; -if header :contains "X-Spam-Flag" "YES" { - fileinto "Junk"; -} diff --git a/ee/cli/templates/dovecot-sql-conf.mustache b/ee/cli/templates/dovecot-sql-conf.mustache deleted file mode 100644 index 0ec50c113..000000000 --- a/ee/cli/templates/dovecot-sql-conf.mustache +++ /dev/null @@ -1,12 +0,0 @@ -driver = mysql -connect = host={{host}} user=vimbadmin password={{password}} dbname=vimbadmin -default_pass_scheme = MD5 -password_query = SELECT username as user, password as password, \ -homedir AS home, maildir AS mail, \ -concat('*:bytes=', quota) as quota_rule, uid, gid \ -FROM mailbox \ -WHERE username = '%Lu' AND active = '1' \ -AND ( access_restriction = 'ALL' OR LOCATE( access_restriction, '%Us' ) > 0 ) -user_query = SELECT homedir AS home, maildir AS mail, \ -concat('*:bytes=', quota) as quota_rule, uid, gid \ -FROM mailbox WHERE username = '%u' diff --git a/ee/cli/templates/dovecot.mustache b/ee/cli/templates/dovecot.mustache deleted file mode 100644 index f7370da83..000000000 --- a/ee/cli/templates/dovecot.mustache +++ /dev/null @@ -1,60 +0,0 @@ -protocols = imap pop3 lmtp sieve - -mail_location = maildir:/var/vmail/%d/%n - -disable_plaintext_auth = no -auth_mechanisms = plain login -#!include auth-system.conf.ext -!include auth-sql.conf.ext - -ssl_protocols = !SSLv2 !SSLv3 - -service lmtp { - unix_listener /var/spool/postfix/private/dovecot-lmtp { - mode = 0600 - user = postfix - group = postfix - } -} -service auth { - unix_listener /var/spool/postfix/private/auth { - mode = 0666 - user = postfix - group = postfix - } - unix_listener auth-userdb { - mode = 0600 - user = vmail - } - user = dovecot -} -service auth-worker { - user = vmail -} - -log_path = /var/log/dovecot.log - -mail_plugins = $mail_plugins autocreate - -plugin { - autocreate = Trash - autocreate2 = Junk - autocreate3 = Drafts - autocreate4 = Sent - autosubscribe = Trash - autosubscribe2 = Junk - autosubscribe3 = Drafts - autosubscribe4 = Sent -} - -protocol lmtp { - postmaster_address = {{email}} - mail_plugins = $mail_plugins sieve -} - -plugin { - sieve = ~/.dovecot.sieve - sieve_global_path = /var/lib/dovecot/sieve/default.sieve - sieve_global_dir = /var/lib/dovecot/sieve/ - sieve_dir = ~/sieve -} diff --git a/ee/cli/templates/ee-plus.mustache b/ee/cli/templates/ee-plus.mustache deleted file mode 100644 index fc90602bf..000000000 --- a/ee/cli/templates/ee-plus.mustache +++ /dev/null @@ -1,84 +0,0 @@ -## -# EasyEngine Settings -## - - -tcp_nopush on; -tcp_nodelay on; -types_hash_max_size 2048; - -server_tokens off; -reset_timedout_connection on; -add_header X-Powered-By "EasyEngine {{ version }}"; -add_header rt-Fastcgi-Cache $upstream_cache_status; - -# Limit Request -limit_req_status 403; -limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s; - -# Proxy Settings -# set_real_ip_from proxy-server-ip; -# real_ip_header X-Forwarded-For; - -fastcgi_read_timeout 300; -client_max_body_size 100m; - -## -# SSL Settings -## - -ssl_session_cache shared:SSL:20m; -ssl_session_timeout 10m; -ssl_prefer_server_ciphers on; -ssl_ciphers HIGH:!aNULL:!MD5:!kEDH; -ssl_protocols TLSv1 TLSv1.1 TLSv1.2; - -## -# Basic Settings -## -server_names_hash_bucket_size 16384; -# server_name_in_redirect off; - - -## -# Logging Settings -## - -access_log /var/log/nginx/access.log; -error_log /var/log/nginx/error.log; - -# Log format Settings -log_format rt_cache '$remote_addr $upstream_response_time $upstream_cache_status [$time_local] ' -'$http_host "$request" $status $body_bytes_sent ' -'"$http_referer" "$http_user_agent" "$request_body"'; - -## -# Gzip Settings -## - -gzip on; -gzip_disable "msie6"; - -gzip_vary on; -gzip_proxied any; -gzip_comp_level 6; -gzip_buffers 16 8k; -gzip_http_version 1.1; -gzip_types - application/atom+xml - application/javascript - application/json - application/rss+xml - application/vnd.ms-fontobject - application/x-font-ttf - application/x-web-app-manifest+json - application/xhtml+xml - application/xml - font/opentype - image/svg+xml - image/x-icon - text/css - text/plain - text/x-component - text/xml - text/javascript; diff --git a/ee/cli/templates/fastcgi.mustache b/ee/cli/templates/fastcgi.mustache deleted file mode 100644 index 6d4bc4baa..000000000 --- a/ee/cli/templates/fastcgi.mustache +++ /dev/null @@ -1,10 +0,0 @@ -# FastCGI cache settings -fastcgi_cache_path /var/run/nginx-cache levels=1:2 keys_zone=WORDPRESS:50m inactive=60m; -fastcgi_cache_key "$scheme$request_method$host$request_uri"; -fastcgi_cache_use_stale error timeout invalid_header updating http_500 http_503; -fastcgi_cache_valid 200 301 302 404 1h; -fastcgi_buffers 16 16k; -fastcgi_buffer_size 32k; -fastcgi_param SERVER_NAME $http_host; -fastcgi_ignore_headers Cache-Control Expires Set-Cookie; -fastcgi_keep_conn on; diff --git a/ee/cli/templates/info_mysql.mustache b/ee/cli/templates/info_mysql.mustache deleted file mode 100644 index 8d7ac950e..000000000 --- a/ee/cli/templates/info_mysql.mustache +++ /dev/null @@ -1,10 +0,0 @@ - -MySQL ({{version}}) on {{host}}: - -port {{port}} -wait_timeout {{wait_timeout}} -interactive_timeout {{interactive_timeout}} -max_used_connections {{max_used_connections}} -datadir {{datadir}} -socket {{socket}} -my.cnf [PATH] /etc/mysql/conf.d/my.cnf diff --git a/ee/cli/templates/info_nginx.mustache b/ee/cli/templates/info_nginx.mustache deleted file mode 100644 index 6420405bf..000000000 --- a/ee/cli/templates/info_nginx.mustache +++ /dev/null @@ -1,10 +0,0 @@ - -NGINX ({{version}}): - -user {{user}} -worker_processes {{worker_processes}} -worker_connections {{worker_connections}} -keepalive_timeout {{keepalive_timeout}} -fastcgi_read_timeout {{fastcgi_read_timeout}} -client_max_body_size {{client_max_body_size}} -allow {{allow}} diff --git a/ee/cli/templates/info_php.mustache b/ee/cli/templates/info_php.mustache deleted file mode 100644 index 1638cf8a5..000000000 --- a/ee/cli/templates/info_php.mustache +++ /dev/null @@ -1,35 +0,0 @@ - -PHP ({{version}}): - -user {{user}} -expose_php {{expose_php}} -memory_limit {{memory_limit}} -post_max_size {{post_max_size}} -upload_max_filesize {{upload_max_filesize}} -max_execution_time {{max_execution_time}} - -Information about www.conf -ping.path {{www_ping_path}} -pm.status_path {{www_pm_status_path}} -process_manager {{www_pm}} -pm.max_requests {{www_pm_max_requests}} -pm.max_children {{www_pm_max_children}} -pm.start_servers {{www_pm_start_servers}} -pm.min_spare_servers {{www_pm_min_spare_servers}} -pm.max_spare_servers {{www_pm_max_spare_servers}} -request_terminate_timeout {{www_request_terminate_timeout}} -xdebug.profiler_enable_trigger {{www_xdebug_profiler_enable_trigger}} -listen {{www_listen}} - -Information about debug.conf -ping.path {{debug_ping_path}} -pm.status_path {{debug_pm_status_path}} -process_manager {{debug_pm}} -pm.max_requests {{debug_pm_max_requests}} -pm.max_children {{debug_pm_max_children}} -pm.start_servers {{debug_pm_start_servers}} -pm.min_spare_servers {{debug_pm_min_spare_servers}} -pm.max_spare_servers {{debug_pm_max_spare_servers}} -request_terminate_timeout {{debug_request_terminate_timeout}} -xdebug.profiler_enable_trigger {{debug_xdebug_profiler_enable_trigger}} -listen {{debug_listen}} diff --git a/ee/cli/templates/locations-php7.mustache b/ee/cli/templates/locations-php7.mustache deleted file mode 100644 index ee0ebb484..000000000 --- a/ee/cli/templates/locations-php7.mustache +++ /dev/null @@ -1,68 +0,0 @@ -# NGINX CONFIGURATION FOR COMMON LOCATION -# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee) -# Basic locations files -location = /favicon.ico { - access_log off; - log_not_found off; - expires max; -} -location = /robots.txt { - # Some WordPress plugin gererate robots.txt file - # Refer #340 issue - try_files $uri $uri/ /index.php?$args; - access_log off; - log_not_found off; -} -# Cache static files -location ~* \.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|css|rss|atom|js|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf|swf)$ { - add_header "Access-Control-Allow-Origin" "*"; - access_log off; - log_not_found off; - expires max; -} -# Security settings for better privacy -# Deny hidden files -location ~ /\.well-known { - allow all; -} -location ~ /\. { - deny all; - access_log off; - log_not_found off; -} -# Deny backup extensions & log files -location ~* ^.+\.(bak|log|old|orig|original|php#|php~|php_bak|save|swo|swp|sql)$ { - deny all; - access_log off; - log_not_found off; -} -# Return 403 forbidden for readme.(txt|html) or license.(txt|html) or example.(txt|html) -if ($uri ~* "^.+(readme|license|example)\.(txt|html)$") { - return 403; -} -# Status pages -location = /nginx_status { - stub_status on; - access_log off; - include common/acl.conf; -} -location ~ ^/(status|ping)$ { - include fastcgi_params; - fastcgi_pass php7; - include common/acl.conf; -} -# EasyEngine (ee) utilities -# phpMyAdmin settings -location = /pma { - return 301 https://$host:22222/db/pma; -} -location = /phpMyAdmin { - return 301 https://$host:22222/db/pma; -} -location = /phpmyadmin { - return 301 https://$host:22222/db/pma; -} -# Adminer settings -location = /adminer { - return 301 https://$host:22222/db/adminer; -} diff --git a/ee/cli/templates/locations.mustache b/ee/cli/templates/locations.mustache deleted file mode 100644 index 3bfda44f4..000000000 --- a/ee/cli/templates/locations.mustache +++ /dev/null @@ -1,68 +0,0 @@ -# NGINX CONFIGURATION FOR COMMON LOCATION -# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee) -# Basic locations files -location = /favicon.ico { - access_log off; - log_not_found off; - expires max; -} -location = /robots.txt { - # Some WordPress plugin gererate robots.txt file - # Refer #340 issue - try_files $uri $uri/ /index.php?$args; - access_log off; - log_not_found off; -} -# Cache static files -location ~* \.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|css|rss|atom|js|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf|swf)$ { - add_header "Access-Control-Allow-Origin" "*"; - access_log off; - log_not_found off; - expires max; -} -# Security settings for better privacy -# Deny hidden files -location ~ /\.well-known { - allow all; -} -location ~ /\. { - deny all; - access_log off; - log_not_found off; -} -# Deny backup extensions & log files -location ~* ^.+\.(bak|log|old|orig|original|php#|php~|php_bak|save|swo|swp|sql)$ { - deny all; - access_log off; - log_not_found off; -} -# Return 403 forbidden for readme.(txt|html) or license.(txt|html) or example.(txt|html) -if ($uri ~* "^.+(readme|license|example)\.(txt|html)$") { - return 403; -} -# Status pages -location = /nginx_status { - stub_status on; - access_log off; - include common/acl.conf; -} -location ~ ^/(status|ping)$ { - include fastcgi_params; - fastcgi_pass php; - include common/acl.conf; -} -# EasyEngine (ee) utilities -# phpMyAdmin settings -location = /pma { - return 301 https://$host:22222/db/pma; -} -location = /phpMyAdmin { - return 301 https://$host:22222/db/pma; -} -location = /phpmyadmin { - return 301 https://$host:22222/db/pma; -} -# Adminer settings -location = /adminer { - return 301 https://$host:22222/db/adminer; -} diff --git a/ee/cli/templates/nginx-core.mustache b/ee/cli/templates/nginx-core.mustache deleted file mode 100644 index bdce6d2d1..000000000 --- a/ee/cli/templates/nginx-core.mustache +++ /dev/null @@ -1,60 +0,0 @@ -## -# EasyEngine Settings -## - -server_tokens off; -reset_timedout_connection on; -add_header X-Powered-By "EasyEngine {{version}}"; -add_header rt-Fastcgi-Cache $upstream_cache_status; - -# Limit Request -limit_req_status 403; -limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s; - -# Proxy Settings -# set_real_ip_from proxy-server-ip; -# real_ip_header X-Forwarded-For; - -fastcgi_read_timeout 300; -client_max_body_size 100m; - -# SSL Settings -ssl_session_cache shared:SSL:20m; -ssl_session_timeout 10m; -{{#Ubuntu}} -ssl_prefer_server_ciphers on; -{{/Ubuntu}} -ssl_ciphers HIGH:!aNULL:!MD5:!kEDH; - -# Log format Settings -log_format rt_cache '$remote_addr $upstream_response_time $upstream_cache_status [$time_local] ' -'$http_host "$request" $status $body_bytes_sent ' -'"$http_referer" "$http_user_agent"'; - - -# GZip settings -gzip_vary on; -gzip_proxied any; -gzip_comp_level 6; -gzip_buffers 16 8k; -gzip_http_version 1.1; -# Compress all output labeled with one of the following MIME-types. -gzip_types - application/atom+xml - application/javascript - application/json - application/rss+xml - application/vnd.ms-fontobject - application/x-font-ttf - application/x-web-app-manifest+json - application/xhtml+xml - application/xml - font/opentype - image/svg+xml - image/x-icon - text/css - text/plain - text/x-component - text/xml - text/javascript; - # text/html is always compressed by HttpGzipModule diff --git a/ee/cli/templates/pagespeed-common.mustache b/ee/cli/templates/pagespeed-common.mustache deleted file mode 100644 index 5b789c8dc..000000000 --- a/ee/cli/templates/pagespeed-common.mustache +++ /dev/null @@ -1,44 +0,0 @@ -# HTTPS Support -# pagespeed FetchHttps enable; - -# PageSpeed Filters -# CSS Minification -# pagespeed EnableFilters combine_css,rewrite_css; - -# JS Minification -# pagespeed EnableFilters combine_javascript,rewrite_javascript; - -# Images Optimization -#pagespeed EnableFilters lazyload_images; -#pagespeed EnableFilters rewrite_images; -#pagespeed EnableFilters convert_jpeg_to_progressive,convert_png_to_jpeg,convert_jpeg_to_webp,convert_to_webp_lossless; - -# Remove comments from HTML -#pagespeed EnableFilters remove_comments; -# Remove WHITESPACE from HTML -#pagespeed EnableFilters collapse_whitespace; - - -# CDN Support -#pagespeed MapRewriteDomain cdn.example.com www.example.com; - - -########################################################################################################################### -# DO NOT EDIT AFTER THIS LINE # -########################################################################################################################### - -# PageSpeed Admin -location /ngx_pagespeed_statistics { include common/acl.conf; } -location /ngx_pagespeed_global_statistics { include common/acl.conf; } -location /ngx_pagespeed_message { include common/acl.conf; } -location /pagespeed_console { include common/acl.conf; } -location ~ ^/pagespeed_admin { include common/acl.conf; } -location ~ ^/pagespeed_global_admin { include common/acl.conf; } - -# Ensure requests for pagespeed optimized resources go to the pagespeed handler -# and no extraneous headers get set. -location ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" { - add_header "" ""; -} -location ~ "^/pagespeed_static/" { } -location ~ "^/ngx_pagespeed_beacon$" { } diff --git a/ee/cli/templates/pagespeed-global.mustache b/ee/cli/templates/pagespeed-global.mustache deleted file mode 100644 index bb5ab51eb..000000000 --- a/ee/cli/templates/pagespeed-global.mustache +++ /dev/null @@ -1,21 +0,0 @@ -# Turning the module on and off -pagespeed on; - -# Configuring PageSpeed Filters -pagespeed RewriteLevel PassThrough; - -# Needs to exist and be writable by nginx. Use tmpfs for best performance. -pagespeed MemcachedServers "127.0.0.1:11211"; -pagespeed FileCachePath /var/ngx_pagespeed_cache; - -# PageSpeed Admin -pagespeed StatisticsPath /ngx_pagespeed_statistics; -pagespeed GlobalStatisticsPath /ngx_pagespeed_global_statistics; -pagespeed MessagesPath /ngx_pagespeed_message; -pagespeed ConsolePath /pagespeed_console; -pagespeed AdminPath /pagespeed_admin; -pagespeed GlobalAdminPath /pagespeed_global_admin; - -# PageSpeed Cache Purge -pagespeed EnableCachePurge on; -pagespeed PurgeMethod PURGE; diff --git a/ee/cli/templates/php-fpm.mustache b/ee/cli/templates/php-fpm.mustache deleted file mode 100644 index eae67a415..000000000 --- a/ee/cli/templates/php-fpm.mustache +++ /dev/null @@ -1,5 +0,0 @@ -[global] -pid = {{pid}} -error_log = {{error_log}} -log_level = notice -include = {{include}} \ No newline at end of file diff --git a/ee/cli/templates/php-hhvm.mustache b/ee/cli/templates/php-hhvm.mustache deleted file mode 100644 index 198d81de1..000000000 --- a/ee/cli/templates/php-hhvm.mustache +++ /dev/null @@ -1,10 +0,0 @@ -# PHP NGINX CONFIGURATION -# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee) -location / { - try_files $uri $uri/ /index.php?$args; -} -location ~ \.php$ { - try_files $uri =404; - include fastcgi_params; - fastcgi_pass hhvm; -} diff --git a/ee/cli/templates/php.mustache b/ee/cli/templates/php.mustache deleted file mode 100644 index b12b250aa..000000000 --- a/ee/cli/templates/php.mustache +++ /dev/null @@ -1,10 +0,0 @@ -# PHP NGINX CONFIGURATION -# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee) -location / { - try_files $uri $uri/ /index.php?$args; -} -location ~ \.php$ { - try_files $uri =404; - include fastcgi_params; - fastcgi_pass php; -} diff --git a/ee/cli/templates/php7.mustache b/ee/cli/templates/php7.mustache deleted file mode 100644 index 85f3e44b4..000000000 --- a/ee/cli/templates/php7.mustache +++ /dev/null @@ -1,10 +0,0 @@ -# PHP NGINX CONFIGURATION -# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee) -location / { - try_files $uri $uri/ /index.php?$args; -} -location ~ \.php$ { - try_files $uri =404; - include fastcgi_params; - fastcgi_pass php7; -} diff --git a/ee/cli/templates/redis-hhvm.mustache b/ee/cli/templates/redis-hhvm.mustache deleted file mode 100644 index 22abdd2ba..000000000 --- a/ee/cli/templates/redis-hhvm.mustache +++ /dev/null @@ -1,58 +0,0 @@ -# Redis NGINX CONFIGURATION -# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee) -set $skip_cache 0; -# POST requests and URL with a query string should always go to php -if ($request_method = POST) { - set $skip_cache 1; -} -if ($query_string != "") { - set $skip_cache 1; -} -# Don't cache URL containing the following segments -if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|wp-.*\.php|index.php|/feed/|.*sitemap.*\.xml)") { - set $skip_cache 1; -} -# Don't use the cache for logged in users or recent commenter or customer with items in cart -if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|[a-z0-9]+_items_in_cart") { - set $skip_cache 1; -} -# Use cached or actual file if they exists, Otherwise pass request to WordPress -location / { - try_files $uri $uri/ /index.php?$args; -} - -location /redis-fetch { - internal ; - set $redis_key $args; - redis_pass redis; -} -location /redis-store { - internal ; - set_unescape_uri $key $arg_key ; - redis2_query set $key $echo_request_body; - redis2_query expire $key 14400; - redis2_pass redis; - -} - -location ~ \.php$ { - set $key "nginx-cache:$scheme$request_method$host$request_uri"; - try_files $uri =404; - - srcache_fetch_skip $skip_cache; - srcache_store_skip $skip_cache; - - srcache_response_cache_control off; - - set_escape_uri $escaped_key $key; - - srcache_fetch GET /redis-fetch $key; - srcache_store PUT /redis-store key=$escaped_key; - - more_set_headers 'X-SRCache-Fetch-Status $srcache_fetch_status'; - more_set_headers 'X-SRCache-Store-Status $srcache_store_status'; - - include fastcgi_params; - fastcgi_param HTTP_ACCEPT_ENCODING ""; - fastcgi_pass hhvm; -} diff --git a/ee/cli/templates/redis-php7.mustache b/ee/cli/templates/redis-php7.mustache deleted file mode 100644 index a3dede557..000000000 --- a/ee/cli/templates/redis-php7.mustache +++ /dev/null @@ -1,56 +0,0 @@ -# Redis NGINX CONFIGURATION -# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee) -set $skip_cache 0; -# POST requests and URL with a query string should always go to php -if ($request_method = POST) { - set $skip_cache 1; -} -if ($query_string != "") { - set $skip_cache 1; -} -# Don't cache URL containing the following segments -if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|wp-.*\.php|index.php|/feed/|.*sitemap.*\.xml)") { - set $skip_cache 1; -} -# Don't use the cache for logged in users or recent commenter or customer with items in cart -if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|[a-z0-9]+_items_in_cart") { - set $skip_cache 1; -} -# Use cached or actual file if they exists, Otherwise pass request to WordPress -location / { - try_files $uri $uri/ /index.php?$args; -} - -location /redis-fetch { - internal ; - set $redis_key $args; - redis_pass redis; -} -location /redis-store { - internal ; - set_unescape_uri $key $arg_key ; - redis2_query set $key $echo_request_body; - redis2_query expire $key 14400; - redis2_pass redis; -} - -location ~ \.php$ { - set $key "nginx-cache:$scheme$request_method$host$request_uri"; - try_files $uri =404; - - srcache_fetch_skip $skip_cache; - srcache_store_skip $skip_cache; - - srcache_response_cache_control off; - - set_escape_uri $escaped_key $key; - - srcache_fetch GET /redis-fetch $key; - srcache_store PUT /redis-store key=$escaped_key; - - more_set_headers 'X-SRCache-Fetch-Status $srcache_fetch_status'; - more_set_headers 'X-SRCache-Store-Status $srcache_store_status'; - - include fastcgi_params; - fastcgi_pass php7; -} diff --git a/ee/cli/templates/redis.mustache b/ee/cli/templates/redis.mustache deleted file mode 100644 index 82c353b31..000000000 --- a/ee/cli/templates/redis.mustache +++ /dev/null @@ -1,57 +0,0 @@ -# Redis NGINX CONFIGURATION -# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee) -set $skip_cache 0; -# POST requests and URL with a query string should always go to php -if ($request_method = POST) { - set $skip_cache 1; -} -if ($query_string != "") { - set $skip_cache 1; -} -# Don't cache URL containing the following segments -if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|wp-.*\.php|index.php|/feed/|.*sitemap.*\.xml)") { - set $skip_cache 1; -} -# Don't use the cache for logged in users or recent commenter or customer with items in cart -if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|[a-z0-9]+_items_in_cart") { - set $skip_cache 1; -} -# Use cached or actual file if they exists, Otherwise pass request to WordPress -location / { - try_files $uri $uri/ /index.php?$args; -} - -location /redis-fetch { - internal ; - set $redis_key $args; - redis_pass redis; -} -location /redis-store { - internal ; - set_unescape_uri $key $arg_key ; - redis2_query set $key $echo_request_body; - redis2_query expire $key 14400; - redis2_pass redis; - -} - -location ~ \.php$ { - set $key "nginx-cache:$scheme$request_method$host$request_uri"; - try_files $uri =404; - - srcache_fetch_skip $skip_cache; - srcache_store_skip $skip_cache; - - srcache_response_cache_control off; - - set_escape_uri $escaped_key $key; - - srcache_fetch GET /redis-fetch $key; - srcache_store PUT /redis-store key=$escaped_key; - - more_set_headers 'X-SRCache-Fetch-Status $srcache_fetch_status'; - more_set_headers 'X-SRCache-Store-Status $srcache_store_status'; - - include fastcgi_params; - fastcgi_pass php; -} diff --git a/ee/cli/templates/siteinfo.mustache b/ee/cli/templates/siteinfo.mustache deleted file mode 100644 index 3d0acbb6f..000000000 --- a/ee/cli/templates/siteinfo.mustache +++ /dev/null @@ -1,15 +0,0 @@ -Information about {{domain}}: - -Nginx configuration {{type}} {{enable}} -{{#php_version}}PHP Version {{php_version}}{{/php_version}} -{{#hhvm}}HHVM {{hhvm}}{{/hhvm}} -{{#ssl}}SSL {{ssl}}{{/ssl}} -{{#sslprovider}}SSL PROVIDER {{sslprovider}}{{/sslprovider}} -{{#sslexpiry}}SSL EXPIRY DATE {{sslexpiry}}{{/sslexpiry}} -access_log {{accesslog}} -error_log {{errorlog}} -{{#webroot}}Webroot {{webroot}}{{/webroot}} -{{#dbname}}DB_NAME {{dbname}}{{/dbname}} -{{#dbname}}DB_USER {{dbuser}}{{/dbname}} -{{#dbname}}DB_PASS {{dbpass}}{{/dbname}} -{{#tablepref}}table_prefix {{tableprefix}}{{/tablepref}} diff --git a/ee/cli/templates/upstream.mustache b/ee/cli/templates/upstream.mustache deleted file mode 100644 index 473fd1bc6..000000000 --- a/ee/cli/templates/upstream.mustache +++ /dev/null @@ -1,26 +0,0 @@ -# Common upstream settings -upstream php { -# server unix:/run/php5-fpm.sock; -server 127.0.0.1:{{php}}; -} -upstream debug { -# Debug Pool -server 127.0.0.1:{{debug}}; -} -{{#php7conf}} -upstream php7 { -server 127.0.0.1:{{php7}}; -} -upstream debug7 { -# Debug Pool -server 127.0.0.1:{{debug7}}; -} -{{/php7conf}} - -{{#hhvmconf}} -upstream hhvm { -# HHVM Pool -server 127.0.0.1:{{hhvm}}; -server 127.0.0.1:{{php}} backup; -} -{{/hhvmconf}} diff --git a/ee/cli/templates/vimbadmin.mustache b/ee/cli/templates/vimbadmin.mustache deleted file mode 100644 index 808d57cef..000000000 --- a/ee/cli/templates/vimbadmin.mustache +++ /dev/null @@ -1,662 +0,0 @@ -;; This file is licenesed Under GNU GENERAL PUBLIC LICENSE Version 3 -;; © Copyright 2011 - 2014 Open Source Solutions Limited, Dublin, Ireland. -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; ViMbAdmin :: Virtual Mailbox Admin -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; IMPORTANT: Review and change all options in [user] -;; -;; ** This is for ViMbAdmin V3 and later ** -;; -;; See: https://github.com/opensolutions/ViMbAdmin/wiki/Configuration - -[user] - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; Installation Keys and Salts -; -; During installation, you will be prompted to enter strings here. This -; is to verify that you are in fact the person authorised to complete the -; installation as well as provide security for cookies and passwords. - -securitysalt = "{{salt}}" -resources.auth.oss.rememberme.salt = "{{salt}}" -defaults.mailbox.password_salt = "{{salt}}" - - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; When installing for the first time, it may be useful to set the following -; to 1 BUT ensure you set it to zero again in a production system - -phpSettings.display_startup_errors = 0 -phpSettings.display_errors = 0 -resources.frontController.params.displayExceptions = 0 - - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; You database and caching connection. -;; - -resources.doctrine2.connection.options.driver = 'mysqli' -resources.doctrine2.connection.options.dbname = 'vimbadmin' -resources.doctrine2.connection.options.user = 'vimbadmin' -resources.doctrine2.connection.options.password = '{{password}}' -resources.doctrine2.connection.options.host = '{{host}}' -resources.doctrine2.connection.options.charset = 'utf8' - -;; Doctrine2 requires Memcache for maximum efficency. Without Memcache -;; it can be highly inefficient and will slow page requests down. -;; -;; You are strongly advised to install memcache and comment ArrayCache -;; here and uncomment MemcacheCache. -;; - -resources.doctrine2cache.type = 'ArrayCache' -;resources.doctrine2cache.type = 'MemcacheCache' -;resources.doctrine2cache.memcache.servers.0.host = '127.0.0.1' -resources.doctrine2cache.namespace = 'ViMbAdmin3' - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; Default values used when creating domains -; -; See: https://github.com/opensolutions/ViMbAdmin/wiki/Configuration -; See: https://github.com/opensolutions/ViMbAdmin/wiki/Quotas - -defaults.domain.quota = 0 -defaults.domain.maxquota = 0 -defaults.domain.transport = "virtual" -defaults.domain.aliases = 0 -defaults.domain.mailboxes = 0 - -defaults.quota.multiplier = 'MB' - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Use server side filtering to reduce pagination time on client side -;; Defaults to off / false -defaults.server_side.pagination.enable = false -defaults.server_side.pagination.min_search_str = 3 -defaults.server_side.pagination.max_result_cnt = 500 - -;; Separate configuration for domain list -defaults.server_side.pagination.domain.enable = false -defaults.server_side.pagination.domain.min_search_str = 3 -defaults.server_side.pagination.domain.max_result_cnt = 500 - -; The number of rows displayed in the tables -; must be one of these: 10, 25, 50, 100 -defaults.table.entries = 50 - - - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Options for the display of domain and mailbox sizes -;; -;; See: https://github.com/opensolutions/ViMbAdmin/wiki/Mailbox-Sizes -;; -;; Enable or disable display of sizes. Default: disabled - -defaults.list_size.disabled = true - -;; Maildir size units. By default: KB. One of B, KB, MB or GB. -defaults.list_size.multiplier = 'GB' - - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; Default values for creating mailboxes - -; This sets the uid and gid columns in the mailbox table to the below values -defaults.mailbox.uid = 5000 -defaults.mailbox.gid = 5000 - - -; Set the homedir and maildir values in the mailbox table where the -; following substitutions apply: -; -; %d -> domain part of email address -; %u -> user part of email address -; $m -> full email address -; -; -; http://wiki2.dovecot.org/VirtualUsers/Home - -defaults.mailbox.maildir = "maildir:/var/vmail/%d/%u" -defaults.mailbox.homedir = "/var/vmail/" - -;minimum mailbox password length -defaults.mailbox.min_password_length = 8 - -; The password hashing function to use. Set to one of: -; -; "plain" - password stored as clear text -; "md5" - password hashed using MD5 without salt (PHP md5()) -; "md5.salted" - password hashed using MD5 with salt (see below) -; "sha1" - password hashed using sha1 without salt -; "sha1.salted" - password hashed using sha1 with salt defined below -; "crypt:XXX" - call the PHP crypt function (with random salt) where XXX is one of: md5, blowfish, sha256, sha512 -; "dovecot:XXX" - call the Dovecot password generator (see next option below) and use the -; scheme specified by XXX. To see available schemes, use 'dovecotpw -l' -; or 'doveadm pw -l' - -defaults.mailbox.password_scheme = "md5" - -; The path to (and initial option(s) if necessary) the Dovecot password generator. Typical -; values may be something like: -; -; "/usr/bin/doveadm pw" -; "/usr/bin/dovecotpw" - -defaults.mailbox.dovecot_pw_binary = "/usr/bin/doveadm pw" - - - -;; A "mailbox alias" will, for example add the following entry to -;; the alias table for a mailbox: name@example.com -;; -;; name@example.com -> name@example.com -;; -;; This is required for aliasing an entire domain. If in doubt, leave it enabled. -mailboxAliases = 1 - - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; See: https://github.com/opensolutions/ViMbAdmin/wiki/Archiving-Mailboxes - -server_id = 1 - -;;Archive options -binary.path.chown_R = "/bin/chown -R" -binary.path.tar_cf = "/bin/tar -cf" -binary.path.tar_xf = "/bin/tar -xf" -binary.path.bzip2_q = "/bin/bzip2 -q" -binary.path.bunzip2_q = "/bin/bunzip2 -q" -binary.path.rm_rf = "/bin/rm -rf" - -archive.path = "/srv/archives" - - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; Enable mailbox deletion on the file system -; -; See: https://github.com/opensolutions/ViMbAdmin/wiki/Deleting-Mailboxes -; - -mailbox_deletion_fs_enabled = false - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; Export Mailbox Settings -; -; See: https://github.com/opensolutions/ViMbAdmin/wiki/Export-Settings -; -defaults.export_settings.disabled = true - - -;; Export settings alowed subnets -defaults.export_settings.allowed_subnet[] = "10." -defaults.export_settings.allowed_subnet[] = "192.168." - - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Settings email default values. -;; -;; Substituions are as follows: -;; -;; %d -> domain part of email address -;; %u -> user part of email address -;; $m -> full email address -;; -;; See (and skin) the following file to see how the below are used: -;; -;; views/mailbox/email/settings.phtml -;; - -server.smtp.enabled = 1 -server.smtp.host = "mail.%d" -server.smtp.user = "%m" -server.smtp.port = "465" -server.smtp.crypt = "SSL" - -server.pop3.enabled = 1 -server.pop3.host = "gpo.%d" -server.pop3.user = "%m" -server.pop3.port = "995" -server.pop3.crypt = "SSL" - -server.imap.enabled = 1 -server.imap.host = "gpo.%d" -server.imap.user = "%m" -server.imap.port = "993" -server.imap.crypt = "SSL" - -server.webmail.enabled = 1 -server.webmail.host = "https://webmail.%d" -server.webmail.user = "%m" - - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Identity - -identity.orgname = "Example Limited" -identity.name = "Example Support Team" -identity.email = "support@example.com" -identity.autobot.name = "ViMbAdmin Autobot" -identity.autobot.email = "autobot@example.com" -identity.mailer.name = "ViMbAdmin Autobot" -identity.mailer.email = "do-not-reply@example.com" - -identity.sitename = "ViMbAdmin" -identity.siteurl = "https://www.example.com/vimbadmin/" - - -;; -;; All mail and correspondence will come from the following;; - -server.email.name = "ViMbAdmin Administrator" -server.email.address = "support@example.com" - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Skinning -;; -;; You can skin ViMbAdmin pages if you wish. -;; -;; See: https://github.com/opensolutions/ViMbAdmin/wiki/Skinning - -; resources.smarty.skin = "myskin" - - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; See: http://framework.zend.com/manual/en/zend.mail.smtp-authentication.html -;; -;; Ensure you have a working mail server configuration so the system can -;; send emails: -;; -resources.mailer.smtphost = "localhost" -;resources.mailer.username = "" -;resources.mailer.password = "" -;resources.mailer.auth = "" -;resources.mailer.ssl = "" -;resources.mailer.port = "25" - - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Local filesystem logging. -;; -;; We log various things to var/log/YYYY/MM/ if you enable the logger here. -;; -;; It is useful to use the email logger to be alerted of serious errors. -;; - -ondemand_resources.logger.enabled = 1 - -;ondemand_resources.logger.writers.email.from = "admin@example.com" -;ondemand_resources.logger.writers.email.to = "admin@example.com" -;ondemand_resources.logger.writers.email.prefix = "ViMbAdmin_Error" -;ondemand_resources.logger.writers.email.level = 3 - -ondemand_resources.logger.writers.stream.level = 7 - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; ViMbAdmin performs a version check on administrator login and alerts the -;; user if there is a newer version available. -;; -;; This can be disabled by setting the below to 1 -;; - -skipVersionCheck = 0 - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; ViMbAdmin 'pings' the developers as part of the set up process to let -;; them know there is a new installation. -;; -;; All we are interested in is knowing whether people are using the software -;; or not and whether continued support and development is worth the time -;; and effort. -;; -;; Unless you're very shy, PLEASE LET US KNOW YOU'RE USING IT! -;; -;; This can be disabled by setting the below to 1 -;; - -skipInstallPingback = 0 - - - - - - - - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; Allow admins to dictate whether a user can use BOTH, IMAP ONLY, -; POP3 ONLY when creating mailboxes. -; -; Must be supported by your POP3/IMAP server. -; -; See https://github.com/opensolutions/ViMbAdmin/wiki/POP3-IMAP-Access-Permissions -; for documentation. -; -; This is handled via a plugin -; - -vimbadmin_plugins.AccessPermissions.disabled = false - -; specify the options which should be allowed for access restrictions -vimbadmin_plugins.AccessPermissions.type.SMTP = "SMTP" -vimbadmin_plugins.AccessPermissions.type.IMAP = "IMAP" -vimbadmin_plugins.AccessPermissions.type.POP3 = "POP3" -vimbadmin_plugins.AccessPermissions.type.SIEVE = "SIEVE" - - - - - - - - - - - - - - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Proceed onwards with caution. -;; -;; The above [user] params are the may ones of consequence. -;; - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; Allows to add additional information. -; -; This is handled via a plugin -; - -vimbadmin_plugins.AccessPermissions.disabled = false -vimbadmin_plugins.Jabber.disabled = true -vimbadmin_plugins.DirectoryEntry.disabled = true -vimbadmin_plugins.SharedMailbox.disabled = true -vimbadmin_plugins.SOGo.disabled = true - - -vimbadmin_plugins.AdditionalInfo.disabled = true -vimbadmin_plugins.Addressbook.disabled = true -vimbadmin_plugins.Calendar.disabled = true -vimbadmin_plugins.RoundCube.disabled = true - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;; Disabling directory entry subform element -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -vimbadmin_plugins.DirectoryEntry.disabled_elements.JpegPhoto = true -vimbadmin_plugins.DirectoryEntry.disabled_elements.Mail = true -vimbadmin_plugins.DirectoryEntry.disabled_elements.PreferredLanguage = true -vimbadmin_plugins.DirectoryEntry.disabled_elements.Secretary = true - -vimbadmin_plugins.DirectoryEntry.disabled_elements.PersonalTitle = false -vimbadmin_plugins.DirectoryEntry.disabled_elements.GivenName = false -vimbadmin_plugins.DirectoryEntry.disabled_elements.Sn = false -vimbadmin_plugins.DirectoryEntry.disabled_elements.DisplayName = false -vimbadmin_plugins.DirectoryEntry.disabled_elements.Initials = false -vimbadmin_plugins.DirectoryEntry.disabled_elements.BusinesCategory = false -vimbadmin_plugins.DirectoryEntry.disabled_elements.EmployeeType = false -vimbadmin_plugins.DirectoryEntry.disabled_elements.Title = false -vimbadmin_plugins.DirectoryEntry.disabled_elements.DepartmentNumber = false -vimbadmin_plugins.DirectoryEntry.disabled_elements.Ou = false -vimbadmin_plugins.DirectoryEntry.disabled_elements.RoomNumber = false -vimbadmin_plugins.DirectoryEntry.disabled_elements.O = false -vimbadmin_plugins.DirectoryEntry.disabled_elements.CarLicense = false -vimbadmin_plugins.DirectoryEntry.disabled_elements.EmployeeNumber = false -vimbadmin_plugins.DirectoryEntry.disabled_elements.HomePhone = false -vimbadmin_plugins.DirectoryEntry.disabled_elements.TelephoneNumber = false -vimbadmin_plugins.DirectoryEntry.disabled_elements.Mobile = false -vimbadmin_plugins.DirectoryEntry.disabled_elements.Pager = false -vimbadmin_plugins.DirectoryEntry.disabled_elements.FacsimileTelephoneNumber = false -vimbadmin_plugins.DirectoryEntry.disabled_elements.HomePostalAddress = false -vimbadmin_plugins.DirectoryEntry.disabled_elements.LabeledUri = false -vimbadmin_plugins.DirectoryEntry.disabled_elements.Manager = false - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; Mailbox AdditionalInfo plugin elements -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - - -;;Additional text messages for plugin. -AdditionalInfo.mailbox.formPreBlurb = "<p><strong>NB:</strong> Do not edit the following. It is sync'd on a nightly basis ..." - -; First Name -vimbadmin_plugins.AdditionalInfo.elements.id.type = "Zend_Form_Element_Text" -vimbadmin_plugins.AdditionalInfo.elements.id.options.required = false -vimbadmin_plugins.AdditionalInfo.elements.id.options.label = "LDAP Id" - -; First Name -vimbadmin_plugins.AdditionalInfo.elements.first_name.type = "Zend_Form_Element_Text" -vimbadmin_plugins.AdditionalInfo.elements.first_name.options.required = false -vimbadmin_plugins.AdditionalInfo.elements.first_name.options.label = "First Name" - -; Last Name -vimbadmin_plugins.AdditionalInfo.elements.second_name.type = "Zend_Form_Element_Text" -vimbadmin_plugins.AdditionalInfo.elements.second_name.options.required = false -vimbadmin_plugins.AdditionalInfo.elements.second_name.options.label = "Last Name" - -; Grade -vimbadmin_plugins.AdditionalInfo.elements.grade.type = "Zend_Form_Element_Text" -vimbadmin_plugins.AdditionalInfo.elements.grade.options.required = false -vimbadmin_plugins.AdditionalInfo.elements.grade.options.label = "Grade" - -; Grade Id -vimbadmin_plugins.AdditionalInfo.elements.grade_id.type = "Zend_Form_Element_Text" -vimbadmin_plugins.AdditionalInfo.elements.grade_id.options.required = false -vimbadmin_plugins.AdditionalInfo.elements.grade_id.options.label = "Grade Id" -vimbadmin_plugins.AdditionalInfo.elements.grade_id.options.validators.digits[] = 'Digits' -vimbadmin_plugins.AdditionalInfo.elements.grade_id.options.validators.digits[] = true - -; Department -vimbadmin_plugins.AdditionalInfo.elements.department.type = "Zend_Form_Element_Text" -vimbadmin_plugins.AdditionalInfo.elements.department.options.required = false -vimbadmin_plugins.AdditionalInfo.elements.department.options.label = "Department" - -; Department Id -vimbadmin_plugins.AdditionalInfo.elements.department_id.type = "Zend_Form_Element_Text" -vimbadmin_plugins.AdditionalInfo.elements.department_id.options.required = false -vimbadmin_plugins.AdditionalInfo.elements.department_id.options.label = "Department Id" -vimbadmin_plugins.AdditionalInfo.elements.department_id.options.validators.digits[] = 'Digits' -vimbadmin_plugins.AdditionalInfo.elements.department_id.options.validators.digits[] = true - -; Section -vimbadmin_plugins.AdditionalInfo.elements.section.type = "Zend_Form_Element_Text" -vimbadmin_plugins.AdditionalInfo.elements.section.options.required = false -vimbadmin_plugins.AdditionalInfo.elements.section.options.label = "Section" - -; Extension Number -vimbadmin_plugins.AdditionalInfo.elements.ext_no.type = "Zend_Form_Element_Text" -vimbadmin_plugins.AdditionalInfo.elements.ext_no.options.required = false -vimbadmin_plugins.AdditionalInfo.elements.ext_no.options.label = "Extension Number" -vimbadmin_plugins.AdditionalInfo.elements.ext_no.options.validators.digits[] = 'Digits' -vimbadmin_plugins.AdditionalInfo.elements.ext_no.options.validators.digits[] = true -vimbadmin_plugins.AdditionalInfo.elements.ext_no.options.validators.length[] = 'StringLength' -vimbadmin_plugins.AdditionalInfo.elements.ext_no.options.validators.length[] = false -vimbadmin_plugins.AdditionalInfo.elements.ext_no.options.validators.length.range[] = 4 -vimbadmin_plugins.AdditionalInfo.elements.ext_no.options.validators.length.range[] = 4 -;;to disable autocomplete functionality -vimbadmin_plugins.AdditionalInfo.elements.ext_no.options.autocomplete = 'off' - -; Direct Dial -vimbadmin_plugins.AdditionalInfo.elements.d_dial.type = "Zend_Form_Element_Text" -vimbadmin_plugins.AdditionalInfo.elements.d_dial.options.required = false -vimbadmin_plugins.AdditionalInfo.elements.d_dial.options.label = "Direct Dial" -vimbadmin_plugins.AdditionalInfo.elements.d_dial.options.autocomplete = 'off' - -; Mobile -vimbadmin_plugins.AdditionalInfo.elements.mobile.type = "Zend_Form_Element_Text" -vimbadmin_plugins.AdditionalInfo.elements.mobile.options.required = false -vimbadmin_plugins.AdditionalInfo.elements.mobile.options.label = "Mobile" -vimbadmin_plugins.AdditionalInfo.elements.mobile.options.autocomplete = 'off' - -;;;;;;; -;; Aliases additional information -;; -; First Name -vimbadmin_plugins.AdditionalInfo.alias.elements.name.type = "Zend_Form_Element_Text" -vimbadmin_plugins.AdditionalInfo.alias.elements.name.options.required = false -vimbadmin_plugins.AdditionalInfo.alias.elements.name.options.label = "Name" - -; Extension Number -vimbadmin_plugins.AdditionalInfo.alias.elements.ext_no.type = "Zend_Form_Element_Text" -vimbadmin_plugins.AdditionalInfo.alias.elements.ext_no.options.required = false -vimbadmin_plugins.AdditionalInfo.alias.elements.ext_no.options.label = "Extension Number" -vimbadmin_plugins.AdditionalInfo.alias.elements.ext_no.options.validators.digits[] = 'Digits' -vimbadmin_plugins.AdditionalInfo.alias.elements.ext_no.options.validators.digits[] = true -vimbadmin_plugins.AdditionalInfo.alias.elements.ext_no.options.validators.length[] = 'StringLength' -vimbadmin_plugins.AdditionalInfo.alias.elements.ext_no.options.validators.length[] = false -vimbadmin_plugins.AdditionalInfo.alias.elements.ext_no.options.validators.length.range[] = 4 -vimbadmin_plugins.AdditionalInfo.alias.elements.ext_no.options.validators.length.range[] = 4 -vimbadmin_plugins.AdditionalInfo.alias.elements.ext_no.options.autocomplete = 'off' - -; Direct Dial -vimbadmin_plugins.AdditionalInfo.alias.elements.d_dial.type = "Zend_Form_Element_Text" -vimbadmin_plugins.AdditionalInfo.alias.elements.d_dial.options.required = false -vimbadmin_plugins.AdditionalInfo.alias.elements.d_dial.options.label = "Direct Dial" -vimbadmin_plugins.AdditionalInfo.alias.elements.d_dial.options.autocomplete = 'off' - - -[production : user] - -includePaths.library = APPLICATION_PATH "/../library" -includePaths.osslibrary = APPLICATION_PATH "/../vendor/opensolutions/oss-framework/src/" - -bootstrap.path = APPLICATION_PATH "/Bootstrap.php" -bootstrap.class = "Bootstrap" -appnamespace = "ViMbAdmin" - -temporary_directory = APPLICATION_PATH "/../var/tmp" - -pluginPaths.OSS_Resource = APPLICATION_PATH "/../vendor/opensolutions/oss-framework/src/OSS/Resource" -pluginPaths.ViMbAdmin_Resource = APPLICATION_PATH "/../library/ViMbAdmin/Resource" - -mini_js = 1 -mini_css = 1 - -alias_autocomplete_min_length = 2 - - - -resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers" -resources.frontController.moduleDirectory = APPLICATION_PATH "/modules" -resources.modules[] = - - -; doctrine2 -resources.doctrine2.models_path = APPLICATION_PATH -resources.doctrine2.proxies_path = APPLICATION_PATH "/Proxies" -resources.doctrine2.repositories_path = APPLICATION_PATH -resources.doctrine2.xml_schema_path = APPLICATION_PATH "/../doctrine2/xml" -resources.doctrine2.autogen_proxies = 0 -resources.doctrine2.logger = 1 -resources.doctrine2.models_namespace = "Entities" -resources.doctrine2.proxies_namespace = "Proxies" -resources.doctrine2.repositories_namespace = "Repositories" - - -resources.doctrine2cache.autoload_method = "composer" -;resources.doctrine2cache.type = 'ArrayCache' -;resources.doctrine2cache.type = 'MemcacheCache' -;resources.doctrine2cache.memcache.servers.0.host = '127.0.0.1' -;resources.doctrine2cache.memcache.servers.0.port = '11211' -;resources.doctrine2cache.memcache.servers.0.persistent = false -;resources.doctrine2cache.memcache.servers.0.weight = 1 -;resources.doctrine2cache.memcache.servers.0.timeout = 1 -;resources.doctrine2cache.memcache.servers.0.retry_int = 15 - -; resources.doctrine2cache.memcache.servers.1.host = 'xxx' -; resources.doctrine2cache.memcache.servers.2.host = 'yyy' - -resources.namespace.checkip = 0 - -resources.auth.enabled = 1 -resources.auth.oss.adapter = "OSS_Auth_Doctrine2Adapter" -resources.auth.oss.pwhash = "bcrypt" -resources.auth.oss.hash_cost = 9 -resources.auth.oss.entity = "\\Entities\\Admin" -resources.auth.oss.disabled.lost-username = 1 -resources.auth.oss.disabled.lost-password = 0 - -resources.auth.oss.rememberme.enabled = 1 -resources.auth.oss.rememberme.timeout = 2592000 -resources.auth.oss.rememberme.secure = true - -resources.auth.oss.lost_password.use_captcha = true - -resources.session.save_path = APPLICATION_PATH "/../var/session" -resources.session.use_only_cookies = true -resources.session.remember_me_seconds = 3600 -resources.session.name = 'VIMBADMIN3' - -ondemand_resources.logger.writers.stream.path = APPLICATION_PATH "/../var/log" -ondemand_resources.logger.writers.stream.owner = {{php_user}} -ondemand_resources.logger.writers.stream.group = {{php_user}} -ondemand_resources.logger.writers.stream.mode = single -ondemand_resources.logger.writers.stream.logname = vimbadmin.log - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; Smarty View -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -resources.smarty.enabled = 1 -resources.smarty.templates = APPLICATION_PATH "/views" -; resources.smarty.skin = "myskin" -resources.smarty.compiled = APPLICATION_PATH "/../var/templates_c" -resources.smarty.cache = APPLICATION_PATH "/../var/cache" -resources.smarty.config = APPLICATION_PATH "/configs/smarty" -resources.smarty.plugins[] = APPLICATION_PATH "/../library/ViMbAdmin/Smarty/functions" -resources.smarty.plugins[] = APPLICATION_PATH "/../vendor/opensolutions/oss-framework/src/OSS/Smarty/functions" -resources.smarty.plugins[] = APPLICATION_PATH "/../vendor/smarty/smarty/libs/plugins" -resources.smarty.plugins[] = APPLICATION_PATH "/../vendor/smarty/smarty/libs/sysplugins" -resources.smarty.debugging = 0 - - - - -[development : production] - -mini_js = 0 -mini_css = 0 - -phpSettings.display_startup_errors = 1 -phpSettings.display_errors = 1 -resources.frontController.params.displayExceptions = 1 diff --git a/ee/cli/templates/virtual_alias_maps.mustache b/ee/cli/templates/virtual_alias_maps.mustache deleted file mode 100644 index b7919c74d..000000000 --- a/ee/cli/templates/virtual_alias_maps.mustache +++ /dev/null @@ -1,5 +0,0 @@ -user = vimbadmin -password = {{password}} -hosts = {{host}} -dbname = vimbadmin -query = SELECT goto FROM alias WHERE address = '%s' AND active = '1' diff --git a/ee/cli/templates/virtual_domains_maps.mustache b/ee/cli/templates/virtual_domains_maps.mustache deleted file mode 100644 index 2dce79a0d..000000000 --- a/ee/cli/templates/virtual_domains_maps.mustache +++ /dev/null @@ -1,5 +0,0 @@ -user = vimbadmin -password = {{password}} -hosts = {{host}} -dbname = vimbadmin -query = SELECT domain FROM domain WHERE domain = '%s' AND backupmx = '0' AND active = '1' diff --git a/ee/cli/templates/virtual_mailbox_maps.mustache b/ee/cli/templates/virtual_mailbox_maps.mustache deleted file mode 100644 index f8aafdaf8..000000000 --- a/ee/cli/templates/virtual_mailbox_maps.mustache +++ /dev/null @@ -1,7 +0,0 @@ -user = vimbadmin -password = {{password}} -hosts = {{host}} -dbname = vimbadmin -table = mailbox -select_field = maildir -where_field = username diff --git a/ee/cli/templates/virtualconf-php7.mustache b/ee/cli/templates/virtualconf-php7.mustache deleted file mode 100644 index 681eb35bf..000000000 --- a/ee/cli/templates/virtualconf-php7.mustache +++ /dev/null @@ -1,49 +0,0 @@ - -server { - - {{#multisite}} - # Uncomment the following line for domain mapping - # listen 80 default_server; - {{/multisite}} - - server_name {{^vma}}{{^rc}}{{site_name}}{{/rc}}{{/vma}} {{#vma}}vma.*{{/vma}} {{#rc}}webmail.*{{/rc}} {{^vma}}{{^rc}}{{#multisite}}*{{/multisite}}{{^multisite}}www{{/multisite}}.{{site_name}}{{/rc}}{{/vma}}; - - {{#multisite}} - # Uncomment the following line for domain mapping - #server_name_in_redirect off; - {{/multisite}} - - access_log /var/log/nginx/{{site_name}}.access.log {{^wpredis}}{{^static}}rt_cache{{/static}}{{/wpredis}}{{#wpredis}}rt_cache_redis{{/wpredis}}; - error_log /var/log/nginx/{{site_name}}.error.log; - - {{#proxy}} - add_header X-Proxy-Cache $upstream_cache_status; - location / { - proxy_pass http://{{host}}:{{port}}; - proxy_redirect off; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - } - {{/proxy}} - - {{^proxy}} - {{^vma}}{{^rc}}root {{webroot}}/htdocs;{{/rc}}{{/vma}} - {{#vma}}root /var/www/22222/htdocs/vimbadmin/public;{{/vma}} - {{#rc}}root /var/www/roundcubemail/htdocs/;{{/rc}} - - {{^proxy}}index {{^static}}index.php{{/static}} index.html index.htm;{{/proxy}} - - {{#static}} - location / { - try_files $uri $uri/ =404; - } - {{/static}} - - {{^static}}include {{^hhvm}}{{#basic}}common/php7.conf;{{/basic}}{{#w3tc}}common/w3tc-php7.conf;{{/w3tc}}{{#wpfc}}common/wpfc-php7.conf;{{/wpfc}} {{#wpsc}}common/wpsc-php7.conf;{{/wpsc}}{{#wpredis}}common/redis-php7.conf;{{/wpredis}} {{/hhvm}}{{#hhvm}}{{#basic}}common/php-hhvm.conf;{{/basic}}{{#w3tc}}common/w3tc-hhvm.conf;{{/w3tc}}{{#wpfc}}common/wpfc-hhvm.conf;{{/wpfc}} {{#wpsc}}common/wpsc-hhvm.conf;{{/wpsc}}{{#wpredis}}common/redis-hhvm.conf;{{/wpredis}} {{/hhvm}} - {{#wpsubdir}}include common/wpsubdir.conf;{{/wpsubdir}}{{/static}} - {{#wp}}include common/wpcommon-php7.conf;{{/wp}} - {{^proxy}}include common/locations-php7.conf;{{/proxy}} - {{^vma}}{{^rc}}include {{webroot}}/conf/nginx/*.conf;{{/rc}}{{/vma}} - {{/proxy}} -} diff --git a/ee/cli/templates/virtualconf.mustache b/ee/cli/templates/virtualconf.mustache deleted file mode 100644 index c7d3ac438..000000000 --- a/ee/cli/templates/virtualconf.mustache +++ /dev/null @@ -1,48 +0,0 @@ - -server { - - {{#multisite}} - # Uncomment the following line for domain mapping - # listen 80 default_server; - {{/multisite}} - - server_name {{^vma}}{{^rc}}{{site_name}}{{/rc}}{{/vma}} {{#vma}}vma.*{{/vma}} {{#rc}}webmail.*{{/rc}} {{^vma}}{{^rc}}{{#multisite}}*{{/multisite}}{{^multisite}}www{{/multisite}}.{{site_name}}{{/rc}}{{/vma}}; - - {{#multisite}} - # Uncomment the following line for domain mapping - #server_name_in_redirect off; - {{/multisite}} - - access_log /var/log/nginx/{{site_name}}.access.log {{^wpredis}}{{^static}}rt_cache{{/static}}{{/wpredis}}{{#wpredis}}rt_cache_redis{{/wpredis}}; - error_log /var/log/nginx/{{site_name}}.error.log; - - {{#proxy}} - add_header X-Proxy-Cache $upstream_cache_status; - location / { - proxy_pass http://{{host}}:{{port}}; - proxy_redirect off; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - } - {{/proxy}} - - {{^proxy}} - {{^vma}}{{^rc}}root {{webroot}}/htdocs;{{/rc}}{{/vma}} - {{#vma}}root /var/www/22222/htdocs/vimbadmin/public;{{/vma}} - {{#rc}}root /var/www/roundcubemail/htdocs/;{{/rc}} - - {{^proxy}}index {{^static}}index.php{{/static}} index.html index.htm;{{/proxy}} - - {{#static}} - location / { - try_files $uri $uri/ =404; - } - {{/static}} - - {{^static}}include {{^hhvm}}{{#basic}}common/php.conf;{{/basic}}{{#w3tc}}common/w3tc.conf;{{/w3tc}}{{#wpfc}}common/wpfc.conf;{{/wpfc}} {{#wpsc}}common/wpsc.conf;{{/wpsc}}{{#wpredis}}common/redis.conf;{{/wpredis}} {{/hhvm}}{{#hhvm}}{{#basic}}common/php-hhvm.conf;{{/basic}}{{#w3tc}}common/w3tc-hhvm.conf;{{/w3tc}}{{#wpfc}}common/wpfc-hhvm.conf;{{/wpfc}} {{#wpsc}}common/wpsc-hhvm.conf;{{/wpsc}}{{#wpredis}}common/redis-hhvm.conf;{{/wpredis}} {{/hhvm}} {{#wpsubdir}}include common/wpsubdir.conf;{{/wpsubdir}}{{/static}} - {{#wp}}include common/wpcommon.conf;{{/wp}} - {{^proxy}}include common/locations.conf;{{/proxy}} - {{^vma}}{{^rc}}include {{webroot}}/conf/nginx/*.conf;{{/rc}}{{/vma}} - {{/proxy}} -} diff --git a/ee/cli/templates/w3tc-hhvm.mustache b/ee/cli/templates/w3tc-hhvm.mustache deleted file mode 100644 index 86b13eefd..000000000 --- a/ee/cli/templates/w3tc-hhvm.mustache +++ /dev/null @@ -1,31 +0,0 @@ - -# W3TC NGINX CONFIGURATION -# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee) -set $cache_uri $request_uri; -# POST requests and URL with a query string should always go to php -if ($request_method = POST) { - set $cache_uri 'null cache'; -} -if ($query_string != "") { - set $cache_uri 'null cache'; -} -# Don't cache URL containing the following segments -if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|wp-.*\.php|index.php|/feed/|.*sitemap.*\.xml)") { - set $cache_uri 'null cache'; -} -# Don't use the cache for logged in users or recent commenter or customer with items in cart -if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|[a-z0-9]+_items_in_cart") { - set $cache_uri 'null cache'; -} -# Use cached or actual file if they exists, Otherwise pass request to WordPress -location / { - try_files /wp-content/cache/page_enhanced/${host}${cache_uri}_index.html $uri $uri/ /index.php?$args; -} -location ~ ^/wp-content/cache/minify/(.+\.(css|js))$ { - try_files $uri /wp-content/plugins/w3-total-cache/pub/minify.php?file=$1; -} -location ~ \.php$ { - try_files $uri =404; - include fastcgi_params; - fastcgi_pass hhvm; -} diff --git a/ee/cli/templates/w3tc-php7.mustache b/ee/cli/templates/w3tc-php7.mustache deleted file mode 100644 index 802847661..000000000 --- a/ee/cli/templates/w3tc-php7.mustache +++ /dev/null @@ -1,31 +0,0 @@ - -# W3TC NGINX CONFIGURATION -# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee) -set $cache_uri $request_uri; -# POST requests and URL with a query string should always go to php -if ($request_method = POST) { - set $cache_uri 'null cache'; -} -if ($query_string != "") { - set $cache_uri 'null cache'; -} -# Don't cache URL containing the following segments -if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|wp-.*\.php|index.php|/feed/|.*sitemap.*\.xml)") { - set $cache_uri 'null cache'; -} -# Don't use the cache for logged in users or recent commenter or customer with items in cart -if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|[a-z0-9]+_items_in_cart") { - set $cache_uri 'null cache'; -} -# Use cached or actual file if they exists, Otherwise pass request to WordPress -location / { - try_files /wp-content/cache/page_enhanced/${host}${cache_uri}_index.html $uri $uri/ /index.php?$args; -} -location ~ ^/wp-content/cache/minify/(.+\.(css|js))$ { - try_files $uri /wp-content/plugins/w3-total-cache/pub/minify.php?file=$1; -} -location ~ \.php$ { - try_files $uri =404; - include fastcgi_params; - fastcgi_pass php7; -} diff --git a/ee/cli/templates/w3tc.mustache b/ee/cli/templates/w3tc.mustache deleted file mode 100644 index daff74848..000000000 --- a/ee/cli/templates/w3tc.mustache +++ /dev/null @@ -1,31 +0,0 @@ - -# W3TC NGINX CONFIGURATION -# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee) -set $cache_uri $request_uri; -# POST requests and URL with a query string should always go to php -if ($request_method = POST) { - set $cache_uri 'null cache'; -} -if ($query_string != "") { - set $cache_uri 'null cache'; -} -# Don't cache URL containing the following segments -if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|wp-.*\.php|index.php|/feed/|.*sitemap.*\.xml)") { - set $cache_uri 'null cache'; -} -# Don't use the cache for logged in users or recent commenter or customer with items in cart -if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|[a-z0-9]+_items_in_cart") { - set $cache_uri 'null cache'; -} -# Use cached or actual file if they exists, Otherwise pass request to WordPress -location / { - try_files /wp-content/cache/page_enhanced/${host}${cache_uri}_index.html $uri $uri/ /index.php?$args; -} -location ~ ^/wp-content/cache/minify/(.+\.(css|js))$ { - try_files $uri /wp-content/plugins/w3-total-cache/pub/minify.php?file=$1; -} -location ~ \.php$ { - try_files $uri =404; - include fastcgi_params; - fastcgi_pass php; -} diff --git a/ee/cli/templates/wpcommon-php7.mustache b/ee/cli/templates/wpcommon-php7.mustache deleted file mode 100644 index b09437247..000000000 --- a/ee/cli/templates/wpcommon-php7.mustache +++ /dev/null @@ -1,21 +0,0 @@ -# WordPress COMMON SETTINGS -# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee) -# Limit access to avoid brute force attack -location = /wp-login.php { - limit_req zone=one burst=1 nodelay; - include fastcgi_params; - fastcgi_pass php7; -} -# Disable wp-config.txt -location = /wp-config.txt { - deny all; - access_log off; - log_not_found off; -} -# Disallow php in upload folder -location /wp-content/uploads/ { - location ~ \.php$ { - #Prevent Direct Access Of PHP Files From Web Browsers - deny all; - } -} diff --git a/ee/cli/templates/wpcommon.mustache b/ee/cli/templates/wpcommon.mustache deleted file mode 100644 index 394c68725..000000000 --- a/ee/cli/templates/wpcommon.mustache +++ /dev/null @@ -1,21 +0,0 @@ -# WordPress COMMON SETTINGS -# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee) -# Limit access to avoid brute force attack -location = /wp-login.php { - limit_req zone=one burst=1 nodelay; - include fastcgi_params; - fastcgi_pass php; -} -# Disable wp-config.txt -location = /wp-config.txt { - deny all; - access_log off; - log_not_found off; -} -# Disallow php in upload folder -location /wp-content/uploads/ { - location ~ \.php$ { - #Prevent Direct Access Of PHP Files From Web Browsers - deny all; - } -} diff --git a/ee/cli/templates/wpfc-hhvm.mustache b/ee/cli/templates/wpfc-hhvm.mustache deleted file mode 100644 index 5d268bbb5..000000000 --- a/ee/cli/templates/wpfc-hhvm.mustache +++ /dev/null @@ -1,37 +0,0 @@ -# WPFC NGINX CONFIGURATION -# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee) -set $skip_cache 0; -# POST requests and URL with a query string should always go to php -if ($request_method = POST) { - set $skip_cache 1; -} -if ($query_string != "") { - set $skip_cache 1; -} -# Don't cache URL containing the following segments -if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|wp-.*\.php|index.php|/feed/|.*sitemap.*\.xml)") { - set $skip_cache 1; -} -# Don't use the cache for logged in users or recent commenter or customer with items in cart -if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|[a-z0-9]+_items_in_cart") { - set $skip_cache 1; -} -# Use cached or actual file if they exists, Otherwise pass request to WordPress -location / { - try_files $uri $uri/ /index.php?$args; -} -location ~ ^/wp-content/cache/minify/(.+\.(css|js))$ { - try_files $uri /wp-content/plugins/w3-total-cache/pub/minify.php?file=$1; -} -location ~ \.php$ { - try_files $uri =404; - include fastcgi_params; - fastcgi_pass hhvm; - fastcgi_cache_bypass $skip_cache; - fastcgi_no_cache $skip_cache; - fastcgi_cache WORDPRESS; -} -location ~ /purge(/.*) { - fastcgi_cache_purge WORDPRESS "$scheme$request_method$host$1"; - access_log off; -} diff --git a/ee/cli/templates/wpfc-php7.mustache b/ee/cli/templates/wpfc-php7.mustache deleted file mode 100644 index 5ab0f783e..000000000 --- a/ee/cli/templates/wpfc-php7.mustache +++ /dev/null @@ -1,37 +0,0 @@ -# WPFC NGINX CONFIGURATION -# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee) -set $skip_cache 0; -# POST requests and URL with a query string should always go to php -if ($request_method = POST) { - set $skip_cache 1; -} -if ($query_string != "") { - set $skip_cache 1; -} -# Don't cache URL containing the following segments -if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|wp-.*\.php|index.php|/feed/|.*sitemap.*\.xml)") { - set $skip_cache 1; -} -# Don't use the cache for logged in users or recent commenter or customer with items in cart -if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|[a-z0-9]+_items_in_cart") { - set $skip_cache 1; -} -# Use cached or actual file if they exists, Otherwise pass request to WordPress -location / { - try_files $uri $uri/ /index.php?$args; -} -location ~ ^/wp-content/cache/minify/(.+\.(css|js))$ { - try_files $uri /wp-content/plugins/w3-total-cache/pub/minify.php?file=$1; -} -location ~ \.php$ { - try_files $uri =404; - include fastcgi_params; - fastcgi_pass php7; - fastcgi_cache_bypass $skip_cache; - fastcgi_no_cache $skip_cache; - fastcgi_cache WORDPRESS; -} -location ~ /purge(/.*) { - fastcgi_cache_purge WORDPRESS "$scheme$request_method$host$1"; - access_log off; -} diff --git a/ee/cli/templates/wpfc.mustache b/ee/cli/templates/wpfc.mustache deleted file mode 100644 index 46430138d..000000000 --- a/ee/cli/templates/wpfc.mustache +++ /dev/null @@ -1,37 +0,0 @@ -# WPFC NGINX CONFIGURATION -# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee) -set $skip_cache 0; -# POST requests and URL with a query string should always go to php -if ($request_method = POST) { - set $skip_cache 1; -} -if ($query_string != "") { - set $skip_cache 1; -} -# Don't cache URL containing the following segments -if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|wp-.*\.php|index.php|/feed/|.*sitemap.*\.xml)") { - set $skip_cache 1; -} -# Don't use the cache for logged in users or recent commenter or customer with items in cart -if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|[a-z0-9]+_items_in_cart") { - set $skip_cache 1; -} -# Use cached or actual file if they exists, Otherwise pass request to WordPress -location / { - try_files $uri $uri/ /index.php?$args; -} -location ~ ^/wp-content/cache/minify/(.+\.(css|js))$ { - try_files $uri /wp-content/plugins/w3-total-cache/pub/minify.php?file=$1; -} -location ~ \.php$ { - try_files $uri =404; - include fastcgi_params; - fastcgi_pass php; - fastcgi_cache_bypass $skip_cache; - fastcgi_no_cache $skip_cache; - fastcgi_cache WORDPRESS; -} -location ~ /purge(/.*) { - fastcgi_cache_purge WORDPRESS "$scheme$request_method$host$1"; - access_log off; -} diff --git a/ee/cli/templates/wpsc-hhvm.mustache b/ee/cli/templates/wpsc-hhvm.mustache deleted file mode 100644 index f99a82f34..000000000 --- a/ee/cli/templates/wpsc-hhvm.mustache +++ /dev/null @@ -1,31 +0,0 @@ -# WPSC NGINX CONFIGURATION -# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee) -set $cache_uri $request_uri; -# POST requests and URL with a query string should always go to php -if ($request_method = POST) { - set $cache_uri 'null cache'; -} -if ($query_string != "") { - set $cache_uri 'null cache'; -} -# Don't cache URL containing the following segments -if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|wp-.*\.php|index.php|/feed/|.*sitemap.*\.xml)") { - set $cache_uri 'null cache'; -} -# Don't use the cache for logged in users or recent commenter or customer with items in cart -if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|[a-z0-9]+_items_in_cart") { - set $cache_uri 'null cache'; -} -# Use cached or actual file if they exists, Otherwise pass request to WordPress -location / { - # If we add index.php?$args its break WooCommerce like plugins - # Ref: #330 - try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php; -} -location ~ \.php$ { - try_files $uri =404; - include fastcgi_params; - fastcgi_pass hhvm; - # Following line is needed by WP Super Cache plugin - fastcgi_param SERVER_NAME $http_host; -} diff --git a/ee/cli/templates/wpsc-php7.mustache b/ee/cli/templates/wpsc-php7.mustache deleted file mode 100644 index 9b2225405..000000000 --- a/ee/cli/templates/wpsc-php7.mustache +++ /dev/null @@ -1,31 +0,0 @@ -# WPSC NGINX CONFIGURATION -# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee) -set $cache_uri $request_uri; -# POST requests and URL with a query string should always go to php -if ($request_method = POST) { - set $cache_uri 'null cache'; -} -if ($query_string != "") { - set $cache_uri 'null cache'; -} -# Don't cache URL containing the following segments -if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|wp-.*\.php|index.php|/feed/|.*sitemap.*\.xml)") { - set $cache_uri 'null cache'; -} -# Don't use the cache for logged in users or recent commenter or customer with items in cart -if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|[a-z0-9]+_items_in_cart") { - set $cache_uri 'null cache'; -} -# Use cached or actual file if they exists, Otherwise pass request to WordPress -location / { - # If we add index.php?$args its break WooCommerce like plugins - # Ref: #330 - try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php; -} -location ~ \.php$ { - try_files $uri =404; - include fastcgi_params; - fastcgi_pass php7; - # Following line is needed by WP Super Cache plugin - fastcgi_param SERVER_NAME $http_host; -} diff --git a/ee/cli/templates/wpsc.mustache b/ee/cli/templates/wpsc.mustache deleted file mode 100644 index 9e864ec87..000000000 --- a/ee/cli/templates/wpsc.mustache +++ /dev/null @@ -1,31 +0,0 @@ -# WPSC NGINX CONFIGURATION -# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee) -set $cache_uri $request_uri; -# POST requests and URL with a query string should always go to php -if ($request_method = POST) { - set $cache_uri 'null cache'; -} -if ($query_string != "") { - set $cache_uri 'null cache'; -} -# Don't cache URL containing the following segments -if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|wp-.*\.php|index.php|/feed/|.*sitemap.*\.xml)") { - set $cache_uri 'null cache'; -} -# Don't use the cache for logged in users or recent commenter or customer with items in cart -if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|[a-z0-9]+_items_in_cart") { - set $cache_uri 'null cache'; -} -# Use cached or actual file if they exists, Otherwise pass request to WordPress -location / { - # If we add index.php?$args its break WooCommerce like plugins - # Ref: #330 - try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php; -} -location ~ \.php$ { - try_files $uri =404; - include fastcgi_params; - fastcgi_pass php; - # Following line is needed by WP Super Cache plugin - fastcgi_param SERVER_NAME $http_host; -} diff --git a/ee/cli/templates/wpsubdir.mustache b/ee/cli/templates/wpsubdir.mustache deleted file mode 100644 index 2ef064895..000000000 --- a/ee/cli/templates/wpsubdir.mustache +++ /dev/null @@ -1,10 +0,0 @@ -# WPSUBDIRECTORY NGINX CONFIGURATION -# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee) -if (!-e $request_filename) { - # Redirect wp-admin to wp-admin/ - rewrite /wp-admin$ $scheme://$host$uri/ permanent; - # Redirect wp-* files/folders - rewrite ^(/[^/]+)?(/wp-.*) $2 last; - # Redirect other php files - rewrite ^(/[^/]+)?(/.*\.php) $2 last; -} diff --git a/ee/core/__init__.py b/ee/core/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/ee/core/addswap.py b/ee/core/addswap.py deleted file mode 100644 index de2e4eb04..000000000 --- a/ee/core/addswap.py +++ /dev/null @@ -1,48 +0,0 @@ -"""EasyEngine SWAP creation""" -from ee.core.variables import EEVariables -from ee.core.shellexec import EEShellExec -from ee.core.fileutils import EEFileUtils -from ee.core.aptget import EEAptGet -from ee.core.logging import Log -import os - - -class EESwap(): - """Manage Swap""" - - def __init__(): - """Initialize """ - pass - - def add(self): - """Swap addition with EasyEngine""" - if EEVariables.ee_ram < 512: - if EEVariables.ee_swap < 1000: - Log.info(self, "Adding SWAP file, please wait...") - - # Install dphys-swapfile - EEAptGet.update(self) - EEAptGet.install(self, ["dphys-swapfile"]) - # Stop service - EEShellExec.cmd_exec(self, "service dphys-swapfile stop") - # Remove Default swap created - EEShellExec.cmd_exec(self, "/sbin/dphys-swapfile uninstall") - - # Modify Swap configuration - if os.path.isfile("/etc/dphys-swapfile"): - EEFileUtils.searchreplace(self, "/etc/dphys-swapfile", - "#CONF_SWAPFILE=/var/swap", - "CONF_SWAPFILE=/ee-swapfile") - EEFileUtils.searchreplace(self, "/etc/dphys-swapfile", - "#CONF_MAXSWAP=2048", - "CONF_MAXSWAP=1024") - EEFileUtils.searchreplace(self, "/etc/dphys-swapfile", - "#CONF_SWAPSIZE=", - "CONF_SWAPSIZE=1024") - else: - with open("/etc/dphys-swapfile", 'w') as conffile: - conffile.write("CONF_SWAPFILE=/ee-swapfile\n" - "CONF_SWAPSIZE=1024\n" - "CONF_MAXSWAP=1024\n") - # Create swap file - EEShellExec.cmd_exec(self, "service dphys-swapfile start") diff --git a/ee/core/apt_repo.py b/ee/core/apt_repo.py deleted file mode 100644 index c743cfdf5..000000000 --- a/ee/core/apt_repo.py +++ /dev/null @@ -1,91 +0,0 @@ -"""EasyEngine packages repository operations""" -from ee.core.shellexec import EEShellExec -from ee.core.variables import EEVariables -from ee.core.logging import Log -import os - - -class EERepo(): - """Manage Repositories""" - - def __init__(self): - """Initialize """ - pass - - def add(self, repo_url=None, ppa=None): - """ - This function used to add apt repositories and or ppa's - If repo_url is provided adds repo file to - /etc/apt/sources.list.d/ - If ppa is provided add apt-repository using - add-apt-repository - command. - """ - - if repo_url is not None: - repo_file_path = ("/etc/apt/sources.list.d/" - + EEVariables().ee_repo_file) - try: - if not os.path.isfile(repo_file_path): - with open(repo_file_path, - encoding='utf-8', mode='a') as repofile: - repofile.write(repo_url) - repofile.write('\n') - repofile.close() - elif repo_url not in open(repo_file_path, - encoding='utf-8').read(): - with open(repo_file_path, - encoding='utf-8', mode='a') as repofile: - repofile.write(repo_url) - repofile.write('\n') - repofile.close() - return True - except IOError as e: - Log.debug(self, "{0}".format(e)) - Log.error(self, "File I/O error.") - except Exception as e: - Log.debug(self, "{0}".format(e)) - Log.error(self, "Unable to add repo") - if ppa is not None: - EEShellExec.cmd_exec(self, "add-apt-repository -y '{ppa_name}'" - .format(ppa_name=ppa)) - - def remove(self, ppa=None, repo_url=None): - """ - This function used to remove ppa's - If ppa is provided adds repo file to - /etc/apt/sources.list.d/ - command. - """ - if ppa: - EEShellExec.cmd_exec(self, "add-apt-repository -y " - "--remove '{ppa_name}'" - .format(ppa_name=ppa)) - elif repo_url: - repo_file_path = ("/etc/apt/sources.list.d/" - + EEVariables().ee_repo_file) - - try: - repofile = open(repo_file_path, "w+") - repofile.write(repofile.read().replace(repo_url, "")) - repofile.close() - except IOError as e: - Log.debug(self, "{0}".format(e)) - Log.error(self, "File I/O error.") - except Exception as e: - Log.debug(self, "{0}".format(e)) - Log.error(self, "Unable to remove repo") - - def add_key(self, keyids, keyserver=None): - """ - This function adds imports repository keys from keyserver. - default keyserver is hkp://keys.gnupg.net - user can provide other keyserver with keyserver="hkp://xyz" - """ - EEShellExec.cmd_exec(self, "gpg --keyserver {serv}" - .format(serv=(keyserver or - "hkp://keys.gnupg.net")) - + " --recv-keys {key}".format(key=keyids)) - EEShellExec.cmd_exec(self, "gpg -a --export --armor {0}" - .format(keyids) - + " | apt-key add - ") diff --git a/ee/core/aptget.py b/ee/core/aptget.py deleted file mode 100644 index 6555ed8b9..000000000 --- a/ee/core/aptget.py +++ /dev/null @@ -1,231 +0,0 @@ -"""EasyEngine package installation using apt-get module.""" -import apt -import apt_pkg -import sys -import subprocess -from ee.core.logging import Log -from ee.core.apt_repo import EERepo -from sh import apt_get -from sh import ErrorReturnCode - - -class EEAptGet(): - """Generic apt-get intialisation""" - - def update(self): - """ - Similar to `apt-get update` - """ - try: - with open('/var/log/ee/ee.log', 'a') as f: - proc = subprocess.Popen('apt-get update', - shell=True, - stdin=None, stdout=f, - stderr=subprocess.PIPE, - executable="/bin/bash") - proc.wait() - output, error_output = proc.communicate() - - # Check what is error in error_output - if "NO_PUBKEY" in str(error_output): - # Split the output - Log.info(self, "Fixing missing GPG keys, please wait...") - error_list = str(error_output).split("\\n") - - # Use a loop to add misising keys - for single_error in error_list: - if "NO_PUBKEY" in single_error: - key = single_error.rsplit(None, 1)[-1] - EERepo.add_key(self, key, keyserver="hkp://pgp.mit.edu") - - proc = subprocess.Popen('apt-get update', - shell=True, - stdin=None, stdout=f, stderr=f, - executable="/bin/bash") - proc.wait() - - if proc.returncode == 0: - return True - else: - Log.info(self, Log.FAIL + "Oops Something went wrong!!") - Log.error(self, "Check logs for reason " - "`tail /var/log/ee/ee.log` & Try Again!!!") - - except Exception as e: - Log.error(self, "apt-get update exited with error") - - def check_upgrade(self): - """ - Similar to `apt-get upgrade` - """ - try: - check_update = subprocess.Popen(['apt-get upgrade -s | grep ' - '\"^Inst\" | wc -l'], - stdout=subprocess.PIPE, - shell=True).communicate()[0] - if check_update == b'0\n': - Log.error(self, "No package updates available") - Log.info(self, "Following package updates are available:") - subprocess.Popen("apt-get -s dist-upgrade | grep \"^Inst\"", - shell=True, executable="/bin/bash", - stdout=sys.stdout).communicate() - - except Exception as e: - Log.error(self, "Unable to check for packages upgrades") - - def dist_upgrade(self): - """ - Similar to `apt-get upgrade` - """ - try: - with open('/var/log/ee/ee.log', 'a') as f: - proc = subprocess.Popen("DEBIAN_FRONTEND=noninteractive " - "apt-get dist-upgrade -o " - "Dpkg::Options::=\"--force-confdef\"" - " -o " - "Dpkg::Options::=\"--force-confold\"" - " -y ", - shell=True, stdin=None, - stdout=f, stderr=f, - executable="/bin/bash") - proc.wait() - - if proc.returncode == 0: - return True - else: - Log.info(self, Log.FAIL + "Oops Something went " - "wrong!!") - Log.error(self, "Check logs for reason " - "`tail /var/log/ee/ee.log` & Try Again!!!") - except Exception as e: - Log.error(self, "Error while installing packages, " - "apt-get exited with error") - - def install(self, packages): - all_packages = ' '.join(packages) - try: - with open('/var/log/ee/ee.log', 'a') as f: - proc = subprocess.Popen("DEBIAN_FRONTEND=noninteractive " - "apt-get install -o " - "Dpkg::Options::=\"--force-confdef\"" - " -o " - "Dpkg::Options::=\"--force-confold\"" - " -y --allow-unauthenticated {0}" - .format(all_packages), shell=True, - stdin=None, stdout=f, stderr=f, - executable="/bin/bash") - proc.wait() - - if proc.returncode == 0: - return True - else: - Log.info(self, Log.FAIL + "Oops Something went " - "wrong!!") - Log.error(self, "Check logs for reason " - "`tail /var/log/ee/ee.log` & Try Again!!!") - - except Exception as e: - Log.info(self, Log.FAIL + "Oops Something went " - "wrong!!") - Log.error(self, "Check logs for reason " - "`tail /var/log/ee/ee.log` & Try Again!!!") - - def remove(self, packages, auto=False, purge=False): - all_packages = ' '.join(packages) - try: - with open('/var/log/ee/ee.log', 'a') as f: - if purge: - proc = subprocess.Popen('apt-get purge -y {0}' - .format(all_packages), shell=True, - stdin=None, stdout=f, stderr=f, - executable="/bin/bash") - else: - proc = subprocess.Popen('apt-get remove -y {0}' - .format(all_packages), shell=True, - stdin=None, stdout=f, stderr=f, - executable="/bin/bash") - proc.wait() - if proc.returncode == 0: - return True - else: - Log.info(self, Log.FAIL + "Oops Something went " - "wrong!!") - Log.error(self, "Check logs for reason " - "`tail /var/log/ee/ee.log` & Try Again!!!") - - except Exception as e: - Log.error(self, "Error while installing packages, " - "apt-get exited with error") - - def auto_clean(self): - """ - Similar to `apt-get autoclean` - """ - try: - orig_out = sys.stdout - sys.stdout = open(self.app.config.get('log.logging', 'file'), - encoding='utf-8', mode='a') - apt_get.autoclean("-y") - sys.stdout = orig_out - except ErrorReturnCode as e: - Log.debug(self, "{0}".format(e)) - Log.error(self, "Unable to apt-get autoclean") - - def auto_remove(self): - """ - Similar to `apt-get autoremove` - """ - try: - Log.debug(self, "Running apt-get autoremove") - apt_get.autoremove("-y") - except ErrorReturnCode as e: - Log.debug(self, "{0}".format(e)) - Log.error(self, "Unable to apt-get autoremove") - - def is_installed(self, package_name): - """ - Checks if package is available in cache and is installed or not - returns True if installed otherwise returns False - """ - apt_cache = apt.cache.Cache() - apt_cache.open() - if (package_name.strip() in apt_cache and - apt_cache[package_name.strip()].is_installed): - # apt_cache.close() - return True - # apt_cache.close() - return False - - def download_only(self,package_name,repo_url=None,repo_key=None): - """ - Similar to `apt-get install --download-only PACKAGE_NAME` - """ - packages = ' '.join(package_name) - try: - with open('/var/log/ee/ee.log', 'a') as f: - if repo_url is not None: - EERepo.add(self, repo_url=repo_url) - if repo_key is not None: - EERepo.add_key(self, repo_key) - proc = subprocess.Popen("apt-get update && DEBIAN_FRONTEND=noninteractive " - "apt-get install -o " - "Dpkg::Options::=\"--force-confdef\"" - " -o " - "Dpkg::Options::=\"--force-confold\"" - " -y --download-only {0}" - .format(packages), shell=True, - stdin=None, stdout=f, stderr=f, - executable="/bin/bash") - proc.wait() - - if proc.returncode == 0: - return True - else: - Log.error(self,"Error in fetching dpkg package.\nReverting changes ..",False) - if repo_url is not None: - EERepo.remove(self, repo_url=repo_url) - return False - except Exception as e: - Log.error(self, "Error while downloading packages, " - "apt-get exited with error") - diff --git a/ee/core/checkfqdn.py b/ee/core/checkfqdn.py deleted file mode 100644 index 4caf93806..000000000 --- a/ee/core/checkfqdn.py +++ /dev/null @@ -1,23 +0,0 @@ -from ee.core.shellexec import EEShellExec -from ee.core.variables import EEVariables -import os - - -def check_fqdn(self, ee_host): - """FQDN check with EasyEngine, for mail server hostname must be FQDN""" - # ee_host=os.popen("hostname -f | tr -d '\n'").read() - if '.' in ee_host: - EEVariables.ee_fqdn = ee_host - with open('/etc/hostname', encoding='utf-8', mode='w') as hostfile: - hostfile.write(ee_host) - - EEShellExec.cmd_exec(self, "sed -i \"1i\\127.0.0.1 {0}\" /etc/hosts" - .format(ee_host)) - if EEVariables.ee_platform_distro == 'debian': - EEShellExec.cmd_exec(self, "/etc/init.d/hostname.sh start") - else: - EEShellExec.cmd_exec(self, "service hostname restart") - - else: - ee_host = input("Enter hostname [fqdn]:") - check_fqdn(self, ee_host) diff --git a/ee/core/cron.py b/ee/core/cron.py deleted file mode 100644 index 7357ebd1c..000000000 --- a/ee/core/cron.py +++ /dev/null @@ -1,32 +0,0 @@ -from ee.core.shellexec import EEShellExec -from ee.core.logging import Log - -""" -Set CRON on LINUX system. -""" - -class EECron(): - def setcron_weekly(self,cmd,comment='Cron set by EasyEngine',user='root',min=0,hour=12): - if not EEShellExec.cmd_exec(self, "crontab -l | grep -q \'{0}\'".format(cmd)): - - EEShellExec.cmd_exec(self, "/bin/bash -c \"crontab -l " - "2> /dev/null | {{ cat; echo -e" - " \\\"" - "\\n0 0 * * 0 " - "{0}".format(cmd) + - " # {0}".format(comment)+ - "\\\"; } | crontab -\"") - Log.debug(self, "Cron set") - - - - def remove_cron(self,cmd): - if EEShellExec.cmd_exec(self, "crontab -l | grep -q \'{0}\'".format(cmd)): - if not EEShellExec.cmd_exec(self, "/bin/bash -c " - "\"crontab " - "-l | sed '/{0}/d'" - "| crontab -\"" - .format(cmd)): - Log.error(self, "Failed to remove crontab entry",False) - else: - Log.debug(self, "Cron not found") diff --git a/ee/core/database.py b/ee/core/database.py deleted file mode 100644 index 0b44eac1d..000000000 --- a/ee/core/database.py +++ /dev/null @@ -1,28 +0,0 @@ -"""EasyEngine generic database creation module""" -from sqlalchemy import create_engine -from sqlalchemy.orm import scoped_session, sessionmaker -from sqlalchemy.ext.declarative import declarative_base -from ee.core.variables import EEVariables - -# db_path = self.app.config.get('site', 'db_path') -engine = create_engine(EEVariables.ee_db_uri, convert_unicode=True) -db_session = scoped_session(sessionmaker(autocommit=False, - autoflush=False, - bind=engine)) -Base = declarative_base() -Base.query = db_session.query_property() - - -def init_db(app): - """ - Initializes and creates all tables from models into the database - """ - # import all modules here that might define models so that - # they will be registered properly on the metadata. Otherwise - # # you will have to import them first before calling init_db() - # import ee.core.models - try: - app.log.info("Initializing EasyEngine Database") - Base.metadata.create_all(bind=engine) - except Exception as e: - app.log.debug("{0}".format(e)) diff --git a/ee/core/domainvalidate.py b/ee/core/domainvalidate.py deleted file mode 100644 index 2b1fe4a54..000000000 --- a/ee/core/domainvalidate.py +++ /dev/null @@ -1,24 +0,0 @@ -"""EasyEngine domain validation module.""" -from urllib.parse import urlparse - - -def ValidateDomain(url): - """ - This function returns domain name removing http:// and https:// - returns domain name only with or without www as user provided. - """ - - # Check if http:// or https:// present remove it if present - domain_name = url.split('/') - if 'http:' in domain_name or 'https:' in domain_name: - domain_name = domain_name[2] - else: - domain_name = domain_name[0] - www_domain_name = domain_name.split('.') - final_domain = '' - if www_domain_name[0] == 'www': - final_domain = '.'.join(www_domain_name[1:]) - else: - final_domain = domain_name - - return (final_domain, domain_name) diff --git a/ee/core/download.py b/ee/core/download.py deleted file mode 100644 index e3280111c..000000000 --- a/ee/core/download.py +++ /dev/null @@ -1,45 +0,0 @@ -"""EasyEngine download core classes.""" -import urllib.request -import urllib.error -import os -from ee.core.logging import Log - - -class EEDownload(): - """Method to download using urllib""" - def __init__(): - pass - - def download(self, packages): - """Download packages, packges must be list in format of - [url, path, package name]""" - for package in packages: - url = package[0] - filename = package[1] - pkg_name = package[2] - try: - directory = os.path.dirname(filename) - if not os.path.exists(directory): - os.makedirs(directory) - Log.info(self, "Downloading {0:20}".format(pkg_name), end=' ') - req = urllib.request.Request(url, headers={'User-Agent': 'Mozilla/5.0'}) - with urllib.request.urlopen(req) as response, open(filename, 'wb') as out_file: - out_file.write(response.read()) - Log.info(self, "{0}".format("[" + Log.ENDC + "Done" - + Log.OKBLUE + "]")) - except urllib.error.URLError as e: - Log.debug(self, "[{err}]".format(err=str(e.reason))) - Log.error(self, "Unable to download file, {0}" - .format(filename)) - return False - except urllib.error.HTTPError as e: - Log.error(self, "Package download failed. {0}" - .format(pkg_name)) - Log.debug(self, "[{err}]".format(err=str(e.reason))) - return False - except urllib.error.ContentTooShortError as e: - Log.debug(self, "{0}{1}".format(e.errno, e.strerror)) - Log.error(self, "Package download failed. The amount of the" - " downloaded data is less than " - "the expected amount \{0} ".format(pkg_name)) - return False diff --git a/ee/core/exc.py b/ee/core/exc.py deleted file mode 100644 index 06579f41f..000000000 --- a/ee/core/exc.py +++ /dev/null @@ -1,26 +0,0 @@ -"""EasyEngine exception classes.""" - - -class EEError(Exception): - """Generic errors.""" - def __init__(self, msg): - Exception.__init__(self) - self.msg = msg - - def __str__(self): - return self.msg - - -class EEConfigError(EEError): - """Config related errors.""" - pass - - -class EERuntimeError(EEError): - """Generic runtime errors.""" - pass - - -class EEArgumentError(EEError): - """Argument related errors.""" - pass diff --git a/ee/core/extract.py b/ee/core/extract.py deleted file mode 100644 index 59c2c23ac..000000000 --- a/ee/core/extract.py +++ /dev/null @@ -1,21 +0,0 @@ -"""EasyEngine extarct core classes.""" -import tarfile -import os -from ee.core.logging import Log - - -class EEExtract(): - """Method to extract from tar.gz file""" - - def extract(self, file, path): - """Function to extract tar.gz file""" - try: - tar = tarfile.open(file) - tar.extractall(path=path) - tar.close() - os.remove(file) - return True - except tarfile.TarError as e: - Log.debug(self, "{0}".format(e)) - Log.error(self, 'Unable to extract file \{0}'.format(file)) - return False diff --git a/ee/core/fileutils.py b/ee/core/fileutils.py deleted file mode 100644 index b5369050f..000000000 --- a/ee/core/fileutils.py +++ /dev/null @@ -1,268 +0,0 @@ -"""EasyEngine file utils core classes.""" -import shutil -import os -import sys -import glob -import shutil -import pwd -import fileinput -from ee.core.logging import Log - - -class EEFileUtils(): - """Utilities to operate on files""" - def __init__(): - pass - - def remove(self, filelist): - """remove files from given path""" - for file in filelist: - if os.path.isfile(file): - Log.info(self, "Removing {0:65}".format(file), end=' ') - os.remove(file) - Log.info(self, "{0}".format("[" + Log.ENDC + "Done" + - Log.OKBLUE + "]")) - Log.debug(self, 'file Removed') - if os.path.isdir(file): - try: - Log.info(self, "Removing {0:65}".format(file), end=' ') - shutil.rmtree(file) - Log.info(self, "{0}".format("[" + Log.ENDC + "Done" + - Log.OKBLUE + "]")) - except shutil.Error as e: - Log.debug(self, "{err}".format(err=str(e.reason))) - Log.error(self, 'Unable to Remove file ') - - def create_symlink(self, paths, errormsg=''): - """ - Create symbolic links provided in list with first as source - and second as destination - """ - src = paths[0] - dst = paths[1] - if not os.path.islink(dst): - try: - Log.debug(self, "Creating Symbolic link, Source:{0}, Dest:{1}" - .format(src, dst)) - os.symlink(src, dst) - except Exception as e: - Log.debug(self, "{0}{1}".format(e.errno, e.strerror)) - Log.error(self, "Unable to create symbolic link ...\n ") - else: - Log.debug(self, "Destination: {0} exists".format(dst)) - - def remove_symlink(self, filepath): - """ - Removes symbolic link for the path provided with filepath - """ - try: - Log.debug(self, "Removing symbolic link: {0}".format(filepath)) - os.unlink(filepath) - except Exception as e: - Log.debug(self, "{0}".format(e)) - Log.error(self, "Unable to reomove symbolic link ...\n") - - def copyfiles(self, src, dest): - """ - Copies files: - src : source path - dest : destination path - - Recursively copy an entire directory tree rooted at src. - The destination directory, named by dst, must not already exist; - it will be created as well as missing parent directories. - """ - try: - Log.debug(self, "Copying files, Source:{0}, Dest:{1}" - .format(src, dest)) - shutil.copytree(src, dest) - except shutil.Error as e: - Log.debug(self, "{0}".format(e)) - Log.error(self, 'Unable to copy files from {0} to {1}' - .format(src, dest)) - except IOError as e: - Log.debug(self, "{0}".format(e.strerror)) - Log.error(self, "Unable to copy files from {0} to {1}" - .format(src, dest)) - - def copyfile(self, src, dest): - """ - Copy file: - src : source path - dest : destination path - """ - try: - Log.debug(self, "Copying file, Source:{0}, Dest:{1}" - .format(src, dest)) - shutil.copy2(src, dest) - except shutil.Error as e: - Log.debug(self, "{0}".format(e)) - Log.error(self, 'Unable to copy file from {0} to {1}' - .format(src, dest)) - except IOError as e: - Log.debug(self, "{0}".format(e.strerror)) - Log.error(self, "Unable to copy file from {0} to {1}" - .format(src, dest)) - - def searchreplace(self, fnm, sstr, rstr): - """ - Search replace strings in file - fnm : filename - sstr: search string - rstr: replace string - """ - try: - Log.debug(self, "Doning search and replace, File:{0}," - "Source string:{1}, Dest String:{2}" - .format(fnm, sstr, rstr)) - for line in fileinput.input(fnm, inplace=True): - print(line.replace(sstr, rstr), end='') - fileinput.close() - except Exception as e: - Log.debug(self, "{0}".format(e)) - Log.error(self, "Unable to search {0} and replace {1} {2}" - .format(fnm, sstr, rstr)) - - def mvfile(self, src, dst): - """ - Moves file from source path to destination path - src : source path - dst : Destination path - """ - try: - Log.debug(self, "Moving file from {0} to {1}".format(src, dst)) - shutil.move(src, dst) - except Exception as e: - Log.debug(self, "{err}".format(err=e)) - Log.error(self, 'Unable to move file from {0} to {1}' - .format(src, dst)) - - def chdir(self, path): - """ - Change Directory to path specified - Path : path for destination directory - """ - try: - Log.debug(self, "Changing directory to {0}" - .format(path)) - os.chdir(path) - except OSError as e: - Log.debug(self, "{err}".format(err=e.strerror)) - Log.error(self, 'Unable to Change Directory {0}'.format(path)) - - def chown(self, path, user, group, recursive=False): - """ - Change Owner for files - change owner for file with path specified - user: username of owner - group: group of owner - recursive: if recursive is True change owner for all - files in directory - """ - userid = pwd.getpwnam(user)[2] - groupid = pwd.getpwnam(user)[3] - try: - Log.debug(self, "Changing ownership of {0}, Userid:{1},Groupid:{2}" - .format(path, userid, groupid)) - # Change inside files/directory permissions only if recursive flag - # is set - if recursive: - for root, dirs, files in os.walk(path): - for d in dirs: - os.chown(os.path.join(root, d), userid, - groupid) - for f in files: - os.chown(os.path.join(root, f), userid, - groupid) - os.chown(path, userid, groupid) - except shutil.Error as e: - Log.debug(self, "{0}".format(e)) - Log.error(self, "Unable to change owner : {0}".format(path)) - except Exception as e: - Log.debug(self, "{0}".format(e)) - Log.error(self, "Unable to change owner : {0} ".format(path)) - - def chmod(self, path, perm, recursive=False): - """ - Changes Permission for files - path : file path permission to be changed - perm : permissions to be given - recursive: change permission recursively for all files - """ - try: - Log.debug(self, "Changing permission of {0}, Perm:{1}" - .format(path, perm)) - if recursive: - for root, dirs, files in os.walk(path): - for d in dirs: - os.chmod(os.path.join(root, d), perm) - for f in files: - os.chmod(os.path.join(root, f), perm) - else: - os.chmod(path, perm) - except OSError as e: - Log.debug(self, "{0}".format(e.strerror)) - Log.error(self, "Unable to change owner : {0}".format(path)) - - def mkdir(self, path): - """ - create directories. - path : path for directory to be created - Similar to `mkdir -p` - """ - try: - Log.debug(self, "Creating directories: {0}" - .format(path)) - os.makedirs(path) - except OSError as e: - Log.debug(self, "{0}".format(e.strerror)) - Log.error(self, "Unable to create directory {0} ".format(path)) - - def isexist(self, path): - """ - Check if file exist on given path - """ - try: - if os.path.exists(path): - return (True) - else: - return (False) - except OSError as e: - Log.debug(self, "{0}".format(e.strerror)) - Log.error(self, "Unable to check path {0}".format(path)) - - def grep(self, fnm, sstr): - """ - Searches for string in file and returns the matched line. - """ - try: - Log.debug(self, "Finding string {0} to file {1}" - .format(sstr, fnm)) - for line in open(fnm, encoding='utf-8'): - if sstr in line: - return line - return False - except OSError as e: - Log.debug(self, "{0}".format(e.strerror)) - Log.error(self, "Unable to Search string {0} in {1}" - .format(sstr, fnm)) - - def rm(self, path): - """ - Remove files - """ - Log.debug(self, "Removing {0}".format(path)) - if EEFileUtils.isexist(self, path): - try: - if os.path.isdir(path): - shutil.rmtree(path) - else: - os.remove(path) - except shutil.Error as e: - Log.debug(self, "{0}".format(e)) - Log.error(self, "Unable to remove directory : {0} " - .format(path)) - except OSError as e: - Log.debug(self, "{0}".format(e)) - Log.error(self, "Unable to remove file : {0} " - .format(path)) diff --git a/ee/core/git.py b/ee/core/git.py deleted file mode 100644 index 5d587c81d..000000000 --- a/ee/core/git.py +++ /dev/null @@ -1,57 +0,0 @@ -"""EasyEngine GIT module""" -from sh import git, ErrorReturnCode -from ee.core.logging import Log -import os - - -class EEGit: - """Intialization of core variables""" - def ___init__(): - # TODO method for core variables - pass - - def add(self, paths, msg="Intializating"): - """ - Initializes Directory as repository if not already git repo. - and adds uncommited changes automatically - """ - for path in paths: - global git - git = git.bake("--git-dir={0}/.git".format(path), - "--work-tree={0}".format(path)) - if os.path.isdir(path): - if not os.path.isdir(path+"/.git"): - try: - Log.debug(self, "EEGit: git init at {0}" - .format(path)) - git.init(path) - except ErrorReturnCode as e: - Log.debug(self, "{0}".format(e)) - Log.error(self, "Unable to git init at {0}" - .format(path)) - status = git.status("-s") - if len(status.splitlines()) > 0: - try: - Log.debug(self, "EEGit: git commit at {0}" - .format(path)) - git.add("--all") - git.commit("-am {0}".format(msg)) - except ErrorReturnCode as e: - Log.debug(self, "{0}".format(e)) - Log.error(self, "Unable to git commit at {0} " - .format(path)) - else: - Log.debug(self, "EEGit: Path {0} not present".format(path)) - - def checkfilestatus(self, repo, filepath): - """ - Checks status of file, If its tracked or untracked. - """ - global git - git = git.bake("--git-dir={0}/.git".format(repo), - "--work-tree={0}".format(repo)) - status = git.status("-s", "{0}".format(filepath)) - if len(status.splitlines()) > 0: - return True - else: - return False diff --git a/ee/core/logging.py b/ee/core/logging.py deleted file mode 100644 index 1fcb8da7d..000000000 --- a/ee/core/logging.py +++ /dev/null @@ -1,47 +0,0 @@ -"""EasyEngine log module""" - - -class Log: - """ - Logs messages with colors for different messages - according to functions - """ - HEADER = '\033[95m' - OKBLUE = '\033[94m' - OKGREEN = '\033[92m' - WARNING = '\033[93m' - FAIL = '\033[91m' - ENDC = '\033[0m' - BOLD = '\033[1m' - UNDERLINE = '\033[4m' - - def error(self, msg, exit=True): - """ - Logs error into log file - """ - print(Log.FAIL + msg + Log.ENDC) - self.app.log.error(Log.FAIL + msg + Log.ENDC) - if exit: - self.app.close(1) - - def info(self, msg, end='\n', log=True): - """ - Logs info messages into log file - """ - - print(Log.OKBLUE + msg + Log.ENDC, end=end) - if log: - self.app.log.info(Log.OKBLUE + msg + Log.ENDC) - - def warn(self, msg): - """ - Logs warning into log file - """ - print(Log.WARNING + msg + Log.ENDC) - self.app.log.warn(Log.BOLD + msg + Log.ENDC) - - def debug(self, msg): - """ - Logs debug messages into log file - """ - self.app.log.debug(Log.HEADER + msg + Log.ENDC) diff --git a/ee/core/logwatch.py b/ee/core/logwatch.py deleted file mode 100644 index ec2e210f8..000000000 --- a/ee/core/logwatch.py +++ /dev/null @@ -1,195 +0,0 @@ - -""" -Real time log files watcher supporting log rotation. -""" - -import os -import time -import errno -import stat -from ee.core.logging import Log - - -class LogWatcher(object): - """Looks for changes in all files of a directory. - This is useful for watching log file changes in real-time. - It also supports files rotation. - - Example: - - >>> def callback(filename, lines): - ... print filename, lines - ... - >>> l = LogWatcher("/var/www/example.com/logs", callback) - >>> l.loop() - """ - - def __init__(self, filelist, callback, extensions=["log"], tail_lines=0): - """Arguments: - - (str) @folder: - the folder to watch - - (callable) @callback: - a function which is called every time a new line in a - file being watched is found; - this is called with "filename" and "lines" arguments. - - (list) @extensions: - only watch files with these extensions - - (int) @tail_lines: - read last N lines from files being watched before starting - """ - self.files_map = {} - self.filelist = filelist - self.callback = callback - # self.folder = os.path.realpath(folder) - self.extensions = extensions - # assert (os.path.isdir(self.folder), "%s does not exists" - # % self.folder) - for file in self.filelist: - assert (os.path.isfile(file)) - assert callable(callback) - self.update_files() - # The first time we run the script we move all file markers at EOF. - # In case of files created afterwards we don't do this. - for id, file in list(iter(self.files_map.items())): - file.seek(os.path.getsize(file.name)) # EOF - if tail_lines: - lines = self.tail(file.name, tail_lines) - if lines: - self.callback(file.name, lines) - - def __del__(self): - self.close() - - def loop(self, interval=0.1, async=False): - """Start the loop. - If async is True make one loop then return. - """ - while 1: - self.update_files() - for fid, file in list(iter(self.files_map.items())): - self.readfile(file) - if async: - return - time.sleep(interval) - - def log(self, line): - """Log when a file is un/watched""" - print(line) - - # def listdir(self): - # """List directory and filter files by extension. - # You may want to override this to add extra logic or - # globbling support. - # """ - # ls = os.listdir(self.folder) - # if self.extensions: - # return ([x for x in ls if os.path.splitext(x)[1][1:] - # in self.extensions]) - # else: - # return ls - - @staticmethod - def tail(fname, window): - """Read last N lines from file fname.""" - try: - f = open(fname, encoding='utf-8', mode='r') - except IOError as err: - if err.errno == errno.ENOENT: - return [] - else: - raise - else: - BUFSIZ = 1024 - f.seek(0, os.SEEK_END) - fsize = f.tell() - block = -1 - data = "" - exit = False - while not exit: - step = (block * BUFSIZ) - if abs(step) >= fsize: - f.seek(0) - exit = True - else: - f.seek(step, os.SEEK_END) - data = f.read().strip() - if data.count('\n') >= window: - break - else: - block -= 1 - return data.splitlines()[-window:] - - def update_files(self): - ls = [] - for name in self.filelist: - absname = os.path.realpath(os.path.join(name)) - try: - st = os.stat(absname) - except EnvironmentError as err: - if err.errno != errno.ENOENT: - raise - else: - if not stat.S_ISREG(st.st_mode): - continue - fid = self.get_file_id(st) - ls.append((fid, absname)) - - # check existent files - for fid, file in list(iter(self.files_map.items())): - # next(iter(graph.items())) - try: - st = os.stat(file.name) - except EnvironmentError as err: - if err.errno == errno.ENOENT: - self.unwatch(file, fid) - else: - raise - else: - if fid != self.get_file_id(st): - # same name but different file (rotation); reload it. - self.unwatch(file, fid) - self.watch(file.name) - - # add new ones - for fid, fname in ls: - if fid not in self.files_map: - self.watch(fname) - - def readfile(self, file): - lines = file.readlines() - if lines: - self.callback(file.name, lines) - - def watch(self, fname): - try: - file = open(fname, encoding='utf-8', mode='r') - fid = self.get_file_id(os.stat(fname)) - except EnvironmentError as err: - if err.errno != errno.ENOENT: - raise - else: - self.log("watching logfile %s" % fname) - self.files_map[fid] = file - - def unwatch(self, file, fid): - # file no longer exists; if it has been renamed - # try to read it for the last time in case the - # log rotator has written something in it. - lines = self.readfile(file) - self.log("un-watching logfile %s" % file.name) - del self.files_map[fid] - if lines: - self.callback(file.name, lines) - - @staticmethod - def get_file_id(st): - return "%xg%x" % (st.st_dev, st.st_ino) - - def close(self): - for id, file in list(iter(self.files_map.items())): - file.close() - self.files_map.clear() diff --git a/ee/core/mysql.py b/ee/core/mysql.py deleted file mode 100644 index f197d8be4..000000000 --- a/ee/core/mysql.py +++ /dev/null @@ -1,136 +0,0 @@ -"""EasyEngine MySQL core classes.""" -import pymysql -from pymysql import connections, DatabaseError, Error -import configparser -from os.path import expanduser -import sys -import os -from ee.core.logging import Log -from ee.core.variables import EEVariables - - -class MySQLConnectionError(Exception): - """Custom Exception when MySQL server Not Connected""" - pass - - -class StatementExcecutionError(Exception): - """Custom Exception when any Query Fails to execute""" - pass - - -class DatabaseNotExistsError(Exception): - """Custom Exception when Database not Exist""" - pass - - -class EEMysql(): - """Method for MySQL connection""" - - def connect(self): - """Makes connection with MySQL server""" - try: - if os.path.exists('/etc/mysql/conf.d/my.cnf'): - connection = pymysql.connect(read_default_file='/etc/mysql/conf.d/my.cnf') - else: - connection = pymysql.connect(read_default_file='~/.my.cnf') - return connection - except ValueError as e: - Log.debug(self, str(e)) - raise MySQLConnectionError - except pymysql.err.InternalError as e: - Log.debug(self, str(e)) - raise MySQLConnectionError - - def dbConnection(self, db_name): - try: - if os.path.exists('/etc/mysql/conf.d/my.cnf'): - connection = pymysql.connect(db=db_name,read_default_file='/etc/mysql/conf.d/my.cnf') - else: - connection = pymysql.connect(db=db_name,read_default_file='~/.my.cnf') - - return connection - except DatabaseError as e: - if e.args[1] == '#42000Unknown database \'{0}\''.format(db_name): - raise DatabaseNotExistsError - else: - raise MySQLConnectionError - except pymysql.err.InternalError as e: - Log.debug(self, str(e)) - raise MySQLConnectionError - except Exception as e : - Log.debug(self, "[Error]Setting up database: \'" + str(e) + "\'") - raise MySQLConnectionError - - def execute(self, statement, errormsg='', log=True): - """Get login details from /etc/mysql/conf.d/my.cnf & Execute MySQL query""" - connection = EEMysql.connect(self) - log and Log.debug(self, "Exceuting MySQL Statement : {0}" - .format(statement)) - try: - cursor = connection.cursor() - sql = statement - cursor.execute(sql) - - # connection is not autocommit by default. - # So you must commit to save your changes. - connection.commit() - except AttributeError as e: - Log.debug(self, str(e)) - raise StatementExcecutionError - except Error as e: - Log.debug(self, str(e)) - raise StatementExcecutionError - finally: - connection.close() - - def backupAll(self): - import subprocess - try: - Log.info(self, "Backing up database at location: " - "/var/ee-mysqlbackup") - # Setup Nginx common directory - if not os.path.exists('/var/ee-mysqlbackup'): - Log.debug(self, 'Creating directory' - '/var/ee-mysqlbackup') - os.makedirs('/var/ee-mysqlbackup') - - db = subprocess.check_output(["mysql -Bse \'show databases\'"], - universal_newlines=True, - shell=True).split('\n') - for dbs in db: - if dbs == "": - continue - Log.info(self, "Backing up {0} database".format(dbs)) - p1 = subprocess.Popen("mysqldump {0}" - " --max_allowed_packet=1024M" - " --single-transaction".format(dbs), - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, shell=True) - p2 = subprocess.Popen("gzip -c > /var/ee-mysqlbackup/{0}{1}.s" - "ql.gz".format(dbs, EEVariables.ee_date), - stdin=p1.stdout, - shell=True) - - # Allow p1 to receive a SIGPIPE if p2 exits - p1.stdout.close() - output = p1.stderr.read() - p1.wait() - if p1.returncode == 0: - Log.debug(self, "done") - else: - Log.error(self, output.decode("utf-8")) - except Exception as e: - Log.error(self, "Error: process exited with status %s" - % e) - - def check_db_exists(self, db_name): - try: - if EEMysql.dbConnection(self, db_name): - return True - except DatabaseNotExistsError as e: - Log.debug(self, str(e)) - return False - except MySQLConnectionError as e: - Log.debug(self, str(e)) - return False diff --git a/ee/core/nginxhashbucket.py b/ee/core/nginxhashbucket.py deleted file mode 100644 index 862165c2e..000000000 --- a/ee/core/nginxhashbucket.py +++ /dev/null @@ -1,44 +0,0 @@ -"""EasyEngine Hash bucket calculate function for Nginx""" -from ee.core.fileutils import EEFileUtils -import math -import os -import fileinput -import re -import subprocess - - -def hashbucket(self): - # Check Nginx Hashbucket error - sub = subprocess.Popen('nginx -t', stdout=subprocess.PIPE, - stderr=subprocess.PIPE, shell=True) - output, error_output = sub.communicate() - if 'server_names_hash_bucket_size' not in str(error_output): - return True - - count = 0 - # Get the list of sites-availble - sites_list = os.listdir("/etc/nginx/sites-enabled/") - - # Count the number of characters in site names - for site in sites_list: - count = sum([count, len(site)]) - - # Calculate Nginx hash bucket size - ngx_calc = math.trunc(sum([math.log(count, 2), 2])) - ngx_hash = math.trunc(math.pow(2, ngx_calc)) - - # Replace hashbucket in Nginx.conf file - if EEFileUtils.grep(self, "/etc/nginx/nginx.conf", - "server_names_hash_bucket_size"): - for line in fileinput.FileInput("/etc/nginx/nginx.conf", inplace=1): - if "server_names_hash_bucket_size" in line: - print("\tserver_names_hash_bucket_size {0};".format(ngx_hash)) - else: - print(line, end='') - - else: - EEFileUtils.searchreplace(self, '/etc/nginx/nginx.conf', - "gzip_disable \"msie6\";", - "gzip_disable \"msie6\";\n" - "\tserver_names_hash_bucket_size {0};\n" - .format(ngx_hash)) diff --git a/ee/core/sendmail.py b/ee/core/sendmail.py deleted file mode 100644 index 21d6cadf0..000000000 --- a/ee/core/sendmail.py +++ /dev/null @@ -1,33 +0,0 @@ -import smtplib -import os -from email.mime.multipart import MIMEMultipart -from email.mime.base import MIMEBase -from email.mime.text import MIMEText -from email.utils import COMMASPACE, formatdate -from email import encoders - - -def EESendMail(send_from, send_to, subject, text, files, server="localhost", - port=587, username='', password='', isTls=True): - msg = MIMEMultipart() - msg['From'] = send_from - msg['To'] = send_to - msg['Date'] = formatdate(localtime=True) - msg['Subject'] = subject - - msg.attach(MIMEText(text)) - - for f in files: - part = MIMEBase('application', "octet-stream") - part.set_payload(open(f, "rb").read()) - encoders.encode_base64(part) - part.add_header('Content-Disposition', 'attachment; filename="{0}"' - .format(os.path.basename(f))) - msg.attach(part) - - smtp = smtplib.SMTP(server, port) - if isTls: - smtp.starttls() - - smtp.sendmail(send_from, send_to, msg.as_string()) - smtp.quit() diff --git a/ee/core/services.py b/ee/core/services.py deleted file mode 100644 index b0c52766c..000000000 --- a/ee/core/services.py +++ /dev/null @@ -1,134 +0,0 @@ -"""EasyEngine service start/stop/restart module.""" -import os -import sys -import subprocess -from subprocess import Popen -from ee.core.logging import Log -import pystache - - -class EEService(): - """Intialization for service""" - def ___init__(): - pass - - def start_service(self, service_name): - """ - start service - Similar to `service xyz start` - """ - try: - if service_name in ['nginx', 'php5-fpm']: - service_cmd = ('{0} -t && service {0} start' - .format(service_name)) - else: - service_cmd = ('service {0} start'.format(service_name)) - - Log.info(self, "Start : {0:10}" .format(service_name), end='') - retcode = subprocess.getstatusoutput(service_cmd) - if retcode[0] == 0: - Log.info(self, "[" + Log.ENDC + "OK" + Log.OKBLUE + "]") - return True - else: - Log.debug(self, "{0}".format(retcode[1])) - Log.info(self, "[" + Log.FAIL + "Failed" + Log.OKBLUE+"]") - return False - except OSError as e: - Log.debug(self, "{0}".format(e)) - Log.error(self, "\nFailed to start service {0}" - .format(service_name)) - - def stop_service(self, service_name): - """ - Stop service - Similar to `service xyz stop` - """ - try: - Log.info(self, "Stop : {0:10}" .format(service_name), end='') - retcode = subprocess.getstatusoutput('service {0} stop' - .format(service_name)) - if retcode[0] == 0: - Log.info(self, "[" + Log.ENDC + "OK" + Log.OKBLUE + "]") - return True - else: - Log.debug(self, "{0}".format(retcode[1])) - Log.info(self, "[" + Log.FAIL + "Failed" + Log.OKBLUE+"]") - return False - except OSError as e: - Log.debug(self, "{0}".format(e)) - Log.error(self, "\nFailed to stop service : {0}" - .format(service_name)) - - def restart_service(self, service_name): - """ - Restart service - Similar to `service xyz restart` - """ - try: - if service_name in ['nginx', 'php5-fpm']: - service_cmd = ('{0} -t && service {0} restart' - .format(service_name)) - else: - service_cmd = ('service {0} restart'.format(service_name)) - - Log.info(self, "Restart : {0:10}".format(service_name), end='') - retcode = subprocess.getstatusoutput(service_cmd) - if retcode[0] == 0: - Log.info(self, "[" + Log.ENDC + "OK" + Log.OKBLUE + "]") - return True - else: - Log.debug(self, "{0}".format(retcode[1])) - Log.info(self, "[" + Log.FAIL + "Failed" + Log.OKBLUE+"]") - return False - except OSError as e: - Log.debug(self, "{0} {1}".format(e.errno, e.strerror)) - Log.error(self, "\nFailed to restart service : {0}" - .format(service_name)) - - def reload_service(self, service_name): - """ - Stop service - Similar to `service xyz stop` - """ - try: - if service_name in ['nginx', 'php5-fpm']: - service_cmd = ('{0} -t && service {0} reload' - .format(service_name)) - else: - service_cmd = ('service {0} reload'.format(service_name)) - - Log.info(self, "Reload : {0:10}".format(service_name), end='') - retcode = subprocess.getstatusoutput(service_cmd) - if retcode[0] == 0: - Log.info(self, "[" + Log.ENDC + "OK" + Log.OKBLUE + "]") - return True - else: - Log.debug(self, "{0}".format(retcode[1])) - Log.info(self, "[" + Log.FAIL + "Failed" + Log.OKBLUE+"]") - return False - except OSError as e: - Log.debug(self, "{0}".format(e)) - Log.error(self, "\nFailed to reload service {0}" - .format(service_name)) - - def get_service_status(self, service_name): - - - try: - is_exist = subprocess.getstatusoutput('which {0}' - .format(service_name)) - if is_exist[0] == 0 or service_name in ['php7.0-fpm', 'php5.6-fpm']: - retcode = subprocess.getstatusoutput('service {0} status' - .format(service_name)) - if retcode[0] == 0: - return True - else: - Log.debug(self, "{0}".format(retcode[1])) - return False - else: - return False - except OSError as e: - Log.debug(self, "{0}{1}".format(e.errno, e.strerror)) - Log.error(self, "Unable to get services status of {0}" - .format(service_name)) - return False diff --git a/ee/core/shellexec.py b/ee/core/shellexec.py deleted file mode 100644 index b68076cca..000000000 --- a/ee/core/shellexec.py +++ /dev/null @@ -1,83 +0,0 @@ -"""EasyEngine shell executaion functions.""" -from ee.core.logging import Log -import os -import sys -import subprocess - - -class CommandExecutionError(Exception): - """custom Exception for command execution""" - pass - - -class EEShellExec(): - """Method to run shell commands""" - def __init__(): - pass - - def cmd_exec(self, command, errormsg='', log=True): - """Run shell command from Python""" - try: - log and Log.debug(self, "Running command: {0}".format(command)) - - with subprocess.Popen([command], stdout=subprocess.PIPE, - stderr=subprocess.PIPE, shell=True) as proc: - (cmd_stdout_bytes, cmd_stderr_bytes) = proc.communicate() - (cmd_stdout, cmd_stderr) = (cmd_stdout_bytes.decode('utf-8', - "replace"), - cmd_stderr_bytes.decode('utf-8', - "replace")) - - if proc.returncode == 0: - Log.debug(self, "Command Output: {0}, \nCommand Error: {1}" - .format(cmd_stdout, cmd_stderr)) - return True - else: - Log.debug(self, "Command Output: {0}, \nCommand Error: {1}" - .format(cmd_stdout, cmd_stderr)) - return False - except OSError as e: - Log.debug(self, str(e)) - raise CommandExecutionError - except Exception as e: - Log.debug(self, str(e)) - raise CommandExecutionError - - def invoke_editor(self, filepath, errormsg=''): - """ - Open files using sensible editor - """ - try: - subprocess.call(['sensible-editor', filepath]) - except OSError as e: - Log.debug(self, "{0}{1}".format(e.errno, e.strerror)) - raise CommandExecutionError - - - def cmd_exec_stdout(self, command, errormsg='', log=True): - """Run shell command from Python""" - try: - log and Log.debug(self, "Running command: {0}".format(command)) - - with subprocess.Popen([command], stdout=subprocess.PIPE, - stderr=subprocess.PIPE, shell=True) as proc: - (cmd_stdout_bytes, cmd_stderr_bytes) = proc.communicate() - (cmd_stdout, cmd_stderr) = (cmd_stdout_bytes.decode('utf-8', - "replace"), - cmd_stderr_bytes.decode('utf-8', - "replace")) - - if proc.returncode == 0: - Log.debug(self, "Command Output: {0}, \nCommand Error: {1}" - .format(cmd_stdout, cmd_stderr)) - return cmd_stdout - else: - Log.debug(self, "Command Output: {0}, \nCommand Error: {1}" - .format(cmd_stdout, cmd_stderr)) - return cmd_stdout - except OSError as e: - Log.debug(self, str(e)) - raise CommandExecutionError - except Exception as e: - Log.debug(self, str(e)) - raise CommandExecutionError \ No newline at end of file diff --git a/ee/core/sslutils.py b/ee/core/sslutils.py deleted file mode 100644 index d704c71fc..000000000 --- a/ee/core/sslutils.py +++ /dev/null @@ -1,43 +0,0 @@ -import os -from ee.core.shellexec import EEShellExec -from ee.core.logging import Log - - -class SSL: - - def getExpirationDays(self,domain,returnonerror=False): - # check if exist - if not os.path.isfile('/etc/letsencrypt/live/{0}/cert.pem' - .format(domain)): - Log.error(self,'File Not Found : /etc/letsencrypt/live/{0}/cert.pem' - .format(domain),False) - if returnonerror: - return -1 - Log.error(self, "Check logs for reason " - "`tail /var/log/ee/ee.log` & Try Again!!!") - - - current_date = EEShellExec.cmd_exec_stdout(self, "date -d \"now\" +%s") - expiration_date = EEShellExec.cmd_exec_stdout(self, "date -d \"`openssl x509 -in /etc/letsencrypt/live/{0}/cert.pem" - " -text -noout|grep \"Not After\"|cut -c 25-`\" +%s".format(domain)) - - days_left = int((int(expiration_date) - int(current_date))/ 86400) - if (days_left > 0): - return days_left - else: - # return "Certificate Already Expired ! Please Renew soon." - return -1 - - def getExpirationDate(self,domain): - # check if exist - if not os.path.isfile('/etc/letsencrypt/live/{0}/cert.pem' - .format(domain)): - Log.error(self,'File Not Found : /etc/letsencrypt/live/{0}/cert.pem' - .format(domain),False) - Log.error(self, "Check logs for reason " - "`tail /var/log/ee/ee.log` & Try Again!!!") - - expiration_date = EEShellExec.cmd_exec_stdout(self, "date -d \"`openssl x509 -in /etc/letsencrypt/live/{0}/cert.pem" - " -text -noout|grep \"Not After\"|cut -c 25-`\" ".format(domain)) - return expiration_date - diff --git a/ee/core/variables.py b/ee/core/variables.py deleted file mode 100644 index bce6e13cf..000000000 --- a/ee/core/variables.py +++ /dev/null @@ -1,230 +0,0 @@ -"""EasyEngine core variable module""" -import platform -import socket -import configparser -import os -import sys -import psutil -import datetime - - -class EEVariables(): - """Intialization of core variables""" - - # EasyEngine version - ee_version = "3.8.1" - # EasyEngine packages versions - ee_wp_cli = "1.5.1" - ee_adminer = "4.6.2" - ee_roundcube = "1.3.6" - # ee_vimbadmin = "3.0.12" - ee_vimbadmin = "master" - - # Get WPCLI path - ee_wpcli_path = os.popen('which wp | tr "\n" " "').read() - if ee_wpcli_path == '': - ee_wpcli_path = '/usr/bin/wp ' - - # Current date and time of System - ee_date = datetime.datetime.now().strftime('%d%b%Y%H%M%S') - - # EasyEngine core variables - ee_platform_distro = platform.linux_distribution()[0].lower() - ee_platform_version = platform.linux_distribution()[1] - ee_platform_codename = os.popen("lsb_release -sc | tr -d \'\\n\'").read() - - # Get timezone of system - if os.path.isfile('/etc/timezone'): - with open("/etc/timezone", "r") as tzfile: - ee_timezone = tzfile.read().replace('\n', '') - if ee_timezone == "Etc/UTC": - ee_timezone = "UTC" - else: - ee_timezone = "UTC" - - # Get FQDN of system - ee_fqdn = socket.getfqdn() - - # EasyEngien default webroot path - ee_webroot = '/var/www/' - - # PHP5 user - ee_php_user = 'www-data' - - # Get git user name and EMail - config = configparser.ConfigParser() - config.read(os.path.expanduser("~")+'/.gitconfig') - try: - ee_user = config['user']['name'] - ee_email = config['user']['email'] - except Exception as e: - ee_user = input("Enter your name: ") - ee_email = input("Enter your email: ") - os.system("git config --global user.name {0}".format(ee_user)) - os.system("git config --global user.email {0}".format(ee_email)) - - # Get System RAM and SWAP details - ee_ram = psutil.virtual_memory().total / (1024 * 1024) - ee_swap = psutil.swap_memory().total / (1024 * 1024) - - # MySQL hostname - ee_mysql_host = "" - config = configparser.RawConfigParser() - if os.path.exists('/etc/mysql/conf.d/my.cnf'): - cnfpath = "/etc/mysql/conf.d/my.cnf" - else: - cnfpath = os.path.expanduser("~")+"/.my.cnf" - if [cnfpath] == config.read(cnfpath): - try: - ee_mysql_host = config.get('client', 'host') - except configparser.NoOptionError as e: - ee_mysql_host = "localhost" - else: - ee_mysql_host = "localhost" - - # EasyEngine stack installation variables - # Nginx repo and packages - if ee_platform_codename == 'precise': - ee_nginx_repo = ("deb http://download.opensuse.org/repositories/home:" - "/rtCamp:/EasyEngine/xUbuntu_12.04/ /") - elif ee_platform_codename == 'trusty': - ee_nginx_repo = ("deb http://download.opensuse.org/repositories/home:" - "/rtCamp:/EasyEngine/xUbuntu_14.04/ /") - elif ee_platform_codename == 'xenial': - ee_nginx_repo = ("deb http://download.opensuse.org/repositories/home:" - "/rtCamp:/EasyEngine/xUbuntu_16.04/ /") - elif ee_platform_codename == 'bionic': - ee_nginx_repo = ("deb http://download.opensuse.org/repositories/home:" - "/rtCamp:/EasyEngine/xUbuntu_18.04/ /") - elif ee_platform_codename == 'wheezy': - ee_nginx_repo = ("deb http://download.opensuse.org/repositories/home:" - "/rtCamp:/EasyEngine/Debian_7.0/ /") - elif ee_platform_codename == 'jessie': - ee_nginx_repo = ("deb http://download.opensuse.org/repositories/home:" - "/rtCamp:/EasyEngine/Debian_8.0/ /") - - - ee_nginx = ["nginx-custom", "nginx-ee"] - ee_nginx_key = '3050AC3CD2AE6F03' - - # PHP repo and packages - if ee_platform_distro == 'ubuntu': - if ee_platform_codename == 'precise': - ee_php_repo = "ppa:ondrej/php5-5.6" - ee_php = ["php5-fpm", "php5-curl", "php5-gd", "php5-imap", - "php5-mcrypt", "php5-common", "php5-readline", - "php5-mysql", "php5-cli", "php5-memcache", "php5-imagick", - "memcached", "graphviz", "php-pear"] - elif (ee_platform_codename == 'trusty' or ee_platform_codename == 'xenial' or ee_platform_codename == 'bionic'): - ee_php_repo = "ppa:ondrej/php" - ee_php5_6 = ["php5.6-fpm", "php5.6-curl", "php5.6-gd", "php5.6-imap", - "php5.6-mcrypt", "php5.6-readline", "php5.6-common", "php5.6-recode", - "php5.6-mysql", "php5.6-cli", "php5.6-curl", "php5.6-mbstring", - "php5.6-bcmath", "php5.6-mysql", "php5.6-opcache", "php5.6-zip", "php5.6-xml", "php5.6-soap"] - ee_php7_0 = ["php7.0-fpm", "php7.0-curl", "php7.0-gd", "php7.0-imap", - "php7.0-mcrypt", "php7.0-readline", "php7.0-common", "php7.0-recode", - "php7.0-cli", "php7.0-mbstring", - "php7.0-bcmath", "php7.0-mysql", "php7.0-opcache", "php7.0-zip", "php7.0-xml", "php7.0-soap"] - ee_php_extra = ["php-memcached", "php-imagick", "php-memcache", "memcached", - "graphviz", "php-pear", "php-xdebug", "php-msgpack", "php-redis"] - elif ee_platform_distro == 'debian': - if ee_platform_codename == 'wheezy': - ee_php_repo = ("deb http://packages.dotdeb.org {codename}-php56 all" - .format(codename=ee_platform_codename)) - else : - ee_php_repo = ("deb http://packages.dotdeb.org {codename} all".format(codename=ee_platform_codename)) - - ee_php = ["php5-fpm", "php5-curl", "php5-gd", "php5-imap", - "php5-mcrypt", "php5-common", "php5-readline", - "php5-mysqlnd", "php5-cli", "php5-memcache", "php5-imagick", - "memcached", "graphviz", "php-pear"] - - ee_php7_0 = ["php7.0-fpm", "php7.0-curl", "php7.0-gd", "php7.0-imap", - "php7.0-mcrypt", "php7.0-common", "php7.0-readline", "php7.0-redis", - "php7.0-mysql", "php7.0-cli", "php7.0-memcache", "php7.0-imagick", - "php7.0-mbstring", "php7.0-recode", "php7.0-bcmath", "php7.0-opcache", "php7.0-zip", "php7.0-xml", - "php7.0-soap", "php7.0-msgpack", - "memcached", "graphviz", "php-pear", "php7.0-xdebug"] - ee_php_extra = [] - - if ee_platform_codename == 'wheezy': - ee_php = ee_php + ["php5-dev"] - - if ee_platform_codename == 'precise' or ee_platform_codename == 'jessie': - ee_php = ee_php + ["php5-xdebug"] - - # MySQL repo and packages - if ee_platform_distro == 'ubuntu': - ee_mysql_repo = ("deb http://sfo1.mirrors.digitalocean.com/mariadb/repo/" - "10.1/ubuntu {codename} main" - .format(codename=ee_platform_codename)) - elif ee_platform_distro == 'debian': - ee_mysql_repo = ("deb http://sfo1.mirrors.digitalocean.com/mariadb/repo/" - "10.1/debian {codename} main" - .format(codename=ee_platform_codename)) - - ee_mysql = ["mariadb-server", "percona-toolkit"] - - # Postfix repo and packages - ee_postfix_repo = "" - ee_postfix = ["postfix"] - - # Mail repo and packages - ee_mail_repo = ("deb http://http.debian.net/debian-backports {codename}" - "-backports main".format(codename=ee_platform_codename)) - if (ee_platform_distro == 'debian' or ee_platform_codename == 'precise'): - ee_mail = ["dovecot-core", "dovecot-imapd", "dovecot-pop3d", - "dovecot-lmtpd", "dovecot-mysql", "dovecot-sieve", - "dovecot-managesieved", "postfix-mysql", "php5-cgi", - "php-gettext", "php-pear"] - else: - ee_mail = ["dovecot-core", "dovecot-imapd", "dovecot-pop3d", - "dovecot-lmtpd", "dovecot-mysql", "dovecot-sieve", - "dovecot-managesieved", "postfix-mysql", "php5.6-cgi", - "php-gettext", "php-pear", "subversion"] - - # Mailscanner repo and packages - ee_mailscanner_repo = () - ee_mailscanner = ["amavisd-new", "spamassassin", "clamav", "clamav-daemon", - "arj", "zoo", "nomarch", "lzop", "cabextract", "p7zip", - "rpm", "unrar-free"] - - # HHVM repo details - # 12.04 requires boot repository - if ee_platform_distro == 'ubuntu': - if ee_platform_codename == "precise": - ee_boost_repo = ("ppa:mapnik/boost") - ee_hhvm_repo = ("deb http://dl.hhvm.com/ubuntu {codename} main" - .format(codename=ee_platform_codename)) - elif ee_platform_codename == "trusty": - ee_hhvm_repo = ("deb http://dl.hhvm.com/ubuntu {codename} main" - .format(codename=ee_platform_codename)) - else: - ee_hhvm_repo = ("deb http://dl.hhvm.com/debian {codename} main" - .format(codename=ee_platform_codename)) - - ee_hhvm = ["hhvm"] - - # Redis repo details - if ee_platform_distro == 'ubuntu': - ee_redis_repo = ("ppa:chris-lea/redis-server") - - else: - ee_redis_repo = ("deb http://packages.dotdeb.org {codename} all" - .format(codename=ee_platform_codename)) - - if (ee_platform_codename == 'trusty' or ee_platform_codename == 'xenial' or ee_platform_codename == 'bionic'): - ee_redis = ['redis-server', 'php-redis'] - else: - ee_redis = ['redis-server', 'php5-redis'] - - # Repo path - ee_repo_file = "ee-repo.list" - ee_repo_file_path = ("/etc/apt/sources.list.d/" + ee_repo_file) - - # Application dabase file path - basedir = os.path.abspath(os.path.dirname('/var/lib/ee/')) - ee_db_uri = 'sqlite:///' + os.path.join(basedir, 'ee.db') - - def __init__(self): - pass diff --git a/ee/utils/__init__.py b/ee/utils/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/ee/utils/test.py b/ee/utils/test.py deleted file mode 100644 index 1d3371edd..000000000 --- a/ee/utils/test.py +++ /dev/null @@ -1,15 +0,0 @@ -"""Testing utilities for EasyEngine.""" -from ee.cli.main import EETestApp -from cement.utils.test import * - - -class EETestCase(CementTestCase): - app_class = EETestApp - - def setUp(self): - """Override setup actions (for every test).""" - super(EETestCase, self).setUp() - - def tearDown(self): - """Override teardown actions (for every test).""" - super(EETestCase, self).tearDown() diff --git a/install b/install deleted file mode 100644 index 27ac955cf..000000000 --- a/install +++ /dev/null @@ -1,806 +0,0 @@ -#!/bin/bash - -# EasyEngine update script. -# This script is designed to install latest EasyEngine or -# to update current EasyEngine from 2.x to 3.x - -# Define echo function -# Blue color -function ee_lib_echo() -{ - echo $(tput setaf 4)$@$(tput sgr0) -} -# White color -function ee_lib_echo_info() -{ - echo $(tput setaf 7)$@$(tput sgr0) -} -# Red color -function ee_lib_echo_fail() -{ - echo $(tput setaf 1)$@$(tput sgr0) -} - -# Checking permissions -if [[ $EUID -ne 0 ]]; then - ee_lib_echo_fail "Sudo privilege required..." - ee_lib_echo_fail "Uses: wget -qO ee rt.cx/ee && sudo bash ee" - exit 100 -fi - -# Capture errors -function ee_lib_error() -{ - echo "[ `date` ] $(tput setaf 1)$@$(tput sgr0)" - exit $2 -} - -# Execute: apt-get update -ee_lib_echo "Executing apt-get update, please wait..." -apt-get update &>> /dev/null - -# Checking lsb_release package -if [ ! -x /usr/bin/lsb_release ]; then - ee_lib_echo "Installing lsb-release, please wait..." - apt-get -y install lsb-release &>> /dev/null -fi - -# Define variables for later use -ee_branch=$1 -readonly ee_version_old="2.2.3" -readonly ee_version_new="3.8.1" -readonly ee_log_dir=/var/log/ee/ -readonly ee_install_log=/var/log/ee/install.log -readonly ee_linux_distro=$(lsb_release -i | awk '{print $3}') -readonly ee_distro_version=$(lsb_release -sc) - -# Checking linux distro -if [ "$ee_linux_distro" != "Ubuntu" ] && [ "$ee_linux_distro" != "Debian" ]; then - ee_lib_echo_fail "EasyEngine (ee) is made for Ubuntu and Debian only as of now" - ee_lib_echo_fail "You are free to fork EasyEngine (ee): https://github.com/EasyEngine/easyengine/fork" - ee_lib_echo_fail "EasyEngine (ee) only support Ubuntu 14.04/16.04/18.04 and Debian 8.x" - exit 100 -fi - -# EasyEngine (ee) only support all Ubuntu/Debian distro except the distro reached EOL -lsb_release -d | egrep -e "14.04|16.04|18.04|jessie" &>> /dev/null -if [ "$?" -ne "0" ]; then - ee_lib_echo_fail "EasyEngine (ee) only support Ubuntu 14.04/16.04/18.04 LTS and Debian 8.x" - exit 100 -fi - -# Pre checks to avoid later screw ups -# Checking EasyEngine (ee) log directory -if [ ! -d $ee_log_dir ]; then - - ee_lib_echo "Creating EasyEngine log directory, please wait..." - mkdir -p $ee_log_dir || ee_lib_error "Unable to create log directory $ee_log_dir, exit status " $? - - # Create EasyEngine log files - touch /var/log/ee/{ee.log,install.log} - - # Keep EasyEngine log folder accessible to root only - chmod -R 700 /var/log/ee || ee_lib_error "Unable to change permissions for EasyEngine log folder, exit status " $? -fi - -# Install Python3, Git, Tar and python-software-properties required packages -# Generate Locale -function ee_install_dep() -{ - if [ "$ee_linux_distro" == "Ubuntu" ]; then - apt-get -y install build-essential curl gzip python3 python3-apt python3-setuptools python3-dev sqlite3 git tar software-properties-common || ee_lib_error "Unable to install pre depedencies, exit status " 1 - elif [ "$ee_linux_distro" == "Debian" ]; then - apt-get -y install build-essential curl gzip dirmngr python3 python3-apt python3-setuptools python3-dev sqlite3 git tar python-software-properties || ee_lib_error "Unable to pre depedencies, exit status " 1 - fi - - # Generating Locale - locale-gen en &>> /dev/null -} - -# Sqlite query to create table `sites` into ee.db -# which will be used by EasyEngine 3.x -function ee_sync_db() -{ - if [ ! -f /var/lib/ee/ee.db ]; then - mkdir -p /var/lib/ee - - echo "CREATE TABLE sites ( - id INTEGER PRIMARY KEY AUTOINCREMENT, - sitename UNIQUE, - site_type CHAR, - cache_type CHAR, - site_path CHAR, - created_on TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - is_enabled INT, - is_ssl INT, - storage_fs CHAR, - storage_db CHAR, - db_name VARCHAR, - db_user VARCHAR, - db_password VARCHAR, - db_host VARCHAR, - is_hhvm INT INT DEFAULT '0', - is_pagespeed INT INT DEFAULT '0', - php_version VARCHAR - );" | sqlite3 /var/lib/ee/ee.db - - # Check site is enable/live or disable - for site in $(ls /etc/nginx/sites-available/ | grep -v default); - do - if [ -f /etc/nginx/sites-enabled/$site ]; then - ee_site_status='1' - else - ee_site_status='0' - fi - - # Find out information about current NGINX configuration - ee_site_current_type=$(head -n1 /etc/nginx/sites-available/$site | grep "NGINX CONFIGURATION" | rev | cut -d' ' -f3,4,5,6,7 | rev | cut -d ' ' -f2,3,4,5) - - # Detect current website type and cache - if [ "$ee_site_current_type" = "HTML" ]; then - ee_site_current="html" - ee_site_current_cache="basic" - elif [ "$ee_site_current_type" = "PHP" ]; then - ee_site_current="php" - ee_site_current_cache="basic" - elif [ "$ee_site_current_type" = "MYSQL" ]; then - ee_site_current="mysql" - ee_site_current_cache="basic" - # Single WordPress - elif [ "$ee_site_current_type" = "WPSINGLE BASIC" ]; then - ee_site_current="wp" - ee_site_current_cache="basic" - - elif [ "$ee_site_current_type" = "WPSINGLE WP SUPER CACHE" ]; then - ee_site_current="wp" - ee_site_current_cache="wpsc" - - elif [ "$ee_site_current_type" = "WPSINGLE W3 TOTAL CACHE" ]; then - ee_site_current="wp" - ee_site_current_cache="w3tc" - - elif [ "$ee_site_current_type" = "WPSINGLE FAST CGI" ] || [ "$ee_site_current_type" = "WPSINGLE FASTCGI" ]; then - ee_site_current="wp" - ee_site_current_cache="wpfc" - - # WordPress subdirectory - elif [ "$ee_site_current_type" = "WPSUBDIR BASIC" ]; then - ee_site_current="wpsubdir" - ee_site_current_cache="basic" - - elif [ "$ee_site_current_type" = "WPSUBDIR WP SUPER CACHE" ]; then - ee_site_current="wpsubdir" - ee_site_current_cache="wpsc" - - elif [ "$ee_site_current_type" = "WPSUBDIR W3 TOTAL CACHE" ]; then - ee_site_current="wpsubdir" - ee_site_current_cache="w3tc" - - elif [ "$ee_site_current_type" = "WPSUBDIR FAST CGI" ] || [ "$ee_site_current_type" = "WPSUBDIR FASTCGI" ]; then - ee_site_current="wpsubdir" - ee_site_current_cache="wpfc" - - # WordPress subdomain - elif [ "$ee_site_current_type" = "WPSUBDOMAIN BASIC" ]; then - ee_site_current="wpsubdomain" - ee_site_current_cache="basic" - - elif [ "$ee_site_current_type" = "WPSUBDOMAIN WP SUPER CACHE" ]; then - ee_site_current="wpsubdomain" - ee_site_current_cache="wpsc" - - elif [ "$ee_site_current_type" = "WPSUBDOMAIN W3 TOTAL CACHE" ]; then - ee_site_current="wpsubdomain" - ee_site_current_cache="w3tc" - - elif [ "$ee_site_current_type" = "WPSUBDOMAIN FAST CGI" ] || [ "$ee_site_current_type" = "WPSUBDOMAIN FASTCGI" ]; then - ee_site_current="wpsubdomain" - ee_site_current_cache="wpfc" - fi - - ee_webroot="/var/www/$site" - - # Insert query to insert old site information into ee.db - echo "INSERT INTO sites (sitename, site_type, cache_type, site_path, is_enabled, is_ssl, storage_fs, storage_db) - VALUES (\"$site\", \"$ee_site_current\", \"$ee_site_current_cache\", \"$ee_webroot\", \"$ee_site_status\", 0, 'ext4', 'mysql');" | sqlite3 /var/lib/ee/ee.db - - done - else - ee_php_version=$(php -v | head -n1 | cut -d' ' -f2 |cut -c1-3) - ee_lib_echo "Updating EasyEngine Database" - echo "ALTER TABLE sites ADD COLUMN db_name varchar;" | sqlite3 /var/lib/ee/ee.db - echo "ALTER TABLE sites ADD COLUMN db_user varchar; " | sqlite3 /var/lib/ee/ee.db - echo "ALTER TABLE sites ADD COLUMN db_password varchar;" | sqlite3 /var/lib/ee/ee.db - echo "ALTER TABLE sites ADD COLUMN db_host varchar;" | sqlite3 /var/lib/ee/ee.db - echo "ALTER TABLE sites ADD COLUMN is_hhvm INT DEFAULT '0';" | sqlite3 /var/lib/ee/ee.db - echo "ALTER TABLE sites ADD COLUMN is_pagespeed INT DEFAULT '0';" | sqlite3 /var/lib/ee/ee.db - echo "ALTER TABLE sites ADD COLUMN php_version varchar DEFAULT \"$ee_php_version\";" | sqlite3 /var/lib/ee/ee.db - fi -} - - -function secure_ee_db() -{ - chown -R root:root /var/lib/ee/ - chmod -R 600 /var/lib/ee/ -} - -function ee_update_wp_cli() -{ - ee_lib_echo "Updating WP-CLI version to resolve compatibility issue." - PHP_PATH=$(which php) - WP_CLI_PATH=$(which wp) - if [ "${WP_CLI_PATH}" != "" ]; then - # Get WP-CLI version - WP_CLI_VERSION=$(${PHP_PATH} ${WP_CLI_PATH} --allow-root cli version | awk '{ print $2 }') - dpkg --compare-versions ${WP_CLI_VERSION} lt 1.4.1 - # Update WP-CLI version - if [ "$?" == "0" ]; then - wget -qO ${WP_CLI_PATH} https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar - chmod +x ${WP_CLI_PATH} - fi - fi -} - -function check_pagespeed() -{ - ee_lib_echo_info "Please Note: We have removed pagespeed from current version of our nginx build." - ee_lib_echo_info "Verifiying if PageSpeed is not used..." - - if [ -f /etc/nginx/conf.d/pagespeed.conf ] - then - PAGESPEEDSITE="$(echo "SELECT sitename FROM sites WHERE is_pagespeed=1;"| sqlite3 /var/lib/ee/ee.db | wc -l)" - - if [ ${PAGESPEEDSITE} -ge 0 ]; then - ee_lib_echo_fail "Issue: Update script has found PageSpeed on following site" - echo "SELECT sitename FROM sites WHERE is_pagespeed=1;"| sqlite3 /var/lib/ee/ee.db - ee_lib_echo_fail "Please remove Pagespeed from above site using:" - ee_lib_echo_fail "ee site update example.com --pagespeed=off or follow this blog: https://easyengine.io/blog/disabling-pagespeed/ " - ee_lib_error "Once done, run `ee update` again" - fi - else - ee_lib_echo_info "OK: PageSpeed not Present." - fi - -} - -# Install EasyEngine 3.x -function ee_install() -{ - # Remove old clone of EasyEngine (ee) if any - rm -rf /tmp/easyengine &>> /dev/null - - # Clone EE 3.0 Python ee_branch - ee_lib_echo "Cloning EasyEngine, please wait..." - if [ "$ee_branch" = "" ]; then - ee_branch=master - fi - - git clone -b $ee_branch https://github.com/EasyEngine/easyengine.git /tmp/easyengine --quiet > /dev/null \ - || ee_lib_error "Unable to clone EasyEngine, exit status" $? - - cd /tmp/easyengine - ee_lib_echo "Installing EasyEngine, please wait..." - python3 setup.py install || ee_lib_error "Unable to install EasyEngine, exit status " $? -} - -# Update EasyEngine configuration -# Remove EasyEngine 2.x -function ee_update() -{ - # Preserve old configuration - ee_lib_echo "Updating EasyEngine configuration, please wait..." - - ee_grant_host=$(grep grant-host /etc/easyengine/ee.conf | awk '{ print $3 }' | head -1 ) - ee_db_name=$(grep db-name /etc/easyengine/ee.conf | awk '{ print $3 }') - ee_db_user=$(grep db-name /etc/easyengine/ee.conf | awk '{ print $3 }') - ee_wp_prefix=$(grep prefix /etc/easyengine/ee.conf | awk '{ print $3 }') - ee_wp_user=$(grep 'user ' /etc/easyengine/ee.conf | grep -v db-user |awk '{ print $3 }') - ee_wp_pass=$(grep password /etc/easyengine/ee.conf | awk '{ print $3 }') - ee_wp_email=$(grep email /etc/easyengine/ee.conf | awk '{ print $3 }') - ee_ip_addr=$(grep ip-address /etc/easyengine/ee.conf |awk -F'=' '{ print $2 }') - - sed -i "s/ip-address.*/ip-address = ${ee_ip_addr}/" /etc/ee/ee.conf && \ - sed -i "s/grant-host.*/grant-host = ${ee_grant_host}/" /etc/ee/ee.conf && \ - sed -i "s/db-name.*/db-name = ${db-name}/" /etc/ee/ee.conf && \ - sed -i "s/db-user.*/db-user = ${ee_db_user}/" /etc/ee/ee.conf && \ - sed -i "s/prefix.*/prefix = ${ee_wp_prefix}/" /etc/ee/ee.conf && \ - sed -i "s/^user.*/user = ${ee_wp_user}/" /etc/ee/ee.conf && \ - sed -i "s/password.*/password = ${ee_wp_password}/" /etc/ee/ee.conf && \ - sed -i "s/email.*/email = ${ee_wp_email}/" /etc/ee/ee.conf || ee_lib_error "Unable to update configuration, exit status " $? - - # Remove old EasyEngine - ee_lib_echo "Removing EasyEngine 2.x" - rm -rf /etc/bash_completion.d/ee /etc/easyengine/ /usr/share/easyengine/ /usr/local/lib/easyengine /usr/local/sbin/easyengine /usr/local/sbin/ee /var/log/easyengine - - # Softlink to fix command not found error - ln -s /usr/local/bin/ee /usr/local/sbin/ee || ee_lib_error "Unable to create softlink to old EasyEngine, exit status " $? -} - -function ee_upgrade_php(){ - #Upgrade PHP5.6 to a new repo supporting PHP 7.0 - if [ "$ee_distro_version" == "trusty" ]; then - if [ -f /etc/apt/sources.list.d/ondrej-php5-5_6-trusty.list ]; then - # add-apt-repository -y --remove 'ppa:ondrej/php5-5.6' - add-apt-repository -y 'ppa:ondrej/php' - ee_lib_echo "Upgrading required packages, please wait..." - apt-get update &>> /dev/null - apt-get -y install php5.6-fpm php5.6-curl php5.6-gd php5.6-imap php5.6-mcrypt php5.6-readline php5.6-mysql php5.6-cli php5.6-common php5.6-curl php5.6-mbstring php5.6-bcmath php5.6-recode php5.6-mysql php5.6-opcache php-memcached php-imagick memcached graphviz php-pear php-xdebug php-msgpack php5.6-zip php5.6-xml php5.6-soap php-memcache || ee_lib_error "Unable to install PHP 5.6 packages, exit status " 1 - if [ -e /etc/php5/fpm/pool.d/www.conf -a -e /etc/php5/fpm/pool.d/debug.conf -a -e /etc/php5/fpm/php.ini -a -e /etc/php5/fpm/php-fpm.conf ]; then - cp -f /etc/php5/fpm/pool.d/www.conf /etc/php/5.6/fpm/pool.d/www.conf &>> /dev/null - cp -f /etc/php5/fpm/pool.d/debug.conf /etc/php/5.6/fpm/pool.d/debug.conf &>> /dev/null - cp -f /etc/php5/fpm/php.ini /etc/php/5.6/fpm/php.ini &>> /dev/null - cp -f /etc/php5/fpm/php-fpm.conf /etc/php/5.6/fpm/php-fpm.conf &>> /dev/null - else - echo "Some files are missing." || ee_lib_error "Unable to configure PHP5.6 packages, exit status " 1 - fi - sed -i "s/pid.*/pid = \/run\/php\/php5.6-fpm.pid/" /etc/php/5.6/fpm/php-fpm.conf && \ - sed -i "s/error_log.*/error_log = \/var\/log\/php\/5.6\/fpm.log/" /etc/php/5.6/fpm/php-fpm.conf && \ - sed -i "s/log_level.*/log_level = notice/" /etc/php/5.6/fpm/php-fpm.conf && \ - sed -i "s/include.*/include = \/etc\/php\/5.6\/fpm\/pool.d\/*.conf/" /etc/php/5.6/fpm/php-fpm.conf && \ - sed -i "s/slowlog =.*/slowlog = \/var\/log\/php\/5.6\/slow.log/" /etc/php/5.6/fpm/pool.d/debug.conf || ee_lib_error "Unable to update configuration, exit status " $? - mkdir -p /var/log/php/5.6/ - touch /var/log/php/5.6/slow.log /var/log/php/5.6/fpm.log - service php5-fpm stop &>> /dev/null - service php5.6-fpm restart &>> /dev/null - rm -f /etc/apt/sources.list.d/ondrej-php5-5_6-trusty.list &>> /dev/null - apt-get remove -y php5-fpm php5-curl php5-gd php5-imap php5-mcrypt php5-common php5-readline php5-mysql php5-cli php5-memcache php5-imagick memcached graphviz php-pear - - #Fix for PHP 5.6 + 7.0 missed packages - elif [ -f /etc/php/mods-available/readline.ini ]; then - mkdir -p /tmp/php-conf/5.6 - mkdir -p /tmp/php-conf/7.0 - cp -f /etc/php/5.6/fpm/pool.d/www.conf /tmp/php-conf/5.6 &>> /dev/null - cp -f /etc/php/5.6/fpm/pool.d/debug.conf /tmp/php-conf/5.6 &>> /dev/null - cp -f /etc/php/5.6/fpm/php.ini /tmp/php-conf/5.6 &>> /dev/null - cp -f /etc/php/5.6/fpm/php-fpm.conf /tmp/php-conf/5.6 &>> /dev/null - - cp -f /etc/php/7.0/fpm/pool.d/www.conf /tmp/php-conf/7.0 &>> /dev/null - cp -f /etc/php/7.0/fpm/pool.d/debug.conf /tmp/php-conf/7.0 &>> /dev/null - cp -f /etc/php/7.0/fpm/php.ini /tmp/php-conf/7.0 &>> /dev/null - cp -f /etc/php/7.0/fpm/php-fpm.conf /tmp/php-conf/7.0 &>> /dev/null - - - apt-get -y install php5.6-fpm php5.6-curl php5.6-gd php5.6-imap php5.6-mcrypt php5.6-readline php5.6-mysql php5.6-cli php5.6-common php5.6-curl php5.6-mbstring php5.6-bcmath php5.6-recode php5.6-mysql php5.6-opcache php-memcached php-imagick memcached graphviz php-pear php-xdebug php-msgpack php5.6-zip php5.6-xml php-memcache || ee_lib_error "Unable to install PHP 5.6 packages, exit status " 1 - dpkg-query -W -f='${Status} ${Version}\n' php7.0-fpm 2>/dev/null | grep installed - if [ "$?" -eq "0" ]; then - apt-get -y install php7.0-fpm php7.0-curl php7.0-gd php7.0-imap php7.0-mcrypt php7.0-readline php7.0-common php7.0-recode php7.0-mysql php7.0-cli php7.0-curl php7.0-mbstring php7.0-bcmath php7.0-mysql php7.0-opcache php7.0-zip php7.0-xml php-memcached php-imagick php-memcache memcached graphviz php-pear php-xdebug php-msgpack php7.0-soap || ee_lib_error "Unable to install PHP 7.0 packages, exit status " 1 - mv -f /tmp/php-conf/7.0/www.conf /etc/php/7.0/fpm/pool.d/www.conf &>> /dev/null - mv -f /tmp/php-conf/7.0/debug.conf /etc/php/7.0/fpm/pool.d/debug.conf &>> /dev/null - mv -f /tmp/php-conf/7.0/php.ini /etc/php/7.0/fpm/php.ini &>> /dev/null - mv -f /tmp/php-conf/7.0/php-fpm.conf /etc/php/7.0/fpm/php-fpm.conf &>> /dev/null - service php7.0-fpm restart &>> /dev/null - fi - - mv -f /tmp/php-conf/5.6/www.conf /etc/php/5.6/fpm/pool.d/www.conf &>> /dev/null - mv -f /tmp/php-conf/5.6/debug.conf /etc/php/5.6/fpm/pool.d/debug.conf &>> /dev/null - mv -f /tmp/php-conf/5.6/php.ini /etc/php/5.6/fpm/php.ini &>> /dev/null - mv -f /tmp/php-conf/5.6/php-fpm.conf /etc/php/5.6/fpm/php-fpm.conf &>> /dev/null - - service php5.6-fpm restart &>> /dev/null - rm -rf /tmp/php-conf - fi - fi - -} - -function ee_update_latest() -{ - -if [ -f /etc/nginx/fastcgi_params ] -then - cat /etc/nginx/fastcgi_params| grep -q 'HTTP_PROXY' - if [[ $? -ne 0 ]]; then - echo "fastcgi_param HTTP_PROXY \"\";" >> /etc/nginx/fastcgi_params - echo "fastcgi_param HTTP_PROXY \"\";" >> /etc/nginx/fastcgi.conf - service nginx restart &>> /dev/null - fi -fi - - - -if [ -f /etc/ImageMagick/policy.xml ] - then - if [ ! -f /etc/ImageMagick/patch.txt ] - then - echo -e "\t<policy domain="coder" rights="none" pattern="EPHEMERAL" />\n\t<policy domain="coder" rights="none" pattern="URL" />\n\t<policy domain="coder" rights="none" pattern="HTTPS" />\n\t<policy domain="coder" rights="none" pattern="MVG" />\n\t<policy domain="coder" rights="none" pattern="MSL" />" >> /etc/ImageMagick/patch.txt - sed -i '/<policymap>/r /etc/ImageMagick/patch.txt' /etc/ImageMagick/policy.xml - fi - fi - - #Move ~/.my.cnf to /etc/mysql/conf.d/my.cnf - if [ ! -f /etc/mysql/conf.d/my.cnf ] - then - #create conf.d folder if not exist - if [ ! -d /etc/mysql/conf.d ]; then - mkdir -p /etc/mysql/conf.d - chmod 755 /etc/mysql/conf.d - fi - if [ -d /etc/mysql/conf.d ] - then - if [ -f ~/.my.cnf ] - then - cp ~/.my.cnf /etc/mysql/conf.d/my.cnf &>> /dev/null - chmod 600 /etc/mysql/conf.d/my.cnf - else - if [ -f /root/.my.cnf ] - then - cp /root/.my.cnf /etc/mysql/conf.d/my.cnf &>> /dev/null - chmod 600 /etc/mysql/conf.d/my.cnf - else - ee_lib_echo_fail ".my.cnf cannot be located in your current user or root." - fi - fi - fi - fi - - - if [ -f /etc/nginx/nginx.conf ]; then - ee_lib_echo "Updating Nginx configuration, please wait..." - # From version 3.1.10 we are using Suse builder for repository - if [ "$ee_distro_version" == "precise" ]; then - grep -Hr 'http://download.opensuse.org/repositories/home:/rtCamp:/EasyEngine/xUbuntu_12.04/ /' /etc/apt/sources.list.d/ &>> /dev/null - if [[ $? -ne 0 ]]; then - if [ -f /etc/apt/sources.list.d/rtcamp-nginx-precise.list ]; then - rm -rf /etc/apt/sources.list.d/rtcamp-nginx-precise.list - fi - echo -e "\ndeb http://download.opensuse.org/repositories/home:/rtCamp:/EasyEngine/xUbuntu_12.04/ /" >> /etc/apt/sources.list.d/ee-repo.list - gpg --keyserver "hkp://pgp.mit.edu" --recv-keys '3050AC3CD2AE6F03' - gpg -a --export --armor '3050AC3CD2AE6F03' | apt-key add - - if [ -f /etc/nginx/conf.d/ee-nginx.conf ]; then - mv /etc/nginx/conf.d/ee-nginx.conf /etc/nginx/conf.d/ee-nginx.conf.old &>> /dev/null - fi - mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.old &>> /dev/null - apt-get update - service nginx stop &>> /dev/null - DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confmiss" -o Dpkg::Options::="--force-confold" -y install nginx-ee openssl - service nginx restart &>> /dev/null - fi - dpkg --get-selections | grep -v deinstall | grep nginx-common - if [ $? -eq 0 ]; then - apt-get update - dpkg --get-selections | grep -v deinstall | grep nginx-mainline - if [ $? -eq 0 ]; then - apt-get remove -y nginx-mainline - fi - service nginx stop &>> /dev/null - DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confmiss" -o Dpkg::Options::="--force-confold" -y --allow-unauthenticated install nginx-ee nginx-custom - service nginx restart &>> /dev/null - fi - dpkg --get-selections | grep -v deinstall | grep nginx-mainline - - elif [ "$ee_distro_version" == "trusty" ]; then - grep -Hr 'http://download.opensuse.org/repositories/home:/rtCamp:/EasyEngine/xUbuntu_14.04/ /' /etc/apt/sources.list.d/ &>> /dev/null - if [[ $? -ne 0 ]]; then - if [ -f /etc/apt/sources.list.d/rtcamp-nginx-trusty.list ]; then - rm -rf /etc/apt/sources.list.d/rtcamp-nginx-trusty.list - fi - echo -e "\ndeb http://download.opensuse.org/repositories/home:/rtCamp:/EasyEngine/xUbuntu_14.04/ /" >> /etc/apt/sources.list.d/ee-repo.list - gpg --keyserver "hkp://pgp.mit.edu" --recv-keys '3050AC3CD2AE6F03' - gpg -a --export --armor '3050AC3CD2AE6F03' | apt-key add - - if [ -f /etc/nginx/conf.d/ee-nginx.conf ]; then - mv /etc/nginx/conf.d/ee-nginx.conf /etc/nginx/conf.d/ee-nginx.conf.old &>> /dev/null - fi - mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.old &>> /dev/null - apt-get update - service nginx stop &>> /dev/null - DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confmiss" -o Dpkg::Options::="--force-confold" -y install nginx-custom nginx-ee - service nginx restart &>> /dev/null - fi - dpkg --get-selections | grep -v deinstall | grep nginx-common - if [ $? -eq 0 ]; then - apt-get update - dpkg --get-selections | grep -v deinstall | grep nginx-mainline - if [ $? -eq 0 ]; then - apt-get remove -y nginx-mainline - fi - service nginx stop &>> /dev/null - DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confmiss" -o Dpkg::Options::="--force-confold" -y --allow-unauthenticated install nginx-ee nginx-custom - service nginx restart &>> /dev/null - fi - - elif [ "$ee_distro_version" == "wheezy" ]; then - grep -Hr 'http://download.opensuse.org/repositories/home:/rtCamp:/EasyEngine/Debian_7.0/ /' /etc/apt/sources.list.d/ &>> /dev/null - #grep -Hr "deb http://packages.dotdeb.org wheezy all" /etc/apt/sources.list.d/ee-repo.list &>> /dev/null - if [[ $? -ne 0 ]]; then - # if [ -f /etc/apt/sources.list.d/dotdeb-wheezy.list ]; then - # rm -rf /etc/apt/sources.list.d/dotdeb-wheezy.list - # else - # sed -i "/deb http:\/\/packages.dotdeb.org wheezy all/d" /etc/apt/sources.list.d/ee-repo.list &>> /dev/null - # fi - echo -e "deb http://download.opensuse.org/repositories/home:/rtCamp:/EasyEngine/Debian_7.0/ /" >> /etc/apt/sources.list.d/ee-repo.list - gpg --keyserver "hkp://pgp.mit.edu" --recv-keys '3050AC3CD2AE6F03' - gpg -a --export --armor '3050AC3CD2AE6F03' | apt-key add - - if [ -f /etc/nginx/conf.d/ee-nginx.conf ]; then - mv /etc/nginx/conf.d/ee-nginx.conf /etc/nginx/conf.d/ee-nginx.conf.old &>> /dev/null - fi - mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.old &>> /dev/null - mv /etc/nginx/fastcgi_params /etc/nginx/fastcgi_params.old &>> /dev/null - apt-get update - service nginx stop &>> /dev/null - DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confmiss" -o Dpkg::Options::="--force-confold" -y install nginx-custom - service nginx restart &>> /dev/null - fi - dpkg --get-selections | grep -v deinstall | grep nginx-common - if [ $? -eq 0 ]; then - apt-get update - service nginx stop &>> /dev/null - DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confmiss" -o Dpkg::Options::="--force-confold" -y install nginx-ee nginx-custom - service nginx restart &>> /dev/null - fi - elif [ "$ee_distro_version" == "jessie" ]; then - - grep -Hr 'http://download.opensuse.org/repositories/home:/rtCamp:/EasyEngine/Debian_8.0/ /' /etc/apt/sources.list.d/ &>> /dev/null - #grep -Hr "deb http://packages.dotdeb.org jessie all" /etc/apt/sources.list.d/ee-repo.list &>> /dev/null - if [[ $? -ne 0 ]]; then - #sed -i "/deb http:\/\/packages.dotdeb.org jessie all/d" /etc/apt/sources.list.d/ee-repo.list &>> /dev/null - echo -e "deb http://download.opensuse.org/repositories/home:/rtCamp:/EasyEngine/Debian_8.0/ /" >> /etc/apt/sources.list.d/ee-repo.list - gpg --keyserver "hkp://pgp.mit.edu" --recv-keys '3050AC3CD2AE6F03' - gpg -a --export --armor '3050AC3CD2AE6F03' | apt-key add - - if [ -f /etc/nginx/conf.d/ee-nginx.conf ]; then - mv /etc/nginx/conf.d/ee-nginx.conf /etc/nginx/conf.d/ee-nginx.conf.old &>> /dev/null - fi - mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.old &>> /dev/null - mv /etc/nginx/fastcgi_params /etc/nginx/fastcgi_params.old &>> /dev/null - apt-get update - service nginx stop &>> /dev/null - apt-get -o Dpkg::Options::="--force-confmiss" -o Dpkg::Options::="--force-confold" -y install nginx-custom - service nginx restart &>> /dev/null - fi - dpkg --get-selections | grep -v deinstall | grep nginx-common - if [ $? -eq 0 ]; then - apt-get update - dpkg --get-selections | grep -v deinstall | grep nginx-mainline - if [ $? -eq 0 ]; then - apt-get remove -y nginx-mainline - fi - service nginx stop &>> /dev/null - DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confmiss" -o Dpkg::Options::="--force-confold" -y --allow-unauthenticated install nginx-ee nginx-custom - service nginx restart &>> /dev/null - fi - fi - fi - - if [ -f /etc/nginx/nginx.conf ]; then - sed -i "s/.*X-Powered-By.*/\tadd_header X-Powered-By \"EasyEngine $ee_version_new\";/" /etc/nginx/nginx.conf &>> /dev/null - fi - - if [ -f /etc/nginx/conf.d/ee-plus.conf ]; then - sed -i "s/.*X-Powered-By.*/\tadd_header X-Powered-By \"EasyEngine $ee_version_new\";/" /etc/nginx/conf.d/ee-plus.conf &>> /dev/null - fi - - # Disable Xdebug on old systems if and only if ee debug is off - if [ -f /etc/php5/mods-available/xdebug.ini ]; then - ee_debug_value=$(grep -Hr 9001 /etc/nginx/conf.d/upstream.conf | wc -l ) - if [ $ee_debug_value -eq 1 ]; then - grep -Hr ";zend_extension" /etc/php5/mods-available/xdebug.ini &>> /dev/null - if [ $? -ne 0 ]; then - sed -i "s/zend_extension/;zend_extension/" /etc/php5/mods-available/xdebug.ini - fi - fi - fi - - # Fix HHVM autostart on reboot - dpkg --get-selections | grep -v deinstall | grep hhvm &>> /dev/null - if [ $? -eq 0 ]; then - update-rc.d hhvm defaults &>> /dev/null - fi - - # Fix WordPress example.html issue - # Ref: http://wptavern.com/xss-vulnerability-in-jetpack-and-the-twenty-fifteen-default-theme-affects-millions-of-wordpress-users - dpkg --get-selections | grep -v deinstall | grep nginx &>> /dev/null - if [ $? -eq 0 ]; then - cp /usr/lib/ee/templates/locations.mustache /etc/nginx/common/locations.conf &>> /dev/null - fi - - # Fix HHVM upstream issue that was preventing from using EasyEngine for site operations - if [ -f /etc/nginx/conf.d/upstream.conf ]; then - grep -Hr hhvm /etc/nginx/conf.d/upstream.conf &>> /dev/null - if [ $? -ne 0 ]; then - echo -e "upstream hhvm {\n# HHVM Pool\nserver 127.0.0.1:8000;\nserver 127.0.0.1:9000 backup;\n}\n" >> /etc/nginx/conf.d/upstream.conf - fi - fi - - # Fix HHVM server IP - if [ -f /etc/hhvm/server.ini ]; then - grep -Hr "hhvm.server.ip" /etc/hhvm/server.ini &>> /dev/null - if [ $? -ne 0 ]; then - echo -e "hhvm.server.ip = 127.0.0.1\n" >> /etc/hhvm/server.ini - fi - fi - - - # Rename Redis Header - if [ -f /etc/nginx/common/redis-hhvm.conf ]; then - sed -i "s/X-Cache /X-SRCache-Fetch-Status /g" /etc/nginx/common/redis-hhvm.conf &>> /dev/null - sed -i "s/X-Cache-2 /X-SRCache-Store-Status /g" /etc/nginx/common/redis-hhvm.conf &>> /dev/null - fi - - if [ -f /etc/nginx/common/redis.conf ]; then - sed -i "s/X-Cache /X-SRCache-Fetch-Status /g" /etc/nginx/common/redis.conf &>> /dev/null - sed -i "s/X-Cache-2 /X-SRCache-Store-Status /g" /etc/nginx/common/redis.conf &>> /dev/null - fi - - - if [ -f /etc/nginx/common/redis-hhvm.conf ]; then - # Update Timeout redis-hhvm.conf - grep -0 'redis2_query expire $key 6h' /etc/nginx/common/redis-hhvm.conf &>> /dev/null - if [ $? -eq 0 ]; then - sed -i 's/redis2_query expire $key 6h/redis2_query expire $key 14400/g' /etc/nginx/common/redis-hhvm.conf &>> /dev/null - fi - - #Fix for 3.3.4 redis-hhvm issue - grep -0 'HTTP_ACCEPT_ENCODING' /etc/nginx/common/redis-hhvm.conf &>> /dev/null - if [ $? -ne 0 ]; then - sed -i 's/fastcgi_params;/fastcgi_params;\n fastcgi_param HTTP_ACCEPT_ENCODING "";/g' /etc/nginx/common/redis-hhvm.conf &>> /dev/null - fi - fi - - #Fix Security Issue. commit #c64f28e - if [ -f /etc/nginx/common/locations.conf ]; then - grep -0 '$request_uri ~\* \"^.+(readme|license|example)\\.(txt|html)$\"' /etc/nginx/common/locations.conf &>> /dev/null - if [ $? -eq 0 ]; then - sed -i 's/$request_uri ~\* \"^.+(readme|license|example)\\.(txt|html)$\"/$uri ~\* \"^.+(readme|license|example)\\.(txt|html)$\"/g' /etc/nginx/common/locations.conf &>> /dev/null - fi - fi - - #Fix Redis-server security issue - #http://redis.io/topics/security - if [ -f /etc/redis/redis.conf ]; then - grep -0 -v "#" /etc/redis/redis.conf | grep 'bind' &>> /dev/null - if [ $? -ne 0 ]; then - sed -i '$ a bind 127.0.0.1' /etc/redis/redis.conf &>> /dev/null - service redis-server restart &>> /dev/null - fi - fi - - #Fix For --letsencrypt - if [ -f /etc/nginx/common/locations.conf ]; then - grep -0 'location ~ \/\\.well-known' /etc/nginx/common/locations.conf &>> /dev/null - if [ $? -ne 0 ]; then - sed -i 's/# Deny hidden files/# Deny hidden files\nlocation ~ \/\\.well-known {\n allow all;\n}\n /g' /etc/nginx/common/locations.conf &>> /dev/null - fi - fi - - # Fix for 3.3.2 renamed nginx.conf - nginx -V 2>&1 &>>/dev/null - if [[ $? -eq 0 ]]; then - nginx -t 2>&1 | grep 'open() "/etc/nginx/nginx.conf" failed' &>>/dev/null - if [[ $? -eq 0 ]]; then - if [ -f /etc/nginx/nginx.conf.old ]; then - if [ ! -f /etc/nginx/nginx.conf ]; then - cp /etc/nginx/nginx.conf.old /etc/nginx/nginx.conf - fi - fi - fi - # Fix for 3.3.2 renamed fastcgi_param - nginx -t 2>&1 | grep 'open() "/etc/nginx/fastcgi_params" failed' &>>/dev/null - if [[ $? -eq 0 ]]; then - if [ -f /etc/nginx/fastcgi_params.old ]; then - if [ ! -f /etc/nginx/fastcgi_params ]; then - cp /etc/nginx/fastcgi_params.old /etc/nginx/fastcgi_params - fi - fi - fi - fi - - #Fix For ssl_ciphers - if [ -f /etc/nginx/nginx.conf ]; then - sed -i 's/HIGH:!aNULL:!MD5:!kEDH;/ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:ECDHE-RSA-DES-CBC3-SHA:ECDHE-ECDSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA;/' /etc/nginx/nginx.conf - fi - - #Fix for SSL cert --all - crontab -l | grep -q '\-\-min_expiry_limit' - if [[ $? -eq 0 ]]; then - crontab -l > /var/spool/cron/cron-backup.txt #backup cron before editing - crontab -l | sed '/--min_expiry_limit/d' | crontab - - /bin/bash -c "crontab -l 2> /dev/null | { cat; echo -e \"\n0 0 * * 0 ee site update --le=renew --all 2> /dev/null # Renew all letsencrypt SSL cert. Set by EasyEngine\"; } | crontab -" - fi - - - -} - -# Do git intialisation -function ee_git_init() -{ - # Nginx under git version control - if [ -d /etc/nginx ];then - cd /etc/nginx - if [ ! -d /etc/nginx/.git ]; then - git init &>> /dev/null - fi - git add -A . - git commit -am "Updated Nginx" > /dev/null - fi - # EasyEngine under git version control - cd /etc/ee - if [ ! -d /etc/ee/.git ]; then - git init > /dev/null - fi - git add -A . - git commit -am "Installed/Updated to EasyEngine 3.x" &>> /dev/null - - #PHP under git version control - if [ -d /etc/php ];then - cd /etc/php - if [ ! -d /etc/php/.git ]; then - git init &>> /dev/null - fi - git add -A . - git commit -am "Updated PHP" > /dev/null - fi - -} - -# Update EasyEngine -if [ -f /usr/local/sbin/easyengine ]; then - # Check old EasyEngine version - ee version | grep ${ee_version_old} &>> /dev/null - if [[ $? -ne 0 ]]; then - ee_lib_echo "EasyEngine $ee_version_old not found on your system" | tee -ai $ee_install_log - ee_lib_echo "Updating your EasyEngine to $ee_version_old for compability" | tee -ai $ee_install_log - wget -q https://raw.githubusercontent.com/EasyEngine/easyengine/old-stable/bin/update && bash update - if [[ $? -ne 0 ]]; then - ee_lib_echo_fail "Unable to update EasyEngine to $ee_version_old, exit status = " $? - exit 100 - fi - fi - read -p "Update EasyEngine to $ee_version_new (y/n): " ee_ans - if [ "$ee_ans" = "y" ] || [ "$ee_ans" = "Y" ]; then - check_pagespeed | tee -ai $ee_install_log - ee_install_dep | tee -ai $ee_install_log - ee_sync_db 2&>>1 $EE_INSTALL_LOG - secure_ee_db | tee -ai $EE_INSTALL_LOG - ee_upgrade_php | tee -ai $ee_install_log - ee_install | tee -ai $ee_install_log - ee_update | tee -ai $ee_install_log - ee_update_latest | tee -ai $ee_install_log - ee_git_init | tee -ai $ee_install_log - else - ee_lib_error "Not updating EasyEngine to $ee_version_new, exit status = " 1 - fi -elif [ ! -f /usr/local/bin/ee ]; then - ee_lib_echo "Installing depedencies" | tee -ai $ee_install_log - ee_install_dep | tee -ai $ee_install_log - ee_lib_echo "Installing EasyEngine $ee_branch" | tee -ai $ee_install_log - ee_install | tee -ai $ee_install_log - ee_lib_echo "Running post-install steps" | tee -ai $ee_install_log - secure_ee_db | tee -ai $EE_INSTALL_LOG - ee_git_init | tee -ai $ee_install_log - -else - ee -v 2>&1 | grep $ee_version_new &>> /dev/null - if [[ $? -ne 0 ]];then - read -p "Update EasyEngine to $ee_version_new (y/n): " ee_ans - if [ "$ee_ans" = "y" ] || [ "$ee_ans" = "Y" ]; then - ee_install_dep | tee -ai $ee_install_log - ee_sync_db 2&>>1 $EE_INSTALL_LOG - secure_ee_db | tee -ai $EE_INSTALL_LOG - ee_upgrade_php | tee -ai $ee_install_log - ee_install | tee -ai $ee_install_log - ee_update_latest | tee -ai $ee_install_log - ee_git_init | tee -ai $ee_install_log - service nginx reload &>> /dev/null - if [ "$ee_distro_version" == "trusty" ]; then - service php5.6-fpm restart &>> /dev/null - else - service php5-fpm restart &>> /dev/null - fi - ee_update_wp_cli | tee -ai $ee_install_log - else - ee_lib_error "Not updating EasyEngine to $ee_version_new, exit status = " 1 - fi - else - ee_lib_error "You already have EasyEngine $ee_version_new, exit status = " 1 - fi -fi -ee sync | tee -ai $EE_INSTALL_LOG - -echo -ee_lib_echo "For EasyEngine (ee) auto completion, run the following command" -echo -ee_lib_echo_info "source /etc/bash_completion.d/ee_auto.rc" -echo -ee_lib_echo "EasyEngine (ee) installed/updated successfully" -ee_lib_echo "EasyEngine (ee) help: http://docs.rtcamp.com/easyengine/" diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 24fb22183..000000000 --- a/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -cement>=2.4.0 diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index a273d468b..000000000 --- a/setup.cfg +++ /dev/null @@ -1,9 +0,0 @@ -[nosetests] -verbosity=3 -debug=0 -detailed-errors=1 -with-coverage=1 -cover-package=ee -cover-erase=1 -cover-html=1 -cover-html-dir=coverage_report/ diff --git a/setup.py b/setup.py deleted file mode 100644 index bd088c13a..000000000 --- a/setup.py +++ /dev/null @@ -1,103 +0,0 @@ - -from setuptools import setup, find_packages -import sys -import os -import glob -import configparser -import re -import shutil - -conf = [] -templates = [] - -long_description = '''EasyEngine is the commandline tool to manage your - Websites based on WordPress and Nginx with easy to use - commands''' - -for name in glob.glob('config/plugins.d/*.conf'): - conf.insert(1, name) - -for name in glob.glob('ee/cli/templates/*.mustache'): - templates.insert(1, name) - -if not os.path.exists('/var/log/ee/'): - os.makedirs('/var/log/ee/') - -if not os.path.exists('/var/lib/ee/'): - os.makedirs('/var/lib/ee/') - -# EasyEngine git function -config = configparser.ConfigParser() -config.read(os.path.expanduser("~")+'/.gitconfig') -try: - ee_user = config['user']['name'] - ee_email = config['user']['email'] -except Exception as e: - print("EasyEngine (ee) required your name & email address to track" - " changes you made under the Git version control") - print("EasyEngine (ee) will be able to send you daily reports & alerts in " - "upcoming version") - print("EasyEngine (ee) will NEVER send your information across") - - ee_user = input("Enter your name: ") - while ee_user is "": - print("Name not Valid, Please enter again") - ee_user = input("Enter your name: ") - - ee_email = input("Enter your email: ") - - while not re.match(r"^[A-Za-z0-9\.\+_-]+@[A-Za-z0-9\._-]+\.[a-zA-Z]*$", - ee_email): - print("Invalid email address, please try again") - ee_email = input("Enter your email: ") - - os.system("git config --global user.name {0}".format(ee_user)) - os.system("git config --global user.email {0}".format(ee_email)) - -if not os.path.isfile('/root/.gitconfig'): - shutil.copy2(os.path.expanduser("~")+'/.gitconfig', '/root/.gitconfig') - -setup(name='ee', - version='3.8.1', - description=long_description, - long_description=long_description, - classifiers=[], - keywords='', - author='rtCamp Soultions Pvt. LTD', - author_email='ee@rtcamp.com', - url='http://rtcamp.com/easyengine', - license='MIT', - packages=find_packages(exclude=['ez_setup', 'examples', 'tests', - 'templates']), - include_package_data=True, - zip_safe=False, - test_suite='nose.collector', - install_requires=[ - # Required to build documentation - # "Sphinx >= 1.0", - # Required for testing - # "nose", - # "coverage", - # Required to function - 'cement == 2.4', - 'pystache', - 'python-apt', - 'pynginxconfig', - 'PyMySQL == 0.8.0', - 'psutil == 3.1.1', - 'sh', - 'SQLAlchemy', - ], - data_files=[('/etc/ee', ['config/ee.conf']), - ('/etc/ee/plugins.d', conf), - ('/usr/lib/ee/templates', templates), - ('/etc/bash_completion.d/', - ['config/bash_completion.d/ee_auto.rc']), - ('/usr/share/man/man8/', ['docs/ee.8'])], - setup_requires=[], - entry_points=""" - [console_scripts] - ee = ee.cli.main:main - """, - namespace_packages=[], - ) diff --git a/tests/__init__.py b/tests/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/cli/13_test_stack.py b/tests/cli/13_test_stack.py deleted file mode 100644 index a108e5948..000000000 --- a/tests/cli/13_test_stack.py +++ /dev/null @@ -1,76 +0,0 @@ -from ee.utils import test -from ee.cli.main import get_test_app - - -class CliTestCaseStack(test.EETestCase): - - def test_ee_cli(self): - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_install_web(self): - self.app = get_test_app(argv=['stack', 'install', '--web']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_install_admin(self): - self.app = get_test_app(argv=['stack', 'install', '--admin']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_install_mail(self): - self.app = get_test_app(argv=['stack', 'install', '--mail']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_install_nginx(self): - self.app = get_test_app(argv=['stack', 'install', '--nginx']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_install_php(self): - self.app = get_test_app(argv=['stack', 'install', '--php']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_install_mysql(self): - self.app = get_test_app(argv=['stack', 'install', '--mysql']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_install_postfix(self): - self.app = get_test_app(argv=['stack', 'install', '--postfix']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_install_wpcli(self): - self.app = get_test_app(argv=['stack', 'install', '--wpcli']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_install_phpmyadmin(self): - self.app = get_test_app(argv=['stack', 'install', '--phpmyadmin']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_install_adminer(self): - self.app = get_test_app(argv=['stack', 'install', '--adminer']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_install_utils(self): - self.app = get_test_app(argv=['stack', 'install', '--utils']) - self.app.setup() - self.app.run() - self.app.close() diff --git a/tests/cli/2_test_stack_services_start.py b/tests/cli/2_test_stack_services_start.py deleted file mode 100644 index de874afed..000000000 --- a/tests/cli/2_test_stack_services_start.py +++ /dev/null @@ -1,52 +0,0 @@ -from ee.utils import test -from ee.cli.main import get_test_app - - -class CliTestCaseStack(test.EETestCase): - - def test_ee_cli(self): - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_services_start_nginx(self): - self.app = get_test_app(argv=['stack', 'start', '--nginx']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_services_start_php5_fpm(self): - self.app = get_test_app(argv=['stack', 'start', '--php']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_services_start_mysql(self): - self.app = get_test_app(argv=['stack', 'start', '--mysql']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_services_start_postfix(self): - self.app = get_test_app(argv=['stack', 'start', '--postfix']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_services_start_memcached(self): - self.app = get_test_app(argv=['stack', 'start', '--memcache']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_services_start_dovecot(self): - self.app = get_test_app(argv=['stack', 'start', '--dovecot']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_services_start_all(self): - self.app = get_test_app(argv=['stack', 'start']) - self.app.setup() - self.app.run() - self.app.close() diff --git a/tests/cli/3_test_stack_services_status.py b/tests/cli/3_test_stack_services_status.py deleted file mode 100644 index 42bd65a8b..000000000 --- a/tests/cli/3_test_stack_services_status.py +++ /dev/null @@ -1,52 +0,0 @@ -from ee.utils import test -from ee.cli.main import get_test_app - - -class CliTestCaseStack(test.EETestCase): - - def test_ee_cli(self): - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_services_status_nginx(self): - self.app = get_test_app(argv=['stack', 'status', '--nginx']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_services_status_php5_fpm(self): - self.app = get_test_app(argv=['stack', 'status', '--php']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_services_status_mysql(self): - self.app = get_test_app(argv=['stack', 'status', '--mysql']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_services_status_postfix(self): - self.app = get_test_app(argv=['stack', 'status', '--postfix']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_services_status_memcached(self): - self.app = get_test_app(argv=['stack', 'status', '--memcache']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_services_status_dovecot(self): - self.app = get_test_app(argv=['stack', 'status', '--dovecot']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_services_status_all(self): - self.app = get_test_app(argv=['stack', 'status']) - self.app.setup() - self.app.run() - self.app.close() diff --git a/tests/cli/4_test_stack_services_stop.py b/tests/cli/4_test_stack_services_stop.py deleted file mode 100644 index 9b6ece4bb..000000000 --- a/tests/cli/4_test_stack_services_stop.py +++ /dev/null @@ -1,52 +0,0 @@ -from ee.utils import test -from ee.cli.main import get_test_app - - -class CliTestCaseStack(test.EETestCase): - - def test_ee_cli(self): - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_services_stop_nginx(self): - self.app = get_test_app(argv=['stack', 'stop', '--nginx']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_services_stop_php5_fpm(self): - self.app = get_test_app(argv=['stack', 'stop', '--php']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_services_stop_mysql(self): - self.app = get_test_app(argv=['stack', 'stop', '--mysql']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_services_stop_postfix(self): - self.app = get_test_app(argv=['stack', 'stop', '--postfix']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_services_stop_memcached(self): - self.app = get_test_app(argv=['stack', 'stop', '--memcache']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_services_stop_dovecot(self): - self.app = get_test_app(argv=['stack', 'stop', '--dovecot']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_services_stop_all(self): - self.app = get_test_app(argv=['stack', 'stop']) - self.app.setup() - self.app.run() - self.app.close() diff --git a/tests/cli/5_test_stack_services_restart.py b/tests/cli/5_test_stack_services_restart.py deleted file mode 100644 index 39d8825ca..000000000 --- a/tests/cli/5_test_stack_services_restart.py +++ /dev/null @@ -1,52 +0,0 @@ -from ee.utils import test -from ee.cli.main import get_test_app - - -class CliTestCaseStack(test.EETestCase): - - def test_ee_cli(self): - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_services_restart_nginx(self): - self.app = get_test_app(argv=['stack', 'restart', '--nginx']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_services_restart_php5_fpm(self): - self.app = get_test_app(argv=['stack', 'restart', '--php']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_services_restart_mysql(self): - self.app = get_test_app(argv=['stack', 'restart', '--mysql']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_services_restart_postfix(self): - self.app = get_test_app(argv=['stack', 'restart', '--postfix']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_services_restart_memcached(self): - self.app = get_test_app(argv=['stack', 'restart', '--memcache']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_services_restart_dovecot(self): - self.app = get_test_app(argv=['stack', 'restart', '--dovecot']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_services_restart_all(self): - self.app = get_test_app(argv=['stack', 'restart']) - self.app.setup() - self.app.run() - self.app.close() diff --git a/tests/cli/8_test_site_create.py b/tests/cli/8_test_site_create.py deleted file mode 100644 index 3b3a25546..000000000 --- a/tests/cli/8_test_site_create.py +++ /dev/null @@ -1,73 +0,0 @@ -from ee.utils import test -from ee.cli.main import get_test_app - - -class CliTestCaseSite(test.EETestCase): - - def test_ee_cli(self): - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_site_create_html(self): - self.app = get_test_app(argv=['site', 'create', 'example1.com', - '--html']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_site_create_php(self): - self.app = get_test_app(argv=['site', 'create', 'example2.com', - '--php']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_site_create_mysql(self): - self.app = get_test_app(argv=['site', 'create', 'example3.com', - '--mysql']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_site_create_wp(self): - self.app = get_test_app(argv=['site', 'create', 'example4.com', - '--wp']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_site_create_wpsubdir(self): - self.app = get_test_app(argv=['site', 'create', 'example5.com', - '--wpsubdir']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_site_create_wpsubdomain(self): - self.app = get_test_app(argv=['site', 'create', 'example6.com', - '--wpsubdomain']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_site_create_w3tc(self): - self.app = get_test_app(argv=['site', 'create', 'example7.com', - '--w3tc']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_site_create_wpfc(self): - self.app = get_test_app(argv=['site', 'create', 'example8.com', - '--wpfc']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_site_create_wpsc(self): - self.app = get_test_app(argv=['site', 'create', 'example9.com', - '--wpsc']) - self.app.setup() - self.app.run() - self.app.close() diff --git a/tests/cli/91_test_site_info.py b/tests/cli/91_test_site_info.py deleted file mode 100644 index 1ecc20620..000000000 --- a/tests/cli/91_test_site_info.py +++ /dev/null @@ -1,16 +0,0 @@ -from ee.utils import test -from ee.cli.main import get_test_app - - -class CliTestCaseSite(test.EETestCase): - - def test_ee_cli(self): - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_site_info(self): - self.app = get_test_app(argv=['site', 'info', 'example1.com']) - self.app.setup() - self.app.run() - self.app.close() diff --git a/tests/cli/93_test_site_list.py b/tests/cli/93_test_site_list.py deleted file mode 100644 index 477e6915c..000000000 --- a/tests/cli/93_test_site_list.py +++ /dev/null @@ -1,22 +0,0 @@ -from ee.utils import test -from ee.cli.main import get_test_app - - -class CliTestCaseSite(test.EETestCase): - - def test_ee_cli(self): - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_site_list_enable(self): - self.app = get_test_app(argv=['site', 'list', '--enabled']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_site_list_disable(self): - self.app = get_test_app(argv=['site', 'list', '--disabled']) - self.app.setup() - self.app.run() - self.app.close() diff --git a/tests/cli/95_test_site_show.py b/tests/cli/95_test_site_show.py deleted file mode 100644 index 606578a66..000000000 --- a/tests/cli/95_test_site_show.py +++ /dev/null @@ -1,16 +0,0 @@ -from ee.utils import test -from ee.cli.main import get_test_app - - -class CliTestCaseSite(test.EETestCase): - - def test_ee_cli(self): - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_show_edit(self): - self.app = get_test_app(argv=['site', 'show', 'example1.com']) - self.app.setup() - self.app.run() - self.app.close() diff --git a/tests/cli/97_test_site_update.py b/tests/cli/97_test_site_update.py deleted file mode 100644 index 38b0c0abf..000000000 --- a/tests/cli/97_test_site_update.py +++ /dev/null @@ -1,73 +0,0 @@ -from ee.utils import test -from ee.cli.main import get_test_app - - -class CliTestCaseSite(test.EETestCase): - - def test_ee_cli(self): - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_site_update_html(self): - self.app = get_test_app(argv=['site', 'update', 'example2.com', - '--html']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_site_update_php(self): - self.app = get_test_app(argv=['site', 'update', 'example1.com', - '--php']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_site_update_mysql(self): - self.app = get_test_app(argv=['site', 'update', 'example1.com', - '--html']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_site_update_wp(self): - self.app = get_test_app(argv=['site', 'update', 'example5.com', - '--wp']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_site_update_wpsubdir(self): - self.app = get_test_app(argv=['site', 'update', 'example4.com', - '--wpsubdir']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_site_update_wpsubdomain(self): - self.app = get_test_app(argv=['site', 'update', 'example7.com', - '--wpsubdomain']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_site_update_w3tc(self): - self.app = get_test_app(argv=['site', 'update', 'example8.com', - '--w3tc']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_site_update_wpfc(self): - self.app = get_test_app(argv=['site', 'update', 'example9.com', - '--wpfc']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_site_update_wpsc(self): - self.app = get_test_app(argv=['site', 'update', 'example6.com', - '--wpsc']) - self.app.setup() - self.app.run() - self.app.close() diff --git a/tests/cli/9_test_site_enable.py b/tests/cli/9_test_site_enable.py deleted file mode 100644 index 87cc4f856..000000000 --- a/tests/cli/9_test_site_enable.py +++ /dev/null @@ -1,16 +0,0 @@ -from ee.utils import test -from ee.cli.main import get_test_app - - -class CliTestCaseSite(test.EETestCase): - - def test_ee_cli(self): - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_site_enable(self): - self.app = get_test_app(argv=['site', 'enable', 'example2.com']) - self.app.setup() - self.app.run() - self.app.close() diff --git a/tests/cli/__init__.py b/tests/cli/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/cli/a_test_site_disable.py b/tests/cli/a_test_site_disable.py deleted file mode 100644 index 3d948f770..000000000 --- a/tests/cli/a_test_site_disable.py +++ /dev/null @@ -1,16 +0,0 @@ -from ee.utils import test -from ee.cli.main import get_test_app - - -class CliTestCaseSite(test.EETestCase): - - def test_ee_cli(self): - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_site_disable(self): - self.app = get_test_app(argv=['site', 'disable', 'example2.com']) - self.app.setup() - self.app.run() - self.app.close() diff --git a/tests/cli/ext/__init__.py b/tests/cli/ext/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/cli/plugins/__init__.py b/tests/cli/plugins/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/cli/plugins/test_example.py b/tests/cli/plugins/test_example.py deleted file mode 100644 index 860a5485e..000000000 --- a/tests/cli/plugins/test_example.py +++ /dev/null @@ -1,8 +0,0 @@ -"""Tests for Example Plugin.""" - -from ee.utils import test - -class ExamplePluginTestCase(test.EETestCase): - def test_load_example_plugin(self): - self.app.setup() - self.app.plugin.load_plugin('example') diff --git a/tests/cli/test_clean.py b/tests/cli/test_clean.py deleted file mode 100644 index 39254bffc..000000000 --- a/tests/cli/test_clean.py +++ /dev/null @@ -1,40 +0,0 @@ -from ee.utils import test -from ee.cli.main import get_test_app - - -class CliTestCaseClean(test.EETestCase): - - def test_ee_cli(self): - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_clean(self): - self.app = get_test_app(argv=['clean']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_clean_fastcgi(self): - self.app = get_test_app(argv=['clean', '--fastcgi']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_clean_all(self): - self.app = get_test_app(argv=['clean', '--all']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_clean_memcache(self): - self.app = get_test_app(argv=['clean', '--memcache']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_clean_opcache(self): - self.app = get_test_app(argv=['clean', '--opcache']) - self.app.setup() - self.app.run() - self.app.close() diff --git a/tests/cli/test_debug.py b/tests/cli/test_debug.py deleted file mode 100644 index ba071001c..000000000 --- a/tests/cli/test_debug.py +++ /dev/null @@ -1,95 +0,0 @@ -from ee.utils import test -from ee.cli.main import get_test_app - - -class CliTestCaseDebug(test.EETestCase): - - def test_ee_cli(self): - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_debug_stop(self): - self.app = get_test_app(argv=['debug', '--stop']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_debug_start(self): - self.app = get_test_app(argv=['debug', '--start']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_debug_php(self): - self.app = get_test_app(argv=['debug', '--php']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_debug_nginx(self): - self.app = get_test_app(argv=['debug', '--nginx']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_debug_rewrite(self): - self.app = get_test_app(argv=['debug', '--rewrite']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_debug_fpm(self): - self.app = get_test_app(argv=['debug', '--fpm']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_debug_mysql(self): - self.app = get_test_app(argv=['debug', '--mysql']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_debug_import_slow_log_interval(self): - self.app = get_test_app(argv=['debug', '--mysql', - '--import-slow-log-interval']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_debug_site_name_mysql(self): - self.app = get_test_app(argv=['debug', 'example3.com', '--mysql']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_debug_site_name_wp(self): - self.app = get_test_app(argv=['debug', 'example4.com', '--wp']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_debug_site_name_nginx(self): - self.app = get_test_app(argv=['debug', 'example4.com', '--nginx']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_debug_site_name_start(self): - self.app = get_test_app(argv=['debug', 'example1.com', '--start']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_debug_site_name_stop(self): - self.app = get_test_app(argv=['debug', 'example1.com', '--stop']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_debug_site_name_rewrite(self): - self.app = get_test_app(argv=['debug', 'example1.com', '--rewrite']) - self.app.setup() - self.app.run() - self.app.close() diff --git a/tests/cli/test_info.py b/tests/cli/test_info.py deleted file mode 100644 index 0c36edb48..000000000 --- a/tests/cli/test_info.py +++ /dev/null @@ -1,28 +0,0 @@ -from ee.utils import test -from ee.cli.main import get_test_app - - -class CliTestCaseInfo(test.EETestCase): - - def test_ee_cli(self): - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_info_mysql(self): - self.app = get_test_app(argv=['info', '--mysql']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_info_php(self): - self.app = get_test_app(argv=['info', '--php']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_info_nginx(self): - self.app = get_test_app(argv=['info', '--nginx']) - self.app.setup() - self.app.run() - self.app.close() diff --git a/tests/cli/test_secure.py b/tests/cli/test_secure.py deleted file mode 100644 index d867a2e8e..000000000 --- a/tests/cli/test_secure.py +++ /dev/null @@ -1,28 +0,0 @@ -from ee.utils import test -from ee.cli.main import get_test_app - - -class CliTestCaseSecure(test.EETestCase): - - def test_ee_cli(self): - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_secure_auth(self): - self.app = get_test_app(argv=['secure', '--auth']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_secure_port(self): - self.app = get_test_app(argv=['secure', '--port']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_secure_ip(self): - self.app = get_test_app(argv=['secure', '--ip']) - self.app.setup() - self.app.run() - self.app.close() diff --git a/tests/cli/test_site_delete.py b/tests/cli/test_site_delete.py deleted file mode 100644 index b9f204ead..000000000 --- a/tests/cli/test_site_delete.py +++ /dev/null @@ -1,38 +0,0 @@ -from ee.utils import test -from ee.cli.main import get_test_app - - -class CliTestCaseSite(test.EETestCase): - - def test_ee_cli(self): - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_site_detele(self): - self.app = get_test_app(argv=['site', 'delete', 'example1.com', - '--no-prompt']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_site_detele_all(self): - self.app = get_test_app(argv=['site', 'delete', 'example2.com', - '--all', '--no-prompt']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_site_detele_db(self): - self.app = get_test_app(argv=['site', 'delete', 'example3.com', - '--db', '--no-prompt']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_site_detele_files(self): - self.app = get_test_app(argv=['site', 'delete', 'example4.com', - '--files', '--no-prompt']) - self.app.setup() - self.app.run() - self.app.close() diff --git a/tests/cli/test_stack_purge.py b/tests/cli/test_stack_purge.py deleted file mode 100644 index 433b23d4b..000000000 --- a/tests/cli/test_stack_purge.py +++ /dev/null @@ -1,76 +0,0 @@ -from ee.utils import test -from ee.cli.main import get_test_app - - -class CliTestCaseStack(test.EETestCase): - - def test_ee_cli(self): - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_purge_web(self): - self.app = get_test_app(argv=['stack', 'purge', '--web']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_purge_admin(self): - self.app = get_test_app(argv=['stack', 'purge', '--admin']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_purge_mail(self): - self.app = get_test_app(argv=['stack', 'purge', '--mail']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_purge_nginx(self): - self.app = get_test_app(argv=['stack', 'purge', '--nginx']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_purge_php(self): - self.app = get_test_app(argv=['stack', 'purge', '--php']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_purge_mysql(self): - self.app = get_test_app(argv=['stack', 'purge', '--mysql']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_purge_postfix(self): - self.app = get_test_app(argv=['stack', 'purge', '--postfix']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_purge_wpcli(self): - self.app = get_test_app(argv=['stack', 'purge', '--wpcli']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_purge_phpmyadmin(self): - self.app = get_test_app(argv=['stack', 'purge', '--phpmyadmin']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_purge_adminer(self): - self.app = get_test_app(argv=['stack', 'purge', '--adminer']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_purge_utils(self): - self.app = get_test_app(argv=['stack', 'purge', '--utils']) - self.app.setup() - self.app.run() - self.app.close() diff --git a/tests/cli/test_stack_remove.py b/tests/cli/test_stack_remove.py deleted file mode 100644 index 543383736..000000000 --- a/tests/cli/test_stack_remove.py +++ /dev/null @@ -1,76 +0,0 @@ -from ee.utils import test -from ee.cli.main import get_test_app - - -class CliTestCaseStack(test.EETestCase): - - def test_ee_cli(self): - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_remove_web(self): - self.app = get_test_app(argv=['stack', 'remove', '--web']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_install_admin(self): - self.app = get_test_app(argv=['stack', 'remove', '--admin']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_install_mail(self): - self.app = get_test_app(argv=['stack', 'remove', '--mail']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_install_nginx(self): - self.app = get_test_app(argv=['stack', 'remove', '--nginx']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_install_php(self): - self.app = get_test_app(argv=['stack', 'remove', '--php']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_install_mysql(self): - self.app = get_test_app(argv=['stack', 'remove', '--mysql']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_install_postfix(self): - self.app = get_test_app(argv=['stack', 'remove', '--postfix']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_install_wpcli(self): - self.app = get_test_app(argv=['stack', 'remove', '--wpcli']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_install_phpmyadmin(self): - self.app = get_test_app(argv=['stack', 'remove', '--phpmyadmin']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_install_adminer(self): - self.app = get_test_app(argv=['stack', 'remove', '--adminer']) - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_stack_install_utils(self): - self.app = get_test_app(argv=['stack', 'remove', '--utils']) - self.app.setup() - self.app.run() - self.app.close() diff --git a/tests/core/__init__.py b/tests/core/__init__.py deleted file mode 100644 index e69de29bb..000000000 From 1c16997a71e82abd3c0fa0c130d6af491ce02179 Mon Sep 17 00:00:00 2001 From: Rahul Prajapati <rahul.prajapati@live.in> Date: Thu, 22 Nov 2018 02:19:54 +0530 Subject: [PATCH 0596/1044] Bump version to 4.0.0 :tada: :rocket: --- .travis.yml | 10 +++++----- VERSION | 2 +- ci/deploy.sh | 6 +++--- composer.json | 6 +++--- composer.lock | 39 ++++++++++++++------------------------- 5 files changed, 26 insertions(+), 37 deletions(-) diff --git a/.travis.yml b/.travis.yml index c77225114..2d6e97b01 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,14 +18,14 @@ before_install: fi - | # Update commands in composer.json to develop if branch is not master. - if [[ "$TRAVIS_BRANCH" != "master-v4" ]]; then + if [[ "$TRAVIS_BRANCH" != "master" ]]; then sed -i 's/\(easyengine\/.*\):\ \".*\"/\1:\ \"dev-develop\"/' composer.json fi install: - | # Run composer install for master else update. - if [[ "$TRAVIS_BRANCH" = "master-v4" ]]; then + if [[ "$TRAVIS_BRANCH" = "master" ]]; then composer install --no-interaction else composer update @@ -47,7 +47,7 @@ after_script: jobs: include: - stage: deploy - env: DEPLOY_BRANCH=master-v4 + env: DEPLOY_BRANCH=master after_success: ./ci/deploy.sh cache: @@ -56,8 +56,8 @@ cache: branches: only: - - develop-v4 - - master-v4 + - develop + - master notifications: email: diff --git a/VERSION b/VERSION index cd46fc977..fcdb2e109 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.0.0-rc.2 +4.0.0 diff --git a/ci/deploy.sh b/ci/deploy.sh index f06643034..9e7c2af9d 100755 --- a/ci/deploy.sh +++ b/ci/deploy.sh @@ -12,7 +12,7 @@ if [ -z $DEPLOY_BRANCH ]; then exit fi -if [[ "$TRAVIS_BRANCH" != "$DEPLOY_BRANCH" ]] && [[ ! "$TRAVIS_BRANCH" == "develop-v4" ]]; then +if [[ "$TRAVIS_BRANCH" != "$DEPLOY_BRANCH" ]] && [[ ! "$TRAVIS_BRANCH" == "develop" ]]; then echo "Skipping deployment as '$TRAVIS_BRANCH' is not a deploy branch." exit fi @@ -36,7 +36,7 @@ git config user.name "Travis CI" git config user.email "travis@travis-ci.org" git config push.default "current" -if [[ "$TRAVIS_BRANCH" == "develop-v4" ]]; then +if [[ "$TRAVIS_BRANCH" == "develop" ]]; then fname="phar/easyengine-nightly.phar" else fname="phar/easyengine.phar" @@ -52,4 +52,4 @@ sha512sum $fname | cut -d ' ' -f 1 > $fname.sha512 git add . git commit -m "phar build: $TRAVIS_REPO_SLUG@$TRAVIS_COMMIT" -git push \ No newline at end of file +git push diff --git a/composer.json b/composer.json index 6c405720c..174087201 100644 --- a/composer.json +++ b/composer.json @@ -29,14 +29,14 @@ "composer/semver": "~1.0", "easyengine/admin-tools-command": "v1.0.0", "easyengine/auth-command": "v1.0.0", - "easyengine/config-command": "v1.0.0-rc.1", - "easyengine/cron-command": "v1.0.0-rc.2", + "easyengine/config-command": "v1.0.0", + "easyengine/cron-command": "v1.0.0", "easyengine/mailhog-command": "v1.0.0", "easyengine/site-command": "v2.2.2", "easyengine/site-type-wp": "v1.0.0", "easyengine/site-type-php": "v1.0.0", "easyengine/service-command": "v1.0.0", - "easyengine/shell-command" : "v1.0.0-rc.1", + "easyengine/shell-command" : "v1.0.0", "justinrainbow/json-schema": "~5.2.5", "monolog/monolog": "^1.23", "mustache/mustache": "~2.4", diff --git a/composer.lock b/composer.lock index 6fa48ff3e..9bcd44b65 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": "db5360d5481a14c4735e65361adb0e64", + "content-hash": "8485fde92407e0e273c9d97a0cab5248", "packages": [ { "name": "acmephp/core", @@ -528,7 +528,7 @@ }, { "name": "easyengine/config-command", - "version": "v1.0.0-rc.1", + "version": "v1.0.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/config-command.git", @@ -568,7 +568,7 @@ }, { "name": "easyengine/cron-command", - "version": "v1.0.0-rc.2", + "version": "v1.0.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/cron-command.git", @@ -660,12 +660,12 @@ "source": { "type": "git", "url": "https://github.com/EasyEngine/service-command.git", - "reference": "547de8e72d1e2ff8cae1746c3f56f8d362042b79" + "reference": "f24d29b33935341501de8912fd4f57b550af0aa2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/547de8e72d1e2ff8cae1746c3f56f8d362042b79", - "reference": "547de8e72d1e2ff8cae1746c3f56f8d362042b79", + "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/f24d29b33935341501de8912fd4f57b550af0aa2", + "reference": "f24d29b33935341501de8912fd4f57b550af0aa2", "shasum": "" }, "type": "ee-cli-package", @@ -697,11 +697,11 @@ ], "description": "Command to manager global containers/services in EasyEngine", "homepage": "https://github.com/easyengine/service-command", - "time": "2018-11-20T12:41:28+00:00" + "time": "2018-11-21T20:12:21+00:00" }, { "name": "easyengine/shell-command", - "version": "v1.0.0-rc.1", + "version": "v1.0.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/shell-command.git", @@ -745,12 +745,12 @@ "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "49222c5fc19f96be5beec5833b9d720163b16e28" + "reference": "2a116036821a347fa460d8267fcf705fa19b751b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/49222c5fc19f96be5beec5833b9d720163b16e28", - "reference": "49222c5fc19f96be5beec5833b9d720163b16e28", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/2a116036821a347fa460d8267fcf705fa19b751b", + "reference": "2a116036821a347fa460d8267fcf705fa19b751b", "shasum": "" }, "require": { @@ -796,7 +796,7 @@ "MIT" ], "homepage": "https://github.com/easyengine/site-command", - "time": "2018-11-20T13:08:35+00:00" + "time": "2018-11-21T21:50:58+00:00" }, { "name": "easyengine/site-type-php", @@ -836,7 +836,7 @@ ], "description": "EasyEngine package for PHP site creation.", "homepage": "https://github.com/easyengine/site-type-php", - "time": "2018-11-20T12:58:39+00:00" + "time": "2018-11-21T15:23:51+00:00" }, { "name": "easyengine/site-type-wp", @@ -888,7 +888,7 @@ ], "description": "EasyEngine site type package for WordPress site creation.", "homepage": "https://github.com/easyengine/site-type-wp", - "time": "2018-11-20T12:58:28+00:00" + "time": "2018-11-21T15:25:08+00:00" }, { "name": "guzzlehttp/guzzle", @@ -3280,17 +3280,6 @@ { "name": "roave/security-advisories", "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "d71acf1340f7fb24b3469a892c130263c08e0a43" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/d71acf1340f7fb24b3469a892c130263c08e0a43", - "reference": "d71acf1340f7fb24b3469a892c130263c08e0a43", - "shasum": "" - }, "conflict": { "3f/pygmentize": "<1.2", "adodb/adodb-php": "<5.20.12", From 00223229c6347d187e8368230b022244d59ba2be Mon Sep 17 00:00:00 2001 From: Rahul Bansal <rahul.bansal@rtcamp.com> Date: Thu, 22 Nov 2018 10:59:59 +0530 Subject: [PATCH 0597/1044] Removed BitPay Donate link Our BitPay account is running into compliance --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index fa2981b85..7aa9e8d4d 100644 --- a/README.md +++ b/README.md @@ -107,4 +107,3 @@ We warmheartedly welcome all contributions however and in whatever capacity you ## Donations [![PayPal-Donate](https://cloud.githubusercontent.com/assets/4115/5297691/c7b50292-7bd7-11e4-987b-2dc21069e756.png)](http://rt.cx/eedonate) -[![BitCoin-Donate](https://bitpay.com/img/donate-button.svg)](https://bitpay.com/417008/donate) From ce7e73d97abb7e067530173d34a31744def79a18 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Fri, 23 Nov 2018 17:12:44 +0530 Subject: [PATCH 0598/1044] Correct download URL and add license badge --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7aa9e8d4d..8de7874da 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ <img width="150" height="150" src="https://easyengine.io/wp-content/uploads/2015/11/cropped-favicon-easyengine.png" alt="EasyEngine Logo" align="right" /> [![Build Status](https://travis-ci.org/EasyEngine/easyengine.svg?branch=master-v4)](https://travis-ci.org/EasyEngine/easyengine) +[![License](https://poser.pugx.org/phpunit/phpunit/license)](https://packagist.org/packages/phpunit/phpunit) [![Join EasyEngine Slack Channel](http://slack.easyengine.io/badge.svg)](http://slack.easyengine.io/) ## Requirements @@ -19,7 +20,7 @@ For Linux, we have created an installer script which will install all the dependencies for you. We have tested this on Ubuntu 14.04, 16.04, 18.04 and Debian 8. ```bash -wget -qO ee https://rt.cx/ee4beta && sudo bash ee +wget -qO ee https://rt.cx/ee4 && sudo bash ee ``` Even if the script doesn't work for your distribution, you can manually install the dependencies and then run the following commands to install EasyEngine From 91f841a3cb9f6be7bbb933596177f5ecbec0b609 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Fri, 23 Nov 2018 18:29:03 +0530 Subject: [PATCH 0599/1044] Update checks in running commands Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Runner.php | 54 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 37 insertions(+), 17 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index c7227ae16..74eae8b57 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -64,27 +64,47 @@ private function init_ee() { if ( ! empty( $this->arguments ) && - ( 'help' !== $this->arguments[0] ) - && $this->arguments !== [ 'cli', 'version' ] - ) - { + ( ! in_array( $this->arguments[0], [ 'cli', 'config', 'help' ], true ) ) + ) { + $this->check_requirements(); + $this->maybe_trigger_migration(); + } + if ( [ 'cli', 'info' ] === $this->arguments && $this->check_requirements( false ) ) { + $this->maybe_trigger_migration(); + } + } - // Minimum requirement checks. - $docker_running = 'docker ps > /dev/null'; - if ( ! EE::exec( $docker_running ) ) { - EE::error( 'docker not installed or not running.' ); - } + /** + * Check EE requirements for required commands. + * + * @param bool $show_error To display error or to retutn status. + */ + public function check_requirements( $show_error = true ) { - $docker_compose_installed = 'command -v docker-compose > /dev/null'; - if ( ! EE::exec( $docker_compose_installed ) ) { - EE::error( 'EasyEngine requires docker-compose.' ); - } + $status = true; - if ( version_compare( PHP_VERSION, '7.2.0' ) < 0 ) { - EE::error( 'EasyEngine requires minimum PHP 7.2.0 to run.' ); - } + // Minimum requirement checks. + $docker_running = 'docker ps > /dev/null'; + if ( ! EE::exec( $docker_running ) ) { + $status = false; + $error = 'Docker not installed or not running.'; + } - $this->maybe_trigger_migration(); + $docker_compose_installed = 'command -v docker-compose > /dev/null'; + if ( ! EE::exec( $docker_compose_installed ) ) { + $status = false; + $error = 'EasyEngine requires docker-compose.'; + } + + if ( version_compare( PHP_VERSION, '7.2.0' ) < 0 ) { + $status = false; + $error = 'EasyEngine requires minimum PHP 7.2.0 to run.'; + } + + if ( ! $show_error ) { + return $status; + } elseif ( ! $status ) { + EE::error( $error ); } } From 30601354a67f5150cef8d0c48444277e4daecc66 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Fri, 23 Nov 2018 18:29:21 +0530 Subject: [PATCH 0600/1044] Run checks before replacing phar Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/commands/src/CLI_Command.php | 1 + 1 file changed, 1 insertion(+) diff --git a/php/commands/src/CLI_Command.php b/php/commands/src/CLI_Command.php index c1bafea71..2929aae21 100644 --- a/php/commands/src/CLI_Command.php +++ b/php/commands/src/CLI_Command.php @@ -286,6 +286,7 @@ public function update( $_, $assoc_args ) { $download_url = $newest['package_url']; $md5_url = str_replace( '.phar', '.phar.md5', $download_url ); } + EE::get_runner()->check_requirements(); EE::log( sprintf( 'Downloading from %s...', $download_url ) ); $temp = \EE\Utils\get_temp_dir() . uniqid( 'ee_', true ) . '.phar'; $headers = array(); From 37dd137768eee30be5f7381afe315cbe99bf0b8c Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Fri, 23 Nov 2018 19:00:29 +0530 Subject: [PATCH 0601/1044] Update ci prepration of phar Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- ci/prepare.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ci/prepare.sh b/ci/prepare.sh index 7ae98d55f..5f2a38056 100755 --- a/ci/prepare.sh +++ b/ci/prepare.sh @@ -10,4 +10,7 @@ if [[ "$TRAVIS_BRANCH" != $DEPLOY_BRANCH ]]; then sed -i 's/\:\ \"\(.*\)\"/\:\ \"\1-nightly\"/g' img-versions.json fi -php -dphar.readonly=0 ./utils/make-phar.php easyengine.phar --quiet \ No newline at end of file +php -dphar.readonly=0 ./utils/make-phar.php easyengine.phar --quiet + +# Checking the phar is working. +./easyengine.phar cli info \ No newline at end of file From e3cf4146b9f45ea238a9d5e409511e282122d857 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Fri, 23 Nov 2018 19:22:27 +0530 Subject: [PATCH 0602/1044] Update returning status Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Runner.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 74eae8b57..8d919aa20 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -101,11 +101,11 @@ public function check_requirements( $show_error = true ) { $error = 'EasyEngine requires minimum PHP 7.2.0 to run.'; } - if ( ! $show_error ) { - return $status; - } elseif ( ! $status ) { + if ( $show_error && ! $status ) { EE::error( $error ); } + + return $status; } /** From 972393ade3261c241ba05f05564b9852cb583321 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Fri, 23 Nov 2018 19:31:54 +0530 Subject: [PATCH 0603/1044] Update self-uninstall dependency check Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/commands/src/CLI_Command.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/php/commands/src/CLI_Command.php b/php/commands/src/CLI_Command.php index 2929aae21..a80198165 100644 --- a/php/commands/src/CLI_Command.php +++ b/php/commands/src/CLI_Command.php @@ -494,6 +494,11 @@ public function cmd_dump() { */ public function self_uninstall( $args, $assoc_args ) { + if ( ! EE::get_runner()->check_requirements( false ) ) { + EE::error( 'Unable to proceed with uninstallation. Seems there is a dependency down.', false ); + die; + } + EE::confirm( "Are you sure you want to remove EasyEngine and all its sites(along with their data)?\nThis is an irreversible action. No backup will be kept.", $assoc_args ); EE::exec( 'docker rm -f $(docker ps -aqf label=org.label-schema.vendor="EasyEngine")' ); From 73488a81f323425595133ea0de6356cb52abebf1 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Fri, 23 Nov 2018 19:49:28 +0530 Subject: [PATCH 0604/1044] Update to show first message Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Runner.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 8d919aa20..99a2549b8 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -82,27 +82,27 @@ private function init_ee() { public function check_requirements( $show_error = true ) { $status = true; + $error = []; - // Minimum requirement checks. $docker_running = 'docker ps > /dev/null'; if ( ! EE::exec( $docker_running ) ) { - $status = false; - $error = 'Docker not installed or not running.'; + $status = false; + $error[] = 'Docker not installed or not running.'; } $docker_compose_installed = 'command -v docker-compose > /dev/null'; if ( ! EE::exec( $docker_compose_installed ) ) { - $status = false; - $error = 'EasyEngine requires docker-compose.'; + $status = false; + $error[] = 'EasyEngine requires docker-compose.'; } if ( version_compare( PHP_VERSION, '7.2.0' ) < 0 ) { - $status = false; - $error = 'EasyEngine requires minimum PHP 7.2.0 to run.'; + $status = false; + $error[] = 'EasyEngine requires minimum PHP 7.2.0 to run.'; } if ( $show_error && ! $status ) { - EE::error( $error ); + EE::error( reset( $error ) ); } return $status; From 34e7e3ce4ff8862acc3dd605fd92478e5241273e Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Fri, 23 Nov 2018 20:31:49 +0530 Subject: [PATCH 0605/1044] Check prepare.sh Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- ci/prepare.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ci/prepare.sh b/ci/prepare.sh index 5f2a38056..a3fd49a41 100755 --- a/ci/prepare.sh +++ b/ci/prepare.sh @@ -13,4 +13,5 @@ fi php -dphar.readonly=0 ./utils/make-phar.php easyengine.phar --quiet # Checking the phar is working. -./easyengine.phar cli info \ No newline at end of file +sudo ./easyengine.phar cli info +docker ps -a \ No newline at end of file From 2276fe78aaad17fbfd5ea685191591853cbacdee Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Fri, 23 Nov 2018 20:44:10 +0530 Subject: [PATCH 0606/1044] Update checks and messages for macOS Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Runner.php | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 99a2549b8..fa0133b3a 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -81,28 +81,33 @@ private function init_ee() { */ public function check_requirements( $show_error = true ) { - $status = true; - $error = []; + $docker_running = true; + $status = true; + $error = []; - $docker_running = 'docker ps > /dev/null'; - if ( ! EE::exec( $docker_running ) ) { - $status = false; - $error[] = 'Docker not installed or not running.'; + $docker_running_cmd = 'docker ps > /dev/null'; + if ( ! EE::exec( $docker_running_cmd ) ) { + $status = false; + $docker_running = false; + $error[] = 'Docker not installed or not running.'; } $docker_compose_installed = 'command -v docker-compose > /dev/null'; if ( ! EE::exec( $docker_compose_installed ) ) { - $status = false; - $error[] = 'EasyEngine requires docker-compose.'; + $status = false; + $error[] = 'EasyEngine requires docker-compose.'; } if ( version_compare( PHP_VERSION, '7.2.0' ) < 0 ) { - $status = false; - $error[] = 'EasyEngine requires minimum PHP 7.2.0 to run.'; + $status = false; + $error[] = 'EasyEngine requires minimum PHP 7.2.0 to run.'; } if ( $show_error && ! $status ) { - EE::error( reset( $error ) ); + EE::error( reset( $error ), false ); + if ( IS_DARWIN && ! $docker_running ) { + EE::log( 'For macOS docker can be installed using: `brew cask install docker`' ); + } } return $status; From 94a1fd381516c60ec7258348bbfa985bdb0164dc Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Fri, 23 Nov 2018 20:48:59 +0530 Subject: [PATCH 0607/1044] Exit after showing error. Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Runner.php | 1 + 1 file changed, 1 insertion(+) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index fa0133b3a..3a83acfea 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -108,6 +108,7 @@ public function check_requirements( $show_error = true ) { if ( IS_DARWIN && ! $docker_running ) { EE::log( 'For macOS docker can be installed using: `brew cask install docker`' ); } + die; } return $status; From 9fa620ca1e21381ea2b1f3ec4abc7e5c74b15072 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Fri, 23 Nov 2018 20:54:05 +0530 Subject: [PATCH 0608/1044] Update self-uninstall Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/commands/src/CLI_Command.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/php/commands/src/CLI_Command.php b/php/commands/src/CLI_Command.php index a80198165..6ab58af42 100644 --- a/php/commands/src/CLI_Command.php +++ b/php/commands/src/CLI_Command.php @@ -502,18 +502,19 @@ public function self_uninstall( $args, $assoc_args ) { EE::confirm( "Are you sure you want to remove EasyEngine and all its sites(along with their data)?\nThis is an irreversible action. No backup will be kept.", $assoc_args ); EE::exec( 'docker rm -f $(docker ps -aqf label=org.label-schema.vendor="EasyEngine")' ); - $home = Utils\get_home_dir(); - EE::exec( "rm -rf $home/.ee/" ); + EE::exec( 'docker network prune -f $(docker network ls -f "label=org.label-schema.vendor=EasyEngine")' ); + EE::exec( 'docker volume rm -f $(docker volume ls -f "label=org.label-schema.vendor=EasyEngine" -q)' ); + EE::exec( 'docker image rm $(docker image ls -f "label=org.label-schema.vendor=EasyEngine" -q)' ); $records = Site::all( [ 'site_fs_path' ] ); + $fs = new Filesystem(); if ( ! empty( $records ) ) { $sites_paths = array_column( $records, 'site_fs_path' ); - $fs = new Filesystem(); $fs->remove( $sites_paths ); } - EE::exec( "rm -rf " . EE_ROOT_DIR ); + $fs->remove( EE_ROOT_DIR ); if ( Utils\inside_phar() ) { unlink( realpath( $_SERVER['argv'][0] ) ); From d3289d05c9df5c93868ed032d8249f853657e2ad Mon Sep 17 00:00:00 2001 From: Rahul Prajapati <rahul.prajapati@live.in> Date: Fri, 23 Nov 2018 21:18:22 +0530 Subject: [PATCH 0609/1044] Bump version to 4.0.1. Note: Maintenance Release for macOS Brew Package `brew install easyengine`. --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index fcdb2e109..1454f6ed4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.0.0 +4.0.1 From 5a13b72dde460ec84fd6e9886fa931d621c05f85 Mon Sep 17 00:00:00 2001 From: vishalkakadiya <vishalkakadiya123@gmail.com> Date: Tue, 27 Nov 2018 17:37:37 +0530 Subject: [PATCH 0610/1044] Remove global --prompt argument and respective code for same --- php/EE/Dispatcher/Subcommand.php | 153 ------------------------------- php/config-spec.php | 7 -- 2 files changed, 160 deletions(-) diff --git a/php/EE/Dispatcher/Subcommand.php b/php/EE/Dispatcher/Subcommand.php index 76e7b049e..520be2cb4 100644 --- a/php/EE/Dispatcher/Subcommand.php +++ b/php/EE/Dispatcher/Subcommand.php @@ -105,151 +105,6 @@ public function get_usage( $prefix ) { ); } - /** - * Wrapper for CLI Tools' prompt() method. - * - * @param string $question - * @param string $default - * @return string|false - */ - private function prompt( $question, $default ) { - - $question .= ': '; - if ( function_exists( 'readline' ) ) { - return readline( $question ); - } - - echo $question; - - $ret = stream_get_line( STDIN, 1024, "\n" ); - if ( Utils\is_windows() && "\r" === substr( $ret, -1 ) ) { - $ret = substr( $ret, 0, -1 ); - } - return $ret; - } - - /** - * Interactively prompt the user for input - * based on defined synopsis and passed arguments. - * - * @param array $args - * @param array $assoc_args - * @return array - */ - private function prompt_args( $args, $assoc_args ) { - - $synopsis = $this->get_synopsis(); - - if ( ! $synopsis ) { - return array( $args, $assoc_args ); - } - - $spec = array_filter( - \EE\SynopsisParser::parse( $synopsis ), - function( $spec_arg ) { - return in_array( $spec_arg['type'], array( 'generic', 'positional', 'assoc', 'flag' ) ); - } - ); - - $spec = array_values( $spec ); - - $prompt_args = EE::get_config( 'prompt' ); - if ( true !== $prompt_args ) { - $prompt_args = explode( ',', $prompt_args ); - } - - // 'positional' arguments are positional (aka zero-indexed) - // so $args needs to be reset before prompting for new arguments - $args = array(); - foreach ( $spec as $key => $spec_arg ) { - - // When prompting for specific arguments (e.g. --prompt=user_pass), - // ignore all arguments that don't match. - if ( is_array( $prompt_args ) ) { - if ( 'assoc' !== $spec_arg['type'] ) { - continue; - } - if ( ! in_array( $spec_arg['name'], $prompt_args, true ) ) { - continue; - } - } - - $current_prompt = ( $key + 1 ) . '/' . count( $spec ) . ' '; - $default = $spec_arg['optional'] ? '' : false; - - // 'generic' permits arbitrary key=value (e.g. [--<field>=<value>] ) - if ( 'generic' == $spec_arg['type'] ) { - - list( $key_token, $value_token ) = explode( '=', $spec_arg['token'] ); - - $repeat = false; - do { - if ( ! $repeat ) { - $key_prompt = $current_prompt . $key_token; - } else { - $key_prompt = str_repeat( ' ', strlen( $current_prompt ) ) . $key_token; - } - - $key = $this->prompt( $key_prompt, $default ); - if ( false === $key ) { - return array( $args, $assoc_args ); - } - - if ( $key ) { - $key_prompt_count = strlen( $key_prompt ) - strlen( $value_token ) - 1; - $value_prompt = str_repeat( ' ', $key_prompt_count ) . '=' . $value_token; - - $value = $this->prompt( $value_prompt, $default ); - if ( false === $value ) { - return array( $args, $assoc_args ); - } - - $assoc_args[ $key ] = $value; - - $repeat = true; - } else { - $repeat = false; - } - } while ( $repeat ); - - } else { - - $prompt = $current_prompt . $spec_arg['token']; - if ( 'flag' == $spec_arg['type'] ) { - $prompt .= ' (Y/n)'; - } - - $response = $this->prompt( $prompt, $default ); - if ( false === $response ) { - return array( $args, $assoc_args ); - } - - if ( $response ) { - switch ( $spec_arg['type'] ) { - case 'positional': - if ( $spec_arg['repeating'] ) { - $response = explode( ' ', $response ); - } else { - $response = array( $response ); - } - $args = array_merge( $args, $response ); - break; - case 'assoc': - $assoc_args[ $spec_arg['name'] ] = $response; - break; - case 'flag': - if ( 'Y' == strtoupper( $response ) ) { - $assoc_args[ $spec_arg['name'] ] = true; - } - break; - } - } - } - } - - return array( $args, $assoc_args ); - } - /** * Validate the supplied arguments to the command. * Throws warnings or errors if arguments are missing @@ -382,19 +237,11 @@ private function validate_args( $args, $assoc_args, $extra_args ) { /** * Invoke the subcommand with the supplied arguments. - * Given a --prompt argument, interactively request input - * from the end user. * * @param array $args * @param array $assoc_args */ public function invoke( $args, $assoc_args, $extra_args ) { - static $prompted_once = false; - if ( \EE::get_config( 'prompt' ) && ! $prompted_once ) { - list( $_args, $assoc_args ) = $this->prompt_args( $args, $assoc_args ); - $args = array_merge( $args, $_args ); - $prompted_once = true; - } $extra_positionals = array(); foreach ( $extra_args as $k => $v ) { diff --git a/php/config-spec.php b/php/config-spec.php index 247b5a42c..1e091df90 100644 --- a/php/config-spec.php +++ b/php/config-spec.php @@ -51,13 +51,6 @@ 'desc' => 'Show all PHP errors; add verbosity to EE bootstrap.', ), - 'prompt' => array( - 'runtime' => '[=<assoc>]', - 'file' => false, - 'default' => false, - 'desc' => 'Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values.', - ), - 'quiet' => array( 'runtime' => '', 'file' => '<bool>', From 5f420fbbc4b1e7a36c7cc0eef9a13308ad70a026 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Wed, 28 Nov 2018 14:51:11 +0530 Subject: [PATCH 0611/1044] Update curl utility to resolve to locahost Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/utils.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/php/utils.php b/php/utils.php index 571a655d0..93e4f1548 100644 --- a/php/utils.php +++ b/php/utils.php @@ -1599,14 +1599,15 @@ function get_image_versions() { /** * Function to get httpcode or port occupancy info. * - * @param string $url url to get info about. - * @param int $port The port to check. - * @param bool $port_info Return port info or httpcode. - * @param mixed $auth Send http auth with passed value if not false. + * @param string $url url to get info about. + * @param int $port The port to check. + * @param bool $port_info Return port info or httpcode. + * @param mixed $auth Send http auth with passed value if not false. + * @param bool $resolve_localhost Wether to reolve curl request to localhost or not. * * @return bool|int port occupied or httpcode. */ -function get_curl_info( $url, $port = 80, $port_info = false, $auth = false ) { +function get_curl_info( $url, $port = 80, $port_info = false, $auth = false, $resolve_localhost = false ) { $ch = curl_init( $url ); curl_setopt( $ch, CURLOPT_HEADER, true ); @@ -1614,6 +1615,9 @@ function get_curl_info( $url, $port = 80, $port_info = false, $auth = false ) { curl_setopt( $ch, CURLOPT_NOBODY, true ); curl_setopt( $ch, CURLOPT_TIMEOUT, 10 ); curl_setopt( $ch, CURLOPT_PORT, $port ); + if ( $resolve_localhost ) { + curl_setopt( $ch, CURLOPT_RESOLVE, [ $url . ':' . $port . ':' . LOCALHOST_IP ] ); + } if ( $auth ) { curl_setopt( $ch, CURLOPT_USERPWD, $auth ); } From fc6fc0299c10830556e8fd0f282acaeec1b2ed41 Mon Sep 17 00:00:00 2001 From: Abhijit Rakas <abhijit.rakas@rtcamp.com> Date: Wed, 28 Nov 2018 17:11:13 +0530 Subject: [PATCH 0612/1044] Make correct help command example --- php/commands/help.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/php/commands/help.php b/php/commands/help.php index ca0c53cff..2fef01e25 100644 --- a/php/commands/help.php +++ b/php/commands/help.php @@ -15,11 +15,11 @@ class Help_Command extends EE_Command { * * ## EXAMPLES * - * # get help for `core` command - * ee help core + * # get help for `site` command + * ee help site * - * # get help for `core download` subcommand - * ee help core download + * # get help for `site create` subcommand + * ee help site create */ public function __invoke( $args, $assoc_args ) { $r = EE::get_runner()->find_command_to_run( $args ); From b605d14aaca8467a057ccc6026f6e33c741ee4d7 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Wed, 28 Nov 2018 18:24:35 +0530 Subject: [PATCH 0613/1044] Update to directly use static class Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Migration/SiteContainers.php | 2 +- php/class-ee.php | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/php/EE/Migration/SiteContainers.php b/php/EE/Migration/SiteContainers.php index 4d22e76e8..4ae668c2e 100644 --- a/php/EE/Migration/SiteContainers.php +++ b/php/EE/Migration/SiteContainers.php @@ -157,7 +157,7 @@ public static function create_volume( $site, $volume_name, $symlink_path ) { 'path_to_symlink' => $symlink_path, ], ]; - \EE::docker()->create_volumes( $site_url, $volumes ); + \EE_DOCKER::create_volumes( $site_url, $volumes ); } /** diff --git a/php/class-ee.php b/php/class-ee.php index 3a84061d6..e33f35d70 100644 --- a/php/class-ee.php +++ b/php/class-ee.php @@ -1187,12 +1187,4 @@ public static function run_command( $args, $assoc_args = array() ) { public static function db() { return new EE_DB(); } - - public static function docker() { - if ( empty( self::$docker ) ) { - self::$docker = new EE_DOCKER(); - } - - return self::$docker; - } } From 797086a30099249e93505d9628d3435ae12cb7fe Mon Sep 17 00:00:00 2001 From: Rahul Prajapati <rahul.prajapati@live.in> Date: Wed, 28 Nov 2018 19:13:42 +0530 Subject: [PATCH 0614/1044] Add random name generator function for usernames. --- php/utils.php | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/php/utils.php b/php/utils.php index 93e4f1548..9d8463975 100644 --- a/php/utils.php +++ b/php/utils.php @@ -1644,3 +1644,53 @@ function get_config_value( $key, $default = null ) { return empty( $existing_config[ $key ] ) ? $default : $existing_config[ $key ]; } + +/** + * Random name generator. + * + * @return string + */ +function random_name_generator() { + + $left = [ + 'admiring', 'adoring', 'affectionate', 'agitated', 'amazing', 'angry', 'awesome', 'blissful', 'bold', + 'boring', 'brave', 'charming', 'clever', 'cocky', 'cool', 'compassionate', 'competent', 'condescending', + 'confident', 'cranky', 'crazy', 'dazzling', 'determined', 'distracted', 'dreamy', 'eager', 'ecstatic', + 'elastic', 'elated', 'elegant', 'eloquent', 'epic', 'fervent', 'festive', 'flamboyant', 'focused', 'friendly', + 'frosty', 'gallant', 'gifted', 'goofy', 'gracious', 'happy', 'hardcore', 'heuristic', 'hopeful', 'hungry', + 'infallible', 'inspiring', 'jolly', 'jovial', 'keen', 'kind', 'laughing', 'loving', 'lucid', 'magical', + 'mystifying', 'modest', 'musing', 'naughty', 'nervous', 'nifty', 'nostalgic', 'objective', 'optimistic', + 'peaceful', 'pedantic', 'pensive', 'practical', 'priceless', 'quirky', 'quizzical', 'recursing', 'relaxed', + 'reverent', 'romantic', 'sad', 'serene', 'sharp', 'silly', 'sleepy', 'stoic', 'stupefied', 'suspicious', + 'sweet', 'tender', 'thirsty', 'trusting', 'unruffled', 'upbeat', 'vibrant', 'vigilant', 'vigorous', + 'wizardly', 'wonderful', 'xenodochial', 'youthful', 'zealous', 'zen', + ]; + + $right = [ 'albattani', 'allen', 'almeida', 'antonelli', 'agnesi', 'archimedes', 'ardinghelli', 'aryabhata', + 'austin', 'babbage', 'banach', 'banzai', 'bardeen', 'bartik', 'bassi', 'beaver', 'bell', 'benz', 'bhabha', + 'bhaskara', 'black', 'blackburn', 'blackwell', 'bohr', 'booth', 'borg', 'bose', 'boyd', 'brahmagupta', + 'brattain', 'brown', 'burnell', 'buck', 'burnell', 'cannon', 'carson', 'cartwright', 'chandrasekhar', + 'chaplygin', 'chatelet', 'chatterjee', 'chebyshev', 'cocks', 'cohen', 'chaum', 'clarke', 'colden', 'cori', + 'cray', 'curran', 'curie', 'darwin', 'davinci', 'dewdney', 'dhawan', 'diffie', 'dijkstra', 'dirac', 'driscoll', + 'dubinsky', 'easley', 'edison', 'einstein', 'elbakyan', 'elgamal', 'elion', 'ellis', 'engelbart', 'euclid', + 'euler', 'faraday', 'feistel', 'fermat', 'fermi', 'feynman', 'franklin', 'gagarin', 'galileo', 'galois', + 'ganguly', 'gates', 'gauss', 'germain', 'goldberg', 'goldstine', 'goldwasser', 'golick', 'goodall', 'gould', + 'greider', 'grothendieck', 'haibt', 'hamilton', 'haslett', 'hawking', 'hellman', 'heisenberg', 'hermann', + 'herschel', 'hertz', 'heyrovsky', 'hodgkin', 'hofstadter', 'hoover', 'hopper', 'hugle', 'hypatia', 'ishizaka', + 'jackson', 'jang', 'jennings', 'jepsen', 'johnson', 'joliot', 'jones', 'kalam', 'kapitsa', 'kare', 'keldysh', + 'keller', 'kepler', 'khayyam', 'khorana', 'kilby', 'kirch', 'knuth', 'kowalevski', 'lalande', 'lamarr', + 'lamport', 'leakey', 'leavitt', 'lederberg', 'lehmann', 'lewin', 'lichterman', 'liskov', 'lovelace', 'lumiere', + 'mahavira', 'margulis', 'matsumoto', 'maxwell', 'mayer', 'mccarthy', 'mcclintock', 'mclaren', 'mclean', + 'mcnulty', 'mendel', 'mendeleev', 'meitner', 'meninsky', 'merkle', 'mestorf', 'minsky', 'mirzakhani', + 'moore', 'morse', 'murdock', 'moser', 'napier', 'nash', 'neumann', 'newton', 'nightingale', 'nobel', + 'noether', 'northcutt', 'noyce', 'panini', 'pare', 'pascal', 'pasteur', 'payne', 'perlman', 'pike', + 'poincare', 'poitras', 'proskuriakova', 'ptolemy', 'raman', 'ramanujan', 'ride', 'montalcini', 'ritchie', + 'rhodes', 'robinson', 'roentgen', 'rosalind', 'rubin', 'saha', 'sammet', 'sanderson', 'shannon', 'shaw', + 'shirley', 'shockley', 'shtern', 'sinoussi', 'snyder', 'solomon', 'spence', 'sutherland', 'stallman', + 'stonebraker', 'swanson', 'swartz', 'swirles', 'taussig', 'tereshkova', 'tesla', 'tharp', 'thompson', + 'torvalds', 'tu', 'turing', 'varahamihira', 'vaughan', 'visvesvaraya', 'volhard', 'villani', 'wescoff', + 'wiles', 'williams', 'williamson', 'wilson', 'wing', 'wozniak', 'wright', 'wu', 'yalow', 'yonath', "zhukovsky", + ]; + + return array_rand( $left ) . '-' . array_rand( $right ); +} From 864e12a9404ff5511d26c2eb5ffd5b8f4460d868 Mon Sep 17 00:00:00 2001 From: Rahul Prajapati <rahul.prajapati@live.in> Date: Wed, 28 Nov 2018 20:07:22 +0530 Subject: [PATCH 0615/1044] Update easyengine packages and add stable tags for other packages. --- composer.json | 58 +++++++++++++------------- composer.lock | 110 ++++++++++++++++++++++++++------------------------ 2 files changed, 86 insertions(+), 82 deletions(-) diff --git a/composer.json b/composer.json index 174087201..476a570b0 100644 --- a/composer.json +++ b/composer.json @@ -25,43 +25,43 @@ "prefer-stable": true, "require": { "php": ">=7.0", - "composer/composer": "^1.2.0", - "composer/semver": "~1.0", - "easyengine/admin-tools-command": "v1.0.0", + "composer/composer": "1.7.3", + "composer/semver": "1.4.2", + "easyengine/admin-tools-command": "v1.0.1", "easyengine/auth-command": "v1.0.0", "easyengine/config-command": "v1.0.0", - "easyengine/cron-command": "v1.0.0", - "easyengine/mailhog-command": "v1.0.0", - "easyengine/site-command": "v2.2.2", - "easyengine/site-type-wp": "v1.0.0", - "easyengine/site-type-php": "v1.0.0", - "easyengine/service-command": "v1.0.0", + "easyengine/cron-command": "v1.0.1", + "easyengine/mailhog-command": "v1.0.1", + "easyengine/site-command": "v2.2.3", + "easyengine/site-type-wp": "v1.0.1", + "easyengine/site-type-php": "v1.0.1", + "easyengine/service-command": "v1.0.1", "easyengine/shell-command" : "v1.0.0", - "justinrainbow/json-schema": "~5.2.5", - "monolog/monolog": "^1.23", - "mustache/mustache": "~2.4", - "rmccue/requests": "~1.6", - "symfony/config": "^2.7|^3.0", - "symfony/console": "^2.7|^3.0", - "symfony/debug": "^2.7|^3.0", - "symfony/dependency-injection": "^2.7|^3.0", - "symfony/event-dispatcher": "^2.7|^3.0", - "symfony/filesystem": "^2.7|^3.0", - "symfony/finder": "^2.7|^3.0", - "symfony/process": "^2.1|^3.0", - "symfony/translation": "^2.7|^3.0", - "symfony/yaml": "^2.7|^3.0", - "wp-cli/autoload-splitter": "^0.1.5", - "wp-cli/mustangostang-spyc": "^0.6.3", - "wp-cli/php-cli-tools": "~0.11.2" + "justinrainbow/json-schema": "5.2.7", + "monolog/monolog": "1.24.0", + "mustache/mustache": "2.12.0", + "rmccue/requests": "1.7.0", + "symfony/config": "3.4.18", + "symfony/console": "3.4.18", + "symfony/debug": "3.4.18", + "symfony/dependency-injection": "3.4.18", + "symfony/event-dispatcher": "3.4.18", + "symfony/filesystem": "3.4.18", + "symfony/finder": "3.4.18", + "symfony/process": "3.4.18", + "symfony/translation": "3.4.18", + "symfony/yaml": "3.4.18", + "wp-cli/autoload-splitter": "0.1.5", + "wp-cli/mustangostang-spyc": "0.6.3", + "wp-cli/php-cli-tools": "0.11.10" }, "require-dev": { "behat/behat": "3.4.*", - "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3", + "dealerdirect/phpcodesniffer-composer-installer": "0.4.4", "phpunit/phpunit": "3.7.*", "roave/security-advisories": "dev-master", - "wimg/php-compatibility": "^8.0", - "wp-coding-standards/wpcs": "^0.13.1" + "wimg/php-compatibility": "8.2.0", + "wp-coding-standards/wpcs": "0.13.1" }, "suggest": { "psy/psysh": "Enhanced shell functionality" diff --git a/composer.lock b/composer.lock index 9bcd44b65..3fdf22fb4 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": "8485fde92407e0e273c9d97a0cab5248", + "content-hash": "2d885df4207faccab0c1ceec1784a6c3", "packages": [ { "name": "acmephp/core", @@ -437,16 +437,16 @@ }, { "name": "easyengine/admin-tools-command", - "version": "v1.0.0", + "version": "v1.0.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/admin-tools-command.git", - "reference": "e5f608d89351aa59e6aa811cbe78a937a306d2b2" + "reference": "4a65b89765ea61512e1e2b56a5f788a2927db564" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/admin-tools-command/zipball/e5f608d89351aa59e6aa811cbe78a937a306d2b2", - "reference": "e5f608d89351aa59e6aa811cbe78a937a306d2b2", + "url": "https://api.github.com/repos/EasyEngine/admin-tools-command/zipball/4a65b89765ea61512e1e2b56a5f788a2927db564", + "reference": "4a65b89765ea61512e1e2b56a5f788a2927db564", "shasum": "" }, "type": "ee-cli-package", @@ -476,7 +476,7 @@ ], "description": "Command to manage admin tools for php based sites.", "homepage": "https://github.com/easyengine/amdin-tools", - "time": "2018-11-20T12:18:53+00:00" + "time": "2018-11-28T13:50:00+00:00" }, { "name": "easyengine/auth-command", @@ -568,16 +568,16 @@ }, { "name": "easyengine/cron-command", - "version": "v1.0.0", + "version": "v1.0.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/cron-command.git", - "reference": "f6ba3754adf9e60baa63bd8ae1b96228c3999fce" + "reference": "8a80aa4c0a18e72b9542c853e1360749718ca9bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/cron-command/zipball/f6ba3754adf9e60baa63bd8ae1b96228c3999fce", - "reference": "f6ba3754adf9e60baa63bd8ae1b96228c3999fce", + "url": "https://api.github.com/repos/EasyEngine/cron-command/zipball/8a80aa4c0a18e72b9542c853e1360749718ca9bd", + "reference": "8a80aa4c0a18e72b9542c853e1360749718ca9bd", "shasum": "" }, "type": "ee-cli-package", @@ -609,20 +609,20 @@ ], "description": "Manages cron jobs in EasyEngine", "homepage": "https://github.com/easyengine/cron-command", - "time": "2018-11-13T11:31:12+00:00" + "time": "2018-11-28T13:56:44+00:00" }, { "name": "easyengine/mailhog-command", - "version": "v1.0.0", + "version": "v1.0.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/mailhog-command.git", - "reference": "8bdcd4b82cba57fc414ff0a443271b51452ee8c0" + "reference": "642173e0e2510e3d148a60d46eab90635081955b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/mailhog-command/zipball/8bdcd4b82cba57fc414ff0a443271b51452ee8c0", - "reference": "8bdcd4b82cba57fc414ff0a443271b51452ee8c0", + "url": "https://api.github.com/repos/EasyEngine/mailhog-command/zipball/642173e0e2510e3d148a60d46eab90635081955b", + "reference": "642173e0e2510e3d148a60d46eab90635081955b", "shasum": "" }, "type": "ee-cli-package", @@ -652,20 +652,20 @@ ], "description": "Command to manage mailhog", "homepage": "https://github.com/easyengine/mailhog-command", - "time": "2018-11-20T12:40:06+00:00" + "time": "2018-11-28T13:58:43+00:00" }, { "name": "easyengine/service-command", - "version": "v1.0.0", + "version": "v1.0.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/service-command.git", - "reference": "f24d29b33935341501de8912fd4f57b550af0aa2" + "reference": "c5f538bf2338e2d15a8594bc994c4b177814c605" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/f24d29b33935341501de8912fd4f57b550af0aa2", - "reference": "f24d29b33935341501de8912fd4f57b550af0aa2", + "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/c5f538bf2338e2d15a8594bc994c4b177814c605", + "reference": "c5f538bf2338e2d15a8594bc994c4b177814c605", "shasum": "" }, "type": "ee-cli-package", @@ -697,7 +697,7 @@ ], "description": "Command to manager global containers/services in EasyEngine", "homepage": "https://github.com/easyengine/service-command", - "time": "2018-11-21T20:12:21+00:00" + "time": "2018-11-28T14:10:15+00:00" }, { "name": "easyengine/shell-command", @@ -741,16 +741,16 @@ }, { "name": "easyengine/site-command", - "version": "v2.2.2", + "version": "v2.2.3", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "2a116036821a347fa460d8267fcf705fa19b751b" + "reference": "53f642042473ac834cd0eeacea92f05a2f81cf6b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/2a116036821a347fa460d8267fcf705fa19b751b", - "reference": "2a116036821a347fa460d8267fcf705fa19b751b", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/53f642042473ac834cd0eeacea92f05a2f81cf6b", + "reference": "53f642042473ac834cd0eeacea92f05a2f81cf6b", "shasum": "" }, "require": { @@ -796,20 +796,20 @@ "MIT" ], "homepage": "https://github.com/easyengine/site-command", - "time": "2018-11-21T21:50:58+00:00" + "time": "2018-11-28T14:01:32+00:00" }, { "name": "easyengine/site-type-php", - "version": "v1.0.0", + "version": "v1.0.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-php.git", - "reference": "019e3d9ae678b5b179ef5ca9541a4d43bf4e3856" + "reference": "c331359762d84cca505e0628f05ec2fc37ac6782" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/019e3d9ae678b5b179ef5ca9541a4d43bf4e3856", - "reference": "019e3d9ae678b5b179ef5ca9541a4d43bf4e3856", + "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/c331359762d84cca505e0628f05ec2fc37ac6782", + "reference": "c331359762d84cca505e0628f05ec2fc37ac6782", "shasum": "" }, "require-dev": { @@ -836,20 +836,20 @@ ], "description": "EasyEngine package for PHP site creation.", "homepage": "https://github.com/easyengine/site-type-php", - "time": "2018-11-21T15:23:51+00:00" + "time": "2018-11-28T14:06:49+00:00" }, { "name": "easyengine/site-type-wp", - "version": "v1.0.0", + "version": "v1.0.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-wp.git", - "reference": "96a13b42fb64ac857071079557e01268e71f4c4f" + "reference": "8aac1a04554d940ccc601e6310183dfa2e692c81" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/96a13b42fb64ac857071079557e01268e71f4c4f", - "reference": "96a13b42fb64ac857071079557e01268e71f4c4f", + "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/8aac1a04554d940ccc601e6310183dfa2e692c81", + "reference": "8aac1a04554d940ccc601e6310183dfa2e692c81", "shasum": "" }, "require-dev": { @@ -888,7 +888,7 @@ ], "description": "EasyEngine site type package for WordPress site creation.", "homepage": "https://github.com/easyengine/site-type-wp", - "time": "2018-11-21T15:25:08+00:00" + "time": "2018-11-28T14:04:17+00:00" }, { "name": "guzzlehttp/guzzle", @@ -1139,16 +1139,16 @@ }, { "name": "league/flysystem", - "version": "1.0.48", + "version": "1.0.49", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "a6ded5b2f6055e2db97b4b859fdfca2b952b78aa" + "reference": "a63cc83d8a931b271be45148fa39ba7156782ffd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/a6ded5b2f6055e2db97b4b859fdfca2b952b78aa", - "reference": "a6ded5b2f6055e2db97b4b859fdfca2b952b78aa", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/a63cc83d8a931b271be45148fa39ba7156782ffd", + "reference": "a63cc83d8a931b271be45148fa39ba7156782ffd", "shasum": "" }, "require": { @@ -1219,7 +1219,7 @@ "sftp", "storage" ], - "time": "2018-10-15T13:53:10+00:00" + "time": "2018-11-23T23:41:29+00:00" }, { "name": "monolog/monolog", @@ -2223,16 +2223,16 @@ }, { "name": "symfony/serializer", - "version": "v3.4.18", + "version": "v3.4.19", "source": { "type": "git", "url": "https://github.com/symfony/serializer.git", - "reference": "8bc00ef47a428bfebc4641f29d158e7c56137fcb" + "reference": "3808566ba899afe9aa66c3d5d726c22230d5037d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/serializer/zipball/8bc00ef47a428bfebc4641f29d158e7c56137fcb", - "reference": "8bc00ef47a428bfebc4641f29d158e7c56137fcb", + "url": "https://api.github.com/repos/symfony/serializer/zipball/3808566ba899afe9aa66c3d5d726c22230d5037d", + "reference": "3808566ba899afe9aa66c3d5d726c22230d5037d", "shasum": "" }, "require": { @@ -2298,7 +2298,7 @@ ], "description": "Symfony Serializer Component", "homepage": "https://symfony.com", - "time": "2018-10-02T12:28:39+00:00" + "time": "2018-11-11T19:48:54+00:00" }, { "name": "symfony/translation", @@ -3314,7 +3314,10 @@ "drupal/core": ">=7,<7.60|>=8,<8.5.8|>=8.6,<8.6.2", "drupal/drupal": ">=7,<7.60|>=8,<8.5.8|>=8.6,<8.6.2", "erusev/parsedown": "<1.7", - "ezsystems/ezpublish-legacy": ">=5.3,<5.3.12.5|>=5.4,<5.4.12.2|>=2017.8,<2017.8.1.1|>=2017.12,<2017.12.4.2|>=2018.6,<2018.6.1.3|>=2018.9,<2018.9.1.2", + "ezsystems/ezplatform": "<1.7.8.1|>=1.8,<1.13.4.1|>=2,<2.2.3.1|>=2.3,<2.3.2.1", + "ezsystems/ezpublish-kernel": ">=5.3,<5.3.12.1|>=5.4,<5.4.13.1|>=6,<6.7.9.1|>=6.8,<6.13.5.1|>=7,<7.2.4.1|>=7.3,<7.3.2.1", + "ezsystems/ezpublish-legacy": ">=5.3,<5.3.12.6|>=5.4,<5.4.12.3|>=2011,<2017.12.4.3|>=2018.6,<2018.6.1.4|>=2018.9,<2018.9.1.3", + "ezsystems/repository-forms": ">=2.3,<2.3.2.1", "ezyang/htmlpurifier": "<4.1.1", "firebase/php-jwt": "<2", "fooman/tcpdf": "<6.2.22", @@ -3352,6 +3355,7 @@ "paragonie/random_compat": "<2", "paypal/merchant-sdk-php": "<3.12", "phpmailer/phpmailer": ">=5,<5.2.27|>=6,<6.0.6", + "phpoffice/phpexcel": "<=1.8.1", "phpoffice/phpspreadsheet": "<=1.5", "phpunit/phpunit": ">=4.8.19,<4.8.28|>=5.0.10,<5.6.3", "phpwhois/phpwhois": "<=4.2.5", @@ -3461,7 +3465,7 @@ } ], "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", - "time": "2018-11-21T13:18:22+00:00" + "time": "2018-11-27T12:50:30+00:00" }, { "name": "squizlabs/php_codesniffer", @@ -3516,16 +3520,16 @@ }, { "name": "symfony/class-loader", - "version": "v3.4.18", + "version": "v3.4.19", "source": { "type": "git", "url": "https://github.com/symfony/class-loader.git", - "reference": "5605edec7b8f034ead2497ff4aab17bb70d558c1" + "reference": "420458095cf60025eb0841276717e0da7f75e50e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/class-loader/zipball/5605edec7b8f034ead2497ff4aab17bb70d558c1", - "reference": "5605edec7b8f034ead2497ff4aab17bb70d558c1", + "url": "https://api.github.com/repos/symfony/class-loader/zipball/420458095cf60025eb0841276717e0da7f75e50e", + "reference": "420458095cf60025eb0841276717e0da7f75e50e", "shasum": "" }, "require": { @@ -3568,7 +3572,7 @@ ], "description": "Symfony ClassLoader Component", "homepage": "https://symfony.com", - "time": "2018-10-31T09:06:03+00:00" + "time": "2018-11-11T19:48:54+00:00" }, { "name": "wimg/php-compatibility", From 1a7bab3f327dadb04b11e2aa00d84f1c778f3705 Mon Sep 17 00:00:00 2001 From: Rahul Prajapati <rahul.prajapati@live.in> Date: Wed, 28 Nov 2018 20:18:48 +0530 Subject: [PATCH 0616/1044] Fix username generate issue. --- php/utils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/utils.php b/php/utils.php index 9d8463975..f57ad6776 100644 --- a/php/utils.php +++ b/php/utils.php @@ -1692,5 +1692,5 @@ function random_name_generator() { 'wiles', 'williams', 'williamson', 'wilson', 'wing', 'wozniak', 'wright', 'wu', 'yalow', 'yonath', "zhukovsky", ]; - return array_rand( $left ) . '-' . array_rand( $right ); + return $left[ array_rand( $left ) ] . '-' . $right[ array_rand( $right ) ]; } From d7505be18a57452eab99ed67510626d456ec5db8 Mon Sep 17 00:00:00 2001 From: Rahul Prajapati <rahul.prajapati@live.in> Date: Wed, 28 Nov 2018 20:19:11 +0530 Subject: [PATCH 0617/1044] Bump version v4.0.2 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 1454f6ed4..4d54daddb 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.0.1 +4.0.2 From 20e5e8bdca223b47ea784a4013b2a3ebd142dacd Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 29 Nov 2018 16:01:26 +0530 Subject: [PATCH 0618/1044] Update to rtBot user for phar deployment Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- ci/deploy.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/deploy.sh b/ci/deploy.sh index 9e7c2af9d..8dc32ab1f 100755 --- a/ci/deploy.sh +++ b/ci/deploy.sh @@ -32,8 +32,8 @@ echo "|1|qPmmP7LVZ7Qbpk7AylmkfR0FApQ=|WUy1WS3F4qcr3R5Sc728778goPw= ssh-rsa AAAAB git clone git@github.com:easyengine/easyengine-builds.git -git config user.name "Travis CI" -git config user.email "travis@travis-ci.org" +git config user.name "rtBot" +git config user.email "43742164+rtBot@users.noreply.github.com" git config push.default "current" if [[ "$TRAVIS_BRANCH" == "develop" ]]; then From 8b2ea2cae45e0905adb37691764ac23a53dc0675 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 29 Nov 2018 21:13:20 +0530 Subject: [PATCH 0619/1044] Update config setting to global scope Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- ci/deploy.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ci/deploy.sh b/ci/deploy.sh index 8dc32ab1f..4f771c8cf 100755 --- a/ci/deploy.sh +++ b/ci/deploy.sh @@ -32,9 +32,9 @@ echo "|1|qPmmP7LVZ7Qbpk7AylmkfR0FApQ=|WUy1WS3F4qcr3R5Sc728778goPw= ssh-rsa AAAAB git clone git@github.com:easyengine/easyengine-builds.git -git config user.name "rtBot" -git config user.email "43742164+rtBot@users.noreply.github.com" -git config push.default "current" +git config --global user.name "rtBot" +git config --global user.email "43742164+rtBot@users.noreply.github.com" +git config --global push.default "current" if [[ "$TRAVIS_BRANCH" == "develop" ]]; then fname="phar/easyengine-nightly.phar" From 226532c8a44af8fdc261f02fc0257ed6636e44d8 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 29 Nov 2018 21:45:16 +0530 Subject: [PATCH 0620/1044] Add log-command and update other packages Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- ci/prepare.sh | 1 - composer.json | 7 ++-- composer.lock | 89 +++++++++++++++++++++++++++++++++++++++------------ 3 files changed, 72 insertions(+), 25 deletions(-) diff --git a/ci/prepare.sh b/ci/prepare.sh index a3fd49a41..b2323f0e6 100755 --- a/ci/prepare.sh +++ b/ci/prepare.sh @@ -7,7 +7,6 @@ if [[ "$TRAVIS_BRANCH" != $DEPLOY_BRANCH ]]; then version="$(echo $version | xargs)" version+="-nightly-$(git rev-parse --short HEAD)" echo $version > VERSION - sed -i 's/\:\ \"\(.*\)\"/\:\ \"\1-nightly\"/g' img-versions.json fi php -dphar.readonly=0 ./utils/make-phar.php easyengine.phar --quiet diff --git a/composer.json b/composer.json index 476a570b0..ccbd1c7b0 100644 --- a/composer.json +++ b/composer.json @@ -29,13 +29,14 @@ "composer/semver": "1.4.2", "easyengine/admin-tools-command": "v1.0.1", "easyengine/auth-command": "v1.0.0", - "easyengine/config-command": "v1.0.0", + "easyengine/config-command": "v1.0.1", "easyengine/cron-command": "v1.0.1", + "easyengine/log-command": "v1.0.0", "easyengine/mailhog-command": "v1.0.1", - "easyengine/site-command": "v2.2.3", + "easyengine/site-command": "v2.2.4", "easyengine/site-type-wp": "v1.0.1", "easyengine/site-type-php": "v1.0.1", - "easyengine/service-command": "v1.0.1", + "easyengine/service-command": "v1.0.2", "easyengine/shell-command" : "v1.0.0", "justinrainbow/json-schema": "5.2.7", "monolog/monolog": "1.24.0", diff --git a/composer.lock b/composer.lock index 3fdf22fb4..fe73533b5 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": "2d885df4207faccab0c1ceec1784a6c3", + "content-hash": "2f9705fa3a3b4e349f1e277b6b171831", "packages": [ { "name": "acmephp/core", @@ -393,16 +393,16 @@ }, { "name": "composer/xdebug-handler", - "version": "1.3.0", + "version": "1.3.1", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "b8e9745fb9b06ea6664d8872c4505fb16df4611c" + "reference": "dc523135366eb68f22268d069ea7749486458562" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/b8e9745fb9b06ea6664d8872c4505fb16df4611c", - "reference": "b8e9745fb9b06ea6664d8872c4505fb16df4611c", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/dc523135366eb68f22268d069ea7749486458562", + "reference": "dc523135366eb68f22268d069ea7749486458562", "shasum": "" }, "require": { @@ -433,7 +433,7 @@ "Xdebug", "performance" ], - "time": "2018-08-31T19:07:57+00:00" + "time": "2018-11-29T10:59:02+00:00" }, { "name": "easyengine/admin-tools-command", @@ -528,16 +528,16 @@ }, { "name": "easyengine/config-command", - "version": "v1.0.0", + "version": "v1.0.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/config-command.git", - "reference": "cd1f3423413414d6a46f3e89bbce910d16dc1ee6" + "reference": "34ddc95325e1b4967a77ea9d34bddaf7f6ee6cf5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/config-command/zipball/cd1f3423413414d6a46f3e89bbce910d16dc1ee6", - "reference": "cd1f3423413414d6a46f3e89bbce910d16dc1ee6", + "url": "https://api.github.com/repos/EasyEngine/config-command/zipball/34ddc95325e1b4967a77ea9d34bddaf7f6ee6cf5", + "reference": "34ddc95325e1b4967a77ea9d34bddaf7f6ee6cf5", "shasum": "" }, "type": "ee-cli-package", @@ -564,7 +564,7 @@ ], "description": "Manages EasyEngine configuration", "homepage": "https://github.com/easyengine/config-command", - "time": "2018-10-30T08:38:08+00:00" + "time": "2018-11-29T15:58:43+00:00" }, { "name": "easyengine/cron-command", @@ -611,6 +611,42 @@ "homepage": "https://github.com/easyengine/cron-command", "time": "2018-11-28T13:56:44+00:00" }, + { + "name": "easyengine/log-command", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/EasyEngine/log-command.git", + "reference": "ba20a345cdb55bc97d3a17b430140487964417c2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/EasyEngine/log-command/zipball/ba20a345cdb55bc97d3a17b430140487964417c2", + "reference": "ba20a345cdb55bc97d3a17b430140487964417c2", + "shasum": "" + }, + "type": "ee-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "log-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "homepage": "https://github.com/easyengine/log-command", + "time": "2018-11-29T15:50:06+00:00" + }, { "name": "easyengine/mailhog-command", "version": "v1.0.1", @@ -656,16 +692,16 @@ }, { "name": "easyengine/service-command", - "version": "v1.0.1", + "version": "v1.0.2", "source": { "type": "git", "url": "https://github.com/EasyEngine/service-command.git", - "reference": "c5f538bf2338e2d15a8594bc994c4b177814c605" + "reference": "a7aa3e01262ea8d255b08b0b1b0919cabaf7f708" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/c5f538bf2338e2d15a8594bc994c4b177814c605", - "reference": "c5f538bf2338e2d15a8594bc994c4b177814c605", + "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/a7aa3e01262ea8d255b08b0b1b0919cabaf7f708", + "reference": "a7aa3e01262ea8d255b08b0b1b0919cabaf7f708", "shasum": "" }, "type": "ee-cli-package", @@ -697,7 +733,7 @@ ], "description": "Command to manager global containers/services in EasyEngine", "homepage": "https://github.com/easyengine/service-command", - "time": "2018-11-28T14:10:15+00:00" + "time": "2018-11-29T16:00:52+00:00" }, { "name": "easyengine/shell-command", @@ -741,16 +777,16 @@ }, { "name": "easyengine/site-command", - "version": "v2.2.3", + "version": "v2.2.4", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "53f642042473ac834cd0eeacea92f05a2f81cf6b" + "reference": "6a34d51ba8e2eaeca2b0726bac314a39bee0c819" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/53f642042473ac834cd0eeacea92f05a2f81cf6b", - "reference": "53f642042473ac834cd0eeacea92f05a2f81cf6b", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/6a34d51ba8e2eaeca2b0726bac314a39bee0c819", + "reference": "6a34d51ba8e2eaeca2b0726bac314a39bee0c819", "shasum": "" }, "require": { @@ -796,7 +832,7 @@ "MIT" ], "homepage": "https://github.com/easyengine/site-command", - "time": "2018-11-28T14:01:32+00:00" + "time": "2018-11-29T16:02:27+00:00" }, { "name": "easyengine/site-type-php", @@ -3280,6 +3316,17 @@ { "name": "roave/security-advisories", "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/Roave/SecurityAdvisories.git", + "reference": "6acf968142215f1614f5909aa006b2bf1ec45cb1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/6acf968142215f1614f5909aa006b2bf1ec45cb1", + "reference": "6acf968142215f1614f5909aa006b2bf1ec45cb1", + "shasum": "" + }, "conflict": { "3f/pygmentize": "<1.2", "adodb/adodb-php": "<5.20.12", From bc4cb910d70ba1e3eccfbf6f759071bbd76d326b Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 29 Nov 2018 21:46:41 +0530 Subject: [PATCH 0621/1044] Bump version v4.0.3 Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 4d54daddb..c4e41f945 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.0.2 +4.0.3 From 25a6f8603ba22e12f593f51abb784c3f285098ba Mon Sep 17 00:00:00 2001 From: Mriyam Tamuli <mbtamuli@gmail.com> Date: Mon, 3 Dec 2018 12:20:02 +0530 Subject: [PATCH 0622/1044] Add ralouphie/getallheaders in the phar Signed-off-by: Mriyam Tamuli <mbtamuli@gmail.com> --- utils/make-phar.php | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/make-phar.php b/utils/make-phar.php index 625b55d18..2e5381748 100644 --- a/utils/make-phar.php +++ b/utils/make-phar.php @@ -170,6 +170,7 @@ function get_composer_versions( $current_version ) { ->in(EE_VENDOR_DIR . '/symfony/polyfill-ctype') ->in(EE_VENDOR_DIR . '/monolog') ->in(EE_VENDOR_DIR . '/guzzlehttp') + ->in(EE_VENDOR_DIR . '/ralouphie/getallheaders') ->in(EE_VENDOR_DIR . '/acmephp') ->in(EE_VENDOR_DIR . '/league') ->in(EE_VENDOR_DIR . '/webmozart') From 8c2915821c3778d6d753a5eac92fffa01badee67 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 4 Dec 2018 17:40:56 +0530 Subject: [PATCH 0623/1044] Update EasyEngine packages Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- composer.json | 12 ++--- composer.lock | 120 ++++++++++++++++++++++++++++++++++---------------- 2 files changed, 87 insertions(+), 45 deletions(-) diff --git a/composer.json b/composer.json index ccbd1c7b0..c0850513b 100644 --- a/composer.json +++ b/composer.json @@ -27,16 +27,16 @@ "php": ">=7.0", "composer/composer": "1.7.3", "composer/semver": "1.4.2", - "easyengine/admin-tools-command": "v1.0.1", - "easyengine/auth-command": "v1.0.0", + "easyengine/admin-tools-command": "v1.0.2", + "easyengine/auth-command": "v1.0.1", "easyengine/config-command": "v1.0.1", "easyengine/cron-command": "v1.0.1", "easyengine/log-command": "v1.0.0", "easyengine/mailhog-command": "v1.0.1", - "easyengine/site-command": "v2.2.4", - "easyengine/site-type-wp": "v1.0.1", - "easyengine/site-type-php": "v1.0.1", - "easyengine/service-command": "v1.0.2", + "easyengine/site-command": "v2.2.5", + "easyengine/site-type-wp": "v1.0.2", + "easyengine/site-type-php": "v1.0.2", + "easyengine/service-command": "v1.0.3", "easyengine/shell-command" : "v1.0.0", "justinrainbow/json-schema": "5.2.7", "monolog/monolog": "1.24.0", diff --git a/composer.lock b/composer.lock index fe73533b5..b5ff2d2b8 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": "2f9705fa3a3b4e349f1e277b6b171831", + "content-hash": "eb75ca7c2de58a1c1ddd96abc234a1e1", "packages": [ { "name": "acmephp/core", @@ -437,16 +437,16 @@ }, { "name": "easyengine/admin-tools-command", - "version": "v1.0.1", + "version": "v1.0.2", "source": { "type": "git", "url": "https://github.com/EasyEngine/admin-tools-command.git", - "reference": "4a65b89765ea61512e1e2b56a5f788a2927db564" + "reference": "53617712ea658da31badc970d55802fef6c92cd8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/admin-tools-command/zipball/4a65b89765ea61512e1e2b56a5f788a2927db564", - "reference": "4a65b89765ea61512e1e2b56a5f788a2927db564", + "url": "https://api.github.com/repos/EasyEngine/admin-tools-command/zipball/53617712ea658da31badc970d55802fef6c92cd8", + "reference": "53617712ea658da31badc970d55802fef6c92cd8", "shasum": "" }, "type": "ee-cli-package", @@ -476,20 +476,20 @@ ], "description": "Command to manage admin tools for php based sites.", "homepage": "https://github.com/easyengine/amdin-tools", - "time": "2018-11-28T13:50:00+00:00" + "time": "2018-12-04T11:50:13+00:00" }, { "name": "easyengine/auth-command", - "version": "v1.0.0", + "version": "v1.0.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/auth-command.git", - "reference": "4fb77a34be9e735ad2325475602fcbf5a4e148cc" + "reference": "9c1681041d1307744207dfaba0cb3d7189f4d0e4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/auth-command/zipball/4fb77a34be9e735ad2325475602fcbf5a4e148cc", - "reference": "4fb77a34be9e735ad2325475602fcbf5a4e148cc", + "url": "https://api.github.com/repos/EasyEngine/auth-command/zipball/9c1681041d1307744207dfaba0cb3d7189f4d0e4", + "reference": "9c1681041d1307744207dfaba0cb3d7189f4d0e4", "shasum": "" }, "type": "ee-cli-package", @@ -524,7 +524,7 @@ ], "description": "Configure HTTP Authentication and whitelisting for EasyEngine site", "homepage": "https://github.com/easyengine/auth-command", - "time": "2018-11-20T12:20:49+00:00" + "time": "2018-12-04T11:48:09+00:00" }, { "name": "easyengine/config-command", @@ -692,16 +692,16 @@ }, { "name": "easyengine/service-command", - "version": "v1.0.2", + "version": "v1.0.3", "source": { "type": "git", "url": "https://github.com/EasyEngine/service-command.git", - "reference": "a7aa3e01262ea8d255b08b0b1b0919cabaf7f708" + "reference": "dd244842a44b1e9bf9758a24c3bc111c3a3f7b41" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/a7aa3e01262ea8d255b08b0b1b0919cabaf7f708", - "reference": "a7aa3e01262ea8d255b08b0b1b0919cabaf7f708", + "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/dd244842a44b1e9bf9758a24c3bc111c3a3f7b41", + "reference": "dd244842a44b1e9bf9758a24c3bc111c3a3f7b41", "shasum": "" }, "type": "ee-cli-package", @@ -733,7 +733,7 @@ ], "description": "Command to manager global containers/services in EasyEngine", "homepage": "https://github.com/easyengine/service-command", - "time": "2018-11-29T16:00:52+00:00" + "time": "2018-12-04T12:00:02+00:00" }, { "name": "easyengine/shell-command", @@ -777,16 +777,16 @@ }, { "name": "easyengine/site-command", - "version": "v2.2.4", + "version": "v2.2.5", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "6a34d51ba8e2eaeca2b0726bac314a39bee0c819" + "reference": "4fe11c88d3ef8a40e2890d072c0131703ff82e38" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/6a34d51ba8e2eaeca2b0726bac314a39bee0c819", - "reference": "6a34d51ba8e2eaeca2b0726bac314a39bee0c819", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/4fe11c88d3ef8a40e2890d072c0131703ff82e38", + "reference": "4fe11c88d3ef8a40e2890d072c0131703ff82e38", "shasum": "" }, "require": { @@ -832,20 +832,20 @@ "MIT" ], "homepage": "https://github.com/easyengine/site-command", - "time": "2018-11-29T16:02:27+00:00" + "time": "2018-12-04T11:53:25+00:00" }, { "name": "easyengine/site-type-php", - "version": "v1.0.1", + "version": "v1.0.2", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-php.git", - "reference": "c331359762d84cca505e0628f05ec2fc37ac6782" + "reference": "4aadca07d8f0209990cf9bca5a8861dd1377546d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/c331359762d84cca505e0628f05ec2fc37ac6782", - "reference": "c331359762d84cca505e0628f05ec2fc37ac6782", + "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/4aadca07d8f0209990cf9bca5a8861dd1377546d", + "reference": "4aadca07d8f0209990cf9bca5a8861dd1377546d", "shasum": "" }, "require-dev": { @@ -872,20 +872,20 @@ ], "description": "EasyEngine package for PHP site creation.", "homepage": "https://github.com/easyengine/site-type-php", - "time": "2018-11-28T14:06:49+00:00" + "time": "2018-12-04T11:57:11+00:00" }, { "name": "easyengine/site-type-wp", - "version": "v1.0.1", + "version": "v1.0.2", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-wp.git", - "reference": "8aac1a04554d940ccc601e6310183dfa2e692c81" + "reference": "134b1fb9864115ae552c2b1c2b9274b4ec63ecc3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/8aac1a04554d940ccc601e6310183dfa2e692c81", - "reference": "8aac1a04554d940ccc601e6310183dfa2e692c81", + "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/134b1fb9864115ae552c2b1c2b9274b4ec63ecc3", + "reference": "134b1fb9864115ae552c2b1c2b9274b4ec63ecc3", "shasum": "" }, "require-dev": { @@ -924,7 +924,7 @@ ], "description": "EasyEngine site type package for WordPress site creation.", "homepage": "https://github.com/easyengine/site-type-wp", - "time": "2018-11-28T14:04:17+00:00" + "time": "2018-12-04T11:55:41+00:00" }, { "name": "guzzlehttp/guzzle", @@ -1044,32 +1044,33 @@ }, { "name": "guzzlehttp/psr7", - "version": "1.4.2", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" + "reference": "53662d6688033a5eccde987bdd5a4a98ebe2d952" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", - "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/53662d6688033a5eccde987bdd5a4a98ebe2d952", + "reference": "53662d6688033a5eccde987bdd5a4a98ebe2d952", "shasum": "" }, "require": { "php": ">=5.4.0", - "psr/http-message": "~1.0" + "psr/http-message": "~1.0", + "ralouphie/getallheaders": "^2.0.5" }, "provide": { "psr/http-message-implementation": "1.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "1.5-dev" } }, "autoload": { @@ -1099,13 +1100,14 @@ "keywords": [ "http", "message", + "psr-7", "request", "response", "stream", "uri", "url" ], - "time": "2017-03-20T17:10:46+00:00" + "time": "2018-12-03T05:07:51+00:00" }, { "name": "justinrainbow/json-schema", @@ -1527,6 +1529,46 @@ ], "time": "2018-11-20T15:27:04+00:00" }, + { + "name": "ralouphie/getallheaders", + "version": "2.0.5", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/5601c8a83fbba7ef674a7369456d12f1e0d0eafa", + "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "require-dev": { + "phpunit/phpunit": "~3.7.0", + "satooshi/php-coveralls": ">=1.0" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "time": "2016-02-11T07:05:27+00:00" + }, { "name": "rmccue/requests", "version": "v1.7.0", From 242629a4326809e12c1a80f960d53a4a395ba439 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 4 Dec 2018 17:41:28 +0530 Subject: [PATCH 0624/1044] Bump version v4.0.4 Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index c4e41f945..c5106e6d1 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.0.3 +4.0.4 From 4c713b242b562c784beb278413274e143bdde13f Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 4 Dec 2018 17:41:28 +0530 Subject: [PATCH 0625/1044] Bump version v4.0.4 Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- VERSION | 2 +- composer.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/VERSION b/VERSION index c4e41f945..c5106e6d1 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.0.3 +4.0.4 diff --git a/composer.lock b/composer.lock index b5ff2d2b8..594abfe77 100644 --- a/composer.lock +++ b/composer.lock @@ -696,12 +696,12 @@ "source": { "type": "git", "url": "https://github.com/EasyEngine/service-command.git", - "reference": "dd244842a44b1e9bf9758a24c3bc111c3a3f7b41" + "reference": "ad5c869c8eba70e53c7700bcf594252d067ad1b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/dd244842a44b1e9bf9758a24c3bc111c3a3f7b41", - "reference": "dd244842a44b1e9bf9758a24c3bc111c3a3f7b41", + "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/ad5c869c8eba70e53c7700bcf594252d067ad1b5", + "reference": "ad5c869c8eba70e53c7700bcf594252d067ad1b5", "shasum": "" }, "type": "ee-cli-package", From 4568a0baf6227aa7ef3d1ee00baeea392f8e67b0 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 6 Dec 2018 10:52:43 +0530 Subject: [PATCH 0626/1044] Add utility function to download files Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/utils.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/php/utils.php b/php/utils.php index f57ad6776..24bdbf042 100644 --- a/php/utils.php +++ b/php/utils.php @@ -1645,6 +1645,22 @@ function get_config_value( $key, $default = null ) { return empty( $existing_config[ $key ] ) ? $default : $existing_config[ $key ]; } +/** + * Function to download file to a path. + * + * @param string $path Path to download the file on. + * @param string $download_url Url to download the file from. + */ +function download( $path, $download_url ) { + + $headers = array(); + $options = array( + 'timeout' => 1200, // 20 minutes ought to be enough for everybody. + 'filename' => $path, + ); + http_request( 'GET', $download_url, null, $headers, $options ); +} + /** * Random name generator. * From 0b2a3caec656a0a163d6fe7e87a328158bba793d Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 6 Dec 2018 10:53:05 +0530 Subject: [PATCH 0627/1044] Add utility function to extract zip archives Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/utils.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/php/utils.php b/php/utils.php index 24bdbf042..b81710270 100644 --- a/php/utils.php +++ b/php/utils.php @@ -1661,6 +1661,28 @@ function download( $path, $download_url ) { http_request( 'GET', $download_url, null, $headers, $options ); } +/** + * Extract zip files. + * + * @param string $zip_file Path to the zip file. + * @param string $path_to_extract Path where zip needs to be extracted to. + * + * @return bool Success of extraction. + */ +function extract_zip( $zip_file, $path_to_extract ) { + + $zip = new ZipArchive; + $res = $zip->open( $zip_file ); + if ( true === $res ) { + $zip->extractTo( $path_to_extract ); + $zip->close(); + + return true; + } + + return false; +} + /** * Random name generator. * From 8203ea200d4015b8d3389383428b7ac51957144c Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 6 Dec 2018 17:33:40 +0530 Subject: [PATCH 0628/1044] Update due to namespace issue Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/utils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/utils.php b/php/utils.php index b81710270..899ce521f 100644 --- a/php/utils.php +++ b/php/utils.php @@ -1671,7 +1671,7 @@ function download( $path, $download_url ) { */ function extract_zip( $zip_file, $path_to_extract ) { - $zip = new ZipArchive; + $zip = new \ZipArchive; $res = $zip->open( $zip_file ); if ( true === $res ) { $zip->extractTo( $path_to_extract ); From 4202a739adb484359d9b30c7f7fd28eb14fce07b Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 10 Dec 2018 18:21:48 +0530 Subject: [PATCH 0629/1044] Update EasyEngine packages Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- composer.json | 10 +++--- composer.lock | 92 +++++++++++++++++++++++++-------------------------- 2 files changed, 51 insertions(+), 51 deletions(-) diff --git a/composer.json b/composer.json index c0850513b..53da99386 100644 --- a/composer.json +++ b/composer.json @@ -27,16 +27,16 @@ "php": ">=7.0", "composer/composer": "1.7.3", "composer/semver": "1.4.2", - "easyengine/admin-tools-command": "v1.0.2", + "easyengine/admin-tools-command": "v1.0.3", "easyengine/auth-command": "v1.0.1", "easyengine/config-command": "v1.0.1", "easyengine/cron-command": "v1.0.1", "easyengine/log-command": "v1.0.0", "easyengine/mailhog-command": "v1.0.1", - "easyengine/site-command": "v2.2.5", - "easyengine/site-type-wp": "v1.0.2", - "easyengine/site-type-php": "v1.0.2", - "easyengine/service-command": "v1.0.3", + "easyengine/site-command": "v2.2.6", + "easyengine/site-type-wp": "v1.0.3", + "easyengine/site-type-php": "v1.0.3", + "easyengine/service-command": "v1.0.4", "easyengine/shell-command" : "v1.0.0", "justinrainbow/json-schema": "5.2.7", "monolog/monolog": "1.24.0", diff --git a/composer.lock b/composer.lock index 594abfe77..cf5cc5dd4 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": "eb75ca7c2de58a1c1ddd96abc234a1e1", + "content-hash": "b241bc13d1636220cc0cf26ab632e388", "packages": [ { "name": "acmephp/core", @@ -437,16 +437,16 @@ }, { "name": "easyengine/admin-tools-command", - "version": "v1.0.2", + "version": "v1.0.3", "source": { "type": "git", "url": "https://github.com/EasyEngine/admin-tools-command.git", - "reference": "53617712ea658da31badc970d55802fef6c92cd8" + "reference": "70dd7915977ed96adefd16e6c78512f637c137b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/admin-tools-command/zipball/53617712ea658da31badc970d55802fef6c92cd8", - "reference": "53617712ea658da31badc970d55802fef6c92cd8", + "url": "https://api.github.com/repos/EasyEngine/admin-tools-command/zipball/70dd7915977ed96adefd16e6c78512f637c137b4", + "reference": "70dd7915977ed96adefd16e6c78512f637c137b4", "shasum": "" }, "type": "ee-cli-package", @@ -476,7 +476,7 @@ ], "description": "Command to manage admin tools for php based sites.", "homepage": "https://github.com/easyengine/amdin-tools", - "time": "2018-12-04T11:50:13+00:00" + "time": "2018-12-10T12:38:34+00:00" }, { "name": "easyengine/auth-command", @@ -692,16 +692,16 @@ }, { "name": "easyengine/service-command", - "version": "v1.0.3", + "version": "v1.0.4", "source": { "type": "git", "url": "https://github.com/EasyEngine/service-command.git", - "reference": "ad5c869c8eba70e53c7700bcf594252d067ad1b5" + "reference": "4011086be464369b0bc65c407df7972ccdce2ba3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/ad5c869c8eba70e53c7700bcf594252d067ad1b5", - "reference": "ad5c869c8eba70e53c7700bcf594252d067ad1b5", + "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/4011086be464369b0bc65c407df7972ccdce2ba3", + "reference": "4011086be464369b0bc65c407df7972ccdce2ba3", "shasum": "" }, "type": "ee-cli-package", @@ -733,7 +733,7 @@ ], "description": "Command to manager global containers/services in EasyEngine", "homepage": "https://github.com/easyengine/service-command", - "time": "2018-12-04T12:00:02+00:00" + "time": "2018-12-10T12:44:39+00:00" }, { "name": "easyengine/shell-command", @@ -777,16 +777,16 @@ }, { "name": "easyengine/site-command", - "version": "v2.2.5", + "version": "v2.2.6", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "4fe11c88d3ef8a40e2890d072c0131703ff82e38" + "reference": "1915ff5b75d3a5bc19daf332e59c9f7cc431d09b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/4fe11c88d3ef8a40e2890d072c0131703ff82e38", - "reference": "4fe11c88d3ef8a40e2890d072c0131703ff82e38", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/1915ff5b75d3a5bc19daf332e59c9f7cc431d09b", + "reference": "1915ff5b75d3a5bc19daf332e59c9f7cc431d09b", "shasum": "" }, "require": { @@ -832,20 +832,20 @@ "MIT" ], "homepage": "https://github.com/easyengine/site-command", - "time": "2018-12-04T11:53:25+00:00" + "time": "2018-12-10T12:41:42+00:00" }, { "name": "easyengine/site-type-php", - "version": "v1.0.2", + "version": "v1.0.3", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-php.git", - "reference": "4aadca07d8f0209990cf9bca5a8861dd1377546d" + "reference": "ed5dda08a4efec76d2834328f040847f5a686585" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/4aadca07d8f0209990cf9bca5a8861dd1377546d", - "reference": "4aadca07d8f0209990cf9bca5a8861dd1377546d", + "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/ed5dda08a4efec76d2834328f040847f5a686585", + "reference": "ed5dda08a4efec76d2834328f040847f5a686585", "shasum": "" }, "require-dev": { @@ -872,20 +872,20 @@ ], "description": "EasyEngine package for PHP site creation.", "homepage": "https://github.com/easyengine/site-type-php", - "time": "2018-12-04T11:57:11+00:00" + "time": "2018-12-10T12:43:46+00:00" }, { "name": "easyengine/site-type-wp", - "version": "v1.0.2", + "version": "v1.0.3", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-wp.git", - "reference": "134b1fb9864115ae552c2b1c2b9274b4ec63ecc3" + "reference": "1e4462cd9b08937a9d70f9935e7f3b5cf3a5a196" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/134b1fb9864115ae552c2b1c2b9274b4ec63ecc3", - "reference": "134b1fb9864115ae552c2b1c2b9274b4ec63ecc3", + "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/1e4462cd9b08937a9d70f9935e7f3b5cf3a5a196", + "reference": "1e4462cd9b08937a9d70f9935e7f3b5cf3a5a196", "shasum": "" }, "require-dev": { @@ -924,7 +924,7 @@ ], "description": "EasyEngine site type package for WordPress site creation.", "homepage": "https://github.com/easyengine/site-type-wp", - "time": "2018-12-04T11:55:41+00:00" + "time": "2018-12-10T12:43:14+00:00" }, { "name": "guzzlehttp/guzzle", @@ -1044,16 +1044,16 @@ }, { "name": "guzzlehttp/psr7", - "version": "1.5.0", + "version": "1.5.2", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "53662d6688033a5eccde987bdd5a4a98ebe2d952" + "reference": "9f83dded91781a01c63574e387eaa769be769115" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/53662d6688033a5eccde987bdd5a4a98ebe2d952", - "reference": "53662d6688033a5eccde987bdd5a4a98ebe2d952", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/9f83dded91781a01c63574e387eaa769be769115", + "reference": "9f83dded91781a01c63574e387eaa769be769115", "shasum": "" }, "require": { @@ -1107,7 +1107,7 @@ "uri", "url" ], - "time": "2018-12-03T05:07:51+00:00" + "time": "2018-12-04T20:46:45+00:00" }, { "name": "justinrainbow/json-schema", @@ -2301,16 +2301,16 @@ }, { "name": "symfony/serializer", - "version": "v3.4.19", + "version": "v3.4.20", "source": { "type": "git", "url": "https://github.com/symfony/serializer.git", - "reference": "3808566ba899afe9aa66c3d5d726c22230d5037d" + "reference": "40b326ca34c113da5d626e87fb5d0627b8324098" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/serializer/zipball/3808566ba899afe9aa66c3d5d726c22230d5037d", - "reference": "3808566ba899afe9aa66c3d5d726c22230d5037d", + "url": "https://api.github.com/repos/symfony/serializer/zipball/40b326ca34c113da5d626e87fb5d0627b8324098", + "reference": "40b326ca34c113da5d626e87fb5d0627b8324098", "shasum": "" }, "require": { @@ -2376,7 +2376,7 @@ ], "description": "Symfony Serializer Component", "homepage": "https://symfony.com", - "time": "2018-11-11T19:48:54+00:00" + "time": "2018-12-02T13:20:19+00:00" }, { "name": "symfony/translation", @@ -3361,12 +3361,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "6acf968142215f1614f5909aa006b2bf1ec45cb1" + "reference": "46efa7cf127bfe6289e05b546db0442598f47359" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/6acf968142215f1614f5909aa006b2bf1ec45cb1", - "reference": "6acf968142215f1614f5909aa006b2bf1ec45cb1", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/46efa7cf127bfe6289e05b546db0442598f47359", + "reference": "46efa7cf127bfe6289e05b546db0442598f47359", "shasum": "" }, "conflict": { @@ -3475,7 +3475,7 @@ "sylius/admin-bundle": ">=1,<1.0.17|>=1.1,<1.1.9|>=1.2,<1.2.2", "sylius/sylius": ">=1,<1.0.17|>=1.1,<1.1.9|>=1.2,<1.2.2", "symfony/dependency-injection": ">=2,<2.0.17", - "symfony/form": ">=2.3,<2.3.35|>=2.4,<2.6.12|>=2.7,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", + "symfony/form": ">=2.3,<2.3.35|>=2.4,<2.6.12|>=2.7,<2.7.50|>=2.8,<2.8.49|>=3,<3.4.20|>=4,<4.0.15|>=4.1,<4.1.9|>=4.2,<4.2.1", "symfony/framework-bundle": ">=2,<2.3.18|>=2.4,<2.4.8|>=2.5,<2.5.2", "symfony/http-foundation": ">=2,<2.7.49|>=2.8,<2.8.44|>=3,<3.3.18|>=3.4,<3.4.14|>=4,<4.0.14|>=4.1,<4.1.3", "symfony/http-kernel": ">=2,<2.3.29|>=2.4,<2.5.12|>=2.6,<2.6.8", @@ -3483,21 +3483,21 @@ "symfony/polyfill": ">=1,<1.10", "symfony/polyfill-php55": ">=1,<1.10", "symfony/routing": ">=2,<2.0.19", - "symfony/security": ">=2,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", + "symfony/security": ">=2,<2.7.50|>=2.8,<2.8.49|>=3,<3.4.19|>=4,<4.0.15|>=4.1,<4.1.9|>=4.2,<4.2.1", "symfony/security-bundle": ">=2,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", "symfony/security-core": ">=2.4,<2.6.13|>=2.7,<2.7.9|>=2.7.30,<2.7.32|>=2.8,<2.8.37|>=3,<3.3.17|>=3.4,<3.4.7|>=4,<4.0.7", "symfony/security-csrf": ">=2.4,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", "symfony/security-guard": ">=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", - "symfony/security-http": ">=2.3,<2.3.41|>=2.4,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", + "symfony/security-http": ">=2.3,<2.3.41|>=2.4,<2.7.50|>=2.8,<2.8.49|>=3,<3.4.20|>=4,<4.0.15|>=4.1,<4.1.9|>=4.2,<4.2.1", "symfony/serializer": ">=2,<2.0.11", - "symfony/symfony": ">=2,<2.7.49|>=2.8,<2.8.44|>=3,<3.3.18|>=3.4,<3.4.14|>=4,<4.0.14|>=4.1,<4.1.3", + "symfony/symfony": ">=2,<2.7.50|>=2.8,<2.8.49|>=3,<3.4.20|>=4,<4.0.15|>=4.1,<4.1.9|>=4.2,<4.2.1", "symfony/translation": ">=2,<2.0.17", "symfony/validator": ">=2,<2.0.24|>=2.1,<2.1.12|>=2.2,<2.2.5|>=2.3,<2.3.3", "symfony/web-profiler-bundle": ">=2,<2.3.19|>=2.4,<2.4.9|>=2.5,<2.5.4", "symfony/yaml": ">=2,<2.0.22|>=2.1,<2.1.7", "tecnickcom/tcpdf": "<6.2.22", "thelia/backoffice-default-template": ">=2.1,<2.1.2", - "thelia/thelia": ">=2.1,<2.1.2|>=2.1.0-beta1,<2.1.3", + "thelia/thelia": ">=2.1.0-beta1,<2.1.3|>=2.1,<2.1.2", "theonedemon/phpwhois": "<=4.2.5", "titon/framework": ">=0,<9.9.99", "truckersmp/phpwhois": "<=4.3.1", @@ -3554,7 +3554,7 @@ } ], "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", - "time": "2018-11-27T12:50:30+00:00" + "time": "2018-12-09T09:52:28+00:00" }, { "name": "squizlabs/php_codesniffer", @@ -3609,7 +3609,7 @@ }, { "name": "symfony/class-loader", - "version": "v3.4.19", + "version": "v3.4.20", "source": { "type": "git", "url": "https://github.com/symfony/class-loader.git", From b0ff4ea4e6a6c0eca2a2a0c670458a8b12d1b62d Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 10 Dec 2018 18:23:43 +0530 Subject: [PATCH 0630/1044] Bump version v4.0.5 Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index c5106e6d1..7636e7565 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.0.4 +4.0.5 From f5797bdacb91d51de8d7444ea4f3bbe03c53b26c Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Wed, 12 Dec 2018 14:35:01 +0530 Subject: [PATCH 0631/1044] Add exception for site cmd-dump Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Runner.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 3a83acfea..e0d638fdd 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -62,10 +62,13 @@ private function init_ee() { mkdir( $db_dir ); } - if ( - ! empty( $this->arguments ) && - ( ! in_array( $this->arguments[0], [ 'cli', 'config', 'help' ], true ) ) - ) { + $check_requirements = false; + if ( ! empty( $this->arguments ) ) { + $check_requirements = in_array( $this->arguments[0], [ 'cli', 'config', 'help' ], true ) ? false : true; + $check_requirements = ( [ 'site', 'cmd-dump' ] === $this->arguments ) ? false : $check_requirements; + } + + if ( $check_requirements ) { $this->check_requirements(); $this->maybe_trigger_migration(); } From bb5c0f3b3bd7242cba0dd5ec17efb50f411e637e Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Wed, 12 Dec 2018 19:44:10 +0530 Subject: [PATCH 0632/1044] Move redirection config to site-command Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- templates/redirect.conf.mustache | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 templates/redirect.conf.mustache diff --git a/templates/redirect.conf.mustache b/templates/redirect.conf.mustache deleted file mode 100644 index 933bed417..000000000 --- a/templates/redirect.conf.mustache +++ /dev/null @@ -1,20 +0,0 @@ -server { - listen 80; - server_name {{server_name}}; - return 301 {{#ssl}}https://{{/ssl}}{{^ssl}}http://{{/ssl}}{{site_name}}$request_uri; -} -{{#ssl}} -server { - listen 443; - ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; - ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:!DSS'; - ssl_prefer_server_ciphers on; - ssl_session_timeout 5m; - ssl_session_cache shared:SSL:50m; - ssl_session_tickets off; - ssl_certificate /etc/nginx/certs/{{cert_site_name}}.crt; - ssl_certificate_key /etc/nginx/certs/{{cert_site_name}}.key; - server_name {{server_name}}; - return 301 https://{{site_name}}$request_uri; -} -{{/ssl}} From 353cb3b4199fe53d6d319299822a6736256c44a3 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 13 Dec 2018 11:54:40 +0530 Subject: [PATCH 0633/1044] Update to nginx-proxy with default Mozilla-Modern profile Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- img-versions.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/img-versions.json b/img-versions.json index 3d9ee513f..ae9219f68 100644 --- a/img-versions.json +++ b/img-versions.json @@ -2,7 +2,7 @@ "easyengine/cron": "v4.0.0", "easyengine/mailhog": "v4.0.0", "easyengine/mariadb": "v4.0.0", - "easyengine/nginx-proxy": "v4.0.0", + "easyengine/nginx-proxy": "v4.0.1", "easyengine/nginx": "v4.0.0", "easyengine/php": "v4.0.0", "easyengine/php5.6": "v4.0.0", From fa58401fec35bc7c3b30fc11025a31d0163ef796 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 13 Dec 2018 12:52:44 +0530 Subject: [PATCH 0634/1044] Disable cli update for macOS Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/commands/src/CLI_Command.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/php/commands/src/CLI_Command.php b/php/commands/src/CLI_Command.php index 6ab58af42..16e7c5844 100644 --- a/php/commands/src/CLI_Command.php +++ b/php/commands/src/CLI_Command.php @@ -260,6 +260,9 @@ public function update( $_, $assoc_args ) { if ( ! Utils\inside_phar() ) { EE::error( 'You can only self-update Phar files.' ); } + if ( IS_DARWIN ) { + EE::error( 'Please use `brew upgrade easyengine` to update EasyEngine on macOS.' ); + } $old_phar = realpath( $_SERVER['argv'][0] ); if ( ! is_writable( $old_phar ) ) { EE::error( sprintf( '%s is not writable by current user.', $old_phar ) ); From 8f67adf9953434f7337f8867a9d69b4932051176 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 13 Dec 2018 13:31:06 +0530 Subject: [PATCH 0635/1044] Update EasyEngine packages Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- composer.json | 6 +++--- composer.lock | 50 +++++++++++++++++++++++++------------------------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/composer.json b/composer.json index 53da99386..aeaaf075b 100644 --- a/composer.json +++ b/composer.json @@ -33,9 +33,9 @@ "easyengine/cron-command": "v1.0.1", "easyengine/log-command": "v1.0.0", "easyengine/mailhog-command": "v1.0.1", - "easyengine/site-command": "v2.2.6", - "easyengine/site-type-wp": "v1.0.3", - "easyengine/site-type-php": "v1.0.3", + "easyengine/site-command": "v2.2.7", + "easyengine/site-type-wp": "v1.0.4", + "easyengine/site-type-php": "v1.0.4", "easyengine/service-command": "v1.0.4", "easyengine/shell-command" : "v1.0.0", "justinrainbow/json-schema": "5.2.7", diff --git a/composer.lock b/composer.lock index cf5cc5dd4..f21fbb526 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": "b241bc13d1636220cc0cf26ab632e388", + "content-hash": "e87584ba47911079e092d6034b4d1fd6", "packages": [ { "name": "acmephp/core", @@ -777,16 +777,16 @@ }, { "name": "easyengine/site-command", - "version": "v2.2.6", + "version": "v2.2.7", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "1915ff5b75d3a5bc19daf332e59c9f7cc431d09b" + "reference": "ea22534236079e6612915614da397f5411c72c6e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/1915ff5b75d3a5bc19daf332e59c9f7cc431d09b", - "reference": "1915ff5b75d3a5bc19daf332e59c9f7cc431d09b", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/ea22534236079e6612915614da397f5411c72c6e", + "reference": "ea22534236079e6612915614da397f5411c72c6e", "shasum": "" }, "require": { @@ -832,20 +832,20 @@ "MIT" ], "homepage": "https://github.com/easyengine/site-command", - "time": "2018-12-10T12:41:42+00:00" + "time": "2018-12-13T07:45:33+00:00" }, { "name": "easyengine/site-type-php", - "version": "v1.0.3", + "version": "v1.0.4", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-php.git", - "reference": "ed5dda08a4efec76d2834328f040847f5a686585" + "reference": "afc4880d9e85409477afa9d086f7d0a2c91f9dd1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/ed5dda08a4efec76d2834328f040847f5a686585", - "reference": "ed5dda08a4efec76d2834328f040847f5a686585", + "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/afc4880d9e85409477afa9d086f7d0a2c91f9dd1", + "reference": "afc4880d9e85409477afa9d086f7d0a2c91f9dd1", "shasum": "" }, "require-dev": { @@ -872,20 +872,20 @@ ], "description": "EasyEngine package for PHP site creation.", "homepage": "https://github.com/easyengine/site-type-php", - "time": "2018-12-10T12:43:46+00:00" + "time": "2018-12-13T07:49:09+00:00" }, { "name": "easyengine/site-type-wp", - "version": "v1.0.3", + "version": "v1.0.4", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-wp.git", - "reference": "1e4462cd9b08937a9d70f9935e7f3b5cf3a5a196" + "reference": "40478d5f766470d3503fcc2fdbc8fc7f19cadecf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/1e4462cd9b08937a9d70f9935e7f3b5cf3a5a196", - "reference": "1e4462cd9b08937a9d70f9935e7f3b5cf3a5a196", + "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/40478d5f766470d3503fcc2fdbc8fc7f19cadecf", + "reference": "40478d5f766470d3503fcc2fdbc8fc7f19cadecf", "shasum": "" }, "require-dev": { @@ -924,7 +924,7 @@ ], "description": "EasyEngine site type package for WordPress site creation.", "homepage": "https://github.com/easyengine/site-type-wp", - "time": "2018-12-10T12:43:14+00:00" + "time": "2018-12-13T07:47:30+00:00" }, { "name": "guzzlehttp/guzzle", @@ -3361,12 +3361,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "46efa7cf127bfe6289e05b546db0442598f47359" + "reference": "9fd088ff8176ceb154c7d3cc0d1241af80e5c93e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/46efa7cf127bfe6289e05b546db0442598f47359", - "reference": "46efa7cf127bfe6289e05b546db0442598f47359", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/9fd088ff8176ceb154c7d3cc0d1241af80e5c93e", + "reference": "9fd088ff8176ceb154c7d3cc0d1241af80e5c93e", "shasum": "" }, "conflict": { @@ -3430,9 +3430,9 @@ "la-haute-societe/tcpdf": "<6.2.22", "laravel/framework": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.42|>=5.6,<5.6.30", "laravel/socialite": ">=1,<1.0.99|>=2,<2.0.10", - "magento/magento1ce": "<1.9.3.9", - "magento/magento1ee": ">=1.9,<1.14.3.2", - "magento/product-community-edition": ">=2,<2.2.6", + "magento/magento1ce": "<1.9.4", + "magento/magento1ee": ">=1.9,<1.14.4", + "magento/product-community-edition": ">=2,<2.2.7", "monolog/monolog": ">=1.8,<1.12", "namshi/jose": "<2.2", "onelogin/php-saml": "<2.10.4", @@ -3502,8 +3502,8 @@ "titon/framework": ">=0,<9.9.99", "truckersmp/phpwhois": "<=4.3.1", "twig/twig": "<1.20", - "typo3/cms": ">=6.2,<6.2.30|>=7,<7.6.30|>=8,<8.7.17|>=9,<9.3.2", - "typo3/cms-core": ">=8,<8.7.17|>=9,<9.3.2", + "typo3/cms": ">=6.2,<6.2.30|>=7,<7.6.32|>=8,<8.7.21|>=9,<9.5.2", + "typo3/cms-core": ">=8,<8.7.21|>=9,<9.5.2", "typo3/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.10|>=3.1,<3.1.7|>=3.2,<3.2.7|>=3.3,<3.3.5", "typo3/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4", "wallabag/tcpdf": "<6.2.22", @@ -3554,7 +3554,7 @@ } ], "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", - "time": "2018-12-09T09:52:28+00:00" + "time": "2018-12-11T16:56:18+00:00" }, { "name": "squizlabs/php_codesniffer", From 9301df0eb5553d008d55594f3bfddd5fa82f75c9 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 13 Dec 2018 13:31:45 +0530 Subject: [PATCH 0636/1044] Bump version v4.0.6 Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 7636e7565..d13e837c8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.0.5 +4.0.6 From 46279e034d2628125bfeef51d9bd60cfc22d559b Mon Sep 17 00:00:00 2001 From: sagarnasit <sagarnasit@gmail.com> Date: Wed, 19 Dec 2018 12:14:56 +0530 Subject: [PATCH 0637/1044] Change container name for global-redis --- php/EE/Migration/Containers.php | 3 ++- php/EE/Migration/GlobalContainers.php | 5 +++-- php/init-ee.php | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index cf881acc1..75f91369b 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -175,7 +175,8 @@ private static function migrate_global_containers( $updated_images ) { $all_global_images = GlobalContainers::get_all_global_images_with_service_name(); foreach ( $updated_global_images as $image_name ) { $global_container_name = $all_global_images[ $image_name ]; - $global_service_name = ltrim( $global_container_name, 'ee-' ); + $global_service_name = ltrim( $global_container_name, 'services_' ); + $global_service_name = rtrim( $global_service_name, '_1' ); self::$rsp->add_step( "upgrade-$global_container_name-container", "EE\Migration\GlobalContainers::global_service_up", diff --git a/php/EE/Migration/GlobalContainers.php b/php/EE/Migration/GlobalContainers.php index 12f80ab89..38b40ca3a 100644 --- a/php/EE/Migration/GlobalContainers.php +++ b/php/EE/Migration/GlobalContainers.php @@ -43,7 +43,7 @@ public static function revert_global_containers( $source_path, $dest_path, $upda $all_global_images = self::get_all_global_images_with_service_name(); foreach ( $updated_images as $image_name ) { $global_container_name = $all_global_images[ $image_name ]; - $services_to_regenerate .= str_replace( '-', '_', ltrim( $global_container_name, 'ee-' ) ) . ' '; + $services_to_regenerate .= str_replace( '-', '_', ltrim( rtrim( $global_container_name, '_1' ), 'services_' ) ) . ' '; } if ( empty( trim( $services_to_regenerate ) ) ) { return; @@ -74,7 +74,8 @@ public static function down_global_containers( $updated_images ) { foreach ( $updated_images as $image_name ) { $global_container_name = $all_global_images[ $image_name ]; - $global_service_name = ltrim( $global_container_name, 'ee-' ); + $global_service_name = ltrim( $global_container_name, 'services_' ); + $global_service_name = rtrim( $global_service_name, '_1' ); EE::debug( "Removing $global_container_name" ); if ( false !== \EE_DOCKER::container_status( $global_container_name ) ) { diff --git a/php/init-ee.php b/php/init-ee.php index b54bee8fe..dae0ececc 100644 --- a/php/init-ee.php +++ b/php/init-ee.php @@ -14,7 +14,7 @@ define( 'EE_BACKUP_DIR', EE_ROOT_DIR . '/.backup' ); define( 'EE_SERVICE_DIR', EE_ROOT_DIR . '/services' ); -define( 'EE_PROXY_TYPE', 'ee-global-nginx-proxy' ); +define( 'EE_PROXY_TYPE', 'services_global-nginx-proxy_1' ); if ( file_exists( EE_ROOT . '/vendor/autoload.php' ) ) { define( 'EE_VENDOR_DIR', EE_ROOT . '/vendor' ); From 03c53ee31c179dfee6a4cb1f6287671edf9f13e6 Mon Sep 17 00:00:00 2001 From: sagarnasit <sagarnasit@gmail.com> Date: Wed, 19 Dec 2018 20:12:17 +0530 Subject: [PATCH 0638/1044] Add migration step in glbal container migration for zero down time --- php/EE/Migration/Containers.php | 22 ++++++++++++++++++++++ php/EE/Migration/GlobalContainers.php | 24 ++++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index 75f91369b..d7faf02da 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -156,6 +156,17 @@ private static function migrate_global_containers( $updated_images ) { [ $global_compose_file_backup_path, $global_compose_file_path, $updated_global_images ] ); + /** + * Create support containers. + */ + self::$rsp->add_step( + 'create-support-global-containers', + 'EE\Migration\GlobalContainers::create_support_container', + 'EE\Migration\GlobalContainers::remove_support_container', + null, + null + ); + self::$rsp->add_step( 'stop-global-containers', 'EE\Migration\GlobalContainers::down_global_containers', @@ -185,6 +196,17 @@ private static function migrate_global_containers( $updated_images ) { [ $global_service_name ] ); } + + /** + * Remove support containers. + */ + self::$rsp->add_step( + 'remove-support-global-containers', + 'EE\Migration\GlobalContainers::remove_support_container', + 'EE\Migration\GlobalContainers::create_support_container', + null, + null + ); } /** diff --git a/php/EE/Migration/GlobalContainers.php b/php/EE/Migration/GlobalContainers.php index 38b40ca3a..d1c263d80 100644 --- a/php/EE/Migration/GlobalContainers.php +++ b/php/EE/Migration/GlobalContainers.php @@ -130,4 +130,28 @@ public static function get_all_global_images_with_service_name() { // 'easyengine/cron' => EE_CRON_SCHEDULER, //TODO: Add it to global docker-compose. ]; } + + /** + * Create support containers for global-db and global-redis service. + */ + public static function create_support_container() { + chdir( EE_SERVICE_DIR ); + $command = 'docker-compose --project-name=ee up -d global-db global-redis'; + + if ( ! EE::exec( $command ) ) { + throw new \Exception( 'Unable to create support container.' ); + } + } + + /** + * Remove support containers for global-db and global-redis service. + */ + public static function remove_support_container() { + chdir( EE_SERVICE_DIR ); + $command = 'docker-compose --project-name=ee down'; + + if ( ! EE::exec( $command ) ) { + throw new \Exception( 'Unable to remove support container.' ); + } + } } From 73f89291a5021783b5d94cf62c054cf2876a8ea8 Mon Sep 17 00:00:00 2001 From: sagarnasit <sagarnasit@gmail.com> Date: Thu, 20 Dec 2018 14:36:55 +0530 Subject: [PATCH 0639/1044] Add migration step in site container migration for zero down time --- php/EE/Migration/Containers.php | 47 +++++++++---- php/EE/Migration/GlobalContainers.php | 4 +- php/EE/Migration/SiteContainers.php | 98 +++++++++++++++++++++++---- 3 files changed, 121 insertions(+), 28 deletions(-) diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index d7faf02da..f44967b66 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -161,8 +161,8 @@ private static function migrate_global_containers( $updated_images ) { */ self::$rsp->add_step( 'create-support-global-containers', - 'EE\Migration\GlobalContainers::create_support_container', - 'EE\Migration\GlobalContainers::remove_support_container', + 'EE\Migration\GlobalContainers::enable_support_containers', + 'EE\Migration\GlobalContainers::disable_support_containers', null, null ); @@ -202,8 +202,8 @@ private static function migrate_global_containers( $updated_images ) { */ self::$rsp->add_step( 'remove-support-global-containers', - 'EE\Migration\GlobalContainers::remove_support_container', - 'EE\Migration\GlobalContainers::create_support_container', + 'EE\Migration\GlobalContainers::disable_support_containers', + 'EE\Migration\GlobalContainers::enable_support_containers', null, null ); @@ -233,12 +233,24 @@ public static function migrate_site_containers( $updated_images ) { $ee_site_object = SiteContainers::get_site_object( $site['site_type'] ); if ( $site['site_enabled'] ) { + + /** + * Enable support containers. + */ + self::$rsp->add_step( + sprintf( 'enable-support-containers-%s', $site['site_url'] ), + 'EE\Migration\SiteContainers::enable_support_containers', + 'EE\Migration\SiteContainers::disable_support_containers', + [ $site['site_url'], $site['site_fs_path'] ], + [ $site['site_url'], $site['site_fs_path'] ] + ); + self::$rsp->add_step( "disable-${site['site_url']}-containers", - 'EE\Migration\SiteContainers::disable_site', - 'EE\Migration\SiteContainers::enable_site', - [ $site, $ee_site_object ], - [ $site, $ee_site_object ] + 'EE\Migration\SiteContainers::disable_default_containers', + 'EE\Migration\SiteContainers::enable_default_containers', + [ $site ], + [ $site ] ); } @@ -261,10 +273,21 @@ public static function migrate_site_containers( $updated_images ) { if ( $site['site_enabled'] ) { self::$rsp->add_step( "upgrade-${site['site_url']}-containers", - 'EE\Migration\SiteContainers::enable_site', - 'EE\Migration\SiteContainers::enable_site', - [ $site, $ee_site_object ], - [ $site, $ee_site_object ] + 'EE\Migration\SiteContainers::enable_default_containers', + 'EE\Migration\SiteContainers::enable_default_containers', + [ $site ], + [ $site ] + ); + + /** + * Disable support containers. + */ + self::$rsp->add_step( + sprintf( 'disable-support-containers-%s', $site['site_url'] ), + 'EE\Migration\SiteContainers::disable_support_containers', + 'EE\Migration\SiteContainers::enable_support_containers', + [ $site['site_url'], $site['site_fs_path'] ], + [ $site['site_url'], $site['site_fs_path'] ] ); } } diff --git a/php/EE/Migration/GlobalContainers.php b/php/EE/Migration/GlobalContainers.php index d1c263d80..4ba40284c 100644 --- a/php/EE/Migration/GlobalContainers.php +++ b/php/EE/Migration/GlobalContainers.php @@ -134,7 +134,7 @@ public static function get_all_global_images_with_service_name() { /** * Create support containers for global-db and global-redis service. */ - public static function create_support_container() { + public static function enable_support_containers() { chdir( EE_SERVICE_DIR ); $command = 'docker-compose --project-name=ee up -d global-db global-redis'; @@ -146,7 +146,7 @@ public static function create_support_container() { /** * Remove support containers for global-db and global-redis service. */ - public static function remove_support_container() { + public static function disable_support_containers() { chdir( EE_SERVICE_DIR ); $command = 'docker-compose --project-name=ee down'; diff --git a/php/EE/Migration/SiteContainers.php b/php/EE/Migration/SiteContainers.php index 4ae668c2e..fef11437a 100644 --- a/php/EE/Migration/SiteContainers.php +++ b/php/EE/Migration/SiteContainers.php @@ -104,30 +104,42 @@ public static function generate_site_docker_compose_file( $site_info, $site_obje * Enable site. * * @param array $site_info array of site information. - * @param object $site_object object of site-type( HTML, PHP, WordPress ). * * @throws \Exception */ - public static function enable_site( $site_info, $site_object ) { - EE::debug( "Start enabling ${site_info['site_url']}" ); - try { - $site_object->enable( [ $site_info['site_url'] ], [ 'force' => true ], false ); - } catch ( \Exception $e ) { - throw new \Exception( $e->getMessage() ); + public static function enable_default_containers( $site_info ) { + EE::debug( "Start enabling default containers of ${site_info['site_url']}" ); + + if ( ! chdir( $site_info['site_fs_path'] ) ) { + throw new \Exception( sprintf( '%s path does not exist', $site_info['site_fs_path'] ) ); + } + + if ( ! EE::exec( 'docker-compose up -d' ) ) { + throw new \Exception( sprintf( 'Something went wrong on enable site %s', $site_info['site_url'] ) ); } - EE::debug( "Complete enabling ${site_info['site_url']}" ); + + EE::debug( "Complete enabling default containers of ${site_info['site_url']}" ); } /** * Disable site. * - * @param array $site_info array of site information. - * @param object $site_object object of site-type( HTML, PHP, Wordpress ). + * @param array $site_info array of site information. + * + * @throws \Exception */ - public static function disable_site( $site_info, $site_object ) { - EE::debug( "Start disabling ${site_info['site_url']}" ); - $site_object->disable( [ $site_info['site_url'] ], [] ); - EE::debug( "Complete disabling ${site_info['site_url']}" ); + public static function disable_default_containers( $site_info ) { + EE::debug( "Start disabling default containers of ${site_info['site_url']}" ); + + if ( ! chdir( $site_info['site_fs_path'] ) ) { + throw new \Exception( sprintf( '%s path does not exist', $site_info['site_fs_path'] ) ); + } + + if ( ! EE::exec( 'docker-compose stop && docker-compose rm -f' ) ) { + throw new \Exception( sprintf( 'Something went wrong on disable site %s', $site_info['site_url'] ) ); + } + + EE::debug( "Complete disabling default containers of ${site_info['site_url']}" ); } /** @@ -219,4 +231,62 @@ public static function docker_compose_pull( $site_fs_path ) { throw new \Exception( 'Could pull given images.' ); } } + + /** + * Enable support containers for sites. + * + * @param $site_url string Site URL. + * @param $site_fs_path string File system path of site. + * + * @throws \Exception + */ + public static function enable_support_containers( $site_url, $site_fs_path ) { + EE::debug( sprintf( 'Start enabling containers for %s', $site_url ) ); + + $site_name = str_replace( '.', '', $site_url ); + $project_name = sprintf( 'update-ee-%s', $site_name ); + $fs = new Filesystem(); + + if ( $fs->exists( $site_fs_path ) ) { + chdir( $site_fs_path ); + } else { + throw new \Exception( sprintf( '%s does not exist.', $site_fs_path ) ); + } + + $command = sprintf( 'docker-compose --project-name=%s up -d', $project_name ); + if ( ! EE::exec( $command ) ) { + throw new \Exception( sprintf( 'Unable to create support container for %s', $site_url ) ); + } + + EE::debug( sprintf( 'Complete enabling support containers for %s', $site_url ) ); + } + + /** + * Disable support containers for sites. + * + * @param $site_url string Site URL. + * @param $site_fs_path string File system path of site. + * + * @throws \Exception + */ + public static function disable_support_containers( $site_url, $site_fs_path ) { + EE::debug( sprintf( 'Start disabling support containers for %s', $site_url ) ); + + $site_name = str_replace( '.', '', $site_url ); + $project_name = sprintf( 'update-ee-%s', $site_name ); + $fs = new Filesystem(); + + if ( $fs->exists( $site_fs_path ) ) { + chdir( $site_fs_path ); + } else { + throw new \Exception( sprintf( '%s does not exist.', $site_fs_path ) ); + } + + $command = sprintf( 'docker-compose --project-name=%1$s stop && docker-compose --project-name=%1$s rm -f', $project_name ); + if ( ! EE::exec( $command ) ) { + throw new \Exception( sprintf( 'Unable to remove support container for %s', $site_url ) ); + } + + EE::debug( sprintf( 'Complete disabling support containers for %s', $site_url ) ); + } } From 2c65655910695588529e3dfbcfd3b26b161376ca Mon Sep 17 00:00:00 2001 From: sagarnasit <sagarnasit@gmail.com> Date: Thu, 20 Dec 2018 16:53:05 +0530 Subject: [PATCH 0640/1044] Use symphoney file system --- php/EE/Migration/GlobalContainers.php | 1 + 1 file changed, 1 insertion(+) diff --git a/php/EE/Migration/GlobalContainers.php b/php/EE/Migration/GlobalContainers.php index 4ba40284c..86a7d975e 100644 --- a/php/EE/Migration/GlobalContainers.php +++ b/php/EE/Migration/GlobalContainers.php @@ -3,6 +3,7 @@ namespace EE\Migration; use EE; +use Symfony\Component\Filesystem\Filesystem; /** * Upgrade existing global containers to new docker-image From b322b1ff1d9d5d90c2060686b59ef79ba4137b05 Mon Sep 17 00:00:00 2001 From: sagarnasit <sagarnasit@gmail.com> Date: Thu, 20 Dec 2018 21:18:50 +0530 Subject: [PATCH 0641/1044] Migration code refactor --- php/EE/Migration/GlobalContainers.php | 14 +++++++++----- php/EE/Migration/SiteContainers.php | 10 ++-------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/php/EE/Migration/GlobalContainers.php b/php/EE/Migration/GlobalContainers.php index 86a7d975e..498055638 100644 --- a/php/EE/Migration/GlobalContainers.php +++ b/php/EE/Migration/GlobalContainers.php @@ -44,7 +44,7 @@ public static function revert_global_containers( $source_path, $dest_path, $upda $all_global_images = self::get_all_global_images_with_service_name(); foreach ( $updated_images as $image_name ) { $global_container_name = $all_global_images[ $image_name ]; - $services_to_regenerate .= str_replace( '-', '_', ltrim( rtrim( $global_container_name, '_1' ), 'services_' ) ) . ' '; + $services_to_regenerate .= ltrim( rtrim( $global_container_name, '_1' ), 'services_' ) . ' '; } if ( empty( trim( $services_to_regenerate ) ) ) { return; @@ -136,9 +136,11 @@ public static function get_all_global_images_with_service_name() { * Create support containers for global-db and global-redis service. */ public static function enable_support_containers() { - chdir( EE_SERVICE_DIR ); - $command = 'docker-compose --project-name=ee up -d global-db global-redis'; + if ( ! chdir( EE_SERVICE_DIR ) ) { + throw new \Exception( sprintf( '%s path does not exist', EE_SERVICE_DIR ) ); + } + $command = 'docker-compose --project-name=ee up -d global-db global-redis'; if ( ! EE::exec( $command ) ) { throw new \Exception( 'Unable to create support container.' ); } @@ -148,9 +150,11 @@ public static function enable_support_containers() { * Remove support containers for global-db and global-redis service. */ public static function disable_support_containers() { - chdir( EE_SERVICE_DIR ); - $command = 'docker-compose --project-name=ee down'; + if ( ! chdir( EE_SERVICE_DIR ) ) { + throw new \Exception( sprintf( '%s path does not exist', EE_SERVICE_DIR ) ); + } + $command = 'docker-compose --project-name=ee down'; if ( ! EE::exec( $command ) ) { throw new \Exception( 'Unable to remove support container.' ); } diff --git a/php/EE/Migration/SiteContainers.php b/php/EE/Migration/SiteContainers.php index fef11437a..c7eba6bdd 100644 --- a/php/EE/Migration/SiteContainers.php +++ b/php/EE/Migration/SiteContainers.php @@ -245,11 +245,8 @@ public static function enable_support_containers( $site_url, $site_fs_path ) { $site_name = str_replace( '.', '', $site_url ); $project_name = sprintf( 'update-ee-%s', $site_name ); - $fs = new Filesystem(); - if ( $fs->exists( $site_fs_path ) ) { - chdir( $site_fs_path ); - } else { + if ( ! chdir( $site_fs_path ) ) { throw new \Exception( sprintf( '%s does not exist.', $site_fs_path ) ); } @@ -274,11 +271,8 @@ public static function disable_support_containers( $site_url, $site_fs_path ) { $site_name = str_replace( '.', '', $site_url ); $project_name = sprintf( 'update-ee-%s', $site_name ); - $fs = new Filesystem(); - if ( $fs->exists( $site_fs_path ) ) { - chdir( $site_fs_path ); - } else { + if ( ! chdir( $site_fs_path ) ) { throw new \Exception( sprintf( '%s does not exist.', $site_fs_path ) ); } From 2378617aeab9d46b98ef5d44d749de7e25bdd84c Mon Sep 17 00:00:00 2001 From: sagarnasit <sagarnasit@gmail.com> Date: Mon, 24 Dec 2018 17:05:31 +0530 Subject: [PATCH 0642/1044] Use site_enable function to enable site with default containers --- php/EE/Migration/Containers.php | 6 +++--- php/EE/Migration/SiteContainers.php | 15 +++++++-------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index f44967b66..4cb3f77eb 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -250,7 +250,7 @@ public static function migrate_site_containers( $updated_images ) { 'EE\Migration\SiteContainers::disable_default_containers', 'EE\Migration\SiteContainers::enable_default_containers', [ $site ], - [ $site ] + [ $site, $ee_site_object ] ); } @@ -275,8 +275,8 @@ public static function migrate_site_containers( $updated_images ) { "upgrade-${site['site_url']}-containers", 'EE\Migration\SiteContainers::enable_default_containers', 'EE\Migration\SiteContainers::enable_default_containers', - [ $site ], - [ $site ] + [ $site, $ee_site_object ], + [ $site, $ee_site_object ] ); /** diff --git a/php/EE/Migration/SiteContainers.php b/php/EE/Migration/SiteContainers.php index c7eba6bdd..4db5d7e9b 100644 --- a/php/EE/Migration/SiteContainers.php +++ b/php/EE/Migration/SiteContainers.php @@ -103,19 +103,18 @@ public static function generate_site_docker_compose_file( $site_info, $site_obje /** * Enable site. * - * @param array $site_info array of site information. + * @param array $site_info array of site information. + * @param object $site_object object of site-type( HTML, PHP, WordPress ). * * @throws \Exception */ - public static function enable_default_containers( $site_info ) { + public static function enable_default_containers( $site_info, $site_object ) { EE::debug( "Start enabling default containers of ${site_info['site_url']}" ); - if ( ! chdir( $site_info['site_fs_path'] ) ) { - throw new \Exception( sprintf( '%s path does not exist', $site_info['site_fs_path'] ) ); - } - - if ( ! EE::exec( 'docker-compose up -d' ) ) { - throw new \Exception( sprintf( 'Something went wrong on enable site %s', $site_info['site_url'] ) ); + try { + $site_object->enable( [ $site_info['site_url'] ], [ 'force' => true ], false ); + } catch ( \Exception $e ) { + throw new \Exception( $e->getMessage() ); } EE::debug( "Complete enabling default containers of ${site_info['site_url']}" ); From 10f97a4e2f2a8b8f79bb17d30c115ccc839cde40 Mon Sep 17 00:00:00 2001 From: sagarnasit <sagarnasit@gmail.com> Date: Mon, 24 Dec 2018 17:23:38 +0530 Subject: [PATCH 0643/1044] Start support site containers except postfix and mailhog services --- php/EE/Migration/SiteContainers.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/php/EE/Migration/SiteContainers.php b/php/EE/Migration/SiteContainers.php index 4db5d7e9b..ea562e73a 100644 --- a/php/EE/Migration/SiteContainers.php +++ b/php/EE/Migration/SiteContainers.php @@ -249,7 +249,13 @@ public static function enable_support_containers( $site_url, $site_fs_path ) { throw new \Exception( sprintf( '%s does not exist.', $site_fs_path ) ); } - $command = sprintf( 'docker-compose --project-name=%s up -d', $project_name ); + // get site services to enable except 'mailhog' and 'postfix'. + $launch = EE::launch( 'docker-compose config --services' ); + $site_services = explode( PHP_EOL, trim( $launch->stdout ) ); + $services_to_enable = array_diff( $site_services, [ 'mailhog', 'postfix' ] ); + $services_to_enable = implode( ' ', $services_to_enable ); + + $command = sprintf( 'docker-compose --project-name=%s up -d %s', $project_name, $services_to_enable ); if ( ! EE::exec( $command ) ) { throw new \Exception( sprintf( 'Unable to create support container for %s', $site_url ) ); } From 7359ddf11f20156656e6941d99b832b8ea47fc8f Mon Sep 17 00:00:00 2001 From: sagarnasit <sagarnasit@gmail.com> Date: Tue, 25 Dec 2018 17:24:12 +0530 Subject: [PATCH 0644/1044] Enable nginx service only --- php/EE/Migration/SiteContainers.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/php/EE/Migration/SiteContainers.php b/php/EE/Migration/SiteContainers.php index ea562e73a..8a720dd36 100644 --- a/php/EE/Migration/SiteContainers.php +++ b/php/EE/Migration/SiteContainers.php @@ -249,13 +249,7 @@ public static function enable_support_containers( $site_url, $site_fs_path ) { throw new \Exception( sprintf( '%s does not exist.', $site_fs_path ) ); } - // get site services to enable except 'mailhog' and 'postfix'. - $launch = EE::launch( 'docker-compose config --services' ); - $site_services = explode( PHP_EOL, trim( $launch->stdout ) ); - $services_to_enable = array_diff( $site_services, [ 'mailhog', 'postfix' ] ); - $services_to_enable = implode( ' ', $services_to_enable ); - - $command = sprintf( 'docker-compose --project-name=%s up -d %s', $project_name, $services_to_enable ); + $command = sprintf( 'docker-compose --project-name=%s up -d nginx', $project_name ); if ( ! EE::exec( $command ) ) { throw new \Exception( sprintf( 'Unable to create support container for %s', $site_url ) ); } From 4577cf462a081421c38464191f83e168cd8ed95d Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 25 Dec 2018 18:54:10 +0530 Subject: [PATCH 0645/1044] Update EasyEngine packages Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- composer.json | 12 ++--- composer.lock | 136 +++++++++++++++++++++++++++++++++----------------- 2 files changed, 97 insertions(+), 51 deletions(-) diff --git a/composer.json b/composer.json index aeaaf075b..cbc8f949c 100644 --- a/composer.json +++ b/composer.json @@ -27,17 +27,17 @@ "php": ">=7.0", "composer/composer": "1.7.3", "composer/semver": "1.4.2", - "easyengine/admin-tools-command": "v1.0.3", + "easyengine/admin-tools-command": "v1.0.4", "easyengine/auth-command": "v1.0.1", "easyengine/config-command": "v1.0.1", "easyengine/cron-command": "v1.0.1", "easyengine/log-command": "v1.0.0", "easyengine/mailhog-command": "v1.0.1", - "easyengine/site-command": "v2.2.7", - "easyengine/site-type-wp": "v1.0.4", - "easyengine/site-type-php": "v1.0.4", - "easyengine/service-command": "v1.0.4", - "easyengine/shell-command" : "v1.0.0", + "easyengine/site-command": "v2.2.8", + "easyengine/site-type-wp": "v1.0.5", + "easyengine/site-type-php": "v1.0.5", + "easyengine/service-command": "v1.0.5", + "easyengine/shell-command" : "v1.0.1", "justinrainbow/json-schema": "5.2.7", "monolog/monolog": "1.24.0", "mustache/mustache": "2.12.0", diff --git a/composer.lock b/composer.lock index f21fbb526..663bb9bad 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": "e87584ba47911079e092d6034b4d1fd6", + "content-hash": "21f62dfc945594a52e22f7054a5a275c", "packages": [ { "name": "acmephp/core", @@ -132,6 +132,49 @@ ], "time": "2018-10-14T09:29:59+00:00" }, + { + "name": "cloudflare/sdk", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/cloudflare/cloudflare-php.git", + "reference": "a3a346ccb2f5cb49759db3d71ba0006a10cf20ef" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cloudflare/cloudflare-php/zipball/a3a346ccb2f5cb49759db3d71ba0006a10cf20ef", + "reference": "a3a346ccb2f5cb49759db3d71ba0006a10cf20ef", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "^6.2.2", + "php": ">=7.0.0", + "psr/http-message": "~1.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.6", + "phpmd/phpmd": "@stable", + "phpunit/phpunit": "5.7.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Cloudflare\\API\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Junade Ali", + "email": "junade@cloudflare.com" + } + ], + "description": "PHP binding for v4 of the Cloudflare Client API.", + "time": "2018-08-28T14:01:57+00:00" + }, { "name": "composer/ca-bundle", "version": "1.1.3", @@ -437,16 +480,16 @@ }, { "name": "easyengine/admin-tools-command", - "version": "v1.0.3", + "version": "v1.0.4", "source": { "type": "git", "url": "https://github.com/EasyEngine/admin-tools-command.git", - "reference": "70dd7915977ed96adefd16e6c78512f637c137b4" + "reference": "b54acd8161578f2cb6b8cd6af0029f10a97052f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/admin-tools-command/zipball/70dd7915977ed96adefd16e6c78512f637c137b4", - "reference": "70dd7915977ed96adefd16e6c78512f637c137b4", + "url": "https://api.github.com/repos/EasyEngine/admin-tools-command/zipball/b54acd8161578f2cb6b8cd6af0029f10a97052f7", + "reference": "b54acd8161578f2cb6b8cd6af0029f10a97052f7", "shasum": "" }, "type": "ee-cli-package", @@ -476,7 +519,7 @@ ], "description": "Command to manage admin tools for php based sites.", "homepage": "https://github.com/easyengine/amdin-tools", - "time": "2018-12-10T12:38:34+00:00" + "time": "2018-12-25T13:16:51+00:00" }, { "name": "easyengine/auth-command", @@ -692,16 +735,16 @@ }, { "name": "easyengine/service-command", - "version": "v1.0.4", + "version": "v1.0.5", "source": { "type": "git", "url": "https://github.com/EasyEngine/service-command.git", - "reference": "4011086be464369b0bc65c407df7972ccdce2ba3" + "reference": "13ab904f92ccc87933bba2f3bdb8a3cf44e3e078" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/4011086be464369b0bc65c407df7972ccdce2ba3", - "reference": "4011086be464369b0bc65c407df7972ccdce2ba3", + "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/13ab904f92ccc87933bba2f3bdb8a3cf44e3e078", + "reference": "13ab904f92ccc87933bba2f3bdb8a3cf44e3e078", "shasum": "" }, "type": "ee-cli-package", @@ -733,20 +776,20 @@ ], "description": "Command to manager global containers/services in EasyEngine", "homepage": "https://github.com/easyengine/service-command", - "time": "2018-12-10T12:44:39+00:00" + "time": "2018-12-25T13:15:38+00:00" }, { "name": "easyengine/shell-command", - "version": "v1.0.0", + "version": "v1.0.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/shell-command.git", - "reference": "98859d0e3002e2a65a82f53bc3771cc973886354" + "reference": "06bb4b7970e4773c408b1d287bb94c37acb1a613" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/shell-command/zipball/98859d0e3002e2a65a82f53bc3771cc973886354", - "reference": "98859d0e3002e2a65a82f53bc3771cc973886354", + "url": "https://api.github.com/repos/EasyEngine/shell-command/zipball/06bb4b7970e4773c408b1d287bb94c37acb1a613", + "reference": "06bb4b7970e4773c408b1d287bb94c37acb1a613", "shasum": "" }, "type": "ee-cli-package", @@ -773,29 +816,30 @@ ], "description": "Shell to run helpful commands inside containers.", "homepage": "https://github.com/easyengine/shell-command", - "time": "2018-10-30T08:48:54+00:00" + "time": "2018-12-25T13:12:40+00:00" }, { "name": "easyengine/site-command", - "version": "v2.2.7", + "version": "v2.2.8", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "ea22534236079e6612915614da397f5411c72c6e" + "reference": "4f8be8fb396d5f96d213c6a4648e71f30990e14b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/ea22534236079e6612915614da397f5411c72c6e", - "reference": "ea22534236079e6612915614da397f5411c72c6e", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/4f8be8fb396d5f96d213c6a4648e71f30990e14b", + "reference": "4f8be8fb396d5f96d213c6a4648e71f30990e14b", "shasum": "" }, "require": { "acmephp/core": "1.0.0", + "cloudflare/sdk": "1.1.1", "ext-openssl": "*", - "guzzlehttp/guzzle": "^6.0", - "league/flysystem": "^1.0.19", - "symfony/serializer": "^3.0", - "webmozart/assert": "^1.0" + "guzzlehttp/guzzle": "6.3.3", + "league/flysystem": "1.0.49", + "symfony/serializer": "3.4.20", + "webmozart/assert": "1.3.0" }, "type": "ee-cli-package", "extra": { @@ -832,20 +876,20 @@ "MIT" ], "homepage": "https://github.com/easyengine/site-command", - "time": "2018-12-13T07:45:33+00:00" + "time": "2018-12-25T13:05:04+00:00" }, { "name": "easyengine/site-type-php", - "version": "v1.0.4", + "version": "v1.0.5", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-php.git", - "reference": "afc4880d9e85409477afa9d086f7d0a2c91f9dd1" + "reference": "cb480abf5e61de0e29959f52c0ba20aa54f35a96" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/afc4880d9e85409477afa9d086f7d0a2c91f9dd1", - "reference": "afc4880d9e85409477afa9d086f7d0a2c91f9dd1", + "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/cb480abf5e61de0e29959f52c0ba20aa54f35a96", + "reference": "cb480abf5e61de0e29959f52c0ba20aa54f35a96", "shasum": "" }, "require-dev": { @@ -872,20 +916,20 @@ ], "description": "EasyEngine package for PHP site creation.", "homepage": "https://github.com/easyengine/site-type-php", - "time": "2018-12-13T07:49:09+00:00" + "time": "2018-12-25T13:11:37+00:00" }, { "name": "easyengine/site-type-wp", - "version": "v1.0.4", + "version": "v1.0.5", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-wp.git", - "reference": "40478d5f766470d3503fcc2fdbc8fc7f19cadecf" + "reference": "638e4b7d9869bb6d5575eddb6ae41000bb6ca1f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/40478d5f766470d3503fcc2fdbc8fc7f19cadecf", - "reference": "40478d5f766470d3503fcc2fdbc8fc7f19cadecf", + "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/638e4b7d9869bb6d5575eddb6ae41000bb6ca1f4", + "reference": "638e4b7d9869bb6d5575eddb6ae41000bb6ca1f4", "shasum": "" }, "require-dev": { @@ -924,7 +968,7 @@ ], "description": "EasyEngine site type package for WordPress site creation.", "homepage": "https://github.com/easyengine/site-type-wp", - "time": "2018-12-13T07:47:30+00:00" + "time": "2018-12-25T13:10:14+00:00" }, { "name": "guzzlehttp/guzzle", @@ -3361,12 +3405,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "9fd088ff8176ceb154c7d3cc0d1241af80e5c93e" + "reference": "ac7afcafc8d63cd3d4ae4929291bb2fec9a4b688" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/9fd088ff8176ceb154c7d3cc0d1241af80e5c93e", - "reference": "9fd088ff8176ceb154c7d3cc0d1241af80e5c93e", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/ac7afcafc8d63cd3d4ae4929291bb2fec9a4b688", + "reference": "ac7afcafc8d63cd3d4ae4929291bb2fec9a4b688", "shasum": "" }, "conflict": { @@ -3463,7 +3507,7 @@ "silverstripe/userforms": "<3", "simple-updates/phpwhois": "<=1", "simplesamlphp/saml2": "<1.10.6|>=2,<2.3.8|>=3,<3.1.4", - "simplesamlphp/simplesamlphp": "<1.15.2", + "simplesamlphp/simplesamlphp": "<1.16.3", "simplesamlphp/simplesamlphp-module-infocard": "<1.0.1", "slim/slim": "<2.6", "smarty/smarty": "<3.1.33", @@ -3506,6 +3550,7 @@ "typo3/cms-core": ">=8,<8.7.21|>=9,<9.5.2", "typo3/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.10|>=3.1,<3.1.7|>=3.2,<3.2.7|>=3.3,<3.3.5", "typo3/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4", + "ua-parser/uap-php": "<3.8", "wallabag/tcpdf": "<6.2.22", "willdurand/js-translation-bundle": "<2.1.1", "yiisoft/yii": ">=1.1.14,<1.1.15", @@ -3554,20 +3599,20 @@ } ], "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", - "time": "2018-12-11T16:56:18+00:00" + "time": "2018-12-25T09:41:12+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.3.2", + "version": "3.4.0", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "6ad28354c04b364c3c71a34e4a18b629cc3b231e" + "reference": "379deb987e26c7cd103a7b387aea178baec96e48" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/6ad28354c04b364c3c71a34e4a18b629cc3b231e", - "reference": "6ad28354c04b364c3c71a34e4a18b629cc3b231e", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/379deb987e26c7cd103a7b387aea178baec96e48", + "reference": "379deb987e26c7cd103a7b387aea178baec96e48", "shasum": "" }, "require": { @@ -3605,7 +3650,7 @@ "phpcs", "standards" ], - "time": "2018-09-23T23:08:17+00:00" + "time": "2018-12-19T23:57:18+00:00" }, { "name": "symfony/class-loader", @@ -3714,6 +3759,7 @@ "phpcs", "standards" ], + "abandoned": "phpcompatibility/php-compatibility", "time": "2018-07-17T13:42:26+00:00" }, { From 236f77f7df25b5bf81cf1a88d051a180bfef0824 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 25 Dec 2018 18:54:43 +0530 Subject: [PATCH 0646/1044] Bump version v4.0.7 Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index d13e837c8..43beb4001 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.0.6 +4.0.7 From a8bc76dad259a68548bffd176305794a94756caa Mon Sep 17 00:00:00 2001 From: Abhijit Rakas <abhijit.rakas@rtcamp.com> Date: Wed, 26 Dec 2018 13:08:10 +0530 Subject: [PATCH 0647/1044] Fix macos update command in warning and error --- php/EE/Runner.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index e0d638fdd..eecb17827 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -869,10 +869,20 @@ private function maybe_trigger_migration() { $base_current_version = preg_replace( '/-nightly.*$/', '', EE_VERSION ); if ( Comparator::lessThan( $base_current_version, $base_db_version ) ) { + + $ee_update_command = 'ee cli update --stable --yes'; + if ( IS_DARWIN ) { + $ee_update_command = 'brew upgrade easyengine'; + } + $ee_update_msg = sprintf( + 'It seems you\'re not running latest version. Update EasyEngine using `%s`.', + $ee_update_command + ); + if ( ! empty( $this->arguments ) && 'cli' === $this->arguments[0] ) { - EE::warning( 'It seems you\'re not running latest version. Update EasyEngine using `ee cli update --stable --yes`.' ); + EE::warning( $ee_update_msg ); } else { - EE::error( 'It seems you\'re not running latest version. Update EasyEngine using `ee cli update --stable --yes`.' ); + EE::error( $ee_update_msg ); } } elseif ( $db_version !== $current_version ) { EE::log( 'Executing migrations. This might take some time.' ); From 9182c4c6b3d892e441f1aad38711491c1b7a3e15 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Wed, 26 Dec 2018 18:56:22 +0530 Subject: [PATCH 0648/1044] Update EasyEngine packages Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- composer.json | 8 ++++---- composer.lock | 42 +++++++++++++++++++++--------------------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/composer.json b/composer.json index cbc8f949c..88146e0e2 100644 --- a/composer.json +++ b/composer.json @@ -33,10 +33,10 @@ "easyengine/cron-command": "v1.0.1", "easyengine/log-command": "v1.0.0", "easyengine/mailhog-command": "v1.0.1", - "easyengine/site-command": "v2.2.8", - "easyengine/site-type-wp": "v1.0.5", - "easyengine/site-type-php": "v1.0.5", - "easyengine/service-command": "v1.0.5", + "easyengine/site-command": "v2.2.9", + "easyengine/site-type-wp": "v1.0.6", + "easyengine/site-type-php": "v1.0.6", + "easyengine/service-command": "v1.0.6", "easyengine/shell-command" : "v1.0.1", "justinrainbow/json-schema": "5.2.7", "monolog/monolog": "1.24.0", diff --git a/composer.lock b/composer.lock index 663bb9bad..452ed3732 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": "21f62dfc945594a52e22f7054a5a275c", + "content-hash": "0824beae3272b874c381a3ace2f6fd7c", "packages": [ { "name": "acmephp/core", @@ -735,16 +735,16 @@ }, { "name": "easyengine/service-command", - "version": "v1.0.5", + "version": "v1.0.6", "source": { "type": "git", "url": "https://github.com/EasyEngine/service-command.git", - "reference": "13ab904f92ccc87933bba2f3bdb8a3cf44e3e078" + "reference": "6c9d379819b8325c8603c5eccb7309ecbda2a4d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/13ab904f92ccc87933bba2f3bdb8a3cf44e3e078", - "reference": "13ab904f92ccc87933bba2f3bdb8a3cf44e3e078", + "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/6c9d379819b8325c8603c5eccb7309ecbda2a4d8", + "reference": "6c9d379819b8325c8603c5eccb7309ecbda2a4d8", "shasum": "" }, "type": "ee-cli-package", @@ -776,7 +776,7 @@ ], "description": "Command to manager global containers/services in EasyEngine", "homepage": "https://github.com/easyengine/service-command", - "time": "2018-12-25T13:15:38+00:00" + "time": "2018-12-26T13:19:43+00:00" }, { "name": "easyengine/shell-command", @@ -820,16 +820,16 @@ }, { "name": "easyengine/site-command", - "version": "v2.2.8", + "version": "v2.2.9", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "4f8be8fb396d5f96d213c6a4648e71f30990e14b" + "reference": "3b1c9f67a1d6cfc16134b9ed619eb2808364d113" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/4f8be8fb396d5f96d213c6a4648e71f30990e14b", - "reference": "4f8be8fb396d5f96d213c6a4648e71f30990e14b", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/3b1c9f67a1d6cfc16134b9ed619eb2808364d113", + "reference": "3b1c9f67a1d6cfc16134b9ed619eb2808364d113", "shasum": "" }, "require": { @@ -876,20 +876,20 @@ "MIT" ], "homepage": "https://github.com/easyengine/site-command", - "time": "2018-12-25T13:05:04+00:00" + "time": "2018-12-26T13:11:00+00:00" }, { "name": "easyengine/site-type-php", - "version": "v1.0.5", + "version": "v1.0.6", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-php.git", - "reference": "cb480abf5e61de0e29959f52c0ba20aa54f35a96" + "reference": "03e0d00afc6ae0aa00eda70da31032ad555df590" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/cb480abf5e61de0e29959f52c0ba20aa54f35a96", - "reference": "cb480abf5e61de0e29959f52c0ba20aa54f35a96", + "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/03e0d00afc6ae0aa00eda70da31032ad555df590", + "reference": "03e0d00afc6ae0aa00eda70da31032ad555df590", "shasum": "" }, "require-dev": { @@ -916,20 +916,20 @@ ], "description": "EasyEngine package for PHP site creation.", "homepage": "https://github.com/easyengine/site-type-php", - "time": "2018-12-25T13:11:37+00:00" + "time": "2018-12-26T13:19:13+00:00" }, { "name": "easyengine/site-type-wp", - "version": "v1.0.5", + "version": "v1.0.6", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-wp.git", - "reference": "638e4b7d9869bb6d5575eddb6ae41000bb6ca1f4" + "reference": "63ef292cf7d433fa8c9fd4910eb8141f7fe32c46" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/638e4b7d9869bb6d5575eddb6ae41000bb6ca1f4", - "reference": "638e4b7d9869bb6d5575eddb6ae41000bb6ca1f4", + "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/63ef292cf7d433fa8c9fd4910eb8141f7fe32c46", + "reference": "63ef292cf7d433fa8c9fd4910eb8141f7fe32c46", "shasum": "" }, "require-dev": { @@ -968,7 +968,7 @@ ], "description": "EasyEngine site type package for WordPress site creation.", "homepage": "https://github.com/easyengine/site-type-wp", - "time": "2018-12-25T13:10:14+00:00" + "time": "2018-12-26T13:17:42+00:00" }, { "name": "guzzlehttp/guzzle", From 8df294f8d96ff0e5956f88113b142b5f9a72b546 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Wed, 26 Dec 2018 18:56:46 +0530 Subject: [PATCH 0649/1044] Bump version v4.0.8 Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 43beb4001..a2cec7aff 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.0.7 +4.0.8 From cc6dde40fecedbc5e7a2ccde6a2153a177a1eec5 Mon Sep 17 00:00:00 2001 From: Abhijit Rakas <abhijit.rakas@rtcamp.com> Date: Fri, 28 Dec 2018 16:01:33 +0530 Subject: [PATCH 0650/1044] Remove extra if condition --- php/EE/Runner.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index eecb17827..29b4dd1cf 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -870,10 +870,7 @@ private function maybe_trigger_migration() { if ( Comparator::lessThan( $base_current_version, $base_db_version ) ) { - $ee_update_command = 'ee cli update --stable --yes'; - if ( IS_DARWIN ) { - $ee_update_command = 'brew upgrade easyengine'; - } + $ee_update_command = IS_DARWIN ? 'brew upgrade easyengine' : 'ee cli update --stable --yes'; $ee_update_msg = sprintf( 'It seems you\'re not running latest version. Update EasyEngine using `%s`.', $ee_update_command From 7292dd961ce21f3af96fead3cb40a4c3d833d425 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Fri, 28 Dec 2018 16:01:55 +0530 Subject: [PATCH 0651/1044] Fix adding cloudflare dependency files to phar Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- utils/make-phar.php | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/make-phar.php b/utils/make-phar.php index 2e5381748..e65c5e6ca 100644 --- a/utils/make-phar.php +++ b/utils/make-phar.php @@ -165,6 +165,7 @@ function get_composer_versions( $current_version ) { ->in(EE_VENDOR_DIR . '/mustache') ->in(EE_VENDOR_DIR . '/rmccue/requests') ->in(EE_VENDOR_DIR . '/composer') + ->in(EE_VENDOR_DIR . '/cloudflare') ->in(EE_VENDOR_DIR . '/symfony/finder') ->in(EE_VENDOR_DIR . '/symfony/polyfill-mbstring') ->in(EE_VENDOR_DIR . '/symfony/polyfill-ctype') From ec03ade2c17d31e92b99e73f3cfe475770045f1e Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Fri, 28 Dec 2018 22:29:15 +0530 Subject: [PATCH 0652/1044] Update EasyEngine packages Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- composer.json | 22 ++++---- composer.lock | 151 +++++++++++++++++++++++++++++--------------------- 2 files changed, 100 insertions(+), 73 deletions(-) diff --git a/composer.json b/composer.json index 88146e0e2..1b4f7a911 100644 --- a/composer.json +++ b/composer.json @@ -27,17 +27,17 @@ "php": ">=7.0", "composer/composer": "1.7.3", "composer/semver": "1.4.2", - "easyengine/admin-tools-command": "v1.0.4", - "easyengine/auth-command": "v1.0.1", - "easyengine/config-command": "v1.0.1", - "easyengine/cron-command": "v1.0.1", - "easyengine/log-command": "v1.0.0", - "easyengine/mailhog-command": "v1.0.1", - "easyengine/site-command": "v2.2.9", - "easyengine/site-type-wp": "v1.0.6", - "easyengine/site-type-php": "v1.0.6", - "easyengine/service-command": "v1.0.6", - "easyengine/shell-command" : "v1.0.1", + "easyengine/admin-tools-command": "v1.0.5", + "easyengine/auth-command": "v1.0.2", + "easyengine/config-command": "v1.0.2", + "easyengine/cron-command": "v1.0.2", + "easyengine/log-command": "v1.0.1", + "easyengine/mailhog-command": "v1.0.2", + "easyengine/site-command": "v2.2.10", + "easyengine/site-type-wp": "v1.0.7", + "easyengine/site-type-php": "v1.0.7", + "easyengine/service-command": "v1.0.7", + "easyengine/shell-command" : "v1.0.2", "justinrainbow/json-schema": "5.2.7", "monolog/monolog": "1.24.0", "mustache/mustache": "2.12.0", diff --git a/composer.lock b/composer.lock index 452ed3732..49997d810 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": "0824beae3272b874c381a3ace2f6fd7c", + "content-hash": "eba30e935d9692da96c724716915c647", "packages": [ { "name": "acmephp/core", @@ -480,7 +480,7 @@ }, { "name": "easyengine/admin-tools-command", - "version": "v1.0.4", + "version": "v1.0.5", "source": { "type": "git", "url": "https://github.com/EasyEngine/admin-tools-command.git", @@ -523,16 +523,16 @@ }, { "name": "easyengine/auth-command", - "version": "v1.0.1", + "version": "v1.0.2", "source": { "type": "git", "url": "https://github.com/EasyEngine/auth-command.git", - "reference": "9c1681041d1307744207dfaba0cb3d7189f4d0e4" + "reference": "2c2b8cdf9d04629835951f85cd5b626e80c790fd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/auth-command/zipball/9c1681041d1307744207dfaba0cb3d7189f4d0e4", - "reference": "9c1681041d1307744207dfaba0cb3d7189f4d0e4", + "url": "https://api.github.com/repos/EasyEngine/auth-command/zipball/2c2b8cdf9d04629835951f85cd5b626e80c790fd", + "reference": "2c2b8cdf9d04629835951f85cd5b626e80c790fd", "shasum": "" }, "type": "ee-cli-package", @@ -546,8 +546,7 @@ "auth create", "auth delete", "auth list", - "auth update", - "auth whitelist" + "auth update" ] }, "autoload": { @@ -567,20 +566,20 @@ ], "description": "Configure HTTP Authentication and whitelisting for EasyEngine site", "homepage": "https://github.com/easyengine/auth-command", - "time": "2018-12-04T11:48:09+00:00" + "time": "2018-12-28T16:04:07+00:00" }, { "name": "easyengine/config-command", - "version": "v1.0.1", + "version": "v1.0.2", "source": { "type": "git", "url": "https://github.com/EasyEngine/config-command.git", - "reference": "34ddc95325e1b4967a77ea9d34bddaf7f6ee6cf5" + "reference": "b48e8cdb9456f7a6a7492415b177867f4228d3f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/config-command/zipball/34ddc95325e1b4967a77ea9d34bddaf7f6ee6cf5", - "reference": "34ddc95325e1b4967a77ea9d34bddaf7f6ee6cf5", + "url": "https://api.github.com/repos/EasyEngine/config-command/zipball/b48e8cdb9456f7a6a7492415b177867f4228d3f6", + "reference": "b48e8cdb9456f7a6a7492415b177867f4228d3f6", "shasum": "" }, "type": "ee-cli-package", @@ -590,7 +589,9 @@ }, "bundled": true, "commands": [ - "config" + "config", + "config set", + "config get" ] }, "autoload": { @@ -607,20 +608,20 @@ ], "description": "Manages EasyEngine configuration", "homepage": "https://github.com/easyengine/config-command", - "time": "2018-11-29T15:58:43+00:00" + "time": "2018-12-28T16:04:46+00:00" }, { "name": "easyengine/cron-command", - "version": "v1.0.1", + "version": "v1.0.2", "source": { "type": "git", "url": "https://github.com/EasyEngine/cron-command.git", - "reference": "8a80aa4c0a18e72b9542c853e1360749718ca9bd" + "reference": "2646a15829dbce069b47a8014ec3168197e114b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/cron-command/zipball/8a80aa4c0a18e72b9542c853e1360749718ca9bd", - "reference": "8a80aa4c0a18e72b9542c853e1360749718ca9bd", + "url": "https://api.github.com/repos/EasyEngine/cron-command/zipball/2646a15829dbce069b47a8014ec3168197e114b6", + "reference": "2646a15829dbce069b47a8014ec3168197e114b6", "shasum": "" }, "type": "ee-cli-package", @@ -630,8 +631,10 @@ }, "bundled": true, "commands": [ - "cron add", + "cron", + "cron create", "cron delete", + "cron update", "cron list", "cron run-now" ] @@ -652,20 +655,20 @@ ], "description": "Manages cron jobs in EasyEngine", "homepage": "https://github.com/easyengine/cron-command", - "time": "2018-11-28T13:56:44+00:00" + "time": "2018-12-28T16:05:27+00:00" }, { "name": "easyengine/log-command", - "version": "v1.0.0", + "version": "v1.0.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/log-command.git", - "reference": "ba20a345cdb55bc97d3a17b430140487964417c2" + "reference": "4cd0850ec40a5f4102eec2741a2b31c9a6a1125d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/log-command/zipball/ba20a345cdb55bc97d3a17b430140487964417c2", - "reference": "ba20a345cdb55bc97d3a17b430140487964417c2", + "url": "https://api.github.com/repos/EasyEngine/log-command/zipball/4cd0850ec40a5f4102eec2741a2b31c9a6a1125d", + "reference": "4cd0850ec40a5f4102eec2741a2b31c9a6a1125d", "shasum": "" }, "type": "ee-cli-package", @@ -673,7 +676,10 @@ "branch-alias": { "dev-master": "1.x-dev" }, - "bundled": true + "bundled": true, + "commands": [ + "log show" + ] }, "autoload": { "psr-4": { @@ -688,20 +694,20 @@ "MIT" ], "homepage": "https://github.com/easyengine/log-command", - "time": "2018-11-29T15:50:06+00:00" + "time": "2018-12-28T16:07:01+00:00" }, { "name": "easyengine/mailhog-command", - "version": "v1.0.1", + "version": "v1.0.2", "source": { "type": "git", "url": "https://github.com/EasyEngine/mailhog-command.git", - "reference": "642173e0e2510e3d148a60d46eab90635081955b" + "reference": "91e8b16c136a65f6c76268322d45061cc02dbb12" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/mailhog-command/zipball/642173e0e2510e3d148a60d46eab90635081955b", - "reference": "642173e0e2510e3d148a60d46eab90635081955b", + "url": "https://api.github.com/repos/EasyEngine/mailhog-command/zipball/91e8b16c136a65f6c76268322d45061cc02dbb12", + "reference": "91e8b16c136a65f6c76268322d45061cc02dbb12", "shasum": "" }, "type": "ee-cli-package", @@ -731,20 +737,20 @@ ], "description": "Command to manage mailhog", "homepage": "https://github.com/easyengine/mailhog-command", - "time": "2018-11-28T13:58:43+00:00" + "time": "2018-12-28T16:05:53+00:00" }, { "name": "easyengine/service-command", - "version": "v1.0.6", + "version": "v1.0.7", "source": { "type": "git", "url": "https://github.com/EasyEngine/service-command.git", - "reference": "6c9d379819b8325c8603c5eccb7309ecbda2a4d8" + "reference": "42bdb645f0e38cf89a374a9429f8d1666991a819" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/6c9d379819b8325c8603c5eccb7309ecbda2a4d8", - "reference": "6c9d379819b8325c8603c5eccb7309ecbda2a4d8", + "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/42bdb645f0e38cf89a374a9429f8d1666991a819", + "reference": "42bdb645f0e38cf89a374a9429f8d1666991a819", "shasum": "" }, "type": "ee-cli-package", @@ -755,8 +761,8 @@ "bundled": true, "commands": [ "service", - "service start", - "service stop", + "service enable", + "service disable", "service restart", "service reload" ] @@ -776,20 +782,20 @@ ], "description": "Command to manager global containers/services in EasyEngine", "homepage": "https://github.com/easyengine/service-command", - "time": "2018-12-26T13:19:43+00:00" + "time": "2018-12-28T16:08:40+00:00" }, { "name": "easyengine/shell-command", - "version": "v1.0.1", + "version": "v1.0.2", "source": { "type": "git", "url": "https://github.com/EasyEngine/shell-command.git", - "reference": "06bb4b7970e4773c408b1d287bb94c37acb1a613" + "reference": "e6dd5ac7278752951f96fb5026b88ad1701c4388" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/shell-command/zipball/06bb4b7970e4773c408b1d287bb94c37acb1a613", - "reference": "06bb4b7970e4773c408b1d287bb94c37acb1a613", + "url": "https://api.github.com/repos/EasyEngine/shell-command/zipball/e6dd5ac7278752951f96fb5026b88ad1701c4388", + "reference": "e6dd5ac7278752951f96fb5026b88ad1701c4388", "shasum": "" }, "type": "ee-cli-package", @@ -816,20 +822,20 @@ ], "description": "Shell to run helpful commands inside containers.", "homepage": "https://github.com/easyengine/shell-command", - "time": "2018-12-25T13:12:40+00:00" + "time": "2018-12-28T16:06:33+00:00" }, { "name": "easyengine/site-command", - "version": "v2.2.9", + "version": "v2.2.10", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "3b1c9f67a1d6cfc16134b9ed619eb2808364d113" + "reference": "525fc26b5c81aa9061ccc33cceac9bf5373366da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/3b1c9f67a1d6cfc16134b9ed619eb2808364d113", - "reference": "3b1c9f67a1d6cfc16134b9ed619eb2808364d113", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/525fc26b5c81aa9061ccc33cceac9bf5373366da", + "reference": "525fc26b5c81aa9061ccc33cceac9bf5373366da", "shasum": "" }, "require": { @@ -850,6 +856,7 @@ "commands": [ "site create --type=html", "site delete", + "site update", "site info --type=html", "site enable", "site disable", @@ -857,7 +864,9 @@ "site ssl", "site list", "site reload --type=html", - "site restart --type=html" + "site restart --type=html", + "site share", + "site clean" ] }, "autoload": { @@ -876,20 +885,20 @@ "MIT" ], "homepage": "https://github.com/easyengine/site-command", - "time": "2018-12-26T13:11:00+00:00" + "time": "2018-12-28T16:07:45+00:00" }, { "name": "easyengine/site-type-php", - "version": "v1.0.6", + "version": "v1.0.7", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-php.git", - "reference": "03e0d00afc6ae0aa00eda70da31032ad555df590" + "reference": "3ab0b4f3bc830ff3cf382b2a0de7d414adcd9589" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/03e0d00afc6ae0aa00eda70da31032ad555df590", - "reference": "03e0d00afc6ae0aa00eda70da31032ad555df590", + "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/3ab0b4f3bc830ff3cf382b2a0de7d414adcd9589", + "reference": "3ab0b4f3bc830ff3cf382b2a0de7d414adcd9589", "shasum": "" }, "require-dev": { @@ -900,7 +909,22 @@ "branch-alias": { "dev-master": "1.x-dev" }, - "bundled": true + "bundled": true, + "commands": [ + "site create --type=php", + "site delete", + "site update", + "site info --type=php", + "site enable", + "site disable", + "site info", + "site ssl", + "site list", + "site reload --type=php", + "site restart --type=php", + "site share", + "site clean" + ] }, "autoload": { "psr-4": { @@ -916,20 +940,20 @@ ], "description": "EasyEngine package for PHP site creation.", "homepage": "https://github.com/easyengine/site-type-php", - "time": "2018-12-26T13:19:13+00:00" + "time": "2018-12-28T16:08:29+00:00" }, { "name": "easyengine/site-type-wp", - "version": "v1.0.6", + "version": "v1.0.7", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-wp.git", - "reference": "63ef292cf7d433fa8c9fd4910eb8141f7fe32c46" + "reference": "0045e8552ae2483b745630723908a6d65e6821ee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/63ef292cf7d433fa8c9fd4910eb8141f7fe32c46", - "reference": "63ef292cf7d433fa8c9fd4910eb8141f7fe32c46", + "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/0045e8552ae2483b745630723908a6d65e6821ee", + "reference": "0045e8552ae2483b745630723908a6d65e6821ee", "shasum": "" }, "require-dev": { @@ -944,6 +968,7 @@ "commands": [ "site create --type=wp", "site delete", + "site update", "site info --type=wp", "site enable", "site disable", @@ -951,7 +976,9 @@ "site ssl", "site list", "site reload --type=wp", - "site restart --type=wp" + "site restart --type=wp", + "site share", + "site clean" ] }, "autoload": { @@ -968,7 +995,7 @@ ], "description": "EasyEngine site type package for WordPress site creation.", "homepage": "https://github.com/easyengine/site-type-wp", - "time": "2018-12-26T13:17:42+00:00" + "time": "2018-12-28T16:08:32+00:00" }, { "name": "guzzlehttp/guzzle", From a8b9dacc61af850818bc50422b3a2d784811f491 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Fri, 28 Dec 2018 22:30:06 +0530 Subject: [PATCH 0653/1044] Bump version v4.0.9 Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index a2cec7aff..7919852fe 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.0.8 +4.0.9 From 56d073ba8293ab02143e65bb8917eba8fd72fb1d Mon Sep 17 00:00:00 2001 From: sagarnasit <sagarnasit@gmail.com> Date: Thu, 10 Jan 2019 12:34:27 +0530 Subject: [PATCH 0654/1044] Move get_value_if_flag_isset from site utils to utils --- php/utils.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/php/utils.php b/php/utils.php index 899ce521f..20abe29b7 100644 --- a/php/utils.php +++ b/php/utils.php @@ -1732,3 +1732,29 @@ function random_name_generator() { return $left[ array_rand( $left ) ] . '-' . $right[ array_rand( $right ) ]; } + +/** + * @param $flag_value mixed flag value. + * @param array $supported_flag_values array of supported flag values. + * @param string $default_value default flag value if flag is passed without value. + * + * @return string + * @throws EE\ExitException + */ +function get_value_if_flag_isset( $flag_value, $supported_flag_values = [], $default_value = '' ) { + + $value = ''; + if ( isset( $flag_value ) ) { + /** + * Set default flag value if flag is passed without value. + */ + $value = ( empty( $flag_value ) || true === $flag_value ) ? $default_value : $flag_value; + + if ( empty( $value ) ) { + return $value; + } elseif ( ! in_array( $value, $supported_flag_values, true ) ) { + EE::error( sprintf( 'Invalid flag value passed %s', $value ) ); + } + } + return $value; +} From 9572c8ff5ffabc86c85fae6ba4a3a656f6fe70d7 Mon Sep 17 00:00:00 2001 From: sagarnasit <sagarnasit@gmail.com> Date: Thu, 10 Jan 2019 13:08:30 +0530 Subject: [PATCH 0655/1044] Add assoc_args param --- php/utils.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/php/utils.php b/php/utils.php index 20abe29b7..9389266ab 100644 --- a/php/utils.php +++ b/php/utils.php @@ -1734,16 +1734,19 @@ function random_name_generator() { } /** - * @param $flag_value mixed flag value. + * @param array $assoc_args Arguments array. + * @param string $flag Flag to get the value. * @param array $supported_flag_values array of supported flag values. * @param string $default_value default flag value if flag is passed without value. * * @return string * @throws EE\ExitException */ -function get_value_if_flag_isset( $flag_value, $supported_flag_values = [], $default_value = '' ) { +function get_value_if_flag_isset( $assoc_args, $flag, $supported_flag_values = [], $default_value = '' ) { + + $flag_value = get_flag_value( $assoc_args, $flag ); + $value = ''; - $value = ''; if ( isset( $flag_value ) ) { /** * Set default flag value if flag is passed without value. From 21aa79cc0564db715e7df000597babd2a19698e8 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 15 Jan 2019 13:04:53 +0530 Subject: [PATCH 0656/1044] Add utility function to sanitize file and folder name Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/utils.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/php/utils.php b/php/utils.php index 9389266ab..7f49e48b0 100644 --- a/php/utils.php +++ b/php/utils.php @@ -1761,3 +1761,21 @@ function get_value_if_flag_isset( $assoc_args, $flag, $supported_flag_values = [ } return $value; } + +/** + * Function to sanitize and remove illegal characters for folder and filename. + * + * @param string $input_name Input name to be sanitized. + * + * @return string Sanitized name valid for file/folder creation. + */ +function sanitize_file_folder_name( $input_name ) { + + // Remove Illegal Chars for folder and filename. + $output = preg_replace('/[\"\*\/\:\<\>\?\'\|]+/', ' ', $input_name); + + // Replace Spaces with dashes. + $output = str_replace(' ', '-', $output); + + return trim( $output, '-' ); +} From 0ecd17e27900a5b27a5f1759220b0efa8ca2f07f Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 15 Jan 2019 13:26:53 +0530 Subject: [PATCH 0657/1044] Make sanitization strict by default Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/utils.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/php/utils.php b/php/utils.php index 7f49e48b0..6450c82a0 100644 --- a/php/utils.php +++ b/php/utils.php @@ -1766,16 +1766,27 @@ function get_value_if_flag_isset( $assoc_args, $flag, $supported_flag_values = [ * Function to sanitize and remove illegal characters for folder and filename. * * @param string $input_name Input name to be sanitized. + * @param bool $strict Do strict replacement, i.e, remove all special characters except `-` and `_`. * * @return string Sanitized name valid for file/folder creation. */ -function sanitize_file_folder_name( $input_name ) { +function sanitize_file_folder_name( $input_name, $strict = true ) { // Remove Illegal Chars for folder and filename. - $output = preg_replace('/[\"\*\/\:\<\>\?\'\|]+/', ' ', $input_name); + $output = preg_replace( '/[\"\*\/\:\<\>\?\'\|]+/', ' ', $input_name ); + if ( $strict ) { + $output = preg_replace( '/[^A-Za-z0-9\-\_]/', '', $output ); + } // Replace Spaces with dashes. - $output = str_replace(' ', '-', $output); + $output = str_replace( ' ', '-', $output ); + + // Replaces multiple hyphens with single one. + $output = preg_replace( '/-+/', '-', $output ); + + // Replaces multiple underscores with single one. + $output = preg_replace( '/_+/', '_', $output ); + // Remove starting and ending hyphens as a starting hyphen in string might be considered as parameter in bash file/folder creation. return trim( $output, '-' ); } From 2b339e081f4033da8c20489a42c24e987ea8bbbf Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 15 Jan 2019 14:50:38 +0530 Subject: [PATCH 0658/1044] Add option for '/' in sanitization Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/utils.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/php/utils.php b/php/utils.php index 6450c82a0..6a70e0fff 100644 --- a/php/utils.php +++ b/php/utils.php @@ -1765,18 +1765,22 @@ function get_value_if_flag_isset( $assoc_args, $flag, $supported_flag_values = [ /** * Function to sanitize and remove illegal characters for folder and filename. * - * @param string $input_name Input name to be sanitized. - * @param bool $strict Do strict replacement, i.e, remove all special characters except `-` and `_`. + * @param string $input_name Input name to be sanitized. + * @param bool $strict Do strict replacement, i.e, remove all special characters except `-` and `_`. + * @param bool $remove_forward_slashes Wether to remove `/` or not from the input. * * @return string Sanitized name valid for file/folder creation. */ -function sanitize_file_folder_name( $input_name, $strict = true ) { +function sanitize_file_folder_name( $input_name, $strict = true, $remove_forward_slashes = false ) { + + $expression = $remove_forward_slashes ? '/[\"\*\/\:\<\>\?\'\|]+/' : '/[\"\*\:\<\>\?\'\|]+/'; // Remove Illegal Chars for folder and filename. - $output = preg_replace( '/[\"\*\/\:\<\>\?\'\|]+/', ' ', $input_name ); + $output = preg_replace( $expression, '', $input_name ); if ( $strict ) { - $output = preg_replace( '/[^A-Za-z0-9\-\_]/', '', $output ); + // Remove all special characters except `-`, `_` and `/`. + $output = preg_replace( '/[^A-Za-z0-9\-_\/]/', '', $output ); } // Replace Spaces with dashes. $output = str_replace( ' ', '-', $output ); From a47aa5a7c70422fb3e9e995512944b36002c10c8 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 15 Jan 2019 18:48:34 +0530 Subject: [PATCH 0659/1044] Add note on how to run EasyEngine updates safely Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/commands/src/CLI_Command.php | 1 + 1 file changed, 1 insertion(+) diff --git a/php/commands/src/CLI_Command.php b/php/commands/src/CLI_Command.php index 16e7c5844..de32f7a54 100644 --- a/php/commands/src/CLI_Command.php +++ b/php/commands/src/CLI_Command.php @@ -269,6 +269,7 @@ public function update( $_, $assoc_args ) { } elseif ( ! is_writable( dirname( $old_phar ) ) ) { EE::error( sprintf( '%s is not writable by current user.', dirname( $old_phar ) ) ); } + EE::log( 'Note: It is recommended to run EasyEngine update in tmux/screen. Update at times may take some time. To view progress, tail logs in a different window using `tail -f /opt/easyengine/logs/ee.log`.' ); if ( Utils\get_flag_value( $assoc_args, 'nightly' ) ) { EE::confirm( sprintf( 'You have version %s. Would you like to update to the latest nightly?', EE_VERSION ), $assoc_args ); $download_url = 'https://raw.githubusercontent.com/EasyEngine/easyengine-builds/master/phar/easyengine-nightly.phar'; From 204331431353d4cc0daffa4937cba09e8fca31fb Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 15 Jan 2019 18:52:20 +0530 Subject: [PATCH 0660/1044] Add line break in long message Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/commands/src/CLI_Command.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/commands/src/CLI_Command.php b/php/commands/src/CLI_Command.php index de32f7a54..34b1ff9e6 100644 --- a/php/commands/src/CLI_Command.php +++ b/php/commands/src/CLI_Command.php @@ -269,7 +269,7 @@ public function update( $_, $assoc_args ) { } elseif ( ! is_writable( dirname( $old_phar ) ) ) { EE::error( sprintf( '%s is not writable by current user.', dirname( $old_phar ) ) ); } - EE::log( 'Note: It is recommended to run EasyEngine update in tmux/screen. Update at times may take some time. To view progress, tail logs in a different window using `tail -f /opt/easyengine/logs/ee.log`.' ); + EE::log( "Note: It is recommended to run EasyEngine update in tmux/screen. Update at times may take some time.\nTo view progress, tail logs in a different window using `tail -f /opt/easyengine/logs/ee.log`." ); if ( Utils\get_flag_value( $assoc_args, 'nightly' ) ) { EE::confirm( sprintf( 'You have version %s. Would you like to update to the latest nightly?', EE_VERSION ), $assoc_args ); $download_url = 'https://raw.githubusercontent.com/EasyEngine/easyengine-builds/master/phar/easyengine-nightly.phar'; From 594a77d13471d10a7b42cab307de2263aefd408d Mon Sep 17 00:00:00 2001 From: kirtan gajjar <kirtangajjar95@gmail.com> Date: Thu, 24 Jan 2019 11:10:19 +0530 Subject: [PATCH 0661/1044] Add confirmation in message --- php/commands/src/CLI_Command.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/commands/src/CLI_Command.php b/php/commands/src/CLI_Command.php index 34b1ff9e6..bdc590492 100644 --- a/php/commands/src/CLI_Command.php +++ b/php/commands/src/CLI_Command.php @@ -269,7 +269,7 @@ public function update( $_, $assoc_args ) { } elseif ( ! is_writable( dirname( $old_phar ) ) ) { EE::error( sprintf( '%s is not writable by current user.', dirname( $old_phar ) ) ); } - EE::log( "Note: It is recommended to run EasyEngine update in tmux/screen. Update at times may take some time.\nTo view progress, tail logs in a different window using `tail -f /opt/easyengine/logs/ee.log`." ); + EE::confirm( "Note: It is recommended to run EasyEngine update in tmux/screen. Update at times may take some time.\n\nTo view progress, tail logs in a different window using `tail -f /opt/easyengine/logs/ee.log`.\n\nAre you sure you want to continue?" ); if ( Utils\get_flag_value( $assoc_args, 'nightly' ) ) { EE::confirm( sprintf( 'You have version %s. Would you like to update to the latest nightly?', EE_VERSION ), $assoc_args ); $download_url = 'https://raw.githubusercontent.com/EasyEngine/easyengine-builds/master/phar/easyengine-nightly.phar'; From 37c27a763a97b7ccb777312d893e4c4e747541d2 Mon Sep 17 00:00:00 2001 From: kirtan gajjar <kirtangajjar95@gmail.com> Date: Thu, 24 Jan 2019 12:23:09 +0530 Subject: [PATCH 0662/1044] Add support for running cli update headlessly --- php/commands/src/CLI_Command.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/commands/src/CLI_Command.php b/php/commands/src/CLI_Command.php index bdc590492..b17028f3b 100644 --- a/php/commands/src/CLI_Command.php +++ b/php/commands/src/CLI_Command.php @@ -269,7 +269,7 @@ public function update( $_, $assoc_args ) { } elseif ( ! is_writable( dirname( $old_phar ) ) ) { EE::error( sprintf( '%s is not writable by current user.', dirname( $old_phar ) ) ); } - EE::confirm( "Note: It is recommended to run EasyEngine update in tmux/screen. Update at times may take some time.\n\nTo view progress, tail logs in a different window using `tail -f /opt/easyengine/logs/ee.log`.\n\nAre you sure you want to continue?" ); + EE::confirm( "Note: It is recommended to run EasyEngine update in tmux/screen. Update at times may take some time.\n\nTo view progress, tail logs in a different window using `tail -f /opt/easyengine/logs/ee.log`.\n\nAre you sure you want to continue?", $assoc_args ); if ( Utils\get_flag_value( $assoc_args, 'nightly' ) ) { EE::confirm( sprintf( 'You have version %s. Would you like to update to the latest nightly?', EE_VERSION ), $assoc_args ); $download_url = 'https://raw.githubusercontent.com/EasyEngine/easyengine-builds/master/phar/easyengine-nightly.phar'; From 9b049051eaa47ca56880f20d88a4d51c30f13932 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 28 Jan 2019 20:15:28 +0530 Subject: [PATCH 0663/1044] Update composer requirements Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- composer.json | 10 ++--- composer.lock | 111 ++++++++++++++++++++++++++------------------------ 2 files changed, 63 insertions(+), 58 deletions(-) diff --git a/composer.json b/composer.json index 1b4f7a911..983b74b47 100644 --- a/composer.json +++ b/composer.json @@ -27,16 +27,16 @@ "php": ">=7.0", "composer/composer": "1.7.3", "composer/semver": "1.4.2", - "easyengine/admin-tools-command": "v1.0.5", + "easyengine/admin-tools-command": "v1.0.6", "easyengine/auth-command": "v1.0.2", "easyengine/config-command": "v1.0.2", "easyengine/cron-command": "v1.0.2", "easyengine/log-command": "v1.0.1", "easyengine/mailhog-command": "v1.0.2", - "easyengine/site-command": "v2.2.10", - "easyengine/site-type-wp": "v1.0.7", - "easyengine/site-type-php": "v1.0.7", - "easyengine/service-command": "v1.0.7", + "easyengine/site-command": "v2.3.0", + "easyengine/site-type-wp": "v1.0.8", + "easyengine/site-type-php": "v1.0.8", + "easyengine/service-command": "v1.0.8", "easyengine/shell-command" : "v1.0.2", "justinrainbow/json-schema": "5.2.7", "monolog/monolog": "1.24.0", diff --git a/composer.lock b/composer.lock index 49997d810..4c7a00a6c 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": "eba30e935d9692da96c724716915c647", + "content-hash": "486b50e1e6a2f935fdc989f32415e18f", "packages": [ { "name": "acmephp/core", @@ -73,20 +73,22 @@ }, { "name": "acmephp/ssl", - "version": "1.0.0", + "version": "1.1.1", "source": { "type": "git", "url": "https://github.com/acmephp/ssl.git", - "reference": "bd070b7de809293bedd3a3ce6d3efc4c1eb996c3" + "reference": "e615312ba2bb6d01267be585e0253e0a95178a31" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/acmephp/ssl/zipball/bd070b7de809293bedd3a3ce6d3efc4c1eb996c3", - "reference": "bd070b7de809293bedd3a3ce6d3efc4c1eb996c3", + "url": "https://api.github.com/repos/acmephp/ssl/zipball/e615312ba2bb6d01267be585e0253e0a95178a31", + "reference": "e615312ba2bb6d01267be585e0253e0a95178a31", "shasum": "" }, "require": { + "ext-hash": "*", "ext-openssl": "*", + "lib-openssl": ">=0.9.8", "php": ">=5.5.0", "webmozart/assert": "^1.0" }, @@ -122,15 +124,17 @@ "description": "PHP wrapper around OpenSSL extension providing SSL encoding, decoding, parsing and signing features", "homepage": "https://github.com/acmephp/ssl", "keywords": [ + "ECDSA", "acmephp", "certificate", "csr", "https", "openssl", + "rsa", "ssl", "x509" ], - "time": "2018-10-14T09:29:59+00:00" + "time": "2018-11-05T19:26:21+00:00" }, { "name": "cloudflare/sdk", @@ -177,16 +181,16 @@ }, { "name": "composer/ca-bundle", - "version": "1.1.3", + "version": "1.1.4", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "8afa52cd417f4ec417b4bfe86b68106538a87660" + "reference": "558f321c52faeb4828c03e7dc0cfe39a09e09a2d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/8afa52cd417f4ec417b4bfe86b68106538a87660", - "reference": "8afa52cd417f4ec417b4bfe86b68106538a87660", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/558f321c52faeb4828c03e7dc0cfe39a09e09a2d", + "reference": "558f321c52faeb4828c03e7dc0cfe39a09e09a2d", "shasum": "" }, "require": { @@ -229,7 +233,7 @@ "ssl", "tls" ], - "time": "2018-10-18T06:09:13+00:00" + "time": "2019-01-28T09:30:10+00:00" }, { "name": "composer/composer", @@ -480,16 +484,16 @@ }, { "name": "easyengine/admin-tools-command", - "version": "v1.0.5", + "version": "v1.0.6", "source": { "type": "git", "url": "https://github.com/EasyEngine/admin-tools-command.git", - "reference": "b54acd8161578f2cb6b8cd6af0029f10a97052f7" + "reference": "b2074b210c312aa17c89b2b1591c7d221cb3e523" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/admin-tools-command/zipball/b54acd8161578f2cb6b8cd6af0029f10a97052f7", - "reference": "b54acd8161578f2cb6b8cd6af0029f10a97052f7", + "url": "https://api.github.com/repos/EasyEngine/admin-tools-command/zipball/b2074b210c312aa17c89b2b1591c7d221cb3e523", + "reference": "b2074b210c312aa17c89b2b1591c7d221cb3e523", "shasum": "" }, "type": "ee-cli-package", @@ -500,7 +504,6 @@ "bundled": true, "commands": [ "admin-tools", - "admin-tools install", "admin-tools enable", "admin-tools disable" ] @@ -519,7 +522,7 @@ ], "description": "Command to manage admin tools for php based sites.", "homepage": "https://github.com/easyengine/amdin-tools", - "time": "2018-12-25T13:16:51+00:00" + "time": "2019-01-28T13:39:55+00:00" }, { "name": "easyengine/auth-command", @@ -741,7 +744,7 @@ }, { "name": "easyengine/service-command", - "version": "v1.0.7", + "version": "v1.0.8", "source": { "type": "git", "url": "https://github.com/EasyEngine/service-command.git", @@ -826,16 +829,16 @@ }, { "name": "easyengine/site-command", - "version": "v2.2.10", + "version": "v2.3.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "525fc26b5c81aa9061ccc33cceac9bf5373366da" + "reference": "eded69eee18097aab8b632647a53e54165182d0f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/525fc26b5c81aa9061ccc33cceac9bf5373366da", - "reference": "525fc26b5c81aa9061ccc33cceac9bf5373366da", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/eded69eee18097aab8b632647a53e54165182d0f", + "reference": "eded69eee18097aab8b632647a53e54165182d0f", "shasum": "" }, "require": { @@ -885,20 +888,20 @@ "MIT" ], "homepage": "https://github.com/easyengine/site-command", - "time": "2018-12-28T16:07:45+00:00" + "time": "2019-01-28T13:34:56+00:00" }, { "name": "easyengine/site-type-php", - "version": "v1.0.7", + "version": "v1.0.8", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-php.git", - "reference": "3ab0b4f3bc830ff3cf382b2a0de7d414adcd9589" + "reference": "2001602f4d300fad6f0371904ea9db5ddd2c52f3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/3ab0b4f3bc830ff3cf382b2a0de7d414adcd9589", - "reference": "3ab0b4f3bc830ff3cf382b2a0de7d414adcd9589", + "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/2001602f4d300fad6f0371904ea9db5ddd2c52f3", + "reference": "2001602f4d300fad6f0371904ea9db5ddd2c52f3", "shasum": "" }, "require-dev": { @@ -940,20 +943,20 @@ ], "description": "EasyEngine package for PHP site creation.", "homepage": "https://github.com/easyengine/site-type-php", - "time": "2018-12-28T16:08:29+00:00" + "time": "2019-01-28T13:38:36+00:00" }, { "name": "easyengine/site-type-wp", - "version": "v1.0.7", + "version": "v1.0.8", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-wp.git", - "reference": "0045e8552ae2483b745630723908a6d65e6821ee" + "reference": "b42ca3b57de5552fc967e4e7c1794c4bfdc4da53" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/0045e8552ae2483b745630723908a6d65e6821ee", - "reference": "0045e8552ae2483b745630723908a6d65e6821ee", + "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/b42ca3b57de5552fc967e4e7c1794c4bfdc4da53", + "reference": "b42ca3b57de5552fc967e4e7c1794c4bfdc4da53", "shasum": "" }, "require-dev": { @@ -995,7 +998,7 @@ ], "description": "EasyEngine site type package for WordPress site creation.", "homepage": "https://github.com/easyengine/site-type-wp", - "time": "2018-12-28T16:08:32+00:00" + "time": "2019-01-28T13:36:34+00:00" }, { "name": "guzzlehttp/guzzle", @@ -2249,7 +2252,7 @@ }, { "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" + "email": "backendtea@gmail.com" } ], "description": "Symfony polyfill for ctype functions", @@ -2852,16 +2855,16 @@ }, { "name": "behat/gherkin", - "version": "v4.5.1", + "version": "v4.6.0", "source": { "type": "git", "url": "https://github.com/Behat/Gherkin.git", - "reference": "74ac03d52c5e23ad8abd5c5cce4ab0e8dc1b530a" + "reference": "ab0a02ea14893860bca00f225f5621d351a3ad07" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Behat/Gherkin/zipball/74ac03d52c5e23ad8abd5c5cce4ab0e8dc1b530a", - "reference": "74ac03d52c5e23ad8abd5c5cce4ab0e8dc1b530a", + "url": "https://api.github.com/repos/Behat/Gherkin/zipball/ab0a02ea14893860bca00f225f5621d351a3ad07", + "reference": "ab0a02ea14893860bca00f225f5621d351a3ad07", "shasum": "" }, "require": { @@ -2869,8 +2872,8 @@ }, "require-dev": { "phpunit/phpunit": "~4.5|~5", - "symfony/phpunit-bridge": "~2.7|~3", - "symfony/yaml": "~2.3|~3" + "symfony/phpunit-bridge": "~2.7|~3|~4", + "symfony/yaml": "~2.3|~3|~4" }, "suggest": { "symfony/yaml": "If you want to parse features, represented in YAML files" @@ -2907,7 +2910,7 @@ "gherkin", "parser" ], - "time": "2017-08-30T11:04:43+00:00" + "time": "2019-01-16T14:22:17+00:00" }, { "name": "behat/transliterator", @@ -3432,12 +3435,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "ac7afcafc8d63cd3d4ae4929291bb2fec9a4b688" + "reference": "db876706aacd4ffbd1c253358d19a651e50e65c2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/ac7afcafc8d63cd3d4ae4929291bb2fec9a4b688", - "reference": "ac7afcafc8d63cd3d4ae4929291bb2fec9a4b688", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/db876706aacd4ffbd1c253358d19a651e50e65c2", + "reference": "db876706aacd4ffbd1c253358d19a651e50e65c2", "shasum": "" }, "conflict": { @@ -3446,6 +3449,7 @@ "alterphp/easyadmin-extension-bundle": ">=1.2,<1.2.11|>=1.3,<1.3.1", "amphp/artax": "<1.0.6|>=2,<2.0.6", "amphp/http": "<1.0.1", + "api-platform/core": ">=2.2,<2.2.10|>=2.3,<2.3.6", "asymmetricrypt/asymmetricrypt": ">=0,<9.9.99", "aws/aws-sdk-php": ">=3,<3.2.1", "brightlocal/phpwhois": "<=4.2.5", @@ -3474,7 +3478,6 @@ "drupal/core": ">=7,<7.60|>=8,<8.5.8|>=8.6,<8.6.2", "drupal/drupal": ">=7,<7.60|>=8,<8.5.8|>=8.6,<8.6.2", "erusev/parsedown": "<1.7", - "ezsystems/ezplatform": "<1.7.8.1|>=1.8,<1.13.4.1|>=2,<2.2.3.1|>=2.3,<2.3.2.1", "ezsystems/ezpublish-kernel": ">=5.3,<5.3.12.1|>=5.4,<5.4.13.1|>=6,<6.7.9.1|>=6.8,<6.13.5.1|>=7,<7.2.4.1|>=7.3,<7.3.2.1", "ezsystems/ezpublish-legacy": ">=5.3,<5.3.12.6|>=5.4,<5.4.12.3|>=2011,<2017.12.4.3|>=2018.6,<2018.6.1.4|>=2018.9,<2018.9.1.3", "ezsystems/repository-forms": ">=2.3,<2.3.2.1", @@ -3501,6 +3504,7 @@ "la-haute-societe/tcpdf": "<6.2.22", "laravel/framework": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.42|>=5.6,<5.6.30", "laravel/socialite": ">=1,<1.0.99|>=2,<2.0.10", + "league/commonmark": ">=0.15.6,<0.18.1", "magento/magento1ce": "<1.9.4", "magento/magento1ee": ">=1.9,<1.14.4", "magento/product-community-edition": ">=2,<2.2.7", @@ -3514,6 +3518,7 @@ "pagarme/pagarme-php": ">=0,<3", "paragonie/random_compat": "<2", "paypal/merchant-sdk-php": "<3.12", + "pear/archive_tar": "<1.4.4", "phpmailer/phpmailer": ">=5,<5.2.27|>=6,<6.0.6", "phpoffice/phpexcel": "<=1.8.1", "phpoffice/phpspreadsheet": "<=1.5", @@ -3573,8 +3578,8 @@ "titon/framework": ">=0,<9.9.99", "truckersmp/phpwhois": "<=4.3.1", "twig/twig": "<1.20", - "typo3/cms": ">=6.2,<6.2.30|>=7,<7.6.32|>=8,<8.7.21|>=9,<9.5.2", - "typo3/cms-core": ">=8,<8.7.21|>=9,<9.5.2", + "typo3/cms": ">=6.2,<6.2.30|>=7,<7.6.32|>=8,<8.7.23|>=9,<9.5.4", + "typo3/cms-core": ">=8,<8.7.23|>=9,<9.5.4", "typo3/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.10|>=3.1,<3.1.7|>=3.2,<3.2.7|>=3.3,<3.3.5", "typo3/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4", "ua-parser/uap-php": "<3.8", @@ -3626,7 +3631,7 @@ } ], "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", - "time": "2018-12-25T09:41:12+00:00" + "time": "2019-01-22T18:37:22+00:00" }, { "name": "squizlabs/php_codesniffer", @@ -3681,16 +3686,16 @@ }, { "name": "symfony/class-loader", - "version": "v3.4.20", + "version": "v3.4.21", "source": { "type": "git", "url": "https://github.com/symfony/class-loader.git", - "reference": "420458095cf60025eb0841276717e0da7f75e50e" + "reference": "4513348012c25148f8cbc3a7761a1d1e60ca3e87" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/class-loader/zipball/420458095cf60025eb0841276717e0da7f75e50e", - "reference": "420458095cf60025eb0841276717e0da7f75e50e", + "url": "https://api.github.com/repos/symfony/class-loader/zipball/4513348012c25148f8cbc3a7761a1d1e60ca3e87", + "reference": "4513348012c25148f8cbc3a7761a1d1e60ca3e87", "shasum": "" }, "require": { @@ -3733,7 +3738,7 @@ ], "description": "Symfony ClassLoader Component", "homepage": "https://symfony.com", - "time": "2018-11-11T19:48:54+00:00" + "time": "2019-01-01T13:45:19+00:00" }, { "name": "wimg/php-compatibility", From 281a24622cf310ef5577eed7422fe3961f29eb69 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 28 Jan 2019 20:16:25 +0530 Subject: [PATCH 0664/1044] Bump version v4.0.10 Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 7919852fe..2d2d68106 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.0.9 +4.0.10 From 8ff42c05f2a4244c3202bd1ec4aaa93a2e127a87 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 31 Jan 2019 20:46:33 +0530 Subject: [PATCH 0665/1044] Define nginx-proxy constant using container id Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Runner.php | 7 +++++++ php/init-ee.php | 1 - 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 29b4dd1cf..e45a46ac6 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -68,6 +68,13 @@ private function init_ee() { $check_requirements = ( [ 'site', 'cmd-dump' ] === $this->arguments ) ? false : $check_requirements; } + $nginx_proxy = 'services_global-nginx-proxy_1'; + $launch = EE::launch( sprintf( 'cd %s && docker ps -q --no-trunc | grep $(docker-compose ps -q global-nginx-proxy)', EE_SERVICE_DIR ) ); + if ( 0 === $launch->return_code ) { + $nginx_proxy = trim( $launch->stdout ); + } + define( 'EE_PROXY_TYPE', $nginx_proxy ); + if ( $check_requirements ) { $this->check_requirements(); $this->maybe_trigger_migration(); diff --git a/php/init-ee.php b/php/init-ee.php index dae0ececc..f5574d9b3 100644 --- a/php/init-ee.php +++ b/php/init-ee.php @@ -14,7 +14,6 @@ define( 'EE_BACKUP_DIR', EE_ROOT_DIR . '/.backup' ); define( 'EE_SERVICE_DIR', EE_ROOT_DIR . '/services' ); -define( 'EE_PROXY_TYPE', 'services_global-nginx-proxy_1' ); if ( file_exists( EE_ROOT . '/vendor/autoload.php' ) ) { define( 'EE_VENDOR_DIR', EE_ROOT . '/vendor' ); From c2c5553b1a1b70df9addbe35316083cf1818f702 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 12 Feb 2019 15:45:10 +0530 Subject: [PATCH 0666/1044] Print stderr using error_log Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/class-ee.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/class-ee.php b/php/class-ee.php index e33f35d70..e9dc1b0d3 100644 --- a/php/class-ee.php +++ b/php/class-ee.php @@ -889,7 +889,7 @@ public static function exec( $command, $echo_stdout = false, $echo_stderr = fals echo $results->stdout; } if ( $echo_stderr && ! $exit_on_error ) { - echo $results->stderr; + error_log( $results->stderr ); } if ( ! $results->return_code ) { return true; From 17a658b95f1f612b13c4340c66f8deca1c8bff3d Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Wed, 13 Feb 2019 10:46:46 +0530 Subject: [PATCH 0667/1044] Update symlink creation in volumes Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/class-ee-docker.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php index 4664736eb..8c0be97b2 100644 --- a/php/class-ee-docker.php +++ b/php/class-ee-docker.php @@ -253,7 +253,10 @@ public static function create_volumes( $prefix, $volumes, $update_to_docker_pref if ( ! empty( $volume['skip_volume'] ) && true === $volume['skip_volume'] ) { continue; } - $fs->mkdir( dirname( $volume['path_to_symlink'] ) ); + $path_to_symlink_not_empty = ! empty( dirname( $volume['path_to_symlink'] ) ); + if ( $path_to_symlink_not_empty ) { + $fs->mkdir( dirname( $volume['path_to_symlink'] ) ); + } EE::exec( sprintf( 'docker volume create \ @@ -265,7 +268,9 @@ public static function create_volumes( $prefix, $volumes, $update_to_docker_pref $volume['name'] ) ); - $fs->symlink( sprintf( '%s/volumes/%s_%s/_data', $docker_root_dir, $volume_prefix, $volume['name'] ), $volume['path_to_symlink'] ); + if ( $path_to_symlink_not_empty ) { + $fs->symlink( sprintf( '%s/volumes/%s_%s/_data', $docker_root_dir, $volume_prefix, $volume['name'] ), $volume['path_to_symlink'] ); + } } } From b479268a8805b61404b916bbd6e9323d1dffecea Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 14 Feb 2019 20:03:55 +0530 Subject: [PATCH 0668/1044] Update images for newrelic integration Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- img-versions.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/img-versions.json b/img-versions.json index ae9219f68..152689d7e 100644 --- a/img-versions.json +++ b/img-versions.json @@ -4,8 +4,9 @@ "easyengine/mariadb": "v4.0.0", "easyengine/nginx-proxy": "v4.0.1", "easyengine/nginx": "v4.0.0", - "easyengine/php": "v4.0.0", + "easyengine/php": "v4.0.2", "easyengine/php5.6": "v4.0.0", "easyengine/postfix": "v4.0.0", - "easyengine/redis": "v4.0.0" + "easyengine/redis": "v4.0.0", + "easyengine/newrelic-daemon": "v4.0.0" } From 2a1bc0e0957bf0f4919e816c681f13a70a84f784 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 18 Feb 2019 09:40:27 +0530 Subject: [PATCH 0669/1044] Update migration pulling of images Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Migration/Containers.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index 4cb3f77eb..44200c365 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -28,11 +28,12 @@ public static function start_container_migration() { $updated_images = []; foreach ( $img_versions as $img => $version ) { - if ( 'easyengine/php5.6' === $img ) { - continue; - } - if ( $current_versions[ $img ] !== $version ) { - $updated_images[] = $img; + if ( array_key_exists( $img, $current_versions ) ) { + if ( $current_versions[ $img ] !== $version ) { + $updated_images[] = $img; + self::pull_or_error( $img, $version ); + } + } else { self::pull_or_error( $img, $version ); } } From 1101ef187fc1f13e9852861ddcc8f4c5b8d375ce Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 14 Mar 2019 19:08:57 +0530 Subject: [PATCH 0670/1044] Fix nginx-proxy container migration Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Migration/GlobalContainers.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/php/EE/Migration/GlobalContainers.php b/php/EE/Migration/GlobalContainers.php index 498055638..89481b274 100644 --- a/php/EE/Migration/GlobalContainers.php +++ b/php/EE/Migration/GlobalContainers.php @@ -124,8 +124,13 @@ public static function global_service_down( $service_name ) { * @return array */ public static function get_all_global_images_with_service_name() { + + $launch = EE::launch( sprintf( 'docker ps -f "id=%s" --format={{.Names}}', EE_PROXY_TYPE ) ); + if ( 0 === $launch->return_code ) { + $nginx_proxy = trim( $launch->stdout ); + } return [ - 'easyengine/nginx-proxy' => EE_PROXY_TYPE, + 'easyengine/nginx-proxy' => $nginx_proxy, 'easyengine/mariadb' => GLOBAL_DB_CONTAINER, 'easyengine/redis' => GLOBAL_REDIS_CONTAINER, // 'easyengine/cron' => EE_CRON_SCHEDULER, //TODO: Add it to global docker-compose. From 789ddd7bb97eaad0033bce339a60e8cce69e4fc7 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 14 Mar 2019 20:57:54 +0530 Subject: [PATCH 0671/1044] Fix nginx-proxy container issue due to docker-compose version Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- php/EE/Migration/GlobalContainers.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/php/EE/Migration/GlobalContainers.php b/php/EE/Migration/GlobalContainers.php index 89481b274..a2f77dc2d 100644 --- a/php/EE/Migration/GlobalContainers.php +++ b/php/EE/Migration/GlobalContainers.php @@ -76,8 +76,9 @@ public static function down_global_containers( $updated_images ) { foreach ( $updated_images as $image_name ) { $global_container_name = $all_global_images[ $image_name ]; $global_service_name = ltrim( $global_container_name, 'services_' ); - $global_service_name = rtrim( $global_service_name, '_1' ); - EE::debug( "Removing $global_container_name" ); + $remove_suffix = explode( '_1', $global_service_name ); + $global_service_name = empty( $remove_suffix[0] ) ? $global_service_name : $remove_suffix[0]; + EE::debug( "Removing $global_container_name" ); if ( false !== \EE_DOCKER::container_status( $global_container_name ) ) { if ( ! EE::exec( "docker-compose stop $global_service_name && docker-compose rm -f $global_service_name" ) ) { @@ -94,8 +95,11 @@ public static function down_global_containers( $updated_images ) { * @throws \Exception */ public static function global_service_up( $service_name ) { + $global_service_name = ltrim( $service_name, 'services_' ); + $remove_suffix = explode( '_1', $global_service_name ); + $global_service_name = empty( $remove_suffix[0] ) ? $global_service_name : $remove_suffix[0]; EE::debug( 'Start ' . $service_name . ' container up' ); - if ( 'global-nginx-proxy' === $service_name ) { + if ( 'global-nginx-proxy' === $global_service_name ) { \EE\Service\Utils\nginx_proxy_check(); } else { \EE\Service\Utils\init_global_container( $service_name ); From e8655a2ab2753a1949cf5218f3be1ef3ff8c1da6 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 14 Mar 2019 20:58:09 +0530 Subject: [PATCH 0672/1044] Update nginx-proxy image for ssl fix Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- img-versions.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/img-versions.json b/img-versions.json index 152689d7e..429ee3671 100644 --- a/img-versions.json +++ b/img-versions.json @@ -2,7 +2,7 @@ "easyengine/cron": "v4.0.0", "easyengine/mailhog": "v4.0.0", "easyengine/mariadb": "v4.0.0", - "easyengine/nginx-proxy": "v4.0.1", + "easyengine/nginx-proxy": "v4.0.2", "easyengine/nginx": "v4.0.0", "easyengine/php": "v4.0.2", "easyengine/php5.6": "v4.0.0", From 0986a675e4ffd8f72981720046275953afb874ff Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 18 Mar 2019 19:44:15 +0530 Subject: [PATCH 0673/1044] Update composer with latest tagged repos Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- composer.json | 10 +++--- composer.lock | 91 ++++++++++++++++++++++++++------------------------- 2 files changed, 51 insertions(+), 50 deletions(-) diff --git a/composer.json b/composer.json index 983b74b47..81861e20f 100644 --- a/composer.json +++ b/composer.json @@ -33,11 +33,11 @@ "easyengine/cron-command": "v1.0.2", "easyengine/log-command": "v1.0.1", "easyengine/mailhog-command": "v1.0.2", - "easyengine/site-command": "v2.3.0", - "easyengine/site-type-wp": "v1.0.8", - "easyengine/site-type-php": "v1.0.8", - "easyengine/service-command": "v1.0.8", - "easyengine/shell-command" : "v1.0.2", + "easyengine/site-command": "v2.3.1", + "easyengine/site-type-wp": "v1.0.9", + "easyengine/site-type-php": "v1.0.9", + "easyengine/service-command": "v1.0.9", + "easyengine/shell-command" : "v1.0.3", "justinrainbow/json-schema": "5.2.7", "monolog/monolog": "1.24.0", "mustache/mustache": "2.12.0", diff --git a/composer.lock b/composer.lock index 4c7a00a6c..de67b840c 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": "486b50e1e6a2f935fdc989f32415e18f", + "content-hash": "e5041e349d0a9f0b3f93d7f356d5efb7", "packages": [ { "name": "acmephp/core", @@ -440,16 +440,16 @@ }, { "name": "composer/xdebug-handler", - "version": "1.3.1", + "version": "1.3.2", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "dc523135366eb68f22268d069ea7749486458562" + "reference": "d17708133b6c276d6e42ef887a877866b909d892" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/dc523135366eb68f22268d069ea7749486458562", - "reference": "dc523135366eb68f22268d069ea7749486458562", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/d17708133b6c276d6e42ef887a877866b909d892", + "reference": "d17708133b6c276d6e42ef887a877866b909d892", "shasum": "" }, "require": { @@ -480,7 +480,7 @@ "Xdebug", "performance" ], - "time": "2018-11-29T10:59:02+00:00" + "time": "2019-01-28T20:25:53+00:00" }, { "name": "easyengine/admin-tools-command", @@ -744,16 +744,16 @@ }, { "name": "easyengine/service-command", - "version": "v1.0.8", + "version": "v1.0.9", "source": { "type": "git", "url": "https://github.com/EasyEngine/service-command.git", - "reference": "42bdb645f0e38cf89a374a9429f8d1666991a819" + "reference": "a89766e23912ad258b29f25087dd3008edc4ccea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/42bdb645f0e38cf89a374a9429f8d1666991a819", - "reference": "42bdb645f0e38cf89a374a9429f8d1666991a819", + "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/a89766e23912ad258b29f25087dd3008edc4ccea", + "reference": "a89766e23912ad258b29f25087dd3008edc4ccea", "shasum": "" }, "type": "ee-cli-package", @@ -785,20 +785,20 @@ ], "description": "Command to manager global containers/services in EasyEngine", "homepage": "https://github.com/easyengine/service-command", - "time": "2018-12-28T16:08:40+00:00" + "time": "2019-03-18T13:40:55+00:00" }, { "name": "easyengine/shell-command", - "version": "v1.0.2", + "version": "v1.0.3", "source": { "type": "git", "url": "https://github.com/EasyEngine/shell-command.git", - "reference": "e6dd5ac7278752951f96fb5026b88ad1701c4388" + "reference": "30500e3d1e8aeb3b9e9ac48b92dcbab3841e3beb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/shell-command/zipball/e6dd5ac7278752951f96fb5026b88ad1701c4388", - "reference": "e6dd5ac7278752951f96fb5026b88ad1701c4388", + "url": "https://api.github.com/repos/EasyEngine/shell-command/zipball/30500e3d1e8aeb3b9e9ac48b92dcbab3841e3beb", + "reference": "30500e3d1e8aeb3b9e9ac48b92dcbab3841e3beb", "shasum": "" }, "type": "ee-cli-package", @@ -825,20 +825,20 @@ ], "description": "Shell to run helpful commands inside containers.", "homepage": "https://github.com/easyengine/shell-command", - "time": "2018-12-28T16:06:33+00:00" + "time": "2019-03-18T13:42:13+00:00" }, { "name": "easyengine/site-command", - "version": "v2.3.0", + "version": "v2.3.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "eded69eee18097aab8b632647a53e54165182d0f" + "reference": "df545c427445dccf7ce5e0fdb27c8cc786ab0b0c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/eded69eee18097aab8b632647a53e54165182d0f", - "reference": "eded69eee18097aab8b632647a53e54165182d0f", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/df545c427445dccf7ce5e0fdb27c8cc786ab0b0c", + "reference": "df545c427445dccf7ce5e0fdb27c8cc786ab0b0c", "shasum": "" }, "require": { @@ -888,20 +888,20 @@ "MIT" ], "homepage": "https://github.com/easyengine/site-command", - "time": "2019-01-28T13:34:56+00:00" + "time": "2019-03-18T13:37:34+00:00" }, { "name": "easyengine/site-type-php", - "version": "v1.0.8", + "version": "v1.0.9", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-php.git", - "reference": "2001602f4d300fad6f0371904ea9db5ddd2c52f3" + "reference": "eedb100899c6c7b065ce87c379f7349d6b4474e2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/2001602f4d300fad6f0371904ea9db5ddd2c52f3", - "reference": "2001602f4d300fad6f0371904ea9db5ddd2c52f3", + "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/eedb100899c6c7b065ce87c379f7349d6b4474e2", + "reference": "eedb100899c6c7b065ce87c379f7349d6b4474e2", "shasum": "" }, "require-dev": { @@ -943,20 +943,20 @@ ], "description": "EasyEngine package for PHP site creation.", "homepage": "https://github.com/easyengine/site-type-php", - "time": "2019-01-28T13:38:36+00:00" + "time": "2019-03-18T13:40:34+00:00" }, { "name": "easyengine/site-type-wp", - "version": "v1.0.8", + "version": "v1.0.9", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-wp.git", - "reference": "b42ca3b57de5552fc967e4e7c1794c4bfdc4da53" + "reference": "e3f94d4db7dbc911bcf3a80abe2ea350d7ba59a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/b42ca3b57de5552fc967e4e7c1794c4bfdc4da53", - "reference": "b42ca3b57de5552fc967e4e7c1794c4bfdc4da53", + "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/e3f94d4db7dbc911bcf3a80abe2ea350d7ba59a7", + "reference": "e3f94d4db7dbc911bcf3a80abe2ea350d7ba59a7", "shasum": "" }, "require-dev": { @@ -998,7 +998,7 @@ ], "description": "EasyEngine site type package for WordPress site creation.", "homepage": "https://github.com/easyengine/site-type-wp", - "time": "2019-01-28T13:36:34+00:00" + "time": "2019-03-18T13:40:26+00:00" }, { "name": "guzzlehttp/guzzle", @@ -2252,7 +2252,7 @@ }, { "name": "Gert de Pagter", - "email": "backendtea@gmail.com" + "email": "BackEndTea@gmail.com" } ], "description": "Symfony polyfill for ctype functions", @@ -3427,6 +3427,7 @@ "mock", "xunit" ], + "abandoned": true, "time": "2013-01-13T10:24:48+00:00" }, { @@ -3435,12 +3436,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "db876706aacd4ffbd1c253358d19a651e50e65c2" + "reference": "3521da8036ce31b11490433aaae47f9601774191" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/db876706aacd4ffbd1c253358d19a651e50e65c2", - "reference": "db876706aacd4ffbd1c253358d19a651e50e65c2", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/3521da8036ce31b11490433aaae47f9601774191", + "reference": "3521da8036ce31b11490433aaae47f9601774191", "shasum": "" }, "conflict": { @@ -3475,8 +3476,8 @@ "doctrine/mongodb-odm-bundle": ">=2,<3.0.1", "doctrine/orm": ">=2,<2.4.8|>=2.5,<2.5.1", "dompdf/dompdf": ">=0.6,<0.6.2", - "drupal/core": ">=7,<7.60|>=8,<8.5.8|>=8.6,<8.6.2", - "drupal/drupal": ">=7,<7.60|>=8,<8.5.8|>=8.6,<8.6.2", + "drupal/core": ">=7,<7.62|>=8,<8.5.11|>=8.6,<8.6.10", + "drupal/drupal": ">=7,<7.62|>=8,<8.5.11|>=8.6,<8.6.10", "erusev/parsedown": "<1.7", "ezsystems/ezpublish-kernel": ">=5.3,<5.3.12.1|>=5.4,<5.4.13.1|>=6,<6.7.9.1|>=6.8,<6.13.5.1|>=7,<7.2.4.1|>=7.3,<7.3.2.1", "ezsystems/ezpublish-legacy": ">=5.3,<5.3.12.6|>=5.4,<5.4.12.3|>=2011,<2017.12.4.3|>=2018.6,<2018.6.1.4|>=2018.9,<2018.9.1.3", @@ -3535,7 +3536,7 @@ "shopware/shopware": "<5.3.7", "silverstripe/cms": ">=3,<=3.0.11|>=3.1,<3.1.11", "silverstripe/forum": "<=0.6.1|>=0.7,<=0.7.3", - "silverstripe/framework": ">=3,<3.3", + "silverstripe/framework": ">=3,<3.6.7|>=3.7,<3.7.3|>=4,<4.0.7|>=4.1,<4.1.5|>=4.2,<4.2.4|>=4.3,<4.3.1", "silverstripe/userforms": "<3", "simple-updates/phpwhois": "<=1", "simplesamlphp/saml2": "<1.10.6|>=2,<2.3.8|>=3,<3.1.4", @@ -3577,7 +3578,7 @@ "theonedemon/phpwhois": "<=4.2.5", "titon/framework": ">=0,<9.9.99", "truckersmp/phpwhois": "<=4.3.1", - "twig/twig": "<1.20", + "twig/twig": "<1.38|>=2,<2.7", "typo3/cms": ">=6.2,<6.2.30|>=7,<7.6.32|>=8,<8.7.23|>=9,<9.5.4", "typo3/cms-core": ">=8,<8.7.23|>=9,<9.5.4", "typo3/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.10|>=3.1,<3.1.7|>=3.2,<3.2.7|>=3.3,<3.3.5", @@ -3631,7 +3632,7 @@ } ], "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", - "time": "2019-01-22T18:37:22+00:00" + "time": "2019-03-12T13:04:55+00:00" }, { "name": "squizlabs/php_codesniffer", @@ -3686,16 +3687,16 @@ }, { "name": "symfony/class-loader", - "version": "v3.4.21", + "version": "v3.4.23", "source": { "type": "git", "url": "https://github.com/symfony/class-loader.git", - "reference": "4513348012c25148f8cbc3a7761a1d1e60ca3e87" + "reference": "4459eef5298dedfb69f771186a580062b8516497" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/class-loader/zipball/4513348012c25148f8cbc3a7761a1d1e60ca3e87", - "reference": "4513348012c25148f8cbc3a7761a1d1e60ca3e87", + "url": "https://api.github.com/repos/symfony/class-loader/zipball/4459eef5298dedfb69f771186a580062b8516497", + "reference": "4459eef5298dedfb69f771186a580062b8516497", "shasum": "" }, "require": { @@ -3738,7 +3739,7 @@ ], "description": "Symfony ClassLoader Component", "homepage": "https://symfony.com", - "time": "2019-01-01T13:45:19+00:00" + "time": "2019-01-16T09:39:14+00:00" }, { "name": "wimg/php-compatibility", From f55eb6cd655e757b1161a06611caa6f00f29af38 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 18 Mar 2019 19:45:26 +0530 Subject: [PATCH 0674/1044] Bump version v4.0.11 Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 2d2d68106..30b26dfb1 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.0.10 +4.0.11 From 444dc497528e0f82a71d31206af84d16d053b115 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 28 Mar 2019 17:44:58 +0530 Subject: [PATCH 0675/1044] Add initial skipping of additional images Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- ...81016052850_easyengine_insert_docker_images_version.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/migrations/db/20181016052850_easyengine_insert_docker_images_version.php b/migrations/db/20181016052850_easyengine_insert_docker_images_version.php index 5a8674327..84f29dae6 100644 --- a/migrations/db/20181016052850_easyengine_insert_docker_images_version.php +++ b/migrations/db/20181016052850_easyengine_insert_docker_images_version.php @@ -31,8 +31,13 @@ public function up() { $images = EE\Utils\get_image_versions(); $query = ''; + $skip_download = [ + 'easyengine/php5.6', + 'easyengine/php7.3', + 'easyengine/newrelic-daemon', + ]; foreach ( $images as $image => $tag ) { - if ( 'easyengine/php5.6' === $image ) { + if ( in_array( $image, $skip_download ) ) { continue; } EE::log( "Checking and Pulling docker image $image:$tag" ); From a02ec537eb6ef16f5965366c60aac1b4f3b34932 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 28 Mar 2019 17:45:13 +0530 Subject: [PATCH 0676/1044] Add PHP 7.3 image Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- img-versions.json | 1 + 1 file changed, 1 insertion(+) diff --git a/img-versions.json b/img-versions.json index 429ee3671..4f876dd62 100644 --- a/img-versions.json +++ b/img-versions.json @@ -6,6 +6,7 @@ "easyengine/nginx": "v4.0.0", "easyengine/php": "v4.0.2", "easyengine/php5.6": "v4.0.0", + "easyengine/php5.6": "v4.0.0", "easyengine/postfix": "v4.0.0", "easyengine/redis": "v4.0.0", "easyengine/newrelic-daemon": "v4.0.0" From ef2b2d3a731941786f5a3dc5daea112899ef31c9 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 28 Mar 2019 17:45:13 +0530 Subject: [PATCH 0677/1044] Add PHP 7.3 image Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- img-versions.json | 1 + 1 file changed, 1 insertion(+) diff --git a/img-versions.json b/img-versions.json index 429ee3671..7579ffdba 100644 --- a/img-versions.json +++ b/img-versions.json @@ -6,6 +6,7 @@ "easyengine/nginx": "v4.0.0", "easyengine/php": "v4.0.2", "easyengine/php5.6": "v4.0.0", + "easyengine/php7.3": "v4.0.0", "easyengine/postfix": "v4.0.0", "easyengine/redis": "v4.0.0", "easyengine/newrelic-daemon": "v4.0.0" From 6b28e76f78a14f63dc301dfa40a3e9115c2bdcf5 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 9 Apr 2019 17:17:38 +0530 Subject: [PATCH 0678/1044] Skip downloading php 7.0 by default Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- .../20181016052850_easyengine_insert_docker_images_version.php | 1 + 1 file changed, 1 insertion(+) diff --git a/migrations/db/20181016052850_easyengine_insert_docker_images_version.php b/migrations/db/20181016052850_easyengine_insert_docker_images_version.php index 84f29dae6..e2411b6dc 100644 --- a/migrations/db/20181016052850_easyengine_insert_docker_images_version.php +++ b/migrations/db/20181016052850_easyengine_insert_docker_images_version.php @@ -33,6 +33,7 @@ public function up() { $query = ''; $skip_download = [ 'easyengine/php5.6', + 'easyengine/php7.0', 'easyengine/php7.3', 'easyengine/newrelic-daemon', ]; From f92e7772511f7a72ebf69f46220bcfa9e7c4c603 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 9 Apr 2019 18:17:25 +0530 Subject: [PATCH 0679/1044] Update composer with latest tagged repos Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- composer.json | 6 +-- composer.lock | 106 +++++++++++++++++++++++++------------------------- 2 files changed, 56 insertions(+), 56 deletions(-) diff --git a/composer.json b/composer.json index 81861e20f..7fb7272f2 100644 --- a/composer.json +++ b/composer.json @@ -27,15 +27,15 @@ "php": ">=7.0", "composer/composer": "1.7.3", "composer/semver": "1.4.2", - "easyengine/admin-tools-command": "v1.0.6", + "easyengine/admin-tools-command": "v1.0.8", "easyengine/auth-command": "v1.0.2", "easyengine/config-command": "v1.0.2", "easyengine/cron-command": "v1.0.2", "easyengine/log-command": "v1.0.1", "easyengine/mailhog-command": "v1.0.2", "easyengine/site-command": "v2.3.1", - "easyengine/site-type-wp": "v1.0.9", - "easyengine/site-type-php": "v1.0.9", + "easyengine/site-type-wp": "v1.0.10", + "easyengine/site-type-php": "v1.0.10", "easyengine/service-command": "v1.0.9", "easyengine/shell-command" : "v1.0.3", "justinrainbow/json-schema": "5.2.7", diff --git a/composer.lock b/composer.lock index de67b840c..39ae47912 100644 --- a/composer.lock +++ b/composer.lock @@ -1,10 +1,10 @@ { "_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", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "e5041e349d0a9f0b3f93d7f356d5efb7", + "content-hash": "22f2ea4f93b3b5208ece8d16852b6818", "packages": [ { "name": "acmephp/core", @@ -379,24 +379,23 @@ }, { "name": "composer/spdx-licenses", - "version": "1.5.0", + "version": "1.5.1", "source": { "type": "git", "url": "https://github.com/composer/spdx-licenses.git", - "reference": "7a9556b22bd9d4df7cad89876b00af58ef20d3a2" + "reference": "a1aa51cf3ab838b83b0867b14e56fc20fbd55b3d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/7a9556b22bd9d4df7cad89876b00af58ef20d3a2", - "reference": "7a9556b22bd9d4df7cad89876b00af58ef20d3a2", + "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/a1aa51cf3ab838b83b0867b14e56fc20fbd55b3d", + "reference": "a1aa51cf3ab838b83b0867b14e56fc20fbd55b3d", "shasum": "" }, "require": { - "php": "^5.3.2 || ^7.0" + "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5", - "phpunit/phpunit-mock-objects": "2.3.0 || ^3.0" + "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 7" }, "type": "library", "extra": { @@ -436,7 +435,7 @@ "spdx", "validator" ], - "time": "2018-11-01T09:45:54+00:00" + "time": "2019-03-26T10:23:26+00:00" }, { "name": "composer/xdebug-handler", @@ -484,16 +483,16 @@ }, { "name": "easyengine/admin-tools-command", - "version": "v1.0.6", + "version": "v1.0.8", "source": { "type": "git", "url": "https://github.com/EasyEngine/admin-tools-command.git", - "reference": "b2074b210c312aa17c89b2b1591c7d221cb3e523" + "reference": "68904df32c4126d2062b2c0dbaa6ec8c544b1879" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/admin-tools-command/zipball/b2074b210c312aa17c89b2b1591c7d221cb3e523", - "reference": "b2074b210c312aa17c89b2b1591c7d221cb3e523", + "url": "https://api.github.com/repos/EasyEngine/admin-tools-command/zipball/68904df32c4126d2062b2c0dbaa6ec8c544b1879", + "reference": "68904df32c4126d2062b2c0dbaa6ec8c544b1879", "shasum": "" }, "type": "ee-cli-package", @@ -522,7 +521,7 @@ ], "description": "Command to manage admin tools for php based sites.", "homepage": "https://github.com/easyengine/amdin-tools", - "time": "2019-01-28T13:39:55+00:00" + "time": "2019-04-09T12:36:14+00:00" }, { "name": "easyengine/auth-command", @@ -892,16 +891,16 @@ }, { "name": "easyengine/site-type-php", - "version": "v1.0.9", + "version": "v1.0.10", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-php.git", - "reference": "eedb100899c6c7b065ce87c379f7349d6b4474e2" + "reference": "b2b86d4105301396decf5cfd19e22ed2b3f7a73f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/eedb100899c6c7b065ce87c379f7349d6b4474e2", - "reference": "eedb100899c6c7b065ce87c379f7349d6b4474e2", + "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/b2b86d4105301396decf5cfd19e22ed2b3f7a73f", + "reference": "b2b86d4105301396decf5cfd19e22ed2b3f7a73f", "shasum": "" }, "require-dev": { @@ -943,20 +942,20 @@ ], "description": "EasyEngine package for PHP site creation.", "homepage": "https://github.com/easyengine/site-type-php", - "time": "2019-03-18T13:40:34+00:00" + "time": "2019-04-09T11:50:40+00:00" }, { "name": "easyengine/site-type-wp", - "version": "v1.0.9", + "version": "v1.0.10", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-wp.git", - "reference": "e3f94d4db7dbc911bcf3a80abe2ea350d7ba59a7" + "reference": "903636756bfdaffcd107743611ae9e2b9424f76f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/e3f94d4db7dbc911bcf3a80abe2ea350d7ba59a7", - "reference": "e3f94d4db7dbc911bcf3a80abe2ea350d7ba59a7", + "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/903636756bfdaffcd107743611ae9e2b9424f76f", + "reference": "903636756bfdaffcd107743611ae9e2b9424f76f", "shasum": "" }, "require-dev": { @@ -998,7 +997,7 @@ ], "description": "EasyEngine site type package for WordPress site creation.", "homepage": "https://github.com/easyengine/site-type-wp", - "time": "2019-03-18T13:40:26+00:00" + "time": "2019-04-09T11:50:40+00:00" }, { "name": "guzzlehttp/guzzle", @@ -2209,16 +2208,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.10.0", + "version": "v1.11.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" + "reference": "82ebae02209c21113908c229e9883c419720738a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", - "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/82ebae02209c21113908c229e9883c419720738a", + "reference": "82ebae02209c21113908c229e9883c419720738a", "shasum": "" }, "require": { @@ -2230,7 +2229,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.9-dev" + "dev-master": "1.11-dev" } }, "autoload": { @@ -2252,7 +2251,7 @@ }, { "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" + "email": "backendtea@gmail.com" } ], "description": "Symfony polyfill for ctype functions", @@ -2263,20 +2262,20 @@ "polyfill", "portable" ], - "time": "2018-08-06T14:22:27+00:00" + "time": "2019-02-06T07:57:58+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.10.0", + "version": "v1.11.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" + "reference": "fe5e94c604826c35a32fa832f35bd036b6799609" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", - "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fe5e94c604826c35a32fa832f35bd036b6799609", + "reference": "fe5e94c604826c35a32fa832f35bd036b6799609", "shasum": "" }, "require": { @@ -2288,7 +2287,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.9-dev" + "dev-master": "1.11-dev" } }, "autoload": { @@ -2322,7 +2321,7 @@ "portable", "shim" ], - "time": "2018-09-21T13:07:52+00:00" + "time": "2019-02-06T07:57:58+00:00" }, { "name": "symfony/process", @@ -3436,12 +3435,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "3521da8036ce31b11490433aaae47f9601774191" + "reference": "bd4dca680a7af3fb99f07dd9c0511f3fb8d066af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/3521da8036ce31b11490433aaae47f9601774191", - "reference": "3521da8036ce31b11490433aaae47f9601774191", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/bd4dca680a7af3fb99f07dd9c0511f3fb8d066af", + "reference": "bd4dca680a7af3fb99f07dd9c0511f3fb8d066af", "shasum": "" }, "conflict": { @@ -3476,9 +3475,9 @@ "doctrine/mongodb-odm-bundle": ">=2,<3.0.1", "doctrine/orm": ">=2,<2.4.8|>=2.5,<2.5.1", "dompdf/dompdf": ">=0.6,<0.6.2", - "drupal/core": ">=7,<7.62|>=8,<8.5.11|>=8.6,<8.6.10", - "drupal/drupal": ">=7,<7.62|>=8,<8.5.11|>=8.6,<8.6.10", - "erusev/parsedown": "<1.7", + "drupal/core": ">=7,<7.64|>=8,<8.5.13|>=8.6,<8.6.12", + "drupal/drupal": ">=7,<7.64|>=8,<8.5.13|>=8.6,<8.6.12", + "erusev/parsedown": "<1.7.2", "ezsystems/ezpublish-kernel": ">=5.3,<5.3.12.1|>=5.4,<5.4.13.1|>=6,<6.7.9.1|>=6.8,<6.13.5.1|>=7,<7.2.4.1|>=7.3,<7.3.2.1", "ezsystems/ezpublish-legacy": ">=5.3,<5.3.12.6|>=5.4,<5.4.12.3|>=2011,<2017.12.4.3|>=2018.6,<2018.6.1.4|>=2018.9,<2018.9.1.3", "ezsystems/repository-forms": ">=2.3,<2.3.2.1", @@ -3505,7 +3504,7 @@ "la-haute-societe/tcpdf": "<6.2.22", "laravel/framework": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.42|>=5.6,<5.6.30", "laravel/socialite": ">=1,<1.0.99|>=2,<2.0.10", - "league/commonmark": ">=0.15.6,<0.18.1", + "league/commonmark": "<0.18.3", "magento/magento1ce": "<1.9.4", "magento/magento1ee": ">=1.9,<1.14.4", "magento/product-community-edition": ">=2,<2.2.7", @@ -3598,6 +3597,7 @@ "zendframework/zend-captcha": ">=2,<2.4.9|>=2.5,<2.5.2", "zendframework/zend-crypt": ">=2,<2.4.9|>=2.5,<2.5.2", "zendframework/zend-db": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.10|>=2.3,<2.3.5", + "zendframework/zend-developer-tools": ">=1.2.2,<1.2.3", "zendframework/zend-diactoros": ">=1,<1.8.4", "zendframework/zend-feed": ">=1,<2.10.3", "zendframework/zend-form": ">=2,<2.2.7|>=2.3,<2.3.1", @@ -3632,20 +3632,20 @@ } ], "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", - "time": "2019-03-12T13:04:55+00:00" + "time": "2019-04-07T10:25:46+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.4.0", + "version": "3.4.1", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "379deb987e26c7cd103a7b387aea178baec96e48" + "reference": "5b4333b4010625d29580eb4a41f1e53251be6baa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/379deb987e26c7cd103a7b387aea178baec96e48", - "reference": "379deb987e26c7cd103a7b387aea178baec96e48", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/5b4333b4010625d29580eb4a41f1e53251be6baa", + "reference": "5b4333b4010625d29580eb4a41f1e53251be6baa", "shasum": "" }, "require": { @@ -3678,16 +3678,16 @@ } ], "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "http://www.squizlabs.com/php-codesniffer", + "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", "keywords": [ "phpcs", "standards" ], - "time": "2018-12-19T23:57:18+00:00" + "time": "2019-03-19T03:22:27+00:00" }, { "name": "symfony/class-loader", - "version": "v3.4.23", + "version": "v3.4.24", "source": { "type": "git", "url": "https://github.com/symfony/class-loader.git", From c1af5fc13ae1266f83ca6ca66a33962d4541cec0 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 9 Apr 2019 18:17:32 +0530 Subject: [PATCH 0680/1044] Bump version v4.0.12 Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 30b26dfb1..4c05e4ef5 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.0.11 +4.0.12 From d5e58e600892baa4081214db4bd4280d9bcc0f14 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Fri, 3 May 2019 16:50:24 +0530 Subject: [PATCH 0681/1044] Update docker images for config updates Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- img-versions.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/img-versions.json b/img-versions.json index 54c4a6542..102abe575 100644 --- a/img-versions.json +++ b/img-versions.json @@ -2,9 +2,9 @@ "easyengine/cron": "v4.0.0", "easyengine/mailhog": "v4.0.0", "easyengine/mariadb": "v4.0.0", - "easyengine/nginx-proxy": "v4.0.2", - "easyengine/nginx": "v4.0.0", - "easyengine/php": "v4.0.2", + "easyengine/nginx-proxy": "v4.0.3", + "easyengine/nginx": "v4.0.3", + "easyengine/php": "v4.0.3", "easyengine/php5.6": "v4.0.0", "easyengine/php7.0": "v4.0.0", "easyengine/php7.3": "v4.0.0", From 089ab0b4938603489cd3f66608a338dbcdee8722 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 6 May 2019 17:58:33 +0530 Subject: [PATCH 0682/1044] Update test running and travis config Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- .travis.yml | 7 +++---- ci/test-commands.sh | 23 ++++++++++++++++------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2d6e97b01..a351de5a0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ sudo: required - +dist: xenial language: php -php: 7.0 +php: 7.2 env: global: @@ -28,12 +28,11 @@ install: if [[ "$TRAVIS_BRANCH" = "master" ]]; then composer install --no-interaction else - composer update + composer install --no-interaction fi - sudo ./ci/test-env-install.sh before_script: - - composer validate - ./ci/prepare.sh script: diff --git a/ci/test-commands.sh b/ci/test-commands.sh index 918f892b5..080969227 100755 --- a/ci/test-commands.sh +++ b/ci/test-commands.sh @@ -1,12 +1,21 @@ #!/bin/bash - +set -ex # called by Travis CI -# Add certificates -./vendor/easyengine/site-command/ci/add-test-certs.sh > /dev/null +#repos=$(find vendor/easyengine -type d -name 'features') +sub_commands=( + vendor/easyengine/site-command/features + vendor/easyengine/site-type-php/features + vendor/easyengine/site-type-wp/features +) -for repo in "$(find vendor/easyengine -type d -name 'features')"; do - rsync -a --delete $repo/ features > /dev/null - echo "Running tests for $repo" - sudo ./vendor/bin/behat +for command in "${sub_commands[@]}"; do + IFS='/' read -r -a array <<< "$command" + rm -rf features/* + rsync -avP --delete $command/ features/ + for file in features/*.feature; do mv "$file" "${file%.feature}_${array[2]}.feature"; done + composer du + echo "Running tests for $command" + export COMPOSE_INTERACTIVE_NO_CLI=1 + sudo ./vendor/bin/behat done \ No newline at end of file From f499482adaff79bb6fffc93924c25f53ba2408c8 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 7 May 2019 10:05:09 +0530 Subject: [PATCH 0683/1044] Update composer packages acc to roave/security-advisories Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- composer.json | 2 +- composer.lock | 69 +++++++++++++++++++++++++++------------------------ 2 files changed, 37 insertions(+), 34 deletions(-) diff --git a/composer.json b/composer.json index 7fb7272f2..9d2fbd8aa 100644 --- a/composer.json +++ b/composer.json @@ -45,7 +45,7 @@ "symfony/config": "3.4.18", "symfony/console": "3.4.18", "symfony/debug": "3.4.18", - "symfony/dependency-injection": "3.4.18", + "symfony/dependency-injection": "3.4.27", "symfony/event-dispatcher": "3.4.18", "symfony/filesystem": "3.4.18", "symfony/finder": "3.4.18", diff --git a/composer.lock b/composer.lock index 39ae47912..4e7a6260d 100644 --- a/composer.lock +++ b/composer.lock @@ -1,10 +1,10 @@ { "_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#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "22f2ea4f93b3b5208ece8d16852b6818", + "content-hash": "4bbbdd5b9f57939c47301ac10ff5a9ca", "packages": [ { "name": "acmephp/core", @@ -1975,16 +1975,16 @@ }, { "name": "symfony/dependency-injection", - "version": "v3.4.18", + "version": "v3.4.27", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "9c98452ac7fff4b538956775630bc9701f5384ba" + "reference": "be0feb3fa202aedfd8d1956f2dafd563fb13acbf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/9c98452ac7fff4b538956775630bc9701f5384ba", - "reference": "9c98452ac7fff4b538956775630bc9701f5384ba", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/be0feb3fa202aedfd8d1956f2dafd563fb13acbf", + "reference": "be0feb3fa202aedfd8d1956f2dafd563fb13acbf", "shasum": "" }, "require": { @@ -2042,7 +2042,7 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2018-10-31T10:49:51+00:00" + "time": "2019-04-20T15:32:49+00:00" }, { "name": "symfony/event-dispatcher", @@ -3435,12 +3435,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "bd4dca680a7af3fb99f07dd9c0511f3fb8d066af" + "reference": "21ad2a8155dd437a0926a4d1fedb991bebd4810b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/bd4dca680a7af3fb99f07dd9c0511f3fb8d066af", - "reference": "bd4dca680a7af3fb99f07dd9c0511f3fb8d066af", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/21ad2a8155dd437a0926a4d1fedb991bebd4810b", + "reference": "21ad2a8155dd437a0926a4d1fedb991bebd4810b", "shasum": "" }, "conflict": { @@ -3454,14 +3454,14 @@ "aws/aws-sdk-php": ">=3,<3.2.1", "brightlocal/phpwhois": "<=4.2.5", "bugsnag/bugsnag-laravel": ">=2,<2.0.2", - "cakephp/cakephp": ">=1.3,<1.3.18|>=2,<2.4.99|>=2.5,<2.5.99|>=2.6,<2.6.12|>=2.7,<2.7.6|>=3,<3.0.15|>=3.1,<3.1.4|>=3.4,<3.4.14|>=3.5,<3.5.17|>=3.6,<3.6.4", + "cakephp/cakephp": ">=1.3,<1.3.18|>=2,<2.4.99|>=2.5,<2.5.99|>=2.6,<2.6.12|>=2.7,<2.7.6|>=3,<3.5.18|>=3.6,<3.6.15|>=3.7,<3.7.7", "cart2quote/module-quotation": ">=4.1.6,<=4.4.5|>=5,<5.4.4", "cartalyst/sentry": "<=2.1.6", "codeigniter/framework": "<=3.0.6", "composer/composer": "<=1.0.0-alpha11", "contao-components/mediaelement": ">=2.14.2,<2.21.1", - "contao/core": ">=2,<3.5.35", - "contao/core-bundle": ">=4,<4.4.18|>=4.5,<4.5.8", + "contao/core": ">=2,<3.5.39", + "contao/core-bundle": ">=4,<4.4.39|>=4.5,<4.7.5", "contao/listing-bundle": ">=4,<4.4.8", "contao/newsletter-bundle": ">=4,<4.1", "david-garcia/phpwhois": "<=4.3.1", @@ -3475,8 +3475,8 @@ "doctrine/mongodb-odm-bundle": ">=2,<3.0.1", "doctrine/orm": ">=2,<2.4.8|>=2.5,<2.5.1", "dompdf/dompdf": ">=0.6,<0.6.2", - "drupal/core": ">=7,<7.64|>=8,<8.5.13|>=8.6,<8.6.12", - "drupal/drupal": ">=7,<7.64|>=8,<8.5.13|>=8.6,<8.6.12", + "drupal/core": ">=7,<7.65|>=8,<8.5.14|>=8.6,<8.6.14", + "drupal/drupal": ">=7,<7.65|>=8,<8.5.14|>=8.6,<8.6.14", "erusev/parsedown": "<1.7.2", "ezsystems/ezpublish-kernel": ">=5.3,<5.3.12.1|>=5.4,<5.4.13.1|>=6,<6.7.9.1|>=6.8,<6.13.5.1|>=7,<7.2.4.1|>=7.3,<7.3.2.1", "ezsystems/ezpublish-legacy": ">=5.3,<5.3.12.6|>=5.4,<5.4.12.3|>=2011,<2017.12.4.3|>=2018.6,<2018.6.1.4|>=2018.9,<2018.9.1.3", @@ -3505,9 +3505,9 @@ "laravel/framework": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.42|>=5.6,<5.6.30", "laravel/socialite": ">=1,<1.0.99|>=2,<2.0.10", "league/commonmark": "<0.18.3", - "magento/magento1ce": "<1.9.4", - "magento/magento1ee": ">=1.9,<1.14.4", - "magento/product-community-edition": ">=2,<2.2.7", + "magento/magento1ce": "<1.9.4.1", + "magento/magento1ee": ">=1.9,<1.14.4.1", + "magento/product-community-edition": ">=2,<2.2.8|>=2.3,<2.3.1", "monolog/monolog": ">=1.8,<1.12", "namshi/jose": "<2.2", "onelogin/php-saml": "<2.10.4", @@ -3539,7 +3539,7 @@ "silverstripe/userforms": "<3", "simple-updates/phpwhois": "<=1", "simplesamlphp/saml2": "<1.10.6|>=2,<2.3.8|>=3,<3.1.4", - "simplesamlphp/simplesamlphp": "<1.16.3", + "simplesamlphp/simplesamlphp": "<1.15.2|>=1.16,<1.16.3", "simplesamlphp/simplesamlphp-module-infocard": "<1.0.1", "slim/slim": "<2.6", "smarty/smarty": "<3.1.33", @@ -3550,30 +3550,33 @@ "swiftmailer/swiftmailer": ">=4,<5.4.5", "sylius/admin-bundle": ">=1,<1.0.17|>=1.1,<1.1.9|>=1.2,<1.2.2", "sylius/sylius": ">=1,<1.0.17|>=1.1,<1.1.9|>=1.2,<1.2.2", - "symfony/dependency-injection": ">=2,<2.0.17", + "symfony/cache": ">=3.2,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", + "symfony/dependency-injection": ">=2,<2.0.17|>=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", "symfony/form": ">=2.3,<2.3.35|>=2.4,<2.6.12|>=2.7,<2.7.50|>=2.8,<2.8.49|>=3,<3.4.20|>=4,<4.0.15|>=4.1,<4.1.9|>=4.2,<4.2.1", - "symfony/framework-bundle": ">=2,<2.3.18|>=2.4,<2.4.8|>=2.5,<2.5.2", - "symfony/http-foundation": ">=2,<2.7.49|>=2.8,<2.8.44|>=3,<3.3.18|>=3.4,<3.4.14|>=4,<4.0.14|>=4.1,<4.1.3", + "symfony/framework-bundle": ">=2,<2.3.18|>=2.4,<2.4.8|>=2.5,<2.5.2|>=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", + "symfony/http-foundation": ">=2,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", "symfony/http-kernel": ">=2,<2.3.29|>=2.4,<2.5.12|>=2.6,<2.6.8", "symfony/intl": ">=2.7,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", + "symfony/phpunit-bridge": ">=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", "symfony/polyfill": ">=1,<1.10", "symfony/polyfill-php55": ">=1,<1.10", + "symfony/proxy-manager-bridge": ">=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", "symfony/routing": ">=2,<2.0.19", - "symfony/security": ">=2,<2.7.50|>=2.8,<2.8.49|>=3,<3.4.19|>=4,<4.0.15|>=4.1,<4.1.9|>=4.2,<4.2.1", + "symfony/security": ">=2,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", "symfony/security-bundle": ">=2,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", "symfony/security-core": ">=2.4,<2.6.13|>=2.7,<2.7.9|>=2.7.30,<2.7.32|>=2.8,<2.8.37|>=3,<3.3.17|>=3.4,<3.4.7|>=4,<4.0.7", "symfony/security-csrf": ">=2.4,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", "symfony/security-guard": ">=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", - "symfony/security-http": ">=2.3,<2.3.41|>=2.4,<2.7.50|>=2.8,<2.8.49|>=3,<3.4.20|>=4,<4.0.15|>=4.1,<4.1.9|>=4.2,<4.2.1", + "symfony/security-http": ">=2.3,<2.3.41|>=2.4,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", "symfony/serializer": ">=2,<2.0.11", - "symfony/symfony": ">=2,<2.7.50|>=2.8,<2.8.49|>=3,<3.4.20|>=4,<4.0.15|>=4.1,<4.1.9|>=4.2,<4.2.1", + "symfony/symfony": ">=2,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", "symfony/translation": ">=2,<2.0.17", "symfony/validator": ">=2,<2.0.24|>=2.1,<2.1.12|>=2.2,<2.2.5|>=2.3,<2.3.3", "symfony/web-profiler-bundle": ">=2,<2.3.19|>=2.4,<2.4.9|>=2.5,<2.5.4", "symfony/yaml": ">=2,<2.0.22|>=2.1,<2.1.7", "tecnickcom/tcpdf": "<6.2.22", "thelia/backoffice-default-template": ">=2.1,<2.1.2", - "thelia/thelia": ">=2.1.0-beta1,<2.1.3|>=2.1,<2.1.2", + "thelia/thelia": ">=2.1,<2.1.2|>=2.1.0-beta1,<2.1.3", "theonedemon/phpwhois": "<=4.2.5", "titon/framework": ">=0,<9.9.99", "truckersmp/phpwhois": "<=4.3.1", @@ -3632,20 +3635,20 @@ } ], "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", - "time": "2019-04-07T10:25:46+00:00" + "time": "2019-05-06T17:09:30+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.4.1", + "version": "3.4.2", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "5b4333b4010625d29580eb4a41f1e53251be6baa" + "reference": "b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/5b4333b4010625d29580eb4a41f1e53251be6baa", - "reference": "5b4333b4010625d29580eb4a41f1e53251be6baa", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8", + "reference": "b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8", "shasum": "" }, "require": { @@ -3683,11 +3686,11 @@ "phpcs", "standards" ], - "time": "2019-03-19T03:22:27+00:00" + "time": "2019-04-10T23:49:02+00:00" }, { "name": "symfony/class-loader", - "version": "v3.4.24", + "version": "v3.4.27", "source": { "type": "git", "url": "https://github.com/symfony/class-loader.git", From 900c5fc01e12e8eba787f53c72989838c33496ce Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 7 May 2019 10:26:50 +0530 Subject: [PATCH 0684/1044] Update sub-command packages and test running Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- .travis.yml | 2 +- ci/test-commands.sh | 5 ++--- composer.json | 2 +- composer.lock | 12 ++++++------ 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index a351de5a0..f8291791c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,7 +28,7 @@ install: if [[ "$TRAVIS_BRANCH" = "master" ]]; then composer install --no-interaction else - composer install --no-interaction + composer update fi - sudo ./ci/test-env-install.sh diff --git a/ci/test-commands.sh b/ci/test-commands.sh index 080969227..2d92285fc 100755 --- a/ci/test-commands.sh +++ b/ci/test-commands.sh @@ -1,5 +1,4 @@ #!/bin/bash -set -ex # called by Travis CI #repos=$(find vendor/easyengine -type d -name 'features') @@ -12,10 +11,10 @@ sub_commands=( for command in "${sub_commands[@]}"; do IFS='/' read -r -a array <<< "$command" rm -rf features/* - rsync -avP --delete $command/ features/ + rsync -av --delete $command/ features/ > /dev/null for file in features/*.feature; do mv "$file" "${file%.feature}_${array[2]}.feature"; done composer du echo "Running tests for $command" export COMPOSE_INTERACTIVE_NO_CLI=1 sudo ./vendor/bin/behat -done \ No newline at end of file +done diff --git a/composer.json b/composer.json index 9d2fbd8aa..fd0621667 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,7 @@ "easyengine/cron-command": "v1.0.2", "easyengine/log-command": "v1.0.1", "easyengine/mailhog-command": "v1.0.2", - "easyengine/site-command": "v2.3.1", + "easyengine/site-command": "v2.3.2", "easyengine/site-type-wp": "v1.0.10", "easyengine/site-type-php": "v1.0.10", "easyengine/service-command": "v1.0.9", diff --git a/composer.lock b/composer.lock index 4e7a6260d..889e9b40b 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": "4bbbdd5b9f57939c47301ac10ff5a9ca", + "content-hash": "8403817360410c6a570b8a7369c824a2", "packages": [ { "name": "acmephp/core", @@ -828,16 +828,16 @@ }, { "name": "easyengine/site-command", - "version": "v2.3.1", + "version": "v2.3.2", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "df545c427445dccf7ce5e0fdb27c8cc786ab0b0c" + "reference": "be235be393d277e9c7b6986ce904cf3e3151f03b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/df545c427445dccf7ce5e0fdb27c8cc786ab0b0c", - "reference": "df545c427445dccf7ce5e0fdb27c8cc786ab0b0c", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/be235be393d277e9c7b6986ce904cf3e3151f03b", + "reference": "be235be393d277e9c7b6986ce904cf3e3151f03b", "shasum": "" }, "require": { @@ -887,7 +887,7 @@ "MIT" ], "homepage": "https://github.com/easyengine/site-command", - "time": "2019-03-18T13:37:34+00:00" + "time": "2019-05-07T04:51:15+00:00" }, { "name": "easyengine/site-type-php", From a95408be59ef38832052f589b0d7162c4cf274ec Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Tue, 7 May 2019 10:27:19 +0530 Subject: [PATCH 0685/1044] Bump version v4.0.13 Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 4c05e4ef5..041792eb4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.0.12 +4.0.13 From 3858df0cecdd230333d545573ce7a55bfba84bfe Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 9 May 2019 13:20:22 +0530 Subject: [PATCH 0686/1044] Update composer packages Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- composer.json | 2 +- composer.lock | 25 +++++++++++++------------ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/composer.json b/composer.json index fd0621667..0dc0eea19 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,7 @@ "easyengine/cron-command": "v1.0.2", "easyengine/log-command": "v1.0.1", "easyengine/mailhog-command": "v1.0.2", - "easyengine/site-command": "v2.3.2", + "easyengine/site-command": "v2.3.4", "easyengine/site-type-wp": "v1.0.10", "easyengine/site-type-php": "v1.0.10", "easyengine/service-command": "v1.0.9", diff --git a/composer.lock b/composer.lock index 889e9b40b..7d3be42e2 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": "8403817360410c6a570b8a7369c824a2", + "content-hash": "f428bafe43bbf1ce25a9b4cf3f71400e", "packages": [ { "name": "acmephp/core", @@ -828,16 +828,16 @@ }, { "name": "easyengine/site-command", - "version": "v2.3.2", + "version": "v2.3.4", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "be235be393d277e9c7b6986ce904cf3e3151f03b" + "reference": "a09639c73c3791842070a794b75f44e12229e191" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/be235be393d277e9c7b6986ce904cf3e3151f03b", - "reference": "be235be393d277e9c7b6986ce904cf3e3151f03b", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/a09639c73c3791842070a794b75f44e12229e191", + "reference": "a09639c73c3791842070a794b75f44e12229e191", "shasum": "" }, "require": { @@ -887,7 +887,7 @@ "MIT" ], "homepage": "https://github.com/easyengine/site-command", - "time": "2019-05-07T04:51:15+00:00" + "time": "2019-05-07T13:51:37+00:00" }, { "name": "easyengine/site-type-php", @@ -3435,12 +3435,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "21ad2a8155dd437a0926a4d1fedb991bebd4810b" + "reference": "2149b00d8c04ccbc71f38a261d0129d5b032b5df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/21ad2a8155dd437a0926a4d1fedb991bebd4810b", - "reference": "21ad2a8155dd437a0926a4d1fedb991bebd4810b", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/2149b00d8c04ccbc71f38a261d0129d5b032b5df", + "reference": "2149b00d8c04ccbc71f38a261d0129d5b032b5df", "shasum": "" }, "conflict": { @@ -3581,10 +3581,11 @@ "titon/framework": ">=0,<9.9.99", "truckersmp/phpwhois": "<=4.3.1", "twig/twig": "<1.38|>=2,<2.7", - "typo3/cms": ">=6.2,<6.2.30|>=7,<7.6.32|>=8,<8.7.23|>=9,<9.5.4", - "typo3/cms-core": ">=8,<8.7.23|>=9,<9.5.4", + "typo3/cms": ">=6.2,<6.2.30|>=7,<7.6.32|>=8,<8.7.25|>=9,<9.5.6", + "typo3/cms-core": ">=8,<8.7.25|>=9,<9.5.6", "typo3/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.10|>=3.1,<3.1.7|>=3.2,<3.2.7|>=3.3,<3.3.5", "typo3/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4", + "typo3/phar-stream-wrapper": ">=1,<2.1.1|>=3,<3.1.1", "ua-parser/uap-php": "<3.8", "wallabag/tcpdf": "<6.2.22", "willdurand/js-translation-bundle": "<2.1.1", @@ -3635,7 +3636,7 @@ } ], "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", - "time": "2019-05-06T17:09:30+00:00" + "time": "2019-05-08T13:51:25+00:00" }, { "name": "squizlabs/php_codesniffer", From 2e0f524f3d9a8c54e041e4b66f22074e1312a4d5 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Thu, 9 May 2019 13:23:58 +0530 Subject: [PATCH 0687/1044] Bump version v4.0.14 Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 041792eb4..80c4cafe0 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.0.13 +4.0.14 From 290c499ff2bcd8c3bd44cf7772d50ac9d1b4a2a2 Mon Sep 17 00:00:00 2001 From: Radhakrishnan Mudliar <radhe@users.noreply.github.com> Date: Thu, 6 Jun 2019 17:55:20 +0530 Subject: [PATCH 0688/1044] Add banner Added new banner pointing to rtCamp site. --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 8de7874da..64253284d 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,21 @@ # EasyEngine v4 +EasyEngine makes it greatly easy to manage nginx, a fast web-server software that consumes little memory when handling increasing volumes of concurrent users. + +<a href="https://rtcamp.com/?utm_source=github&utm_medium=readme" rel="nofollow"><img src="https://rtcamp.com/wp-content/uploads/2019/04/github-banner@2x.png" alt="Handcrafted Enterprise WordPress Solutions by rtCamp" /></a> + + <img width="150" height="150" src="https://easyengine.io/wp-content/uploads/2015/11/cropped-favicon-easyengine.png" alt="EasyEngine Logo" align="right" /> [![Build Status](https://travis-ci.org/EasyEngine/easyengine.svg?branch=master-v4)](https://travis-ci.org/EasyEngine/easyengine) [![License](https://poser.pugx.org/phpunit/phpunit/license)](https://packagist.org/packages/phpunit/phpunit) [![Join EasyEngine Slack Channel](http://slack.easyengine.io/badge.svg)](http://slack.easyengine.io/) + ## Requirements + + * Docker * Docker-Compose * PHP CLI (>=7.1) From c5107b5bb502a41c561ba3d000394e1b8109820b Mon Sep 17 00:00:00 2001 From: Radhakrishnan Mudliar <radhe@users.noreply.github.com> Date: Thu, 6 Jun 2019 19:02:39 +0530 Subject: [PATCH 0689/1044] Update Banner position --- README.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 64253284d..06ac344fd 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,6 @@ EasyEngine makes it greatly easy to manage nginx, a fast web-server software that consumes little memory when handling increasing volumes of concurrent users. -<a href="https://rtcamp.com/?utm_source=github&utm_medium=readme" rel="nofollow"><img src="https://rtcamp.com/wp-content/uploads/2019/04/github-banner@2x.png" alt="Handcrafted Enterprise WordPress Solutions by rtCamp" /></a> - - <img width="150" height="150" src="https://easyengine.io/wp-content/uploads/2015/11/cropped-favicon-easyengine.png" alt="EasyEngine Logo" align="right" /> [![Build Status](https://travis-ci.org/EasyEngine/easyengine.svg?branch=master-v4)](https://travis-ci.org/EasyEngine/easyengine) @@ -14,8 +11,6 @@ EasyEngine makes it greatly easy to manage nginx, a fast web-server software tha ## Requirements - - * Docker * Docker-Compose * PHP CLI (>=7.1) @@ -116,3 +111,6 @@ We warmheartedly welcome all contributions however and in whatever capacity you ## Donations [![PayPal-Donate](https://cloud.githubusercontent.com/assets/4115/5297691/c7b50292-7bd7-11e4-987b-2dc21069e756.png)](http://rt.cx/eedonate) + + +<a href="https://rtcamp.com/?utm_source=github&utm_medium=readme" rel="nofollow"><img src="https://rtcamp.com/wp-content/uploads/2019/04/github-banner@2x.png" alt="Handcrafted Enterprise WordPress Solutions by rtCamp" /></a> From 8693f91ff6dff036ef8bfd9744caff8b6d62588f Mon Sep 17 00:00:00 2001 From: dhsathiya <devarshisathiya5@gmail.com> Date: Tue, 18 Jun 2019 14:26:27 +0530 Subject: [PATCH 0690/1044] Update README.md Banner position moved to top. --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 06ac344fd..b1d5c1320 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,9 @@ EasyEngine makes it greatly easy to manage nginx, a fast web-server software that consumes little memory when handling increasing volumes of concurrent users. + +<a href="https://rtcamp.com/?utm_source=github&utm_medium=readme" rel="nofollow"><img src="https://rtcamp.com/wp-content/uploads/2019/04/github-banner@2x.png" alt="Handcrafted Enterprise WordPress Solutions by rtCamp" /></a> + <img width="150" height="150" src="https://easyengine.io/wp-content/uploads/2015/11/cropped-favicon-easyengine.png" alt="EasyEngine Logo" align="right" /> [![Build Status](https://travis-ci.org/EasyEngine/easyengine.svg?branch=master-v4)](https://travis-ci.org/EasyEngine/easyengine) @@ -113,4 +116,3 @@ We warmheartedly welcome all contributions however and in whatever capacity you [![PayPal-Donate](https://cloud.githubusercontent.com/assets/4115/5297691/c7b50292-7bd7-11e4-987b-2dc21069e756.png)](http://rt.cx/eedonate) -<a href="https://rtcamp.com/?utm_source=github&utm_medium=readme" rel="nofollow"><img src="https://rtcamp.com/wp-content/uploads/2019/04/github-banner@2x.png" alt="Handcrafted Enterprise WordPress Solutions by rtCamp" /></a> From 7b7c19d9e45503b42b8bce48fe58051d14f5f3c1 Mon Sep 17 00:00:00 2001 From: dhsathiya <devarshisathiya5@gmail.com> Date: Tue, 18 Jun 2019 14:33:20 +0530 Subject: [PATCH 0691/1044] Update README.md Moved repo-badges to the top. --- README.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/README.md b/README.md index b1d5c1320..b4ef4c3f6 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# EasyEngine v4 +# EasyEngine v4 [![Build Status](https://travis-ci.org/EasyEngine/easyengine.svg?branch=master-v4)](https://travis-ci.org/EasyEngine/easyengine) [![License](https://poser.pugx.org/phpunit/phpunit/license)](https://packagist.org/packages/phpunit/phpunit) [![Join EasyEngine Slack Channel](http://slack.easyengine.io/badge.svg)](http://slack.easyengine.io/) EasyEngine makes it greatly easy to manage nginx, a fast web-server software that consumes little memory when handling increasing volumes of concurrent users. @@ -7,11 +7,6 @@ EasyEngine makes it greatly easy to manage nginx, a fast web-server software tha <img width="150" height="150" src="https://easyengine.io/wp-content/uploads/2015/11/cropped-favicon-easyengine.png" alt="EasyEngine Logo" align="right" /> -[![Build Status](https://travis-ci.org/EasyEngine/easyengine.svg?branch=master-v4)](https://travis-ci.org/EasyEngine/easyengine) -[![License](https://poser.pugx.org/phpunit/phpunit/license)](https://packagist.org/packages/phpunit/phpunit) -[![Join EasyEngine Slack Channel](http://slack.easyengine.io/badge.svg)](http://slack.easyengine.io/) - - ## Requirements * Docker From ccba71f22411670a4fcfa3d84a8399a86b32e393 Mon Sep 17 00:00:00 2001 From: dhsathiya <devarshisathiya5@gmail.com> Date: Tue, 18 Jun 2019 14:40:18 +0530 Subject: [PATCH 0692/1044] Update README.md EasyEngine Logo URL updated. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b4ef4c3f6..876b46a59 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ EasyEngine makes it greatly easy to manage nginx, a fast web-server software tha <a href="https://rtcamp.com/?utm_source=github&utm_medium=readme" rel="nofollow"><img src="https://rtcamp.com/wp-content/uploads/2019/04/github-banner@2x.png" alt="Handcrafted Enterprise WordPress Solutions by rtCamp" /></a> -<img width="150" height="150" src="https://easyengine.io/wp-content/uploads/2015/11/cropped-favicon-easyengine.png" alt="EasyEngine Logo" align="right" /> +<img width="150" height="150" src="https://easyengine.io/wp-content/uploads/sites/20/2019/06/EasyEngine-New-Logo-Banner@0.1x-Transparent-Background.png" alt="EasyEngine Logo" align="right" /> ## Requirements From 1f412fdd27123b55e7a0a8525db3b16882350e7c Mon Sep 17 00:00:00 2001 From: dhsathiya <devarshisathiya5@gmail.com> Date: Tue, 18 Jun 2019 14:43:44 +0530 Subject: [PATCH 0693/1044] Update README.md Removed broken link. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 876b46a59..d64369706 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ EasyEngine makes it greatly easy to manage nginx, a fast web-server software tha <a href="https://rtcamp.com/?utm_source=github&utm_medium=readme" rel="nofollow"><img src="https://rtcamp.com/wp-content/uploads/2019/04/github-banner@2x.png" alt="Handcrafted Enterprise WordPress Solutions by rtCamp" /></a> -<img width="150" height="150" src="https://easyengine.io/wp-content/uploads/sites/20/2019/06/EasyEngine-New-Logo-Banner@0.1x-Transparent-Background.png" alt="EasyEngine Logo" align="right" /> +<img width="150" height="150" src="" alt="EasyEngine Logo" align="right" /> ## Requirements From 27f1489c17c6fe62770fa77abaf0476f09ab72b8 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Mon, 1 Jul 2019 09:40:23 +0530 Subject: [PATCH 0694/1044] Fixed broken EasyEngine logo link Also, changed logo with banner and moved it to top --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d64369706..84d467765 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ + +<img src="https://i2.wp.com/easyengine.io/wp-content/uploads/sites/20/2019/06/EasyEngine-New-Logo-Banner@2x-Transparent-Background.png?fit=720%2C170&ssl=1" alt="EasyEngine Logo" /> + # EasyEngine v4 [![Build Status](https://travis-ci.org/EasyEngine/easyengine.svg?branch=master-v4)](https://travis-ci.org/EasyEngine/easyengine) [![License](https://poser.pugx.org/phpunit/phpunit/license)](https://packagist.org/packages/phpunit/phpunit) [![Join EasyEngine Slack Channel](http://slack.easyengine.io/badge.svg)](http://slack.easyengine.io/) EasyEngine makes it greatly easy to manage nginx, a fast web-server software that consumes little memory when handling increasing volumes of concurrent users. - <a href="https://rtcamp.com/?utm_source=github&utm_medium=readme" rel="nofollow"><img src="https://rtcamp.com/wp-content/uploads/2019/04/github-banner@2x.png" alt="Handcrafted Enterprise WordPress Solutions by rtCamp" /></a> -<img width="150" height="150" src="" alt="EasyEngine Logo" align="right" /> - ## Requirements * Docker From 4a363f39be703dcc86688f23c20b78add7a30072 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 17 Dec 2019 16:50:12 +0530 Subject: [PATCH 0695/1044] Do not create volume in update Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- php/class-ee-docker.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php index 8c0be97b2..306769521 100644 --- a/php/class-ee-docker.php +++ b/php/class-ee-docker.php @@ -253,6 +253,11 @@ public static function create_volumes( $prefix, $volumes, $update_to_docker_pref if ( ! empty( $volume['skip_volume'] ) && true === $volume['skip_volume'] ) { continue; } + $vol_check = EE::launch( 'docker volume inspect ' . $volume_prefix . '_' . $volume['name'] ); + // Skip if volume already exists. + if ( 0 === $vol_check->return_code ) { + continue; + } $path_to_symlink_not_empty = ! empty( dirname( $volume['path_to_symlink'] ) ); if ( $path_to_symlink_not_empty ) { $fs->mkdir( dirname( $volume['path_to_symlink'] ) ); From 87607d0b21eb8e226d3bb82f763def58da1cb7d6 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 17 Dec 2019 16:58:32 +0530 Subject: [PATCH 0696/1044] Replace rtrim with substr Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- php/EE/Migration/CustomContainerMigrations.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/EE/Migration/CustomContainerMigrations.php b/php/EE/Migration/CustomContainerMigrations.php index 53feb8dd3..39f5c86e5 100644 --- a/php/EE/Migration/CustomContainerMigrations.php +++ b/php/EE/Migration/CustomContainerMigrations.php @@ -207,7 +207,7 @@ private static function get_migration_path( $migration_name ) { */ private static function get_migration_class_name( $migration_name ) { // Remove date and package name from it - $class_name = preg_replace( '/(^\d*)[_]([a-zA-Z-]*[_])/', '', rtrim( $migration_name, '.php' ) ); + $class_name = preg_replace( '/(^\d*)[_]([a-zA-Z-]*[_])/', '', substr( $migration_name, 0, -4 ) ); // Convet snake_case to CamelCase $class_name = self::camelize( $class_name ); // Replace dot with underscore From 6831df40c59c6edc8be762112e056e3a41401902 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 17 Dec 2019 16:59:19 +0530 Subject: [PATCH 0697/1044] Update img version for new dockerfiles Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- img-versions.json | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/img-versions.json b/img-versions.json index 102abe575..e2df4c7e7 100644 --- a/img-versions.json +++ b/img-versions.json @@ -4,10 +4,12 @@ "easyengine/mariadb": "v4.0.0", "easyengine/nginx-proxy": "v4.0.3", "easyengine/nginx": "v4.0.3", - "easyengine/php": "v4.0.3", + "easyengine/php": "v4.1.0", "easyengine/php5.6": "v4.0.0", - "easyengine/php7.0": "v4.0.0", - "easyengine/php7.3": "v4.0.0", + "easyengine/php7.0": "v4.1.0", + "easyengine/php7.2": "v4.1.0", + "easyengine/php7.3": "v4.1.0", + "easyengine/php7.4": "v4.1.0", "easyengine/postfix": "v4.0.0", "easyengine/redis": "v4.0.0", "easyengine/newrelic-daemon": "v4.0.0" From 2c14fda22c47b046f675c000fd30fd9442b8651f Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Wed, 18 Dec 2019 09:54:16 +0530 Subject: [PATCH 0698/1044] PHP 7.4 Compatibility: Update `implode()` calls. Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- php/EE/DocParser.php | 2 +- php/commands/help.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/php/EE/DocParser.php b/php/EE/DocParser.php index 6910b45a8..7fcfd3ba9 100644 --- a/php/EE/DocParser.php +++ b/php/EE/DocParser.php @@ -72,7 +72,7 @@ public function get_longdesc() { $lines[] = $line; } - $longdesc = trim( implode( $lines, "\n" ) ); + $longdesc = trim( implode( "\n", $lines ) ); return $longdesc; } diff --git a/php/commands/help.php b/php/commands/help.php index 2fef01e25..ea72d9b2f 100644 --- a/php/commands/help.php +++ b/php/commands/help.php @@ -104,7 +104,7 @@ private static function indent( $whitespace, $text ) { foreach ( $lines as &$line ) { $line = $whitespace . $line; } - return implode( $lines, "\n" ); + return implode( "\n", $lines ); } private static function pass_through_pager( $out ) { From 1d41cebb7f715f33e1a974716c10aaefcc9b4121 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Wed, 18 Dec 2019 09:55:10 +0530 Subject: [PATCH 0699/1044] Remove notices, warnings and deprecation msgs from phar Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- utils/make-phar.php | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/make-phar.php b/utils/make-phar.php index e65c5e6ca..e802118a6 100644 --- a/utils/make-phar.php +++ b/utils/make-phar.php @@ -323,6 +323,7 @@ function get_composer_versions( $current_version ) { $phar->setStub( <<<EOB #!/usr/bin/env php <?php +error_reporting( E_ALL ^ ( E_NOTICE | E_WARNING | E_DEPRECATED ) ); Phar::mapPhar(); include 'phar://ee.phar{$phar_boot}'; __HALT_COMPILER(); From 3ac1b94056aac7829f2c2a6c3167df6a238a896f Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Wed, 18 Dec 2019 12:08:27 +0530 Subject: [PATCH 0700/1044] Update phar to include zip templates Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- utils/make-phar.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/make-phar.php b/utils/make-phar.php index e802118a6..ee9d18e19 100644 --- a/utils/make-phar.php +++ b/utils/make-phar.php @@ -247,7 +247,8 @@ function get_composer_versions( $current_version ) { ->in(EE_VENDOR_DIR . '/easyengine/*-command/templates') ->in(EE_VENDOR_DIR . '/easyengine/site-type-*/templates') ->name('*.mustache') - ->name('.env.mustache'); + ->name('.env.mustache') + ->name('*.zip'); $finder ->files() From 8d32b20ae0a93f8a6527fd187159d9e23ecae9ab Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Wed, 18 Dec 2019 12:21:26 +0530 Subject: [PATCH 0701/1044] Update nginx image version Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- img-versions.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/img-versions.json b/img-versions.json index e2df4c7e7..a996dd766 100644 --- a/img-versions.json +++ b/img-versions.json @@ -3,7 +3,7 @@ "easyengine/mailhog": "v4.0.0", "easyengine/mariadb": "v4.0.0", "easyengine/nginx-proxy": "v4.0.3", - "easyengine/nginx": "v4.0.3", + "easyengine/nginx": "v4.1.0", "easyengine/php": "v4.1.0", "easyengine/php5.6": "v4.0.0", "easyengine/php7.0": "v4.1.0", From 515ca14d8b568a31daf3d02f6cce486f51403f75 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Wed, 18 Dec 2019 12:21:42 +0530 Subject: [PATCH 0702/1044] Skip downloading of all PHP images by default Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- ...2850_easyengine_insert_docker_images_version.php | 2 ++ php/EE/Migration/Containers.php | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/migrations/db/20181016052850_easyengine_insert_docker_images_version.php b/migrations/db/20181016052850_easyengine_insert_docker_images_version.php index e2411b6dc..5e752b06c 100644 --- a/migrations/db/20181016052850_easyengine_insert_docker_images_version.php +++ b/migrations/db/20181016052850_easyengine_insert_docker_images_version.php @@ -34,7 +34,9 @@ public function up() { $skip_download = [ 'easyengine/php5.6', 'easyengine/php7.0', + 'easyengine/php7.2', 'easyengine/php7.3', + 'easyengine/php7.4', 'easyengine/newrelic-daemon', ]; foreach ( $images as $image => $tag ) { diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index 44200c365..5a6eea225 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -27,7 +27,20 @@ public static function start_container_migration() { $current_versions = self::get_current_docker_images_versions(); $updated_images = []; + $skip_download = [ + 'easyengine/php5.6', + 'easyengine/php7.0', + 'easyengine/php7.2', + 'easyengine/php7.3', + 'easyengine/php7.4', + 'easyengine/newrelic-daemon', + ]; + foreach ( $img_versions as $img => $version ) { + + if ( in_array( $image, $skip_download ) ) { + continue; + } if ( array_key_exists( $img, $current_versions ) ) { if ( $current_versions[ $img ] !== $version ) { $updated_images[] = $img; From 188b5108144f7b35859760ca5b09af8a4d2388f3 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Wed, 18 Dec 2019 12:23:17 +0530 Subject: [PATCH 0703/1044] Fix variable name typo Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- php/EE/Migration/Containers.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index 5a6eea225..9c9e77c4b 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -38,7 +38,7 @@ public static function start_container_migration() { foreach ( $img_versions as $img => $version ) { - if ( in_array( $image, $skip_download ) ) { + if ( in_array( $img, $skip_download ) ) { continue; } if ( array_key_exists( $img, $current_versions ) ) { From 4ba216c8296a044e74e5c5ac877127265dcfe474 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Wed, 18 Dec 2019 18:25:13 +0530 Subject: [PATCH 0704/1044] Update composer packages Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 8 +- composer.lock | 258 ++++++++++++++++++++++++++------------------------ 2 files changed, 140 insertions(+), 126 deletions(-) diff --git a/composer.json b/composer.json index 0dc0eea19..c6995981e 100644 --- a/composer.json +++ b/composer.json @@ -27,15 +27,15 @@ "php": ">=7.0", "composer/composer": "1.7.3", "composer/semver": "1.4.2", - "easyengine/admin-tools-command": "v1.0.8", + "easyengine/admin-tools-command": "v1.0.9", "easyengine/auth-command": "v1.0.2", "easyengine/config-command": "v1.0.2", "easyengine/cron-command": "v1.0.2", "easyengine/log-command": "v1.0.1", "easyengine/mailhog-command": "v1.0.2", - "easyengine/site-command": "v2.3.4", - "easyengine/site-type-wp": "v1.0.10", - "easyengine/site-type-php": "v1.0.10", + "easyengine/site-command": "v2.4.0", + "easyengine/site-type-wp": "v1.1.0", + "easyengine/site-type-php": "v1.1.0", "easyengine/service-command": "v1.0.9", "easyengine/shell-command" : "v1.0.3", "justinrainbow/json-schema": "5.2.7", diff --git a/composer.lock b/composer.lock index 7d3be42e2..29c86955d 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": "f428bafe43bbf1ce25a9b4cf3f71400e", + "content-hash": "d3359aede06e3440af28656664393865", "packages": [ { "name": "acmephp/core", @@ -181,27 +181,27 @@ }, { "name": "composer/ca-bundle", - "version": "1.1.4", + "version": "1.2.5", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "558f321c52faeb4828c03e7dc0cfe39a09e09a2d" + "reference": "62e8fc2dc550e5d6d8c9360c7721662670f58149" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/558f321c52faeb4828c03e7dc0cfe39a09e09a2d", - "reference": "558f321c52faeb4828c03e7dc0cfe39a09e09a2d", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/62e8fc2dc550e5d6d8c9360c7721662670f58149", + "reference": "62e8fc2dc550e5d6d8c9360c7721662670f58149", "shasum": "" }, "require": { "ext-openssl": "*", "ext-pcre": "*", - "php": "^5.3.2 || ^7.0" + "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5", + "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8", "psr/log": "^1.0", - "symfony/process": "^2.5 || ^3.0 || ^4.0" + "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0" }, "type": "library", "extra": { @@ -233,7 +233,7 @@ "ssl", "tls" ], - "time": "2019-01-28T09:30:10+00:00" + "time": "2019-12-11T14:44:42+00:00" }, { "name": "composer/composer", @@ -379,16 +379,16 @@ }, { "name": "composer/spdx-licenses", - "version": "1.5.1", + "version": "1.5.2", "source": { "type": "git", "url": "https://github.com/composer/spdx-licenses.git", - "reference": "a1aa51cf3ab838b83b0867b14e56fc20fbd55b3d" + "reference": "7ac1e6aec371357df067f8a688c3d6974df68fa5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/a1aa51cf3ab838b83b0867b14e56fc20fbd55b3d", - "reference": "a1aa51cf3ab838b83b0867b14e56fc20fbd55b3d", + "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/7ac1e6aec371357df067f8a688c3d6974df68fa5", + "reference": "7ac1e6aec371357df067f8a688c3d6974df68fa5", "shasum": "" }, "require": { @@ -435,28 +435,28 @@ "spdx", "validator" ], - "time": "2019-03-26T10:23:26+00:00" + "time": "2019-07-29T10:31:59+00:00" }, { "name": "composer/xdebug-handler", - "version": "1.3.2", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "d17708133b6c276d6e42ef887a877866b909d892" + "reference": "cbe23383749496fe0f373345208b79568e4bc248" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/d17708133b6c276d6e42ef887a877866b909d892", - "reference": "d17708133b6c276d6e42ef887a877866b909d892", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/cbe23383749496fe0f373345208b79568e4bc248", + "reference": "cbe23383749496fe0f373345208b79568e4bc248", "shasum": "" }, "require": { - "php": "^5.3.2 || ^7.0", + "php": "^5.3.2 || ^7.0 || ^8.0", "psr/log": "^1.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5" + "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8" }, "type": "library", "autoload": { @@ -474,25 +474,25 @@ "email": "john-stevenson@blueyonder.co.uk" } ], - "description": "Restarts a process without xdebug.", + "description": "Restarts a process without Xdebug.", "keywords": [ "Xdebug", "performance" ], - "time": "2019-01-28T20:25:53+00:00" + "time": "2019-11-06T16:40:04+00:00" }, { "name": "easyengine/admin-tools-command", - "version": "v1.0.8", + "version": "v1.0.9", "source": { "type": "git", "url": "https://github.com/EasyEngine/admin-tools-command.git", - "reference": "68904df32c4126d2062b2c0dbaa6ec8c544b1879" + "reference": "6517a41d1958430c56ceb50f874f101392a492c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/admin-tools-command/zipball/68904df32c4126d2062b2c0dbaa6ec8c544b1879", - "reference": "68904df32c4126d2062b2c0dbaa6ec8c544b1879", + "url": "https://api.github.com/repos/EasyEngine/admin-tools-command/zipball/6517a41d1958430c56ceb50f874f101392a492c9", + "reference": "6517a41d1958430c56ceb50f874f101392a492c9", "shasum": "" }, "type": "ee-cli-package", @@ -521,7 +521,7 @@ ], "description": "Command to manage admin tools for php based sites.", "homepage": "https://github.com/easyengine/amdin-tools", - "time": "2019-04-09T12:36:14+00:00" + "time": "2019-12-18T12:48:38+00:00" }, { "name": "easyengine/auth-command", @@ -828,16 +828,16 @@ }, { "name": "easyengine/site-command", - "version": "v2.3.4", + "version": "v2.4.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "a09639c73c3791842070a794b75f44e12229e191" + "reference": "0bfc6a8c23b8099a11db30eb212f0b872158baf1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/a09639c73c3791842070a794b75f44e12229e191", - "reference": "a09639c73c3791842070a794b75f44e12229e191", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/0bfc6a8c23b8099a11db30eb212f0b872158baf1", + "reference": "0bfc6a8c23b8099a11db30eb212f0b872158baf1", "shasum": "" }, "require": { @@ -887,20 +887,20 @@ "MIT" ], "homepage": "https://github.com/easyengine/site-command", - "time": "2019-05-07T13:51:37+00:00" + "time": "2019-12-18T11:11:27+00:00" }, { "name": "easyengine/site-type-php", - "version": "v1.0.10", + "version": "v1.1.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-php.git", - "reference": "b2b86d4105301396decf5cfd19e22ed2b3f7a73f" + "reference": "8823e105f5ec9c3d7bafe79e9341636ee07560ae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/b2b86d4105301396decf5cfd19e22ed2b3f7a73f", - "reference": "b2b86d4105301396decf5cfd19e22ed2b3f7a73f", + "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/8823e105f5ec9c3d7bafe79e9341636ee07560ae", + "reference": "8823e105f5ec9c3d7bafe79e9341636ee07560ae", "shasum": "" }, "require-dev": { @@ -942,20 +942,20 @@ ], "description": "EasyEngine package for PHP site creation.", "homepage": "https://github.com/easyengine/site-type-php", - "time": "2019-04-09T11:50:40+00:00" + "time": "2019-12-18T12:46:13+00:00" }, { "name": "easyengine/site-type-wp", - "version": "v1.0.10", + "version": "v1.1.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-wp.git", - "reference": "903636756bfdaffcd107743611ae9e2b9424f76f" + "reference": "fa9b02d6b05fad3cbcd046227947604ecb076a08" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/903636756bfdaffcd107743611ae9e2b9424f76f", - "reference": "903636756bfdaffcd107743611ae9e2b9424f76f", + "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/fa9b02d6b05fad3cbcd046227947604ecb076a08", + "reference": "fa9b02d6b05fad3cbcd046227947604ecb076a08", "shasum": "" }, "require-dev": { @@ -997,7 +997,7 @@ ], "description": "EasyEngine site type package for WordPress site creation.", "homepage": "https://github.com/easyengine/site-type-wp", - "time": "2019-04-09T11:50:40+00:00" + "time": "2019-12-18T12:44:35+00:00" }, { "name": "guzzlehttp/guzzle", @@ -1117,33 +1117,37 @@ }, { "name": "guzzlehttp/psr7", - "version": "1.5.2", + "version": "1.6.1", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "9f83dded91781a01c63574e387eaa769be769115" + "reference": "239400de7a173fe9901b9ac7c06497751f00727a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/9f83dded91781a01c63574e387eaa769be769115", - "reference": "9f83dded91781a01c63574e387eaa769be769115", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/239400de7a173fe9901b9ac7c06497751f00727a", + "reference": "239400de7a173fe9901b9ac7c06497751f00727a", "shasum": "" }, "require": { "php": ">=5.4.0", "psr/http-message": "~1.0", - "ralouphie/getallheaders": "^2.0.5" + "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" }, "provide": { "psr/http-message-implementation": "1.0" }, "require-dev": { + "ext-zlib": "*", "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" }, + "suggest": { + "zendframework/zend-httphandlerrunner": "Emit PSR-7 responses" + }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.5-dev" + "dev-master": "1.6-dev" } }, "autoload": { @@ -1180,7 +1184,7 @@ "uri", "url" ], - "time": "2018-12-04T20:46:45+00:00" + "time": "2019-07-01T23:21:34+00:00" }, { "name": "justinrainbow/json-schema", @@ -1557,16 +1561,16 @@ }, { "name": "psr/log", - "version": "1.1.0", + "version": "1.1.2", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" + "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", - "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "url": "https://api.github.com/repos/php-fig/log/zipball/446d54b4cb6bf489fc9d75f55843658e6f25d801", + "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801", "shasum": "" }, "require": { @@ -1575,7 +1579,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.1.x-dev" } }, "autoload": { @@ -1600,28 +1604,28 @@ "psr", "psr-3" ], - "time": "2018-11-20T15:27:04+00:00" + "time": "2019-11-01T11:05:21+00:00" }, { "name": "ralouphie/getallheaders", - "version": "2.0.5", + "version": "3.0.3", "source": { "type": "git", "url": "https://github.com/ralouphie/getallheaders.git", - "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa" + "reference": "120b605dfeb996808c31b6477290a714d356e822" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/5601c8a83fbba7ef674a7369456d12f1e0d0eafa", - "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", "shasum": "" }, "require": { - "php": ">=5.3" + "php": ">=5.6" }, "require-dev": { - "phpunit/phpunit": "~3.7.0", - "satooshi/php-coveralls": ">=1.0" + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" }, "type": "library", "autoload": { @@ -1640,7 +1644,7 @@ } ], "description": "A polyfill for getallheaders.", - "time": "2016-02-11T07:05:27+00:00" + "time": "2019-03-08T08:55:37+00:00" }, { "name": "rmccue/requests", @@ -1693,16 +1697,16 @@ }, { "name": "seld/jsonlint", - "version": "1.7.1", + "version": "1.7.2", "source": { "type": "git", "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "d15f59a67ff805a44c50ea0516d2341740f81a38" + "reference": "e2e5d290e4d2a4f0eb449f510071392e00e10d19" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/d15f59a67ff805a44c50ea0516d2341740f81a38", - "reference": "d15f59a67ff805a44c50ea0516d2341740f81a38", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/e2e5d290e4d2a4f0eb449f510071392e00e10d19", + "reference": "e2e5d290e4d2a4f0eb449f510071392e00e10d19", "shasum": "" }, "require": { @@ -1738,7 +1742,7 @@ "parser", "validator" ], - "time": "2018-01-24T12:46:19+00:00" + "time": "2019-10-24T14:27:39+00:00" }, { "name": "seld/phar-utils", @@ -2208,16 +2212,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.11.0", + "version": "v1.13.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "82ebae02209c21113908c229e9883c419720738a" + "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/82ebae02209c21113908c229e9883c419720738a", - "reference": "82ebae02209c21113908c229e9883c419720738a", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", + "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", "shasum": "" }, "require": { @@ -2229,7 +2233,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.11-dev" + "dev-master": "1.13-dev" } }, "autoload": { @@ -2246,12 +2250,12 @@ ], "authors": [ { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" }, { - "name": "Gert de Pagter", - "email": "backendtea@gmail.com" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], "description": "Symfony polyfill for ctype functions", @@ -2262,20 +2266,20 @@ "polyfill", "portable" ], - "time": "2019-02-06T07:57:58+00:00" + "time": "2019-11-27T13:56:44+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.11.0", + "version": "v1.13.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "fe5e94c604826c35a32fa832f35bd036b6799609" + "reference": "7b4aab9743c30be783b73de055d24a39cf4b954f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fe5e94c604826c35a32fa832f35bd036b6799609", - "reference": "fe5e94c604826c35a32fa832f35bd036b6799609", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7b4aab9743c30be783b73de055d24a39cf4b954f", + "reference": "7b4aab9743c30be783b73de055d24a39cf4b954f", "shasum": "" }, "require": { @@ -2287,7 +2291,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.11-dev" + "dev-master": "1.13-dev" } }, "autoload": { @@ -2321,7 +2325,7 @@ "portable", "shim" ], - "time": "2019-02-06T07:57:58+00:00" + "time": "2019-11-27T14:18:11+00:00" }, { "name": "symfony/process", @@ -2984,6 +2988,7 @@ ], "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", "homepage": "https://github.com/container-interop/container-interop", + "abandoned": "psr/container", "time": "2017-02-14T19:40:03+00:00" }, { @@ -3435,12 +3440,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "2149b00d8c04ccbc71f38a261d0129d5b032b5df" + "reference": "1b2183eef1fdf7438d26b37dd87beb07dd4808bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/2149b00d8c04ccbc71f38a261d0129d5b032b5df", - "reference": "2149b00d8c04ccbc71f38a261d0129d5b032b5df", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/1b2183eef1fdf7438d26b37dd87beb07dd4808bc", + "reference": "1b2183eef1fdf7438d26b37dd87beb07dd4808bc", "shasum": "" }, "conflict": { @@ -3458,12 +3463,12 @@ "cart2quote/module-quotation": ">=4.1.6,<=4.4.5|>=5,<5.4.4", "cartalyst/sentry": "<=2.1.6", "codeigniter/framework": "<=3.0.6", - "composer/composer": "<=1.0.0-alpha11", + "composer/composer": "<=1-alpha.11", "contao-components/mediaelement": ">=2.14.2,<2.21.1", "contao/core": ">=2,<3.5.39", - "contao/core-bundle": ">=4,<4.4.39|>=4.5,<4.7.5", + "contao/core-bundle": ">=4,<4.4.46|>=4.5,<4.8.6", "contao/listing-bundle": ">=4,<4.4.8", - "contao/newsletter-bundle": ">=4,<4.1", + "datadog/dd-trace": ">=0.30,<0.30.2", "david-garcia/phpwhois": "<=4.3.1", "doctrine/annotations": ">=1,<1.2.7", "doctrine/cache": ">=1,<1.3.2|>=1.4,<1.4.2", @@ -3475,9 +3480,10 @@ "doctrine/mongodb-odm-bundle": ">=2,<3.0.1", "doctrine/orm": ">=2,<2.4.8|>=2.5,<2.5.1", "dompdf/dompdf": ">=0.6,<0.6.2", - "drupal/core": ">=7,<7.65|>=8,<8.5.14|>=8.6,<8.6.14", - "drupal/drupal": ">=7,<7.65|>=8,<8.5.14|>=8.6,<8.6.14", + "drupal/core": ">=7,<7.67|>=8,<8.6.16|>=8.7,<8.7.1|>8.7.3,<8.7.5", + "drupal/drupal": ">=7,<7.67|>=8,<8.6.16|>=8.7,<8.7.1|>8.7.3,<8.7.5", "erusev/parsedown": "<1.7.2", + "ezsystems/ezplatform-admin-ui": ">=1.3,<1.3.5|>=1.4,<1.4.4", "ezsystems/ezpublish-kernel": ">=5.3,<5.3.12.1|>=5.4,<5.4.13.1|>=6,<6.7.9.1|>=6.8,<6.13.5.1|>=7,<7.2.4.1|>=7.3,<7.3.2.1", "ezsystems/ezpublish-legacy": ">=5.3,<5.3.12.6|>=5.4,<5.4.12.3|>=2011,<2017.12.4.3|>=2018.6,<2018.6.1.4|>=2018.9,<2018.9.1.3", "ezsystems/repository-forms": ">=2.3,<2.3.2.1", @@ -3490,7 +3496,7 @@ "fuel/core": "<1.8.1", "gree/jose": "<=2.2", "gregwar/rst": "<1.0.3", - "guzzlehttp/guzzle": ">=6,<6.2.1|>=4.0.0-rc2,<4.2.4|>=5,<5.3.1", + "guzzlehttp/guzzle": ">=4-rc.2,<4.2.4|>=5,<5.3.1|>=6,<6.2.1", "illuminate/auth": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.10", "illuminate/cookie": ">=4,<=4.0.11|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.42|>=5.6,<5.6.30", "illuminate/database": ">=4,<4.0.99|>=4.1,<4.1.29", @@ -3505,9 +3511,9 @@ "laravel/framework": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.42|>=5.6,<5.6.30", "laravel/socialite": ">=1,<1.0.99|>=2,<2.0.10", "league/commonmark": "<0.18.3", - "magento/magento1ce": "<1.9.4.1", - "magento/magento1ee": ">=1.9,<1.14.4.1", - "magento/product-community-edition": ">=2,<2.2.8|>=2.3,<2.3.1", + "magento/magento1ce": "<1.9.4.3", + "magento/magento1ee": ">=1,<1.14.4.3", + "magento/product-community-edition": ">=2,<2.2.10|>=2.3,<2.3.2-p.2", "monolog/monolog": ">=1.8,<1.12", "namshi/jose": "<2.2", "onelogin/php-saml": "<2.10.4", @@ -3525,21 +3531,24 @@ "phpunit/phpunit": ">=4.8.19,<4.8.28|>=5.0.10,<5.6.3", "phpwhois/phpwhois": "<=4.2.5", "phpxmlrpc/extras": "<0.6.1", - "propel/propel": ">=2.0.0-alpha1,<=2.0.0-alpha7", + "propel/propel": ">=2-alpha.1,<=2-alpha.7", "propel/propel1": ">=1,<=1.7.1", "pusher/pusher-php-server": "<2.2.1", - "robrichards/xmlseclibs": ">=1,<3.0.2", + "robrichards/xmlseclibs": ">=1,<3.0.4", "sabre/dav": ">=1.6,<1.6.99|>=1.7,<1.7.11|>=1.8,<1.8.9", "sensiolabs/connect": "<4.2.3", "serluck/phpwhois": "<=4.2.6", "shopware/shopware": "<5.3.7", "silverstripe/cms": ">=3,<=3.0.11|>=3.1,<3.1.11", "silverstripe/forum": "<=0.6.1|>=0.7,<=0.7.3", - "silverstripe/framework": ">=3,<3.6.7|>=3.7,<3.7.3|>=4,<4.0.7|>=4.1,<4.1.5|>=4.2,<4.2.4|>=4.3,<4.3.1", + "silverstripe/framework": ">=3,<3.6.7|>=3.7,<3.7.3|>=4,<4.4", + "silverstripe/graphql": ">=2,<2.0.5|>=3,<3.1.2", + "silverstripe/registry": ">=2.1,<2.1.2|>=2.2,<2.2.1", + "silverstripe/restfulserver": ">=1,<1.0.9|>=2,<2.0.4", "silverstripe/userforms": "<3", "simple-updates/phpwhois": "<=1", "simplesamlphp/saml2": "<1.10.6|>=2,<2.3.8|>=3,<3.1.4", - "simplesamlphp/simplesamlphp": "<1.15.2|>=1.16,<1.16.3", + "simplesamlphp/simplesamlphp": "<1.17.8", "simplesamlphp/simplesamlphp-module-infocard": "<1.0.1", "slim/slim": "<2.6", "smarty/smarty": "<3.1.33", @@ -3547,16 +3556,20 @@ "spoonity/tcpdf": "<6.2.22", "squizlabs/php_codesniffer": ">=1,<2.8.1|>=3,<3.0.1", "stormpath/sdk": ">=0,<9.9.99", + "studio-42/elfinder": "<2.1.48", "swiftmailer/swiftmailer": ">=4,<5.4.5", "sylius/admin-bundle": ">=1,<1.0.17|>=1.1,<1.1.9|>=1.2,<1.2.2", - "sylius/sylius": ">=1,<1.0.17|>=1.1,<1.1.9|>=1.2,<1.2.2", - "symfony/cache": ">=3.2,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", + "sylius/grid": ">=1,<1.1.19|>=1.2,<1.2.18|>=1.3,<1.3.13|>=1.4,<1.4.5|>=1.5,<1.5.1", + "sylius/grid-bundle": ">=1,<1.1.19|>=1.2,<1.2.18|>=1.3,<1.3.13|>=1.4,<1.4.5|>=1.5,<1.5.1", + "sylius/sylius": ">=1,<1.1.18|>=1.2,<1.2.17|>=1.3,<1.3.12|>=1.4,<1.4.4", + "symfony/cache": ">=3.1,<3.4.35|>=4,<4.2.12|>=4.3,<4.3.8", "symfony/dependency-injection": ">=2,<2.0.17|>=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", "symfony/form": ">=2.3,<2.3.35|>=2.4,<2.6.12|>=2.7,<2.7.50|>=2.8,<2.8.49|>=3,<3.4.20|>=4,<4.0.15|>=4.1,<4.1.9|>=4.2,<4.2.1", "symfony/framework-bundle": ">=2,<2.3.18|>=2.4,<2.4.8|>=2.5,<2.5.2|>=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", - "symfony/http-foundation": ">=2,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", - "symfony/http-kernel": ">=2,<2.3.29|>=2.4,<2.5.12|>=2.6,<2.6.8", + "symfony/http-foundation": ">=2,<2.8.52|>=3,<3.4.35|>=4,<4.2.12|>=4.3,<4.3.8", + "symfony/http-kernel": ">=2,<2.8.52|>=3,<3.4.35|>=4,<4.2.12|>=4.3,<4.3.8", "symfony/intl": ">=2.7,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", + "symfony/mime": ">=4.3,<4.3.8", "symfony/phpunit-bridge": ">=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", "symfony/polyfill": ">=1,<1.10", "symfony/polyfill-php55": ">=1,<1.10", @@ -3567,22 +3580,23 @@ "symfony/security-core": ">=2.4,<2.6.13|>=2.7,<2.7.9|>=2.7.30,<2.7.32|>=2.8,<2.8.37|>=3,<3.3.17|>=3.4,<3.4.7|>=4,<4.0.7", "symfony/security-csrf": ">=2.4,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", "symfony/security-guard": ">=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", - "symfony/security-http": ">=2.3,<2.3.41|>=2.4,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", + "symfony/security-http": ">=2.3,<2.3.41|>=2.4,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.2.12|>=4.3,<4.3.8", "symfony/serializer": ">=2,<2.0.11", - "symfony/symfony": ">=2,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", + "symfony/symfony": ">=2,<2.8.52|>=3,<3.4.35|>=4,<4.2.12|>=4.3,<4.3.8", "symfony/translation": ">=2,<2.0.17", "symfony/validator": ">=2,<2.0.24|>=2.1,<2.1.12|>=2.2,<2.2.5|>=2.3,<2.3.3", + "symfony/var-exporter": ">=4.2,<4.2.12|>=4.3,<4.3.8", "symfony/web-profiler-bundle": ">=2,<2.3.19|>=2.4,<2.4.9|>=2.5,<2.5.4", "symfony/yaml": ">=2,<2.0.22|>=2.1,<2.1.7", "tecnickcom/tcpdf": "<6.2.22", "thelia/backoffice-default-template": ">=2.1,<2.1.2", - "thelia/thelia": ">=2.1,<2.1.2|>=2.1.0-beta1,<2.1.3", + "thelia/thelia": ">=2.1-beta.1,<2.1.3", "theonedemon/phpwhois": "<=4.2.5", "titon/framework": ">=0,<9.9.99", "truckersmp/phpwhois": "<=4.3.1", "twig/twig": "<1.38|>=2,<2.7", - "typo3/cms": ">=6.2,<6.2.30|>=7,<7.6.32|>=8,<8.7.25|>=9,<9.5.6", - "typo3/cms-core": ">=8,<8.7.25|>=9,<9.5.6", + "typo3/cms": ">=6.2,<6.2.30|>=7,<7.6.32|>=8,<8.7.30|>=9,<9.5.12|>=10,<10.2.1", + "typo3/cms-core": ">=8,<8.7.30|>=9,<9.5.12|>=10,<10.2.1", "typo3/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.10|>=3.1,<3.1.7|>=3.2,<3.2.7|>=3.3,<3.3.5", "typo3/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4", "typo3/phar-stream-wrapper": ">=1,<2.1.1|>=3,<3.1.1", @@ -3636,20 +3650,20 @@ } ], "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", - "time": "2019-05-08T13:51:25+00:00" + "time": "2019-12-17T15:12:43+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.4.2", + "version": "3.5.3", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8" + "reference": "557a1fc7ac702c66b0bbfe16ab3d55839ef724cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8", - "reference": "b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/557a1fc7ac702c66b0bbfe16ab3d55839ef724cb", + "reference": "557a1fc7ac702c66b0bbfe16ab3d55839ef724cb", "shasum": "" }, "require": { @@ -3687,20 +3701,20 @@ "phpcs", "standards" ], - "time": "2019-04-10T23:49:02+00:00" + "time": "2019-12-04T04:46:47+00:00" }, { "name": "symfony/class-loader", - "version": "v3.4.27", + "version": "v3.4.36", "source": { "type": "git", "url": "https://github.com/symfony/class-loader.git", - "reference": "4459eef5298dedfb69f771186a580062b8516497" + "reference": "e212b06996819a2bce026a63da03b7182d05a690" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/class-loader/zipball/4459eef5298dedfb69f771186a580062b8516497", - "reference": "4459eef5298dedfb69f771186a580062b8516497", + "url": "https://api.github.com/repos/symfony/class-loader/zipball/e212b06996819a2bce026a63da03b7182d05a690", + "reference": "e212b06996819a2bce026a63da03b7182d05a690", "shasum": "" }, "require": { @@ -3743,7 +3757,7 @@ ], "description": "Symfony ClassLoader Component", "homepage": "https://symfony.com", - "time": "2019-01-16T09:39:14+00:00" + "time": "2019-08-20T13:31:17+00:00" }, { "name": "wimg/php-compatibility", @@ -3804,12 +3818,12 @@ "version": "0.13.1", "source": { "type": "git", - "url": "https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git", + "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", "reference": "1f64b1a0b5b789822d0303436ee4e30e0135e4dc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/zipball/1f64b1a0b5b789822d0303436ee4e30e0135e4dc", + "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/1f64b1a0b5b789822d0303436ee4e30e0135e4dc", "reference": "1f64b1a0b5b789822d0303436ee4e30e0135e4dc", "shasum": "" }, From 8cedeb73534ac55baf3817350e4066ea5bee6ac3 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Wed, 18 Dec 2019 18:25:44 +0530 Subject: [PATCH 0705/1044] Bump version v4.0.15 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 80c4cafe0..af253c16c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.0.14 +4.0.15 From a8f9562cdd95c5d4c86c125b21356bc818af4439 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 6 Jan 2020 10:47:48 +0530 Subject: [PATCH 0706/1044] Update image versions Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- img-versions.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/img-versions.json b/img-versions.json index a996dd766..6c8e891ff 100644 --- a/img-versions.json +++ b/img-versions.json @@ -4,12 +4,12 @@ "easyengine/mariadb": "v4.0.0", "easyengine/nginx-proxy": "v4.0.3", "easyengine/nginx": "v4.1.0", - "easyengine/php": "v4.1.0", + "easyengine/php": "v4.1.1", "easyengine/php5.6": "v4.0.0", "easyengine/php7.0": "v4.1.0", "easyengine/php7.2": "v4.1.0", "easyengine/php7.3": "v4.1.0", - "easyengine/php7.4": "v4.1.0", + "easyengine/php7.4": "v4.1.1", "easyengine/postfix": "v4.0.0", "easyengine/redis": "v4.0.0", "easyengine/newrelic-daemon": "v4.0.0" From 730a310830ea93f2f1b68e00e00223ebb540db26 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 6 Jan 2020 10:48:07 +0530 Subject: [PATCH 0707/1044] Update composer packages Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 2 +- composer.lock | 26 ++++++++++++++------------ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/composer.json b/composer.json index c6995981e..eb1daeb91 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,7 @@ "easyengine/cron-command": "v1.0.2", "easyengine/log-command": "v1.0.1", "easyengine/mailhog-command": "v1.0.2", - "easyengine/site-command": "v2.4.0", + "easyengine/site-command": "v2.4.1", "easyengine/site-type-wp": "v1.1.0", "easyengine/site-type-php": "v1.1.0", "easyengine/service-command": "v1.0.9", diff --git a/composer.lock b/composer.lock index 29c86955d..e40c379c7 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": "d3359aede06e3440af28656664393865", + "content-hash": "6e9a80680c872464527e590dfb5f2d56", "packages": [ { "name": "acmephp/core", @@ -828,16 +828,16 @@ }, { "name": "easyengine/site-command", - "version": "v2.4.0", + "version": "v2.4.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "0bfc6a8c23b8099a11db30eb212f0b872158baf1" + "reference": "03f5b2b72a670780fad4ee1d9467e2dbc87f09bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/0bfc6a8c23b8099a11db30eb212f0b872158baf1", - "reference": "0bfc6a8c23b8099a11db30eb212f0b872158baf1", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/03f5b2b72a670780fad4ee1d9467e2dbc87f09bb", + "reference": "03f5b2b72a670780fad4ee1d9467e2dbc87f09bb", "shasum": "" }, "require": { @@ -887,7 +887,7 @@ "MIT" ], "homepage": "https://github.com/easyengine/site-command", - "time": "2019-12-18T11:11:27+00:00" + "time": "2020-01-06T05:09:06+00:00" }, { "name": "easyengine/site-type-php", @@ -3440,12 +3440,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "1b2183eef1fdf7438d26b37dd87beb07dd4808bc" + "reference": "872fce6c151b06f6446f228f2290a48862ede2a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/1b2183eef1fdf7438d26b37dd87beb07dd4808bc", - "reference": "1b2183eef1fdf7438d26b37dd87beb07dd4808bc", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/872fce6c151b06f6446f228f2290a48862ede2a4", + "reference": "872fce6c151b06f6446f228f2290a48862ede2a4", "shasum": "" }, "conflict": { @@ -3480,8 +3480,9 @@ "doctrine/mongodb-odm-bundle": ">=2,<3.0.1", "doctrine/orm": ">=2,<2.4.8|>=2.5,<2.5.1", "dompdf/dompdf": ">=0.6,<0.6.2", - "drupal/core": ">=7,<7.67|>=8,<8.6.16|>=8.7,<8.7.1|>8.7.3,<8.7.5", - "drupal/drupal": ">=7,<7.67|>=8,<8.6.16|>=8.7,<8.7.1|>8.7.3,<8.7.5", + "drupal/core": ">=7,<7.69|>=8,<8.7.11|>=8.8,<8.8.1", + "drupal/drupal": ">=7,<8.7.11|>=8.8,<8.8.1", + "endroid/qr-code-bundle": "<3.4.2", "erusev/parsedown": "<1.7.2", "ezsystems/ezplatform-admin-ui": ">=1.3,<1.3.5|>=1.4,<1.4.4", "ezsystems/ezpublish-kernel": ">=5.3,<5.3.12.1|>=5.4,<5.4.13.1|>=6,<6.7.9.1|>=6.8,<6.13.5.1|>=7,<7.2.4.1|>=7.3,<7.3.2.1", @@ -3536,6 +3537,7 @@ "pusher/pusher-php-server": "<2.2.1", "robrichards/xmlseclibs": ">=1,<3.0.4", "sabre/dav": ">=1.6,<1.6.99|>=1.7,<1.7.11|>=1.8,<1.8.9", + "scheb/two-factor-bundle": ">=0,<3.26|>=4,<4.11", "sensiolabs/connect": "<4.2.3", "serluck/phpwhois": "<=4.2.6", "shopware/shopware": "<5.3.7", @@ -3650,7 +3652,7 @@ } ], "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", - "time": "2019-12-17T15:12:43+00:00" + "time": "2020-01-02T17:29:14+00:00" }, { "name": "squizlabs/php_codesniffer", From 809dc373223083786326f8c9dc6878f3caf1d6b1 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 6 Jan 2020 14:52:13 +0530 Subject: [PATCH 0708/1044] Add extra and old docker images cleanup on update Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- php/EE/Migration/Containers.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index 9c9e77c4b..9336d6963 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -81,11 +81,25 @@ public static function save_upgraded_image_versions( $current_versions, $new_ver 'EE\Migration\Containers::revert_database_entry', [ $new_versions, $updated_images ], [ $current_versions, $updated_images ] + ); + self::$rsp->add_step( + 'prune-old-docker-images', + 'EE\Migration\Containers::image_cleanup', + null, + null, + null ); } + /** + * Prune old and extra EE Docker images. + */ + public static function image_cleanup() { + EE::exec( 'docker image prune -af --filter=label=org.label-schema.vendor="EasyEngine"' ); + } + /** * Update database entry of images * From 38d11cb4fa16000acf36e117979bf65e4331cbff Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 6 Jan 2020 14:57:44 +0530 Subject: [PATCH 0709/1044] Update composer packages Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 2 +- composer.lock | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index eb1daeb91..cc53eb0a8 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,7 @@ "easyengine/cron-command": "v1.0.2", "easyengine/log-command": "v1.0.1", "easyengine/mailhog-command": "v1.0.2", - "easyengine/site-command": "v2.4.1", + "easyengine/site-command": "v2.4.2", "easyengine/site-type-wp": "v1.1.0", "easyengine/site-type-php": "v1.1.0", "easyengine/service-command": "v1.0.9", diff --git a/composer.lock b/composer.lock index e40c379c7..c6deef2c3 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": "6e9a80680c872464527e590dfb5f2d56", + "content-hash": "81b497f898857ff81664400b915de018", "packages": [ { "name": "acmephp/core", @@ -828,16 +828,16 @@ }, { "name": "easyengine/site-command", - "version": "v2.4.1", + "version": "v2.4.2", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "03f5b2b72a670780fad4ee1d9467e2dbc87f09bb" + "reference": "e3be05f8c70b3edb43433d875aec67612a932672" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/03f5b2b72a670780fad4ee1d9467e2dbc87f09bb", - "reference": "03f5b2b72a670780fad4ee1d9467e2dbc87f09bb", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/e3be05f8c70b3edb43433d875aec67612a932672", + "reference": "e3be05f8c70b3edb43433d875aec67612a932672", "shasum": "" }, "require": { @@ -887,7 +887,7 @@ "MIT" ], "homepage": "https://github.com/easyengine/site-command", - "time": "2020-01-06T05:09:06+00:00" + "time": "2020-01-06T09:24:19+00:00" }, { "name": "easyengine/site-type-php", From 7c8cb8c4655ea0931f5e7460beb0b0c673490843 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 6 Jan 2020 14:57:56 +0530 Subject: [PATCH 0710/1044] Update PHP images Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- img-versions.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/img-versions.json b/img-versions.json index 6c8e891ff..693cba748 100644 --- a/img-versions.json +++ b/img-versions.json @@ -4,12 +4,12 @@ "easyengine/mariadb": "v4.0.0", "easyengine/nginx-proxy": "v4.0.3", "easyengine/nginx": "v4.1.0", - "easyengine/php": "v4.1.1", + "easyengine/php": "v4.1.2", "easyengine/php5.6": "v4.0.0", - "easyengine/php7.0": "v4.1.0", - "easyengine/php7.2": "v4.1.0", - "easyengine/php7.3": "v4.1.0", - "easyengine/php7.4": "v4.1.1", + "easyengine/php7.0": "v4.1.2", + "easyengine/php7.2": "v4.1.2", + "easyengine/php7.3": "v4.1.2", + "easyengine/php7.4": "v4.1.2", "easyengine/postfix": "v4.0.0", "easyengine/redis": "v4.0.0", "easyengine/newrelic-daemon": "v4.0.0" From 59b1d9de9c04032c1416318c4ec8e504d010b165 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 6 Jan 2020 15:27:39 +0530 Subject: [PATCH 0711/1044] Bump version v4.0.16 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index af253c16c..5188cc076 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.0.15 +4.0.16 From 815d6f7044a44883717255077cc1dbd6203531eb Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 9 Jan 2020 08:23:27 +0530 Subject: [PATCH 0712/1044] Update composer packages Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 2 +- composer.lock | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/composer.json b/composer.json index cc53eb0a8..361236ba2 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,7 @@ "easyengine/cron-command": "v1.0.2", "easyengine/log-command": "v1.0.1", "easyengine/mailhog-command": "v1.0.2", - "easyengine/site-command": "v2.4.2", + "easyengine/site-command": "v2.4.4", "easyengine/site-type-wp": "v1.1.0", "easyengine/site-type-php": "v1.1.0", "easyengine/service-command": "v1.0.9", diff --git a/composer.lock b/composer.lock index c6deef2c3..449ab5041 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": "81b497f898857ff81664400b915de018", + "content-hash": "de090a112b8596c27395ae161040f697", "packages": [ { "name": "acmephp/core", @@ -828,16 +828,16 @@ }, { "name": "easyengine/site-command", - "version": "v2.4.2", + "version": "v2.4.4", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "e3be05f8c70b3edb43433d875aec67612a932672" + "reference": "188d9dbf1fe0224c149bcc7202366fbcd27ce896" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/e3be05f8c70b3edb43433d875aec67612a932672", - "reference": "e3be05f8c70b3edb43433d875aec67612a932672", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/188d9dbf1fe0224c149bcc7202366fbcd27ce896", + "reference": "188d9dbf1fe0224c149bcc7202366fbcd27ce896", "shasum": "" }, "require": { @@ -887,7 +887,7 @@ "MIT" ], "homepage": "https://github.com/easyengine/site-command", - "time": "2020-01-06T09:24:19+00:00" + "time": "2020-01-09T02:51:06+00:00" }, { "name": "easyengine/site-type-php", @@ -3440,12 +3440,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "872fce6c151b06f6446f228f2290a48862ede2a4" + "reference": "67ac6ea8f4a078c3c9b7aec5d7ae70f098c37389" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/872fce6c151b06f6446f228f2290a48862ede2a4", - "reference": "872fce6c151b06f6446f228f2290a48862ede2a4", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/67ac6ea8f4a078c3c9b7aec5d7ae70f098c37389", + "reference": "67ac6ea8f4a078c3c9b7aec5d7ae70f098c37389", "shasum": "" }, "conflict": { @@ -3481,7 +3481,7 @@ "doctrine/orm": ">=2,<2.4.8|>=2.5,<2.5.1", "dompdf/dompdf": ">=0.6,<0.6.2", "drupal/core": ">=7,<7.69|>=8,<8.7.11|>=8.8,<8.8.1", - "drupal/drupal": ">=7,<8.7.11|>=8.8,<8.8.1", + "drupal/drupal": ">=7,<7.69|>=8,<8.7.11|>=8.8,<8.8.1", "endroid/qr-code-bundle": "<3.4.2", "erusev/parsedown": "<1.7.2", "ezsystems/ezplatform-admin-ui": ">=1.3,<1.3.5|>=1.4,<1.4.4", @@ -3652,7 +3652,7 @@ } ], "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", - "time": "2020-01-02T17:29:14+00:00" + "time": "2020-01-06T19:16:46+00:00" }, { "name": "squizlabs/php_codesniffer", From dc7027917059eab808c4c9d900f3a8981611f3ae Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 9 Jan 2020 08:23:40 +0530 Subject: [PATCH 0713/1044] Bump version v4.0.17 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 5188cc076..9d58a584e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.0.16 +4.0.17 From 69423bd7ee83d0ce91e5713db2c44fa8ed278ae1 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Wed, 22 Apr 2020 17:40:53 +0530 Subject: [PATCH 0714/1044] Add wp-mail config file option Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- php/config-spec.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/php/config-spec.php b/php/config-spec.php index 1e091df90..2b7933d52 100644 --- a/php/config-spec.php +++ b/php/config-spec.php @@ -31,6 +31,13 @@ 'desc' => 'Mail-id to be used for letsencrypt.', ), + 'wp-mail' => array( + 'runtime' => '=<wp-mail>', + 'file' => '<wp-mail>', + 'default' => null, + 'desc' => 'Default Mail-id to be used for WordPress site installation.', + ), + 'ee_installer_version' => array( 'file' => '<path>', 'default' => null, From 880cb730441d4ec4967a7298b2357dd6d843af87 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Fri, 26 Jun 2020 15:11:01 +0530 Subject: [PATCH 0715/1044] Add PHP reloading function for migrations Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- php/EE/Migration/SiteContainers.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/php/EE/Migration/SiteContainers.php b/php/EE/Migration/SiteContainers.php index 8a720dd36..99e671912 100644 --- a/php/EE/Migration/SiteContainers.php +++ b/php/EE/Migration/SiteContainers.php @@ -206,17 +206,31 @@ public static function delete( $path_to_delete ) { /** * Function to reload site's nginx. * - * @param string $site_fs_path Directory containing site's docker-compose.yml. + * @param string $site_fs_path Directory containing site's docker-compose.yml. */ public static function reload_nginx( $site_fs_path ) { chdir( $site_fs_path ); - $success = EE::exec( "docker-compose exec nginx sh -c 'nginx -t && service openresty reload'" ); + $success = EE::exec( "docker-compose exec nginx sh -c 'nginx -t && nginx -s reload'" ); if ( ! $success ) { throw new \Exception( 'Could not reload nginx. Check logs.' ); } } + /** + * Function to reload site's php. + * + * @param string $site_fs_path Directory containing site's docker-compose.yml. + */ + public static function reload_php( $site_fs_path ) { + + chdir( $site_fs_path ); + $success = EE::exec( "docker-compose exec php bash -c 'kill -USR2 1'" ); + if ( ! $success ) { + throw new \Exception( 'Could not reload php. Check logs.' ); + } + } + /** * Function to pull site docker-compose images. * From 3d629ccf362a8473a216ca54e8f915d43d295d29 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Fri, 26 Jun 2020 15:11:28 +0530 Subject: [PATCH 0716/1044] Update image versions Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- img-versions.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/img-versions.json b/img-versions.json index 693cba748..6817f583f 100644 --- a/img-versions.json +++ b/img-versions.json @@ -1,15 +1,15 @@ { "easyengine/cron": "v4.0.0", "easyengine/mailhog": "v4.0.0", - "easyengine/mariadb": "v4.0.0", + "easyengine/mariadb": "v4.1.3", "easyengine/nginx-proxy": "v4.0.3", - "easyengine/nginx": "v4.1.0", - "easyengine/php": "v4.1.2", + "easyengine/nginx": "v4.1.3", + "easyengine/php": "v4.1.3", "easyengine/php5.6": "v4.0.0", "easyengine/php7.0": "v4.1.2", - "easyengine/php7.2": "v4.1.2", - "easyengine/php7.3": "v4.1.2", - "easyengine/php7.4": "v4.1.2", + "easyengine/php7.2": "v4.1.3", + "easyengine/php7.3": "v4.1.3", + "easyengine/php7.4": "v4.1.3", "easyengine/postfix": "v4.0.0", "easyengine/redis": "v4.0.0", "easyengine/newrelic-daemon": "v4.0.0" From 96c3b604ec3524301a7c1234a424b871fe89e0ea Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 6 Jul 2020 17:49:22 +0530 Subject: [PATCH 0717/1044] Update composer packages Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 8 +- composer.lock | 302 ++++++++++++++++++++++++++++++-------------------- 2 files changed, 188 insertions(+), 122 deletions(-) diff --git a/composer.json b/composer.json index 361236ba2..f48a478fa 100644 --- a/composer.json +++ b/composer.json @@ -28,14 +28,14 @@ "composer/composer": "1.7.3", "composer/semver": "1.4.2", "easyengine/admin-tools-command": "v1.0.9", - "easyengine/auth-command": "v1.0.2", + "easyengine/auth-command": "v1.0.3", "easyengine/config-command": "v1.0.2", "easyengine/cron-command": "v1.0.2", "easyengine/log-command": "v1.0.1", "easyengine/mailhog-command": "v1.0.2", - "easyengine/site-command": "v2.4.4", - "easyengine/site-type-wp": "v1.1.0", - "easyengine/site-type-php": "v1.1.0", + "easyengine/site-command": "v2.5.0", + "easyengine/site-type-wp": "v1.2.0", + "easyengine/site-type-php": "v1.2.0", "easyengine/service-command": "v1.0.9", "easyengine/shell-command" : "v1.0.3", "justinrainbow/json-schema": "5.2.7", diff --git a/composer.lock b/composer.lock index 449ab5041..d31024338 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": "de090a112b8596c27395ae161040f697", + "content-hash": "8af6af2259565d783d76766010378cf9", "packages": [ { "name": "acmephp/core", @@ -73,16 +73,16 @@ }, { "name": "acmephp/ssl", - "version": "1.1.1", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/acmephp/ssl.git", - "reference": "e615312ba2bb6d01267be585e0253e0a95178a31" + "reference": "7b144f9b9b2d6a42065001f784def28b1b2b1f32" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/acmephp/ssl/zipball/e615312ba2bb6d01267be585e0253e0a95178a31", - "reference": "e615312ba2bb6d01267be585e0253e0a95178a31", + "url": "https://api.github.com/repos/acmephp/ssl/zipball/7b144f9b9b2d6a42065001f784def28b1b2b1f32", + "reference": "7b144f9b9b2d6a42065001f784def28b1b2b1f32", "shasum": "" }, "require": { @@ -134,7 +134,7 @@ "ssl", "x509" ], - "time": "2018-11-05T19:26:21+00:00" + "time": "2019-12-17T14:19:42+00:00" }, { "name": "cloudflare/sdk", @@ -181,16 +181,16 @@ }, { "name": "composer/ca-bundle", - "version": "1.2.5", + "version": "1.2.7", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "62e8fc2dc550e5d6d8c9360c7721662670f58149" + "reference": "95c63ab2117a72f48f5a55da9740a3273d45b7fd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/62e8fc2dc550e5d6d8c9360c7721662670f58149", - "reference": "62e8fc2dc550e5d6d8c9360c7721662670f58149", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/95c63ab2117a72f48f5a55da9740a3273d45b7fd", + "reference": "95c63ab2117a72f48f5a55da9740a3273d45b7fd", "shasum": "" }, "require": { @@ -233,7 +233,7 @@ "ssl", "tls" ], - "time": "2019-12-11T14:44:42+00:00" + "time": "2020-04-08T08:27:21+00:00" }, { "name": "composer/composer", @@ -379,16 +379,16 @@ }, { "name": "composer/spdx-licenses", - "version": "1.5.2", + "version": "1.5.3", "source": { "type": "git", "url": "https://github.com/composer/spdx-licenses.git", - "reference": "7ac1e6aec371357df067f8a688c3d6974df68fa5" + "reference": "0c3e51e1880ca149682332770e25977c70cf9dae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/7ac1e6aec371357df067f8a688c3d6974df68fa5", - "reference": "7ac1e6aec371357df067f8a688c3d6974df68fa5", + "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/0c3e51e1880ca149682332770e25977c70cf9dae", + "reference": "0c3e51e1880ca149682332770e25977c70cf9dae", "shasum": "" }, "require": { @@ -435,20 +435,20 @@ "spdx", "validator" ], - "time": "2019-07-29T10:31:59+00:00" + "time": "2020-02-14T07:44:31+00:00" }, { "name": "composer/xdebug-handler", - "version": "1.4.0", + "version": "1.4.2", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "cbe23383749496fe0f373345208b79568e4bc248" + "reference": "fa2aaf99e2087f013a14f7432c1cd2dd7d8f1f51" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/cbe23383749496fe0f373345208b79568e4bc248", - "reference": "cbe23383749496fe0f373345208b79568e4bc248", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/fa2aaf99e2087f013a14f7432c1cd2dd7d8f1f51", + "reference": "fa2aaf99e2087f013a14f7432c1cd2dd7d8f1f51", "shasum": "" }, "require": { @@ -479,7 +479,7 @@ "Xdebug", "performance" ], - "time": "2019-11-06T16:40:04+00:00" + "time": "2020-06-04T11:16:35+00:00" }, { "name": "easyengine/admin-tools-command", @@ -525,16 +525,16 @@ }, { "name": "easyengine/auth-command", - "version": "v1.0.2", + "version": "v1.0.3", "source": { "type": "git", "url": "https://github.com/EasyEngine/auth-command.git", - "reference": "2c2b8cdf9d04629835951f85cd5b626e80c790fd" + "reference": "a30a6d05c1800d73b1fa8c15c3cadeda6ff0dd24" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/auth-command/zipball/2c2b8cdf9d04629835951f85cd5b626e80c790fd", - "reference": "2c2b8cdf9d04629835951f85cd5b626e80c790fd", + "url": "https://api.github.com/repos/EasyEngine/auth-command/zipball/a30a6d05c1800d73b1fa8c15c3cadeda6ff0dd24", + "reference": "a30a6d05c1800d73b1fa8c15c3cadeda6ff0dd24", "shasum": "" }, "type": "ee-cli-package", @@ -568,7 +568,7 @@ ], "description": "Configure HTTP Authentication and whitelisting for EasyEngine site", "homepage": "https://github.com/easyengine/auth-command", - "time": "2018-12-28T16:04:07+00:00" + "time": "2020-07-06T11:44:21+00:00" }, { "name": "easyengine/config-command", @@ -828,16 +828,16 @@ }, { "name": "easyengine/site-command", - "version": "v2.4.4", + "version": "v2.5.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "188d9dbf1fe0224c149bcc7202366fbcd27ce896" + "reference": "fec254173339cabcb6b3afe58db91400df777c36" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/188d9dbf1fe0224c149bcc7202366fbcd27ce896", - "reference": "188d9dbf1fe0224c149bcc7202366fbcd27ce896", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/fec254173339cabcb6b3afe58db91400df777c36", + "reference": "fec254173339cabcb6b3afe58db91400df777c36", "shasum": "" }, "require": { @@ -887,20 +887,20 @@ "MIT" ], "homepage": "https://github.com/easyengine/site-command", - "time": "2020-01-09T02:51:06+00:00" + "time": "2020-07-06T11:23:56+00:00" }, { "name": "easyengine/site-type-php", - "version": "v1.1.0", + "version": "v1.2.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-php.git", - "reference": "8823e105f5ec9c3d7bafe79e9341636ee07560ae" + "reference": "cc0f86ba72f313bd312c6964e1059b6567871849" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/8823e105f5ec9c3d7bafe79e9341636ee07560ae", - "reference": "8823e105f5ec9c3d7bafe79e9341636ee07560ae", + "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/cc0f86ba72f313bd312c6964e1059b6567871849", + "reference": "cc0f86ba72f313bd312c6964e1059b6567871849", "shasum": "" }, "require-dev": { @@ -942,20 +942,20 @@ ], "description": "EasyEngine package for PHP site creation.", "homepage": "https://github.com/easyengine/site-type-php", - "time": "2019-12-18T12:46:13+00:00" + "time": "2020-07-06T11:37:17+00:00" }, { "name": "easyengine/site-type-wp", - "version": "v1.1.0", + "version": "v1.2.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-wp.git", - "reference": "fa9b02d6b05fad3cbcd046227947604ecb076a08" + "reference": "31ad226b96b7564fbfc53d7252a253e018fa9525" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/fa9b02d6b05fad3cbcd046227947604ecb076a08", - "reference": "fa9b02d6b05fad3cbcd046227947604ecb076a08", + "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/31ad226b96b7564fbfc53d7252a253e018fa9525", + "reference": "31ad226b96b7564fbfc53d7252a253e018fa9525", "shasum": "" }, "require-dev": { @@ -997,7 +997,7 @@ ], "description": "EasyEngine site type package for WordPress site creation.", "homepage": "https://github.com/easyengine/site-type-wp", - "time": "2019-12-18T12:44:35+00:00" + "time": "2020-07-06T11:37:51+00:00" }, { "name": "guzzlehttp/guzzle", @@ -1561,16 +1561,16 @@ }, { "name": "psr/log", - "version": "1.1.2", + "version": "1.1.3", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801" + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/446d54b4cb6bf489fc9d75f55843658e6f25d801", - "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801", + "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", "shasum": "" }, "require": { @@ -1604,7 +1604,7 @@ "psr", "psr-3" ], - "time": "2019-11-01T11:05:21+00:00" + "time": "2020-03-23T09:12:05+00:00" }, { "name": "ralouphie/getallheaders", @@ -1697,20 +1697,20 @@ }, { "name": "seld/jsonlint", - "version": "1.7.2", + "version": "1.8.0", "source": { "type": "git", "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "e2e5d290e4d2a4f0eb449f510071392e00e10d19" + "reference": "ff2aa5420bfbc296cf6a0bc785fa5b35736de7c1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/e2e5d290e4d2a4f0eb449f510071392e00e10d19", - "reference": "e2e5d290e4d2a4f0eb449f510071392e00e10d19", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/ff2aa5420bfbc296cf6a0bc785fa5b35736de7c1", + "reference": "ff2aa5420bfbc296cf6a0bc785fa5b35736de7c1", "shasum": "" }, "require": { - "php": "^5.3 || ^7.0" + "php": "^5.3 || ^7.0 || ^8.0" }, "require-dev": { "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" @@ -1742,20 +1742,20 @@ "parser", "validator" ], - "time": "2019-10-24T14:27:39+00:00" + "time": "2020-04-30T19:05:18+00:00" }, { "name": "seld/phar-utils", - "version": "1.0.1", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/Seldaek/phar-utils.git", - "reference": "7009b5139491975ef6486545a39f3e6dad5ac30a" + "reference": "8800503d56b9867d43d9c303b9cbcc26016e82f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/7009b5139491975ef6486545a39f3e6dad5ac30a", - "reference": "7009b5139491975ef6486545a39f3e6dad5ac30a", + "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/8800503d56b9867d43d9c303b9cbcc26016e82f0", + "reference": "8800503d56b9867d43d9c303b9cbcc26016e82f0", "shasum": "" }, "require": { @@ -1784,9 +1784,9 @@ ], "description": "PHAR file format utilities, for when PHP phars you up", "keywords": [ - "phra" + "phar" ], - "time": "2015-10-13T18:44:15+00:00" + "time": "2020-02-14T15:25:33+00:00" }, { "name": "symfony/config", @@ -2212,16 +2212,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.13.1", + "version": "v1.17.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3" + "reference": "2edd75b8b35d62fd3eeabba73b26b8f1f60ce13d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", - "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/2edd75b8b35d62fd3eeabba73b26b8f1f60ce13d", + "reference": "2edd75b8b35d62fd3eeabba73b26b8f1f60ce13d", "shasum": "" }, "require": { @@ -2233,7 +2233,11 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.13-dev" + "dev-master": "1.17-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { @@ -2266,20 +2270,20 @@ "polyfill", "portable" ], - "time": "2019-11-27T13:56:44+00:00" + "time": "2020-06-06T08:46:27+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.13.1", + "version": "v1.17.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "7b4aab9743c30be783b73de055d24a39cf4b954f" + "reference": "7110338d81ce1cbc3e273136e4574663627037a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7b4aab9743c30be783b73de055d24a39cf4b954f", - "reference": "7b4aab9743c30be783b73de055d24a39cf4b954f", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7110338d81ce1cbc3e273136e4574663627037a7", + "reference": "7110338d81ce1cbc3e273136e4574663627037a7", "shasum": "" }, "require": { @@ -2291,7 +2295,11 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.13-dev" + "dev-master": "1.17-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { @@ -2325,7 +2333,7 @@ "portable", "shim" ], - "time": "2019-11-27T14:18:11+00:00" + "time": "2020-06-06T08:46:27+00:00" }, { "name": "symfony/process", @@ -2671,6 +2679,7 @@ ], "description": "Composer plugin for splitting a generated autoloader into two distinct parts.", "homepage": "https://wp-cli.org", + "abandoned": true, "time": "2017-08-03T08:40:16+00:00" }, { @@ -2858,16 +2867,16 @@ }, { "name": "behat/gherkin", - "version": "v4.6.0", + "version": "v4.6.2", "source": { "type": "git", "url": "https://github.com/Behat/Gherkin.git", - "reference": "ab0a02ea14893860bca00f225f5621d351a3ad07" + "reference": "51ac4500c4dc30cbaaabcd2f25694299df666a31" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Behat/Gherkin/zipball/ab0a02ea14893860bca00f225f5621d351a3ad07", - "reference": "ab0a02ea14893860bca00f225f5621d351a3ad07", + "url": "https://api.github.com/repos/Behat/Gherkin/zipball/51ac4500c4dc30cbaaabcd2f25694299df666a31", + "reference": "51ac4500c4dc30cbaaabcd2f25694299df666a31", "shasum": "" }, "require": { @@ -2913,20 +2922,20 @@ "gherkin", "parser" ], - "time": "2019-01-16T14:22:17+00:00" + "time": "2020-03-17T14:03:26+00:00" }, { "name": "behat/transliterator", - "version": "v1.2.0", + "version": "v1.3.0", "source": { "type": "git", "url": "https://github.com/Behat/Transliterator.git", - "reference": "826ce7e9c2a6664c0d1f381cbb38b1fb80a7ee2c" + "reference": "3c4ec1d77c3d05caa1f0bf8fb3aae4845005c7fc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Behat/Transliterator/zipball/826ce7e9c2a6664c0d1f381cbb38b1fb80a7ee2c", - "reference": "826ce7e9c2a6664c0d1f381cbb38b1fb80a7ee2c", + "url": "https://api.github.com/repos/Behat/Transliterator/zipball/3c4ec1d77c3d05caa1f0bf8fb3aae4845005c7fc", + "reference": "3c4ec1d77c3d05caa1f0bf8fb3aae4845005c7fc", "shasum": "" }, "require": { @@ -2934,7 +2943,8 @@ }, "require-dev": { "chuyskywalker/rolling-curl": "^3.1", - "php-yaoi/php-yaoi": "^1.0" + "php-yaoi/php-yaoi": "^1.0", + "phpunit/phpunit": "^4.8.36|^6.3" }, "type": "library", "extra": { @@ -2943,8 +2953,8 @@ } }, "autoload": { - "psr-0": { - "Behat\\Transliterator": "src/" + "psr-4": { + "Behat\\Transliterator\\": "src/Behat/Transliterator" } }, "notification-url": "https://packagist.org/downloads/", @@ -2957,7 +2967,7 @@ "slug", "transliterator" ], - "time": "2017-04-04T11:38:05+00:00" + "time": "2020-01-14T16:39:13+00:00" }, { "name": "container-interop/container-interop", @@ -3440,12 +3450,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "67ac6ea8f4a078c3c9b7aec5d7ae70f098c37389" + "reference": "57353ec1a34527a2dbbd3c0fb9418ffc008c6f60" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/67ac6ea8f4a078c3c9b7aec5d7ae70f098c37389", - "reference": "67ac6ea8f4a078c3c9b7aec5d7ae70f098c37389", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/57353ec1a34527a2dbbd3c0fb9418ffc008c6f60", + "reference": "57353ec1a34527a2dbbd3c0fb9418ffc008c6f60", "shasum": "" }, "conflict": { @@ -3454,14 +3464,22 @@ "alterphp/easyadmin-extension-bundle": ">=1.2,<1.2.11|>=1.3,<1.3.1", "amphp/artax": "<1.0.6|>=2,<2.0.6", "amphp/http": "<1.0.1", + "amphp/http-client": ">=4,<4.4", "api-platform/core": ">=2.2,<2.2.10|>=2.3,<2.3.6", "asymmetricrypt/asymmetricrypt": ">=0,<9.9.99", "aws/aws-sdk-php": ">=3,<3.2.1", + "bagisto/bagisto": "<0.1.5", + "barrelstrength/sprout-base-email": "<1.2.7", + "barrelstrength/sprout-forms": "<3.9", + "bolt/bolt": "<3.7.1", "brightlocal/phpwhois": "<=4.2.5", + "buddypress/buddypress": "<5.1.2", "bugsnag/bugsnag-laravel": ">=2,<2.0.2", "cakephp/cakephp": ">=1.3,<1.3.18|>=2,<2.4.99|>=2.5,<2.5.99|>=2.6,<2.6.12|>=2.7,<2.7.6|>=3,<3.5.18|>=3.6,<3.6.15|>=3.7,<3.7.7", "cart2quote/module-quotation": ">=4.1.6,<=4.4.5|>=5,<5.4.4", "cartalyst/sentry": "<=2.1.6", + "centreon/centreon": "<18.10.8|>=19,<19.4.5", + "cesnet/simplesamlphp-module-proxystatistics": "<3.1", "codeigniter/framework": "<=3.0.6", "composer/composer": "<=1-alpha.11", "contao-components/mediaelement": ">=2.14.2,<2.21.1", @@ -3479,22 +3497,33 @@ "doctrine/mongodb-odm": ">=1,<1.0.2", "doctrine/mongodb-odm-bundle": ">=2,<3.0.1", "doctrine/orm": ">=2,<2.4.8|>=2.5,<2.5.1", + "dolibarr/dolibarr": "<11.0.4", "dompdf/dompdf": ">=0.6,<0.6.2", - "drupal/core": ">=7,<7.69|>=8,<8.7.11|>=8.8,<8.8.1", - "drupal/drupal": ">=7,<7.69|>=8,<8.7.11|>=8.8,<8.8.1", + "drupal/core": ">=7,<7.72|>=8,<8.8.8|>=8.9,<8.9.1|>=9,<9.0.1", + "drupal/drupal": ">=7,<7.72|>=8,<8.8.8|>=8.9,<8.9.1|>=9,<9.0.1", "endroid/qr-code-bundle": "<3.4.2", + "enshrined/svg-sanitize": "<0.13.1", "erusev/parsedown": "<1.7.2", - "ezsystems/ezplatform-admin-ui": ">=1.3,<1.3.5|>=1.4,<1.4.4", - "ezsystems/ezpublish-kernel": ">=5.3,<5.3.12.1|>=5.4,<5.4.13.1|>=6,<6.7.9.1|>=6.8,<6.13.5.1|>=7,<7.2.4.1|>=7.3,<7.3.2.1", - "ezsystems/ezpublish-legacy": ">=5.3,<5.3.12.6|>=5.4,<5.4.12.3|>=2011,<2017.12.4.3|>=2018.6,<2018.6.1.4|>=2018.9,<2018.9.1.3", + "ezsystems/demobundle": ">=5.4,<5.4.6.1", + "ezsystems/ezdemo-ls-extension": ">=5.4,<5.4.2.1", + "ezsystems/ezfind-ls": ">=5.3,<5.3.6.1|>=5.4,<5.4.11.1|>=2017.12,<2017.12.0.1", + "ezsystems/ezplatform": ">=1.7,<1.7.9.1|>=1.13,<1.13.5.1|>=2.5,<2.5.4", + "ezsystems/ezplatform-admin-ui": ">=1.3,<1.3.5|>=1.4,<1.4.6", + "ezsystems/ezplatform-admin-ui-assets": ">=4,<4.2", + "ezsystems/ezplatform-kernel": ">=1,<1.0.2.1", + "ezsystems/ezplatform-user": ">=1,<1.0.1", + "ezsystems/ezpublish-kernel": ">=5.3,<5.3.12.1|>=5.4,<5.4.14.2|>=6,<6.7.9.1|>=6.8,<6.13.6.3|>=7,<7.2.4.1|>=7.3,<7.3.2.1|>=7.5,<7.5.7.1", + "ezsystems/ezpublish-legacy": ">=5.3,<5.3.12.6|>=5.4,<5.4.14.1|>=2011,<2017.12.7.2|>=2018.6,<2018.6.1.4|>=2018.9,<2018.9.1.3|>=2019.3,<2019.3.4.2", "ezsystems/repository-forms": ">=2.3,<2.3.2.1", "ezyang/htmlpurifier": "<4.1.1", "firebase/php-jwt": "<2", "fooman/tcpdf": "<6.2.22", "fossar/tcpdf-parser": "<6.2.22", + "friendsofsymfony/oauth2-php": "<1.3", "friendsofsymfony/rest-bundle": ">=1.2,<1.2.2", "friendsofsymfony/user-bundle": ">=1.2,<1.3.5", "fuel/core": "<1.8.1", + "getgrav/grav": "<1.7-beta.8", "gree/jose": "<=2.2", "gregwar/rst": "<1.0.3", "guzzlehttp/guzzle": ">=4-rc.2,<4.2.4|>=5,<5.3.1|>=6,<6.2.1", @@ -3502,6 +3531,7 @@ "illuminate/cookie": ">=4,<=4.0.11|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.42|>=5.6,<5.6.30", "illuminate/database": ">=4,<4.0.99|>=4.1,<4.1.29", "illuminate/encryption": ">=4,<=4.0.11|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.40|>=5.6,<5.6.15", + "illuminate/view": ">=7,<7.1.2", "ivankristianto/phpwhois": "<=4.3", "james-heinrich/getid3": "<1.9.9", "joomla/session": "<1.3.1", @@ -3509,15 +3539,21 @@ "kazist/phpwhois": "<=4.2.6", "kreait/firebase-php": ">=3.2,<3.8.1", "la-haute-societe/tcpdf": "<6.2.22", - "laravel/framework": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.42|>=5.6,<5.6.30", + "laravel/framework": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.42|>=5.6,<5.6.30|>=7,<7.1.2", "laravel/socialite": ">=1,<1.0.99|>=2,<2.0.10", "league/commonmark": "<0.18.3", + "librenms/librenms": "<1.53", + "magento/community-edition": ">=2,<2.2.10|>=2.3,<2.3.3", "magento/magento1ce": "<1.9.4.3", "magento/magento1ee": ">=1,<1.14.4.3", "magento/product-community-edition": ">=2,<2.2.10|>=2.3,<2.3.2-p.2", "monolog/monolog": ">=1.8,<1.12", "namshi/jose": "<2.2", + "nystudio107/craft-seomatic": "<3.3", + "nzo/url-encryptor-bundle": ">=4,<4.3.2|>=5,<5.0.1", + "october/october": ">=1.0.319,<1.0.467", "onelogin/php-saml": "<2.10.4", + "oneup/uploader-bundle": "<1.9.3|>=2,<2.1.5", "openid/php-openid": "<2.3", "oro/crm": ">=1.7,<1.7.4", "oro/platform": ">=1.7,<1.7.4", @@ -3526,49 +3562,69 @@ "paragonie/random_compat": "<2", "paypal/merchant-sdk-php": "<3.12", "pear/archive_tar": "<1.4.4", - "phpmailer/phpmailer": ">=5,<5.2.27|>=6,<6.0.6", - "phpoffice/phpexcel": "<=1.8.1", - "phpoffice/phpspreadsheet": "<=1.5", + "phpfastcache/phpfastcache": ">=5,<5.0.13", + "phpmailer/phpmailer": "<6.1.6", + "phpmussel/phpmussel": ">=1,<1.6", + "phpmyadmin/phpmyadmin": "<4.9.2", + "phpoffice/phpexcel": "<1.8.2", + "phpoffice/phpspreadsheet": "<1.8", "phpunit/phpunit": ">=4.8.19,<4.8.28|>=5.0.10,<5.6.3", "phpwhois/phpwhois": "<=4.2.5", "phpxmlrpc/extras": "<0.6.1", + "pimcore/pimcore": "<6.3", + "prestashop/autoupgrade": ">=4,<4.10.1", + "prestashop/gamification": "<2.3.2", + "prestashop/ps_facetedsearch": "<3.4.1", + "privatebin/privatebin": "<1.2.2|>=1.3,<1.3.2", "propel/propel": ">=2-alpha.1,<=2-alpha.7", "propel/propel1": ">=1,<=1.7.1", "pusher/pusher-php-server": "<2.2.1", - "robrichards/xmlseclibs": ">=1,<3.0.4", + "rainlab/debugbar-plugin": "<3.1", + "robrichards/xmlseclibs": "<3.0.4", "sabre/dav": ">=1.6,<1.6.99|>=1.7,<1.7.11|>=1.8,<1.8.9", "scheb/two-factor-bundle": ">=0,<3.26|>=4,<4.11", "sensiolabs/connect": "<4.2.3", "serluck/phpwhois": "<=4.2.6", "shopware/shopware": "<5.3.7", - "silverstripe/cms": ">=3,<=3.0.11|>=3.1,<3.1.11", + "silverstripe/admin": ">=1.0.3,<1.0.4|>=1.1,<1.1.1", + "silverstripe/assets": ">=1,<1.4.7|>=1.5,<1.5.2", + "silverstripe/cms": "<4.3.6|>=4.4,<4.4.4", + "silverstripe/comments": ">=1.3,<1.9.99|>=2,<2.9.99|>=3,<3.1.1", "silverstripe/forum": "<=0.6.1|>=0.7,<=0.7.3", - "silverstripe/framework": ">=3,<3.6.7|>=3.7,<3.7.3|>=4,<4.4", + "silverstripe/framework": "<4.4.5|>=4.5,<4.5.2", "silverstripe/graphql": ">=2,<2.0.5|>=3,<3.1.2", "silverstripe/registry": ">=2.1,<2.1.2|>=2.2,<2.2.1", "silverstripe/restfulserver": ">=1,<1.0.9|>=2,<2.0.4", + "silverstripe/subsites": ">=2,<2.1.1", + "silverstripe/taxonomy": ">=1.3,<1.3.1|>=2,<2.0.1", "silverstripe/userforms": "<3", "simple-updates/phpwhois": "<=1", "simplesamlphp/saml2": "<1.10.6|>=2,<2.3.8|>=3,<3.1.4", - "simplesamlphp/simplesamlphp": "<1.17.8", + "simplesamlphp/simplesamlphp": "<1.18.6", "simplesamlphp/simplesamlphp-module-infocard": "<1.0.1", + "simplito/elliptic-php": "<1.0.6", "slim/slim": "<2.6", "smarty/smarty": "<3.1.33", "socalnick/scn-social-auth": "<1.15.2", "spoonity/tcpdf": "<6.2.22", "squizlabs/php_codesniffer": ">=1,<2.8.1|>=3,<3.0.1", + "ssddanbrown/bookstack": "<0.29.2", "stormpath/sdk": ">=0,<9.9.99", - "studio-42/elfinder": "<2.1.48", + "studio-42/elfinder": "<2.1.49", "swiftmailer/swiftmailer": ">=4,<5.4.5", "sylius/admin-bundle": ">=1,<1.0.17|>=1.1,<1.1.9|>=1.2,<1.2.2", "sylius/grid": ">=1,<1.1.19|>=1.2,<1.2.18|>=1.3,<1.3.13|>=1.4,<1.4.5|>=1.5,<1.5.1", "sylius/grid-bundle": ">=1,<1.1.19|>=1.2,<1.2.18|>=1.3,<1.3.13|>=1.4,<1.4.5|>=1.5,<1.5.1", - "sylius/sylius": ">=1,<1.1.18|>=1.2,<1.2.17|>=1.3,<1.3.12|>=1.4,<1.4.4", + "sylius/resource-bundle": "<1.3.13|>=1.4,<1.4.6|>=1.5,<1.5.1|>=1.6,<1.6.3", + "sylius/sylius": "<1.3.16|>=1.4,<1.4.12|>=1.5,<1.5.9|>=1.6,<1.6.5", + "symbiote/silverstripe-multivaluefield": ">=3,<3.0.99", + "symbiote/silverstripe-versionedfiles": "<=2.0.3", "symfony/cache": ">=3.1,<3.4.35|>=4,<4.2.12|>=4.3,<4.3.8", "symfony/dependency-injection": ">=2,<2.0.17|>=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", + "symfony/error-handler": ">=4.4,<4.4.4|>=5,<5.0.4", "symfony/form": ">=2.3,<2.3.35|>=2.4,<2.6.12|>=2.7,<2.7.50|>=2.8,<2.8.49|>=3,<3.4.20|>=4,<4.0.15|>=4.1,<4.1.9|>=4.2,<4.2.1", "symfony/framework-bundle": ">=2,<2.3.18|>=2.4,<2.4.8|>=2.5,<2.5.2|>=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", - "symfony/http-foundation": ">=2,<2.8.52|>=3,<3.4.35|>=4,<4.2.12|>=4.3,<4.3.8", + "symfony/http-foundation": ">=2,<2.8.52|>=3,<3.4.35|>=4,<4.2.12|>=4.3,<4.3.8|>=4.4,<4.4.7|>=5,<5.0.7", "symfony/http-kernel": ">=2,<2.8.52|>=3,<3.4.35|>=4,<4.2.12|>=4.3,<4.3.8", "symfony/intl": ">=2.7,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", "symfony/mime": ">=4.3,<4.3.8", @@ -3577,19 +3633,20 @@ "symfony/polyfill-php55": ">=1,<1.10", "symfony/proxy-manager-bridge": ">=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", "symfony/routing": ">=2,<2.0.19", - "symfony/security": ">=2,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", + "symfony/security": ">=2,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7|>=4.4,<4.4.7|>=5,<5.0.7", "symfony/security-bundle": ">=2,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", "symfony/security-core": ">=2.4,<2.6.13|>=2.7,<2.7.9|>=2.7.30,<2.7.32|>=2.8,<2.8.37|>=3,<3.3.17|>=3.4,<3.4.7|>=4,<4.0.7", "symfony/security-csrf": ">=2.4,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", "symfony/security-guard": ">=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", - "symfony/security-http": ">=2.3,<2.3.41|>=2.4,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.2.12|>=4.3,<4.3.8", + "symfony/security-http": ">=2.3,<2.3.41|>=2.4,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.2.12|>=4.3,<4.3.8|>=4.4,<4.4.7|>=5,<5.0.7", "symfony/serializer": ">=2,<2.0.11", - "symfony/symfony": ">=2,<2.8.52|>=3,<3.4.35|>=4,<4.2.12|>=4.3,<4.3.8", + "symfony/symfony": ">=2,<2.8.52|>=3,<3.4.35|>=4,<4.2.12|>=4.3,<4.3.8|>=4.4,<4.4.7|>=5,<5.0.7", "symfony/translation": ">=2,<2.0.17", "symfony/validator": ">=2,<2.0.24|>=2.1,<2.1.12|>=2.2,<2.2.5|>=2.3,<2.3.3", "symfony/var-exporter": ">=4.2,<4.2.12|>=4.3,<4.3.8", "symfony/web-profiler-bundle": ">=2,<2.3.19|>=2.4,<2.4.9|>=2.5,<2.5.4", "symfony/yaml": ">=2,<2.0.22|>=2.1,<2.1.7", + "t3g/svg-sanitizer": "<1.0.3", "tecnickcom/tcpdf": "<6.2.22", "thelia/backoffice-default-template": ">=2.1,<2.1.2", "thelia/thelia": ">=2.1-beta.1,<2.1.3", @@ -3597,14 +3654,17 @@ "titon/framework": ">=0,<9.9.99", "truckersmp/phpwhois": "<=4.3.1", "twig/twig": "<1.38|>=2,<2.7", - "typo3/cms": ">=6.2,<6.2.30|>=7,<7.6.32|>=8,<8.7.30|>=9,<9.5.12|>=10,<10.2.1", - "typo3/cms-core": ">=8,<8.7.30|>=9,<9.5.12|>=10,<10.2.1", + "typo3/cms": ">=6.2,<6.2.30|>=7,<7.6.32|>=8,<8.7.30|>=9,<9.5.17|>=10,<10.4.2", + "typo3/cms-core": ">=8,<8.7.30|>=9,<9.5.17|>=10,<10.4.2", "typo3/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.10|>=3.1,<3.1.7|>=3.2,<3.2.7|>=3.3,<3.3.5", "typo3/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4", "typo3/phar-stream-wrapper": ">=1,<2.1.1|>=3,<3.1.1", "ua-parser/uap-php": "<3.8", + "usmanhalalit/pixie": "<1.0.3|>=2,<2.0.2", + "verot/class.upload.php": "<=1.0.3|>=2,<=2.0.4", "wallabag/tcpdf": "<6.2.22", "willdurand/js-translation-bundle": "<2.1.1", + "yii2mod/yii2-cms": "<1.9.2", "yiisoft/yii": ">=1.1.14,<1.1.15", "yiisoft/yii2": "<2.0.15", "yiisoft/yii2-bootstrap": "<2.0.4", @@ -3613,6 +3673,7 @@ "yiisoft/yii2-gii": "<2.0.4", "yiisoft/yii2-jui": "<2.0.4", "yiisoft/yii2-redis": "<2.0.8", + "yourls/yourls": "<1.7.4", "zendframework/zend-cache": ">=2.4,<2.4.8|>=2.5,<2.5.3", "zendframework/zend-captcha": ">=2,<2.4.9|>=2.5,<2.5.2", "zendframework/zend-crypt": ">=2,<2.4.9|>=2.5,<2.5.2", @@ -3649,23 +3710,28 @@ "name": "Marco Pivetta", "email": "ocramius@gmail.com", "role": "maintainer" + }, + { + "name": "Ilya Tribusean", + "email": "slash3b@gmail.com", + "role": "maintainer" } ], "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", - "time": "2020-01-06T19:16:46+00:00" + "time": "2020-07-03T16:50:03+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.5.3", + "version": "3.5.5", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "557a1fc7ac702c66b0bbfe16ab3d55839ef724cb" + "reference": "73e2e7f57d958e7228fce50dc0c61f58f017f9f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/557a1fc7ac702c66b0bbfe16ab3d55839ef724cb", - "reference": "557a1fc7ac702c66b0bbfe16ab3d55839ef724cb", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/73e2e7f57d958e7228fce50dc0c61f58f017f9f6", + "reference": "73e2e7f57d958e7228fce50dc0c61f58f017f9f6", "shasum": "" }, "require": { @@ -3703,20 +3769,20 @@ "phpcs", "standards" ], - "time": "2019-12-04T04:46:47+00:00" + "time": "2020-04-17T01:09:41+00:00" }, { "name": "symfony/class-loader", - "version": "v3.4.36", + "version": "v3.4.42", "source": { "type": "git", "url": "https://github.com/symfony/class-loader.git", - "reference": "e212b06996819a2bce026a63da03b7182d05a690" + "reference": "e4636a4f23f157278a19e5db160c63de0da297d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/class-loader/zipball/e212b06996819a2bce026a63da03b7182d05a690", - "reference": "e212b06996819a2bce026a63da03b7182d05a690", + "url": "https://api.github.com/repos/symfony/class-loader/zipball/e4636a4f23f157278a19e5db160c63de0da297d8", + "reference": "e4636a4f23f157278a19e5db160c63de0da297d8", "shasum": "" }, "require": { @@ -3759,7 +3825,7 @@ ], "description": "Symfony ClassLoader Component", "homepage": "https://symfony.com", - "time": "2019-08-20T13:31:17+00:00" + "time": "2020-03-15T09:38:08+00:00" }, { "name": "wimg/php-compatibility", From d29ad07b1f3b1eb34af834208f4c4c1d18b68209 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 6 Jul 2020 17:51:04 +0530 Subject: [PATCH 0718/1044] Bump version to v4.1.0 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 9d58a584e..ee74734aa 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.0.17 +4.1.0 From a33a07358acfb427212c9ad43672a1df9d8406fa Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Wed, 22 Jul 2020 13:51:57 +0530 Subject: [PATCH 0719/1044] Update composer packages Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 2 +- composer.lock | 69 ++++++++++++++++++++++++++------------------------- 2 files changed, 36 insertions(+), 35 deletions(-) diff --git a/composer.json b/composer.json index f48a478fa..57d2db71d 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,7 @@ "easyengine/cron-command": "v1.0.2", "easyengine/log-command": "v1.0.1", "easyengine/mailhog-command": "v1.0.2", - "easyengine/site-command": "v2.5.0", + "easyengine/site-command": "v2.5.1", "easyengine/site-type-wp": "v1.2.0", "easyengine/site-type-php": "v1.2.0", "easyengine/service-command": "v1.0.9", diff --git a/composer.lock b/composer.lock index d31024338..f4731bc07 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": "8af6af2259565d783d76766010378cf9", + "content-hash": "08afab9391be9842c287821bf6b2d9b8", "packages": [ { "name": "acmephp/core", @@ -379,16 +379,16 @@ }, { "name": "composer/spdx-licenses", - "version": "1.5.3", + "version": "1.5.4", "source": { "type": "git", "url": "https://github.com/composer/spdx-licenses.git", - "reference": "0c3e51e1880ca149682332770e25977c70cf9dae" + "reference": "6946f785871e2314c60b4524851f3702ea4f2223" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/0c3e51e1880ca149682332770e25977c70cf9dae", - "reference": "0c3e51e1880ca149682332770e25977c70cf9dae", + "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/6946f785871e2314c60b4524851f3702ea4f2223", + "reference": "6946f785871e2314c60b4524851f3702ea4f2223", "shasum": "" }, "require": { @@ -435,7 +435,7 @@ "spdx", "validator" ], - "time": "2020-02-14T07:44:31+00:00" + "time": "2020-07-15T15:35:07+00:00" }, { "name": "composer/xdebug-handler", @@ -828,16 +828,16 @@ }, { "name": "easyengine/site-command", - "version": "v2.5.0", + "version": "v2.5.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "fec254173339cabcb6b3afe58db91400df777c36" + "reference": "4c305cad5a1e2322742da85ece14e18e69e1f38c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/fec254173339cabcb6b3afe58db91400df777c36", - "reference": "fec254173339cabcb6b3afe58db91400df777c36", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/4c305cad5a1e2322742da85ece14e18e69e1f38c", + "reference": "4c305cad5a1e2322742da85ece14e18e69e1f38c", "shasum": "" }, "require": { @@ -887,7 +887,7 @@ "MIT" ], "homepage": "https://github.com/easyengine/site-command", - "time": "2020-07-06T11:23:56+00:00" + "time": "2020-07-22T08:05:34+00:00" }, { "name": "easyengine/site-type-php", @@ -1746,16 +1746,16 @@ }, { "name": "seld/phar-utils", - "version": "1.1.0", + "version": "1.1.1", "source": { "type": "git", "url": "https://github.com/Seldaek/phar-utils.git", - "reference": "8800503d56b9867d43d9c303b9cbcc26016e82f0" + "reference": "8674b1d84ffb47cc59a101f5d5a3b61e87d23796" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/8800503d56b9867d43d9c303b9cbcc26016e82f0", - "reference": "8800503d56b9867d43d9c303b9cbcc26016e82f0", + "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/8674b1d84ffb47cc59a101f5d5a3b61e87d23796", + "reference": "8674b1d84ffb47cc59a101f5d5a3b61e87d23796", "shasum": "" }, "require": { @@ -1786,7 +1786,7 @@ "keywords": [ "phar" ], - "time": "2020-02-14T15:25:33+00:00" + "time": "2020-07-07T18:42:57+00:00" }, { "name": "symfony/config", @@ -2212,16 +2212,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.17.1", + "version": "v1.18.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "2edd75b8b35d62fd3eeabba73b26b8f1f60ce13d" + "reference": "1c302646f6efc070cd46856e600e5e0684d6b454" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/2edd75b8b35d62fd3eeabba73b26b8f1f60ce13d", - "reference": "2edd75b8b35d62fd3eeabba73b26b8f1f60ce13d", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/1c302646f6efc070cd46856e600e5e0684d6b454", + "reference": "1c302646f6efc070cd46856e600e5e0684d6b454", "shasum": "" }, "require": { @@ -2233,7 +2233,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.17-dev" + "dev-master": "1.18-dev" }, "thanks": { "name": "symfony/polyfill", @@ -2270,20 +2270,20 @@ "polyfill", "portable" ], - "time": "2020-06-06T08:46:27+00:00" + "time": "2020-07-14T12:35:20+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.17.1", + "version": "v1.18.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "7110338d81ce1cbc3e273136e4574663627037a7" + "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7110338d81ce1cbc3e273136e4574663627037a7", - "reference": "7110338d81ce1cbc3e273136e4574663627037a7", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/a6977d63bf9a0ad4c65cd352709e230876f9904a", + "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a", "shasum": "" }, "require": { @@ -2295,7 +2295,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.17-dev" + "dev-master": "1.18-dev" }, "thanks": { "name": "symfony/polyfill", @@ -2333,7 +2333,7 @@ "portable", "shim" ], - "time": "2020-06-06T08:46:27+00:00" + "time": "2020-07-14T12:35:20+00:00" }, { "name": "symfony/process", @@ -3450,12 +3450,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "57353ec1a34527a2dbbd3c0fb9418ffc008c6f60" + "reference": "9f386dba391018e90a5f1e51abeffc6bf27583db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/57353ec1a34527a2dbbd3c0fb9418ffc008c6f60", - "reference": "57353ec1a34527a2dbbd3c0fb9418ffc008c6f60", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/9f386dba391018e90a5f1e51abeffc6bf27583db", + "reference": "9f386dba391018e90a5f1e51abeffc6bf27583db", "shasum": "" }, "conflict": { @@ -3524,6 +3524,7 @@ "friendsofsymfony/user-bundle": ">=1.2,<1.3.5", "fuel/core": "<1.8.1", "getgrav/grav": "<1.7-beta.8", + "gos/web-socket-bundle": "<1.10.4|>=2,<2.6.1|>=3,<3.3", "gree/jose": "<=2.2", "gregwar/rst": "<1.0.3", "guzzlehttp/guzzle": ">=4-rc.2,<4.2.4|>=5,<5.3.1|>=6,<6.2.1", @@ -3591,8 +3592,8 @@ "silverstripe/cms": "<4.3.6|>=4.4,<4.4.4", "silverstripe/comments": ">=1.3,<1.9.99|>=2,<2.9.99|>=3,<3.1.1", "silverstripe/forum": "<=0.6.1|>=0.7,<=0.7.3", - "silverstripe/framework": "<4.4.5|>=4.5,<4.5.2", - "silverstripe/graphql": ">=2,<2.0.5|>=3,<3.1.2", + "silverstripe/framework": "<4.4.7|>=4.5,<4.5.4", + "silverstripe/graphql": ">=2,<2.0.5|>=3,<3.1.2|>=3.2,<3.2.4", "silverstripe/registry": ">=2.1,<2.1.2|>=2.2,<2.2.1", "silverstripe/restfulserver": ">=1,<1.0.9|>=2,<2.0.4", "silverstripe/subsites": ">=2,<2.1.1", @@ -3718,7 +3719,7 @@ } ], "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", - "time": "2020-07-03T16:50:03+00:00" + "time": "2020-07-16T05:17:29+00:00" }, { "name": "squizlabs/php_codesniffer", From 1a7151b69a1d1a2025d30b0d16ce204e17d84c96 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Wed, 22 Jul 2020 13:52:31 +0530 Subject: [PATCH 0720/1044] Bump version to v4.1.1 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index ee74734aa..627a3f43a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.1.0 +4.1.1 From 6d3693b07e5d86742f3c15fdcbd9a0381274b19d Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Thu, 30 Jul 2020 18:03:05 +0530 Subject: [PATCH 0721/1044] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c9428011f..24797a969 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ <img src="https://i2.wp.com/easyengine.io/wp-content/uploads/sites/20/2019/06/EasyEngine-New-Logo-Banner@2x-Transparent-Background.png?fit=720%2C170&ssl=1" alt="EasyEngine Logo" /> -# EasyEngine v4 [![Build Status](https://travis-ci.org/EasyEngine/easyengine.svg?branch=master-v4)](https://travis-ci.org/EasyEngine/easyengine) [![License](https://poser.pugx.org/phpunit/phpunit/license)](https://packagist.org/packages/phpunit/phpunit) [![Join EasyEngine Slack Channel](http://slack.easyengine.io/badge.svg)](http://slack.easyengine.io/)[![Latest Stable Version](https://poser.pugx.org/easyengine/easyengine/v/stable)](https://packagist.org/packages/easyengine/easyengine) [![Latest Unstable Version](https://poser.pugx.org/easyengine/easyengine/v/unstable)](https://packagist.org/packages/easyengine/easyengine) [![License](https://poser.pugx.org/easyengine/easyengine/license)](https://packagist.org/packages/easyengine/easyengine) +# EasyEngine v4 +[![Build Status](https://travis-ci.org/EasyEngine/easyengine.svg?branch=master-v4)](https://travis-ci.org/EasyEngine/easyengine) [![Join EasyEngine Slack Channel](http://slack.easyengine.io/badge.svg)](http://slack.easyengine.io/) [![Latest Stable Version](https://poser.pugx.org/easyengine/easyengine/v/stable)](https://packagist.org/packages/easyengine/easyengine) [![Latest Unstable Version](https://poser.pugx.org/easyengine/easyengine/v/unstable)](https://packagist.org/packages/easyengine/easyengine) [![License](https://poser.pugx.org/easyengine/easyengine/license)](https://packagist.org/packages/easyengine/easyengine) EasyEngine makes it greatly easy to manage nginx, a fast web-server software that consumes little memory when handling increasing volumes of concurrent users. From 4de08daec88b96b4ca6d223385b03b152c9c944d Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Fri, 31 Jul 2020 19:09:13 +0530 Subject: [PATCH 0722/1044] Improve sqlite error message --- php/class-ee-db.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/class-ee-db.php b/php/class-ee-db.php index 14d08942b..33571593e 100644 --- a/php/class-ee-db.php +++ b/php/class-ee-db.php @@ -42,7 +42,7 @@ private static function init_db() { self::$pdo = new PDO( 'sqlite:' . DB ); self::$pdo->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION ); } catch ( PDOException $exception ) { - EE::error( $exception->getMessage() ); + EE::error( "Unable to initialize connection to EE sqlite database: " . $exception->getMessage() ); } } From eb3f8334ea61bbda5466ae56a5539b2a7e997851 Mon Sep 17 00:00:00 2001 From: dhsathiya <devarshisathiya5@gmail.com> Date: Mon, 3 Aug 2020 11:40:07 +0530 Subject: [PATCH 0723/1044] Add variable for custom docker-compose file for site Signed-off-by: dhsathiya <devarshisathiya5@gmail.com> --- php/EE/Runner.php | 1 + 1 file changed, 1 insertion(+) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index e45a46ac6..026306339 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -56,6 +56,7 @@ private function init_ee() { define( 'DB', EE_ROOT_DIR . '/db/ee.sqlite' ); define( 'LOCALHOST_IP', '127.0.0.1' ); + define( 'SITE_CUSTOM_DOCKER_COMPOSE', 'docker-compose-custom.yml' ); $db_dir = dirname( DB ); if ( ! is_dir( $db_dir ) ) { From 79fabf232989345cdda703ae52966230159ffc4c Mon Sep 17 00:00:00 2001 From: dhsathiya <devarshisathiya5@gmail.com> Date: Mon, 3 Aug 2020 11:46:11 +0530 Subject: [PATCH 0724/1044] Update docker_compose_up for custom docker-compose file Signed-off-by: dhsathiya <devarshisathiya5@gmail.com> --- php/class-ee-docker.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php index 8c0be97b2..eb90ff6d4 100644 --- a/php/class-ee-docker.php +++ b/php/class-ee-docker.php @@ -159,14 +159,18 @@ public static function disconnect_site_network_from( $site_name, $from_container * @return bool success. */ public static function docker_compose_up( $dir, $services = [] ) { + $fs = new Filesystem(); $chdir_return_code = chdir( $dir ); if ( $chdir_return_code ) { if ( empty( $services ) ) { return EE::exec( 'docker-compose up -d' ); } else { $all_services = implode( ' ', $services ); - - return EE::exec( "docker-compose up -d $all_services" ); + if ( $fs->exists( SITE_CUSTOM_DOCKER_COMPOSE ) ) { + return EE::exec( 'docker-compose -f docker-compose.yml -f ' . SITE_CUSTOM_DOCKER_COMPOSE . " up -d $all_services" ); + } else { + return EE::exec( "docker-compose up -d $all_services" ); + } } } From a0ab3e55b2f6c116af1b2e1d11233c7055435c1a Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 3 Aug 2020 14:09:07 +0530 Subject: [PATCH 0725/1044] Switch to single quotes Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- php/class-ee-db.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/class-ee-db.php b/php/class-ee-db.php index 33571593e..dd6b2462b 100644 --- a/php/class-ee-db.php +++ b/php/class-ee-db.php @@ -42,7 +42,7 @@ private static function init_db() { self::$pdo = new PDO( 'sqlite:' . DB ); self::$pdo->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION ); } catch ( PDOException $exception ) { - EE::error( "Unable to initialize connection to EE sqlite database: " . $exception->getMessage() ); + EE::error( 'Unable to initialize connection to EE sqlite database: ' . $exception->getMessage() ); } } From 2b218875815095325005c700a7f48a149858399c Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Fri, 7 Aug 2020 10:45:27 +0530 Subject: [PATCH 0726/1044] Update nginx-proxy and nginx image versions Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- img-versions.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/img-versions.json b/img-versions.json index 6817f583f..52eb73b4e 100644 --- a/img-versions.json +++ b/img-versions.json @@ -2,8 +2,8 @@ "easyengine/cron": "v4.0.0", "easyengine/mailhog": "v4.0.0", "easyengine/mariadb": "v4.1.3", - "easyengine/nginx-proxy": "v4.0.3", - "easyengine/nginx": "v4.1.3", + "easyengine/nginx-proxy": "v4.1.4", + "easyengine/nginx": "v4.1.4", "easyengine/php": "v4.1.3", "easyengine/php5.6": "v4.0.0", "easyengine/php7.0": "v4.1.2", From 8eab07807bda89b0411966a9d7f3c18ad1f51e2e Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Fri, 7 Aug 2020 15:21:50 +0530 Subject: [PATCH 0727/1044] Update redis from 5.0 to 6.0.6 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- img-versions.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/img-versions.json b/img-versions.json index 52eb73b4e..bea9f1100 100644 --- a/img-versions.json +++ b/img-versions.json @@ -11,6 +11,6 @@ "easyengine/php7.3": "v4.1.3", "easyengine/php7.4": "v4.1.3", "easyengine/postfix": "v4.0.0", - "easyengine/redis": "v4.0.0", + "easyengine/redis": "v4.1.4", "easyengine/newrelic-daemon": "v4.0.0" } From 35114b8e7f798c295edb244cde9bbbcd3166b3b3 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 11 Aug 2020 15:56:21 +0530 Subject: [PATCH 0728/1044] Update composer packages Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 12 ++--- composer.lock | 128 ++++++++++++++++++++++++++++---------------------- 2 files changed, 77 insertions(+), 63 deletions(-) diff --git a/composer.json b/composer.json index 57d2db71d..6e754707e 100644 --- a/composer.json +++ b/composer.json @@ -27,16 +27,16 @@ "php": ">=7.0", "composer/composer": "1.7.3", "composer/semver": "1.4.2", - "easyengine/admin-tools-command": "v1.0.9", - "easyengine/auth-command": "v1.0.3", + "easyengine/admin-tools-command": "v1.0.10", + "easyengine/auth-command": "v1.0.4", "easyengine/config-command": "v1.0.2", "easyengine/cron-command": "v1.0.2", "easyengine/log-command": "v1.0.1", "easyengine/mailhog-command": "v1.0.2", - "easyengine/site-command": "v2.5.1", - "easyengine/site-type-wp": "v1.2.0", - "easyengine/site-type-php": "v1.2.0", - "easyengine/service-command": "v1.0.9", + "easyengine/site-command": "v2.6.0", + "easyengine/site-type-wp": "v1.3.0", + "easyengine/site-type-php": "v1.3.0", + "easyengine/service-command": "v1.1.0", "easyengine/shell-command" : "v1.0.3", "justinrainbow/json-schema": "5.2.7", "monolog/monolog": "1.24.0", diff --git a/composer.lock b/composer.lock index f4731bc07..859bac340 100644 --- a/composer.lock +++ b/composer.lock @@ -4,27 +4,33 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "08afab9391be9842c287821bf6b2d9b8", + "content-hash": "24a7fb2973c4324657f495db59fa0044", "packages": [ { "name": "acmephp/core", - "version": "1.0.0", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/acmephp/core.git", - "reference": "aa84037654073a2840c2425acb599567d3d2f3e7" + "reference": "b038d61f06f3cb1e81a1a3cbe63eae42d9d3d3ca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/acmephp/core/zipball/aa84037654073a2840c2425acb599567d3d2f3e7", - "reference": "aa84037654073a2840c2425acb599567d3d2f3e7", + "url": "https://api.github.com/repos/acmephp/core/zipball/b038d61f06f3cb1e81a1a3cbe63eae42d9d3d3ca", + "reference": "b038d61f06f3cb1e81a1a3cbe63eae42d9d3d3ca", "shasum": "" }, "require": { - "acmephp/ssl": "^1.0-alpha2", + "acmephp/ssl": "^1.0", + "ext-hash": "*", + "ext-json": "*", "ext-openssl": "*", "guzzlehttp/guzzle": "^6.0", - "php": ">=5.5.0" + "guzzlehttp/psr7": "^1.0", + "php": ">=5.5.0", + "psr/http-message": "^1.0", + "psr/log": "^1.0", + "webmozart/assert": "^1.0" }, "require-dev": { "phpunit/phpunit": "^4.8.22", @@ -69,7 +75,7 @@ "ssl", "x509" ], - "time": "2018-10-14T09:29:59+00:00" + "time": "2019-12-17T11:28:20+00:00" }, { "name": "acmephp/ssl", @@ -483,16 +489,16 @@ }, { "name": "easyengine/admin-tools-command", - "version": "v1.0.9", + "version": "v1.0.10", "source": { "type": "git", "url": "https://github.com/EasyEngine/admin-tools-command.git", - "reference": "6517a41d1958430c56ceb50f874f101392a492c9" + "reference": "2e298c92a2a44c29d41af63505e25ff820f03c86" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/admin-tools-command/zipball/6517a41d1958430c56ceb50f874f101392a492c9", - "reference": "6517a41d1958430c56ceb50f874f101392a492c9", + "url": "https://api.github.com/repos/EasyEngine/admin-tools-command/zipball/2e298c92a2a44c29d41af63505e25ff820f03c86", + "reference": "2e298c92a2a44c29d41af63505e25ff820f03c86", "shasum": "" }, "type": "ee-cli-package", @@ -521,20 +527,20 @@ ], "description": "Command to manage admin tools for php based sites.", "homepage": "https://github.com/easyengine/amdin-tools", - "time": "2019-12-18T12:48:38+00:00" + "time": "2020-08-11T10:14:14+00:00" }, { "name": "easyengine/auth-command", - "version": "v1.0.3", + "version": "v1.0.4", "source": { "type": "git", "url": "https://github.com/EasyEngine/auth-command.git", - "reference": "a30a6d05c1800d73b1fa8c15c3cadeda6ff0dd24" + "reference": "29cc2d2d3341a32115050bf81de7acb1615cf209" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/auth-command/zipball/a30a6d05c1800d73b1fa8c15c3cadeda6ff0dd24", - "reference": "a30a6d05c1800d73b1fa8c15c3cadeda6ff0dd24", + "url": "https://api.github.com/repos/EasyEngine/auth-command/zipball/29cc2d2d3341a32115050bf81de7acb1615cf209", + "reference": "29cc2d2d3341a32115050bf81de7acb1615cf209", "shasum": "" }, "type": "ee-cli-package", @@ -568,7 +574,7 @@ ], "description": "Configure HTTP Authentication and whitelisting for EasyEngine site", "homepage": "https://github.com/easyengine/auth-command", - "time": "2020-07-06T11:44:21+00:00" + "time": "2020-08-11T10:12:02+00:00" }, { "name": "easyengine/config-command", @@ -743,16 +749,16 @@ }, { "name": "easyengine/service-command", - "version": "v1.0.9", + "version": "v1.1.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/service-command.git", - "reference": "a89766e23912ad258b29f25087dd3008edc4ccea" + "reference": "8278b3e895e7dbb7109e90e492068650217ce997" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/a89766e23912ad258b29f25087dd3008edc4ccea", - "reference": "a89766e23912ad258b29f25087dd3008edc4ccea", + "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/8278b3e895e7dbb7109e90e492068650217ce997", + "reference": "8278b3e895e7dbb7109e90e492068650217ce997", "shasum": "" }, "type": "ee-cli-package", @@ -784,7 +790,7 @@ ], "description": "Command to manager global containers/services in EasyEngine", "homepage": "https://github.com/easyengine/service-command", - "time": "2019-03-18T13:40:55+00:00" + "time": "2020-08-11T10:19:09+00:00" }, { "name": "easyengine/shell-command", @@ -828,20 +834,20 @@ }, { "name": "easyengine/site-command", - "version": "v2.5.1", + "version": "v2.6.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "4c305cad5a1e2322742da85ece14e18e69e1f38c" + "reference": "5df65696e809a6e0dcb144bc02891c03fd07caf3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/4c305cad5a1e2322742da85ece14e18e69e1f38c", - "reference": "4c305cad5a1e2322742da85ece14e18e69e1f38c", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/5df65696e809a6e0dcb144bc02891c03fd07caf3", + "reference": "5df65696e809a6e0dcb144bc02891c03fd07caf3", "shasum": "" }, "require": { - "acmephp/core": "1.0.0", + "acmephp/core": "1.2.0", "cloudflare/sdk": "1.1.1", "ext-openssl": "*", "guzzlehttp/guzzle": "6.3.3", @@ -887,20 +893,20 @@ "MIT" ], "homepage": "https://github.com/easyengine/site-command", - "time": "2020-07-22T08:05:34+00:00" + "time": "2020-08-11T10:16:05+00:00" }, { "name": "easyengine/site-type-php", - "version": "v1.2.0", + "version": "v1.3.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-php.git", - "reference": "cc0f86ba72f313bd312c6964e1059b6567871849" + "reference": "a1ab205f7b90cf34009c3a3354c637013467bd00" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/cc0f86ba72f313bd312c6964e1059b6567871849", - "reference": "cc0f86ba72f313bd312c6964e1059b6567871849", + "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/a1ab205f7b90cf34009c3a3354c637013467bd00", + "reference": "a1ab205f7b90cf34009c3a3354c637013467bd00", "shasum": "" }, "require-dev": { @@ -942,20 +948,20 @@ ], "description": "EasyEngine package for PHP site creation.", "homepage": "https://github.com/easyengine/site-type-php", - "time": "2020-07-06T11:37:17+00:00" + "time": "2020-08-11T10:17:03+00:00" }, { "name": "easyengine/site-type-wp", - "version": "v1.2.0", + "version": "v1.3.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-wp.git", - "reference": "31ad226b96b7564fbfc53d7252a253e018fa9525" + "reference": "70d6e6b61d323428c343356dd9714a64cb2d4d46" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/31ad226b96b7564fbfc53d7252a253e018fa9525", - "reference": "31ad226b96b7564fbfc53d7252a253e018fa9525", + "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/70d6e6b61d323428c343356dd9714a64cb2d4d46", + "reference": "70d6e6b61d323428c343356dd9714a64cb2d4d46", "shasum": "" }, "require-dev": { @@ -997,7 +1003,7 @@ ], "description": "EasyEngine site type package for WordPress site creation.", "homepage": "https://github.com/easyengine/site-type-wp", - "time": "2020-07-06T11:37:51+00:00" + "time": "2020-08-11T10:16:46+00:00" }, { "name": "guzzlehttp/guzzle", @@ -2212,7 +2218,7 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.18.0", + "version": "v1.18.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", @@ -2274,7 +2280,7 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.18.0", + "version": "v1.18.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", @@ -3450,12 +3456,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "9f386dba391018e90a5f1e51abeffc6bf27583db" + "reference": "a9e4cf90fc47b0ffbb90ee79f24be1b7c5ce82dc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/9f386dba391018e90a5f1e51abeffc6bf27583db", - "reference": "9f386dba391018e90a5f1e51abeffc6bf27583db", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/a9e4cf90fc47b0ffbb90ee79f24be1b7c5ce82dc", + "reference": "a9e4cf90fc47b0ffbb90ee79f24be1b7c5ce82dc", "shasum": "" }, "conflict": { @@ -3522,6 +3528,7 @@ "friendsofsymfony/oauth2-php": "<1.3", "friendsofsymfony/rest-bundle": ">=1.2,<1.2.2", "friendsofsymfony/user-bundle": ">=1.2,<1.3.5", + "friendsoftypo3/mediace": ">=7.6.2,<7.6.5", "fuel/core": "<1.8.1", "getgrav/grav": "<1.7-beta.8", "gos/web-socket-bundle": "<1.10.4|>=2,<2.6.1|>=3,<3.3", @@ -3529,8 +3536,8 @@ "gregwar/rst": "<1.0.3", "guzzlehttp/guzzle": ">=4-rc.2,<4.2.4|>=5,<5.3.1|>=6,<6.2.1", "illuminate/auth": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.10", - "illuminate/cookie": ">=4,<=4.0.11|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.42|>=5.6,<5.6.30", - "illuminate/database": ">=4,<4.0.99|>=4.1,<4.1.29", + "illuminate/cookie": ">=4,<=4.0.11|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<=5.5.44|>=5.6,<5.6.30|>=6,<6.18.31|>=7,<7.22.4", + "illuminate/database": ">=4,<4.0.99|>=4.1,<4.1.29|>=5.5,<=5.5.44|>=6,<6.18.34|>=7,<7.23.2", "illuminate/encryption": ">=4,<=4.0.11|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.40|>=5.6,<5.6.15", "illuminate/view": ">=7,<7.1.2", "ivankristianto/phpwhois": "<=4.3", @@ -3538,9 +3545,10 @@ "joomla/session": "<1.3.1", "jsmitty12/phpwhois": "<5.1", "kazist/phpwhois": "<=4.2.6", + "kitodo/presentation": "<3.1.2", "kreait/firebase-php": ">=3.2,<3.8.1", "la-haute-societe/tcpdf": "<6.2.22", - "laravel/framework": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.42|>=5.6,<5.6.30|>=7,<7.1.2", + "laravel/framework": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<=5.5.49|>=5.6,<5.6.30|>=6,<6.18.34|>=7,<7.23.2", "laravel/socialite": ">=1,<1.0.99|>=2,<2.0.10", "league/commonmark": "<0.18.3", "librenms/librenms": "<1.53", @@ -3548,11 +3556,16 @@ "magento/magento1ce": "<1.9.4.3", "magento/magento1ee": ">=1,<1.14.4.3", "magento/product-community-edition": ">=2,<2.2.10|>=2.3,<2.3.2-p.2", + "marcwillmann/turn": "<0.3.3", + "mittwald/typo3_forum": "<1.2.1", "monolog/monolog": ">=1.8,<1.12", "namshi/jose": "<2.2", "nystudio107/craft-seomatic": "<3.3", "nzo/url-encryptor-bundle": ">=4,<4.3.2|>=5,<5.0.1", - "october/october": ">=1.0.319,<1.0.467", + "october/backend": ">=1.0.319,<1.0.467", + "october/cms": ">=1.0.319,<1.0.466", + "october/october": ">=1.0.319,<1.0.466", + "october/rain": ">=1.0.319,<1.0.468", "onelogin/php-saml": "<2.10.4", "oneup/uploader-bundle": "<1.9.3|>=2,<2.1.5", "openid/php-openid": "<2.3", @@ -3612,6 +3625,7 @@ "ssddanbrown/bookstack": "<0.29.2", "stormpath/sdk": ">=0,<9.9.99", "studio-42/elfinder": "<2.1.49", + "sulu/sulu": "<1.6.34|>=2,<2.0.10|>=2.1,<2.1.1", "swiftmailer/swiftmailer": ">=4,<5.4.5", "sylius/admin-bundle": ">=1,<1.0.17|>=1.1,<1.1.9|>=1.2,<1.2.2", "sylius/grid": ">=1,<1.1.19|>=1.2,<1.2.18|>=1.3,<1.3.13|>=1.4,<1.4.5|>=1.5,<1.5.1", @@ -3655,8 +3669,8 @@ "titon/framework": ">=0,<9.9.99", "truckersmp/phpwhois": "<=4.3.1", "twig/twig": "<1.38|>=2,<2.7", - "typo3/cms": ">=6.2,<6.2.30|>=7,<7.6.32|>=8,<8.7.30|>=9,<9.5.17|>=10,<10.4.2", - "typo3/cms-core": ">=8,<8.7.30|>=9,<9.5.17|>=10,<10.4.2", + "typo3/cms": ">=6.2,<6.2.30|>=7,<7.6.32|>=8,<8.7.30|>=9,<9.5.20|>=10,<10.4.6", + "typo3/cms-core": ">=8,<8.7.30|>=9,<9.5.20|>=10,<10.4.6", "typo3/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.10|>=3.1,<3.1.7|>=3.2,<3.2.7|>=3.3,<3.3.5", "typo3/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4", "typo3/phar-stream-wrapper": ">=1,<2.1.1|>=3,<3.1.1", @@ -3719,20 +3733,20 @@ } ], "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", - "time": "2020-07-16T05:17:29+00:00" + "time": "2020-08-08T10:05:44+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.5.5", + "version": "3.5.6", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "73e2e7f57d958e7228fce50dc0c61f58f017f9f6" + "reference": "e97627871a7eab2f70e59166072a6b767d5834e0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/73e2e7f57d958e7228fce50dc0c61f58f017f9f6", - "reference": "73e2e7f57d958e7228fce50dc0c61f58f017f9f6", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/e97627871a7eab2f70e59166072a6b767d5834e0", + "reference": "e97627871a7eab2f70e59166072a6b767d5834e0", "shasum": "" }, "require": { @@ -3770,11 +3784,11 @@ "phpcs", "standards" ], - "time": "2020-04-17T01:09:41+00:00" + "time": "2020-08-10T04:50:15+00:00" }, { "name": "symfony/class-loader", - "version": "v3.4.42", + "version": "v3.4.43", "source": { "type": "git", "url": "https://github.com/symfony/class-loader.git", From ff6abc76b85602ba6e309670454df6019d2f45c8 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 11 Aug 2020 15:56:37 +0530 Subject: [PATCH 0729/1044] Bump version to v4.1.2 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 627a3f43a..4d0dcda01 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.1.1 +4.1.2 From e0282798308f25625ee07b4ad6b4dccfa520d1bb Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Wed, 12 Aug 2020 13:39:43 +0530 Subject: [PATCH 0730/1044] Update composer packages Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 2 +- composer.lock | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index 6e754707e..6ddef006d 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,7 @@ "easyengine/cron-command": "v1.0.2", "easyengine/log-command": "v1.0.1", "easyengine/mailhog-command": "v1.0.2", - "easyengine/site-command": "v2.6.0", + "easyengine/site-command": "v2.6.1", "easyengine/site-type-wp": "v1.3.0", "easyengine/site-type-php": "v1.3.0", "easyengine/service-command": "v1.1.0", diff --git a/composer.lock b/composer.lock index 859bac340..7261774ae 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": "24a7fb2973c4324657f495db59fa0044", + "content-hash": "6dd27c515a90ebedb91de2f9f5f94b1d", "packages": [ { "name": "acmephp/core", @@ -834,16 +834,16 @@ }, { "name": "easyengine/site-command", - "version": "v2.6.0", + "version": "v2.6.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "5df65696e809a6e0dcb144bc02891c03fd07caf3" + "reference": "9684b4bac2abf6bd32d55ae49036316aea6d838c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/5df65696e809a6e0dcb144bc02891c03fd07caf3", - "reference": "5df65696e809a6e0dcb144bc02891c03fd07caf3", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/9684b4bac2abf6bd32d55ae49036316aea6d838c", + "reference": "9684b4bac2abf6bd32d55ae49036316aea6d838c", "shasum": "" }, "require": { @@ -893,7 +893,7 @@ "MIT" ], "homepage": "https://github.com/easyengine/site-command", - "time": "2020-08-11T10:16:05+00:00" + "time": "2020-08-12T07:49:13+00:00" }, { "name": "easyengine/site-type-php", From 2a0b430e019db8fede659de886a4897c3edcc8d1 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 20 Aug 2020 14:51:17 +0530 Subject: [PATCH 0731/1044] Update composer packages Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 6 ++--- composer.lock | 67 ++++++++++++++++++++++++++------------------------- 2 files changed, 37 insertions(+), 36 deletions(-) diff --git a/composer.json b/composer.json index 6ddef006d..4b986ef21 100644 --- a/composer.json +++ b/composer.json @@ -33,9 +33,9 @@ "easyengine/cron-command": "v1.0.2", "easyengine/log-command": "v1.0.1", "easyengine/mailhog-command": "v1.0.2", - "easyengine/site-command": "v2.6.1", - "easyengine/site-type-wp": "v1.3.0", - "easyengine/site-type-php": "v1.3.0", + "easyengine/site-command": "v2.6.2", + "easyengine/site-type-wp": "v1.3.1", + "easyengine/site-type-php": "v1.3.1", "easyengine/service-command": "v1.1.0", "easyengine/shell-command" : "v1.0.3", "justinrainbow/json-schema": "5.2.7", diff --git a/composer.lock b/composer.lock index 7261774ae..3871e252d 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": "6dd27c515a90ebedb91de2f9f5f94b1d", + "content-hash": "88ed22b22a2eaeef29865bac7546df1e", "packages": [ { "name": "acmephp/core", @@ -445,16 +445,16 @@ }, { "name": "composer/xdebug-handler", - "version": "1.4.2", + "version": "1.4.3", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "fa2aaf99e2087f013a14f7432c1cd2dd7d8f1f51" + "reference": "ebd27a9866ae8254e873866f795491f02418c5a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/fa2aaf99e2087f013a14f7432c1cd2dd7d8f1f51", - "reference": "fa2aaf99e2087f013a14f7432c1cd2dd7d8f1f51", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ebd27a9866ae8254e873866f795491f02418c5a5", + "reference": "ebd27a9866ae8254e873866f795491f02418c5a5", "shasum": "" }, "require": { @@ -485,7 +485,7 @@ "Xdebug", "performance" ], - "time": "2020-06-04T11:16:35+00:00" + "time": "2020-08-19T10:27:58+00:00" }, { "name": "easyengine/admin-tools-command", @@ -834,16 +834,16 @@ }, { "name": "easyengine/site-command", - "version": "v2.6.1", + "version": "v2.6.2", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "9684b4bac2abf6bd32d55ae49036316aea6d838c" + "reference": "b5b87e8a1756ab7beef591fe86a077c301969acf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/9684b4bac2abf6bd32d55ae49036316aea6d838c", - "reference": "9684b4bac2abf6bd32d55ae49036316aea6d838c", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/b5b87e8a1756ab7beef591fe86a077c301969acf", + "reference": "b5b87e8a1756ab7beef591fe86a077c301969acf", "shasum": "" }, "require": { @@ -893,20 +893,20 @@ "MIT" ], "homepage": "https://github.com/easyengine/site-command", - "time": "2020-08-12T07:49:13+00:00" + "time": "2020-08-20T09:17:14+00:00" }, { "name": "easyengine/site-type-php", - "version": "v1.3.0", + "version": "v1.3.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-php.git", - "reference": "a1ab205f7b90cf34009c3a3354c637013467bd00" + "reference": "9dc599a4b2569ff424ba27febabd624872af01da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/a1ab205f7b90cf34009c3a3354c637013467bd00", - "reference": "a1ab205f7b90cf34009c3a3354c637013467bd00", + "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/9dc599a4b2569ff424ba27febabd624872af01da", + "reference": "9dc599a4b2569ff424ba27febabd624872af01da", "shasum": "" }, "require-dev": { @@ -948,20 +948,20 @@ ], "description": "EasyEngine package for PHP site creation.", "homepage": "https://github.com/easyengine/site-type-php", - "time": "2020-08-11T10:17:03+00:00" + "time": "2020-08-20T09:15:47+00:00" }, { "name": "easyengine/site-type-wp", - "version": "v1.3.0", + "version": "v1.3.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-wp.git", - "reference": "70d6e6b61d323428c343356dd9714a64cb2d4d46" + "reference": "9ff05aea59fe1c62d9a93d4a3ebc855fe38766f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/70d6e6b61d323428c343356dd9714a64cb2d4d46", - "reference": "70d6e6b61d323428c343356dd9714a64cb2d4d46", + "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/9ff05aea59fe1c62d9a93d4a3ebc855fe38766f7", + "reference": "9ff05aea59fe1c62d9a93d4a3ebc855fe38766f7", "shasum": "" }, "require-dev": { @@ -1003,7 +1003,7 @@ ], "description": "EasyEngine site type package for WordPress site creation.", "homepage": "https://github.com/easyengine/site-type-wp", - "time": "2020-08-11T10:16:46+00:00" + "time": "2020-08-20T09:17:25+00:00" }, { "name": "guzzlehttp/guzzle", @@ -1703,16 +1703,16 @@ }, { "name": "seld/jsonlint", - "version": "1.8.0", + "version": "1.8.1", "source": { "type": "git", "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "ff2aa5420bfbc296cf6a0bc785fa5b35736de7c1" + "reference": "3d5eb71705adfa34bd34b993400622932b2f62fd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/ff2aa5420bfbc296cf6a0bc785fa5b35736de7c1", - "reference": "ff2aa5420bfbc296cf6a0bc785fa5b35736de7c1", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/3d5eb71705adfa34bd34b993400622932b2f62fd", + "reference": "3d5eb71705adfa34bd34b993400622932b2f62fd", "shasum": "" }, "require": { @@ -1748,7 +1748,7 @@ "parser", "validator" ], - "time": "2020-04-30T19:05:18+00:00" + "time": "2020-08-13T09:07:59+00:00" }, { "name": "seld/phar-utils", @@ -3456,12 +3456,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "a9e4cf90fc47b0ffbb90ee79f24be1b7c5ce82dc" + "reference": "89bed6788d61977969b89d912b5844e8beee09f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/a9e4cf90fc47b0ffbb90ee79f24be1b7c5ce82dc", - "reference": "a9e4cf90fc47b0ffbb90ee79f24be1b7c5ce82dc", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/89bed6788d61977969b89d912b5844e8beee09f0", + "reference": "89bed6788d61977969b89d912b5844e8beee09f0", "shasum": "" }, "conflict": { @@ -3536,7 +3536,7 @@ "gregwar/rst": "<1.0.3", "guzzlehttp/guzzle": ">=4-rc.2,<4.2.4|>=5,<5.3.1|>=6,<6.2.1", "illuminate/auth": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.10", - "illuminate/cookie": ">=4,<=4.0.11|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<=5.5.44|>=5.6,<5.6.30|>=6,<6.18.31|>=7,<7.22.4", + "illuminate/cookie": ">=4,<=4.0.11|>=4.1,<=4.1.99999|>=4.2,<=4.2.99999|>=5,<=5.0.99999|>=5.1,<=5.1.99999|>=5.2,<=5.2.99999|>=5.3,<=5.3.99999|>=5.4,<=5.4.99999|>=5.5,<=5.5.49|>=5.6,<=5.6.99999|>=5.7,<=5.7.99999|>=5.8,<=5.8.99999|>=6,<6.18.31|>=7,<7.22.4", "illuminate/database": ">=4,<4.0.99|>=4.1,<4.1.29|>=5.5,<=5.5.44|>=6,<6.18.34|>=7,<7.23.2", "illuminate/encryption": ">=4,<=4.0.11|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.40|>=5.6,<5.6.15", "illuminate/view": ">=7,<7.1.2", @@ -3548,7 +3548,7 @@ "kitodo/presentation": "<3.1.2", "kreait/firebase-php": ">=3.2,<3.8.1", "la-haute-societe/tcpdf": "<6.2.22", - "laravel/framework": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<=5.5.49|>=5.6,<5.6.30|>=6,<6.18.34|>=7,<7.23.2", + "laravel/framework": ">=4,<4.0.99|>=4.1,<=4.1.99999|>=4.2,<=4.2.99999|>=5,<=5.0.99999|>=5.1,<=5.1.99999|>=5.2,<=5.2.99999|>=5.3,<=5.3.99999|>=5.4,<=5.4.99999|>=5.5,<=5.5.49|>=5.6,<=5.6.99999|>=5.7,<=5.7.99999|>=5.8,<=5.8.99999|>=6,<6.18.34|>=7,<7.23.2", "laravel/socialite": ">=1,<1.0.99|>=2,<2.0.10", "league/commonmark": "<0.18.3", "librenms/librenms": "<1.53", @@ -3569,6 +3569,7 @@ "onelogin/php-saml": "<2.10.4", "oneup/uploader-bundle": "<1.9.3|>=2,<2.1.5", "openid/php-openid": "<2.3", + "openmage/magento-lts": "<19.4.6|>=20,<20.0.2", "oro/crm": ">=1.7,<1.7.4", "oro/platform": ">=1.7,<1.7.4", "padraic/humbug_get_contents": "<1.1.2", @@ -3630,7 +3631,7 @@ "sylius/admin-bundle": ">=1,<1.0.17|>=1.1,<1.1.9|>=1.2,<1.2.2", "sylius/grid": ">=1,<1.1.19|>=1.2,<1.2.18|>=1.3,<1.3.13|>=1.4,<1.4.5|>=1.5,<1.5.1", "sylius/grid-bundle": ">=1,<1.1.19|>=1.2,<1.2.18|>=1.3,<1.3.13|>=1.4,<1.4.5|>=1.5,<1.5.1", - "sylius/resource-bundle": "<1.3.13|>=1.4,<1.4.6|>=1.5,<1.5.1|>=1.6,<1.6.3", + "sylius/resource-bundle": "<1.3.14|>=1.4,<1.4.7|>=1.5,<1.5.2|>=1.6,<1.6.4", "sylius/sylius": "<1.3.16|>=1.4,<1.4.12|>=1.5,<1.5.9|>=1.6,<1.6.5", "symbiote/silverstripe-multivaluefield": ">=3,<3.0.99", "symbiote/silverstripe-versionedfiles": "<=2.0.3", @@ -3733,7 +3734,7 @@ } ], "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", - "time": "2020-08-08T10:05:44+00:00" + "time": "2020-08-19T19:01:52+00:00" }, { "name": "squizlabs/php_codesniffer", From db87b87ac3b7db86f98532fde1b9c7eaa179ea03 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 20 Aug 2020 14:51:33 +0530 Subject: [PATCH 0732/1044] Bump version to v4.1.3 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 4d0dcda01..de197cc33 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.1.2 +4.1.3 From e8f9e84d8c8efdee82ae8a9ffa43fe066e541786 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Thu, 20 Aug 2020 18:15:38 +0530 Subject: [PATCH 0733/1044] Update dependencies --- composer.json | 7 +- composer.lock | 319 ++++++++++++++++++++++++-------------------------- 2 files changed, 155 insertions(+), 171 deletions(-) diff --git a/composer.json b/composer.json index 4b986ef21..1ed26f5cf 100644 --- a/composer.json +++ b/composer.json @@ -54,14 +54,15 @@ "symfony/yaml": "3.4.18", "wp-cli/autoload-splitter": "0.1.5", "wp-cli/mustangostang-spyc": "0.6.3", - "wp-cli/php-cli-tools": "0.11.10" + "wp-cli/php-cli-tools": "0.11.10", + "ext-json": "*" }, "require-dev": { - "behat/behat": "3.4.*", + "behat/behat": "^3.7", "dealerdirect/phpcodesniffer-composer-installer": "0.4.4", "phpunit/phpunit": "3.7.*", "roave/security-advisories": "dev-master", - "wimg/php-compatibility": "8.2.0", + "phpcompatibility/php-compatibility": "8.2.0", "wp-coding-standards/wpcs": "0.13.1" }, "suggest": { diff --git a/composer.lock b/composer.lock index 3871e252d..0e86a910c 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": "88ed22b22a2eaeef29865bac7546df1e", + "content-hash": "0107ffe19eb97523ddcd6ffb4246bd63", "packages": [ { "name": "acmephp/core", @@ -239,6 +239,16 @@ "ssl", "tls" ], + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], "time": "2020-04-08T08:27:21+00:00" }, { @@ -485,6 +495,20 @@ "Xdebug", "performance" ], + "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": "2020-08-19T10:27:58+00:00" }, { @@ -1748,6 +1772,16 @@ "parser", "validator" ], + "funding": [ + { + "url": "https://github.com/Seldaek", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/seld/jsonlint", + "type": "tidelift" + } + ], "time": "2020-08-13T09:07:59+00:00" }, { @@ -2276,6 +2310,20 @@ "polyfill", "portable" ], + "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": "2020-07-14T12:35:20+00:00" }, { @@ -2339,6 +2387,20 @@ "portable", "shim" ], + "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": "2020-07-14T12:35:20+00:00" }, { @@ -2790,42 +2852,39 @@ "packages-dev": [ { "name": "behat/behat", - "version": "v3.4.3", + "version": "v3.7.0", "source": { "type": "git", "url": "https://github.com/Behat/Behat.git", - "reference": "d60b161bff1b95ec4bb80bb8cb210ccf890314c2" + "reference": "08052f739619a9e9f62f457a67302f0715e6dd13" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Behat/Behat/zipball/d60b161bff1b95ec4bb80bb8cb210ccf890314c2", - "reference": "d60b161bff1b95ec4bb80bb8cb210ccf890314c2", + "url": "https://api.github.com/repos/Behat/Behat/zipball/08052f739619a9e9f62f457a67302f0715e6dd13", + "reference": "08052f739619a9e9f62f457a67302f0715e6dd13", "shasum": "" }, "require": { - "behat/gherkin": "^4.5.1", + "behat/gherkin": "^4.6.0", "behat/transliterator": "^1.2", - "container-interop/container-interop": "^1.2", "ext-mbstring": "*", "php": ">=5.3.3", "psr/container": "^1.0", - "symfony/class-loader": "~2.1||~3.0||~4.0", - "symfony/config": "~2.3||~3.0||~4.0", - "symfony/console": "~2.5||~3.0||~4.0", - "symfony/dependency-injection": "~2.1||~3.0||~4.0", - "symfony/event-dispatcher": "~2.1||~3.0||~4.0", - "symfony/translation": "~2.3||~3.0||~4.0", - "symfony/yaml": "~2.1||~3.0||~4.0" + "symfony/config": "^2.7.51 || ^3.0 || ^4.0 || ^5.0", + "symfony/console": "^2.7.51 || ^2.8.33 || ^3.3.15 || ^3.4.3 || ^4.0.3 || ^5.0", + "symfony/dependency-injection": "^2.7.51 || ^3.0 || ^4.0 || ^5.0", + "symfony/event-dispatcher": "^2.7.51 || ^3.0 || ^4.0 || ^5.0", + "symfony/translation": "^2.7.51 || ^3.0 || ^4.0 || ^5.0", + "symfony/yaml": "^2.7.51 || ^3.0 || ^4.0 || ^5.0" }, "require-dev": { + "container-interop/container-interop": "^1.2", "herrera-io/box": "~1.6.1", - "phpunit/phpunit": "^4.8.36|^6.3", - "symfony/process": "~2.5|~3.0|~4.0" + "phpunit/phpunit": "^4.8.36 || ^6.5.14 || ^7.5.20", + "symfony/process": "~2.5 || ^3.0 || ^4.0 || ^5.0" }, "suggest": { - "behat/mink-extension": "for integration with Mink testing framework", - "behat/symfony2-extension": "for integration with Symfony2 web framework", - "behat/yii-extension": "for integration with Yii web framework" + "ext-dom": "Needed to output test results in JUnit format." }, "bin": [ "bin/behat" @@ -2833,13 +2892,13 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2.x-dev" + "dev-master": "3.6.x-dev" } }, "autoload": { - "psr-0": { - "Behat\\Behat": "src/", - "Behat\\Testwork": "src/" + "psr-4": { + "Behat\\Behat\\": "src/Behat/Behat/", + "Behat\\Testwork\\": "src/Behat/Testwork/" } }, "notification-url": "https://packagist.org/downloads/", @@ -2869,7 +2928,7 @@ "symfony", "testing" ], - "time": "2017-11-27T10:37:56+00:00" + "time": "2020-06-03T13:08:44+00:00" }, { "name": "behat/gherkin", @@ -2975,38 +3034,6 @@ ], "time": "2020-01-14T16:39:13+00:00" }, - { - "name": "container-interop/container-interop", - "version": "1.2.0", - "source": { - "type": "git", - "url": "https://github.com/container-interop/container-interop.git", - "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/container-interop/container-interop/zipball/79cbf1341c22ec75643d841642dd5d6acd83bdb8", - "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8", - "shasum": "" - }, - "require": { - "psr/container": "^1.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Interop\\Container\\": "src/Interop/Container/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", - "homepage": "https://github.com/container-interop/container-interop", - "abandoned": "psr/container", - "time": "2017-02-14T19:40:03+00:00" - }, { "name": "dealerdirect/phpcodesniffer-composer-installer", "version": "v0.4.4", @@ -3075,6 +3102,59 @@ ], "time": "2017-12-06T16:27:17+00:00" }, + { + "name": "phpcompatibility/php-compatibility", + "version": "8.2.0", + "source": { + "type": "git", + "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", + "reference": "eaf613c1a8265bcfd7b0ab690783f2aef519f78a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/eaf613c1a8265bcfd7b0ab690783f2aef519f78a", + "reference": "eaf613c1a8265bcfd7b0ab690783f2aef519f78a", + "shasum": "" + }, + "require": { + "php": ">=5.3", + "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" + }, + "conflict": { + "squizlabs/php_codesniffer": "2.6.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", + "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + }, + "type": "phpcodesniffer-standard", + "autoload": { + "psr-4": { + "PHPCompatibility\\": "PHPCompatibility/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Wim Godden", + "role": "lead" + } + ], + "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP version compatibility.", + "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", + "keywords": [ + "compatibility", + "phpcs", + "standards" + ], + "time": "2018-07-17T13:42:26+00:00" + }, { "name": "phpunit/php-code-coverage", "version": "1.2.18", @@ -3324,6 +3404,7 @@ "keywords": [ "tokenizer" ], + "abandoned": true, "time": "2014-03-03T05:10:30+00:00" }, { @@ -3734,6 +3815,16 @@ } ], "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", + "funding": [ + { + "url": "https://github.com/Ocramius", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/roave/security-advisories", + "type": "tidelift" + } + ], "time": "2020-08-19T19:01:52+00:00" }, { @@ -3787,116 +3878,6 @@ ], "time": "2020-08-10T04:50:15+00:00" }, - { - "name": "symfony/class-loader", - "version": "v3.4.43", - "source": { - "type": "git", - "url": "https://github.com/symfony/class-loader.git", - "reference": "e4636a4f23f157278a19e5db160c63de0da297d8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/class-loader/zipball/e4636a4f23f157278a19e5db160c63de0da297d8", - "reference": "e4636a4f23f157278a19e5db160c63de0da297d8", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8" - }, - "require-dev": { - "symfony/finder": "~2.8|~3.0|~4.0", - "symfony/polyfill-apcu": "~1.1" - }, - "suggest": { - "symfony/polyfill-apcu": "For using ApcClassLoader on HHVM" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\ClassLoader\\": "" - }, - "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": "Symfony ClassLoader Component", - "homepage": "https://symfony.com", - "time": "2020-03-15T09:38:08+00:00" - }, - { - "name": "wimg/php-compatibility", - "version": "8.2.0", - "source": { - "type": "git", - "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", - "reference": "eaf613c1a8265bcfd7b0ab690783f2aef519f78a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/eaf613c1a8265bcfd7b0ab690783f2aef519f78a", - "reference": "eaf613c1a8265bcfd7b0ab690783f2aef519f78a", - "shasum": "" - }, - "require": { - "php": ">=5.3", - "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" - }, - "conflict": { - "squizlabs/php_codesniffer": "2.6.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" - }, - "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", - "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." - }, - "type": "phpcodesniffer-standard", - "autoload": { - "psr-4": { - "PHPCompatibility\\": "PHPCompatibility/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "LGPL-3.0-or-later" - ], - "authors": [ - { - "name": "Wim Godden", - "role": "lead" - } - ], - "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP version compatibility.", - "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", - "keywords": [ - "compatibility", - "phpcs", - "standards" - ], - "abandoned": "phpcompatibility/php-compatibility", - "time": "2018-07-17T13:42:26+00:00" - }, { "name": "wp-coding-standards/wpcs", "version": "0.13.1", @@ -3946,10 +3927,12 @@ "prefer-stable": true, "prefer-lowest": false, "platform": { - "php": ">=7.0" + "php": ">=7.0", + "ext-json": "*" }, "platform-dev": [], "platform-overrides": { "php": "7.1" - } + }, + "plugin-api-version": "1.1.0" } From ebe89c2867c0a3e69a13c52fdb2f25ab30cf6e96 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 27 Aug 2020 16:05:06 +0530 Subject: [PATCH 0734/1044] Update docker images Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- img-versions.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/img-versions.json b/img-versions.json index bea9f1100..f6792564a 100644 --- a/img-versions.json +++ b/img-versions.json @@ -10,7 +10,7 @@ "easyengine/php7.2": "v4.1.3", "easyengine/php7.3": "v4.1.3", "easyengine/php7.4": "v4.1.3", - "easyengine/postfix": "v4.0.0", + "easyengine/postfix": "v4.1.5", "easyengine/redis": "v4.1.4", "easyengine/newrelic-daemon": "v4.0.0" } From a1e3d5666db6c286df80d5947d7b4c8d97e387bf Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 27 Aug 2020 17:44:19 +0530 Subject: [PATCH 0735/1044] Bump version to v4.1.4 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index de197cc33..a95f28844 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.1.3 +4.1.4 From 45a53254da328be8ee8eb9f5bcf7144ff6236f27 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Wed, 23 Sep 2020 09:49:21 +0530 Subject: [PATCH 0736/1044] Update image versions Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- img-versions.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/img-versions.json b/img-versions.json index f6792564a..c0d3aae3a 100644 --- a/img-versions.json +++ b/img-versions.json @@ -4,12 +4,12 @@ "easyengine/mariadb": "v4.1.3", "easyengine/nginx-proxy": "v4.1.4", "easyengine/nginx": "v4.1.4", - "easyengine/php": "v4.1.3", + "easyengine/php": "v4.1.6", "easyengine/php5.6": "v4.0.0", - "easyengine/php7.0": "v4.1.2", - "easyengine/php7.2": "v4.1.3", - "easyengine/php7.3": "v4.1.3", - "easyengine/php7.4": "v4.1.3", + "easyengine/php7.0": "v4.1.6", + "easyengine/php7.2": "v4.1.6", + "easyengine/php7.3": "v4.1.6", + "easyengine/php7.4": "v4.1.6", "easyengine/postfix": "v4.1.5", "easyengine/redis": "v4.1.4", "easyengine/newrelic-daemon": "v4.0.0" From 3c0858c480647efd4c16b2aa461d78a9025ee38a Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Wed, 23 Sep 2020 09:59:56 +0530 Subject: [PATCH 0737/1044] Update composer dependencies Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 2 +- composer.lock | 69 ++++++++++++++++++++++++++++----------------------- 2 files changed, 39 insertions(+), 32 deletions(-) diff --git a/composer.json b/composer.json index 4b986ef21..e82abae4f 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,7 @@ "easyengine/log-command": "v1.0.1", "easyengine/mailhog-command": "v1.0.2", "easyengine/site-command": "v2.6.2", - "easyengine/site-type-wp": "v1.3.1", + "easyengine/site-type-wp": "v1.3.2", "easyengine/site-type-php": "v1.3.1", "easyengine/service-command": "v1.1.0", "easyengine/shell-command" : "v1.0.3", diff --git a/composer.lock b/composer.lock index 3871e252d..1d603ba78 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": "88ed22b22a2eaeef29865bac7546df1e", + "content-hash": "e6aba9512b61e85178731d0be19daf01", "packages": [ { "name": "acmephp/core", @@ -187,16 +187,16 @@ }, { "name": "composer/ca-bundle", - "version": "1.2.7", + "version": "1.2.8", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "95c63ab2117a72f48f5a55da9740a3273d45b7fd" + "reference": "8a7ecad675253e4654ea05505233285377405215" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/95c63ab2117a72f48f5a55da9740a3273d45b7fd", - "reference": "95c63ab2117a72f48f5a55da9740a3273d45b7fd", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/8a7ecad675253e4654ea05505233285377405215", + "reference": "8a7ecad675253e4654ea05505233285377405215", "shasum": "" }, "require": { @@ -239,7 +239,7 @@ "ssl", "tls" ], - "time": "2020-04-08T08:27:21+00:00" + "time": "2020-08-23T12:54:47+00:00" }, { "name": "composer/composer", @@ -952,16 +952,16 @@ }, { "name": "easyengine/site-type-wp", - "version": "v1.3.1", + "version": "v1.3.2", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-wp.git", - "reference": "9ff05aea59fe1c62d9a93d4a3ebc855fe38766f7" + "reference": "68903762d08ce05f2aad947229e34a9b10353dc8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/9ff05aea59fe1c62d9a93d4a3ebc855fe38766f7", - "reference": "9ff05aea59fe1c62d9a93d4a3ebc855fe38766f7", + "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/68903762d08ce05f2aad947229e34a9b10353dc8", + "reference": "68903762d08ce05f2aad947229e34a9b10353dc8", "shasum": "" }, "require-dev": { @@ -1003,7 +1003,7 @@ ], "description": "EasyEngine site type package for WordPress site creation.", "homepage": "https://github.com/easyengine/site-type-wp", - "time": "2020-08-20T09:17:25+00:00" + "time": "2020-09-23T03:49:19+00:00" }, { "name": "guzzlehttp/guzzle", @@ -1703,16 +1703,16 @@ }, { "name": "seld/jsonlint", - "version": "1.8.1", + "version": "1.8.2", "source": { "type": "git", "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "3d5eb71705adfa34bd34b993400622932b2f62fd" + "reference": "590cfec960b77fd55e39b7d9246659e95dd6d337" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/3d5eb71705adfa34bd34b993400622932b2f62fd", - "reference": "3d5eb71705adfa34bd34b993400622932b2f62fd", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/590cfec960b77fd55e39b7d9246659e95dd6d337", + "reference": "590cfec960b77fd55e39b7d9246659e95dd6d337", "shasum": "" }, "require": { @@ -1748,7 +1748,7 @@ "parser", "validator" ], - "time": "2020-08-13T09:07:59+00:00" + "time": "2020-08-25T06:56:57+00:00" }, { "name": "seld/phar-utils", @@ -3324,6 +3324,7 @@ "keywords": [ "tokenizer" ], + "abandoned": true, "time": "2014-03-03T05:10:30+00:00" }, { @@ -3456,12 +3457,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "89bed6788d61977969b89d912b5844e8beee09f0" + "reference": "81cb95735a719403eddb77fc78e21362b56d9ea9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/89bed6788d61977969b89d912b5844e8beee09f0", - "reference": "89bed6788d61977969b89d912b5844e8beee09f0", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/81cb95735a719403eddb77fc78e21362b56d9ea9", + "reference": "81cb95735a719403eddb77fc78e21362b56d9ea9", "shasum": "" }, "conflict": { @@ -3477,6 +3478,7 @@ "bagisto/bagisto": "<0.1.5", "barrelstrength/sprout-base-email": "<1.2.7", "barrelstrength/sprout-forms": "<3.9", + "baserproject/basercms": ">=4,<=4.3.6", "bolt/bolt": "<3.7.1", "brightlocal/phpwhois": "<=4.2.5", "buddypress/buddypress": "<5.1.2", @@ -3494,6 +3496,7 @@ "contao/listing-bundle": ">=4,<4.4.8", "datadog/dd-trace": ">=0.30,<0.30.2", "david-garcia/phpwhois": "<=4.3.1", + "derhansen/sf_event_mgt": "<4.3.1|>=5,<5.1.1", "doctrine/annotations": ">=1,<1.2.7", "doctrine/cache": ">=1,<1.3.2|>=1.4,<1.4.2", "doctrine/common": ">=2,<2.4.3|>=2.5,<2.5.1", @@ -3505,8 +3508,8 @@ "doctrine/orm": ">=2,<2.4.8|>=2.5,<2.5.1", "dolibarr/dolibarr": "<11.0.4", "dompdf/dompdf": ">=0.6,<0.6.2", - "drupal/core": ">=7,<7.72|>=8,<8.8.8|>=8.9,<8.9.1|>=9,<9.0.1", - "drupal/drupal": ">=7,<7.72|>=8,<8.8.8|>=8.9,<8.9.1|>=9,<9.0.1", + "drupal/core": ">=7,<7.73|>=8,<8.8.10|>=8.9,<8.9.6|>=9,<9.0.6", + "drupal/drupal": ">=7,<7.73|>=8,<8.8.10|>=8.9,<8.9.6|>=9,<9.0.6", "endroid/qr-code-bundle": "<3.4.2", "enshrined/svg-sanitize": "<0.13.1", "erusev/parsedown": "<1.7.2", @@ -3515,11 +3518,12 @@ "ezsystems/ezfind-ls": ">=5.3,<5.3.6.1|>=5.4,<5.4.11.1|>=2017.12,<2017.12.0.1", "ezsystems/ezplatform": ">=1.7,<1.7.9.1|>=1.13,<1.13.5.1|>=2.5,<2.5.4", "ezsystems/ezplatform-admin-ui": ">=1.3,<1.3.5|>=1.4,<1.4.6", - "ezsystems/ezplatform-admin-ui-assets": ">=4,<4.2", + "ezsystems/ezplatform-admin-ui-assets": ">=4,<4.2.1|>=5,<5.0.1|>=5.1,<5.1.1", "ezsystems/ezplatform-kernel": ">=1,<1.0.2.1", "ezsystems/ezplatform-user": ">=1,<1.0.1", "ezsystems/ezpublish-kernel": ">=5.3,<5.3.12.1|>=5.4,<5.4.14.2|>=6,<6.7.9.1|>=6.8,<6.13.6.3|>=7,<7.2.4.1|>=7.3,<7.3.2.1|>=7.5,<7.5.7.1", "ezsystems/ezpublish-legacy": ">=5.3,<5.3.12.6|>=5.4,<5.4.14.1|>=2011,<2017.12.7.2|>=2018.6,<2018.6.1.4|>=2018.9,<2018.9.1.3|>=2019.3,<2019.3.4.2", + "ezsystems/platform-ui-assets-bundle": ">=4.2,<4.2.3", "ezsystems/repository-forms": ">=2.3,<2.3.2.1", "ezyang/htmlpurifier": "<4.1.1", "firebase/php-jwt": "<2", @@ -3577,6 +3581,7 @@ "paragonie/random_compat": "<2", "paypal/merchant-sdk-php": "<3.12", "pear/archive_tar": "<1.4.4", + "personnummer/personnummer": "<3.0.2", "phpfastcache/phpfastcache": ">=5,<5.0.13", "phpmailer/phpmailer": "<6.1.6", "phpmussel/phpmussel": ">=1,<1.6", @@ -3588,6 +3593,7 @@ "phpxmlrpc/extras": "<0.6.1", "pimcore/pimcore": "<6.3", "prestashop/autoupgrade": ">=4,<4.10.1", + "prestashop/contactform": ">1.0.1,<4.3", "prestashop/gamification": "<2.3.2", "prestashop/ps_facetedsearch": "<3.4.1", "privatebin/privatebin": "<1.2.2|>=1.3,<1.3.2", @@ -3596,6 +3602,7 @@ "pusher/pusher-php-server": "<2.2.1", "rainlab/debugbar-plugin": "<3.1", "robrichards/xmlseclibs": "<3.0.4", + "sabberworm/php-css-parser": ">=1,<1.0.1|>=2,<2.0.1|>=3,<3.0.1|>=4,<4.0.1|>=5,<5.0.9|>=5.1,<5.1.3|>=5.2,<5.2.1|>=6,<6.0.2|>=7,<7.0.4|>=8,<8.0.1|>=8.1,<8.1.1|>=8.2,<8.2.1|>=8.3,<8.3.1", "sabre/dav": ">=1.6,<1.6.99|>=1.7,<1.7.11|>=1.8,<1.8.9", "scheb/two-factor-bundle": ">=0,<3.26|>=4,<4.11", "sensiolabs/connect": "<4.2.3", @@ -3641,7 +3648,7 @@ "symfony/form": ">=2.3,<2.3.35|>=2.4,<2.6.12|>=2.7,<2.7.50|>=2.8,<2.8.49|>=3,<3.4.20|>=4,<4.0.15|>=4.1,<4.1.9|>=4.2,<4.2.1", "symfony/framework-bundle": ">=2,<2.3.18|>=2.4,<2.4.8|>=2.5,<2.5.2|>=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", "symfony/http-foundation": ">=2,<2.8.52|>=3,<3.4.35|>=4,<4.2.12|>=4.3,<4.3.8|>=4.4,<4.4.7|>=5,<5.0.7", - "symfony/http-kernel": ">=2,<2.8.52|>=3,<3.4.35|>=4,<4.2.12|>=4.3,<4.3.8", + "symfony/http-kernel": ">=2,<2.8.52|>=3,<3.4.35|>=4,<4.2.12|>=4.3,<4.4.13|>=5,<5.1.5", "symfony/intl": ">=2.7,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", "symfony/mime": ">=4.3,<4.3.8", "symfony/phpunit-bridge": ">=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", @@ -3656,7 +3663,7 @@ "symfony/security-guard": ">=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", "symfony/security-http": ">=2.3,<2.3.41|>=2.4,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.2.12|>=4.3,<4.3.8|>=4.4,<4.4.7|>=5,<5.0.7", "symfony/serializer": ">=2,<2.0.11", - "symfony/symfony": ">=2,<2.8.52|>=3,<3.4.35|>=4,<4.2.12|>=4.3,<4.3.8|>=4.4,<4.4.7|>=5,<5.0.7", + "symfony/symfony": ">=2,<2.8.52|>=3,<3.4.35|>=4,<4.2.12|>=4.3,<4.4.13|>=5,<5.1.5", "symfony/translation": ">=2,<2.0.17", "symfony/validator": ">=2,<2.0.24|>=2.1,<2.1.12|>=2.2,<2.2.5|>=2.3,<2.3.3", "symfony/var-exporter": ">=4.2,<4.2.12|>=4.3,<4.3.8", @@ -3682,7 +3689,7 @@ "willdurand/js-translation-bundle": "<2.1.1", "yii2mod/yii2-cms": "<1.9.2", "yiisoft/yii": ">=1.1.14,<1.1.15", - "yiisoft/yii2": "<2.0.15", + "yiisoft/yii2": "<2.0.38", "yiisoft/yii2-bootstrap": "<2.0.4", "yiisoft/yii2-dev": "<2.0.15", "yiisoft/yii2-elasticsearch": "<2.0.5", @@ -3734,7 +3741,7 @@ } ], "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", - "time": "2020-08-19T19:01:52+00:00" + "time": "2020-09-18T13:01:53+00:00" }, { "name": "squizlabs/php_codesniffer", @@ -3789,16 +3796,16 @@ }, { "name": "symfony/class-loader", - "version": "v3.4.43", + "version": "v3.4.44", "source": { "type": "git", "url": "https://github.com/symfony/class-loader.git", - "reference": "e4636a4f23f157278a19e5db160c63de0da297d8" + "reference": "04a7e4c1bf7f156f3d9df930401eb2c6fe51fc72" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/class-loader/zipball/e4636a4f23f157278a19e5db160c63de0da297d8", - "reference": "e4636a4f23f157278a19e5db160c63de0da297d8", + "url": "https://api.github.com/repos/symfony/class-loader/zipball/04a7e4c1bf7f156f3d9df930401eb2c6fe51fc72", + "reference": "04a7e4c1bf7f156f3d9df930401eb2c6fe51fc72", "shasum": "" }, "require": { @@ -3841,7 +3848,7 @@ ], "description": "Symfony ClassLoader Component", "homepage": "https://symfony.com", - "time": "2020-03-15T09:38:08+00:00" + "time": "2020-08-09T11:28:08+00:00" }, { "name": "wimg/php-compatibility", From d3cfc56ca3afb0e06fd94ace6165491e4c4c1c56 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Wed, 23 Sep 2020 10:00:10 +0530 Subject: [PATCH 0738/1044] Bump version to v4.1.5 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index a95f28844..b1cbc1fcd 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.1.4 +4.1.5 From 9096530c2aaeab0b56735501f948596c11febb6f Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Wed, 30 Sep 2020 12:07:09 +0530 Subject: [PATCH 0739/1044] Add custom docker-compose in class-ee-docker.php --- php/class-ee-docker.php | 12 +++++------- php/utils.php | 25 +++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php index bbf3bd200..dfbd9639b 100644 --- a/php/class-ee-docker.php +++ b/php/class-ee-docker.php @@ -1,6 +1,7 @@ <?php use Symfony\Component\Filesystem\Filesystem; +use function EE\Utils\docker_compose_with_custom; class EE_DOCKER { @@ -163,14 +164,11 @@ public static function docker_compose_up( $dir, $services = [] ) { $chdir_return_code = chdir( $dir ); if ( $chdir_return_code ) { if ( empty( $services ) ) { - return EE::exec( 'docker-compose up -d' ); + return EE::exec( docker_compose_with_custom() . ' up -d' ); } else { $all_services = implode( ' ', $services ); - if ( $fs->exists( SITE_CUSTOM_DOCKER_COMPOSE ) ) { - return EE::exec( 'docker-compose -f docker-compose.yml -f ' . SITE_CUSTOM_DOCKER_COMPOSE . " up -d $all_services" ); - } else { - return EE::exec( "docker-compose up -d $all_services" ); - } + + return EE::exec( docker_compose_with_custom() . ' up -d '. $all_services ); } } @@ -199,7 +197,7 @@ public static function docker_compose_down( $dir ) { $chdir_return_code = chdir( $dir ); if ( $chdir_return_code ) { - return EE::exec( 'docker-compose down' ); + return EE::exec( docker_compose_with_custom() . ' down' ); } return false; diff --git a/php/utils.php b/php/utils.php index 6a70e0fff..f349c2605 100644 --- a/php/utils.php +++ b/php/utils.php @@ -9,6 +9,7 @@ use EE; use EE\Iterators\Transform; use Mustangostang\Spyc; +use Symfony\Component\Filesystem\Filesystem; const PHAR_STREAM_PREFIX = 'phar://'; @@ -1794,3 +1795,27 @@ function sanitize_file_folder_name( $input_name, $strict = true, $remove_forward // Remove starting and ending hyphens as a starting hyphen in string might be considered as parameter in bash file/folder creation. return trim( $output, '-' ); } + +/** + * Function to return docker-compose command with custom docker-compose files + * + * @param array $files_before_custom Files to be included before custom compose file is included + * @return string + */ +function docker_compose_with_custom( array $files_before_custom = [] ) : string { + $fs = new Filesystem(); + + $command = 'docker-compose -f docker-compose.yml'; + + foreach ( $files_before_custom as $file ) { + if ( $fs->exists( $file ) ) { + $command .= ' -f ' . $file ; + } + } + + if ( $fs->exists( SITE_CUSTOM_DOCKER_COMPOSE ) ) { + $command .= ' -f ' . SITE_CUSTOM_DOCKER_COMPOSE ; + } + + return $command; +} From 3c126d2937f3bc56052e2e5a322336072c5c3bce Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Wed, 30 Sep 2020 17:03:23 +0530 Subject: [PATCH 0740/1044] Add custom docker-compose support in GlobalContainers.php --- php/EE/Migration/GlobalContainers.php | 11 ++++++----- php/class-ee-docker.php | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/php/EE/Migration/GlobalContainers.php b/php/EE/Migration/GlobalContainers.php index a2f77dc2d..1b81f8cd9 100644 --- a/php/EE/Migration/GlobalContainers.php +++ b/php/EE/Migration/GlobalContainers.php @@ -4,6 +4,7 @@ use EE; use Symfony\Component\Filesystem\Filesystem; +use function EE\Utils\docker_compose_with_custom; /** * Upgrade existing global containers to new docker-image @@ -55,7 +56,7 @@ public static function revert_global_containers( $source_path, $dest_path, $upda chdir( EE_ROOT_DIR . '/services' ); - if ( ! EE::exec( 'docker-compose up -d ' . $services_to_regenerate ) ) { + if ( ! EE::exec( docker_compose_with_custom() . ' up -d ' . $services_to_regenerate ) ) { throw new \Exception( 'Unable to downgrade global containers. Please check logs for more details.' ); } EE::debug( 'Complete restoring global docker-compose.yml file from backup' ); @@ -81,7 +82,7 @@ public static function down_global_containers( $updated_images ) { EE::debug( "Removing $global_container_name" ); if ( false !== \EE_DOCKER::container_status( $global_container_name ) ) { - if ( ! EE::exec( "docker-compose stop $global_service_name && docker-compose rm -f $global_service_name" ) ) { + if ( ! EE::exec( docker_compose_with_custom() . " stop $global_service_name && ". docker_compose_with_custom() . " rm -f $global_service_name" ) ) { throw new \Exception( "Unable to stop $global_container_name container" ); } } @@ -115,7 +116,7 @@ public static function global_service_down( $service_name ) { EE::debug( 'Start ' . $service_name . ' container removing' ); chdir( EE_ROOT_DIR . '/services' ); - if ( ! EE::exec( "docker-compose stop $service_name && docker-compose rm -f $service_name" ) ) { + if ( ! EE::exec( docker_compose_with_custom() . " stop $service_name && ". docker_compose_with_custom() . " rm -f $service_name" ) ) { throw new \Exception( sprintf( 'Unable to remove %1$s container', $service_name ) ); } EE::debug( 'Complete ' . $service_name . ' container removing' ); @@ -149,7 +150,7 @@ public static function enable_support_containers() { throw new \Exception( sprintf( '%s path does not exist', EE_SERVICE_DIR ) ); } - $command = 'docker-compose --project-name=ee up -d global-db global-redis'; + $command = docker_compose_with_custom() . ' --project-name=ee up -d global-db global-redis'; if ( ! EE::exec( $command ) ) { throw new \Exception( 'Unable to create support container.' ); } @@ -163,7 +164,7 @@ public static function disable_support_containers() { throw new \Exception( sprintf( '%s path does not exist', EE_SERVICE_DIR ) ); } - $command = 'docker-compose --project-name=ee down'; + $command = docker_compose_with_custom() . ' --project-name=ee down'; if ( ! EE::exec( $command ) ) { throw new \Exception( 'Unable to remove support container.' ); } diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php index dfbd9639b..4bfba6699 100644 --- a/php/class-ee-docker.php +++ b/php/class-ee-docker.php @@ -213,7 +213,7 @@ public static function docker_compose_down( $dir ) { */ public static function service_exists( $service, $site_fs_path ) { chdir( $site_fs_path ); - $launch = EE::launch( 'docker-compose config --services' ); + $launch = EE::launch( docker_compose_with_custom() . ' config --services' ); $services = explode( PHP_EOL, trim( $launch->stdout ) ); return in_array( $service, $services, true ); From 81994713279e9b423636b4b6ebb8d6b8b81e1b9d Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Mon, 5 Oct 2020 15:24:58 +0530 Subject: [PATCH 0741/1044] Remove additional space --- php/utils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/utils.php b/php/utils.php index f349c2605..d67e984bf 100644 --- a/php/utils.php +++ b/php/utils.php @@ -1817,5 +1817,5 @@ function docker_compose_with_custom( array $files_before_custom = [] ) : string $command .= ' -f ' . SITE_CUSTOM_DOCKER_COMPOSE ; } - return $command; + return $command; } From 0a0fc150a7091e0f01fa9e140a6997755655b46e Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Mon, 5 Oct 2020 15:39:25 +0530 Subject: [PATCH 0742/1044] Add custom docker-compose support --- php/EE/Runner.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 026306339..87aa41f7b 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -10,6 +10,7 @@ use EE\Utils; use Monolog\Logger; use Mustangostang\Spyc; +use function EE\Utils\docker_compose_with_custom; /** * Performs the execution of a command. @@ -473,7 +474,7 @@ private function generate_ssh_command( $bits, $ee_command ) { } if ( 'docker-compose' === $bits['scheme'] ) { - $command = 'docker-compose exec %s%s%s sh -c %s'; + $command = docker_compose_with_custom() . ' exec %s%s%s sh -c %s'; $escaped_command = sprintf( $command, From 4eb4857ebf1e491b3c6a8dcdd84637efeca54b46 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Tue, 27 Oct 2020 19:28:14 +0530 Subject: [PATCH 0743/1044] Move docker_compose_with_custom to class EE_DOCKER --- php/EE/Migration/GlobalContainers.php | 11 ++++----- php/EE/Runner.php | 5 ++-- php/class-ee-docker.php | 33 +++++++++++++++++++++++---- php/utils.php | 23 ------------------- 4 files changed, 35 insertions(+), 37 deletions(-) diff --git a/php/EE/Migration/GlobalContainers.php b/php/EE/Migration/GlobalContainers.php index 1b81f8cd9..b802cb544 100644 --- a/php/EE/Migration/GlobalContainers.php +++ b/php/EE/Migration/GlobalContainers.php @@ -4,7 +4,6 @@ use EE; use Symfony\Component\Filesystem\Filesystem; -use function EE\Utils\docker_compose_with_custom; /** * Upgrade existing global containers to new docker-image @@ -56,7 +55,7 @@ public static function revert_global_containers( $source_path, $dest_path, $upda chdir( EE_ROOT_DIR . '/services' ); - if ( ! EE::exec( docker_compose_with_custom() . ' up -d ' . $services_to_regenerate ) ) { + if ( ! EE::exec( \EE_DOCKER::docker_compose_with_custom() . ' up -d ' . $services_to_regenerate ) ) { throw new \Exception( 'Unable to downgrade global containers. Please check logs for more details.' ); } EE::debug( 'Complete restoring global docker-compose.yml file from backup' ); @@ -82,7 +81,7 @@ public static function down_global_containers( $updated_images ) { EE::debug( "Removing $global_container_name" ); if ( false !== \EE_DOCKER::container_status( $global_container_name ) ) { - if ( ! EE::exec( docker_compose_with_custom() . " stop $global_service_name && ". docker_compose_with_custom() . " rm -f $global_service_name" ) ) { + if ( ! EE::exec( \EE_DOCKER::docker_compose_with_custom() . " stop $global_service_name && ". \EE_DOCKER::docker_compose_with_custom() . " rm -f $global_service_name" ) ) { throw new \Exception( "Unable to stop $global_container_name container" ); } } @@ -116,7 +115,7 @@ public static function global_service_down( $service_name ) { EE::debug( 'Start ' . $service_name . ' container removing' ); chdir( EE_ROOT_DIR . '/services' ); - if ( ! EE::exec( docker_compose_with_custom() . " stop $service_name && ". docker_compose_with_custom() . " rm -f $service_name" ) ) { + if ( ! EE::exec( \EE_DOCKER::docker_compose_with_custom() . " stop $service_name && ". \EE_DOCKER::docker_compose_with_custom() . " rm -f $service_name" ) ) { throw new \Exception( sprintf( 'Unable to remove %1$s container', $service_name ) ); } EE::debug( 'Complete ' . $service_name . ' container removing' ); @@ -150,7 +149,7 @@ public static function enable_support_containers() { throw new \Exception( sprintf( '%s path does not exist', EE_SERVICE_DIR ) ); } - $command = docker_compose_with_custom() . ' --project-name=ee up -d global-db global-redis'; + $command = \EE_DOCKER::docker_compose_with_custom() . ' --project-name=ee up -d global-db global-redis'; if ( ! EE::exec( $command ) ) { throw new \Exception( 'Unable to create support container.' ); } @@ -164,7 +163,7 @@ public static function disable_support_containers() { throw new \Exception( sprintf( '%s path does not exist', EE_SERVICE_DIR ) ); } - $command = docker_compose_with_custom() . ' --project-name=ee down'; + $command = \EE_DOCKER::docker_compose_with_custom() . ' --project-name=ee down'; if ( ! EE::exec( $command ) ) { throw new \Exception( 'Unable to remove support container.' ); } diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 87aa41f7b..11e8b125f 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -10,7 +10,6 @@ use EE\Utils; use Monolog\Logger; use Mustangostang\Spyc; -use function EE\Utils\docker_compose_with_custom; /** * Performs the execution of a command. @@ -57,7 +56,7 @@ private function init_ee() { define( 'DB', EE_ROOT_DIR . '/db/ee.sqlite' ); define( 'LOCALHOST_IP', '127.0.0.1' ); - define( 'SITE_CUSTOM_DOCKER_COMPOSE', 'docker-compose-custom.yml' ); + define( 'SITE_CUSTOM_DOCKER_COMPOSE', 'docker-compose.custom.yml' ); $db_dir = dirname( DB ); if ( ! is_dir( $db_dir ) ) { @@ -474,7 +473,7 @@ private function generate_ssh_command( $bits, $ee_command ) { } if ( 'docker-compose' === $bits['scheme'] ) { - $command = docker_compose_with_custom() . ' exec %s%s%s sh -c %s'; + $command = \EE_DOCKER::docker_compose_with_custom() . ' exec %s%s%s sh -c %s'; $escaped_command = sprintf( $command, diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php index 4bfba6699..ae17a7a65 100644 --- a/php/class-ee-docker.php +++ b/php/class-ee-docker.php @@ -1,10 +1,33 @@ <?php use Symfony\Component\Filesystem\Filesystem; -use function EE\Utils\docker_compose_with_custom; class EE_DOCKER { + /** + * Function to return docker-compose command with custom docker-compose files + * + * @param array $files_before_custom Files to be included before custom compose file is included + * @return string + */ + public static function docker_compose_with_custom( array $files_before_custom = [] ) : string { + $fs = new Filesystem(); + + $command = 'docker-compose -f docker-compose.yml'; + + foreach ( $files_before_custom as $file ) { + if ( $fs->exists( $file ) ) { + $command .= ' -f ' . $file ; + } + } + + if ( $fs->exists( SITE_CUSTOM_DOCKER_COMPOSE ) ) { + $command .= ' -f ' . SITE_CUSTOM_DOCKER_COMPOSE ; + } + + return $command; + } + /** * Check and Start or create container if not running. * @@ -164,11 +187,11 @@ public static function docker_compose_up( $dir, $services = [] ) { $chdir_return_code = chdir( $dir ); if ( $chdir_return_code ) { if ( empty( $services ) ) { - return EE::exec( docker_compose_with_custom() . ' up -d' ); + return EE::exec( \EE_DOCKER::docker_compose_with_custom() . ' up -d' ); } else { $all_services = implode( ' ', $services ); - return EE::exec( docker_compose_with_custom() . ' up -d '. $all_services ); + return EE::exec( \EE_DOCKER::docker_compose_with_custom() . ' up -d '. $all_services ); } } @@ -197,7 +220,7 @@ public static function docker_compose_down( $dir ) { $chdir_return_code = chdir( $dir ); if ( $chdir_return_code ) { - return EE::exec( docker_compose_with_custom() . ' down' ); + return EE::exec( \EE_DOCKER::docker_compose_with_custom() . ' down' ); } return false; @@ -213,7 +236,7 @@ public static function docker_compose_down( $dir ) { */ public static function service_exists( $service, $site_fs_path ) { chdir( $site_fs_path ); - $launch = EE::launch( docker_compose_with_custom() . ' config --services' ); + $launch = EE::launch( \EE_DOCKER::docker_compose_with_custom() . ' config --services' ); $services = explode( PHP_EOL, trim( $launch->stdout ) ); return in_array( $service, $services, true ); diff --git a/php/utils.php b/php/utils.php index d67e984bf..8aaf06be5 100644 --- a/php/utils.php +++ b/php/utils.php @@ -1796,26 +1796,3 @@ function sanitize_file_folder_name( $input_name, $strict = true, $remove_forward return trim( $output, '-' ); } -/** - * Function to return docker-compose command with custom docker-compose files - * - * @param array $files_before_custom Files to be included before custom compose file is included - * @return string - */ -function docker_compose_with_custom( array $files_before_custom = [] ) : string { - $fs = new Filesystem(); - - $command = 'docker-compose -f docker-compose.yml'; - - foreach ( $files_before_custom as $file ) { - if ( $fs->exists( $file ) ) { - $command .= ' -f ' . $file ; - } - } - - if ( $fs->exists( SITE_CUSTOM_DOCKER_COMPOSE ) ) { - $command .= ' -f ' . SITE_CUSTOM_DOCKER_COMPOSE ; - } - - return $command; -} From 99d96bb52b199bd532d80c6e93d7142f5fb6896f Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 29 Oct 2020 17:45:00 +0530 Subject: [PATCH 0744/1044] Switch to easyengine/autoload-splitter Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index e82abae4f..d8b97e34c 100644 --- a/composer.json +++ b/composer.json @@ -29,15 +29,16 @@ "composer/semver": "1.4.2", "easyengine/admin-tools-command": "v1.0.10", "easyengine/auth-command": "v1.0.4", + "easyengine/autoload-splitter": "dev-master", "easyengine/config-command": "v1.0.2", "easyengine/cron-command": "v1.0.2", "easyengine/log-command": "v1.0.1", "easyengine/mailhog-command": "v1.0.2", + "easyengine/service-command": "v1.1.0", + "easyengine/shell-command": "v1.0.3", "easyengine/site-command": "v2.6.2", - "easyengine/site-type-wp": "v1.3.2", "easyengine/site-type-php": "v1.3.1", - "easyengine/service-command": "v1.1.0", - "easyengine/shell-command" : "v1.0.3", + "easyengine/site-type-wp": "v1.3.2", "justinrainbow/json-schema": "5.2.7", "monolog/monolog": "1.24.0", "mustache/mustache": "2.12.0", @@ -52,7 +53,6 @@ "symfony/process": "3.4.18", "symfony/translation": "3.4.18", "symfony/yaml": "3.4.18", - "wp-cli/autoload-splitter": "0.1.5", "wp-cli/mustangostang-spyc": "0.6.3", "wp-cli/php-cli-tools": "0.11.10" }, From 2351986effb5962791a61aed08186c9d1fdbdc78 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 29 Oct 2020 17:45:33 +0530 Subject: [PATCH 0745/1044] Update dealerdirect/phpcodesniffer-composer-installer to latest for 2.0 changes Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 2 +- composer.lock | 598 ++++++++++++++++++++++++++++++++++++++++---------- 2 files changed, 484 insertions(+), 116 deletions(-) diff --git a/composer.json b/composer.json index d8b97e34c..bcb919a13 100644 --- a/composer.json +++ b/composer.json @@ -58,7 +58,7 @@ }, "require-dev": { "behat/behat": "3.4.*", - "dealerdirect/phpcodesniffer-composer-installer": "0.4.4", + "dealerdirect/phpcodesniffer-composer-installer": "0.7.0", "phpunit/phpunit": "3.7.*", "roave/security-advisories": "dev-master", "wimg/php-compatibility": "8.2.0", diff --git a/composer.lock b/composer.lock index 1d603ba78..af7638f82 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": "e6aba9512b61e85178731d0be19daf01", + "content-hash": "c402efbe153196894309544411b6d246", "packages": [ { "name": "acmephp/core", @@ -75,6 +75,9 @@ "ssl", "x509" ], + "support": { + "source": "https://github.com/acmephp/core/tree/1.2.0" + }, "time": "2019-12-17T11:28:20+00:00" }, { @@ -140,6 +143,10 @@ "ssl", "x509" ], + "support": { + "issues": "https://github.com/acmephp/ssl/issues", + "source": "https://github.com/acmephp/ssl/tree/1.2.0" + }, "time": "2019-12-17T14:19:42+00:00" }, { @@ -183,6 +190,10 @@ } ], "description": "PHP binding for v4 of the Cloudflare Client API.", + "support": { + "issues": "https://github.com/cloudflare/cloudflare-php/issues", + "source": "https://github.com/cloudflare/cloudflare-php/tree/1.1.1" + }, "time": "2018-08-28T14:01:57+00:00" }, { @@ -239,6 +250,25 @@ "ssl", "tls" ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/ca-bundle/issues", + "source": "https://github.com/composer/ca-bundle/tree/1.2.8" + }, + "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": "2020-08-23T12:54:47+00:00" }, { @@ -319,6 +349,11 @@ "dependency", "package" ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/composer/issues", + "source": "https://github.com/composer/composer/tree/1.7.3" + }, "time": "2018-11-01T09:05:06+00:00" }, { @@ -381,6 +416,11 @@ "validation", "versioning" ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/1.4.2" + }, "time": "2016-08-30T16:08:34+00:00" }, { @@ -441,20 +481,39 @@ "spdx", "validator" ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/spdx-licenses/issues", + "source": "https://github.com/composer/spdx-licenses/tree/1.5.4" + }, + "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": "2020-07-15T15:35:07+00:00" }, { "name": "composer/xdebug-handler", - "version": "1.4.3", + "version": "1.4.4", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "ebd27a9866ae8254e873866f795491f02418c5a5" + "reference": "6e076a124f7ee146f2487554a94b6a19a74887ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ebd27a9866ae8254e873866f795491f02418c5a5", - "reference": "ebd27a9866ae8254e873866f795491f02418c5a5", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6e076a124f7ee146f2487554a94b6a19a74887ba", + "reference": "6e076a124f7ee146f2487554a94b6a19a74887ba", "shasum": "" }, "require": { @@ -485,7 +544,26 @@ "Xdebug", "performance" ], - "time": "2020-08-19T10:27:58+00:00" + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/1.4.4" + }, + "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": "2020-10-24T12:39:10+00:00" }, { "name": "easyengine/admin-tools-command", @@ -527,6 +605,10 @@ ], "description": "Command to manage admin tools for php based sites.", "homepage": "https://github.com/easyengine/amdin-tools", + "support": { + "issues": "https://github.com/EasyEngine/admin-tools-command/issues", + "source": "https://github.com/EasyEngine/admin-tools-command/tree/master" + }, "time": "2020-08-11T10:14:14+00:00" }, { @@ -574,8 +656,58 @@ ], "description": "Configure HTTP Authentication and whitelisting for EasyEngine site", "homepage": "https://github.com/easyengine/auth-command", + "support": { + "issues": "https://github.com/EasyEngine/auth-command/issues", + "source": "https://github.com/EasyEngine/auth-command/tree/master" + }, "time": "2020-08-11T10:12:02+00:00" }, + { + "name": "easyengine/autoload-splitter", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/EasyEngine/autoload-splitter.git", + "reference": "c59a6fd3ca9a7514e47629567d69c8ada6062e7b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/EasyEngine/autoload-splitter/zipball/c59a6fd3ca9a7514e47629567d69c8ada6062e7b", + "reference": "c59a6fd3ca9a7514e47629567d69c8ada6062e7b", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.1 || ^2.0" + }, + "default-branch": true, + "type": "composer-plugin", + "extra": { + "class": "WP_CLI\\AutoloadSplitter\\ComposerPlugin" + }, + "autoload": { + "psr-4": { + "WP_CLI\\AutoloadSplitter\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Alain Schlesser", + "email": "alain.schlesser@gmail.com", + "homepage": "https://www.alainschlesser.com" + } + ], + "description": "Composer plugin for splitting a generated autoloader into two distinct parts.", + "homepage": "https://wp-cli.org", + "support": { + "issues": "https://github.com/easyengine/autoload-splitter/issues", + "source": "https://github.com/easyengine/autoload-splitter" + }, + "time": "2020-10-29T11:34:56+00:00" + }, { "name": "easyengine/config-command", "version": "v1.0.2", @@ -616,6 +748,10 @@ ], "description": "Manages EasyEngine configuration", "homepage": "https://github.com/easyengine/config-command", + "support": { + "issues": "https://github.com/EasyEngine/config-command/issues", + "source": "https://github.com/EasyEngine/config-command/tree/master" + }, "time": "2018-12-28T16:04:46+00:00" }, { @@ -663,6 +799,10 @@ ], "description": "Manages cron jobs in EasyEngine", "homepage": "https://github.com/easyengine/cron-command", + "support": { + "issues": "https://github.com/EasyEngine/cron-command/issues", + "source": "https://github.com/EasyEngine/cron-command/tree/master" + }, "time": "2018-12-28T16:05:27+00:00" }, { @@ -702,6 +842,10 @@ "MIT" ], "homepage": "https://github.com/easyengine/log-command", + "support": { + "issues": "https://github.com/EasyEngine/log-command/issues", + "source": "https://github.com/EasyEngine/log-command/tree/master" + }, "time": "2018-12-28T16:07:01+00:00" }, { @@ -745,6 +889,10 @@ ], "description": "Command to manage mailhog", "homepage": "https://github.com/easyengine/mailhog-command", + "support": { + "issues": "https://github.com/EasyEngine/mailhog-command/issues", + "source": "https://github.com/EasyEngine/mailhog-command/tree/master" + }, "time": "2018-12-28T16:05:53+00:00" }, { @@ -790,6 +938,10 @@ ], "description": "Command to manager global containers/services in EasyEngine", "homepage": "https://github.com/easyengine/service-command", + "support": { + "issues": "https://github.com/EasyEngine/service-command/issues", + "source": "https://github.com/EasyEngine/service-command/tree/master" + }, "time": "2020-08-11T10:19:09+00:00" }, { @@ -830,6 +982,10 @@ ], "description": "Shell to run helpful commands inside containers.", "homepage": "https://github.com/easyengine/shell-command", + "support": { + "issues": "https://github.com/EasyEngine/shell-command/issues", + "source": "https://github.com/EasyEngine/shell-command/tree/master" + }, "time": "2019-03-18T13:42:13+00:00" }, { @@ -893,6 +1049,10 @@ "MIT" ], "homepage": "https://github.com/easyengine/site-command", + "support": { + "issues": "https://github.com/EasyEngine/site-command/issues", + "source": "https://github.com/EasyEngine/site-command/tree/v2.6.2" + }, "time": "2020-08-20T09:17:14+00:00" }, { @@ -948,6 +1108,10 @@ ], "description": "EasyEngine package for PHP site creation.", "homepage": "https://github.com/easyengine/site-type-php", + "support": { + "issues": "https://github.com/EasyEngine/site-type-php/issues", + "source": "https://github.com/EasyEngine/site-type-php/tree/v1.3.1" + }, "time": "2020-08-20T09:15:47+00:00" }, { @@ -1003,6 +1167,10 @@ ], "description": "EasyEngine site type package for WordPress site creation.", "homepage": "https://github.com/easyengine/site-type-wp", + "support": { + "issues": "https://github.com/EasyEngine/site-type-wp/issues", + "source": "https://github.com/EasyEngine/site-type-wp/tree/v1.3.2" + }, "time": "2020-09-23T03:49:19+00:00" }, { @@ -1068,27 +1236,31 @@ "rest", "web service" ], + "support": { + "issues": "https://github.com/guzzle/guzzle/issues", + "source": "https://github.com/guzzle/guzzle/tree/master" + }, "time": "2018-04-22T15:46:56+00:00" }, { "name": "guzzlehttp/promises", - "version": "v1.3.1", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" + "reference": "60d379c243457e073cff02bc323a2a86cb355631" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", - "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "url": "https://api.github.com/repos/guzzle/promises/zipball/60d379c243457e073cff02bc323a2a86cb355631", + "reference": "60d379c243457e073cff02bc323a2a86cb355631", "shasum": "" }, "require": { - "php": ">=5.5.0" + "php": ">=5.5" }, "require-dev": { - "phpunit/phpunit": "^4.0" + "symfony/phpunit-bridge": "^4.4 || ^5.1" }, "type": "library", "extra": { @@ -1119,20 +1291,24 @@ "keywords": [ "promise" ], - "time": "2016-12-20T10:07:11+00:00" + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/1.4.0" + }, + "time": "2020-09-30T07:37:28+00:00" }, { "name": "guzzlehttp/psr7", - "version": "1.6.1", + "version": "1.7.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "239400de7a173fe9901b9ac7c06497751f00727a" + "reference": "53330f47520498c0ae1f61f7e2c90f55690c06a3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/239400de7a173fe9901b9ac7c06497751f00727a", - "reference": "239400de7a173fe9901b9ac7c06497751f00727a", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/53330f47520498c0ae1f61f7e2c90f55690c06a3", + "reference": "53330f47520498c0ae1f61f7e2c90f55690c06a3", "shasum": "" }, "require": { @@ -1145,15 +1321,15 @@ }, "require-dev": { "ext-zlib": "*", - "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10" }, "suggest": { - "zendframework/zend-httphandlerrunner": "Emit PSR-7 responses" + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6-dev" + "dev-master": "1.7-dev" } }, "autoload": { @@ -1190,7 +1366,11 @@ "uri", "url" ], - "time": "2019-07-01T23:21:34+00:00" + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/1.7.0" + }, + "time": "2020-09-30T07:37:11+00:00" }, { "name": "justinrainbow/json-schema", @@ -1256,6 +1436,10 @@ "json", "schema" ], + "support": { + "issues": "https://github.com/justinrainbow/json-schema/issues", + "source": "https://github.com/justinrainbow/json-schema/tree/5.x.x" + }, "time": "2018-02-14T22:26:30+00:00" }, { @@ -1340,6 +1524,10 @@ "sftp", "storage" ], + "support": { + "issues": "https://github.com/thephpleague/flysystem/issues", + "source": "https://github.com/thephpleague/flysystem/tree/master" + }, "time": "2018-11-23T23:41:29+00:00" }, { @@ -1418,6 +1606,10 @@ "logging", "psr-3" ], + "support": { + "issues": "https://github.com/Seldaek/monolog/issues", + "source": "https://github.com/Seldaek/monolog/tree/1.24.0" + }, "time": "2018-11-05T09:00:11+00:00" }, { @@ -1464,6 +1656,10 @@ "mustache", "templating" ], + "support": { + "issues": "https://github.com/bobthecow/mustache.php/issues", + "source": "https://github.com/bobthecow/mustache.php/tree/dev" + }, "time": "2017-07-11T12:54:05+00:00" }, { @@ -1513,6 +1709,10 @@ "container-interop", "psr" ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/master" + }, "time": "2017-02-14T16:28:37+00:00" }, { @@ -1563,6 +1763,9 @@ "request", "response" ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/master" + }, "time": "2016-08-06T14:39:51+00:00" }, { @@ -1610,6 +1813,9 @@ "psr", "psr-3" ], + "support": { + "source": "https://github.com/php-fig/log/tree/1.1.3" + }, "time": "2020-03-23T09:12:05+00:00" }, { @@ -1650,6 +1856,10 @@ } ], "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, "time": "2019-03-08T08:55:37+00:00" }, { @@ -1699,6 +1909,10 @@ "iri", "sockets" ], + "support": { + "issues": "https://github.com/rmccue/Requests/issues", + "source": "https://github.com/rmccue/Requests/tree/master" + }, "time": "2016-10-13T00:11:37+00:00" }, { @@ -1748,6 +1962,20 @@ "parser", "validator" ], + "support": { + "issues": "https://github.com/Seldaek/jsonlint/issues", + "source": "https://github.com/Seldaek/jsonlint/tree/master" + }, + "funding": [ + { + "url": "https://github.com/Seldaek", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/seld/jsonlint", + "type": "tidelift" + } + ], "time": "2020-08-25T06:56:57+00:00" }, { @@ -1792,6 +2020,10 @@ "keywords": [ "phar" ], + "support": { + "issues": "https://github.com/Seldaek/phar-utils/issues", + "source": "https://github.com/Seldaek/phar-utils/tree/master" + }, "time": "2020-07-07T18:42:57+00:00" }, { @@ -1856,6 +2088,9 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/config/tree/3.4" + }, "time": "2018-10-31T09:06:03+00:00" }, { @@ -1925,6 +2160,9 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/console/tree/3.4" + }, "time": "2018-10-30T16:50:50+00:00" }, { @@ -1981,6 +2219,9 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/debug/tree/3.4" + }, "time": "2018-10-31T09:06:03+00:00" }, { @@ -2052,6 +2293,9 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/dependency-injection/tree/v3.4.27" + }, "time": "2019-04-20T15:32:49+00:00" }, { @@ -2115,6 +2359,9 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/event-dispatcher/tree/3.4" + }, "time": "2018-10-30T16:50:50+00:00" }, { @@ -2165,6 +2412,9 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/filesystem/tree/3.4" + }, "time": "2018-10-02T12:28:39+00:00" }, { @@ -2214,24 +2464,27 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/3.4" + }, "time": "2018-10-03T08:46:40+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.18.1", + "version": "v1.20.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "1c302646f6efc070cd46856e600e5e0684d6b454" + "reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/1c302646f6efc070cd46856e600e5e0684d6b454", - "reference": "1c302646f6efc070cd46856e600e5e0684d6b454", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f4ba089a5b6366e453971d3aad5fe8e897b37f41", + "reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.1" }, "suggest": { "ext-ctype": "For best performance" @@ -2239,7 +2492,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.18-dev" + "dev-main": "1.20-dev" }, "thanks": { "name": "symfony/polyfill", @@ -2276,24 +2529,41 @@ "polyfill", "portable" ], - "time": "2020-07-14T12:35:20+00:00" + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.20.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": "2020-10-23T14:02:19+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.18.1", + "version": "v1.20.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a" + "reference": "39d483bdf39be819deabf04ec872eb0b2410b531" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/a6977d63bf9a0ad4c65cd352709e230876f9904a", - "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/39d483bdf39be819deabf04ec872eb0b2410b531", + "reference": "39d483bdf39be819deabf04ec872eb0b2410b531", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.1" }, "suggest": { "ext-mbstring": "For best performance" @@ -2301,7 +2571,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.18-dev" + "dev-main": "1.20-dev" }, "thanks": { "name": "symfony/polyfill", @@ -2339,7 +2609,24 @@ "portable", "shim" ], - "time": "2020-07-14T12:35:20+00:00" + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.20.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": "2020-10-23T14:02:19+00:00" }, { "name": "symfony/process", @@ -2388,6 +2675,9 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/process/tree/3.4" + }, "time": "2018-10-14T17:33:21+00:00" }, { @@ -2467,6 +2757,9 @@ ], "description": "Symfony Serializer Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/serializer/tree/3.4" + }, "time": "2018-12-02T13:20:19+00:00" }, { @@ -2535,6 +2828,9 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/translation/tree/3.4" + }, "time": "2018-10-02T16:33:53+00:00" }, { @@ -2594,6 +2890,9 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/yaml/tree/3.4" + }, "time": "2018-10-02T16:33:53+00:00" }, { @@ -2644,49 +2943,11 @@ "check", "validate" ], - "time": "2018-01-29T19:49:41+00:00" - }, - { - "name": "wp-cli/autoload-splitter", - "version": "v0.1.5", - "source": { - "type": "git", - "url": "https://github.com/wp-cli/autoload-splitter.git", - "reference": "fb4302da26390811d2631c62b42b75976d224bb8" + "support": { + "issues": "https://github.com/webmozart/assert/issues", + "source": "https://github.com/webmozart/assert/tree/master" }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/wp-cli/autoload-splitter/zipball/fb4302da26390811d2631c62b42b75976d224bb8", - "reference": "fb4302da26390811d2631c62b42b75976d224bb8", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.1" - }, - "type": "composer-plugin", - "extra": { - "class": "WP_CLI\\AutoloadSplitter\\ComposerPlugin" - }, - "autoload": { - "psr-4": { - "WP_CLI\\AutoloadSplitter\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Alain Schlesser", - "email": "alain.schlesser@gmail.com", - "homepage": "https://www.alainschlesser.com" - } - ], - "description": "Composer plugin for splitting a generated autoloader into two distinct parts.", - "homepage": "https://wp-cli.org", - "abandoned": true, - "time": "2017-08-03T08:40:16+00:00" + "time": "2018-01-29T19:49:41+00:00" }, { "name": "wp-cli/mustangostang-spyc", @@ -2734,6 +2995,9 @@ ], "description": "A simple YAML loader/dumper class for PHP (WP-CLI fork)", "homepage": "https://github.com/mustangostang/spyc/", + "support": { + "source": "https://github.com/wp-cli/spyc/tree/autoload" + }, "time": "2017-04-25T11:26:20+00:00" }, { @@ -2784,6 +3048,10 @@ "cli", "console" ], + "support": { + "issues": "https://github.com/wp-cli/php-cli-tools/issues", + "source": "https://github.com/wp-cli/php-cli-tools/tree/master" + }, "time": "2018-08-22T10:11:06+00:00" } ], @@ -2869,6 +3137,10 @@ "symfony", "testing" ], + "support": { + "issues": "https://github.com/Behat/Behat/issues", + "source": "https://github.com/Behat/Behat/tree/v3.4.3" + }, "time": "2017-11-27T10:37:56+00:00" }, { @@ -2928,6 +3200,10 @@ "gherkin", "parser" ], + "support": { + "issues": "https://github.com/Behat/Gherkin/issues", + "source": "https://github.com/Behat/Gherkin/tree/master" + }, "time": "2020-03-17T14:03:26+00:00" }, { @@ -2973,6 +3249,10 @@ "slug", "transliterator" ], + "support": { + "issues": "https://github.com/Behat/Transliterator/issues", + "source": "https://github.com/Behat/Transliterator/tree/v1.3.0" + }, "time": "2020-01-14T16:39:13+00:00" }, { @@ -3004,34 +3284,36 @@ ], "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", "homepage": "https://github.com/container-interop/container-interop", + "support": { + "issues": "https://github.com/container-interop/container-interop/issues", + "source": "https://github.com/container-interop/container-interop/tree/master" + }, "abandoned": "psr/container", "time": "2017-02-14T19:40:03+00:00" }, { "name": "dealerdirect/phpcodesniffer-composer-installer", - "version": "v0.4.4", + "version": "v0.7.0", "source": { "type": "git", "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", - "reference": "2e41850d5f7797cbb1af7b030d245b3b24e63a08" + "reference": "e8d808670b8f882188368faaf1144448c169c0b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/2e41850d5f7797cbb1af7b030d245b3b24e63a08", - "reference": "2e41850d5f7797cbb1af7b030d245b3b24e63a08", + "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/e8d808670b8f882188368faaf1144448c169c0b7", + "reference": "e8d808670b8f882188368faaf1144448c169c0b7", "shasum": "" }, "require": { - "composer-plugin-api": "^1.0", - "php": "^5.3|^7", - "squizlabs/php_codesniffer": "*" + "composer-plugin-api": "^1.0 || ^2.0", + "php": ">=5.3", + "squizlabs/php_codesniffer": "^2 || ^3 || 4.0.x-dev" }, "require-dev": { "composer/composer": "*", - "wimg/php-compatibility": "^8.0" - }, - "suggest": { - "dealerdirect/qa-tools": "All the PHP QA tools you'll need" + "phpcompatibility/php-compatibility": "^9.0", + "sensiolabs/security-checker": "^4.1.0" }, "type": "composer-plugin", "extra": { @@ -3049,13 +3331,13 @@ "authors": [ { "name": "Franck Nijhof", - "email": "f.nijhof@dealerdirect.nl", - "homepage": "http://workingatdealerdirect.eu", - "role": "Developer" + "email": "franck.nijhof@dealerdirect.com", + "homepage": "http://www.frenck.nl", + "role": "Developer / IT Manager" } ], "description": "PHP_CodeSniffer Standards Composer Installer Plugin", - "homepage": "http://workingatdealerdirect.eu", + "homepage": "http://www.dealerdirect.com", "keywords": [ "PHPCodeSniffer", "PHP_CodeSniffer", @@ -3073,7 +3355,11 @@ "stylecheck", "tests" ], - "time": "2017-12-06T16:27:17+00:00" + "support": { + "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues", + "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer" + }, + "time": "2020-06-25T14:57:39+00:00" }, { "name": "phpunit/php-code-coverage", @@ -3134,6 +3420,11 @@ "testing", "xunit" ], + "support": { + "irc": "irc://irc.freenode.net/phpunit", + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/1.2.18" + }, "time": "2014-09-02T10:13:14+00:00" }, { @@ -3184,6 +3475,10 @@ "filesystem", "iterator" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/2.0.2" + }, "time": "2018-09-13T20:33:42+00:00" }, { @@ -3225,6 +3520,10 @@ "keywords": [ "template" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/1.2.1" + }, "time": "2015-06-21T13:50:34+00:00" }, { @@ -3274,6 +3573,10 @@ "keywords": [ "timer" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/master" + }, "time": "2017-02-26T11:10:40+00:00" }, { @@ -3324,6 +3627,11 @@ "keywords": [ "tokenizer" ], + "support": { + "irc": "irc://irc.freenode.net/phpunit", + "issues": "https://github.com/sebastianbergmann/php-token-stream/issues", + "source": "https://github.com/sebastianbergmann/php-token-stream/tree/1.2.2" + }, "abandoned": true, "time": "2014-03-03T05:10:30+00:00" }, @@ -3399,6 +3707,11 @@ "testing", "xunit" ], + "support": { + "irc": "irc://irc.freenode.net/phpunit", + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "source": "https://github.com/sebastianbergmann/phpunit/tree/3.7.18" + }, "time": "2013-03-07T21:45:39+00:00" }, { @@ -3448,6 +3761,11 @@ "mock", "xunit" ], + "support": { + "irc": "irc://irc.freenode.net/phpunit", + "issues": "https://github.com/sebastianbergmann/phpunit-mock-objects/issues", + "source": "https://github.com/sebastianbergmann/phpunit-mock-objects/tree/1.2.3" + }, "abandoned": true, "time": "2013-01-13T10:24:48+00:00" }, @@ -3457,12 +3775,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "81cb95735a719403eddb77fc78e21362b56d9ea9" + "reference": "327370943772f9917bc2dc2aa4263db2d572a112" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/81cb95735a719403eddb77fc78e21362b56d9ea9", - "reference": "81cb95735a719403eddb77fc78e21362b56d9ea9", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/327370943772f9917bc2dc2aa4263db2d572a112", + "reference": "327370943772f9917bc2dc2aa4263db2d572a112", "shasum": "" }, "conflict": { @@ -3492,7 +3810,7 @@ "composer/composer": "<=1-alpha.11", "contao-components/mediaelement": ">=2.14.2,<2.21.1", "contao/core": ">=2,<3.5.39", - "contao/core-bundle": ">=4,<4.4.46|>=4.5,<4.8.6", + "contao/core-bundle": ">=4,<4.4.52|>=4.5,<4.9.6|= 4.10.0", "contao/listing-bundle": ">=4,<4.4.8", "datadog/dd-trace": ">=0.30,<0.30.2", "david-garcia/phpwhois": "<=4.3.1", @@ -3522,7 +3840,7 @@ "ezsystems/ezplatform-kernel": ">=1,<1.0.2.1", "ezsystems/ezplatform-user": ">=1,<1.0.1", "ezsystems/ezpublish-kernel": ">=5.3,<5.3.12.1|>=5.4,<5.4.14.2|>=6,<6.7.9.1|>=6.8,<6.13.6.3|>=7,<7.2.4.1|>=7.3,<7.3.2.1|>=7.5,<7.5.7.1", - "ezsystems/ezpublish-legacy": ">=5.3,<5.3.12.6|>=5.4,<5.4.14.1|>=2011,<2017.12.7.2|>=2018.6,<2018.6.1.4|>=2018.9,<2018.9.1.3|>=2019.3,<2019.3.4.2", + "ezsystems/ezpublish-legacy": ">=5.3,<5.3.12.6|>=5.4,<5.4.14.2|>=2011,<2017.12.7.3|>=2018.6,<2018.6.1.4|>=2018.9,<2018.9.1.3|>=2019.3,<2019.3.5.1", "ezsystems/platform-ui-assets-bundle": ">=4.2,<4.2.3", "ezsystems/repository-forms": ">=2.3,<2.3.2.1", "ezyang/htmlpurifier": "<4.1.1", @@ -3556,14 +3874,18 @@ "laravel/socialite": ">=1,<1.0.99|>=2,<2.0.10", "league/commonmark": "<0.18.3", "librenms/librenms": "<1.53", + "livewire/livewire": ">2.2.4,<2.2.6", "magento/community-edition": ">=2,<2.2.10|>=2.3,<2.3.3", "magento/magento1ce": "<1.9.4.3", "magento/magento1ee": ">=1,<1.14.4.3", "magento/product-community-edition": ">=2,<2.2.10|>=2.3,<2.3.2-p.2", "marcwillmann/turn": "<0.3.3", + "mediawiki/core": ">=1.31,<1.31.4|>=1.32,<1.32.4|>=1.33,<1.33.1", "mittwald/typo3_forum": "<1.2.1", "monolog/monolog": ">=1.8,<1.12", "namshi/jose": "<2.2", + "nette/application": ">=2,<2.0.19|>=2.1,<2.1.13|>=2.2,<2.2.10|>=2.3,<2.3.14|>=2.4,<2.4.16|>=3,<3.0.6", + "nette/nette": ">=2,<2.0.19|>=2.1,<2.1.13", "nystudio107/craft-seomatic": "<3.3", "nzo/url-encryptor-bundle": ">=4,<4.3.2|>=5,<5.0.1", "october/backend": ">=1.0.319,<1.0.467", @@ -3599,6 +3921,7 @@ "privatebin/privatebin": "<1.2.2|>=1.3,<1.3.2", "propel/propel": ">=2-alpha.1,<=2-alpha.7", "propel/propel1": ">=1,<=1.7.1", + "pterodactyl/panel": "<0.7.19|>=1-rc.0,<=1-rc.6", "pusher/pusher-php-server": "<2.2.1", "rainlab/debugbar-plugin": "<3.1", "robrichards/xmlseclibs": "<3.0.4", @@ -3607,6 +3930,8 @@ "scheb/two-factor-bundle": ">=0,<3.26|>=4,<4.11", "sensiolabs/connect": "<4.2.3", "serluck/phpwhois": "<=4.2.6", + "shopware/core": "<=6.3.1", + "shopware/platform": "<=6.3.1", "shopware/shopware": "<5.3.7", "silverstripe/admin": ">=1.0.3,<1.0.4|>=1.1,<1.1.1", "silverstripe/assets": ">=1,<1.4.7|>=1.5,<1.5.2", @@ -3682,6 +4007,7 @@ "typo3/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.10|>=3.1,<3.1.7|>=3.2,<3.2.7|>=3.3,<3.3.5", "typo3/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4", "typo3/phar-stream-wrapper": ">=1,<2.1.1|>=3,<3.1.1", + "typo3fluid/fluid": ">=2,<2.0.5|>=2.1,<2.1.4|>=2.2,<2.2.1|>=2.3,<2.3.5|>=2.4,<2.4.1|>=2.5,<2.5.5|>=2.6,<2.6.1", "ua-parser/uap-php": "<3.8", "usmanhalalit/pixie": "<1.0.3|>=2,<2.0.2", "verot/class.upload.php": "<=1.0.3|>=2,<=2.0.4", @@ -3741,20 +4067,34 @@ } ], "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", - "time": "2020-09-18T13:01:53+00:00" + "support": { + "issues": "https://github.com/Roave/SecurityAdvisories/issues", + "source": "https://github.com/Roave/SecurityAdvisories/tree/latest" + }, + "funding": [ + { + "url": "https://github.com/Ocramius", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/roave/security-advisories", + "type": "tidelift" + } + ], + "time": "2020-10-19T07:02:45+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.5.6", + "version": "3.5.8", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "e97627871a7eab2f70e59166072a6b767d5834e0" + "reference": "9d583721a7157ee997f235f327de038e7ea6dac4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/e97627871a7eab2f70e59166072a6b767d5834e0", - "reference": "e97627871a7eab2f70e59166072a6b767d5834e0", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/9d583721a7157ee997f235f327de038e7ea6dac4", + "reference": "9d583721a7157ee997f235f327de038e7ea6dac4", "shasum": "" }, "require": { @@ -3792,20 +4132,25 @@ "phpcs", "standards" ], - "time": "2020-08-10T04:50:15+00:00" + "support": { + "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", + "source": "https://github.com/squizlabs/PHP_CodeSniffer", + "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + }, + "time": "2020-10-23T02:01:07+00:00" }, { "name": "symfony/class-loader", - "version": "v3.4.44", + "version": "v3.4.46", "source": { "type": "git", "url": "https://github.com/symfony/class-loader.git", - "reference": "04a7e4c1bf7f156f3d9df930401eb2c6fe51fc72" + "reference": "a22265a9f3511c0212bf79f54910ca5a77c0e92c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/class-loader/zipball/04a7e4c1bf7f156f3d9df930401eb2c6fe51fc72", - "reference": "04a7e4c1bf7f156f3d9df930401eb2c6fe51fc72", + "url": "https://api.github.com/repos/symfony/class-loader/zipball/a22265a9f3511c0212bf79f54910ca5a77c0e92c", + "reference": "a22265a9f3511c0212bf79f54910ca5a77c0e92c", "shasum": "" }, "require": { @@ -3819,11 +4164,6 @@ "symfony/polyfill-apcu": "For using ApcClassLoader on HHVM" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\ClassLoader\\": "" @@ -3848,7 +4188,24 @@ ], "description": "Symfony ClassLoader Component", "homepage": "https://symfony.com", - "time": "2020-08-09T11:28:08+00:00" + "support": { + "source": "https://github.com/symfony/class-loader/tree/v3.4.46" + }, + "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": "2020-10-24T10:57:07+00:00" }, { "name": "wimg/php-compatibility", @@ -3901,6 +4258,10 @@ "phpcs", "standards" ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", + "source": "https://github.com/PHPCompatibility/PHPCompatibility" + }, "abandoned": "phpcompatibility/php-compatibility", "time": "2018-07-17T13:42:26+00:00" }, @@ -3942,12 +4303,18 @@ "standards", "wordpress" ], + "support": { + "issues": "https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/issues", + "source": "https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards", + "wiki": "https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki" + }, "time": "2017-08-05T16:08:58+00:00" } ], "aliases": [], "minimum-stability": "dev", "stability-flags": { + "easyengine/autoload-splitter": 20, "roave/security-advisories": 20 }, "prefer-stable": true, @@ -3958,5 +4325,6 @@ "platform-dev": [], "platform-overrides": { "php": "7.1" - } + }, + "plugin-api-version": "2.0.0" } From 51938e141d9301731b0de23f623cb83f1327a9c3 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 29 Oct 2020 18:48:16 +0530 Subject: [PATCH 0746/1044] Bump easyengine/autoload-splitter to v1.0.0 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 2 +- composer.lock | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index bcb919a13..0c420be8d 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,7 @@ "composer/semver": "1.4.2", "easyengine/admin-tools-command": "v1.0.10", "easyengine/auth-command": "v1.0.4", - "easyengine/autoload-splitter": "dev-master", + "easyengine/autoload-splitter": "v1.0.0", "easyengine/config-command": "v1.0.2", "easyengine/cron-command": "v1.0.2", "easyengine/log-command": "v1.0.1", diff --git a/composer.lock b/composer.lock index af7638f82..fa49b363e 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": "c402efbe153196894309544411b6d246", + "content-hash": "f910a607d4732fe6c5cc1491d8efdc71", "packages": [ { "name": "acmephp/core", @@ -664,7 +664,7 @@ }, { "name": "easyengine/autoload-splitter", - "version": "dev-master", + "version": "v1.0.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/autoload-splitter.git", @@ -679,7 +679,6 @@ "require": { "composer-plugin-api": "^1.1 || ^2.0" }, - "default-branch": true, "type": "composer-plugin", "extra": { "class": "WP_CLI\\AutoloadSplitter\\ComposerPlugin" @@ -4314,7 +4313,6 @@ "aliases": [], "minimum-stability": "dev", "stability-flags": { - "easyengine/autoload-splitter": 20, "roave/security-advisories": 20 }, "prefer-stable": true, From 2cccc2019a279dbc4dbea626427a767b372c2855 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Fri, 30 Oct 2020 10:47:34 +0530 Subject: [PATCH 0747/1044] Update PHP version and modules to install Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- ci/test-env-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/test-env-install.sh b/ci/test-env-install.sh index 19054439d..3c17a3022 100755 --- a/ci/test-env-install.sh +++ b/ci/test-env-install.sh @@ -7,9 +7,9 @@ function setup_test_requirements() { add-apt-repository -y ppa:ondrej/php apt-get update # Installing php-cli, which is the minimum requirement to run EasyEngine - apt-get -y install php7.2-cli + apt-get -y install php7.3-cli - php_modules=( pcntl curl sqlite3 ) + php_modules=( pcntl curl sqlite3 zip ) if command -v php > /dev/null 2>&1; then # Reading the php version. default_php_version="$(readlink -f /usr/bin/php | gawk -F "php" '{ print $2}')" From e25beed29c66b8c946a4f4e852eea69b645f350d Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Fri, 30 Oct 2020 11:18:39 +0530 Subject: [PATCH 0748/1044] Correct custom file format --- php/EE/Runner.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 11e8b125f..933892c99 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -56,7 +56,7 @@ private function init_ee() { define( 'DB', EE_ROOT_DIR . '/db/ee.sqlite' ); define( 'LOCALHOST_IP', '127.0.0.1' ); - define( 'SITE_CUSTOM_DOCKER_COMPOSE', 'docker-compose.custom.yml' ); + define( 'SITE_CUSTOM_DOCKER_COMPOSE', 'docker-compose-custom.yml' ); $db_dir = dirname( DB ); if ( ! is_dir( $db_dir ) ) { From de1ad855d1c366da3545c14e576af4ad0ebc6020 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Fri, 30 Oct 2020 11:52:50 +0530 Subject: [PATCH 0749/1044] Remove lock file --- composer.lock | 4379 ------------------------------------------------- 1 file changed, 4379 deletions(-) delete mode 100644 composer.lock diff --git a/composer.lock b/composer.lock deleted file mode 100644 index 30d49cdef..000000000 --- a/composer.lock +++ /dev/null @@ -1,4379 +0,0 @@ -{ - "_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": "f910a607d4732fe6c5cc1491d8efdc71", - "packages": [ - { - "name": "acmephp/core", - "version": "1.2.0", - "source": { - "type": "git", - "url": "https://github.com/acmephp/core.git", - "reference": "b038d61f06f3cb1e81a1a3cbe63eae42d9d3d3ca" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/acmephp/core/zipball/b038d61f06f3cb1e81a1a3cbe63eae42d9d3d3ca", - "reference": "b038d61f06f3cb1e81a1a3cbe63eae42d9d3d3ca", - "shasum": "" - }, - "require": { - "acmephp/ssl": "^1.0", - "ext-hash": "*", - "ext-json": "*", - "ext-openssl": "*", - "guzzlehttp/guzzle": "^6.0", - "guzzlehttp/psr7": "^1.0", - "php": ">=5.5.0", - "psr/http-message": "^1.0", - "psr/log": "^1.0", - "webmozart/assert": "^1.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.22", - "symfony/process": "^3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "AcmePhp\\Core\\": "." - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Titouan Galopin", - "email": "galopintitouan@gmail.com", - "homepage": "http://titouangalopin.com" - }, - { - "name": "Jérémy Derussé", - "homepage": "https://twitter.com/jderusse" - } - ], - "description": "Raw implementation of the ACME protocol in PHP", - "homepage": "https://github.com/acmephp/core", - "keywords": [ - "acmephp", - "certificate", - "csr", - "encryption", - "https", - "letsencrypt", - "openssl", - "ssl", - "x509" - ], - "support": { - "source": "https://github.com/acmephp/core/tree/1.2.0" - }, - "time": "2019-12-17T11:28:20+00:00" - }, - { - "name": "acmephp/ssl", - "version": "1.2.0", - "source": { - "type": "git", - "url": "https://github.com/acmephp/ssl.git", - "reference": "7b144f9b9b2d6a42065001f784def28b1b2b1f32" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/acmephp/ssl/zipball/7b144f9b9b2d6a42065001f784def28b1b2b1f32", - "reference": "7b144f9b9b2d6a42065001f784def28b1b2b1f32", - "shasum": "" - }, - "require": { - "ext-hash": "*", - "ext-openssl": "*", - "lib-openssl": ">=0.9.8", - "php": ">=5.5.0", - "webmozart/assert": "^1.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.22" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "AcmePhp\\Ssl\\": "." - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Titouan Galopin", - "email": "galopintitouan@gmail.com", - "homepage": "http://titouangalopin.com" - }, - { - "name": "Jérémy Derussé", - "homepage": "https://twitter.com/jderusse" - } - ], - "description": "PHP wrapper around OpenSSL extension providing SSL encoding, decoding, parsing and signing features", - "homepage": "https://github.com/acmephp/ssl", - "keywords": [ - "ECDSA", - "acmephp", - "certificate", - "csr", - "https", - "openssl", - "rsa", - "ssl", - "x509" - ], - "support": { - "issues": "https://github.com/acmephp/ssl/issues", - "source": "https://github.com/acmephp/ssl/tree/1.2.0" - }, - "time": "2019-12-17T14:19:42+00:00" - }, - { - "name": "cloudflare/sdk", - "version": "1.1.1", - "source": { - "type": "git", - "url": "https://github.com/cloudflare/cloudflare-php.git", - "reference": "a3a346ccb2f5cb49759db3d71ba0006a10cf20ef" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/cloudflare/cloudflare-php/zipball/a3a346ccb2f5cb49759db3d71ba0006a10cf20ef", - "reference": "a3a346ccb2f5cb49759db3d71ba0006a10cf20ef", - "shasum": "" - }, - "require": { - "guzzlehttp/guzzle": "^6.2.2", - "php": ">=7.0.0", - "psr/http-message": "~1.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^2.6", - "phpmd/phpmd": "@stable", - "phpunit/phpunit": "5.7.5" - }, - "type": "library", - "autoload": { - "psr-4": { - "Cloudflare\\API\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Junade Ali", - "email": "junade@cloudflare.com" - } - ], - "description": "PHP binding for v4 of the Cloudflare Client API.", - "support": { - "issues": "https://github.com/cloudflare/cloudflare-php/issues", - "source": "https://github.com/cloudflare/cloudflare-php/tree/1.1.1" - }, - "time": "2018-08-28T14:01:57+00:00" - }, - { - "name": "composer/ca-bundle", - "version": "1.2.8", - "source": { - "type": "git", - "url": "https://github.com/composer/ca-bundle.git", - "reference": "8a7ecad675253e4654ea05505233285377405215" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/8a7ecad675253e4654ea05505233285377405215", - "reference": "8a7ecad675253e4654ea05505233285377405215", - "shasum": "" - }, - "require": { - "ext-openssl": "*", - "ext-pcre": "*", - "php": "^5.3.2 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8", - "psr/log": "^1.0", - "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\CaBundle\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", - "keywords": [ - "cabundle", - "cacert", - "certificate", - "ssl", - "tls" - ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.2.8" - }, - "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": "2020-08-23T12:54:47+00:00" - }, - { - "name": "composer/composer", - "version": "1.7.3", - "source": { - "type": "git", - "url": "https://github.com/composer/composer.git", - "reference": "e965b9aaa8854c3067f1ed2ae45f436572d73eb7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/e965b9aaa8854c3067f1ed2ae45f436572d73eb7", - "reference": "e965b9aaa8854c3067f1ed2ae45f436572d73eb7", - "shasum": "" - }, - "require": { - "composer/ca-bundle": "^1.0", - "composer/semver": "^1.0", - "composer/spdx-licenses": "^1.2", - "composer/xdebug-handler": "^1.1", - "justinrainbow/json-schema": "^3.0 || ^4.0 || ^5.0", - "php": "^5.3.2 || ^7.0", - "psr/log": "^1.0", - "seld/jsonlint": "^1.4", - "seld/phar-utils": "^1.0", - "symfony/console": "^2.7 || ^3.0 || ^4.0", - "symfony/filesystem": "^2.7 || ^3.0 || ^4.0", - "symfony/finder": "^2.7 || ^3.0 || ^4.0", - "symfony/process": "^2.7 || ^3.0 || ^4.0" - }, - "conflict": { - "symfony/console": "2.8.38" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7", - "phpunit/phpunit-mock-objects": "^2.3 || ^3.0" - }, - "suggest": { - "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages", - "ext-zip": "Enabling the zip extension allows you to unzip archives", - "ext-zlib": "Allow gzip compression of HTTP requests" - }, - "bin": [ - "bin/composer" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.7-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\": "src/Composer" - } - }, - "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" - } - ], - "description": "Composer helps you declare, manage and install dependencies of PHP projects, ensuring you have the right stack everywhere.", - "homepage": "https://getcomposer.org/", - "keywords": [ - "autoload", - "dependency", - "package" - ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/composer/issues", - "source": "https://github.com/composer/composer/tree/1.7.3" - }, - "time": "2018-11-01T09:05:06+00:00" - }, - { - "name": "composer/semver", - "version": "1.4.2", - "source": { - "type": "git", - "url": "https://github.com/composer/semver.git", - "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/c7cb9a2095a074d131b65a8a0cd294479d785573", - "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.5 || ^5.0.5", - "phpunit/phpunit-mock-objects": "2.3.0 || ^3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.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": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/1.4.2" - }, - "time": "2016-08-30T16:08:34+00:00" - }, - { - "name": "composer/spdx-licenses", - "version": "1.5.4", - "source": { - "type": "git", - "url": "https://github.com/composer/spdx-licenses.git", - "reference": "6946f785871e2314c60b4524851f3702ea4f2223" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/6946f785871e2314c60b4524851f3702ea4f2223", - "reference": "6946f785871e2314c60b4524851f3702ea4f2223", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 7" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\Spdx\\": "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": "SPDX licenses list and validation library.", - "keywords": [ - "license", - "spdx", - "validator" - ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/spdx-licenses/issues", - "source": "https://github.com/composer/spdx-licenses/tree/1.5.4" - }, - "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": "2020-07-15T15:35:07+00:00" - }, - { - "name": "composer/xdebug-handler", - "version": "1.4.4", - "source": { - "type": "git", - "url": "https://github.com/composer/xdebug-handler.git", - "reference": "6e076a124f7ee146f2487554a94b6a19a74887ba" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6e076a124f7ee146f2487554a94b6a19a74887ba", - "reference": "6e076a124f7ee146f2487554a94b6a19a74887ba", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0 || ^8.0", - "psr/log": "^1.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8" - }, - "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": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/1.4.4" - }, - "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": "2020-10-24T12:39:10+00:00" - }, - { - "name": "easyengine/admin-tools-command", - "version": "v1.0.10", - "source": { - "type": "git", - "url": "https://github.com/EasyEngine/admin-tools-command.git", - "reference": "2e298c92a2a44c29d41af63505e25ff820f03c86" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/admin-tools-command/zipball/2e298c92a2a44c29d41af63505e25ff820f03c86", - "reference": "2e298c92a2a44c29d41af63505e25ff820f03c86", - "shasum": "" - }, - "type": "ee-cli-package", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - }, - "bundled": true, - "commands": [ - "admin-tools", - "admin-tools enable", - "admin-tools disable" - ] - }, - "autoload": { - "psr-4": { - "": "src/" - }, - "files": [ - "admin-tools-command.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Command to manage admin tools for php based sites.", - "homepage": "https://github.com/easyengine/amdin-tools", - "support": { - "issues": "https://github.com/EasyEngine/admin-tools-command/issues", - "source": "https://github.com/EasyEngine/admin-tools-command/tree/master" - }, - "time": "2020-08-11T10:14:14+00:00" - }, - { - "name": "easyengine/auth-command", - "version": "v1.0.4", - "source": { - "type": "git", - "url": "https://github.com/EasyEngine/auth-command.git", - "reference": "29cc2d2d3341a32115050bf81de7acb1615cf209" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/auth-command/zipball/29cc2d2d3341a32115050bf81de7acb1615cf209", - "reference": "29cc2d2d3341a32115050bf81de7acb1615cf209", - "shasum": "" - }, - "type": "ee-cli-package", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - }, - "bundled": true, - "commands": [ - "auth", - "auth create", - "auth delete", - "auth list", - "auth update" - ] - }, - "autoload": { - "psr-4": { - "": "src/", - "\\EE\\Model\\": "src/db/" - }, - "files": [ - "src/auth-utils.php", - "src/helper/hooks.php", - "auth-command.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Configure HTTP Authentication and whitelisting for EasyEngine site", - "homepage": "https://github.com/easyengine/auth-command", - "support": { - "issues": "https://github.com/EasyEngine/auth-command/issues", - "source": "https://github.com/EasyEngine/auth-command/tree/master" - }, - "time": "2020-08-11T10:12:02+00:00" - }, - { - "name": "easyengine/autoload-splitter", - "version": "v1.0.0", - "source": { - "type": "git", - "url": "https://github.com/EasyEngine/autoload-splitter.git", - "reference": "c59a6fd3ca9a7514e47629567d69c8ada6062e7b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/autoload-splitter/zipball/c59a6fd3ca9a7514e47629567d69c8ada6062e7b", - "reference": "c59a6fd3ca9a7514e47629567d69c8ada6062e7b", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.1 || ^2.0" - }, - "type": "composer-plugin", - "extra": { - "class": "WP_CLI\\AutoloadSplitter\\ComposerPlugin" - }, - "autoload": { - "psr-4": { - "WP_CLI\\AutoloadSplitter\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Alain Schlesser", - "email": "alain.schlesser@gmail.com", - "homepage": "https://www.alainschlesser.com" - } - ], - "description": "Composer plugin for splitting a generated autoloader into two distinct parts.", - "homepage": "https://wp-cli.org", - "support": { - "issues": "https://github.com/easyengine/autoload-splitter/issues", - "source": "https://github.com/easyengine/autoload-splitter" - }, - "time": "2020-10-29T11:34:56+00:00" - }, - { - "name": "easyengine/config-command", - "version": "v1.0.2", - "source": { - "type": "git", - "url": "https://github.com/EasyEngine/config-command.git", - "reference": "b48e8cdb9456f7a6a7492415b177867f4228d3f6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/config-command/zipball/b48e8cdb9456f7a6a7492415b177867f4228d3f6", - "reference": "b48e8cdb9456f7a6a7492415b177867f4228d3f6", - "shasum": "" - }, - "type": "ee-cli-package", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - }, - "bundled": true, - "commands": [ - "config", - "config set", - "config get" - ] - }, - "autoload": { - "psr-4": { - "": "src/" - }, - "files": [ - "config-command.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Manages EasyEngine configuration", - "homepage": "https://github.com/easyengine/config-command", - "support": { - "issues": "https://github.com/EasyEngine/config-command/issues", - "source": "https://github.com/EasyEngine/config-command/tree/master" - }, - "time": "2018-12-28T16:04:46+00:00" - }, - { - "name": "easyengine/cron-command", - "version": "v1.0.2", - "source": { - "type": "git", - "url": "https://github.com/EasyEngine/cron-command.git", - "reference": "2646a15829dbce069b47a8014ec3168197e114b6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/cron-command/zipball/2646a15829dbce069b47a8014ec3168197e114b6", - "reference": "2646a15829dbce069b47a8014ec3168197e114b6", - "shasum": "" - }, - "type": "ee-cli-package", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - }, - "bundled": true, - "commands": [ - "cron", - "cron create", - "cron delete", - "cron update", - "cron list", - "cron run-now" - ] - }, - "autoload": { - "psr-4": { - "": "src/" - }, - "files": [ - "cron-command.php", - "src/helper/hooks.php", - "src/helper/utils.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Manages cron jobs in EasyEngine", - "homepage": "https://github.com/easyengine/cron-command", - "support": { - "issues": "https://github.com/EasyEngine/cron-command/issues", - "source": "https://github.com/EasyEngine/cron-command/tree/master" - }, - "time": "2018-12-28T16:05:27+00:00" - }, - { - "name": "easyengine/log-command", - "version": "v1.0.1", - "source": { - "type": "git", - "url": "https://github.com/EasyEngine/log-command.git", - "reference": "4cd0850ec40a5f4102eec2741a2b31c9a6a1125d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/log-command/zipball/4cd0850ec40a5f4102eec2741a2b31c9a6a1125d", - "reference": "4cd0850ec40a5f4102eec2741a2b31c9a6a1125d", - "shasum": "" - }, - "type": "ee-cli-package", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - }, - "bundled": true, - "commands": [ - "log show" - ] - }, - "autoload": { - "psr-4": { - "": "src/" - }, - "files": [ - "log-command.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "homepage": "https://github.com/easyengine/log-command", - "support": { - "issues": "https://github.com/EasyEngine/log-command/issues", - "source": "https://github.com/EasyEngine/log-command/tree/master" - }, - "time": "2018-12-28T16:07:01+00:00" - }, - { - "name": "easyengine/mailhog-command", - "version": "v1.0.2", - "source": { - "type": "git", - "url": "https://github.com/EasyEngine/mailhog-command.git", - "reference": "91e8b16c136a65f6c76268322d45061cc02dbb12" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/mailhog-command/zipball/91e8b16c136a65f6c76268322d45061cc02dbb12", - "reference": "91e8b16c136a65f6c76268322d45061cc02dbb12", - "shasum": "" - }, - "type": "ee-cli-package", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - }, - "bundled": true, - "commands": [ - "mailhog", - "mailhog enable", - "mailhog disable", - "mailhog status" - ] - }, - "autoload": { - "psr-4": { - "": "src/" - }, - "files": [ - "mailhog-command.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Command to manage mailhog", - "homepage": "https://github.com/easyengine/mailhog-command", - "support": { - "issues": "https://github.com/EasyEngine/mailhog-command/issues", - "source": "https://github.com/EasyEngine/mailhog-command/tree/master" - }, - "time": "2018-12-28T16:05:53+00:00" - }, - { - "name": "easyengine/service-command", - "version": "v1.1.0", - "source": { - "type": "git", - "url": "https://github.com/EasyEngine/service-command.git", - "reference": "8278b3e895e7dbb7109e90e492068650217ce997" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/8278b3e895e7dbb7109e90e492068650217ce997", - "reference": "8278b3e895e7dbb7109e90e492068650217ce997", - "shasum": "" - }, - "type": "ee-cli-package", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - }, - "bundled": true, - "commands": [ - "service", - "service enable", - "service disable", - "service restart", - "service reload" - ] - }, - "autoload": { - "psr-4": { - "": "src/" - }, - "files": [ - "src/helper/service-utils.php", - "service-command.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Command to manager global containers/services in EasyEngine", - "homepage": "https://github.com/easyengine/service-command", - "support": { - "issues": "https://github.com/EasyEngine/service-command/issues", - "source": "https://github.com/EasyEngine/service-command/tree/master" - }, - "time": "2020-08-11T10:19:09+00:00" - }, - { - "name": "easyengine/shell-command", - "version": "v1.0.3", - "source": { - "type": "git", - "url": "https://github.com/EasyEngine/shell-command.git", - "reference": "30500e3d1e8aeb3b9e9ac48b92dcbab3841e3beb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/shell-command/zipball/30500e3d1e8aeb3b9e9ac48b92dcbab3841e3beb", - "reference": "30500e3d1e8aeb3b9e9ac48b92dcbab3841e3beb", - "shasum": "" - }, - "type": "ee-cli-package", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - }, - "bundled": true, - "commands": [ - "shell" - ] - }, - "autoload": { - "psr-4": { - "": "src/" - }, - "files": [ - "shell-command.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Shell to run helpful commands inside containers.", - "homepage": "https://github.com/easyengine/shell-command", - "support": { - "issues": "https://github.com/EasyEngine/shell-command/issues", - "source": "https://github.com/EasyEngine/shell-command/tree/master" - }, - "time": "2019-03-18T13:42:13+00:00" - }, - { - "name": "easyengine/site-command", - "version": "v2.6.2", - "source": { - "type": "git", - "url": "https://github.com/EasyEngine/site-command.git", - "reference": "b5b87e8a1756ab7beef591fe86a077c301969acf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/b5b87e8a1756ab7beef591fe86a077c301969acf", - "reference": "b5b87e8a1756ab7beef591fe86a077c301969acf", - "shasum": "" - }, - "require": { - "acmephp/core": "1.2.0", - "cloudflare/sdk": "1.1.1", - "ext-openssl": "*", - "guzzlehttp/guzzle": "6.3.3", - "league/flysystem": "1.0.49", - "symfony/serializer": "3.4.20", - "webmozart/assert": "1.3.0" - }, - "type": "ee-cli-package", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - }, - "bundled": true, - "commands": [ - "site create --type=html", - "site delete", - "site update", - "site info --type=html", - "site enable", - "site disable", - "site info", - "site ssl", - "site list", - "site reload --type=html", - "site restart --type=html", - "site share", - "site clean" - ] - }, - "autoload": { - "psr-4": { - "": "src/", - "AcmePhp\\Cli\\": "AcmePhp/Cli" - }, - "files": [ - "src/helper/hooks.php", - "src/helper/site-utils.php", - "site-command.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "homepage": "https://github.com/easyengine/site-command", - "support": { - "issues": "https://github.com/EasyEngine/site-command/issues", - "source": "https://github.com/EasyEngine/site-command/tree/v2.6.2" - }, - "time": "2020-08-20T09:17:14+00:00" - }, - { - "name": "easyengine/site-type-php", - "version": "v1.3.1", - "source": { - "type": "git", - "url": "https://github.com/EasyEngine/site-type-php.git", - "reference": "9dc599a4b2569ff424ba27febabd624872af01da" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/9dc599a4b2569ff424ba27febabd624872af01da", - "reference": "9dc599a4b2569ff424ba27febabd624872af01da", - "shasum": "" - }, - "require-dev": { - "wp-cli/mustangostang-spyc": "^0.6.3" - }, - "type": "ee-cli-package", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - }, - "bundled": true, - "commands": [ - "site create --type=php", - "site delete", - "site update", - "site info --type=php", - "site enable", - "site disable", - "site info", - "site ssl", - "site list", - "site reload --type=php", - "site restart --type=php", - "site share", - "site clean" - ] - }, - "autoload": { - "psr-4": { - "": "src/" - }, - "files": [ - "site-type-php.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "EasyEngine package for PHP site creation.", - "homepage": "https://github.com/easyengine/site-type-php", - "support": { - "issues": "https://github.com/EasyEngine/site-type-php/issues", - "source": "https://github.com/EasyEngine/site-type-php/tree/v1.3.1" - }, - "time": "2020-08-20T09:15:47+00:00" - }, - { - "name": "easyengine/site-type-wp", - "version": "v1.3.2", - "source": { - "type": "git", - "url": "https://github.com/EasyEngine/site-type-wp.git", - "reference": "68903762d08ce05f2aad947229e34a9b10353dc8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/68903762d08ce05f2aad947229e34a9b10353dc8", - "reference": "68903762d08ce05f2aad947229e34a9b10353dc8", - "shasum": "" - }, - "require-dev": { - "wp-cli/mustangostang-spyc": "^0.6.3" - }, - "type": "ee-cli-package", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - }, - "bundled": true, - "commands": [ - "site create --type=wp", - "site delete", - "site update", - "site info --type=wp", - "site enable", - "site disable", - "site info", - "site ssl", - "site list", - "site reload --type=wp", - "site restart --type=wp", - "site share", - "site clean" - ] - }, - "autoload": { - "psr-4": { - "": "src/" - }, - "files": [ - "site-type-wp.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "EasyEngine site type package for WordPress site creation.", - "homepage": "https://github.com/easyengine/site-type-wp", - "support": { - "issues": "https://github.com/EasyEngine/site-type-wp/issues", - "source": "https://github.com/EasyEngine/site-type-wp/tree/v1.3.2" - }, - "time": "2020-09-23T03:49:19+00:00" - }, - { - "name": "guzzlehttp/guzzle", - "version": "6.3.3", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba", - "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba", - "shasum": "" - }, - "require": { - "guzzlehttp/promises": "^1.0", - "guzzlehttp/psr7": "^1.4", - "php": ">=5.5" - }, - "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", - "psr/log": "^1.0" - }, - "suggest": { - "psr/log": "Required for using the Log middleware" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "6.3-dev" - } - }, - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "GuzzleHttp\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle is a PHP HTTP client library", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "rest", - "web service" - ], - "support": { - "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/master" - }, - "time": "2018-04-22T15:46:56+00:00" - }, - { - "name": "guzzlehttp/promises", - "version": "1.4.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/promises.git", - "reference": "60d379c243457e073cff02bc323a2a86cb355631" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/60d379c243457e073cff02bc323a2a86cb355631", - "reference": "60d379c243457e073cff02bc323a2a86cb355631", - "shasum": "" - }, - "require": { - "php": ">=5.5" - }, - "require-dev": { - "symfony/phpunit-bridge": "^4.4 || ^5.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Promise\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle promises library", - "keywords": [ - "promise" - ], - "support": { - "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/1.4.0" - }, - "time": "2020-09-30T07:37:28+00:00" - }, - { - "name": "guzzlehttp/psr7", - "version": "1.7.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/psr7.git", - "reference": "53330f47520498c0ae1f61f7e2c90f55690c06a3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/53330f47520498c0ae1f61f7e2c90f55690c06a3", - "reference": "53330f47520498c0ae1f61f7e2c90f55690c06a3", - "shasum": "" - }, - "require": { - "php": ">=5.4.0", - "psr/http-message": "~1.0", - "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" - }, - "provide": { - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "ext-zlib": "*", - "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10" - }, - "suggest": { - "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.7-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Tobias Schultze", - "homepage": "https://github.com/Tobion" - } - ], - "description": "PSR-7 message implementation that also provides common utility methods", - "keywords": [ - "http", - "message", - "psr-7", - "request", - "response", - "stream", - "uri", - "url" - ], - "support": { - "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/1.7.0" - }, - "time": "2020-09-30T07:37:11+00:00" - }, - { - "name": "justinrainbow/json-schema", - "version": "5.2.7", - "source": { - "type": "git", - "url": "https://github.com/justinrainbow/json-schema.git", - "reference": "8560d4314577199ba51bf2032f02cd1315587c23" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/8560d4314577199ba51bf2032f02cd1315587c23", - "reference": "8560d4314577199ba51bf2032f02cd1315587c23", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^2.1", - "json-schema/json-schema-test-suite": "1.2.0", - "phpunit/phpunit": "^4.8.35" - }, - "bin": [ - "bin/validate-json" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "JsonSchema\\": "src/JsonSchema/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bruno Prieto Reis", - "email": "bruno.p.reis@gmail.com" - }, - { - "name": "Justin Rainbow", - "email": "justin.rainbow@gmail.com" - }, - { - "name": "Igor Wiedler", - "email": "igor@wiedler.ch" - }, - { - "name": "Robert Schönthal", - "email": "seroscho@googlemail.com" - } - ], - "description": "A library to validate a json schema.", - "homepage": "https://github.com/justinrainbow/json-schema", - "keywords": [ - "json", - "schema" - ], - "support": { - "issues": "https://github.com/justinrainbow/json-schema/issues", - "source": "https://github.com/justinrainbow/json-schema/tree/5.x.x" - }, - "time": "2018-02-14T22:26:30+00:00" - }, - { - "name": "league/flysystem", - "version": "1.0.49", - "source": { - "type": "git", - "url": "https://github.com/thephpleague/flysystem.git", - "reference": "a63cc83d8a931b271be45148fa39ba7156782ffd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/a63cc83d8a931b271be45148fa39ba7156782ffd", - "reference": "a63cc83d8a931b271be45148fa39ba7156782ffd", - "shasum": "" - }, - "require": { - "ext-fileinfo": "*", - "php": ">=5.5.9" - }, - "conflict": { - "league/flysystem-sftp": "<1.0.6" - }, - "require-dev": { - "phpspec/phpspec": "^3.4", - "phpunit/phpunit": "^5.7.10" - }, - "suggest": { - "ext-fileinfo": "Required for MimeType", - "ext-ftp": "Allows you to use FTP server storage", - "ext-openssl": "Allows you to use FTPS server storage", - "league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2", - "league/flysystem-aws-s3-v3": "Allows you to use S3 storage with AWS SDK v3", - "league/flysystem-azure": "Allows you to use Windows Azure Blob storage", - "league/flysystem-cached-adapter": "Flysystem adapter decorator for metadata caching", - "league/flysystem-eventable-filesystem": "Allows you to use EventableFilesystem", - "league/flysystem-rackspace": "Allows you to use Rackspace Cloud Files", - "league/flysystem-sftp": "Allows you to use SFTP server storage via phpseclib", - "league/flysystem-webdav": "Allows you to use WebDAV storage", - "league/flysystem-ziparchive": "Allows you to use ZipArchive adapter", - "spatie/flysystem-dropbox": "Allows you to use Dropbox storage", - "srmklive/flysystem-dropbox-v2": "Allows you to use Dropbox storage for PHP 5 applications" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "psr-4": { - "League\\Flysystem\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Frank de Jonge", - "email": "info@frenky.net" - } - ], - "description": "Filesystem abstraction: Many filesystems, one API.", - "keywords": [ - "Cloud Files", - "WebDAV", - "abstraction", - "aws", - "cloud", - "copy.com", - "dropbox", - "file systems", - "files", - "filesystem", - "filesystems", - "ftp", - "rackspace", - "remote", - "s3", - "sftp", - "storage" - ], - "support": { - "issues": "https://github.com/thephpleague/flysystem/issues", - "source": "https://github.com/thephpleague/flysystem/tree/master" - }, - "time": "2018-11-23T23:41:29+00:00" - }, - { - "name": "monolog/monolog", - "version": "1.24.0", - "source": { - "type": "git", - "url": "https://github.com/Seldaek/monolog.git", - "reference": "bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266", - "reference": "bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266", - "shasum": "" - }, - "require": { - "php": ">=5.3.0", - "psr/log": "~1.0" - }, - "provide": { - "psr/log-implementation": "1.0.0" - }, - "require-dev": { - "aws/aws-sdk-php": "^2.4.9 || ^3.0", - "doctrine/couchdb": "~1.0@dev", - "graylog2/gelf-php": "~1.0", - "jakub-onderka/php-parallel-lint": "0.9", - "php-amqplib/php-amqplib": "~2.4", - "php-console/php-console": "^3.1.3", - "phpunit/phpunit": "~4.5", - "phpunit/phpunit-mock-objects": "2.3.0", - "ruflin/elastica": ">=0.90 <3.0", - "sentry/sentry": "^0.13", - "swiftmailer/swiftmailer": "^5.3|^6.0" - }, - "suggest": { - "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", - "doctrine/couchdb": "Allow sending log messages to a CouchDB server", - "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", - "ext-mongo": "Allow sending log messages to a MongoDB server", - "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", - "mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver", - "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", - "php-console/php-console": "Allow sending log messages to Google Chrome", - "rollbar/rollbar": "Allow sending log messages to Rollbar", - "ruflin/elastica": "Allow sending log messages to an Elastic Search server", - "sentry/sentry": "Allow sending log messages to a Sentry server" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Monolog\\": "src/Monolog" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "Sends your logs to files, sockets, inboxes, databases and various web services", - "homepage": "http://github.com/Seldaek/monolog", - "keywords": [ - "log", - "logging", - "psr-3" - ], - "support": { - "issues": "https://github.com/Seldaek/monolog/issues", - "source": "https://github.com/Seldaek/monolog/tree/1.24.0" - }, - "time": "2018-11-05T09:00:11+00:00" - }, - { - "name": "mustache/mustache", - "version": "v2.12.0", - "source": { - "type": "git", - "url": "https://github.com/bobthecow/mustache.php.git", - "reference": "fe8fe72e9d580591854de404cc59a1b83ca4d19e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/bobthecow/mustache.php/zipball/fe8fe72e9d580591854de404cc59a1b83ca4d19e", - "reference": "fe8fe72e9d580591854de404cc59a1b83ca4d19e", - "shasum": "" - }, - "require": { - "php": ">=5.2.4" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "~1.11", - "phpunit/phpunit": "~3.7|~4.0|~5.0" - }, - "type": "library", - "autoload": { - "psr-0": { - "Mustache": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Justin Hileman", - "email": "justin@justinhileman.info", - "homepage": "http://justinhileman.com" - } - ], - "description": "A Mustache implementation in PHP.", - "homepage": "https://github.com/bobthecow/mustache.php", - "keywords": [ - "mustache", - "templating" - ], - "support": { - "issues": "https://github.com/bobthecow/mustache.php/issues", - "source": "https://github.com/bobthecow/mustache.php/tree/dev" - }, - "time": "2017-07-11T12:54:05+00:00" - }, - { - "name": "psr/container", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://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/master" - }, - "time": "2017-02-14T16:28:37+00:00" - }, - { - "name": "psr/http-message", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP messages", - "homepage": "https://github.com/php-fig/http-message", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ], - "support": { - "source": "https://github.com/php-fig/http-message/tree/master" - }, - "time": "2016-08-06T14:39:51+00:00" - }, - { - "name": "psr/log", - "version": "1.1.3", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Log\\": "Psr/Log/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://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/1.1.3" - }, - "time": "2020-03-23T09:12:05+00:00" - }, - { - "name": "ralouphie/getallheaders", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/ralouphie/getallheaders.git", - "reference": "120b605dfeb996808c31b6477290a714d356e822" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", - "reference": "120b605dfeb996808c31b6477290a714d356e822", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "require-dev": { - "php-coveralls/php-coveralls": "^2.1", - "phpunit/phpunit": "^5 || ^6.5" - }, - "type": "library", - "autoload": { - "files": [ - "src/getallheaders.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ralph Khattar", - "email": "ralph.khattar@gmail.com" - } - ], - "description": "A polyfill for getallheaders.", - "support": { - "issues": "https://github.com/ralouphie/getallheaders/issues", - "source": "https://github.com/ralouphie/getallheaders/tree/develop" - }, - "time": "2019-03-08T08:55:37+00:00" - }, - { - "name": "rmccue/requests", - "version": "v1.7.0", - "source": { - "type": "git", - "url": "https://github.com/rmccue/Requests.git", - "reference": "87932f52ffad70504d93f04f15690cf16a089546" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/rmccue/Requests/zipball/87932f52ffad70504d93f04f15690cf16a089546", - "reference": "87932f52ffad70504d93f04f15690cf16a089546", - "shasum": "" - }, - "require": { - "php": ">=5.2" - }, - "require-dev": { - "requests/test-server": "dev-master" - }, - "type": "library", - "autoload": { - "psr-0": { - "Requests": "library/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "ISC" - ], - "authors": [ - { - "name": "Ryan McCue", - "homepage": "http://ryanmccue.info" - } - ], - "description": "A HTTP library written in PHP, for human beings.", - "homepage": "http://github.com/rmccue/Requests", - "keywords": [ - "curl", - "fsockopen", - "http", - "idna", - "ipv6", - "iri", - "sockets" - ], - "support": { - "issues": "https://github.com/rmccue/Requests/issues", - "source": "https://github.com/rmccue/Requests/tree/master" - }, - "time": "2016-10-13T00:11:37+00:00" - }, - { - "name": "seld/jsonlint", - "version": "1.8.2", - "source": { - "type": "git", - "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "590cfec960b77fd55e39b7d9246659e95dd6d337" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/590cfec960b77fd55e39b7d9246659e95dd6d337", - "reference": "590cfec960b77fd55e39b7d9246659e95dd6d337", - "shasum": "" - }, - "require": { - "php": "^5.3 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" - }, - "bin": [ - "bin/jsonlint" - ], - "type": "library", - "autoload": { - "psr-4": { - "Seld\\JsonLint\\": "src/Seld/JsonLint/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "JSON Linter", - "keywords": [ - "json", - "linter", - "parser", - "validator" - ], - "support": { - "issues": "https://github.com/Seldaek/jsonlint/issues", - "source": "https://github.com/Seldaek/jsonlint/tree/master" - }, - "funding": [ - { - "url": "https://github.com/Seldaek", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/seld/jsonlint", - "type": "tidelift" - } - ], - "time": "2020-08-25T06:56:57+00:00" - }, - { - "name": "seld/phar-utils", - "version": "1.1.1", - "source": { - "type": "git", - "url": "https://github.com/Seldaek/phar-utils.git", - "reference": "8674b1d84ffb47cc59a101f5d5a3b61e87d23796" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/8674b1d84ffb47cc59a101f5d5a3b61e87d23796", - "reference": "8674b1d84ffb47cc59a101f5d5a3b61e87d23796", - "shasum": "" - }, - "require": { - "php": ">=5.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Seld\\PharUtils\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be" - } - ], - "description": "PHAR file format utilities, for when PHP phars you up", - "keywords": [ - "phar" - ], - "support": { - "issues": "https://github.com/Seldaek/phar-utils/issues", - "source": "https://github.com/Seldaek/phar-utils/tree/master" - }, - "time": "2020-07-07T18:42:57+00:00" - }, - { - "name": "symfony/config", - "version": "v3.4.18", - "source": { - "type": "git", - "url": "https://github.com/symfony/config.git", - "reference": "99b2fa8acc244e656cdf324ff419fbe6fd300a4d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/99b2fa8acc244e656cdf324ff419fbe6fd300a4d", - "reference": "99b2fa8acc244e656cdf324ff419fbe6fd300a4d", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/filesystem": "~2.8|~3.0|~4.0", - "symfony/polyfill-ctype": "~1.8" - }, - "conflict": { - "symfony/dependency-injection": "<3.3", - "symfony/finder": "<3.3" - }, - "require-dev": { - "symfony/dependency-injection": "~3.3|~4.0", - "symfony/event-dispatcher": "~3.3|~4.0", - "symfony/finder": "~3.3|~4.0", - "symfony/yaml": "~3.0|~4.0" - }, - "suggest": { - "symfony/yaml": "To use the yaml reference dumper" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Config\\": "" - }, - "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": "Symfony Config Component", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/config/tree/3.4" - }, - "time": "2018-10-31T09:06:03+00:00" - }, - { - "name": "symfony/console", - "version": "v3.4.18", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "1d228fb4602047d7b26a0554e0d3efd567da5803" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/1d228fb4602047d7b26a0554e0d3efd567da5803", - "reference": "1d228fb4602047d7b26a0554e0d3efd567da5803", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/debug": "~2.8|~3.0|~4.0", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "symfony/dependency-injection": "<3.4", - "symfony/process": "<3.3" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~3.3|~4.0", - "symfony/dependency-injection": "~3.4|~4.0", - "symfony/event-dispatcher": "~2.8|~3.0|~4.0", - "symfony/lock": "~3.4|~4.0", - "symfony/process": "~3.3|~4.0" - }, - "suggest": { - "psr/log-implementation": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "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": "Symfony Console Component", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/console/tree/3.4" - }, - "time": "2018-10-30T16:50:50+00:00" - }, - { - "name": "symfony/debug", - "version": "v3.4.18", - "source": { - "type": "git", - "url": "https://github.com/symfony/debug.git", - "reference": "fe9793af008b651c5441bdeab21ede8172dab097" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/fe9793af008b651c5441bdeab21ede8172dab097", - "reference": "fe9793af008b651c5441bdeab21ede8172dab097", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8", - "psr/log": "~1.0" - }, - "conflict": { - "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" - }, - "require-dev": { - "symfony/http-kernel": "~2.8|~3.0|~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Debug\\": "" - }, - "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": "Symfony Debug Component", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/debug/tree/3.4" - }, - "time": "2018-10-31T09:06:03+00:00" - }, - { - "name": "symfony/dependency-injection", - "version": "v3.4.27", - "source": { - "type": "git", - "url": "https://github.com/symfony/dependency-injection.git", - "reference": "be0feb3fa202aedfd8d1956f2dafd563fb13acbf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/be0feb3fa202aedfd8d1956f2dafd563fb13acbf", - "reference": "be0feb3fa202aedfd8d1956f2dafd563fb13acbf", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8", - "psr/container": "^1.0" - }, - "conflict": { - "symfony/config": "<3.3.7", - "symfony/finder": "<3.3", - "symfony/proxy-manager-bridge": "<3.4", - "symfony/yaml": "<3.4" - }, - "provide": { - "psr/container-implementation": "1.0" - }, - "require-dev": { - "symfony/config": "~3.3|~4.0", - "symfony/expression-language": "~2.8|~3.0|~4.0", - "symfony/yaml": "~3.4|~4.0" - }, - "suggest": { - "symfony/config": "", - "symfony/expression-language": "For using expressions in service container configuration", - "symfony/finder": "For using double-star glob patterns or when GLOB_BRACE portability is required", - "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", - "symfony/yaml": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\DependencyInjection\\": "" - }, - "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": "Symfony DependencyInjection Component", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v3.4.27" - }, - "time": "2019-04-20T15:32:49+00:00" - }, - { - "name": "symfony/event-dispatcher", - "version": "v3.4.18", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "db9e829c8f34c3d35cf37fcd4cdb4293bc4a2f14" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/db9e829c8f34c3d35cf37fcd4cdb4293bc4a2f14", - "reference": "db9e829c8f34c3d35cf37fcd4cdb4293bc4a2f14", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8" - }, - "conflict": { - "symfony/dependency-injection": "<3.3" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~2.8|~3.0|~4.0", - "symfony/dependency-injection": "~3.3|~4.0", - "symfony/expression-language": "~2.8|~3.0|~4.0", - "symfony/stopwatch": "~2.8|~3.0|~4.0" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "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": "Symfony EventDispatcher Component", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/3.4" - }, - "time": "2018-10-30T16:50:50+00:00" - }, - { - "name": "symfony/filesystem", - "version": "v3.4.18", - "source": { - "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "d69930fc337d767607267d57c20a7403d0a822a4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/d69930fc337d767607267d57c20a7403d0a822a4", - "reference": "d69930fc337d767607267d57c20a7403d0a822a4", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/polyfill-ctype": "~1.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "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": "Symfony Filesystem Component", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/filesystem/tree/3.4" - }, - "time": "2018-10-02T12:28:39+00:00" - }, - { - "name": "symfony/finder", - "version": "v3.4.18", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "54ba444dddc5bd5708a34bd095ea67c6eb54644d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/54ba444dddc5bd5708a34bd095ea67c6eb54644d", - "reference": "54ba444dddc5bd5708a34bd095ea67c6eb54644d", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "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": "Symfony Finder Component", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/finder/tree/3.4" - }, - "time": "2018-10-03T08:46:40+00:00" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.20.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f4ba089a5b6366e453971d3aad5fe8e897b37f41", - "reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.20-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "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.20.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": "2020-10-23T14:02:19+00:00" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.20.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "39d483bdf39be819deabf04ec872eb0b2410b531" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/39d483bdf39be819deabf04ec872eb0b2410b531", - "reference": "39d483bdf39be819deabf04ec872eb0b2410b531", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.20-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, - "files": [ - "bootstrap.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": "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.20.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": "2020-10-23T14:02:19+00:00" - }, - { - "name": "symfony/process", - "version": "v3.4.18", - "source": { - "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "35c2914a9f50519bd207164c353ae4d59182c2cb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/35c2914a9f50519bd207164c353ae4d59182c2cb", - "reference": "35c2914a9f50519bd207164c353ae4d59182c2cb", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "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": "Symfony Process Component", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/process/tree/3.4" - }, - "time": "2018-10-14T17:33:21+00:00" - }, - { - "name": "symfony/serializer", - "version": "v3.4.20", - "source": { - "type": "git", - "url": "https://github.com/symfony/serializer.git", - "reference": "40b326ca34c113da5d626e87fb5d0627b8324098" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/serializer/zipball/40b326ca34c113da5d626e87fb5d0627b8324098", - "reference": "40b326ca34c113da5d626e87fb5d0627b8324098", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/polyfill-ctype": "~1.8" - }, - "conflict": { - "phpdocumentor/type-resolver": "<0.2.1", - "symfony/dependency-injection": "<3.2", - "symfony/property-access": ">=3.0,<3.0.4|>=2.8,<2.8.4", - "symfony/property-info": "<3.1", - "symfony/yaml": "<3.4" - }, - "require-dev": { - "doctrine/annotations": "~1.0", - "doctrine/cache": "~1.0", - "phpdocumentor/reflection-docblock": "^3.0|^4.0", - "symfony/cache": "~3.1|~4.0", - "symfony/config": "~2.8|~3.0|~4.0", - "symfony/dependency-injection": "~3.2|~4.0", - "symfony/http-foundation": "~2.8|~3.0|~4.0", - "symfony/property-access": "~2.8|~3.0|~4.0", - "symfony/property-info": "~3.1|~4.0", - "symfony/yaml": "~3.4|~4.0" - }, - "suggest": { - "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.", - "doctrine/cache": "For using the default cached annotation reader and metadata cache.", - "psr/cache-implementation": "For using the metadata cache.", - "symfony/config": "For using the XML mapping loader.", - "symfony/http-foundation": "To use the DataUriNormalizer.", - "symfony/property-access": "For using the ObjectNormalizer.", - "symfony/property-info": "To deserialize relations.", - "symfony/yaml": "For using the default YAML mapping loader." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Serializer\\": "" - }, - "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": "Symfony Serializer Component", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/serializer/tree/3.4" - }, - "time": "2018-12-02T13:20:19+00:00" - }, - { - "name": "symfony/translation", - "version": "v3.4.18", - "source": { - "type": "git", - "url": "https://github.com/symfony/translation.git", - "reference": "94bc3a79008e6640defedf5e14eb3b4f20048352" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/94bc3a79008e6640defedf5e14eb3b4f20048352", - "reference": "94bc3a79008e6640defedf5e14eb3b4f20048352", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "symfony/config": "<2.8", - "symfony/dependency-injection": "<3.4", - "symfony/yaml": "<3.4" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~2.8|~3.0|~4.0", - "symfony/dependency-injection": "~3.4|~4.0", - "symfony/finder": "~2.8|~3.0|~4.0", - "symfony/intl": "^2.8.18|^3.2.5|~4.0", - "symfony/yaml": "~3.4|~4.0" - }, - "suggest": { - "psr/log-implementation": "To use logging capability in translator", - "symfony/config": "", - "symfony/yaml": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Translation\\": "" - }, - "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": "Symfony Translation Component", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/translation/tree/3.4" - }, - "time": "2018-10-02T16:33:53+00:00" - }, - { - "name": "symfony/yaml", - "version": "v3.4.18", - "source": { - "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "640b6c27fed4066d64b64d5903a86043f4a4de7f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/640b6c27fed4066d64b64d5903a86043f4a4de7f", - "reference": "640b6c27fed4066d64b64d5903a86043f4a4de7f", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/polyfill-ctype": "~1.8" - }, - "conflict": { - "symfony/console": "<3.4" - }, - "require-dev": { - "symfony/console": "~3.4|~4.0" - }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "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": "Symfony Yaml Component", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/yaml/tree/3.4" - }, - "time": "2018-10-02T16:33:53+00:00" - }, - { - "name": "webmozart/assert", - "version": "1.3.0", - "source": { - "type": "git", - "url": "https://github.com/webmozart/assert.git", - "reference": "0df1908962e7a3071564e857d86874dad1ef204a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", - "reference": "0df1908962e7a3071564e857d86874dad1ef204a", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "support": { - "issues": "https://github.com/webmozart/assert/issues", - "source": "https://github.com/webmozart/assert/tree/master" - }, - "time": "2018-01-29T19:49:41+00:00" - }, - { - "name": "wp-cli/mustangostang-spyc", - "version": "0.6.3", - "source": { - "type": "git", - "url": "https://github.com/wp-cli/spyc.git", - "reference": "6aa0b4da69ce9e9a2c8402dab8d43cf32c581cc7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/wp-cli/spyc/zipball/6aa0b4da69ce9e9a2c8402dab8d43cf32c581cc7", - "reference": "6aa0b4da69ce9e9a2c8402dab8d43cf32c581cc7", - "shasum": "" - }, - "require": { - "php": ">=5.3.1" - }, - "require-dev": { - "phpunit/phpunit": "4.3.*@dev" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.5.x-dev" - } - }, - "autoload": { - "psr-4": { - "Mustangostang\\": "src/" - }, - "files": [ - "includes/functions.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "mustangostang", - "email": "vlad.andersen@gmail.com" - } - ], - "description": "A simple YAML loader/dumper class for PHP (WP-CLI fork)", - "homepage": "https://github.com/mustangostang/spyc/", - "support": { - "source": "https://github.com/wp-cli/spyc/tree/autoload" - }, - "time": "2017-04-25T11:26:20+00:00" - }, - { - "name": "wp-cli/php-cli-tools", - "version": "v0.11.10", - "source": { - "type": "git", - "url": "https://github.com/wp-cli/php-cli-tools.git", - "reference": "f99308f92487efe18b5aac2057240fe5bb542374" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/wp-cli/php-cli-tools/zipball/f99308f92487efe18b5aac2057240fe5bb542374", - "reference": "f99308f92487efe18b5aac2057240fe5bb542374", - "shasum": "" - }, - "require": { - "php": ">= 5.3.0" - }, - "type": "library", - "autoload": { - "psr-0": { - "cli": "lib/" - }, - "files": [ - "lib/cli/cli.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "James Logsdon", - "email": "jlogsdon@php.net", - "role": "Developer" - }, - { - "name": "Daniel Bachhuber", - "email": "daniel@handbuilt.co", - "role": "Maintainer" - } - ], - "description": "Console utilities for PHP", - "homepage": "http://github.com/wp-cli/php-cli-tools", - "keywords": [ - "cli", - "console" - ], - "support": { - "issues": "https://github.com/wp-cli/php-cli-tools/issues", - "source": "https://github.com/wp-cli/php-cli-tools/tree/master" - }, - "time": "2018-08-22T10:11:06+00:00" - } - ], - "packages-dev": [ - { - "name": "behat/behat", - "version": "v3.7.0", - "source": { - "type": "git", - "url": "https://github.com/Behat/Behat.git", - "reference": "08052f739619a9e9f62f457a67302f0715e6dd13" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Behat/Behat/zipball/08052f739619a9e9f62f457a67302f0715e6dd13", - "reference": "08052f739619a9e9f62f457a67302f0715e6dd13", - "shasum": "" - }, - "require": { - "behat/gherkin": "^4.6.0", - "behat/transliterator": "^1.2", - "ext-mbstring": "*", - "php": ">=5.3.3", - "psr/container": "^1.0", - "symfony/config": "^2.7.51 || ^3.0 || ^4.0 || ^5.0", - "symfony/console": "^2.7.51 || ^2.8.33 || ^3.3.15 || ^3.4.3 || ^4.0.3 || ^5.0", - "symfony/dependency-injection": "^2.7.51 || ^3.0 || ^4.0 || ^5.0", - "symfony/event-dispatcher": "^2.7.51 || ^3.0 || ^4.0 || ^5.0", - "symfony/translation": "^2.7.51 || ^3.0 || ^4.0 || ^5.0", - "symfony/yaml": "^2.7.51 || ^3.0 || ^4.0 || ^5.0" - }, - "require-dev": { - "container-interop/container-interop": "^1.2", - "herrera-io/box": "~1.6.1", - "phpunit/phpunit": "^4.8.36 || ^6.5.14 || ^7.5.20", - "symfony/process": "~2.5 || ^3.0 || ^4.0 || ^5.0" - }, - "suggest": { - "ext-dom": "Needed to output test results in JUnit format." - }, - "bin": [ - "bin/behat" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.6.x-dev" - } - }, - "autoload": { - "psr-4": { - "Behat\\Behat\\": "src/Behat/Behat/", - "Behat\\Testwork\\": "src/Behat/Testwork/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - } - ], - "description": "Scenario-oriented BDD framework for PHP 5.3", - "homepage": "http://behat.org/", - "keywords": [ - "Agile", - "BDD", - "ScenarioBDD", - "Scrum", - "StoryBDD", - "User story", - "business", - "development", - "documentation", - "examples", - "symfony", - "testing" - ], - "support": { - "issues": "https://github.com/Behat/Behat/issues", - "source": "https://github.com/Behat/Behat/tree/v3.4.3" - }, - "time": "2017-11-27T10:37:56+00:00" - }, - { - "name": "behat/gherkin", - "version": "v4.6.2", - "source": { - "type": "git", - "url": "https://github.com/Behat/Gherkin.git", - "reference": "51ac4500c4dc30cbaaabcd2f25694299df666a31" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Behat/Gherkin/zipball/51ac4500c4dc30cbaaabcd2f25694299df666a31", - "reference": "51ac4500c4dc30cbaaabcd2f25694299df666a31", - "shasum": "" - }, - "require": { - "php": ">=5.3.1" - }, - "require-dev": { - "phpunit/phpunit": "~4.5|~5", - "symfony/phpunit-bridge": "~2.7|~3|~4", - "symfony/yaml": "~2.3|~3|~4" - }, - "suggest": { - "symfony/yaml": "If you want to parse features, represented in YAML files" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.4-dev" - } - }, - "autoload": { - "psr-0": { - "Behat\\Gherkin": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - } - ], - "description": "Gherkin DSL parser for PHP 5.3", - "homepage": "http://behat.org/", - "keywords": [ - "BDD", - "Behat", - "Cucumber", - "DSL", - "gherkin", - "parser" - ], - "support": { - "issues": "https://github.com/Behat/Gherkin/issues", - "source": "https://github.com/Behat/Gherkin/tree/master" - }, - "time": "2020-03-17T14:03:26+00:00" - }, - { - "name": "behat/transliterator", - "version": "v1.3.0", - "source": { - "type": "git", - "url": "https://github.com/Behat/Transliterator.git", - "reference": "3c4ec1d77c3d05caa1f0bf8fb3aae4845005c7fc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Behat/Transliterator/zipball/3c4ec1d77c3d05caa1f0bf8fb3aae4845005c7fc", - "reference": "3c4ec1d77c3d05caa1f0bf8fb3aae4845005c7fc", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "chuyskywalker/rolling-curl": "^3.1", - "php-yaoi/php-yaoi": "^1.0", - "phpunit/phpunit": "^4.8.36|^6.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2-dev" - } - }, - "autoload": { - "psr-4": { - "Behat\\Transliterator\\": "src/Behat/Transliterator" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Artistic-1.0" - ], - "description": "String transliterator", - "keywords": [ - "i18n", - "slug", - "transliterator" - ], - "support": { - "issues": "https://github.com/Behat/Transliterator/issues", - "source": "https://github.com/Behat/Transliterator/tree/v1.3.0" - }, - "time": "2020-01-14T16:39:13+00:00" - }, - { - "name": "container-interop/container-interop", - "version": "1.2.0", - "source": { - "type": "git", - "url": "https://github.com/container-interop/container-interop.git", - "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/container-interop/container-interop/zipball/79cbf1341c22ec75643d841642dd5d6acd83bdb8", - "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8", - "shasum": "" - }, - "require": { - "psr/container": "^1.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Interop\\Container\\": "src/Interop/Container/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", - "homepage": "https://github.com/container-interop/container-interop", - "support": { - "issues": "https://github.com/container-interop/container-interop/issues", - "source": "https://github.com/container-interop/container-interop/tree/master" - }, - "abandoned": "psr/container", - "time": "2017-02-14T19:40:03+00:00" - }, - { - "name": "dealerdirect/phpcodesniffer-composer-installer", - "version": "v0.7.0", - "source": { - "type": "git", - "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", - "reference": "e8d808670b8f882188368faaf1144448c169c0b7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/e8d808670b8f882188368faaf1144448c169c0b7", - "reference": "e8d808670b8f882188368faaf1144448c169c0b7", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.0 || ^2.0", - "php": ">=5.3", - "squizlabs/php_codesniffer": "^2 || ^3 || 4.0.x-dev" - }, - "require-dev": { - "composer/composer": "*", - "phpcompatibility/php-compatibility": "^9.0", - "sensiolabs/security-checker": "^4.1.0" - }, - "type": "composer-plugin", - "extra": { - "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" - }, - "autoload": { - "psr-4": { - "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Franck Nijhof", - "email": "franck.nijhof@dealerdirect.com", - "homepage": "http://www.frenck.nl", - "role": "Developer / IT Manager" - } - ], - "description": "PHP_CodeSniffer Standards Composer Installer Plugin", - "homepage": "http://www.dealerdirect.com", - "keywords": [ - "PHPCodeSniffer", - "PHP_CodeSniffer", - "code quality", - "codesniffer", - "composer", - "installer", - "phpcs", - "plugin", - "qa", - "quality", - "standard", - "standards", - "style guide", - "stylecheck", - "tests" - ], - "support": { - "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues", - "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer" - }, - "time": "2020-06-25T14:57:39+00:00" - }, - { - "name": "phpcompatibility/php-compatibility", - "version": "8.2.0", - "source": { - "type": "git", - "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", - "reference": "eaf613c1a8265bcfd7b0ab690783f2aef519f78a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/eaf613c1a8265bcfd7b0ab690783f2aef519f78a", - "reference": "eaf613c1a8265bcfd7b0ab690783f2aef519f78a", - "shasum": "" - }, - "require": { - "php": ">=5.3", - "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" - }, - "conflict": { - "squizlabs/php_codesniffer": "2.6.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" - }, - "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", - "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." - }, - "type": "phpcodesniffer-standard", - "autoload": { - "psr-4": { - "PHPCompatibility\\": "PHPCompatibility/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "LGPL-3.0-or-later" - ], - "authors": [ - { - "name": "Wim Godden", - "role": "lead" - } - ], - "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP version compatibility.", - "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", - "keywords": [ - "compatibility", - "phpcs", - "standards" - ], - "time": "2018-07-17T13:42:26+00:00" - }, - { - "name": "phpunit/php-code-coverage", - "version": "1.2.18", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "fe2466802556d3fe4e4d1d58ffd3ccfd0a19be0b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/fe2466802556d3fe4e4d1d58ffd3ccfd0a19be0b", - "reference": "fe2466802556d3fe4e4d1d58ffd3ccfd0a19be0b", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "phpunit/php-file-iterator": ">=1.3.0@stable", - "phpunit/php-text-template": ">=1.2.0@stable", - "phpunit/php-token-stream": ">=1.1.3,<1.3.0" - }, - "require-dev": { - "phpunit/phpunit": "3.7.*@dev" - }, - "suggest": { - "ext-dom": "*", - "ext-xdebug": ">=2.0.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "PHP/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "support": { - "irc": "irc://irc.freenode.net/phpunit", - "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/1.2.18" - }, - "time": "2014-09-02T10:13:14+00:00" - }, - { - "name": "phpunit/php-file-iterator", - "version": "2.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "050bedf145a257b1ff02746c31894800e5122946" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/050bedf145a257b1ff02746c31894800e5122946", - "reference": "050bedf145a257b1ff02746c31894800e5122946", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/2.0.2" - }, - "time": "2018-09-13T20:33:42+00:00" - }, - { - "name": "phpunit/php-text-template", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/1.2.1" - }, - "time": "2015-06-21T13:50:34+00:00" - }, - { - "name": "phpunit/php-timer", - "version": "1.0.9", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/master" - }, - "time": "2017-02-26T11:10:40+00:00" - }, - { - "name": "phpunit/php-token-stream", - "version": "1.2.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "ad4e1e23ae01b483c16f600ff1bebec184588e32" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/ad4e1e23ae01b483c16f600ff1bebec184588e32", - "reference": "ad4e1e23ae01b483c16f600ff1bebec184588e32", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2-dev" - } - }, - "autoload": { - "classmap": [ - "PHP/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "support": { - "irc": "irc://irc.freenode.net/phpunit", - "issues": "https://github.com/sebastianbergmann/php-token-stream/issues", - "source": "https://github.com/sebastianbergmann/php-token-stream/tree/1.2.2" - }, - "abandoned": true, - "time": "2014-03-03T05:10:30+00:00" - }, - { - "name": "phpunit/phpunit", - "version": "3.7.18", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "82335c294ae39a59965b0dc2027ac74eb62f53f1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/82335c294ae39a59965b0dc2027ac74eb62f53f1", - "reference": "82335c294ae39a59965b0dc2027ac74eb62f53f1", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*", - "php": ">=5.3.3", - "phpunit/php-code-coverage": ">=1.2.1,<1.3.0", - "phpunit/php-file-iterator": ">=1.3.1", - "phpunit/php-text-template": ">=1.1.1", - "phpunit/php-timer": ">=1.0.2,<1.1.0", - "phpunit/phpunit-mock-objects": ">=1.2.0,<1.3.0", - "symfony/yaml": ">=2.2.0" - }, - "require-dev": { - "pear-pear/pear": "1.9.4" - }, - "suggest": { - "ext-json": "*", - "ext-simplexml": "*", - "ext-tokenizer": "*", - "phpunit/php-invoker": ">=1.1.0,<1.2.0" - }, - "bin": [ - "composer/bin/phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.7.x-dev" - } - }, - "autoload": { - "classmap": [ - "PHPUnit/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "", - "../../symfony/yaml/" - ], - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "The PHP Unit Testing framework.", - "homepage": "http://www.phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "support": { - "irc": "irc://irc.freenode.net/phpunit", - "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/3.7.18" - }, - "time": "2013-03-07T21:45:39+00:00" - }, - { - "name": "phpunit/phpunit-mock-objects", - "version": "1.2.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "5794e3c5c5ba0fb037b11d8151add2a07fa82875" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/5794e3c5c5ba0fb037b11d8151add2a07fa82875", - "reference": "5794e3c5c5ba0fb037b11d8151add2a07fa82875", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "phpunit/php-text-template": ">=1.1.1@stable" - }, - "suggest": { - "ext-soap": "*" - }, - "type": "library", - "autoload": { - "classmap": [ - "PHPUnit/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ], - "support": { - "irc": "irc://irc.freenode.net/phpunit", - "issues": "https://github.com/sebastianbergmann/phpunit-mock-objects/issues", - "source": "https://github.com/sebastianbergmann/phpunit-mock-objects/tree/1.2.3" - }, - "abandoned": true, - "time": "2013-01-13T10:24:48+00:00" - }, - { - "name": "roave/security-advisories", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "327370943772f9917bc2dc2aa4263db2d572a112" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/327370943772f9917bc2dc2aa4263db2d572a112", - "reference": "327370943772f9917bc2dc2aa4263db2d572a112", - "shasum": "" - }, - "conflict": { - "3f/pygmentize": "<1.2", - "adodb/adodb-php": "<5.20.12", - "alterphp/easyadmin-extension-bundle": ">=1.2,<1.2.11|>=1.3,<1.3.1", - "amphp/artax": "<1.0.6|>=2,<2.0.6", - "amphp/http": "<1.0.1", - "amphp/http-client": ">=4,<4.4", - "api-platform/core": ">=2.2,<2.2.10|>=2.3,<2.3.6", - "asymmetricrypt/asymmetricrypt": ">=0,<9.9.99", - "aws/aws-sdk-php": ">=3,<3.2.1", - "bagisto/bagisto": "<0.1.5", - "barrelstrength/sprout-base-email": "<1.2.7", - "barrelstrength/sprout-forms": "<3.9", - "baserproject/basercms": ">=4,<=4.3.6", - "bolt/bolt": "<3.7.1", - "brightlocal/phpwhois": "<=4.2.5", - "buddypress/buddypress": "<5.1.2", - "bugsnag/bugsnag-laravel": ">=2,<2.0.2", - "cakephp/cakephp": ">=1.3,<1.3.18|>=2,<2.4.99|>=2.5,<2.5.99|>=2.6,<2.6.12|>=2.7,<2.7.6|>=3,<3.5.18|>=3.6,<3.6.15|>=3.7,<3.7.7", - "cart2quote/module-quotation": ">=4.1.6,<=4.4.5|>=5,<5.4.4", - "cartalyst/sentry": "<=2.1.6", - "centreon/centreon": "<18.10.8|>=19,<19.4.5", - "cesnet/simplesamlphp-module-proxystatistics": "<3.1", - "codeigniter/framework": "<=3.0.6", - "composer/composer": "<=1-alpha.11", - "contao-components/mediaelement": ">=2.14.2,<2.21.1", - "contao/core": ">=2,<3.5.39", - "contao/core-bundle": ">=4,<4.4.52|>=4.5,<4.9.6|= 4.10.0", - "contao/listing-bundle": ">=4,<4.4.8", - "datadog/dd-trace": ">=0.30,<0.30.2", - "david-garcia/phpwhois": "<=4.3.1", - "derhansen/sf_event_mgt": "<4.3.1|>=5,<5.1.1", - "doctrine/annotations": ">=1,<1.2.7", - "doctrine/cache": ">=1,<1.3.2|>=1.4,<1.4.2", - "doctrine/common": ">=2,<2.4.3|>=2.5,<2.5.1", - "doctrine/dbal": ">=2,<2.0.8|>=2.1,<2.1.2", - "doctrine/doctrine-bundle": "<1.5.2", - "doctrine/doctrine-module": "<=0.7.1", - "doctrine/mongodb-odm": ">=1,<1.0.2", - "doctrine/mongodb-odm-bundle": ">=2,<3.0.1", - "doctrine/orm": ">=2,<2.4.8|>=2.5,<2.5.1", - "dolibarr/dolibarr": "<11.0.4", - "dompdf/dompdf": ">=0.6,<0.6.2", - "drupal/core": ">=7,<7.73|>=8,<8.8.10|>=8.9,<8.9.6|>=9,<9.0.6", - "drupal/drupal": ">=7,<7.73|>=8,<8.8.10|>=8.9,<8.9.6|>=9,<9.0.6", - "endroid/qr-code-bundle": "<3.4.2", - "enshrined/svg-sanitize": "<0.13.1", - "erusev/parsedown": "<1.7.2", - "ezsystems/demobundle": ">=5.4,<5.4.6.1", - "ezsystems/ezdemo-ls-extension": ">=5.4,<5.4.2.1", - "ezsystems/ezfind-ls": ">=5.3,<5.3.6.1|>=5.4,<5.4.11.1|>=2017.12,<2017.12.0.1", - "ezsystems/ezplatform": ">=1.7,<1.7.9.1|>=1.13,<1.13.5.1|>=2.5,<2.5.4", - "ezsystems/ezplatform-admin-ui": ">=1.3,<1.3.5|>=1.4,<1.4.6", - "ezsystems/ezplatform-admin-ui-assets": ">=4,<4.2.1|>=5,<5.0.1|>=5.1,<5.1.1", - "ezsystems/ezplatform-kernel": ">=1,<1.0.2.1", - "ezsystems/ezplatform-user": ">=1,<1.0.1", - "ezsystems/ezpublish-kernel": ">=5.3,<5.3.12.1|>=5.4,<5.4.14.2|>=6,<6.7.9.1|>=6.8,<6.13.6.3|>=7,<7.2.4.1|>=7.3,<7.3.2.1|>=7.5,<7.5.7.1", - "ezsystems/ezpublish-legacy": ">=5.3,<5.3.12.6|>=5.4,<5.4.14.2|>=2011,<2017.12.7.3|>=2018.6,<2018.6.1.4|>=2018.9,<2018.9.1.3|>=2019.3,<2019.3.5.1", - "ezsystems/platform-ui-assets-bundle": ">=4.2,<4.2.3", - "ezsystems/repository-forms": ">=2.3,<2.3.2.1", - "ezyang/htmlpurifier": "<4.1.1", - "firebase/php-jwt": "<2", - "fooman/tcpdf": "<6.2.22", - "fossar/tcpdf-parser": "<6.2.22", - "friendsofsymfony/oauth2-php": "<1.3", - "friendsofsymfony/rest-bundle": ">=1.2,<1.2.2", - "friendsofsymfony/user-bundle": ">=1.2,<1.3.5", - "friendsoftypo3/mediace": ">=7.6.2,<7.6.5", - "fuel/core": "<1.8.1", - "getgrav/grav": "<1.7-beta.8", - "gos/web-socket-bundle": "<1.10.4|>=2,<2.6.1|>=3,<3.3", - "gree/jose": "<=2.2", - "gregwar/rst": "<1.0.3", - "guzzlehttp/guzzle": ">=4-rc.2,<4.2.4|>=5,<5.3.1|>=6,<6.2.1", - "illuminate/auth": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.10", - "illuminate/cookie": ">=4,<=4.0.11|>=4.1,<=4.1.99999|>=4.2,<=4.2.99999|>=5,<=5.0.99999|>=5.1,<=5.1.99999|>=5.2,<=5.2.99999|>=5.3,<=5.3.99999|>=5.4,<=5.4.99999|>=5.5,<=5.5.49|>=5.6,<=5.6.99999|>=5.7,<=5.7.99999|>=5.8,<=5.8.99999|>=6,<6.18.31|>=7,<7.22.4", - "illuminate/database": ">=4,<4.0.99|>=4.1,<4.1.29|>=5.5,<=5.5.44|>=6,<6.18.34|>=7,<7.23.2", - "illuminate/encryption": ">=4,<=4.0.11|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.40|>=5.6,<5.6.15", - "illuminate/view": ">=7,<7.1.2", - "ivankristianto/phpwhois": "<=4.3", - "james-heinrich/getid3": "<1.9.9", - "joomla/session": "<1.3.1", - "jsmitty12/phpwhois": "<5.1", - "kazist/phpwhois": "<=4.2.6", - "kitodo/presentation": "<3.1.2", - "kreait/firebase-php": ">=3.2,<3.8.1", - "la-haute-societe/tcpdf": "<6.2.22", - "laravel/framework": ">=4,<4.0.99|>=4.1,<=4.1.99999|>=4.2,<=4.2.99999|>=5,<=5.0.99999|>=5.1,<=5.1.99999|>=5.2,<=5.2.99999|>=5.3,<=5.3.99999|>=5.4,<=5.4.99999|>=5.5,<=5.5.49|>=5.6,<=5.6.99999|>=5.7,<=5.7.99999|>=5.8,<=5.8.99999|>=6,<6.18.34|>=7,<7.23.2", - "laravel/socialite": ">=1,<1.0.99|>=2,<2.0.10", - "league/commonmark": "<0.18.3", - "librenms/librenms": "<1.53", - "livewire/livewire": ">2.2.4,<2.2.6", - "magento/community-edition": ">=2,<2.2.10|>=2.3,<2.3.3", - "magento/magento1ce": "<1.9.4.3", - "magento/magento1ee": ">=1,<1.14.4.3", - "magento/product-community-edition": ">=2,<2.2.10|>=2.3,<2.3.2-p.2", - "marcwillmann/turn": "<0.3.3", - "mediawiki/core": ">=1.31,<1.31.4|>=1.32,<1.32.4|>=1.33,<1.33.1", - "mittwald/typo3_forum": "<1.2.1", - "monolog/monolog": ">=1.8,<1.12", - "namshi/jose": "<2.2", - "nette/application": ">=2,<2.0.19|>=2.1,<2.1.13|>=2.2,<2.2.10|>=2.3,<2.3.14|>=2.4,<2.4.16|>=3,<3.0.6", - "nette/nette": ">=2,<2.0.19|>=2.1,<2.1.13", - "nystudio107/craft-seomatic": "<3.3", - "nzo/url-encryptor-bundle": ">=4,<4.3.2|>=5,<5.0.1", - "october/backend": ">=1.0.319,<1.0.467", - "october/cms": ">=1.0.319,<1.0.466", - "october/october": ">=1.0.319,<1.0.466", - "october/rain": ">=1.0.319,<1.0.468", - "onelogin/php-saml": "<2.10.4", - "oneup/uploader-bundle": "<1.9.3|>=2,<2.1.5", - "openid/php-openid": "<2.3", - "openmage/magento-lts": "<19.4.6|>=20,<20.0.2", - "oro/crm": ">=1.7,<1.7.4", - "oro/platform": ">=1.7,<1.7.4", - "padraic/humbug_get_contents": "<1.1.2", - "pagarme/pagarme-php": ">=0,<3", - "paragonie/random_compat": "<2", - "paypal/merchant-sdk-php": "<3.12", - "pear/archive_tar": "<1.4.4", - "personnummer/personnummer": "<3.0.2", - "phpfastcache/phpfastcache": ">=5,<5.0.13", - "phpmailer/phpmailer": "<6.1.6", - "phpmussel/phpmussel": ">=1,<1.6", - "phpmyadmin/phpmyadmin": "<4.9.2", - "phpoffice/phpexcel": "<1.8.2", - "phpoffice/phpspreadsheet": "<1.8", - "phpunit/phpunit": ">=4.8.19,<4.8.28|>=5.0.10,<5.6.3", - "phpwhois/phpwhois": "<=4.2.5", - "phpxmlrpc/extras": "<0.6.1", - "pimcore/pimcore": "<6.3", - "prestashop/autoupgrade": ">=4,<4.10.1", - "prestashop/contactform": ">1.0.1,<4.3", - "prestashop/gamification": "<2.3.2", - "prestashop/ps_facetedsearch": "<3.4.1", - "privatebin/privatebin": "<1.2.2|>=1.3,<1.3.2", - "propel/propel": ">=2-alpha.1,<=2-alpha.7", - "propel/propel1": ">=1,<=1.7.1", - "pterodactyl/panel": "<0.7.19|>=1-rc.0,<=1-rc.6", - "pusher/pusher-php-server": "<2.2.1", - "rainlab/debugbar-plugin": "<3.1", - "robrichards/xmlseclibs": "<3.0.4", - "sabberworm/php-css-parser": ">=1,<1.0.1|>=2,<2.0.1|>=3,<3.0.1|>=4,<4.0.1|>=5,<5.0.9|>=5.1,<5.1.3|>=5.2,<5.2.1|>=6,<6.0.2|>=7,<7.0.4|>=8,<8.0.1|>=8.1,<8.1.1|>=8.2,<8.2.1|>=8.3,<8.3.1", - "sabre/dav": ">=1.6,<1.6.99|>=1.7,<1.7.11|>=1.8,<1.8.9", - "scheb/two-factor-bundle": ">=0,<3.26|>=4,<4.11", - "sensiolabs/connect": "<4.2.3", - "serluck/phpwhois": "<=4.2.6", - "shopware/core": "<=6.3.1", - "shopware/platform": "<=6.3.1", - "shopware/shopware": "<5.3.7", - "silverstripe/admin": ">=1.0.3,<1.0.4|>=1.1,<1.1.1", - "silverstripe/assets": ">=1,<1.4.7|>=1.5,<1.5.2", - "silverstripe/cms": "<4.3.6|>=4.4,<4.4.4", - "silverstripe/comments": ">=1.3,<1.9.99|>=2,<2.9.99|>=3,<3.1.1", - "silverstripe/forum": "<=0.6.1|>=0.7,<=0.7.3", - "silverstripe/framework": "<4.4.7|>=4.5,<4.5.4", - "silverstripe/graphql": ">=2,<2.0.5|>=3,<3.1.2|>=3.2,<3.2.4", - "silverstripe/registry": ">=2.1,<2.1.2|>=2.2,<2.2.1", - "silverstripe/restfulserver": ">=1,<1.0.9|>=2,<2.0.4", - "silverstripe/subsites": ">=2,<2.1.1", - "silverstripe/taxonomy": ">=1.3,<1.3.1|>=2,<2.0.1", - "silverstripe/userforms": "<3", - "simple-updates/phpwhois": "<=1", - "simplesamlphp/saml2": "<1.10.6|>=2,<2.3.8|>=3,<3.1.4", - "simplesamlphp/simplesamlphp": "<1.18.6", - "simplesamlphp/simplesamlphp-module-infocard": "<1.0.1", - "simplito/elliptic-php": "<1.0.6", - "slim/slim": "<2.6", - "smarty/smarty": "<3.1.33", - "socalnick/scn-social-auth": "<1.15.2", - "spoonity/tcpdf": "<6.2.22", - "squizlabs/php_codesniffer": ">=1,<2.8.1|>=3,<3.0.1", - "ssddanbrown/bookstack": "<0.29.2", - "stormpath/sdk": ">=0,<9.9.99", - "studio-42/elfinder": "<2.1.49", - "sulu/sulu": "<1.6.34|>=2,<2.0.10|>=2.1,<2.1.1", - "swiftmailer/swiftmailer": ">=4,<5.4.5", - "sylius/admin-bundle": ">=1,<1.0.17|>=1.1,<1.1.9|>=1.2,<1.2.2", - "sylius/grid": ">=1,<1.1.19|>=1.2,<1.2.18|>=1.3,<1.3.13|>=1.4,<1.4.5|>=1.5,<1.5.1", - "sylius/grid-bundle": ">=1,<1.1.19|>=1.2,<1.2.18|>=1.3,<1.3.13|>=1.4,<1.4.5|>=1.5,<1.5.1", - "sylius/resource-bundle": "<1.3.14|>=1.4,<1.4.7|>=1.5,<1.5.2|>=1.6,<1.6.4", - "sylius/sylius": "<1.3.16|>=1.4,<1.4.12|>=1.5,<1.5.9|>=1.6,<1.6.5", - "symbiote/silverstripe-multivaluefield": ">=3,<3.0.99", - "symbiote/silverstripe-versionedfiles": "<=2.0.3", - "symfony/cache": ">=3.1,<3.4.35|>=4,<4.2.12|>=4.3,<4.3.8", - "symfony/dependency-injection": ">=2,<2.0.17|>=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", - "symfony/error-handler": ">=4.4,<4.4.4|>=5,<5.0.4", - "symfony/form": ">=2.3,<2.3.35|>=2.4,<2.6.12|>=2.7,<2.7.50|>=2.8,<2.8.49|>=3,<3.4.20|>=4,<4.0.15|>=4.1,<4.1.9|>=4.2,<4.2.1", - "symfony/framework-bundle": ">=2,<2.3.18|>=2.4,<2.4.8|>=2.5,<2.5.2|>=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", - "symfony/http-foundation": ">=2,<2.8.52|>=3,<3.4.35|>=4,<4.2.12|>=4.3,<4.3.8|>=4.4,<4.4.7|>=5,<5.0.7", - "symfony/http-kernel": ">=2,<2.8.52|>=3,<3.4.35|>=4,<4.2.12|>=4.3,<4.4.13|>=5,<5.1.5", - "symfony/intl": ">=2.7,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", - "symfony/mime": ">=4.3,<4.3.8", - "symfony/phpunit-bridge": ">=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", - "symfony/polyfill": ">=1,<1.10", - "symfony/polyfill-php55": ">=1,<1.10", - "symfony/proxy-manager-bridge": ">=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", - "symfony/routing": ">=2,<2.0.19", - "symfony/security": ">=2,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7|>=4.4,<4.4.7|>=5,<5.0.7", - "symfony/security-bundle": ">=2,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", - "symfony/security-core": ">=2.4,<2.6.13|>=2.7,<2.7.9|>=2.7.30,<2.7.32|>=2.8,<2.8.37|>=3,<3.3.17|>=3.4,<3.4.7|>=4,<4.0.7", - "symfony/security-csrf": ">=2.4,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", - "symfony/security-guard": ">=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", - "symfony/security-http": ">=2.3,<2.3.41|>=2.4,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.2.12|>=4.3,<4.3.8|>=4.4,<4.4.7|>=5,<5.0.7", - "symfony/serializer": ">=2,<2.0.11", - "symfony/symfony": ">=2,<2.8.52|>=3,<3.4.35|>=4,<4.2.12|>=4.3,<4.4.13|>=5,<5.1.5", - "symfony/translation": ">=2,<2.0.17", - "symfony/validator": ">=2,<2.0.24|>=2.1,<2.1.12|>=2.2,<2.2.5|>=2.3,<2.3.3", - "symfony/var-exporter": ">=4.2,<4.2.12|>=4.3,<4.3.8", - "symfony/web-profiler-bundle": ">=2,<2.3.19|>=2.4,<2.4.9|>=2.5,<2.5.4", - "symfony/yaml": ">=2,<2.0.22|>=2.1,<2.1.7", - "t3g/svg-sanitizer": "<1.0.3", - "tecnickcom/tcpdf": "<6.2.22", - "thelia/backoffice-default-template": ">=2.1,<2.1.2", - "thelia/thelia": ">=2.1-beta.1,<2.1.3", - "theonedemon/phpwhois": "<=4.2.5", - "titon/framework": ">=0,<9.9.99", - "truckersmp/phpwhois": "<=4.3.1", - "twig/twig": "<1.38|>=2,<2.7", - "typo3/cms": ">=6.2,<6.2.30|>=7,<7.6.32|>=8,<8.7.30|>=9,<9.5.20|>=10,<10.4.6", - "typo3/cms-core": ">=8,<8.7.30|>=9,<9.5.20|>=10,<10.4.6", - "typo3/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.10|>=3.1,<3.1.7|>=3.2,<3.2.7|>=3.3,<3.3.5", - "typo3/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4", - "typo3/phar-stream-wrapper": ">=1,<2.1.1|>=3,<3.1.1", - "typo3fluid/fluid": ">=2,<2.0.5|>=2.1,<2.1.4|>=2.2,<2.2.1|>=2.3,<2.3.5|>=2.4,<2.4.1|>=2.5,<2.5.5|>=2.6,<2.6.1", - "ua-parser/uap-php": "<3.8", - "usmanhalalit/pixie": "<1.0.3|>=2,<2.0.2", - "verot/class.upload.php": "<=1.0.3|>=2,<=2.0.4", - "wallabag/tcpdf": "<6.2.22", - "willdurand/js-translation-bundle": "<2.1.1", - "yii2mod/yii2-cms": "<1.9.2", - "yiisoft/yii": ">=1.1.14,<1.1.15", - "yiisoft/yii2": "<2.0.38", - "yiisoft/yii2-bootstrap": "<2.0.4", - "yiisoft/yii2-dev": "<2.0.15", - "yiisoft/yii2-elasticsearch": "<2.0.5", - "yiisoft/yii2-gii": "<2.0.4", - "yiisoft/yii2-jui": "<2.0.4", - "yiisoft/yii2-redis": "<2.0.8", - "yourls/yourls": "<1.7.4", - "zendframework/zend-cache": ">=2.4,<2.4.8|>=2.5,<2.5.3", - "zendframework/zend-captcha": ">=2,<2.4.9|>=2.5,<2.5.2", - "zendframework/zend-crypt": ">=2,<2.4.9|>=2.5,<2.5.2", - "zendframework/zend-db": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.10|>=2.3,<2.3.5", - "zendframework/zend-developer-tools": ">=1.2.2,<1.2.3", - "zendframework/zend-diactoros": ">=1,<1.8.4", - "zendframework/zend-feed": ">=1,<2.10.3", - "zendframework/zend-form": ">=2,<2.2.7|>=2.3,<2.3.1", - "zendframework/zend-http": ">=1,<2.8.1", - "zendframework/zend-json": ">=2.1,<2.1.6|>=2.2,<2.2.6", - "zendframework/zend-ldap": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.8|>=2.3,<2.3.3", - "zendframework/zend-mail": ">=2,<2.4.11|>=2.5,<2.7.2", - "zendframework/zend-navigation": ">=2,<2.2.7|>=2.3,<2.3.1", - "zendframework/zend-session": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.9|>=2.3,<2.3.4", - "zendframework/zend-validator": ">=2.3,<2.3.6", - "zendframework/zend-view": ">=2,<2.2.7|>=2.3,<2.3.1", - "zendframework/zend-xmlrpc": ">=2.1,<2.1.6|>=2.2,<2.2.6", - "zendframework/zendframework": "<2.5.1", - "zendframework/zendframework1": "<1.12.20", - "zendframework/zendopenid": ">=2,<2.0.2", - "zendframework/zendxml": ">=1,<1.0.1", - "zetacomponents/mail": "<1.8.2", - "zf-commons/zfc-user": "<1.2.2", - "zfcampus/zf-apigility-doctrine": ">=1,<1.0.3", - "zfr/zfr-oauth2-server-module": "<0.1.2" - }, - "type": "metapackage", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "role": "maintainer" - }, - { - "name": "Ilya Tribusean", - "email": "slash3b@gmail.com", - "role": "maintainer" - } - ], - "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", - "support": { - "issues": "https://github.com/Roave/SecurityAdvisories/issues", - "source": "https://github.com/Roave/SecurityAdvisories/tree/latest" - }, - "funding": [ - { - "url": "https://github.com/Ocramius", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/roave/security-advisories", - "type": "tidelift" - } - ], - "time": "2020-10-19T07:02:45+00:00" - }, - { - "name": "squizlabs/php_codesniffer", - "version": "3.5.8", - "source": { - "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "9d583721a7157ee997f235f327de038e7ea6dac4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/9d583721a7157ee997f235f327de038e7ea6dac4", - "reference": "9d583721a7157ee997f235f327de038e7ea6dac4", - "shasum": "" - }, - "require": { - "ext-simplexml": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" - }, - "bin": [ - "bin/phpcs", - "bin/phpcbf" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Greg Sherwood", - "role": "lead" - } - ], - "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", - "keywords": [ - "phpcs", - "standards" - ], - "support": { - "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", - "source": "https://github.com/squizlabs/PHP_CodeSniffer", - "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" - }, - "time": "2020-10-23T02:01:07+00:00" - }, - { - "name": "symfony/class-loader", - "version": "v3.4.46", - "source": { - "type": "git", - "url": "https://github.com/symfony/class-loader.git", - "reference": "a22265a9f3511c0212bf79f54910ca5a77c0e92c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/class-loader/zipball/a22265a9f3511c0212bf79f54910ca5a77c0e92c", - "reference": "a22265a9f3511c0212bf79f54910ca5a77c0e92c", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8" - }, - "require-dev": { - "symfony/finder": "~2.8|~3.0|~4.0", - "symfony/polyfill-apcu": "~1.1" - }, - "suggest": { - "symfony/polyfill-apcu": "For using ApcClassLoader on HHVM" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\ClassLoader\\": "" - }, - "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": "Symfony ClassLoader Component", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/class-loader/tree/v3.4.46" - }, - "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": "2020-10-24T10:57:07+00:00" - }, - { - "name": "wimg/php-compatibility", - "version": "8.2.0", - "source": { - "type": "git", - "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", - "reference": "eaf613c1a8265bcfd7b0ab690783f2aef519f78a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/eaf613c1a8265bcfd7b0ab690783f2aef519f78a", - "reference": "eaf613c1a8265bcfd7b0ab690783f2aef519f78a", - "shasum": "" - }, - "require": { - "php": ">=5.3", - "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" - }, - "conflict": { - "squizlabs/php_codesniffer": "2.6.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" - }, - "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", - "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." - }, - "type": "phpcodesniffer-standard", - "autoload": { - "psr-4": { - "PHPCompatibility\\": "PHPCompatibility/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "LGPL-3.0-or-later" - ], - "authors": [ - { - "name": "Wim Godden", - "role": "lead" - } - ], - "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP version compatibility.", - "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", - "keywords": [ - "compatibility", - "phpcs", - "standards" - ], - "support": { - "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", - "source": "https://github.com/PHPCompatibility/PHPCompatibility" - }, - "abandoned": "phpcompatibility/php-compatibility", - "time": "2018-07-17T13:42:26+00:00" - }, - { - "name": "wp-coding-standards/wpcs", - "version": "0.13.1", - "source": { - "type": "git", - "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", - "reference": "1f64b1a0b5b789822d0303436ee4e30e0135e4dc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/1f64b1a0b5b789822d0303436ee4e30e0135e4dc", - "reference": "1f64b1a0b5b789822d0303436ee4e30e0135e4dc", - "shasum": "" - }, - "require": { - "php": ">=5.3", - "squizlabs/php_codesniffer": "^2.9.0 || ^3.0.2" - }, - "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.4.1" - }, - "type": "phpcodesniffer-standard", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Contributors", - "homepage": "https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/graphs/contributors" - } - ], - "description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions", - "keywords": [ - "phpcs", - "standards", - "wordpress" - ], - "support": { - "issues": "https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/issues", - "source": "https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards", - "wiki": "https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki" - }, - "time": "2017-08-05T16:08:58+00:00" - } - ], - "aliases": [], - "minimum-stability": "dev", - "stability-flags": { - "roave/security-advisories": 20 - }, - "prefer-stable": true, - "prefer-lowest": false, - "platform": { - "php": ">=7.0", - "ext-json": "*" - }, - "platform-dev": [], - "platform-overrides": { - "php": "7.1" - }, - "plugin-api-version": "2.0.0" -} From 46a4023d7f50de210af08ec6c0e3c41cd4d5ae37 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Fri, 30 Oct 2020 11:53:25 +0530 Subject: [PATCH 0750/1044] Add lock file --- composer.lock | 3967 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 3967 insertions(+) create mode 100644 composer.lock diff --git a/composer.lock b/composer.lock new file mode 100644 index 000000000..04292f279 --- /dev/null +++ b/composer.lock @@ -0,0 +1,3967 @@ +{ + "_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": "b8d866712fa07af84a62979e98694f18", + "packages": [ + { + "name": "acmephp/core", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/acmephp/core.git", + "reference": "b038d61f06f3cb1e81a1a3cbe63eae42d9d3d3ca" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/acmephp/core/zipball/b038d61f06f3cb1e81a1a3cbe63eae42d9d3d3ca", + "reference": "b038d61f06f3cb1e81a1a3cbe63eae42d9d3d3ca", + "shasum": "" + }, + "require": { + "acmephp/ssl": "^1.0", + "ext-hash": "*", + "ext-json": "*", + "ext-openssl": "*", + "guzzlehttp/guzzle": "^6.0", + "guzzlehttp/psr7": "^1.0", + "php": ">=5.5.0", + "psr/http-message": "^1.0", + "psr/log": "^1.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.22", + "symfony/process": "^3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "AcmePhp\\Core\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Titouan Galopin", + "email": "galopintitouan@gmail.com", + "homepage": "http://titouangalopin.com" + }, + { + "name": "Jérémy Derussé", + "homepage": "https://twitter.com/jderusse" + } + ], + "description": "Raw implementation of the ACME protocol in PHP", + "homepage": "https://github.com/acmephp/core", + "keywords": [ + "acmephp", + "certificate", + "csr", + "encryption", + "https", + "letsencrypt", + "openssl", + "ssl", + "x509" + ], + "time": "2019-12-17T11:28:20+00:00" + }, + { + "name": "acmephp/ssl", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/acmephp/ssl.git", + "reference": "7b144f9b9b2d6a42065001f784def28b1b2b1f32" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/acmephp/ssl/zipball/7b144f9b9b2d6a42065001f784def28b1b2b1f32", + "reference": "7b144f9b9b2d6a42065001f784def28b1b2b1f32", + "shasum": "" + }, + "require": { + "ext-hash": "*", + "ext-openssl": "*", + "lib-openssl": ">=0.9.8", + "php": ">=5.5.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.22" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "AcmePhp\\Ssl\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Titouan Galopin", + "email": "galopintitouan@gmail.com", + "homepage": "http://titouangalopin.com" + }, + { + "name": "Jérémy Derussé", + "homepage": "https://twitter.com/jderusse" + } + ], + "description": "PHP wrapper around OpenSSL extension providing SSL encoding, decoding, parsing and signing features", + "homepage": "https://github.com/acmephp/ssl", + "keywords": [ + "ECDSA", + "acmephp", + "certificate", + "csr", + "https", + "openssl", + "rsa", + "ssl", + "x509" + ], + "time": "2019-12-17T14:19:42+00:00" + }, + { + "name": "cloudflare/sdk", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/cloudflare/cloudflare-php.git", + "reference": "a3a346ccb2f5cb49759db3d71ba0006a10cf20ef" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cloudflare/cloudflare-php/zipball/a3a346ccb2f5cb49759db3d71ba0006a10cf20ef", + "reference": "a3a346ccb2f5cb49759db3d71ba0006a10cf20ef", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "^6.2.2", + "php": ">=7.0.0", + "psr/http-message": "~1.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.6", + "phpmd/phpmd": "@stable", + "phpunit/phpunit": "5.7.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Cloudflare\\API\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Junade Ali", + "email": "junade@cloudflare.com" + } + ], + "description": "PHP binding for v4 of the Cloudflare Client API.", + "time": "2018-08-28T14:01:57+00:00" + }, + { + "name": "composer/ca-bundle", + "version": "1.2.8", + "source": { + "type": "git", + "url": "https://github.com/composer/ca-bundle.git", + "reference": "8a7ecad675253e4654ea05505233285377405215" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/8a7ecad675253e4654ea05505233285377405215", + "reference": "8a7ecad675253e4654ea05505233285377405215", + "shasum": "" + }, + "require": { + "ext-openssl": "*", + "ext-pcre": "*", + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8", + "psr/log": "^1.0", + "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\CaBundle\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", + "keywords": [ + "cabundle", + "cacert", + "certificate", + "ssl", + "tls" + ], + "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": "2020-08-23T12:54:47+00:00" + }, + { + "name": "composer/composer", + "version": "1.7.3", + "source": { + "type": "git", + "url": "https://github.com/composer/composer.git", + "reference": "e965b9aaa8854c3067f1ed2ae45f436572d73eb7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/composer/zipball/e965b9aaa8854c3067f1ed2ae45f436572d73eb7", + "reference": "e965b9aaa8854c3067f1ed2ae45f436572d73eb7", + "shasum": "" + }, + "require": { + "composer/ca-bundle": "^1.0", + "composer/semver": "^1.0", + "composer/spdx-licenses": "^1.2", + "composer/xdebug-handler": "^1.1", + "justinrainbow/json-schema": "^3.0 || ^4.0 || ^5.0", + "php": "^5.3.2 || ^7.0", + "psr/log": "^1.0", + "seld/jsonlint": "^1.4", + "seld/phar-utils": "^1.0", + "symfony/console": "^2.7 || ^3.0 || ^4.0", + "symfony/filesystem": "^2.7 || ^3.0 || ^4.0", + "symfony/finder": "^2.7 || ^3.0 || ^4.0", + "symfony/process": "^2.7 || ^3.0 || ^4.0" + }, + "conflict": { + "symfony/console": "2.8.38" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7", + "phpunit/phpunit-mock-objects": "^2.3 || ^3.0" + }, + "suggest": { + "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages", + "ext-zip": "Enabling the zip extension allows you to unzip archives", + "ext-zlib": "Allow gzip compression of HTTP requests" + }, + "bin": [ + "bin/composer" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.7-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\": "src/Composer" + } + }, + "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" + } + ], + "description": "Composer helps you declare, manage and install dependencies of PHP projects, ensuring you have the right stack everywhere.", + "homepage": "https://getcomposer.org/", + "keywords": [ + "autoload", + "dependency", + "package" + ], + "time": "2018-11-01T09:05:06+00:00" + }, + { + "name": "composer/semver", + "version": "1.4.2", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/c7cb9a2095a074d131b65a8a0cd294479d785573", + "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.5 || ^5.0.5", + "phpunit/phpunit-mock-objects": "2.3.0 || ^3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.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" + ], + "time": "2016-08-30T16:08:34+00:00" + }, + { + "name": "composer/spdx-licenses", + "version": "1.5.4", + "source": { + "type": "git", + "url": "https://github.com/composer/spdx-licenses.git", + "reference": "6946f785871e2314c60b4524851f3702ea4f2223" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/6946f785871e2314c60b4524851f3702ea4f2223", + "reference": "6946f785871e2314c60b4524851f3702ea4f2223", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Spdx\\": "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": "SPDX licenses list and validation library.", + "keywords": [ + "license", + "spdx", + "validator" + ], + "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": "2020-07-15T15:35:07+00:00" + }, + { + "name": "composer/xdebug-handler", + "version": "1.4.4", + "source": { + "type": "git", + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "6e076a124f7ee146f2487554a94b6a19a74887ba" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6e076a124f7ee146f2487554a94b6a19a74887ba", + "reference": "6e076a124f7ee146f2487554a94b6a19a74887ba", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0", + "psr/log": "^1.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8" + }, + "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" + ], + "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": "2020-10-24T12:39:10+00:00" + }, + { + "name": "easyengine/admin-tools-command", + "version": "v1.0.10", + "source": { + "type": "git", + "url": "https://github.com/EasyEngine/admin-tools-command.git", + "reference": "2e298c92a2a44c29d41af63505e25ff820f03c86" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/EasyEngine/admin-tools-command/zipball/2e298c92a2a44c29d41af63505e25ff820f03c86", + "reference": "2e298c92a2a44c29d41af63505e25ff820f03c86", + "shasum": "" + }, + "type": "ee-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "admin-tools", + "admin-tools enable", + "admin-tools disable" + ] + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "admin-tools-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Command to manage admin tools for php based sites.", + "homepage": "https://github.com/easyengine/amdin-tools", + "time": "2020-08-11T10:14:14+00:00" + }, + { + "name": "easyengine/auth-command", + "version": "v1.0.4", + "source": { + "type": "git", + "url": "https://github.com/EasyEngine/auth-command.git", + "reference": "29cc2d2d3341a32115050bf81de7acb1615cf209" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/EasyEngine/auth-command/zipball/29cc2d2d3341a32115050bf81de7acb1615cf209", + "reference": "29cc2d2d3341a32115050bf81de7acb1615cf209", + "shasum": "" + }, + "type": "ee-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "auth", + "auth create", + "auth delete", + "auth list", + "auth update" + ] + }, + "autoload": { + "psr-4": { + "": "src/", + "\\EE\\Model\\": "src/db/" + }, + "files": [ + "src/auth-utils.php", + "src/helper/hooks.php", + "auth-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Configure HTTP Authentication and whitelisting for EasyEngine site", + "homepage": "https://github.com/easyengine/auth-command", + "time": "2020-08-11T10:12:02+00:00" + }, + { + "name": "easyengine/autoload-splitter", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/EasyEngine/autoload-splitter.git", + "reference": "c59a6fd3ca9a7514e47629567d69c8ada6062e7b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/EasyEngine/autoload-splitter/zipball/c59a6fd3ca9a7514e47629567d69c8ada6062e7b", + "reference": "c59a6fd3ca9a7514e47629567d69c8ada6062e7b", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.1 || ^2.0" + }, + "type": "composer-plugin", + "extra": { + "class": "WP_CLI\\AutoloadSplitter\\ComposerPlugin" + }, + "autoload": { + "psr-4": { + "WP_CLI\\AutoloadSplitter\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Alain Schlesser", + "email": "alain.schlesser@gmail.com", + "homepage": "https://www.alainschlesser.com" + } + ], + "description": "Composer plugin for splitting a generated autoloader into two distinct parts.", + "homepage": "https://wp-cli.org", + "time": "2020-10-29T11:34:56+00:00" + }, + { + "name": "easyengine/config-command", + "version": "v1.0.2", + "source": { + "type": "git", + "url": "https://github.com/EasyEngine/config-command.git", + "reference": "b48e8cdb9456f7a6a7492415b177867f4228d3f6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/EasyEngine/config-command/zipball/b48e8cdb9456f7a6a7492415b177867f4228d3f6", + "reference": "b48e8cdb9456f7a6a7492415b177867f4228d3f6", + "shasum": "" + }, + "type": "ee-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "config", + "config set", + "config get" + ] + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "config-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Manages EasyEngine configuration", + "homepage": "https://github.com/easyengine/config-command", + "time": "2018-12-28T16:04:46+00:00" + }, + { + "name": "easyengine/cron-command", + "version": "v1.0.2", + "source": { + "type": "git", + "url": "https://github.com/EasyEngine/cron-command.git", + "reference": "2646a15829dbce069b47a8014ec3168197e114b6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/EasyEngine/cron-command/zipball/2646a15829dbce069b47a8014ec3168197e114b6", + "reference": "2646a15829dbce069b47a8014ec3168197e114b6", + "shasum": "" + }, + "type": "ee-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "cron", + "cron create", + "cron delete", + "cron update", + "cron list", + "cron run-now" + ] + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "cron-command.php", + "src/helper/hooks.php", + "src/helper/utils.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Manages cron jobs in EasyEngine", + "homepage": "https://github.com/easyengine/cron-command", + "time": "2018-12-28T16:05:27+00:00" + }, + { + "name": "easyengine/log-command", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/EasyEngine/log-command.git", + "reference": "4cd0850ec40a5f4102eec2741a2b31c9a6a1125d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/EasyEngine/log-command/zipball/4cd0850ec40a5f4102eec2741a2b31c9a6a1125d", + "reference": "4cd0850ec40a5f4102eec2741a2b31c9a6a1125d", + "shasum": "" + }, + "type": "ee-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "log show" + ] + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "log-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "homepage": "https://github.com/easyengine/log-command", + "time": "2018-12-28T16:07:01+00:00" + }, + { + "name": "easyengine/mailhog-command", + "version": "v1.0.2", + "source": { + "type": "git", + "url": "https://github.com/EasyEngine/mailhog-command.git", + "reference": "91e8b16c136a65f6c76268322d45061cc02dbb12" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/EasyEngine/mailhog-command/zipball/91e8b16c136a65f6c76268322d45061cc02dbb12", + "reference": "91e8b16c136a65f6c76268322d45061cc02dbb12", + "shasum": "" + }, + "type": "ee-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "mailhog", + "mailhog enable", + "mailhog disable", + "mailhog status" + ] + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "mailhog-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Command to manage mailhog", + "homepage": "https://github.com/easyengine/mailhog-command", + "time": "2018-12-28T16:05:53+00:00" + }, + { + "name": "easyengine/service-command", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/EasyEngine/service-command.git", + "reference": "8278b3e895e7dbb7109e90e492068650217ce997" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/8278b3e895e7dbb7109e90e492068650217ce997", + "reference": "8278b3e895e7dbb7109e90e492068650217ce997", + "shasum": "" + }, + "type": "ee-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "service", + "service enable", + "service disable", + "service restart", + "service reload" + ] + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "src/helper/service-utils.php", + "service-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Command to manager global containers/services in EasyEngine", + "homepage": "https://github.com/easyengine/service-command", + "time": "2020-08-11T10:19:09+00:00" + }, + { + "name": "easyengine/shell-command", + "version": "v1.0.3", + "source": { + "type": "git", + "url": "https://github.com/EasyEngine/shell-command.git", + "reference": "30500e3d1e8aeb3b9e9ac48b92dcbab3841e3beb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/EasyEngine/shell-command/zipball/30500e3d1e8aeb3b9e9ac48b92dcbab3841e3beb", + "reference": "30500e3d1e8aeb3b9e9ac48b92dcbab3841e3beb", + "shasum": "" + }, + "type": "ee-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "shell" + ] + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "shell-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Shell to run helpful commands inside containers.", + "homepage": "https://github.com/easyengine/shell-command", + "time": "2019-03-18T13:42:13+00:00" + }, + { + "name": "easyengine/site-command", + "version": "v2.6.2", + "source": { + "type": "git", + "url": "https://github.com/EasyEngine/site-command.git", + "reference": "b5b87e8a1756ab7beef591fe86a077c301969acf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/b5b87e8a1756ab7beef591fe86a077c301969acf", + "reference": "b5b87e8a1756ab7beef591fe86a077c301969acf", + "shasum": "" + }, + "require": { + "acmephp/core": "1.2.0", + "cloudflare/sdk": "1.1.1", + "ext-openssl": "*", + "guzzlehttp/guzzle": "6.3.3", + "league/flysystem": "1.0.49", + "symfony/serializer": "3.4.20", + "webmozart/assert": "1.3.0" + }, + "type": "ee-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "site create --type=html", + "site delete", + "site update", + "site info --type=html", + "site enable", + "site disable", + "site info", + "site ssl", + "site list", + "site reload --type=html", + "site restart --type=html", + "site share", + "site clean" + ] + }, + "autoload": { + "psr-4": { + "": "src/", + "AcmePhp\\Cli\\": "AcmePhp/Cli" + }, + "files": [ + "src/helper/hooks.php", + "src/helper/site-utils.php", + "site-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "homepage": "https://github.com/easyengine/site-command", + "time": "2020-08-20T09:17:14+00:00" + }, + { + "name": "easyengine/site-type-php", + "version": "v1.3.1", + "source": { + "type": "git", + "url": "https://github.com/EasyEngine/site-type-php.git", + "reference": "9dc599a4b2569ff424ba27febabd624872af01da" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/9dc599a4b2569ff424ba27febabd624872af01da", + "reference": "9dc599a4b2569ff424ba27febabd624872af01da", + "shasum": "" + }, + "require-dev": { + "wp-cli/mustangostang-spyc": "^0.6.3" + }, + "type": "ee-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "site create --type=php", + "site delete", + "site update", + "site info --type=php", + "site enable", + "site disable", + "site info", + "site ssl", + "site list", + "site reload --type=php", + "site restart --type=php", + "site share", + "site clean" + ] + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "site-type-php.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "EasyEngine package for PHP site creation.", + "homepage": "https://github.com/easyengine/site-type-php", + "time": "2020-08-20T09:15:47+00:00" + }, + { + "name": "easyengine/site-type-wp", + "version": "v1.3.2", + "source": { + "type": "git", + "url": "https://github.com/EasyEngine/site-type-wp.git", + "reference": "68903762d08ce05f2aad947229e34a9b10353dc8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/68903762d08ce05f2aad947229e34a9b10353dc8", + "reference": "68903762d08ce05f2aad947229e34a9b10353dc8", + "shasum": "" + }, + "require-dev": { + "wp-cli/mustangostang-spyc": "^0.6.3" + }, + "type": "ee-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "site create --type=wp", + "site delete", + "site update", + "site info --type=wp", + "site enable", + "site disable", + "site info", + "site ssl", + "site list", + "site reload --type=wp", + "site restart --type=wp", + "site share", + "site clean" + ] + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "site-type-wp.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "EasyEngine site type package for WordPress site creation.", + "homepage": "https://github.com/easyengine/site-type-wp", + "time": "2020-09-23T03:49:19+00:00" + }, + { + "name": "guzzlehttp/guzzle", + "version": "6.3.3", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba", + "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba", + "shasum": "" + }, + "require": { + "guzzlehttp/promises": "^1.0", + "guzzlehttp/psr7": "^1.4", + "php": ">=5.5" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", + "psr/log": "^1.0" + }, + "suggest": { + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.3-dev" + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "time": "2018-04-22T15:46:56+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "60d379c243457e073cff02bc323a2a86cb355631" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/60d379c243457e073cff02bc323a2a86cb355631", + "reference": "60d379c243457e073cff02bc323a2a86cb355631", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "symfony/phpunit-bridge": "^4.4 || ^5.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "time": "2020-09-30T07:37:28+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "1.7.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "53330f47520498c0ae1f61f7e2c90f55690c06a3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/53330f47520498c0ae1f61f7e2c90f55690c06a3", + "reference": "53330f47520498c0ae1f61f7e2c90f55690c06a3", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0", + "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "ext-zlib": "*", + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.7-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "time": "2020-09-30T07:37:11+00:00" + }, + { + "name": "justinrainbow/json-schema", + "version": "5.2.7", + "source": { + "type": "git", + "url": "https://github.com/justinrainbow/json-schema.git", + "reference": "8560d4314577199ba51bf2032f02cd1315587c23" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/8560d4314577199ba51bf2032f02cd1315587c23", + "reference": "8560d4314577199ba51bf2032f02cd1315587c23", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.1", + "json-schema/json-schema-test-suite": "1.2.0", + "phpunit/phpunit": "^4.8.35" + }, + "bin": [ + "bin/validate-json" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "JsonSchema\\": "src/JsonSchema/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bruno Prieto Reis", + "email": "bruno.p.reis@gmail.com" + }, + { + "name": "Justin Rainbow", + "email": "justin.rainbow@gmail.com" + }, + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + }, + { + "name": "Robert Schönthal", + "email": "seroscho@googlemail.com" + } + ], + "description": "A library to validate a json schema.", + "homepage": "https://github.com/justinrainbow/json-schema", + "keywords": [ + "json", + "schema" + ], + "time": "2018-02-14T22:26:30+00:00" + }, + { + "name": "league/flysystem", + "version": "1.0.49", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/flysystem.git", + "reference": "a63cc83d8a931b271be45148fa39ba7156782ffd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/a63cc83d8a931b271be45148fa39ba7156782ffd", + "reference": "a63cc83d8a931b271be45148fa39ba7156782ffd", + "shasum": "" + }, + "require": { + "ext-fileinfo": "*", + "php": ">=5.5.9" + }, + "conflict": { + "league/flysystem-sftp": "<1.0.6" + }, + "require-dev": { + "phpspec/phpspec": "^3.4", + "phpunit/phpunit": "^5.7.10" + }, + "suggest": { + "ext-fileinfo": "Required for MimeType", + "ext-ftp": "Allows you to use FTP server storage", + "ext-openssl": "Allows you to use FTPS server storage", + "league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2", + "league/flysystem-aws-s3-v3": "Allows you to use S3 storage with AWS SDK v3", + "league/flysystem-azure": "Allows you to use Windows Azure Blob storage", + "league/flysystem-cached-adapter": "Flysystem adapter decorator for metadata caching", + "league/flysystem-eventable-filesystem": "Allows you to use EventableFilesystem", + "league/flysystem-rackspace": "Allows you to use Rackspace Cloud Files", + "league/flysystem-sftp": "Allows you to use SFTP server storage via phpseclib", + "league/flysystem-webdav": "Allows you to use WebDAV storage", + "league/flysystem-ziparchive": "Allows you to use ZipArchive adapter", + "spatie/flysystem-dropbox": "Allows you to use Dropbox storage", + "srmklive/flysystem-dropbox-v2": "Allows you to use Dropbox storage for PHP 5 applications" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Flysystem\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frank de Jonge", + "email": "info@frenky.net" + } + ], + "description": "Filesystem abstraction: Many filesystems, one API.", + "keywords": [ + "Cloud Files", + "WebDAV", + "abstraction", + "aws", + "cloud", + "copy.com", + "dropbox", + "file systems", + "files", + "filesystem", + "filesystems", + "ftp", + "rackspace", + "remote", + "s3", + "sftp", + "storage" + ], + "time": "2018-11-23T23:41:29+00:00" + }, + { + "name": "monolog/monolog", + "version": "1.24.0", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/monolog.git", + "reference": "bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266", + "reference": "bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "psr/log": "~1.0" + }, + "provide": { + "psr/log-implementation": "1.0.0" + }, + "require-dev": { + "aws/aws-sdk-php": "^2.4.9 || ^3.0", + "doctrine/couchdb": "~1.0@dev", + "graylog2/gelf-php": "~1.0", + "jakub-onderka/php-parallel-lint": "0.9", + "php-amqplib/php-amqplib": "~2.4", + "php-console/php-console": "^3.1.3", + "phpunit/phpunit": "~4.5", + "phpunit/phpunit-mock-objects": "2.3.0", + "ruflin/elastica": ">=0.90 <3.0", + "sentry/sentry": "^0.13", + "swiftmailer/swiftmailer": "^5.3|^6.0" + }, + "suggest": { + "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", + "doctrine/couchdb": "Allow sending log messages to a CouchDB server", + "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", + "ext-mongo": "Allow sending log messages to a MongoDB server", + "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", + "mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver", + "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", + "php-console/php-console": "Allow sending log messages to Google Chrome", + "rollbar/rollbar": "Allow sending log messages to Rollbar", + "ruflin/elastica": "Allow sending log messages to an Elastic Search server", + "sentry/sentry": "Allow sending log messages to a Sentry server" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Monolog\\": "src/Monolog" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Sends your logs to files, sockets, inboxes, databases and various web services", + "homepage": "http://github.com/Seldaek/monolog", + "keywords": [ + "log", + "logging", + "psr-3" + ], + "time": "2018-11-05T09:00:11+00:00" + }, + { + "name": "mustache/mustache", + "version": "v2.12.0", + "source": { + "type": "git", + "url": "https://github.com/bobthecow/mustache.php.git", + "reference": "fe8fe72e9d580591854de404cc59a1b83ca4d19e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/bobthecow/mustache.php/zipball/fe8fe72e9d580591854de404cc59a1b83ca4d19e", + "reference": "fe8fe72e9d580591854de404cc59a1b83ca4d19e", + "shasum": "" + }, + "require": { + "php": ">=5.2.4" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "~1.11", + "phpunit/phpunit": "~3.7|~4.0|~5.0" + }, + "type": "library", + "autoload": { + "psr-0": { + "Mustache": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Justin Hileman", + "email": "justin@justinhileman.info", + "homepage": "http://justinhileman.com" + } + ], + "description": "A Mustache implementation in PHP.", + "homepage": "https://github.com/bobthecow/mustache.php", + "keywords": [ + "mustache", + "templating" + ], + "time": "2017-07-11T12:54:05+00:00" + }, + { + "name": "psr/container", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://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" + ], + "time": "2017-02-14T16:28:37+00:00" + }, + { + "name": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "time": "2016-08-06T14:39:51+00:00" + }, + { + "name": "psr/log", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2020-03-23T09:12:05+00:00" + }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "time": "2019-03-08T08:55:37+00:00" + }, + { + "name": "rmccue/requests", + "version": "v1.7.0", + "source": { + "type": "git", + "url": "https://github.com/rmccue/Requests.git", + "reference": "87932f52ffad70504d93f04f15690cf16a089546" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/rmccue/Requests/zipball/87932f52ffad70504d93f04f15690cf16a089546", + "reference": "87932f52ffad70504d93f04f15690cf16a089546", + "shasum": "" + }, + "require": { + "php": ">=5.2" + }, + "require-dev": { + "requests/test-server": "dev-master" + }, + "type": "library", + "autoload": { + "psr-0": { + "Requests": "library/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "ISC" + ], + "authors": [ + { + "name": "Ryan McCue", + "homepage": "http://ryanmccue.info" + } + ], + "description": "A HTTP library written in PHP, for human beings.", + "homepage": "http://github.com/rmccue/Requests", + "keywords": [ + "curl", + "fsockopen", + "http", + "idna", + "ipv6", + "iri", + "sockets" + ], + "time": "2016-10-13T00:11:37+00:00" + }, + { + "name": "seld/jsonlint", + "version": "1.8.2", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/jsonlint.git", + "reference": "590cfec960b77fd55e39b7d9246659e95dd6d337" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/590cfec960b77fd55e39b7d9246659e95dd6d337", + "reference": "590cfec960b77fd55e39b7d9246659e95dd6d337", + "shasum": "" + }, + "require": { + "php": "^5.3 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "bin": [ + "bin/jsonlint" + ], + "type": "library", + "autoload": { + "psr-4": { + "Seld\\JsonLint\\": "src/Seld/JsonLint/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "JSON Linter", + "keywords": [ + "json", + "linter", + "parser", + "validator" + ], + "funding": [ + { + "url": "https://github.com/Seldaek", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/seld/jsonlint", + "type": "tidelift" + } + ], + "time": "2020-08-25T06:56:57+00:00" + }, + { + "name": "seld/phar-utils", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/phar-utils.git", + "reference": "8674b1d84ffb47cc59a101f5d5a3b61e87d23796" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/8674b1d84ffb47cc59a101f5d5a3b61e87d23796", + "reference": "8674b1d84ffb47cc59a101f5d5a3b61e87d23796", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Seld\\PharUtils\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be" + } + ], + "description": "PHAR file format utilities, for when PHP phars you up", + "keywords": [ + "phar" + ], + "time": "2020-07-07T18:42:57+00:00" + }, + { + "name": "symfony/config", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/config.git", + "reference": "99b2fa8acc244e656cdf324ff419fbe6fd300a4d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/config/zipball/99b2fa8acc244e656cdf324ff419fbe6fd300a4d", + "reference": "99b2fa8acc244e656cdf324ff419fbe6fd300a4d", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/filesystem": "~2.8|~3.0|~4.0", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/dependency-injection": "<3.3", + "symfony/finder": "<3.3" + }, + "require-dev": { + "symfony/dependency-injection": "~3.3|~4.0", + "symfony/event-dispatcher": "~3.3|~4.0", + "symfony/finder": "~3.3|~4.0", + "symfony/yaml": "~3.0|~4.0" + }, + "suggest": { + "symfony/yaml": "To use the yaml reference dumper" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Config\\": "" + }, + "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": "Symfony Config Component", + "homepage": "https://symfony.com", + "time": "2018-10-31T09:06:03+00:00" + }, + { + "name": "symfony/console", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "1d228fb4602047d7b26a0554e0d3efd567da5803" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/1d228fb4602047d7b26a0554e0d3efd567da5803", + "reference": "1d228fb4602047d7b26a0554e0d3efd567da5803", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/debug": "~2.8|~3.0|~4.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/dependency-injection": "<3.4", + "symfony/process": "<3.3" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~3.3|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/event-dispatcher": "~2.8|~3.0|~4.0", + "symfony/lock": "~3.4|~4.0", + "symfony/process": "~3.3|~4.0" + }, + "suggest": { + "psr/log-implementation": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "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": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2018-10-30T16:50:50+00:00" + }, + { + "name": "symfony/debug", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "fe9793af008b651c5441bdeab21ede8172dab097" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/fe9793af008b651c5441bdeab21ede8172dab097", + "reference": "fe9793af008b651c5441bdeab21ede8172dab097", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "psr/log": "~1.0" + }, + "conflict": { + "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + }, + "require-dev": { + "symfony/http-kernel": "~2.8|~3.0|~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Debug\\": "" + }, + "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": "Symfony Debug Component", + "homepage": "https://symfony.com", + "time": "2018-10-31T09:06:03+00:00" + }, + { + "name": "symfony/dependency-injection", + "version": "v3.4.27", + "source": { + "type": "git", + "url": "https://github.com/symfony/dependency-injection.git", + "reference": "be0feb3fa202aedfd8d1956f2dafd563fb13acbf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/be0feb3fa202aedfd8d1956f2dafd563fb13acbf", + "reference": "be0feb3fa202aedfd8d1956f2dafd563fb13acbf", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "psr/container": "^1.0" + }, + "conflict": { + "symfony/config": "<3.3.7", + "symfony/finder": "<3.3", + "symfony/proxy-manager-bridge": "<3.4", + "symfony/yaml": "<3.4" + }, + "provide": { + "psr/container-implementation": "1.0" + }, + "require-dev": { + "symfony/config": "~3.3|~4.0", + "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/yaml": "~3.4|~4.0" + }, + "suggest": { + "symfony/config": "", + "symfony/expression-language": "For using expressions in service container configuration", + "symfony/finder": "For using double-star glob patterns or when GLOB_BRACE portability is required", + "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", + "symfony/yaml": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\DependencyInjection\\": "" + }, + "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": "Symfony DependencyInjection Component", + "homepage": "https://symfony.com", + "time": "2019-04-20T15:32:49+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "db9e829c8f34c3d35cf37fcd4cdb4293bc4a2f14" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/db9e829c8f34c3d35cf37fcd4cdb4293bc4a2f14", + "reference": "db9e829c8f34c3d35cf37fcd4cdb4293bc4a2f14", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "conflict": { + "symfony/dependency-injection": "<3.3" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~2.8|~3.0|~4.0", + "symfony/dependency-injection": "~3.3|~4.0", + "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/stopwatch": "~2.8|~3.0|~4.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "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": "Symfony EventDispatcher Component", + "homepage": "https://symfony.com", + "time": "2018-10-30T16:50:50+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "d69930fc337d767607267d57c20a7403d0a822a4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/d69930fc337d767607267d57c20a7403d0a822a4", + "reference": "d69930fc337d767607267d57c20a7403d0a822a4", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-ctype": "~1.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "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": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "time": "2018-10-02T12:28:39+00:00" + }, + { + "name": "symfony/finder", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "54ba444dddc5bd5708a34bd095ea67c6eb54644d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/54ba444dddc5bd5708a34bd095ea67c6eb54644d", + "reference": "54ba444dddc5bd5708a34bd095ea67c6eb54644d", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "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": "Symfony Finder Component", + "homepage": "https://symfony.com", + "time": "2018-10-03T08:46:40+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.20.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f4ba089a5b6366e453971d3aad5fe8e897b37f41", + "reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.20-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "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" + ], + "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": "2020-10-23T14:02:19+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.20.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "39d483bdf39be819deabf04ec872eb0b2410b531" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/39d483bdf39be819deabf04ec872eb0b2410b531", + "reference": "39d483bdf39be819deabf04ec872eb0b2410b531", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.20-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.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": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "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": "2020-10-23T14:02:19+00:00" + }, + { + "name": "symfony/process", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "35c2914a9f50519bd207164c353ae4d59182c2cb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/35c2914a9f50519bd207164c353ae4d59182c2cb", + "reference": "35c2914a9f50519bd207164c353ae4d59182c2cb", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "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": "Symfony Process Component", + "homepage": "https://symfony.com", + "time": "2018-10-14T17:33:21+00:00" + }, + { + "name": "symfony/serializer", + "version": "v3.4.20", + "source": { + "type": "git", + "url": "https://github.com/symfony/serializer.git", + "reference": "40b326ca34c113da5d626e87fb5d0627b8324098" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/serializer/zipball/40b326ca34c113da5d626e87fb5d0627b8324098", + "reference": "40b326ca34c113da5d626e87fb5d0627b8324098", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "phpdocumentor/type-resolver": "<0.2.1", + "symfony/dependency-injection": "<3.2", + "symfony/property-access": ">=3.0,<3.0.4|>=2.8,<2.8.4", + "symfony/property-info": "<3.1", + "symfony/yaml": "<3.4" + }, + "require-dev": { + "doctrine/annotations": "~1.0", + "doctrine/cache": "~1.0", + "phpdocumentor/reflection-docblock": "^3.0|^4.0", + "symfony/cache": "~3.1|~4.0", + "symfony/config": "~2.8|~3.0|~4.0", + "symfony/dependency-injection": "~3.2|~4.0", + "symfony/http-foundation": "~2.8|~3.0|~4.0", + "symfony/property-access": "~2.8|~3.0|~4.0", + "symfony/property-info": "~3.1|~4.0", + "symfony/yaml": "~3.4|~4.0" + }, + "suggest": { + "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.", + "doctrine/cache": "For using the default cached annotation reader and metadata cache.", + "psr/cache-implementation": "For using the metadata cache.", + "symfony/config": "For using the XML mapping loader.", + "symfony/http-foundation": "To use the DataUriNormalizer.", + "symfony/property-access": "For using the ObjectNormalizer.", + "symfony/property-info": "To deserialize relations.", + "symfony/yaml": "For using the default YAML mapping loader." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Serializer\\": "" + }, + "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": "Symfony Serializer Component", + "homepage": "https://symfony.com", + "time": "2018-12-02T13:20:19+00:00" + }, + { + "name": "symfony/translation", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation.git", + "reference": "94bc3a79008e6640defedf5e14eb3b4f20048352" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation/zipball/94bc3a79008e6640defedf5e14eb3b4f20048352", + "reference": "94bc3a79008e6640defedf5e14eb3b4f20048352", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/config": "<2.8", + "symfony/dependency-injection": "<3.4", + "symfony/yaml": "<3.4" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~2.8|~3.0|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/finder": "~2.8|~3.0|~4.0", + "symfony/intl": "^2.8.18|^3.2.5|~4.0", + "symfony/yaml": "~3.4|~4.0" + }, + "suggest": { + "psr/log-implementation": "To use logging capability in translator", + "symfony/config": "", + "symfony/yaml": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Translation\\": "" + }, + "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": "Symfony Translation Component", + "homepage": "https://symfony.com", + "time": "2018-10-02T16:33:53+00:00" + }, + { + "name": "symfony/yaml", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "640b6c27fed4066d64b64d5903a86043f4a4de7f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/640b6c27fed4066d64b64d5903a86043f4a4de7f", + "reference": "640b6c27fed4066d64b64d5903a86043f4a4de7f", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/console": "<3.4" + }, + "require-dev": { + "symfony/console": "~3.4|~4.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "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": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2018-10-02T16:33:53+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "0df1908962e7a3071564e857d86874dad1ef204a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", + "reference": "0df1908962e7a3071564e857d86874dad1ef204a", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2018-01-29T19:49:41+00:00" + }, + { + "name": "wp-cli/mustangostang-spyc", + "version": "0.6.3", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/spyc.git", + "reference": "6aa0b4da69ce9e9a2c8402dab8d43cf32c581cc7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/spyc/zipball/6aa0b4da69ce9e9a2c8402dab8d43cf32c581cc7", + "reference": "6aa0b4da69ce9e9a2c8402dab8d43cf32c581cc7", + "shasum": "" + }, + "require": { + "php": ">=5.3.1" + }, + "require-dev": { + "phpunit/phpunit": "4.3.*@dev" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.5.x-dev" + } + }, + "autoload": { + "psr-4": { + "Mustangostang\\": "src/" + }, + "files": [ + "includes/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "mustangostang", + "email": "vlad.andersen@gmail.com" + } + ], + "description": "A simple YAML loader/dumper class for PHP (WP-CLI fork)", + "homepage": "https://github.com/mustangostang/spyc/", + "time": "2017-04-25T11:26:20+00:00" + }, + { + "name": "wp-cli/php-cli-tools", + "version": "v0.11.10", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/php-cli-tools.git", + "reference": "f99308f92487efe18b5aac2057240fe5bb542374" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/php-cli-tools/zipball/f99308f92487efe18b5aac2057240fe5bb542374", + "reference": "f99308f92487efe18b5aac2057240fe5bb542374", + "shasum": "" + }, + "require": { + "php": ">= 5.3.0" + }, + "type": "library", + "autoload": { + "psr-0": { + "cli": "lib/" + }, + "files": [ + "lib/cli/cli.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "James Logsdon", + "email": "jlogsdon@php.net", + "role": "Developer" + }, + { + "name": "Daniel Bachhuber", + "email": "daniel@handbuilt.co", + "role": "Maintainer" + } + ], + "description": "Console utilities for PHP", + "homepage": "http://github.com/wp-cli/php-cli-tools", + "keywords": [ + "cli", + "console" + ], + "time": "2018-08-22T10:11:06+00:00" + } + ], + "packages-dev": [ + { + "name": "behat/behat", + "version": "v3.7.0", + "source": { + "type": "git", + "url": "https://github.com/Behat/Behat.git", + "reference": "08052f739619a9e9f62f457a67302f0715e6dd13" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Behat/Behat/zipball/08052f739619a9e9f62f457a67302f0715e6dd13", + "reference": "08052f739619a9e9f62f457a67302f0715e6dd13", + "shasum": "" + }, + "require": { + "behat/gherkin": "^4.6.0", + "behat/transliterator": "^1.2", + "ext-mbstring": "*", + "php": ">=5.3.3", + "psr/container": "^1.0", + "symfony/config": "^2.7.51 || ^3.0 || ^4.0 || ^5.0", + "symfony/console": "^2.7.51 || ^2.8.33 || ^3.3.15 || ^3.4.3 || ^4.0.3 || ^5.0", + "symfony/dependency-injection": "^2.7.51 || ^3.0 || ^4.0 || ^5.0", + "symfony/event-dispatcher": "^2.7.51 || ^3.0 || ^4.0 || ^5.0", + "symfony/translation": "^2.7.51 || ^3.0 || ^4.0 || ^5.0", + "symfony/yaml": "^2.7.51 || ^3.0 || ^4.0 || ^5.0" + }, + "require-dev": { + "container-interop/container-interop": "^1.2", + "herrera-io/box": "~1.6.1", + "phpunit/phpunit": "^4.8.36 || ^6.5.14 || ^7.5.20", + "symfony/process": "~2.5 || ^3.0 || ^4.0 || ^5.0" + }, + "suggest": { + "ext-dom": "Needed to output test results in JUnit format." + }, + "bin": [ + "bin/behat" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.6.x-dev" + } + }, + "autoload": { + "psr-4": { + "Behat\\Behat\\": "src/Behat/Behat/", + "Behat\\Testwork\\": "src/Behat/Testwork/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + } + ], + "description": "Scenario-oriented BDD framework for PHP 5.3", + "homepage": "http://behat.org/", + "keywords": [ + "Agile", + "BDD", + "ScenarioBDD", + "Scrum", + "StoryBDD", + "User story", + "business", + "development", + "documentation", + "examples", + "symfony", + "testing" + ], + "time": "2020-06-03T13:08:44+00:00" + }, + { + "name": "behat/gherkin", + "version": "v4.6.2", + "source": { + "type": "git", + "url": "https://github.com/Behat/Gherkin.git", + "reference": "51ac4500c4dc30cbaaabcd2f25694299df666a31" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Behat/Gherkin/zipball/51ac4500c4dc30cbaaabcd2f25694299df666a31", + "reference": "51ac4500c4dc30cbaaabcd2f25694299df666a31", + "shasum": "" + }, + "require": { + "php": ">=5.3.1" + }, + "require-dev": { + "phpunit/phpunit": "~4.5|~5", + "symfony/phpunit-bridge": "~2.7|~3|~4", + "symfony/yaml": "~2.3|~3|~4" + }, + "suggest": { + "symfony/yaml": "If you want to parse features, represented in YAML files" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.4-dev" + } + }, + "autoload": { + "psr-0": { + "Behat\\Gherkin": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + } + ], + "description": "Gherkin DSL parser for PHP 5.3", + "homepage": "http://behat.org/", + "keywords": [ + "BDD", + "Behat", + "Cucumber", + "DSL", + "gherkin", + "parser" + ], + "time": "2020-03-17T14:03:26+00:00" + }, + { + "name": "behat/transliterator", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/Behat/Transliterator.git", + "reference": "3c4ec1d77c3d05caa1f0bf8fb3aae4845005c7fc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Behat/Transliterator/zipball/3c4ec1d77c3d05caa1f0bf8fb3aae4845005c7fc", + "reference": "3c4ec1d77c3d05caa1f0bf8fb3aae4845005c7fc", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "chuyskywalker/rolling-curl": "^3.1", + "php-yaoi/php-yaoi": "^1.0", + "phpunit/phpunit": "^4.8.36|^6.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + }, + "autoload": { + "psr-4": { + "Behat\\Transliterator\\": "src/Behat/Transliterator" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Artistic-1.0" + ], + "description": "String transliterator", + "keywords": [ + "i18n", + "slug", + "transliterator" + ], + "time": "2020-01-14T16:39:13+00:00" + }, + { + "name": "dealerdirect/phpcodesniffer-composer-installer", + "version": "v0.7.0", + "source": { + "type": "git", + "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", + "reference": "e8d808670b8f882188368faaf1144448c169c0b7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/e8d808670b8f882188368faaf1144448c169c0b7", + "reference": "e8d808670b8f882188368faaf1144448c169c0b7", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0 || ^2.0", + "php": ">=5.3", + "squizlabs/php_codesniffer": "^2 || ^3 || 4.0.x-dev" + }, + "require-dev": { + "composer/composer": "*", + "phpcompatibility/php-compatibility": "^9.0", + "sensiolabs/security-checker": "^4.1.0" + }, + "type": "composer-plugin", + "extra": { + "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" + }, + "autoload": { + "psr-4": { + "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Franck Nijhof", + "email": "franck.nijhof@dealerdirect.com", + "homepage": "http://www.frenck.nl", + "role": "Developer / IT Manager" + } + ], + "description": "PHP_CodeSniffer Standards Composer Installer Plugin", + "homepage": "http://www.dealerdirect.com", + "keywords": [ + "PHPCodeSniffer", + "PHP_CodeSniffer", + "code quality", + "codesniffer", + "composer", + "installer", + "phpcs", + "plugin", + "qa", + "quality", + "standard", + "standards", + "style guide", + "stylecheck", + "tests" + ], + "time": "2020-06-25T14:57:39+00:00" + }, + { + "name": "phpcompatibility/php-compatibility", + "version": "8.2.0", + "source": { + "type": "git", + "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", + "reference": "eaf613c1a8265bcfd7b0ab690783f2aef519f78a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/eaf613c1a8265bcfd7b0ab690783f2aef519f78a", + "reference": "eaf613c1a8265bcfd7b0ab690783f2aef519f78a", + "shasum": "" + }, + "require": { + "php": ">=5.3", + "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" + }, + "conflict": { + "squizlabs/php_codesniffer": "2.6.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", + "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + }, + "type": "phpcodesniffer-standard", + "autoload": { + "psr-4": { + "PHPCompatibility\\": "PHPCompatibility/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Wim Godden", + "role": "lead" + } + ], + "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP version compatibility.", + "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", + "keywords": [ + "compatibility", + "phpcs", + "standards" + ], + "time": "2018-07-17T13:42:26+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "1.2.18", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "fe2466802556d3fe4e4d1d58ffd3ccfd0a19be0b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/fe2466802556d3fe4e4d1d58ffd3ccfd0a19be0b", + "reference": "fe2466802556d3fe4e4d1d58ffd3ccfd0a19be0b", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "phpunit/php-file-iterator": ">=1.3.0@stable", + "phpunit/php-text-template": ">=1.2.0@stable", + "phpunit/php-token-stream": ">=1.1.3,<1.3.0" + }, + "require-dev": { + "phpunit/phpunit": "3.7.*@dev" + }, + "suggest": { + "ext-dom": "*", + "ext-xdebug": ">=2.0.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "PHP/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "time": "2014-09-02T10:13:14+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "050bedf145a257b1ff02746c31894800e5122946" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/050bedf145a257b1ff02746c31894800e5122946", + "reference": "050bedf145a257b1ff02746c31894800e5122946", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "time": "2018-09-13T20:33:42+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2017-02-26T11:10:40+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "1.2.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "ad4e1e23ae01b483c16f600ff1bebec184588e32" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/ad4e1e23ae01b483c16f600ff1bebec184588e32", + "reference": "ad4e1e23ae01b483c16f600ff1bebec184588e32", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + }, + "autoload": { + "classmap": [ + "PHP/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "abandoned": true, + "time": "2014-03-03T05:10:30+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "3.7.18", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "82335c294ae39a59965b0dc2027ac74eb62f53f1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/82335c294ae39a59965b0dc2027ac74eb62f53f1", + "reference": "82335c294ae39a59965b0dc2027ac74eb62f53f1", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-spl": "*", + "php": ">=5.3.3", + "phpunit/php-code-coverage": ">=1.2.1,<1.3.0", + "phpunit/php-file-iterator": ">=1.3.1", + "phpunit/php-text-template": ">=1.1.1", + "phpunit/php-timer": ">=1.0.2,<1.1.0", + "phpunit/phpunit-mock-objects": ">=1.2.0,<1.3.0", + "symfony/yaml": ">=2.2.0" + }, + "require-dev": { + "pear-pear/pear": "1.9.4" + }, + "suggest": { + "ext-json": "*", + "ext-simplexml": "*", + "ext-tokenizer": "*", + "phpunit/php-invoker": ">=1.1.0,<1.2.0" + }, + "bin": [ + "composer/bin/phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.7.x-dev" + } + }, + "autoload": { + "classmap": [ + "PHPUnit/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "", + "../../symfony/yaml/" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "http://www.phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "time": "2013-03-07T21:45:39+00:00" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "1.2.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "5794e3c5c5ba0fb037b11d8151add2a07fa82875" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/5794e3c5c5ba0fb037b11d8151add2a07fa82875", + "reference": "5794e3c5c5ba0fb037b11d8151add2a07fa82875", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "phpunit/php-text-template": ">=1.1.1@stable" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "autoload": { + "classmap": [ + "PHPUnit/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "abandoned": true, + "time": "2013-01-13T10:24:48+00:00" + }, + { + "name": "roave/security-advisories", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/Roave/SecurityAdvisories.git", + "reference": "327370943772f9917bc2dc2aa4263db2d572a112" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/327370943772f9917bc2dc2aa4263db2d572a112", + "reference": "327370943772f9917bc2dc2aa4263db2d572a112", + "shasum": "" + }, + "conflict": { + "3f/pygmentize": "<1.2", + "adodb/adodb-php": "<5.20.12", + "alterphp/easyadmin-extension-bundle": ">=1.2,<1.2.11|>=1.3,<1.3.1", + "amphp/artax": "<1.0.6|>=2,<2.0.6", + "amphp/http": "<1.0.1", + "amphp/http-client": ">=4,<4.4", + "api-platform/core": ">=2.2,<2.2.10|>=2.3,<2.3.6", + "asymmetricrypt/asymmetricrypt": ">=0,<9.9.99", + "aws/aws-sdk-php": ">=3,<3.2.1", + "bagisto/bagisto": "<0.1.5", + "barrelstrength/sprout-base-email": "<1.2.7", + "barrelstrength/sprout-forms": "<3.9", + "baserproject/basercms": ">=4,<=4.3.6", + "bolt/bolt": "<3.7.1", + "brightlocal/phpwhois": "<=4.2.5", + "buddypress/buddypress": "<5.1.2", + "bugsnag/bugsnag-laravel": ">=2,<2.0.2", + "cakephp/cakephp": ">=1.3,<1.3.18|>=2,<2.4.99|>=2.5,<2.5.99|>=2.6,<2.6.12|>=2.7,<2.7.6|>=3,<3.5.18|>=3.6,<3.6.15|>=3.7,<3.7.7", + "cart2quote/module-quotation": ">=4.1.6,<=4.4.5|>=5,<5.4.4", + "cartalyst/sentry": "<=2.1.6", + "centreon/centreon": "<18.10.8|>=19,<19.4.5", + "cesnet/simplesamlphp-module-proxystatistics": "<3.1", + "codeigniter/framework": "<=3.0.6", + "composer/composer": "<=1-alpha.11", + "contao-components/mediaelement": ">=2.14.2,<2.21.1", + "contao/core": ">=2,<3.5.39", + "contao/core-bundle": ">=4,<4.4.52|>=4.5,<4.9.6|= 4.10.0", + "contao/listing-bundle": ">=4,<4.4.8", + "datadog/dd-trace": ">=0.30,<0.30.2", + "david-garcia/phpwhois": "<=4.3.1", + "derhansen/sf_event_mgt": "<4.3.1|>=5,<5.1.1", + "doctrine/annotations": ">=1,<1.2.7", + "doctrine/cache": ">=1,<1.3.2|>=1.4,<1.4.2", + "doctrine/common": ">=2,<2.4.3|>=2.5,<2.5.1", + "doctrine/dbal": ">=2,<2.0.8|>=2.1,<2.1.2", + "doctrine/doctrine-bundle": "<1.5.2", + "doctrine/doctrine-module": "<=0.7.1", + "doctrine/mongodb-odm": ">=1,<1.0.2", + "doctrine/mongodb-odm-bundle": ">=2,<3.0.1", + "doctrine/orm": ">=2,<2.4.8|>=2.5,<2.5.1", + "dolibarr/dolibarr": "<11.0.4", + "dompdf/dompdf": ">=0.6,<0.6.2", + "drupal/core": ">=7,<7.73|>=8,<8.8.10|>=8.9,<8.9.6|>=9,<9.0.6", + "drupal/drupal": ">=7,<7.73|>=8,<8.8.10|>=8.9,<8.9.6|>=9,<9.0.6", + "endroid/qr-code-bundle": "<3.4.2", + "enshrined/svg-sanitize": "<0.13.1", + "erusev/parsedown": "<1.7.2", + "ezsystems/demobundle": ">=5.4,<5.4.6.1", + "ezsystems/ezdemo-ls-extension": ">=5.4,<5.4.2.1", + "ezsystems/ezfind-ls": ">=5.3,<5.3.6.1|>=5.4,<5.4.11.1|>=2017.12,<2017.12.0.1", + "ezsystems/ezplatform": ">=1.7,<1.7.9.1|>=1.13,<1.13.5.1|>=2.5,<2.5.4", + "ezsystems/ezplatform-admin-ui": ">=1.3,<1.3.5|>=1.4,<1.4.6", + "ezsystems/ezplatform-admin-ui-assets": ">=4,<4.2.1|>=5,<5.0.1|>=5.1,<5.1.1", + "ezsystems/ezplatform-kernel": ">=1,<1.0.2.1", + "ezsystems/ezplatform-user": ">=1,<1.0.1", + "ezsystems/ezpublish-kernel": ">=5.3,<5.3.12.1|>=5.4,<5.4.14.2|>=6,<6.7.9.1|>=6.8,<6.13.6.3|>=7,<7.2.4.1|>=7.3,<7.3.2.1|>=7.5,<7.5.7.1", + "ezsystems/ezpublish-legacy": ">=5.3,<5.3.12.6|>=5.4,<5.4.14.2|>=2011,<2017.12.7.3|>=2018.6,<2018.6.1.4|>=2018.9,<2018.9.1.3|>=2019.3,<2019.3.5.1", + "ezsystems/platform-ui-assets-bundle": ">=4.2,<4.2.3", + "ezsystems/repository-forms": ">=2.3,<2.3.2.1", + "ezyang/htmlpurifier": "<4.1.1", + "firebase/php-jwt": "<2", + "fooman/tcpdf": "<6.2.22", + "fossar/tcpdf-parser": "<6.2.22", + "friendsofsymfony/oauth2-php": "<1.3", + "friendsofsymfony/rest-bundle": ">=1.2,<1.2.2", + "friendsofsymfony/user-bundle": ">=1.2,<1.3.5", + "friendsoftypo3/mediace": ">=7.6.2,<7.6.5", + "fuel/core": "<1.8.1", + "getgrav/grav": "<1.7-beta.8", + "gos/web-socket-bundle": "<1.10.4|>=2,<2.6.1|>=3,<3.3", + "gree/jose": "<=2.2", + "gregwar/rst": "<1.0.3", + "guzzlehttp/guzzle": ">=4-rc.2,<4.2.4|>=5,<5.3.1|>=6,<6.2.1", + "illuminate/auth": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.10", + "illuminate/cookie": ">=4,<=4.0.11|>=4.1,<=4.1.99999|>=4.2,<=4.2.99999|>=5,<=5.0.99999|>=5.1,<=5.1.99999|>=5.2,<=5.2.99999|>=5.3,<=5.3.99999|>=5.4,<=5.4.99999|>=5.5,<=5.5.49|>=5.6,<=5.6.99999|>=5.7,<=5.7.99999|>=5.8,<=5.8.99999|>=6,<6.18.31|>=7,<7.22.4", + "illuminate/database": ">=4,<4.0.99|>=4.1,<4.1.29|>=5.5,<=5.5.44|>=6,<6.18.34|>=7,<7.23.2", + "illuminate/encryption": ">=4,<=4.0.11|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.40|>=5.6,<5.6.15", + "illuminate/view": ">=7,<7.1.2", + "ivankristianto/phpwhois": "<=4.3", + "james-heinrich/getid3": "<1.9.9", + "joomla/session": "<1.3.1", + "jsmitty12/phpwhois": "<5.1", + "kazist/phpwhois": "<=4.2.6", + "kitodo/presentation": "<3.1.2", + "kreait/firebase-php": ">=3.2,<3.8.1", + "la-haute-societe/tcpdf": "<6.2.22", + "laravel/framework": ">=4,<4.0.99|>=4.1,<=4.1.99999|>=4.2,<=4.2.99999|>=5,<=5.0.99999|>=5.1,<=5.1.99999|>=5.2,<=5.2.99999|>=5.3,<=5.3.99999|>=5.4,<=5.4.99999|>=5.5,<=5.5.49|>=5.6,<=5.6.99999|>=5.7,<=5.7.99999|>=5.8,<=5.8.99999|>=6,<6.18.34|>=7,<7.23.2", + "laravel/socialite": ">=1,<1.0.99|>=2,<2.0.10", + "league/commonmark": "<0.18.3", + "librenms/librenms": "<1.53", + "livewire/livewire": ">2.2.4,<2.2.6", + "magento/community-edition": ">=2,<2.2.10|>=2.3,<2.3.3", + "magento/magento1ce": "<1.9.4.3", + "magento/magento1ee": ">=1,<1.14.4.3", + "magento/product-community-edition": ">=2,<2.2.10|>=2.3,<2.3.2-p.2", + "marcwillmann/turn": "<0.3.3", + "mediawiki/core": ">=1.31,<1.31.4|>=1.32,<1.32.4|>=1.33,<1.33.1", + "mittwald/typo3_forum": "<1.2.1", + "monolog/monolog": ">=1.8,<1.12", + "namshi/jose": "<2.2", + "nette/application": ">=2,<2.0.19|>=2.1,<2.1.13|>=2.2,<2.2.10|>=2.3,<2.3.14|>=2.4,<2.4.16|>=3,<3.0.6", + "nette/nette": ">=2,<2.0.19|>=2.1,<2.1.13", + "nystudio107/craft-seomatic": "<3.3", + "nzo/url-encryptor-bundle": ">=4,<4.3.2|>=5,<5.0.1", + "october/backend": ">=1.0.319,<1.0.467", + "october/cms": ">=1.0.319,<1.0.466", + "october/october": ">=1.0.319,<1.0.466", + "october/rain": ">=1.0.319,<1.0.468", + "onelogin/php-saml": "<2.10.4", + "oneup/uploader-bundle": "<1.9.3|>=2,<2.1.5", + "openid/php-openid": "<2.3", + "openmage/magento-lts": "<19.4.6|>=20,<20.0.2", + "oro/crm": ">=1.7,<1.7.4", + "oro/platform": ">=1.7,<1.7.4", + "padraic/humbug_get_contents": "<1.1.2", + "pagarme/pagarme-php": ">=0,<3", + "paragonie/random_compat": "<2", + "paypal/merchant-sdk-php": "<3.12", + "pear/archive_tar": "<1.4.4", + "personnummer/personnummer": "<3.0.2", + "phpfastcache/phpfastcache": ">=5,<5.0.13", + "phpmailer/phpmailer": "<6.1.6", + "phpmussel/phpmussel": ">=1,<1.6", + "phpmyadmin/phpmyadmin": "<4.9.2", + "phpoffice/phpexcel": "<1.8.2", + "phpoffice/phpspreadsheet": "<1.8", + "phpunit/phpunit": ">=4.8.19,<4.8.28|>=5.0.10,<5.6.3", + "phpwhois/phpwhois": "<=4.2.5", + "phpxmlrpc/extras": "<0.6.1", + "pimcore/pimcore": "<6.3", + "prestashop/autoupgrade": ">=4,<4.10.1", + "prestashop/contactform": ">1.0.1,<4.3", + "prestashop/gamification": "<2.3.2", + "prestashop/ps_facetedsearch": "<3.4.1", + "privatebin/privatebin": "<1.2.2|>=1.3,<1.3.2", + "propel/propel": ">=2-alpha.1,<=2-alpha.7", + "propel/propel1": ">=1,<=1.7.1", + "pterodactyl/panel": "<0.7.19|>=1-rc.0,<=1-rc.6", + "pusher/pusher-php-server": "<2.2.1", + "rainlab/debugbar-plugin": "<3.1", + "robrichards/xmlseclibs": "<3.0.4", + "sabberworm/php-css-parser": ">=1,<1.0.1|>=2,<2.0.1|>=3,<3.0.1|>=4,<4.0.1|>=5,<5.0.9|>=5.1,<5.1.3|>=5.2,<5.2.1|>=6,<6.0.2|>=7,<7.0.4|>=8,<8.0.1|>=8.1,<8.1.1|>=8.2,<8.2.1|>=8.3,<8.3.1", + "sabre/dav": ">=1.6,<1.6.99|>=1.7,<1.7.11|>=1.8,<1.8.9", + "scheb/two-factor-bundle": ">=0,<3.26|>=4,<4.11", + "sensiolabs/connect": "<4.2.3", + "serluck/phpwhois": "<=4.2.6", + "shopware/core": "<=6.3.1", + "shopware/platform": "<=6.3.1", + "shopware/shopware": "<5.3.7", + "silverstripe/admin": ">=1.0.3,<1.0.4|>=1.1,<1.1.1", + "silverstripe/assets": ">=1,<1.4.7|>=1.5,<1.5.2", + "silverstripe/cms": "<4.3.6|>=4.4,<4.4.4", + "silverstripe/comments": ">=1.3,<1.9.99|>=2,<2.9.99|>=3,<3.1.1", + "silverstripe/forum": "<=0.6.1|>=0.7,<=0.7.3", + "silverstripe/framework": "<4.4.7|>=4.5,<4.5.4", + "silverstripe/graphql": ">=2,<2.0.5|>=3,<3.1.2|>=3.2,<3.2.4", + "silverstripe/registry": ">=2.1,<2.1.2|>=2.2,<2.2.1", + "silverstripe/restfulserver": ">=1,<1.0.9|>=2,<2.0.4", + "silverstripe/subsites": ">=2,<2.1.1", + "silverstripe/taxonomy": ">=1.3,<1.3.1|>=2,<2.0.1", + "silverstripe/userforms": "<3", + "simple-updates/phpwhois": "<=1", + "simplesamlphp/saml2": "<1.10.6|>=2,<2.3.8|>=3,<3.1.4", + "simplesamlphp/simplesamlphp": "<1.18.6", + "simplesamlphp/simplesamlphp-module-infocard": "<1.0.1", + "simplito/elliptic-php": "<1.0.6", + "slim/slim": "<2.6", + "smarty/smarty": "<3.1.33", + "socalnick/scn-social-auth": "<1.15.2", + "spoonity/tcpdf": "<6.2.22", + "squizlabs/php_codesniffer": ">=1,<2.8.1|>=3,<3.0.1", + "ssddanbrown/bookstack": "<0.29.2", + "stormpath/sdk": ">=0,<9.9.99", + "studio-42/elfinder": "<2.1.49", + "sulu/sulu": "<1.6.34|>=2,<2.0.10|>=2.1,<2.1.1", + "swiftmailer/swiftmailer": ">=4,<5.4.5", + "sylius/admin-bundle": ">=1,<1.0.17|>=1.1,<1.1.9|>=1.2,<1.2.2", + "sylius/grid": ">=1,<1.1.19|>=1.2,<1.2.18|>=1.3,<1.3.13|>=1.4,<1.4.5|>=1.5,<1.5.1", + "sylius/grid-bundle": ">=1,<1.1.19|>=1.2,<1.2.18|>=1.3,<1.3.13|>=1.4,<1.4.5|>=1.5,<1.5.1", + "sylius/resource-bundle": "<1.3.14|>=1.4,<1.4.7|>=1.5,<1.5.2|>=1.6,<1.6.4", + "sylius/sylius": "<1.3.16|>=1.4,<1.4.12|>=1.5,<1.5.9|>=1.6,<1.6.5", + "symbiote/silverstripe-multivaluefield": ">=3,<3.0.99", + "symbiote/silverstripe-versionedfiles": "<=2.0.3", + "symfony/cache": ">=3.1,<3.4.35|>=4,<4.2.12|>=4.3,<4.3.8", + "symfony/dependency-injection": ">=2,<2.0.17|>=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", + "symfony/error-handler": ">=4.4,<4.4.4|>=5,<5.0.4", + "symfony/form": ">=2.3,<2.3.35|>=2.4,<2.6.12|>=2.7,<2.7.50|>=2.8,<2.8.49|>=3,<3.4.20|>=4,<4.0.15|>=4.1,<4.1.9|>=4.2,<4.2.1", + "symfony/framework-bundle": ">=2,<2.3.18|>=2.4,<2.4.8|>=2.5,<2.5.2|>=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", + "symfony/http-foundation": ">=2,<2.8.52|>=3,<3.4.35|>=4,<4.2.12|>=4.3,<4.3.8|>=4.4,<4.4.7|>=5,<5.0.7", + "symfony/http-kernel": ">=2,<2.8.52|>=3,<3.4.35|>=4,<4.2.12|>=4.3,<4.4.13|>=5,<5.1.5", + "symfony/intl": ">=2.7,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", + "symfony/mime": ">=4.3,<4.3.8", + "symfony/phpunit-bridge": ">=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", + "symfony/polyfill": ">=1,<1.10", + "symfony/polyfill-php55": ">=1,<1.10", + "symfony/proxy-manager-bridge": ">=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", + "symfony/routing": ">=2,<2.0.19", + "symfony/security": ">=2,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7|>=4.4,<4.4.7|>=5,<5.0.7", + "symfony/security-bundle": ">=2,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", + "symfony/security-core": ">=2.4,<2.6.13|>=2.7,<2.7.9|>=2.7.30,<2.7.32|>=2.8,<2.8.37|>=3,<3.3.17|>=3.4,<3.4.7|>=4,<4.0.7", + "symfony/security-csrf": ">=2.4,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", + "symfony/security-guard": ">=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", + "symfony/security-http": ">=2.3,<2.3.41|>=2.4,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.2.12|>=4.3,<4.3.8|>=4.4,<4.4.7|>=5,<5.0.7", + "symfony/serializer": ">=2,<2.0.11", + "symfony/symfony": ">=2,<2.8.52|>=3,<3.4.35|>=4,<4.2.12|>=4.3,<4.4.13|>=5,<5.1.5", + "symfony/translation": ">=2,<2.0.17", + "symfony/validator": ">=2,<2.0.24|>=2.1,<2.1.12|>=2.2,<2.2.5|>=2.3,<2.3.3", + "symfony/var-exporter": ">=4.2,<4.2.12|>=4.3,<4.3.8", + "symfony/web-profiler-bundle": ">=2,<2.3.19|>=2.4,<2.4.9|>=2.5,<2.5.4", + "symfony/yaml": ">=2,<2.0.22|>=2.1,<2.1.7", + "t3g/svg-sanitizer": "<1.0.3", + "tecnickcom/tcpdf": "<6.2.22", + "thelia/backoffice-default-template": ">=2.1,<2.1.2", + "thelia/thelia": ">=2.1-beta.1,<2.1.3", + "theonedemon/phpwhois": "<=4.2.5", + "titon/framework": ">=0,<9.9.99", + "truckersmp/phpwhois": "<=4.3.1", + "twig/twig": "<1.38|>=2,<2.7", + "typo3/cms": ">=6.2,<6.2.30|>=7,<7.6.32|>=8,<8.7.30|>=9,<9.5.20|>=10,<10.4.6", + "typo3/cms-core": ">=8,<8.7.30|>=9,<9.5.20|>=10,<10.4.6", + "typo3/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.10|>=3.1,<3.1.7|>=3.2,<3.2.7|>=3.3,<3.3.5", + "typo3/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4", + "typo3/phar-stream-wrapper": ">=1,<2.1.1|>=3,<3.1.1", + "typo3fluid/fluid": ">=2,<2.0.5|>=2.1,<2.1.4|>=2.2,<2.2.1|>=2.3,<2.3.5|>=2.4,<2.4.1|>=2.5,<2.5.5|>=2.6,<2.6.1", + "ua-parser/uap-php": "<3.8", + "usmanhalalit/pixie": "<1.0.3|>=2,<2.0.2", + "verot/class.upload.php": "<=1.0.3|>=2,<=2.0.4", + "wallabag/tcpdf": "<6.2.22", + "willdurand/js-translation-bundle": "<2.1.1", + "yii2mod/yii2-cms": "<1.9.2", + "yiisoft/yii": ">=1.1.14,<1.1.15", + "yiisoft/yii2": "<2.0.38", + "yiisoft/yii2-bootstrap": "<2.0.4", + "yiisoft/yii2-dev": "<2.0.15", + "yiisoft/yii2-elasticsearch": "<2.0.5", + "yiisoft/yii2-gii": "<2.0.4", + "yiisoft/yii2-jui": "<2.0.4", + "yiisoft/yii2-redis": "<2.0.8", + "yourls/yourls": "<1.7.4", + "zendframework/zend-cache": ">=2.4,<2.4.8|>=2.5,<2.5.3", + "zendframework/zend-captcha": ">=2,<2.4.9|>=2.5,<2.5.2", + "zendframework/zend-crypt": ">=2,<2.4.9|>=2.5,<2.5.2", + "zendframework/zend-db": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.10|>=2.3,<2.3.5", + "zendframework/zend-developer-tools": ">=1.2.2,<1.2.3", + "zendframework/zend-diactoros": ">=1,<1.8.4", + "zendframework/zend-feed": ">=1,<2.10.3", + "zendframework/zend-form": ">=2,<2.2.7|>=2.3,<2.3.1", + "zendframework/zend-http": ">=1,<2.8.1", + "zendframework/zend-json": ">=2.1,<2.1.6|>=2.2,<2.2.6", + "zendframework/zend-ldap": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.8|>=2.3,<2.3.3", + "zendframework/zend-mail": ">=2,<2.4.11|>=2.5,<2.7.2", + "zendframework/zend-navigation": ">=2,<2.2.7|>=2.3,<2.3.1", + "zendframework/zend-session": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.9|>=2.3,<2.3.4", + "zendframework/zend-validator": ">=2.3,<2.3.6", + "zendframework/zend-view": ">=2,<2.2.7|>=2.3,<2.3.1", + "zendframework/zend-xmlrpc": ">=2.1,<2.1.6|>=2.2,<2.2.6", + "zendframework/zendframework": "<2.5.1", + "zendframework/zendframework1": "<1.12.20", + "zendframework/zendopenid": ">=2,<2.0.2", + "zendframework/zendxml": ">=1,<1.0.1", + "zetacomponents/mail": "<1.8.2", + "zf-commons/zfc-user": "<1.2.2", + "zfcampus/zf-apigility-doctrine": ">=1,<1.0.3", + "zfr/zfr-oauth2-server-module": "<0.1.2" + }, + "type": "metapackage", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "role": "maintainer" + }, + { + "name": "Ilya Tribusean", + "email": "slash3b@gmail.com", + "role": "maintainer" + } + ], + "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", + "funding": [ + { + "url": "https://github.com/Ocramius", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/roave/security-advisories", + "type": "tidelift" + } + ], + "time": "2020-10-19T07:02:45+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "3.5.8", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "9d583721a7157ee997f235f327de038e7ea6dac4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/9d583721a7157ee997f235f327de038e7ea6dac4", + "reference": "9d583721a7157ee997f235f327de038e7ea6dac4", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + }, + "bin": [ + "bin/phpcs", + "bin/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", + "keywords": [ + "phpcs", + "standards" + ], + "time": "2020-10-23T02:01:07+00:00" + }, + { + "name": "wp-coding-standards/wpcs", + "version": "0.13.1", + "source": { + "type": "git", + "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", + "reference": "1f64b1a0b5b789822d0303436ee4e30e0135e4dc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/1f64b1a0b5b789822d0303436ee4e30e0135e4dc", + "reference": "1f64b1a0b5b789822d0303436ee4e30e0135e4dc", + "shasum": "" + }, + "require": { + "php": ">=5.3", + "squizlabs/php_codesniffer": "^2.9.0 || ^3.0.2" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.1" + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Contributors", + "homepage": "https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/graphs/contributors" + } + ], + "description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions", + "keywords": [ + "phpcs", + "standards", + "wordpress" + ], + "time": "2017-08-05T16:08:58+00:00" + } + ], + "aliases": [], + "minimum-stability": "dev", + "stability-flags": { + "roave/security-advisories": 20 + }, + "prefer-stable": true, + "prefer-lowest": false, + "platform": { + "php": ">=7.0", + "ext-json": "*" + }, + "platform-dev": [], + "platform-overrides": { + "php": "7.1" + }, + "plugin-api-version": "1.1.0" +} From 62c7b2023627b5bd1363530f2805d698cecd79b7 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Fri, 30 Oct 2020 12:21:53 +0530 Subject: [PATCH 0751/1044] Update dist and php version Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index f8291791c..4a6087f0c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ sudo: required -dist: xenial +dist: bionic language: php -php: 7.2 +php: 7.3 env: global: From bc1111075710d1e88ad93aadbd75529234efa6af Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Fri, 30 Oct 2020 15:55:55 +0530 Subject: [PATCH 0752/1044] Pinned dependency version --- composer.json | 2 +- composer.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 1289115c4..33d1da5ad 100644 --- a/composer.json +++ b/composer.json @@ -58,7 +58,7 @@ "ext-json": "*" }, "require-dev": { - "behat/behat": "^3.7", + "behat/behat": "3.7.0", "dealerdirect/phpcodesniffer-composer-installer": "0.7.0", "phpunit/phpunit": "3.7.*", "roave/security-advisories": "dev-master", diff --git a/composer.lock b/composer.lock index 04292f279..af8ca1746 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": "b8d866712fa07af84a62979e98694f18", + "content-hash": "933638fee77c1f354d6f581c14da25fa", "packages": [ { "name": "acmephp/core", From b00dfe20a0bb886ec54b01a1a172a825c9364352 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Fri, 30 Oct 2020 16:40:04 +0530 Subject: [PATCH 0753/1044] Add suggested modules Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- ci/test-env-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/test-env-install.sh b/ci/test-env-install.sh index 3c17a3022..26a80de72 100755 --- a/ci/test-env-install.sh +++ b/ci/test-env-install.sh @@ -9,7 +9,7 @@ function setup_test_requirements() { # Installing php-cli, which is the minimum requirement to run EasyEngine apt-get -y install php7.3-cli - php_modules=( pcntl curl sqlite3 zip ) + php_modules=( pcntl curl sqlite3 zip dom mbstring json ) if command -v php > /dev/null 2>&1; then # Reading the php version. default_php_version="$(readlink -f /usr/bin/php | gawk -F "php" '{ print $2}')" From 5c1942283df4c5ab94f9909f388fff8f8ba28c29 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Fri, 30 Oct 2020 17:13:12 +0530 Subject: [PATCH 0754/1044] Add debugging to testing script Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- ci/test-commands.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ci/test-commands.sh b/ci/test-commands.sh index 2d92285fc..f25bb8891 100755 --- a/ci/test-commands.sh +++ b/ci/test-commands.sh @@ -1,6 +1,8 @@ #!/bin/bash # called by Travis CI +set -x + #repos=$(find vendor/easyengine -type d -name 'features') sub_commands=( vendor/easyengine/site-command/features @@ -8,6 +10,8 @@ sub_commands=( vendor/easyengine/site-type-wp/features ) +export COMPOSE_INTERACTIVE_NO_CLI=1 + for command in "${sub_commands[@]}"; do IFS='/' read -r -a array <<< "$command" rm -rf features/* @@ -15,6 +19,5 @@ for command in "${sub_commands[@]}"; do for file in features/*.feature; do mv "$file" "${file%.feature}_${array[2]}.feature"; done composer du echo "Running tests for $command" - export COMPOSE_INTERACTIVE_NO_CLI=1 sudo ./vendor/bin/behat done From 1d754895cdb8ea0b519571f62309b77ca4858ade Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Fri, 30 Oct 2020 17:13:58 +0530 Subject: [PATCH 0755/1044] Remove composer du Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- ci/test-commands.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/ci/test-commands.sh b/ci/test-commands.sh index f25bb8891..e94ae5f3a 100755 --- a/ci/test-commands.sh +++ b/ci/test-commands.sh @@ -10,14 +10,11 @@ sub_commands=( vendor/easyengine/site-type-wp/features ) -export COMPOSE_INTERACTIVE_NO_CLI=1 - for command in "${sub_commands[@]}"; do IFS='/' read -r -a array <<< "$command" rm -rf features/* rsync -av --delete $command/ features/ > /dev/null for file in features/*.feature; do mv "$file" "${file%.feature}_${array[2]}.feature"; done - composer du echo "Running tests for $command" sudo ./vendor/bin/behat done From cdaf1b5ea02ff056abe7f8c4c130f935ddaa1387 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 2 Nov 2020 10:41:53 +0530 Subject: [PATCH 0756/1044] Add sysctl option in global config Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- php/config-spec.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/php/config-spec.php b/php/config-spec.php index 2b7933d52..51c9f9c71 100644 --- a/php/config-spec.php +++ b/php/config-spec.php @@ -38,6 +38,13 @@ 'desc' => 'Default Mail-id to be used for WordPress site installation.', ), + 'sysctl' => array( + 'runtime' => '=<true/false>', + 'file' => '<sysctl>', + 'default' => false, + 'desc' => 'Whether to add sysctl config in docker-compose.', + ), + 'ee_installer_version' => array( 'file' => '<path>', 'default' => null, From 845e785d9939f517ab725dc2075c8f16516f8672 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 3 Nov 2020 18:58:17 +0530 Subject: [PATCH 0757/1044] Update PHP images Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- img-versions.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/img-versions.json b/img-versions.json index c0d3aae3a..eb4ec5a54 100644 --- a/img-versions.json +++ b/img-versions.json @@ -4,12 +4,12 @@ "easyengine/mariadb": "v4.1.3", "easyengine/nginx-proxy": "v4.1.4", "easyengine/nginx": "v4.1.4", - "easyengine/php": "v4.1.6", + "easyengine/php": "v4.1.7", "easyengine/php5.6": "v4.0.0", - "easyengine/php7.0": "v4.1.6", - "easyengine/php7.2": "v4.1.6", - "easyengine/php7.3": "v4.1.6", - "easyengine/php7.4": "v4.1.6", + "easyengine/php7.0": "v4.1.7", + "easyengine/php7.2": "v4.1.7", + "easyengine/php7.3": "v4.1.7", + "easyengine/php7.4": "v4.1.7", "easyengine/postfix": "v4.1.5", "easyengine/redis": "v4.1.4", "easyengine/newrelic-daemon": "v4.0.0" From b678df1fdc60699b0e42e9ac03338dc84d2b4733 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Wed, 4 Nov 2020 16:21:17 +0530 Subject: [PATCH 0758/1044] Update composer installation steps Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4a6087f0c..f3a46690c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,9 +26,9 @@ install: - | # Run composer install for master else update. if [[ "$TRAVIS_BRANCH" = "master" ]]; then - composer install --no-interaction + composer install --prefer-dist --no-suggest --no-progress --no-interaction else - composer update + composer update --prefer-dist --no-suggest --no-progress --no-interaction fi - sudo ./ci/test-env-install.sh From a34d6df199bcc4bde3c20831dabf1f3a3c8be5ce Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Wed, 4 Nov 2020 16:21:49 +0530 Subject: [PATCH 0759/1044] Remove json extension as required ext Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 33d1da5ad..085ea59cb 100644 --- a/composer.json +++ b/composer.json @@ -54,8 +54,7 @@ "symfony/translation": "3.4.18", "symfony/yaml": "3.4.18", "wp-cli/mustangostang-spyc": "0.6.3", - "wp-cli/php-cli-tools": "0.11.10", - "ext-json": "*" + "wp-cli/php-cli-tools": "0.11.10" }, "require-dev": { "behat/behat": "3.7.0", From fbe043238cdfce68493d52e397aea15e49d43f26 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Wed, 4 Nov 2020 16:22:10 +0530 Subject: [PATCH 0760/1044] Re-create phar without dev dependencies Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- ci/deploy.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ci/deploy.sh b/ci/deploy.sh index 4f771c8cf..3ed4eb852 100755 --- a/ci/deploy.sh +++ b/ci/deploy.sh @@ -30,6 +30,16 @@ set -x # add github's public key echo "|1|qPmmP7LVZ7Qbpk7AylmkfR0FApQ=|WUy1WS3F4qcr3R5Sc728778goPw= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==" >> ~/.ssh/known_hosts +# Remove dev dependenices needed for testing +if [[ "$TRAVIS_BRANCH" = "master" ]]; then + composer install --prefer-dist --no-suggest --no-progress --no-interaction --no-dev +else + composer update --prefer-dist --no-suggest --no-progress --no-interaction --no-dev +fi + +# Re create phar +bash "$TRAVIS_BUILD_DIR/ci/prepare.sh" + git clone git@github.com:easyengine/easyengine-builds.git git config --global user.name "rtBot" From 372ad67280f5ce67b49fbac1fd11fd296395b200 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 5 Nov 2020 12:05:14 +0530 Subject: [PATCH 0761/1044] Remove --no-suggest param Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index f3a46690c..6987c0ad3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,9 +26,9 @@ install: - | # Run composer install for master else update. if [[ "$TRAVIS_BRANCH" = "master" ]]; then - composer install --prefer-dist --no-suggest --no-progress --no-interaction + composer install --prefer-dist --no-progress --no-interaction else - composer update --prefer-dist --no-suggest --no-progress --no-interaction + composer update --prefer-dist --no-progress --no-interaction fi - sudo ./ci/test-env-install.sh From 7b3586b59635df35202728943b45a4e45d325c97 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 5 Nov 2020 12:06:21 +0530 Subject: [PATCH 0762/1044] Update re-creation of phar steps Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- ci/deploy.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ci/deploy.sh b/ci/deploy.sh index 3ed4eb852..0abe32ab7 100755 --- a/ci/deploy.sh +++ b/ci/deploy.sh @@ -31,14 +31,15 @@ set -x echo "|1|qPmmP7LVZ7Qbpk7AylmkfR0FApQ=|WUy1WS3F4qcr3R5Sc728778goPw= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==" >> ~/.ssh/known_hosts # Remove dev dependenices needed for testing +sudo rm -rf vendor if [[ "$TRAVIS_BRANCH" = "master" ]]; then - composer install --prefer-dist --no-suggest --no-progress --no-interaction --no-dev + composer install --prefer-dist --no-progress --no-interaction --no-dev else - composer update --prefer-dist --no-suggest --no-progress --no-interaction --no-dev + composer update --prefer-dist --no-progress --no-interaction --no-dev fi # Re create phar -bash "$TRAVIS_BUILD_DIR/ci/prepare.sh" +php -dphar.readonly=0 ./utils/make-phar.php easyengine.phar --quiet git clone git@github.com:easyengine/easyengine-builds.git From b9f0153cd15dfc147b0b5b37aac41ef6fcf86a9b Mon Sep 17 00:00:00 2001 From: dhsathiya <devarshisathiya5@gmail.com> Date: Tue, 10 Nov 2020 18:54:29 +0530 Subject: [PATCH 0763/1044] Fix docker-compose command being ran on cli, config and help Signed-off-by: dhsathiya <devarshisathiya5@gmail.com> --- php/EE/Runner.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 933892c99..a9f6aa0c9 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -69,17 +69,18 @@ private function init_ee() { $check_requirements = ( [ 'site', 'cmd-dump' ] === $this->arguments ) ? false : $check_requirements; } - $nginx_proxy = 'services_global-nginx-proxy_1'; - $launch = EE::launch( sprintf( 'cd %s && docker ps -q --no-trunc | grep $(docker-compose ps -q global-nginx-proxy)', EE_SERVICE_DIR ) ); - if ( 0 === $launch->return_code ) { - $nginx_proxy = trim( $launch->stdout ); - } - define( 'EE_PROXY_TYPE', $nginx_proxy ); - if ( $check_requirements ) { + $nginx_proxy = 'services_global-nginx-proxy_1'; + $launch = EE::launch( sprintf( 'cd %s && docker ps -q --no-trunc | grep $(docker-compose ps -q global-nginx-proxy)', EE_SERVICE_DIR ) ); + if ( 0 === $launch->return_code ) { + $nginx_proxy = trim( $launch->stdout ); + } + define( 'EE_PROXY_TYPE', $nginx_proxy ); + $this->check_requirements(); $this->maybe_trigger_migration(); } + if ( [ 'cli', 'info' ] === $this->arguments && $this->check_requirements( false ) ) { $this->maybe_trigger_migration(); } From 76926419ffd54188f767ba070a8d764084113657 Mon Sep 17 00:00:00 2001 From: dhsathiya <devarshisathiya5@gmail.com> Date: Wed, 11 Nov 2020 17:41:04 +0530 Subject: [PATCH 0764/1044] Fix file_logging_path and EE_PROXY_TYPE related conditions Signed-off-by: dhsathiya <devarshisathiya5@gmail.com> --- php/EE/Runner.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index a9f6aa0c9..f4b15fc21 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -69,17 +69,18 @@ private function init_ee() { $check_requirements = ( [ 'site', 'cmd-dump' ] === $this->arguments ) ? false : $check_requirements; } + $nginx_proxy = 'services_global-nginx-proxy_1'; if ( $check_requirements ) { - $nginx_proxy = 'services_global-nginx-proxy_1'; - $launch = EE::launch( sprintf( 'cd %s && docker ps -q --no-trunc | grep $(docker-compose ps -q global-nginx-proxy)', EE_SERVICE_DIR ) ); + + $launch = EE::launch( sprintf( 'cd %s && docker ps -q --no-trunc | grep $(docker-compose ps -q global-nginx-proxy)', EE_SERVICE_DIR ) ); if ( 0 === $launch->return_code ) { $nginx_proxy = trim( $launch->stdout ); } - define( 'EE_PROXY_TYPE', $nginx_proxy ); - + $this->check_requirements(); $this->maybe_trigger_migration(); } + define( 'EE_PROXY_TYPE', $nginx_proxy ); if ( [ 'cli', 'info' ] === $this->arguments && $this->check_requirements( false ) ) { $this->maybe_trigger_migration(); @@ -563,17 +564,16 @@ public function init_logger() { EE::err( 'Config root: ' . EE_ROOT_DIR . ' is not writable by EasyEngine' ); } - if ( !empty( $this->arguments[0] ) && 'cli' === $this->arguments[0] && ! empty( $this->arguments[1] ) && 'info' === $this->arguments[1] ) { + if ( isset( $GLOBALS['argv'] ) && 'cli' === $GLOBALS['argv'][1] && 'completions ' === $GLOBALS['argv'][2] ) { $file_logging_path = '/dev/null'; - } - else { + } else { $file_logging_path = EE_ROOT_DIR . '/logs/ee.log'; } $dateFormat = 'd-m-Y H:i:s'; $output = "[%datetime%] %channel%.%level_name%: %message% %context% %extra%\n"; $formatter = new \Monolog\Formatter\LineFormatter( $output, $dateFormat, false, true ); - $stream = new \Monolog\Handler\StreamHandler( EE_ROOT_DIR . '/logs/ee.log', Logger::DEBUG ); + $stream = new \Monolog\Handler\StreamHandler( $file_logging_path, Logger::DEBUG ); $stream->setFormatter( $formatter ); $file_logger = new \Monolog\Logger( 'ee' ); $file_logger->pushHandler( $stream ); From ab1e1d318b23bd81ec1f85530dcc946f95ff3ab3 Mon Sep 17 00:00:00 2001 From: Devarshi Sathiya <devarshisathiya5@gmail.com> Date: Wed, 11 Nov 2020 17:44:12 +0530 Subject: [PATCH 0765/1044] Remove empty line --- php/EE/Runner.php | 1 - 1 file changed, 1 deletion(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index f4b15fc21..1769cbe4b 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -71,7 +71,6 @@ private function init_ee() { $nginx_proxy = 'services_global-nginx-proxy_1'; if ( $check_requirements ) { - $launch = EE::launch( sprintf( 'cd %s && docker ps -q --no-trunc | grep $(docker-compose ps -q global-nginx-proxy)', EE_SERVICE_DIR ) ); if ( 0 === $launch->return_code ) { $nginx_proxy = trim( $launch->stdout ); From 05745dcc4025721175a6b39cdfdc7abcfdc4f3f9 Mon Sep 17 00:00:00 2001 From: Devarshi Sathiya <devarshisathiya5@gmail.com> Date: Wed, 11 Nov 2020 18:28:29 +0530 Subject: [PATCH 0766/1044] Update checks --- php/EE/Runner.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 1769cbe4b..1ba637888 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -563,7 +563,7 @@ public function init_logger() { EE::err( 'Config root: ' . EE_ROOT_DIR . ' is not writable by EasyEngine' ); } - if ( isset( $GLOBALS['argv'] ) && 'cli' === $GLOBALS['argv'][1] && 'completions ' === $GLOBALS['argv'][2] ) { + if ( isset( $GLOBALS['argv'][1] ) && 'cli' === $GLOBALS['argv'][1] && isset( $GLOBALS['argv'][2] ) && 'completions' === $GLOBALS['argv'][2] ) { $file_logging_path = '/dev/null'; } else { $file_logging_path = EE_ROOT_DIR . '/logs/ee.log'; From 586e81fddbab62ea3935f0d087060843fb164763 Mon Sep 17 00:00:00 2001 From: dhsathiya <devarshisathiya5@gmail.com> Date: Mon, 30 Nov 2020 15:26:16 +0530 Subject: [PATCH 0767/1044] Remove global parameters from auto-completions Signed-off-by: dhsathiya <devarshisathiya5@gmail.com> --- php/EE/Completions.php | 41 ----------------------------------------- 1 file changed, 41 deletions(-) diff --git a/php/EE/Completions.php b/php/EE/Completions.php index 11a103278..ce47ca2b7 100644 --- a/php/EE/Completions.php +++ b/php/EE/Completions.php @@ -78,22 +78,6 @@ public function __construct( $line ) { $this->add( $opt ); } } - - foreach ( $this->get_global_parameters() as $param => $runtime ) { - if ( isset( $assoc_args[ $param ] ) ) { - continue; - } - - $opt = "--{$param}"; - - if ( '' === $runtime || ! is_string( $runtime ) ) { - $opt .= ' '; - } else { - $opt .= '='; - } - - $this->add( $opt ); - } } } @@ -123,31 +107,6 @@ private function get_command( $words ) { return array( $command, $args, $assoc_args ); } - private function get_global_parameters() { - $params = array(); - foreach ( \EE::get_configurator()->get_spec() as $key => $details ) { - if ( false === $details['runtime'] ) { - continue; - } - - if ( isset( $details['deprecated'] ) ) { - continue; - } - - if ( isset( $details['hidden'] ) ) { - continue; - } - $params[ $key ] = $details['runtime']; - - // Add additional option like `--[no-]color`. - if ( true === $details['runtime'] ) { - $params[ 'no-' . $key ] = ''; - } - } - - return $params; - } - private function add( $opt ) { if ( '' !== $this->cur_word ) { if ( 0 !== strpos( $opt, $this->cur_word ) ) { From e2a6917d982a247d7277ca355b4c1c44d23ed33b Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Thu, 3 Dec 2020 15:18:53 +0530 Subject: [PATCH 0768/1044] Add site command in EE runner during completions --- php/EE/Completions.php | 46 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/php/EE/Completions.php b/php/EE/Completions.php index 11a103278..15d88c717 100644 --- a/php/EE/Completions.php +++ b/php/EE/Completions.php @@ -2,6 +2,10 @@ namespace EE; +use EE; +use EE\Dispatcher\CommandFactory; +use EE\Model\Site; + class Completions { private $words; @@ -109,6 +113,8 @@ private function get_command( $words ) { } } + $this->maybe_add_site_command( $words ); + $r = \EE::get_runner()->find_command_to_run( $positional_args ); if ( ! is_array( $r ) && array_pop( $positional_args ) == $this->cur_word ) { $r = \EE::get_runner()->find_command_to_run( $positional_args ); @@ -123,6 +129,46 @@ private function get_command( $words ) { return array( $command, $args, $assoc_args ); } + /** + * Adds correct site-type to EE runner if autocompletion of site command is required + */ + private function maybe_add_site_command( array $words ) { + if ( count( $words ) > 0 && $words[0] === 'site' ) { + $type= $this->get_site_type ( $words, 'html' ); + $site_types = \Site_Command::get_site_types(); + + $command = EE::get_root_command(); + $callback = $site_types[ $type ]; + $leaf_command = CommandFactory::create( 'site', $callback, $command ); + $command->add_subcommand( 'site', $leaf_command ); + } + } + + /** + * Returns correct site-type for completion. Only for `site create`, type is specified in command. + * For other commands, it is fetched from EE db.comp + */ + private function get_site_type( $words, $default_site_type ) { + $type = $default_site_type; + + foreach ( $words as $arg ) { + if ( preg_match( '|^--type=(\S+)|', $arg, $matches ) ) { + $type = $matches[1] ; + } + } + + if ( count( $words) >= 2 && $words[1] !== 'create' && ! preg_match( '|^--|', $words[2] ) ) { + $sitename = str_replace( [ 'https://', 'http://' ], '', $words[2] ); + $sitetype = Site::find( $sitename, [ 'site_type' ] ); + + if ( $sitetype ) { + $type = $sitetype->site_type; + } + } + + return $type; + } + private function get_global_parameters() { $params = array(); foreach ( \EE::get_configurator()->get_spec() as $key => $details ) { From f4a835d93609972f74f94bd050e00a0ee8a51c53 Mon Sep 17 00:00:00 2001 From: dhsathiya <devarshisathiya5@gmail.com> Date: Mon, 14 Dec 2020 13:50:57 +0530 Subject: [PATCH 0769/1044] Remove unused method get_global_parameters Signed-off-by: dhsathiya <devarshisathiya5@gmail.com> --- php/EE/Completions.php | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/php/EE/Completions.php b/php/EE/Completions.php index 19cf2f565..c3a3a7d62 100644 --- a/php/EE/Completions.php +++ b/php/EE/Completions.php @@ -153,31 +153,6 @@ private function get_site_type( $words, $default_site_type ) { return $type; } - private function get_global_parameters() { - $params = array(); - foreach ( \EE::get_configurator()->get_spec() as $key => $details ) { - if ( false === $details['runtime'] ) { - continue; - } - - if ( isset( $details['deprecated'] ) ) { - continue; - } - - if ( isset( $details['hidden'] ) ) { - continue; - } - $params[ $key ] = $details['runtime']; - - // Add additional option like `--[no-]color`. - if ( true === $details['runtime'] ) { - $params[ 'no-' . $key ] = ''; - } - } - - return $params; - } - private function add( $opt ) { if ( '' !== $this->cur_word ) { if ( 0 !== strpos( $opt, $this->cur_word ) ) { From 71d9761465f753783ae883748f03ff76eeb86d77 Mon Sep 17 00:00:00 2001 From: dhsathiya <devarshisathiya5@gmail.com> Date: Mon, 14 Dec 2020 13:56:16 +0530 Subject: [PATCH 0770/1044] Add description in the command completion Signed-off-by: dhsathiya <devarshisathiya5@gmail.com> --- php/EE/Completions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/EE/Completions.php b/php/EE/Completions.php index c3a3a7d62..0049dbac6 100644 --- a/php/EE/Completions.php +++ b/php/EE/Completions.php @@ -62,7 +62,7 @@ public function __construct( $line ) { } } foreach ( $command->get_subcommands() as $name => $_ ) { - $this->add( "$name " ); + $this->add("$name" . ":" . $subcommand->get_shortdesc() ); } } else { foreach ( $spec as $arg ) { From e807b6e05a1de650da130f5de65f206bd6d93161 Mon Sep 17 00:00:00 2001 From: dhsathiya <devarshisathiya5@gmail.com> Date: Mon, 14 Dec 2020 14:18:23 +0530 Subject: [PATCH 0771/1044] Fixed loop variable names Signed-off-by: dhsathiya <devarshisathiya5@gmail.com> --- php/EE/Completions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/EE/Completions.php b/php/EE/Completions.php index 0049dbac6..71a741984 100644 --- a/php/EE/Completions.php +++ b/php/EE/Completions.php @@ -61,7 +61,7 @@ public function __construct( $line ) { $this->add( "$name " ); } } - foreach ( $command->get_subcommands() as $name => $_ ) { + foreach ( $command->get_subcommands() as $name => $subcommand ) { $this->add("$name" . ":" . $subcommand->get_shortdesc() ); } } else { From ac80ad40b80b5a4cb346dd3c97ba72c437ab3643 Mon Sep 17 00:00:00 2001 From: Devarshi Sathiya <devarshisathiya5@gmail.com> Date: Mon, 14 Dec 2020 14:27:34 +0530 Subject: [PATCH 0772/1044] Fix condition for site completion --- php/EE/Completions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/EE/Completions.php b/php/EE/Completions.php index 71a741984..479f0f278 100644 --- a/php/EE/Completions.php +++ b/php/EE/Completions.php @@ -141,7 +141,7 @@ private function get_site_type( $words, $default_site_type ) { } } - if ( count( $words) >= 2 && $words[1] !== 'create' && ! preg_match( '|^--|', $words[2] ) ) { + if ( count( $words ) >= 3 && $words[1] !== 'create' && ! preg_match( '|^--|', $words[2] ) ) { $sitename = str_replace( [ 'https://', 'http://' ], '', $words[2] ); $sitetype = Site::find( $sitename, [ 'site_type' ] ); From ea66e81b58804db51b36b9f0a8d5626ca2206aec Mon Sep 17 00:00:00 2001 From: dhsathiya <devarshisathiya5@gmail.com> Date: Tue, 15 Dec 2020 13:20:53 +0530 Subject: [PATCH 0773/1044] Add zsh compatible autocompletion script Signed-off-by: dhsathiya <devarshisathiya5@gmail.com> --- utils/_ee | 95 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 utils/_ee diff --git a/utils/_ee b/utils/_ee new file mode 100644 index 000000000..9fdd040bc --- /dev/null +++ b/utils/_ee @@ -0,0 +1,95 @@ +#compdef ee + +function _ee { + + _ee_completion() { + ee_completion=() + ee_completion=$(sudo /mnt/sdb1/easyengine/easyengine/bin/ee cli completions --line="ee $current_command " --point="$current_position") + + completion=() + while read line; do + completion+=("${line}") + done < <(echo "$ee_completion") + } + + _ee_service_list() { + ee_services=$(sudo docker-compose -f /opt/easyengine/services/docker-compose.yml ps --services | sed 's/global\-//g') + completion=() + while read line; do + completion+=("${line}") + done < <(echo "$ee_services") + } + + _ee_site_list() { + ee_sites=$(sqlite3 /opt/easyengine/db/ee.sqlite "select site_url from sites;") + completion=() + while read line; do + completion+=("${line}") + done < <(echo "$ee_sites") + } + + if [[ "${words[2]}" == "cli" || "${words[2]}" == "config" || "${words[2]}" == "help" ]]; then + _arguments '1: :-> sub_commands' '2: :->sub_command_param' '*: :->flags' + + elif [[ "${words[2]}" == "service" ]]; then + _arguments '1: :-> sub_commands' '2: :->sub_command_param' '3: :->get_service_name' '*: :->flags' + + elif [[ "${words[2]}" == "shell" ]]; then + _arguments '1: :-> sub_commands' '2: :->get_site_name' '*: :->flags' + + else + _arguments '1: :-> sub_commands' '2: :->sub_command_param' '3: :->get_site_name' '*: :->flags' + fi + + current_command="" + current_position=0 + + case $state in + sub_commands) + + current_command=${words[@]:1} + current_position=$((CURRENT + 1)) + + _ee_completion + _describe 'command' completion + ;; + + sub_command_param) + + chrlen="ee ${words[@]:1}" + current_command=${words[@]:1} + current_position=$((${#chrlen})) + + _ee_completion + + _describe 'command' completion + ;; + + get_site_name) + + _ee_site_list + _describe 'command' completion + ;; + + get_service_name) + + _ee_service_list + _describe 'command' completion + ;; + + flags) + + chrlen="ee ${words[@]:1}" + current_command=${words[@]:1} + current_position=$((${#chrlen})) + + _ee_completion + _describe 'command' completion + + ;; + + *) + echo "Error occured in auto completion" + ;; + esac +} From 2e165968111415fdaf600ea2cdc98c93e0343b9c Mon Sep 17 00:00:00 2001 From: Devarshi Sathiya <devarshisathiya5@gmail.com> Date: Wed, 16 Dec 2020 18:09:43 +0530 Subject: [PATCH 0774/1044] Fix PHPCS issues --- php/EE/Completions.php | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/php/EE/Completions.php b/php/EE/Completions.php index 479f0f278..c56db8428 100644 --- a/php/EE/Completions.php +++ b/php/EE/Completions.php @@ -25,7 +25,7 @@ public function __construct( $line ) { } $is_alias = false; - $is_help = false; + $is_help = false; if ( ! empty( $this->words[0] ) && preg_match( '/^@/', $this->words[0] ) ) { array_shift( $this->words ); // `ee @al` is false, but `ee @all ` is true. @@ -52,21 +52,20 @@ public function __construct( $line ) { return; } } - if ( $command->can_have_subcommands() ) { // add completion when command is `ee` and alias isn't set. - if ( 'ee' === $command->get_name() && false === $is_alias && false == $is_help ) { + if ( 'ee' === $command->get_name() && false === $is_alias && false === $is_help ) { $aliases = \EE::get_configurator()->get_aliases(); foreach ( $aliases as $name => $_ ) { $this->add( "$name " ); } } foreach ( $command->get_subcommands() as $name => $subcommand ) { - $this->add("$name" . ":" . $subcommand->get_shortdesc() ); + $this->add( $name . ':' . $subcommand->get_shortdesc() ); } } else { foreach ( $spec as $arg ) { - if ( in_array( $arg['type'], array( 'flag', 'assoc' ) ) ) { + if ( in_array( $arg['type'], array( 'flag', 'assoc' ), true ) ) { if ( isset( $assoc_args[ $arg['name'] ] ) ) { continue; } @@ -83,7 +82,6 @@ public function __construct( $line ) { } } } - } private function get_command( $words ) { @@ -100,7 +98,7 @@ private function get_command( $words ) { $this->maybe_add_site_command( $words ); $r = \EE::get_runner()->find_command_to_run( $positional_args ); - if ( ! is_array( $r ) && array_pop( $positional_args ) == $this->cur_word ) { + if ( ! is_array( $r ) && array_pop( $positional_args ) === $this->cur_word ) { $r = \EE::get_runner()->find_command_to_run( $positional_args ); } @@ -117,12 +115,12 @@ private function get_command( $words ) { * Adds correct site-type to EE runner if autocompletion of site command is required */ private function maybe_add_site_command( array $words ) { - if ( count( $words ) > 0 && $words[0] === 'site' ) { - $type= $this->get_site_type ( $words, 'html' ); + if ( count( $words ) > 0 && 'site' === $words[0] ) { + $type = $this->get_site_type( $words, 'html' ); $site_types = \Site_Command::get_site_types(); $command = EE::get_root_command(); - $callback = $site_types[ $type ]; + $callback = $site_types[ $type ]; $leaf_command = CommandFactory::create( 'site', $callback, $command ); $command->add_subcommand( 'site', $leaf_command ); } @@ -137,13 +135,13 @@ private function get_site_type( $words, $default_site_type ) { foreach ( $words as $arg ) { if ( preg_match( '|^--type=(\S+)|', $arg, $matches ) ) { - $type = $matches[1] ; + $type = $matches[1]; } } - if ( count( $words ) >= 3 && $words[1] !== 'create' && ! preg_match( '|^--|', $words[2] ) ) { - $sitename = str_replace( [ 'https://', 'http://' ], '', $words[2] ); - $sitetype = Site::find( $sitename, [ 'site_type' ] ); + if ( count( $words ) >= 3 && 'create' === $words[1] && ! preg_match( '|^--|', $words[2] ) ) { + $sitename = str_replace( array( 'https://', 'http://' ), '', $words[2] ); + $sitetype = Site::find( $sitename, array( 'site_type' ) ); if ( $sitetype ) { $type = $sitetype->site_type; From 76db098b39803e66c6f7f91964bf21a71e00b0c5 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Fri, 25 Dec 2020 15:02:20 +0530 Subject: [PATCH 0775/1044] =?UTF-8?q?Remove=20wp-cli=20autoloader=20?= =?UTF-8?q?=F0=9F=A5=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- composer.json | 12 ++-- php/EE/Bootstrap/IncludeBundledAutoloader.php | 37 ----------- .../Bootstrap/IncludeFallbackAutoloader.php | 10 +++ .../Bootstrap/IncludeFrameworkAutoloader.php | 63 ++++++++++--------- php/bootstrap.php | 3 +- php/commands/cli.php | 4 ++ 6 files changed, 57 insertions(+), 72 deletions(-) delete mode 100644 php/EE/Bootstrap/IncludeBundledAutoloader.php diff --git a/composer.json b/composer.json index 085ea59cb..8708dde77 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,6 @@ "composer/semver": "1.4.2", "easyengine/admin-tools-command": "v1.0.10", "easyengine/auth-command": "v1.0.4", - "easyengine/autoload-splitter": "v1.0.0", "easyengine/config-command": "v1.0.2", "easyengine/cron-command": "v1.0.2", "easyengine/log-command": "v1.0.1", @@ -69,11 +68,14 @@ }, "autoload": { "psr-0": { - "EE": "php" + "EE\\": "php/" }, - "psr-4": { - "": "php/commands/src" - } + "classmap": [ + "php/class-ee.php", + "php/class-ee-db.php", + "php/class-ee-docker.php", + "php/class-ee-command.php" + ] }, "extra": { "branch-alias": { diff --git a/php/EE/Bootstrap/IncludeBundledAutoloader.php b/php/EE/Bootstrap/IncludeBundledAutoloader.php deleted file mode 100644 index a55428341..000000000 --- a/php/EE/Bootstrap/IncludeBundledAutoloader.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -namespace EE\Bootstrap; - -/** - * Class IncludeBundledAutoloader. - * - * Loads the bundled autoloader that is provided through the `composer.json` - * file. - * - * This only contains classes for the commands. - * - * @package EE\Bootstrap - */ -final class IncludeBundledAutoloader extends AutoloaderStep { - - /** - * Get the autoloader paths to scan for an autoloader. - * - * @return string[]|false Array of strings with autoloader paths, or false - * to skip. - */ - protected function get_autoloader_paths() { - $autoloader_paths = array( - EE_VENDOR_DIR . '/autoload_commands.php', - ); - - if ( $custom_vendor = $this->get_custom_vendor_folder() ) { - array_unshift( - $autoloader_paths, - EE_ROOT . '/../../../' . $custom_vendor . '/autoload_commands.php' - ); - } - - return $autoloader_paths; - } -} diff --git a/php/EE/Bootstrap/IncludeFallbackAutoloader.php b/php/EE/Bootstrap/IncludeFallbackAutoloader.php index 04ada980c..bb550bed5 100644 --- a/php/EE/Bootstrap/IncludeFallbackAutoloader.php +++ b/php/EE/Bootstrap/IncludeFallbackAutoloader.php @@ -2,6 +2,8 @@ namespace EE\Bootstrap; +use EE; + /** * Class IncludeFallbackAutoloader. * @@ -30,6 +32,14 @@ protected function get_autoloader_paths() { ); } + EE::debug( + sprintf( + 'Fallback autoloader paths: %s', + implode( ', ', $autoloader_paths ) + ), + 'bootstrap' + ); + return $autoloader_paths; } } diff --git a/php/EE/Bootstrap/IncludeFrameworkAutoloader.php b/php/EE/Bootstrap/IncludeFrameworkAutoloader.php index 3b9ab522e..43c8f3d91 100644 --- a/php/EE/Bootstrap/IncludeFrameworkAutoloader.php +++ b/php/EE/Bootstrap/IncludeFrameworkAutoloader.php @@ -2,49 +2,56 @@ namespace EE\Bootstrap; +use EE\Autoloader; + /** * Class IncludeFrameworkAutoloader. * - * Loads the framework autoloader that is provided through the `composer.json` - * file. + * Loads the framework autoloader through an autoloader separate from the + * Composer one, to avoid coupling the loading of the framework with bundled + * commands. * * This only contains classes for the framework. * * @package EE\Bootstrap */ -final class IncludeFrameworkAutoloader extends AutoloaderStep { +final class IncludeFrameworkAutoloader implements BootstrapStep { /** - * Get the autoloader paths to scan for an autoloader. + * Process this single bootstrapping step. + * + * @param BootstrapState $state Contextual state to pass into the step. * - * @return string[]|false Array of strings with autoloader paths, or false - * to skip. + * @return BootstrapState Modified state to pass to the next step. */ - protected function get_autoloader_paths() { - $autoloader_paths = array( - EE_VENDOR_DIR . '/autoload_framework.php', - ); - - if ( $custom_vendor = $this->get_custom_vendor_folder() ) { - array_unshift( - $autoloader_paths, - EE_ROOT . '/../../../' . $custom_vendor . '/autoload_framework.php' + public function process( BootstrapState $state ) { + if ( ! class_exists( 'EE\Autoloader' ) ) { + require_once EE_ROOT . '/php/EE/Autoloader.php'; + } + + $autoloader = new Autoloader(); + + $mappings = [ + 'EE' => EE_ROOT . '/php/EE', + 'cli' => EE_VENDOR_DIR . '/wp-cli/php-cli-tools/lib/cli', + 'Requests' => EE_VENDOR_DIR . '/rmccue/requests/library/Requests', + 'Symfony\Component\Finder' => EE_VENDOR_DIR . '/symfony/finder/', + 'Psr\Log' => EE_VENDOR_DIR . '/psr/log/Psr/Log/', + 'Monolog' => EE_VENDOR_DIR . '/monolog/monolog/src/Monolog', + ]; + + foreach ( $mappings as $namespace => $folder ) { + $autoloader->add_namespace( + $namespace, + $folder ); } - return $autoloader_paths; - } + include_once EE_VENDOR_DIR . '/rmccue/requests/library/Requests.php'; + include_once EE_VENDOR_DIR . '/wp-cli/mustangostang-spyc/Spyc.php'; - /** - * Handle the failure to find an autoloader. - * - * @return void - */ - protected function handle_failure() { - fwrite( - STDERR, - "Internal error: Can't find Composer autoloader.\nTry running: composer install\n" - ); - exit( 3 ); + $autoloader->register(); + + return $state; } } diff --git a/php/bootstrap.php b/php/bootstrap.php index 195efd818..8704069ec 100644 --- a/php/bootstrap.php +++ b/php/bootstrap.php @@ -25,7 +25,6 @@ function get_bootstrap_steps() { 'EE\Bootstrap\DefineProtectedCommands', 'EE\Bootstrap\LoadRequiredCommand', 'EE\Bootstrap\IncludePackageAutoloader', - 'EE\Bootstrap\IncludeBundledAutoloader', 'EE\Bootstrap\RegisterFrameworkCommands', 'EE\Bootstrap\IncludeFallbackAutoloader', 'EE\Bootstrap\RegisterDeferredCommands', @@ -72,6 +71,6 @@ function bootstrap() { foreach ( get_bootstrap_steps() as $step ) { /** @var \EE\Bootstrap\BootstrapStep $step_instance */ $step_instance = new $step(); - $state = $step_instance->process( $state ); + $state = $step_instance->process( $state ); } } diff --git a/php/commands/cli.php b/php/commands/cli.php index f7200164c..786b4eb75 100644 --- a/php/commands/cli.php +++ b/php/commands/cli.php @@ -1,3 +1,7 @@ <?php +if ( ! class_exists( 'CLI_Command' ) ) { + require_once __DIR__ . '/src/CLI_Command.php'; +} + EE::add_command( 'cli', 'CLI_Command' ); From 57b23f80e4c376fdd5e1a2af1a638023dfe07bba Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Thu, 3 Jun 2021 11:14:22 +0530 Subject: [PATCH 0776/1044] Remove autoloader files --- php/EE/AutoloadSplitter.php | 33 ---------------- tests/test-autoload-splitter.php | 65 -------------------------------- 2 files changed, 98 deletions(-) delete mode 100644 php/EE/AutoloadSplitter.php delete mode 100644 tests/test-autoload-splitter.php diff --git a/php/EE/AutoloadSplitter.php b/php/EE/AutoloadSplitter.php deleted file mode 100644 index 858db9a5b..000000000 --- a/php/EE/AutoloadSplitter.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php - -namespace EE; - -/** - * Class AutoloadSplitter. - * - * This class is used to provide the splitting logic to the - * `ee/autoload-splitter` Composer plugin. - * - * @package EE - */ -class AutoloadSplitter { - - /** - * Check whether the current class should be split out into a separate - * autoloader. - * - * Note: `class` in this context refers to all PHP autoloadable elements: - * - classes - * - interfaces - * - traits - * - * @param string $class Fully qualified name of the current class. - * @param string $code Path to the code file that declares the class. - * - * @return bool Whether to split out the class into a separate autoloader. - */ - public function __invoke( $class, $code ) { - return 1 === preg_match( '/\/easyengine\/\w+(?:-\w+)*-command\//', $code ) - || 1 === preg_match( '/\/php\/commands\/src\//', $code ); - } -} diff --git a/tests/test-autoload-splitter.php b/tests/test-autoload-splitter.php deleted file mode 100644 index 6d60823dc..000000000 --- a/tests/test-autoload-splitter.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php -/** - * Test AutoloadSplitter class - * - * @package EE\Tests\Unit - * @author EE Contributors - * @copyright 2017 EE - * @license GPL-2.0+ - */ - -namespace EE\Tests\Unit; - -use PHPUnit_Framework_TestCase; -use EE\AutoloadSplitter; - -/** - * Class AutoloadSplitterTest. - * - * @group autoloadsplitter - */ -class AutoloadSplitterTest extends PHPUnit_Framework_TestCase { - /** - * Test that AutoloadSplitter returns correct login - * - * @dataProvider dataCodePaths - */ - public function testAutoloadSplitter( $code, $expected ) { - $autoload_splitter = new AutoloadSplitter(); - - $this->assertSame( $expected, $autoload_splitter('foo', $code) ); - } - - /** - * Data provider of code paths. - * - * @return array - */ - public function dataCodePaths() { - return array( - array( '/ee/a-command/', true ), - array( '/ee/abcd-command/', true ), - array( '/ee/a-b-c-d-e-f-g-h-i-j-k-l-m-n-o-p-q-r-s-t-u-v-w-x-y-z-command/', true ), - array( 'xyz/ee/abcd-command/zxy', true ), - - array( '/php/commands/src/', true ), - array( 'xyz/php/commands/src/zyx', true ), - - array( '/ee/-command/', false ), // No command name. - array( '/ee/--command/', false ), // No command name. - array( '/ee/abcd-command-/', false ), // End is not '-command/` - array( '/ee/abcd-/', false ), // End is not '-command/'. - array( '/ee/abcd-command', false ), // End is not '-command/'. - array( 'ee/abcd-command/', false ), // Start is not '/ee/'. - array( '/wp--cli/abcd-command/', false ), // Start is not '/ee/'. - array( '/eeabcd-command/', false ), // Start is not '/ee/'. - array( '/ee//abcd-command/', false ), // Middle contains two '/'. - - array( '/php-/commands/src/', false ), // Start is not '/php/'. - array( 'php/commands/src/', false ), // Start is not '/php/'. - array( '/php/commands/src', false ), // End is not '/src/'. - array( '/php/commands/srcs/', false ), // End is not '/src/'. - array( '/php/commandssrc/', false ), // End is not '/src/'. - ); - } -} From ed4493a8faab6d5cca76334510a70feb934b59f6 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Thu, 3 Jun 2021 11:15:15 +0530 Subject: [PATCH 0777/1044] Update composer dependencies Remove autoloader section from composer.json --- composer.json | 22 +- composer.lock | 1061 ++++++++++++++++++++++++++----------------------- 2 files changed, 566 insertions(+), 517 deletions(-) diff --git a/composer.json b/composer.json index 8708dde77..86faa1e92 100644 --- a/composer.json +++ b/composer.json @@ -25,8 +25,8 @@ "prefer-stable": true, "require": { "php": ">=7.0", - "composer/composer": "1.7.3", - "composer/semver": "1.4.2", + "composer/composer": "2.0.13", + "composer/semver": "3.2.4", "easyengine/admin-tools-command": "v1.0.10", "easyengine/auth-command": "v1.0.4", "easyengine/config-command": "v1.0.2", @@ -38,18 +38,17 @@ "easyengine/site-command": "v2.6.2", "easyengine/site-type-php": "v1.3.1", "easyengine/site-type-wp": "v1.3.2", - "justinrainbow/json-schema": "5.2.7", "monolog/monolog": "1.24.0", "mustache/mustache": "2.12.0", - "rmccue/requests": "1.7.0", + "rmccue/requests": "1.8.0", "symfony/config": "3.4.18", - "symfony/console": "3.4.18", + "symfony/console": "3.4.35", "symfony/debug": "3.4.18", "symfony/dependency-injection": "3.4.27", "symfony/event-dispatcher": "3.4.18", - "symfony/filesystem": "3.4.18", - "symfony/finder": "3.4.18", - "symfony/process": "3.4.18", + "symfony/filesystem": "3.4.35", + "symfony/finder": "3.4.35", + "symfony/process": "3.4.35", "symfony/translation": "3.4.18", "symfony/yaml": "3.4.18", "wp-cli/mustangostang-spyc": "0.6.3", @@ -59,7 +58,6 @@ "behat/behat": "3.7.0", "dealerdirect/phpcodesniffer-composer-installer": "0.7.0", "phpunit/phpunit": "3.7.*", - "roave/security-advisories": "dev-master", "phpcompatibility/php-compatibility": "8.2.0", "wp-coding-standards/wpcs": "0.13.1" }, @@ -80,12 +78,6 @@ "extra": { "branch-alias": { "dev-master": "1.5.x-dev" - }, - "autoload-splitter": { - "splitter-logic": "EE\\AutoloadSplitter", - "splitter-location": "php/EE/AutoloadSplitter.php", - "split-target-prefix-true": "autoload_commands", - "split-target-prefix-false": "autoload_framework" } } } diff --git a/composer.lock b/composer.lock index af8ca1746..2859b61cc 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": "933638fee77c1f354d6f581c14da25fa", + "content-hash": "8aaf2740b242d7ab5ac43e2eed57a588", "packages": [ { "name": "acmephp/core", @@ -75,20 +75,23 @@ "ssl", "x509" ], + "support": { + "source": "https://github.com/acmephp/core/tree/1.2.0" + }, "time": "2019-12-17T11:28:20+00:00" }, { "name": "acmephp/ssl", - "version": "1.2.0", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/acmephp/ssl.git", - "reference": "7b144f9b9b2d6a42065001f784def28b1b2b1f32" + "reference": "30a02abf8811978ad1837a0c98383438d4c91f78" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/acmephp/ssl/zipball/7b144f9b9b2d6a42065001f784def28b1b2b1f32", - "reference": "7b144f9b9b2d6a42065001f784def28b1b2b1f32", + "url": "https://api.github.com/repos/acmephp/ssl/zipball/30a02abf8811978ad1837a0c98383438d4c91f78", + "reference": "30a02abf8811978ad1837a0c98383438d4c91f78", "shasum": "" }, "require": { @@ -140,7 +143,11 @@ "ssl", "x509" ], - "time": "2019-12-17T14:19:42+00:00" + "support": { + "issues": "https://github.com/acmephp/ssl/issues", + "source": "https://github.com/acmephp/ssl/tree/1.3.0" + }, + "time": "2020-12-13T21:27:31+00:00" }, { "name": "cloudflare/sdk", @@ -183,20 +190,24 @@ } ], "description": "PHP binding for v4 of the Cloudflare Client API.", + "support": { + "issues": "https://github.com/cloudflare/cloudflare-php/issues", + "source": "https://github.com/cloudflare/cloudflare-php/tree/1.1.1" + }, "time": "2018-08-28T14:01:57+00:00" }, { "name": "composer/ca-bundle", - "version": "1.2.8", + "version": "1.2.9", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "8a7ecad675253e4654ea05505233285377405215" + "reference": "78a0e288fdcebf92aa2318a8d3656168da6ac1a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/8a7ecad675253e4654ea05505233285377405215", - "reference": "8a7ecad675253e4654ea05505233285377405215", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/78a0e288fdcebf92aa2318a8d3656168da6ac1a5", + "reference": "78a0e288fdcebf92aa2318a8d3656168da6ac1a5", "shasum": "" }, "require": { @@ -205,14 +216,15 @@ "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8", + "phpstan/phpstan": "^0.12.55", "psr/log": "^1.0", + "symfony/phpunit-bridge": "^4.2 || ^5", "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.x-dev" + "dev-main": "1.x-dev" } }, "autoload": { @@ -239,6 +251,11 @@ "ssl", "tls" ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/ca-bundle/issues", + "source": "https://github.com/composer/ca-bundle/tree/1.2.9" + }, "funding": [ { "url": "https://packagist.com", @@ -253,43 +270,42 @@ "type": "tidelift" } ], - "time": "2020-08-23T12:54:47+00:00" + "time": "2021-01-12T12:10:35+00:00" }, { "name": "composer/composer", - "version": "1.7.3", + "version": "2.0.13", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "e965b9aaa8854c3067f1ed2ae45f436572d73eb7" + "reference": "986e8b86b7b570632ad0a905c3726c33dd4c0efb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/e965b9aaa8854c3067f1ed2ae45f436572d73eb7", - "reference": "e965b9aaa8854c3067f1ed2ae45f436572d73eb7", + "url": "https://api.github.com/repos/composer/composer/zipball/986e8b86b7b570632ad0a905c3726c33dd4c0efb", + "reference": "986e8b86b7b570632ad0a905c3726c33dd4c0efb", "shasum": "" }, "require": { "composer/ca-bundle": "^1.0", - "composer/semver": "^1.0", + "composer/metadata-minifier": "^1.0", + "composer/semver": "^3.0", "composer/spdx-licenses": "^1.2", "composer/xdebug-handler": "^1.1", - "justinrainbow/json-schema": "^3.0 || ^4.0 || ^5.0", - "php": "^5.3.2 || ^7.0", + "justinrainbow/json-schema": "^5.2.10", + "php": "^5.3.2 || ^7.0 || ^8.0", "psr/log": "^1.0", + "react/promise": "^1.2 || ^2.7", "seld/jsonlint": "^1.4", "seld/phar-utils": "^1.0", - "symfony/console": "^2.7 || ^3.0 || ^4.0", - "symfony/filesystem": "^2.7 || ^3.0 || ^4.0", - "symfony/finder": "^2.7 || ^3.0 || ^4.0", - "symfony/process": "^2.7 || ^3.0 || ^4.0" - }, - "conflict": { - "symfony/console": "2.8.38" + "symfony/console": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0", + "symfony/filesystem": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0", + "symfony/finder": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0", + "symfony/process": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7", - "phpunit/phpunit-mock-objects": "^2.3 || ^3.0" + "phpspec/prophecy": "^1.10", + "symfony/phpunit-bridge": "^4.2 || ^5.0" }, "suggest": { "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages", @@ -302,7 +318,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -318,48 +334,136 @@ { "name": "Nils Adermann", "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" + "homepage": "https://www.naderman.de" }, { "name": "Jordi Boggiano", "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" + "homepage": "https://seld.be" } ], - "description": "Composer helps you declare, manage and install dependencies of PHP projects, ensuring you have the right stack everywhere.", + "description": "Composer helps you declare, manage and install dependencies of PHP projects. It ensures you have the right stack everywhere.", "homepage": "https://getcomposer.org/", "keywords": [ "autoload", "dependency", "package" ], - "time": "2018-11-01T09:05:06+00:00" + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/composer/issues", + "source": "https://github.com/composer/composer/tree/2.0.13" + }, + "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": "2021-04-27T11:11:08+00:00" + }, + { + "name": "composer/metadata-minifier", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/composer/metadata-minifier.git", + "reference": "c549d23829536f0d0e984aaabbf02af91f443207" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/metadata-minifier/zipball/c549d23829536f0d0e984aaabbf02af91f443207", + "reference": "c549d23829536f0d0e984aaabbf02af91f443207", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "composer/composer": "^2", + "phpstan/phpstan": "^0.12.55", + "symfony/phpunit-bridge": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\MetadataMinifier\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Small utility library that handles metadata minification and expansion.", + "keywords": [ + "composer", + "compression" + ], + "support": { + "issues": "https://github.com/composer/metadata-minifier/issues", + "source": "https://github.com/composer/metadata-minifier/tree/1.0.0" + }, + "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": "2021-04-07T13:37:33+00:00" }, { "name": "composer/semver", - "version": "1.4.2", + "version": "3.2.4", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573" + "reference": "a02fdf930a3c1c3ed3a49b5f63859c0c20e10464" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/c7cb9a2095a074d131b65a8a0cd294479d785573", - "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573", + "url": "https://api.github.com/repos/composer/semver/zipball/a02fdf930a3c1c3ed3a49b5f63859c0c20e10464", + "reference": "a02fdf930a3c1c3ed3a49b5f63859c0c20e10464", "shasum": "" }, "require": { - "php": "^5.3.2 || ^7.0" + "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^4.5 || ^5.0.5", - "phpunit/phpunit-mock-objects": "2.3.0 || ^3.0" + "phpstan/phpstan": "^0.12.54", + "symfony/phpunit-bridge": "^4.2 || ^5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.x-dev" + "dev-main": "3.x-dev" } }, "autoload": { @@ -395,20 +499,39 @@ "validation", "versioning" ], - "time": "2016-08-30T16:08:34+00:00" + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.2.4" + }, + "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": "2020-11-13T08:59:24+00:00" }, { "name": "composer/spdx-licenses", - "version": "1.5.4", + "version": "1.5.5", "source": { "type": "git", "url": "https://github.com/composer/spdx-licenses.git", - "reference": "6946f785871e2314c60b4524851f3702ea4f2223" + "reference": "de30328a7af8680efdc03e396aad24befd513200" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/6946f785871e2314c60b4524851f3702ea4f2223", - "reference": "6946f785871e2314c60b4524851f3702ea4f2223", + "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/de30328a7af8680efdc03e396aad24befd513200", + "reference": "de30328a7af8680efdc03e396aad24befd513200", "shasum": "" }, "require": { @@ -420,7 +543,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.x-dev" + "dev-main": "1.x-dev" } }, "autoload": { @@ -455,6 +578,11 @@ "spdx", "validator" ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/spdx-licenses/issues", + "source": "https://github.com/composer/spdx-licenses/tree/1.5.5" + }, "funding": [ { "url": "https://packagist.com", @@ -469,20 +597,20 @@ "type": "tidelift" } ], - "time": "2020-07-15T15:35:07+00:00" + "time": "2020-12-03T16:04:16+00:00" }, { "name": "composer/xdebug-handler", - "version": "1.4.4", + "version": "1.4.6", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "6e076a124f7ee146f2487554a94b6a19a74887ba" + "reference": "f27e06cd9675801df441b3656569b328e04aa37c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6e076a124f7ee146f2487554a94b6a19a74887ba", - "reference": "6e076a124f7ee146f2487554a94b6a19a74887ba", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/f27e06cd9675801df441b3656569b328e04aa37c", + "reference": "f27e06cd9675801df441b3656569b328e04aa37c", "shasum": "" }, "require": { @@ -490,7 +618,8 @@ "psr/log": "^1.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8" + "phpstan/phpstan": "^0.12.55", + "symfony/phpunit-bridge": "^4.2 || ^5" }, "type": "library", "autoload": { @@ -513,6 +642,11 @@ "Xdebug", "performance" ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/1.4.6" + }, "funding": [ { "url": "https://packagist.com", @@ -527,7 +661,7 @@ "type": "tidelift" } ], - "time": "2020-10-24T12:39:10+00:00" + "time": "2021-03-25T17:01:18+00:00" }, { "name": "easyengine/admin-tools-command", @@ -569,6 +703,10 @@ ], "description": "Command to manage admin tools for php based sites.", "homepage": "https://github.com/easyengine/amdin-tools", + "support": { + "issues": "https://github.com/EasyEngine/admin-tools-command/issues", + "source": "https://github.com/EasyEngine/admin-tools-command/tree/master" + }, "time": "2020-08-11T10:14:14+00:00" }, { @@ -616,48 +754,11 @@ ], "description": "Configure HTTP Authentication and whitelisting for EasyEngine site", "homepage": "https://github.com/easyengine/auth-command", - "time": "2020-08-11T10:12:02+00:00" - }, - { - "name": "easyengine/autoload-splitter", - "version": "v1.0.0", - "source": { - "type": "git", - "url": "https://github.com/EasyEngine/autoload-splitter.git", - "reference": "c59a6fd3ca9a7514e47629567d69c8ada6062e7b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/autoload-splitter/zipball/c59a6fd3ca9a7514e47629567d69c8ada6062e7b", - "reference": "c59a6fd3ca9a7514e47629567d69c8ada6062e7b", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.1 || ^2.0" - }, - "type": "composer-plugin", - "extra": { - "class": "WP_CLI\\AutoloadSplitter\\ComposerPlugin" + "support": { + "issues": "https://github.com/EasyEngine/auth-command/issues", + "source": "https://github.com/EasyEngine/auth-command/tree/master" }, - "autoload": { - "psr-4": { - "WP_CLI\\AutoloadSplitter\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Alain Schlesser", - "email": "alain.schlesser@gmail.com", - "homepage": "https://www.alainschlesser.com" - } - ], - "description": "Composer plugin for splitting a generated autoloader into two distinct parts.", - "homepage": "https://wp-cli.org", - "time": "2020-10-29T11:34:56+00:00" + "time": "2020-08-11T10:12:02+00:00" }, { "name": "easyengine/config-command", @@ -699,6 +800,10 @@ ], "description": "Manages EasyEngine configuration", "homepage": "https://github.com/easyengine/config-command", + "support": { + "issues": "https://github.com/EasyEngine/config-command/issues", + "source": "https://github.com/EasyEngine/config-command/tree/master" + }, "time": "2018-12-28T16:04:46+00:00" }, { @@ -746,6 +851,10 @@ ], "description": "Manages cron jobs in EasyEngine", "homepage": "https://github.com/easyengine/cron-command", + "support": { + "issues": "https://github.com/EasyEngine/cron-command/issues", + "source": "https://github.com/EasyEngine/cron-command/tree/master" + }, "time": "2018-12-28T16:05:27+00:00" }, { @@ -785,6 +894,10 @@ "MIT" ], "homepage": "https://github.com/easyengine/log-command", + "support": { + "issues": "https://github.com/EasyEngine/log-command/issues", + "source": "https://github.com/EasyEngine/log-command/tree/master" + }, "time": "2018-12-28T16:07:01+00:00" }, { @@ -828,6 +941,10 @@ ], "description": "Command to manage mailhog", "homepage": "https://github.com/easyengine/mailhog-command", + "support": { + "issues": "https://github.com/EasyEngine/mailhog-command/issues", + "source": "https://github.com/EasyEngine/mailhog-command/tree/master" + }, "time": "2018-12-28T16:05:53+00:00" }, { @@ -873,6 +990,10 @@ ], "description": "Command to manager global containers/services in EasyEngine", "homepage": "https://github.com/easyengine/service-command", + "support": { + "issues": "https://github.com/EasyEngine/service-command/issues", + "source": "https://github.com/EasyEngine/service-command/tree/master" + }, "time": "2020-08-11T10:19:09+00:00" }, { @@ -913,6 +1034,10 @@ ], "description": "Shell to run helpful commands inside containers.", "homepage": "https://github.com/easyengine/shell-command", + "support": { + "issues": "https://github.com/EasyEngine/shell-command/issues", + "source": "https://github.com/EasyEngine/shell-command/tree/master" + }, "time": "2019-03-18T13:42:13+00:00" }, { @@ -976,6 +1101,10 @@ "MIT" ], "homepage": "https://github.com/easyengine/site-command", + "support": { + "issues": "https://github.com/EasyEngine/site-command/issues", + "source": "https://github.com/EasyEngine/site-command/tree/v2.6.2" + }, "time": "2020-08-20T09:17:14+00:00" }, { @@ -1031,6 +1160,10 @@ ], "description": "EasyEngine package for PHP site creation.", "homepage": "https://github.com/easyengine/site-type-php", + "support": { + "issues": "https://github.com/EasyEngine/site-type-php/issues", + "source": "https://github.com/EasyEngine/site-type-php/tree/v1.3.1" + }, "time": "2020-08-20T09:15:47+00:00" }, { @@ -1086,6 +1219,10 @@ ], "description": "EasyEngine site type package for WordPress site creation.", "homepage": "https://github.com/easyengine/site-type-wp", + "support": { + "issues": "https://github.com/EasyEngine/site-type-wp/issues", + "source": "https://github.com/EasyEngine/site-type-wp/tree/v1.3.2" + }, "time": "2020-09-23T03:49:19+00:00" }, { @@ -1151,20 +1288,24 @@ "rest", "web service" ], + "support": { + "issues": "https://github.com/guzzle/guzzle/issues", + "source": "https://github.com/guzzle/guzzle/tree/master" + }, "time": "2018-04-22T15:46:56+00:00" }, { "name": "guzzlehttp/promises", - "version": "1.4.0", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "60d379c243457e073cff02bc323a2a86cb355631" + "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/60d379c243457e073cff02bc323a2a86cb355631", - "reference": "60d379c243457e073cff02bc323a2a86cb355631", + "url": "https://api.github.com/repos/guzzle/promises/zipball/8e7d04f1f6450fef59366c399cfad4b9383aa30d", + "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d", "shasum": "" }, "require": { @@ -1202,20 +1343,24 @@ "keywords": [ "promise" ], - "time": "2020-09-30T07:37:28+00:00" + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/1.4.1" + }, + "time": "2021-03-07T09:25:29+00:00" }, { "name": "guzzlehttp/psr7", - "version": "1.7.0", + "version": "1.8.2", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "53330f47520498c0ae1f61f7e2c90f55690c06a3" + "reference": "dc960a912984efb74d0a90222870c72c87f10c91" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/53330f47520498c0ae1f61f7e2c90f55690c06a3", - "reference": "53330f47520498c0ae1f61f7e2c90f55690c06a3", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/dc960a912984efb74d0a90222870c72c87f10c91", + "reference": "dc960a912984efb74d0a90222870c72c87f10c91", "shasum": "" }, "require": { @@ -1273,27 +1418,31 @@ "uri", "url" ], - "time": "2020-09-30T07:37:11+00:00" + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/1.8.2" + }, + "time": "2021-04-26T09:17:50+00:00" }, { "name": "justinrainbow/json-schema", - "version": "5.2.7", + "version": "5.2.10", "source": { "type": "git", "url": "https://github.com/justinrainbow/json-schema.git", - "reference": "8560d4314577199ba51bf2032f02cd1315587c23" + "reference": "2ba9c8c862ecd5510ed16c6340aa9f6eadb4f31b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/8560d4314577199ba51bf2032f02cd1315587c23", - "reference": "8560d4314577199ba51bf2032f02cd1315587c23", + "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/2ba9c8c862ecd5510ed16c6340aa9f6eadb4f31b", + "reference": "2ba9c8c862ecd5510ed16c6340aa9f6eadb4f31b", "shasum": "" }, "require": { "php": ">=5.3.3" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.1", + "friendsofphp/php-cs-fixer": "~2.2.20||~2.15.1", "json-schema/json-schema-test-suite": "1.2.0", "phpunit/phpunit": "^4.8.35" }, @@ -1339,7 +1488,11 @@ "json", "schema" ], - "time": "2018-02-14T22:26:30+00:00" + "support": { + "issues": "https://github.com/justinrainbow/json-schema/issues", + "source": "https://github.com/justinrainbow/json-schema/tree/5.2.10" + }, + "time": "2020-05-27T16:41:55+00:00" }, { "name": "league/flysystem", @@ -1423,6 +1576,10 @@ "sftp", "storage" ], + "support": { + "issues": "https://github.com/thephpleague/flysystem/issues", + "source": "https://github.com/thephpleague/flysystem/tree/master" + }, "time": "2018-11-23T23:41:29+00:00" }, { @@ -1501,6 +1658,10 @@ "logging", "psr-3" ], + "support": { + "issues": "https://github.com/Seldaek/monolog/issues", + "source": "https://github.com/Seldaek/monolog/tree/1.24.0" + }, "time": "2018-11-05T09:00:11+00:00" }, { @@ -1547,6 +1708,10 @@ "mustache", "templating" ], + "support": { + "issues": "https://github.com/bobthecow/mustache.php/issues", + "source": "https://github.com/bobthecow/mustache.php/tree/dev" + }, "time": "2017-07-11T12:54:05+00:00" }, { @@ -1596,6 +1761,10 @@ "container-interop", "psr" ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/master" + }, "time": "2017-02-14T16:28:37+00:00" }, { @@ -1646,20 +1815,23 @@ "request", "response" ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/master" + }, "time": "2016-08-06T14:39:51+00:00" }, { "name": "psr/log", - "version": "1.1.3", + "version": "1.1.4", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" + "reference": "d49695b909c3b7628b6289db5479a1c204601f11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", + "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11", "shasum": "" }, "require": { @@ -1683,7 +1855,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for logging libraries", @@ -1693,7 +1865,10 @@ "psr", "psr-3" ], - "time": "2020-03-23T09:12:05+00:00" + "support": { + "source": "https://github.com/php-fig/log/tree/1.1.4" + }, + "time": "2021-05-03T11:20:27+00:00" }, { "name": "ralouphie/getallheaders", @@ -1733,27 +1908,88 @@ } ], "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, "time": "2019-03-08T08:55:37+00:00" }, + { + "name": "react/promise", + "version": "v2.8.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/promise.git", + "reference": "f3cff96a19736714524ca0dd1d4130de73dbbbc4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/promise/zipball/f3cff96a19736714524ca0dd1d4130de73dbbbc4", + "reference": "f3cff96a19736714524ca0dd1d4130de73dbbbc4", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^7.0 || ^6.5 || ^5.7 || ^4.8.36" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com" + } + ], + "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/v2.8.0" + }, + "time": "2020-05-12T15:16:56+00:00" + }, { "name": "rmccue/requests", - "version": "v1.7.0", + "version": "v1.8.0", "source": { "type": "git", - "url": "https://github.com/rmccue/Requests.git", - "reference": "87932f52ffad70504d93f04f15690cf16a089546" + "url": "https://github.com/WordPress/Requests.git", + "reference": "afbe4790e4def03581c4a0963a1e8aa01f6030f1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rmccue/Requests/zipball/87932f52ffad70504d93f04f15690cf16a089546", - "reference": "87932f52ffad70504d93f04f15690cf16a089546", + "url": "https://api.github.com/repos/WordPress/Requests/zipball/afbe4790e4def03581c4a0963a1e8aa01f6030f1", + "reference": "afbe4790e4def03581c4a0963a1e8aa01f6030f1", "shasum": "" }, "require": { "php": ">=5.2" }, "require-dev": { - "requests/test-server": "dev-master" + "dealerdirect/phpcodesniffer-composer-installer": "^0.7", + "php-parallel-lint/php-console-highlighter": "^0.5.0", + "php-parallel-lint/php-parallel-lint": "^1.3", + "phpcompatibility/php-compatibility": "^9.0", + "phpunit/phpunit": "^4.8 || ^5.7 || ^6.5 || ^7.5", + "requests/test-server": "dev-master", + "squizlabs/php_codesniffer": "^3.5", + "wp-coding-standards/wpcs": "^2.0" }, "type": "library", "autoload": { @@ -1772,7 +2008,7 @@ } ], "description": "A HTTP library written in PHP, for human beings.", - "homepage": "http://github.com/rmccue/Requests", + "homepage": "http://github.com/WordPress/Requests", "keywords": [ "curl", "fsockopen", @@ -1782,20 +2018,24 @@ "iri", "sockets" ], - "time": "2016-10-13T00:11:37+00:00" + "support": { + "issues": "https://github.com/WordPress/Requests/issues", + "source": "https://github.com/WordPress/Requests/tree/v1.8.0" + }, + "time": "2021-04-27T11:05:25+00:00" }, { "name": "seld/jsonlint", - "version": "1.8.2", + "version": "1.8.3", "source": { "type": "git", "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "590cfec960b77fd55e39b7d9246659e95dd6d337" + "reference": "9ad6ce79c342fbd44df10ea95511a1b24dee5b57" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/590cfec960b77fd55e39b7d9246659e95dd6d337", - "reference": "590cfec960b77fd55e39b7d9246659e95dd6d337", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/9ad6ce79c342fbd44df10ea95511a1b24dee5b57", + "reference": "9ad6ce79c342fbd44df10ea95511a1b24dee5b57", "shasum": "" }, "require": { @@ -1831,6 +2071,10 @@ "parser", "validator" ], + "support": { + "issues": "https://github.com/Seldaek/jsonlint/issues", + "source": "https://github.com/Seldaek/jsonlint/tree/1.8.3" + }, "funding": [ { "url": "https://github.com/Seldaek", @@ -1841,7 +2085,7 @@ "type": "tidelift" } ], - "time": "2020-08-25T06:56:57+00:00" + "time": "2020-11-11T09:19:24+00:00" }, { "name": "seld/phar-utils", @@ -1885,6 +2129,10 @@ "keywords": [ "phar" ], + "support": { + "issues": "https://github.com/Seldaek/phar-utils/issues", + "source": "https://github.com/Seldaek/phar-utils/tree/master" + }, "time": "2020-07-07T18:42:57+00:00" }, { @@ -1949,20 +2197,23 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/config/tree/3.4" + }, "time": "2018-10-31T09:06:03+00:00" }, { "name": "symfony/console", - "version": "v3.4.18", + "version": "v3.4.35", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "1d228fb4602047d7b26a0554e0d3efd567da5803" + "reference": "17b154f932c5874cdbda6d05796b6490eec9f9f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/1d228fb4602047d7b26a0554e0d3efd567da5803", - "reference": "1d228fb4602047d7b26a0554e0d3efd567da5803", + "url": "https://api.github.com/repos/symfony/console/zipball/17b154f932c5874cdbda6d05796b6490eec9f9f7", + "reference": "17b154f932c5874cdbda6d05796b6490eec9f9f7", "shasum": "" }, "require": { @@ -1974,6 +2225,9 @@ "symfony/dependency-injection": "<3.4", "symfony/process": "<3.3" }, + "provide": { + "psr/log-implementation": "1.0" + }, "require-dev": { "psr/log": "~1.0", "symfony/config": "~3.3|~4.0", @@ -1983,7 +2237,7 @@ "symfony/process": "~3.3|~4.0" }, "suggest": { - "psr/log-implementation": "For using the console logger", + "psr/log": "For using the console logger", "symfony/event-dispatcher": "", "symfony/lock": "", "symfony/process": "" @@ -2018,7 +2272,10 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-10-30T16:50:50+00:00" + "support": { + "source": "https://github.com/symfony/console/tree/3.4" + }, + "time": "2019-11-13T07:12:39+00:00" }, { "name": "symfony/debug", @@ -2074,6 +2331,9 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/debug/tree/3.4" + }, "time": "2018-10-31T09:06:03+00:00" }, { @@ -2145,6 +2405,9 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/dependency-injection/tree/v3.4.27" + }, "time": "2019-04-20T15:32:49+00:00" }, { @@ -2208,20 +2471,23 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/event-dispatcher/tree/3.4" + }, "time": "2018-10-30T16:50:50+00:00" }, { "name": "symfony/filesystem", - "version": "v3.4.18", + "version": "v3.4.35", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "d69930fc337d767607267d57c20a7403d0a822a4" + "reference": "00e3a6ddd723b8bcfe4f2a1b6f82b98eeeb51516" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/d69930fc337d767607267d57c20a7403d0a822a4", - "reference": "d69930fc337d767607267d57c20a7403d0a822a4", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/00e3a6ddd723b8bcfe4f2a1b6f82b98eeeb51516", + "reference": "00e3a6ddd723b8bcfe4f2a1b6f82b98eeeb51516", "shasum": "" }, "require": { @@ -2258,20 +2524,23 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2018-10-02T12:28:39+00:00" + "support": { + "source": "https://github.com/symfony/filesystem/tree/v3.4.31" + }, + "time": "2019-08-20T13:31:17+00:00" }, { "name": "symfony/finder", - "version": "v3.4.18", + "version": "v3.4.35", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "54ba444dddc5bd5708a34bd095ea67c6eb54644d" + "reference": "3e915e5ce305f8bc8017597f71f1f4095092ddf8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/54ba444dddc5bd5708a34bd095ea67c6eb54644d", - "reference": "54ba444dddc5bd5708a34bd095ea67c6eb54644d", + "url": "https://api.github.com/repos/symfony/finder/zipball/3e915e5ce305f8bc8017597f71f1f4095092ddf8", + "reference": "3e915e5ce305f8bc8017597f71f1f4095092ddf8", "shasum": "" }, "require": { @@ -2307,20 +2576,23 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2018-10-03T08:46:40+00:00" + "support": { + "source": "https://github.com/symfony/finder/tree/v3.4.33" + }, + "time": "2019-10-30T12:43:22+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.20.0", + "version": "v1.23.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41" + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f4ba089a5b6366e453971d3aad5fe8e897b37f41", - "reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", "shasum": "" }, "require": { @@ -2332,7 +2604,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.20-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -2369,6 +2641,9 @@ "polyfill", "portable" ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -2383,20 +2658,20 @@ "type": "tidelift" } ], - "time": "2020-10-23T14:02:19+00:00" + "time": "2021-02-19T12:13:01+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.20.0", + "version": "v1.23.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "39d483bdf39be819deabf04ec872eb0b2410b531" + "reference": "2df51500adbaebdc4c38dea4c89a2e131c45c8a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/39d483bdf39be819deabf04ec872eb0b2410b531", - "reference": "39d483bdf39be819deabf04ec872eb0b2410b531", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/2df51500adbaebdc4c38dea4c89a2e131c45c8a1", + "reference": "2df51500adbaebdc4c38dea4c89a2e131c45c8a1", "shasum": "" }, "require": { @@ -2408,7 +2683,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.20-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -2446,6 +2721,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -2460,20 +2738,20 @@ "type": "tidelift" } ], - "time": "2020-10-23T14:02:19+00:00" + "time": "2021-05-27T09:27:20+00:00" }, { "name": "symfony/process", - "version": "v3.4.18", + "version": "v3.4.35", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "35c2914a9f50519bd207164c353ae4d59182c2cb" + "reference": "c19da50bc3e8fa7d60628fdb4ab5d67de534cf3e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/35c2914a9f50519bd207164c353ae4d59182c2cb", - "reference": "35c2914a9f50519bd207164c353ae4d59182c2cb", + "url": "https://api.github.com/repos/symfony/process/zipball/c19da50bc3e8fa7d60628fdb4ab5d67de534cf3e", + "reference": "c19da50bc3e8fa7d60628fdb4ab5d67de534cf3e", "shasum": "" }, "require": { @@ -2509,7 +2787,10 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2018-10-14T17:33:21+00:00" + "support": { + "source": "https://github.com/symfony/process/tree/3.4" + }, + "time": "2019-10-24T15:33:53+00:00" }, { "name": "symfony/serializer", @@ -2588,6 +2869,9 @@ ], "description": "Symfony Serializer Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/serializer/tree/3.4" + }, "time": "2018-12-02T13:20:19+00:00" }, { @@ -2656,6 +2940,9 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/translation/tree/3.4" + }, "time": "2018-10-02T16:33:53+00:00" }, { @@ -2715,6 +3002,9 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/yaml/tree/3.4" + }, "time": "2018-10-02T16:33:53+00:00" }, { @@ -2722,12 +3012,12 @@ "version": "1.3.0", "source": { "type": "git", - "url": "https://github.com/webmozart/assert.git", + "url": "https://github.com/webmozarts/assert.git", "reference": "0df1908962e7a3071564e857d86874dad1ef204a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", "reference": "0df1908962e7a3071564e857d86874dad1ef204a", "shasum": "" }, @@ -2765,6 +3055,10 @@ "check", "validate" ], + "support": { + "issues": "https://github.com/webmozarts/assert/issues", + "source": "https://github.com/webmozarts/assert/tree/1.3.0" + }, "time": "2018-01-29T19:49:41+00:00" }, { @@ -2813,6 +3107,9 @@ ], "description": "A simple YAML loader/dumper class for PHP (WP-CLI fork)", "homepage": "https://github.com/mustangostang/spyc/", + "support": { + "source": "https://github.com/wp-cli/spyc/tree/autoload" + }, "time": "2017-04-25T11:26:20+00:00" }, { @@ -2863,6 +3160,10 @@ "cli", "console" ], + "support": { + "issues": "https://github.com/wp-cli/php-cli-tools/issues", + "source": "https://github.com/wp-cli/php-cli-tools/tree/master" + }, "time": "2018-08-22T10:11:06+00:00" } ], @@ -2945,27 +3246,32 @@ "symfony", "testing" ], + "support": { + "issues": "https://github.com/Behat/Behat/issues", + "source": "https://github.com/Behat/Behat/tree/v3.7.0" + }, "time": "2020-06-03T13:08:44+00:00" }, { "name": "behat/gherkin", - "version": "v4.6.2", + "version": "v4.7.3", "source": { "type": "git", "url": "https://github.com/Behat/Gherkin.git", - "reference": "51ac4500c4dc30cbaaabcd2f25694299df666a31" + "reference": "d5ae4616aeaa91daadbfb8446d9d17aae8d43cf7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Behat/Gherkin/zipball/51ac4500c4dc30cbaaabcd2f25694299df666a31", - "reference": "51ac4500c4dc30cbaaabcd2f25694299df666a31", + "url": "https://api.github.com/repos/Behat/Gherkin/zipball/d5ae4616aeaa91daadbfb8446d9d17aae8d43cf7", + "reference": "d5ae4616aeaa91daadbfb8446d9d17aae8d43cf7", "shasum": "" }, "require": { - "php": ">=5.3.1" + "php": ">=5.6" }, "require-dev": { - "phpunit/phpunit": "~4.5|~5", + "cucumber/cucumber": "dev-gherkin-16.0.0", + "phpunit/phpunit": "^5.7.1|~6|~7", "symfony/phpunit-bridge": "~2.7|~3|~4", "symfony/yaml": "~2.3|~3|~4" }, @@ -2994,7 +3300,7 @@ "homepage": "http://everzet.com" } ], - "description": "Gherkin DSL parser for PHP 5.3", + "description": "Gherkin DSL parser for PHP", "homepage": "http://behat.org/", "keywords": [ "BDD", @@ -3004,7 +3310,11 @@ "gherkin", "parser" ], - "time": "2020-03-17T14:03:26+00:00" + "support": { + "issues": "https://github.com/Behat/Gherkin/issues", + "source": "https://github.com/Behat/Gherkin/tree/v4.7.3" + }, + "time": "2021-02-04T12:26:47+00:00" }, { "name": "behat/transliterator", @@ -3049,6 +3359,10 @@ "slug", "transliterator" ], + "support": { + "issues": "https://github.com/Behat/Transliterator/issues", + "source": "https://github.com/Behat/Transliterator/tree/v1.3.0" + }, "time": "2020-01-14T16:39:13+00:00" }, { @@ -3115,6 +3429,10 @@ "stylecheck", "tests" ], + "support": { + "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues", + "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer" + }, "time": "2020-06-25T14:57:39+00:00" }, { @@ -3168,6 +3486,10 @@ "phpcs", "standards" ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", + "source": "https://github.com/PHPCompatibility/PHPCompatibility" + }, "time": "2018-07-17T13:42:26+00:00" }, { @@ -3229,27 +3551,32 @@ "testing", "xunit" ], + "support": { + "irc": "irc://irc.freenode.net/phpunit", + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/1.2.18" + }, "time": "2014-09-02T10:13:14+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "2.0.2", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "050bedf145a257b1ff02746c31894800e5122946" + "reference": "4b49fb70f067272b659ef0174ff9ca40fdaa6357" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/050bedf145a257b1ff02746c31894800e5122946", - "reference": "050bedf145a257b1ff02746c31894800e5122946", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/4b49fb70f067272b659ef0174ff9ca40fdaa6357", + "reference": "4b49fb70f067272b659ef0174ff9ca40fdaa6357", "shasum": "" }, "require": { - "php": "^7.1" + "php": ">=7.1" }, "require-dev": { - "phpunit/phpunit": "^7.1" + "phpunit/phpunit": "^8.5" }, "type": "library", "extra": { @@ -3279,7 +3606,17 @@ "filesystem", "iterator" ], - "time": "2018-09-13T20:33:42+00:00" + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/2.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-30T08:25:21+00:00" }, { "name": "phpunit/php-text-template", @@ -3320,6 +3657,10 @@ "keywords": [ "template" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/1.2.1" + }, "time": "2015-06-21T13:50:34+00:00" }, { @@ -3369,6 +3710,10 @@ "keywords": [ "timer" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/master" + }, "time": "2017-02-26T11:10:40+00:00" }, { @@ -3419,6 +3764,11 @@ "keywords": [ "tokenizer" ], + "support": { + "irc": "irc://irc.freenode.net/phpunit", + "issues": "https://github.com/sebastianbergmann/php-token-stream/issues", + "source": "https://github.com/sebastianbergmann/php-token-stream/tree/1.2.2" + }, "abandoned": true, "time": "2014-03-03T05:10:30+00:00" }, @@ -3494,6 +3844,11 @@ "testing", "xunit" ], + "support": { + "irc": "irc://irc.freenode.net/phpunit", + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "source": "https://github.com/sebastianbergmann/phpunit/tree/3.7.18" + }, "time": "2013-03-07T21:45:39+00:00" }, { @@ -3543,331 +3898,26 @@ "mock", "xunit" ], + "support": { + "irc": "irc://irc.freenode.net/phpunit", + "issues": "https://github.com/sebastianbergmann/phpunit-mock-objects/issues", + "source": "https://github.com/sebastianbergmann/phpunit-mock-objects/tree/1.2.3" + }, "abandoned": true, "time": "2013-01-13T10:24:48+00:00" }, - { - "name": "roave/security-advisories", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "327370943772f9917bc2dc2aa4263db2d572a112" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/327370943772f9917bc2dc2aa4263db2d572a112", - "reference": "327370943772f9917bc2dc2aa4263db2d572a112", - "shasum": "" - }, - "conflict": { - "3f/pygmentize": "<1.2", - "adodb/adodb-php": "<5.20.12", - "alterphp/easyadmin-extension-bundle": ">=1.2,<1.2.11|>=1.3,<1.3.1", - "amphp/artax": "<1.0.6|>=2,<2.0.6", - "amphp/http": "<1.0.1", - "amphp/http-client": ">=4,<4.4", - "api-platform/core": ">=2.2,<2.2.10|>=2.3,<2.3.6", - "asymmetricrypt/asymmetricrypt": ">=0,<9.9.99", - "aws/aws-sdk-php": ">=3,<3.2.1", - "bagisto/bagisto": "<0.1.5", - "barrelstrength/sprout-base-email": "<1.2.7", - "barrelstrength/sprout-forms": "<3.9", - "baserproject/basercms": ">=4,<=4.3.6", - "bolt/bolt": "<3.7.1", - "brightlocal/phpwhois": "<=4.2.5", - "buddypress/buddypress": "<5.1.2", - "bugsnag/bugsnag-laravel": ">=2,<2.0.2", - "cakephp/cakephp": ">=1.3,<1.3.18|>=2,<2.4.99|>=2.5,<2.5.99|>=2.6,<2.6.12|>=2.7,<2.7.6|>=3,<3.5.18|>=3.6,<3.6.15|>=3.7,<3.7.7", - "cart2quote/module-quotation": ">=4.1.6,<=4.4.5|>=5,<5.4.4", - "cartalyst/sentry": "<=2.1.6", - "centreon/centreon": "<18.10.8|>=19,<19.4.5", - "cesnet/simplesamlphp-module-proxystatistics": "<3.1", - "codeigniter/framework": "<=3.0.6", - "composer/composer": "<=1-alpha.11", - "contao-components/mediaelement": ">=2.14.2,<2.21.1", - "contao/core": ">=2,<3.5.39", - "contao/core-bundle": ">=4,<4.4.52|>=4.5,<4.9.6|= 4.10.0", - "contao/listing-bundle": ">=4,<4.4.8", - "datadog/dd-trace": ">=0.30,<0.30.2", - "david-garcia/phpwhois": "<=4.3.1", - "derhansen/sf_event_mgt": "<4.3.1|>=5,<5.1.1", - "doctrine/annotations": ">=1,<1.2.7", - "doctrine/cache": ">=1,<1.3.2|>=1.4,<1.4.2", - "doctrine/common": ">=2,<2.4.3|>=2.5,<2.5.1", - "doctrine/dbal": ">=2,<2.0.8|>=2.1,<2.1.2", - "doctrine/doctrine-bundle": "<1.5.2", - "doctrine/doctrine-module": "<=0.7.1", - "doctrine/mongodb-odm": ">=1,<1.0.2", - "doctrine/mongodb-odm-bundle": ">=2,<3.0.1", - "doctrine/orm": ">=2,<2.4.8|>=2.5,<2.5.1", - "dolibarr/dolibarr": "<11.0.4", - "dompdf/dompdf": ">=0.6,<0.6.2", - "drupal/core": ">=7,<7.73|>=8,<8.8.10|>=8.9,<8.9.6|>=9,<9.0.6", - "drupal/drupal": ">=7,<7.73|>=8,<8.8.10|>=8.9,<8.9.6|>=9,<9.0.6", - "endroid/qr-code-bundle": "<3.4.2", - "enshrined/svg-sanitize": "<0.13.1", - "erusev/parsedown": "<1.7.2", - "ezsystems/demobundle": ">=5.4,<5.4.6.1", - "ezsystems/ezdemo-ls-extension": ">=5.4,<5.4.2.1", - "ezsystems/ezfind-ls": ">=5.3,<5.3.6.1|>=5.4,<5.4.11.1|>=2017.12,<2017.12.0.1", - "ezsystems/ezplatform": ">=1.7,<1.7.9.1|>=1.13,<1.13.5.1|>=2.5,<2.5.4", - "ezsystems/ezplatform-admin-ui": ">=1.3,<1.3.5|>=1.4,<1.4.6", - "ezsystems/ezplatform-admin-ui-assets": ">=4,<4.2.1|>=5,<5.0.1|>=5.1,<5.1.1", - "ezsystems/ezplatform-kernel": ">=1,<1.0.2.1", - "ezsystems/ezplatform-user": ">=1,<1.0.1", - "ezsystems/ezpublish-kernel": ">=5.3,<5.3.12.1|>=5.4,<5.4.14.2|>=6,<6.7.9.1|>=6.8,<6.13.6.3|>=7,<7.2.4.1|>=7.3,<7.3.2.1|>=7.5,<7.5.7.1", - "ezsystems/ezpublish-legacy": ">=5.3,<5.3.12.6|>=5.4,<5.4.14.2|>=2011,<2017.12.7.3|>=2018.6,<2018.6.1.4|>=2018.9,<2018.9.1.3|>=2019.3,<2019.3.5.1", - "ezsystems/platform-ui-assets-bundle": ">=4.2,<4.2.3", - "ezsystems/repository-forms": ">=2.3,<2.3.2.1", - "ezyang/htmlpurifier": "<4.1.1", - "firebase/php-jwt": "<2", - "fooman/tcpdf": "<6.2.22", - "fossar/tcpdf-parser": "<6.2.22", - "friendsofsymfony/oauth2-php": "<1.3", - "friendsofsymfony/rest-bundle": ">=1.2,<1.2.2", - "friendsofsymfony/user-bundle": ">=1.2,<1.3.5", - "friendsoftypo3/mediace": ">=7.6.2,<7.6.5", - "fuel/core": "<1.8.1", - "getgrav/grav": "<1.7-beta.8", - "gos/web-socket-bundle": "<1.10.4|>=2,<2.6.1|>=3,<3.3", - "gree/jose": "<=2.2", - "gregwar/rst": "<1.0.3", - "guzzlehttp/guzzle": ">=4-rc.2,<4.2.4|>=5,<5.3.1|>=6,<6.2.1", - "illuminate/auth": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.10", - "illuminate/cookie": ">=4,<=4.0.11|>=4.1,<=4.1.99999|>=4.2,<=4.2.99999|>=5,<=5.0.99999|>=5.1,<=5.1.99999|>=5.2,<=5.2.99999|>=5.3,<=5.3.99999|>=5.4,<=5.4.99999|>=5.5,<=5.5.49|>=5.6,<=5.6.99999|>=5.7,<=5.7.99999|>=5.8,<=5.8.99999|>=6,<6.18.31|>=7,<7.22.4", - "illuminate/database": ">=4,<4.0.99|>=4.1,<4.1.29|>=5.5,<=5.5.44|>=6,<6.18.34|>=7,<7.23.2", - "illuminate/encryption": ">=4,<=4.0.11|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.40|>=5.6,<5.6.15", - "illuminate/view": ">=7,<7.1.2", - "ivankristianto/phpwhois": "<=4.3", - "james-heinrich/getid3": "<1.9.9", - "joomla/session": "<1.3.1", - "jsmitty12/phpwhois": "<5.1", - "kazist/phpwhois": "<=4.2.6", - "kitodo/presentation": "<3.1.2", - "kreait/firebase-php": ">=3.2,<3.8.1", - "la-haute-societe/tcpdf": "<6.2.22", - "laravel/framework": ">=4,<4.0.99|>=4.1,<=4.1.99999|>=4.2,<=4.2.99999|>=5,<=5.0.99999|>=5.1,<=5.1.99999|>=5.2,<=5.2.99999|>=5.3,<=5.3.99999|>=5.4,<=5.4.99999|>=5.5,<=5.5.49|>=5.6,<=5.6.99999|>=5.7,<=5.7.99999|>=5.8,<=5.8.99999|>=6,<6.18.34|>=7,<7.23.2", - "laravel/socialite": ">=1,<1.0.99|>=2,<2.0.10", - "league/commonmark": "<0.18.3", - "librenms/librenms": "<1.53", - "livewire/livewire": ">2.2.4,<2.2.6", - "magento/community-edition": ">=2,<2.2.10|>=2.3,<2.3.3", - "magento/magento1ce": "<1.9.4.3", - "magento/magento1ee": ">=1,<1.14.4.3", - "magento/product-community-edition": ">=2,<2.2.10|>=2.3,<2.3.2-p.2", - "marcwillmann/turn": "<0.3.3", - "mediawiki/core": ">=1.31,<1.31.4|>=1.32,<1.32.4|>=1.33,<1.33.1", - "mittwald/typo3_forum": "<1.2.1", - "monolog/monolog": ">=1.8,<1.12", - "namshi/jose": "<2.2", - "nette/application": ">=2,<2.0.19|>=2.1,<2.1.13|>=2.2,<2.2.10|>=2.3,<2.3.14|>=2.4,<2.4.16|>=3,<3.0.6", - "nette/nette": ">=2,<2.0.19|>=2.1,<2.1.13", - "nystudio107/craft-seomatic": "<3.3", - "nzo/url-encryptor-bundle": ">=4,<4.3.2|>=5,<5.0.1", - "october/backend": ">=1.0.319,<1.0.467", - "october/cms": ">=1.0.319,<1.0.466", - "october/october": ">=1.0.319,<1.0.466", - "october/rain": ">=1.0.319,<1.0.468", - "onelogin/php-saml": "<2.10.4", - "oneup/uploader-bundle": "<1.9.3|>=2,<2.1.5", - "openid/php-openid": "<2.3", - "openmage/magento-lts": "<19.4.6|>=20,<20.0.2", - "oro/crm": ">=1.7,<1.7.4", - "oro/platform": ">=1.7,<1.7.4", - "padraic/humbug_get_contents": "<1.1.2", - "pagarme/pagarme-php": ">=0,<3", - "paragonie/random_compat": "<2", - "paypal/merchant-sdk-php": "<3.12", - "pear/archive_tar": "<1.4.4", - "personnummer/personnummer": "<3.0.2", - "phpfastcache/phpfastcache": ">=5,<5.0.13", - "phpmailer/phpmailer": "<6.1.6", - "phpmussel/phpmussel": ">=1,<1.6", - "phpmyadmin/phpmyadmin": "<4.9.2", - "phpoffice/phpexcel": "<1.8.2", - "phpoffice/phpspreadsheet": "<1.8", - "phpunit/phpunit": ">=4.8.19,<4.8.28|>=5.0.10,<5.6.3", - "phpwhois/phpwhois": "<=4.2.5", - "phpxmlrpc/extras": "<0.6.1", - "pimcore/pimcore": "<6.3", - "prestashop/autoupgrade": ">=4,<4.10.1", - "prestashop/contactform": ">1.0.1,<4.3", - "prestashop/gamification": "<2.3.2", - "prestashop/ps_facetedsearch": "<3.4.1", - "privatebin/privatebin": "<1.2.2|>=1.3,<1.3.2", - "propel/propel": ">=2-alpha.1,<=2-alpha.7", - "propel/propel1": ">=1,<=1.7.1", - "pterodactyl/panel": "<0.7.19|>=1-rc.0,<=1-rc.6", - "pusher/pusher-php-server": "<2.2.1", - "rainlab/debugbar-plugin": "<3.1", - "robrichards/xmlseclibs": "<3.0.4", - "sabberworm/php-css-parser": ">=1,<1.0.1|>=2,<2.0.1|>=3,<3.0.1|>=4,<4.0.1|>=5,<5.0.9|>=5.1,<5.1.3|>=5.2,<5.2.1|>=6,<6.0.2|>=7,<7.0.4|>=8,<8.0.1|>=8.1,<8.1.1|>=8.2,<8.2.1|>=8.3,<8.3.1", - "sabre/dav": ">=1.6,<1.6.99|>=1.7,<1.7.11|>=1.8,<1.8.9", - "scheb/two-factor-bundle": ">=0,<3.26|>=4,<4.11", - "sensiolabs/connect": "<4.2.3", - "serluck/phpwhois": "<=4.2.6", - "shopware/core": "<=6.3.1", - "shopware/platform": "<=6.3.1", - "shopware/shopware": "<5.3.7", - "silverstripe/admin": ">=1.0.3,<1.0.4|>=1.1,<1.1.1", - "silverstripe/assets": ">=1,<1.4.7|>=1.5,<1.5.2", - "silverstripe/cms": "<4.3.6|>=4.4,<4.4.4", - "silverstripe/comments": ">=1.3,<1.9.99|>=2,<2.9.99|>=3,<3.1.1", - "silverstripe/forum": "<=0.6.1|>=0.7,<=0.7.3", - "silverstripe/framework": "<4.4.7|>=4.5,<4.5.4", - "silverstripe/graphql": ">=2,<2.0.5|>=3,<3.1.2|>=3.2,<3.2.4", - "silverstripe/registry": ">=2.1,<2.1.2|>=2.2,<2.2.1", - "silverstripe/restfulserver": ">=1,<1.0.9|>=2,<2.0.4", - "silverstripe/subsites": ">=2,<2.1.1", - "silverstripe/taxonomy": ">=1.3,<1.3.1|>=2,<2.0.1", - "silverstripe/userforms": "<3", - "simple-updates/phpwhois": "<=1", - "simplesamlphp/saml2": "<1.10.6|>=2,<2.3.8|>=3,<3.1.4", - "simplesamlphp/simplesamlphp": "<1.18.6", - "simplesamlphp/simplesamlphp-module-infocard": "<1.0.1", - "simplito/elliptic-php": "<1.0.6", - "slim/slim": "<2.6", - "smarty/smarty": "<3.1.33", - "socalnick/scn-social-auth": "<1.15.2", - "spoonity/tcpdf": "<6.2.22", - "squizlabs/php_codesniffer": ">=1,<2.8.1|>=3,<3.0.1", - "ssddanbrown/bookstack": "<0.29.2", - "stormpath/sdk": ">=0,<9.9.99", - "studio-42/elfinder": "<2.1.49", - "sulu/sulu": "<1.6.34|>=2,<2.0.10|>=2.1,<2.1.1", - "swiftmailer/swiftmailer": ">=4,<5.4.5", - "sylius/admin-bundle": ">=1,<1.0.17|>=1.1,<1.1.9|>=1.2,<1.2.2", - "sylius/grid": ">=1,<1.1.19|>=1.2,<1.2.18|>=1.3,<1.3.13|>=1.4,<1.4.5|>=1.5,<1.5.1", - "sylius/grid-bundle": ">=1,<1.1.19|>=1.2,<1.2.18|>=1.3,<1.3.13|>=1.4,<1.4.5|>=1.5,<1.5.1", - "sylius/resource-bundle": "<1.3.14|>=1.4,<1.4.7|>=1.5,<1.5.2|>=1.6,<1.6.4", - "sylius/sylius": "<1.3.16|>=1.4,<1.4.12|>=1.5,<1.5.9|>=1.6,<1.6.5", - "symbiote/silverstripe-multivaluefield": ">=3,<3.0.99", - "symbiote/silverstripe-versionedfiles": "<=2.0.3", - "symfony/cache": ">=3.1,<3.4.35|>=4,<4.2.12|>=4.3,<4.3.8", - "symfony/dependency-injection": ">=2,<2.0.17|>=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", - "symfony/error-handler": ">=4.4,<4.4.4|>=5,<5.0.4", - "symfony/form": ">=2.3,<2.3.35|>=2.4,<2.6.12|>=2.7,<2.7.50|>=2.8,<2.8.49|>=3,<3.4.20|>=4,<4.0.15|>=4.1,<4.1.9|>=4.2,<4.2.1", - "symfony/framework-bundle": ">=2,<2.3.18|>=2.4,<2.4.8|>=2.5,<2.5.2|>=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", - "symfony/http-foundation": ">=2,<2.8.52|>=3,<3.4.35|>=4,<4.2.12|>=4.3,<4.3.8|>=4.4,<4.4.7|>=5,<5.0.7", - "symfony/http-kernel": ">=2,<2.8.52|>=3,<3.4.35|>=4,<4.2.12|>=4.3,<4.4.13|>=5,<5.1.5", - "symfony/intl": ">=2.7,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", - "symfony/mime": ">=4.3,<4.3.8", - "symfony/phpunit-bridge": ">=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", - "symfony/polyfill": ">=1,<1.10", - "symfony/polyfill-php55": ">=1,<1.10", - "symfony/proxy-manager-bridge": ">=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", - "symfony/routing": ">=2,<2.0.19", - "symfony/security": ">=2,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7|>=4.4,<4.4.7|>=5,<5.0.7", - "symfony/security-bundle": ">=2,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", - "symfony/security-core": ">=2.4,<2.6.13|>=2.7,<2.7.9|>=2.7.30,<2.7.32|>=2.8,<2.8.37|>=3,<3.3.17|>=3.4,<3.4.7|>=4,<4.0.7", - "symfony/security-csrf": ">=2.4,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", - "symfony/security-guard": ">=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", - "symfony/security-http": ">=2.3,<2.3.41|>=2.4,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.2.12|>=4.3,<4.3.8|>=4.4,<4.4.7|>=5,<5.0.7", - "symfony/serializer": ">=2,<2.0.11", - "symfony/symfony": ">=2,<2.8.52|>=3,<3.4.35|>=4,<4.2.12|>=4.3,<4.4.13|>=5,<5.1.5", - "symfony/translation": ">=2,<2.0.17", - "symfony/validator": ">=2,<2.0.24|>=2.1,<2.1.12|>=2.2,<2.2.5|>=2.3,<2.3.3", - "symfony/var-exporter": ">=4.2,<4.2.12|>=4.3,<4.3.8", - "symfony/web-profiler-bundle": ">=2,<2.3.19|>=2.4,<2.4.9|>=2.5,<2.5.4", - "symfony/yaml": ">=2,<2.0.22|>=2.1,<2.1.7", - "t3g/svg-sanitizer": "<1.0.3", - "tecnickcom/tcpdf": "<6.2.22", - "thelia/backoffice-default-template": ">=2.1,<2.1.2", - "thelia/thelia": ">=2.1-beta.1,<2.1.3", - "theonedemon/phpwhois": "<=4.2.5", - "titon/framework": ">=0,<9.9.99", - "truckersmp/phpwhois": "<=4.3.1", - "twig/twig": "<1.38|>=2,<2.7", - "typo3/cms": ">=6.2,<6.2.30|>=7,<7.6.32|>=8,<8.7.30|>=9,<9.5.20|>=10,<10.4.6", - "typo3/cms-core": ">=8,<8.7.30|>=9,<9.5.20|>=10,<10.4.6", - "typo3/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.10|>=3.1,<3.1.7|>=3.2,<3.2.7|>=3.3,<3.3.5", - "typo3/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4", - "typo3/phar-stream-wrapper": ">=1,<2.1.1|>=3,<3.1.1", - "typo3fluid/fluid": ">=2,<2.0.5|>=2.1,<2.1.4|>=2.2,<2.2.1|>=2.3,<2.3.5|>=2.4,<2.4.1|>=2.5,<2.5.5|>=2.6,<2.6.1", - "ua-parser/uap-php": "<3.8", - "usmanhalalit/pixie": "<1.0.3|>=2,<2.0.2", - "verot/class.upload.php": "<=1.0.3|>=2,<=2.0.4", - "wallabag/tcpdf": "<6.2.22", - "willdurand/js-translation-bundle": "<2.1.1", - "yii2mod/yii2-cms": "<1.9.2", - "yiisoft/yii": ">=1.1.14,<1.1.15", - "yiisoft/yii2": "<2.0.38", - "yiisoft/yii2-bootstrap": "<2.0.4", - "yiisoft/yii2-dev": "<2.0.15", - "yiisoft/yii2-elasticsearch": "<2.0.5", - "yiisoft/yii2-gii": "<2.0.4", - "yiisoft/yii2-jui": "<2.0.4", - "yiisoft/yii2-redis": "<2.0.8", - "yourls/yourls": "<1.7.4", - "zendframework/zend-cache": ">=2.4,<2.4.8|>=2.5,<2.5.3", - "zendframework/zend-captcha": ">=2,<2.4.9|>=2.5,<2.5.2", - "zendframework/zend-crypt": ">=2,<2.4.9|>=2.5,<2.5.2", - "zendframework/zend-db": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.10|>=2.3,<2.3.5", - "zendframework/zend-developer-tools": ">=1.2.2,<1.2.3", - "zendframework/zend-diactoros": ">=1,<1.8.4", - "zendframework/zend-feed": ">=1,<2.10.3", - "zendframework/zend-form": ">=2,<2.2.7|>=2.3,<2.3.1", - "zendframework/zend-http": ">=1,<2.8.1", - "zendframework/zend-json": ">=2.1,<2.1.6|>=2.2,<2.2.6", - "zendframework/zend-ldap": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.8|>=2.3,<2.3.3", - "zendframework/zend-mail": ">=2,<2.4.11|>=2.5,<2.7.2", - "zendframework/zend-navigation": ">=2,<2.2.7|>=2.3,<2.3.1", - "zendframework/zend-session": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.9|>=2.3,<2.3.4", - "zendframework/zend-validator": ">=2.3,<2.3.6", - "zendframework/zend-view": ">=2,<2.2.7|>=2.3,<2.3.1", - "zendframework/zend-xmlrpc": ">=2.1,<2.1.6|>=2.2,<2.2.6", - "zendframework/zendframework": "<2.5.1", - "zendframework/zendframework1": "<1.12.20", - "zendframework/zendopenid": ">=2,<2.0.2", - "zendframework/zendxml": ">=1,<1.0.1", - "zetacomponents/mail": "<1.8.2", - "zf-commons/zfc-user": "<1.2.2", - "zfcampus/zf-apigility-doctrine": ">=1,<1.0.3", - "zfr/zfr-oauth2-server-module": "<0.1.2" - }, - "type": "metapackage", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "role": "maintainer" - }, - { - "name": "Ilya Tribusean", - "email": "slash3b@gmail.com", - "role": "maintainer" - } - ], - "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", - "funding": [ - { - "url": "https://github.com/Ocramius", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/roave/security-advisories", - "type": "tidelift" - } - ], - "time": "2020-10-19T07:02:45+00:00" - }, { "name": "squizlabs/php_codesniffer", - "version": "3.5.8", + "version": "3.6.0", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "9d583721a7157ee997f235f327de038e7ea6dac4" + "reference": "ffced0d2c8fa8e6cdc4d695a743271fab6c38625" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/9d583721a7157ee997f235f327de038e7ea6dac4", - "reference": "9d583721a7157ee997f235f327de038e7ea6dac4", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ffced0d2c8fa8e6cdc4d695a743271fab6c38625", + "reference": "ffced0d2c8fa8e6cdc4d695a743271fab6c38625", "shasum": "" }, "require": { @@ -3905,7 +3955,12 @@ "phpcs", "standards" ], - "time": "2020-10-23T02:01:07+00:00" + "support": { + "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", + "source": "https://github.com/squizlabs/PHP_CodeSniffer", + "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + }, + "time": "2021-04-09T00:54:41+00:00" }, { "name": "wp-coding-standards/wpcs", @@ -3945,23 +4000,25 @@ "standards", "wordpress" ], + "support": { + "issues": "https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/issues", + "source": "https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards", + "wiki": "https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki" + }, "time": "2017-08-05T16:08:58+00:00" } ], "aliases": [], "minimum-stability": "dev", - "stability-flags": { - "roave/security-advisories": 20 - }, + "stability-flags": [], "prefer-stable": true, "prefer-lowest": false, "platform": { - "php": ">=7.0", - "ext-json": "*" + "php": ">=7.0" }, "platform-dev": [], "platform-overrides": { "php": "7.1" }, - "plugin-api-version": "1.1.0" + "plugin-api-version": "2.0.0" } From df074a675dfa9a2e841cbdd895cd00dd2098b4d4 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Wed, 9 Jun 2021 16:26:25 +0530 Subject: [PATCH 0778/1044] Update phar script for autoloader changes --- utils/make-phar.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/make-phar.php b/utils/make-phar.php index ee9d18e19..7cead42d7 100644 --- a/utils/make-phar.php +++ b/utils/make-phar.php @@ -13,8 +13,9 @@ exit(1); } -require EE_VENDOR_DIR . '/autoload.php'; +define( 'EE_ROOT_DIR', '/opt/easyengine' ); require EE_ROOT . '/php/utils.php'; +require EE_VENDOR_DIR . '/autoload.php'; use EE\Configurator; use EE\Utils; @@ -164,6 +165,7 @@ function get_composer_versions( $current_version ) { ->in(EE_ROOT . '/migrations') ->in(EE_VENDOR_DIR . '/mustache') ->in(EE_VENDOR_DIR . '/rmccue/requests') + ->in(EE_VENDOR_DIR . '/react') ->in(EE_VENDOR_DIR . '/composer') ->in(EE_VENDOR_DIR . '/cloudflare') ->in(EE_VENDOR_DIR . '/symfony/finder') @@ -309,8 +311,6 @@ function get_composer_versions( $current_version ) { } add_file( $phar, EE_VENDOR_DIR . '/autoload.php' ); -add_file( $phar, EE_VENDOR_DIR . '/autoload_commands.php' ); -add_file( $phar, EE_VENDOR_DIR . '/autoload_framework.php' ); if ( 'cli' !== BUILD ) { add_file( $phar, EE_VENDOR_DIR . '/composer/composer/LICENSE' ); add_file( $phar, EE_VENDOR_DIR . '/composer/composer/res/composer-schema.json' ); From 814b23022ea306d1f14c89c5a368e0638cc7d480 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Fri, 11 Jun 2021 20:21:21 +0530 Subject: [PATCH 0779/1044] Fix phar build --- utils/make-phar.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/make-phar.php b/utils/make-phar.php index 7cead42d7..8e160c15e 100644 --- a/utils/make-phar.php +++ b/utils/make-phar.php @@ -75,7 +75,7 @@ function add_file( $phar, $path ) { $strips = array( '\/(?:behat|gherkin)\/src\/', '\/phpunit\/', - '\/symfony\/(?!console|filesystem|finder|polyfill-mbstring|process|serializer)[^\/]+\/', + '\/symfony\/(?!console|filesystem|finder|polyfill-mbstring|process|serializer)', '\/composer\/spdx-licenses\/', '\/Composer\/(?:Command\/|Compiler\.php|Console\/|Downloader\/Pear|Installer\/Pear|Question\/|Repository\/Pear|SelfUpdate\/)', '\/(?:dealerdirect|squizlabs|wimg)\/', From 0afcf5d966b7f743341535a52f86ec3fb7d24a3d Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 15 Jun 2021 10:44:04 +0530 Subject: [PATCH 0780/1044] Update nginx-proxy: Fix no server in upstream err Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- img-versions.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/img-versions.json b/img-versions.json index eb4ec5a54..04b19ae3a 100644 --- a/img-versions.json +++ b/img-versions.json @@ -2,7 +2,7 @@ "easyengine/cron": "v4.0.0", "easyengine/mailhog": "v4.0.0", "easyengine/mariadb": "v4.1.3", - "easyengine/nginx-proxy": "v4.1.4", + "easyengine/nginx-proxy": "v4.2.0", "easyengine/nginx": "v4.1.4", "easyengine/php": "v4.1.7", "easyengine/php5.6": "v4.0.0", From 88b055c97cce265307c3890ea3585a74f1a5668a Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 15 Jun 2021 10:45:24 +0530 Subject: [PATCH 0781/1044] Remove travis ci config file Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- .travis.yml | 69 ----------------------------------------------------- 1 file changed, 69 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6987c0ad3..000000000 --- a/.travis.yml +++ /dev/null @@ -1,69 +0,0 @@ -sudo: required -dist: bionic -language: php -php: 7.3 - -env: - global: - - PATH="$TRAVIS_BUILD_DIR/vendor/bin:$PATH" - -before_install: - - sudo curl -L https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose - - | - # Remove Xdebug for a huge performance increase: - if [ -f ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini ]; then - phpenv config-rm xdebug.ini - else - echo "xdebug.ini does not exist" - fi - - | - # Update commands in composer.json to develop if branch is not master. - if [[ "$TRAVIS_BRANCH" != "master" ]]; then - sed -i 's/\(easyengine\/.*\):\ \".*\"/\1:\ \"dev-develop\"/' composer.json - fi - -install: - - | - # Run composer install for master else update. - if [[ "$TRAVIS_BRANCH" = "master" ]]; then - composer install --prefer-dist --no-progress --no-interaction - else - composer update --prefer-dist --no-progress --no-interaction - fi - - sudo ./ci/test-env-install.sh - -before_script: - - ./ci/prepare.sh - -script: - - sudo ./vendor/bin/behat - - ./ci/test-commands.sh - -after_script: - - cat /opt/easyengine/logs/install.log - - cat /opt/easyengine/logs/ee.log - -jobs: - include: - - stage: deploy - env: DEPLOY_BRANCH=master - after_success: ./ci/deploy.sh - -cache: - directories: - - $HOME/.composer/cache - -branches: - only: - - develop - - master - -notifications: - email: - on_success: never - on_failure: change - -addons: - apt: - packages: - - docker-ce From c7e9f3576391b1d38789b99ad6566c54ab22aef4 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 15 Jun 2021 10:45:46 +0530 Subject: [PATCH 0782/1044] Move testing bash scripts to GH action workflow Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- ci/test-commands.sh | 20 -------------------- ci/test-env-install.sh | 27 --------------------------- 2 files changed, 47 deletions(-) delete mode 100755 ci/test-commands.sh delete mode 100755 ci/test-env-install.sh diff --git a/ci/test-commands.sh b/ci/test-commands.sh deleted file mode 100755 index e94ae5f3a..000000000 --- a/ci/test-commands.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -# called by Travis CI - -set -x - -#repos=$(find vendor/easyengine -type d -name 'features') -sub_commands=( - vendor/easyengine/site-command/features - vendor/easyengine/site-type-php/features - vendor/easyengine/site-type-wp/features -) - -for command in "${sub_commands[@]}"; do - IFS='/' read -r -a array <<< "$command" - rm -rf features/* - rsync -av --delete $command/ features/ > /dev/null - for file in features/*.feature; do mv "$file" "${file%.feature}_${array[2]}.feature"; done - echo "Running tests for $command" - sudo ./vendor/bin/behat -done diff --git a/ci/test-env-install.sh b/ci/test-env-install.sh deleted file mode 100755 index 26a80de72..000000000 --- a/ci/test-env-install.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash -function setup_test_requirements() { - readonly LOG_FILE="/opt/easyengine/logs/install.log" - # Adding software-properties-common for add-apt-repository. - apt-get install -y software-properties-common - # Adding ondrej/php repository for installing php, this works for all ubuntu flavours. - add-apt-repository -y ppa:ondrej/php - apt-get update - # Installing php-cli, which is the minimum requirement to run EasyEngine - apt-get -y install php7.3-cli - - php_modules=( pcntl curl sqlite3 zip dom mbstring json ) - if command -v php > /dev/null 2>&1; then - # Reading the php version. - default_php_version="$(readlink -f /usr/bin/php | gawk -F "php" '{ print $2}')" - for module in "${php_modules[@]}"; do - if ! php -m | grep $module >> $LOG_FILE 2>&1; then - echo "$module not installed. Installing..." - apt install -y php$default_php_version-$module - else - echo "$module is already installed" - fi - done - fi -} - -setup_test_requirements From a328df1e9ceb2d5005d55b15e3a517c48eeb45b6 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 15 Jun 2021 10:48:43 +0530 Subject: [PATCH 0783/1044] Add initial GH action CI/CD code Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- .github/workflows/test_and_build.yml | 91 ++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 .github/workflows/test_and_build.yml diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml new file mode 100644 index 000000000..695cdfa84 --- /dev/null +++ b/.github/workflows/test_and_build.yml @@ -0,0 +1,91 @@ +on: + pull_request: + push: + branches: + - master + - develop + +name: EE test & build + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Get Composer cache directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + + - name: Set up Composer caching + uses: actions/cache@v2 + env: + cache-name: cache-composer-dependencies + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-composer- + + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '7.3' + coverage: none + tools: composer + extensions: pcntl, curl, sqlite3, zip, dom, mbstring, json + + - name: Update docker + run: | + sudo apt purge nginx nginx-common docker docker-engine docker.io docker-ce containerd runc + curl -fsSL https://get.docker.com/ | sudo bash + sudo systemctl restart docker.service + + - name: Install docker-compose + run: | + VERSION=$(curl --silent "https://api.github.com/repos/docker/compose/releases/latest" | + grep '"tag_name":' | + sed -E 's/.*"([^"]+)".*/\1/' + ) + sudo curl -L "https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose + + - name: Composer changes and install + run: | + cd "$GITHUB_WORKSPACE" + # Run composer install for master else update. + if [[ "$GITHUB_REF" = "heads/ref/master" ]]; then + composer install --prefer-dist --no-progress --no-interaction + else + sed -i 's/\(easyengine\/.*\):\ \".*\"/\1:\ \"dev-develop\"/' composer.json + composer update --prefer-dist --no-progress --no-interaction + fi + + - name: Prepare + run: bash $GITHUB_WORKSPACE/ci/prepare.sh + + - name: Test + shell: 'script -q -e -c "bash {0}"' + run: | + cd $GITHUB_WORKSPACE + sudo ./vendor/bin/behat + sub_commands=( + vendor/easyengine/site-command/features + vendor/easyengine/site-type-php/features + vendor/easyengine/site-type-wp/features + ) + for command in "${sub_commands[@]}"; do + IFS='/' read -r -a array <<< "$command" + rm -rf features/* + rsync -av --delete $command/ features/ > /dev/null + for file in features/*.feature; do mv "$file" "${file%.feature}_${array[2]}.feature"; done + echo "Running tests for $command" + sudo -E ./vendor/bin/behat + done + env: + COMPOSE_INTERACTIVE_NO_CLI: 1 + + - name: Output logs + if: ${{ always() }} + run: | + [[ -f "/opt/easyengine/logs/install.log" ]] && cat /opt/easyengine/logs/install.log || echo 'No install log.' + [[ -f "/opt/easyengine/logs/ee.log" ]] && cat /opt/easyengine/logs/ee.log || echo 'No run log.' From dbffe7a5b732b8e14abc14e84a2dc733c01db269 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 15 Jun 2021 11:00:56 +0530 Subject: [PATCH 0784/1044] Use latest docker-compose version Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- .github/workflows/test_and_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index 695cdfa84..3840f2dc6 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -47,7 +47,7 @@ jobs: grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' ) - sudo curl -L "https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose + sudo curl -L "https://github.com/docker/compose/releases/download/$VERSION/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose - name: Composer changes and install run: | From 68eaf2509c7fe387651cbf95e2e6d0e27e56dc8f Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 15 Jun 2021 11:04:10 +0530 Subject: [PATCH 0785/1044] Add cron for daily test Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- .github/workflows/test_and_build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index 3840f2dc6..dc146f58c 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -4,6 +4,8 @@ on: branches: - master - develop + schedule: + - cron: '30 3 * * *' name: EE test & build From da847c23ed9979e6047094f96d851250a41ee027 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 15 Jun 2021 12:13:34 +0530 Subject: [PATCH 0786/1044] Move all ci scripts to GH workflow Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- ci/README.md | 13 ---------- ci/deploy.sh | 66 --------------------------------------------------- ci/prepare.sh | 16 ------------- 3 files changed, 95 deletions(-) delete mode 100644 ci/README.md delete mode 100755 ci/deploy.sh delete mode 100755 ci/prepare.sh diff --git a/ci/README.md b/ci/README.md deleted file mode 100644 index ccc6f29de..000000000 --- a/ci/README.md +++ /dev/null @@ -1,13 +0,0 @@ -Build and Release Process -========================= - -Currently EasyEngine v4 is in development stage. Hence the main branch for v4 is [master-v4](https://github.com/easyengine/easyengine/tree/master-v4) and the ongoing development branch is [develop-v4](https://github.com/easyengine/easyengine/tree/develop-v4). - -The current build and release process uses [travis-ci](https://travis-ci.org/) and docker build triggers. - -* Whenever any commit is pushed or merged into the `develop-v4` branch, it trigggers the travis-ci to generate a `nightly phar` and commits it to the [easyengine-builds](https://github.com/easyengine/easyengine-builds) repository. - -* Simillarly, whenever any commit is pushed or merged into the `master-v4` branch, it trigggers the travis-ci to generate a `stable phar` and commits it to the [easyengine-builds](https://github.com/easyengine/easyengine-builds) repository. - -* `prepare.sh` creates the phar. -* `deploy.sh` Takes the phar and deploys it to the [easyengine-builds](https://github.com/easyengine/easyengine-builds) repository. \ No newline at end of file diff --git a/ci/deploy.sh b/ci/deploy.sh deleted file mode 100755 index 0abe32ab7..000000000 --- a/ci/deploy.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/bash - -# called by Travis CI - -if [[ "false" != "$TRAVIS_PULL_REQUEST" ]]; then - echo "Not deploying pull requests." - exit -fi - -if [ -z $DEPLOY_BRANCH ]; then - echo "Skipping deployment as DEPLOY_BRANCH is not set" - exit -fi - -if [[ "$TRAVIS_BRANCH" != "$DEPLOY_BRANCH" ]] && [[ ! "$TRAVIS_BRANCH" == "develop" ]]; then - echo "Skipping deployment as '$TRAVIS_BRANCH' is not a deploy branch." - exit -fi - -# Turn off command traces while dealing with the private key -set +x - -# Get the encrypted private key from the repo settings -echo $EE_REPO_DEPLOY_KEY | base64 --decode > ~/.ssh/id_rsa -chmod 600 ~/.ssh/id_rsa - -# anyone can read the build log, so it MUST NOT contain any sensitive data -set -x - -# add github's public key -echo "|1|qPmmP7LVZ7Qbpk7AylmkfR0FApQ=|WUy1WS3F4qcr3R5Sc728778goPw= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==" >> ~/.ssh/known_hosts - -# Remove dev dependenices needed for testing -sudo rm -rf vendor -if [[ "$TRAVIS_BRANCH" = "master" ]]; then - composer install --prefer-dist --no-progress --no-interaction --no-dev -else - composer update --prefer-dist --no-progress --no-interaction --no-dev -fi - -# Re create phar -php -dphar.readonly=0 ./utils/make-phar.php easyengine.phar --quiet - -git clone git@github.com:easyengine/easyengine-builds.git - -git config --global user.name "rtBot" -git config --global user.email "43742164+rtBot@users.noreply.github.com" -git config --global push.default "current" - -if [[ "$TRAVIS_BRANCH" == "develop" ]]; then - fname="phar/easyengine-nightly.phar" -else - fname="phar/easyengine.phar" -fi - -mkdir -p easyengine-builds/phar -mv easyengine.phar easyengine-builds/$fname -cd easyengine-builds -chmod -x $fname - -md5sum $fname | cut -d ' ' -f 1 > $fname.md5 -sha512sum $fname | cut -d ' ' -f 1 > $fname.sha512 - -git add . -git commit -m "phar build: $TRAVIS_REPO_SLUG@$TRAVIS_COMMIT" -git push diff --git a/ci/prepare.sh b/ci/prepare.sh deleted file mode 100755 index b2323f0e6..000000000 --- a/ci/prepare.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -# called by Travis CI - -if [[ "$TRAVIS_BRANCH" != $DEPLOY_BRANCH ]]; then - version=$(head -n 1 VERSION) - version="$(echo $version | xargs)" - version+="-nightly-$(git rev-parse --short HEAD)" - echo $version > VERSION -fi - -php -dphar.readonly=0 ./utils/make-phar.php easyengine.phar --quiet - -# Checking the phar is working. -sudo ./easyengine.phar cli info -docker ps -a \ No newline at end of file From a1545cc27b9c52bec6723c391ef799404e7631db Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 15 Jun 2021 12:15:35 +0530 Subject: [PATCH 0787/1044] Add build phar job Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- .github/workflows/test_and_build.yml | 87 +++++++++++++++++++++++++--- 1 file changed, 80 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index dc146f58c..02836a451 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -10,10 +10,86 @@ on: name: EE test & build jobs: - test: + + build: #--------------------------------------------------------------------- + name: Build Phar runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - name: Check out source code + uses: actions/checkout@v2 + + - name: Get Composer cache directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + + - name: Set up Composer caching + uses: actions/cache@v2 + env: + cache-name: cache-composer-dependencies + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-composer- + + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '7.3' + coverage: none + tools: composer + extensions: pcntl, curl, sqlite3, zip, dom, mbstring, json + + - name: Install dependencies + run: | + cd "$GITHUB_WORKSPACE" + # Run composer install for master else update. + if [[ "$GITHUB_REF" = "refs/heads/master" ]]; then + composer install --no-dev --no-progress --no-interaction + else + sed -i 's/\(easyengine\/.*\):\ \".*\"/\1:\ \"dev-develop\"/' composer.json + composer update --prefer-dist --no-progress --no-interaction + fi + + - name: Setup EE version + run: | + cd "$GITHUB_WORKSPACE" + if [[ "$GITHUB_REF" != $DEPLOY_BRANCH ]]; then + CLI_VERSION=$(head -n 1 VERSION) + CLI_VERSION="$(echo $CLI_VERSION | xargs)" + CLI_VERSION+="-nightly-$(git rev-parse --short HEAD)" + echo $CLI_VERSION > VERSION + echo "$CLI_VERSION" > VERSION + fi + env: + DEPLOY_BRANCH: "refs/heads/master" + + + - name: Upload EE version + uses: actions/upload-artifact@v2 + with: + name: cli_version + path: VERSION + + - name: Build the Phar file + run: php -dphar.readonly=0 utils/make-phar.php easyengine.phar + + - name: Check phar + run: sudo ./easyengine.phar cli info + + - name: Upload built Phar file + uses: actions/upload-artifact@v2 + with: + name: easyengine-phar + path: easyengine.phar + + test: #---------------------------------------------------------------------- + runs-on: ubuntu-latest + needs: [build] + name: Behat Tests + steps: + - name: Check out source code + uses: actions/checkout@v2 - name: Get Composer cache directory id: composer-cache @@ -51,20 +127,17 @@ jobs: ) sudo curl -L "https://github.com/docker/compose/releases/download/$VERSION/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose - - name: Composer changes and install + - name: Install dependencies run: | cd "$GITHUB_WORKSPACE" # Run composer install for master else update. - if [[ "$GITHUB_REF" = "heads/ref/master" ]]; then + if [[ "$GITHUB_REF" = "refs/heads/master" ]]; then composer install --prefer-dist --no-progress --no-interaction else sed -i 's/\(easyengine\/.*\):\ \".*\"/\1:\ \"dev-develop\"/' composer.json composer update --prefer-dist --no-progress --no-interaction fi - - name: Prepare - run: bash $GITHUB_WORKSPACE/ci/prepare.sh - - name: Test shell: 'script -q -e -c "bash {0}"' run: | From ec0301272b0d838bd808ca9b06f38d1fbd0befa7 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 15 Jun 2021 12:25:36 +0530 Subject: [PATCH 0788/1044] Add deploy phar job Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- .github/workflows/test_and_build.yml | 53 ++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index 02836a451..66e20cf8a 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -164,3 +164,56 @@ jobs: run: | [[ -f "/opt/easyengine/logs/install.log" ]] && cat /opt/easyengine/logs/install.log || echo 'No install log.' [[ -f "/opt/easyengine/logs/ee.log" ]] && cat /opt/easyengine/logs/ee.log || echo 'No run log.' + + deploy: #----------------------------------------------------------------------- + name: Deploy Phar + if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master' + runs-on: ubuntu-latest + needs: [build, test] + + steps: + - name: Check out builds repository + uses: actions/checkout@v2 + with: + repository: easyengine/easyengine-builds + token: ${{ secrets.BOT_TOKEN }} + + - name: Download built Phar file + uses: actions/download-artifact@v2 + with: + name: easyengine-phar + + - name: Set file name + if: ${{ contains(github.ref, 'develop') }} + run: | + echo 'FILENAME=easyengine-nightly.phar' > $GITHUB_ENV + - name: Set file name for master branch + if: ${{ contains(github.ref, 'master') }} + run: | + echo 'FILENAME=easyengine.phar' > $GITHUB_ENV + + - name: Move built Phar file into correct location + run: | + mv easyengine.phar phar/$FILENAME + + - name: Make built Phar executable + run: | + chmod +x phar/$FILENAME + + - name : Create hashes + run: | + md5sum phar/$FILENAME | cut -d ' ' -f 1 > phar/$FILENAME.md5 + sha512sum phar/$FILENAME | cut -d ' ' -f 1 > phar/$FILENAME.sha512 + - name: Commit files + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add phar/$FILENAME phar/$FILENAME.md5 phar/$FILENAME.sha512 + git commit -m "phar build: $GITHUB_REPOSITORY@$GITHUB_SHA" + + - name: Push changes + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.BOT_TOKEN }} + branch: master + repository: easyengine/easyengine-builds From 64bef8b6e2ce0b15c8d2c06a3d0bd199d2012b0d Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 15 Jun 2021 15:22:38 +0530 Subject: [PATCH 0789/1044] Update cli test Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- features/cli.feature | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/features/cli.feature b/features/cli.feature index cda619557..5223ec5d2 100644 --- a/features/cli.feature +++ b/features/cli.feature @@ -1,5 +1,6 @@ Feature: CLI Command Scenario: ee uninstall works properly - When I run 'sudo bin/ee cli self-uninstall --yes' + When I run 'sudo bin/ee cli info' + And I run 'sudo bin/ee cli self-uninstall --yes' Then ee should be deleted From 6d18c8bd676ad356508beaf841f936c8f508f273 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 15 Jun 2021 15:22:42 +0530 Subject: [PATCH 0790/1044] Exit on error Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- .github/workflows/test_and_build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index 66e20cf8a..9ae040c95 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -141,8 +141,9 @@ jobs: - name: Test shell: 'script -q -e -c "bash {0}"' run: | + set -e cd $GITHUB_WORKSPACE - sudo ./vendor/bin/behat + sudo -E ./vendor/bin/behat sub_commands=( vendor/easyengine/site-command/features vendor/easyengine/site-type-php/features From af0dfe18174674e561037c1af8fad9380b99b2e1 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Wed, 16 Jun 2021 20:01:53 +0530 Subject: [PATCH 0791/1044] Update composer dependencies Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 18 +++---- composer.lock | 146 ++++++++++++++++++++++++++------------------------ 2 files changed, 85 insertions(+), 79 deletions(-) diff --git a/composer.json b/composer.json index 86faa1e92..d7bc0fec6 100644 --- a/composer.json +++ b/composer.json @@ -27,17 +27,17 @@ "php": ">=7.0", "composer/composer": "2.0.13", "composer/semver": "3.2.4", - "easyengine/admin-tools-command": "v1.0.10", - "easyengine/auth-command": "v1.0.4", + "easyengine/admin-tools-command": "v1.1.0", + "easyengine/auth-command": "v1.1.0", "easyengine/config-command": "v1.0.2", - "easyengine/cron-command": "v1.0.2", - "easyengine/log-command": "v1.0.1", + "easyengine/cron-command": "v1.1.0", + "easyengine/log-command": "v1.1.0", "easyengine/mailhog-command": "v1.0.2", - "easyengine/service-command": "v1.1.0", - "easyengine/shell-command": "v1.0.3", - "easyengine/site-command": "v2.6.2", - "easyengine/site-type-php": "v1.3.1", - "easyengine/site-type-wp": "v1.3.2", + "easyengine/service-command": "v1.2.0", + "easyengine/shell-command": "v1.1.0", + "easyengine/site-command": "v2.7.0", + "easyengine/site-type-php": "v1.4.0", + "easyengine/site-type-wp": "v1.4.0", "monolog/monolog": "1.24.0", "mustache/mustache": "2.12.0", "rmccue/requests": "1.8.0", diff --git a/composer.lock b/composer.lock index 2859b61cc..832ab68e9 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": "8aaf2740b242d7ab5ac43e2eed57a588", + "content-hash": "e87109135e51a5c129b04ed3573d5033", "packages": [ { "name": "acmephp/core", @@ -198,16 +198,16 @@ }, { "name": "composer/ca-bundle", - "version": "1.2.9", + "version": "1.2.10", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "78a0e288fdcebf92aa2318a8d3656168da6ac1a5" + "reference": "9fdb22c2e97a614657716178093cd1da90a64aa8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/78a0e288fdcebf92aa2318a8d3656168da6ac1a5", - "reference": "78a0e288fdcebf92aa2318a8d3656168da6ac1a5", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/9fdb22c2e97a614657716178093cd1da90a64aa8", + "reference": "9fdb22c2e97a614657716178093cd1da90a64aa8", "shasum": "" }, "require": { @@ -254,7 +254,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.2.9" + "source": "https://github.com/composer/ca-bundle/tree/1.2.10" }, "funding": [ { @@ -270,7 +270,7 @@ "type": "tidelift" } ], - "time": "2021-01-12T12:10:35+00:00" + "time": "2021-06-07T13:58:28+00:00" }, { "name": "composer/composer", @@ -665,16 +665,16 @@ }, { "name": "easyengine/admin-tools-command", - "version": "v1.0.10", + "version": "v1.1.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/admin-tools-command.git", - "reference": "2e298c92a2a44c29d41af63505e25ff820f03c86" + "reference": "6c7b1cc950e8012e521336260ac60052769c5918" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/admin-tools-command/zipball/2e298c92a2a44c29d41af63505e25ff820f03c86", - "reference": "2e298c92a2a44c29d41af63505e25ff820f03c86", + "url": "https://api.github.com/repos/EasyEngine/admin-tools-command/zipball/6c7b1cc950e8012e521336260ac60052769c5918", + "reference": "6c7b1cc950e8012e521336260ac60052769c5918", "shasum": "" }, "type": "ee-cli-package", @@ -705,22 +705,22 @@ "homepage": "https://github.com/easyengine/amdin-tools", "support": { "issues": "https://github.com/EasyEngine/admin-tools-command/issues", - "source": "https://github.com/EasyEngine/admin-tools-command/tree/master" + "source": "https://github.com/EasyEngine/admin-tools-command/tree/v1.1.0" }, - "time": "2020-08-11T10:14:14+00:00" + "time": "2021-06-16T14:18:24+00:00" }, { "name": "easyengine/auth-command", - "version": "v1.0.4", + "version": "v1.1.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/auth-command.git", - "reference": "29cc2d2d3341a32115050bf81de7acb1615cf209" + "reference": "d73693f8d075af2ea1e501a25ace71931776ed8a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/auth-command/zipball/29cc2d2d3341a32115050bf81de7acb1615cf209", - "reference": "29cc2d2d3341a32115050bf81de7acb1615cf209", + "url": "https://api.github.com/repos/EasyEngine/auth-command/zipball/d73693f8d075af2ea1e501a25ace71931776ed8a", + "reference": "d73693f8d075af2ea1e501a25ace71931776ed8a", "shasum": "" }, "type": "ee-cli-package", @@ -740,12 +740,11 @@ "autoload": { "psr-4": { "": "src/", - "\\EE\\Model\\": "src/db/" + "EE\\Model\\": "src/db/" }, "files": [ - "src/auth-utils.php", - "src/helper/hooks.php", - "auth-command.php" + "auth-command.php", + "src/auth-utils.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -756,9 +755,9 @@ "homepage": "https://github.com/easyengine/auth-command", "support": { "issues": "https://github.com/EasyEngine/auth-command/issues", - "source": "https://github.com/EasyEngine/auth-command/tree/master" + "source": "https://github.com/EasyEngine/auth-command/tree/v1.1.0" }, - "time": "2020-08-11T10:12:02+00:00" + "time": "2021-06-16T14:29:10+00:00" }, { "name": "easyengine/config-command", @@ -808,16 +807,16 @@ }, { "name": "easyengine/cron-command", - "version": "v1.0.2", + "version": "v1.1.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/cron-command.git", - "reference": "2646a15829dbce069b47a8014ec3168197e114b6" + "reference": "4c22f4adab84bae5c5960eba9a258d2b8cad04fe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/cron-command/zipball/2646a15829dbce069b47a8014ec3168197e114b6", - "reference": "2646a15829dbce069b47a8014ec3168197e114b6", + "url": "https://api.github.com/repos/EasyEngine/cron-command/zipball/4c22f4adab84bae5c5960eba9a258d2b8cad04fe", + "reference": "4c22f4adab84bae5c5960eba9a258d2b8cad04fe", "shasum": "" }, "type": "ee-cli-package", @@ -837,11 +836,11 @@ }, "autoload": { "psr-4": { - "": "src/" + "": "src/", + "EE\\Model\\": "src/db/" }, "files": [ "cron-command.php", - "src/helper/hooks.php", "src/helper/utils.php" ] }, @@ -853,22 +852,22 @@ "homepage": "https://github.com/easyengine/cron-command", "support": { "issues": "https://github.com/EasyEngine/cron-command/issues", - "source": "https://github.com/EasyEngine/cron-command/tree/master" + "source": "https://github.com/EasyEngine/cron-command/tree/v1.1.0" }, - "time": "2018-12-28T16:05:27+00:00" + "time": "2021-06-16T14:22:17+00:00" }, { "name": "easyengine/log-command", - "version": "v1.0.1", + "version": "v1.1.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/log-command.git", - "reference": "4cd0850ec40a5f4102eec2741a2b31c9a6a1125d" + "reference": "192a5a9dcdcf3f65aa3af3f9dbb6200e026e5c6c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/log-command/zipball/4cd0850ec40a5f4102eec2741a2b31c9a6a1125d", - "reference": "4cd0850ec40a5f4102eec2741a2b31c9a6a1125d", + "url": "https://api.github.com/repos/EasyEngine/log-command/zipball/192a5a9dcdcf3f65aa3af3f9dbb6200e026e5c6c", + "reference": "192a5a9dcdcf3f65aa3af3f9dbb6200e026e5c6c", "shasum": "" }, "type": "ee-cli-package", @@ -896,9 +895,9 @@ "homepage": "https://github.com/easyengine/log-command", "support": { "issues": "https://github.com/EasyEngine/log-command/issues", - "source": "https://github.com/EasyEngine/log-command/tree/master" + "source": "https://github.com/EasyEngine/log-command/tree/v1.1.0" }, - "time": "2018-12-28T16:07:01+00:00" + "time": "2021-06-16T14:24:11+00:00" }, { "name": "easyengine/mailhog-command", @@ -949,16 +948,16 @@ }, { "name": "easyengine/service-command", - "version": "v1.1.0", + "version": "v1.2.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/service-command.git", - "reference": "8278b3e895e7dbb7109e90e492068650217ce997" + "reference": "94ecf05b8726b1ad31cba6b4d7eb3db1fb398128" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/8278b3e895e7dbb7109e90e492068650217ce997", - "reference": "8278b3e895e7dbb7109e90e492068650217ce997", + "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/94ecf05b8726b1ad31cba6b4d7eb3db1fb398128", + "reference": "94ecf05b8726b1ad31cba6b4d7eb3db1fb398128", "shasum": "" }, "type": "ee-cli-package", @@ -992,22 +991,22 @@ "homepage": "https://github.com/easyengine/service-command", "support": { "issues": "https://github.com/EasyEngine/service-command/issues", - "source": "https://github.com/EasyEngine/service-command/tree/master" + "source": "https://github.com/EasyEngine/service-command/tree/v1.2.0" }, - "time": "2020-08-11T10:19:09+00:00" + "time": "2021-06-16T14:24:47+00:00" }, { "name": "easyengine/shell-command", - "version": "v1.0.3", + "version": "v1.1.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/shell-command.git", - "reference": "30500e3d1e8aeb3b9e9ac48b92dcbab3841e3beb" + "reference": "e87c21c2b31073f0aa38348d87556cd99b1d85c3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/shell-command/zipball/30500e3d1e8aeb3b9e9ac48b92dcbab3841e3beb", - "reference": "30500e3d1e8aeb3b9e9ac48b92dcbab3841e3beb", + "url": "https://api.github.com/repos/EasyEngine/shell-command/zipball/e87c21c2b31073f0aa38348d87556cd99b1d85c3", + "reference": "e87c21c2b31073f0aa38348d87556cd99b1d85c3", "shasum": "" }, "type": "ee-cli-package", @@ -1036,22 +1035,22 @@ "homepage": "https://github.com/easyengine/shell-command", "support": { "issues": "https://github.com/EasyEngine/shell-command/issues", - "source": "https://github.com/EasyEngine/shell-command/tree/master" + "source": "https://github.com/EasyEngine/shell-command/tree/v1.1.0" }, - "time": "2019-03-18T13:42:13+00:00" + "time": "2021-06-16T14:20:17+00:00" }, { "name": "easyengine/site-command", - "version": "v2.6.2", + "version": "v2.7.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "b5b87e8a1756ab7beef591fe86a077c301969acf" + "reference": "e00d58b214b0b9e6aa117fd3c8ee266dbc9a11f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/b5b87e8a1756ab7beef591fe86a077c301969acf", - "reference": "b5b87e8a1756ab7beef591fe86a077c301969acf", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/e00d58b214b0b9e6aa117fd3c8ee266dbc9a11f6", + "reference": "e00d58b214b0b9e6aa117fd3c8ee266dbc9a11f6", "shasum": "" }, "require": { @@ -1088,12 +1087,19 @@ "autoload": { "psr-4": { "": "src/", + "EE\\Model\\": "src/db/", + "EE\\Site\\Type\\": "src/site-type/", "AcmePhp\\Cli\\": "AcmePhp/Cli" }, "files": [ + "site-command.php", "src/helper/hooks.php", "src/helper/site-utils.php", - "site-command.php" + "src/helper/class-ee-site.php", + "src/helper/SimpleDnsCloudflareSolver.php", + "src/helper/Site_Self_Signed.php", + "src/helper/Site_Letsencrypt.php", + "src/helper/Shutdown_Handler.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -1103,22 +1109,22 @@ "homepage": "https://github.com/easyengine/site-command", "support": { "issues": "https://github.com/EasyEngine/site-command/issues", - "source": "https://github.com/EasyEngine/site-command/tree/v2.6.2" + "source": "https://github.com/EasyEngine/site-command/tree/v2.7.0" }, - "time": "2020-08-20T09:17:14+00:00" + "time": "2021-06-16T14:15:00+00:00" }, { "name": "easyengine/site-type-php", - "version": "v1.3.1", + "version": "v1.4.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-php.git", - "reference": "9dc599a4b2569ff424ba27febabd624872af01da" + "reference": "429a04f2ca61ff1222a96e690d4148bd65dd371f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/9dc599a4b2569ff424ba27febabd624872af01da", - "reference": "9dc599a4b2569ff424ba27febabd624872af01da", + "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/429a04f2ca61ff1222a96e690d4148bd65dd371f", + "reference": "429a04f2ca61ff1222a96e690d4148bd65dd371f", "shasum": "" }, "require-dev": { @@ -1148,7 +1154,7 @@ }, "autoload": { "psr-4": { - "": "src/" + "EE\\Site\\Type\\": "src/" }, "files": [ "site-type-php.php" @@ -1162,22 +1168,22 @@ "homepage": "https://github.com/easyengine/site-type-php", "support": { "issues": "https://github.com/EasyEngine/site-type-php/issues", - "source": "https://github.com/EasyEngine/site-type-php/tree/v1.3.1" + "source": "https://github.com/EasyEngine/site-type-php/tree/v1.4.0" }, - "time": "2020-08-20T09:15:47+00:00" + "time": "2021-06-16T14:15:58+00:00" }, { "name": "easyengine/site-type-wp", - "version": "v1.3.2", + "version": "v1.4.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-wp.git", - "reference": "68903762d08ce05f2aad947229e34a9b10353dc8" + "reference": "a9a75b0516ac944b075f353786ac11bd0df0fc09" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/68903762d08ce05f2aad947229e34a9b10353dc8", - "reference": "68903762d08ce05f2aad947229e34a9b10353dc8", + "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/a9a75b0516ac944b075f353786ac11bd0df0fc09", + "reference": "a9a75b0516ac944b075f353786ac11bd0df0fc09", "shasum": "" }, "require-dev": { @@ -1207,7 +1213,7 @@ }, "autoload": { "psr-4": { - "": "src/" + "EE\\Site\\Type\\": "src/" }, "files": [ "site-type-wp.php" @@ -1221,9 +1227,9 @@ "homepage": "https://github.com/easyengine/site-type-wp", "support": { "issues": "https://github.com/EasyEngine/site-type-wp/issues", - "source": "https://github.com/EasyEngine/site-type-wp/tree/v1.3.2" + "source": "https://github.com/EasyEngine/site-type-wp/tree/v1.4.0" }, - "time": "2020-09-23T03:49:19+00:00" + "time": "2021-06-16T14:15:44+00:00" }, { "name": "guzzlehttp/guzzle", From 166bd6bc89ddb471197f3d050c8d5a8526fb7060 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Wed, 16 Jun 2021 20:02:15 +0530 Subject: [PATCH 0792/1044] Bump version to v4.2.0 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index b1cbc1fcd..6aba2b245 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.1.5 +4.2.0 From 721ed0b58610e849d4757d6532be50c2d0a4bc83 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 17 Jun 2021 12:25:36 +0530 Subject: [PATCH 0793/1044] Update composer dependencies Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 2 +- composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index d7bc0fec6..262ec8d3f 100644 --- a/composer.json +++ b/composer.json @@ -35,7 +35,7 @@ "easyengine/mailhog-command": "v1.0.2", "easyengine/service-command": "v1.2.0", "easyengine/shell-command": "v1.1.0", - "easyengine/site-command": "v2.7.0", + "easyengine/site-command": "v2.7.1", "easyengine/site-type-php": "v1.4.0", "easyengine/site-type-wp": "v1.4.0", "monolog/monolog": "1.24.0", diff --git a/composer.lock b/composer.lock index 832ab68e9..cce9ee998 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": "e87109135e51a5c129b04ed3573d5033", + "content-hash": "01a35db07afad064c10ffb75ffda0f3a", "packages": [ { "name": "acmephp/core", @@ -1041,16 +1041,16 @@ }, { "name": "easyengine/site-command", - "version": "v2.7.0", + "version": "v2.7.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "e00d58b214b0b9e6aa117fd3c8ee266dbc9a11f6" + "reference": "0cdca5e185dfc892b7d323f1c12185fc5ed928ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/e00d58b214b0b9e6aa117fd3c8ee266dbc9a11f6", - "reference": "e00d58b214b0b9e6aa117fd3c8ee266dbc9a11f6", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/0cdca5e185dfc892b7d323f1c12185fc5ed928ed", + "reference": "0cdca5e185dfc892b7d323f1c12185fc5ed928ed", "shasum": "" }, "require": { @@ -1109,9 +1109,9 @@ "homepage": "https://github.com/easyengine/site-command", "support": { "issues": "https://github.com/EasyEngine/site-command/issues", - "source": "https://github.com/EasyEngine/site-command/tree/v2.7.0" + "source": "https://github.com/EasyEngine/site-command/tree/v2.7.1" }, - "time": "2021-06-16T14:15:00+00:00" + "time": "2021-06-17T06:53:19+00:00" }, { "name": "easyengine/site-type-php", From 41cb2cc93b058da01bc178c7bf76e60b40afde61 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Thu, 17 Jun 2021 18:19:43 +0530 Subject: [PATCH 0794/1044] Make EE compatible with PHP 8.0 --- composer.json | 4 ++-- php/EE/Runner.php | 4 ++-- php/class-ee-db.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 262ec8d3f..7e2a4ed6c 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ ], "config": { "platform": { - "php": "7.1" + "php": "7.3" }, "sort-packages": true }, @@ -39,7 +39,7 @@ "easyengine/site-type-php": "v1.4.0", "easyengine/site-type-wp": "v1.4.0", "monolog/monolog": "1.24.0", - "mustache/mustache": "2.12.0", + "mustache/mustache": "2.13.0", "rmccue/requests": "1.8.0", "symfony/config": "3.4.18", "symfony/console": "3.4.35", diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 1ba637888..d1da9a238 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -538,7 +538,7 @@ public function in_color() { } public function init_colorization() { - if ( 'auto' === $this->config['color'] ) { + if ( ! isset( $this->config['color'] ) || 'auto' === $this->config['color'] ) { $this->colorize = ( ! \EE\Utils\isPiped() && ! \EE\Utils\is_windows() ); } else { $this->colorize = $this->config['color']; @@ -546,7 +546,7 @@ public function init_colorization() { } public function init_logger() { - if ( $this->config['quiet'] ) { + if ( isset( $this->config['quiet'] ) && $this->config['quiet'] ) { $logger = new \EE\Loggers\Quiet; } else { $logger = new \EE\Loggers\Regular( $this->in_color() ); diff --git a/php/class-ee-db.php b/php/class-ee-db.php index dd6b2462b..3d361198a 100644 --- a/php/class-ee-db.php +++ b/php/class-ee-db.php @@ -391,7 +391,7 @@ public function update( $values ) { $set_bindings = array_values( $values ); $where_bindings = $this->where['bindings']; - $set_clause = implode( $set_keys, ' = ?, ' ) . ' = ?'; + $set_clause = implode( ' = ?, ', $set_keys) . ' = ?'; $query = "UPDATE $this->tables SET $set_clause{$this->where['query_string']}"; $pdo_statement = self::$pdo->query( $query ); From 7e3020a8ede7f688df3144126965a0fed594eef5 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Thu, 17 Jun 2021 19:11:19 +0530 Subject: [PATCH 0795/1044] Change action name --- .github/workflows/test_and_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index 9ae040c95..a4b01f65d 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -7,7 +7,7 @@ on: schedule: - cron: '30 3 * * *' -name: EE test & build +name: EE Test 👨‍🔧 + Build 🔨 jobs: From 1990c4ec78f67db460745dd18e3934b5f360e59a Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Thu, 17 Jun 2021 19:11:19 +0530 Subject: [PATCH 0796/1044] Change action name --- .github/workflows/test_and_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index 9ae040c95..a4b01f65d 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -7,7 +7,7 @@ on: schedule: - cron: '30 3 * * *' -name: EE test & build +name: EE Test 👨‍🔧 + Build 🔨 jobs: From ce2cb6dc9c6879bb6d0efd10f4becb9d1b75d2bb Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Thu, 17 Jun 2021 19:13:55 +0530 Subject: [PATCH 0797/1044] Change action name --- .github/workflows/test_and_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index a4b01f65d..6540a21e9 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -7,7 +7,7 @@ on: schedule: - cron: '30 3 * * *' -name: EE Test 👨‍🔧 + Build 🔨 +name: Build 🔨 + Test 👨‍🔧 jobs: From 92c775c0379a127716331e636a40a9fb2a664faf Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Fri, 18 Jun 2021 16:01:01 +0530 Subject: [PATCH 0798/1044] Update PHP to 8.0 for CI/CD Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- .github/workflows/test_and_build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index 6540a21e9..a56276ab3 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -35,7 +35,7 @@ jobs: - name: Set up PHP uses: shivammathur/setup-php@v2 with: - php-version: '7.3' + php-version: '8.0' coverage: none tools: composer extensions: pcntl, curl, sqlite3, zip, dom, mbstring, json @@ -108,7 +108,7 @@ jobs: - name: Set up PHP uses: shivammathur/setup-php@v2 with: - php-version: '7.3' + php-version: '8.0' coverage: none tools: composer extensions: pcntl, curl, sqlite3, zip, dom, mbstring, json From 43ba0b1db54538b5d7e9c063f59507d9377c5de3 Mon Sep 17 00:00:00 2001 From: Devarshi Sathiya <devarshisathiya5@gmail.com> Date: Sat, 19 Jun 2021 11:13:41 +0530 Subject: [PATCH 0799/1044] Update ee executable path --- utils/_ee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/_ee b/utils/_ee index 9fdd040bc..4198722e9 100644 --- a/utils/_ee +++ b/utils/_ee @@ -4,7 +4,7 @@ function _ee { _ee_completion() { ee_completion=() - ee_completion=$(sudo /mnt/sdb1/easyengine/easyengine/bin/ee cli completions --line="ee $current_command " --point="$current_position") + ee_completion=$(sudo /usr/local/bin/ee cli completions --line="ee $current_command " --point="$current_position") completion=() while read line; do From 7105acc7ec55f0bc00960244fa40889a931619c5 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Mon, 21 Jun 2021 15:44:28 +0530 Subject: [PATCH 0800/1044] Update behat to 3.8.1 for PHP 8 related changes --- composer.json | 22 +- composer.lock | 1119 +++++++++++++++++++++++++++++++++++++------------ 2 files changed, 871 insertions(+), 270 deletions(-) diff --git a/composer.json b/composer.json index 7e2a4ed6c..a53ef6d9d 100644 --- a/composer.json +++ b/composer.json @@ -41,21 +41,21 @@ "monolog/monolog": "1.24.0", "mustache/mustache": "2.13.0", "rmccue/requests": "1.8.0", - "symfony/config": "3.4.18", - "symfony/console": "3.4.35", - "symfony/debug": "3.4.18", - "symfony/dependency-injection": "3.4.27", - "symfony/event-dispatcher": "3.4.18", - "symfony/filesystem": "3.4.35", - "symfony/finder": "3.4.35", - "symfony/process": "3.4.35", - "symfony/translation": "3.4.18", - "symfony/yaml": "3.4.18", + "symfony/config": "4.4.*", + "symfony/console": "4.4.*", + "symfony/debug": "4.4.*", + "symfony/dependency-injection": "4.4.*", + "symfony/event-dispatcher": "4.4.*", + "symfony/filesystem": "4.4.*", + "symfony/finder": "4.4.*", + "symfony/process": "4.4.*", + "symfony/translation": "4.4.*", + "symfony/yaml": "4.4.*", "wp-cli/mustangostang-spyc": "0.6.3", "wp-cli/php-cli-tools": "0.11.10" }, "require-dev": { - "behat/behat": "3.7.0", + "behat/behat": "3.8.1", "dealerdirect/phpcodesniffer-composer-installer": "0.7.0", "phpunit/phpunit": "3.7.*", "phpcompatibility/php-compatibility": "8.2.0", diff --git a/composer.lock b/composer.lock index cce9ee998..2ff5dcdb6 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": "01a35db07afad064c10ffb75ffda0f3a", + "content-hash": "ca702cea932b2546c6f4fb3ce747c812", "packages": [ { "name": "acmephp/core", @@ -1672,16 +1672,16 @@ }, { "name": "mustache/mustache", - "version": "v2.12.0", + "version": "v2.13.0", "source": { "type": "git", "url": "https://github.com/bobthecow/mustache.php.git", - "reference": "fe8fe72e9d580591854de404cc59a1b83ca4d19e" + "reference": "e95c5a008c23d3151d59ea72484d4f72049ab7f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/mustache.php/zipball/fe8fe72e9d580591854de404cc59a1b83ca4d19e", - "reference": "fe8fe72e9d580591854de404cc59a1b83ca4d19e", + "url": "https://api.github.com/repos/bobthecow/mustache.php/zipball/e95c5a008c23d3151d59ea72484d4f72049ab7f4", + "reference": "e95c5a008c23d3151d59ea72484d4f72049ab7f4", "shasum": "" }, "require": { @@ -1716,33 +1716,28 @@ ], "support": { "issues": "https://github.com/bobthecow/mustache.php/issues", - "source": "https://github.com/bobthecow/mustache.php/tree/dev" + "source": "https://github.com/bobthecow/mustache.php/tree/master" }, - "time": "2017-07-11T12:54:05+00:00" + "time": "2019-11-23T21:40:31+00:00" }, { "name": "psr/container", - "version": "1.0.0", + "version": "1.1.1", "source": { "type": "git", "url": "https://github.com/php-fig/container.git", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf", + "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=7.2.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, "autoload": { "psr-4": { "Psr\\Container\\": "src/" @@ -1755,7 +1750,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common Container Interface (PHP FIG PSR-11)", @@ -1769,9 +1764,9 @@ ], "support": { "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/master" + "source": "https://github.com/php-fig/container/tree/1.1.1" }, - "time": "2017-02-14T16:28:37+00:00" + "time": "2021-03-05T17:36:06+00:00" }, { "name": "psr/http-message", @@ -2143,42 +2138,38 @@ }, { "name": "symfony/config", - "version": "v3.4.18", + "version": "v4.4.25", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "99b2fa8acc244e656cdf324ff419fbe6fd300a4d" + "reference": "2803882bb10353d277d4539635dd688a053d571c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/99b2fa8acc244e656cdf324ff419fbe6fd300a4d", - "reference": "99b2fa8acc244e656cdf324ff419fbe6fd300a4d", + "url": "https://api.github.com/repos/symfony/config/zipball/2803882bb10353d277d4539635dd688a053d571c", + "reference": "2803882bb10353d277d4539635dd688a053d571c", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/filesystem": "~2.8|~3.0|~4.0", - "symfony/polyfill-ctype": "~1.8" + "php": ">=7.1.3", + "symfony/filesystem": "^3.4|^4.0|^5.0", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-php81": "^1.22" }, "conflict": { - "symfony/dependency-injection": "<3.3", - "symfony/finder": "<3.3" + "symfony/finder": "<3.4" }, "require-dev": { - "symfony/dependency-injection": "~3.3|~4.0", - "symfony/event-dispatcher": "~3.3|~4.0", - "symfony/finder": "~3.3|~4.0", - "symfony/yaml": "~3.0|~4.0" + "symfony/event-dispatcher": "^3.4|^4.0|^5.0", + "symfony/finder": "^3.4|^4.0|^5.0", + "symfony/messenger": "^4.1|^5.0", + "symfony/service-contracts": "^1.1|^2", + "symfony/yaml": "^3.4|^4.0|^5.0" }, "suggest": { "symfony/yaml": "To use the yaml reference dumper" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\Config\\": "" @@ -2201,34 +2192,52 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Config Component", + "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/config/tree/3.4" + "source": "https://github.com/symfony/config/tree/v4.4.25" }, - "time": "2018-10-31T09:06:03+00:00" + "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": "2021-05-26T11:20:16+00:00" }, { "name": "symfony/console", - "version": "v3.4.35", + "version": "v4.4.25", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "17b154f932c5874cdbda6d05796b6490eec9f9f7" + "reference": "a62acecdf5b50e314a4f305cd01b5282126f3095" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/17b154f932c5874cdbda6d05796b6490eec9f9f7", - "reference": "17b154f932c5874cdbda6d05796b6490eec9f9f7", + "url": "https://api.github.com/repos/symfony/console/zipball/a62acecdf5b50e314a4f305cd01b5282126f3095", + "reference": "a62acecdf5b50e314a4f305cd01b5282126f3095", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/debug": "~2.8|~3.0|~4.0", - "symfony/polyfill-mbstring": "~1.0" + "php": ">=7.1.3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "^1.8", + "symfony/polyfill-php80": "^1.15", + "symfony/service-contracts": "^1.1|^2" }, "conflict": { "symfony/dependency-injection": "<3.4", + "symfony/event-dispatcher": "<4.3|>=5", + "symfony/lock": "<4.4", "symfony/process": "<3.3" }, "provide": { @@ -2236,11 +2245,12 @@ }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~3.3|~4.0", - "symfony/dependency-injection": "~3.4|~4.0", - "symfony/event-dispatcher": "~2.8|~3.0|~4.0", - "symfony/lock": "~3.4|~4.0", - "symfony/process": "~3.3|~4.0" + "symfony/config": "^3.4|^4.0|^5.0", + "symfony/dependency-injection": "^3.4|^4.0|^5.0", + "symfony/event-dispatcher": "^4.3", + "symfony/lock": "^4.4|^5.0", + "symfony/process": "^3.4|^4.0|^5.0", + "symfony/var-dumper": "^4.3|^5.0" }, "suggest": { "psr/log": "For using the console logger", @@ -2249,11 +2259,6 @@ "symfony/process": "" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\Console\\": "" @@ -2276,43 +2281,53 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Console Component", + "description": "Eases the creation of beautiful and testable command line interfaces", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/console/tree/3.4" + "source": "https://github.com/symfony/console/tree/v4.4.25" }, - "time": "2019-11-13T07:12:39+00:00" + "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": "2021-05-26T11:20:16+00:00" }, { "name": "symfony/debug", - "version": "v3.4.18", + "version": "v4.4.25", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "fe9793af008b651c5441bdeab21ede8172dab097" + "reference": "a8d2d5c94438548bff9f998ca874e202bb29d07f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/fe9793af008b651c5441bdeab21ede8172dab097", - "reference": "fe9793af008b651c5441bdeab21ede8172dab097", + "url": "https://api.github.com/repos/symfony/debug/zipball/a8d2d5c94438548bff9f998ca874e202bb29d07f", + "reference": "a8d2d5c94438548bff9f998ca874e202bb29d07f", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "psr/log": "~1.0" + "php": ">=7.1.3", + "psr/log": "~1.0", + "symfony/polyfill-php80": "^1.15" }, "conflict": { - "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + "symfony/http-kernel": "<3.4" }, "require-dev": { - "symfony/http-kernel": "~2.8|~3.0|~4.0" + "symfony/http-kernel": "^3.4|^4.0|^5.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\Debug\\": "" @@ -2335,44 +2350,60 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Debug Component", + "description": "Provides tools to ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/debug/tree/3.4" + "source": "https://github.com/symfony/debug/tree/v4.4.25" }, - "time": "2018-10-31T09:06:03+00:00" + "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": "2021-05-26T17:39:37+00:00" }, { "name": "symfony/dependency-injection", - "version": "v3.4.27", + "version": "v4.4.25", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "be0feb3fa202aedfd8d1956f2dafd563fb13acbf" + "reference": "2ed2a0a6c960bf4e2e862ec77b2f2c558b83c64d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/be0feb3fa202aedfd8d1956f2dafd563fb13acbf", - "reference": "be0feb3fa202aedfd8d1956f2dafd563fb13acbf", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/2ed2a0a6c960bf4e2e862ec77b2f2c558b83c64d", + "reference": "2ed2a0a6c960bf4e2e862ec77b2f2c558b83c64d", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "psr/container": "^1.0" + "php": ">=7.1.3", + "psr/container": "^1.0", + "symfony/service-contracts": "^1.1.6|^2" }, "conflict": { - "symfony/config": "<3.3.7", - "symfony/finder": "<3.3", + "symfony/config": "<4.3|>=5.0", + "symfony/finder": "<3.4", "symfony/proxy-manager-bridge": "<3.4", "symfony/yaml": "<3.4" }, "provide": { - "psr/container-implementation": "1.0" + "psr/container-implementation": "1.0", + "symfony/service-implementation": "1.0|2.0" }, "require-dev": { - "symfony/config": "~3.3|~4.0", - "symfony/expression-language": "~2.8|~3.0|~4.0", - "symfony/yaml": "~3.4|~4.0" + "symfony/config": "^4.3", + "symfony/expression-language": "^3.4|^4.0|^5.0", + "symfony/yaml": "^4.4|^5.0" }, "suggest": { "symfony/config": "", @@ -2382,11 +2413,6 @@ "symfony/yaml": "" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\DependencyInjection\\": "" @@ -2409,50 +2435,67 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony DependencyInjection Component", + "description": "Allows you to standardize and centralize the way objects are constructed in your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v3.4.27" + "source": "https://github.com/symfony/dependency-injection/tree/v4.4.25" }, - "time": "2019-04-20T15:32:49+00:00" + "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": "2021-05-26T17:54:16+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v3.4.18", + "version": "v4.4.25", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "db9e829c8f34c3d35cf37fcd4cdb4293bc4a2f14" + "reference": "047773e7016e4fd45102cedf4bd2558ae0d0c32f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/db9e829c8f34c3d35cf37fcd4cdb4293bc4a2f14", - "reference": "db9e829c8f34c3d35cf37fcd4cdb4293bc4a2f14", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/047773e7016e4fd45102cedf4bd2558ae0d0c32f", + "reference": "047773e7016e4fd45102cedf4bd2558ae0d0c32f", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": ">=7.1.3", + "symfony/event-dispatcher-contracts": "^1.1" }, "conflict": { - "symfony/dependency-injection": "<3.3" + "symfony/dependency-injection": "<3.4" + }, + "provide": { + "psr/event-dispatcher-implementation": "1.0", + "symfony/event-dispatcher-implementation": "1.1" }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~2.8|~3.0|~4.0", - "symfony/dependency-injection": "~3.3|~4.0", - "symfony/expression-language": "~2.8|~3.0|~4.0", - "symfony/stopwatch": "~2.8|~3.0|~4.0" + "symfony/config": "^3.4|^4.0|^5.0", + "symfony/dependency-injection": "^3.4|^4.0|^5.0", + "symfony/error-handler": "~3.4|~4.4", + "symfony/expression-language": "^3.4|^4.0|^5.0", + "symfony/http-foundation": "^3.4|^4.0|^5.0", + "symfony/service-contracts": "^1.1|^2", + "symfony/stopwatch": "^3.4|^4.0|^5.0" }, "suggest": { "symfony/dependency-injection": "", "symfony/http-kernel": "" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\EventDispatcher\\": "" @@ -2475,37 +2518,125 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony EventDispatcher Component", + "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/3.4" + "source": "https://github.com/symfony/event-dispatcher/tree/v4.4.25" }, - "time": "2018-10-30T16:50:50+00:00" + "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": "2021-05-26T17:39:37+00:00" }, { - "name": "symfony/filesystem", - "version": "v3.4.35", + "name": "symfony/event-dispatcher-contracts", + "version": "v1.1.9", "source": { "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "00e3a6ddd723b8bcfe4f2a1b6f82b98eeeb51516" + "url": "https://github.com/symfony/event-dispatcher-contracts.git", + "reference": "84e23fdcd2517bf37aecbd16967e83f0caee25a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/00e3a6ddd723b8bcfe4f2a1b6f82b98eeeb51516", - "reference": "00e3a6ddd723b8bcfe4f2a1b6f82b98eeeb51516", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/84e23fdcd2517bf37aecbd16967e83f0caee25a7", + "reference": "84e23fdcd2517bf37aecbd16967e83f0caee25a7", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/polyfill-ctype": "~1.8" + "php": ">=7.1.3" + }, + "suggest": { + "psr/event-dispatcher": "", + "symfony/event-dispatcher-implementation": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "1.1-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" } }, + "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/v1.1.9" + }, + "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": "2020-07-06T13:19:58+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v4.4.25", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "2d926ebd76f52352deb3c9577d8c1d4b96eae429" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/2d926ebd76f52352deb3c9577d8c1d4b96eae429", + "reference": "2d926ebd76f52352deb3c9577d8c1d4b96eae429", + "shasum": "" + }, + "require": { + "php": ">=7.1.3", + "symfony/polyfill-ctype": "~1.8" + }, + "type": "library", "autoload": { "psr-4": { "Symfony\\Component\\Filesystem\\": "" @@ -2528,36 +2659,45 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Filesystem Component", + "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v3.4.31" + "source": "https://github.com/symfony/filesystem/tree/v4.4.25" }, - "time": "2019-08-20T13:31:17+00:00" + "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": "2021-05-26T17:30:55+00:00" }, { "name": "symfony/finder", - "version": "v3.4.35", + "version": "v4.4.25", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "3e915e5ce305f8bc8017597f71f1f4095092ddf8" + "reference": "ed33314396d968a8936c95f5bd1b88bd3b3e94a3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/3e915e5ce305f8bc8017597f71f1f4095092ddf8", - "reference": "3e915e5ce305f8bc8017597f71f1f4095092ddf8", + "url": "https://api.github.com/repos/symfony/finder/zipball/ed33314396d968a8936c95f5bd1b88bd3b3e94a3", + "reference": "ed33314396d968a8936c95f5bd1b88bd3b3e94a3", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": ">=7.1.3" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\Finder\\": "" @@ -2580,33 +2720,282 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Finder Component", + "description": "Finds files and directories via an intuitive fluent interface", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/v4.4.25" + }, + "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": "2021-05-26T11:20:16+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.23.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "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.23.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": "2021-02-19T12:13:01+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.23.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "2df51500adbaebdc4c38dea4c89a2e131c45c8a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/2df51500adbaebdc4c38dea4c89a2e131c45c8a1", + "reference": "2df51500adbaebdc4c38dea4c89a2e131c45c8a1", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.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": "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.23.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": "2021-05-27T09:27:20+00:00" + }, + { + "name": "symfony/polyfill-php73", + "version": "v1.23.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fba8933c384d6476ab14fb7b8526e5287ca7e010", + "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, + "files": [ + "bootstrap.php" + ], + "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 7.3+ features to lower PHP versions", "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], "support": { - "source": "https://github.com/symfony/finder/tree/v3.4.33" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.23.0" }, - "time": "2019-10-30T12:43:22+00:00" + "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": "2021-02-19T12:13:01+00:00" }, { - "name": "symfony/polyfill-ctype", + "name": "symfony/polyfill-php80", "version": "v1.23.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", - "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/eca0bf41ed421bed1b57c4958bab16aa86b757d0", + "reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0", "shasum": "" }, "require": { "php": ">=7.1" }, - "suggest": { - "ext-ctype": "For best performance" - }, "type": "library", "extra": { "branch-alias": { @@ -2619,10 +3008,13 @@ }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" + "Symfony\\Polyfill\\Php80\\": "" }, "files": [ "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", @@ -2631,24 +3023,28 @@ ], "authors": [ { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" + "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 for ctype functions", + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ "compatibility", - "ctype", "polyfill", - "portable" + "portable", + "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.0" }, "funding": [ { @@ -2667,25 +3063,22 @@ "time": "2021-02-19T12:13:01+00:00" }, { - "name": "symfony/polyfill-mbstring", + "name": "symfony/polyfill-php81", "version": "v1.23.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "2df51500adbaebdc4c38dea4c89a2e131c45c8a1" + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "e66119f3de95efc359483f810c4c3e6436279436" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/2df51500adbaebdc4c38dea4c89a2e131c45c8a1", - "reference": "2df51500adbaebdc4c38dea4c89a2e131c45c8a1", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/e66119f3de95efc359483f810c4c3e6436279436", + "reference": "e66119f3de95efc359483f810c4c3e6436279436", "shasum": "" }, "require": { "php": ">=7.1" }, - "suggest": { - "ext-mbstring": "For best performance" - }, "type": "library", "extra": { "branch-alias": { @@ -2698,10 +3091,13 @@ }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" + "Symfony\\Polyfill\\Php81\\": "" }, "files": [ "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", @@ -2718,17 +3114,16 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for the Mbstring extension", + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ "compatibility", - "mbstring", "polyfill", "portable", "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.23.0" }, "funding": [ { @@ -2744,31 +3139,26 @@ "type": "tidelift" } ], - "time": "2021-05-27T09:27:20+00:00" + "time": "2021-05-21T13:25:03+00:00" }, { "name": "symfony/process", - "version": "v3.4.35", + "version": "v4.4.25", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "c19da50bc3e8fa7d60628fdb4ab5d67de534cf3e" + "reference": "cd61e6dd273975c6625316de9d141ebd197f93c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/c19da50bc3e8fa7d60628fdb4ab5d67de534cf3e", - "reference": "c19da50bc3e8fa7d60628fdb4ab5d67de534cf3e", + "url": "https://api.github.com/repos/symfony/process/zipball/cd61e6dd273975c6625316de9d141ebd197f93c9", + "reference": "cd61e6dd273975c6625316de9d141ebd197f93c9", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": ">=7.1.3" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\Process\\": "" @@ -2791,12 +3181,26 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Process Component", + "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/3.4" + "source": "https://github.com/symfony/process/tree/v4.4.25" }, - "time": "2019-10-24T15:33:53+00:00" + "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": "2021-05-26T11:20:16+00:00" }, { "name": "symfony/serializer", @@ -2880,36 +3284,123 @@ }, "time": "2018-12-02T13:20:19+00:00" }, + { + "name": "symfony/service-contracts", + "version": "v2.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb", + "reference": "f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/container": "^1.1" + }, + "suggest": { + "symfony/service-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.4-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + } + }, + "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/v2.4.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": "2021-04-01T10:43:52+00:00" + }, { "name": "symfony/translation", - "version": "v3.4.18", + "version": "v4.4.25", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "94bc3a79008e6640defedf5e14eb3b4f20048352" + "reference": "dfe132c5c6d89f90ce7f961742cc532e9ca16dd4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/94bc3a79008e6640defedf5e14eb3b4f20048352", - "reference": "94bc3a79008e6640defedf5e14eb3b4f20048352", + "url": "https://api.github.com/repos/symfony/translation/zipball/dfe132c5c6d89f90ce7f961742cc532e9ca16dd4", + "reference": "dfe132c5c6d89f90ce7f961742cc532e9ca16dd4", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/polyfill-mbstring": "~1.0" + "php": ">=7.1.3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/translation-contracts": "^1.1.6|^2" }, "conflict": { - "symfony/config": "<2.8", + "symfony/config": "<3.4", "symfony/dependency-injection": "<3.4", + "symfony/http-kernel": "<4.4", "symfony/yaml": "<3.4" }, + "provide": { + "symfony/translation-implementation": "1.0|2.0" + }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~2.8|~3.0|~4.0", - "symfony/dependency-injection": "~3.4|~4.0", - "symfony/finder": "~2.8|~3.0|~4.0", - "symfony/intl": "^2.8.18|^3.2.5|~4.0", - "symfony/yaml": "~3.4|~4.0" + "symfony/config": "^3.4|^4.0|^5.0", + "symfony/console": "^3.4|^4.0|^5.0", + "symfony/dependency-injection": "^3.4|^4.0|^5.0", + "symfony/finder": "~2.8|~3.0|~4.0|^5.0", + "symfony/http-kernel": "^4.4", + "symfony/intl": "^3.4|^4.0|^5.0", + "symfony/service-contracts": "^1.1.2|^2", + "symfony/yaml": "^3.4|^4.0|^5.0" }, "suggest": { "psr/log-implementation": "To use logging capability in translator", @@ -2917,11 +3408,6 @@ "symfony/yaml": "" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\Translation\\": "" @@ -2944,46 +3430,133 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Translation Component", + "description": "Provides tools to internationalize your application", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/translation/tree/v4.4.25" + }, + "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": "2021-05-26T17:39:37+00:00" + }, + { + "name": "symfony/translation-contracts", + "version": "v2.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation-contracts.git", + "reference": "95c812666f3e91db75385749fe219c5e494c7f95" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/95c812666f3e91db75385749fe219c5e494c7f95", + "reference": "95c812666f3e91db75385749fe219c5e494c7f95", + "shasum": "" + }, + "require": { + "php": ">=7.2.5" + }, + "suggest": { + "symfony/translation-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.4-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Translation\\": "" + } + }, + "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 translation", "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], "support": { - "source": "https://github.com/symfony/translation/tree/3.4" + "source": "https://github.com/symfony/translation-contracts/tree/v2.4.0" }, - "time": "2018-10-02T16:33:53+00:00" + "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": "2021-03-23T23:28:01+00:00" }, { "name": "symfony/yaml", - "version": "v3.4.18", + "version": "v4.4.25", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "640b6c27fed4066d64b64d5903a86043f4a4de7f" + "reference": "81cdac5536925c1c4b7b50aabc9ff6330b9eb5fc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/640b6c27fed4066d64b64d5903a86043f4a4de7f", - "reference": "640b6c27fed4066d64b64d5903a86043f4a4de7f", + "url": "https://api.github.com/repos/symfony/yaml/zipball/81cdac5536925c1c4b7b50aabc9ff6330b9eb5fc", + "reference": "81cdac5536925c1c4b7b50aabc9ff6330b9eb5fc", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", + "php": ">=7.1.3", "symfony/polyfill-ctype": "~1.8" }, "conflict": { "symfony/console": "<3.4" }, "require-dev": { - "symfony/console": "~3.4|~4.0" + "symfony/console": "^3.4|^4.0|^5.0" }, "suggest": { "symfony/console": "For validating YAML files using the lint command" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\Yaml\\": "" @@ -3006,12 +3579,26 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Yaml Component", + "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/3.4" + "source": "https://github.com/symfony/yaml/tree/v4.4.25" }, - "time": "2018-10-02T16:33:53+00:00" + "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": "2021-05-26T17:39:37+00:00" }, { "name": "webmozart/assert", @@ -3176,36 +3763,36 @@ "packages-dev": [ { "name": "behat/behat", - "version": "v3.7.0", + "version": "v3.8.1", "source": { "type": "git", "url": "https://github.com/Behat/Behat.git", - "reference": "08052f739619a9e9f62f457a67302f0715e6dd13" + "reference": "fbb065457d523d9856d4b50775b4151a7598b510" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Behat/Behat/zipball/08052f739619a9e9f62f457a67302f0715e6dd13", - "reference": "08052f739619a9e9f62f457a67302f0715e6dd13", + "url": "https://api.github.com/repos/Behat/Behat/zipball/fbb065457d523d9856d4b50775b4151a7598b510", + "reference": "fbb065457d523d9856d4b50775b4151a7598b510", "shasum": "" }, "require": { "behat/gherkin": "^4.6.0", "behat/transliterator": "^1.2", "ext-mbstring": "*", - "php": ">=5.3.3", + "php": "^7.2 || ^8.0", "psr/container": "^1.0", - "symfony/config": "^2.7.51 || ^3.0 || ^4.0 || ^5.0", - "symfony/console": "^2.7.51 || ^2.8.33 || ^3.3.15 || ^3.4.3 || ^4.0.3 || ^5.0", - "symfony/dependency-injection": "^2.7.51 || ^3.0 || ^4.0 || ^5.0", - "symfony/event-dispatcher": "^2.7.51 || ^3.0 || ^4.0 || ^5.0", - "symfony/translation": "^2.7.51 || ^3.0 || ^4.0 || ^5.0", - "symfony/yaml": "^2.7.51 || ^3.0 || ^4.0 || ^5.0" + "symfony/config": "^4.4 || ^5.0", + "symfony/console": "^4.4 || ^5.0", + "symfony/dependency-injection": "^4.4 || ^5.0", + "symfony/event-dispatcher": "^4.4 || ^5.0", + "symfony/translation": "^4.4 || ^5.0", + "symfony/yaml": "^4.4 || ^5.0" }, "require-dev": { "container-interop/container-interop": "^1.2", "herrera-io/box": "~1.6.1", - "phpunit/phpunit": "^4.8.36 || ^6.5.14 || ^7.5.20", - "symfony/process": "~2.5 || ^3.0 || ^4.0 || ^5.0" + "phpunit/phpunit": "^8.5 || ^9.0", + "symfony/process": "^4.4 || ^5.0" }, "suggest": { "ext-dom": "Needed to output test results in JUnit format." @@ -3216,7 +3803,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.6.x-dev" + "dev-master": "3.8.x-dev" } }, "autoload": { @@ -3236,7 +3823,7 @@ "homepage": "http://everzet.com" } ], - "description": "Scenario-oriented BDD framework for PHP 5.3", + "description": "Scenario-oriented BDD framework for PHP", "homepage": "http://behat.org/", "keywords": [ "Agile", @@ -3254,32 +3841,32 @@ ], "support": { "issues": "https://github.com/Behat/Behat/issues", - "source": "https://github.com/Behat/Behat/tree/v3.7.0" + "source": "https://github.com/Behat/Behat/tree/v3.8.1" }, - "time": "2020-06-03T13:08:44+00:00" + "time": "2020-11-07T15:55:18+00:00" }, { "name": "behat/gherkin", - "version": "v4.7.3", + "version": "v4.8.0", "source": { "type": "git", "url": "https://github.com/Behat/Gherkin.git", - "reference": "d5ae4616aeaa91daadbfb8446d9d17aae8d43cf7" + "reference": "2391482cd003dfdc36b679b27e9f5326bd656acd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Behat/Gherkin/zipball/d5ae4616aeaa91daadbfb8446d9d17aae8d43cf7", - "reference": "d5ae4616aeaa91daadbfb8446d9d17aae8d43cf7", + "url": "https://api.github.com/repos/Behat/Gherkin/zipball/2391482cd003dfdc36b679b27e9f5326bd656acd", + "reference": "2391482cd003dfdc36b679b27e9f5326bd656acd", "shasum": "" }, "require": { - "php": ">=5.6" + "php": "~7.2|~8.0" }, "require-dev": { "cucumber/cucumber": "dev-gherkin-16.0.0", - "phpunit/phpunit": "^5.7.1|~6|~7", - "symfony/phpunit-bridge": "~2.7|~3|~4", - "symfony/yaml": "~2.3|~3|~4" + "phpunit/phpunit": "~8|~9", + "symfony/phpunit-bridge": "~3|~4|~5", + "symfony/yaml": "~3|~4|~5" }, "suggest": { "symfony/yaml": "If you want to parse features, represented in YAML files" @@ -3318,9 +3905,9 @@ ], "support": { "issues": "https://github.com/Behat/Gherkin/issues", - "source": "https://github.com/Behat/Gherkin/tree/v4.7.3" + "source": "https://github.com/Behat/Gherkin/tree/v4.8.0" }, - "time": "2021-02-04T12:26:47+00:00" + "time": "2021-02-04T12:44:21+00:00" }, { "name": "behat/transliterator", @@ -3566,28 +4153,28 @@ }, { "name": "phpunit/php-file-iterator", - "version": "2.0.3", + "version": "3.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "4b49fb70f067272b659ef0174ff9ca40fdaa6357" + "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/4b49fb70f067272b659ef0174ff9ca40fdaa6357", - "reference": "4b49fb70f067272b659ef0174ff9ca40fdaa6357", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/aa4be8575f26070b100fccb67faabb28f21f66f8", + "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^8.5" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -3614,7 +4201,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/2.0.3" + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.5" }, "funding": [ { @@ -3622,26 +4209,34 @@ "type": "github" } ], - "time": "2020-11-30T08:25:21+00:00" + "time": "2020-09-28T05:57:25+00:00" }, { "name": "phpunit/php-text-template", - "version": "1.2.1", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, "autoload": { "classmap": [ "src/" @@ -3665,9 +4260,15 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/1.2.1" + "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" }, - "time": "2015-06-21T13:50:34+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T05:33:50+00:00" }, { "name": "phpunit/php-timer", @@ -4024,7 +4625,7 @@ }, "platform-dev": [], "platform-overrides": { - "php": "7.1" + "php": "7.3" }, "plugin-api-version": "2.0.0" } From 8c764b8a5e998be846fa8a8225c5adb870992094 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Tue, 22 Jun 2021 13:18:59 +0530 Subject: [PATCH 0801/1044] Initialise config in tests --- features/bootstrap/FeatureContext.php | 1 + 1 file changed, 1 insertion(+) diff --git a/features/bootstrap/FeatureContext.php b/features/bootstrap/FeatureContext.php index be17f11f9..11dfd75db 100644 --- a/features/bootstrap/FeatureContext.php +++ b/features/bootstrap/FeatureContext.php @@ -41,6 +41,7 @@ } $runner = \EE::get_runner(); $runner->init_logger(); +$runner->init_config(); /* End. Loading required files to enable EE::launch() in tests. */ use Behat\Behat\Context\Context; From c021e027219ecc29694107fa7d205a36c3d6f690 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Wed, 23 Jun 2021 18:20:12 +0530 Subject: [PATCH 0802/1044] Add PHP 8.0 support in site create --- img-versions.json | 1 + php/EE/Migration/Containers.php | 1 + 2 files changed, 2 insertions(+) diff --git a/img-versions.json b/img-versions.json index 04b19ae3a..91e0d7ca6 100644 --- a/img-versions.json +++ b/img-versions.json @@ -10,6 +10,7 @@ "easyengine/php7.2": "v4.1.7", "easyengine/php7.3": "v4.1.7", "easyengine/php7.4": "v4.1.7", + "easyengine/php8.0": "v4.2.0", "easyengine/postfix": "v4.1.5", "easyengine/redis": "v4.1.4", "easyengine/newrelic-daemon": "v4.0.0" diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index 9336d6963..b5e261d2a 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -33,6 +33,7 @@ public static function start_container_migration() { 'easyengine/php7.2', 'easyengine/php7.3', 'easyengine/php7.4', + 'easyengine/php8.0', 'easyengine/newrelic-daemon', ]; From acf6f1b4aec81216907f721b5149f778e7130744 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Thu, 24 Jun 2021 18:43:10 +0530 Subject: [PATCH 0803/1044] Add zsh shell support in completions --- php/EE/Completions.php | 8 ++++++-- php/commands/src/CLI_Command.php | 11 ++++++++++- utils/_ee | 5 ++++- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/php/EE/Completions.php b/php/EE/Completions.php index c56db8428..a6705e961 100644 --- a/php/EE/Completions.php +++ b/php/EE/Completions.php @@ -11,7 +11,7 @@ class Completions { private $words; private $opts = array(); - public function __construct( $line ) { + public function __construct( $line, $shell ) { // TODO: properly parse single and double quotes $this->words = explode( ' ', $line ); @@ -61,7 +61,11 @@ public function __construct( $line ) { } } foreach ( $command->get_subcommands() as $name => $subcommand ) { - $this->add( $name . ':' . $subcommand->get_shortdesc() ); + if ( $shell === 'zsh') { + $this->add( $name . ':' . $subcommand->get_shortdesc() ); + } else { + $this->add( $name ); + } } } else { foreach ( $spec as $arg ) { diff --git a/php/commands/src/CLI_Command.php b/php/commands/src/CLI_Command.php index b17028f3b..99ac10e33 100644 --- a/php/commands/src/CLI_Command.php +++ b/php/commands/src/CLI_Command.php @@ -536,6 +536,15 @@ public function self_uninstall( $args, $assoc_args ) { * --point=<point> * : The index to the current cursor position relative to the beginning of the command. * + * [--shell=<shell>] + * : Shell for completions output. + * --- + * default: bash + * options: + * - bash + * - zsh + * --- + * ## EXAMPLES * * # Generate tab completion strings. @@ -545,7 +554,7 @@ public function self_uninstall( $args, $assoc_args ) { */ public function completions( $_, $assoc_args ) { $line = substr( $assoc_args['line'], 0, $assoc_args['point'] ); - $compl = new \EE\Completions( $line ); + $compl = new \EE\Completions( $line, $assoc_args['shell'] ); $compl->render(); } diff --git a/utils/_ee b/utils/_ee index 4198722e9..1d32e1d76 100644 --- a/utils/_ee +++ b/utils/_ee @@ -4,7 +4,7 @@ function _ee { _ee_completion() { ee_completion=() - ee_completion=$(sudo /usr/local/bin/ee cli completions --line="ee $current_command " --point="$current_position") + ee_completion=$(sudo /usr/local/bin/ee cli completions --shell='zsh' --line="ee $current_command " --point="$current_position") completion=() while read line; do @@ -37,6 +37,9 @@ function _ee { elif [[ "${words[2]}" == "shell" ]]; then _arguments '1: :-> sub_commands' '2: :->get_site_name' '*: :->flags' + elif [[ `pwd` == /opt/easyengine/sites*/* ]]; then + _arguments '1: :-> sub_commands' '2: :->sub_command_param' '*: :->flags' + else _arguments '1: :-> sub_commands' '2: :->sub_command_param' '3: :->get_site_name' '*: :->flags' fi From 3a4130bf260424641b21ab1eb0e4badc55ade28f Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Thu, 24 Jun 2021 18:47:23 +0530 Subject: [PATCH 0804/1044] Add fix for site create --- utils/_ee | 3 +++ 1 file changed, 3 insertions(+) diff --git a/utils/_ee b/utils/_ee index 1d32e1d76..065447f36 100644 --- a/utils/_ee +++ b/utils/_ee @@ -40,6 +40,9 @@ function _ee { elif [[ `pwd` == /opt/easyengine/sites*/* ]]; then _arguments '1: :-> sub_commands' '2: :->sub_command_param' '*: :->flags' + elif [[ "${words[2]}" == "site" && "${words[3]}" == "create" ]]; then + _arguments '1: :-> sub_commands' '2: :->sub_command_param' '*: :->flags' + else _arguments '1: :-> sub_commands' '2: :->sub_command_param' '3: :->get_site_name' '*: :->flags' fi From 4160e8d8d9bc812867d47dfc2890f594b54fb39d Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 28 Jun 2021 12:52:52 +0530 Subject: [PATCH 0805/1044] Add PHP matrix for testing Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- .github/workflows/test_and_build.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index a56276ab3..d94b66b2d 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -86,7 +86,11 @@ jobs: test: #---------------------------------------------------------------------- runs-on: ubuntu-latest needs: [build] - name: Behat Tests + name: Behat Tests - PHP ${{ matrix.php }} + strategy: + fail-fast: false + matrix: + php: ['7.2', '7.3', '7.4', '8.0'] steps: - name: Check out source code uses: actions/checkout@v2 @@ -108,7 +112,7 @@ jobs: - name: Set up PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.0' + php-version: '${{ matrix.php }}' coverage: none tools: composer extensions: pcntl, curl, sqlite3, zip, dom, mbstring, json From 745edbd5e9fbc5eb7770cff651f9507e60a87765 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 28 Jun 2021 12:54:47 +0530 Subject: [PATCH 0806/1044] Pin phar build at PHP 7.4 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- .github/workflows/test_and_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index d94b66b2d..cd0b132ca 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -35,7 +35,7 @@ jobs: - name: Set up PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.0' + php-version: '7.4' coverage: none tools: composer extensions: pcntl, curl, sqlite3, zip, dom, mbstring, json From 6406285f790c9f0a60826080f6c6a62170e05b02 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 28 Jun 2021 13:26:57 +0530 Subject: [PATCH 0807/1044] Update images to latest versions Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- img-versions.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/img-versions.json b/img-versions.json index 91e0d7ca6..16168a9f6 100644 --- a/img-versions.json +++ b/img-versions.json @@ -1,17 +1,17 @@ { "easyengine/cron": "v4.0.0", "easyengine/mailhog": "v4.0.0", - "easyengine/mariadb": "v4.1.3", - "easyengine/nginx-proxy": "v4.2.0", - "easyengine/nginx": "v4.1.4", + "easyengine/mariadb": "v4.3.0", + "easyengine/nginx-proxy": "v4.3.0", + "easyengine/nginx": "v4.3.0", "easyengine/php": "v4.1.7", "easyengine/php5.6": "v4.0.0", "easyengine/php7.0": "v4.1.7", "easyengine/php7.2": "v4.1.7", - "easyengine/php7.3": "v4.1.7", - "easyengine/php7.4": "v4.1.7", - "easyengine/php8.0": "v4.2.0", + "easyengine/php7.3": "v4.3.0", + "easyengine/php7.4": "v4.3.0", + "easyengine/php8.0": "v4.3.0", "easyengine/postfix": "v4.1.5", - "easyengine/redis": "v4.1.4", - "easyengine/newrelic-daemon": "v4.0.0" + "easyengine/redis": "v4.3.0", + "easyengine/newrelic-daemon": "v4.3.0" } From 60d706daffa588df30605ab53ca5a2cb72cc149e Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 28 Jun 2021 13:59:49 +0530 Subject: [PATCH 0808/1044] Revert mariadb to older version Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- img-versions.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/img-versions.json b/img-versions.json index 16168a9f6..ebb0adff5 100644 --- a/img-versions.json +++ b/img-versions.json @@ -1,7 +1,7 @@ { "easyengine/cron": "v4.0.0", "easyengine/mailhog": "v4.0.0", - "easyengine/mariadb": "v4.3.0", + "easyengine/mariadb": "v4.1.3", "easyengine/nginx-proxy": "v4.3.0", "easyengine/nginx": "v4.3.0", "easyengine/php": "v4.1.7", From cfabd00010348cd921f440c3b4bb5b58f6ab0f8a Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 28 Jun 2021 14:54:47 +0530 Subject: [PATCH 0809/1044] Bump version to v4.3.0 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 6aba2b245..80895903a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.2.0 +4.3.0 From 24c0c58f96e7196644d99316e78a1c885262087a Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Mon, 28 Jun 2021 16:07:30 +0530 Subject: [PATCH 0810/1044] Rename completion file --- utils/{_ee => ee-completion.zsh} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename utils/{_ee => ee-completion.zsh} (100%) diff --git a/utils/_ee b/utils/ee-completion.zsh similarity index 100% rename from utils/_ee rename to utils/ee-completion.zsh From 3f3b83e100626ca8efdc8e6c5b9745659e85f919 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 28 Jun 2021 17:03:34 +0530 Subject: [PATCH 0811/1044] Update composer dependencies Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 6 ++--- composer.lock | 64 +++++++++++++++++++++++++++------------------------ 2 files changed, 37 insertions(+), 33 deletions(-) diff --git a/composer.json b/composer.json index a53ef6d9d..39ef3a6b7 100644 --- a/composer.json +++ b/composer.json @@ -35,9 +35,9 @@ "easyengine/mailhog-command": "v1.0.2", "easyengine/service-command": "v1.2.0", "easyengine/shell-command": "v1.1.0", - "easyengine/site-command": "v2.7.1", - "easyengine/site-type-php": "v1.4.0", - "easyengine/site-type-wp": "v1.4.0", + "easyengine/site-command": "v2.8.0", + "easyengine/site-type-php": "v1.5.0", + "easyengine/site-type-wp": "v1.5.0", "monolog/monolog": "1.24.0", "mustache/mustache": "2.13.0", "rmccue/requests": "1.8.0", diff --git a/composer.lock b/composer.lock index 2ff5dcdb6..39f7e6514 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": "ca702cea932b2546c6f4fb3ce747c812", + "content-hash": "15ce254b5d9df3571f9964ccd7f6ce32", "packages": [ { "name": "acmephp/core", @@ -1041,16 +1041,16 @@ }, { "name": "easyengine/site-command", - "version": "v2.7.1", + "version": "v2.8.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "0cdca5e185dfc892b7d323f1c12185fc5ed928ed" + "reference": "3a9fe393843b2dd7d760daac7e24f74c36db6abb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/0cdca5e185dfc892b7d323f1c12185fc5ed928ed", - "reference": "0cdca5e185dfc892b7d323f1c12185fc5ed928ed", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/3a9fe393843b2dd7d760daac7e24f74c36db6abb", + "reference": "3a9fe393843b2dd7d760daac7e24f74c36db6abb", "shasum": "" }, "require": { @@ -1060,7 +1060,7 @@ "guzzlehttp/guzzle": "6.3.3", "league/flysystem": "1.0.49", "symfony/serializer": "3.4.20", - "webmozart/assert": "1.3.0" + "webmozart/assert": "1.10.0" }, "type": "ee-cli-package", "extra": { @@ -1109,22 +1109,22 @@ "homepage": "https://github.com/easyengine/site-command", "support": { "issues": "https://github.com/EasyEngine/site-command/issues", - "source": "https://github.com/EasyEngine/site-command/tree/v2.7.1" + "source": "https://github.com/EasyEngine/site-command/tree/v2.8.0" }, - "time": "2021-06-17T06:53:19+00:00" + "time": "2021-06-28T10:52:21+00:00" }, { "name": "easyengine/site-type-php", - "version": "v1.4.0", + "version": "v1.5.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-php.git", - "reference": "429a04f2ca61ff1222a96e690d4148bd65dd371f" + "reference": "637623fddb4ce30009f4e000c5eab89c7c12d9d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/429a04f2ca61ff1222a96e690d4148bd65dd371f", - "reference": "429a04f2ca61ff1222a96e690d4148bd65dd371f", + "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/637623fddb4ce30009f4e000c5eab89c7c12d9d0", + "reference": "637623fddb4ce30009f4e000c5eab89c7c12d9d0", "shasum": "" }, "require-dev": { @@ -1168,22 +1168,22 @@ "homepage": "https://github.com/easyengine/site-type-php", "support": { "issues": "https://github.com/EasyEngine/site-type-php/issues", - "source": "https://github.com/EasyEngine/site-type-php/tree/v1.4.0" + "source": "https://github.com/EasyEngine/site-type-php/tree/v1.5.0" }, - "time": "2021-06-16T14:15:58+00:00" + "time": "2021-06-28T10:58:23+00:00" }, { "name": "easyengine/site-type-wp", - "version": "v1.4.0", + "version": "v1.5.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-wp.git", - "reference": "a9a75b0516ac944b075f353786ac11bd0df0fc09" + "reference": "8ef3d132c74dede5d4141020e4e2126fd8066a98" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/a9a75b0516ac944b075f353786ac11bd0df0fc09", - "reference": "a9a75b0516ac944b075f353786ac11bd0df0fc09", + "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/8ef3d132c74dede5d4141020e4e2126fd8066a98", + "reference": "8ef3d132c74dede5d4141020e4e2126fd8066a98", "shasum": "" }, "require-dev": { @@ -1227,9 +1227,9 @@ "homepage": "https://github.com/easyengine/site-type-wp", "support": { "issues": "https://github.com/EasyEngine/site-type-wp/issues", - "source": "https://github.com/EasyEngine/site-type-wp/tree/v1.4.0" + "source": "https://github.com/EasyEngine/site-type-wp/tree/v1.5.0" }, - "time": "2021-06-16T14:15:44+00:00" + "time": "2021-06-28T10:59:11+00:00" }, { "name": "guzzlehttp/guzzle", @@ -3602,29 +3602,33 @@ }, { "name": "webmozart/assert", - "version": "1.3.0", + "version": "1.10.0", "source": { "type": "git", "url": "https://github.com/webmozarts/assert.git", - "reference": "0df1908962e7a3071564e857d86874dad1ef204a" + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", - "reference": "0df1908962e7a3071564e857d86874dad1ef204a", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^7.2 || ^8.0", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "phpstan/phpstan": "<0.12.20", + "vimeo/psalm": "<4.6.1 || 4.6.2" }, "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1" + "phpunit/phpunit": "^8.5.13" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "1.10-dev" } }, "autoload": { @@ -3650,9 +3654,9 @@ ], "support": { "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.3.0" + "source": "https://github.com/webmozarts/assert/tree/1.10.0" }, - "time": "2018-01-29T19:49:41+00:00" + "time": "2021-03-09T10:59:23+00:00" }, { "name": "wp-cli/mustangostang-spyc", From 9f9ed704bcd6fadb1b03746d4cf1c85ad0013e73 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 28 Jun 2021 18:21:05 +0530 Subject: [PATCH 0812/1044] Update site-command package Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 2 +- composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index 39ef3a6b7..bccea4ad8 100644 --- a/composer.json +++ b/composer.json @@ -35,7 +35,7 @@ "easyengine/mailhog-command": "v1.0.2", "easyengine/service-command": "v1.2.0", "easyengine/shell-command": "v1.1.0", - "easyengine/site-command": "v2.8.0", + "easyengine/site-command": "v2.8.1", "easyengine/site-type-php": "v1.5.0", "easyengine/site-type-wp": "v1.5.0", "monolog/monolog": "1.24.0", diff --git a/composer.lock b/composer.lock index 39f7e6514..891f9895b 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": "15ce254b5d9df3571f9964ccd7f6ce32", + "content-hash": "bba6361d6a0ab923b088c7fda5d65466", "packages": [ { "name": "acmephp/core", @@ -1041,16 +1041,16 @@ }, { "name": "easyengine/site-command", - "version": "v2.8.0", + "version": "v2.8.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "3a9fe393843b2dd7d760daac7e24f74c36db6abb" + "reference": "c4d5716212ab4ed0a9f2bc561905d8d8a1fde4d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/3a9fe393843b2dd7d760daac7e24f74c36db6abb", - "reference": "3a9fe393843b2dd7d760daac7e24f74c36db6abb", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/c4d5716212ab4ed0a9f2bc561905d8d8a1fde4d3", + "reference": "c4d5716212ab4ed0a9f2bc561905d8d8a1fde4d3", "shasum": "" }, "require": { @@ -1109,9 +1109,9 @@ "homepage": "https://github.com/easyengine/site-command", "support": { "issues": "https://github.com/EasyEngine/site-command/issues", - "source": "https://github.com/EasyEngine/site-command/tree/v2.8.0" + "source": "https://github.com/EasyEngine/site-command/tree/v2.8.1" }, - "time": "2021-06-28T10:52:21+00:00" + "time": "2021-06-28T12:46:56+00:00" }, { "name": "easyengine/site-type-php", From 5e0914c9a0b87ad0d31ae666c698a7c894ecf2e7 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 29 Jun 2021 14:47:23 +0530 Subject: [PATCH 0813/1044] Update PHP img version Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- img-versions.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/img-versions.json b/img-versions.json index ebb0adff5..572a29381 100644 --- a/img-versions.json +++ b/img-versions.json @@ -4,7 +4,7 @@ "easyengine/mariadb": "v4.1.3", "easyengine/nginx-proxy": "v4.3.0", "easyengine/nginx": "v4.3.0", - "easyengine/php": "v4.1.7", + "easyengine/php": "v4.3.0", "easyengine/php5.6": "v4.0.0", "easyengine/php7.0": "v4.1.7", "easyengine/php7.2": "v4.1.7", From 212bc4777c62af4d352b4f5267f1f88901775562 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Wed, 30 Jun 2021 13:31:36 +0530 Subject: [PATCH 0814/1044] =?UTF-8?q?=F0=9F=90=9B=20Fix=20EE=5FPROXY=5FTYP?= =?UTF-8?q?E=20declaration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- php/EE/Runner.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index d1da9a238..74b851173 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -75,11 +75,15 @@ private function init_ee() { if ( 0 === $launch->return_code ) { $nginx_proxy = trim( $launch->stdout ); } + define( 'EE_PROXY_TYPE', $nginx_proxy ); $this->check_requirements(); $this->maybe_trigger_migration(); } - define( 'EE_PROXY_TYPE', $nginx_proxy ); + + if ( ! defined( 'EE_PROXY_TYPE' ) ) { + define('EE_PROXY_TYPE', $nginx_proxy); + } if ( [ 'cli', 'info' ] === $this->arguments && $this->check_requirements( false ) ) { $this->maybe_trigger_migration(); From 2db942396428164455455c84d06fc2930b7ae03f Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Wed, 30 Jun 2021 17:57:43 +0530 Subject: [PATCH 0815/1044] Update composer dependencies Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 2 +- composer.lock | 182 +++++++++++++++++++++++++++++++++----------------- 2 files changed, 123 insertions(+), 61 deletions(-) diff --git a/composer.json b/composer.json index bccea4ad8..10f11ffa3 100644 --- a/composer.json +++ b/composer.json @@ -35,7 +35,7 @@ "easyengine/mailhog-command": "v1.0.2", "easyengine/service-command": "v1.2.0", "easyengine/shell-command": "v1.1.0", - "easyengine/site-command": "v2.8.1", + "easyengine/site-command": "v2.8.2", "easyengine/site-type-php": "v1.5.0", "easyengine/site-type-wp": "v1.5.0", "monolog/monolog": "1.24.0", diff --git a/composer.lock b/composer.lock index 891f9895b..2fba1038e 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": "bba6361d6a0ab923b088c7fda5d65466", + "content-hash": "dcbbd53c4d59746eabb3cd49a4c3e644", "packages": [ { "name": "acmephp/core", @@ -1041,16 +1041,16 @@ }, { "name": "easyengine/site-command", - "version": "v2.8.1", + "version": "v2.8.2", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "c4d5716212ab4ed0a9f2bc561905d8d8a1fde4d3" + "reference": "aba31db217416d9cd696fa19fe0a947ca7bb084e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/c4d5716212ab4ed0a9f2bc561905d8d8a1fde4d3", - "reference": "c4d5716212ab4ed0a9f2bc561905d8d8a1fde4d3", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/aba31db217416d9cd696fa19fe0a947ca7bb084e", + "reference": "aba31db217416d9cd696fa19fe0a947ca7bb084e", "shasum": "" }, "require": { @@ -1058,7 +1058,7 @@ "cloudflare/sdk": "1.1.1", "ext-openssl": "*", "guzzlehttp/guzzle": "6.3.3", - "league/flysystem": "1.0.49", + "league/flysystem": "1.1.4", "symfony/serializer": "3.4.20", "webmozart/assert": "1.10.0" }, @@ -1109,9 +1109,9 @@ "homepage": "https://github.com/easyengine/site-command", "support": { "issues": "https://github.com/EasyEngine/site-command/issues", - "source": "https://github.com/EasyEngine/site-command/tree/v2.8.1" + "source": "https://github.com/EasyEngine/site-command/tree/v2.8.2" }, - "time": "2021-06-28T12:46:56+00:00" + "time": "2021-06-30T11:15:41+00:00" }, { "name": "easyengine/site-type-php", @@ -1502,31 +1502,31 @@ }, { "name": "league/flysystem", - "version": "1.0.49", + "version": "1.1.4", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "a63cc83d8a931b271be45148fa39ba7156782ffd" + "reference": "f3ad69181b8afed2c9edf7be5a2918144ff4ea32" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/a63cc83d8a931b271be45148fa39ba7156782ffd", - "reference": "a63cc83d8a931b271be45148fa39ba7156782ffd", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/f3ad69181b8afed2c9edf7be5a2918144ff4ea32", + "reference": "f3ad69181b8afed2c9edf7be5a2918144ff4ea32", "shasum": "" }, "require": { "ext-fileinfo": "*", - "php": ">=5.5.9" + "league/mime-type-detection": "^1.3", + "php": "^7.2.5 || ^8.0" }, "conflict": { "league/flysystem-sftp": "<1.0.6" }, "require-dev": { - "phpspec/phpspec": "^3.4", - "phpunit/phpunit": "^5.7.10" + "phpspec/prophecy": "^1.11.1", + "phpunit/phpunit": "^8.5.8" }, "suggest": { - "ext-fileinfo": "Required for MimeType", "ext-ftp": "Allows you to use FTP server storage", "ext-openssl": "Allows you to use FTPS server storage", "league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2", @@ -1584,9 +1584,71 @@ ], "support": { "issues": "https://github.com/thephpleague/flysystem/issues", - "source": "https://github.com/thephpleague/flysystem/tree/master" + "source": "https://github.com/thephpleague/flysystem/tree/1.1.4" }, - "time": "2018-11-23T23:41:29+00:00" + "funding": [ + { + "url": "https://offset.earth/frankdejonge", + "type": "other" + } + ], + "time": "2021-06-23T21:56:05+00:00" + }, + { + "name": "league/mime-type-detection", + "version": "1.7.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/mime-type-detection.git", + "reference": "3b9dff8aaf7323590c1d2e443db701eb1f9aa0d3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/3b9dff8aaf7323590c1d2e443db701eb1f9aa0d3", + "reference": "3b9dff8aaf7323590c1d2e443db701eb1f9aa0d3", + "shasum": "" + }, + "require": { + "ext-fileinfo": "*", + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.18", + "phpstan/phpstan": "^0.12.68", + "phpunit/phpunit": "^8.5.8 || ^9.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "League\\MimeTypeDetection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frank de Jonge", + "email": "info@frankdejonge.nl" + } + ], + "description": "Mime-type detection for Flysystem", + "support": { + "issues": "https://github.com/thephpleague/mime-type-detection/issues", + "source": "https://github.com/thephpleague/mime-type-detection/tree/1.7.0" + }, + "funding": [ + { + "url": "https://github.com/frankdejonge", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/league/flysystem", + "type": "tidelift" + } + ], + "time": "2021-01-18T20:58:21+00:00" }, { "name": "monolog/monolog", @@ -2138,16 +2200,16 @@ }, { "name": "symfony/config", - "version": "v4.4.25", + "version": "v4.4.26", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "2803882bb10353d277d4539635dd688a053d571c" + "reference": "1cb26cdb8a9834d8494cadd284602fa0647b73e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/2803882bb10353d277d4539635dd688a053d571c", - "reference": "2803882bb10353d277d4539635dd688a053d571c", + "url": "https://api.github.com/repos/symfony/config/zipball/1cb26cdb8a9834d8494cadd284602fa0647b73e5", + "reference": "1cb26cdb8a9834d8494cadd284602fa0647b73e5", "shasum": "" }, "require": { @@ -2195,7 +2257,7 @@ "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/config/tree/v4.4.25" + "source": "https://github.com/symfony/config/tree/v4.4.26" }, "funding": [ { @@ -2211,20 +2273,20 @@ "type": "tidelift" } ], - "time": "2021-05-26T11:20:16+00:00" + "time": "2021-06-21T14:51:25+00:00" }, { "name": "symfony/console", - "version": "v4.4.25", + "version": "v4.4.26", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "a62acecdf5b50e314a4f305cd01b5282126f3095" + "reference": "9aa1eb46c1b12fada74dc0c529e93d1ccef22576" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/a62acecdf5b50e314a4f305cd01b5282126f3095", - "reference": "a62acecdf5b50e314a4f305cd01b5282126f3095", + "url": "https://api.github.com/repos/symfony/console/zipball/9aa1eb46c1b12fada74dc0c529e93d1ccef22576", + "reference": "9aa1eb46c1b12fada74dc0c529e93d1ccef22576", "shasum": "" }, "require": { @@ -2284,7 +2346,7 @@ "description": "Eases the creation of beautiful and testable command line interfaces", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/console/tree/v4.4.25" + "source": "https://github.com/symfony/console/tree/v4.4.26" }, "funding": [ { @@ -2300,7 +2362,7 @@ "type": "tidelift" } ], - "time": "2021-05-26T11:20:16+00:00" + "time": "2021-06-06T09:12:27+00:00" }, { "name": "symfony/debug", @@ -2373,16 +2435,16 @@ }, { "name": "symfony/dependency-injection", - "version": "v4.4.25", + "version": "v4.4.26", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "2ed2a0a6c960bf4e2e862ec77b2f2c558b83c64d" + "reference": "a944d2f8e903dc99f5f1baf3eb74081352f0067f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/2ed2a0a6c960bf4e2e862ec77b2f2c558b83c64d", - "reference": "2ed2a0a6c960bf4e2e862ec77b2f2c558b83c64d", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/a944d2f8e903dc99f5f1baf3eb74081352f0067f", + "reference": "a944d2f8e903dc99f5f1baf3eb74081352f0067f", "shasum": "" }, "require": { @@ -2438,7 +2500,7 @@ "description": "Allows you to standardize and centralize the way objects are constructed in your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v4.4.25" + "source": "https://github.com/symfony/dependency-injection/tree/v4.4.26" }, "funding": [ { @@ -2454,7 +2516,7 @@ "type": "tidelift" } ], - "time": "2021-05-26T17:54:16+00:00" + "time": "2021-06-24T08:08:16+00:00" }, { "name": "symfony/event-dispatcher", @@ -2620,16 +2682,16 @@ }, { "name": "symfony/filesystem", - "version": "v4.4.25", + "version": "v4.4.26", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "2d926ebd76f52352deb3c9577d8c1d4b96eae429" + "reference": "a501126eb6ec9288a3434af01b3d4499ec1268a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/2d926ebd76f52352deb3c9577d8c1d4b96eae429", - "reference": "2d926ebd76f52352deb3c9577d8c1d4b96eae429", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/a501126eb6ec9288a3434af01b3d4499ec1268a0", + "reference": "a501126eb6ec9288a3434af01b3d4499ec1268a0", "shasum": "" }, "require": { @@ -2662,7 +2724,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v4.4.25" + "source": "https://github.com/symfony/filesystem/tree/v4.4.26" }, "funding": [ { @@ -2678,7 +2740,7 @@ "type": "tidelift" } ], - "time": "2021-05-26T17:30:55+00:00" + "time": "2021-06-30T07:12:23+00:00" }, { "name": "symfony/finder", @@ -3143,16 +3205,16 @@ }, { "name": "symfony/process", - "version": "v4.4.25", + "version": "v4.4.26", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "cd61e6dd273975c6625316de9d141ebd197f93c9" + "reference": "7e812c84c3f2dba173d311de6e510edf701685a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/cd61e6dd273975c6625316de9d141ebd197f93c9", - "reference": "cd61e6dd273975c6625316de9d141ebd197f93c9", + "url": "https://api.github.com/repos/symfony/process/zipball/7e812c84c3f2dba173d311de6e510edf701685a8", + "reference": "7e812c84c3f2dba173d311de6e510edf701685a8", "shasum": "" }, "require": { @@ -3184,7 +3246,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v4.4.25" + "source": "https://github.com/symfony/process/tree/v4.4.26" }, "funding": [ { @@ -3200,7 +3262,7 @@ "type": "tidelift" } ], - "time": "2021-05-26T11:20:16+00:00" + "time": "2021-06-09T14:57:04+00:00" }, { "name": "symfony/serializer", @@ -3365,16 +3427,16 @@ }, { "name": "symfony/translation", - "version": "v4.4.25", + "version": "v4.4.26", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "dfe132c5c6d89f90ce7f961742cc532e9ca16dd4" + "reference": "2f7fa60b8d10ca71c30dc46b0870143183a8f131" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/dfe132c5c6d89f90ce7f961742cc532e9ca16dd4", - "reference": "dfe132c5c6d89f90ce7f961742cc532e9ca16dd4", + "url": "https://api.github.com/repos/symfony/translation/zipball/2f7fa60b8d10ca71c30dc46b0870143183a8f131", + "reference": "2f7fa60b8d10ca71c30dc46b0870143183a8f131", "shasum": "" }, "require": { @@ -3433,7 +3495,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v4.4.25" + "source": "https://github.com/symfony/translation/tree/v4.4.26" }, "funding": [ { @@ -3449,7 +3511,7 @@ "type": "tidelift" } ], - "time": "2021-05-26T17:39:37+00:00" + "time": "2021-06-06T08:51:46+00:00" }, { "name": "symfony/translation-contracts", @@ -3531,16 +3593,16 @@ }, { "name": "symfony/yaml", - "version": "v4.4.25", + "version": "v4.4.26", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "81cdac5536925c1c4b7b50aabc9ff6330b9eb5fc" + "reference": "e096ef4b4c4c9a2f72c2ac660f54352cd31c60f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/81cdac5536925c1c4b7b50aabc9ff6330b9eb5fc", - "reference": "81cdac5536925c1c4b7b50aabc9ff6330b9eb5fc", + "url": "https://api.github.com/repos/symfony/yaml/zipball/e096ef4b4c4c9a2f72c2ac660f54352cd31c60f8", + "reference": "e096ef4b4c4c9a2f72c2ac660f54352cd31c60f8", "shasum": "" }, "require": { @@ -3582,7 +3644,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v4.4.25" + "source": "https://github.com/symfony/yaml/tree/v4.4.26" }, "funding": [ { @@ -3598,7 +3660,7 @@ "type": "tidelift" } ], - "time": "2021-05-26T17:39:37+00:00" + "time": "2021-06-23T19:06:53+00:00" }, { "name": "webmozart/assert", From f0a812ea2a49bb46d480df960cb8dfdb33991679 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Tue, 6 Jul 2021 14:47:49 +0530 Subject: [PATCH 0816/1044] =?UTF-8?q?=F0=9F=90=9B=20Add=20symphony=20servi?= =?UTF-8?q?ce-contracts=20package=20in=20phar=20to=20fix=20site=20ssl=20cr?= =?UTF-8?q?eate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/make-phar.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/make-phar.php b/utils/make-phar.php index 8e160c15e..15c4f6f33 100644 --- a/utils/make-phar.php +++ b/utils/make-phar.php @@ -75,7 +75,7 @@ function add_file( $phar, $path ) { $strips = array( '\/(?:behat|gherkin)\/src\/', '\/phpunit\/', - '\/symfony\/(?!console|filesystem|finder|polyfill-mbstring|process|serializer)', + '\/symfony\/(?!console|filesystem|finder|polyfill-mbstring|process|serializer|service-contracts)', '\/composer\/spdx-licenses\/', '\/Composer\/(?:Command\/|Compiler\.php|Console\/|Downloader\/Pear|Installer\/Pear|Question\/|Repository\/Pear|SelfUpdate\/)', '\/(?:dealerdirect|squizlabs|wimg)\/', @@ -206,6 +206,7 @@ function get_composer_versions( $current_version ) { ->in(EE_VENDOR_DIR . '/symfony/filesystem') ->in(EE_VENDOR_DIR . '/symfony/process') ->in(EE_VENDOR_DIR . '/symfony/serializer') + ->in(EE_VENDOR_DIR . '/symfony/service-contracts') ->in(EE_VENDOR_DIR . '/justinrainbow/json-schema') ->exclude('demo') ->exclude('nb/oxymel/OxymelTest.php') From 6157d536a2a1f447b5e6a0f6040fb3f7f0e66bd4 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 6 Jul 2021 20:13:05 +0530 Subject: [PATCH 0817/1044] Bump version to v4.3.1 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 80895903a..f77856a6f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.3.0 +4.3.1 From 55ceb9e6586701ca7ae95b01ee70a616b4b370e3 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Thu, 8 Jul 2021 15:16:56 +0530 Subject: [PATCH 0818/1044] Add feature to remove SSL from site command --- php/EE/DocParser.php | 2 +- php/utils.php | 20 +++----------------- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/php/EE/DocParser.php b/php/EE/DocParser.php index 7fcfd3ba9..46e94fb24 100644 --- a/php/EE/DocParser.php +++ b/php/EE/DocParser.php @@ -163,7 +163,7 @@ public function get_param_desc( $key ) { * @return mixed|null */ public function get_param_args( $key ) { - return $this->get_arg_or_param_args( "/^\[?--{$key}=.*/" ); + return $this->get_arg_or_param_args( "/^\[?--{$key}\[?=.*/" ); } /** diff --git a/php/utils.php b/php/utils.php index 8aaf06be5..6980cef75 100644 --- a/php/utils.php +++ b/php/utils.php @@ -1737,30 +1737,16 @@ function random_name_generator() { /** * @param array $assoc_args Arguments array. * @param string $flag Flag to get the value. - * @param array $supported_flag_values array of supported flag values. * @param string $default_value default flag value if flag is passed without value. * * @return string * @throws EE\ExitException */ -function get_value_if_flag_isset( $assoc_args, $flag, $supported_flag_values = [], $default_value = '' ) { +function get_value_if_flag_isset( $assoc_args, $flag, $default_value = '' ) { - $flag_value = get_flag_value( $assoc_args, $flag ); - $value = ''; + $value = get_flag_value( $assoc_args, $flag ); - if ( isset( $flag_value ) ) { - /** - * Set default flag value if flag is passed without value. - */ - $value = ( empty( $flag_value ) || true === $flag_value ) ? $default_value : $flag_value; - - if ( empty( $value ) ) { - return $value; - } elseif ( ! in_array( $value, $supported_flag_values, true ) ) { - EE::error( sprintf( 'Invalid flag value passed %s', $value ) ); - } - } - return $value; + return $value === true ? $default_value : $value; } /** From ed8bba009af6f27cf57df7a68aa22ecf8c0b2060 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 15 Jul 2021 23:18:11 +0530 Subject: [PATCH 0819/1044] Fix docker network cleanup Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- php/commands/src/CLI_Command.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/commands/src/CLI_Command.php b/php/commands/src/CLI_Command.php index 99ac10e33..dc7f28bf3 100644 --- a/php/commands/src/CLI_Command.php +++ b/php/commands/src/CLI_Command.php @@ -506,7 +506,7 @@ public function self_uninstall( $args, $assoc_args ) { EE::confirm( "Are you sure you want to remove EasyEngine and all its sites(along with their data)?\nThis is an irreversible action. No backup will be kept.", $assoc_args ); EE::exec( 'docker rm -f $(docker ps -aqf label=org.label-schema.vendor="EasyEngine")' ); - EE::exec( 'docker network prune -f $(docker network ls -f "label=org.label-schema.vendor=EasyEngine")' ); + EE::exec( 'docker network rm $(docker network ls -f "label=org.label-schema.vendor=EasyEngine" --format="{{.Name}}")' ); EE::exec( 'docker volume rm -f $(docker volume ls -f "label=org.label-schema.vendor=EasyEngine" -q)' ); EE::exec( 'docker image rm $(docker image ls -f "label=org.label-schema.vendor=EasyEngine" -q)' ); From 96b802d2b21300c0a3f856653448f37695183f57 Mon Sep 17 00:00:00 2001 From: YuQuan <38601123+RussQuan@users.noreply.github.com> Date: Sun, 18 Jul 2021 08:47:26 +0800 Subject: [PATCH 0820/1044] Update README.md I've tried. It works fine on Debian 10. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 24797a969..632d6f6f4 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ EasyEngine makes it greatly easy to manage nginx, a fast web-server software tha ### Linux -For Linux, we have created an installer script which will install all the dependencies for you. We have tested this on Ubuntu 14.04, 16.04, 18.04 and Debian 8. +For Linux, we have created an installer script which will install all the dependencies for you. We have tested this on Ubuntu 14.04, 16.04, 18.04 and Debian 8, Debian 10. ```bash wget -qO ee https://rt.cx/ee4 && sudo bash ee From f1f3523aec6915da3e9b4074c54469e2372185d7 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Sun, 18 Jul 2021 17:37:28 +0530 Subject: [PATCH 0821/1044] Exclude running Deploy Phar job in forks Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- .github/workflows/test_and_build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index cd0b132ca..60269dc66 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -172,7 +172,9 @@ jobs: deploy: #----------------------------------------------------------------------- name: Deploy Phar - if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master' + if: | + github.repository_owner == 'EasyEngine' && + (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master') runs-on: ubuntu-latest needs: [build, test] @@ -209,6 +211,7 @@ jobs: run: | md5sum phar/$FILENAME | cut -d ' ' -f 1 > phar/$FILENAME.md5 sha512sum phar/$FILENAME | cut -d ' ' -f 1 > phar/$FILENAME.sha512 + - name: Commit files run: | git config --local user.email "action@github.com" From 82509aa0aa596599a1021003431b2f3bbca99141 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Tue, 3 Aug 2021 13:57:14 +0530 Subject: [PATCH 0822/1044] =?UTF-8?q?=F0=9F=90=9BFix=20migration=20trigger?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- php/EE/Runner.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 74b851173..ca82657f0 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -868,6 +868,18 @@ private function auto_check_update() { */ private function maybe_trigger_migration() { + $cache = EE::get_cache(); + + /** + * Below condition ensures that running EE::launch() or runcommand() + * in migration file does not trigget migration again. + */ + if ( $cache->read('migration_running' ) ) { + return; + } + + $cache->write( 'migration_running', true ); + $db_version = Option::get( 'version' ); $current_version = EE_VERSION; @@ -899,6 +911,8 @@ private function maybe_trigger_migration() { } elseif ( false !== strpos( $current_version, 'nightly' ) ) { $this->trigger_migration( $current_version ); } + + $cache->remove( 'migration_running' ); } private function trigger_migration( $version ) { From c2af8e1fccce90402b961193c57c9f37e827c0da Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Mon, 16 Aug 2021 18:18:20 +0530 Subject: [PATCH 0823/1044] Add message when skipping migration --- php/EE/Runner.php | 1 + 1 file changed, 1 insertion(+) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index ca82657f0..666f21826 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -875,6 +875,7 @@ private function maybe_trigger_migration() { * in migration file does not trigget migration again. */ if ( $cache->read('migration_running' ) ) { + EE::log( 'Not triggering migrations since they seems to already been running.' ); return; } From 5af8ce71186a0fc508a8357789c9ab91d6095e6c Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Wed, 18 Aug 2021 17:08:02 +0530 Subject: [PATCH 0824/1044] Change log to debug --- php/EE/Runner.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 666f21826..226408db6 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -875,7 +875,7 @@ private function maybe_trigger_migration() { * in migration file does not trigget migration again. */ if ( $cache->read('migration_running' ) ) { - EE::log( 'Not triggering migrations since they seems to already been running.' ); + EE::debug( 'Not triggering migrations since they seems to already been running.' ); return; } From e08276cd8e083ec8fabb66cc461c5224b77074dd Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Thu, 19 Aug 2021 16:39:26 +0530 Subject: [PATCH 0825/1044] Remove migration cache during first run --- php/EE/Runner.php | 1 + 1 file changed, 1 insertion(+) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 226408db6..7b9065522 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -886,6 +886,7 @@ private function maybe_trigger_migration() { if ( ! $db_version ) { $this->trigger_migration( $current_version ); + $cache->remove( 'migration_running' ); return; } From ced3c444bc26c767c66c7a68d6d4663051e2caf0 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Mon, 23 Aug 2021 10:32:28 +0530 Subject: [PATCH 0826/1044] Update Runner.php --- php/EE/Runner.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 7b9065522..1551b1536 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -874,7 +874,7 @@ private function maybe_trigger_migration() { * Below condition ensures that running EE::launch() or runcommand() * in migration file does not trigget migration again. */ - if ( $cache->read('migration_running' ) ) { + if ( $cache->read( 'migration_running' ) ) { EE::debug( 'Not triggering migrations since they seems to already been running.' ); return; } From 4ecfc0a065ae886102e919f465fd32f53f1ad66e Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 24 Aug 2021 11:28:23 +0530 Subject: [PATCH 0827/1044] Update get_value_if_flag_isset Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- php/utils.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/php/utils.php b/php/utils.php index 6980cef75..4c2ca61b9 100644 --- a/php/utils.php +++ b/php/utils.php @@ -1744,9 +1744,17 @@ function random_name_generator() { */ function get_value_if_flag_isset( $assoc_args, $flag, $default_value = '' ) { - $value = get_flag_value( $assoc_args, $flag ); + $flag_value = get_flag_value( $assoc_args, $flag ); + $value = ''; - return $value === true ? $default_value : $value; + if ( isset( $flag_value ) ) { + /** + * Set default flag value if flag is passed without value. + */ + $value = ( ! empty( $default_value ) && ( empty( $flag_value ) || true === $flag_value ) ) ? $default_value : $flag_value; + } + + return $value; } /** From 80b4ab320e34406e7b68291b01201d7a3c16b656 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Tue, 24 Aug 2021 15:16:13 +0530 Subject: [PATCH 0828/1044] Fix migration cache removal --- php/EE/Migration/Executor.php | 1 + 1 file changed, 1 insertion(+) diff --git a/php/EE/Migration/Executor.php b/php/EE/Migration/Executor.php index 249e00df9..8ef7afae6 100644 --- a/php/EE/Migration/Executor.php +++ b/php/EE/Migration/Executor.php @@ -30,6 +30,7 @@ public static function execute_migrations() { self::execute_migration_stack( $migrations ); } catch ( \Throwable $e ) { Utils\delem_log( 'ee migration ended abruptly' ); + EE::get_cache()->remove( 'migration_running' ); exit( 1 ); } From 3efaf57bc82021b2f19326bfd7e581307ee343d0 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com> Date: Wed, 1 Sep 2021 17:18:07 +0530 Subject: [PATCH 0829/1044] Update staus badges --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 632d6f6f4..404ad15d7 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,7 @@ <img src="https://i2.wp.com/easyengine.io/wp-content/uploads/sites/20/2019/06/EasyEngine-New-Logo-Banner@2x-Transparent-Background.png?fit=720%2C170&ssl=1" alt="EasyEngine Logo" /> -# EasyEngine v4 -[![Build Status](https://travis-ci.org/EasyEngine/easyengine.svg?branch=master-v4)](https://travis-ci.org/EasyEngine/easyengine) [![Join EasyEngine Slack Channel](http://slack.easyengine.io/badge.svg)](http://slack.easyengine.io/) [![Latest Stable Version](https://poser.pugx.org/easyengine/easyengine/v/stable)](https://packagist.org/packages/easyengine/easyengine) [![Latest Unstable Version](https://poser.pugx.org/easyengine/easyengine/v/unstable)](https://packagist.org/packages/easyengine/easyengine) [![License](https://poser.pugx.org/easyengine/easyengine/license)](https://packagist.org/packages/easyengine/easyengine) +# EasyEngine v4 [![Build 🔨 + Test 👨‍🔧](https://github.com/EasyEngine/easyengine/actions/workflows/test_and_build.yml/badge.svg?branch=develop)](https://github.com/EasyEngine/easyengine/actions/workflows/test_and_build.yml) [![Join EasyEngine Slack Channel](http://slack.easyengine.io/badge.svg)](http://slack.easyengine.io/) [![Latest Stable Version](https://poser.pugx.org/easyengine/easyengine/v/stable)](https://github.com/EasyEngine/easyengine/releases) [![License](https://poser.pugx.org/easyengine/easyengine/license)](https://packagist.org/packages/easyengine/easyengine) EasyEngine makes it greatly easy to manage nginx, a fast web-server software that consumes little memory when handling increasing volumes of concurrent users. From 8a3e800467de2b8537f58eb6125dd74face8dfb8 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Thu, 2 Sep 2021 16:34:20 +0530 Subject: [PATCH 0830/1044] Remove migration retrigger prevention --- php/EE/Migration/Executor.php | 1 - php/EE/Runner.php | 17 ----------------- 2 files changed, 18 deletions(-) diff --git a/php/EE/Migration/Executor.php b/php/EE/Migration/Executor.php index 8ef7afae6..249e00df9 100644 --- a/php/EE/Migration/Executor.php +++ b/php/EE/Migration/Executor.php @@ -30,7 +30,6 @@ public static function execute_migrations() { self::execute_migration_stack( $migrations ); } catch ( \Throwable $e ) { Utils\delem_log( 'ee migration ended abruptly' ); - EE::get_cache()->remove( 'migration_running' ); exit( 1 ); } diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 1551b1536..8e608b315 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -868,26 +868,11 @@ private function auto_check_update() { */ private function maybe_trigger_migration() { - $cache = EE::get_cache(); - - /** - * Below condition ensures that running EE::launch() or runcommand() - * in migration file does not trigget migration again. - */ - if ( $cache->read( 'migration_running' ) ) { - EE::debug( 'Not triggering migrations since they seems to already been running.' ); - return; - } - - $cache->write( 'migration_running', true ); - $db_version = Option::get( 'version' ); $current_version = EE_VERSION; if ( ! $db_version ) { $this->trigger_migration( $current_version ); - $cache->remove( 'migration_running' ); - return; } @@ -913,8 +898,6 @@ private function maybe_trigger_migration() { } elseif ( false !== strpos( $current_version, 'nightly' ) ) { $this->trigger_migration( $current_version ); } - - $cache->remove( 'migration_running' ); } private function trigger_migration( $version ) { From c0a55b6bdc1af0985df222cae1bc99de0680b007 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Fri, 10 Sep 2021 16:04:27 +0530 Subject: [PATCH 0831/1044] Create SECURITY.md --- SECURITY.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 SECURITY.md diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 000000000..d9d9c2591 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,27 @@ +## Security + +EasyEngine takes the security of our software products seriously, which includes all source code repositories managed through our GitHub organizations. + +If you believe you have found a security vulnerability in any EasyEngine repository, please report it to us at sys@rtcamp.com. + +## Reporting Security Issues + +**Please do not report security vulnerabilities through public GitHub issues.** + +You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. + +Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: + + * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) + * Full paths of source file(s) related to the manifestation of the issue + * The location of the affected source code (tag/branch/commit or direct URL) + * Any special configuration required to reproduce the issue + * Step-by-step instructions to reproduce the issue + * Proof-of-concept or exploit code (if possible) + * Impact of the issue, including how an attacker might exploit the issue + +This information will help us triage your report more quickly. + +## Preferred Languages + +We prefer all communications to be in English. From 98d657377c568eeb187704e06089c999172ed28c Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Fri, 10 Sep 2021 16:10:57 +0530 Subject: [PATCH 0832/1044] Update SECURITY.md --- SECURITY.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SECURITY.md b/SECURITY.md index d9d9c2591..ce609565d 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -2,7 +2,7 @@ EasyEngine takes the security of our software products seriously, which includes all source code repositories managed through our GitHub organizations. -If you believe you have found a security vulnerability in any EasyEngine repository, please report it to us at sys@rtcamp.com. +If you believe you have found a security vulnerability in any EasyEngine repository, please report it to us at sys+gh@rtcamp.com. ## Reporting Security Issues From 68ecbbfa9e30ef45f8f28a364e3920956e7b87ae Mon Sep 17 00:00:00 2001 From: Danish Shakeel <danishshakeel54@gmail.com> Date: Mon, 27 Sep 2021 17:04:03 +0530 Subject: [PATCH 0833/1044] Fix typos --- .github/CONTRIBUTING.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 457de7a5b..6c6403151 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,12 +1,12 @@ # Community Guidelines -This guide details how to get involve in EasyEngine commmunity. Please read this carefully. +This guide details how to get involved in EasyEngine commmunity. Please read this carefully. ## How to get help? -Please attach the output of following command when open a new support request. +Please attach the output of following commands when opening a new support request. ```bash lsb_release -a @@ -19,16 +19,16 @@ wp --allow-root --info For free support, please use - http://community.rtcamp.com/c/easyengine -Please do NOT clutter github issue tracker here with support requests. It hampers development speed of this project. +Please do NOT clutter GitHub issue tracker here with support requests. It hampers development speed of this project. ### Pull Requests -When submitting your code please follow this coding standerds - http://docs.rtcamp.com/easyengine/dev/python/ +When submitting your code, please follow these coding standards - http://docs.rtcamp.com/easyengine/dev/python/ ### EasyEngine Chat -Developer & contributor discussion: https://gitter.im/rtCamp/easyengine +Developers & contributors discussion: https://gitter.im/rtCamp/easyengine -Please do NOT use chat for technical support. Chat is limited to developer & contributor disucssion related to EasyEngine future. +Please do NOT use chat for technical support. Chat is limited to developers & contributors disucssion related to EasyEngine's future. From a768f494eed40d0eacc092572bab0e6cbf888e49 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Oct 2021 20:59:48 +0000 Subject: [PATCH 0834/1044] Bump composer/composer from 2.0.13 to 2.1.9 Bumps [composer/composer](https://github.com/composer/composer) from 2.0.13 to 2.1.9. - [Release notes](https://github.com/composer/composer/releases) - [Changelog](https://github.com/composer/composer/blob/master/CHANGELOG.md) - [Commits](https://github.com/composer/composer/compare/2.0.13...2.1.9) --- updated-dependencies: - dependency-name: composer/composer dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> --- composer.json | 2 +- composer.lock | 174 ++++++++++++++++++++++++++------------------------ 2 files changed, 90 insertions(+), 86 deletions(-) diff --git a/composer.json b/composer.json index 10f11ffa3..aa8c13e63 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ "prefer-stable": true, "require": { "php": ">=7.0", - "composer/composer": "2.0.13", + "composer/composer": "2.1.9", "composer/semver": "3.2.4", "easyengine/admin-tools-command": "v1.1.0", "easyengine/auth-command": "v1.1.0", diff --git a/composer.lock b/composer.lock index 2fba1038e..7bec3d6cf 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": "dcbbd53c4d59746eabb3cd49a4c3e644", + "content-hash": "20cbdbc1569130159ca7ce2fba2990ca", "packages": [ { "name": "acmephp/core", @@ -198,16 +198,16 @@ }, { "name": "composer/ca-bundle", - "version": "1.2.10", + "version": "1.2.11", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "9fdb22c2e97a614657716178093cd1da90a64aa8" + "reference": "0b072d51c5a9c6f3412f7ea3ab043d6603cb2582" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/9fdb22c2e97a614657716178093cd1da90a64aa8", - "reference": "9fdb22c2e97a614657716178093cd1da90a64aa8", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/0b072d51c5a9c6f3412f7ea3ab043d6603cb2582", + "reference": "0b072d51c5a9c6f3412f7ea3ab043d6603cb2582", "shasum": "" }, "require": { @@ -219,7 +219,7 @@ "phpstan/phpstan": "^0.12.55", "psr/log": "^1.0", "symfony/phpunit-bridge": "^4.2 || ^5", - "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0" + "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0 || ^6.0" }, "type": "library", "extra": { @@ -254,7 +254,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.2.10" + "source": "https://github.com/composer/ca-bundle/tree/1.2.11" }, "funding": [ { @@ -270,20 +270,20 @@ "type": "tidelift" } ], - "time": "2021-06-07T13:58:28+00:00" + "time": "2021-09-25T20:32:43+00:00" }, { "name": "composer/composer", - "version": "2.0.13", + "version": "2.1.9", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "986e8b86b7b570632ad0a905c3726c33dd4c0efb" + "reference": "e558c88f28d102d497adec4852802c0dc14c7077" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/986e8b86b7b570632ad0a905c3726c33dd4c0efb", - "reference": "986e8b86b7b570632ad0a905c3726c33dd4c0efb", + "url": "https://api.github.com/repos/composer/composer/zipball/e558c88f28d102d497adec4852802c0dc14c7077", + "reference": "e558c88f28d102d497adec4852802c0dc14c7077", "shasum": "" }, "require": { @@ -291,21 +291,21 @@ "composer/metadata-minifier": "^1.0", "composer/semver": "^3.0", "composer/spdx-licenses": "^1.2", - "composer/xdebug-handler": "^1.1", - "justinrainbow/json-schema": "^5.2.10", + "composer/xdebug-handler": "^2.0", + "justinrainbow/json-schema": "^5.2.11", "php": "^5.3.2 || ^7.0 || ^8.0", "psr/log": "^1.0", "react/promise": "^1.2 || ^2.7", "seld/jsonlint": "^1.4", "seld/phar-utils": "^1.0", - "symfony/console": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0", - "symfony/filesystem": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0", - "symfony/finder": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0", - "symfony/process": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0" + "symfony/console": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0", + "symfony/filesystem": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0", + "symfony/finder": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0", + "symfony/process": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0" }, "require-dev": { "phpspec/prophecy": "^1.10", - "symfony/phpunit-bridge": "^4.2 || ^5.0" + "symfony/phpunit-bridge": "^4.2 || ^5.0 || ^6.0" }, "suggest": { "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages", @@ -318,7 +318,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "2.1-dev" } }, "autoload": { @@ -350,9 +350,9 @@ "package" ], "support": { - "irc": "irc://irc.freenode.org/composer", + "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/composer/issues", - "source": "https://github.com/composer/composer/tree/2.0.13" + "source": "https://github.com/composer/composer/tree/2.1.9" }, "funding": [ { @@ -368,7 +368,7 @@ "type": "tidelift" } ], - "time": "2021-04-27T11:11:08+00:00" + "time": "2021-10-05T07:47:38+00:00" }, { "name": "composer/metadata-minifier", @@ -601,21 +601,21 @@ }, { "name": "composer/xdebug-handler", - "version": "1.4.6", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "f27e06cd9675801df441b3656569b328e04aa37c" + "reference": "84674dd3a7575ba617f5a76d7e9e29a7d3891339" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/f27e06cd9675801df441b3656569b328e04aa37c", - "reference": "f27e06cd9675801df441b3656569b328e04aa37c", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/84674dd3a7575ba617f5a76d7e9e29a7d3891339", + "reference": "84674dd3a7575ba617f5a76d7e9e29a7d3891339", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0", - "psr/log": "^1.0" + "psr/log": "^1 || ^2 || ^3" }, "require-dev": { "phpstan/phpstan": "^0.12.55", @@ -645,7 +645,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/1.4.6" + "source": "https://github.com/composer/xdebug-handler/tree/2.0.2" }, "funding": [ { @@ -661,7 +661,7 @@ "type": "tidelift" } ], - "time": "2021-03-25T17:01:18+00:00" + "time": "2021-07-31T17:03:58+00:00" }, { "name": "easyengine/admin-tools-command", @@ -1432,16 +1432,16 @@ }, { "name": "justinrainbow/json-schema", - "version": "5.2.10", + "version": "5.2.11", "source": { "type": "git", "url": "https://github.com/justinrainbow/json-schema.git", - "reference": "2ba9c8c862ecd5510ed16c6340aa9f6eadb4f31b" + "reference": "2ab6744b7296ded80f8cc4f9509abbff393399aa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/2ba9c8c862ecd5510ed16c6340aa9f6eadb4f31b", - "reference": "2ba9c8c862ecd5510ed16c6340aa9f6eadb4f31b", + "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/2ab6744b7296ded80f8cc4f9509abbff393399aa", + "reference": "2ab6744b7296ded80f8cc4f9509abbff393399aa", "shasum": "" }, "require": { @@ -1496,9 +1496,9 @@ ], "support": { "issues": "https://github.com/justinrainbow/json-schema/issues", - "source": "https://github.com/justinrainbow/json-schema/tree/5.2.10" + "source": "https://github.com/justinrainbow/json-schema/tree/5.2.11" }, - "time": "2020-05-27T16:41:55+00:00" + "time": "2021-07-22T09:24:00+00:00" }, { "name": "league/flysystem", @@ -2152,16 +2152,16 @@ }, { "name": "seld/phar-utils", - "version": "1.1.1", + "version": "1.1.2", "source": { "type": "git", "url": "https://github.com/Seldaek/phar-utils.git", - "reference": "8674b1d84ffb47cc59a101f5d5a3b61e87d23796" + "reference": "749042a2315705d2dfbbc59234dd9ceb22bf3ff0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/8674b1d84ffb47cc59a101f5d5a3b61e87d23796", - "reference": "8674b1d84ffb47cc59a101f5d5a3b61e87d23796", + "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/749042a2315705d2dfbbc59234dd9ceb22bf3ff0", + "reference": "749042a2315705d2dfbbc59234dd9ceb22bf3ff0", "shasum": "" }, "require": { @@ -2194,9 +2194,9 @@ ], "support": { "issues": "https://github.com/Seldaek/phar-utils/issues", - "source": "https://github.com/Seldaek/phar-utils/tree/master" + "source": "https://github.com/Seldaek/phar-utils/tree/1.1.2" }, - "time": "2020-07-07T18:42:57+00:00" + "time": "2021-08-19T21:01:38+00:00" }, { "name": "symfony/config", @@ -2277,36 +2277,37 @@ }, { "name": "symfony/console", - "version": "v4.4.26", + "version": "v4.4.30", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "9aa1eb46c1b12fada74dc0c529e93d1ccef22576" + "reference": "a3f7189a0665ee33b50e9e228c46f50f5acbed22" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/9aa1eb46c1b12fada74dc0c529e93d1ccef22576", - "reference": "9aa1eb46c1b12fada74dc0c529e93d1ccef22576", + "url": "https://api.github.com/repos/symfony/console/zipball/a3f7189a0665ee33b50e9e228c46f50f5acbed22", + "reference": "a3f7189a0665ee33b50e9e228c46f50f5acbed22", "shasum": "" }, "require": { "php": ">=7.1.3", "symfony/polyfill-mbstring": "~1.0", "symfony/polyfill-php73": "^1.8", - "symfony/polyfill-php80": "^1.15", + "symfony/polyfill-php80": "^1.16", "symfony/service-contracts": "^1.1|^2" }, "conflict": { + "psr/log": ">=3", "symfony/dependency-injection": "<3.4", "symfony/event-dispatcher": "<4.3|>=5", "symfony/lock": "<4.4", "symfony/process": "<3.3" }, "provide": { - "psr/log-implementation": "1.0" + "psr/log-implementation": "1.0|2.0" }, "require-dev": { - "psr/log": "~1.0", + "psr/log": "^1|^2", "symfony/config": "^3.4|^4.0|^5.0", "symfony/dependency-injection": "^3.4|^4.0|^5.0", "symfony/event-dispatcher": "^4.3", @@ -2346,7 +2347,7 @@ "description": "Eases the creation of beautiful and testable command line interfaces", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/console/tree/v4.4.26" + "source": "https://github.com/symfony/console/tree/v4.4.30" }, "funding": [ { @@ -2362,7 +2363,7 @@ "type": "tidelift" } ], - "time": "2021-06-06T09:12:27+00:00" + "time": "2021-08-25T19:27:26+00:00" }, { "name": "symfony/debug", @@ -2682,21 +2683,22 @@ }, { "name": "symfony/filesystem", - "version": "v4.4.26", + "version": "v4.4.27", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "a501126eb6ec9288a3434af01b3d4499ec1268a0" + "reference": "517fb795794faf29086a77d99eb8f35e457837a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/a501126eb6ec9288a3434af01b3d4499ec1268a0", - "reference": "a501126eb6ec9288a3434af01b3d4499ec1268a0", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/517fb795794faf29086a77d99eb8f35e457837a7", + "reference": "517fb795794faf29086a77d99eb8f35e457837a7", "shasum": "" }, "require": { "php": ">=7.1.3", - "symfony/polyfill-ctype": "~1.8" + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-php80": "^1.16" }, "type": "library", "autoload": { @@ -2724,7 +2726,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v4.4.26" + "source": "https://github.com/symfony/filesystem/tree/v4.4.27" }, "funding": [ { @@ -2740,24 +2742,25 @@ "type": "tidelift" } ], - "time": "2021-06-30T07:12:23+00:00" + "time": "2021-07-21T12:19:41+00:00" }, { "name": "symfony/finder", - "version": "v4.4.25", + "version": "v4.4.30", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "ed33314396d968a8936c95f5bd1b88bd3b3e94a3" + "reference": "70362f1e112280d75b30087c7598b837c1b468b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/ed33314396d968a8936c95f5bd1b88bd3b3e94a3", - "reference": "ed33314396d968a8936c95f5bd1b88bd3b3e94a3", + "url": "https://api.github.com/repos/symfony/finder/zipball/70362f1e112280d75b30087c7598b837c1b468b6", + "reference": "70362f1e112280d75b30087c7598b837c1b468b6", "shasum": "" }, "require": { - "php": ">=7.1.3" + "php": ">=7.1.3", + "symfony/polyfill-php80": "^1.16" }, "type": "library", "autoload": { @@ -2785,7 +2788,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v4.4.25" + "source": "https://github.com/symfony/finder/tree/v4.4.30" }, "funding": [ { @@ -2801,7 +2804,7 @@ "type": "tidelift" } ], - "time": "2021-05-26T11:20:16+00:00" + "time": "2021-08-04T20:31:23+00:00" }, { "name": "symfony/polyfill-ctype", @@ -2884,16 +2887,16 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.23.0", + "version": "v1.23.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "2df51500adbaebdc4c38dea4c89a2e131c45c8a1" + "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/2df51500adbaebdc4c38dea4c89a2e131c45c8a1", - "reference": "2df51500adbaebdc4c38dea4c89a2e131c45c8a1", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6", + "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6", "shasum": "" }, "require": { @@ -2944,7 +2947,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1" }, "funding": [ { @@ -2960,7 +2963,7 @@ "type": "tidelift" } ], - "time": "2021-05-27T09:27:20+00:00" + "time": "2021-05-27T12:26:48+00:00" }, { "name": "symfony/polyfill-php73", @@ -3043,16 +3046,16 @@ }, { "name": "symfony/polyfill-php80", - "version": "v1.23.0", + "version": "v1.23.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0" + "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/eca0bf41ed421bed1b57c4958bab16aa86b757d0", - "reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be", + "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be", "shasum": "" }, "require": { @@ -3106,7 +3109,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1" }, "funding": [ { @@ -3122,7 +3125,7 @@ "type": "tidelift" } ], - "time": "2021-02-19T12:13:01+00:00" + "time": "2021-07-28T13:41:28+00:00" }, { "name": "symfony/polyfill-php81", @@ -3205,20 +3208,21 @@ }, { "name": "symfony/process", - "version": "v4.4.26", + "version": "v4.4.30", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "7e812c84c3f2dba173d311de6e510edf701685a8" + "reference": "13d3161ef63a8ec21eeccaaf9a4d7f784a87a97d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/7e812c84c3f2dba173d311de6e510edf701685a8", - "reference": "7e812c84c3f2dba173d311de6e510edf701685a8", + "url": "https://api.github.com/repos/symfony/process/zipball/13d3161ef63a8ec21eeccaaf9a4d7f784a87a97d", + "reference": "13d3161ef63a8ec21eeccaaf9a4d7f784a87a97d", "shasum": "" }, "require": { - "php": ">=7.1.3" + "php": ">=7.1.3", + "symfony/polyfill-php80": "^1.16" }, "type": "library", "autoload": { @@ -3246,7 +3250,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v4.4.26" + "source": "https://github.com/symfony/process/tree/v4.4.30" }, "funding": [ { @@ -3262,7 +3266,7 @@ "type": "tidelift" } ], - "time": "2021-06-09T14:57:04+00:00" + "time": "2021-08-04T20:31:23+00:00" }, { "name": "symfony/serializer", @@ -4693,5 +4697,5 @@ "platform-overrides": { "php": "7.3" }, - "plugin-api-version": "2.0.0" + "plugin-api-version": "2.1.0" } From 0832121e2cff97589cfe25d7905f12ad1fc8c67e Mon Sep 17 00:00:00 2001 From: unknown <ibrahim.wali@hotmail.com> Date: Sat, 23 Oct 2021 20:40:47 +0500 Subject: [PATCH 0835/1044] fixed some grammar and made readme more reader frandly --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 404ad15d7..046069463 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ EasyEngine makes it greatly easy to manage nginx, a fast web-server software tha ### Linux -For Linux, we have created an installer script which will install all the dependencies for you. We have tested this on Ubuntu 14.04, 16.04, 18.04 and Debian 8, Debian 10. +For Linux, we have created an installer script that will install all the dependencies for you. We have tested this on Ubuntu 14.04, 16.04, 18.04 and Debian 8, Debian 10. ```bash wget -qO ee https://rt.cx/ee4 && sudo bash ee @@ -92,15 +92,15 @@ Development of easyengine is done entirely on GitHub. We've used [wp-cli](https://github.com/wp-cli/wp-cli/) framework as a base and built EasyEngine on top of it. -This repo contains main core of easyengine (the framework). +This repo contains the main core of easyengine (the framework). All top level commands(except `ee cli`) i.e. `ee site`, `ee shell` have their own repos. -Currently we have following commands which are bundled by default in EasyEngine: +Currently, we have the following commands which are bundled by default in EasyEngine: * [site command](https://github.com/EasyEngine/site-command/) * [shell command](https://github.com/EasyEngine/shell-command/) -In future, community will be able to make their own packages and commands! +In future, the community will be able to make their own packages and commands! ## Contributing From 8ede78fa69603cccc322d8ed89c40e05603a25e8 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Tue, 26 Oct 2021 16:53:01 +0530 Subject: [PATCH 0836/1044] Add Ubuntu 20.04 in supported OS --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 404ad15d7..574ed96ec 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ EasyEngine makes it greatly easy to manage nginx, a fast web-server software tha ### Linux -For Linux, we have created an installer script which will install all the dependencies for you. We have tested this on Ubuntu 14.04, 16.04, 18.04 and Debian 8, Debian 10. +For Linux, we have created an installer script which will install all the dependencies for you. We have tested this on Ubuntu 14.04, 16.04, 18.04, 20.04 and Debian 8, Debian 10. ```bash wget -qO ee https://rt.cx/ee4 && sudo bash ee From 11030889b14f003b1da7f63c731584f9452664ab Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 2 Nov 2021 14:58:15 +0530 Subject: [PATCH 0837/1044] Update composer dependencies Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 12 +- composer.lock | 314 ++++++++++++++++++++++++++++++-------------------- 2 files changed, 196 insertions(+), 130 deletions(-) diff --git a/composer.json b/composer.json index aa8c13e63..ced95c67a 100644 --- a/composer.json +++ b/composer.json @@ -28,16 +28,16 @@ "composer/composer": "2.1.9", "composer/semver": "3.2.4", "easyengine/admin-tools-command": "v1.1.0", - "easyengine/auth-command": "v1.1.0", + "easyengine/auth-command": "v1.2.0", "easyengine/config-command": "v1.0.2", - "easyengine/cron-command": "v1.1.0", + "easyengine/cron-command": "v1.2.0", "easyengine/log-command": "v1.1.0", "easyengine/mailhog-command": "v1.0.2", - "easyengine/service-command": "v1.2.0", + "easyengine/service-command": "v1.3.0", "easyengine/shell-command": "v1.1.0", - "easyengine/site-command": "v2.8.2", - "easyengine/site-type-php": "v1.5.0", - "easyengine/site-type-wp": "v1.5.0", + "easyengine/site-command": "v2.9.0", + "easyengine/site-type-php": "v1.6.0", + "easyengine/site-type-wp": "v1.6.0", "monolog/monolog": "1.24.0", "mustache/mustache": "2.13.0", "rmccue/requests": "1.8.0", diff --git a/composer.lock b/composer.lock index 7bec3d6cf..2385e4519 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": "20cbdbc1569130159ca7ce2fba2990ca", + "content-hash": "6e933f17ddf9c89111a271f8acc62daa", "packages": [ { "name": "acmephp/core", @@ -198,16 +198,16 @@ }, { "name": "composer/ca-bundle", - "version": "1.2.11", + "version": "1.3.1", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "0b072d51c5a9c6f3412f7ea3ab043d6603cb2582" + "reference": "4c679186f2aca4ab6a0f1b0b9cf9252decb44d0b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/0b072d51c5a9c6f3412f7ea3ab043d6603cb2582", - "reference": "0b072d51c5a9c6f3412f7ea3ab043d6603cb2582", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/4c679186f2aca4ab6a0f1b0b9cf9252decb44d0b", + "reference": "4c679186f2aca4ab6a0f1b0b9cf9252decb44d0b", "shasum": "" }, "require": { @@ -254,7 +254,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.2.11" + "source": "https://github.com/composer/ca-bundle/tree/1.3.1" }, "funding": [ { @@ -270,7 +270,7 @@ "type": "tidelift" } ], - "time": "2021-09-25T20:32:43+00:00" + "time": "2021-10-28T20:44:15+00:00" }, { "name": "composer/composer", @@ -711,16 +711,16 @@ }, { "name": "easyengine/auth-command", - "version": "v1.1.0", + "version": "v1.2.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/auth-command.git", - "reference": "d73693f8d075af2ea1e501a25ace71931776ed8a" + "reference": "e08f7e01d3d73d0ea61f1adfb73249af19e88cb7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/auth-command/zipball/d73693f8d075af2ea1e501a25ace71931776ed8a", - "reference": "d73693f8d075af2ea1e501a25ace71931776ed8a", + "url": "https://api.github.com/repos/EasyEngine/auth-command/zipball/e08f7e01d3d73d0ea61f1adfb73249af19e88cb7", + "reference": "e08f7e01d3d73d0ea61f1adfb73249af19e88cb7", "shasum": "" }, "type": "ee-cli-package", @@ -755,9 +755,9 @@ "homepage": "https://github.com/easyengine/auth-command", "support": { "issues": "https://github.com/EasyEngine/auth-command/issues", - "source": "https://github.com/EasyEngine/auth-command/tree/v1.1.0" + "source": "https://github.com/EasyEngine/auth-command/tree/v1.2.0" }, - "time": "2021-06-16T14:29:10+00:00" + "time": "2021-11-02T09:18:13+00:00" }, { "name": "easyengine/config-command", @@ -807,16 +807,16 @@ }, { "name": "easyengine/cron-command", - "version": "v1.1.0", + "version": "v1.2.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/cron-command.git", - "reference": "4c22f4adab84bae5c5960eba9a258d2b8cad04fe" + "reference": "aa2e4ee3a8e0cf8b928cae9b50fb5d52808fcc24" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/cron-command/zipball/4c22f4adab84bae5c5960eba9a258d2b8cad04fe", - "reference": "4c22f4adab84bae5c5960eba9a258d2b8cad04fe", + "url": "https://api.github.com/repos/EasyEngine/cron-command/zipball/aa2e4ee3a8e0cf8b928cae9b50fb5d52808fcc24", + "reference": "aa2e4ee3a8e0cf8b928cae9b50fb5d52808fcc24", "shasum": "" }, "type": "ee-cli-package", @@ -852,9 +852,9 @@ "homepage": "https://github.com/easyengine/cron-command", "support": { "issues": "https://github.com/EasyEngine/cron-command/issues", - "source": "https://github.com/EasyEngine/cron-command/tree/v1.1.0" + "source": "https://github.com/EasyEngine/cron-command/tree/v1.2.0" }, - "time": "2021-06-16T14:22:17+00:00" + "time": "2021-11-02T09:18:46+00:00" }, { "name": "easyengine/log-command", @@ -948,16 +948,16 @@ }, { "name": "easyengine/service-command", - "version": "v1.2.0", + "version": "v1.3.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/service-command.git", - "reference": "94ecf05b8726b1ad31cba6b4d7eb3db1fb398128" + "reference": "2c426e12e6ee26458c398de5b8c341c2bdce3c43" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/94ecf05b8726b1ad31cba6b4d7eb3db1fb398128", - "reference": "94ecf05b8726b1ad31cba6b4d7eb3db1fb398128", + "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/2c426e12e6ee26458c398de5b8c341c2bdce3c43", + "reference": "2c426e12e6ee26458c398de5b8c341c2bdce3c43", "shasum": "" }, "type": "ee-cli-package", @@ -991,9 +991,9 @@ "homepage": "https://github.com/easyengine/service-command", "support": { "issues": "https://github.com/EasyEngine/service-command/issues", - "source": "https://github.com/EasyEngine/service-command/tree/v1.2.0" + "source": "https://github.com/EasyEngine/service-command/tree/v1.3.0" }, - "time": "2021-06-16T14:24:47+00:00" + "time": "2021-11-02T09:11:49+00:00" }, { "name": "easyengine/shell-command", @@ -1041,16 +1041,16 @@ }, { "name": "easyengine/site-command", - "version": "v2.8.2", + "version": "v2.9.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "aba31db217416d9cd696fa19fe0a947ca7bb084e" + "reference": "6a9664a7dbf3be7e2d461712ac9fac899619a7cc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/aba31db217416d9cd696fa19fe0a947ca7bb084e", - "reference": "aba31db217416d9cd696fa19fe0a947ca7bb084e", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/6a9664a7dbf3be7e2d461712ac9fac899619a7cc", + "reference": "6a9664a7dbf3be7e2d461712ac9fac899619a7cc", "shasum": "" }, "require": { @@ -1109,22 +1109,22 @@ "homepage": "https://github.com/easyengine/site-command", "support": { "issues": "https://github.com/EasyEngine/site-command/issues", - "source": "https://github.com/EasyEngine/site-command/tree/v2.8.2" + "source": "https://github.com/EasyEngine/site-command/tree/v2.9.0" }, - "time": "2021-06-30T11:15:41+00:00" + "time": "2021-11-02T09:17:02+00:00" }, { "name": "easyengine/site-type-php", - "version": "v1.5.0", + "version": "v1.6.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-php.git", - "reference": "637623fddb4ce30009f4e000c5eab89c7c12d9d0" + "reference": "42df81adb6c37b4d51766f94cfc005360ebf6085" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/637623fddb4ce30009f4e000c5eab89c7c12d9d0", - "reference": "637623fddb4ce30009f4e000c5eab89c7c12d9d0", + "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/42df81adb6c37b4d51766f94cfc005360ebf6085", + "reference": "42df81adb6c37b4d51766f94cfc005360ebf6085", "shasum": "" }, "require-dev": { @@ -1168,22 +1168,22 @@ "homepage": "https://github.com/easyengine/site-type-php", "support": { "issues": "https://github.com/EasyEngine/site-type-php/issues", - "source": "https://github.com/EasyEngine/site-type-php/tree/v1.5.0" + "source": "https://github.com/EasyEngine/site-type-php/tree/v1.6.0" }, - "time": "2021-06-28T10:58:23+00:00" + "time": "2021-11-02T09:16:12+00:00" }, { "name": "easyengine/site-type-wp", - "version": "v1.5.0", + "version": "v1.6.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-wp.git", - "reference": "8ef3d132c74dede5d4141020e4e2126fd8066a98" + "reference": "8a505759ad9161d365abd797adce24c2367e972b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/8ef3d132c74dede5d4141020e4e2126fd8066a98", - "reference": "8ef3d132c74dede5d4141020e4e2126fd8066a98", + "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/8a505759ad9161d365abd797adce24c2367e972b", + "reference": "8a505759ad9161d365abd797adce24c2367e972b", "shasum": "" }, "require-dev": { @@ -1227,9 +1227,9 @@ "homepage": "https://github.com/easyengine/site-type-wp", "support": { "issues": "https://github.com/EasyEngine/site-type-wp/issues", - "source": "https://github.com/EasyEngine/site-type-wp/tree/v1.5.0" + "source": "https://github.com/EasyEngine/site-type-wp/tree/v1.6.0" }, - "time": "2021-06-28T10:59:11+00:00" + "time": "2021-11-02T09:16:34+00:00" }, { "name": "guzzlehttp/guzzle", @@ -1302,16 +1302,16 @@ }, { "name": "guzzlehttp/promises", - "version": "1.4.1", + "version": "1.5.1", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d" + "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/8e7d04f1f6450fef59366c399cfad4b9383aa30d", - "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d", + "url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da", + "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da", "shasum": "" }, "require": { @@ -1323,7 +1323,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "1.5-dev" } }, "autoload": { @@ -1339,10 +1339,25 @@ "MIT" ], "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" } ], "description": "Guzzle promises library", @@ -1351,22 +1366,36 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/1.4.1" + "source": "https://github.com/guzzle/promises/tree/1.5.1" }, - "time": "2021-03-07T09:25:29+00:00" + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", + "type": "tidelift" + } + ], + "time": "2021-10-22T20:56:57+00:00" }, { "name": "guzzlehttp/psr7", - "version": "1.8.2", + "version": "1.8.3", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "dc960a912984efb74d0a90222870c72c87f10c91" + "reference": "1afdd860a2566ed3c2b0b4a3de6e23434a79ec85" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/dc960a912984efb74d0a90222870c72c87f10c91", - "reference": "dc960a912984efb74d0a90222870c72c87f10c91", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/1afdd860a2566ed3c2b0b4a3de6e23434a79ec85", + "reference": "1afdd860a2566ed3c2b0b4a3de6e23434a79ec85", "shasum": "" }, "require": { @@ -1403,13 +1432,34 @@ "MIT" ], "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, { "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", "homepage": "https://github.com/Tobion" } ], @@ -1426,9 +1476,23 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/1.8.2" + "source": "https://github.com/guzzle/psr7/tree/1.8.3" }, - "time": "2021-04-26T09:17:50+00:00" + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], + "time": "2021-10-05T13:56:00+00:00" }, { "name": "justinrainbow/json-schema", @@ -1596,16 +1660,16 @@ }, { "name": "league/mime-type-detection", - "version": "1.7.0", + "version": "1.8.0", "source": { "type": "git", "url": "https://github.com/thephpleague/mime-type-detection.git", - "reference": "3b9dff8aaf7323590c1d2e443db701eb1f9aa0d3" + "reference": "b38b25d7b372e9fddb00335400467b223349fd7e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/3b9dff8aaf7323590c1d2e443db701eb1f9aa0d3", - "reference": "3b9dff8aaf7323590c1d2e443db701eb1f9aa0d3", + "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/b38b25d7b372e9fddb00335400467b223349fd7e", + "reference": "b38b25d7b372e9fddb00335400467b223349fd7e", "shasum": "" }, "require": { @@ -1636,7 +1700,7 @@ "description": "Mime-type detection for Flysystem", "support": { "issues": "https://github.com/thephpleague/mime-type-detection/issues", - "source": "https://github.com/thephpleague/mime-type-detection/tree/1.7.0" + "source": "https://github.com/thephpleague/mime-type-detection/tree/1.8.0" }, "funding": [ { @@ -1648,7 +1712,7 @@ "type": "tidelift" } ], - "time": "2021-01-18T20:58:21+00:00" + "time": "2021-09-25T08:23:19+00:00" }, { "name": "monolog/monolog", @@ -2200,22 +2264,23 @@ }, { "name": "symfony/config", - "version": "v4.4.26", + "version": "v4.4.33", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "1cb26cdb8a9834d8494cadd284602fa0647b73e5" + "reference": "25c11934bf20c1633f3f125fed0bd7e29f5d8f24" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/1cb26cdb8a9834d8494cadd284602fa0647b73e5", - "reference": "1cb26cdb8a9834d8494cadd284602fa0647b73e5", + "url": "https://api.github.com/repos/symfony/config/zipball/25c11934bf20c1633f3f125fed0bd7e29f5d8f24", + "reference": "25c11934bf20c1633f3f125fed0bd7e29f5d8f24", "shasum": "" }, "require": { "php": ">=7.1.3", "symfony/filesystem": "^3.4|^4.0|^5.0", "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-php80": "^1.16", "symfony/polyfill-php81": "^1.22" }, "conflict": { @@ -2257,7 +2322,7 @@ "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/config/tree/v4.4.26" + "source": "https://github.com/symfony/config/tree/v4.4.33" }, "funding": [ { @@ -2273,20 +2338,20 @@ "type": "tidelift" } ], - "time": "2021-06-21T14:51:25+00:00" + "time": "2021-10-19T15:09:42+00:00" }, { "name": "symfony/console", - "version": "v4.4.30", + "version": "v4.4.33", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "a3f7189a0665ee33b50e9e228c46f50f5acbed22" + "reference": "8dbd23ef7a8884051482183ddee8d9061b5feed0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/a3f7189a0665ee33b50e9e228c46f50f5acbed22", - "reference": "a3f7189a0665ee33b50e9e228c46f50f5acbed22", + "url": "https://api.github.com/repos/symfony/console/zipball/8dbd23ef7a8884051482183ddee8d9061b5feed0", + "reference": "8dbd23ef7a8884051482183ddee8d9061b5feed0", "shasum": "" }, "require": { @@ -2347,7 +2412,7 @@ "description": "Eases the creation of beautiful and testable command line interfaces", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/console/tree/v4.4.30" + "source": "https://github.com/symfony/console/tree/v4.4.33" }, "funding": [ { @@ -2363,26 +2428,25 @@ "type": "tidelift" } ], - "time": "2021-08-25T19:27:26+00:00" + "time": "2021-10-25T16:36:08+00:00" }, { "name": "symfony/debug", - "version": "v4.4.25", + "version": "v4.4.31", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "a8d2d5c94438548bff9f998ca874e202bb29d07f" + "reference": "43ede438d4cb52cd589ae5dc070e9323866ba8e0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/a8d2d5c94438548bff9f998ca874e202bb29d07f", - "reference": "a8d2d5c94438548bff9f998ca874e202bb29d07f", + "url": "https://api.github.com/repos/symfony/debug/zipball/43ede438d4cb52cd589ae5dc070e9323866ba8e0", + "reference": "43ede438d4cb52cd589ae5dc070e9323866ba8e0", "shasum": "" }, "require": { "php": ">=7.1.3", - "psr/log": "~1.0", - "symfony/polyfill-php80": "^1.15" + "psr/log": "^1|^2|^3" }, "conflict": { "symfony/http-kernel": "<3.4" @@ -2416,7 +2480,7 @@ "description": "Provides tools to ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/debug/tree/v4.4.25" + "source": "https://github.com/symfony/debug/tree/v4.4.31" }, "funding": [ { @@ -2432,25 +2496,26 @@ "type": "tidelift" } ], - "time": "2021-05-26T17:39:37+00:00" + "time": "2021-09-24T13:30:14+00:00" }, { "name": "symfony/dependency-injection", - "version": "v4.4.26", + "version": "v4.4.33", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "a944d2f8e903dc99f5f1baf3eb74081352f0067f" + "reference": "ad364e599a4059db29c0aa424537e6ba668f54e6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/a944d2f8e903dc99f5f1baf3eb74081352f0067f", - "reference": "a944d2f8e903dc99f5f1baf3eb74081352f0067f", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/ad364e599a4059db29c0aa424537e6ba668f54e6", + "reference": "ad364e599a4059db29c0aa424537e6ba668f54e6", "shasum": "" }, "require": { "php": ">=7.1.3", "psr/container": "^1.0", + "symfony/polyfill-php80": "^1.16", "symfony/service-contracts": "^1.1.6|^2" }, "conflict": { @@ -2501,7 +2566,7 @@ "description": "Allows you to standardize and centralize the way objects are constructed in your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v4.4.26" + "source": "https://github.com/symfony/dependency-injection/tree/v4.4.33" }, "funding": [ { @@ -2517,25 +2582,26 @@ "type": "tidelift" } ], - "time": "2021-06-24T08:08:16+00:00" + "time": "2021-10-17T07:04:24+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v4.4.25", + "version": "v4.4.30", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "047773e7016e4fd45102cedf4bd2558ae0d0c32f" + "reference": "2fe81680070043c4c80e7cedceb797e34f377bac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/047773e7016e4fd45102cedf4bd2558ae0d0c32f", - "reference": "047773e7016e4fd45102cedf4bd2558ae0d0c32f", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/2fe81680070043c4c80e7cedceb797e34f377bac", + "reference": "2fe81680070043c4c80e7cedceb797e34f377bac", "shasum": "" }, "require": { "php": ">=7.1.3", - "symfony/event-dispatcher-contracts": "^1.1" + "symfony/event-dispatcher-contracts": "^1.1", + "symfony/polyfill-php80": "^1.16" }, "conflict": { "symfony/dependency-injection": "<3.4" @@ -2545,7 +2611,7 @@ "symfony/event-dispatcher-implementation": "1.1" }, "require-dev": { - "psr/log": "~1.0", + "psr/log": "^1|^2|^3", "symfony/config": "^3.4|^4.0|^5.0", "symfony/dependency-injection": "^3.4|^4.0|^5.0", "symfony/error-handler": "~3.4|~4.4", @@ -2584,7 +2650,7 @@ "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/v4.4.25" + "source": "https://github.com/symfony/event-dispatcher/tree/v4.4.30" }, "funding": [ { @@ -2600,7 +2666,7 @@ "type": "tidelift" } ], - "time": "2021-05-26T17:39:37+00:00" + "time": "2021-08-04T20:31:23+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -3431,21 +3497,22 @@ }, { "name": "symfony/translation", - "version": "v4.4.26", + "version": "v4.4.32", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "2f7fa60b8d10ca71c30dc46b0870143183a8f131" + "reference": "db0ba1e85280d8ff11e38d53c70f8814d4d740f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/2f7fa60b8d10ca71c30dc46b0870143183a8f131", - "reference": "2f7fa60b8d10ca71c30dc46b0870143183a8f131", + "url": "https://api.github.com/repos/symfony/translation/zipball/db0ba1e85280d8ff11e38d53c70f8814d4d740f5", + "reference": "db0ba1e85280d8ff11e38d53c70f8814d4d740f5", "shasum": "" }, "require": { "php": ">=7.1.3", "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php80": "^1.16", "symfony/translation-contracts": "^1.1.6|^2" }, "conflict": { @@ -3458,7 +3525,7 @@ "symfony/translation-implementation": "1.0|2.0" }, "require-dev": { - "psr/log": "~1.0", + "psr/log": "^1|^2|^3", "symfony/config": "^3.4|^4.0|^5.0", "symfony/console": "^3.4|^4.0|^5.0", "symfony/dependency-injection": "^3.4|^4.0|^5.0", @@ -3499,7 +3566,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v4.4.26" + "source": "https://github.com/symfony/translation/tree/v4.4.32" }, "funding": [ { @@ -3515,7 +3582,7 @@ "type": "tidelift" } ], - "time": "2021-06-06T08:51:46+00:00" + "time": "2021-08-26T05:57:13+00:00" }, { "name": "symfony/translation-contracts", @@ -3597,16 +3664,16 @@ }, { "name": "symfony/yaml", - "version": "v4.4.26", + "version": "v4.4.29", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "e096ef4b4c4c9a2f72c2ac660f54352cd31c60f8" + "reference": "3abcc4db06d4e776825eaa3ed8ad924d5bc7432a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/e096ef4b4c4c9a2f72c2ac660f54352cd31c60f8", - "reference": "e096ef4b4c4c9a2f72c2ac660f54352cd31c60f8", + "url": "https://api.github.com/repos/symfony/yaml/zipball/3abcc4db06d4e776825eaa3ed8ad924d5bc7432a", + "reference": "3abcc4db06d4e776825eaa3ed8ad924d5bc7432a", "shasum": "" }, "require": { @@ -3648,7 +3715,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v4.4.26" + "source": "https://github.com/symfony/yaml/tree/v4.4.29" }, "funding": [ { @@ -3664,7 +3731,7 @@ "type": "tidelift" } ], - "time": "2021-06-23T19:06:53+00:00" + "time": "2021-07-27T16:19:30+00:00" }, { "name": "webmozart/assert", @@ -3917,25 +3984,24 @@ }, { "name": "behat/gherkin", - "version": "v4.8.0", + "version": "v4.9.0", "source": { "type": "git", "url": "https://github.com/Behat/Gherkin.git", - "reference": "2391482cd003dfdc36b679b27e9f5326bd656acd" + "reference": "0bc8d1e30e96183e4f36db9dc79caead300beff4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Behat/Gherkin/zipball/2391482cd003dfdc36b679b27e9f5326bd656acd", - "reference": "2391482cd003dfdc36b679b27e9f5326bd656acd", + "url": "https://api.github.com/repos/Behat/Gherkin/zipball/0bc8d1e30e96183e4f36db9dc79caead300beff4", + "reference": "0bc8d1e30e96183e4f36db9dc79caead300beff4", "shasum": "" }, "require": { "php": "~7.2|~8.0" }, "require-dev": { - "cucumber/cucumber": "dev-gherkin-16.0.0", + "cucumber/cucumber": "dev-gherkin-22.0.0", "phpunit/phpunit": "~8|~9", - "symfony/phpunit-bridge": "~3|~4|~5", "symfony/yaml": "~3|~4|~5" }, "suggest": { @@ -3944,7 +4010,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.4-dev" + "dev-master": "4.x-dev" } }, "autoload": { @@ -3975,9 +4041,9 @@ ], "support": { "issues": "https://github.com/Behat/Gherkin/issues", - "source": "https://github.com/Behat/Gherkin/tree/v4.8.0" + "source": "https://github.com/Behat/Gherkin/tree/v4.9.0" }, - "time": "2021-02-04T12:44:21+00:00" + "time": "2021-10-12T13:05:09+00:00" }, { "name": "behat/transliterator", @@ -4585,16 +4651,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.6.0", + "version": "3.6.1", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "ffced0d2c8fa8e6cdc4d695a743271fab6c38625" + "reference": "f268ca40d54617c6e06757f83f699775c9b3ff2e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ffced0d2c8fa8e6cdc4d695a743271fab6c38625", - "reference": "ffced0d2c8fa8e6cdc4d695a743271fab6c38625", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/f268ca40d54617c6e06757f83f699775c9b3ff2e", + "reference": "f268ca40d54617c6e06757f83f699775c9b3ff2e", "shasum": "" }, "require": { @@ -4637,7 +4703,7 @@ "source": "https://github.com/squizlabs/PHP_CodeSniffer", "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" }, - "time": "2021-04-09T00:54:41+00:00" + "time": "2021-10-11T04:00:11+00:00" }, { "name": "wp-coding-standards/wpcs", @@ -4697,5 +4763,5 @@ "platform-overrides": { "php": "7.3" }, - "plugin-api-version": "2.1.0" + "plugin-api-version": "2.0.0" } From e12cb797cbafe3f0ddb4ecf510a715095666d8c6 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 2 Nov 2021 14:58:32 +0530 Subject: [PATCH 0838/1044] Bump to version v4.4.0 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index f77856a6f..fdc669880 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.3.1 +4.4.0 From 12c78dc16280e1443af71f075bda54e97587efca Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 9 Nov 2021 10:38:47 +0530 Subject: [PATCH 0839/1044] Fix composer dependency in nightly Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- .github/workflows/test_and_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index 60269dc66..c9a85a528 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -48,7 +48,7 @@ jobs: composer install --no-dev --no-progress --no-interaction else sed -i 's/\(easyengine\/.*\):\ \".*\"/\1:\ \"dev-develop\"/' composer.json - composer update --prefer-dist --no-progress --no-interaction + composer update --prefer-dist --no-dev --no-progress --no-interaction fi - name: Setup EE version From b2ad5d64c23513f7410f631d5f11b3b5e987591e Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 9 Nov 2021 10:44:54 +0530 Subject: [PATCH 0840/1044] Add one time notice for MacOS for updating Docker daemon.json Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- php/EE/Runner.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 8e608b315..3fd8468fe 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -873,6 +873,17 @@ private function maybe_trigger_migration() { if ( ! $db_version ) { $this->trigger_migration( $current_version ); + EE::log( 'ee successfully setup.' ); + if ( IS_DARWIN ) { + EE::log( 'To create more than 27 sites follow these steps manually: ' . "\n" . + '1. Please open Docker Desktop and in taskbar, go to Preferences > Daemon > Advanced. ' . "\n" . + '2. If the file is empty, add the following:' . "\n" . + ' {' . "\n" . + '"default-address-pools": [{"base":"10.0.0.0/8","size":24}]' . "\n" . + ' }' . "\n" . + 'If the file already contains JSON, just add the key "default-address-pools": [{"base":"10.0.0.0/8","size":24}] being careful to add a comma to the end of the line if it is not the last line before the closing bracket.' . "\n" . + '3. Restart Docker' ); + } return; } From 438d176da885555d3064f464444961a018eb64cc Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 9 Nov 2021 10:45:42 +0530 Subject: [PATCH 0841/1044] Update composer dependencies Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 2 +- composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index ced95c67a..65f787f58 100644 --- a/composer.json +++ b/composer.json @@ -35,7 +35,7 @@ "easyengine/mailhog-command": "v1.0.2", "easyengine/service-command": "v1.3.0", "easyengine/shell-command": "v1.1.0", - "easyengine/site-command": "v2.9.0", + "easyengine/site-command": "v2.9.1", "easyengine/site-type-php": "v1.6.0", "easyengine/site-type-wp": "v1.6.0", "monolog/monolog": "1.24.0", diff --git a/composer.lock b/composer.lock index 2385e4519..b07a036b4 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": "6e933f17ddf9c89111a271f8acc62daa", + "content-hash": "8b66ff9176faffdc4d46633346f1707b", "packages": [ { "name": "acmephp/core", @@ -1041,16 +1041,16 @@ }, { "name": "easyengine/site-command", - "version": "v2.9.0", + "version": "v2.9.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "6a9664a7dbf3be7e2d461712ac9fac899619a7cc" + "reference": "fc6fb37891f49d8d68589baa9938ef98633c83b1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/6a9664a7dbf3be7e2d461712ac9fac899619a7cc", - "reference": "6a9664a7dbf3be7e2d461712ac9fac899619a7cc", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/fc6fb37891f49d8d68589baa9938ef98633c83b1", + "reference": "fc6fb37891f49d8d68589baa9938ef98633c83b1", "shasum": "" }, "require": { @@ -1109,9 +1109,9 @@ "homepage": "https://github.com/easyengine/site-command", "support": { "issues": "https://github.com/EasyEngine/site-command/issues", - "source": "https://github.com/EasyEngine/site-command/tree/v2.9.0" + "source": "https://github.com/EasyEngine/site-command/tree/v2.9.1" }, - "time": "2021-11-02T09:17:02+00:00" + "time": "2021-11-09T04:58:03+00:00" }, { "name": "easyengine/site-type-php", From c3c4c5cde22d4a6c8cb3da98aac6349ca3a67a15 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 9 Nov 2021 10:45:49 +0530 Subject: [PATCH 0842/1044] Bump to version v4.4.1 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index fdc669880..cca25a93c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.4.0 +4.4.1 From a26d5aa15777f1b6a5788dd99780a1968a49be3b Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Thu, 11 Nov 2021 13:51:17 +0530 Subject: [PATCH 0843/1044] Add polyfills in phar --- utils/make-phar.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/utils/make-phar.php b/utils/make-phar.php index 15c4f6f33..ea5dcdccd 100644 --- a/utils/make-phar.php +++ b/utils/make-phar.php @@ -171,6 +171,9 @@ function get_composer_versions( $current_version ) { ->in(EE_VENDOR_DIR . '/symfony/finder') ->in(EE_VENDOR_DIR . '/symfony/polyfill-mbstring') ->in(EE_VENDOR_DIR . '/symfony/polyfill-ctype') + ->in(EE_VENDOR_DIR . '/symfony/polyfill-php73') + ->in(EE_VENDOR_DIR . '/symfony/polyfill-php80') + ->in(EE_VENDOR_DIR . '/symfony/polyfill-php81') ->in(EE_VENDOR_DIR . '/monolog') ->in(EE_VENDOR_DIR . '/guzzlehttp') ->in(EE_VENDOR_DIR . '/ralouphie/getallheaders') From cba317e93b9760b007b090701ab010e7631e91ec Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Thu, 11 Nov 2021 14:38:48 +0530 Subject: [PATCH 0844/1044] Add polyfills in PSR4 autoloading --- utils/make-phar.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/make-phar.php b/utils/make-phar.php index ea5dcdccd..127fc5aa8 100644 --- a/utils/make-phar.php +++ b/utils/make-phar.php @@ -68,14 +68,14 @@ function add_file( $phar, $path ) { '\/nb\/oxymel\/', '-command\/src\/', '\/ee\/[^\n]+?-command\/', - '\/symfony\/(?!finder|polyfill-mbstring)[^\/]+\/', + '\/symfony\/(?!finder|polyfill-mbstring|polyfill-ctype|polyfill-php81|polyfill-php80|polyfill-php73)[^\/]+\/', '\/(?:dealerdirect|squizlabs|wimg)\/', ); } else { $strips = array( '\/(?:behat|gherkin)\/src\/', '\/phpunit\/', - '\/symfony\/(?!console|filesystem|finder|polyfill-mbstring|process|serializer|service-contracts)', + '\/symfony\/(?!console|filesystem|finder|polyfill-mbstring|polyfill-ctype|polyfill-php81|polyfill-php80|polyfill-php73|process|serializer|service-contracts)', '\/composer\/spdx-licenses\/', '\/Composer\/(?:Command\/|Compiler\.php|Console\/|Downloader\/Pear|Installer\/Pear|Question\/|Repository\/Pear|SelfUpdate\/)', '\/(?:dealerdirect|squizlabs|wimg)\/', From f0fe4f6570f1f5e29f68545a6bba7e0316ae1055 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 16 Nov 2021 09:49:46 +0530 Subject: [PATCH 0845/1044] Pin to docker-compose v1.29.2 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- .github/workflows/test_and_build.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index c9a85a528..5982c05fa 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -125,11 +125,8 @@ jobs: - name: Install docker-compose run: | - VERSION=$(curl --silent "https://api.github.com/repos/docker/compose/releases/latest" | - grep '"tag_name":' | - sed -E 's/.*"([^"]+)".*/\1/' - ) - sudo curl -L "https://github.com/docker/compose/releases/download/$VERSION/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose + curl -L https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose + chmod +x /usr/local/bin/docker-compose - name: Install dependencies run: | From 7537a4246ef52d6360333a26c4a5db05cf4138bd Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 16 Nov 2021 10:00:13 +0530 Subject: [PATCH 0846/1044] Fix permission issue in test Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- .github/workflows/test_and_build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index 5982c05fa..b4368edf6 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -125,8 +125,8 @@ jobs: - name: Install docker-compose run: | - curl -L https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose - chmod +x /usr/local/bin/docker-compose + sudo curl -L https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose + sudo chmod +x /usr/local/bin/docker-compose - name: Install dependencies run: | From 3dca583e33ebe23c4d55343113253b89380f49c2 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 16 Nov 2021 13:32:53 +0530 Subject: [PATCH 0847/1044] Update migration in accordance to site-limit update changes Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- php/EE/Migration/GlobalContainers.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/php/EE/Migration/GlobalContainers.php b/php/EE/Migration/GlobalContainers.php index b802cb544..d319e561a 100644 --- a/php/EE/Migration/GlobalContainers.php +++ b/php/EE/Migration/GlobalContainers.php @@ -164,8 +164,10 @@ public static function disable_support_containers() { } $command = \EE_DOCKER::docker_compose_with_custom() . ' --project-name=ee down'; - if ( ! EE::exec( $command ) ) { - throw new \Exception( 'Unable to remove support container.' ); - } + /** + * Return code can be 1 due to error in removing network. This is expected. + * TODO: Get a fix for global network / make them external so that the return code is not 1. + */ + EE::exec( $command ); } } From 9e906676239790c5570867c897226a49bf983349 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 16 Nov 2021 14:10:47 +0530 Subject: [PATCH 0848/1044] Update composer dependencies Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 8 ++++---- composer.lock | 50 +++++++++++++++++++++++++------------------------- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/composer.json b/composer.json index 65f787f58..6c9ec3566 100644 --- a/composer.json +++ b/composer.json @@ -33,11 +33,11 @@ "easyengine/cron-command": "v1.2.0", "easyengine/log-command": "v1.1.0", "easyengine/mailhog-command": "v1.0.2", - "easyengine/service-command": "v1.3.0", + "easyengine/service-command": "v1.3.1", "easyengine/shell-command": "v1.1.0", - "easyengine/site-command": "v2.9.1", - "easyengine/site-type-php": "v1.6.0", - "easyengine/site-type-wp": "v1.6.0", + "easyengine/site-command": "v2.9.2", + "easyengine/site-type-php": "v1.6.1", + "easyengine/site-type-wp": "v1.6.1", "monolog/monolog": "1.24.0", "mustache/mustache": "2.13.0", "rmccue/requests": "1.8.0", diff --git a/composer.lock b/composer.lock index b07a036b4..a3badb403 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": "8b66ff9176faffdc4d46633346f1707b", + "content-hash": "14abf4745d2516f7624b72dbe2093986", "packages": [ { "name": "acmephp/core", @@ -948,16 +948,16 @@ }, { "name": "easyengine/service-command", - "version": "v1.3.0", + "version": "v1.3.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/service-command.git", - "reference": "2c426e12e6ee26458c398de5b8c341c2bdce3c43" + "reference": "8ec16fe747c43948c72fd385efbf6c514da66ea4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/2c426e12e6ee26458c398de5b8c341c2bdce3c43", - "reference": "2c426e12e6ee26458c398de5b8c341c2bdce3c43", + "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/8ec16fe747c43948c72fd385efbf6c514da66ea4", + "reference": "8ec16fe747c43948c72fd385efbf6c514da66ea4", "shasum": "" }, "type": "ee-cli-package", @@ -991,9 +991,9 @@ "homepage": "https://github.com/easyengine/service-command", "support": { "issues": "https://github.com/EasyEngine/service-command/issues", - "source": "https://github.com/EasyEngine/service-command/tree/v1.3.0" + "source": "https://github.com/EasyEngine/service-command/tree/v1.3.1" }, - "time": "2021-11-02T09:11:49+00:00" + "time": "2021-11-16T08:30:54+00:00" }, { "name": "easyengine/shell-command", @@ -1041,16 +1041,16 @@ }, { "name": "easyengine/site-command", - "version": "v2.9.1", + "version": "v2.9.2", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "fc6fb37891f49d8d68589baa9938ef98633c83b1" + "reference": "1b318aa666de2feeb1b5901549d0f6a5222140a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/fc6fb37891f49d8d68589baa9938ef98633c83b1", - "reference": "fc6fb37891f49d8d68589baa9938ef98633c83b1", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/1b318aa666de2feeb1b5901549d0f6a5222140a4", + "reference": "1b318aa666de2feeb1b5901549d0f6a5222140a4", "shasum": "" }, "require": { @@ -1109,22 +1109,22 @@ "homepage": "https://github.com/easyengine/site-command", "support": { "issues": "https://github.com/EasyEngine/site-command/issues", - "source": "https://github.com/EasyEngine/site-command/tree/v2.9.1" + "source": "https://github.com/EasyEngine/site-command/tree/v2.9.2" }, - "time": "2021-11-09T04:58:03+00:00" + "time": "2021-11-16T08:31:48+00:00" }, { "name": "easyengine/site-type-php", - "version": "v1.6.0", + "version": "v1.6.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-php.git", - "reference": "42df81adb6c37b4d51766f94cfc005360ebf6085" + "reference": "207ff6b647f8b9f61266d86a1c7cc1a51b39aa6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/42df81adb6c37b4d51766f94cfc005360ebf6085", - "reference": "42df81adb6c37b4d51766f94cfc005360ebf6085", + "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/207ff6b647f8b9f61266d86a1c7cc1a51b39aa6a", + "reference": "207ff6b647f8b9f61266d86a1c7cc1a51b39aa6a", "shasum": "" }, "require-dev": { @@ -1168,22 +1168,22 @@ "homepage": "https://github.com/easyengine/site-type-php", "support": { "issues": "https://github.com/EasyEngine/site-type-php/issues", - "source": "https://github.com/EasyEngine/site-type-php/tree/v1.6.0" + "source": "https://github.com/EasyEngine/site-type-php/tree/v1.6.1" }, - "time": "2021-11-02T09:16:12+00:00" + "time": "2021-11-16T08:32:31+00:00" }, { "name": "easyengine/site-type-wp", - "version": "v1.6.0", + "version": "v1.6.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-wp.git", - "reference": "8a505759ad9161d365abd797adce24c2367e972b" + "reference": "e5067c54599e83a58017feb101f9d5585600899a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/8a505759ad9161d365abd797adce24c2367e972b", - "reference": "8a505759ad9161d365abd797adce24c2367e972b", + "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/e5067c54599e83a58017feb101f9d5585600899a", + "reference": "e5067c54599e83a58017feb101f9d5585600899a", "shasum": "" }, "require-dev": { @@ -1227,9 +1227,9 @@ "homepage": "https://github.com/easyengine/site-type-wp", "support": { "issues": "https://github.com/EasyEngine/site-type-wp/issues", - "source": "https://github.com/EasyEngine/site-type-wp/tree/v1.6.0" + "source": "https://github.com/EasyEngine/site-type-wp/tree/v1.6.1" }, - "time": "2021-11-02T09:16:34+00:00" + "time": "2021-11-16T08:32:26+00:00" }, { "name": "guzzlehttp/guzzle", From 0f0a77cade7f634cbf292f0a8f03695071daf3b3 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 16 Nov 2021 14:10:56 +0530 Subject: [PATCH 0849/1044] Bump to version v4.4.2 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index cca25a93c..1d068c6ec 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.4.1 +4.4.2 From bb7e7006de4e832501512fb8c572a13556b9872d Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 16 Nov 2021 16:04:59 +0530 Subject: [PATCH 0850/1044] Update redis to v6.2.6 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- img-versions.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/img-versions.json b/img-versions.json index 572a29381..949e20ba6 100644 --- a/img-versions.json +++ b/img-versions.json @@ -12,6 +12,6 @@ "easyengine/php7.4": "v4.3.0", "easyengine/php8.0": "v4.3.0", "easyengine/postfix": "v4.1.5", - "easyengine/redis": "v4.3.0", + "easyengine/redis": "v4.4.3", "easyengine/newrelic-daemon": "v4.3.0" } From 8857d7fce66be39e555d63b556d3ea9261b611e5 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 16 Nov 2021 22:22:46 +0530 Subject: [PATCH 0851/1044] Update composer dependencies Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 2 +- composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index 6c9ec3566..4910baf62 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,7 @@ "easyengine/cron-command": "v1.2.0", "easyengine/log-command": "v1.1.0", "easyengine/mailhog-command": "v1.0.2", - "easyengine/service-command": "v1.3.1", + "easyengine/service-command": "v1.3.2", "easyengine/shell-command": "v1.1.0", "easyengine/site-command": "v2.9.2", "easyengine/site-type-php": "v1.6.1", diff --git a/composer.lock b/composer.lock index a3badb403..9047aa787 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": "14abf4745d2516f7624b72dbe2093986", + "content-hash": "82fc57d7eed8b00ab10b80efe59948da", "packages": [ { "name": "acmephp/core", @@ -948,16 +948,16 @@ }, { "name": "easyengine/service-command", - "version": "v1.3.1", + "version": "v1.3.2", "source": { "type": "git", "url": "https://github.com/EasyEngine/service-command.git", - "reference": "8ec16fe747c43948c72fd385efbf6c514da66ea4" + "reference": "39a00f33f1c8ba4ca05137b9e1ebbbdeb9e17c4a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/8ec16fe747c43948c72fd385efbf6c514da66ea4", - "reference": "8ec16fe747c43948c72fd385efbf6c514da66ea4", + "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/39a00f33f1c8ba4ca05137b9e1ebbbdeb9e17c4a", + "reference": "39a00f33f1c8ba4ca05137b9e1ebbbdeb9e17c4a", "shasum": "" }, "type": "ee-cli-package", @@ -991,9 +991,9 @@ "homepage": "https://github.com/easyengine/service-command", "support": { "issues": "https://github.com/EasyEngine/service-command/issues", - "source": "https://github.com/EasyEngine/service-command/tree/v1.3.1" + "source": "https://github.com/EasyEngine/service-command/tree/v1.3.2" }, - "time": "2021-11-16T08:30:54+00:00" + "time": "2021-11-16T16:45:59+00:00" }, { "name": "easyengine/shell-command", From 38f7cf9bb564704952b1bf310e37beb31a48f5e0 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Wed, 17 Nov 2021 12:35:31 +0530 Subject: [PATCH 0852/1044] Bump to version v4.4.3 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 1d068c6ec..9e3a93350 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.4.2 +4.4.3 From 32fdfb04af1dfbe6ebb9fba38399027eebf2bf81 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Fri, 19 Nov 2021 17:53:29 +0530 Subject: [PATCH 0853/1044] Update forum link in issue template --- .github/ISSUE_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 633ce175d..5c7a16529 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,4 +1,4 @@ -This issue tracker is only for issues related to EasyEngine. Please use http://community.rtcamp.com/c/easyengine for support questions. +This issue tracker is only for issues related to EasyEngine. Please use https://github.com/EasyEngine/easyengine/discussions for support questions. If you feel the issue is a EasyEngine specific issue, please attach the output of the following commands. From 0847534d69d836d85d6ffef0119e132fd06a23b9 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Tue, 30 Nov 2021 18:26:03 +0530 Subject: [PATCH 0854/1044] Add rollback in case site clone fails --- php/EE/RevertableStepProcessor.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/php/EE/RevertableStepProcessor.php b/php/EE/RevertableStepProcessor.php index 993062eb0..2dfa2dad6 100644 --- a/php/EE/RevertableStepProcessor.php +++ b/php/EE/RevertableStepProcessor.php @@ -75,6 +75,10 @@ public function execute() { */ public function rollback() { while ( $this->execution_index >= 0 ) { + if ( ! array_key_exists( $this->execution_index, $this->steps ) ) { + $this->execution_index--; + continue; + } $step = $this->steps[ $this->execution_index ]; $context = $step['context']; try { From 742671e5a68e7721da34cfe6cee66b0307bea6d9 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar <kirtangajjar95@gmail.com> Date: Thu, 2 Dec 2021 17:43:41 +0530 Subject: [PATCH 0855/1044] Add variable to hide error message --- php/EE/RevertableStepProcessor.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/php/EE/RevertableStepProcessor.php b/php/EE/RevertableStepProcessor.php index 2dfa2dad6..fde925787 100644 --- a/php/EE/RevertableStepProcessor.php +++ b/php/EE/RevertableStepProcessor.php @@ -46,7 +46,7 @@ public function add_step( string $context, callable $up_step, callable $down_ste * * @return boolean Returns if the pending steps were executed successfully. */ - public function execute() { + public function execute( $show_error = true ) { $steps_to_execute = array_slice( $this->steps, $this->execution_index ); foreach ( $steps_to_execute as $step ) { @@ -59,7 +59,9 @@ public function execute() { } catch ( \Exception $e ) { $exception_message = $e->getMessage(); $callable = EE\Utils\get_callable_name( $step['up'] ); - EE::error( "Encountered error while processing $context in $callable. Exception: $exception_message", false ); + if ( $show_error ) { + EE::error( "Error while executing $context. $callable: $exception_message", false ); + } $this->rollback(); $this->steps = []; From 44417b9c974598761714875872e85583afcc1eb5 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 7 Dec 2021 12:30:11 +0530 Subject: [PATCH 0856/1044] Remove Nginx proxy id fecthing Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- php/EE/Migration/GlobalContainers.php | 6 +----- php/EE/Runner.php | 12 +----------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/php/EE/Migration/GlobalContainers.php b/php/EE/Migration/GlobalContainers.php index d319e561a..f6f33d054 100644 --- a/php/EE/Migration/GlobalContainers.php +++ b/php/EE/Migration/GlobalContainers.php @@ -129,12 +129,8 @@ public static function global_service_down( $service_name ) { */ public static function get_all_global_images_with_service_name() { - $launch = EE::launch( sprintf( 'docker ps -f "id=%s" --format={{.Names}}', EE_PROXY_TYPE ) ); - if ( 0 === $launch->return_code ) { - $nginx_proxy = trim( $launch->stdout ); - } return [ - 'easyengine/nginx-proxy' => $nginx_proxy, + 'easyengine/nginx-proxy' => GLOBAL_PROXY_CONTAINER, 'easyengine/mariadb' => GLOBAL_DB_CONTAINER, 'easyengine/redis' => GLOBAL_REDIS_CONTAINER, // 'easyengine/cron' => EE_CRON_SCHEDULER, //TODO: Add it to global docker-compose. diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 3fd8468fe..42d2d51be 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -69,22 +69,12 @@ private function init_ee() { $check_requirements = ( [ 'site', 'cmd-dump' ] === $this->arguments ) ? false : $check_requirements; } - $nginx_proxy = 'services_global-nginx-proxy_1'; + define( 'EE_PROXY_TYPE', 'services_global-nginx-proxy_1' ); if ( $check_requirements ) { - $launch = EE::launch( sprintf( 'cd %s && docker ps -q --no-trunc | grep $(docker-compose ps -q global-nginx-proxy)', EE_SERVICE_DIR ) ); - if ( 0 === $launch->return_code ) { - $nginx_proxy = trim( $launch->stdout ); - } - define( 'EE_PROXY_TYPE', $nginx_proxy ); - $this->check_requirements(); $this->maybe_trigger_migration(); } - if ( ! defined( 'EE_PROXY_TYPE' ) ) { - define('EE_PROXY_TYPE', $nginx_proxy); - } - if ( [ 'cli', 'info' ] === $this->arguments && $this->check_requirements( false ) ) { $this->maybe_trigger_migration(); } From b1c8e6e710265dd9ac8557e6f21dfd5e5323b0ad Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 7 Dec 2021 12:34:34 +0530 Subject: [PATCH 0857/1044] Update Nginx and PHP images Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- img-versions.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/img-versions.json b/img-versions.json index 949e20ba6..6a6e0c71e 100644 --- a/img-versions.json +++ b/img-versions.json @@ -2,15 +2,15 @@ "easyengine/cron": "v4.0.0", "easyengine/mailhog": "v4.0.0", "easyengine/mariadb": "v4.1.3", - "easyengine/nginx-proxy": "v4.3.0", - "easyengine/nginx": "v4.3.0", - "easyengine/php": "v4.3.0", + "easyengine/nginx-proxy": "v4.5.0", + "easyengine/nginx": "v4.5.0", + "easyengine/php": "v4.5.0", "easyengine/php5.6": "v4.0.0", "easyengine/php7.0": "v4.1.7", "easyengine/php7.2": "v4.1.7", - "easyengine/php7.3": "v4.3.0", - "easyengine/php7.4": "v4.3.0", - "easyengine/php8.0": "v4.3.0", + "easyengine/php7.3": "v4.5.0", + "easyengine/php7.4": "v4.5.0", + "easyengine/php8.0": "v4.5.0", "easyengine/postfix": "v4.1.5", "easyengine/redis": "v4.4.3", "easyengine/newrelic-daemon": "v4.3.0" From 23a45442ba79d8e664f1f0cbfd0d4ff80aa8a1ac Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 7 Dec 2021 12:46:04 +0530 Subject: [PATCH 0858/1044] Add PHP 8.1 in test Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- .github/workflows/test_and_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index b4368edf6..6ee90b07b 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -90,7 +90,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.2', '7.3', '7.4', '8.0'] + php: ['7.2', '7.3', '7.4', '8.0', '8.1'] steps: - name: Check out source code uses: actions/checkout@v2 From e2d2aadd6752cb97f236a2d632f04cb14737c25f Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 7 Dec 2021 15:24:23 +0530 Subject: [PATCH 0859/1044] Update composer packages Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 4 +- composer.lock | 270 ++++++++++++++++++++++++++++++++------------------ 2 files changed, 174 insertions(+), 100 deletions(-) diff --git a/composer.json b/composer.json index 4910baf62..2bcce03eb 100644 --- a/composer.json +++ b/composer.json @@ -33,9 +33,9 @@ "easyengine/cron-command": "v1.2.0", "easyengine/log-command": "v1.1.0", "easyengine/mailhog-command": "v1.0.2", - "easyengine/service-command": "v1.3.2", + "easyengine/service-command": "v1.4.0", "easyengine/shell-command": "v1.1.0", - "easyengine/site-command": "v2.9.2", + "easyengine/site-command": "v3.0.0", "easyengine/site-type-php": "v1.6.1", "easyengine/site-type-wp": "v1.6.1", "monolog/monolog": "1.24.0", diff --git a/composer.lock b/composer.lock index 9047aa787..2fd018e7a 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": "82fc57d7eed8b00ab10b80efe59948da", + "content-hash": "54e4c473bac2da41f02b44fa9184aaef", "packages": [ { "name": "acmephp/core", @@ -522,23 +522,24 @@ }, { "name": "composer/spdx-licenses", - "version": "1.5.5", + "version": "1.5.6", "source": { "type": "git", "url": "https://github.com/composer/spdx-licenses.git", - "reference": "de30328a7af8680efdc03e396aad24befd513200" + "reference": "a30d487169d799745ca7280bc90fdfa693536901" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/de30328a7af8680efdc03e396aad24befd513200", - "reference": "de30328a7af8680efdc03e396aad24befd513200", + "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/a30d487169d799745ca7280bc90fdfa693536901", + "reference": "a30d487169d799745ca7280bc90fdfa693536901", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 7" + "phpstan/phpstan": "^0.12.55", + "symfony/phpunit-bridge": "^4.2 || ^5" }, "type": "library", "extra": { @@ -581,7 +582,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/spdx-licenses/issues", - "source": "https://github.com/composer/spdx-licenses/tree/1.5.5" + "source": "https://github.com/composer/spdx-licenses/tree/1.5.6" }, "funding": [ { @@ -597,7 +598,7 @@ "type": "tidelift" } ], - "time": "2020-12-03T16:04:16+00:00" + "time": "2021-11-18T10:14:14+00:00" }, { "name": "composer/xdebug-handler", @@ -948,16 +949,16 @@ }, { "name": "easyengine/service-command", - "version": "v1.3.2", + "version": "v1.4.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/service-command.git", - "reference": "39a00f33f1c8ba4ca05137b9e1ebbbdeb9e17c4a" + "reference": "0ae9ab240ddf50e9157c8ab4b0cb8646de694b08" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/39a00f33f1c8ba4ca05137b9e1ebbbdeb9e17c4a", - "reference": "39a00f33f1c8ba4ca05137b9e1ebbbdeb9e17c4a", + "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/0ae9ab240ddf50e9157c8ab4b0cb8646de694b08", + "reference": "0ae9ab240ddf50e9157c8ab4b0cb8646de694b08", "shasum": "" }, "type": "ee-cli-package", @@ -991,9 +992,9 @@ "homepage": "https://github.com/easyengine/service-command", "support": { "issues": "https://github.com/EasyEngine/service-command/issues", - "source": "https://github.com/EasyEngine/service-command/tree/v1.3.2" + "source": "https://github.com/EasyEngine/service-command/tree/v1.4.0" }, - "time": "2021-11-16T16:45:59+00:00" + "time": "2021-12-07T09:34:46+00:00" }, { "name": "easyengine/shell-command", @@ -1041,16 +1042,16 @@ }, { "name": "easyengine/site-command", - "version": "v2.9.2", + "version": "v3.0.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "1b318aa666de2feeb1b5901549d0f6a5222140a4" + "reference": "5e20ed466cacfee163d247aacf5cce8626239cbf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/1b318aa666de2feeb1b5901549d0f6a5222140a4", - "reference": "1b318aa666de2feeb1b5901549d0f6a5222140a4", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/5e20ed466cacfee163d247aacf5cce8626239cbf", + "reference": "5e20ed466cacfee163d247aacf5cce8626239cbf", "shasum": "" }, "require": { @@ -1099,7 +1100,9 @@ "src/helper/SimpleDnsCloudflareSolver.php", "src/helper/Site_Self_Signed.php", "src/helper/Site_Letsencrypt.php", - "src/helper/Shutdown_Handler.php" + "src/helper/Shutdown_Handler.php", + "src/clone/Cloner.php", + "src/clone/clone-utils.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -1109,9 +1112,9 @@ "homepage": "https://github.com/easyengine/site-command", "support": { "issues": "https://github.com/EasyEngine/site-command/issues", - "source": "https://github.com/EasyEngine/site-command/tree/v2.9.2" + "source": "https://github.com/EasyEngine/site-command/tree/v3.0.0" }, - "time": "2021-11-16T08:31:48+00:00" + "time": "2021-12-07T09:35:14+00:00" }, { "name": "easyengine/site-type-php", @@ -1660,16 +1663,16 @@ }, { "name": "league/mime-type-detection", - "version": "1.8.0", + "version": "1.9.0", "source": { "type": "git", "url": "https://github.com/thephpleague/mime-type-detection.git", - "reference": "b38b25d7b372e9fddb00335400467b223349fd7e" + "reference": "aa70e813a6ad3d1558fc927863d47309b4c23e69" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/b38b25d7b372e9fddb00335400467b223349fd7e", - "reference": "b38b25d7b372e9fddb00335400467b223349fd7e", + "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/aa70e813a6ad3d1558fc927863d47309b4c23e69", + "reference": "aa70e813a6ad3d1558fc927863d47309b4c23e69", "shasum": "" }, "require": { @@ -1677,7 +1680,7 @@ "php": "^7.2 || ^8.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.18", + "friendsofphp/php-cs-fixer": "^3.2", "phpstan/phpstan": "^0.12.68", "phpunit/phpunit": "^8.5.8 || ^9.3" }, @@ -1700,7 +1703,7 @@ "description": "Mime-type detection for Flysystem", "support": { "issues": "https://github.com/thephpleague/mime-type-detection/issues", - "source": "https://github.com/thephpleague/mime-type-detection/tree/1.8.0" + "source": "https://github.com/thephpleague/mime-type-detection/tree/1.9.0" }, "funding": [ { @@ -1712,7 +1715,7 @@ "type": "tidelift" } ], - "time": "2021-09-25T08:23:19+00:00" + "time": "2021-11-21T11:48:40+00:00" }, { "name": "monolog/monolog", @@ -2264,16 +2267,16 @@ }, { "name": "symfony/config", - "version": "v4.4.33", + "version": "v4.4.34", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "25c11934bf20c1633f3f125fed0bd7e29f5d8f24" + "reference": "e99b65a18faa34fde57078095c39a1bc91a22492" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/25c11934bf20c1633f3f125fed0bd7e29f5d8f24", - "reference": "25c11934bf20c1633f3f125fed0bd7e29f5d8f24", + "url": "https://api.github.com/repos/symfony/config/zipball/e99b65a18faa34fde57078095c39a1bc91a22492", + "reference": "e99b65a18faa34fde57078095c39a1bc91a22492", "shasum": "" }, "require": { @@ -2322,7 +2325,7 @@ "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/config/tree/v4.4.33" + "source": "https://github.com/symfony/config/tree/v4.4.34" }, "funding": [ { @@ -2338,20 +2341,20 @@ "type": "tidelift" } ], - "time": "2021-10-19T15:09:42+00:00" + "time": "2021-10-29T15:43:26+00:00" }, { "name": "symfony/console", - "version": "v4.4.33", + "version": "v4.4.34", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "8dbd23ef7a8884051482183ddee8d9061b5feed0" + "reference": "329b3a75cc6b16d435ba1b1a41df54a53382a3f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/8dbd23ef7a8884051482183ddee8d9061b5feed0", - "reference": "8dbd23ef7a8884051482183ddee8d9061b5feed0", + "url": "https://api.github.com/repos/symfony/console/zipball/329b3a75cc6b16d435ba1b1a41df54a53382a3f0", + "reference": "329b3a75cc6b16d435ba1b1a41df54a53382a3f0", "shasum": "" }, "require": { @@ -2412,7 +2415,7 @@ "description": "Eases the creation of beautiful and testable command line interfaces", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/console/tree/v4.4.33" + "source": "https://github.com/symfony/console/tree/v4.4.34" }, "funding": [ { @@ -2428,7 +2431,7 @@ "type": "tidelift" } ], - "time": "2021-10-25T16:36:08+00:00" + "time": "2021-11-04T12:23:33+00:00" }, { "name": "symfony/debug", @@ -2500,16 +2503,16 @@ }, { "name": "symfony/dependency-injection", - "version": "v4.4.33", + "version": "v4.4.34", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "ad364e599a4059db29c0aa424537e6ba668f54e6" + "reference": "117d7f132ed7efbd535ec947709d49bec1b9d24b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/ad364e599a4059db29c0aa424537e6ba668f54e6", - "reference": "ad364e599a4059db29c0aa424537e6ba668f54e6", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/117d7f132ed7efbd535ec947709d49bec1b9d24b", + "reference": "117d7f132ed7efbd535ec947709d49bec1b9d24b", "shasum": "" }, "require": { @@ -2566,7 +2569,7 @@ "description": "Allows you to standardize and centralize the way objects are constructed in your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v4.4.33" + "source": "https://github.com/symfony/dependency-injection/tree/v4.4.34" }, "funding": [ { @@ -2582,20 +2585,87 @@ "type": "tidelift" } ], - "time": "2021-10-17T07:04:24+00:00" + "time": "2021-11-15T14:42:25+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v2.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/6f981ee24cf69ee7ce9736146d1c57c2780598a8", + "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "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/v2.5.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": "2021-07-12T14:48:14+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v4.4.30", + "version": "v4.4.34", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "2fe81680070043c4c80e7cedceb797e34f377bac" + "reference": "1a024b45369c9d55d76b6b8a241bd20c9ea1cbd8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/2fe81680070043c4c80e7cedceb797e34f377bac", - "reference": "2fe81680070043c4c80e7cedceb797e34f377bac", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/1a024b45369c9d55d76b6b8a241bd20c9ea1cbd8", + "reference": "1a024b45369c9d55d76b6b8a241bd20c9ea1cbd8", "shasum": "" }, "require": { @@ -2650,7 +2720,7 @@ "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/v4.4.30" + "source": "https://github.com/symfony/event-dispatcher/tree/v4.4.34" }, "funding": [ { @@ -2666,20 +2736,20 @@ "type": "tidelift" } ], - "time": "2021-08-04T20:31:23+00:00" + "time": "2021-11-15T14:42:25+00:00" }, { "name": "symfony/event-dispatcher-contracts", - "version": "v1.1.9", + "version": "v1.1.11", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "84e23fdcd2517bf37aecbd16967e83f0caee25a7" + "reference": "01e9a4efac0ee33a05dfdf93b346f62e7d0e998c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/84e23fdcd2517bf37aecbd16967e83f0caee25a7", - "reference": "84e23fdcd2517bf37aecbd16967e83f0caee25a7", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/01e9a4efac0ee33a05dfdf93b346f62e7d0e998c", + "reference": "01e9a4efac0ee33a05dfdf93b346f62e7d0e998c", "shasum": "" }, "require": { @@ -2692,7 +2762,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-main": "1.1-dev" }, "thanks": { "name": "symfony/contracts", @@ -2729,7 +2799,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v1.1.9" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v1.1.11" }, "funding": [ { @@ -2745,7 +2815,7 @@ "type": "tidelift" } ], - "time": "2020-07-06T13:19:58+00:00" + "time": "2021-03-23T15:25:38+00:00" }, { "name": "symfony/filesystem", @@ -3274,16 +3344,16 @@ }, { "name": "symfony/process", - "version": "v4.4.30", + "version": "v4.4.35", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "13d3161ef63a8ec21eeccaaf9a4d7f784a87a97d" + "reference": "c2098705326addae6e6742151dfade47ac71da1b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/13d3161ef63a8ec21eeccaaf9a4d7f784a87a97d", - "reference": "13d3161ef63a8ec21eeccaaf9a4d7f784a87a97d", + "url": "https://api.github.com/repos/symfony/process/zipball/c2098705326addae6e6742151dfade47ac71da1b", + "reference": "c2098705326addae6e6742151dfade47ac71da1b", "shasum": "" }, "require": { @@ -3316,7 +3386,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v4.4.30" + "source": "https://github.com/symfony/process/tree/v4.4.35" }, "funding": [ { @@ -3332,7 +3402,7 @@ "type": "tidelift" } ], - "time": "2021-08-04T20:31:23+00:00" + "time": "2021-11-22T22:36:24+00:00" }, { "name": "symfony/serializer", @@ -3418,21 +3488,25 @@ }, { "name": "symfony/service-contracts", - "version": "v2.4.0", + "version": "v2.5.0", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb" + "reference": "1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb", - "reference": "f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc", + "reference": "1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc", "shasum": "" }, "require": { "php": ">=7.2.5", - "psr/container": "^1.1" + "psr/container": "^1.1", + "symfony/deprecation-contracts": "^2.1" + }, + "conflict": { + "ext-psr": "<1.1|>=2" }, "suggest": { "symfony/service-implementation": "" @@ -3440,7 +3514,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "2.4-dev" + "dev-main": "2.5-dev" }, "thanks": { "name": "symfony/contracts", @@ -3477,7 +3551,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v2.4.0" + "source": "https://github.com/symfony/service-contracts/tree/v2.5.0" }, "funding": [ { @@ -3493,20 +3567,20 @@ "type": "tidelift" } ], - "time": "2021-04-01T10:43:52+00:00" + "time": "2021-11-04T16:48:04+00:00" }, { "name": "symfony/translation", - "version": "v4.4.32", + "version": "v4.4.34", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "db0ba1e85280d8ff11e38d53c70f8814d4d740f5" + "reference": "26d330720627b234803595ecfc0191eeabc65190" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/db0ba1e85280d8ff11e38d53c70f8814d4d740f5", - "reference": "db0ba1e85280d8ff11e38d53c70f8814d4d740f5", + "url": "https://api.github.com/repos/symfony/translation/zipball/26d330720627b234803595ecfc0191eeabc65190", + "reference": "26d330720627b234803595ecfc0191eeabc65190", "shasum": "" }, "require": { @@ -3566,7 +3640,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v4.4.32" + "source": "https://github.com/symfony/translation/tree/v4.4.34" }, "funding": [ { @@ -3582,20 +3656,20 @@ "type": "tidelift" } ], - "time": "2021-08-26T05:57:13+00:00" + "time": "2021-11-04T12:23:33+00:00" }, { "name": "symfony/translation-contracts", - "version": "v2.4.0", + "version": "v2.5.0", "source": { "type": "git", "url": "https://github.com/symfony/translation-contracts.git", - "reference": "95c812666f3e91db75385749fe219c5e494c7f95" + "reference": "d28150f0f44ce854e942b671fc2620a98aae1b1e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/95c812666f3e91db75385749fe219c5e494c7f95", - "reference": "95c812666f3e91db75385749fe219c5e494c7f95", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/d28150f0f44ce854e942b671fc2620a98aae1b1e", + "reference": "d28150f0f44ce854e942b671fc2620a98aae1b1e", "shasum": "" }, "require": { @@ -3607,7 +3681,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "2.4-dev" + "dev-main": "2.5-dev" }, "thanks": { "name": "symfony/contracts", @@ -3644,7 +3718,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/translation-contracts/tree/v2.4.0" + "source": "https://github.com/symfony/translation-contracts/tree/v2.5.0" }, "funding": [ { @@ -3660,20 +3734,20 @@ "type": "tidelift" } ], - "time": "2021-03-23T23:28:01+00:00" + "time": "2021-08-17T14:20:01+00:00" }, { "name": "symfony/yaml", - "version": "v4.4.29", + "version": "v4.4.34", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "3abcc4db06d4e776825eaa3ed8ad924d5bc7432a" + "reference": "2c309e258adeb9970229042be39b360d34986fad" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/3abcc4db06d4e776825eaa3ed8ad924d5bc7432a", - "reference": "3abcc4db06d4e776825eaa3ed8ad924d5bc7432a", + "url": "https://api.github.com/repos/symfony/yaml/zipball/2c309e258adeb9970229042be39b360d34986fad", + "reference": "2c309e258adeb9970229042be39b360d34986fad", "shasum": "" }, "require": { @@ -3715,7 +3789,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v4.4.29" + "source": "https://github.com/symfony/yaml/tree/v4.4.34" }, "funding": [ { @@ -3731,7 +3805,7 @@ "type": "tidelift" } ], - "time": "2021-07-27T16:19:30+00:00" + "time": "2021-11-18T18:49:23+00:00" }, { "name": "webmozart/assert", @@ -4289,16 +4363,16 @@ }, { "name": "phpunit/php-file-iterator", - "version": "3.0.5", + "version": "3.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8" + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/aa4be8575f26070b100fccb67faabb28f21f66f8", - "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", "shasum": "" }, "require": { @@ -4337,7 +4411,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.5" + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" }, "funding": [ { @@ -4345,7 +4419,7 @@ "type": "github" } ], - "time": "2020-09-28T05:57:25+00:00" + "time": "2021-12-02T12:48:52+00:00" }, { "name": "phpunit/php-text-template", From dbf71c626b2af3ecaa83ea30956a345f983fe32b Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 7 Dec 2021 15:27:57 +0530 Subject: [PATCH 0860/1044] Bump to version v4.5.0 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 9e3a93350..a84947d6f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.4.3 +4.5.0 From 55d2275295ffe4991749f9bdb175301228db9f03 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Wed, 8 Dec 2021 22:22:40 +0530 Subject: [PATCH 0861/1044] Update composer packages Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 2 +- composer.lock | 103 ++++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 89 insertions(+), 16 deletions(-) diff --git a/composer.json b/composer.json index 2bcce03eb..6b13ffb2c 100644 --- a/composer.json +++ b/composer.json @@ -35,7 +35,7 @@ "easyengine/mailhog-command": "v1.0.2", "easyengine/service-command": "v1.4.0", "easyengine/shell-command": "v1.1.0", - "easyengine/site-command": "v3.0.0", + "easyengine/site-command": "v3.0.1", "easyengine/site-type-php": "v1.6.1", "easyengine/site-type-wp": "v1.6.1", "monolog/monolog": "1.24.0", diff --git a/composer.lock b/composer.lock index 2fd018e7a..8328f5e39 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": "54e4c473bac2da41f02b44fa9184aaef", + "content-hash": "973006f55bac770ec1d994f862ef70c9", "packages": [ { "name": "acmephp/core", @@ -439,6 +439,77 @@ ], "time": "2021-04-07T13:37:33+00:00" }, + { + "name": "composer/pcre", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/composer/pcre.git", + "reference": "3d322d715c43a1ac36c7fe215fa59336265500f2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/pcre/zipball/3d322d715c43a1ac36c7fe215fa59336265500f2", + "reference": "3d322d715c43a1ac36c7fe215fa59336265500f2", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.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/1.0.0" + }, + "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": "2021-12-06T15:17:27+00:00" + }, { "name": "composer/semver", "version": "3.2.4", @@ -602,25 +673,27 @@ }, { "name": "composer/xdebug-handler", - "version": "2.0.2", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "84674dd3a7575ba617f5a76d7e9e29a7d3891339" + "reference": "6555461e76962fd0379c444c46fd558a0fcfb65e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/84674dd3a7575ba617f5a76d7e9e29a7d3891339", - "reference": "84674dd3a7575ba617f5a76d7e9e29a7d3891339", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6555461e76962fd0379c444c46fd558a0fcfb65e", + "reference": "6555461e76962fd0379c444c46fd558a0fcfb65e", "shasum": "" }, "require": { + "composer/pcre": "^1", "php": "^5.3.2 || ^7.0 || ^8.0", "psr/log": "^1 || ^2 || ^3" }, "require-dev": { - "phpstan/phpstan": "^0.12.55", - "symfony/phpunit-bridge": "^4.2 || ^5" + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^4.2 || ^5.0 || ^6.0" }, "type": "library", "autoload": { @@ -646,7 +719,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/2.0.2" + "source": "https://github.com/composer/xdebug-handler/tree/2.0.3" }, "funding": [ { @@ -662,7 +735,7 @@ "type": "tidelift" } ], - "time": "2021-07-31T17:03:58+00:00" + "time": "2021-12-08T13:07:32+00:00" }, { "name": "easyengine/admin-tools-command", @@ -1042,16 +1115,16 @@ }, { "name": "easyengine/site-command", - "version": "v3.0.0", + "version": "v3.0.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "5e20ed466cacfee163d247aacf5cce8626239cbf" + "reference": "ecaba669003c7f0e6b9bfdabc5dc250469834451" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/5e20ed466cacfee163d247aacf5cce8626239cbf", - "reference": "5e20ed466cacfee163d247aacf5cce8626239cbf", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/ecaba669003c7f0e6b9bfdabc5dc250469834451", + "reference": "ecaba669003c7f0e6b9bfdabc5dc250469834451", "shasum": "" }, "require": { @@ -1112,9 +1185,9 @@ "homepage": "https://github.com/easyengine/site-command", "support": { "issues": "https://github.com/EasyEngine/site-command/issues", - "source": "https://github.com/EasyEngine/site-command/tree/v3.0.0" + "source": "https://github.com/EasyEngine/site-command/tree/v3.0.1" }, - "time": "2021-12-07T09:35:14+00:00" + "time": "2021-12-08T16:46:35+00:00" }, { "name": "easyengine/site-type-php", From a0d4771fd9317d41def4ff09670a91bdd161082e Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Wed, 8 Dec 2021 22:22:50 +0530 Subject: [PATCH 0862/1044] Bump to version v4.5.1 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index a84947d6f..4404a17ba 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.5.0 +4.5.1 From 1f9365ac4238ae8e9085c7362edc9bbf1d627ae4 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 9 Dec 2021 10:19:54 +0530 Subject: [PATCH 0863/1044] Add ee_release to gitignore Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index f2cd166fe..1b29f3c5b 100644 --- a/.gitignore +++ b/.gitignore @@ -18,4 +18,5 @@ vcs.xml workspace.xml profiles_settings.xml Project_Default.xml -.idea \ No newline at end of file +.idea +ee_release From 1091ea8118328034e444552bf22d363f6f3928b1 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 9 Dec 2021 12:56:06 +0530 Subject: [PATCH 0864/1044] Update composer packages Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 2 +- composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index 6b13ffb2c..c49ab16de 100644 --- a/composer.json +++ b/composer.json @@ -35,7 +35,7 @@ "easyengine/mailhog-command": "v1.0.2", "easyengine/service-command": "v1.4.0", "easyengine/shell-command": "v1.1.0", - "easyengine/site-command": "v3.0.1", + "easyengine/site-command": "v3.0.5", "easyengine/site-type-php": "v1.6.1", "easyengine/site-type-wp": "v1.6.1", "monolog/monolog": "1.24.0", diff --git a/composer.lock b/composer.lock index 8328f5e39..10dc1e38d 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": "973006f55bac770ec1d994f862ef70c9", + "content-hash": "566f93153ed8fcbc90108a462c8a60f1", "packages": [ { "name": "acmephp/core", @@ -1115,16 +1115,16 @@ }, { "name": "easyengine/site-command", - "version": "v3.0.1", + "version": "v3.0.5", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "ecaba669003c7f0e6b9bfdabc5dc250469834451" + "reference": "d0cc3f79b79049a55ebd886d10cf096a3118f7b3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/ecaba669003c7f0e6b9bfdabc5dc250469834451", - "reference": "ecaba669003c7f0e6b9bfdabc5dc250469834451", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/d0cc3f79b79049a55ebd886d10cf096a3118f7b3", + "reference": "d0cc3f79b79049a55ebd886d10cf096a3118f7b3", "shasum": "" }, "require": { @@ -1185,9 +1185,9 @@ "homepage": "https://github.com/easyengine/site-command", "support": { "issues": "https://github.com/EasyEngine/site-command/issues", - "source": "https://github.com/EasyEngine/site-command/tree/v3.0.1" + "source": "https://github.com/EasyEngine/site-command/tree/v3.0.5" }, - "time": "2021-12-08T16:46:35+00:00" + "time": "2021-12-09T07:23:35+00:00" }, { "name": "easyengine/site-type-php", From e440c249422c2fb2aa49a8d5dd1a8f4f758c3360 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 9 Dec 2021 12:56:13 +0530 Subject: [PATCH 0865/1044] Bump to version v4.5.2 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 4404a17ba..6cedcff63 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.5.1 +4.5.2 From 65bf8b9b01c7529bf6b2a6ba18cce8343391ce74 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 13 Dec 2021 16:49:14 +0530 Subject: [PATCH 0866/1044] Add env config support Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- php/config-spec.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/php/config-spec.php b/php/config-spec.php index 51c9f9c71..c6b92302f 100644 --- a/php/config-spec.php +++ b/php/config-spec.php @@ -31,6 +31,13 @@ 'desc' => 'Mail-id to be used for letsencrypt.', ), + 'env' => array( + 'runtime' => '=<env>', + 'file' => '<env>', + 'default' => null, + 'desc' => 'EasyEngine server environment.', + ), + 'wp-mail' => array( 'runtime' => '=<wp-mail>', 'file' => '<wp-mail>', From 3bc5e0f6eb4f4a5d7fcff71ca83606342cc6db14 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 13 Dec 2021 18:30:38 +0530 Subject: [PATCH 0867/1044] Update composer packages Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 4 ++-- composer.lock | 48 ++++++++++++++++++++++++------------------------ 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/composer.json b/composer.json index c49ab16de..d0bc6d051 100644 --- a/composer.json +++ b/composer.json @@ -35,9 +35,9 @@ "easyengine/mailhog-command": "v1.0.2", "easyengine/service-command": "v1.4.0", "easyengine/shell-command": "v1.1.0", - "easyengine/site-command": "v3.0.5", + "easyengine/site-command": "v3.0.6", "easyengine/site-type-php": "v1.6.1", - "easyengine/site-type-wp": "v1.6.1", + "easyengine/site-type-wp": "v1.6.2", "monolog/monolog": "1.24.0", "mustache/mustache": "2.13.0", "rmccue/requests": "1.8.0", diff --git a/composer.lock b/composer.lock index 10dc1e38d..1b2cbb8ca 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": "566f93153ed8fcbc90108a462c8a60f1", + "content-hash": "d94f50ee9c5b930b944481aff2cabb06", "packages": [ { "name": "acmephp/core", @@ -1115,16 +1115,16 @@ }, { "name": "easyengine/site-command", - "version": "v3.0.5", + "version": "v3.0.6", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "d0cc3f79b79049a55ebd886d10cf096a3118f7b3" + "reference": "80e66f28a2711bdfdc29add1db97dfb8b19a1efb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/d0cc3f79b79049a55ebd886d10cf096a3118f7b3", - "reference": "d0cc3f79b79049a55ebd886d10cf096a3118f7b3", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/80e66f28a2711bdfdc29add1db97dfb8b19a1efb", + "reference": "80e66f28a2711bdfdc29add1db97dfb8b19a1efb", "shasum": "" }, "require": { @@ -1185,9 +1185,9 @@ "homepage": "https://github.com/easyengine/site-command", "support": { "issues": "https://github.com/EasyEngine/site-command/issues", - "source": "https://github.com/EasyEngine/site-command/tree/v3.0.5" + "source": "https://github.com/EasyEngine/site-command/tree/v3.0.6" }, - "time": "2021-12-09T07:23:35+00:00" + "time": "2021-12-13T12:58:01+00:00" }, { "name": "easyengine/site-type-php", @@ -1250,16 +1250,16 @@ }, { "name": "easyengine/site-type-wp", - "version": "v1.6.1", + "version": "v1.6.2", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-wp.git", - "reference": "e5067c54599e83a58017feb101f9d5585600899a" + "reference": "009e64fae3c17745aa06bd49cc443faa3a6aa414" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/e5067c54599e83a58017feb101f9d5585600899a", - "reference": "e5067c54599e83a58017feb101f9d5585600899a", + "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/009e64fae3c17745aa06bd49cc443faa3a6aa414", + "reference": "009e64fae3c17745aa06bd49cc443faa3a6aa414", "shasum": "" }, "require-dev": { @@ -1303,9 +1303,9 @@ "homepage": "https://github.com/easyengine/site-type-wp", "support": { "issues": "https://github.com/EasyEngine/site-type-wp/issues", - "source": "https://github.com/EasyEngine/site-type-wp/tree/v1.6.1" + "source": "https://github.com/EasyEngine/site-type-wp/tree/v1.6.2" }, - "time": "2021-11-16T08:32:26+00:00" + "time": "2021-12-13T12:57:27+00:00" }, { "name": "guzzlehttp/guzzle", @@ -2292,16 +2292,16 @@ }, { "name": "seld/phar-utils", - "version": "1.1.2", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/Seldaek/phar-utils.git", - "reference": "749042a2315705d2dfbbc59234dd9ceb22bf3ff0" + "reference": "9f3452c93ff423469c0d56450431562ca423dcee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/749042a2315705d2dfbbc59234dd9ceb22bf3ff0", - "reference": "749042a2315705d2dfbbc59234dd9ceb22bf3ff0", + "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/9f3452c93ff423469c0d56450431562ca423dcee", + "reference": "9f3452c93ff423469c0d56450431562ca423dcee", "shasum": "" }, "require": { @@ -2334,9 +2334,9 @@ ], "support": { "issues": "https://github.com/Seldaek/phar-utils/issues", - "source": "https://github.com/Seldaek/phar-utils/tree/1.1.2" + "source": "https://github.com/Seldaek/phar-utils/tree/1.2.0" }, - "time": "2021-08-19T21:01:38+00:00" + "time": "2021-12-10T11:20:11+00:00" }, { "name": "symfony/config", @@ -4798,16 +4798,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.6.1", + "version": "3.6.2", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "f268ca40d54617c6e06757f83f699775c9b3ff2e" + "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/f268ca40d54617c6e06757f83f699775c9b3ff2e", - "reference": "f268ca40d54617c6e06757f83f699775c9b3ff2e", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/5e4e71592f69da17871dba6e80dd51bce74a351a", + "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a", "shasum": "" }, "require": { @@ -4850,7 +4850,7 @@ "source": "https://github.com/squizlabs/PHP_CodeSniffer", "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" }, - "time": "2021-10-11T04:00:11+00:00" + "time": "2021-12-12T21:44:58+00:00" }, { "name": "wp-coding-standards/wpcs", From ad3dc2a297a72f371a40b4f6c834f84a3e64ce96 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 13 Dec 2021 18:33:56 +0530 Subject: [PATCH 0868/1044] Bump to version v4.5.3 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 6cedcff63..4e298cc96 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.5.2 +4.5.3 From b101fc0f778a2a9bf038d34b5d8553c42042f3d1 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Wed, 30 Mar 2022 13:45:52 +0530 Subject: [PATCH 0869/1044] Update images to latest versions Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- img-versions.json | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/img-versions.json b/img-versions.json index 6a6e0c71e..414bede6f 100644 --- a/img-versions.json +++ b/img-versions.json @@ -3,14 +3,15 @@ "easyengine/mailhog": "v4.0.0", "easyengine/mariadb": "v4.1.3", "easyengine/nginx-proxy": "v4.5.0", - "easyengine/nginx": "v4.5.0", - "easyengine/php": "v4.5.0", + "easyengine/nginx": "v4.5.4", + "easyengine/php": "v4.5.4", "easyengine/php5.6": "v4.0.0", "easyengine/php7.0": "v4.1.7", "easyengine/php7.2": "v4.1.7", - "easyengine/php7.3": "v4.5.0", - "easyengine/php7.4": "v4.5.0", - "easyengine/php8.0": "v4.5.0", + "easyengine/php7.3": "v4.5.4", + "easyengine/php7.4": "v4.5.4", + "easyengine/php8.0": "v4.5.4", + "easyengine/php8.1": "v4.5.4", "easyengine/postfix": "v4.1.5", "easyengine/redis": "v4.4.3", "easyengine/newrelic-daemon": "v4.3.0" From b1d06515608d8f49bf5072f75e498317a45f70f1 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Wed, 30 Mar 2022 13:46:47 +0530 Subject: [PATCH 0870/1044] Update composer dependencies Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 6 +- composer.lock | 480 +++++++++++++++++++++++++++----------------------- 2 files changed, 259 insertions(+), 227 deletions(-) diff --git a/composer.json b/composer.json index d0bc6d051..4f4572b45 100644 --- a/composer.json +++ b/composer.json @@ -35,9 +35,9 @@ "easyengine/mailhog-command": "v1.0.2", "easyengine/service-command": "v1.4.0", "easyengine/shell-command": "v1.1.0", - "easyengine/site-command": "v3.0.6", - "easyengine/site-type-php": "v1.6.1", - "easyengine/site-type-wp": "v1.6.2", + "easyengine/site-command": "v3.0.7", + "easyengine/site-type-php": "v1.6.2", + "easyengine/site-type-wp": "v1.6.3", "monolog/monolog": "1.24.0", "mustache/mustache": "2.13.0", "rmccue/requests": "1.8.0", diff --git a/composer.lock b/composer.lock index 1b2cbb8ca..744144cbe 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": "d94f50ee9c5b930b944481aff2cabb06", + "content-hash": "87184a2cb9fec5029913dcc01c4c320a", "packages": [ { "name": "acmephp/core", @@ -441,23 +441,23 @@ }, { "name": "composer/pcre", - "version": "1.0.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "3d322d715c43a1ac36c7fe215fa59336265500f2" + "reference": "67a32d7d6f9f560b726ab25a061b38ff3a80c560" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/3d322d715c43a1ac36c7fe215fa59336265500f2", - "reference": "3d322d715c43a1ac36c7fe215fa59336265500f2", + "url": "https://api.github.com/repos/composer/pcre/zipball/67a32d7d6f9f560b726ab25a061b38ff3a80c560", + "reference": "67a32d7d6f9f560b726ab25a061b38ff3a80c560", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^1", + "phpstan/phpstan": "^1.3", "phpstan/phpstan-strict-rules": "^1.1", "symfony/phpunit-bridge": "^4.2 || ^5" }, @@ -492,7 +492,7 @@ ], "support": { "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/1.0.0" + "source": "https://github.com/composer/pcre/tree/1.0.1" }, "funding": [ { @@ -508,7 +508,7 @@ "type": "tidelift" } ], - "time": "2021-12-06T15:17:27+00:00" + "time": "2022-01-21T20:24:37+00:00" }, { "name": "composer/semver", @@ -673,16 +673,16 @@ }, { "name": "composer/xdebug-handler", - "version": "2.0.3", + "version": "2.0.5", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "6555461e76962fd0379c444c46fd558a0fcfb65e" + "reference": "9e36aeed4616366d2b690bdce11f71e9178c579a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6555461e76962fd0379c444c46fd558a0fcfb65e", - "reference": "6555461e76962fd0379c444c46fd558a0fcfb65e", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/9e36aeed4616366d2b690bdce11f71e9178c579a", + "reference": "9e36aeed4616366d2b690bdce11f71e9178c579a", "shasum": "" }, "require": { @@ -719,7 +719,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/2.0.3" + "source": "https://github.com/composer/xdebug-handler/tree/2.0.5" }, "funding": [ { @@ -735,7 +735,7 @@ "type": "tidelift" } ], - "time": "2021-12-08T13:07:32+00:00" + "time": "2022-02-24T20:20:32+00:00" }, { "name": "easyengine/admin-tools-command", @@ -764,12 +764,12 @@ ] }, "autoload": { - "psr-4": { - "": "src/" - }, "files": [ "admin-tools-command.php" - ] + ], + "psr-4": { + "": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -812,14 +812,14 @@ ] }, "autoload": { - "psr-4": { - "": "src/", - "EE\\Model\\": "src/db/" - }, "files": [ "auth-command.php", "src/auth-utils.php" - ] + ], + "psr-4": { + "": "src/", + "EE\\Model\\": "src/db/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -860,12 +860,12 @@ ] }, "autoload": { - "psr-4": { - "": "src/" - }, "files": [ "config-command.php" - ] + ], + "psr-4": { + "": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -909,14 +909,14 @@ ] }, "autoload": { - "psr-4": { - "": "src/", - "EE\\Model\\": "src/db/" - }, "files": [ "cron-command.php", "src/helper/utils.php" - ] + ], + "psr-4": { + "": "src/", + "EE\\Model\\": "src/db/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -955,12 +955,12 @@ ] }, "autoload": { - "psr-4": { - "": "src/" - }, "files": [ "log-command.php" - ] + ], + "psr-4": { + "": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1001,12 +1001,12 @@ ] }, "autoload": { - "psr-4": { - "": "src/" - }, "files": [ "mailhog-command.php" - ] + ], + "psr-4": { + "": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1049,13 +1049,13 @@ ] }, "autoload": { - "psr-4": { - "": "src/" - }, "files": [ "src/helper/service-utils.php", "service-command.php" - ] + ], + "psr-4": { + "": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1094,12 +1094,12 @@ ] }, "autoload": { - "psr-4": { - "": "src/" - }, "files": [ "shell-command.php" - ] + ], + "psr-4": { + "": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1115,16 +1115,16 @@ }, { "name": "easyengine/site-command", - "version": "v3.0.6", + "version": "v3.0.7", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "80e66f28a2711bdfdc29add1db97dfb8b19a1efb" + "reference": "fe76cc35fe598d97b41dc6b5495ba1b5db53164f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/80e66f28a2711bdfdc29add1db97dfb8b19a1efb", - "reference": "80e66f28a2711bdfdc29add1db97dfb8b19a1efb", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/fe76cc35fe598d97b41dc6b5495ba1b5db53164f", + "reference": "fe76cc35fe598d97b41dc6b5495ba1b5db53164f", "shasum": "" }, "require": { @@ -1159,12 +1159,6 @@ ] }, "autoload": { - "psr-4": { - "": "src/", - "EE\\Model\\": "src/db/", - "EE\\Site\\Type\\": "src/site-type/", - "AcmePhp\\Cli\\": "AcmePhp/Cli" - }, "files": [ "site-command.php", "src/helper/hooks.php", @@ -1176,7 +1170,13 @@ "src/helper/Shutdown_Handler.php", "src/clone/Cloner.php", "src/clone/clone-utils.php" - ] + ], + "psr-4": { + "": "src/", + "EE\\Model\\": "src/db/", + "AcmePhp\\Cli\\": "AcmePhp/Cli", + "EE\\Site\\Type\\": "src/site-type/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1185,22 +1185,22 @@ "homepage": "https://github.com/easyengine/site-command", "support": { "issues": "https://github.com/EasyEngine/site-command/issues", - "source": "https://github.com/EasyEngine/site-command/tree/v3.0.6" + "source": "https://github.com/EasyEngine/site-command/tree/v3.0.7" }, - "time": "2021-12-13T12:58:01+00:00" + "time": "2022-03-30T07:49:15+00:00" }, { "name": "easyengine/site-type-php", - "version": "v1.6.1", + "version": "v1.6.2", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-php.git", - "reference": "207ff6b647f8b9f61266d86a1c7cc1a51b39aa6a" + "reference": "8b7546f58e2b08004b84d5f6d4e5e2faedbecf8d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/207ff6b647f8b9f61266d86a1c7cc1a51b39aa6a", - "reference": "207ff6b647f8b9f61266d86a1c7cc1a51b39aa6a", + "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/8b7546f58e2b08004b84d5f6d4e5e2faedbecf8d", + "reference": "8b7546f58e2b08004b84d5f6d4e5e2faedbecf8d", "shasum": "" }, "require-dev": { @@ -1229,12 +1229,12 @@ ] }, "autoload": { - "psr-4": { - "EE\\Site\\Type\\": "src/" - }, "files": [ "site-type-php.php" - ] + ], + "psr-4": { + "EE\\Site\\Type\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1244,22 +1244,22 @@ "homepage": "https://github.com/easyengine/site-type-php", "support": { "issues": "https://github.com/EasyEngine/site-type-php/issues", - "source": "https://github.com/EasyEngine/site-type-php/tree/v1.6.1" + "source": "https://github.com/EasyEngine/site-type-php/tree/v1.6.2" }, - "time": "2021-11-16T08:32:31+00:00" + "time": "2022-03-30T07:49:59+00:00" }, { "name": "easyengine/site-type-wp", - "version": "v1.6.2", + "version": "v1.6.3", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-wp.git", - "reference": "009e64fae3c17745aa06bd49cc443faa3a6aa414" + "reference": "6b6b1281519a290bc132046480ba4acdd583e344" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/009e64fae3c17745aa06bd49cc443faa3a6aa414", - "reference": "009e64fae3c17745aa06bd49cc443faa3a6aa414", + "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/6b6b1281519a290bc132046480ba4acdd583e344", + "reference": "6b6b1281519a290bc132046480ba4acdd583e344", "shasum": "" }, "require-dev": { @@ -1288,12 +1288,12 @@ ] }, "autoload": { - "psr-4": { - "EE\\Site\\Type\\": "src/" - }, "files": [ "site-type-wp.php" - ] + ], + "psr-4": { + "EE\\Site\\Type\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1303,9 +1303,9 @@ "homepage": "https://github.com/easyengine/site-type-wp", "support": { "issues": "https://github.com/EasyEngine/site-type-wp/issues", - "source": "https://github.com/EasyEngine/site-type-wp/tree/v1.6.2" + "source": "https://github.com/EasyEngine/site-type-wp/tree/v1.6.3" }, - "time": "2021-12-13T12:57:27+00:00" + "time": "2022-03-30T07:49:45+00:00" }, { "name": "guzzlehttp/guzzle", @@ -1403,12 +1403,12 @@ } }, "autoload": { - "psr-4": { - "GuzzleHttp\\Promise\\": "src/" - }, "files": [ "src/functions_include.php" - ] + ], + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1462,16 +1462,16 @@ }, { "name": "guzzlehttp/psr7", - "version": "1.8.3", + "version": "1.8.5", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "1afdd860a2566ed3c2b0b4a3de6e23434a79ec85" + "reference": "337e3ad8e5716c15f9657bd214d16cc5e69df268" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/1afdd860a2566ed3c2b0b4a3de6e23434a79ec85", - "reference": "1afdd860a2566ed3c2b0b4a3de6e23434a79ec85", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/337e3ad8e5716c15f9657bd214d16cc5e69df268", + "reference": "337e3ad8e5716c15f9657bd214d16cc5e69df268", "shasum": "" }, "require": { @@ -1496,12 +1496,12 @@ } }, "autoload": { - "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" - }, "files": [ "src/functions_include.php" - ] + ], + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1552,7 +1552,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/1.8.3" + "source": "https://github.com/guzzle/psr7/tree/1.8.5" }, "funding": [ { @@ -1568,7 +1568,7 @@ "type": "tidelift" } ], - "time": "2021-10-05T13:56:00+00:00" + "time": "2022-03-20T21:51:18+00:00" }, { "name": "justinrainbow/json-schema", @@ -2119,32 +2119,32 @@ }, { "name": "react/promise", - "version": "v2.8.0", + "version": "v2.9.0", "source": { "type": "git", "url": "https://github.com/reactphp/promise.git", - "reference": "f3cff96a19736714524ca0dd1d4130de73dbbbc4" + "reference": "234f8fd1023c9158e2314fa9d7d0e6a83db42910" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise/zipball/f3cff96a19736714524ca0dd1d4130de73dbbbc4", - "reference": "f3cff96a19736714524ca0dd1d4130de73dbbbc4", + "url": "https://api.github.com/repos/reactphp/promise/zipball/234f8fd1023c9158e2314fa9d7d0e6a83db42910", + "reference": "234f8fd1023c9158e2314fa9d7d0e6a83db42910", "shasum": "" }, "require": { "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "^7.0 || ^6.5 || ^5.7 || ^4.8.36" + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36" }, "type": "library", "autoload": { - "psr-4": { - "React\\Promise\\": "src/" - }, "files": [ "src/functions_include.php" - ] + ], + "psr-4": { + "React\\Promise\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2153,7 +2153,23 @@ "authors": [ { "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com" + "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", @@ -2163,9 +2179,19 @@ ], "support": { "issues": "https://github.com/reactphp/promise/issues", - "source": "https://github.com/reactphp/promise/tree/v2.8.0" + "source": "https://github.com/reactphp/promise/tree/v2.9.0" }, - "time": "2020-05-12T15:16:56+00:00" + "funding": [ + { + "url": "https://github.com/WyriHaximus", + "type": "github" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2022-02-11T10:27:51+00:00" }, { "name": "rmccue/requests", @@ -2340,16 +2366,16 @@ }, { "name": "symfony/config", - "version": "v4.4.34", + "version": "v4.4.37", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "e99b65a18faa34fde57078095c39a1bc91a22492" + "reference": "e8c2d2c951ddedecb6d28954d336cb7d2e852d0e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/e99b65a18faa34fde57078095c39a1bc91a22492", - "reference": "e99b65a18faa34fde57078095c39a1bc91a22492", + "url": "https://api.github.com/repos/symfony/config/zipball/e8c2d2c951ddedecb6d28954d336cb7d2e852d0e", + "reference": "e8c2d2c951ddedecb6d28954d336cb7d2e852d0e", "shasum": "" }, "require": { @@ -2398,7 +2424,7 @@ "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/config/tree/v4.4.34" + "source": "https://github.com/symfony/config/tree/v4.4.37" }, "funding": [ { @@ -2414,20 +2440,20 @@ "type": "tidelift" } ], - "time": "2021-10-29T15:43:26+00:00" + "time": "2022-01-03T09:46:22+00:00" }, { "name": "symfony/console", - "version": "v4.4.34", + "version": "v4.4.38", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "329b3a75cc6b16d435ba1b1a41df54a53382a3f0" + "reference": "5a50085bf5460f0c0d60a50b58388c1249826b8a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/329b3a75cc6b16d435ba1b1a41df54a53382a3f0", - "reference": "329b3a75cc6b16d435ba1b1a41df54a53382a3f0", + "url": "https://api.github.com/repos/symfony/console/zipball/5a50085bf5460f0c0d60a50b58388c1249826b8a", + "reference": "5a50085bf5460f0c0d60a50b58388c1249826b8a", "shasum": "" }, "require": { @@ -2488,7 +2514,7 @@ "description": "Eases the creation of beautiful and testable command line interfaces", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/console/tree/v4.4.34" + "source": "https://github.com/symfony/console/tree/v4.4.38" }, "funding": [ { @@ -2504,20 +2530,20 @@ "type": "tidelift" } ], - "time": "2021-11-04T12:23:33+00:00" + "time": "2022-01-30T21:23:57+00:00" }, { "name": "symfony/debug", - "version": "v4.4.31", + "version": "v4.4.37", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "43ede438d4cb52cd589ae5dc070e9323866ba8e0" + "reference": "5de6c6e7f52b364840e53851c126be4d71e60470" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/43ede438d4cb52cd589ae5dc070e9323866ba8e0", - "reference": "43ede438d4cb52cd589ae5dc070e9323866ba8e0", + "url": "https://api.github.com/repos/symfony/debug/zipball/5de6c6e7f52b364840e53851c126be4d71e60470", + "reference": "5de6c6e7f52b364840e53851c126be4d71e60470", "shasum": "" }, "require": { @@ -2556,7 +2582,7 @@ "description": "Provides tools to ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/debug/tree/v4.4.31" + "source": "https://github.com/symfony/debug/tree/v4.4.37" }, "funding": [ { @@ -2572,20 +2598,20 @@ "type": "tidelift" } ], - "time": "2021-09-24T13:30:14+00:00" + "time": "2022-01-02T09:41:36+00:00" }, { "name": "symfony/dependency-injection", - "version": "v4.4.34", + "version": "v4.4.39", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "117d7f132ed7efbd535ec947709d49bec1b9d24b" + "reference": "5d0fbcdb9317864b2bd9e49d570d88ae512cadf3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/117d7f132ed7efbd535ec947709d49bec1b9d24b", - "reference": "117d7f132ed7efbd535ec947709d49bec1b9d24b", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/5d0fbcdb9317864b2bd9e49d570d88ae512cadf3", + "reference": "5d0fbcdb9317864b2bd9e49d570d88ae512cadf3", "shasum": "" }, "require": { @@ -2598,7 +2624,7 @@ "symfony/config": "<4.3|>=5.0", "symfony/finder": "<3.4", "symfony/proxy-manager-bridge": "<3.4", - "symfony/yaml": "<3.4" + "symfony/yaml": "<4.4.26" }, "provide": { "psr/container-implementation": "1.0", @@ -2607,7 +2633,7 @@ "require-dev": { "symfony/config": "^4.3", "symfony/expression-language": "^3.4|^4.0|^5.0", - "symfony/yaml": "^4.4|^5.0" + "symfony/yaml": "^4.4.26|^5.0" }, "suggest": { "symfony/config": "", @@ -2642,7 +2668,7 @@ "description": "Allows you to standardize and centralize the way objects are constructed in your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v4.4.34" + "source": "https://github.com/symfony/dependency-injection/tree/v4.4.39" }, "funding": [ { @@ -2658,7 +2684,7 @@ "type": "tidelift" } ], - "time": "2021-11-15T14:42:25+00:00" + "time": "2022-03-02T12:36:39+00:00" }, { "name": "symfony/deprecation-contracts", @@ -2729,16 +2755,16 @@ }, { "name": "symfony/event-dispatcher", - "version": "v4.4.34", + "version": "v4.4.37", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "1a024b45369c9d55d76b6b8a241bd20c9ea1cbd8" + "reference": "3ccfcfb96ecce1217d7b0875a0736976bc6e63dc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/1a024b45369c9d55d76b6b8a241bd20c9ea1cbd8", - "reference": "1a024b45369c9d55d76b6b8a241bd20c9ea1cbd8", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/3ccfcfb96ecce1217d7b0875a0736976bc6e63dc", + "reference": "3ccfcfb96ecce1217d7b0875a0736976bc6e63dc", "shasum": "" }, "require": { @@ -2793,7 +2819,7 @@ "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/v4.4.34" + "source": "https://github.com/symfony/event-dispatcher/tree/v4.4.37" }, "funding": [ { @@ -2809,7 +2835,7 @@ "type": "tidelift" } ], - "time": "2021-11-15T14:42:25+00:00" + "time": "2022-01-02T09:41:36+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -2892,16 +2918,16 @@ }, { "name": "symfony/filesystem", - "version": "v4.4.27", + "version": "v4.4.39", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "517fb795794faf29086a77d99eb8f35e457837a7" + "reference": "72a5b35fecaa670b13954e6eaf414acbe2a67b35" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/517fb795794faf29086a77d99eb8f35e457837a7", - "reference": "517fb795794faf29086a77d99eb8f35e457837a7", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/72a5b35fecaa670b13954e6eaf414acbe2a67b35", + "reference": "72a5b35fecaa670b13954e6eaf414acbe2a67b35", "shasum": "" }, "require": { @@ -2935,7 +2961,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v4.4.27" + "source": "https://github.com/symfony/filesystem/tree/v4.4.39" }, "funding": [ { @@ -2951,20 +2977,20 @@ "type": "tidelift" } ], - "time": "2021-07-21T12:19:41+00:00" + "time": "2022-02-25T10:38:15+00:00" }, { "name": "symfony/finder", - "version": "v4.4.30", + "version": "v4.4.37", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "70362f1e112280d75b30087c7598b837c1b468b6" + "reference": "b17d76d7ed179f017aad646e858c90a2771af15d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/70362f1e112280d75b30087c7598b837c1b468b6", - "reference": "70362f1e112280d75b30087c7598b837c1b468b6", + "url": "https://api.github.com/repos/symfony/finder/zipball/b17d76d7ed179f017aad646e858c90a2771af15d", + "reference": "b17d76d7ed179f017aad646e858c90a2771af15d", "shasum": "" }, "require": { @@ -2997,7 +3023,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v4.4.30" + "source": "https://github.com/symfony/finder/tree/v4.4.37" }, "funding": [ { @@ -3013,25 +3039,28 @@ "type": "tidelift" } ], - "time": "2021-08-04T20:31:23+00:00" + "time": "2022-01-02T09:41:36+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.23.0", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" + "reference": "30885182c981ab175d4d034db0f6f469898070ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", - "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab", + "reference": "30885182c981ab175d4d034db0f6f469898070ab", "shasum": "" }, "require": { "php": ">=7.1" }, + "provide": { + "ext-ctype": "*" + }, "suggest": { "ext-ctype": "For best performance" }, @@ -3046,12 +3075,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -3076,7 +3105,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.25.0" }, "funding": [ { @@ -3092,25 +3121,28 @@ "type": "tidelift" } ], - "time": "2021-02-19T12:13:01+00:00" + "time": "2021-10-20T20:35:02+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.23.1", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6" + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6", - "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825", + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825", "shasum": "" }, "require": { "php": ">=7.1" }, + "provide": { + "ext-mbstring": "*" + }, "suggest": { "ext-mbstring": "For best performance" }, @@ -3125,12 +3157,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -3156,7 +3188,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.25.0" }, "funding": [ { @@ -3172,20 +3204,20 @@ "type": "tidelift" } ], - "time": "2021-05-27T12:26:48+00:00" + "time": "2021-11-30T18:21:41+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.23.0", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010" + "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fba8933c384d6476ab14fb7b8526e5287ca7e010", - "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/cc5db0e22b3cb4111010e48785a97f670b350ca5", + "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5", "shasum": "" }, "require": { @@ -3202,12 +3234,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" - }, "files": [ "bootstrap.php" ], + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, "classmap": [ "Resources/stubs" ] @@ -3235,7 +3267,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.25.0" }, "funding": [ { @@ -3251,20 +3283,20 @@ "type": "tidelift" } ], - "time": "2021-02-19T12:13:01+00:00" + "time": "2021-06-05T21:20:04+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.23.1", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be" + "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be", - "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/4407588e0d3f1f52efb65fbe92babe41f37fe50c", + "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c", "shasum": "" }, "require": { @@ -3281,12 +3313,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, "files": [ "bootstrap.php" ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, "classmap": [ "Resources/stubs" ] @@ -3318,7 +3350,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.25.0" }, "funding": [ { @@ -3334,20 +3366,20 @@ "type": "tidelift" } ], - "time": "2021-07-28T13:41:28+00:00" + "time": "2022-03-04T08:16:47+00:00" }, { "name": "symfony/polyfill-php81", - "version": "v1.23.0", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "e66119f3de95efc359483f810c4c3e6436279436" + "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/e66119f3de95efc359483f810c4c3e6436279436", - "reference": "e66119f3de95efc359483f810c4c3e6436279436", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/5de4ba2d41b15f9bd0e19b2ab9674135813ec98f", + "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f", "shasum": "" }, "require": { @@ -3364,12 +3396,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php81\\": "" - }, "files": [ "bootstrap.php" ], + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, "classmap": [ "Resources/stubs" ] @@ -3397,7 +3429,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.25.0" }, "funding": [ { @@ -3413,20 +3445,20 @@ "type": "tidelift" } ], - "time": "2021-05-21T13:25:03+00:00" + "time": "2021-09-13T13:58:11+00:00" }, { "name": "symfony/process", - "version": "v4.4.35", + "version": "v4.4.37", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "c2098705326addae6e6742151dfade47ac71da1b" + "reference": "b2d924e5a4cb284f293d5092b1dbf0d364cb8b67" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/c2098705326addae6e6742151dfade47ac71da1b", - "reference": "c2098705326addae6e6742151dfade47ac71da1b", + "url": "https://api.github.com/repos/symfony/process/zipball/b2d924e5a4cb284f293d5092b1dbf0d364cb8b67", + "reference": "b2d924e5a4cb284f293d5092b1dbf0d364cb8b67", "shasum": "" }, "require": { @@ -3459,7 +3491,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v4.4.35" + "source": "https://github.com/symfony/process/tree/v4.4.37" }, "funding": [ { @@ -3475,7 +3507,7 @@ "type": "tidelift" } ], - "time": "2021-11-22T22:36:24+00:00" + "time": "2022-01-27T17:14:04+00:00" }, { "name": "symfony/serializer", @@ -3644,16 +3676,16 @@ }, { "name": "symfony/translation", - "version": "v4.4.34", + "version": "v4.4.37", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "26d330720627b234803595ecfc0191eeabc65190" + "reference": "4ce00d6875230b839f5feef82e51971f6c886e00" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/26d330720627b234803595ecfc0191eeabc65190", - "reference": "26d330720627b234803595ecfc0191eeabc65190", + "url": "https://api.github.com/repos/symfony/translation/zipball/4ce00d6875230b839f5feef82e51971f6c886e00", + "reference": "4ce00d6875230b839f5feef82e51971f6c886e00", "shasum": "" }, "require": { @@ -3713,7 +3745,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v4.4.34" + "source": "https://github.com/symfony/translation/tree/v4.4.37" }, "funding": [ { @@ -3729,7 +3761,7 @@ "type": "tidelift" } ], - "time": "2021-11-04T12:23:33+00:00" + "time": "2022-01-02T09:41:36+00:00" }, { "name": "symfony/translation-contracts", @@ -3811,16 +3843,16 @@ }, { "name": "symfony/yaml", - "version": "v4.4.34", + "version": "v4.4.37", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "2c309e258adeb9970229042be39b360d34986fad" + "reference": "d7f637cc0f0cc14beb0984f2bb50da560b271311" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/2c309e258adeb9970229042be39b360d34986fad", - "reference": "2c309e258adeb9970229042be39b360d34986fad", + "url": "https://api.github.com/repos/symfony/yaml/zipball/d7f637cc0f0cc14beb0984f2bb50da560b271311", + "reference": "d7f637cc0f0cc14beb0984f2bb50da560b271311", "shasum": "" }, "require": { @@ -3862,7 +3894,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v4.4.34" + "source": "https://github.com/symfony/yaml/tree/v4.4.37" }, "funding": [ { @@ -3878,7 +3910,7 @@ "type": "tidelift" } ], - "time": "2021-11-18T18:49:23+00:00" + "time": "2022-01-24T20:11:01+00:00" }, { "name": "webmozart/assert", @@ -3965,12 +3997,12 @@ } }, "autoload": { - "psr-4": { - "Mustangostang\\": "src/" - }, "files": [ "includes/functions.php" - ] + ], + "psr-4": { + "Mustangostang\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -4008,12 +4040,12 @@ }, "type": "library", "autoload": { - "psr-0": { - "cli": "lib/" - }, "files": [ "lib/cli/cli.php" - ] + ], + "psr-0": { + "cli": "lib/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ From 36d8b363b687997a2dae41f29774c07ce01a3086 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Wed, 30 Mar 2022 13:47:03 +0530 Subject: [PATCH 0871/1044] Bump to version v4.5.4 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 4e298cc96..0ed2bfe96 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.5.3 +4.5.4 From 4a512d5fa1d426528de61b35a8b2fa8eae32c311 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 30 Mar 2022 08:19:57 +0000 Subject: [PATCH 0872/1044] Bump mustache/mustache from 2.13.0 to 2.14.1 Bumps [mustache/mustache](https://github.com/bobthecow/mustache.php) from 2.13.0 to 2.14.1. - [Release notes](https://github.com/bobthecow/mustache.php/releases) - [Commits](https://github.com/bobthecow/mustache.php/compare/v2.13.0...v2.14.1) --- updated-dependencies: - dependency-name: mustache/mustache dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> --- composer.json | 2 +- composer.lock | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index 4f4572b45..1c35c9d52 100644 --- a/composer.json +++ b/composer.json @@ -39,7 +39,7 @@ "easyengine/site-type-php": "v1.6.2", "easyengine/site-type-wp": "v1.6.3", "monolog/monolog": "1.24.0", - "mustache/mustache": "2.13.0", + "mustache/mustache": "2.14.1", "rmccue/requests": "1.8.0", "symfony/config": "4.4.*", "symfony/console": "4.4.*", diff --git a/composer.lock b/composer.lock index 744144cbe..5f453a550 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": "87184a2cb9fec5029913dcc01c4c320a", + "content-hash": "df59a7bca269ff26ecf1bfbdd0cacc96", "packages": [ { "name": "acmephp/core", @@ -1874,16 +1874,16 @@ }, { "name": "mustache/mustache", - "version": "v2.13.0", + "version": "v2.14.1", "source": { "type": "git", "url": "https://github.com/bobthecow/mustache.php.git", - "reference": "e95c5a008c23d3151d59ea72484d4f72049ab7f4" + "reference": "579ffa5c96e1d292c060b3dd62811ff01ad8c24e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/mustache.php/zipball/e95c5a008c23d3151d59ea72484d4f72049ab7f4", - "reference": "e95c5a008c23d3151d59ea72484d4f72049ab7f4", + "url": "https://api.github.com/repos/bobthecow/mustache.php/zipball/579ffa5c96e1d292c060b3dd62811ff01ad8c24e", + "reference": "579ffa5c96e1d292c060b3dd62811ff01ad8c24e", "shasum": "" }, "require": { @@ -1918,9 +1918,9 @@ ], "support": { "issues": "https://github.com/bobthecow/mustache.php/issues", - "source": "https://github.com/bobthecow/mustache.php/tree/master" + "source": "https://github.com/bobthecow/mustache.php/tree/v2.14.1" }, - "time": "2019-11-23T21:40:31+00:00" + "time": "2022-01-21T06:08:36+00:00" }, { "name": "psr/container", @@ -4942,5 +4942,5 @@ "platform-overrides": { "php": "7.3" }, - "plugin-api-version": "2.0.0" + "plugin-api-version": "2.2.0" } From 6aca4ea16a7a40200b024ce646c3eea4c24442b3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 30 Mar 2022 08:22:39 +0000 Subject: [PATCH 0873/1044] Bump phpunit/phpunit from 3.7.18 to 9.5.19 Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 3.7.18 to 9.5.19. - [Release notes](https://github.com/sebastianbergmann/phpunit/releases) - [Changelog](https://github.com/sebastianbergmann/phpunit/blob/master/ChangeLog-9.5.md) - [Commits](https://github.com/sebastianbergmann/phpunit/compare/3.7.18...9.5.19) --- updated-dependencies: - dependency-name: phpunit/phpunit dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com> --- composer.json | 2 +- composer.lock | 1948 +++++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 1740 insertions(+), 210 deletions(-) diff --git a/composer.json b/composer.json index 1c35c9d52..88ed104b3 100644 --- a/composer.json +++ b/composer.json @@ -57,7 +57,7 @@ "require-dev": { "behat/behat": "3.8.1", "dealerdirect/phpcodesniffer-composer-installer": "0.7.0", - "phpunit/phpunit": "3.7.*", + "phpunit/phpunit": "9.5.*", "phpcompatibility/php-compatibility": "8.2.0", "wp-coding-standards/wpcs": "0.13.1" }, diff --git a/composer.lock b/composer.lock index 5f453a550..e4b4405d9 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": "df59a7bca269ff26ecf1bfbdd0cacc96", + "content-hash": "bdfb89cf400a399c5af7a2ee58a20b56", "packages": [ { "name": "acmephp/core", @@ -4343,145 +4343,1650 @@ }, "time": "2020-06-25T14:57:39+00:00" }, + { + "name": "doctrine/instantiator", + "version": "1.4.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/10dcfce151b967d20fde1b34ae6640712c3891bc", + "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9", + "ext-pdo": "*", + "ext-phar": "*", + "phpbench/phpbench": "^0.16 || ^1", + "phpstan/phpstan": "^1.4", + "phpstan/phpstan-phpunit": "^1", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "vimeo/psalm": "^4.22" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "https://ocramius.github.io/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", + "keywords": [ + "constructor", + "instantiate" + ], + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/1.4.1" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", + "type": "tidelift" + } + ], + "time": "2022-03-03T08:28:38+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.11.0", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/14daed4296fae74d9e3201d2c4925d1acb7aa614", + "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3,<3.2.2" + }, + "require-dev": { + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" + }, + "type": "library", + "autoload": { + "files": [ + "src/DeepCopy/deep_copy.php" + ], + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.11.0" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2022-03-03T13:19:32+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v4.13.2", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "210577fe3cf7badcc5814d99455df46564f3c077" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/210577fe3cf7badcc5814d99455df46564f3c077", + "reference": "210577fe3cf7badcc5814d99455df46564f3c077", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=7.0" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.9-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.2" + }, + "time": "2021-11-30T19:35:32+00:00" + }, + { + "name": "phar-io/manifest", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.3" + }, + "time": "2021-07-20T11:28:43+00:00" + }, + { + "name": "phar-io/version", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.2.1" + }, + "time": "2022-02-21T01:04:05+00:00" + }, { "name": "phpcompatibility/php-compatibility", "version": "8.2.0", "source": { "type": "git", - "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", - "reference": "eaf613c1a8265bcfd7b0ab690783f2aef519f78a" + "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", + "reference": "eaf613c1a8265bcfd7b0ab690783f2aef519f78a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/eaf613c1a8265bcfd7b0ab690783f2aef519f78a", + "reference": "eaf613c1a8265bcfd7b0ab690783f2aef519f78a", + "shasum": "" + }, + "require": { + "php": ">=5.3", + "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" + }, + "conflict": { + "squizlabs/php_codesniffer": "2.6.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", + "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + }, + "type": "phpcodesniffer-standard", + "autoload": { + "psr-4": { + "PHPCompatibility\\": "PHPCompatibility/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Wim Godden", + "role": "lead" + } + ], + "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP version compatibility.", + "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", + "keywords": [ + "compatibility", + "phpcs", + "standards" + ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", + "source": "https://github.com/PHPCompatibility/PHPCompatibility" + }, + "time": "2018-07-17T13:42:26+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-2.x": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", + "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" + }, + "time": "2020-06-27T09:03:43+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "5.3.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", + "shasum": "" + }, + "require": { + "ext-filter": "*", + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.2", + "phpdocumentor/type-resolver": "^1.3", + "webmozart/assert": "^1.9.1" + }, + "require-dev": { + "mockery/mockery": "~1.3.2", + "psalm/phar": "^4.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + }, + { + "name": "Jaap van Otterdijk", + "email": "account@ijaap.nl" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" + }, + "time": "2021-10-19T17:43:47+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "1.6.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "77a32518733312af16a44300404e945338981de3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/77a32518733312af16a44300404e945338981de3", + "reference": "77a32518733312af16a44300404e945338981de3", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.0" + }, + "require-dev": { + "ext-tokenizer": "*", + "psalm/phar": "^4.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-1.x": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "support": { + "issues": "https://github.com/phpDocumentor/TypeResolver/issues", + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.1" + }, + "time": "2022-03-15T21:29:03+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "v1.15.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/bbcd7380b0ebf3961ee21409db7b38bc31d69a13", + "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.2", + "php": "^7.2 || ~8.0, <8.2", + "phpdocumentor/reflection-docblock": "^5.2", + "sebastian/comparator": "^3.0 || ^4.0", + "sebastian/recursion-context": "^3.0 || ^4.0" + }, + "require-dev": { + "phpspec/phpspec": "^6.0 || ^7.0", + "phpunit/phpunit": "^8.0 || ^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Prophecy\\": "src/Prophecy" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "support": { + "issues": "https://github.com/phpspec/prophecy/issues", + "source": "https://github.com/phpspec/prophecy/tree/v1.15.0" + }, + "time": "2021-12-08T12:19:24+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "9.2.15", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "2e9da11878c4202f97915c1cb4bb1ca318a63f5f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2e9da11878c4202f97915c1cb4bb1ca318a63f5f", + "reference": "2e9da11878c4202f97915c1cb4bb1ca318a63f5f", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.13.0", + "php": ">=7.3", + "phpunit/php-file-iterator": "^3.0.3", + "phpunit/php-text-template": "^2.0.2", + "sebastian/code-unit-reverse-lookup": "^2.0.2", + "sebastian/complexity": "^2.0", + "sebastian/environment": "^5.1.2", + "sebastian/lines-of-code": "^1.0.3", + "sebastian/version": "^3.0.1", + "theseer/tokenizer": "^1.2.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcov": "*", + "ext-xdebug": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.15" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-03-07T09:28:20+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "3.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-12-02T12:48:52+00:00" + }, + { + "name": "phpunit/php-invoker", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcntl": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "keywords": [ + "process" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:58:55+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T05:33:50+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "5.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:16:10+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "9.5.19", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "35ea4b7f3acabb26f4bb640f8c30866c401da807" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/35ea4b7f3acabb26f4bb640f8c30866c401da807", + "reference": "35ea4b7f3acabb26f4bb640f8c30866c401da807", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.3.1", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.10.1", + "phar-io/manifest": "^2.0.3", + "phar-io/version": "^3.0.2", + "php": ">=7.3", + "phpspec/prophecy": "^1.12.1", + "phpunit/php-code-coverage": "^9.2.13", + "phpunit/php-file-iterator": "^3.0.5", + "phpunit/php-invoker": "^3.1.1", + "phpunit/php-text-template": "^2.0.3", + "phpunit/php-timer": "^5.0.2", + "sebastian/cli-parser": "^1.0.1", + "sebastian/code-unit": "^1.0.6", + "sebastian/comparator": "^4.0.5", + "sebastian/diff": "^4.0.3", + "sebastian/environment": "^5.1.3", + "sebastian/exporter": "^4.0.3", + "sebastian/global-state": "^5.0.1", + "sebastian/object-enumerator": "^4.0.3", + "sebastian/resource-operations": "^3.0.3", + "sebastian/type": "^3.0", + "sebastian/version": "^3.0.2" + }, + "require-dev": { + "ext-pdo": "*", + "phpspec/prophecy-phpunit": "^2.0.1" + }, + "suggest": { + "ext-soap": "*", + "ext-xdebug": "*" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.5-dev" + } + }, + "autoload": { + "files": [ + "src/Framework/Assert/Functions.php" + ], + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.19" + }, + "funding": [ + { + "url": "https://phpunit.de/sponsors.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-03-15T09:57:31+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:08:49+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "1.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:08:54+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:30:19+00:00" + }, + { + "name": "sebastian/comparator", + "version": "4.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "55f4261989e546dc112258c7a75935a81a7ce382" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", + "reference": "55f4261989e546dc112258c7a75935a81a7ce382", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/diff": "^4.0", + "sebastian/exporter": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:49:45+00:00" + }, + { + "name": "sebastian/complexity", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.7", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:52:27+00:00" + }, + { + "name": "sebastian/diff", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.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", + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:10:38+00:00" + }, + { + "name": "sebastian/environment", + "version": "5.1.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "388b6ced16caa751030f6a69e588299fa09200ac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/388b6ced16caa751030f6a69e588299fa09200ac", + "reference": "388b6ced16caa751030f6a69e588299fa09200ac", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:52:38+00:00" + }, + { + "name": "sebastian/exporter", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/65e8b7db476c5dd267e65eea9cab77584d3cfff9", + "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "https://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-11-11T14:18:36+00:00" + }, + { + "name": "sebastian/global-state", + "version": "5.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/eaf613c1a8265bcfd7b0ab690783f2aef519f78a", - "reference": "eaf613c1a8265bcfd7b0ab690783f2aef519f78a", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/0ca8db5a5fc9c8646244e629625ac486fa286bf2", + "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2", "shasum": "" }, "require": { - "php": ">=5.3", - "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" - }, - "conflict": { - "squizlabs/php_codesniffer": "2.6.2" + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" }, "require-dev": { - "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" + "ext-dom": "*", + "phpunit/phpunit": "^9.3" }, "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", - "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + "ext-uopz": "*" }, - "type": "phpcodesniffer-standard", - "autoload": { - "psr-4": { - "PHPCompatibility\\": "PHPCompatibility/" + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" } }, + "autoload": { + "classmap": [ + "src/" + ] + }, "notification-url": "https://packagist.org/downloads/", "license": [ - "LGPL-3.0-or-later" + "BSD-3-Clause" ], "authors": [ { - "name": "Wim Godden", - "role": "lead" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" } ], - "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP version compatibility.", - "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", "keywords": [ - "compatibility", - "phpcs", - "standards" + "global state" ], "support": { - "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", - "source": "https://github.com/PHPCompatibility/PHPCompatibility" + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.5" }, - "time": "2018-07-17T13:42:26+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-02-14T08:28:10+00:00" }, { - "name": "phpunit/php-code-coverage", - "version": "1.2.18", + "name": "sebastian/lines-of-code", + "version": "1.0.3", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "fe2466802556d3fe4e4d1d58ffd3ccfd0a19be0b" + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/fe2466802556d3fe4e4d1d58ffd3ccfd0a19be0b", - "reference": "fe2466802556d3fe4e4d1d58ffd3ccfd0a19be0b", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", "shasum": "" }, "require": { - "php": ">=5.3.3", - "phpunit/php-file-iterator": ">=1.3.0@stable", - "phpunit/php-text-template": ">=1.2.0@stable", - "phpunit/php-token-stream": ">=1.1.3,<1.3.0" + "nikic/php-parser": "^4.6", + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "3.7.*@dev" - }, - "suggest": { - "ext-dom": "*", - "ext-xdebug": ">=2.0.5" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.0-dev" } }, "autoload": { "classmap": [ - "PHP/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", "support": { - "irc": "irc://irc.freenode.net/phpunit", - "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/1.2.18" + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3" }, - "time": "2014-09-02T10:13:14+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-28T06:42:11+00:00" }, { - "name": "phpunit/php-file-iterator", - "version": "3.0.6", + "name": "sebastian/object-enumerator", + "version": "4.0.4", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" }, "require-dev": { "phpunit/phpunit": "^9.3" @@ -4489,7 +5994,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -4504,19 +6009,14 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "email": "sebastian@phpunit.de" } ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", "support": { - "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" }, "funding": [ { @@ -4524,20 +6024,20 @@ "type": "github" } ], - "time": "2021-12-02T12:48:52+00:00" + "time": "2020-10-26T13:12:34+00:00" }, { - "name": "phpunit/php-text-template", + "name": "sebastian/object-reflector", "version": "2.0.4", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", "shasum": "" }, "require": { @@ -4564,18 +6064,14 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "email": "sebastian@phpunit.de" } ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", "support": { - "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" }, "funding": [ { @@ -4583,32 +6079,32 @@ "type": "github" } ], - "time": "2020-10-26T05:33:50+00:00" + "time": "2020-10-26T13:14:26+00:00" }, { - "name": "phpunit/php-timer", - "version": "1.0.9", + "name": "sebastian/recursion-context", + "version": "4.0.4", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172", + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -4623,132 +6119,118 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" } ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", "support": { - "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/master" + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.4" }, - "time": "2017-02-26T11:10:40+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:17:30+00:00" }, { - "name": "phpunit/php-token-stream", - "version": "1.2.2", + "name": "sebastian/resource-operations", + "version": "3.0.3", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "ad4e1e23ae01b483c16f600ff1bebec184588e32" + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/ad4e1e23ae01b483c16f600ff1bebec184588e32", - "reference": "ad4e1e23ae01b483c16f600ff1bebec184588e32", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", "shasum": "" }, "require": { - "ext-tokenizer": "*", - "php": ">=5.3.3" + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "3.0-dev" } }, "autoload": { "classmap": [ - "PHP/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "email": "sebastian@phpunit.de" } ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", "support": { - "irc": "irc://irc.freenode.net/phpunit", - "issues": "https://github.com/sebastianbergmann/php-token-stream/issues", - "source": "https://github.com/sebastianbergmann/php-token-stream/tree/1.2.2" + "issues": "https://github.com/sebastianbergmann/resource-operations/issues", + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" }, - "abandoned": true, - "time": "2014-03-03T05:10:30+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:45:17+00:00" }, { - "name": "phpunit/phpunit", - "version": "3.7.18", + "name": "sebastian/type", + "version": "3.0.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "82335c294ae39a59965b0dc2027ac74eb62f53f1" + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "b233b84bc4465aff7b57cf1c4bc75c86d00d6dad" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/82335c294ae39a59965b0dc2027ac74eb62f53f1", - "reference": "82335c294ae39a59965b0dc2027ac74eb62f53f1", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b233b84bc4465aff7b57cf1c4bc75c86d00d6dad", + "reference": "b233b84bc4465aff7b57cf1c4bc75c86d00d6dad", "shasum": "" }, "require": { - "ext-dom": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*", - "php": ">=5.3.3", - "phpunit/php-code-coverage": ">=1.2.1,<1.3.0", - "phpunit/php-file-iterator": ">=1.3.1", - "phpunit/php-text-template": ">=1.1.1", - "phpunit/php-timer": ">=1.0.2,<1.1.0", - "phpunit/phpunit-mock-objects": ">=1.2.0,<1.3.0", - "symfony/yaml": ">=2.2.0" + "php": ">=7.3" }, "require-dev": { - "pear-pear/pear": "1.9.4" - }, - "suggest": { - "ext-json": "*", - "ext-simplexml": "*", - "ext-tokenizer": "*", - "phpunit/php-invoker": ">=1.1.0,<1.2.0" + "phpunit/phpunit": "^9.5" }, - "bin": [ - "composer/bin/phpunit" - ], "type": "library", "extra": { "branch-alias": { - "dev-master": "3.7.x-dev" + "dev-master": "3.0-dev" } }, "autoload": { "classmap": [ - "PHPUnit/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "", - "../../symfony/yaml/" - ], "license": [ "BSD-3-Clause" ], @@ -4759,74 +6241,72 @@ "role": "lead" } ], - "description": "The PHP Unit Testing framework.", - "homepage": "http://www.phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", "support": { - "irc": "irc://irc.freenode.net/phpunit", - "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/3.7.18" + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/3.0.0" }, - "time": "2013-03-07T21:45:39+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-03-15T09:54:48+00:00" }, { - "name": "phpunit/phpunit-mock-objects", - "version": "1.2.3", + "name": "sebastian/version", + "version": "3.0.2", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "5794e3c5c5ba0fb037b11d8151add2a07fa82875" + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c6c1022351a901512170118436c764e473f6de8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/5794e3c5c5ba0fb037b11d8151add2a07fa82875", - "reference": "5794e3c5c5ba0fb037b11d8151add2a07fa82875", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", + "reference": "c6c1022351a901512170118436c764e473f6de8c", "shasum": "" }, "require": { - "php": ">=5.3.3", - "phpunit/php-text-template": ">=1.1.1@stable" - }, - "suggest": { - "ext-soap": "*" + "php": ">=7.3" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, "autoload": { "classmap": [ - "PHPUnit/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", "support": { - "irc": "irc://irc.freenode.net/phpunit", - "issues": "https://github.com/sebastianbergmann/phpunit-mock-objects/issues", - "source": "https://github.com/sebastianbergmann/phpunit-mock-objects/tree/1.2.3" + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" }, - "abandoned": true, - "time": "2013-01-13T10:24:48+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:39:44+00:00" }, { "name": "squizlabs/php_codesniffer", @@ -4884,6 +6364,56 @@ }, "time": "2021-12-12T21:44:58+00:00" }, + { + "name": "theseer/tokenizer", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.2.1" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2021-07-28T10:34:58+00:00" + }, { "name": "wp-coding-standards/wpcs", "version": "0.13.1", From 66859c063912c77b13c2cf36da42637e5b9fe1f1 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 31 Mar 2022 10:47:12 +0530 Subject: [PATCH 0874/1044] Update composer dependencies Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 2 +- composer.lock | 34 +++++++++++++++++----------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/composer.json b/composer.json index 88ed104b3..e179d2511 100644 --- a/composer.json +++ b/composer.json @@ -37,7 +37,7 @@ "easyengine/shell-command": "v1.1.0", "easyengine/site-command": "v3.0.7", "easyengine/site-type-php": "v1.6.2", - "easyengine/site-type-wp": "v1.6.3", + "easyengine/site-type-wp": "v1.6.4", "monolog/monolog": "1.24.0", "mustache/mustache": "2.14.1", "rmccue/requests": "1.8.0", diff --git a/composer.lock b/composer.lock index e4b4405d9..43db1e946 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": "bdfb89cf400a399c5af7a2ee58a20b56", + "content-hash": "e62657f1d83ca45ae75fc8cab53a3643", "packages": [ { "name": "acmephp/core", @@ -1250,16 +1250,16 @@ }, { "name": "easyengine/site-type-wp", - "version": "v1.6.3", + "version": "v1.6.4", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-wp.git", - "reference": "6b6b1281519a290bc132046480ba4acdd583e344" + "reference": "2ccdd7a1a6c80e33a63d5650cbc8dc115372217e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/6b6b1281519a290bc132046480ba4acdd583e344", - "reference": "6b6b1281519a290bc132046480ba4acdd583e344", + "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/2ccdd7a1a6c80e33a63d5650cbc8dc115372217e", + "reference": "2ccdd7a1a6c80e33a63d5650cbc8dc115372217e", "shasum": "" }, "require-dev": { @@ -1303,9 +1303,9 @@ "homepage": "https://github.com/easyengine/site-type-wp", "support": { "issues": "https://github.com/EasyEngine/site-type-wp/issues", - "source": "https://github.com/EasyEngine/site-type-wp/tree/v1.6.3" + "source": "https://github.com/EasyEngine/site-type-wp/tree/v1.6.4" }, - "time": "2022-03-30T07:49:45+00:00" + "time": "2022-03-30T11:56:22+00:00" }, { "name": "guzzlehttp/guzzle", @@ -4226,30 +4226,30 @@ }, { "name": "behat/transliterator", - "version": "v1.3.0", + "version": "v1.5.0", "source": { "type": "git", "url": "https://github.com/Behat/Transliterator.git", - "reference": "3c4ec1d77c3d05caa1f0bf8fb3aae4845005c7fc" + "reference": "baac5873bac3749887d28ab68e2f74db3a4408af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Behat/Transliterator/zipball/3c4ec1d77c3d05caa1f0bf8fb3aae4845005c7fc", - "reference": "3c4ec1d77c3d05caa1f0bf8fb3aae4845005c7fc", + "url": "https://api.github.com/repos/Behat/Transliterator/zipball/baac5873bac3749887d28ab68e2f74db3a4408af", + "reference": "baac5873bac3749887d28ab68e2f74db3a4408af", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.2" }, "require-dev": { "chuyskywalker/rolling-curl": "^3.1", "php-yaoi/php-yaoi": "^1.0", - "phpunit/phpunit": "^4.8.36|^6.3" + "phpunit/phpunit": "^8.5.25 || ^9.5.19" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "1.x-dev" } }, "autoload": { @@ -4269,9 +4269,9 @@ ], "support": { "issues": "https://github.com/Behat/Transliterator/issues", - "source": "https://github.com/Behat/Transliterator/tree/v1.3.0" + "source": "https://github.com/Behat/Transliterator/tree/v1.5.0" }, - "time": "2020-01-14T16:39:13+00:00" + "time": "2022-03-30T09:27:43+00:00" }, { "name": "dealerdirect/phpcodesniffer-composer-installer", @@ -6472,5 +6472,5 @@ "platform-overrides": { "php": "7.3" }, - "plugin-api-version": "2.2.0" + "plugin-api-version": "2.0.0" } From d23fd1d59a4512622f878518e6351fcbe8a4896f Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 31 Mar 2022 15:45:30 +0530 Subject: [PATCH 0875/1044] Skip PHP 8.1 image download in migration Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- .../20181016052850_easyengine_insert_docker_images_version.php | 2 ++ php/EE/Migration/Containers.php | 1 + 2 files changed, 3 insertions(+) diff --git a/migrations/db/20181016052850_easyengine_insert_docker_images_version.php b/migrations/db/20181016052850_easyengine_insert_docker_images_version.php index 5e752b06c..c9f6f1cb5 100644 --- a/migrations/db/20181016052850_easyengine_insert_docker_images_version.php +++ b/migrations/db/20181016052850_easyengine_insert_docker_images_version.php @@ -37,6 +37,8 @@ public function up() { 'easyengine/php7.2', 'easyengine/php7.3', 'easyengine/php7.4', + 'easyengine/php8.0', + 'easyengine/php8.1', 'easyengine/newrelic-daemon', ]; foreach ( $images as $image => $tag ) { diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index b5e261d2a..bb3d54498 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -34,6 +34,7 @@ public static function start_container_migration() { 'easyengine/php7.3', 'easyengine/php7.4', 'easyengine/php8.0', + 'easyengine/php8.1', 'easyengine/newrelic-daemon', ]; From db4a622ce1970cf84f84dbd9f95bc34ca4f17df7 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 31 Mar 2022 18:03:09 +0530 Subject: [PATCH 0876/1044] Update composer dependencies Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 2 +- composer.lock | 29 +++++++++++++++-------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/composer.json b/composer.json index e179d2511..f15598a7e 100644 --- a/composer.json +++ b/composer.json @@ -37,7 +37,7 @@ "easyengine/shell-command": "v1.1.0", "easyengine/site-command": "v3.0.7", "easyengine/site-type-php": "v1.6.2", - "easyengine/site-type-wp": "v1.6.4", + "easyengine/site-type-wp": "v1.6.5", "monolog/monolog": "1.24.0", "mustache/mustache": "2.14.1", "rmccue/requests": "1.8.0", diff --git a/composer.lock b/composer.lock index 43db1e946..fa72dd12b 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": "e62657f1d83ca45ae75fc8cab53a3643", + "content-hash": "7b38c7d1ccdf56aaa5e622991c22d1b6", "packages": [ { "name": "acmephp/core", @@ -1250,16 +1250,16 @@ }, { "name": "easyengine/site-type-wp", - "version": "v1.6.4", + "version": "v1.6.5", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-wp.git", - "reference": "2ccdd7a1a6c80e33a63d5650cbc8dc115372217e" + "reference": "251ced68de2788d16d2f85b641c56bd680f6927d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/2ccdd7a1a6c80e33a63d5650cbc8dc115372217e", - "reference": "2ccdd7a1a6c80e33a63d5650cbc8dc115372217e", + "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/251ced68de2788d16d2f85b641c56bd680f6927d", + "reference": "251ced68de2788d16d2f85b641c56bd680f6927d", "shasum": "" }, "require-dev": { @@ -1303,9 +1303,9 @@ "homepage": "https://github.com/easyengine/site-type-wp", "support": { "issues": "https://github.com/EasyEngine/site-type-wp/issues", - "source": "https://github.com/EasyEngine/site-type-wp/tree/v1.6.4" + "source": "https://github.com/EasyEngine/site-type-wp/tree/v1.6.5" }, - "time": "2022-03-30T11:56:22+00:00" + "time": "2022-03-31T11:52:42+00:00" }, { "name": "guzzlehttp/guzzle", @@ -2255,23 +2255,24 @@ }, { "name": "seld/jsonlint", - "version": "1.8.3", + "version": "1.8.9", "source": { "type": "git", "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "9ad6ce79c342fbd44df10ea95511a1b24dee5b57" + "reference": "d9a308b84277a7dd651ba89bf5ed37b88497b171" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/9ad6ce79c342fbd44df10ea95511a1b24dee5b57", - "reference": "9ad6ce79c342fbd44df10ea95511a1b24dee5b57", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/d9a308b84277a7dd651ba89bf5ed37b88497b171", + "reference": "d9a308b84277a7dd651ba89bf5ed37b88497b171", "shasum": "" }, "require": { "php": "^5.3 || ^7.0 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "phpstan/phpstan": "^0.12.59", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0 || ^8.5.13" }, "bin": [ "bin/jsonlint" @@ -2302,7 +2303,7 @@ ], "support": { "issues": "https://github.com/Seldaek/jsonlint/issues", - "source": "https://github.com/Seldaek/jsonlint/tree/1.8.3" + "source": "https://github.com/Seldaek/jsonlint/tree/1.8.9" }, "funding": [ { @@ -2314,7 +2315,7 @@ "type": "tidelift" } ], - "time": "2020-11-11T09:19:24+00:00" + "time": "2022-03-31T11:30:35+00:00" }, { "name": "seld/phar-utils", From 4cdd547e8affb2ac24cef040883d1957a446c19b Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 28 Apr 2022 12:29:35 +0530 Subject: [PATCH 0877/1044] Update composer dependencies Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 4 +- composer.lock | 222 +++++++++++++++++++++++++------------------------- 2 files changed, 113 insertions(+), 113 deletions(-) diff --git a/composer.json b/composer.json index f15598a7e..9f152a938 100644 --- a/composer.json +++ b/composer.json @@ -35,9 +35,9 @@ "easyengine/mailhog-command": "v1.0.2", "easyengine/service-command": "v1.4.0", "easyengine/shell-command": "v1.1.0", - "easyengine/site-command": "v3.0.7", + "easyengine/site-command": "v3.0.8", "easyengine/site-type-php": "v1.6.2", - "easyengine/site-type-wp": "v1.6.5", + "easyengine/site-type-wp": "v1.6.6", "monolog/monolog": "1.24.0", "mustache/mustache": "2.14.1", "rmccue/requests": "1.8.0", diff --git a/composer.lock b/composer.lock index fa72dd12b..83a814163 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": "7b38c7d1ccdf56aaa5e622991c22d1b6", + "content-hash": "e12f9b55df8388eb2c159f0afdd91b9a", "packages": [ { "name": "acmephp/core", @@ -1115,16 +1115,16 @@ }, { "name": "easyengine/site-command", - "version": "v3.0.7", + "version": "v3.0.8", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "fe76cc35fe598d97b41dc6b5495ba1b5db53164f" + "reference": "25c67cb7263159989648c8f7d7defbb38834afd7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/fe76cc35fe598d97b41dc6b5495ba1b5db53164f", - "reference": "fe76cc35fe598d97b41dc6b5495ba1b5db53164f", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/25c67cb7263159989648c8f7d7defbb38834afd7", + "reference": "25c67cb7263159989648c8f7d7defbb38834afd7", "shasum": "" }, "require": { @@ -1185,9 +1185,9 @@ "homepage": "https://github.com/easyengine/site-command", "support": { "issues": "https://github.com/EasyEngine/site-command/issues", - "source": "https://github.com/EasyEngine/site-command/tree/v3.0.7" + "source": "https://github.com/EasyEngine/site-command/tree/v3.0.8" }, - "time": "2022-03-30T07:49:15+00:00" + "time": "2022-04-28T06:40:02+00:00" }, { "name": "easyengine/site-type-php", @@ -1250,16 +1250,16 @@ }, { "name": "easyengine/site-type-wp", - "version": "v1.6.5", + "version": "v1.6.6", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-wp.git", - "reference": "251ced68de2788d16d2f85b641c56bd680f6927d" + "reference": "d3cbd48f743fadbba081a652b2cfeb4c7c5fa4c6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/251ced68de2788d16d2f85b641c56bd680f6927d", - "reference": "251ced68de2788d16d2f85b641c56bd680f6927d", + "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/d3cbd48f743fadbba081a652b2cfeb4c7c5fa4c6", + "reference": "d3cbd48f743fadbba081a652b2cfeb4c7c5fa4c6", "shasum": "" }, "require-dev": { @@ -1303,9 +1303,9 @@ "homepage": "https://github.com/easyengine/site-type-wp", "support": { "issues": "https://github.com/EasyEngine/site-type-wp/issues", - "source": "https://github.com/EasyEngine/site-type-wp/tree/v1.6.5" + "source": "https://github.com/EasyEngine/site-type-wp/tree/v1.6.6" }, - "time": "2022-03-31T11:52:42+00:00" + "time": "2022-04-28T06:41:32+00:00" }, { "name": "guzzlehttp/guzzle", @@ -1572,16 +1572,16 @@ }, { "name": "justinrainbow/json-schema", - "version": "5.2.11", + "version": "5.2.12", "source": { "type": "git", "url": "https://github.com/justinrainbow/json-schema.git", - "reference": "2ab6744b7296ded80f8cc4f9509abbff393399aa" + "reference": "ad87d5a5ca981228e0e205c2bc7dfb8e24559b60" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/2ab6744b7296ded80f8cc4f9509abbff393399aa", - "reference": "2ab6744b7296ded80f8cc4f9509abbff393399aa", + "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/ad87d5a5ca981228e0e205c2bc7dfb8e24559b60", + "reference": "ad87d5a5ca981228e0e205c2bc7dfb8e24559b60", "shasum": "" }, "require": { @@ -1636,9 +1636,9 @@ ], "support": { "issues": "https://github.com/justinrainbow/json-schema/issues", - "source": "https://github.com/justinrainbow/json-schema/tree/5.2.11" + "source": "https://github.com/justinrainbow/json-schema/tree/5.2.12" }, - "time": "2021-07-22T09:24:00+00:00" + "time": "2022-04-13T08:02:27+00:00" }, { "name": "league/flysystem", @@ -1736,16 +1736,16 @@ }, { "name": "league/mime-type-detection", - "version": "1.9.0", + "version": "1.11.0", "source": { "type": "git", "url": "https://github.com/thephpleague/mime-type-detection.git", - "reference": "aa70e813a6ad3d1558fc927863d47309b4c23e69" + "reference": "ff6248ea87a9f116e78edd6002e39e5128a0d4dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/aa70e813a6ad3d1558fc927863d47309b4c23e69", - "reference": "aa70e813a6ad3d1558fc927863d47309b4c23e69", + "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/ff6248ea87a9f116e78edd6002e39e5128a0d4dd", + "reference": "ff6248ea87a9f116e78edd6002e39e5128a0d4dd", "shasum": "" }, "require": { @@ -1776,7 +1776,7 @@ "description": "Mime-type detection for Flysystem", "support": { "issues": "https://github.com/thephpleague/mime-type-detection/issues", - "source": "https://github.com/thephpleague/mime-type-detection/tree/1.9.0" + "source": "https://github.com/thephpleague/mime-type-detection/tree/1.11.0" }, "funding": [ { @@ -1788,7 +1788,7 @@ "type": "tidelift" } ], - "time": "2021-11-21T11:48:40+00:00" + "time": "2022-04-17T13:12:02+00:00" }, { "name": "monolog/monolog", @@ -2255,23 +2255,23 @@ }, { "name": "seld/jsonlint", - "version": "1.8.9", + "version": "1.9.0", "source": { "type": "git", "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "d9a308b84277a7dd651ba89bf5ed37b88497b171" + "reference": "4211420d25eba80712bff236a98960ef68b866b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/d9a308b84277a7dd651ba89bf5ed37b88497b171", - "reference": "d9a308b84277a7dd651ba89bf5ed37b88497b171", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/4211420d25eba80712bff236a98960ef68b866b7", + "reference": "4211420d25eba80712bff236a98960ef68b866b7", "shasum": "" }, "require": { "php": "^5.3 || ^7.0 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^0.12.59", + "phpstan/phpstan": "^1.5", "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0 || ^8.5.13" }, "bin": [ @@ -2303,7 +2303,7 @@ ], "support": { "issues": "https://github.com/Seldaek/jsonlint/issues", - "source": "https://github.com/Seldaek/jsonlint/tree/1.8.9" + "source": "https://github.com/Seldaek/jsonlint/tree/1.9.0" }, "funding": [ { @@ -2315,7 +2315,7 @@ "type": "tidelift" } ], - "time": "2022-03-31T11:30:35+00:00" + "time": "2022-04-01T13:37:23+00:00" }, { "name": "seld/phar-utils", @@ -2367,16 +2367,16 @@ }, { "name": "symfony/config", - "version": "v4.4.37", + "version": "v4.4.41", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "e8c2d2c951ddedecb6d28954d336cb7d2e852d0e" + "reference": "9d031eb2d4292aed117b0f7fafd5c436dcf3dfd7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/e8c2d2c951ddedecb6d28954d336cb7d2e852d0e", - "reference": "e8c2d2c951ddedecb6d28954d336cb7d2e852d0e", + "url": "https://api.github.com/repos/symfony/config/zipball/9d031eb2d4292aed117b0f7fafd5c436dcf3dfd7", + "reference": "9d031eb2d4292aed117b0f7fafd5c436dcf3dfd7", "shasum": "" }, "require": { @@ -2425,7 +2425,7 @@ "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/config/tree/v4.4.37" + "source": "https://github.com/symfony/config/tree/v4.4.41" }, "funding": [ { @@ -2441,20 +2441,20 @@ "type": "tidelift" } ], - "time": "2022-01-03T09:46:22+00:00" + "time": "2022-04-12T15:19:55+00:00" }, { "name": "symfony/console", - "version": "v4.4.38", + "version": "v4.4.41", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "5a50085bf5460f0c0d60a50b58388c1249826b8a" + "reference": "0e1e62083b20ccb39c2431293de060f756af905c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/5a50085bf5460f0c0d60a50b58388c1249826b8a", - "reference": "5a50085bf5460f0c0d60a50b58388c1249826b8a", + "url": "https://api.github.com/repos/symfony/console/zipball/0e1e62083b20ccb39c2431293de060f756af905c", + "reference": "0e1e62083b20ccb39c2431293de060f756af905c", "shasum": "" }, "require": { @@ -2515,7 +2515,7 @@ "description": "Eases the creation of beautiful and testable command line interfaces", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/console/tree/v4.4.38" + "source": "https://github.com/symfony/console/tree/v4.4.41" }, "funding": [ { @@ -2531,20 +2531,20 @@ "type": "tidelift" } ], - "time": "2022-01-30T21:23:57+00:00" + "time": "2022-04-12T15:19:55+00:00" }, { "name": "symfony/debug", - "version": "v4.4.37", + "version": "v4.4.41", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "5de6c6e7f52b364840e53851c126be4d71e60470" + "reference": "6637e62480b60817b9a6984154a533e8e64c6bd5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/5de6c6e7f52b364840e53851c126be4d71e60470", - "reference": "5de6c6e7f52b364840e53851c126be4d71e60470", + "url": "https://api.github.com/repos/symfony/debug/zipball/6637e62480b60817b9a6984154a533e8e64c6bd5", + "reference": "6637e62480b60817b9a6984154a533e8e64c6bd5", "shasum": "" }, "require": { @@ -2583,7 +2583,7 @@ "description": "Provides tools to ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/debug/tree/v4.4.37" + "source": "https://github.com/symfony/debug/tree/v4.4.41" }, "funding": [ { @@ -2599,20 +2599,20 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:41:36+00:00" + "time": "2022-04-12T15:19:55+00:00" }, { "name": "symfony/dependency-injection", - "version": "v4.4.39", + "version": "v4.4.41", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "5d0fbcdb9317864b2bd9e49d570d88ae512cadf3" + "reference": "74c7f55de0eced4d3c9654809b1871870386a577" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/5d0fbcdb9317864b2bd9e49d570d88ae512cadf3", - "reference": "5d0fbcdb9317864b2bd9e49d570d88ae512cadf3", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/74c7f55de0eced4d3c9654809b1871870386a577", + "reference": "74c7f55de0eced4d3c9654809b1871870386a577", "shasum": "" }, "require": { @@ -2669,7 +2669,7 @@ "description": "Allows you to standardize and centralize the way objects are constructed in your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v4.4.39" + "source": "https://github.com/symfony/dependency-injection/tree/v4.4.41" }, "funding": [ { @@ -2685,20 +2685,20 @@ "type": "tidelift" } ], - "time": "2022-03-02T12:36:39+00:00" + "time": "2022-04-12T15:19:55+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v2.5.0", + "version": "v2.5.1", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8" + "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/6f981ee24cf69ee7ce9736146d1c57c2780598a8", - "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66", + "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66", "shasum": "" }, "require": { @@ -2736,7 +2736,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.0" + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.1" }, "funding": [ { @@ -2752,7 +2752,7 @@ "type": "tidelift" } ], - "time": "2021-07-12T14:48:14+00:00" + "time": "2022-01-02T09:53:40+00:00" }, { "name": "symfony/event-dispatcher", @@ -2840,16 +2840,16 @@ }, { "name": "symfony/event-dispatcher-contracts", - "version": "v1.1.11", + "version": "v1.1.12", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "01e9a4efac0ee33a05dfdf93b346f62e7d0e998c" + "reference": "1d5cd762abaa6b2a4169d3e77610193a7157129e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/01e9a4efac0ee33a05dfdf93b346f62e7d0e998c", - "reference": "01e9a4efac0ee33a05dfdf93b346f62e7d0e998c", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/1d5cd762abaa6b2a4169d3e77610193a7157129e", + "reference": "1d5cd762abaa6b2a4169d3e77610193a7157129e", "shasum": "" }, "require": { @@ -2899,7 +2899,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v1.1.11" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v1.1.12" }, "funding": [ { @@ -2915,7 +2915,7 @@ "type": "tidelift" } ], - "time": "2021-03-23T15:25:38+00:00" + "time": "2022-01-02T09:41:36+00:00" }, { "name": "symfony/filesystem", @@ -2982,16 +2982,16 @@ }, { "name": "symfony/finder", - "version": "v4.4.37", + "version": "v4.4.41", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "b17d76d7ed179f017aad646e858c90a2771af15d" + "reference": "40790bdf293b462798882ef6da72bb49a4a6633a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/b17d76d7ed179f017aad646e858c90a2771af15d", - "reference": "b17d76d7ed179f017aad646e858c90a2771af15d", + "url": "https://api.github.com/repos/symfony/finder/zipball/40790bdf293b462798882ef6da72bb49a4a6633a", + "reference": "40790bdf293b462798882ef6da72bb49a4a6633a", "shasum": "" }, "require": { @@ -3024,7 +3024,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v4.4.37" + "source": "https://github.com/symfony/finder/tree/v4.4.41" }, "funding": [ { @@ -3040,7 +3040,7 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:41:36+00:00" + "time": "2022-04-14T15:36:10+00:00" }, { "name": "symfony/polyfill-ctype", @@ -3450,16 +3450,16 @@ }, { "name": "symfony/process", - "version": "v4.4.37", + "version": "v4.4.41", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "b2d924e5a4cb284f293d5092b1dbf0d364cb8b67" + "reference": "9eedd60225506d56e42210a70c21bb80ca8456ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/b2d924e5a4cb284f293d5092b1dbf0d364cb8b67", - "reference": "b2d924e5a4cb284f293d5092b1dbf0d364cb8b67", + "url": "https://api.github.com/repos/symfony/process/zipball/9eedd60225506d56e42210a70c21bb80ca8456ce", + "reference": "9eedd60225506d56e42210a70c21bb80ca8456ce", "shasum": "" }, "require": { @@ -3492,7 +3492,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v4.4.37" + "source": "https://github.com/symfony/process/tree/v4.4.41" }, "funding": [ { @@ -3508,7 +3508,7 @@ "type": "tidelift" } ], - "time": "2022-01-27T17:14:04+00:00" + "time": "2022-04-04T10:19:07+00:00" }, { "name": "symfony/serializer", @@ -3594,22 +3594,22 @@ }, { "name": "symfony/service-contracts", - "version": "v2.5.0", + "version": "v2.5.1", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc" + "reference": "24d9dc654b83e91aa59f9d167b131bc3b5bea24c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc", - "reference": "1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/24d9dc654b83e91aa59f9d167b131bc3b5bea24c", + "reference": "24d9dc654b83e91aa59f9d167b131bc3b5bea24c", "shasum": "" }, "require": { "php": ">=7.2.5", "psr/container": "^1.1", - "symfony/deprecation-contracts": "^2.1" + "symfony/deprecation-contracts": "^2.1|^3" }, "conflict": { "ext-psr": "<1.1|>=2" @@ -3657,7 +3657,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v2.5.0" + "source": "https://github.com/symfony/service-contracts/tree/v2.5.1" }, "funding": [ { @@ -3673,20 +3673,20 @@ "type": "tidelift" } ], - "time": "2021-11-04T16:48:04+00:00" + "time": "2022-03-13T20:07:29+00:00" }, { "name": "symfony/translation", - "version": "v4.4.37", + "version": "v4.4.41", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "4ce00d6875230b839f5feef82e51971f6c886e00" + "reference": "dcb67eae126e74507e0b4f0b9ac6ef35b37c3331" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/4ce00d6875230b839f5feef82e51971f6c886e00", - "reference": "4ce00d6875230b839f5feef82e51971f6c886e00", + "url": "https://api.github.com/repos/symfony/translation/zipball/dcb67eae126e74507e0b4f0b9ac6ef35b37c3331", + "reference": "dcb67eae126e74507e0b4f0b9ac6ef35b37c3331", "shasum": "" }, "require": { @@ -3746,7 +3746,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v4.4.37" + "source": "https://github.com/symfony/translation/tree/v4.4.41" }, "funding": [ { @@ -3762,20 +3762,20 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:41:36+00:00" + "time": "2022-04-21T07:22:34+00:00" }, { "name": "symfony/translation-contracts", - "version": "v2.5.0", + "version": "v2.5.1", "source": { "type": "git", "url": "https://github.com/symfony/translation-contracts.git", - "reference": "d28150f0f44ce854e942b671fc2620a98aae1b1e" + "reference": "1211df0afa701e45a04253110e959d4af4ef0f07" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/d28150f0f44ce854e942b671fc2620a98aae1b1e", - "reference": "d28150f0f44ce854e942b671fc2620a98aae1b1e", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/1211df0afa701e45a04253110e959d4af4ef0f07", + "reference": "1211df0afa701e45a04253110e959d4af4ef0f07", "shasum": "" }, "require": { @@ -3824,7 +3824,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/translation-contracts/tree/v2.5.0" + "source": "https://github.com/symfony/translation-contracts/tree/v2.5.1" }, "funding": [ { @@ -3840,7 +3840,7 @@ "type": "tidelift" } ], - "time": "2021-08-17T14:20:01+00:00" + "time": "2022-01-02T09:53:40+00:00" }, { "name": "symfony/yaml", @@ -5244,16 +5244,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.19", + "version": "9.5.20", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "35ea4b7f3acabb26f4bb640f8c30866c401da807" + "reference": "12bc8879fb65aef2138b26fc633cb1e3620cffba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/35ea4b7f3acabb26f4bb640f8c30866c401da807", - "reference": "35ea4b7f3acabb26f4bb640f8c30866c401da807", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/12bc8879fb65aef2138b26fc633cb1e3620cffba", + "reference": "12bc8879fb65aef2138b26fc633cb1e3620cffba", "shasum": "" }, "require": { @@ -5331,7 +5331,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.19" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.20" }, "funding": [ { @@ -5343,7 +5343,7 @@ "type": "github" } ], - "time": "2022-03-15T09:57:31+00:00" + "time": "2022-04-01T12:37:26+00:00" }, { "name": "sebastian/cli-parser", @@ -5711,16 +5711,16 @@ }, { "name": "sebastian/environment", - "version": "5.1.3", + "version": "5.1.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "388b6ced16caa751030f6a69e588299fa09200ac" + "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/388b6ced16caa751030f6a69e588299fa09200ac", - "reference": "388b6ced16caa751030f6a69e588299fa09200ac", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/1b5dff7bb151a4db11d49d90e5408e4e938270f7", + "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7", "shasum": "" }, "require": { @@ -5762,7 +5762,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/5.1.3" + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.4" }, "funding": [ { @@ -5770,7 +5770,7 @@ "type": "github" } ], - "time": "2020-09-28T05:52:38+00:00" + "time": "2022-04-03T09:37:03+00:00" }, { "name": "sebastian/exporter", From e6ab5110602cbc92c5b8e94796dc58cef4c37453 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 28 Apr 2022 12:30:01 +0530 Subject: [PATCH 0878/1044] Bump to version v4.5.5 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 0ed2bfe96..3afbea712 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.5.4 +4.5.5 From 82f47e927b92ed3e6f48cf2fa3b95ce552b9d2d2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 28 Apr 2022 07:00:50 +0000 Subject: [PATCH 0879/1044] Bump composer/composer from 2.1.9 to 2.2.12 Bumps [composer/composer](https://github.com/composer/composer) from 2.1.9 to 2.2.12. - [Release notes](https://github.com/composer/composer/releases) - [Changelog](https://github.com/composer/composer/blob/main/CHANGELOG.md) - [Commits](https://github.com/composer/composer/compare/2.1.9...2.2.12) --- updated-dependencies: - dependency-name: composer/composer dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> --- composer.json | 2 +- composer.lock | 43 ++++++++++++++++++++++--------------------- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/composer.json b/composer.json index 9f152a938..30ee498e1 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ "prefer-stable": true, "require": { "php": ">=7.0", - "composer/composer": "2.1.9", + "composer/composer": "2.2.12", "composer/semver": "3.2.4", "easyengine/admin-tools-command": "v1.1.0", "easyengine/auth-command": "v1.2.0", diff --git a/composer.lock b/composer.lock index 83a814163..52a1d69a0 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": "e12f9b55df8388eb2c159f0afdd91b9a", + "content-hash": "69aeadb532e1666635d7167b040f9d77", "packages": [ { "name": "acmephp/core", @@ -274,31 +274,32 @@ }, { "name": "composer/composer", - "version": "2.1.9", + "version": "2.2.12", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "e558c88f28d102d497adec4852802c0dc14c7077" + "reference": "ba61e768b410736efe61df01b61f1ec44f51474f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/e558c88f28d102d497adec4852802c0dc14c7077", - "reference": "e558c88f28d102d497adec4852802c0dc14c7077", + "url": "https://api.github.com/repos/composer/composer/zipball/ba61e768b410736efe61df01b61f1ec44f51474f", + "reference": "ba61e768b410736efe61df01b61f1ec44f51474f", "shasum": "" }, "require": { "composer/ca-bundle": "^1.0", "composer/metadata-minifier": "^1.0", + "composer/pcre": "^1.0", "composer/semver": "^3.0", "composer/spdx-licenses": "^1.2", - "composer/xdebug-handler": "^2.0", + "composer/xdebug-handler": "^2.0 || ^3.0", "justinrainbow/json-schema": "^5.2.11", "php": "^5.3.2 || ^7.0 || ^8.0", - "psr/log": "^1.0", + "psr/log": "^1.0 || ^2.0", "react/promise": "^1.2 || ^2.7", "seld/jsonlint": "^1.4", "seld/phar-utils": "^1.0", - "symfony/console": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0", + "symfony/console": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0", "symfony/filesystem": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0", "symfony/finder": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0", "symfony/process": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0" @@ -318,7 +319,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1-dev" + "dev-main": "2.2-dev" } }, "autoload": { @@ -352,7 +353,7 @@ "support": { "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/composer/issues", - "source": "https://github.com/composer/composer/tree/2.1.9" + "source": "https://github.com/composer/composer/tree/2.2.12" }, "funding": [ { @@ -368,7 +369,7 @@ "type": "tidelift" } ], - "time": "2021-10-05T07:47:38+00:00" + "time": "2022-04-13T14:42:25+00:00" }, { "name": "composer/metadata-minifier", @@ -673,27 +674,27 @@ }, { "name": "composer/xdebug-handler", - "version": "2.0.5", + "version": "3.0.3", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "9e36aeed4616366d2b690bdce11f71e9178c579a" + "reference": "ced299686f41dce890debac69273b47ffe98a40c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/9e36aeed4616366d2b690bdce11f71e9178c579a", - "reference": "9e36aeed4616366d2b690bdce11f71e9178c579a", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ced299686f41dce890debac69273b47ffe98a40c", + "reference": "ced299686f41dce890debac69273b47ffe98a40c", "shasum": "" }, "require": { - "composer/pcre": "^1", - "php": "^5.3.2 || ^7.0 || ^8.0", + "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", - "symfony/phpunit-bridge": "^4.2 || ^5.0 || ^6.0" + "symfony/phpunit-bridge": "^6.0" }, "type": "library", "autoload": { @@ -719,7 +720,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/2.0.5" + "source": "https://github.com/composer/xdebug-handler/tree/3.0.3" }, "funding": [ { @@ -735,7 +736,7 @@ "type": "tidelift" } ], - "time": "2022-02-24T20:20:32+00:00" + "time": "2022-02-25T21:32:43+00:00" }, { "name": "easyengine/admin-tools-command", @@ -6473,5 +6474,5 @@ "platform-overrides": { "php": "7.3" }, - "plugin-api-version": "2.0.0" + "plugin-api-version": "2.3.0" } From d05add8980280287dd351356b4f639c4001fc26c Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Fri, 29 Apr 2022 12:28:52 +0530 Subject: [PATCH 0880/1044] Update composer dependencies Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 2 +- composer.lock | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index 30ee498e1..49b2e33d8 100644 --- a/composer.json +++ b/composer.json @@ -37,7 +37,7 @@ "easyengine/shell-command": "v1.1.0", "easyengine/site-command": "v3.0.8", "easyengine/site-type-php": "v1.6.2", - "easyengine/site-type-wp": "v1.6.6", + "easyengine/site-type-wp": "v1.6.7", "monolog/monolog": "1.24.0", "mustache/mustache": "2.14.1", "rmccue/requests": "1.8.0", diff --git a/composer.lock b/composer.lock index 52a1d69a0..fbf0e3152 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": "69aeadb532e1666635d7167b040f9d77", + "content-hash": "da76fb412f02b6d13f7e8a0198feba9f", "packages": [ { "name": "acmephp/core", @@ -1251,16 +1251,16 @@ }, { "name": "easyengine/site-type-wp", - "version": "v1.6.6", + "version": "v1.6.7", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-wp.git", - "reference": "d3cbd48f743fadbba081a652b2cfeb4c7c5fa4c6" + "reference": "7fa3c2a032154952ff6e8c8cabbb9f40e0df7759" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/d3cbd48f743fadbba081a652b2cfeb4c7c5fa4c6", - "reference": "d3cbd48f743fadbba081a652b2cfeb4c7c5fa4c6", + "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/7fa3c2a032154952ff6e8c8cabbb9f40e0df7759", + "reference": "7fa3c2a032154952ff6e8c8cabbb9f40e0df7759", "shasum": "" }, "require-dev": { @@ -1304,9 +1304,9 @@ "homepage": "https://github.com/easyengine/site-type-wp", "support": { "issues": "https://github.com/EasyEngine/site-type-wp/issues", - "source": "https://github.com/EasyEngine/site-type-wp/tree/v1.6.6" + "source": "https://github.com/EasyEngine/site-type-wp/tree/v1.6.7" }, - "time": "2022-04-28T06:41:32+00:00" + "time": "2022-04-29T06:57:26+00:00" }, { "name": "guzzlehttp/guzzle", @@ -6474,5 +6474,5 @@ "platform-overrides": { "php": "7.3" }, - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.0.0" } From bec04116e4a188b61ce2175ece30a8948c9abfcb Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Fri, 27 May 2022 08:41:40 +0530 Subject: [PATCH 0881/1044] Add skip-tty as global flag Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- php/config-spec.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/php/config-spec.php b/php/config-spec.php index c6b92302f..23f045145 100644 --- a/php/config-spec.php +++ b/php/config-spec.php @@ -52,6 +52,13 @@ 'desc' => 'Whether to add sysctl config in docker-compose.', ), + 'skip-tty' => array( + 'runtime' => '=<true/false>', + 'file' => '<bool>', + 'default' => false, + 'desc' => 'Skip tty allocation for remote command execution.', + ), + 'ee_installer_version' => array( 'file' => '<path>', 'default' => null, From 99b3daa667b5ba327763e4835516345b099d4112 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Fri, 27 May 2022 08:44:25 +0530 Subject: [PATCH 0882/1044] Add docker_compose_exec helper function Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- php/class-ee-docker.php | 44 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php index ae17a7a65..960a8aa5a 100644 --- a/php/class-ee-docker.php +++ b/php/class-ee-docker.php @@ -183,7 +183,7 @@ public static function disconnect_site_network_from( $site_name, $from_container * @return bool success. */ public static function docker_compose_up( $dir, $services = [] ) { - $fs = new Filesystem(); + $chdir_return_code = chdir( $dir ); if ( $chdir_return_code ) { if ( empty( $services ) ) { @@ -198,6 +198,48 @@ public static function docker_compose_up( $dir, $services = [] ) { return false; } + /** + * Function to exec and run commands into the containers. + * + * @param string $command Command to exec. + * @param string $service Service to exec command into. + * @param string $shell Shell in which exec command will be executed. + * @param string $user User to execute command into. + * @param String $dir Path to docker-compose.yml. + * @param bool $shell_wrapper If shell wrapper should be enabled or not. + * @param bool $exit_on_error To exit or not on error. + * + * @return bool success. + */ + public static function docker_compose_exec( $command = '', $service = '', $shell = 'sh', $user = '', $dir = '', $shell_wrapper = false, $exit_on_error = false ) { + + if ( ! empty( $dir ) ) { + $chdir_return_code = chdir( $dir ); + } else { + $chdir_return_code = true; + } + + $skip_tty = \EE::get_runner()->config['skip-tty']; + $tty = empty( $skip_tty ) ? '' : '-T'; + + if ( $chdir_return_code ) { + + $user_string = ''; + if ( $user ) { + $user_string = empty( $user ) ? '' : "--user='$user'"; + } + + if ( $shell_wrapper ) { + return EE::exec( \EE_DOCKER::docker_compose_with_custom() . " exec $tty $user_string $service $shell -c \"$command\"", true, true, [], $exit_on_error ); + } else { + return EE::exec( \EE_DOCKER::docker_compose_with_custom() . " exec $tty $user_string $service $command", true, true, [], $exit_on_error ); + } + + } + + return false; + } + /** * Function to check if a network exists * From d4371c11d767ce02febc4bb30fd1bb44e23226a9 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Fri, 27 May 2022 09:24:44 +0530 Subject: [PATCH 0883/1044] Add obfuscation support Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- php/class-ee-docker.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php index 960a8aa5a..109e90b71 100644 --- a/php/class-ee-docker.php +++ b/php/class-ee-docker.php @@ -201,17 +201,18 @@ public static function docker_compose_up( $dir, $services = [] ) { /** * Function to exec and run commands into the containers. * - * @param string $command Command to exec. - * @param string $service Service to exec command into. - * @param string $shell Shell in which exec command will be executed. - * @param string $user User to execute command into. - * @param String $dir Path to docker-compose.yml. - * @param bool $shell_wrapper If shell wrapper should be enabled or not. - * @param bool $exit_on_error To exit or not on error. + * @param string $command Command to exec. + * @param string $service Service to exec command into. + * @param string $shell Shell in which exec command will be executed. + * @param string $user User to execute command into. + * @param String $dir Path to docker-compose.yml. + * @param bool $shell_wrapper If shell wrapper should be enabled or not. + * @param bool $exit_on_error To exit or not on error. + * @param array $exec_obfuscate Data to be obfuscated from log. * * @return bool success. */ - public static function docker_compose_exec( $command = '', $service = '', $shell = 'sh', $user = '', $dir = '', $shell_wrapper = false, $exit_on_error = false ) { + public static function docker_compose_exec( $command = '', $service = '', $shell = 'sh', $user = '', $dir = '', $shell_wrapper = false, $exit_on_error = false, $exec_obfuscate = [] ) { if ( ! empty( $dir ) ) { $chdir_return_code = chdir( $dir ); @@ -230,9 +231,9 @@ public static function docker_compose_exec( $command = '', $service = '', $shell } if ( $shell_wrapper ) { - return EE::exec( \EE_DOCKER::docker_compose_with_custom() . " exec $tty $user_string $service $shell -c \"$command\"", true, true, [], $exit_on_error ); + return EE::exec( \EE_DOCKER::docker_compose_with_custom() . " exec $tty $user_string $service $shell -c \"$command\"", true, true, $exec_obfuscate, $exit_on_error ); } else { - return EE::exec( \EE_DOCKER::docker_compose_with_custom() . " exec $tty $user_string $service $command", true, true, [], $exit_on_error ); + return EE::exec( \EE_DOCKER::docker_compose_with_custom() . " exec $tty $user_string $service $command", true, true, $exec_obfuscate, $exit_on_error ); } } From e7559fc9fba4c8a5f8825638e82c3435b99653c0 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Fri, 27 May 2022 10:11:36 +0530 Subject: [PATCH 0884/1044] Add stdout/stderr option Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- php/class-ee-docker.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php index 109e90b71..856e0704e 100644 --- a/php/class-ee-docker.php +++ b/php/class-ee-docker.php @@ -209,10 +209,12 @@ public static function docker_compose_up( $dir, $services = [] ) { * @param bool $shell_wrapper If shell wrapper should be enabled or not. * @param bool $exit_on_error To exit or not on error. * @param array $exec_obfuscate Data to be obfuscated from log. + * @param bool $echo_stdout Output stdout of exec if true. + * @param bool $echo_stderr Output stderr of exec if true. * * @return bool success. */ - public static function docker_compose_exec( $command = '', $service = '', $shell = 'sh', $user = '', $dir = '', $shell_wrapper = false, $exit_on_error = false, $exec_obfuscate = [] ) { + public static function docker_compose_exec( $command = '', $service = '', $shell = 'sh', $user = '', $dir = '', $shell_wrapper = false, $exit_on_error = false, $exec_obfuscate = [], $echo_stdout = false, $echo_stderr = false ) { if ( ! empty( $dir ) ) { $chdir_return_code = chdir( $dir ); @@ -231,9 +233,9 @@ public static function docker_compose_exec( $command = '', $service = '', $shell } if ( $shell_wrapper ) { - return EE::exec( \EE_DOCKER::docker_compose_with_custom() . " exec $tty $user_string $service $shell -c \"$command\"", true, true, $exec_obfuscate, $exit_on_error ); + return EE::exec( \EE_DOCKER::docker_compose_with_custom() . " exec $tty $user_string $service $shell -c \"$command\"", $echo_stdout, $echo_stderr, $exec_obfuscate, $exit_on_error ); } else { - return EE::exec( \EE_DOCKER::docker_compose_with_custom() . " exec $tty $user_string $service $command", true, true, $exec_obfuscate, $exit_on_error ); + return EE::exec( \EE_DOCKER::docker_compose_with_custom() . " exec $tty $user_string $service $command", $echo_stdout, $echo_stderr, $exec_obfuscate, $exit_on_error ); } } From d1c61862afa50eebc3b9de1ea2e26781d43dc0ba Mon Sep 17 00:00:00 2001 From: PiyushKhurana <khuranapiyush27@gmail.com> Date: Tue, 31 May 2022 17:38:07 +0530 Subject: [PATCH 0885/1044] Update composer packages --- composer.json | 10 ++-- composer.lock | 148 +++++++++++++++++++++++++------------------------- 2 files changed, 79 insertions(+), 79 deletions(-) diff --git a/composer.json b/composer.json index 49b2e33d8..7f8097ddd 100644 --- a/composer.json +++ b/composer.json @@ -32,12 +32,12 @@ "easyengine/config-command": "v1.0.2", "easyengine/cron-command": "v1.2.0", "easyengine/log-command": "v1.1.0", - "easyengine/mailhog-command": "v1.0.2", + "easyengine/mailhog-command": "v1.0.3", "easyengine/service-command": "v1.4.0", - "easyengine/shell-command": "v1.1.0", - "easyengine/site-command": "v3.0.8", - "easyengine/site-type-php": "v1.6.2", - "easyengine/site-type-wp": "v1.6.7", + "easyengine/shell-command": "v1.1.1", + "easyengine/site-command": "v3.0.9", + "easyengine/site-type-php": "v1.6.3", + "easyengine/site-type-wp": "v1.6.8", "monolog/monolog": "1.24.0", "mustache/mustache": "2.14.1", "rmccue/requests": "1.8.0", diff --git a/composer.lock b/composer.lock index fbf0e3152..1b52b99fa 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": "da76fb412f02b6d13f7e8a0198feba9f", + "content-hash": "0d3cce44b917d07bf6c35657f218021c", "packages": [ { "name": "acmephp/core", @@ -198,16 +198,16 @@ }, { "name": "composer/ca-bundle", - "version": "1.3.1", + "version": "1.3.2", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "4c679186f2aca4ab6a0f1b0b9cf9252decb44d0b" + "reference": "fd5dd441932a7e10ca6e5b490e272d34c8430640" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/4c679186f2aca4ab6a0f1b0b9cf9252decb44d0b", - "reference": "4c679186f2aca4ab6a0f1b0b9cf9252decb44d0b", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/fd5dd441932a7e10ca6e5b490e272d34c8430640", + "reference": "fd5dd441932a7e10ca6e5b490e272d34c8430640", "shasum": "" }, "require": { @@ -254,7 +254,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.3.1" + "source": "https://github.com/composer/ca-bundle/tree/1.3.2" }, "funding": [ { @@ -270,7 +270,7 @@ "type": "tidelift" } ], - "time": "2021-10-28T20:44:15+00:00" + "time": "2022-05-24T11:56:16+00:00" }, { "name": "composer/composer", @@ -594,16 +594,16 @@ }, { "name": "composer/spdx-licenses", - "version": "1.5.6", + "version": "1.5.7", "source": { "type": "git", "url": "https://github.com/composer/spdx-licenses.git", - "reference": "a30d487169d799745ca7280bc90fdfa693536901" + "reference": "c848241796da2abf65837d51dce1fae55a960149" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/a30d487169d799745ca7280bc90fdfa693536901", - "reference": "a30d487169d799745ca7280bc90fdfa693536901", + "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/c848241796da2abf65837d51dce1fae55a960149", + "reference": "c848241796da2abf65837d51dce1fae55a960149", "shasum": "" }, "require": { @@ -654,7 +654,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/spdx-licenses/issues", - "source": "https://github.com/composer/spdx-licenses/tree/1.5.6" + "source": "https://github.com/composer/spdx-licenses/tree/1.5.7" }, "funding": [ { @@ -670,7 +670,7 @@ "type": "tidelift" } ], - "time": "2021-11-18T10:14:14+00:00" + "time": "2022-05-23T07:37:50+00:00" }, { "name": "composer/xdebug-handler", @@ -976,16 +976,16 @@ }, { "name": "easyengine/mailhog-command", - "version": "v1.0.2", + "version": "v1.0.3", "source": { "type": "git", "url": "https://github.com/EasyEngine/mailhog-command.git", - "reference": "91e8b16c136a65f6c76268322d45061cc02dbb12" + "reference": "1dee0473dfb7011a15af7dae549794d7ab9e2946" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/mailhog-command/zipball/91e8b16c136a65f6c76268322d45061cc02dbb12", - "reference": "91e8b16c136a65f6c76268322d45061cc02dbb12", + "url": "https://api.github.com/repos/EasyEngine/mailhog-command/zipball/1dee0473dfb7011a15af7dae549794d7ab9e2946", + "reference": "1dee0473dfb7011a15af7dae549794d7ab9e2946", "shasum": "" }, "type": "ee-cli-package", @@ -1017,9 +1017,9 @@ "homepage": "https://github.com/easyengine/mailhog-command", "support": { "issues": "https://github.com/EasyEngine/mailhog-command/issues", - "source": "https://github.com/EasyEngine/mailhog-command/tree/master" + "source": "https://github.com/EasyEngine/mailhog-command/tree/v1.0.3" }, - "time": "2018-12-28T16:05:53+00:00" + "time": "2022-05-31T11:42:28+00:00" }, { "name": "easyengine/service-command", @@ -1072,16 +1072,16 @@ }, { "name": "easyengine/shell-command", - "version": "v1.1.0", + "version": "v1.1.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/shell-command.git", - "reference": "e87c21c2b31073f0aa38348d87556cd99b1d85c3" + "reference": "08475c777671cbf9feff7240910bcf14d298331a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/shell-command/zipball/e87c21c2b31073f0aa38348d87556cd99b1d85c3", - "reference": "e87c21c2b31073f0aa38348d87556cd99b1d85c3", + "url": "https://api.github.com/repos/EasyEngine/shell-command/zipball/08475c777671cbf9feff7240910bcf14d298331a", + "reference": "08475c777671cbf9feff7240910bcf14d298331a", "shasum": "" }, "type": "ee-cli-package", @@ -1110,22 +1110,22 @@ "homepage": "https://github.com/easyengine/shell-command", "support": { "issues": "https://github.com/EasyEngine/shell-command/issues", - "source": "https://github.com/EasyEngine/shell-command/tree/v1.1.0" + "source": "https://github.com/EasyEngine/shell-command/tree/v1.1.1" }, - "time": "2021-06-16T14:20:17+00:00" + "time": "2022-05-31T11:46:57+00:00" }, { "name": "easyengine/site-command", - "version": "v3.0.8", + "version": "v3.0.9", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "25c67cb7263159989648c8f7d7defbb38834afd7" + "reference": "232a80ba1e1214844f17d3830b0a6cd435a2ad74" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/25c67cb7263159989648c8f7d7defbb38834afd7", - "reference": "25c67cb7263159989648c8f7d7defbb38834afd7", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/232a80ba1e1214844f17d3830b0a6cd435a2ad74", + "reference": "232a80ba1e1214844f17d3830b0a6cd435a2ad74", "shasum": "" }, "require": { @@ -1186,22 +1186,22 @@ "homepage": "https://github.com/easyengine/site-command", "support": { "issues": "https://github.com/EasyEngine/site-command/issues", - "source": "https://github.com/EasyEngine/site-command/tree/v3.0.8" + "source": "https://github.com/EasyEngine/site-command/tree/v3.0.9" }, - "time": "2022-04-28T06:40:02+00:00" + "time": "2022-05-31T11:48:43+00:00" }, { "name": "easyengine/site-type-php", - "version": "v1.6.2", + "version": "v1.6.3", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-php.git", - "reference": "8b7546f58e2b08004b84d5f6d4e5e2faedbecf8d" + "reference": "25b401f0c3988b5d4db066b5254c28d4a3308de1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/8b7546f58e2b08004b84d5f6d4e5e2faedbecf8d", - "reference": "8b7546f58e2b08004b84d5f6d4e5e2faedbecf8d", + "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/25b401f0c3988b5d4db066b5254c28d4a3308de1", + "reference": "25b401f0c3988b5d4db066b5254c28d4a3308de1", "shasum": "" }, "require-dev": { @@ -1245,22 +1245,22 @@ "homepage": "https://github.com/easyengine/site-type-php", "support": { "issues": "https://github.com/EasyEngine/site-type-php/issues", - "source": "https://github.com/EasyEngine/site-type-php/tree/v1.6.2" + "source": "https://github.com/EasyEngine/site-type-php/tree/v1.6.3" }, - "time": "2022-03-30T07:49:59+00:00" + "time": "2022-05-31T11:49:54+00:00" }, { "name": "easyengine/site-type-wp", - "version": "v1.6.7", + "version": "v1.6.8", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-wp.git", - "reference": "7fa3c2a032154952ff6e8c8cabbb9f40e0df7759" + "reference": "ad2efa76281b3b9af7e0a4d88a54369920ed4b15" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/7fa3c2a032154952ff6e8c8cabbb9f40e0df7759", - "reference": "7fa3c2a032154952ff6e8c8cabbb9f40e0df7759", + "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/ad2efa76281b3b9af7e0a4d88a54369920ed4b15", + "reference": "ad2efa76281b3b9af7e0a4d88a54369920ed4b15", "shasum": "" }, "require-dev": { @@ -1304,9 +1304,9 @@ "homepage": "https://github.com/easyengine/site-type-wp", "support": { "issues": "https://github.com/EasyEngine/site-type-wp/issues", - "source": "https://github.com/EasyEngine/site-type-wp/tree/v1.6.7" + "source": "https://github.com/EasyEngine/site-type-wp/tree/v1.6.8" }, - "time": "2022-04-29T06:57:26+00:00" + "time": "2022-05-31T11:51:03+00:00" }, { "name": "guzzlehttp/guzzle", @@ -2368,16 +2368,16 @@ }, { "name": "symfony/config", - "version": "v4.4.41", + "version": "v4.4.42", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "9d031eb2d4292aed117b0f7fafd5c436dcf3dfd7" + "reference": "83cdafd1bd3370de23e3dc2ed01026908863be81" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/9d031eb2d4292aed117b0f7fafd5c436dcf3dfd7", - "reference": "9d031eb2d4292aed117b0f7fafd5c436dcf3dfd7", + "url": "https://api.github.com/repos/symfony/config/zipball/83cdafd1bd3370de23e3dc2ed01026908863be81", + "reference": "83cdafd1bd3370de23e3dc2ed01026908863be81", "shasum": "" }, "require": { @@ -2426,7 +2426,7 @@ "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/config/tree/v4.4.41" + "source": "https://github.com/symfony/config/tree/v4.4.42" }, "funding": [ { @@ -2442,20 +2442,20 @@ "type": "tidelift" } ], - "time": "2022-04-12T15:19:55+00:00" + "time": "2022-05-17T07:10:14+00:00" }, { "name": "symfony/console", - "version": "v4.4.41", + "version": "v4.4.42", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "0e1e62083b20ccb39c2431293de060f756af905c" + "reference": "cce7a9f99e22937a71a16b23afa762558808d587" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/0e1e62083b20ccb39c2431293de060f756af905c", - "reference": "0e1e62083b20ccb39c2431293de060f756af905c", + "url": "https://api.github.com/repos/symfony/console/zipball/cce7a9f99e22937a71a16b23afa762558808d587", + "reference": "cce7a9f99e22937a71a16b23afa762558808d587", "shasum": "" }, "require": { @@ -2516,7 +2516,7 @@ "description": "Eases the creation of beautiful and testable command line interfaces", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/console/tree/v4.4.41" + "source": "https://github.com/symfony/console/tree/v4.4.42" }, "funding": [ { @@ -2532,7 +2532,7 @@ "type": "tidelift" } ], - "time": "2022-04-12T15:19:55+00:00" + "time": "2022-05-14T12:35:33+00:00" }, { "name": "symfony/debug", @@ -2604,16 +2604,16 @@ }, { "name": "symfony/dependency-injection", - "version": "v4.4.41", + "version": "v4.4.42", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "74c7f55de0eced4d3c9654809b1871870386a577" + "reference": "f6fdbf252765a09c7ac243617f79f1babef792c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/74c7f55de0eced4d3c9654809b1871870386a577", - "reference": "74c7f55de0eced4d3c9654809b1871870386a577", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/f6fdbf252765a09c7ac243617f79f1babef792c9", + "reference": "f6fdbf252765a09c7ac243617f79f1babef792c9", "shasum": "" }, "require": { @@ -2670,7 +2670,7 @@ "description": "Allows you to standardize and centralize the way objects are constructed in your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v4.4.41" + "source": "https://github.com/symfony/dependency-injection/tree/v4.4.42" }, "funding": [ { @@ -2686,7 +2686,7 @@ "type": "tidelift" } ], - "time": "2022-04-12T15:19:55+00:00" + "time": "2022-05-24T15:15:52+00:00" }, { "name": "symfony/deprecation-contracts", @@ -2757,16 +2757,16 @@ }, { "name": "symfony/event-dispatcher", - "version": "v4.4.37", + "version": "v4.4.42", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "3ccfcfb96ecce1217d7b0875a0736976bc6e63dc" + "reference": "708e761740c16b02c86e3f0c932018a06b895d40" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/3ccfcfb96ecce1217d7b0875a0736976bc6e63dc", - "reference": "3ccfcfb96ecce1217d7b0875a0736976bc6e63dc", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/708e761740c16b02c86e3f0c932018a06b895d40", + "reference": "708e761740c16b02c86e3f0c932018a06b895d40", "shasum": "" }, "require": { @@ -2821,7 +2821,7 @@ "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/v4.4.37" + "source": "https://github.com/symfony/event-dispatcher/tree/v4.4.42" }, "funding": [ { @@ -2837,7 +2837,7 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:41:36+00:00" + "time": "2022-05-05T15:33:49+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -2920,16 +2920,16 @@ }, { "name": "symfony/filesystem", - "version": "v4.4.39", + "version": "v4.4.42", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "72a5b35fecaa670b13954e6eaf414acbe2a67b35" + "reference": "815412ee8971209bd4c1eecd5f4f481eacd44bf5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/72a5b35fecaa670b13954e6eaf414acbe2a67b35", - "reference": "72a5b35fecaa670b13954e6eaf414acbe2a67b35", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/815412ee8971209bd4c1eecd5f4f481eacd44bf5", + "reference": "815412ee8971209bd4c1eecd5f4f481eacd44bf5", "shasum": "" }, "require": { @@ -2963,7 +2963,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v4.4.39" + "source": "https://github.com/symfony/filesystem/tree/v4.4.42" }, "funding": [ { @@ -2979,7 +2979,7 @@ "type": "tidelift" } ], - "time": "2022-02-25T10:38:15+00:00" + "time": "2022-05-20T08:49:14+00:00" }, { "name": "symfony/finder", @@ -6474,5 +6474,5 @@ "platform-overrides": { "php": "7.3" }, - "plugin-api-version": "2.0.0" + "plugin-api-version": "2.3.0" } From 8cb7d16ccd91d872552f2d6de9edbbb123e64554 Mon Sep 17 00:00:00 2001 From: PiyushKhurana <khuranapiyush27@gmail.com> Date: Tue, 31 May 2022 17:39:09 +0530 Subject: [PATCH 0886/1044] Bump to version v4.5.6 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 3afbea712..bb8dc6360 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.5.5 +4.5.6 From edf28af75d6ee8b6669dd97253e8ded2214778be Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 20 Jun 2022 09:57:33 +0530 Subject: [PATCH 0887/1044] Define custom docker-compose dir Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- php/EE/Runner.php | 1 + 1 file changed, 1 insertion(+) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 42d2d51be..b078a6333 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -57,6 +57,7 @@ private function init_ee() { define( 'DB', EE_ROOT_DIR . '/db/ee.sqlite' ); define( 'LOCALHOST_IP', '127.0.0.1' ); define( 'SITE_CUSTOM_DOCKER_COMPOSE', 'docker-compose-custom.yml' ); + define( 'SITE_CUSTOM_DOCKER_COMPOSE_DIR', 'user-docker-compose' ); $db_dir = dirname( DB ); if ( ! is_dir( $db_dir ) ) { From ec0017c294b56de78023ae281944e7c1ab45eb31 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 20 Jun 2022 09:58:02 +0530 Subject: [PATCH 0888/1044] Define custom-compose global flag Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- php/config-spec.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/php/config-spec.php b/php/config-spec.php index 23f045145..6baafa840 100644 --- a/php/config-spec.php +++ b/php/config-spec.php @@ -59,6 +59,13 @@ 'desc' => 'Skip tty allocation for remote command execution.', ), + 'custom-compose' => array( + 'runtime' => '=<custom-compose file>', + 'file' => '<custom-compose>', + 'default' => null, + 'desc' => 'Path to custom compose file.', + ), + 'ee_installer_version' => array( 'file' => '<path>', 'default' => null, From 1e6fbd104636bbd800614d8bc1867fa569975307 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 20 Jun 2022 09:58:24 +0530 Subject: [PATCH 0889/1044] Update docker lib for custom compose dir Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- php/class-ee-docker.php | 102 +++++++++++++++++++++++++++++++--------- 1 file changed, 81 insertions(+), 21 deletions(-) diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php index 856e0704e..97f5962a3 100644 --- a/php/class-ee-docker.php +++ b/php/class-ee-docker.php @@ -8,21 +8,52 @@ class EE_DOCKER { * Function to return docker-compose command with custom docker-compose files * * @param array $files_before_custom Files to be included before custom compose file is included + * * @return string */ - public static function docker_compose_with_custom( array $files_before_custom = [] ) : string { + public static function docker_compose_with_custom( array $files_before_custom = [] ): string { + $fs = new Filesystem(); - $command = 'docker-compose -f docker-compose.yml'; + $command = 'docker-compose -f '; + + $cusotm_compose = \EE::get_runner()->config['custom-compose']; - foreach ( $files_before_custom as $file ) { - if ( $fs->exists( $file ) ) { - $command .= ' -f ' . $file ; + if ( ! empty( $cusotm_compose ) ) { + $cusotm_compose_path = SITE_CUSTOM_DOCKER_COMPOSE_DIR . '/' . $cusotm_compose; + if ( SITE_CUSTOM_DOCKER_COMPOSE === $cusotm_compose ) { + if ( $fs->exists( SITE_CUSTOM_DOCKER_COMPOSE ) ) { + $cusotm_compose_path = SITE_CUSTOM_DOCKER_COMPOSE; + } + } + if ( $fs->exists( $cusotm_compose_path ) ) { + $command .= $cusotm_compose_path; + } else { + EE::warning( 'File: ' . $cusotm_compose_path . ' does not exist. Falling back to default compose file.' ); + $command .= 'docker-compose.yml'; + } + } else { + $command .= 'docker-compose.yml'; + + if ( $fs->exists( SITE_CUSTOM_DOCKER_COMPOSE_DIR ) ) { + $cusotm_compose_files = array_diff( scandir( SITE_CUSTOM_DOCKER_COMPOSE_DIR ), [ '.', '..' ] ); + $cusotm_compose_files = array_map( function ( $arrayValues ) { + + return SITE_CUSTOM_DOCKER_COMPOSE_DIR . '/' . $arrayValues; + }, $cusotm_compose_files ); + + $files_before_custom = array_unique( array_merge( $files_before_custom, $cusotm_compose_files ) ); + } + + foreach ( $files_before_custom as $file ) { + if ( $fs->exists( $file ) ) { + $command .= ' -f ' . $file; + } } - } - if ( $fs->exists( SITE_CUSTOM_DOCKER_COMPOSE ) ) { - $command .= ' -f ' . SITE_CUSTOM_DOCKER_COMPOSE ; + if ( $fs->exists( SITE_CUSTOM_DOCKER_COMPOSE ) ) { + $command .= ' -f ' . SITE_CUSTOM_DOCKER_COMPOSE; + } } return $command; @@ -37,6 +68,7 @@ public static function docker_compose_with_custom( array $files_before_custom = * @return bool success. */ public static function boot_container( $container, $command = '' ) { + $status = self::container_status( $container ); if ( $status ) { if ( 'exited' === $status ) { @@ -50,6 +82,7 @@ public static function boot_container( $container, $command = '' ) { } public static function container_status( $container ) { + $exec_command = 'which docker'; exec( $exec_command, $out, $ret ); EE::debug( 'COMMAND: ' . $exec_command ); @@ -77,6 +110,7 @@ public static function container_status( $container ) { * @return bool success. */ public static function start_container( $container ) { + return EE::exec( "docker start $container" ); } @@ -88,6 +122,7 @@ public static function start_container( $container ) { * @return bool success. */ public static function stop_container( $container ) { + return EE::exec( "docker stop $container" ); } @@ -99,6 +134,7 @@ public static function stop_container( $container ) { * @return bool success. */ public static function restart_container( $container ) { + return EE::exec( "docker restart $container" ); } @@ -110,6 +146,7 @@ public static function restart_container( $container ) { * @return bool success. */ public static function create_network( $name ) { + return EE::exec( "docker network create $name --label=org.label-schema.vendor=\"EasyEngine\" " ); } @@ -122,6 +159,7 @@ public static function create_network( $name ) { * @return bool success. */ public static function connect_network( $name, $connect_to ) { + return EE::exec( "docker network connect $name $connect_to" ); } @@ -133,6 +171,7 @@ public static function connect_network( $name, $connect_to ) { * @return bool success. */ public static function rm_network( $name ) { + return EE::exec( "docker network rm $name" ); } @@ -145,6 +184,7 @@ public static function rm_network( $name ) { * @return bool success. */ public static function disconnect_network( $name, $connected_to ) { + return EE::exec( "docker network disconnect $name $connected_to" ); } @@ -177,8 +217,8 @@ public static function disconnect_site_network_from( $site_name, $from_container /** * Function to boot the containers. * - * @param String $dir Path to docker-compose.yml. - * @param array $services Services to bring up. + * @param String $dir Path to docker-compose.yml. + * @param array $services Services to bring up. * * @return bool success. */ @@ -191,7 +231,7 @@ public static function docker_compose_up( $dir, $services = [] ) { } else { $all_services = implode( ' ', $services ); - return EE::exec( \EE_DOCKER::docker_compose_with_custom() . ' up -d '. $all_services ); + return EE::exec( \EE_DOCKER::docker_compose_with_custom() . ' up -d ' . $all_services ); } } @@ -251,6 +291,7 @@ public static function docker_compose_exec( $command = '', $service = '', $shell * @return bool Network exists or not */ public static function docker_network_exists( string $network ) { + return EE::exec( "docker network inspect $network" ); } @@ -262,6 +303,7 @@ public static function docker_network_exists( string $network ) { * @return bool success. */ public static function docker_compose_down( $dir ) { + $chdir_return_code = chdir( $dir ); if ( $chdir_return_code ) { @@ -280,11 +322,26 @@ public static function docker_compose_down( $dir ) { * @return bool Whether service is available or not. */ public static function service_exists( $service, $site_fs_path ) { - chdir( $site_fs_path ); + + return in_array( $service, \EE_DOCKER::get_services( $site_fs_path ), true ); + } + + /** + * Get list of all docker-compose services. + * + * @param string $site_fs_path Path to the site root where docker-compose.yml file is present. + * + * @return bool Whether service is available or not. + */ + public static function get_services( $site_fs_path = '' ) { + + if ( ! empty( $site_fs_path ) ) { + chdir( $site_fs_path ); + } $launch = EE::launch( \EE_DOCKER::docker_compose_with_custom() . ' config --services' ); $services = explode( PHP_EOL, trim( $launch->stdout ) ); - return in_array( $service, $services, true ); + return $services; } /** @@ -295,20 +352,21 @@ public static function service_exists( $service, $site_fs_path ) { * @return string prefix derived from the name. */ public static function get_docker_style_prefix( $site_url ) { + return str_replace( [ '.', '-' ], '', $site_url ); } /** * Function to create external docker volumes and related symlinks. * - * @param string $prefix Prefix by volumes have to be created. - * @param array $volumes The volumes to be created. - * $volumes[$key]['name'] => specifies the name of volume to be created. - * $volumes[$key]['path_to_symlink'] => specifies the path to symlink the - * created volume. - * $volumes[$key]['skip_volume'] => if set to `true` will skip volume creation - * for that entry. - * @param bool $update_to_docker_prefix Update the prefix in dockerized style. + * @param string $prefix Prefix by volumes have to be created. + * @param array $volumes The volumes to be created. + * $volumes[$key]['name'] => specifies the name of volume to be created. + * $volumes[$key]['path_to_symlink'] => specifies the path to symlink the + * created volume. + * $volumes[$key]['skip_volume'] => if set to `true` will skip volume + * creation for that entry. + * @param bool $update_to_docker_prefix Update the prefix in dockerized style. */ public static function create_volumes( $prefix, $volumes, $update_to_docker_prefix = true ) { @@ -357,6 +415,7 @@ public static function create_volumes( $prefix, $volumes, $update_to_docker_pref * @return array Found containers. */ public static function get_volumes_by_label( $label ) { + $launch = EE::launch( sprintf( 'docker volume ls --filter="label=org.label-schema.vendor=EasyEngine" --filter="label=io.easyengine.site=%s" -q', $label ) ); return array_filter( explode( PHP_EOL, trim( $launch->stdout ) ), 'trim' ); @@ -390,4 +449,5 @@ public static function get_mounting_volume_array( $extended_vols ) { return $final_mount_volumes; } + } From a9e676dec330eaf08b21d647bb2dc246e266cb51 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Wed, 22 Jun 2022 15:33:32 +0530 Subject: [PATCH 0890/1044] Update docker images Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- img-versions.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/img-versions.json b/img-versions.json index 414bede6f..c6526fca9 100644 --- a/img-versions.json +++ b/img-versions.json @@ -4,14 +4,14 @@ "easyengine/mariadb": "v4.1.3", "easyengine/nginx-proxy": "v4.5.0", "easyengine/nginx": "v4.5.4", - "easyengine/php": "v4.5.4", - "easyengine/php5.6": "v4.0.0", - "easyengine/php7.0": "v4.1.7", - "easyengine/php7.2": "v4.1.7", - "easyengine/php7.3": "v4.5.4", - "easyengine/php7.4": "v4.5.4", - "easyengine/php8.0": "v4.5.4", - "easyengine/php8.1": "v4.5.4", + "easyengine/php": "v4.6.0", + "easyengine/php5.6": "v4.6.0", + "easyengine/php7.0": "v4.6.0", + "easyengine/php7.2": "v4.6.0", + "easyengine/php7.3": "v4.6.0", + "easyengine/php7.4": "v4.6.0", + "easyengine/php8.0": "v4.6.0", + "easyengine/php8.1": "v4.6.0", "easyengine/postfix": "v4.1.5", "easyengine/redis": "v4.4.3", "easyengine/newrelic-daemon": "v4.3.0" From b80c17f1574d71229e2def7b84361faa6e6843b3 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Wed, 22 Jun 2022 15:33:41 +0530 Subject: [PATCH 0891/1044] Update composer packages Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 6 +-- composer.lock | 122 +++++++++++++++++++++++++------------------------- 2 files changed, 64 insertions(+), 64 deletions(-) diff --git a/composer.json b/composer.json index 7f8097ddd..3a22f105e 100644 --- a/composer.json +++ b/composer.json @@ -35,9 +35,9 @@ "easyengine/mailhog-command": "v1.0.3", "easyengine/service-command": "v1.4.0", "easyengine/shell-command": "v1.1.1", - "easyengine/site-command": "v3.0.9", - "easyengine/site-type-php": "v1.6.3", - "easyengine/site-type-wp": "v1.6.8", + "easyengine/site-command": "v3.1.0", + "easyengine/site-type-php": "v1.7.0", + "easyengine/site-type-wp": "v1.7.0", "monolog/monolog": "1.24.0", "mustache/mustache": "2.14.1", "rmccue/requests": "1.8.0", diff --git a/composer.lock b/composer.lock index 1b52b99fa..8f1e9e1f5 100644 --- a/composer.lock +++ b/composer.lock @@ -1463,16 +1463,16 @@ }, { "name": "guzzlehttp/psr7", - "version": "1.8.5", + "version": "1.9.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "337e3ad8e5716c15f9657bd214d16cc5e69df268" + "reference": "e98e3e6d4f86621a9b75f623996e6bbdeb4b9318" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/337e3ad8e5716c15f9657bd214d16cc5e69df268", - "reference": "337e3ad8e5716c15f9657bd214d16cc5e69df268", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/e98e3e6d4f86621a9b75f623996e6bbdeb4b9318", + "reference": "e98e3e6d4f86621a9b75f623996e6bbdeb4b9318", "shasum": "" }, "require": { @@ -1493,7 +1493,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7-dev" + "dev-master": "1.9-dev" } }, "autoload": { @@ -1553,7 +1553,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/1.8.5" + "source": "https://github.com/guzzle/psr7/tree/1.9.0" }, "funding": [ { @@ -1569,7 +1569,7 @@ "type": "tidelift" } ], - "time": "2022-03-20T21:51:18+00:00" + "time": "2022-06-20T21:43:03+00:00" }, { "name": "justinrainbow/json-schema", @@ -2600,6 +2600,7 @@ "type": "tidelift" } ], + "abandoned": "symfony/error-handler", "time": "2022-04-12T15:19:55+00:00" }, { @@ -3045,16 +3046,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.25.0", + "version": "v1.26.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "30885182c981ab175d4d034db0f6f469898070ab" + "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab", - "reference": "30885182c981ab175d4d034db0f6f469898070ab", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", + "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", "shasum": "" }, "require": { @@ -3069,7 +3070,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3107,7 +3108,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.26.0" }, "funding": [ { @@ -3123,20 +3124,20 @@ "type": "tidelift" } ], - "time": "2021-10-20T20:35:02+00:00" + "time": "2022-05-24T11:49:31+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.25.0", + "version": "v1.26.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825" + "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825", - "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", + "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", "shasum": "" }, "require": { @@ -3151,7 +3152,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3190,7 +3191,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0" }, "funding": [ { @@ -3206,20 +3207,20 @@ "type": "tidelift" } ], - "time": "2021-11-30T18:21:41+00:00" + "time": "2022-05-24T11:49:31+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.25.0", + "version": "v1.26.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5" + "reference": "e440d35fa0286f77fb45b79a03fedbeda9307e85" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/cc5db0e22b3cb4111010e48785a97f670b350ca5", - "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/e440d35fa0286f77fb45b79a03fedbeda9307e85", + "reference": "e440d35fa0286f77fb45b79a03fedbeda9307e85", "shasum": "" }, "require": { @@ -3228,7 +3229,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3269,7 +3270,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.26.0" }, "funding": [ { @@ -3285,20 +3286,20 @@ "type": "tidelift" } ], - "time": "2021-06-05T21:20:04+00:00" + "time": "2022-05-24T11:49:31+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.25.0", + "version": "v1.26.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c" + "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/4407588e0d3f1f52efb65fbe92babe41f37fe50c", - "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/cfa0ae98841b9e461207c13ab093d76b0fa7bace", + "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace", "shasum": "" }, "require": { @@ -3307,7 +3308,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3352,7 +3353,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.26.0" }, "funding": [ { @@ -3368,20 +3369,20 @@ "type": "tidelift" } ], - "time": "2022-03-04T08:16:47+00:00" + "time": "2022-05-10T07:21:04+00:00" }, { "name": "symfony/polyfill-php81", - "version": "v1.25.0", + "version": "v1.26.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f" + "reference": "13f6d1271c663dc5ae9fb843a8f16521db7687a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/5de4ba2d41b15f9bd0e19b2ab9674135813ec98f", - "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/13f6d1271c663dc5ae9fb843a8f16521db7687a1", + "reference": "13f6d1271c663dc5ae9fb843a8f16521db7687a1", "shasum": "" }, "require": { @@ -3390,7 +3391,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3431,7 +3432,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.26.0" }, "funding": [ { @@ -3447,7 +3448,7 @@ "type": "tidelift" } ], - "time": "2021-09-13T13:58:11+00:00" + "time": "2022-05-24T11:49:31+00:00" }, { "name": "symfony/process", @@ -4476,16 +4477,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.13.2", + "version": "v4.14.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "210577fe3cf7badcc5814d99455df46564f3c077" + "reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/210577fe3cf7badcc5814d99455df46564f3c077", - "reference": "210577fe3cf7badcc5814d99455df46564f3c077", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/34bea19b6e03d8153165d8f30bba4c3be86184c1", + "reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1", "shasum": "" }, "require": { @@ -4526,9 +4527,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.2" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.14.0" }, - "time": "2021-11-30T19:35:32+00:00" + "time": "2022-05-31T20:59:12+00:00" }, { "name": "phar-io/manifest", @@ -5245,16 +5246,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.20", + "version": "9.5.21", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "12bc8879fb65aef2138b26fc633cb1e3620cffba" + "reference": "0e32b76be457de00e83213528f6bb37e2a38fcb1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/12bc8879fb65aef2138b26fc633cb1e3620cffba", - "reference": "12bc8879fb65aef2138b26fc633cb1e3620cffba", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0e32b76be457de00e83213528f6bb37e2a38fcb1", + "reference": "0e32b76be457de00e83213528f6bb37e2a38fcb1", "shasum": "" }, "require": { @@ -5288,7 +5289,6 @@ "sebastian/version": "^3.0.2" }, "require-dev": { - "ext-pdo": "*", "phpspec/prophecy-phpunit": "^2.0.1" }, "suggest": { @@ -5332,7 +5332,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.20" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.21" }, "funding": [ { @@ -5344,7 +5344,7 @@ "type": "github" } ], - "time": "2022-04-01T12:37:26+00:00" + "time": "2022-06-19T12:14:25+00:00" }, { "name": "sebastian/cli-parser", @@ -6312,16 +6312,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.6.2", + "version": "3.7.1", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a" + "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/5e4e71592f69da17871dba6e80dd51bce74a351a", - "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/1359e176e9307e906dc3d890bcc9603ff6d90619", + "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619", "shasum": "" }, "require": { @@ -6364,7 +6364,7 @@ "source": "https://github.com/squizlabs/PHP_CodeSniffer", "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" }, - "time": "2021-12-12T21:44:58+00:00" + "time": "2022-06-18T07:21:10+00:00" }, { "name": "theseer/tokenizer", @@ -6474,5 +6474,5 @@ "platform-overrides": { "php": "7.3" }, - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.0.0" } From 66a83c6435b1fcf7658b5eec58ab77c2724f1dac Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Wed, 22 Jun 2022 15:34:35 +0530 Subject: [PATCH 0892/1044] Update composer packages Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.lock | 353 +++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 323 insertions(+), 30 deletions(-) diff --git a/composer.lock b/composer.lock index 8f1e9e1f5..8620d337c 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": "0d3cce44b917d07bf6c35657f218021c", + "content-hash": "fd64cdb193933ea711c1088db932671d", "packages": [ { "name": "acmephp/core", @@ -1116,23 +1116,23 @@ }, { "name": "easyengine/site-command", - "version": "v3.0.9", + "version": "v3.1.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "232a80ba1e1214844f17d3830b0a6cd435a2ad74" + "reference": "63bf95c245c6125dfcc54bd507413b2a93ffa7de" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/232a80ba1e1214844f17d3830b0a6cd435a2ad74", - "reference": "232a80ba1e1214844f17d3830b0a6cd435a2ad74", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/63bf95c245c6125dfcc54bd507413b2a93ffa7de", + "reference": "63bf95c245c6125dfcc54bd507413b2a93ffa7de", "shasum": "" }, "require": { "acmephp/core": "1.2.0", "cloudflare/sdk": "1.1.1", "ext-openssl": "*", - "guzzlehttp/guzzle": "6.3.3", + "guzzlehttp/guzzle": "6.5.8", "league/flysystem": "1.1.4", "symfony/serializer": "3.4.20", "webmozart/assert": "1.10.0" @@ -1186,22 +1186,22 @@ "homepage": "https://github.com/easyengine/site-command", "support": { "issues": "https://github.com/EasyEngine/site-command/issues", - "source": "https://github.com/EasyEngine/site-command/tree/v3.0.9" + "source": "https://github.com/EasyEngine/site-command/tree/v3.1.0" }, - "time": "2022-05-31T11:48:43+00:00" + "time": "2022-06-22T09:54:19+00:00" }, { "name": "easyengine/site-type-php", - "version": "v1.6.3", + "version": "v1.7.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-php.git", - "reference": "25b401f0c3988b5d4db066b5254c28d4a3308de1" + "reference": "70c69bbdd2fa742c169f5c294a027e648d10665f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/25b401f0c3988b5d4db066b5254c28d4a3308de1", - "reference": "25b401f0c3988b5d4db066b5254c28d4a3308de1", + "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/70c69bbdd2fa742c169f5c294a027e648d10665f", + "reference": "70c69bbdd2fa742c169f5c294a027e648d10665f", "shasum": "" }, "require-dev": { @@ -1245,22 +1245,22 @@ "homepage": "https://github.com/easyengine/site-type-php", "support": { "issues": "https://github.com/EasyEngine/site-type-php/issues", - "source": "https://github.com/EasyEngine/site-type-php/tree/v1.6.3" + "source": "https://github.com/EasyEngine/site-type-php/tree/v1.7.0" }, - "time": "2022-05-31T11:49:54+00:00" + "time": "2022-06-22T10:02:51+00:00" }, { "name": "easyengine/site-type-wp", - "version": "v1.6.8", + "version": "v1.7.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-wp.git", - "reference": "ad2efa76281b3b9af7e0a4d88a54369920ed4b15" + "reference": "53e5abfe962b619f42a61398e503a5f7e3266c07" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/ad2efa76281b3b9af7e0a4d88a54369920ed4b15", - "reference": "ad2efa76281b3b9af7e0a4d88a54369920ed4b15", + "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/53e5abfe962b619f42a61398e503a5f7e3266c07", + "reference": "53e5abfe962b619f42a61398e503a5f7e3266c07", "shasum": "" }, "require-dev": { @@ -1304,33 +1304,35 @@ "homepage": "https://github.com/easyengine/site-type-wp", "support": { "issues": "https://github.com/EasyEngine/site-type-wp/issues", - "source": "https://github.com/EasyEngine/site-type-wp/tree/v1.6.8" + "source": "https://github.com/EasyEngine/site-type-wp/tree/v1.7.0" }, - "time": "2022-05-31T11:51:03+00:00" + "time": "2022-06-22T10:02:41+00:00" }, { "name": "guzzlehttp/guzzle", - "version": "6.3.3", + "version": "6.5.8", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba" + "reference": "a52f0440530b54fa079ce76e8c5d196a42cad981" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba", - "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/a52f0440530b54fa079ce76e8c5d196a42cad981", + "reference": "a52f0440530b54fa079ce76e8c5d196a42cad981", "shasum": "" }, "require": { + "ext-json": "*", "guzzlehttp/promises": "^1.0", - "guzzlehttp/psr7": "^1.4", - "php": ">=5.5" + "guzzlehttp/psr7": "^1.9", + "php": ">=5.5", + "symfony/polyfill-intl-idn": "^1.17" }, "require-dev": { "ext-curl": "*", "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", - "psr/log": "^1.0" + "psr/log": "^1.1" }, "suggest": { "psr/log": "Required for using the Log middleware" @@ -1338,7 +1340,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "6.3-dev" + "dev-master": "6.5-dev" } }, "autoload": { @@ -1354,10 +1356,40 @@ "MIT" ], "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" + }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" } ], "description": "Guzzle is a PHP HTTP client library", @@ -1373,9 +1405,23 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/master" + "source": "https://github.com/guzzle/guzzle/tree/6.5.8" }, - "time": "2018-04-22T15:46:56+00:00" + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", + "type": "tidelift" + } + ], + "time": "2022-06-20T22:16:07+00:00" }, { "name": "guzzlehttp/promises", @@ -3126,6 +3172,177 @@ ], "time": "2022-05-24T11:49:31+00:00" }, + { + "name": "symfony/polyfill-intl-idn", + "version": "v1.26.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-idn.git", + "reference": "59a8d271f00dd0e4c2e518104cc7963f655a1aa8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/59a8d271f00dd0e4c2e518104cc7963f655a1aa8", + "reference": "59a8d271f00dd0e4c2e518104cc7963f655a1aa8", + "shasum": "" + }, + "require": { + "php": ">=7.1", + "symfony/polyfill-intl-normalizer": "^1.10", + "symfony/polyfill-php72": "^1.10" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.26-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Idn\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Laurent Bassin", + "email": "laurent@bassin.info" + }, + { + "name": "Trevor Rowbotham", + "email": "trevor.rowbotham@pm.me" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "idn", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.26.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": "2022-05-24T11:49:31+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.26.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "219aa369ceff116e673852dce47c3a41794c14bd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/219aa369ceff116e673852dce47c3a41794c14bd", + "reference": "219aa369ceff116e673852dce47c3a41794c14bd", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.26-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/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.26.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": "2022-05-24T11:49:31+00:00" + }, { "name": "symfony/polyfill-mbstring", "version": "v1.26.0", @@ -3209,6 +3426,82 @@ ], "time": "2022-05-24T11:49:31+00:00" }, + { + "name": "symfony/polyfill-php72", + "version": "v1.26.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php72.git", + "reference": "bf44a9fd41feaac72b074de600314a93e2ae78e2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/bf44a9fd41feaac72b074de600314a93e2ae78e2", + "reference": "bf44a9fd41feaac72b074de600314a93e2ae78e2", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.26-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php72\\": "" + } + }, + "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 7.2+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php72/tree/v1.26.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": "2022-05-24T11:49:31+00:00" + }, { "name": "symfony/polyfill-php73", "version": "v1.26.0", From 5cfeda066339f214d645b1b1d44f94239f659c75 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 23 Jun 2022 16:32:38 +0530 Subject: [PATCH 0893/1044] Add script to generate changelog Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- utils/changelog.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 utils/changelog.sh diff --git a/utils/changelog.sh b/utils/changelog.sh new file mode 100644 index 000000000..4ca0e70bb --- /dev/null +++ b/utils/changelog.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash + +echo "## What's Changed" > changelog.txt + +createdAt=$(gh api graphql -F owner='EasyEngine' -F name='easyengine' -f query=' + query { + repository(owner: "EasyEngine", name: "easyengine") { + releases(last: 1) { + nodes { tagName, createdAt } + } + } + } +' | jq -r '.data.repository.releases.nodes[0].createdAt') +gh api graphql --paginate -f query=" +query { + search(query: \"org:Easyengine updated:>$createdAt state:closed is:pr\", type:ISSUE,first: 100) { + repositoryCount + edges { + node { + ... on PullRequest { + title + permalink + state + author { + login + } + updatedAt + } + } + } + } +} +" --template '{{range .data.search.edges}}{{"* "}}{{.node.title}}{{" "}}{{.node.permalink}}{{" "}}{{.node.state}}{{" @"}}{{.node.author.login}}{{"\n"}}{{end}}' | sed '/CLOSED/d' | sed 's/ MERGED//g' >> changelog.txt From fe447479d78f86ef9e9406f3cdd4099a6a7f1c63 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 23 Jun 2022 16:33:09 +0530 Subject: [PATCH 0894/1044] Add workflow to gen release on tag push Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- .github/workflows/test_and_build.yml | 45 ++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index 6ee90b07b..efb33631c 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -1,6 +1,8 @@ on: pull_request: push: + tags: + - "v*.*.*" branches: - master - develop @@ -222,3 +224,46 @@ jobs: github_token: ${{ secrets.BOT_TOKEN }} branch: master repository: easyengine/easyengine-builds + + release: #----------------------------------------------------------------------- + name: Create release + if: | + github.repository_owner == 'mrrobot47' && + startsWith(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + needs: [build] + + steps: + - name: Check out source code + uses: actions/checkout@v2 + + - name: Download built Phar file + uses: actions/download-artifact@v2 + with: + name: easyengine-phar + + - name : Create hashes + run: | + md5sum easyengine.phar | cut -d ' ' -f 1 > easyengine.phar.md5 + sha512sum easyengine.phar | cut -d ' ' -f 1 > easyengine.phar.sha512 + + - name: Authenticate gh-cli + run: echo ${{ secrets.BOT_TOKEN }} | gh auth login --with-token + + - name: Generate changelog + run: bash utils/changelog.sh + + - name: Get tag + id: tag + run: echo ::set-output name=tag::${GITHUB_REF/refs\/tags\//} + + - name: Release + uses: softprops/action-gh-release@v1 + with: + body_path: changelog.txt + files: | + easyengine.phar + easyengine.phar.md5 + easyengine.phar.sha512 + name: EasyEngine ${{ steps.tag.outputs.tag }} + token: ${{ secrets.GITHUB_TOKEN }} From b7788b99c0aff6b687ea28bbe0e7a52d9957c4c6 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 23 Jun 2022 16:35:04 +0530 Subject: [PATCH 0895/1044] Update owner and run priority Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- .github/workflows/test_and_build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index efb33631c..e5cee9dc7 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -228,10 +228,10 @@ jobs: release: #----------------------------------------------------------------------- name: Create release if: | - github.repository_owner == 'mrrobot47' && + github.repository_owner == 'EasyEngine' && startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-latest - needs: [build] + needs: [build, test, deploy] steps: - name: Check out source code From b56745c6b9ec4479a1d6a93be527982af41bc4e0 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 28 Jun 2022 16:11:33 +0530 Subject: [PATCH 0896/1044] Fix spelling in custom compose var Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- php/class-ee-docker.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php index 97f5962a3..83ba55bf0 100644 --- a/php/class-ee-docker.php +++ b/php/class-ee-docker.php @@ -17,32 +17,32 @@ public static function docker_compose_with_custom( array $files_before_custom = $command = 'docker-compose -f '; - $cusotm_compose = \EE::get_runner()->config['custom-compose']; + $custom_compose = \EE::get_runner()->config['custom-compose']; - if ( ! empty( $cusotm_compose ) ) { - $cusotm_compose_path = SITE_CUSTOM_DOCKER_COMPOSE_DIR . '/' . $cusotm_compose; - if ( SITE_CUSTOM_DOCKER_COMPOSE === $cusotm_compose ) { + if ( ! empty( $custom_compose ) ) { + $custom_compose_path = SITE_CUSTOM_DOCKER_COMPOSE_DIR . '/' . $custom_compose; + if ( SITE_CUSTOM_DOCKER_COMPOSE === $custom_compose ) { if ( $fs->exists( SITE_CUSTOM_DOCKER_COMPOSE ) ) { - $cusotm_compose_path = SITE_CUSTOM_DOCKER_COMPOSE; + $custom_compose_path = SITE_CUSTOM_DOCKER_COMPOSE; } } - if ( $fs->exists( $cusotm_compose_path ) ) { - $command .= $cusotm_compose_path; + if ( $fs->exists( $custom_compose_path ) ) { + $command .= $custom_compose_path; } else { - EE::warning( 'File: ' . $cusotm_compose_path . ' does not exist. Falling back to default compose file.' ); + EE::warning( 'File: ' . $custom_compose_path . ' does not exist. Falling back to default compose file.' ); $command .= 'docker-compose.yml'; } } else { $command .= 'docker-compose.yml'; if ( $fs->exists( SITE_CUSTOM_DOCKER_COMPOSE_DIR ) ) { - $cusotm_compose_files = array_diff( scandir( SITE_CUSTOM_DOCKER_COMPOSE_DIR ), [ '.', '..' ] ); - $cusotm_compose_files = array_map( function ( $arrayValues ) { + $custom_compose_files = array_diff( scandir( SITE_CUSTOM_DOCKER_COMPOSE_DIR ), [ '.', '..' ] ); + $custom_compose_files = array_map( function ( $arrayValues ) { return SITE_CUSTOM_DOCKER_COMPOSE_DIR . '/' . $arrayValues; - }, $cusotm_compose_files ); + }, $custom_compose_files ); - $files_before_custom = array_unique( array_merge( $files_before_custom, $cusotm_compose_files ) ); + $files_before_custom = array_unique( array_merge( $files_before_custom, $custom_compose_files ) ); } foreach ( $files_before_custom as $file ) { From f0e4371b8099478876e2fdc1e72f2480f2e7d572 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 19 Jul 2022 14:22:49 +0530 Subject: [PATCH 0897/1044] Add Ubuntu 22.04 as supported OS --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3aef3eaed..bda7398f0 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ EasyEngine makes it greatly easy to manage nginx, a fast web-server software tha ### Linux -For Linux, we have created an installer script that will install all the dependencies for you. We have tested this on Ubuntu 14.04, 16.04, 18.04, 20.04 and Debian 8, Debian 10. +For Linux, we have created an installer script that will install all the dependencies for you. We have tested this on Ubuntu 14.04, 16.04, 18.04, 20.04, 22.04 and Debian 8, Debian 10. ```bash wget -qO ee https://rt.cx/ee4 && sudo bash ee From 26d85d986777a5eaa693a65f088861572a99d226 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Wed, 20 Jul 2022 20:51:55 +0530 Subject: [PATCH 0898/1044] Fix service list for custom compose Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- php/class-ee-docker.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php index 83ba55bf0..22a5f3db8 100644 --- a/php/class-ee-docker.php +++ b/php/class-ee-docker.php @@ -11,11 +11,15 @@ class EE_DOCKER { * * @return string */ - public static function docker_compose_with_custom( array $files_before_custom = [] ): string { + public static function docker_compose_with_custom( array $files_before_custom = [], bool $get_service = false ): string { $fs = new Filesystem(); - $command = 'docker-compose -f '; + if ( $get_service ) { + $command = 'docker-compose '; + } else { + $command = 'docker-compose -f docker-compose.yml '; + } $custom_compose = \EE::get_runner()->config['custom-compose']; @@ -27,13 +31,11 @@ public static function docker_compose_with_custom( array $files_before_custom = } } if ( $fs->exists( $custom_compose_path ) ) { - $command .= $custom_compose_path; + $command .= ' -f ' . $custom_compose_path; } else { EE::warning( 'File: ' . $custom_compose_path . ' does not exist. Falling back to default compose file.' ); - $command .= 'docker-compose.yml'; } } else { - $command .= 'docker-compose.yml'; if ( $fs->exists( SITE_CUSTOM_DOCKER_COMPOSE_DIR ) ) { $custom_compose_files = array_diff( scandir( SITE_CUSTOM_DOCKER_COMPOSE_DIR ), [ '.', '..' ] ); @@ -338,8 +340,9 @@ public static function get_services( $site_fs_path = '' ) { if ( ! empty( $site_fs_path ) ) { chdir( $site_fs_path ); } - $launch = EE::launch( \EE_DOCKER::docker_compose_with_custom() . ' config --services' ); - $services = explode( PHP_EOL, trim( $launch->stdout ) ); + $custom_service = empty( \EE::get_runner()->config['custom-compose'] ) ? false : true; + $launch = EE::launch( \EE_DOCKER::docker_compose_with_custom( [], $custom_service ) . ' config --services' ); + $services = explode( PHP_EOL, trim( $launch->stdout ) ); return $services; } From 95e253ecd0225524947dedc6c9415ee2ef5a1ae9 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Wed, 20 Jul 2022 20:55:17 +0530 Subject: [PATCH 0899/1044] Update doc comment Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- php/class-ee-docker.php | 1 + 1 file changed, 1 insertion(+) diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php index 22a5f3db8..058d354d7 100644 --- a/php/class-ee-docker.php +++ b/php/class-ee-docker.php @@ -8,6 +8,7 @@ class EE_DOCKER { * Function to return docker-compose command with custom docker-compose files * * @param array $files_before_custom Files to be included before custom compose file is included + * @param bool $get_service Boolean to check if it is for getting service call or not. * * @return string */ From e39088fc0f4d3fc9bd808c05a119a34d9b800525 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 11 Aug 2022 17:24:40 +0530 Subject: [PATCH 0900/1044] Update nginx image Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- img-versions.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/img-versions.json b/img-versions.json index c6526fca9..ac7572368 100644 --- a/img-versions.json +++ b/img-versions.json @@ -3,7 +3,7 @@ "easyengine/mailhog": "v4.0.0", "easyengine/mariadb": "v4.1.3", "easyengine/nginx-proxy": "v4.5.0", - "easyengine/nginx": "v4.5.4", + "easyengine/nginx": "v4.6.0", "easyengine/php": "v4.6.0", "easyengine/php5.6": "v4.6.0", "easyengine/php7.0": "v4.6.0", From 4870acc6cfbce2956ec3f083f48b1c860a5f6a19 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 11 Aug 2022 17:26:06 +0530 Subject: [PATCH 0901/1044] Update composer packages Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 2 +- composer.lock | 166 +++++++++++++++++++++++++------------------------- 2 files changed, 84 insertions(+), 84 deletions(-) diff --git a/composer.json b/composer.json index 3a22f105e..e0e561233 100644 --- a/composer.json +++ b/composer.json @@ -35,7 +35,7 @@ "easyengine/mailhog-command": "v1.0.3", "easyengine/service-command": "v1.4.0", "easyengine/shell-command": "v1.1.1", - "easyengine/site-command": "v3.1.0", + "easyengine/site-command": "v3.2.0", "easyengine/site-type-php": "v1.7.0", "easyengine/site-type-wp": "v1.7.0", "monolog/monolog": "1.24.0", diff --git a/composer.lock b/composer.lock index 8620d337c..680dd04ef 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": "fd64cdb193933ea711c1088db932671d", + "content-hash": "69ead8da62c4635c24d51239662b56cb", "packages": [ { "name": "acmephp/core", @@ -198,16 +198,16 @@ }, { "name": "composer/ca-bundle", - "version": "1.3.2", + "version": "1.3.3", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "fd5dd441932a7e10ca6e5b490e272d34c8430640" + "reference": "30897edbfb15e784fe55587b4f73ceefd3c4d98c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/fd5dd441932a7e10ca6e5b490e272d34c8430640", - "reference": "fd5dd441932a7e10ca6e5b490e272d34c8430640", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/30897edbfb15e784fe55587b4f73ceefd3c4d98c", + "reference": "30897edbfb15e784fe55587b4f73ceefd3c4d98c", "shasum": "" }, "require": { @@ -254,7 +254,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.3.2" + "source": "https://github.com/composer/ca-bundle/tree/1.3.3" }, "funding": [ { @@ -270,7 +270,7 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:56:16+00:00" + "time": "2022-07-20T07:14:26+00:00" }, { "name": "composer/composer", @@ -1116,16 +1116,16 @@ }, { "name": "easyengine/site-command", - "version": "v3.1.0", + "version": "v3.2.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "63bf95c245c6125dfcc54bd507413b2a93ffa7de" + "reference": "02193613f65eea1e17b6cd53946df2a89715b7e1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/63bf95c245c6125dfcc54bd507413b2a93ffa7de", - "reference": "63bf95c245c6125dfcc54bd507413b2a93ffa7de", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/02193613f65eea1e17b6cd53946df2a89715b7e1", + "reference": "02193613f65eea1e17b6cd53946df2a89715b7e1", "shasum": "" }, "require": { @@ -1186,9 +1186,9 @@ "homepage": "https://github.com/easyengine/site-command", "support": { "issues": "https://github.com/EasyEngine/site-command/issues", - "source": "https://github.com/EasyEngine/site-command/tree/v3.1.0" + "source": "https://github.com/EasyEngine/site-command/tree/v3.2.0" }, - "time": "2022-06-22T09:54:19+00:00" + "time": "2022-08-11T11:51:43+00:00" }, { "name": "easyengine/site-type-php", @@ -2414,16 +2414,16 @@ }, { "name": "symfony/config", - "version": "v4.4.42", + "version": "v4.4.44", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "83cdafd1bd3370de23e3dc2ed01026908863be81" + "reference": "ed42f8f9da528d2c6cae36fe1f380b0c1d8f0658" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/83cdafd1bd3370de23e3dc2ed01026908863be81", - "reference": "83cdafd1bd3370de23e3dc2ed01026908863be81", + "url": "https://api.github.com/repos/symfony/config/zipball/ed42f8f9da528d2c6cae36fe1f380b0c1d8f0658", + "reference": "ed42f8f9da528d2c6cae36fe1f380b0c1d8f0658", "shasum": "" }, "require": { @@ -2472,7 +2472,7 @@ "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/config/tree/v4.4.42" + "source": "https://github.com/symfony/config/tree/v4.4.44" }, "funding": [ { @@ -2488,20 +2488,20 @@ "type": "tidelift" } ], - "time": "2022-05-17T07:10:14+00:00" + "time": "2022-07-20T09:59:04+00:00" }, { "name": "symfony/console", - "version": "v4.4.42", + "version": "v4.4.44", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "cce7a9f99e22937a71a16b23afa762558808d587" + "reference": "c35fafd7f12ebd6f9e29c95a370df7f1fb171a40" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/cce7a9f99e22937a71a16b23afa762558808d587", - "reference": "cce7a9f99e22937a71a16b23afa762558808d587", + "url": "https://api.github.com/repos/symfony/console/zipball/c35fafd7f12ebd6f9e29c95a370df7f1fb171a40", + "reference": "c35fafd7f12ebd6f9e29c95a370df7f1fb171a40", "shasum": "" }, "require": { @@ -2562,7 +2562,7 @@ "description": "Eases the creation of beautiful and testable command line interfaces", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/console/tree/v4.4.42" + "source": "https://github.com/symfony/console/tree/v4.4.44" }, "funding": [ { @@ -2578,20 +2578,20 @@ "type": "tidelift" } ], - "time": "2022-05-14T12:35:33+00:00" + "time": "2022-07-20T09:59:04+00:00" }, { "name": "symfony/debug", - "version": "v4.4.41", + "version": "v4.4.44", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "6637e62480b60817b9a6984154a533e8e64c6bd5" + "reference": "1a692492190773c5310bc7877cb590c04c2f05be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/6637e62480b60817b9a6984154a533e8e64c6bd5", - "reference": "6637e62480b60817b9a6984154a533e8e64c6bd5", + "url": "https://api.github.com/repos/symfony/debug/zipball/1a692492190773c5310bc7877cb590c04c2f05be", + "reference": "1a692492190773c5310bc7877cb590c04c2f05be", "shasum": "" }, "require": { @@ -2630,7 +2630,7 @@ "description": "Provides tools to ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/debug/tree/v4.4.41" + "source": "https://github.com/symfony/debug/tree/v4.4.44" }, "funding": [ { @@ -2647,20 +2647,20 @@ } ], "abandoned": "symfony/error-handler", - "time": "2022-04-12T15:19:55+00:00" + "time": "2022-07-28T16:29:46+00:00" }, { "name": "symfony/dependency-injection", - "version": "v4.4.42", + "version": "v4.4.44", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "f6fdbf252765a09c7ac243617f79f1babef792c9" + "reference": "25502a57182ba1e15da0afd64c975cae4d0a1471" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/f6fdbf252765a09c7ac243617f79f1babef792c9", - "reference": "f6fdbf252765a09c7ac243617f79f1babef792c9", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/25502a57182ba1e15da0afd64c975cae4d0a1471", + "reference": "25502a57182ba1e15da0afd64c975cae4d0a1471", "shasum": "" }, "require": { @@ -2717,7 +2717,7 @@ "description": "Allows you to standardize and centralize the way objects are constructed in your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v4.4.42" + "source": "https://github.com/symfony/dependency-injection/tree/v4.4.44" }, "funding": [ { @@ -2733,11 +2733,11 @@ "type": "tidelift" } ], - "time": "2022-05-24T15:15:52+00:00" + "time": "2022-07-20T09:59:04+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v2.5.1", + "version": "v2.5.2", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", @@ -2784,7 +2784,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.1" + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.2" }, "funding": [ { @@ -2804,16 +2804,16 @@ }, { "name": "symfony/event-dispatcher", - "version": "v4.4.42", + "version": "v4.4.44", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "708e761740c16b02c86e3f0c932018a06b895d40" + "reference": "1e866e9e5c1b22168e0ce5f0b467f19bba61266a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/708e761740c16b02c86e3f0c932018a06b895d40", - "reference": "708e761740c16b02c86e3f0c932018a06b895d40", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/1e866e9e5c1b22168e0ce5f0b467f19bba61266a", + "reference": "1e866e9e5c1b22168e0ce5f0b467f19bba61266a", "shasum": "" }, "require": { @@ -2868,7 +2868,7 @@ "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/v4.4.42" + "source": "https://github.com/symfony/event-dispatcher/tree/v4.4.44" }, "funding": [ { @@ -2884,11 +2884,11 @@ "type": "tidelift" } ], - "time": "2022-05-05T15:33:49+00:00" + "time": "2022-07-20T09:59:04+00:00" }, { "name": "symfony/event-dispatcher-contracts", - "version": "v1.1.12", + "version": "v1.1.13", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", @@ -2947,7 +2947,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v1.1.12" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v1.1.13" }, "funding": [ { @@ -3030,16 +3030,16 @@ }, { "name": "symfony/finder", - "version": "v4.4.41", + "version": "v4.4.44", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "40790bdf293b462798882ef6da72bb49a4a6633a" + "reference": "66bd787edb5e42ff59d3523f623895af05043e4f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/40790bdf293b462798882ef6da72bb49a4a6633a", - "reference": "40790bdf293b462798882ef6da72bb49a4a6633a", + "url": "https://api.github.com/repos/symfony/finder/zipball/66bd787edb5e42ff59d3523f623895af05043e4f", + "reference": "66bd787edb5e42ff59d3523f623895af05043e4f", "shasum": "" }, "require": { @@ -3072,7 +3072,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v4.4.41" + "source": "https://github.com/symfony/finder/tree/v4.4.44" }, "funding": [ { @@ -3088,7 +3088,7 @@ "type": "tidelift" } ], - "time": "2022-04-14T15:36:10+00:00" + "time": "2022-07-29T07:35:46+00:00" }, { "name": "symfony/polyfill-ctype", @@ -3745,16 +3745,16 @@ }, { "name": "symfony/process", - "version": "v4.4.41", + "version": "v4.4.44", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "9eedd60225506d56e42210a70c21bb80ca8456ce" + "reference": "5cee9cdc4f7805e2699d9fd66991a0e6df8252a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/9eedd60225506d56e42210a70c21bb80ca8456ce", - "reference": "9eedd60225506d56e42210a70c21bb80ca8456ce", + "url": "https://api.github.com/repos/symfony/process/zipball/5cee9cdc4f7805e2699d9fd66991a0e6df8252a2", + "reference": "5cee9cdc4f7805e2699d9fd66991a0e6df8252a2", "shasum": "" }, "require": { @@ -3787,7 +3787,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v4.4.41" + "source": "https://github.com/symfony/process/tree/v4.4.44" }, "funding": [ { @@ -3803,7 +3803,7 @@ "type": "tidelift" } ], - "time": "2022-04-04T10:19:07+00:00" + "time": "2022-06-27T13:16:42+00:00" }, { "name": "symfony/serializer", @@ -3889,16 +3889,16 @@ }, { "name": "symfony/service-contracts", - "version": "v2.5.1", + "version": "v2.5.2", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "24d9dc654b83e91aa59f9d167b131bc3b5bea24c" + "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/24d9dc654b83e91aa59f9d167b131bc3b5bea24c", - "reference": "24d9dc654b83e91aa59f9d167b131bc3b5bea24c", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/4b426aac47d6427cc1a1d0f7e2ac724627f5966c", + "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c", "shasum": "" }, "require": { @@ -3952,7 +3952,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v2.5.1" + "source": "https://github.com/symfony/service-contracts/tree/v2.5.2" }, "funding": [ { @@ -3968,20 +3968,20 @@ "type": "tidelift" } ], - "time": "2022-03-13T20:07:29+00:00" + "time": "2022-05-30T19:17:29+00:00" }, { "name": "symfony/translation", - "version": "v4.4.41", + "version": "v4.4.44", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "dcb67eae126e74507e0b4f0b9ac6ef35b37c3331" + "reference": "af947fefc306cec6ea5a1f6160c7e305a71f2493" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/dcb67eae126e74507e0b4f0b9ac6ef35b37c3331", - "reference": "dcb67eae126e74507e0b4f0b9ac6ef35b37c3331", + "url": "https://api.github.com/repos/symfony/translation/zipball/af947fefc306cec6ea5a1f6160c7e305a71f2493", + "reference": "af947fefc306cec6ea5a1f6160c7e305a71f2493", "shasum": "" }, "require": { @@ -4041,7 +4041,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v4.4.41" + "source": "https://github.com/symfony/translation/tree/v4.4.44" }, "funding": [ { @@ -4057,20 +4057,20 @@ "type": "tidelift" } ], - "time": "2022-04-21T07:22:34+00:00" + "time": "2022-07-20T09:59:04+00:00" }, { "name": "symfony/translation-contracts", - "version": "v2.5.1", + "version": "v2.5.2", "source": { "type": "git", "url": "https://github.com/symfony/translation-contracts.git", - "reference": "1211df0afa701e45a04253110e959d4af4ef0f07" + "reference": "136b19dd05cdf0709db6537d058bcab6dd6e2dbe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/1211df0afa701e45a04253110e959d4af4ef0f07", - "reference": "1211df0afa701e45a04253110e959d4af4ef0f07", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/136b19dd05cdf0709db6537d058bcab6dd6e2dbe", + "reference": "136b19dd05cdf0709db6537d058bcab6dd6e2dbe", "shasum": "" }, "require": { @@ -4119,7 +4119,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/translation-contracts/tree/v2.5.1" + "source": "https://github.com/symfony/translation-contracts/tree/v2.5.2" }, "funding": [ { @@ -4135,20 +4135,20 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:53:40+00:00" + "time": "2022-06-27T16:58:25+00:00" }, { "name": "symfony/yaml", - "version": "v4.4.37", + "version": "v4.4.44", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "d7f637cc0f0cc14beb0984f2bb50da560b271311" + "reference": "c2b28c10fb3b7ac67bafa7b8f952cd83f35acde2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/d7f637cc0f0cc14beb0984f2bb50da560b271311", - "reference": "d7f637cc0f0cc14beb0984f2bb50da560b271311", + "url": "https://api.github.com/repos/symfony/yaml/zipball/c2b28c10fb3b7ac67bafa7b8f952cd83f35acde2", + "reference": "c2b28c10fb3b7ac67bafa7b8f952cd83f35acde2", "shasum": "" }, "require": { @@ -4190,7 +4190,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v4.4.37" + "source": "https://github.com/symfony/yaml/tree/v4.4.44" }, "funding": [ { @@ -4206,7 +4206,7 @@ "type": "tidelift" } ], - "time": "2022-01-24T20:11:01+00:00" + "time": "2022-06-27T13:16:42+00:00" }, { "name": "webmozart/assert", From 0837f066a8894a3dd5747b604e9c95ceffc0dbdb Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 11 Aug 2022 17:26:20 +0530 Subject: [PATCH 0902/1044] Bump to version v4.6.0 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index bb8dc6360..6016e8add 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.5.6 +4.6.0 From 2659608680e8483e4917d4ad39ff8a7284507ac1 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 11 Aug 2022 17:52:40 +0530 Subject: [PATCH 0903/1044] Fix deploy condition on tag Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- .github/workflows/test_and_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index e5cee9dc7..b9fef0f7c 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -173,7 +173,7 @@ jobs: name: Deploy Phar if: | github.repository_owner == 'EasyEngine' && - (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master') + (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')) runs-on: ubuntu-latest needs: [build, test] From 24bc55b6988ea7bbb190fac12be1301ea5c7b58a Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 15 Aug 2022 17:52:20 +0530 Subject: [PATCH 0904/1044] Skip deploy on tag Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- .github/workflows/test_and_build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index b9fef0f7c..6ab9d7504 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -173,7 +173,7 @@ jobs: name: Deploy Phar if: | github.repository_owner == 'EasyEngine' && - (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')) + (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master') runs-on: ubuntu-latest needs: [build, test] @@ -231,7 +231,7 @@ jobs: github.repository_owner == 'EasyEngine' && startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-latest - needs: [build, test, deploy] + needs: [build, test] steps: - name: Check out source code From a3c4cd6f97b62909558ac48a5d3bcc13d237fe98 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 15 Aug 2022 17:52:44 +0530 Subject: [PATCH 0905/1044] Skip version set on tag Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- .github/workflows/test_and_build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index 6ab9d7504..50bbb5044 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -54,6 +54,7 @@ jobs: fi - name: Setup EE version + if: ${{ ! startsWith(github.ref, 'refs/tags/') }} run: | cd "$GITHUB_WORKSPACE" if [[ "$GITHUB_REF" != $DEPLOY_BRANCH ]]; then From 1d5935595744c6c83bd6300d7444e17caaa22622 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 15 Aug 2022 22:55:12 +0530 Subject: [PATCH 0906/1044] Add myclabs/deep-copy to phar creation Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- utils/make-phar.php | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/make-phar.php b/utils/make-phar.php index 127fc5aa8..aa739d16c 100644 --- a/utils/make-phar.php +++ b/utils/make-phar.php @@ -179,6 +179,7 @@ function get_composer_versions( $current_version ) { ->in(EE_VENDOR_DIR . '/ralouphie/getallheaders') ->in(EE_VENDOR_DIR . '/acmephp') ->in(EE_VENDOR_DIR . '/league') + ->in(EE_VENDOR_DIR . '/myclabs/deep-copy') ->in(EE_VENDOR_DIR . '/webmozart') ->notName('behat-tags.php') ->notPath('#(?:[^/]+-command|php-cli-tools)/vendor/#') // For running locally, in case have composer installed or symlinked them. From aa98f82fe93d81c25350be0dabc70fd2a0c7a3e8 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 15 Aug 2022 22:56:35 +0530 Subject: [PATCH 0907/1044] Update composer packages Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 2 +- composer.lock | 389 +++++++++++++------------------------------------- 2 files changed, 103 insertions(+), 288 deletions(-) diff --git a/composer.json b/composer.json index e0e561233..4f06d9321 100644 --- a/composer.json +++ b/composer.json @@ -35,7 +35,7 @@ "easyengine/mailhog-command": "v1.0.3", "easyengine/service-command": "v1.4.0", "easyengine/shell-command": "v1.1.1", - "easyengine/site-command": "v3.2.0", + "easyengine/site-command": "v3.2.1", "easyengine/site-type-php": "v1.7.0", "easyengine/site-type-wp": "v1.7.0", "monolog/monolog": "1.24.0", diff --git a/composer.lock b/composer.lock index 680dd04ef..4cbf3bd1c 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "69ead8da62c4635c24d51239662b56cb", + "content-hash": "fbb3dc3a01b29a66778d43e2696e59a9", "packages": [ { "name": "acmephp/core", - "version": "1.2.0", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/acmephp/core.git", - "reference": "b038d61f06f3cb1e81a1a3cbe63eae42d9d3d3ca" + "reference": "cd4e69385052b05f24cc4aa938b3bad0a033d085" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/acmephp/core/zipball/b038d61f06f3cb1e81a1a3cbe63eae42d9d3d3ca", - "reference": "b038d61f06f3cb1e81a1a3cbe63eae42d9d3d3ca", + "url": "https://api.github.com/repos/acmephp/core/zipball/cd4e69385052b05f24cc4aa938b3bad0a033d085", + "reference": "cd4e69385052b05f24cc4aa938b3bad0a033d085", "shasum": "" }, "require": { @@ -25,7 +25,7 @@ "ext-hash": "*", "ext-json": "*", "ext-openssl": "*", - "guzzlehttp/guzzle": "^6.0", + "guzzlehttp/guzzle": "^6.0|^7.0", "guzzlehttp/psr7": "^1.0", "php": ">=5.5.0", "psr/http-message": "^1.0", @@ -76,9 +76,9 @@ "x509" ], "support": { - "source": "https://github.com/acmephp/core/tree/1.2.0" + "source": "https://github.com/acmephp/core/tree/1.3.0" }, - "time": "2019-12-17T11:28:20+00:00" + "time": "2020-12-13T21:29:40+00:00" }, { "name": "acmephp/ssl", @@ -151,27 +151,28 @@ }, { "name": "cloudflare/sdk", - "version": "1.1.1", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/cloudflare/cloudflare-php.git", - "reference": "a3a346ccb2f5cb49759db3d71ba0006a10cf20ef" + "reference": "fdfc656aa8b78016f4722acec30b54136c027d8e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cloudflare/cloudflare-php/zipball/a3a346ccb2f5cb49759db3d71ba0006a10cf20ef", - "reference": "a3a346ccb2f5cb49759db3d71ba0006a10cf20ef", + "url": "https://api.github.com/repos/cloudflare/cloudflare-php/zipball/fdfc656aa8b78016f4722acec30b54136c027d8e", + "reference": "fdfc656aa8b78016f4722acec30b54136c027d8e", "shasum": "" }, "require": { - "guzzlehttp/guzzle": "^6.2.2", - "php": ">=7.0.0", + "ext-json": "*", + "guzzlehttp/guzzle": "^7.0.1", + "php": ">=7.2.5", "psr/http-message": "~1.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^2.6", "phpmd/phpmd": "@stable", - "phpunit/phpunit": "5.7.5" + "phpunit/phpunit": "^5.7" }, "type": "library", "autoload": { @@ -192,9 +193,9 @@ "description": "PHP binding for v4 of the Cloudflare Client API.", "support": { "issues": "https://github.com/cloudflare/cloudflare-php/issues", - "source": "https://github.com/cloudflare/cloudflare-php/tree/1.1.1" + "source": "https://github.com/cloudflare/cloudflare-php/tree/1.3.0" }, - "time": "2018-08-28T14:01:57+00:00" + "time": "2021-10-13T03:40:33+00:00" }, { "name": "composer/ca-bundle", @@ -1116,23 +1117,23 @@ }, { "name": "easyengine/site-command", - "version": "v3.2.0", + "version": "v3.2.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "02193613f65eea1e17b6cd53946df2a89715b7e1" + "reference": "abe3d8df6c17c641992ca3124bc795dda320ebce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/02193613f65eea1e17b6cd53946df2a89715b7e1", - "reference": "02193613f65eea1e17b6cd53946df2a89715b7e1", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/abe3d8df6c17c641992ca3124bc795dda320ebce", + "reference": "abe3d8df6c17c641992ca3124bc795dda320ebce", "shasum": "" }, "require": { - "acmephp/core": "1.2.0", - "cloudflare/sdk": "1.1.1", + "acmephp/core": "1.3.0", + "cloudflare/sdk": "^1.3", "ext-openssl": "*", - "guzzlehttp/guzzle": "6.5.8", + "guzzlehttp/guzzle": "^7.4", "league/flysystem": "1.1.4", "symfony/serializer": "3.4.20", "webmozart/assert": "1.10.0" @@ -1186,9 +1187,9 @@ "homepage": "https://github.com/easyengine/site-command", "support": { "issues": "https://github.com/EasyEngine/site-command/issues", - "source": "https://github.com/EasyEngine/site-command/tree/v3.2.0" + "source": "https://github.com/EasyEngine/site-command/tree/v3.2.1" }, - "time": "2022-08-11T11:51:43+00:00" + "time": "2022-08-15T17:09:03+00:00" }, { "name": "easyengine/site-type-php", @@ -1310,37 +1311,45 @@ }, { "name": "guzzlehttp/guzzle", - "version": "6.5.8", + "version": "7.4.5", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "a52f0440530b54fa079ce76e8c5d196a42cad981" + "reference": "1dd98b0564cb3f6bd16ce683cb755f94c10fbd82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/a52f0440530b54fa079ce76e8c5d196a42cad981", - "reference": "a52f0440530b54fa079ce76e8c5d196a42cad981", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/1dd98b0564cb3f6bd16ce683cb755f94c10fbd82", + "reference": "1dd98b0564cb3f6bd16ce683cb755f94c10fbd82", "shasum": "" }, "require": { "ext-json": "*", - "guzzlehttp/promises": "^1.0", - "guzzlehttp/psr7": "^1.9", - "php": ">=5.5", - "symfony/polyfill-intl-idn": "^1.17" + "guzzlehttp/promises": "^1.5", + "guzzlehttp/psr7": "^1.9 || ^2.4", + "php": "^7.2.5 || ^8.0", + "psr/http-client": "^1.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" + }, + "provide": { + "psr/http-client-implementation": "1.0" }, "require-dev": { + "bamarni/composer-bin-plugin": "^1.4.1", "ext-curl": "*", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", - "psr/log": "^1.1" + "php-http/client-integration-tests": "^3.0", + "phpunit/phpunit": "^8.5.5 || ^9.3.5", + "psr/log": "^1.1 || ^2.0 || ^3.0" }, "suggest": { + "ext-curl": "Required for CURL handler support", + "ext-intl": "Required for Internationalized Domain Name (IDN) support", "psr/log": "Required for using the Log middleware" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "6.5-dev" + "dev-master": "7.4-dev" } }, "autoload": { @@ -1393,19 +1402,20 @@ } ], "description": "Guzzle is a PHP HTTP client library", - "homepage": "http://guzzlephp.org/", "keywords": [ "client", "curl", "framework", "http", "http client", + "psr-18", + "psr-7", "rest", "web service" ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/6.5.8" + "source": "https://github.com/guzzle/guzzle/tree/7.4.5" }, "funding": [ { @@ -1421,7 +1431,7 @@ "type": "tidelift" } ], - "time": "2022-06-20T22:16:07+00:00" + "time": "2022-06-20T22:16:13+00:00" }, { "name": "guzzlehttp/promises", @@ -2017,6 +2027,58 @@ }, "time": "2021-03-05T17:36:06+00:00" }, + { + "name": "psr/http-client", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-client.git", + "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", + "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", + "keywords": [ + "http", + "http-client", + "psr", + "psr-18" + ], + "support": { + "source": "https://github.com/php-fig/http-client/tree/master" + }, + "time": "2020-06-29T06:28:15+00:00" + }, { "name": "psr/http-message", "version": "1.0.1", @@ -3172,177 +3234,6 @@ ], "time": "2022-05-24T11:49:31+00:00" }, - { - "name": "symfony/polyfill-intl-idn", - "version": "v1.26.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "59a8d271f00dd0e4c2e518104cc7963f655a1aa8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/59a8d271f00dd0e4c2e518104cc7963f655a1aa8", - "reference": "59a8d271f00dd0e4c2e518104cc7963f655a1aa8", - "shasum": "" - }, - "require": { - "php": ">=7.1", - "symfony/polyfill-intl-normalizer": "^1.10", - "symfony/polyfill-php72": "^1.10" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.26-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Idn\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Laurent Bassin", - "email": "laurent@bassin.info" - }, - { - "name": "Trevor Rowbotham", - "email": "trevor.rowbotham@pm.me" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "idn", - "intl", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.26.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": "2022-05-24T11:49:31+00:00" - }, - { - "name": "symfony/polyfill-intl-normalizer", - "version": "v1.26.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "219aa369ceff116e673852dce47c3a41794c14bd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/219aa369ceff116e673852dce47c3a41794c14bd", - "reference": "219aa369ceff116e673852dce47c3a41794c14bd", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.26-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/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.26.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": "2022-05-24T11:49:31+00:00" - }, { "name": "symfony/polyfill-mbstring", "version": "v1.26.0", @@ -3426,82 +3317,6 @@ ], "time": "2022-05-24T11:49:31+00:00" }, - { - "name": "symfony/polyfill-php72", - "version": "v1.26.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "bf44a9fd41feaac72b074de600314a93e2ae78e2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/bf44a9fd41feaac72b074de600314a93e2ae78e2", - "reference": "bf44a9fd41feaac72b074de600314a93e2ae78e2", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.26-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php72\\": "" - } - }, - "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 7.2+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.26.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": "2022-05-24T11:49:31+00:00" - }, { "name": "symfony/polyfill-php73", "version": "v1.26.0", From 371d9e61d49da7e8126b22f8e4cc358adc4ae5ed Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 15 Aug 2022 23:02:06 +0530 Subject: [PATCH 0908/1044] Remove myclabs/deep-copy from phar Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- utils/make-phar.php | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/make-phar.php b/utils/make-phar.php index aa739d16c..127fc5aa8 100644 --- a/utils/make-phar.php +++ b/utils/make-phar.php @@ -179,7 +179,6 @@ function get_composer_versions( $current_version ) { ->in(EE_VENDOR_DIR . '/ralouphie/getallheaders') ->in(EE_VENDOR_DIR . '/acmephp') ->in(EE_VENDOR_DIR . '/league') - ->in(EE_VENDOR_DIR . '/myclabs/deep-copy') ->in(EE_VENDOR_DIR . '/webmozart') ->notName('behat-tags.php') ->notPath('#(?:[^/]+-command|php-cli-tools)/vendor/#') // For running locally, in case have composer installed or symlinked them. From b1135519dc901c6fadb0225382ab467c3bea35a9 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 15 Aug 2022 23:09:49 +0530 Subject: [PATCH 0909/1044] Bump to version v4.6.1 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 6016e8add..8ac28bf9f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.6.0 +4.6.1 From d13fcb19e8c09ce5ff78da24a5f3109f30ebb493 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 16 Aug 2022 00:17:46 +0530 Subject: [PATCH 0910/1044] test Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- .github/workflows/test_and_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index 50bbb5044..ff4ea597b 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -46,7 +46,7 @@ jobs: run: | cd "$GITHUB_WORKSPACE" # Run composer install for master else update. - if [[ "$GITHUB_REF" = "refs/heads/master" ]]; then + if [[ "$GITHUB_REF" = "refs/heads/master" ]] || [[ "$GITHUB_REF" = "refs/tags/"* ]]; then composer install --no-dev --no-progress --no-interaction else sed -i 's/\(easyengine\/.*\):\ \".*\"/\1:\ \"dev-develop\"/' composer.json From fcda150d7452f484fa23774b844a93fc6517ae1c Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 15 Nov 2022 12:07:48 +0530 Subject: [PATCH 0911/1044] Add daverandom/libdns for LE DNS issue Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 1 + composer.lock | 46 +++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 4f06d9321..ad9c73d66 100644 --- a/composer.json +++ b/composer.json @@ -27,6 +27,7 @@ "php": ">=7.0", "composer/composer": "2.2.12", "composer/semver": "3.2.4", + "daverandom/libdns": "^2.0", "easyengine/admin-tools-command": "v1.1.0", "easyengine/auth-command": "v1.2.0", "easyengine/config-command": "v1.0.2", diff --git a/composer.lock b/composer.lock index 4cbf3bd1c..c07a4e7d1 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": "fbb3dc3a01b29a66778d43e2696e59a9", + "content-hash": "3e1f09710b9eb5d3eb18354e37fcb3fa", "packages": [ { "name": "acmephp/core", @@ -739,6 +739,50 @@ ], "time": "2022-02-25T21:32:43+00:00" }, + { + "name": "daverandom/libdns", + "version": "v2.0.3", + "source": { + "type": "git", + "url": "https://github.com/DaveRandom/LibDNS.git", + "reference": "42c2d700d1178c9f9e78664793463f7f1aea248c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/DaveRandom/LibDNS/zipball/42c2d700d1178c9f9e78664793463f7f1aea248c", + "reference": "42c2d700d1178c9f9e78664793463f7f1aea248c", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "php": ">=7.0" + }, + "suggest": { + "ext-intl": "Required for IDN support" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "LibDNS\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "DNS protocol implementation written in pure PHP", + "keywords": [ + "dns" + ], + "support": { + "issues": "https://github.com/DaveRandom/LibDNS/issues", + "source": "https://github.com/DaveRandom/LibDNS/tree/v2.0.3" + }, + "time": "2022-09-20T18:15:38+00:00" + }, { "name": "easyengine/admin-tools-command", "version": "v1.1.0", From c7e3f80d13644cbc1e72274d245af52fe829dcd9 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 15 Nov 2022 12:08:48 +0530 Subject: [PATCH 0912/1044] Add daverandom/libdns to phar Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- utils/make-phar.php | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/make-phar.php b/utils/make-phar.php index 127fc5aa8..3e5c4a51c 100644 --- a/utils/make-phar.php +++ b/utils/make-phar.php @@ -175,6 +175,7 @@ function get_composer_versions( $current_version ) { ->in(EE_VENDOR_DIR . '/symfony/polyfill-php80') ->in(EE_VENDOR_DIR . '/symfony/polyfill-php81') ->in(EE_VENDOR_DIR . '/monolog') + ->in(EE_VENDOR_DIR . '/daverandom') ->in(EE_VENDOR_DIR . '/guzzlehttp') ->in(EE_VENDOR_DIR . '/ralouphie/getallheaders') ->in(EE_VENDOR_DIR . '/acmephp') From 8fce36aa8128d34e7bda3c6cded48f3112f6d389 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 15 Nov 2022 15:02:11 +0530 Subject: [PATCH 0913/1044] Bump to version v4.6.2 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 8ac28bf9f..c78c4964c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.6.1 +4.6.2 From 17fb9395487fbb9378630ff2d9ac8d5c46eb7295 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 15 Nov 2022 15:02:58 +0530 Subject: [PATCH 0914/1044] Update docker image versions Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- img-versions.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/img-versions.json b/img-versions.json index ac7572368..6823a06ef 100644 --- a/img-versions.json +++ b/img-versions.json @@ -3,15 +3,15 @@ "easyengine/mailhog": "v4.0.0", "easyengine/mariadb": "v4.1.3", "easyengine/nginx-proxy": "v4.5.0", - "easyengine/nginx": "v4.6.0", + "easyengine/nginx": "v4.6.2", "easyengine/php": "v4.6.0", "easyengine/php5.6": "v4.6.0", "easyengine/php7.0": "v4.6.0", "easyengine/php7.2": "v4.6.0", "easyengine/php7.3": "v4.6.0", - "easyengine/php7.4": "v4.6.0", - "easyengine/php8.0": "v4.6.0", - "easyengine/php8.1": "v4.6.0", + "easyengine/php7.4": "v4.6.2", + "easyengine/php8.0": "v4.6.2", + "easyengine/php8.1": "v4.6.2", "easyengine/postfix": "v4.1.5", "easyengine/redis": "v4.4.3", "easyengine/newrelic-daemon": "v4.3.0" From 01ab9ecf93f7ef735a03371472b68d6647fe1ea9 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 17 Nov 2022 14:47:16 +0530 Subject: [PATCH 0915/1044] Keep release as draft on tag push Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- .github/workflows/test_and_build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index ff4ea597b..021dc249d 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -266,5 +266,6 @@ jobs: easyengine.phar easyengine.phar.md5 easyengine.phar.sha512 + draft: true name: EasyEngine ${{ steps.tag.outputs.tag }} token: ${{ secrets.GITHUB_TOKEN }} From 37acba7f4f46abd6a83154306484291d3e58d27b Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 17 Nov 2022 14:50:23 +0530 Subject: [PATCH 0916/1044] Update actions to v3 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- .github/workflows/test_and_build.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index 021dc249d..332416310 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -18,14 +18,14 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out source code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Get Composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Set up Composer caching - uses: actions/cache@v2 + uses: actions/cache@v3 env: cache-name: cache-composer-dependencies with: @@ -69,7 +69,7 @@ jobs: - name: Upload EE version - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: cli_version path: VERSION @@ -81,7 +81,7 @@ jobs: run: sudo ./easyengine.phar cli info - name: Upload built Phar file - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: easyengine-phar path: easyengine.phar @@ -96,14 +96,14 @@ jobs: php: ['7.2', '7.3', '7.4', '8.0', '8.1'] steps: - name: Check out source code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Get Composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Set up Composer caching - uses: actions/cache@v2 + uses: actions/cache@v3 env: cache-name: cache-composer-dependencies with: @@ -180,13 +180,13 @@ jobs: steps: - name: Check out builds repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: easyengine/easyengine-builds token: ${{ secrets.BOT_TOKEN }} - name: Download built Phar file - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: easyengine-phar @@ -236,10 +236,10 @@ jobs: steps: - name: Check out source code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Download built Phar file - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: easyengine-phar From 80c04c103e469c3d215bbe2fe1fbb164b43996a5 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 8 Dec 2022 17:59:54 +0530 Subject: [PATCH 0917/1044] Update all images Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- img-versions.json | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/img-versions.json b/img-versions.json index 6823a06ef..f76b5a10d 100644 --- a/img-versions.json +++ b/img-versions.json @@ -1,18 +1,18 @@ { - "easyengine/cron": "v4.0.0", - "easyengine/mailhog": "v4.0.0", - "easyengine/mariadb": "v4.1.3", - "easyengine/nginx-proxy": "v4.5.0", - "easyengine/nginx": "v4.6.2", - "easyengine/php": "v4.6.0", - "easyengine/php5.6": "v4.6.0", - "easyengine/php7.0": "v4.6.0", - "easyengine/php7.2": "v4.6.0", - "easyengine/php7.3": "v4.6.0", - "easyengine/php7.4": "v4.6.2", - "easyengine/php8.0": "v4.6.2", - "easyengine/php8.1": "v4.6.2", - "easyengine/postfix": "v4.1.5", - "easyengine/redis": "v4.4.3", - "easyengine/newrelic-daemon": "v4.3.0" + "easyengine/cron": "v4.6.3", + "easyengine/mailhog": "v4.6.3", + "easyengine/mariadb": "v4.6.3", + "easyengine/nginx-proxy": "v4.6.3", + "easyengine/nginx": "v4.6.3", + "easyengine/php": "v4.6.3", + "easyengine/php5.6": "v4.6.3", + "easyengine/php7.0": "v4.6.3", + "easyengine/php7.2": "v4.6.3", + "easyengine/php7.3": "v4.6.3", + "easyengine/php7.4": "v4.6.3", + "easyengine/php8.0": "v4.6.3", + "easyengine/php8.1": "v4.6.3", + "easyengine/postfix": "v4.6.3", + "easyengine/redis": "v4.6.3", + "easyengine/newrelic-daemon": "v4.6.3" } From 79798f60dc9e4595c3aef9f095ef79c18db50cb7 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 15 Dec 2022 13:01:05 +0530 Subject: [PATCH 0918/1044] Upgrade to using $GITHUB_OUTPUT Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- .github/workflows/test_and_build.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index 332416310..772002a9b 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -12,7 +12,6 @@ on: name: Build 🔨 + Test 👨‍🔧 jobs: - build: #--------------------------------------------------------------------- name: Build Phar runs-on: ubuntu-latest @@ -22,7 +21,7 @@ jobs: - name: Get Composer cache directory id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Set up Composer caching uses: actions/cache@v3 @@ -100,7 +99,7 @@ jobs: - name: Get Composer cache directory id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Set up Composer caching uses: actions/cache@v3 @@ -243,7 +242,7 @@ jobs: with: name: easyengine-phar - - name : Create hashes + - name: Create hashes run: | md5sum easyengine.phar | cut -d ' ' -f 1 > easyengine.phar.md5 sha512sum easyengine.phar | cut -d ' ' -f 1 > easyengine.phar.sha512 @@ -256,7 +255,7 @@ jobs: - name: Get tag id: tag - run: echo ::set-output name=tag::${GITHUB_REF/refs\/tags\//} + run: echo tag=${GITHUB_REF/refs\/tags\//} >> $GITHUB_OUTPUT - name: Release uses: softprops/action-gh-release@v1 From 43c77e9beedf76f6b14b2ce50341a2b243de9439 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 15 Dec 2022 13:48:23 +0530 Subject: [PATCH 0919/1044] Bring setup-php up Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- .github/workflows/test_and_build.yml | 32 ++++++++++++++-------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index 772002a9b..ea53fb815 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -19,6 +19,14 @@ jobs: - name: Check out source code uses: actions/checkout@v3 + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '7.4' + coverage: none + tools: composer + extensions: pcntl, curl, sqlite3, zip, dom, mbstring, json + - name: Get Composer cache directory id: composer-cache run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT @@ -33,14 +41,6 @@ jobs: restore-keys: | ${{ runner.os }}-composer- - - name: Set up PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '7.4' - coverage: none - tools: composer - extensions: pcntl, curl, sqlite3, zip, dom, mbstring, json - - name: Install dependencies run: | cd "$GITHUB_WORKSPACE" @@ -97,6 +97,14 @@ jobs: - name: Check out source code uses: actions/checkout@v3 + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '${{ matrix.php }}' + coverage: none + tools: composer + extensions: pcntl, curl, sqlite3, zip, dom, mbstring, json + - name: Get Composer cache directory id: composer-cache run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT @@ -111,14 +119,6 @@ jobs: restore-keys: | ${{ runner.os }}-composer- - - name: Set up PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '${{ matrix.php }}' - coverage: none - tools: composer - extensions: pcntl, curl, sqlite3, zip, dom, mbstring, json - - name: Update docker run: | sudo apt purge nginx nginx-common docker docker-engine docker.io docker-ce containerd runc From edb8fa80f63e9e83814ddffff519a411a208ac47 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 19 Dec 2022 15:08:50 +0530 Subject: [PATCH 0920/1044] Update composer packages Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 2 +- composer.lock | 507 ++++++++++++++------------------------------------ 2 files changed, 143 insertions(+), 366 deletions(-) diff --git a/composer.json b/composer.json index ad9c73d66..93a7f7074 100644 --- a/composer.json +++ b/composer.json @@ -38,7 +38,7 @@ "easyengine/shell-command": "v1.1.1", "easyengine/site-command": "v3.2.1", "easyengine/site-type-php": "v1.7.0", - "easyengine/site-type-wp": "v1.7.0", + "easyengine/site-type-wp": "v1.7.1", "monolog/monolog": "1.24.0", "mustache/mustache": "2.14.1", "rmccue/requests": "1.8.0", diff --git a/composer.lock b/composer.lock index c07a4e7d1..77072a9c8 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": "3e1f09710b9eb5d3eb18354e37fcb3fa", + "content-hash": "fc392ca98a505b4561cba6a0ef5eed3f", "packages": [ { "name": "acmephp/core", @@ -199,16 +199,16 @@ }, { "name": "composer/ca-bundle", - "version": "1.3.3", + "version": "1.3.4", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "30897edbfb15e784fe55587b4f73ceefd3c4d98c" + "reference": "69098eca243998b53eed7a48d82dedd28b447cd5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/30897edbfb15e784fe55587b4f73ceefd3c4d98c", - "reference": "30897edbfb15e784fe55587b4f73ceefd3c4d98c", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/69098eca243998b53eed7a48d82dedd28b447cd5", + "reference": "69098eca243998b53eed7a48d82dedd28b447cd5", "shasum": "" }, "require": { @@ -255,7 +255,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.3.3" + "source": "https://github.com/composer/ca-bundle/tree/1.3.4" }, "funding": [ { @@ -271,7 +271,7 @@ "type": "tidelift" } ], - "time": "2022-07-20T07:14:26+00:00" + "time": "2022-10-12T12:08:29+00:00" }, { "name": "composer/composer", @@ -1296,16 +1296,16 @@ }, { "name": "easyengine/site-type-wp", - "version": "v1.7.0", + "version": "v1.7.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-wp.git", - "reference": "53e5abfe962b619f42a61398e503a5f7e3266c07" + "reference": "cd3b6a85fd88809fa3664a842a82cee9493880aa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/53e5abfe962b619f42a61398e503a5f7e3266c07", - "reference": "53e5abfe962b619f42a61398e503a5f7e3266c07", + "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/cd3b6a85fd88809fa3664a842a82cee9493880aa", + "reference": "cd3b6a85fd88809fa3664a842a82cee9493880aa", "shasum": "" }, "require-dev": { @@ -1349,22 +1349,22 @@ "homepage": "https://github.com/easyengine/site-type-wp", "support": { "issues": "https://github.com/EasyEngine/site-type-wp/issues", - "source": "https://github.com/EasyEngine/site-type-wp/tree/v1.7.0" + "source": "https://github.com/EasyEngine/site-type-wp/tree/v1.7.1" }, - "time": "2022-06-22T10:02:41+00:00" + "time": "2022-12-19T09:23:04+00:00" }, { "name": "guzzlehttp/guzzle", - "version": "7.4.5", + "version": "7.5.0", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "1dd98b0564cb3f6bd16ce683cb755f94c10fbd82" + "reference": "b50a2a1251152e43f6a37f0fa053e730a67d25ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/1dd98b0564cb3f6bd16ce683cb755f94c10fbd82", - "reference": "1dd98b0564cb3f6bd16ce683cb755f94c10fbd82", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/b50a2a1251152e43f6a37f0fa053e730a67d25ba", + "reference": "b50a2a1251152e43f6a37f0fa053e730a67d25ba", "shasum": "" }, "require": { @@ -1379,10 +1379,10 @@ "psr/http-client-implementation": "1.0" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.4.1", + "bamarni/composer-bin-plugin": "^1.8.1", "ext-curl": "*", "php-http/client-integration-tests": "^3.0", - "phpunit/phpunit": "^8.5.5 || ^9.3.5", + "phpunit/phpunit": "^8.5.29 || ^9.5.23", "psr/log": "^1.1 || ^2.0 || ^3.0" }, "suggest": { @@ -1392,8 +1392,12 @@ }, "type": "library", "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + }, "branch-alias": { - "dev-master": "7.4-dev" + "dev-master": "7.5-dev" } }, "autoload": { @@ -1459,7 +1463,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.4.5" + "source": "https://github.com/guzzle/guzzle/tree/7.5.0" }, "funding": [ { @@ -1475,20 +1479,20 @@ "type": "tidelift" } ], - "time": "2022-06-20T22:16:13+00:00" + "time": "2022-08-28T15:39:27+00:00" }, { "name": "guzzlehttp/promises", - "version": "1.5.1", + "version": "1.5.2", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da" + "reference": "b94b2807d85443f9719887892882d0329d1e2598" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da", - "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da", + "url": "https://api.github.com/repos/guzzle/promises/zipball/b94b2807d85443f9719887892882d0329d1e2598", + "reference": "b94b2807d85443f9719887892882d0329d1e2598", "shasum": "" }, "require": { @@ -1543,7 +1547,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/1.5.1" + "source": "https://github.com/guzzle/promises/tree/1.5.2" }, "funding": [ { @@ -1559,7 +1563,7 @@ "type": "tidelift" } ], - "time": "2021-10-22T20:56:57+00:00" + "time": "2022-08-28T14:55:35+00:00" }, { "name": "guzzlehttp/psr7", @@ -2472,16 +2476,16 @@ }, { "name": "seld/phar-utils", - "version": "1.2.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/Seldaek/phar-utils.git", - "reference": "9f3452c93ff423469c0d56450431562ca423dcee" + "reference": "ea2f4014f163c1be4c601b9b7bd6af81ba8d701c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/9f3452c93ff423469c0d56450431562ca423dcee", - "reference": "9f3452c93ff423469c0d56450431562ca423dcee", + "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/ea2f4014f163c1be4c601b9b7bd6af81ba8d701c", + "reference": "ea2f4014f163c1be4c601b9b7bd6af81ba8d701c", "shasum": "" }, "require": { @@ -2514,9 +2518,9 @@ ], "support": { "issues": "https://github.com/Seldaek/phar-utils/issues", - "source": "https://github.com/Seldaek/phar-utils/tree/1.2.0" + "source": "https://github.com/Seldaek/phar-utils/tree/1.2.1" }, - "time": "2021-12-10T11:20:11+00:00" + "time": "2022-08-31T10:31:18+00:00" }, { "name": "symfony/config", @@ -2598,16 +2602,16 @@ }, { "name": "symfony/console", - "version": "v4.4.44", + "version": "v4.4.49", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "c35fafd7f12ebd6f9e29c95a370df7f1fb171a40" + "reference": "33fa45ffc81fdcc1ca368d4946da859c8cdb58d9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/c35fafd7f12ebd6f9e29c95a370df7f1fb171a40", - "reference": "c35fafd7f12ebd6f9e29c95a370df7f1fb171a40", + "url": "https://api.github.com/repos/symfony/console/zipball/33fa45ffc81fdcc1ca368d4946da859c8cdb58d9", + "reference": "33fa45ffc81fdcc1ca368d4946da859c8cdb58d9", "shasum": "" }, "require": { @@ -2668,7 +2672,7 @@ "description": "Eases the creation of beautiful and testable command line interfaces", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/console/tree/v4.4.44" + "source": "https://github.com/symfony/console/tree/v4.4.49" }, "funding": [ { @@ -2684,7 +2688,7 @@ "type": "tidelift" } ], - "time": "2022-07-20T09:59:04+00:00" + "time": "2022-11-05T17:10:16+00:00" }, { "name": "symfony/debug", @@ -2757,16 +2761,16 @@ }, { "name": "symfony/dependency-injection", - "version": "v4.4.44", + "version": "v4.4.49", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "25502a57182ba1e15da0afd64c975cae4d0a1471" + "reference": "9065fe97dbd38a897e95ea254eb5ddfe1310f734" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/25502a57182ba1e15da0afd64c975cae4d0a1471", - "reference": "25502a57182ba1e15da0afd64c975cae4d0a1471", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/9065fe97dbd38a897e95ea254eb5ddfe1310f734", + "reference": "9065fe97dbd38a897e95ea254eb5ddfe1310f734", "shasum": "" }, "require": { @@ -2823,7 +2827,7 @@ "description": "Allows you to standardize and centralize the way objects are constructed in your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v4.4.44" + "source": "https://github.com/symfony/dependency-injection/tree/v4.4.49" }, "funding": [ { @@ -2839,7 +2843,7 @@ "type": "tidelift" } ], - "time": "2022-07-20T09:59:04+00:00" + "time": "2022-11-16T16:18:09+00:00" }, { "name": "symfony/deprecation-contracts", @@ -3198,16 +3202,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4" + "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", - "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", + "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", "shasum": "" }, "require": { @@ -3222,7 +3226,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3260,7 +3264,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0" }, "funding": [ { @@ -3276,20 +3280,20 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e" + "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", - "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", "shasum": "" }, "require": { @@ -3304,7 +3308,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3343,7 +3347,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0" }, "funding": [ { @@ -3359,20 +3363,20 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "e440d35fa0286f77fb45b79a03fedbeda9307e85" + "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/e440d35fa0286f77fb45b79a03fedbeda9307e85", - "reference": "e440d35fa0286f77fb45b79a03fedbeda9307e85", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/9e8ecb5f92152187c4799efd3c96b78ccab18ff9", + "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9", "shasum": "" }, "require": { @@ -3381,7 +3385,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3422,7 +3426,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.27.0" }, "funding": [ { @@ -3438,20 +3442,20 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace" + "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/cfa0ae98841b9e461207c13ab093d76b0fa7bace", - "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", "shasum": "" }, "require": { @@ -3460,7 +3464,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3505,7 +3509,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0" }, "funding": [ { @@ -3521,20 +3525,20 @@ "type": "tidelift" } ], - "time": "2022-05-10T07:21:04+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-php81", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "13f6d1271c663dc5ae9fb843a8f16521db7687a1" + "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/13f6d1271c663dc5ae9fb843a8f16521db7687a1", - "reference": "13f6d1271c663dc5ae9fb843a8f16521db7687a1", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/707403074c8ea6e2edaf8794b0157a0bfa52157a", + "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a", "shasum": "" }, "require": { @@ -3543,7 +3547,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3584,7 +3588,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.27.0" }, "funding": [ { @@ -3600,7 +3604,7 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/process", @@ -3831,16 +3835,16 @@ }, { "name": "symfony/translation", - "version": "v4.4.44", + "version": "v4.4.47", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "af947fefc306cec6ea5a1f6160c7e305a71f2493" + "reference": "45036b1d53accc48fe9bab71ccd86d57eba0dd94" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/af947fefc306cec6ea5a1f6160c7e305a71f2493", - "reference": "af947fefc306cec6ea5a1f6160c7e305a71f2493", + "url": "https://api.github.com/repos/symfony/translation/zipball/45036b1d53accc48fe9bab71ccd86d57eba0dd94", + "reference": "45036b1d53accc48fe9bab71ccd86d57eba0dd94", "shasum": "" }, "require": { @@ -3900,7 +3904,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v4.4.44" + "source": "https://github.com/symfony/translation/tree/v4.4.47" }, "funding": [ { @@ -3916,7 +3920,7 @@ "type": "tidelift" } ], - "time": "2022-07-20T09:59:04+00:00" + "time": "2022-10-03T15:15:11+00:00" }, { "name": "symfony/translation-contracts", @@ -3998,16 +4002,16 @@ }, { "name": "symfony/yaml", - "version": "v4.4.44", + "version": "v4.4.45", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "c2b28c10fb3b7ac67bafa7b8f952cd83f35acde2" + "reference": "aeccc4dc52a9e634f1d1eebeb21eacfdcff1053d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/c2b28c10fb3b7ac67bafa7b8f952cd83f35acde2", - "reference": "c2b28c10fb3b7ac67bafa7b8f952cd83f35acde2", + "url": "https://api.github.com/repos/symfony/yaml/zipball/aeccc4dc52a9e634f1d1eebeb21eacfdcff1053d", + "reference": "aeccc4dc52a9e634f1d1eebeb21eacfdcff1053d", "shasum": "" }, "require": { @@ -4049,7 +4053,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v4.4.44" + "source": "https://github.com/symfony/yaml/tree/v4.4.45" }, "funding": [ { @@ -4065,7 +4069,7 @@ "type": "tidelift" } ], - "time": "2022-06-27T13:16:42+00:00" + "time": "2022-08-02T15:47:23+00:00" }, { "name": "webmozart/assert", @@ -4629,16 +4633,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.14.0", + "version": "v4.15.2", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1" + "reference": "f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/34bea19b6e03d8153165d8f30bba4c3be86184c1", - "reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc", + "reference": "f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc", "shasum": "" }, "require": { @@ -4679,9 +4683,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.14.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.2" }, - "time": "2022-05-31T20:59:12+00:00" + "time": "2022-11-12T15:38:23+00:00" }, { "name": "phar-io/manifest", @@ -4851,252 +4855,25 @@ }, "time": "2018-07-17T13:42:26+00:00" }, - { - "name": "phpdocumentor/reflection-common", - "version": "2.2.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-2.x": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" - } - ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", - "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" - ], - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", - "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" - }, - "time": "2020-06-27T09:03:43+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "5.3.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", - "shasum": "" - }, - "require": { - "ext-filter": "*", - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.2", - "phpdocumentor/type-resolver": "^1.3", - "webmozart/assert": "^1.9.1" - }, - "require-dev": { - "mockery/mockery": "~1.3.2", - "psalm/phar": "^4.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - }, - { - "name": "Jaap van Otterdijk", - "email": "account@ijaap.nl" - } - ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" - }, - "time": "2021-10-19T17:43:47+00:00" - }, - { - "name": "phpdocumentor/type-resolver", - "version": "1.6.1", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "77a32518733312af16a44300404e945338981de3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/77a32518733312af16a44300404e945338981de3", - "reference": "77a32518733312af16a44300404e945338981de3", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.0" - }, - "require-dev": { - "ext-tokenizer": "*", - "psalm/phar": "^4.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-1.x": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "support": { - "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.1" - }, - "time": "2022-03-15T21:29:03+00:00" - }, - { - "name": "phpspec/prophecy", - "version": "v1.15.0", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/bbcd7380b0ebf3961ee21409db7b38bc31d69a13", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.2", - "php": "^7.2 || ~8.0, <8.2", - "phpdocumentor/reflection-docblock": "^5.2", - "sebastian/comparator": "^3.0 || ^4.0", - "sebastian/recursion-context": "^3.0 || ^4.0" - }, - "require-dev": { - "phpspec/phpspec": "^6.0 || ^7.0", - "phpunit/phpunit": "^8.0 || ^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Prophecy\\": "src/Prophecy" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "support": { - "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.15.0" - }, - "time": "2021-12-08T12:19:24+00:00" - }, { "name": "phpunit/php-code-coverage", - "version": "9.2.15", + "version": "9.2.22", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "2e9da11878c4202f97915c1cb4bb1ca318a63f5f" + "reference": "e4bf60d2220b4baaa0572986b5d69870226b06df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2e9da11878c4202f97915c1cb4bb1ca318a63f5f", - "reference": "2e9da11878c4202f97915c1cb4bb1ca318a63f5f", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/e4bf60d2220b4baaa0572986b5d69870226b06df", + "reference": "e4bf60d2220b4baaa0572986b5d69870226b06df", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.13.0", + "nikic/php-parser": "^4.14", "php": ">=7.3", "phpunit/php-file-iterator": "^3.0.3", "phpunit/php-text-template": "^2.0.2", @@ -5145,7 +4922,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.15" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.22" }, "funding": [ { @@ -5153,7 +4930,7 @@ "type": "github" } ], - "time": "2022-03-07T09:28:20+00:00" + "time": "2022-12-18T16:40:55+00:00" }, { "name": "phpunit/php-file-iterator", @@ -5398,16 +5175,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.21", + "version": "9.5.27", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "0e32b76be457de00e83213528f6bb37e2a38fcb1" + "reference": "a2bc7ffdca99f92d959b3f2270529334030bba38" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0e32b76be457de00e83213528f6bb37e2a38fcb1", - "reference": "0e32b76be457de00e83213528f6bb37e2a38fcb1", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a2bc7ffdca99f92d959b3f2270529334030bba38", + "reference": "a2bc7ffdca99f92d959b3f2270529334030bba38", "shasum": "" }, "require": { @@ -5422,7 +5199,6 @@ "phar-io/manifest": "^2.0.3", "phar-io/version": "^3.0.2", "php": ">=7.3", - "phpspec/prophecy": "^1.12.1", "phpunit/php-code-coverage": "^9.2.13", "phpunit/php-file-iterator": "^3.0.5", "phpunit/php-invoker": "^3.1.1", @@ -5430,19 +5206,16 @@ "phpunit/php-timer": "^5.0.2", "sebastian/cli-parser": "^1.0.1", "sebastian/code-unit": "^1.0.6", - "sebastian/comparator": "^4.0.5", + "sebastian/comparator": "^4.0.8", "sebastian/diff": "^4.0.3", "sebastian/environment": "^5.1.3", - "sebastian/exporter": "^4.0.3", + "sebastian/exporter": "^4.0.5", "sebastian/global-state": "^5.0.1", "sebastian/object-enumerator": "^4.0.3", "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^3.0", + "sebastian/type": "^3.2", "sebastian/version": "^3.0.2" }, - "require-dev": { - "phpspec/prophecy-phpunit": "^2.0.1" - }, "suggest": { "ext-soap": "*", "ext-xdebug": "*" @@ -5484,7 +5257,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.21" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.27" }, "funding": [ { @@ -5494,9 +5267,13 @@ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", + "type": "tidelift" } ], - "time": "2022-06-19T12:14:25+00:00" + "time": "2022-12-09T07:31:23+00:00" }, { "name": "sebastian/cli-parser", @@ -5667,16 +5444,16 @@ }, { "name": "sebastian/comparator", - "version": "4.0.6", + "version": "4.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "55f4261989e546dc112258c7a75935a81a7ce382" + "reference": "fa0f136dd2334583309d32b62544682ee972b51a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", - "reference": "55f4261989e546dc112258c7a75935a81a7ce382", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", + "reference": "fa0f136dd2334583309d32b62544682ee972b51a", "shasum": "" }, "require": { @@ -5729,7 +5506,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.6" + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" }, "funding": [ { @@ -5737,7 +5514,7 @@ "type": "github" } ], - "time": "2020-10-26T15:49:45+00:00" + "time": "2022-09-14T12:41:17+00:00" }, { "name": "sebastian/complexity", @@ -5927,16 +5704,16 @@ }, { "name": "sebastian/exporter", - "version": "4.0.4", + "version": "4.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9" + "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/65e8b7db476c5dd267e65eea9cab77584d3cfff9", - "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", + "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", "shasum": "" }, "require": { @@ -5992,7 +5769,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.4" + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5" }, "funding": [ { @@ -6000,7 +5777,7 @@ "type": "github" } ], - "time": "2021-11-11T14:18:36+00:00" + "time": "2022-09-14T06:03:37+00:00" }, { "name": "sebastian/global-state", @@ -6355,16 +6132,16 @@ }, { "name": "sebastian/type", - "version": "3.0.0", + "version": "3.2.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "b233b84bc4465aff7b57cf1c4bc75c86d00d6dad" + "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b233b84bc4465aff7b57cf1c4bc75c86d00d6dad", - "reference": "b233b84bc4465aff7b57cf1c4bc75c86d00d6dad", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e", + "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e", "shasum": "" }, "require": { @@ -6376,7 +6153,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -6399,7 +6176,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.0.0" + "source": "https://github.com/sebastianbergmann/type/tree/3.2.0" }, "funding": [ { @@ -6407,7 +6184,7 @@ "type": "github" } ], - "time": "2022-03-15T09:54:48+00:00" + "time": "2022-09-12T14:47:03+00:00" }, { "name": "sebastian/version", From 203974d94f96a298ed1cbb9c6eb8a140762d54cc Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 19 Dec 2022 15:10:31 +0530 Subject: [PATCH 0921/1044] Bump to version v4.6.3 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index c78c4964c..83da99bc6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.6.2 +4.6.3 From 2ad96afb3e60418967d9c442221f4e94a57cc14f Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 2 Jan 2023 17:12:51 +0530 Subject: [PATCH 0922/1044] Update EE update confirm prompt Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- php/commands/src/CLI_Command.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/commands/src/CLI_Command.php b/php/commands/src/CLI_Command.php index dc7f28bf3..a4f5f6071 100644 --- a/php/commands/src/CLI_Command.php +++ b/php/commands/src/CLI_Command.php @@ -269,7 +269,7 @@ public function update( $_, $assoc_args ) { } elseif ( ! is_writable( dirname( $old_phar ) ) ) { EE::error( sprintf( '%s is not writable by current user.', dirname( $old_phar ) ) ); } - EE::confirm( "Note: It is recommended to run EasyEngine update in tmux/screen. Update at times may take some time.\n\nTo view progress, tail logs in a different window using `tail -f /opt/easyengine/logs/ee.log`.\n\nAre you sure you want to continue?", $assoc_args ); + EE::confirm( "Note: 1. It is recommended to run EasyEngine update in tmux/screen.\n2. Have minimum 5GB free disk space.\nUpdate at times may take some time.\n\nTo view progress, tail logs in a different window using `tail -f /opt/easyengine/logs/ee.log`.\n\nAre you sure you want to continue?", $assoc_args ); if ( Utils\get_flag_value( $assoc_args, 'nightly' ) ) { EE::confirm( sprintf( 'You have version %s. Would you like to update to the latest nightly?', EE_VERSION ), $assoc_args ); $download_url = 'https://raw.githubusercontent.com/EasyEngine/easyengine-builds/master/phar/easyengine-nightly.phar'; From 79406326a03348669c0961b564d840ecc576dd9e Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 2 Jan 2023 17:13:58 +0530 Subject: [PATCH 0923/1044] Update PHP image versions Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- img-versions.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/img-versions.json b/img-versions.json index f76b5a10d..b31ddd0ec 100644 --- a/img-versions.json +++ b/img-versions.json @@ -4,14 +4,14 @@ "easyengine/mariadb": "v4.6.3", "easyengine/nginx-proxy": "v4.6.3", "easyengine/nginx": "v4.6.3", - "easyengine/php": "v4.6.3", + "easyengine/php": "v4.6.4", "easyengine/php5.6": "v4.6.3", - "easyengine/php7.0": "v4.6.3", - "easyengine/php7.2": "v4.6.3", - "easyengine/php7.3": "v4.6.3", - "easyengine/php7.4": "v4.6.3", - "easyengine/php8.0": "v4.6.3", - "easyengine/php8.1": "v4.6.3", + "easyengine/php7.0": "v4.6.4", + "easyengine/php7.2": "v4.6.4", + "easyengine/php7.3": "v4.6.4", + "easyengine/php7.4": "v4.6.4", + "easyengine/php8.0": "v4.6.4", + "easyengine/php8.1": "v4.6.4", "easyengine/postfix": "v4.6.3", "easyengine/redis": "v4.6.3", "easyengine/newrelic-daemon": "v4.6.3" From 7283b9733e40bd288c85f999509c0ff188794cc1 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 2 Jan 2023 17:14:07 +0530 Subject: [PATCH 0924/1044] Bump to version v4.6.4 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 83da99bc6..ef36c9a71 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.6.3 +4.6.4 From 46c1e16f950f9543ef027f1e84546c26f4112cf1 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Fri, 13 Jan 2023 15:01:56 +0530 Subject: [PATCH 0925/1044] Update composer packages Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 6 ++-- composer.lock | 78 +++++++++++++++++++++++++-------------------------- 2 files changed, 42 insertions(+), 42 deletions(-) diff --git a/composer.json b/composer.json index 93a7f7074..a8ad9a12a 100644 --- a/composer.json +++ b/composer.json @@ -31,12 +31,12 @@ "easyengine/admin-tools-command": "v1.1.0", "easyengine/auth-command": "v1.2.0", "easyengine/config-command": "v1.0.2", - "easyengine/cron-command": "v1.2.0", + "easyengine/cron-command": "v2.0.0", "easyengine/log-command": "v1.1.0", "easyengine/mailhog-command": "v1.0.3", - "easyengine/service-command": "v1.4.0", + "easyengine/service-command": "v1.5.0", "easyengine/shell-command": "v1.1.1", - "easyengine/site-command": "v3.2.1", + "easyengine/site-command": "v3.2.2", "easyengine/site-type-php": "v1.7.0", "easyengine/site-type-wp": "v1.7.1", "monolog/monolog": "1.24.0", diff --git a/composer.lock b/composer.lock index 77072a9c8..84f4e9652 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": "fc392ca98a505b4561cba6a0ef5eed3f", + "content-hash": "09cff251daac7a70c1426c29f44b1992", "packages": [ { "name": "acmephp/core", @@ -199,16 +199,16 @@ }, { "name": "composer/ca-bundle", - "version": "1.3.4", + "version": "1.3.5", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "69098eca243998b53eed7a48d82dedd28b447cd5" + "reference": "74780ccf8c19d6acb8d65c5f39cd72110e132bbd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/69098eca243998b53eed7a48d82dedd28b447cd5", - "reference": "69098eca243998b53eed7a48d82dedd28b447cd5", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/74780ccf8c19d6acb8d65c5f39cd72110e132bbd", + "reference": "74780ccf8c19d6acb8d65c5f39cd72110e132bbd", "shasum": "" }, "require": { @@ -255,7 +255,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.3.4" + "source": "https://github.com/composer/ca-bundle/tree/1.3.5" }, "funding": [ { @@ -271,7 +271,7 @@ "type": "tidelift" } ], - "time": "2022-10-12T12:08:29+00:00" + "time": "2023-01-11T08:27:00+00:00" }, { "name": "composer/composer", @@ -927,16 +927,16 @@ }, { "name": "easyengine/cron-command", - "version": "v1.2.0", + "version": "v2.0.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/cron-command.git", - "reference": "aa2e4ee3a8e0cf8b928cae9b50fb5d52808fcc24" + "reference": "53c18a0b5bbc97e5c66f0f349f976d577bdcfe54" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/cron-command/zipball/aa2e4ee3a8e0cf8b928cae9b50fb5d52808fcc24", - "reference": "aa2e4ee3a8e0cf8b928cae9b50fb5d52808fcc24", + "url": "https://api.github.com/repos/EasyEngine/cron-command/zipball/53c18a0b5bbc97e5c66f0f349f976d577bdcfe54", + "reference": "53c18a0b5bbc97e5c66f0f349f976d577bdcfe54", "shasum": "" }, "type": "ee-cli-package", @@ -972,9 +972,9 @@ "homepage": "https://github.com/easyengine/cron-command", "support": { "issues": "https://github.com/EasyEngine/cron-command/issues", - "source": "https://github.com/EasyEngine/cron-command/tree/v1.2.0" + "source": "https://github.com/EasyEngine/cron-command/tree/v2.0.0" }, - "time": "2021-11-02T09:18:46+00:00" + "time": "2023-01-13T09:27:39+00:00" }, { "name": "easyengine/log-command", @@ -1068,16 +1068,16 @@ }, { "name": "easyengine/service-command", - "version": "v1.4.0", + "version": "v1.5.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/service-command.git", - "reference": "0ae9ab240ddf50e9157c8ab4b0cb8646de694b08" + "reference": "e47f1523dce3e90ea42cde9dd2150285b8c0f7ac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/0ae9ab240ddf50e9157c8ab4b0cb8646de694b08", - "reference": "0ae9ab240ddf50e9157c8ab4b0cb8646de694b08", + "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/e47f1523dce3e90ea42cde9dd2150285b8c0f7ac", + "reference": "e47f1523dce3e90ea42cde9dd2150285b8c0f7ac", "shasum": "" }, "type": "ee-cli-package", @@ -1111,9 +1111,9 @@ "homepage": "https://github.com/easyengine/service-command", "support": { "issues": "https://github.com/EasyEngine/service-command/issues", - "source": "https://github.com/EasyEngine/service-command/tree/v1.4.0" + "source": "https://github.com/EasyEngine/service-command/tree/v1.5.0" }, - "time": "2021-12-07T09:34:46+00:00" + "time": "2023-01-13T09:27:13+00:00" }, { "name": "easyengine/shell-command", @@ -1161,16 +1161,16 @@ }, { "name": "easyengine/site-command", - "version": "v3.2.1", + "version": "v3.2.2", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "abe3d8df6c17c641992ca3124bc795dda320ebce" + "reference": "0c3e6aa725c65ddbdb9aa4c5ff53b1fb3c79bfb5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/abe3d8df6c17c641992ca3124bc795dda320ebce", - "reference": "abe3d8df6c17c641992ca3124bc795dda320ebce", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/0c3e6aa725c65ddbdb9aa4c5ff53b1fb3c79bfb5", + "reference": "0c3e6aa725c65ddbdb9aa4c5ff53b1fb3c79bfb5", "shasum": "" }, "require": { @@ -1231,9 +1231,9 @@ "homepage": "https://github.com/easyengine/site-command", "support": { "issues": "https://github.com/EasyEngine/site-command/issues", - "source": "https://github.com/EasyEngine/site-command/tree/v3.2.1" + "source": "https://github.com/EasyEngine/site-command/tree/v3.2.2" }, - "time": "2022-08-15T17:09:03+00:00" + "time": "2023-01-13T09:26:38+00:00" }, { "name": "easyengine/site-type-php", @@ -4504,30 +4504,30 @@ }, { "name": "doctrine/instantiator", - "version": "1.4.1", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc" + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/10dcfce151b967d20fde1b34ae6640712c3891bc", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^9", + "doctrine/coding-standard": "^9 || ^11", "ext-pdo": "*", "ext-phar": "*", "phpbench/phpbench": "^0.16 || ^1", "phpstan/phpstan": "^1.4", "phpstan/phpstan-phpunit": "^1", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.22" + "vimeo/psalm": "^4.30 || ^5.4" }, "type": "library", "autoload": { @@ -4554,7 +4554,7 @@ ], "support": { "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.4.1" + "source": "https://github.com/doctrine/instantiator/tree/1.5.0" }, "funding": [ { @@ -4570,7 +4570,7 @@ "type": "tidelift" } ], - "time": "2022-03-03T08:28:38+00:00" + "time": "2022-12-30T00:15:36+00:00" }, { "name": "myclabs/deep-copy", @@ -4857,16 +4857,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.22", + "version": "9.2.23", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "e4bf60d2220b4baaa0572986b5d69870226b06df" + "reference": "9f1f0f9a2fbb680b26d1cf9b61b6eac43a6e4e9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/e4bf60d2220b4baaa0572986b5d69870226b06df", - "reference": "e4bf60d2220b4baaa0572986b5d69870226b06df", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/9f1f0f9a2fbb680b26d1cf9b61b6eac43a6e4e9c", + "reference": "9f1f0f9a2fbb680b26d1cf9b61b6eac43a6e4e9c", "shasum": "" }, "require": { @@ -4922,7 +4922,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.22" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.23" }, "funding": [ { @@ -4930,7 +4930,7 @@ "type": "github" } ], - "time": "2022-12-18T16:40:55+00:00" + "time": "2022-12-28T12:41:10+00:00" }, { "name": "phpunit/php-file-iterator", From 75668de225142fd156e5a6f4dc99d4e758277796 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Fri, 13 Jan 2023 15:02:06 +0530 Subject: [PATCH 0926/1044] Update images to latest versions Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- img-versions.json | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/img-versions.json b/img-versions.json index b31ddd0ec..06dcc27fe 100644 --- a/img-versions.json +++ b/img-versions.json @@ -1,18 +1,18 @@ { - "easyengine/cron": "v4.6.3", - "easyengine/mailhog": "v4.6.3", - "easyengine/mariadb": "v4.6.3", - "easyengine/nginx-proxy": "v4.6.3", - "easyengine/nginx": "v4.6.3", - "easyengine/php": "v4.6.4", - "easyengine/php5.6": "v4.6.3", - "easyengine/php7.0": "v4.6.4", - "easyengine/php7.2": "v4.6.4", - "easyengine/php7.3": "v4.6.4", - "easyengine/php7.4": "v4.6.4", - "easyengine/php8.0": "v4.6.4", - "easyengine/php8.1": "v4.6.4", - "easyengine/postfix": "v4.6.3", - "easyengine/redis": "v4.6.3", - "easyengine/newrelic-daemon": "v4.6.3" + "easyengine/cron": "v4.6.5", + "easyengine/mailhog": "v4.6.5", + "easyengine/mariadb": "v4.6.5", + "easyengine/nginx-proxy": "v4.6.5", + "easyengine/nginx": "v4.6.5", + "easyengine/php": "v4.6.5", + "easyengine/php5.6": "v4.6.5", + "easyengine/php7.0": "v4.6.5", + "easyengine/php7.2": "v4.6.5", + "easyengine/php7.3": "v4.6.5", + "easyengine/php7.4": "v4.6.5", + "easyengine/php8.0": "v4.6.5", + "easyengine/php8.1": "v4.6.5", + "easyengine/postfix": "v4.6.5", + "easyengine/redis": "v4.6.5", + "easyengine/newrelic-daemon": "v4.6.5" } From b51f41e8e982d01f59cea27a81b4febccdffcdd2 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Fri, 13 Jan 2023 15:04:39 +0530 Subject: [PATCH 0927/1044] Bump to version v4.6.5 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index ef36c9a71..f18045d64 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.6.4 +4.6.5 From 8b8cdba3cfa17b437a72d7b200f93b6e9fe06853 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Fri, 13 Jan 2023 16:24:56 +0530 Subject: [PATCH 0928/1044] Update composer packages Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 2 +- composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index a8ad9a12a..018aca373 100644 --- a/composer.json +++ b/composer.json @@ -36,7 +36,7 @@ "easyengine/mailhog-command": "v1.0.3", "easyengine/service-command": "v1.5.0", "easyengine/shell-command": "v1.1.1", - "easyengine/site-command": "v3.2.2", + "easyengine/site-command": "v3.2.4", "easyengine/site-type-php": "v1.7.0", "easyengine/site-type-wp": "v1.7.1", "monolog/monolog": "1.24.0", diff --git a/composer.lock b/composer.lock index 84f4e9652..835ef3dc4 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": "09cff251daac7a70c1426c29f44b1992", + "content-hash": "0e040add3a6d5ab7c6be0affc3d3e217", "packages": [ { "name": "acmephp/core", @@ -1161,16 +1161,16 @@ }, { "name": "easyengine/site-command", - "version": "v3.2.2", + "version": "v3.2.4", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "0c3e6aa725c65ddbdb9aa4c5ff53b1fb3c79bfb5" + "reference": "13be7f01b24eb332935d0dad51ad504c8a5fefd7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/0c3e6aa725c65ddbdb9aa4c5ff53b1fb3c79bfb5", - "reference": "0c3e6aa725c65ddbdb9aa4c5ff53b1fb3c79bfb5", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/13be7f01b24eb332935d0dad51ad504c8a5fefd7", + "reference": "13be7f01b24eb332935d0dad51ad504c8a5fefd7", "shasum": "" }, "require": { @@ -1231,9 +1231,9 @@ "homepage": "https://github.com/easyengine/site-command", "support": { "issues": "https://github.com/EasyEngine/site-command/issues", - "source": "https://github.com/EasyEngine/site-command/tree/v3.2.2" + "source": "https://github.com/EasyEngine/site-command/tree/v3.2.4" }, - "time": "2023-01-13T09:26:38+00:00" + "time": "2023-01-13T11:49:15+00:00" }, { "name": "easyengine/site-type-php", From bdb2531536a6695fc9226fe68a97e4295cae82c8 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 19 Jan 2023 16:29:41 +0530 Subject: [PATCH 0929/1044] Update PHP images with latest newrelic agent Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- img-versions.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/img-versions.json b/img-versions.json index 06dcc27fe..15328a18e 100644 --- a/img-versions.json +++ b/img-versions.json @@ -4,14 +4,14 @@ "easyengine/mariadb": "v4.6.5", "easyengine/nginx-proxy": "v4.6.5", "easyengine/nginx": "v4.6.5", - "easyengine/php": "v4.6.5", - "easyengine/php5.6": "v4.6.5", - "easyengine/php7.0": "v4.6.5", - "easyengine/php7.2": "v4.6.5", - "easyengine/php7.3": "v4.6.5", - "easyengine/php7.4": "v4.6.5", - "easyengine/php8.0": "v4.6.5", - "easyengine/php8.1": "v4.6.5", + "easyengine/php": "v4.6.6", + "easyengine/php5.6": "v4.6.6", + "easyengine/php7.0": "v4.6.6", + "easyengine/php7.2": "v4.6.6", + "easyengine/php7.3": "v4.6.6", + "easyengine/php7.4": "v4.6.6", + "easyengine/php8.0": "v4.6.6", + "easyengine/php8.1": "v4.6.6", "easyengine/postfix": "v4.6.5", "easyengine/redis": "v4.6.5", "easyengine/newrelic-daemon": "v4.6.5" From 0144bcc436c324b9472f307dfc439c28728024a1 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Wed, 12 Apr 2023 17:03:00 +0530 Subject: [PATCH 0930/1044] Add docker version update migration Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- ...550_easyengine_check_and_update_docker.php | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 migrations/db/20230312102550_easyengine_check_and_update_docker.php diff --git a/migrations/db/20230312102550_easyengine_check_and_update_docker.php b/migrations/db/20230312102550_easyengine_check_and_update_docker.php new file mode 100644 index 000000000..0f2da39b3 --- /dev/null +++ b/migrations/db/20230312102550_easyengine_check_and_update_docker.php @@ -0,0 +1,51 @@ +<?php + +namespace EE\Migration; + +use EE; +use EE\Migration\Base; + +class CheckAndUpdateDocker extends Base { + + /** + * Execute create table query for site and sitemeta table. + * + * @throws EE\ExitException + */ + public function up() { + + EE::log( 'Checking Docker version.' ); + $docker_version = EE::launch( 'docker version --format "{{.Server.Version}}"' )->stdout; + + if ( version_compare( $docker_version, '20.10.10', '<' ) ) { + EE::warning( 'Docker version should be 20.10.10 or above.' ); + + // If it is MacOS, prompt user to update docker. + if ( 'Darwin' === PHP_OS ) { + EE::confirm( 'Do you want to update Docker?' ); + EE::launch( 'open "docker://"' ); + } + + // If it is Linux, proceed with update. + if ( 'Linux' === PHP_OS ) { + EE::log( 'Updating Docker...' ); + EE::launch( 'curl -fsSL https://get.docker.com | sh' ); + } + } + + // Check the version again post update. + $docker_version = EE::launch( 'docker version --format "{{.Server.Version}}"' )->stdout; + if ( version_compare( $docker_version, '20.10.10', '<' ) ) { + EE::error( 'Docker version should be 20.10.10 or above. Please update Docker and try again.' ); + } + } + + /** + * Execute drop table query for site and sitemeta table. + * + * @throws EE\ExitException + */ + public function down() { + + } +} From d36dc1b3fb2259e5faa8b66bcac5a71edfdebf0f Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 13 Apr 2023 16:01:46 +0530 Subject: [PATCH 0931/1044] Update MariaDB to 10.11 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- img-versions.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/img-versions.json b/img-versions.json index 15328a18e..14b859f5f 100644 --- a/img-versions.json +++ b/img-versions.json @@ -1,7 +1,7 @@ { "easyengine/cron": "v4.6.5", "easyengine/mailhog": "v4.6.5", - "easyengine/mariadb": "v4.6.5", + "easyengine/mariadb": "v4.6.6", "easyengine/nginx-proxy": "v4.6.5", "easyengine/nginx": "v4.6.5", "easyengine/php": "v4.6.6", From fb63a1731ee59d41d7578f6e4421fedf99fb023b Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Wed, 26 Apr 2023 10:07:12 +0530 Subject: [PATCH 0932/1044] Bump to version v4.6.6 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index f18045d64..ec3f25fb5 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.6.5 +4.6.6 From 59648c191b3be30adcdcfea7d8ce2e9a47b2a039 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Wed, 23 Aug 2023 18:09:20 +0530 Subject: [PATCH 0933/1044] Update Nginx and PHP Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- img-versions.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/img-versions.json b/img-versions.json index 14b859f5f..d10eb5ac3 100644 --- a/img-versions.json +++ b/img-versions.json @@ -3,15 +3,15 @@ "easyengine/mailhog": "v4.6.5", "easyengine/mariadb": "v4.6.6", "easyengine/nginx-proxy": "v4.6.5", - "easyengine/nginx": "v4.6.5", + "easyengine/nginx": "v4.6.7", "easyengine/php": "v4.6.6", "easyengine/php5.6": "v4.6.6", "easyengine/php7.0": "v4.6.6", "easyengine/php7.2": "v4.6.6", "easyengine/php7.3": "v4.6.6", "easyengine/php7.4": "v4.6.6", - "easyengine/php8.0": "v4.6.6", - "easyengine/php8.1": "v4.6.6", + "easyengine/php8.0": "v4.6.7", + "easyengine/php8.1": "v4.6.7", "easyengine/postfix": "v4.6.5", "easyengine/redis": "v4.6.5", "easyengine/newrelic-daemon": "v4.6.5" From cfc56b55d5b73aaa146b88557b2eab0feebf123e Mon Sep 17 00:00:00 2001 From: Durgesh kumar prajapati <98798977+Durgesh4993@users.noreply.github.com> Date: Tue, 17 Oct 2023 05:23:56 +0530 Subject: [PATCH 0934/1044] Update README.md --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bda7398f0..e992cfff0 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,14 @@ <img src="https://i2.wp.com/easyengine.io/wp-content/uploads/sites/20/2019/06/EasyEngine-New-Logo-Banner@2x-Transparent-Background.png?fit=720%2C170&ssl=1" alt="EasyEngine Logo" /> -# EasyEngine v4 [![Build 🔨 + Test 👨‍🔧](https://github.com/EasyEngine/easyengine/actions/workflows/test_and_build.yml/badge.svg?branch=develop)](https://github.com/EasyEngine/easyengine/actions/workflows/test_and_build.yml) [![Join EasyEngine Slack Channel](http://slack.easyengine.io/badge.svg)](http://slack.easyengine.io/) [![Latest Stable Version](https://poser.pugx.org/easyengine/easyengine/v/stable)](https://github.com/EasyEngine/easyengine/releases) [![License](https://poser.pugx.org/easyengine/easyengine/license)](https://packagist.org/packages/easyengine/easyengine) +# EasyEngine v4 +[![Build 🔨 + Test 👨‍🔧](https://github.com/EasyEngine/easyengine/actions/workflows/test_and_build.yml/badge.svg?branch=develop)](https://github.com/EasyEngine/easyengine/actions/workflows/test_and_build.yml) +[![Join EasyEngine Slack Channel](https://img.shields.io/badge/Join%20Our%20Community-Slack-blue)](http://slack.easyengine.io/) +[![Latest Stable Version](https://poser.pugx.org/easyengine/easyengine/v/stable)](https://github.com/EasyEngine/easyengine/releases) [![License](https://poser.pugx.org/easyengine/easyengine/license)](https://packagist.org/packages/easyengine/easyengine) EasyEngine makes it greatly easy to manage nginx, a fast web-server software that consumes little memory when handling increasing volumes of concurrent users. -<a href="https://rtcamp.com/?utm_source=github&utm_medium=readme" rel="nofollow"><img src="https://rtcamp.com/wp-content/uploads/2019/04/github-banner@2x.png" alt="Handcrafted Enterprise WordPress Solutions by rtCamp" /></a> +<a href="https://rtcamp.com/?utm_source=github&utm_medium=readme" rel="nofollow"><img style="width:150px;" src="https://learn.rtcamp.com/wp-content/uploads/2021/04/rtlearn-logo@2x.png" alt="Handcrafted Enterprise WordPress Solutions by rtCamp" /></a> ## Requirements From 4f578ff5bb7d39b705664f32bcd8d194805dfbe0 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Fri, 10 Nov 2023 16:18:06 +0530 Subject: [PATCH 0935/1044] Update composer packages Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 4 +- composer.lock | 394 ++++++++++++++++++++++++-------------------------- 2 files changed, 194 insertions(+), 204 deletions(-) diff --git a/composer.json b/composer.json index 018aca373..91649d0d6 100644 --- a/composer.json +++ b/composer.json @@ -31,10 +31,10 @@ "easyengine/admin-tools-command": "v1.1.0", "easyengine/auth-command": "v1.2.0", "easyengine/config-command": "v1.0.2", - "easyengine/cron-command": "v2.0.0", + "easyengine/cron-command": "v2.0.1", "easyengine/log-command": "v1.1.0", "easyengine/mailhog-command": "v1.0.3", - "easyengine/service-command": "v1.5.0", + "easyengine/service-command": "v1.5.1", "easyengine/shell-command": "v1.1.1", "easyengine/site-command": "v3.2.4", "easyengine/site-type-php": "v1.7.0", diff --git a/composer.lock b/composer.lock index 835ef3dc4..7d451c65e 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": "0e040add3a6d5ab7c6be0affc3d3e217", + "content-hash": "88dbfbd4138e9c6b612c8169f026713e", "packages": [ { "name": "acmephp/core", @@ -199,16 +199,16 @@ }, { "name": "composer/ca-bundle", - "version": "1.3.5", + "version": "1.3.7", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "74780ccf8c19d6acb8d65c5f39cd72110e132bbd" + "reference": "76e46335014860eec1aa5a724799a00a2e47cc85" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/74780ccf8c19d6acb8d65c5f39cd72110e132bbd", - "reference": "74780ccf8c19d6acb8d65c5f39cd72110e132bbd", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/76e46335014860eec1aa5a724799a00a2e47cc85", + "reference": "76e46335014860eec1aa5a724799a00a2e47cc85", "shasum": "" }, "require": { @@ -255,7 +255,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.3.5" + "source": "https://github.com/composer/ca-bundle/tree/1.3.7" }, "funding": [ { @@ -271,7 +271,7 @@ "type": "tidelift" } ], - "time": "2023-01-11T08:27:00+00:00" + "time": "2023-08-30T09:31:38+00:00" }, { "name": "composer/composer", @@ -927,16 +927,16 @@ }, { "name": "easyengine/cron-command", - "version": "v2.0.0", + "version": "v2.0.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/cron-command.git", - "reference": "53c18a0b5bbc97e5c66f0f349f976d577bdcfe54" + "reference": "f8e138b7f348766fc41b79a66b0778f62db32f46" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/cron-command/zipball/53c18a0b5bbc97e5c66f0f349f976d577bdcfe54", - "reference": "53c18a0b5bbc97e5c66f0f349f976d577bdcfe54", + "url": "https://api.github.com/repos/EasyEngine/cron-command/zipball/f8e138b7f348766fc41b79a66b0778f62db32f46", + "reference": "f8e138b7f348766fc41b79a66b0778f62db32f46", "shasum": "" }, "type": "ee-cli-package", @@ -972,9 +972,9 @@ "homepage": "https://github.com/easyengine/cron-command", "support": { "issues": "https://github.com/EasyEngine/cron-command/issues", - "source": "https://github.com/EasyEngine/cron-command/tree/v2.0.0" + "source": "https://github.com/EasyEngine/cron-command/tree/v2.0.1" }, - "time": "2023-01-13T09:27:39+00:00" + "time": "2023-11-10T10:42:24+00:00" }, { "name": "easyengine/log-command", @@ -1068,16 +1068,16 @@ }, { "name": "easyengine/service-command", - "version": "v1.5.0", + "version": "v1.5.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/service-command.git", - "reference": "e47f1523dce3e90ea42cde9dd2150285b8c0f7ac" + "reference": "203edce7a099dd100eb8a73481a6a7704a712779" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/e47f1523dce3e90ea42cde9dd2150285b8c0f7ac", - "reference": "e47f1523dce3e90ea42cde9dd2150285b8c0f7ac", + "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/203edce7a099dd100eb8a73481a6a7704a712779", + "reference": "203edce7a099dd100eb8a73481a6a7704a712779", "shasum": "" }, "type": "ee-cli-package", @@ -1111,9 +1111,9 @@ "homepage": "https://github.com/easyengine/service-command", "support": { "issues": "https://github.com/EasyEngine/service-command/issues", - "source": "https://github.com/EasyEngine/service-command/tree/v1.5.0" + "source": "https://github.com/EasyEngine/service-command/tree/v1.5.1" }, - "time": "2023-01-13T09:27:13+00:00" + "time": "2023-11-10T10:54:50+00:00" }, { "name": "easyengine/shell-command", @@ -1355,22 +1355,22 @@ }, { "name": "guzzlehttp/guzzle", - "version": "7.5.0", + "version": "7.8.0", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "b50a2a1251152e43f6a37f0fa053e730a67d25ba" + "reference": "1110f66a6530a40fe7aea0378fe608ee2b2248f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/b50a2a1251152e43f6a37f0fa053e730a67d25ba", - "reference": "b50a2a1251152e43f6a37f0fa053e730a67d25ba", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/1110f66a6530a40fe7aea0378fe608ee2b2248f9", + "reference": "1110f66a6530a40fe7aea0378fe608ee2b2248f9", "shasum": "" }, "require": { "ext-json": "*", - "guzzlehttp/promises": "^1.5", - "guzzlehttp/psr7": "^1.9 || ^2.4", + "guzzlehttp/promises": "^1.5.3 || ^2.0.1", + "guzzlehttp/psr7": "^1.9.1 || ^2.5.1", "php": "^7.2.5 || ^8.0", "psr/http-client": "^1.0", "symfony/deprecation-contracts": "^2.2 || ^3.0" @@ -1381,7 +1381,8 @@ "require-dev": { "bamarni/composer-bin-plugin": "^1.8.1", "ext-curl": "*", - "php-http/client-integration-tests": "^3.0", + "php-http/client-integration-tests": "dev-master#2c025848417c1135031fdf9c728ee53d0a7ceaee as 3.0.999", + "php-http/message-factory": "^1.1", "phpunit/phpunit": "^8.5.29 || ^9.5.23", "psr/log": "^1.1 || ^2.0 || ^3.0" }, @@ -1395,9 +1396,6 @@ "bamarni-bin": { "bin-links": true, "forward-command": false - }, - "branch-alias": { - "dev-master": "7.5-dev" } }, "autoload": { @@ -1463,7 +1461,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.5.0" + "source": "https://github.com/guzzle/guzzle/tree/7.8.0" }, "funding": [ { @@ -1479,38 +1477,37 @@ "type": "tidelift" } ], - "time": "2022-08-28T15:39:27+00:00" + "time": "2023-08-27T10:20:53+00:00" }, { "name": "guzzlehttp/promises", - "version": "1.5.2", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "b94b2807d85443f9719887892882d0329d1e2598" + "reference": "111166291a0f8130081195ac4556a5587d7f1b5d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/b94b2807d85443f9719887892882d0329d1e2598", - "reference": "b94b2807d85443f9719887892882d0329d1e2598", + "url": "https://api.github.com/repos/guzzle/promises/zipball/111166291a0f8130081195ac4556a5587d7f1b5d", + "reference": "111166291a0f8130081195ac4556a5587d7f1b5d", "shasum": "" }, "require": { - "php": ">=5.5" + "php": "^7.2.5 || ^8.0" }, "require-dev": { - "symfony/phpunit-bridge": "^4.4 || ^5.1" + "bamarni/composer-bin-plugin": "^1.8.1", + "phpunit/phpunit": "^8.5.29 || ^9.5.23" }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "1.5-dev" + "bamarni-bin": { + "bin-links": true, + "forward-command": false } }, "autoload": { - "files": [ - "src/functions_include.php" - ], "psr-4": { "GuzzleHttp\\Promise\\": "src/" } @@ -1547,7 +1544,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/1.5.2" + "source": "https://github.com/guzzle/promises/tree/2.0.1" }, "funding": [ { @@ -1563,20 +1560,20 @@ "type": "tidelift" } ], - "time": "2022-08-28T14:55:35+00:00" + "time": "2023-08-03T15:11:55+00:00" }, { "name": "guzzlehttp/psr7", - "version": "1.9.0", + "version": "1.9.1", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "e98e3e6d4f86621a9b75f623996e6bbdeb4b9318" + "reference": "e4490cabc77465aaee90b20cfc9a770f8c04be6b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/e98e3e6d4f86621a9b75f623996e6bbdeb4b9318", - "reference": "e98e3e6d4f86621a9b75f623996e6bbdeb4b9318", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/e4490cabc77465aaee90b20cfc9a770f8c04be6b", + "reference": "e4490cabc77465aaee90b20cfc9a770f8c04be6b", "shasum": "" }, "require": { @@ -1595,11 +1592,6 @@ "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.9-dev" - } - }, "autoload": { "files": [ "src/functions_include.php" @@ -1657,7 +1649,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/1.9.0" + "source": "https://github.com/guzzle/psr7/tree/1.9.1" }, "funding": [ { @@ -1673,20 +1665,20 @@ "type": "tidelift" } ], - "time": "2022-06-20T21:43:03+00:00" + "time": "2023-04-17T16:00:37+00:00" }, { "name": "justinrainbow/json-schema", - "version": "5.2.12", + "version": "v5.2.13", "source": { "type": "git", "url": "https://github.com/justinrainbow/json-schema.git", - "reference": "ad87d5a5ca981228e0e205c2bc7dfb8e24559b60" + "reference": "fbbe7e5d79f618997bc3332a6f49246036c45793" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/ad87d5a5ca981228e0e205c2bc7dfb8e24559b60", - "reference": "ad87d5a5ca981228e0e205c2bc7dfb8e24559b60", + "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/fbbe7e5d79f618997bc3332a6f49246036c45793", + "reference": "fbbe7e5d79f618997bc3332a6f49246036c45793", "shasum": "" }, "require": { @@ -1741,9 +1733,9 @@ ], "support": { "issues": "https://github.com/justinrainbow/json-schema/issues", - "source": "https://github.com/justinrainbow/json-schema/tree/5.2.12" + "source": "https://github.com/justinrainbow/json-schema/tree/v5.2.13" }, - "time": "2022-04-13T08:02:27+00:00" + "time": "2023-09-26T02:20:38+00:00" }, { "name": "league/flysystem", @@ -1841,16 +1833,16 @@ }, { "name": "league/mime-type-detection", - "version": "1.11.0", + "version": "1.12.0", "source": { "type": "git", "url": "https://github.com/thephpleague/mime-type-detection.git", - "reference": "ff6248ea87a9f116e78edd6002e39e5128a0d4dd" + "reference": "c7f2872fb273bf493811473dafc88d60ae829f48" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/ff6248ea87a9f116e78edd6002e39e5128a0d4dd", - "reference": "ff6248ea87a9f116e78edd6002e39e5128a0d4dd", + "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/c7f2872fb273bf493811473dafc88d60ae829f48", + "reference": "c7f2872fb273bf493811473dafc88d60ae829f48", "shasum": "" }, "require": { @@ -1881,7 +1873,7 @@ "description": "Mime-type detection for Flysystem", "support": { "issues": "https://github.com/thephpleague/mime-type-detection/issues", - "source": "https://github.com/thephpleague/mime-type-detection/tree/1.11.0" + "source": "https://github.com/thephpleague/mime-type-detection/tree/1.12.0" }, "funding": [ { @@ -1893,7 +1885,7 @@ "type": "tidelift" } ], - "time": "2022-04-17T13:12:02+00:00" + "time": "2023-08-03T07:14:11+00:00" }, { "name": "monolog/monolog", @@ -2077,21 +2069,21 @@ }, { "name": "psr/http-client", - "version": "1.0.1", + "version": "1.0.3", "source": { "type": "git", "url": "https://github.com/php-fig/http-client.git", - "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621" + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", - "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", "shasum": "" }, "require": { "php": "^7.0 || ^8.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.0 || ^2.0" }, "type": "library", "extra": { @@ -2111,7 +2103,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for HTTP clients", @@ -2123,31 +2115,31 @@ "psr-18" ], "support": { - "source": "https://github.com/php-fig/http-client/tree/master" + "source": "https://github.com/php-fig/http-client" }, - "time": "2020-06-29T06:28:15+00:00" + "time": "2023-09-23T14:17:50+00:00" }, { "name": "psr/http-message", - "version": "1.0.1", + "version": "1.1", "source": { "type": "git", "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba", + "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": "^7.2 || ^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.1.x-dev" } }, "autoload": { @@ -2176,9 +2168,9 @@ "response" ], "support": { - "source": "https://github.com/php-fig/http-message/tree/master" + "source": "https://github.com/php-fig/http-message/tree/1.1" }, - "time": "2016-08-06T14:39:51+00:00" + "time": "2023-04-04T09:50:52+00:00" }, { "name": "psr/log", @@ -2276,23 +2268,23 @@ }, { "name": "react/promise", - "version": "v2.9.0", + "version": "v2.10.0", "source": { "type": "git", "url": "https://github.com/reactphp/promise.git", - "reference": "234f8fd1023c9158e2314fa9d7d0e6a83db42910" + "reference": "f913fb8cceba1e6644b7b90c4bfb678ed8a3ef38" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise/zipball/234f8fd1023c9158e2314fa9d7d0e6a83db42910", - "reference": "234f8fd1023c9158e2314fa9d7d0e6a83db42910", + "url": "https://api.github.com/repos/reactphp/promise/zipball/f913fb8cceba1e6644b7b90c4bfb678ed8a3ef38", + "reference": "f913fb8cceba1e6644b7b90c4bfb678ed8a3ef38", "shasum": "" }, "require": { "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36" + "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.36" }, "type": "library", "autoload": { @@ -2336,19 +2328,15 @@ ], "support": { "issues": "https://github.com/reactphp/promise/issues", - "source": "https://github.com/reactphp/promise/tree/v2.9.0" + "source": "https://github.com/reactphp/promise/tree/v2.10.0" }, "funding": [ { - "url": "https://github.com/WyriHaximus", - "type": "github" - }, - { - "url": "https://github.com/clue", - "type": "github" + "url": "https://opencollective.com/reactphp", + "type": "open_collective" } ], - "time": "2022-02-11T10:27:51+00:00" + "time": "2023-05-02T15:15:43+00:00" }, { "name": "rmccue/requests", @@ -2412,16 +2400,16 @@ }, { "name": "seld/jsonlint", - "version": "1.9.0", + "version": "1.10.0", "source": { "type": "git", "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "4211420d25eba80712bff236a98960ef68b866b7" + "reference": "594fd6462aad8ecee0b45ca5045acea4776667f1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/4211420d25eba80712bff236a98960ef68b866b7", - "reference": "4211420d25eba80712bff236a98960ef68b866b7", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/594fd6462aad8ecee0b45ca5045acea4776667f1", + "reference": "594fd6462aad8ecee0b45ca5045acea4776667f1", "shasum": "" }, "require": { @@ -2460,7 +2448,7 @@ ], "support": { "issues": "https://github.com/Seldaek/jsonlint/issues", - "source": "https://github.com/Seldaek/jsonlint/tree/1.9.0" + "source": "https://github.com/Seldaek/jsonlint/tree/1.10.0" }, "funding": [ { @@ -2472,7 +2460,7 @@ "type": "tidelift" } ], - "time": "2022-04-01T13:37:23+00:00" + "time": "2023-05-11T13:16:46+00:00" }, { "name": "seld/phar-utils", @@ -3202,16 +3190,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" + "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", + "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", "shasum": "" }, "require": { @@ -3226,7 +3214,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3264,7 +3252,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0" }, "funding": [ { @@ -3280,20 +3268,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" + "reference": "42292d99c55abe617799667f454222c54c60e229" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229", + "reference": "42292d99c55abe617799667f454222c54c60e229", "shasum": "" }, "require": { @@ -3308,7 +3296,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3347,7 +3335,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0" }, "funding": [ { @@ -3363,20 +3351,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-07-28T09:04:16+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9" + "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/9e8ecb5f92152187c4799efd3c96b78ccab18ff9", - "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fe2f306d1d9d346a7fee353d0d5012e401e984b5", + "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5", "shasum": "" }, "require": { @@ -3385,7 +3373,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3426,7 +3414,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.28.0" }, "funding": [ { @@ -3442,20 +3430,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5", + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5", "shasum": "" }, "require": { @@ -3464,7 +3452,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3509,7 +3497,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0" }, "funding": [ { @@ -3525,20 +3513,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-php81", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a" + "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/707403074c8ea6e2edaf8794b0157a0bfa52157a", - "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/7581cd600fa9fd681b797d00b02f068e2f13263b", + "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b", "shasum": "" }, "require": { @@ -3547,7 +3535,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3588,7 +3576,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.28.0" }, "funding": [ { @@ -3604,7 +3592,7 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/process", @@ -4574,16 +4562,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.11.0", + "version": "1.11.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614" + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/14daed4296fae74d9e3201d2c4925d1acb7aa614", - "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", "shasum": "" }, "require": { @@ -4621,7 +4609,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.0" + "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" }, "funding": [ { @@ -4629,20 +4617,20 @@ "type": "tidelift" } ], - "time": "2022-03-03T13:19:32+00:00" + "time": "2023-03-08T13:26:56+00:00" }, { "name": "nikic/php-parser", - "version": "v4.15.2", + "version": "v4.17.1", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc" + "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc", - "reference": "f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", + "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", "shasum": "" }, "require": { @@ -4683,9 +4671,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.2" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.17.1" }, - "time": "2022-11-12T15:38:23+00:00" + "time": "2023-08-13T19:53:39+00:00" }, { "name": "phar-io/manifest", @@ -4857,23 +4845,23 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.23", + "version": "9.2.29", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "9f1f0f9a2fbb680b26d1cf9b61b6eac43a6e4e9c" + "reference": "6a3a87ac2bbe33b25042753df8195ba4aa534c76" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/9f1f0f9a2fbb680b26d1cf9b61b6eac43a6e4e9c", - "reference": "9f1f0f9a2fbb680b26d1cf9b61b6eac43a6e4e9c", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/6a3a87ac2bbe33b25042753df8195ba4aa534c76", + "reference": "6a3a87ac2bbe33b25042753df8195ba4aa534c76", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.14", + "nikic/php-parser": "^4.15", "php": ">=7.3", "phpunit/php-file-iterator": "^3.0.3", "phpunit/php-text-template": "^2.0.2", @@ -4888,8 +4876,8 @@ "phpunit/phpunit": "^9.3" }, "suggest": { - "ext-pcov": "*", - "ext-xdebug": "*" + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, "type": "library", "extra": { @@ -4922,7 +4910,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.23" + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.29" }, "funding": [ { @@ -4930,7 +4919,7 @@ "type": "github" } ], - "time": "2022-12-28T12:41:10+00:00" + "time": "2023-09-19T04:57:46+00:00" }, { "name": "phpunit/php-file-iterator", @@ -5175,20 +5164,20 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.27", + "version": "9.5.28", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "a2bc7ffdca99f92d959b3f2270529334030bba38" + "reference": "954ca3113a03bf780d22f07bf055d883ee04b65e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a2bc7ffdca99f92d959b3f2270529334030bba38", - "reference": "a2bc7ffdca99f92d959b3f2270529334030bba38", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/954ca3113a03bf780d22f07bf055d883ee04b65e", + "reference": "954ca3113a03bf780d22f07bf055d883ee04b65e", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.3.1", + "doctrine/instantiator": "^1.3.1 || ^2", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", @@ -5257,7 +5246,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.27" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.28" }, "funding": [ { @@ -5273,7 +5262,7 @@ "type": "tidelift" } ], - "time": "2022-12-09T07:31:23+00:00" + "time": "2023-01-14T12:32:24+00:00" }, { "name": "sebastian/cli-parser", @@ -5575,16 +5564,16 @@ }, { "name": "sebastian/diff", - "version": "4.0.4", + "version": "4.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" + "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/74be17022044ebaaecfdf0c5cd504fc9cd5a7131", + "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131", "shasum": "" }, "require": { @@ -5629,7 +5618,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4" + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.5" }, "funding": [ { @@ -5637,20 +5626,20 @@ "type": "github" } ], - "time": "2020-10-26T13:10:38+00:00" + "time": "2023-05-07T05:35:17+00:00" }, { "name": "sebastian/environment", - "version": "5.1.4", + "version": "5.1.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7" + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/1b5dff7bb151a4db11d49d90e5408e4e938270f7", - "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", "shasum": "" }, "require": { @@ -5692,7 +5681,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/5.1.4" + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" }, "funding": [ { @@ -5700,7 +5689,7 @@ "type": "github" } ], - "time": "2022-04-03T09:37:03+00:00" + "time": "2023-02-03T06:03:51+00:00" }, { "name": "sebastian/exporter", @@ -5781,16 +5770,16 @@ }, { "name": "sebastian/global-state", - "version": "5.0.5", + "version": "5.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2" + "reference": "bde739e7565280bda77be70044ac1047bc007e34" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/0ca8db5a5fc9c8646244e629625ac486fa286bf2", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bde739e7565280bda77be70044ac1047bc007e34", + "reference": "bde739e7565280bda77be70044ac1047bc007e34", "shasum": "" }, "require": { @@ -5833,7 +5822,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.5" + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.6" }, "funding": [ { @@ -5841,7 +5830,7 @@ "type": "github" } ], - "time": "2022-02-14T08:28:10+00:00" + "time": "2023-08-02T09:26:13+00:00" }, { "name": "sebastian/lines-of-code", @@ -6014,16 +6003,16 @@ }, { "name": "sebastian/recursion-context", - "version": "4.0.4", + "version": "4.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172" + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172", - "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", "shasum": "" }, "require": { @@ -6062,10 +6051,10 @@ } ], "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "homepage": "https://github.com/sebastianbergmann/recursion-context", "support": { "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.4" + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" }, "funding": [ { @@ -6073,7 +6062,7 @@ "type": "github" } ], - "time": "2020-10-26T13:17:30+00:00" + "time": "2023-02-03T06:07:39+00:00" }, { "name": "sebastian/resource-operations", @@ -6132,16 +6121,16 @@ }, { "name": "sebastian/type", - "version": "3.2.0", + "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e" + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e", - "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", "shasum": "" }, "require": { @@ -6176,7 +6165,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.2.0" + "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" }, "funding": [ { @@ -6184,7 +6173,7 @@ "type": "github" } ], - "time": "2022-09-12T14:47:03+00:00" + "time": "2023-02-03T06:13:03+00:00" }, { "name": "sebastian/version", @@ -6241,16 +6230,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.7.1", + "version": "3.7.2", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619" + "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/1359e176e9307e906dc3d890bcc9603ff6d90619", - "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879", + "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879", "shasum": "" }, "require": { @@ -6286,14 +6275,15 @@ "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", "keywords": [ "phpcs", - "standards" + "standards", + "static analysis" ], "support": { "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", "source": "https://github.com/squizlabs/PHP_CodeSniffer", "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" }, - "time": "2022-06-18T07:21:10+00:00" + "time": "2023-02-22T23:07:41+00:00" }, { "name": "theseer/tokenizer", From 43d00ee1de06ee6103279eca521b33947c45050c Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Fri, 10 Nov 2023 21:18:40 +0530 Subject: [PATCH 0936/1044] Add new global containers Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- php/EE/Migration/GlobalContainers.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/php/EE/Migration/GlobalContainers.php b/php/EE/Migration/GlobalContainers.php index f6f33d054..7c73e550f 100644 --- a/php/EE/Migration/GlobalContainers.php +++ b/php/EE/Migration/GlobalContainers.php @@ -130,10 +130,11 @@ public static function global_service_down( $service_name ) { public static function get_all_global_images_with_service_name() { return [ - 'easyengine/nginx-proxy' => GLOBAL_PROXY_CONTAINER, - 'easyengine/mariadb' => GLOBAL_DB_CONTAINER, - 'easyengine/redis' => GLOBAL_REDIS_CONTAINER, - // 'easyengine/cron' => EE_CRON_SCHEDULER, //TODO: Add it to global docker-compose. + 'easyengine/nginx-proxy' => GLOBAL_PROXY_CONTAINER, + 'easyengine/mariadb' => GLOBAL_DB_CONTAINER, + 'easyengine/redis' => GLOBAL_REDIS_CONTAINER, + 'easyengine/cron' => GLOBAL_CRON_CONTAINER, + 'easyengine/newrelic-daemon' => GLOBAL_NEWRELIC_DAEMON_CONTAINER, ]; } From acaf0089246bf5e485ce5a80258816d1e7f120eb Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Fri, 10 Nov 2023 21:18:59 +0530 Subject: [PATCH 0937/1044] Update fetching existing img versions Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- php/EE/Migration/Containers.php | 40 ++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index bb3d54498..f7b4ba458 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -40,16 +40,17 @@ public static function start_container_migration() { foreach ( $img_versions as $img => $version ) { - if ( in_array( $img, $skip_download ) ) { - continue; - } if ( array_key_exists( $img, $current_versions ) ) { if ( $current_versions[ $img ] !== $version ) { $updated_images[] = $img; - self::pull_or_error( $img, $version ); + if ( ! in_array( $img, $skip_download ) ) { + self::pull_or_error( $img, $version ); + } } } else { - self::pull_or_error( $img, $version ); + if ( ! in_array( $img, $skip_download ) ) { + self::pull_or_error( $img, $version ); + } } } @@ -151,16 +152,29 @@ public static function pull_or_error( $image, $version ) { * @throws \Exception */ public static function get_current_docker_images_versions() { - $images = EE::db() - ->table( 'options' ) - ->where( 'key', 'like', 'easyengine/%' ) - ->all(); - $images = array_map( function ( $image ) { - return [ $image['key'] => $image['value'] ]; - }, $images ); + $dbImages = EE::db() + ->table( 'options' ) + ->where( 'key', 'like', 'easyengine/%' ) + ->all(); + + $dbImages = array_column( $dbImages, 'value', 'key' ); + + $dockerImages = EE::launch( 'docker ps --format "{{.Image}}" | grep "^easyengine/" | sort -u' )->stdout; + $dockerImages = explode( "\n", trim( $dockerImages ) ); + + $dockerImages = array_reduce( $dockerImages, function ( $result, $image ) { + + [ $imageName, $tag ] = explode( ':', $image, 2 ) + [ 1 => null ]; + $result[ $imageName ] = $tag; + + return $result; + }, [] ); + + $mergedImages = $dockerImages + $dbImages; + $mergedImages = array_filter( $mergedImages ); - return array_merge( ...$images ); + return $mergedImages; } /** From b187f85fe1c082cd4a7949cc605401628b0c49d9 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Fri, 10 Nov 2023 21:19:19 +0530 Subject: [PATCH 0938/1044] Update img-versions Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- img-versions.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/img-versions.json b/img-versions.json index d10eb5ac3..c513ef6cc 100644 --- a/img-versions.json +++ b/img-versions.json @@ -9,10 +9,10 @@ "easyengine/php7.0": "v4.6.6", "easyengine/php7.2": "v4.6.6", "easyengine/php7.3": "v4.6.6", - "easyengine/php7.4": "v4.6.6", + "easyengine/php7.4": "v4.6.7", "easyengine/php8.0": "v4.6.7", "easyengine/php8.1": "v4.6.7", "easyengine/postfix": "v4.6.5", "easyengine/redis": "v4.6.5", - "easyengine/newrelic-daemon": "v4.6.5" + "easyengine/newrelic-daemon": "v4.6.7" } From e09f5fbce015fd33b0bac56f7f4f4a43c264f074 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Fri, 26 Apr 2024 20:36:47 +0530 Subject: [PATCH 0939/1044] Add PHP 8.2 & 8.3 image keys Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- img-versions.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/img-versions.json b/img-versions.json index c513ef6cc..88759c896 100644 --- a/img-versions.json +++ b/img-versions.json @@ -12,6 +12,8 @@ "easyengine/php7.4": "v4.6.7", "easyengine/php8.0": "v4.6.7", "easyengine/php8.1": "v4.6.7", + "easyengine/php8.2": "v4.7.0", + "easyengine/php8.3": "v4.7.0", "easyengine/postfix": "v4.6.5", "easyengine/redis": "v4.6.5", "easyengine/newrelic-daemon": "v4.6.7" From 657064ed97106c8f1f9f2587c3bbbd9bd88e2a25 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Fri, 26 Apr 2024 20:37:15 +0530 Subject: [PATCH 0940/1044] Update stack img versions Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- img-versions.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/img-versions.json b/img-versions.json index 88759c896..c5f241e99 100644 --- a/img-versions.json +++ b/img-versions.json @@ -1,20 +1,20 @@ { - "easyengine/cron": "v4.6.5", + "easyengine/cron": "v4.7.0", "easyengine/mailhog": "v4.6.5", "easyengine/mariadb": "v4.6.6", - "easyengine/nginx-proxy": "v4.6.5", - "easyengine/nginx": "v4.6.7", + "easyengine/nginx-proxy": "v4.7.0", + "easyengine/nginx": "v4.7.0", "easyengine/php": "v4.6.6", "easyengine/php5.6": "v4.6.6", "easyengine/php7.0": "v4.6.6", "easyengine/php7.2": "v4.6.6", "easyengine/php7.3": "v4.6.6", - "easyengine/php7.4": "v4.6.7", - "easyengine/php8.0": "v4.6.7", - "easyengine/php8.1": "v4.6.7", + "easyengine/php7.4": "v4.7.0", + "easyengine/php8.0": "v4.7.0", + "easyengine/php8.1": "v4.7.0", "easyengine/php8.2": "v4.7.0", "easyengine/php8.3": "v4.7.0", - "easyengine/postfix": "v4.6.5", - "easyengine/redis": "v4.6.5", - "easyengine/newrelic-daemon": "v4.6.7" + "easyengine/postfix": "v4.7.0", + "easyengine/redis": "v4.7.0", + "easyengine/newrelic-daemon": "v4.7.0" } From d87a7be6b6d08e85ee3a39a0e11da61d952d92e0 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Fri, 26 Apr 2024 21:34:55 +0530 Subject: [PATCH 0941/1044] Nginx proxy revert to 4.6.6 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- img-versions.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/img-versions.json b/img-versions.json index c5f241e99..6276b01f9 100644 --- a/img-versions.json +++ b/img-versions.json @@ -2,7 +2,7 @@ "easyengine/cron": "v4.7.0", "easyengine/mailhog": "v4.6.5", "easyengine/mariadb": "v4.6.6", - "easyengine/nginx-proxy": "v4.7.0", + "easyengine/nginx-proxy": "v4.6.6", "easyengine/nginx": "v4.7.0", "easyengine/php": "v4.6.6", "easyengine/php5.6": "v4.6.6", From 1dd287464824428a9d868eea8ceadc99948e9987 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Wed, 1 May 2024 12:48:23 +0530 Subject: [PATCH 0942/1044] Remove support containers from global migration Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- php/EE/Migration/Containers.php | 22 -------------------- php/EE/Migration/GlobalContainers.php | 30 --------------------------- 2 files changed, 52 deletions(-) diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index f7b4ba458..5ca611da5 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -200,17 +200,6 @@ private static function migrate_global_containers( $updated_images ) { [ $global_compose_file_backup_path, $global_compose_file_path, $updated_global_images ] ); - /** - * Create support containers. - */ - self::$rsp->add_step( - 'create-support-global-containers', - 'EE\Migration\GlobalContainers::enable_support_containers', - 'EE\Migration\GlobalContainers::disable_support_containers', - null, - null - ); - self::$rsp->add_step( 'stop-global-containers', 'EE\Migration\GlobalContainers::down_global_containers', @@ -240,17 +229,6 @@ private static function migrate_global_containers( $updated_images ) { [ $global_service_name ] ); } - - /** - * Remove support containers. - */ - self::$rsp->add_step( - 'remove-support-global-containers', - 'EE\Migration\GlobalContainers::disable_support_containers', - 'EE\Migration\GlobalContainers::enable_support_containers', - null, - null - ); } /** diff --git a/php/EE/Migration/GlobalContainers.php b/php/EE/Migration/GlobalContainers.php index 7c73e550f..ca762bf54 100644 --- a/php/EE/Migration/GlobalContainers.php +++ b/php/EE/Migration/GlobalContainers.php @@ -137,34 +137,4 @@ public static function get_all_global_images_with_service_name() { 'easyengine/newrelic-daemon' => GLOBAL_NEWRELIC_DAEMON_CONTAINER, ]; } - - /** - * Create support containers for global-db and global-redis service. - */ - public static function enable_support_containers() { - if ( ! chdir( EE_SERVICE_DIR ) ) { - throw new \Exception( sprintf( '%s path does not exist', EE_SERVICE_DIR ) ); - } - - $command = \EE_DOCKER::docker_compose_with_custom() . ' --project-name=ee up -d global-db global-redis'; - if ( ! EE::exec( $command ) ) { - throw new \Exception( 'Unable to create support container.' ); - } - } - - /** - * Remove support containers for global-db and global-redis service. - */ - public static function disable_support_containers() { - if ( ! chdir( EE_SERVICE_DIR ) ) { - throw new \Exception( sprintf( '%s path does not exist', EE_SERVICE_DIR ) ); - } - - $command = \EE_DOCKER::docker_compose_with_custom() . ' --project-name=ee down'; - /** - * Return code can be 1 due to error in removing network. This is expected. - * TODO: Get a fix for global network / make them external so that the return code is not 1. - */ - EE::exec( $command ); - } } From 9f75712c4f1fc7c1823bd583ef24cb5cb58e81cf Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 6 May 2024 22:49:42 +0530 Subject: [PATCH 0943/1044] Add migration to update docker if older Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- ...easyengine_check_and_update_docker_one.php | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 migrations/db/20240502102550_easyengine_check_and_update_docker_one.php diff --git a/migrations/db/20240502102550_easyengine_check_and_update_docker_one.php b/migrations/db/20240502102550_easyengine_check_and_update_docker_one.php new file mode 100644 index 000000000..e1f2efb89 --- /dev/null +++ b/migrations/db/20240502102550_easyengine_check_and_update_docker_one.php @@ -0,0 +1,51 @@ +<?php + +namespace EE\Migration; + +use EE; +use EE\Migration\Base; + +class CheckAndUpdateDockerOne extends Base { + + /** + * Execute create table query for site and sitemeta table. + * + * @throws EE\ExitException + */ + public function up() { + + EE::log( 'Checking Docker version.' ); + $docker_version = EE::launch( 'docker version --format "{{.Server.Version}}"' )->stdout; + + if ( version_compare( $docker_version, '20.10.10', '<' ) ) { + EE::warning( 'Docker version should be 20.10.10 or above.' ); + + // If it is MacOS, prompt user to update docker. + if ( 'Darwin' === PHP_OS ) { + EE::confirm( 'Do you want to update Docker?' ); + EE::launch( 'open "docker://"' ); + } + + // If it is Linux, proceed with update. + if ( 'Linux' === PHP_OS ) { + EE::log( 'Updating Docker...' ); + EE::launch( 'curl -fsSL https://get.docker.com | sh' ); + } + } + + // Check the version again post update. + $docker_version = EE::launch( 'docker version --format "{{.Server.Version}}"' )->stdout; + if ( version_compare( $docker_version, '20.10.10', '<' ) ) { + EE::error( 'Docker version should be 20.10.10 or above. Please update Docker and try again.' ); + } + } + + /** + * Execute drop table query for site and sitemeta table. + * + * @throws EE\ExitException + */ + public function down() { + + } +} From 8f708b743c7c88b73924a026f13d955f4d7a2d18 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 6 May 2024 22:50:24 +0530 Subject: [PATCH 0944/1044] Update docker-compose version at end of migration Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- php/EE/Migration/Containers.php | 51 +++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index 5ca611da5..b086d89da 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -4,6 +4,7 @@ use EE\RevertableStepProcessor; use EE; +use Symfony\Component\Filesystem\Filesystem; /** * Upgrade existing containers to new docker-image @@ -35,6 +36,8 @@ public static function start_container_migration() { 'easyengine/php7.4', 'easyengine/php8.0', 'easyengine/php8.1', + 'easyengine/php8.2', + 'easyengine/php8.3', 'easyengine/newrelic-daemon', ]; @@ -60,6 +63,7 @@ public static function start_container_migration() { self::migrate_global_containers( $updated_images ); self::migrate_site_containers( $updated_images ); + self::maybe_update_docker_compose(); self::save_upgraded_image_versions( $current_versions, $img_versions, $updated_images ); if ( ! self::$rsp->execute() ) { @@ -69,6 +73,21 @@ public static function start_container_migration() { EE\Utils\delem_log( 'Container migration completed' ); } + /** + * Maybe update docker-compose at the end of migration. + * Need to update to latest docker-compose version for new template changes. + */ + public static function maybe_update_docker_compose() { + + self::$rsp->add_step( + 'update-compose', + 'EE\Migration\Containers::update_docker_compose', + 'EE\Migration\Containers::revert_docker_compose', + null, + null + ); + } + /** * Save updated image version in database. * @@ -103,6 +122,38 @@ public static function image_cleanup() { EE::exec( 'docker image prune -af --filter=label=org.label-schema.vendor="EasyEngine"' ); } + /** + * Update docker-compose to v2.26.1 if lower version is installed. + */ + public static function update_docker_compose() { + + $docker_compose_version = EE::launch( 'docker-compose version --short' )->stdout; + $docker_compose_path = EE::launch( 'command -v docker-compose' )->stdout; + $docker_compose_path = trim( $docker_compose_path ); + $docker_compose_backup_path = EE_BACKUP_DIR . '/docker-compose.backup'; + $fs = new Filesystem(); + if ( ! $fs->exists( EE_BACKUP_DIR ) ) { + $fs->mkdir( EE_BACKUP_DIR ); + } + $fs->copy( $docker_compose_path, $docker_compose_backup_path ); + + if ( version_compare( '2.26.1', $docker_compose_version, '>' ) ) { + EE::exec( "curl -L https://github.com/docker/compose/releases/download/v2.26.1/docker-compose-$(uname -s)-$(uname -m) -o $docker_compose_path && chmod +x $docker_compose_path" ); + } + } + + /** + * Revert docker-compose to previous version. + */ + public static function revert_docker_compose() { + + $docker_compose_path = EE::launch( 'command -v docker-compose' )->stdout; + $docker_compose_path = trim( $docker_compose_path ); + $docker_compose_backup_path = EE_BACKUP_DIR . '/docker-compose.backup'; + $fs = new Filesystem(); + $fs->copy( $docker_compose_backup_path, $docker_compose_path ); + } + /** * Update database entry of images * From 2e7b4cb637bf33be74387856915d7402c3e6ce1c Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 6 May 2024 22:50:52 +0530 Subject: [PATCH 0945/1044] Update requirements check for compose version warning Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- php/EE/Runner.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index b078a6333..634dc999e 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -105,6 +105,14 @@ public function check_requirements( $show_error = true ) { $error[] = 'EasyEngine requires docker-compose.'; } + $docker_compose_version = EE::launch( 'docker-compose version --short' )->stdout; + if ( version_compare( $docker_compose_version, '2.26.0', '<' ) ) { + if ( $show_error ) { + EE::warning( 'EasyEngine requires docker-compose version 2.26.0 or greater.' ); + EE::warning( 'You can get the updated version of docker-compose from assets in https://github.com/docker/compose/releases/tag/v2.26.1' ); + } + } + if ( version_compare( PHP_VERSION, '7.2.0' ) < 0 ) { $status = false; $error[] = 'EasyEngine requires minimum PHP 7.2.0 to run.'; From c945ee716dfa21334f70c9fd51f950a4b9d69518 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 6 May 2024 23:12:24 +0530 Subject: [PATCH 0946/1044] Update docker-compose version in test Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- .github/workflows/test_and_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index ea53fb815..afbb1b420 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -127,7 +127,7 @@ jobs: - name: Install docker-compose run: | - sudo curl -L https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose + sudo curl -L https://github.com/docker/compose/releases/download/v2.26.1/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose - name: Install dependencies From 2350e62a0d876f7567f3ed35807304dcb1d941b0 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 6 May 2024 23:13:24 +0530 Subject: [PATCH 0947/1044] Update PHP test versions matrix Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- .github/workflows/test_and_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index afbb1b420..6abdec8a9 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -92,7 +92,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.2', '7.3', '7.4', '8.0', '8.1'] + php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3'] steps: - name: Check out source code uses: actions/checkout@v3 From 8f9eda041f4bacbc5ebeef20ad446cc7617958f2 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 13 May 2024 16:03:55 +0530 Subject: [PATCH 0948/1044] Add migration for docker update Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- ...easyengine_check_and_update_docker_one.php | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/migrations/db/20240502102550_easyengine_check_and_update_docker_one.php b/migrations/db/20240502102550_easyengine_check_and_update_docker_one.php index e1f2efb89..f2bd415c0 100644 --- a/migrations/db/20240502102550_easyengine_check_and_update_docker_one.php +++ b/migrations/db/20240502102550_easyengine_check_and_update_docker_one.php @@ -4,6 +4,7 @@ use EE; use EE\Migration\Base; +use Symfony\Component\Filesystem\Filesystem; class CheckAndUpdateDockerOne extends Base { @@ -15,7 +16,7 @@ class CheckAndUpdateDockerOne extends Base { public function up() { EE::log( 'Checking Docker version.' ); - $docker_version = EE::launch( 'docker version --format "{{.Server.Version}}"' )->stdout; + $docker_version = trim( EE::launch( 'docker version --format "{{.Server.Version}}"' )->stdout ); if ( version_compare( $docker_version, '20.10.10', '<' ) ) { EE::warning( 'Docker version should be 20.10.10 or above.' ); @@ -33,11 +34,31 @@ public function up() { } } + EE::log( 'Checking docker-compose version' ); + $docker_compose_version = trim( EE::launch( 'docker-compose version --short' )->stdout ); + $docker_compose_path = EE::launch( 'command -v docker-compose' )->stdout; + $docker_compose_path = trim( $docker_compose_path ); + $docker_compose_backup_path = EE_BACKUP_DIR . '/docker-compose.backup'; + $fs = new Filesystem(); + if ( ! $fs->exists( EE_BACKUP_DIR ) ) { + $fs->mkdir( EE_BACKUP_DIR ); + } + $fs->copy( $docker_compose_path, $docker_compose_backup_path ); + + if ( version_compare( '1.29.2', $docker_compose_version, '>' ) ) { + EE::exec( "curl -L https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m) -o $docker_compose_path && chmod +x $docker_compose_path" ); + } + // Check the version again post update. - $docker_version = EE::launch( 'docker version --format "{{.Server.Version}}"' )->stdout; + $docker_version = trim( EE::launch( 'docker version --format "{{.Server.Version}}"' )->stdout ); if ( version_compare( $docker_version, '20.10.10', '<' ) ) { EE::error( 'Docker version should be 20.10.10 or above. Please update Docker and try again.' ); } + + $docker_compose_version = trim( EE::launch( 'docker-compose version --short' )->stdout ); + if ( version_compare( '1.29.2', $docker_compose_version, '!=' ) ) { + EE::error( 'Docker-compose version should be 1.29.2. Please update Docker-compose and try again.' ); + } } /** From b7b94072d0ff24b65dcca0adb030958741485bbf Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 13 May 2024 16:04:22 +0530 Subject: [PATCH 0949/1044] Update docker-compose version check Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- php/EE/Migration/Containers.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index b086d89da..a65a3851e 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -123,7 +123,7 @@ public static function image_cleanup() { } /** - * Update docker-compose to v2.26.1 if lower version is installed. + * Update docker-compose to v2.27.0 if lower version is installed. */ public static function update_docker_compose() { @@ -137,8 +137,8 @@ public static function update_docker_compose() { } $fs->copy( $docker_compose_path, $docker_compose_backup_path ); - if ( version_compare( '2.26.1', $docker_compose_version, '>' ) ) { - EE::exec( "curl -L https://github.com/docker/compose/releases/download/v2.26.1/docker-compose-$(uname -s)-$(uname -m) -o $docker_compose_path && chmod +x $docker_compose_path" ); + if ( version_compare( '2.27.0', $docker_compose_version, '>' ) ) { + EE::exec( "curl -L https://github.com/docker/compose/releases/download/v2.27.0/docker-compose-$(uname -s)-$(uname -m) -o $docker_compose_path && chmod +x $docker_compose_path" ); } } From 36f61eb0c41a59059e25ea0be915b60ae6da9f55 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 13 May 2024 16:04:46 +0530 Subject: [PATCH 0950/1044] Update docker-compose version check Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- php/EE/Runner.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 634dc999e..33645e5a3 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -105,10 +105,10 @@ public function check_requirements( $show_error = true ) { $error[] = 'EasyEngine requires docker-compose.'; } - $docker_compose_version = EE::launch( 'docker-compose version --short' )->stdout; - if ( version_compare( $docker_compose_version, '2.26.0', '<' ) ) { + $docker_compose_version = trim( EE::launch( 'docker-compose version --short' )->stdout ); + if ( version_compare( $docker_compose_version, '2.26.1', '<' ) ) { if ( $show_error ) { - EE::warning( 'EasyEngine requires docker-compose version 2.26.0 or greater.' ); + EE::warning( 'EasyEngine requires docker-compose version 2.26.1 or greater.' ); EE::warning( 'You can get the updated version of docker-compose from assets in https://github.com/docker/compose/releases/tag/v2.26.1' ); } } From d06ada161405584fdcf8273d4baabdac2f29b63f Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 13 May 2024 16:09:41 +0530 Subject: [PATCH 0951/1044] Update nginx-proxy image Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- img-versions.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/img-versions.json b/img-versions.json index 6276b01f9..c5f241e99 100644 --- a/img-versions.json +++ b/img-versions.json @@ -2,7 +2,7 @@ "easyengine/cron": "v4.7.0", "easyengine/mailhog": "v4.6.5", "easyengine/mariadb": "v4.6.6", - "easyengine/nginx-proxy": "v4.6.6", + "easyengine/nginx-proxy": "v4.7.0", "easyengine/nginx": "v4.7.0", "easyengine/php": "v4.6.6", "easyengine/php5.6": "v4.6.6", From 2a51dd79298ce6a83b7f483d10404aedd2d5551b Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 13 May 2024 16:29:41 +0530 Subject: [PATCH 0952/1044] Skip migration if first execution Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- ...02550_easyengine_check_and_update_docker_one.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/migrations/db/20240502102550_easyengine_check_and_update_docker_one.php b/migrations/db/20240502102550_easyengine_check_and_update_docker_one.php index f2bd415c0..3d05ec9d2 100644 --- a/migrations/db/20240502102550_easyengine_check_and_update_docker_one.php +++ b/migrations/db/20240502102550_easyengine_check_and_update_docker_one.php @@ -8,6 +8,13 @@ class CheckAndUpdateDockerOne extends Base { + public function __construct() { + + if ( $this->is_first_execution ) { + $this->skip_this_migration = true; + } + } + /** * Execute create table query for site and sitemeta table. * @@ -15,6 +22,12 @@ class CheckAndUpdateDockerOne extends Base { */ public function up() { + if ( $this->skip_this_migration ) { + EE::debug( 'Skipping migration as it is not needed.' ); + + return; + } + EE::log( 'Checking Docker version.' ); $docker_version = trim( EE::launch( 'docker version --format "{{.Server.Version}}"' )->stdout ); From 7facc38cb2dcb02becbfb65bccf484e6285ea581 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 13 May 2024 17:07:03 +0530 Subject: [PATCH 0953/1044] Fix docker-compose version pre migration check Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- .../20240502102550_easyengine_check_and_update_docker_one.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migrations/db/20240502102550_easyengine_check_and_update_docker_one.php b/migrations/db/20240502102550_easyengine_check_and_update_docker_one.php index 3d05ec9d2..adc66386c 100644 --- a/migrations/db/20240502102550_easyengine_check_and_update_docker_one.php +++ b/migrations/db/20240502102550_easyengine_check_and_update_docker_one.php @@ -58,7 +58,7 @@ public function up() { } $fs->copy( $docker_compose_path, $docker_compose_backup_path ); - if ( version_compare( '1.29.2', $docker_compose_version, '>' ) ) { + if ( version_compare( '1.29.2', $docker_compose_version, '!=' ) ) { EE::exec( "curl -L https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m) -o $docker_compose_path && chmod +x $docker_compose_path" ); } From 0828a10d02fc78187d9ab0e1e04fbcd18b5858a4 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 13 May 2024 18:18:59 +0530 Subject: [PATCH 0954/1044] Maybe update docker-compose even when no image mirations needed Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- php/EE/Migration/Containers.php | 1 + 1 file changed, 1 insertion(+) diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index a65a3851e..92273a94b 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -58,6 +58,7 @@ public static function start_container_migration() { } if ( empty( $updated_images ) ) { + self::maybe_update_docker_compose(); return; } From 02b3fcf0f924cfb76468dda4e7e51c71240ee0e1 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 13 May 2024 18:19:27 +0530 Subject: [PATCH 0955/1044] Update docker-compose to v2.27 in GH workflow Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- .github/workflows/test_and_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index 6abdec8a9..c386fb6d6 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -127,7 +127,7 @@ jobs: - name: Install docker-compose run: | - sudo curl -L https://github.com/docker/compose/releases/download/v2.26.1/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose + sudo curl -L https://github.com/docker/compose/releases/download/v2.27.0/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose - name: Install dependencies From 74a4d789d91866b9bd17cdd09521e14c1b9c6279 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 14 May 2024 11:19:03 +0530 Subject: [PATCH 0956/1044] Add compose update in runner migration fn Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- php/EE/Migration/Containers.php | 2 +- php/EE/Runner.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index 92273a94b..edfa98f4e 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -58,7 +58,7 @@ public static function start_container_migration() { } if ( empty( $updated_images ) ) { - self::maybe_update_docker_compose(); + return; } diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 33645e5a3..ff7dca9db 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -138,6 +138,7 @@ private function migrate() { $rsp->add_step( 'ee-db-migrations', 'EE\Migration\Executor::execute_migrations' ); $rsp->add_step( 'ee-custom-container-migrations', 'EE\Migration\CustomContainerMigrations::execute_migrations' ); $rsp->add_step( 'ee-docker-image-migrations', 'EE\Migration\Containers::start_container_migration' ); + $rsp->add_step( 'ee-update-docker-compose', 'EE\Migration\Containers::update_docker_compose' ); return $rsp->execute(); } From 2850be37de33df5e172c3def95896262c4e29dcb Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 14 May 2024 11:29:15 +0530 Subject: [PATCH 0957/1044] Optimize update_docker_compose fn Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- php/EE/Migration/Containers.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index edfa98f4e..4597c5413 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -132,13 +132,15 @@ public static function update_docker_compose() { $docker_compose_path = EE::launch( 'command -v docker-compose' )->stdout; $docker_compose_path = trim( $docker_compose_path ); $docker_compose_backup_path = EE_BACKUP_DIR . '/docker-compose.backup'; - $fs = new Filesystem(); - if ( ! $fs->exists( EE_BACKUP_DIR ) ) { - $fs->mkdir( EE_BACKUP_DIR ); - } - $fs->copy( $docker_compose_path, $docker_compose_backup_path ); if ( version_compare( '2.27.0', $docker_compose_version, '>' ) ) { + + $fs = new Filesystem(); + if ( ! $fs->exists( EE_BACKUP_DIR ) ) { + $fs->mkdir( EE_BACKUP_DIR ); + } + $fs->copy( $docker_compose_path, $docker_compose_backup_path ); + EE::exec( "curl -L https://github.com/docker/compose/releases/download/v2.27.0/docker-compose-$(uname -s)-$(uname -m) -o $docker_compose_path && chmod +x $docker_compose_path" ); } } From cbb934481cfa4b637e3ce532cb1353d72f715257 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 14 May 2024 15:11:55 +0530 Subject: [PATCH 0958/1044] Swtich to debug statements Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- ...230312102550_easyengine_check_and_update_docker.php | 4 ++-- ...02102550_easyengine_check_and_update_docker_one.php | 10 ++++++---- php/EE/Migration/Containers.php | 4 +++- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/migrations/db/20230312102550_easyengine_check_and_update_docker.php b/migrations/db/20230312102550_easyengine_check_and_update_docker.php index 0f2da39b3..0aff4ae36 100644 --- a/migrations/db/20230312102550_easyengine_check_and_update_docker.php +++ b/migrations/db/20230312102550_easyengine_check_and_update_docker.php @@ -14,7 +14,7 @@ class CheckAndUpdateDocker extends Base { */ public function up() { - EE::log( 'Checking Docker version.' ); + EE::debug( 'Checking Docker version.' ); $docker_version = EE::launch( 'docker version --format "{{.Server.Version}}"' )->stdout; if ( version_compare( $docker_version, '20.10.10', '<' ) ) { @@ -28,7 +28,7 @@ public function up() { // If it is Linux, proceed with update. if ( 'Linux' === PHP_OS ) { - EE::log( 'Updating Docker...' ); + EE::debug( 'Updating Docker...' ); EE::launch( 'curl -fsSL https://get.docker.com | sh' ); } } diff --git a/migrations/db/20240502102550_easyengine_check_and_update_docker_one.php b/migrations/db/20240502102550_easyengine_check_and_update_docker_one.php index adc66386c..9a25e20e4 100644 --- a/migrations/db/20240502102550_easyengine_check_and_update_docker_one.php +++ b/migrations/db/20240502102550_easyengine_check_and_update_docker_one.php @@ -28,7 +28,7 @@ public function up() { return; } - EE::log( 'Checking Docker version.' ); + EE::debug( 'Checking Docker version.' ); $docker_version = trim( EE::launch( 'docker version --format "{{.Server.Version}}"' )->stdout ); if ( version_compare( $docker_version, '20.10.10', '<' ) ) { @@ -42,16 +42,17 @@ public function up() { // If it is Linux, proceed with update. if ( 'Linux' === PHP_OS ) { - EE::log( 'Updating Docker...' ); + EE::debug( 'Updating Docker...' ); EE::launch( 'curl -fsSL https://get.docker.com | sh' ); } } - EE::log( 'Checking docker-compose version' ); + EE::debug( 'Checking docker-compose version' ); $docker_compose_version = trim( EE::launch( 'docker-compose version --short' )->stdout ); $docker_compose_path = EE::launch( 'command -v docker-compose' )->stdout; $docker_compose_path = trim( $docker_compose_path ); $docker_compose_backup_path = EE_BACKUP_DIR . '/docker-compose.backup'; + $docker_compose_new_path = EE_BACKUP_DIR . '/docker-compose'; $fs = new Filesystem(); if ( ! $fs->exists( EE_BACKUP_DIR ) ) { $fs->mkdir( EE_BACKUP_DIR ); @@ -59,7 +60,8 @@ public function up() { $fs->copy( $docker_compose_path, $docker_compose_backup_path ); if ( version_compare( '1.29.2', $docker_compose_version, '!=' ) ) { - EE::exec( "curl -L https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m) -o $docker_compose_path && chmod +x $docker_compose_path" ); + EE::exec( "curl -L https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m) -o $docker_compose_new_path && chmod +x $docker_compose_new_path" ); + EE::exec( "mv $docker_compose_new_path $docker_compose_path" ); } // Check the version again post update. diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index 4597c5413..da688c570 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -132,6 +132,7 @@ public static function update_docker_compose() { $docker_compose_path = EE::launch( 'command -v docker-compose' )->stdout; $docker_compose_path = trim( $docker_compose_path ); $docker_compose_backup_path = EE_BACKUP_DIR . '/docker-compose.backup'; + $docker_compose_new_path = EE_BACKUP_DIR . '/docker-compose'; if ( version_compare( '2.27.0', $docker_compose_version, '>' ) ) { @@ -141,7 +142,8 @@ public static function update_docker_compose() { } $fs->copy( $docker_compose_path, $docker_compose_backup_path ); - EE::exec( "curl -L https://github.com/docker/compose/releases/download/v2.27.0/docker-compose-$(uname -s)-$(uname -m) -o $docker_compose_path && chmod +x $docker_compose_path" ); + EE::exec( "curl -L https://github.com/docker/compose/releases/download/v2.27.0/docker-compose-$(uname -s)-$(uname -m) -o $docker_compose_new_path && chmod +x $docker_compose_new_path" ); + EE::exec( "mv $docker_compose_new_path $docker_compose_path" ); } } From c8e082ada63dc62f543a677711660f706d14b24a Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 14 May 2024 16:00:13 +0530 Subject: [PATCH 0959/1044] Update composer packages Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 10 +- composer.lock | 492 ++++++++++++++++++++++++++------------------------ 2 files changed, 258 insertions(+), 244 deletions(-) diff --git a/composer.json b/composer.json index 91649d0d6..1b6533e2b 100644 --- a/composer.json +++ b/composer.json @@ -31,14 +31,14 @@ "easyengine/admin-tools-command": "v1.1.0", "easyengine/auth-command": "v1.2.0", "easyengine/config-command": "v1.0.2", - "easyengine/cron-command": "v2.0.1", + "easyengine/cron-command": "v2.0.2", "easyengine/log-command": "v1.1.0", "easyengine/mailhog-command": "v1.0.3", - "easyengine/service-command": "v1.5.1", + "easyengine/service-command": "v1.6.0", "easyengine/shell-command": "v1.1.1", - "easyengine/site-command": "v3.2.4", - "easyengine/site-type-php": "v1.7.0", - "easyengine/site-type-wp": "v1.7.1", + "easyengine/site-command": "v3.3.0", + "easyengine/site-type-php": "v1.8.0", + "easyengine/site-type-wp": "v1.8.0", "monolog/monolog": "1.24.0", "mustache/mustache": "2.14.1", "rmccue/requests": "1.8.0", diff --git a/composer.lock b/composer.lock index 7d451c65e..83a745d06 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": "88dbfbd4138e9c6b612c8169f026713e", + "content-hash": "a8c403e18981ae6d922754c99a0d20e6", "packages": [ { "name": "acmephp/core", @@ -199,28 +199,28 @@ }, { "name": "composer/ca-bundle", - "version": "1.3.7", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "76e46335014860eec1aa5a724799a00a2e47cc85" + "reference": "0c5ccfcfea312b5c5a190a21ac5cef93f74baf99" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/76e46335014860eec1aa5a724799a00a2e47cc85", - "reference": "76e46335014860eec1aa5a724799a00a2e47cc85", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/0c5ccfcfea312b5c5a190a21ac5cef93f74baf99", + "reference": "0c5ccfcfea312b5c5a190a21ac5cef93f74baf99", "shasum": "" }, "require": { "ext-openssl": "*", "ext-pcre": "*", - "php": "^5.3.2 || ^7.0 || ^8.0" + "php": "^7.2 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^0.12.55", + "phpstan/phpstan": "^1.10", "psr/log": "^1.0", "symfony/phpunit-bridge": "^4.2 || ^5", - "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0 || ^6.0" + "symfony/process": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, "type": "library", "extra": { @@ -255,7 +255,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.3.7" + "source": "https://github.com/composer/ca-bundle/tree/1.5.0" }, "funding": [ { @@ -271,7 +271,7 @@ "type": "tidelift" } ], - "time": "2023-08-30T09:31:38+00:00" + "time": "2024-03-15T14:00:32+00:00" }, { "name": "composer/composer", @@ -595,16 +595,16 @@ }, { "name": "composer/spdx-licenses", - "version": "1.5.7", + "version": "1.5.8", "source": { "type": "git", "url": "https://github.com/composer/spdx-licenses.git", - "reference": "c848241796da2abf65837d51dce1fae55a960149" + "reference": "560bdcf8deb88ae5d611c80a2de8ea9d0358cc0a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/c848241796da2abf65837d51dce1fae55a960149", - "reference": "c848241796da2abf65837d51dce1fae55a960149", + "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/560bdcf8deb88ae5d611c80a2de8ea9d0358cc0a", + "reference": "560bdcf8deb88ae5d611c80a2de8ea9d0358cc0a", "shasum": "" }, "require": { @@ -653,9 +653,9 @@ "validator" ], "support": { - "irc": "irc://irc.freenode.org/composer", + "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/spdx-licenses/issues", - "source": "https://github.com/composer/spdx-licenses/tree/1.5.7" + "source": "https://github.com/composer/spdx-licenses/tree/1.5.8" }, "funding": [ { @@ -671,20 +671,20 @@ "type": "tidelift" } ], - "time": "2022-05-23T07:37:50+00:00" + "time": "2023-11-20T07:44:33+00:00" }, { "name": "composer/xdebug-handler", - "version": "3.0.3", + "version": "3.0.5", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "ced299686f41dce890debac69273b47ffe98a40c" + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ced299686f41dce890debac69273b47ffe98a40c", - "reference": "ced299686f41dce890debac69273b47ffe98a40c", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6c1925561632e83d60a44492e0b344cf48ab85ef", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef", "shasum": "" }, "require": { @@ -695,7 +695,7 @@ "require-dev": { "phpstan/phpstan": "^1.0", "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^6.0" + "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5" }, "type": "library", "autoload": { @@ -719,9 +719,9 @@ "performance" ], "support": { - "irc": "irc://irc.freenode.org/composer", + "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.3" + "source": "https://github.com/composer/xdebug-handler/tree/3.0.5" }, "funding": [ { @@ -737,25 +737,25 @@ "type": "tidelift" } ], - "time": "2022-02-25T21:32:43+00:00" + "time": "2024-05-06T16:37:16+00:00" }, { "name": "daverandom/libdns", - "version": "v2.0.3", + "version": "v2.1.0", "source": { "type": "git", "url": "https://github.com/DaveRandom/LibDNS.git", - "reference": "42c2d700d1178c9f9e78664793463f7f1aea248c" + "reference": "b84c94e8fe6b7ee4aecfe121bfe3b6177d303c8a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/DaveRandom/LibDNS/zipball/42c2d700d1178c9f9e78664793463f7f1aea248c", - "reference": "42c2d700d1178c9f9e78664793463f7f1aea248c", + "url": "https://api.github.com/repos/DaveRandom/LibDNS/zipball/b84c94e8fe6b7ee4aecfe121bfe3b6177d303c8a", + "reference": "b84c94e8fe6b7ee4aecfe121bfe3b6177d303c8a", "shasum": "" }, "require": { "ext-ctype": "*", - "php": ">=7.0" + "php": ">=7.1" }, "suggest": { "ext-intl": "Required for IDN support" @@ -779,9 +779,9 @@ ], "support": { "issues": "https://github.com/DaveRandom/LibDNS/issues", - "source": "https://github.com/DaveRandom/LibDNS/tree/v2.0.3" + "source": "https://github.com/DaveRandom/LibDNS/tree/v2.1.0" }, - "time": "2022-09-20T18:15:38+00:00" + "time": "2024-04-12T12:12:48+00:00" }, { "name": "easyengine/admin-tools-command", @@ -927,7 +927,7 @@ }, { "name": "easyengine/cron-command", - "version": "v2.0.1", + "version": "v2.0.2", "source": { "type": "git", "url": "https://github.com/EasyEngine/cron-command.git", @@ -972,7 +972,7 @@ "homepage": "https://github.com/easyengine/cron-command", "support": { "issues": "https://github.com/EasyEngine/cron-command/issues", - "source": "https://github.com/EasyEngine/cron-command/tree/v2.0.1" + "source": "https://github.com/EasyEngine/cron-command/tree/v2.0.2" }, "time": "2023-11-10T10:42:24+00:00" }, @@ -1068,16 +1068,16 @@ }, { "name": "easyengine/service-command", - "version": "v1.5.1", + "version": "v1.6.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/service-command.git", - "reference": "203edce7a099dd100eb8a73481a6a7704a712779" + "reference": "d07a4f940e68238dd78dcc6e26abeee687588b21" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/203edce7a099dd100eb8a73481a6a7704a712779", - "reference": "203edce7a099dd100eb8a73481a6a7704a712779", + "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/d07a4f940e68238dd78dcc6e26abeee687588b21", + "reference": "d07a4f940e68238dd78dcc6e26abeee687588b21", "shasum": "" }, "type": "ee-cli-package", @@ -1111,9 +1111,9 @@ "homepage": "https://github.com/easyengine/service-command", "support": { "issues": "https://github.com/EasyEngine/service-command/issues", - "source": "https://github.com/EasyEngine/service-command/tree/v1.5.1" + "source": "https://github.com/EasyEngine/service-command/tree/v1.6.0" }, - "time": "2023-11-10T10:54:50+00:00" + "time": "2024-05-14T10:20:08+00:00" }, { "name": "easyengine/shell-command", @@ -1161,16 +1161,16 @@ }, { "name": "easyengine/site-command", - "version": "v3.2.4", + "version": "v3.3.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "13be7f01b24eb332935d0dad51ad504c8a5fefd7" + "reference": "d47e48074981fd4ff3c91366d98d03007bba9158" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/13be7f01b24eb332935d0dad51ad504c8a5fefd7", - "reference": "13be7f01b24eb332935d0dad51ad504c8a5fefd7", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/d47e48074981fd4ff3c91366d98d03007bba9158", + "reference": "d47e48074981fd4ff3c91366d98d03007bba9158", "shasum": "" }, "require": { @@ -1231,13 +1231,13 @@ "homepage": "https://github.com/easyengine/site-command", "support": { "issues": "https://github.com/EasyEngine/site-command/issues", - "source": "https://github.com/EasyEngine/site-command/tree/v3.2.4" + "source": "https://github.com/EasyEngine/site-command/tree/v3.3.0" }, - "time": "2023-01-13T11:49:15+00:00" + "time": "2024-05-14T10:17:30+00:00" }, { "name": "easyengine/site-type-php", - "version": "v1.7.0", + "version": "v1.8.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-php.git", @@ -1290,22 +1290,22 @@ "homepage": "https://github.com/easyengine/site-type-php", "support": { "issues": "https://github.com/EasyEngine/site-type-php/issues", - "source": "https://github.com/EasyEngine/site-type-php/tree/v1.7.0" + "source": "https://github.com/EasyEngine/site-type-php/tree/v1.8.0" }, "time": "2022-06-22T10:02:51+00:00" }, { "name": "easyengine/site-type-wp", - "version": "v1.7.1", + "version": "v1.8.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-wp.git", - "reference": "cd3b6a85fd88809fa3664a842a82cee9493880aa" + "reference": "53e5abfe962b619f42a61398e503a5f7e3266c07" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/cd3b6a85fd88809fa3664a842a82cee9493880aa", - "reference": "cd3b6a85fd88809fa3664a842a82cee9493880aa", + "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/53e5abfe962b619f42a61398e503a5f7e3266c07", + "reference": "53e5abfe962b619f42a61398e503a5f7e3266c07", "shasum": "" }, "require-dev": { @@ -1349,22 +1349,22 @@ "homepage": "https://github.com/easyengine/site-type-wp", "support": { "issues": "https://github.com/EasyEngine/site-type-wp/issues", - "source": "https://github.com/EasyEngine/site-type-wp/tree/v1.7.1" + "source": "https://github.com/EasyEngine/site-type-wp/tree/v1.8.0" }, - "time": "2022-12-19T09:23:04+00:00" + "time": "2022-06-22T10:02:41+00:00" }, { "name": "guzzlehttp/guzzle", - "version": "7.8.0", + "version": "7.8.1", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "1110f66a6530a40fe7aea0378fe608ee2b2248f9" + "reference": "41042bc7ab002487b876a0683fc8dce04ddce104" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/1110f66a6530a40fe7aea0378fe608ee2b2248f9", - "reference": "1110f66a6530a40fe7aea0378fe608ee2b2248f9", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/41042bc7ab002487b876a0683fc8dce04ddce104", + "reference": "41042bc7ab002487b876a0683fc8dce04ddce104", "shasum": "" }, "require": { @@ -1379,11 +1379,11 @@ "psr/http-client-implementation": "1.0" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.8.1", + "bamarni/composer-bin-plugin": "^1.8.2", "ext-curl": "*", "php-http/client-integration-tests": "dev-master#2c025848417c1135031fdf9c728ee53d0a7ceaee as 3.0.999", "php-http/message-factory": "^1.1", - "phpunit/phpunit": "^8.5.29 || ^9.5.23", + "phpunit/phpunit": "^8.5.36 || ^9.6.15", "psr/log": "^1.1 || ^2.0 || ^3.0" }, "suggest": { @@ -1461,7 +1461,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.8.0" + "source": "https://github.com/guzzle/guzzle/tree/7.8.1" }, "funding": [ { @@ -1477,28 +1477,28 @@ "type": "tidelift" } ], - "time": "2023-08-27T10:20:53+00:00" + "time": "2023-12-03T20:35:24+00:00" }, { "name": "guzzlehttp/promises", - "version": "2.0.1", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "111166291a0f8130081195ac4556a5587d7f1b5d" + "reference": "bbff78d96034045e58e13dedd6ad91b5d1253223" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/111166291a0f8130081195ac4556a5587d7f1b5d", - "reference": "111166291a0f8130081195ac4556a5587d7f1b5d", + "url": "https://api.github.com/repos/guzzle/promises/zipball/bbff78d96034045e58e13dedd6ad91b5d1253223", + "reference": "bbff78d96034045e58e13dedd6ad91b5d1253223", "shasum": "" }, "require": { "php": "^7.2.5 || ^8.0" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.8.1", - "phpunit/phpunit": "^8.5.29 || ^9.5.23" + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.36 || ^9.6.15" }, "type": "library", "extra": { @@ -1544,7 +1544,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/2.0.1" + "source": "https://github.com/guzzle/promises/tree/2.0.2" }, "funding": [ { @@ -1560,7 +1560,7 @@ "type": "tidelift" } ], - "time": "2023-08-03T15:11:55+00:00" + "time": "2023-12-03T20:19:20+00:00" }, { "name": "guzzlehttp/psr7", @@ -2268,23 +2268,23 @@ }, { "name": "react/promise", - "version": "v2.10.0", + "version": "v2.11.0", "source": { "type": "git", "url": "https://github.com/reactphp/promise.git", - "reference": "f913fb8cceba1e6644b7b90c4bfb678ed8a3ef38" + "reference": "1a8460931ea36dc5c76838fec5734d55c88c6831" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise/zipball/f913fb8cceba1e6644b7b90c4bfb678ed8a3ef38", - "reference": "f913fb8cceba1e6644b7b90c4bfb678ed8a3ef38", + "url": "https://api.github.com/repos/reactphp/promise/zipball/1a8460931ea36dc5c76838fec5734d55c88c6831", + "reference": "1a8460931ea36dc5c76838fec5734d55c88c6831", "shasum": "" }, "require": { "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.36" + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" }, "type": "library", "autoload": { @@ -2328,7 +2328,7 @@ ], "support": { "issues": "https://github.com/reactphp/promise/issues", - "source": "https://github.com/reactphp/promise/tree/v2.10.0" + "source": "https://github.com/reactphp/promise/tree/v2.11.0" }, "funding": [ { @@ -2336,7 +2336,7 @@ "type": "open_collective" } ], - "time": "2023-05-02T15:15:43+00:00" + "time": "2023-11-16T16:16:50+00:00" }, { "name": "rmccue/requests", @@ -2400,16 +2400,16 @@ }, { "name": "seld/jsonlint", - "version": "1.10.0", + "version": "1.10.2", "source": { "type": "git", "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "594fd6462aad8ecee0b45ca5045acea4776667f1" + "reference": "9bb7db07b5d66d90f6ebf542f09fc67d800e5259" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/594fd6462aad8ecee0b45ca5045acea4776667f1", - "reference": "594fd6462aad8ecee0b45ca5045acea4776667f1", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/9bb7db07b5d66d90f6ebf542f09fc67d800e5259", + "reference": "9bb7db07b5d66d90f6ebf542f09fc67d800e5259", "shasum": "" }, "require": { @@ -2436,7 +2436,7 @@ { "name": "Jordi Boggiano", "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" + "homepage": "https://seld.be" } ], "description": "JSON Linter", @@ -2448,7 +2448,7 @@ ], "support": { "issues": "https://github.com/Seldaek/jsonlint/issues", - "source": "https://github.com/Seldaek/jsonlint/tree/1.10.0" + "source": "https://github.com/Seldaek/jsonlint/tree/1.10.2" }, "funding": [ { @@ -2460,7 +2460,7 @@ "type": "tidelift" } ], - "time": "2023-05-11T13:16:46+00:00" + "time": "2024-02-07T12:57:50+00:00" }, { "name": "seld/phar-utils", @@ -2835,16 +2835,16 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v2.5.2", + "version": "v2.5.3", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66" + "reference": "80d075412b557d41002320b96a096ca65aa2c98d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/80d075412b557d41002320b96a096ca65aa2c98d", + "reference": "80d075412b557d41002320b96a096ca65aa2c98d", "shasum": "" }, "require": { @@ -2882,7 +2882,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.2" + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.3" }, "funding": [ { @@ -2898,7 +2898,7 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:53:40+00:00" + "time": "2023-01-24T14:02:46+00:00" }, { "name": "symfony/event-dispatcher", @@ -2986,16 +2986,16 @@ }, { "name": "symfony/event-dispatcher-contracts", - "version": "v1.1.13", + "version": "v1.10.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "1d5cd762abaa6b2a4169d3e77610193a7157129e" + "reference": "761c8b8387cfe5f8026594a75fdf0a4e83ba6974" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/1d5cd762abaa6b2a4169d3e77610193a7157129e", - "reference": "1d5cd762abaa6b2a4169d3e77610193a7157129e", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/761c8b8387cfe5f8026594a75fdf0a4e83ba6974", + "reference": "761c8b8387cfe5f8026594a75fdf0a4e83ba6974", "shasum": "" }, "require": { @@ -3045,7 +3045,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v1.1.13" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v1.10.0" }, "funding": [ { @@ -3061,7 +3061,7 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:41:36+00:00" + "time": "2022-07-20T09:59:04+00:00" }, { "name": "symfony/filesystem", @@ -3190,16 +3190,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb" + "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", - "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ef4d7e442ca910c4764bce785146269b30cb5fc4", + "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4", "shasum": "" }, "require": { @@ -3213,9 +3213,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -3252,7 +3249,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.29.0" }, "funding": [ { @@ -3268,20 +3265,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "42292d99c55abe617799667f454222c54c60e229" + "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229", - "reference": "42292d99c55abe617799667f454222c54c60e229", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec", + "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec", "shasum": "" }, "require": { @@ -3295,9 +3292,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -3335,7 +3329,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0" }, "funding": [ { @@ -3351,20 +3345,20 @@ "type": "tidelift" } ], - "time": "2023-07-28T09:04:16+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5" + "reference": "21bd091060673a1177ae842c0ef8fe30893114d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fe2f306d1d9d346a7fee353d0d5012e401e984b5", - "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/21bd091060673a1177ae842c0ef8fe30893114d2", + "reference": "21bd091060673a1177ae842c0ef8fe30893114d2", "shasum": "" }, "require": { @@ -3372,9 +3366,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -3414,7 +3405,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.29.0" }, "funding": [ { @@ -3430,20 +3421,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5" + "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5", - "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", + "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", "shasum": "" }, "require": { @@ -3451,9 +3442,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -3497,7 +3485,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.29.0" }, "funding": [ { @@ -3513,20 +3501,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-php81", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b" + "reference": "c565ad1e63f30e7477fc40738343c62b40bc672d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/7581cd600fa9fd681b797d00b02f068e2f13263b", - "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/c565ad1e63f30e7477fc40738343c62b40bc672d", + "reference": "c565ad1e63f30e7477fc40738343c62b40bc672d", "shasum": "" }, "require": { @@ -3534,9 +3522,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -3576,7 +3561,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.29.0" }, "funding": [ { @@ -3592,7 +3577,7 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/process", @@ -3740,16 +3725,16 @@ }, { "name": "symfony/service-contracts", - "version": "v2.5.2", + "version": "v2.5.3", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c" + "reference": "a2329596ddc8fd568900e3fc76cba42489ecc7f3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/4b426aac47d6427cc1a1d0f7e2ac724627f5966c", - "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/a2329596ddc8fd568900e3fc76cba42489ecc7f3", + "reference": "a2329596ddc8fd568900e3fc76cba42489ecc7f3", "shasum": "" }, "require": { @@ -3803,7 +3788,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v2.5.2" + "source": "https://github.com/symfony/service-contracts/tree/v2.5.3" }, "funding": [ { @@ -3819,7 +3804,7 @@ "type": "tidelift" } ], - "time": "2022-05-30T19:17:29+00:00" + "time": "2023-04-21T15:04:16+00:00" }, { "name": "symfony/translation", @@ -3912,16 +3897,16 @@ }, { "name": "symfony/translation-contracts", - "version": "v2.5.2", + "version": "v2.5.3", "source": { "type": "git", "url": "https://github.com/symfony/translation-contracts.git", - "reference": "136b19dd05cdf0709db6537d058bcab6dd6e2dbe" + "reference": "b0073a77ac0b7ea55131020e87b1e3af540f4664" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/136b19dd05cdf0709db6537d058bcab6dd6e2dbe", - "reference": "136b19dd05cdf0709db6537d058bcab6dd6e2dbe", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/b0073a77ac0b7ea55131020e87b1e3af540f4664", + "reference": "b0073a77ac0b7ea55131020e87b1e3af540f4664", "shasum": "" }, "require": { @@ -3970,7 +3955,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/translation-contracts/tree/v2.5.2" + "source": "https://github.com/symfony/translation-contracts/tree/v2.5.3" }, "funding": [ { @@ -3986,7 +3971,7 @@ "type": "tidelift" } ], - "time": "2022-06-27T16:58:25+00:00" + "time": "2024-01-23T13:51:25+00:00" }, { "name": "symfony/yaml", @@ -4621,21 +4606,21 @@ }, { "name": "nikic/php-parser", - "version": "v4.17.1", + "version": "v4.19.1", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d" + "reference": "4e1b88d21c69391150ace211e9eaf05810858d0b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", - "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/4e1b88d21c69391150ace211e9eaf05810858d0b", + "reference": "4e1b88d21c69391150ace211e9eaf05810858d0b", "shasum": "" }, "require": { "ext-tokenizer": "*", - "php": ">=7.0" + "php": ">=7.1" }, "require-dev": { "ircmaxell/php-yacc": "^0.0.7", @@ -4671,26 +4656,27 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.17.1" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.19.1" }, - "time": "2023-08-13T19:53:39+00:00" + "time": "2024-03-17T08:10:35+00:00" }, { "name": "phar-io/manifest", - "version": "2.0.3", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + "reference": "54750ef60c58e43759730615a392c31c80e23176" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", "shasum": "" }, "require": { "ext-dom": "*", + "ext-libxml": "*", "ext-phar": "*", "ext-xmlwriter": "*", "phar-io/version": "^3.0.1", @@ -4731,9 +4717,15 @@ "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", "support": { "issues": "https://github.com/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/2.0.3" + "source": "https://github.com/phar-io/manifest/tree/2.0.4" }, - "time": "2021-07-20T11:28:43+00:00" + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:33:53+00:00" }, { "name": "phar-io/version", @@ -4845,23 +4837,23 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.29", + "version": "9.2.31", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "6a3a87ac2bbe33b25042753df8195ba4aa534c76" + "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/6a3a87ac2bbe33b25042753df8195ba4aa534c76", - "reference": "6a3a87ac2bbe33b25042753df8195ba4aa534c76", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/48c34b5d8d983006bd2adc2d0de92963b9155965", + "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.15", + "nikic/php-parser": "^4.18 || ^5.0", "php": ">=7.3", "phpunit/php-file-iterator": "^3.0.3", "phpunit/php-text-template": "^2.0.2", @@ -4911,7 +4903,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.29" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.31" }, "funding": [ { @@ -4919,7 +4911,7 @@ "type": "github" } ], - "time": "2023-09-19T04:57:46+00:00" + "time": "2024-03-02T06:37:42+00:00" }, { "name": "phpunit/php-file-iterator", @@ -5266,16 +5258,16 @@ }, { "name": "sebastian/cli-parser", - "version": "1.0.1", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/2b56bea83a09de3ac06bb18b92f068e60cc6f50b", + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b", "shasum": "" }, "require": { @@ -5310,7 +5302,7 @@ "homepage": "https://github.com/sebastianbergmann/cli-parser", "support": { "issues": "https://github.com/sebastianbergmann/cli-parser/issues", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.2" }, "funding": [ { @@ -5318,7 +5310,7 @@ "type": "github" } ], - "time": "2020-09-28T06:08:49+00:00" + "time": "2024-03-02T06:27:43+00:00" }, { "name": "sebastian/code-unit", @@ -5507,20 +5499,20 @@ }, { "name": "sebastian/complexity", - "version": "2.0.2", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/25f207c40d62b8b7aa32f5ab026c53561964053a", + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a", "shasum": "" }, "require": { - "nikic/php-parser": "^4.7", + "nikic/php-parser": "^4.18 || ^5.0", "php": ">=7.3" }, "require-dev": { @@ -5552,7 +5544,7 @@ "homepage": "https://github.com/sebastianbergmann/complexity", "support": { "issues": "https://github.com/sebastianbergmann/complexity/issues", - "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" + "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.3" }, "funding": [ { @@ -5560,20 +5552,20 @@ "type": "github" } ], - "time": "2020-10-26T15:52:27+00:00" + "time": "2023-12-22T06:19:30+00:00" }, { "name": "sebastian/diff", - "version": "4.0.5", + "version": "4.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131" + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/74be17022044ebaaecfdf0c5cd504fc9cd5a7131", - "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc", + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc", "shasum": "" }, "require": { @@ -5618,7 +5610,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.5" + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6" }, "funding": [ { @@ -5626,7 +5618,7 @@ "type": "github" } ], - "time": "2023-05-07T05:35:17+00:00" + "time": "2024-03-02T06:30:58+00:00" }, { "name": "sebastian/environment", @@ -5693,16 +5685,16 @@ }, { "name": "sebastian/exporter", - "version": "4.0.5", + "version": "4.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d" + "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/78c00df8f170e02473b682df15bfcdacc3d32d72", + "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72", "shasum": "" }, "require": { @@ -5758,7 +5750,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5" + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.6" }, "funding": [ { @@ -5766,20 +5758,20 @@ "type": "github" } ], - "time": "2022-09-14T06:03:37+00:00" + "time": "2024-03-02T06:33:00+00:00" }, { "name": "sebastian/global-state", - "version": "5.0.6", + "version": "5.0.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bde739e7565280bda77be70044ac1047bc007e34" + "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bde739e7565280bda77be70044ac1047bc007e34", - "reference": "bde739e7565280bda77be70044ac1047bc007e34", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", + "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", "shasum": "" }, "require": { @@ -5822,7 +5814,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.6" + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.7" }, "funding": [ { @@ -5830,24 +5822,24 @@ "type": "github" } ], - "time": "2023-08-02T09:26:13+00:00" + "time": "2024-03-02T06:35:11+00:00" }, { "name": "sebastian/lines-of-code", - "version": "1.0.3", + "version": "1.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/e1e4a170560925c26d424b6a03aed157e7dcc5c5", + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5", "shasum": "" }, "require": { - "nikic/php-parser": "^4.6", + "nikic/php-parser": "^4.18 || ^5.0", "php": ">=7.3" }, "require-dev": { @@ -5879,7 +5871,7 @@ "homepage": "https://github.com/sebastianbergmann/lines-of-code", "support": { "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3" + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.4" }, "funding": [ { @@ -5887,7 +5879,7 @@ "type": "github" } ], - "time": "2020-11-28T06:42:11+00:00" + "time": "2023-12-22T06:20:34+00:00" }, { "name": "sebastian/object-enumerator", @@ -6066,16 +6058,16 @@ }, { "name": "sebastian/resource-operations", - "version": "3.0.3", + "version": "3.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" + "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/05d5692a7993ecccd56a03e40cd7e5b09b1d404e", + "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e", "shasum": "" }, "require": { @@ -6087,7 +6079,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -6108,8 +6100,7 @@ "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", "support": { - "issues": "https://github.com/sebastianbergmann/resource-operations/issues", - "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.4" }, "funding": [ { @@ -6117,7 +6108,7 @@ "type": "github" } ], - "time": "2020-09-28T06:45:17+00:00" + "time": "2024-03-14T16:00:52+00:00" }, { "name": "sebastian/type", @@ -6230,16 +6221,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.7.2", + "version": "3.9.2", "source": { "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879" + "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", + "reference": "aac1f6f347a5c5ac6bc98ad395007df00990f480" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879", - "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/aac1f6f347a5c5ac6bc98ad395007df00990f480", + "reference": "aac1f6f347a5c5ac6bc98ad395007df00990f480", "shasum": "" }, "require": { @@ -6249,11 +6240,11 @@ "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" }, "bin": [ - "bin/phpcs", - "bin/phpcbf" + "bin/phpcbf", + "bin/phpcs" ], "type": "library", "extra": { @@ -6268,35 +6259,58 @@ "authors": [ { "name": "Greg Sherwood", - "role": "lead" + "role": "Former lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "Current lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors" } ], "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer", "keywords": [ "phpcs", "standards", "static analysis" ], "support": { - "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", - "source": "https://github.com/squizlabs/PHP_CodeSniffer", - "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues", + "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy", + "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki" }, - "time": "2023-02-22T23:07:41+00:00" + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } + ], + "time": "2024-04-23T20:25:34+00:00" }, { "name": "theseer/tokenizer", - "version": "1.2.1", + "version": "1.2.3", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", "shasum": "" }, "require": { @@ -6325,7 +6339,7 @@ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "support": { "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.1" + "source": "https://github.com/theseer/tokenizer/tree/1.2.3" }, "funding": [ { @@ -6333,7 +6347,7 @@ "type": "github" } ], - "time": "2021-07-28T10:34:58+00:00" + "time": "2024-03-03T12:36:25+00:00" }, { "name": "wp-coding-standards/wpcs", From 1dae77d99f2b71002ca2d46f2a2d67a51b3d73db Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 14 May 2024 16:19:48 +0530 Subject: [PATCH 0960/1044] Update site-type-wp and php version lock Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.lock b/composer.lock index 83a745d06..70cb192a1 100644 --- a/composer.lock +++ b/composer.lock @@ -1241,12 +1241,12 @@ "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-php.git", - "reference": "70c69bbdd2fa742c169f5c294a027e648d10665f" + "reference": "11c1eb443aec0f8292ea62a4fe8e02e6558f0888" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/70c69bbdd2fa742c169f5c294a027e648d10665f", - "reference": "70c69bbdd2fa742c169f5c294a027e648d10665f", + "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/11c1eb443aec0f8292ea62a4fe8e02e6558f0888", + "reference": "11c1eb443aec0f8292ea62a4fe8e02e6558f0888", "shasum": "" }, "require-dev": { @@ -1292,7 +1292,7 @@ "issues": "https://github.com/EasyEngine/site-type-php/issues", "source": "https://github.com/EasyEngine/site-type-php/tree/v1.8.0" }, - "time": "2022-06-22T10:02:51+00:00" + "time": "2024-05-14T10:21:08+00:00" }, { "name": "easyengine/site-type-wp", @@ -1300,12 +1300,12 @@ "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-wp.git", - "reference": "53e5abfe962b619f42a61398e503a5f7e3266c07" + "reference": "a66f460788c760282b26aac91cd254b9a8dbdf45" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/53e5abfe962b619f42a61398e503a5f7e3266c07", - "reference": "53e5abfe962b619f42a61398e503a5f7e3266c07", + "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/a66f460788c760282b26aac91cd254b9a8dbdf45", + "reference": "a66f460788c760282b26aac91cd254b9a8dbdf45", "shasum": "" }, "require-dev": { @@ -1351,7 +1351,7 @@ "issues": "https://github.com/EasyEngine/site-type-wp/issues", "source": "https://github.com/EasyEngine/site-type-wp/tree/v1.8.0" }, - "time": "2022-06-22T10:02:41+00:00" + "time": "2024-05-14T10:21:23+00:00" }, { "name": "guzzlehttp/guzzle", From 873d6c3a22afc2b731bf0b360a5c3dc8814e6746 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 14 May 2024 16:25:30 +0530 Subject: [PATCH 0961/1044] Bump to version v4.7.0 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index ec3f25fb5..f6cdf4098 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.6.6 +4.7.0 From 04e63a509cd3c0168cb5b46f13ebe97ce2a05adf Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 27 May 2024 18:40:13 +0530 Subject: [PATCH 0962/1044] Update composer packages Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 4 ++-- composer.lock | 44 ++++++++++++++++++++++---------------------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/composer.json b/composer.json index 1b6533e2b..d7f8dbf32 100644 --- a/composer.json +++ b/composer.json @@ -31,10 +31,10 @@ "easyengine/admin-tools-command": "v1.1.0", "easyengine/auth-command": "v1.2.0", "easyengine/config-command": "v1.0.2", - "easyengine/cron-command": "v2.0.2", + "easyengine/cron-command": "v2.1.0", "easyengine/log-command": "v1.1.0", "easyengine/mailhog-command": "v1.0.3", - "easyengine/service-command": "v1.6.0", + "easyengine/service-command": "v1.6.1", "easyengine/shell-command": "v1.1.1", "easyengine/site-command": "v3.3.0", "easyengine/site-type-php": "v1.8.0", diff --git a/composer.lock b/composer.lock index 70cb192a1..d9bc3c400 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": "a8c403e18981ae6d922754c99a0d20e6", + "content-hash": "68abab4f9d6a160147aac0cf35349a01", "packages": [ { "name": "acmephp/core", @@ -927,16 +927,16 @@ }, { "name": "easyengine/cron-command", - "version": "v2.0.2", + "version": "v2.1.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/cron-command.git", - "reference": "f8e138b7f348766fc41b79a66b0778f62db32f46" + "reference": "423d990c227a3e070f0fbbdd576a427ba4ad00f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/cron-command/zipball/f8e138b7f348766fc41b79a66b0778f62db32f46", - "reference": "f8e138b7f348766fc41b79a66b0778f62db32f46", + "url": "https://api.github.com/repos/EasyEngine/cron-command/zipball/423d990c227a3e070f0fbbdd576a427ba4ad00f5", + "reference": "423d990c227a3e070f0fbbdd576a427ba4ad00f5", "shasum": "" }, "type": "ee-cli-package", @@ -972,9 +972,9 @@ "homepage": "https://github.com/easyengine/cron-command", "support": { "issues": "https://github.com/EasyEngine/cron-command/issues", - "source": "https://github.com/EasyEngine/cron-command/tree/v2.0.2" + "source": "https://github.com/EasyEngine/cron-command/tree/v2.1.0" }, - "time": "2023-11-10T10:42:24+00:00" + "time": "2024-05-27T13:06:26+00:00" }, { "name": "easyengine/log-command", @@ -1068,16 +1068,16 @@ }, { "name": "easyengine/service-command", - "version": "v1.6.0", + "version": "v1.6.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/service-command.git", - "reference": "d07a4f940e68238dd78dcc6e26abeee687588b21" + "reference": "a730ce0419d6f2b18d1d0206438125e2de9d2ac8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/d07a4f940e68238dd78dcc6e26abeee687588b21", - "reference": "d07a4f940e68238dd78dcc6e26abeee687588b21", + "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/a730ce0419d6f2b18d1d0206438125e2de9d2ac8", + "reference": "a730ce0419d6f2b18d1d0206438125e2de9d2ac8", "shasum": "" }, "type": "ee-cli-package", @@ -1111,9 +1111,9 @@ "homepage": "https://github.com/easyengine/service-command", "support": { "issues": "https://github.com/EasyEngine/service-command/issues", - "source": "https://github.com/EasyEngine/service-command/tree/v1.6.0" + "source": "https://github.com/EasyEngine/service-command/tree/v1.6.1" }, - "time": "2024-05-14T10:20:08+00:00" + "time": "2024-05-27T13:07:27+00:00" }, { "name": "easyengine/shell-command", @@ -1672,12 +1672,12 @@ "version": "v5.2.13", "source": { "type": "git", - "url": "https://github.com/justinrainbow/json-schema.git", + "url": "https://github.com/jsonrainbow/json-schema.git", "reference": "fbbe7e5d79f618997bc3332a6f49246036c45793" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/fbbe7e5d79f618997bc3332a6f49246036c45793", + "url": "https://api.github.com/repos/jsonrainbow/json-schema/zipball/fbbe7e5d79f618997bc3332a6f49246036c45793", "reference": "fbbe7e5d79f618997bc3332a6f49246036c45793", "shasum": "" }, @@ -1732,8 +1732,8 @@ "schema" ], "support": { - "issues": "https://github.com/justinrainbow/json-schema/issues", - "source": "https://github.com/justinrainbow/json-schema/tree/v5.2.13" + "issues": "https://github.com/jsonrainbow/json-schema/issues", + "source": "https://github.com/jsonrainbow/json-schema/tree/v5.2.13" }, "time": "2023-09-26T02:20:38+00:00" }, @@ -6221,16 +6221,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.9.2", + "version": "3.10.1", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "aac1f6f347a5c5ac6bc98ad395007df00990f480" + "reference": "8f90f7a53ce271935282967f53d0894f8f1ff877" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/aac1f6f347a5c5ac6bc98ad395007df00990f480", - "reference": "aac1f6f347a5c5ac6bc98ad395007df00990f480", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/8f90f7a53ce271935282967f53d0894f8f1ff877", + "reference": "8f90f7a53ce271935282967f53d0894f8f1ff877", "shasum": "" }, "require": { @@ -6297,7 +6297,7 @@ "type": "open_collective" } ], - "time": "2024-04-23T20:25:34+00:00" + "time": "2024-05-22T21:24:41+00:00" }, { "name": "theseer/tokenizer", From 572d249b949c401e20ba6e3704b6ccccb528128c Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 27 May 2024 18:40:26 +0530 Subject: [PATCH 0963/1044] Update images for v4.7.1 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- img-versions.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/img-versions.json b/img-versions.json index c5f241e99..fc3da4dc7 100644 --- a/img-versions.json +++ b/img-versions.json @@ -2,7 +2,7 @@ "easyengine/cron": "v4.7.0", "easyengine/mailhog": "v4.6.5", "easyengine/mariadb": "v4.6.6", - "easyengine/nginx-proxy": "v4.7.0", + "easyengine/nginx-proxy": "v4.7.1", "easyengine/nginx": "v4.7.0", "easyengine/php": "v4.6.6", "easyengine/php5.6": "v4.6.6", @@ -10,10 +10,10 @@ "easyengine/php7.2": "v4.6.6", "easyengine/php7.3": "v4.6.6", "easyengine/php7.4": "v4.7.0", - "easyengine/php8.0": "v4.7.0", - "easyengine/php8.1": "v4.7.0", - "easyengine/php8.2": "v4.7.0", - "easyengine/php8.3": "v4.7.0", + "easyengine/php8.0": "v4.7.1", + "easyengine/php8.1": "v4.7.1", + "easyengine/php8.2": "v4.7.1", + "easyengine/php8.3": "v4.7.1", "easyengine/postfix": "v4.7.0", "easyengine/redis": "v4.7.0", "easyengine/newrelic-daemon": "v4.7.0" From 9b4c51559bdd8b8b8e05cd56ab9a14db81641347 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 28 May 2024 21:25:09 +0530 Subject: [PATCH 0964/1044] Add cron config updates in migration Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- php/EE/Runner.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index ff7dca9db..a672f43c4 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -133,12 +133,15 @@ public function check_requirements( $show_error = true ) { * Function to run migrations required to upgrade to the newer version. Will always be invoked from the newer phar downloaded inside the /tmp folder */ private function migrate() { + $rsp = new \EE\RevertableStepProcessor(); $rsp->add_step( 'ee-db-migrations', 'EE\Migration\Executor::execute_migrations' ); $rsp->add_step( 'ee-custom-container-migrations', 'EE\Migration\CustomContainerMigrations::execute_migrations' ); $rsp->add_step( 'ee-docker-image-migrations', 'EE\Migration\Containers::start_container_migration' ); $rsp->add_step( 'ee-update-docker-compose', 'EE\Migration\Containers::update_docker_compose' ); + $rsp->add_step( 'ee-update-cron-config', 'EE\Cron\Utils\update_cron_config' ); + return $rsp->execute(); } From faf96764b5552c9dfbd4e4baab1b7ceffb9c1e2b Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 28 May 2024 21:27:57 +0530 Subject: [PATCH 0965/1044] Update site service migrations Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- php/EE/Migration/Containers.php | 5 ++--- php/EE/Migration/SiteContainers.php | 16 +++++++++++----- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index da688c570..cd64b3929 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -128,9 +128,8 @@ public static function image_cleanup() { */ public static function update_docker_compose() { - $docker_compose_version = EE::launch( 'docker-compose version --short' )->stdout; - $docker_compose_path = EE::launch( 'command -v docker-compose' )->stdout; - $docker_compose_path = trim( $docker_compose_path ); + $docker_compose_version = trim( EE::launch( 'docker-compose version --short' )->stdout ); + $docker_compose_path = trim( EE::launch( 'command -v docker-compose' )->stdout ); $docker_compose_backup_path = EE_BACKUP_DIR . '/docker-compose.backup'; $docker_compose_new_path = EE_BACKUP_DIR . '/docker-compose'; diff --git a/php/EE/Migration/SiteContainers.php b/php/EE/Migration/SiteContainers.php index 99e671912..2d670bd45 100644 --- a/php/EE/Migration/SiteContainers.php +++ b/php/EE/Migration/SiteContainers.php @@ -70,13 +70,19 @@ public static function revert_site_docker_compose_file( $source_path, $destinati * @return bool */ public static function is_site_service_image_changed( $updated_images, $site_info ) { + chdir( $site_info['site_fs_path'] ); - $launch = EE::launch( 'docker-compose config --services' ); - $services = explode( PHP_EOL, trim( $launch->stdout ) ); + $launch = EE::launch( 'docker-compose images' ); + $lines = explode( PHP_EOL, trim( $launch->stdout ) ); + $site_images = []; + + for ( $i = 1; $i < count( $lines ); $i ++ ) { + $columns = preg_split( '/\s+/', $lines[ $i ] ); - $site_images = array_map( function ( $service ) { - return 'easyengine/' . $service; - }, $services ); + if ( isset( $columns[1] ) ) { + $site_images[] = $columns[1]; + } + } $common_image = array_intersect( $updated_images, $site_images ); From 8674a3b6cc08cea63c9ffc43e4d7fe2452901e61 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 28 May 2024 21:42:05 +0530 Subject: [PATCH 0966/1044] Fix image link Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index e992cfff0..34dbe02c3 100644 --- a/README.md +++ b/README.md @@ -3,12 +3,11 @@ # EasyEngine v4 [![Build 🔨 + Test 👨‍🔧](https://github.com/EasyEngine/easyengine/actions/workflows/test_and_build.yml/badge.svg?branch=develop)](https://github.com/EasyEngine/easyengine/actions/workflows/test_and_build.yml) -[![Join EasyEngine Slack Channel](https://img.shields.io/badge/Join%20Our%20Community-Slack-blue)](http://slack.easyengine.io/) [![Latest Stable Version](https://poser.pugx.org/easyengine/easyengine/v/stable)](https://github.com/EasyEngine/easyengine/releases) [![License](https://poser.pugx.org/easyengine/easyengine/license)](https://packagist.org/packages/easyengine/easyengine) EasyEngine makes it greatly easy to manage nginx, a fast web-server software that consumes little memory when handling increasing volumes of concurrent users. -<a href="https://rtcamp.com/?utm_source=github&utm_medium=readme" rel="nofollow"><img style="width:150px;" src="https://learn.rtcamp.com/wp-content/uploads/2021/04/rtlearn-logo@2x.png" alt="Handcrafted Enterprise WordPress Solutions by rtCamp" /></a> +<a href="https://rtcamp.com/?utm_source=github&utm_medium=readme" rel="nofollow"><img src="https://rtcamp.com/wp-content/uploads/sites/2/2019/04/github-banner@2x.png" alt="Handcrafted Enterprise WordPress Solutions by rtCamp" /></a> ## Requirements From b6c99e2fa0559f501a2f4b971bb2862daee2e040 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 28 May 2024 21:43:32 +0530 Subject: [PATCH 0967/1044] Update image banner section Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 34dbe02c3..d464cf142 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,6 @@ EasyEngine makes it greatly easy to manage nginx, a fast web-server software that consumes little memory when handling increasing volumes of concurrent users. -<a href="https://rtcamp.com/?utm_source=github&utm_medium=readme" rel="nofollow"><img src="https://rtcamp.com/wp-content/uploads/sites/2/2019/04/github-banner@2x.png" alt="Handcrafted Enterprise WordPress Solutions by rtCamp" /></a> - ## Requirements * Docker @@ -112,4 +110,6 @@ We warmheartedly welcome all contributions however and in whatever capacity you [![PayPal-Donate](https://cloud.githubusercontent.com/assets/4115/5297691/c7b50292-7bd7-11e4-987b-2dc21069e756.png)](http://rt.cx/eedonate) +## Does this interest you? +<a href="https://rtcamp.com/?utm_source=github&utm_medium=readme" rel="nofollow"><img src="https://rtcamp.com/wp-content/uploads/sites/2/2019/04/github-banner@2x.png" alt="Handcrafted Enterprise WordPress Solutions by rtCamp" /></a> From b24add1ea5ed7069ed6f4b3a4c7919d6024022e1 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 28 May 2024 21:48:19 +0530 Subject: [PATCH 0968/1044] Update readme commands Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d464cf142..8bdf7c249 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ ee site create example.com --type=wp --cache Need a wordpress multi-site with page cache? ``` -ee site create example.com --type=wp --mu=wpsubdir --cache +ee site create example.com --type=wp --mu=subdir --cache ``` Need a plain and simple html site? @@ -84,7 +84,7 @@ Want to know more? Checkout readme of these commands - * [cron command](https://github.com/EasyEngine/cron-command/) * [shell command](https://github.com/EasyEngine/shell-command/) -Note: :warning: EasyEngine will currently only run with root privileges. You can run `ee help`, `ee help site` and `ee help site create` to get all the details about the various commands and subcommands that you can run. +Note: :warning: EasyEngine will currently only run with root privileges. You can run `ee help`, `ee help site` and `ee help site create --type=wp` to get all the details about the various commands and subcommands that you can run. ## Development From 12779e0390012bff8839713c4bf999f508c29b75 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 28 May 2024 21:50:25 +0530 Subject: [PATCH 0969/1044] Bump Nginx image to v4.7.1 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- img-versions.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/img-versions.json b/img-versions.json index fc3da4dc7..998930554 100644 --- a/img-versions.json +++ b/img-versions.json @@ -3,7 +3,7 @@ "easyengine/mailhog": "v4.6.5", "easyengine/mariadb": "v4.6.6", "easyengine/nginx-proxy": "v4.7.1", - "easyengine/nginx": "v4.7.0", + "easyengine/nginx": "v4.7.1", "easyengine/php": "v4.6.6", "easyengine/php5.6": "v4.6.6", "easyengine/php7.0": "v4.6.6", From 0f40982997e8f393c5ce33f0548d20abf6dc925c Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Wed, 29 May 2024 14:25:54 +0530 Subject: [PATCH 0970/1044] Bump to version v4.7.1 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index f6cdf4098..7c66fca57 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.7.0 +4.7.1 From bbfa1d6d906f5e5d4c978abc756c050ced7900b0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 29 May 2024 08:57:59 +0000 Subject: [PATCH 0971/1044] Bump composer/composer from 2.2.12 to 2.2.23 Bumps [composer/composer](https://github.com/composer/composer) from 2.2.12 to 2.2.23. - [Release notes](https://github.com/composer/composer/releases) - [Changelog](https://github.com/composer/composer/blob/main/CHANGELOG.md) - [Commits](https://github.com/composer/composer/compare/2.2.12...2.2.23) --- updated-dependencies: - dependency-name: composer/composer dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> --- composer.json | 2 +- composer.lock | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index d7f8dbf32..a92ddfe67 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ "prefer-stable": true, "require": { "php": ">=7.0", - "composer/composer": "2.2.12", + "composer/composer": "2.2.23", "composer/semver": "3.2.4", "daverandom/libdns": "^2.0", "easyengine/admin-tools-command": "v1.1.0", diff --git a/composer.lock b/composer.lock index d9bc3c400..c818a4caf 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": "68abab4f9d6a160147aac0cf35349a01", + "content-hash": "8eae214044b252f779ad4cba1b243ab7", "packages": [ { "name": "acmephp/core", @@ -275,16 +275,16 @@ }, { "name": "composer/composer", - "version": "2.2.12", + "version": "2.2.23", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "ba61e768b410736efe61df01b61f1ec44f51474f" + "reference": "d1542e89636abf422fde328cb28d53752efb69e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/ba61e768b410736efe61df01b61f1ec44f51474f", - "reference": "ba61e768b410736efe61df01b61f1ec44f51474f", + "url": "https://api.github.com/repos/composer/composer/zipball/d1542e89636abf422fde328cb28d53752efb69e5", + "reference": "d1542e89636abf422fde328cb28d53752efb69e5", "shasum": "" }, "require": { @@ -354,7 +354,7 @@ "support": { "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/composer/issues", - "source": "https://github.com/composer/composer/tree/2.2.12" + "source": "https://github.com/composer/composer/tree/2.2.23" }, "funding": [ { @@ -370,7 +370,7 @@ "type": "tidelift" } ], - "time": "2022-04-13T14:42:25+00:00" + "time": "2024-02-08T14:08:53+00:00" }, { "name": "composer/metadata-minifier", @@ -6407,5 +6407,5 @@ "platform-overrides": { "php": "7.3" }, - "plugin-api-version": "2.0.0" + "plugin-api-version": "2.6.0" } From 48ac35e68d558877e1da0a7416e16b728bc77d48 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Wed, 29 May 2024 14:37:15 +0530 Subject: [PATCH 0972/1044] Change plugin api version Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.lock b/composer.lock index c818a4caf..1d8af8bce 100644 --- a/composer.lock +++ b/composer.lock @@ -6407,5 +6407,5 @@ "platform-overrides": { "php": "7.3" }, - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.0.0" } From 4b79261d1f1a158db669e815bde3c7e561aa53b3 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 24 Jun 2024 17:47:17 +0530 Subject: [PATCH 0973/1044] Update images for v4.7.2 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- img-versions.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/img-versions.json b/img-versions.json index 998930554..b0d531251 100644 --- a/img-versions.json +++ b/img-versions.json @@ -9,12 +9,12 @@ "easyengine/php7.0": "v4.6.6", "easyengine/php7.2": "v4.6.6", "easyengine/php7.3": "v4.6.6", - "easyengine/php7.4": "v4.7.0", - "easyengine/php8.0": "v4.7.1", - "easyengine/php8.1": "v4.7.1", - "easyengine/php8.2": "v4.7.1", - "easyengine/php8.3": "v4.7.1", + "easyengine/php7.4": "v4.7.2", + "easyengine/php8.0": "v4.7.2", + "easyengine/php8.1": "v4.7.2", + "easyengine/php8.2": "v4.7.2", + "easyengine/php8.3": "v4.7.2", "easyengine/postfix": "v4.7.0", - "easyengine/redis": "v4.7.0", - "easyengine/newrelic-daemon": "v4.7.0" + "easyengine/redis": "v4.7.2", + "easyengine/newrelic-daemon": "v4.7.2" } From f9ef705128ccac999ce59d8de231e2e56fcd81f5 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 8 Jul 2024 21:10:47 +0530 Subject: [PATCH 0974/1044] Bump to version v4.7.2 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 7c66fca57..af9764a59 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.7.1 +4.7.2 From 1d1d8a8448d207742f5c43fac105bbf54df7d216 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 8 Aug 2024 10:23:14 +0530 Subject: [PATCH 0975/1044] Extend only valid extension files Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- php/class-ee-docker.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/php/class-ee-docker.php b/php/class-ee-docker.php index 058d354d7..d1deacbfb 100644 --- a/php/class-ee-docker.php +++ b/php/class-ee-docker.php @@ -39,11 +39,10 @@ public static function docker_compose_with_custom( array $files_before_custom = } else { if ( $fs->exists( SITE_CUSTOM_DOCKER_COMPOSE_DIR ) ) { - $custom_compose_files = array_diff( scandir( SITE_CUSTOM_DOCKER_COMPOSE_DIR ), [ '.', '..' ] ); - $custom_compose_files = array_map( function ( $arrayValues ) { + $ymlFiles = glob( SITE_CUSTOM_DOCKER_COMPOSE_DIR . '/*.yml' ); + $yamlFiles = glob( SITE_CUSTOM_DOCKER_COMPOSE_DIR . '/*.yaml' ); - return SITE_CUSTOM_DOCKER_COMPOSE_DIR . '/' . $arrayValues; - }, $custom_compose_files ); + $custom_compose_files = array_merge( $ymlFiles, $yamlFiles ); $files_before_custom = array_unique( array_merge( $files_before_custom, $custom_compose_files ) ); } From ea9b415ca36dff2f24e1d53aede2ce60938bc23a Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 8 Aug 2024 10:36:19 +0530 Subject: [PATCH 0976/1044] Add minimum 5GB disk requirement for update Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- php/EE/Runner.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index a672f43c4..7ad2e2bef 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -134,6 +134,15 @@ public function check_requirements( $show_error = true ) { */ private function migrate() { + // Check if minimum 5GB disk space is available + $free_space = disk_free_space( EE_ROOT_DIR ); + $docker_dir = EE::launch( 'docker info --format \'{{.DockerRootDir}}\'' )->stdout; + $free_space_docker = disk_free_space( $docker_dir ); + + if ( $free_space < 5 * 1024 * 1024 * 1024 || $free_space_docker < 5 * 1024 * 1024 * 1024 ) { + EE::error( 'EasyEngine update requires minimum 5GB disk space to run. Please free up some space and try again.' ); + } + $rsp = new \EE\RevertableStepProcessor(); $rsp->add_step( 'ee-db-migrations', 'EE\Migration\Executor::execute_migrations' ); From c5e4c6810d2889143cd895d0c627aef0391fd6b9 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 8 Aug 2024 11:45:42 +0530 Subject: [PATCH 0977/1044] Update space check Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- php/EE/Runner.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 7ad2e2bef..be5acbf91 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -135,11 +135,21 @@ public function check_requirements( $show_error = true ) { private function migrate() { // Check if minimum 5GB disk space is available - $free_space = disk_free_space( EE_ROOT_DIR ); - $docker_dir = EE::launch( 'docker info --format \'{{.DockerRootDir}}\'' )->stdout; - $free_space_docker = disk_free_space( $docker_dir ); + $required_space = 5 * 1024 * 1024 * 1024; + $free_space = 0; + $free_space_docker = 0; - if ( $free_space < 5 * 1024 * 1024 * 1024 || $free_space_docker < 5 * 1024 * 1024 * 1024 ) { + if ( is_dir( EE_ROOT_DIR ) ) { + $free_space = disk_free_space( EE_ROOT_DIR ); + } + + $docker_dir = EE::launch( 'docker info --format \'{{.DockerRootDir}}\'' )->stdout; + + if ( is_dir( $docker_dir ) ) { + $free_space_docker = disk_free_space( $docker_dir ); + } + + if ( ( $free_space < $required_space && is_dir( EE_ROOT_DIR ) ) || ( $free_space_docker < $required_space && is_dir( $docker_dir ) ) ) { EE::error( 'EasyEngine update requires minimum 5GB disk space to run. Please free up some space and try again.' ); } From d4a3170304744a8bec1dcae5b163c501f6b3432e Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 8 Aug 2024 16:05:31 +0530 Subject: [PATCH 0978/1044] Fix stdout output Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- php/EE/Runner.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 7ad2e2bef..b2088ec44 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -136,7 +136,7 @@ private function migrate() { // Check if minimum 5GB disk space is available $free_space = disk_free_space( EE_ROOT_DIR ); - $docker_dir = EE::launch( 'docker info --format \'{{.DockerRootDir}}\'' )->stdout; + $docker_dir = trim( EE::launch( 'docker info --format \'{{.DockerRootDir}}\'' )->stdout ); $free_space_docker = disk_free_space( $docker_dir ); if ( $free_space < 5 * 1024 * 1024 * 1024 || $free_space_docker < 5 * 1024 * 1024 * 1024 ) { From ef746219b1973963c5008e737f3f2d51dc04d7ab Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 8 Aug 2024 16:06:04 +0530 Subject: [PATCH 0979/1044] Update username generation Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- php/utils.php | 79 ++++++++++++++++++++++++--------------------------- 1 file changed, 37 insertions(+), 42 deletions(-) diff --git a/php/utils.php b/php/utils.php index 4c2ca61b9..985f9802a 100644 --- a/php/utils.php +++ b/php/utils.php @@ -1408,7 +1408,7 @@ function delete_dir( $dir ) { * * @return string Random Password of specified length. */ -function random_password( $length = 12 ) { +function random_password( $length = 18 ) { $alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'; $pass = array(); $alphaLength = strlen( $alphabet ) - 1; @@ -1691,47 +1691,42 @@ function extract_zip( $zip_file, $path_to_extract ) { */ function random_name_generator() { - $left = [ - 'admiring', 'adoring', 'affectionate', 'agitated', 'amazing', 'angry', 'awesome', 'blissful', 'bold', - 'boring', 'brave', 'charming', 'clever', 'cocky', 'cool', 'compassionate', 'competent', 'condescending', - 'confident', 'cranky', 'crazy', 'dazzling', 'determined', 'distracted', 'dreamy', 'eager', 'ecstatic', - 'elastic', 'elated', 'elegant', 'eloquent', 'epic', 'fervent', 'festive', 'flamboyant', 'focused', 'friendly', - 'frosty', 'gallant', 'gifted', 'goofy', 'gracious', 'happy', 'hardcore', 'heuristic', 'hopeful', 'hungry', - 'infallible', 'inspiring', 'jolly', 'jovial', 'keen', 'kind', 'laughing', 'loving', 'lucid', 'magical', - 'mystifying', 'modest', 'musing', 'naughty', 'nervous', 'nifty', 'nostalgic', 'objective', 'optimistic', - 'peaceful', 'pedantic', 'pensive', 'practical', 'priceless', 'quirky', 'quizzical', 'recursing', 'relaxed', - 'reverent', 'romantic', 'sad', 'serene', 'sharp', 'silly', 'sleepy', 'stoic', 'stupefied', 'suspicious', - 'sweet', 'tender', 'thirsty', 'trusting', 'unruffled', 'upbeat', 'vibrant', 'vigilant', 'vigorous', - 'wizardly', 'wonderful', 'xenodochial', 'youthful', 'zealous', 'zen', - ]; - - $right = [ 'albattani', 'allen', 'almeida', 'antonelli', 'agnesi', 'archimedes', 'ardinghelli', 'aryabhata', - 'austin', 'babbage', 'banach', 'banzai', 'bardeen', 'bartik', 'bassi', 'beaver', 'bell', 'benz', 'bhabha', - 'bhaskara', 'black', 'blackburn', 'blackwell', 'bohr', 'booth', 'borg', 'bose', 'boyd', 'brahmagupta', - 'brattain', 'brown', 'burnell', 'buck', 'burnell', 'cannon', 'carson', 'cartwright', 'chandrasekhar', - 'chaplygin', 'chatelet', 'chatterjee', 'chebyshev', 'cocks', 'cohen', 'chaum', 'clarke', 'colden', 'cori', - 'cray', 'curran', 'curie', 'darwin', 'davinci', 'dewdney', 'dhawan', 'diffie', 'dijkstra', 'dirac', 'driscoll', - 'dubinsky', 'easley', 'edison', 'einstein', 'elbakyan', 'elgamal', 'elion', 'ellis', 'engelbart', 'euclid', - 'euler', 'faraday', 'feistel', 'fermat', 'fermi', 'feynman', 'franklin', 'gagarin', 'galileo', 'galois', - 'ganguly', 'gates', 'gauss', 'germain', 'goldberg', 'goldstine', 'goldwasser', 'golick', 'goodall', 'gould', - 'greider', 'grothendieck', 'haibt', 'hamilton', 'haslett', 'hawking', 'hellman', 'heisenberg', 'hermann', - 'herschel', 'hertz', 'heyrovsky', 'hodgkin', 'hofstadter', 'hoover', 'hopper', 'hugle', 'hypatia', 'ishizaka', - 'jackson', 'jang', 'jennings', 'jepsen', 'johnson', 'joliot', 'jones', 'kalam', 'kapitsa', 'kare', 'keldysh', - 'keller', 'kepler', 'khayyam', 'khorana', 'kilby', 'kirch', 'knuth', 'kowalevski', 'lalande', 'lamarr', - 'lamport', 'leakey', 'leavitt', 'lederberg', 'lehmann', 'lewin', 'lichterman', 'liskov', 'lovelace', 'lumiere', - 'mahavira', 'margulis', 'matsumoto', 'maxwell', 'mayer', 'mccarthy', 'mcclintock', 'mclaren', 'mclean', - 'mcnulty', 'mendel', 'mendeleev', 'meitner', 'meninsky', 'merkle', 'mestorf', 'minsky', 'mirzakhani', - 'moore', 'morse', 'murdock', 'moser', 'napier', 'nash', 'neumann', 'newton', 'nightingale', 'nobel', - 'noether', 'northcutt', 'noyce', 'panini', 'pare', 'pascal', 'pasteur', 'payne', 'perlman', 'pike', - 'poincare', 'poitras', 'proskuriakova', 'ptolemy', 'raman', 'ramanujan', 'ride', 'montalcini', 'ritchie', - 'rhodes', 'robinson', 'roentgen', 'rosalind', 'rubin', 'saha', 'sammet', 'sanderson', 'shannon', 'shaw', - 'shirley', 'shockley', 'shtern', 'sinoussi', 'snyder', 'solomon', 'spence', 'sutherland', 'stallman', - 'stonebraker', 'swanson', 'swartz', 'swirles', 'taussig', 'tereshkova', 'tesla', 'tharp', 'thompson', - 'torvalds', 'tu', 'turing', 'varahamihira', 'vaughan', 'visvesvaraya', 'volhard', 'villani', 'wescoff', - 'wiles', 'williams', 'williamson', 'wilson', 'wing', 'wozniak', 'wright', 'wu', 'yalow', 'yonath', "zhukovsky", - ]; - - return $left[ array_rand( $left ) ] . '-' . $right[ array_rand( $right ) ]; + $prefix = 'wp-user-'; + + // Generate a random suffix of 4 to 6 characters with a number at the 2nd or 3rd position. + $suffixLength = random_int( 4, 6 ); + $suffix = generate_safe_suffix( $suffixLength ); + + // Combine prefix and suffix to form the username + return $prefix . $suffix; +} + +/** + * Generate a safe random suffix with a number at the 2nd or 3rd position. + * + * @param int $length Length of the desired suffix. + * + * @return string + */ +function generate_safe_suffix( $length ) { + + $alphanumeric = 'abcdefghijklmnopqrstuvwxyz0123456789'; // Allowed alphanumeric characters + $numbers = '0123456789'; // Allowed numeric characters + + $randomSuffix = ''; + + // Randomly choose a position for the number (2nd or 3rd) + $numberPosition = random_int( 1, 2 ); + + for ( $i = 0; $i < $length; $i ++ ) { + if ( $i == $numberPosition ) { + $randomSuffix .= $numbers[ random_int( 0, strlen( $numbers ) - 1 ) ]; + } else { + $randomSuffix .= $alphanumeric[ random_int( 0, strlen( $alphanumeric ) - 1 ) ]; + } + } + + return $randomSuffix; } /** From 33f4023d9d8284043092d074d37f9f964abbdf6c Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 8 Aug 2024 16:10:42 +0530 Subject: [PATCH 0980/1044] Merge develop into update/username-generation --- php/EE/Runner.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/php/EE/Runner.php b/php/EE/Runner.php index b2088ec44..1f22ac9cf 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -135,11 +135,21 @@ public function check_requirements( $show_error = true ) { private function migrate() { // Check if minimum 5GB disk space is available - $free_space = disk_free_space( EE_ROOT_DIR ); - $docker_dir = trim( EE::launch( 'docker info --format \'{{.DockerRootDir}}\'' )->stdout ); - $free_space_docker = disk_free_space( $docker_dir ); + $required_space = 5 * 1024 * 1024 * 1024; + $free_space = 0; + $free_space_docker = 0; - if ( $free_space < 5 * 1024 * 1024 * 1024 || $free_space_docker < 5 * 1024 * 1024 * 1024 ) { + if ( is_dir( EE_ROOT_DIR ) ) { + $free_space = disk_free_space( EE_ROOT_DIR ); + } + + $docker_dir = trim( EE::launch( 'docker info --format \'{{.DockerRootDir}}\'' )->stdout ); + + if ( is_dir( $docker_dir ) ) { + $free_space_docker = disk_free_space( $docker_dir ); + } + + if ( ( $free_space < $required_space && is_dir( EE_ROOT_DIR ) ) || ( $free_space_docker < $required_space && is_dir( $docker_dir ) ) ) { EE::error( 'EasyEngine update requires minimum 5GB disk space to run. Please free up some space and try again.' ); } From af0ab3a22f6862ad969bffaa41d7e7d85f1850e3 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 8 Aug 2024 16:52:12 +0530 Subject: [PATCH 0981/1044] Update images for v4.7.3 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- img-versions.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/img-versions.json b/img-versions.json index b0d531251..97f264cd0 100644 --- a/img-versions.json +++ b/img-versions.json @@ -1,9 +1,9 @@ { - "easyengine/cron": "v4.7.0", + "easyengine/cron": "v4.7.3", "easyengine/mailhog": "v4.6.5", "easyengine/mariadb": "v4.6.6", - "easyengine/nginx-proxy": "v4.7.1", - "easyengine/nginx": "v4.7.1", + "easyengine/nginx-proxy": "v4.7.3", + "easyengine/nginx": "v4.7.3", "easyengine/php": "v4.6.6", "easyengine/php5.6": "v4.6.6", "easyengine/php7.0": "v4.6.6", @@ -12,9 +12,9 @@ "easyengine/php7.4": "v4.7.2", "easyengine/php8.0": "v4.7.2", "easyengine/php8.1": "v4.7.2", - "easyengine/php8.2": "v4.7.2", - "easyengine/php8.3": "v4.7.2", - "easyengine/postfix": "v4.7.0", - "easyengine/redis": "v4.7.2", - "easyengine/newrelic-daemon": "v4.7.2" + "easyengine/php8.2": "v4.7.3", + "easyengine/php8.3": "v4.7.3", + "easyengine/postfix": "v4.7.3", + "easyengine/redis": "v4.7.3", + "easyengine/newrelic-daemon": "v4.7.3" } From 2e7fa2cea5a4a9c1dc610294d1e0725f57d3fcaf Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 13 Aug 2024 18:11:06 +0530 Subject: [PATCH 0982/1044] Update composer packages for v4.7.3 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 2 +- composer.lock | 180 ++++++++++++++++++++++++-------------------------- 2 files changed, 89 insertions(+), 93 deletions(-) diff --git a/composer.json b/composer.json index a92ddfe67..41da279cd 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,7 @@ "composer/semver": "3.2.4", "daverandom/libdns": "^2.0", "easyengine/admin-tools-command": "v1.1.0", - "easyengine/auth-command": "v1.2.0", + "easyengine/auth-command": "v1.2.1", "easyengine/config-command": "v1.0.2", "easyengine/cron-command": "v2.1.0", "easyengine/log-command": "v1.1.0", diff --git a/composer.lock b/composer.lock index 1d8af8bce..217c1adba 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": "8eae214044b252f779ad4cba1b243ab7", + "content-hash": "3e325ef56ea57dd09ceecd428afce3c1", "packages": [ { "name": "acmephp/core", @@ -199,16 +199,16 @@ }, { "name": "composer/ca-bundle", - "version": "1.5.0", + "version": "1.5.1", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "0c5ccfcfea312b5c5a190a21ac5cef93f74baf99" + "reference": "063d9aa8696582f5a41dffbbaf3c81024f0a604a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/0c5ccfcfea312b5c5a190a21ac5cef93f74baf99", - "reference": "0c5ccfcfea312b5c5a190a21ac5cef93f74baf99", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/063d9aa8696582f5a41dffbbaf3c81024f0a604a", + "reference": "063d9aa8696582f5a41dffbbaf3c81024f0a604a", "shasum": "" }, "require": { @@ -218,7 +218,7 @@ }, "require-dev": { "phpstan/phpstan": "^1.10", - "psr/log": "^1.0", + "psr/log": "^1.0 || ^2.0 || ^3.0", "symfony/phpunit-bridge": "^4.2 || ^5", "symfony/process": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, @@ -255,7 +255,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.5.0" + "source": "https://github.com/composer/ca-bundle/tree/1.5.1" }, "funding": [ { @@ -271,7 +271,7 @@ "type": "tidelift" } ], - "time": "2024-03-15T14:00:32+00:00" + "time": "2024-07-08T15:28:20+00:00" }, { "name": "composer/composer", @@ -831,16 +831,16 @@ }, { "name": "easyengine/auth-command", - "version": "v1.2.0", + "version": "v1.2.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/auth-command.git", - "reference": "e08f7e01d3d73d0ea61f1adfb73249af19e88cb7" + "reference": "009381e270ef415ad2b2f8a0da678459cb9bf4c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/auth-command/zipball/e08f7e01d3d73d0ea61f1adfb73249af19e88cb7", - "reference": "e08f7e01d3d73d0ea61f1adfb73249af19e88cb7", + "url": "https://api.github.com/repos/EasyEngine/auth-command/zipball/009381e270ef415ad2b2f8a0da678459cb9bf4c9", + "reference": "009381e270ef415ad2b2f8a0da678459cb9bf4c9", "shasum": "" }, "type": "ee-cli-package", @@ -875,9 +875,9 @@ "homepage": "https://github.com/easyengine/auth-command", "support": { "issues": "https://github.com/EasyEngine/auth-command/issues", - "source": "https://github.com/EasyEngine/auth-command/tree/v1.2.0" + "source": "https://github.com/EasyEngine/auth-command/tree/v1.2.1" }, - "time": "2021-11-02T09:18:13+00:00" + "time": "2024-08-13T12:39:42+00:00" }, { "name": "easyengine/config-command", @@ -1355,22 +1355,22 @@ }, { "name": "guzzlehttp/guzzle", - "version": "7.8.1", + "version": "7.8.2", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "41042bc7ab002487b876a0683fc8dce04ddce104" + "reference": "f4152d9eb85c445fe1f992001d1748e8bec070d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/41042bc7ab002487b876a0683fc8dce04ddce104", - "reference": "41042bc7ab002487b876a0683fc8dce04ddce104", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f4152d9eb85c445fe1f992001d1748e8bec070d2", + "reference": "f4152d9eb85c445fe1f992001d1748e8bec070d2", "shasum": "" }, "require": { "ext-json": "*", - "guzzlehttp/promises": "^1.5.3 || ^2.0.1", - "guzzlehttp/psr7": "^1.9.1 || ^2.5.1", + "guzzlehttp/promises": "^1.5.3 || ^2.0.3", + "guzzlehttp/psr7": "^1.9.1 || ^2.6.3", "php": "^7.2.5 || ^8.0", "psr/http-client": "^1.0", "symfony/deprecation-contracts": "^2.2 || ^3.0" @@ -1381,9 +1381,9 @@ "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", "ext-curl": "*", - "php-http/client-integration-tests": "dev-master#2c025848417c1135031fdf9c728ee53d0a7ceaee as 3.0.999", + "guzzle/client-integration-tests": "3.0.2", "php-http/message-factory": "^1.1", - "phpunit/phpunit": "^8.5.36 || ^9.6.15", + "phpunit/phpunit": "^8.5.39 || ^9.6.20", "psr/log": "^1.1 || ^2.0 || ^3.0" }, "suggest": { @@ -1461,7 +1461,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.8.1" + "source": "https://github.com/guzzle/guzzle/tree/7.8.2" }, "funding": [ { @@ -1477,20 +1477,20 @@ "type": "tidelift" } ], - "time": "2023-12-03T20:35:24+00:00" + "time": "2024-07-18T11:12:18+00:00" }, { "name": "guzzlehttp/promises", - "version": "2.0.2", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "bbff78d96034045e58e13dedd6ad91b5d1253223" + "reference": "6ea8dd08867a2a42619d65c3deb2c0fcbf81c8f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/bbff78d96034045e58e13dedd6ad91b5d1253223", - "reference": "bbff78d96034045e58e13dedd6ad91b5d1253223", + "url": "https://api.github.com/repos/guzzle/promises/zipball/6ea8dd08867a2a42619d65c3deb2c0fcbf81c8f8", + "reference": "6ea8dd08867a2a42619d65c3deb2c0fcbf81c8f8", "shasum": "" }, "require": { @@ -1498,7 +1498,7 @@ }, "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", - "phpunit/phpunit": "^8.5.36 || ^9.6.15" + "phpunit/phpunit": "^8.5.39 || ^9.6.20" }, "type": "library", "extra": { @@ -1544,7 +1544,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/2.0.2" + "source": "https://github.com/guzzle/promises/tree/2.0.3" }, "funding": [ { @@ -1560,7 +1560,7 @@ "type": "tidelift" } ], - "time": "2023-12-03T20:19:20+00:00" + "time": "2024-07-18T10:29:17+00:00" }, { "name": "guzzlehttp/psr7", @@ -1669,20 +1669,20 @@ }, { "name": "justinrainbow/json-schema", - "version": "v5.2.13", + "version": "5.3.0", "source": { "type": "git", "url": "https://github.com/jsonrainbow/json-schema.git", - "reference": "fbbe7e5d79f618997bc3332a6f49246036c45793" + "reference": "feb2ca6dd1cebdaf1ed60a4c8de2e53ce11c4fd8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/jsonrainbow/json-schema/zipball/fbbe7e5d79f618997bc3332a6f49246036c45793", - "reference": "fbbe7e5d79f618997bc3332a6f49246036c45793", + "url": "https://api.github.com/repos/jsonrainbow/json-schema/zipball/feb2ca6dd1cebdaf1ed60a4c8de2e53ce11c4fd8", + "reference": "feb2ca6dd1cebdaf1ed60a4c8de2e53ce11c4fd8", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.1" }, "require-dev": { "friendsofphp/php-cs-fixer": "~2.2.20||~2.15.1", @@ -1693,11 +1693,6 @@ "bin/validate-json" ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0.x-dev" - } - }, "autoload": { "psr-4": { "JsonSchema\\": "src/JsonSchema/" @@ -1733,9 +1728,9 @@ ], "support": { "issues": "https://github.com/jsonrainbow/json-schema/issues", - "source": "https://github.com/jsonrainbow/json-schema/tree/v5.2.13" + "source": "https://github.com/jsonrainbow/json-schema/tree/5.3.0" }, - "time": "2023-09-26T02:20:38+00:00" + "time": "2024-07-06T21:00:26+00:00" }, { "name": "league/flysystem", @@ -2400,23 +2395,23 @@ }, { "name": "seld/jsonlint", - "version": "1.10.2", + "version": "1.11.0", "source": { "type": "git", "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "9bb7db07b5d66d90f6ebf542f09fc67d800e5259" + "reference": "1748aaf847fc731cfad7725aec413ee46f0cc3a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/9bb7db07b5d66d90f6ebf542f09fc67d800e5259", - "reference": "9bb7db07b5d66d90f6ebf542f09fc67d800e5259", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/1748aaf847fc731cfad7725aec413ee46f0cc3a2", + "reference": "1748aaf847fc731cfad7725aec413ee46f0cc3a2", "shasum": "" }, "require": { "php": "^5.3 || ^7.0 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^1.5", + "phpstan/phpstan": "^1.11", "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0 || ^8.5.13" }, "bin": [ @@ -2448,7 +2443,7 @@ ], "support": { "issues": "https://github.com/Seldaek/jsonlint/issues", - "source": "https://github.com/Seldaek/jsonlint/tree/1.10.2" + "source": "https://github.com/Seldaek/jsonlint/tree/1.11.0" }, "funding": [ { @@ -2460,7 +2455,7 @@ "type": "tidelift" } ], - "time": "2024-02-07T12:57:50+00:00" + "time": "2024-07-11T14:55:45+00:00" }, { "name": "seld/phar-utils", @@ -3190,16 +3185,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4" + "reference": "0424dff1c58f028c451efff2045f5d92410bd540" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ef4d7e442ca910c4764bce785146269b30cb5fc4", - "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/0424dff1c58f028c451efff2045f5d92410bd540", + "reference": "0424dff1c58f028c451efff2045f5d92410bd540", "shasum": "" }, "require": { @@ -3249,7 +3244,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.30.0" }, "funding": [ { @@ -3265,20 +3260,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec" + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec", - "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fd22ab50000ef01661e2a31d850ebaa297f8e03c", + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c", "shasum": "" }, "require": { @@ -3329,7 +3324,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.30.0" }, "funding": [ { @@ -3345,20 +3340,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-06-19T12:30:46+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "21bd091060673a1177ae842c0ef8fe30893114d2" + "reference": "ec444d3f3f6505bb28d11afa41e75faadebc10a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/21bd091060673a1177ae842c0ef8fe30893114d2", - "reference": "21bd091060673a1177ae842c0ef8fe30893114d2", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/ec444d3f3f6505bb28d11afa41e75faadebc10a1", + "reference": "ec444d3f3f6505bb28d11afa41e75faadebc10a1", "shasum": "" }, "require": { @@ -3405,7 +3400,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.30.0" }, "funding": [ { @@ -3421,20 +3416,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b" + "reference": "77fa7995ac1b21ab60769b7323d600a991a90433" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", - "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/77fa7995ac1b21ab60769b7323d600a991a90433", + "reference": "77fa7995ac1b21ab60769b7323d600a991a90433", "shasum": "" }, "require": { @@ -3485,7 +3480,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.30.0" }, "funding": [ { @@ -3501,20 +3496,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-php81", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "c565ad1e63f30e7477fc40738343c62b40bc672d" + "reference": "3fb075789fb91f9ad9af537c4012d523085bd5af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/c565ad1e63f30e7477fc40738343c62b40bc672d", - "reference": "c565ad1e63f30e7477fc40738343c62b40bc672d", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/3fb075789fb91f9ad9af537c4012d523085bd5af", + "reference": "3fb075789fb91f9ad9af537c4012d523085bd5af", "shasum": "" }, "require": { @@ -3561,7 +3556,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.30.0" }, "funding": [ { @@ -3577,7 +3572,7 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-06-19T12:30:46+00:00" }, { "name": "symfony/process", @@ -4547,16 +4542,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.11.1", + "version": "1.12.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" + "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", + "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", "shasum": "" }, "require": { @@ -4564,11 +4559,12 @@ }, "conflict": { "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3,<3.2.2" + "doctrine/common": "<2.13.3 || >=3 <3.2.2" }, "require-dev": { "doctrine/collections": "^1.6.8", "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy": "^1.10", "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, "type": "library", @@ -4594,7 +4590,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" + "source": "https://github.com/myclabs/DeepCopy/tree/1.12.0" }, "funding": [ { @@ -4602,7 +4598,7 @@ "type": "tidelift" } ], - "time": "2023-03-08T13:26:56+00:00" + "time": "2024-06-12T14:39:25+00:00" }, { "name": "nikic/php-parser", @@ -6221,16 +6217,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.10.1", + "version": "3.10.2", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "8f90f7a53ce271935282967f53d0894f8f1ff877" + "reference": "86e5f5dd9a840c46810ebe5ff1885581c42a3017" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/8f90f7a53ce271935282967f53d0894f8f1ff877", - "reference": "8f90f7a53ce271935282967f53d0894f8f1ff877", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/86e5f5dd9a840c46810ebe5ff1885581c42a3017", + "reference": "86e5f5dd9a840c46810ebe5ff1885581c42a3017", "shasum": "" }, "require": { @@ -6297,7 +6293,7 @@ "type": "open_collective" } ], - "time": "2024-05-22T21:24:41+00:00" + "time": "2024-07-21T23:26:44+00:00" }, { "name": "theseer/tokenizer", From 23db4c8fc6975f8aef52e2d2e13958c62bdf4cba Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Wed, 14 Aug 2024 19:01:03 +0530 Subject: [PATCH 0983/1044] Bump to version v4.7.3 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index af9764a59..87b18a567 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.7.2 +4.7.3 From 7ca8123072da3c0d6ad2a29791b2e28e8926b42d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Sep 2024 22:47:52 +0000 Subject: [PATCH 0984/1044] Bump actions/download-artifact from 3 to 4.1.7 in /.github/workflows Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 3 to 4.1.7. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v3...v4.1.7) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> --- .github/workflows/test_and_build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index c386fb6d6..ef854ad5e 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -185,7 +185,7 @@ jobs: token: ${{ secrets.BOT_TOKEN }} - name: Download built Phar file - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4.1.7 with: name: easyengine-phar @@ -238,7 +238,7 @@ jobs: uses: actions/checkout@v3 - name: Download built Phar file - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4.1.7 with: name: easyengine-phar From 2524cadc792be4d202e6bf37ce0c1cecdace5c83 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Fri, 13 Sep 2024 16:26:43 +0530 Subject: [PATCH 0985/1044] Update images for v4.7.4 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- img-versions.json | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/img-versions.json b/img-versions.json index 97f264cd0..5f3e07b5e 100644 --- a/img-versions.json +++ b/img-versions.json @@ -2,19 +2,19 @@ "easyengine/cron": "v4.7.3", "easyengine/mailhog": "v4.6.5", "easyengine/mariadb": "v4.6.6", - "easyengine/nginx-proxy": "v4.7.3", + "easyengine/nginx-proxy": "v4.7.4", "easyengine/nginx": "v4.7.3", "easyengine/php": "v4.6.6", - "easyengine/php5.6": "v4.6.6", - "easyengine/php7.0": "v4.6.6", - "easyengine/php7.2": "v4.6.6", - "easyengine/php7.3": "v4.6.6", - "easyengine/php7.4": "v4.7.2", - "easyengine/php8.0": "v4.7.2", - "easyengine/php8.1": "v4.7.2", - "easyengine/php8.2": "v4.7.3", - "easyengine/php8.3": "v4.7.3", - "easyengine/postfix": "v4.7.3", + "easyengine/php5.6": "v4.7.4", + "easyengine/php7.0": "v4.7.4", + "easyengine/php7.2": "v4.7.4", + "easyengine/php7.3": "v4.7.4", + "easyengine/php7.4": "v4.7.4", + "easyengine/php8.0": "v4.7.4", + "easyengine/php8.1": "v4.7.4", + "easyengine/php8.2": "v4.7.4", + "easyengine/php8.3": "v4.7.4", + "easyengine/postfix": "v4.7.4", "easyengine/redis": "v4.7.3", - "easyengine/newrelic-daemon": "v4.7.3" + "easyengine/newrelic-daemon": "v4.7.4" } From 904acad562caa5e809353908c6b42f62d247c477 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Fri, 13 Sep 2024 16:28:19 +0530 Subject: [PATCH 0986/1044] Bump to version v4.7.4 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 87b18a567..b48b2de9d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.7.3 +4.7.4 From 33df3f2bcfe182d7622cb72a3b4c5041aefba5ea Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Fri, 13 Sep 2024 16:32:57 +0530 Subject: [PATCH 0987/1044] Update composer packages for v4.7.4 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 2 +- composer.lock | 118 +++++++++++++++++++++++++------------------------- 2 files changed, 60 insertions(+), 60 deletions(-) diff --git a/composer.json b/composer.json index 41da279cd..08f3ba8de 100644 --- a/composer.json +++ b/composer.json @@ -36,7 +36,7 @@ "easyengine/mailhog-command": "v1.0.3", "easyengine/service-command": "v1.6.1", "easyengine/shell-command": "v1.1.1", - "easyengine/site-command": "v3.3.0", + "easyengine/site-command": "v3.3.1", "easyengine/site-type-php": "v1.8.0", "easyengine/site-type-wp": "v1.8.0", "monolog/monolog": "1.24.0", diff --git a/composer.lock b/composer.lock index 217c1adba..682e767fc 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": "3e325ef56ea57dd09ceecd428afce3c1", + "content-hash": "7017aacf107eede709fed0b69a1ccdb7", "packages": [ { "name": "acmephp/core", @@ -1161,16 +1161,16 @@ }, { "name": "easyengine/site-command", - "version": "v3.3.0", + "version": "v3.3.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "d47e48074981fd4ff3c91366d98d03007bba9158" + "reference": "f5413bd44f33cf25841b42f27d4816e65950ae51" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/d47e48074981fd4ff3c91366d98d03007bba9158", - "reference": "d47e48074981fd4ff3c91366d98d03007bba9158", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/f5413bd44f33cf25841b42f27d4816e65950ae51", + "reference": "f5413bd44f33cf25841b42f27d4816e65950ae51", "shasum": "" }, "require": { @@ -1231,9 +1231,9 @@ "homepage": "https://github.com/easyengine/site-command", "support": { "issues": "https://github.com/EasyEngine/site-command/issues", - "source": "https://github.com/EasyEngine/site-command/tree/v3.3.0" + "source": "https://github.com/EasyEngine/site-command/tree/v3.3.1" }, - "time": "2024-05-14T10:17:30+00:00" + "time": "2024-09-13T11:01:48+00:00" }, { "name": "easyengine/site-type-php", @@ -3185,20 +3185,20 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.30.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "0424dff1c58f028c451efff2045f5d92410bd540" + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/0424dff1c58f028c451efff2045f5d92410bd540", - "reference": "0424dff1c58f028c451efff2045f5d92410bd540", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638", + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "provide": { "ext-ctype": "*" @@ -3244,7 +3244,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.30.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0" }, "funding": [ { @@ -3260,24 +3260,24 @@ "type": "tidelift" } ], - "time": "2024-05-31T15:07:36+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.30.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c" + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fd22ab50000ef01661e2a31d850ebaa297f8e03c", - "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341", + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "provide": { "ext-mbstring": "*" @@ -3324,7 +3324,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.30.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0" }, "funding": [ { @@ -3340,24 +3340,24 @@ "type": "tidelift" } ], - "time": "2024-06-19T12:30:46+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.30.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "ec444d3f3f6505bb28d11afa41e75faadebc10a1" + "reference": "0f68c03565dcaaf25a890667542e8bd75fe7e5bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/ec444d3f3f6505bb28d11afa41e75faadebc10a1", - "reference": "ec444d3f3f6505bb28d11afa41e75faadebc10a1", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/0f68c03565dcaaf25a890667542e8bd75fe7e5bb", + "reference": "0f68c03565dcaaf25a890667542e8bd75fe7e5bb", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "type": "library", "extra": { @@ -3400,7 +3400,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.30.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.31.0" }, "funding": [ { @@ -3416,24 +3416,24 @@ "type": "tidelift" } ], - "time": "2024-05-31T15:07:36+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.30.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "77fa7995ac1b21ab60769b7323d600a991a90433" + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/77fa7995ac1b21ab60769b7323d600a991a90433", - "reference": "77fa7995ac1b21ab60769b7323d600a991a90433", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "type": "library", "extra": { @@ -3480,7 +3480,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.30.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0" }, "funding": [ { @@ -3496,24 +3496,24 @@ "type": "tidelift" } ], - "time": "2024-05-31T15:07:36+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-php81", - "version": "v1.30.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "3fb075789fb91f9ad9af537c4012d523085bd5af" + "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/3fb075789fb91f9ad9af537c4012d523085bd5af", - "reference": "3fb075789fb91f9ad9af537c4012d523085bd5af", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", + "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "type": "library", "extra": { @@ -3556,7 +3556,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.30.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.31.0" }, "funding": [ { @@ -3572,7 +3572,7 @@ "type": "tidelift" } ], - "time": "2024-06-19T12:30:46+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/process", @@ -4833,35 +4833,35 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.31", + "version": "9.2.32", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965" + "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/48c34b5d8d983006bd2adc2d0de92963b9155965", - "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/85402a822d1ecf1db1096959413d35e1c37cf1a5", + "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.18 || ^5.0", + "nikic/php-parser": "^4.19.1 || ^5.1.0", "php": ">=7.3", - "phpunit/php-file-iterator": "^3.0.3", - "phpunit/php-text-template": "^2.0.2", - "sebastian/code-unit-reverse-lookup": "^2.0.2", - "sebastian/complexity": "^2.0", - "sebastian/environment": "^5.1.2", - "sebastian/lines-of-code": "^1.0.3", - "sebastian/version": "^3.0.1", - "theseer/tokenizer": "^1.2.0" + "phpunit/php-file-iterator": "^3.0.6", + "phpunit/php-text-template": "^2.0.4", + "sebastian/code-unit-reverse-lookup": "^2.0.3", + "sebastian/complexity": "^2.0.3", + "sebastian/environment": "^5.1.5", + "sebastian/lines-of-code": "^1.0.4", + "sebastian/version": "^3.0.2", + "theseer/tokenizer": "^1.2.3" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^9.6" }, "suggest": { "ext-pcov": "PHP extension that provides line coverage", @@ -4870,7 +4870,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.2-dev" + "dev-main": "9.2.x-dev" } }, "autoload": { @@ -4899,7 +4899,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.31" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.32" }, "funding": [ { @@ -4907,7 +4907,7 @@ "type": "github" } ], - "time": "2024-03-02T06:37:42+00:00" + "time": "2024-08-22T04:23:01+00:00" }, { "name": "phpunit/php-file-iterator", From e1903fcb1e64fc6b7365691fbd61efa003cce7ce Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 8 Oct 2024 20:08:50 +0530 Subject: [PATCH 0988/1044] Fix changelog script Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- .gitignore | 1 + utils/changelog.sh | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 1b29f3c5b..269eb2159 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ profiles_settings.xml Project_Default.xml .idea ee_release +changelog.txt diff --git a/utils/changelog.sh b/utils/changelog.sh index 4ca0e70bb..b7d342537 100644 --- a/utils/changelog.sh +++ b/utils/changelog.sh @@ -5,15 +5,16 @@ echo "## What's Changed" > changelog.txt createdAt=$(gh api graphql -F owner='EasyEngine' -F name='easyengine' -f query=' query { repository(owner: "EasyEngine", name: "easyengine") { - releases(last: 1) { + releases(first: 1, orderBy: { field: CREATED_AT, direction: DESC }) { nodes { tagName, createdAt } } } } ' | jq -r '.data.repository.releases.nodes[0].createdAt') + gh api graphql --paginate -f query=" query { - search(query: \"org:Easyengine updated:>$createdAt state:closed is:pr\", type:ISSUE,first: 100) { + search(query: \"org:Easyengine updated:>$createdAt state:closed is:pr\", type:ISSUE, first: 100) { repositoryCount edges { node { From e650e93454d724c64241f16fa82fbb730ab03e40 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 8 Oct 2024 20:26:16 +0530 Subject: [PATCH 0989/1044] Update composer packages for v4.7.5 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 8 ++--- composer.lock | 94 +++++++++++++++++++++++++-------------------------- 2 files changed, 51 insertions(+), 51 deletions(-) diff --git a/composer.json b/composer.json index 08f3ba8de..2fe25355f 100644 --- a/composer.json +++ b/composer.json @@ -35,10 +35,10 @@ "easyengine/log-command": "v1.1.0", "easyengine/mailhog-command": "v1.0.3", "easyengine/service-command": "v1.6.1", - "easyengine/shell-command": "v1.1.1", - "easyengine/site-command": "v3.3.1", - "easyengine/site-type-php": "v1.8.0", - "easyengine/site-type-wp": "v1.8.0", + "easyengine/shell-command": "v1.1.2", + "easyengine/site-command": "v3.3.2", + "easyengine/site-type-php": "v1.8.1", + "easyengine/site-type-wp": "v1.8.1", "monolog/monolog": "1.24.0", "mustache/mustache": "2.14.1", "rmccue/requests": "1.8.0", diff --git a/composer.lock b/composer.lock index 682e767fc..713b8d246 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": "7017aacf107eede709fed0b69a1ccdb7", + "content-hash": "5498938c77cc0c6c755fb80e2c8f4870", "packages": [ { "name": "acmephp/core", @@ -199,16 +199,16 @@ }, { "name": "composer/ca-bundle", - "version": "1.5.1", + "version": "1.5.2", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "063d9aa8696582f5a41dffbbaf3c81024f0a604a" + "reference": "48a792895a2b7a6ee65dd5442c299d7b835b6137" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/063d9aa8696582f5a41dffbbaf3c81024f0a604a", - "reference": "063d9aa8696582f5a41dffbbaf3c81024f0a604a", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/48a792895a2b7a6ee65dd5442c299d7b835b6137", + "reference": "48a792895a2b7a6ee65dd5442c299d7b835b6137", "shasum": "" }, "require": { @@ -218,8 +218,8 @@ }, "require-dev": { "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^8 || ^9", "psr/log": "^1.0 || ^2.0 || ^3.0", - "symfony/phpunit-bridge": "^4.2 || ^5", "symfony/process": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, "type": "library", @@ -255,7 +255,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.5.1" + "source": "https://github.com/composer/ca-bundle/tree/1.5.2" }, "funding": [ { @@ -271,7 +271,7 @@ "type": "tidelift" } ], - "time": "2024-07-08T15:28:20+00:00" + "time": "2024-09-25T07:49:53+00:00" }, { "name": "composer/composer", @@ -1117,16 +1117,16 @@ }, { "name": "easyengine/shell-command", - "version": "v1.1.1", + "version": "v1.1.2", "source": { "type": "git", "url": "https://github.com/EasyEngine/shell-command.git", - "reference": "08475c777671cbf9feff7240910bcf14d298331a" + "reference": "e7676ed2939435354c2c176489e6ba1628561f49" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/shell-command/zipball/08475c777671cbf9feff7240910bcf14d298331a", - "reference": "08475c777671cbf9feff7240910bcf14d298331a", + "url": "https://api.github.com/repos/EasyEngine/shell-command/zipball/e7676ed2939435354c2c176489e6ba1628561f49", + "reference": "e7676ed2939435354c2c176489e6ba1628561f49", "shasum": "" }, "type": "ee-cli-package", @@ -1155,22 +1155,22 @@ "homepage": "https://github.com/easyengine/shell-command", "support": { "issues": "https://github.com/EasyEngine/shell-command/issues", - "source": "https://github.com/EasyEngine/shell-command/tree/v1.1.1" + "source": "https://github.com/EasyEngine/shell-command/tree/v1.1.2" }, - "time": "2022-05-31T11:46:57+00:00" + "time": "2024-10-08T14:45:56+00:00" }, { "name": "easyengine/site-command", - "version": "v3.3.1", + "version": "v3.3.2", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "f5413bd44f33cf25841b42f27d4816e65950ae51" + "reference": "ee76accecff64a189c54860ab48950151125653b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/f5413bd44f33cf25841b42f27d4816e65950ae51", - "reference": "f5413bd44f33cf25841b42f27d4816e65950ae51", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/ee76accecff64a189c54860ab48950151125653b", + "reference": "ee76accecff64a189c54860ab48950151125653b", "shasum": "" }, "require": { @@ -1231,22 +1231,22 @@ "homepage": "https://github.com/easyengine/site-command", "support": { "issues": "https://github.com/EasyEngine/site-command/issues", - "source": "https://github.com/EasyEngine/site-command/tree/v3.3.1" + "source": "https://github.com/EasyEngine/site-command/tree/v3.3.2" }, - "time": "2024-09-13T11:01:48+00:00" + "time": "2024-10-08T14:49:57+00:00" }, { "name": "easyengine/site-type-php", - "version": "v1.8.0", + "version": "v1.8.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-php.git", - "reference": "11c1eb443aec0f8292ea62a4fe8e02e6558f0888" + "reference": "f7ffa594add367df04850bc1b9a46dc857d00c91" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/11c1eb443aec0f8292ea62a4fe8e02e6558f0888", - "reference": "11c1eb443aec0f8292ea62a4fe8e02e6558f0888", + "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/f7ffa594add367df04850bc1b9a46dc857d00c91", + "reference": "f7ffa594add367df04850bc1b9a46dc857d00c91", "shasum": "" }, "require-dev": { @@ -1290,22 +1290,22 @@ "homepage": "https://github.com/easyengine/site-type-php", "support": { "issues": "https://github.com/EasyEngine/site-type-php/issues", - "source": "https://github.com/EasyEngine/site-type-php/tree/v1.8.0" + "source": "https://github.com/EasyEngine/site-type-php/tree/v1.8.1" }, - "time": "2024-05-14T10:21:08+00:00" + "time": "2024-10-08T14:52:50+00:00" }, { "name": "easyengine/site-type-wp", - "version": "v1.8.0", + "version": "v1.8.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-wp.git", - "reference": "a66f460788c760282b26aac91cd254b9a8dbdf45" + "reference": "9a38a3ee9d62dd4988f28ab3fd4d1b8bbbbb0218" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/a66f460788c760282b26aac91cd254b9a8dbdf45", - "reference": "a66f460788c760282b26aac91cd254b9a8dbdf45", + "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/9a38a3ee9d62dd4988f28ab3fd4d1b8bbbbb0218", + "reference": "9a38a3ee9d62dd4988f28ab3fd4d1b8bbbbb0218", "shasum": "" }, "require-dev": { @@ -1349,9 +1349,9 @@ "homepage": "https://github.com/easyengine/site-type-wp", "support": { "issues": "https://github.com/EasyEngine/site-type-wp/issues", - "source": "https://github.com/EasyEngine/site-type-wp/tree/v1.8.0" + "source": "https://github.com/EasyEngine/site-type-wp/tree/v1.8.1" }, - "time": "2024-05-14T10:21:23+00:00" + "time": "2024-10-08T14:53:03+00:00" }, { "name": "guzzlehttp/guzzle", @@ -4602,16 +4602,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.19.1", + "version": "v4.19.4", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "4e1b88d21c69391150ace211e9eaf05810858d0b" + "reference": "715f4d25e225bc47b293a8b997fe6ce99bf987d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/4e1b88d21c69391150ace211e9eaf05810858d0b", - "reference": "4e1b88d21c69391150ace211e9eaf05810858d0b", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/715f4d25e225bc47b293a8b997fe6ce99bf987d2", + "reference": "715f4d25e225bc47b293a8b997fe6ce99bf987d2", "shasum": "" }, "require": { @@ -4620,7 +4620,7 @@ }, "require-dev": { "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" }, "bin": [ "bin/php-parse" @@ -4652,9 +4652,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.19.1" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.19.4" }, - "time": "2024-03-17T08:10:35+00:00" + "time": "2024-09-29T15:01:53+00:00" }, { "name": "phar-io/manifest", @@ -6217,16 +6217,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.10.2", + "version": "3.10.3", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "86e5f5dd9a840c46810ebe5ff1885581c42a3017" + "reference": "62d32998e820bddc40f99f8251958aed187a5c9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/86e5f5dd9a840c46810ebe5ff1885581c42a3017", - "reference": "86e5f5dd9a840c46810ebe5ff1885581c42a3017", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/62d32998e820bddc40f99f8251958aed187a5c9c", + "reference": "62d32998e820bddc40f99f8251958aed187a5c9c", "shasum": "" }, "require": { @@ -6293,7 +6293,7 @@ "type": "open_collective" } ], - "time": "2024-07-21T23:26:44+00:00" + "time": "2024-09-18T10:38:58+00:00" }, { "name": "theseer/tokenizer", @@ -6393,15 +6393,15 @@ ], "aliases": [], "minimum-stability": "dev", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": true, "prefer-lowest": false, "platform": { "php": ">=7.0" }, - "platform-dev": [], + "platform-dev": {}, "platform-overrides": { "php": "7.3" }, - "plugin-api-version": "2.0.0" + "plugin-api-version": "2.6.0" } From b37afad9575ad3e9c3536c0bc919c7c62b392421 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 8 Oct 2024 20:27:26 +0530 Subject: [PATCH 0990/1044] Update images for v4.7.5 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- img-versions.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/img-versions.json b/img-versions.json index 5f3e07b5e..1f67b99fd 100644 --- a/img-versions.json +++ b/img-versions.json @@ -2,8 +2,8 @@ "easyengine/cron": "v4.7.3", "easyengine/mailhog": "v4.6.5", "easyengine/mariadb": "v4.6.6", - "easyengine/nginx-proxy": "v4.7.4", - "easyengine/nginx": "v4.7.3", + "easyengine/nginx-proxy": "v4.7.5", + "easyengine/nginx": "v4.7.5", "easyengine/php": "v4.6.6", "easyengine/php5.6": "v4.7.4", "easyengine/php7.0": "v4.7.4", @@ -11,9 +11,9 @@ "easyengine/php7.3": "v4.7.4", "easyengine/php7.4": "v4.7.4", "easyengine/php8.0": "v4.7.4", - "easyengine/php8.1": "v4.7.4", - "easyengine/php8.2": "v4.7.4", - "easyengine/php8.3": "v4.7.4", + "easyengine/php8.1": "v4.7.5", + "easyengine/php8.2": "v4.7.5", + "easyengine/php8.3": "v4.7.5", "easyengine/postfix": "v4.7.4", "easyengine/redis": "v4.7.3", "easyengine/newrelic-daemon": "v4.7.4" From 8e86ee7a6fc492dc43746616a2eb7b6247631e80 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 8 Oct 2024 20:31:58 +0530 Subject: [PATCH 0991/1044] Bump to version v4.7.5 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index b48b2de9d..70bc9a9f6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.7.4 +4.7.5 From cd44c0eb492506e1c80f810ea3e37e79bdd7df5b Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 8 Oct 2024 21:24:59 +0530 Subject: [PATCH 0992/1044] Add dealerdirect/phpcodesniffer-composer-installer to allowed plugins Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 2fe25355f..1630a9ae9 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,10 @@ "platform": { "php": "7.3" }, - "sort-packages": true + "sort-packages": true, + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true + } }, "minimum-stability": "dev", "prefer-stable": true, From 8f1f2f87b7b20298aebe9181c6b0bd3ba1b58e64 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 8 Oct 2024 21:52:10 +0530 Subject: [PATCH 0993/1044] Bump composer/composer from 2.2.23 to 2.2.24 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 2 +- composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index 1630a9ae9..1fbd753c6 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ "prefer-stable": true, "require": { "php": ">=7.0", - "composer/composer": "2.2.23", + "composer/composer": "2.2.24", "composer/semver": "3.2.4", "daverandom/libdns": "^2.0", "easyengine/admin-tools-command": "v1.1.0", diff --git a/composer.lock b/composer.lock index 713b8d246..f77468228 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": "5498938c77cc0c6c755fb80e2c8f4870", + "content-hash": "ce2e2a2e7458b61ca39039d4420bc51d", "packages": [ { "name": "acmephp/core", @@ -275,16 +275,16 @@ }, { "name": "composer/composer", - "version": "2.2.23", + "version": "2.2.24", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "d1542e89636abf422fde328cb28d53752efb69e5" + "reference": "91d9d38ebc274267f952ee1fd3892dc7962075f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/d1542e89636abf422fde328cb28d53752efb69e5", - "reference": "d1542e89636abf422fde328cb28d53752efb69e5", + "url": "https://api.github.com/repos/composer/composer/zipball/91d9d38ebc274267f952ee1fd3892dc7962075f4", + "reference": "91d9d38ebc274267f952ee1fd3892dc7962075f4", "shasum": "" }, "require": { @@ -354,7 +354,7 @@ "support": { "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/composer/issues", - "source": "https://github.com/composer/composer/tree/2.2.23" + "source": "https://github.com/composer/composer/tree/2.2.24" }, "funding": [ { @@ -370,7 +370,7 @@ "type": "tidelift" } ], - "time": "2024-02-08T14:08:53+00:00" + "time": "2024-06-10T20:51:52+00:00" }, { "name": "composer/metadata-minifier", From 96eeff848d49f7d63586d1881f7d850be6df2184 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 14 Oct 2024 17:47:15 +0530 Subject: [PATCH 0994/1044] Update phar on tag Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- .github/workflows/test_and_build.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index c386fb6d6..2868a7e50 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -172,8 +172,10 @@ jobs: deploy: #----------------------------------------------------------------------- name: Deploy Phar if: | - github.repository_owner == 'EasyEngine' && - (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master') + github.repository_owner == 'EasyEngine' && ( + startsWith(github.ref, 'refs/tags/') || + github.ref == 'refs/heads/develop' + ) runs-on: ubuntu-latest needs: [build, test] @@ -193,8 +195,8 @@ jobs: if: ${{ contains(github.ref, 'develop') }} run: | echo 'FILENAME=easyengine-nightly.phar' > $GITHUB_ENV - - name: Set file name for master branch - if: ${{ contains(github.ref, 'master') }} + - name: Set file name for tag + if: ${{ contains(github.ref, 'refs/tags') }} run: | echo 'FILENAME=easyengine.phar' > $GITHUB_ENV From 91dc0e5e0cfb37d960a0c184fc3a52221ce7bef7 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 14 Oct 2024 17:49:12 +0530 Subject: [PATCH 0995/1044] Fix update log typo Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- php/EE/Migration/SiteContainers.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/php/EE/Migration/SiteContainers.php b/php/EE/Migration/SiteContainers.php index 2d670bd45..f2b7e0e31 100644 --- a/php/EE/Migration/SiteContainers.php +++ b/php/EE/Migration/SiteContainers.php @@ -101,9 +101,9 @@ public static function is_site_service_image_changed( $updated_images, $site_inf */ public static function generate_site_docker_compose_file( $site_info, $site_object ) { $site_object->populate_site_info( $site_info['site_url'] ); - EE::debug( "Start generating news docker-compose.yml for ${site_info['site_url']}" ); + EE::debug( "Start generating new docker-compose.yml for ${site_info['site_url']}" ); $site_object->dump_docker_compose_yml( [ 'nohttps' => ! $site_info['site_ssl'] ] ); - EE::debug( "Complete generating news docker-compose.yml for ${site_info['site_url']}" ); + EE::debug( "Complete generating new docker-compose.yml for ${site_info['site_url']}" ); } /** From a679bcade4638ca53c38d70e4c443ed005152241 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Sat, 16 Nov 2024 13:05:22 +0530 Subject: [PATCH 0996/1044] Update composer packages for v4.7.6 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 4 +-- composer.lock | 88 +++++++++++++++++++++++++-------------------------- 2 files changed, 46 insertions(+), 46 deletions(-) diff --git a/composer.json b/composer.json index 1fbd753c6..be837dd74 100644 --- a/composer.json +++ b/composer.json @@ -38,10 +38,10 @@ "easyengine/log-command": "v1.1.0", "easyengine/mailhog-command": "v1.0.3", "easyengine/service-command": "v1.6.1", - "easyengine/shell-command": "v1.1.2", + "easyengine/shell-command": "v1.1.3", "easyengine/site-command": "v3.3.2", "easyengine/site-type-php": "v1.8.1", - "easyengine/site-type-wp": "v1.8.1", + "easyengine/site-type-wp": "v1.8.2", "monolog/monolog": "1.24.0", "mustache/mustache": "2.14.1", "rmccue/requests": "1.8.0", diff --git a/composer.lock b/composer.lock index f77468228..22d95aa39 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": "ce2e2a2e7458b61ca39039d4420bc51d", + "content-hash": "a0168e236930fe62a520abf5a41ec6b2", "packages": [ { "name": "acmephp/core", @@ -199,16 +199,16 @@ }, { "name": "composer/ca-bundle", - "version": "1.5.2", + "version": "1.5.3", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "48a792895a2b7a6ee65dd5442c299d7b835b6137" + "reference": "3b1fc3f0be055baa7c6258b1467849c3e8204eb2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/48a792895a2b7a6ee65dd5442c299d7b835b6137", - "reference": "48a792895a2b7a6ee65dd5442c299d7b835b6137", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/3b1fc3f0be055baa7c6258b1467849c3e8204eb2", + "reference": "3b1fc3f0be055baa7c6258b1467849c3e8204eb2", "shasum": "" }, "require": { @@ -255,7 +255,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.5.2" + "source": "https://github.com/composer/ca-bundle/tree/1.5.3" }, "funding": [ { @@ -271,7 +271,7 @@ "type": "tidelift" } ], - "time": "2024-09-25T07:49:53+00:00" + "time": "2024-11-04T10:15:26+00:00" }, { "name": "composer/composer", @@ -1117,16 +1117,16 @@ }, { "name": "easyengine/shell-command", - "version": "v1.1.2", + "version": "v1.1.3", "source": { "type": "git", "url": "https://github.com/EasyEngine/shell-command.git", - "reference": "e7676ed2939435354c2c176489e6ba1628561f49" + "reference": "e16751f54ae98ac2d43d54add02fa8befd568f9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/shell-command/zipball/e7676ed2939435354c2c176489e6ba1628561f49", - "reference": "e7676ed2939435354c2c176489e6ba1628561f49", + "url": "https://api.github.com/repos/EasyEngine/shell-command/zipball/e16751f54ae98ac2d43d54add02fa8befd568f9c", + "reference": "e16751f54ae98ac2d43d54add02fa8befd568f9c", "shasum": "" }, "type": "ee-cli-package", @@ -1155,9 +1155,9 @@ "homepage": "https://github.com/easyengine/shell-command", "support": { "issues": "https://github.com/EasyEngine/shell-command/issues", - "source": "https://github.com/EasyEngine/shell-command/tree/v1.1.2" + "source": "https://github.com/EasyEngine/shell-command/tree/v1.1.3" }, - "time": "2024-10-08T14:45:56+00:00" + "time": "2024-11-16T07:30:59+00:00" }, { "name": "easyengine/site-command", @@ -1296,16 +1296,16 @@ }, { "name": "easyengine/site-type-wp", - "version": "v1.8.1", + "version": "v1.8.2", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-wp.git", - "reference": "9a38a3ee9d62dd4988f28ab3fd4d1b8bbbbb0218" + "reference": "aa429e3777e5c0a37a21fe5d3eab98eb8f625ac7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/9a38a3ee9d62dd4988f28ab3fd4d1b8bbbbb0218", - "reference": "9a38a3ee9d62dd4988f28ab3fd4d1b8bbbbb0218", + "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/aa429e3777e5c0a37a21fe5d3eab98eb8f625ac7", + "reference": "aa429e3777e5c0a37a21fe5d3eab98eb8f625ac7", "shasum": "" }, "require-dev": { @@ -1349,9 +1349,9 @@ "homepage": "https://github.com/easyengine/site-type-wp", "support": { "issues": "https://github.com/EasyEngine/site-type-wp/issues", - "source": "https://github.com/EasyEngine/site-type-wp/tree/v1.8.1" + "source": "https://github.com/EasyEngine/site-type-wp/tree/v1.8.2" }, - "time": "2024-10-08T14:53:03+00:00" + "time": "2024-11-16T07:31:39+00:00" }, { "name": "guzzlehttp/guzzle", @@ -1481,16 +1481,16 @@ }, { "name": "guzzlehttp/promises", - "version": "2.0.3", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "6ea8dd08867a2a42619d65c3deb2c0fcbf81c8f8" + "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/6ea8dd08867a2a42619d65c3deb2c0fcbf81c8f8", - "reference": "6ea8dd08867a2a42619d65c3deb2c0fcbf81c8f8", + "url": "https://api.github.com/repos/guzzle/promises/zipball/f9c436286ab2892c7db7be8c8da4ef61ccf7b455", + "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455", "shasum": "" }, "require": { @@ -1544,7 +1544,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/2.0.3" + "source": "https://github.com/guzzle/promises/tree/2.0.4" }, "funding": [ { @@ -1560,7 +1560,7 @@ "type": "tidelift" } ], - "time": "2024-07-18T10:29:17+00:00" + "time": "2024-10-17T10:06:22+00:00" }, { "name": "guzzlehttp/psr7", @@ -4290,25 +4290,25 @@ }, { "name": "behat/gherkin", - "version": "v4.9.0", + "version": "v4.10.0", "source": { "type": "git", "url": "https://github.com/Behat/Gherkin.git", - "reference": "0bc8d1e30e96183e4f36db9dc79caead300beff4" + "reference": "cbb83c4c435dd8d05a161f2a5ae322e61b2f4db6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Behat/Gherkin/zipball/0bc8d1e30e96183e4f36db9dc79caead300beff4", - "reference": "0bc8d1e30e96183e4f36db9dc79caead300beff4", + "url": "https://api.github.com/repos/Behat/Gherkin/zipball/cbb83c4c435dd8d05a161f2a5ae322e61b2f4db6", + "reference": "cbb83c4c435dd8d05a161f2a5ae322e61b2f4db6", "shasum": "" }, "require": { "php": "~7.2|~8.0" }, "require-dev": { - "cucumber/cucumber": "dev-gherkin-22.0.0", + "cucumber/cucumber": "dev-gherkin-24.1.0", "phpunit/phpunit": "~8|~9", - "symfony/yaml": "~3|~4|~5" + "symfony/yaml": "~3|~4|~5|~6|~7" }, "suggest": { "symfony/yaml": "If you want to parse features, represented in YAML files" @@ -4347,9 +4347,9 @@ ], "support": { "issues": "https://github.com/Behat/Gherkin/issues", - "source": "https://github.com/Behat/Gherkin/tree/v4.9.0" + "source": "https://github.com/Behat/Gherkin/tree/v4.10.0" }, - "time": "2021-10-12T13:05:09+00:00" + "time": "2024-10-19T14:46:06+00:00" }, { "name": "behat/transliterator", @@ -4542,16 +4542,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.12.0", + "version": "1.12.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c" + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", - "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/123267b2c49fbf30d78a7b2d333f6be754b94845", + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845", "shasum": "" }, "require": { @@ -4590,7 +4590,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.12.0" + "source": "https://github.com/myclabs/DeepCopy/tree/1.12.1" }, "funding": [ { @@ -4598,7 +4598,7 @@ "type": "tidelift" } ], - "time": "2024-06-12T14:39:25+00:00" + "time": "2024-11-08T17:47:46+00:00" }, { "name": "nikic/php-parser", @@ -6217,16 +6217,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.10.3", + "version": "3.11.0", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "62d32998e820bddc40f99f8251958aed187a5c9c" + "reference": "70c08f8d20c0eb4fe56f26644dd94dae76a7f450" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/62d32998e820bddc40f99f8251958aed187a5c9c", - "reference": "62d32998e820bddc40f99f8251958aed187a5c9c", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/70c08f8d20c0eb4fe56f26644dd94dae76a7f450", + "reference": "70c08f8d20c0eb4fe56f26644dd94dae76a7f450", "shasum": "" }, "require": { @@ -6293,7 +6293,7 @@ "type": "open_collective" } ], - "time": "2024-09-18T10:38:58+00:00" + "time": "2024-11-12T09:53:29+00:00" }, { "name": "theseer/tokenizer", From 0543f29bd22a3c6da6b03525080e28b7340662ed Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Sat, 16 Nov 2024 13:05:36 +0530 Subject: [PATCH 0997/1044] Update images for v4.7.6 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- img-versions.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/img-versions.json b/img-versions.json index 1f67b99fd..e99f80daf 100644 --- a/img-versions.json +++ b/img-versions.json @@ -2,8 +2,8 @@ "easyengine/cron": "v4.7.3", "easyengine/mailhog": "v4.6.5", "easyengine/mariadb": "v4.6.6", - "easyengine/nginx-proxy": "v4.7.5", - "easyengine/nginx": "v4.7.5", + "easyengine/nginx-proxy": "v4.7.6", + "easyengine/nginx": "v4.7.6", "easyengine/php": "v4.6.6", "easyengine/php5.6": "v4.7.4", "easyengine/php7.0": "v4.7.4", @@ -12,9 +12,9 @@ "easyengine/php7.4": "v4.7.4", "easyengine/php8.0": "v4.7.4", "easyengine/php8.1": "v4.7.5", - "easyengine/php8.2": "v4.7.5", - "easyengine/php8.3": "v4.7.5", + "easyengine/php8.2": "v4.7.6", + "easyengine/php8.3": "v4.7.6", "easyengine/postfix": "v4.7.4", - "easyengine/redis": "v4.7.3", + "easyengine/redis": "v4.7.6", "easyengine/newrelic-daemon": "v4.7.4" } From d21ca79337e4db896ef158aca21d602e94764c9f Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Sat, 16 Nov 2024 15:21:10 +0530 Subject: [PATCH 0998/1044] Bump to version v4.7.6 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 70bc9a9f6..546080495 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.7.5 +4.7.6 From 7c9e8eacea4549ec1d82c5cd23283df9fe97c81a Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 25 Nov 2024 22:57:44 +0530 Subject: [PATCH 0999/1044] Update download-artifact to v4 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- .github/workflows/test_and_build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index a6cdb097f..9bc2b5703 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -187,7 +187,7 @@ jobs: token: ${{ secrets.BOT_TOKEN }} - name: Download built Phar file - uses: actions/download-artifact@v4.1.7 + uses: actions/download-artifact@v4 with: name: easyengine-phar @@ -240,7 +240,7 @@ jobs: uses: actions/checkout@v3 - name: Download built Phar file - uses: actions/download-artifact@v4.1.7 + uses: actions/download-artifact@v4 with: name: easyengine-phar From 2a2440492d20913992ac81b4feb59179cb026c13 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 26 Nov 2024 12:28:19 +0530 Subject: [PATCH 1000/1044] Update phar build to use 8.3 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- .github/workflows/test_and_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index 9bc2b5703..1866a75ba 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -22,7 +22,7 @@ jobs: - name: Set up PHP uses: shivammathur/setup-php@v2 with: - php-version: '7.4' + php-version: '8.3' coverage: none tools: composer extensions: pcntl, curl, sqlite3, zip, dom, mbstring, json From 6c9914895b290e98779d24d47bdb40c8edb0ae9c Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 26 Nov 2024 12:29:15 +0530 Subject: [PATCH 1001/1044] Add PHP 8.4 for testing EE Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- .github/workflows/test_and_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index 1866a75ba..93b9714d7 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -92,7 +92,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3'] + php: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4'] steps: - name: Check out source code uses: actions/checkout@v3 From 3377ad2856ff99d9e0ec7efcb3853b98980773ae Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 26 Nov 2024 14:39:02 +0530 Subject: [PATCH 1002/1044] Add PHP 8.4 and update stack Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- img-versions.json | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/img-versions.json b/img-versions.json index e99f80daf..7a4cadefc 100644 --- a/img-versions.json +++ b/img-versions.json @@ -2,7 +2,7 @@ "easyengine/cron": "v4.7.3", "easyengine/mailhog": "v4.6.5", "easyengine/mariadb": "v4.6.6", - "easyengine/nginx-proxy": "v4.7.6", + "easyengine/nginx-proxy": "v4.8.0", "easyengine/nginx": "v4.7.6", "easyengine/php": "v4.6.6", "easyengine/php5.6": "v4.7.4", @@ -10,11 +10,12 @@ "easyengine/php7.2": "v4.7.4", "easyengine/php7.3": "v4.7.4", "easyengine/php7.4": "v4.7.4", - "easyengine/php8.0": "v4.7.4", - "easyengine/php8.1": "v4.7.5", - "easyengine/php8.2": "v4.7.6", - "easyengine/php8.3": "v4.7.6", - "easyengine/postfix": "v4.7.4", + "easyengine/php8.0": "v4.8.0", + "easyengine/php8.1": "v4.8.0", + "easyengine/php8.2": "v4.8.0", + "easyengine/php8.3": "v4.8.0", + "easyengine/php8.4": "v4.8.0", + "easyengine/postfix": "v4.8.0", "easyengine/redis": "v4.7.6", "easyengine/newrelic-daemon": "v4.7.4" } From 7f5992c3441ba7d6edfbd922735055372f1d165b Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 26 Nov 2024 14:39:18 +0530 Subject: [PATCH 1003/1044] Update composer packages for v4.8.0 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 6 +++--- composer.lock | 48 ++++++++++++++++++++++++------------------------ 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/composer.json b/composer.json index be837dd74..7c0238ea3 100644 --- a/composer.json +++ b/composer.json @@ -39,9 +39,9 @@ "easyengine/mailhog-command": "v1.0.3", "easyengine/service-command": "v1.6.1", "easyengine/shell-command": "v1.1.3", - "easyengine/site-command": "v3.3.2", - "easyengine/site-type-php": "v1.8.1", - "easyengine/site-type-wp": "v1.8.2", + "easyengine/site-command": "v3.3.3", + "easyengine/site-type-php": "v1.9.0", + "easyengine/site-type-wp": "v1.9.0", "monolog/monolog": "1.24.0", "mustache/mustache": "2.14.1", "rmccue/requests": "1.8.0", diff --git a/composer.lock b/composer.lock index 22d95aa39..5a96e5e18 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": "a0168e236930fe62a520abf5a41ec6b2", + "content-hash": "b8c6daceccead49d779e0d125186376e", "packages": [ { "name": "acmephp/core", @@ -1161,16 +1161,16 @@ }, { "name": "easyengine/site-command", - "version": "v3.3.2", + "version": "v3.3.3", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "ee76accecff64a189c54860ab48950151125653b" + "reference": "d930519cc0ad6c9fe81bd17f23692e9f2830feb2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/ee76accecff64a189c54860ab48950151125653b", - "reference": "ee76accecff64a189c54860ab48950151125653b", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/d930519cc0ad6c9fe81bd17f23692e9f2830feb2", + "reference": "d930519cc0ad6c9fe81bd17f23692e9f2830feb2", "shasum": "" }, "require": { @@ -1231,22 +1231,22 @@ "homepage": "https://github.com/easyengine/site-command", "support": { "issues": "https://github.com/EasyEngine/site-command/issues", - "source": "https://github.com/EasyEngine/site-command/tree/v3.3.2" + "source": "https://github.com/EasyEngine/site-command/tree/v3.3.3" }, - "time": "2024-10-08T14:49:57+00:00" + "time": "2024-11-26T09:06:35+00:00" }, { "name": "easyengine/site-type-php", - "version": "v1.8.1", + "version": "v1.9.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-php.git", - "reference": "f7ffa594add367df04850bc1b9a46dc857d00c91" + "reference": "7a38595e198650a2091c1497e3ce54c5c5485587" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/f7ffa594add367df04850bc1b9a46dc857d00c91", - "reference": "f7ffa594add367df04850bc1b9a46dc857d00c91", + "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/7a38595e198650a2091c1497e3ce54c5c5485587", + "reference": "7a38595e198650a2091c1497e3ce54c5c5485587", "shasum": "" }, "require-dev": { @@ -1290,22 +1290,22 @@ "homepage": "https://github.com/easyengine/site-type-php", "support": { "issues": "https://github.com/EasyEngine/site-type-php/issues", - "source": "https://github.com/EasyEngine/site-type-php/tree/v1.8.1" + "source": "https://github.com/EasyEngine/site-type-php/tree/v1.9.0" }, - "time": "2024-10-08T14:52:50+00:00" + "time": "2024-11-26T08:38:27+00:00" }, { "name": "easyengine/site-type-wp", - "version": "v1.8.2", + "version": "v1.9.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-wp.git", - "reference": "aa429e3777e5c0a37a21fe5d3eab98eb8f625ac7" + "reference": "afcba8ca7429f6a8dc4db608c5acab36921a1193" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/aa429e3777e5c0a37a21fe5d3eab98eb8f625ac7", - "reference": "aa429e3777e5c0a37a21fe5d3eab98eb8f625ac7", + "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/afcba8ca7429f6a8dc4db608c5acab36921a1193", + "reference": "afcba8ca7429f6a8dc4db608c5acab36921a1193", "shasum": "" }, "require-dev": { @@ -1349,9 +1349,9 @@ "homepage": "https://github.com/easyengine/site-type-wp", "support": { "issues": "https://github.com/EasyEngine/site-type-wp/issues", - "source": "https://github.com/EasyEngine/site-type-wp/tree/v1.8.2" + "source": "https://github.com/EasyEngine/site-type-wp/tree/v1.9.0" }, - "time": "2024-11-16T07:31:39+00:00" + "time": "2024-11-26T08:38:22+00:00" }, { "name": "guzzlehttp/guzzle", @@ -6217,16 +6217,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.11.0", + "version": "3.11.1", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "70c08f8d20c0eb4fe56f26644dd94dae76a7f450" + "reference": "19473c30efe4f7b3cd42522d0b2e6e7f243c6f87" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/70c08f8d20c0eb4fe56f26644dd94dae76a7f450", - "reference": "70c08f8d20c0eb4fe56f26644dd94dae76a7f450", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/19473c30efe4f7b3cd42522d0b2e6e7f243c6f87", + "reference": "19473c30efe4f7b3cd42522d0b2e6e7f243c6f87", "shasum": "" }, "require": { @@ -6293,7 +6293,7 @@ "type": "open_collective" } ], - "time": "2024-11-12T09:53:29+00:00" + "time": "2024-11-16T12:02:36+00:00" }, { "name": "theseer/tokenizer", From 6abd6188d0e0cbe2c2ce0f84067626155bbf7935 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 26 Nov 2024 14:39:32 +0530 Subject: [PATCH 1004/1044] Bump to version v4.8.0 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 546080495..88f181192 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.7.6 +4.8.0 From a737264508f45273f6ece82e6b9b5082a5308d88 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Tue, 26 Nov 2024 14:43:41 +0530 Subject: [PATCH 1005/1044] Update upload artifact to v4 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- .github/workflows/test_and_build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index 9bc2b5703..86533d83b 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -68,7 +68,7 @@ jobs: - name: Upload EE version - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: cli_version path: VERSION @@ -80,7 +80,7 @@ jobs: run: sudo ./easyengine.phar cli info - name: Upload built Phar file - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: easyengine-phar path: easyengine.phar From 2c6f9ae61c4c4cbc8d9aa03fe25b66e7ea839093 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 13 Feb 2025 16:54:54 +0530 Subject: [PATCH 1006/1044] Add network cleanup post update Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- php/EE/Migration/Containers.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index cd64b3929..aee32e6e0 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -108,7 +108,7 @@ public static function save_upgraded_image_versions( $current_versions, $new_ver self::$rsp->add_step( 'prune-old-docker-images', - 'EE\Migration\Containers::image_cleanup', + 'EE\Migration\Containers::docker_cleanup', null, null, null @@ -119,8 +119,9 @@ public static function save_upgraded_image_versions( $current_versions, $new_ver /** * Prune old and extra EE Docker images. */ - public static function image_cleanup() { + public static function docker_cleanup() { EE::exec( 'docker image prune -af --filter=label=org.label-schema.vendor="EasyEngine"' ); + EE::exec( 'docker network prune -f --filter=label=org.label-schema.vendor="EasyEngine"' ); } /** From af6aa4a9536e87cc5ced9d72b9f2c3fe00eeadad Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 13 Feb 2025 17:24:54 +0530 Subject: [PATCH 1007/1044] Skip download of 8.4 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- php/EE/Migration/Containers.php | 1 + 1 file changed, 1 insertion(+) diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index aee32e6e0..70101a0ca 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -38,6 +38,7 @@ public static function start_container_migration() { 'easyengine/php8.1', 'easyengine/php8.2', 'easyengine/php8.3', + 'easyengine/php8.4', 'easyengine/newrelic-daemon', ]; From 3694a532a4964090cd040a43982179a10b86c9f0 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 13 Feb 2025 17:25:15 +0530 Subject: [PATCH 1008/1044] Update images for v4.8.1 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- img-versions.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/img-versions.json b/img-versions.json index 7a4cadefc..fa334a567 100644 --- a/img-versions.json +++ b/img-versions.json @@ -1,8 +1,8 @@ { - "easyengine/cron": "v4.7.3", + "easyengine/cron": "v4.8.1", "easyengine/mailhog": "v4.6.5", "easyengine/mariadb": "v4.6.6", - "easyengine/nginx-proxy": "v4.8.0", + "easyengine/nginx-proxy": "v4.8.1", "easyengine/nginx": "v4.7.6", "easyengine/php": "v4.6.6", "easyengine/php5.6": "v4.7.4", @@ -10,12 +10,12 @@ "easyengine/php7.2": "v4.7.4", "easyengine/php7.3": "v4.7.4", "easyengine/php7.4": "v4.7.4", - "easyengine/php8.0": "v4.8.0", - "easyengine/php8.1": "v4.8.0", - "easyengine/php8.2": "v4.8.0", - "easyengine/php8.3": "v4.8.0", + "easyengine/php8.0": "v4.8.1", + "easyengine/php8.1": "v4.8.1", + "easyengine/php8.2": "v4.8.1", + "easyengine/php8.3": "v4.8.1", "easyengine/php8.4": "v4.8.0", - "easyengine/postfix": "v4.8.0", - "easyengine/redis": "v4.7.6", - "easyengine/newrelic-daemon": "v4.7.4" + "easyengine/postfix": "v4.8.1", + "easyengine/redis": "v4.8.1", + "easyengine/newrelic-daemon": "v4.8.1" } From a2f8ce26366d35e9abe0aeac17c8acbe6ab18e24 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 13 Feb 2025 17:25:27 +0530 Subject: [PATCH 1009/1044] Update composer packages for v4.8.1 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 8 +- composer.lock | 278 +++++++++++++++++++++++++------------------------- 2 files changed, 145 insertions(+), 141 deletions(-) diff --git a/composer.json b/composer.json index 7c0238ea3..bb7dd6be5 100644 --- a/composer.json +++ b/composer.json @@ -39,9 +39,9 @@ "easyengine/mailhog-command": "v1.0.3", "easyengine/service-command": "v1.6.1", "easyengine/shell-command": "v1.1.3", - "easyengine/site-command": "v3.3.3", - "easyengine/site-type-php": "v1.9.0", - "easyengine/site-type-wp": "v1.9.0", + "easyengine/site-command": "v3.3.5", + "easyengine/site-type-php": "v1.9.1", + "easyengine/site-type-wp": "v1.9.1", "monolog/monolog": "1.24.0", "mustache/mustache": "2.14.1", "rmccue/requests": "1.8.0", @@ -52,7 +52,7 @@ "symfony/event-dispatcher": "4.4.*", "symfony/filesystem": "4.4.*", "symfony/finder": "4.4.*", - "symfony/process": "4.4.*", + "symfony/process": "5.4.*", "symfony/translation": "4.4.*", "symfony/yaml": "4.4.*", "wp-cli/mustangostang-spyc": "0.6.3", diff --git a/composer.lock b/composer.lock index 5a96e5e18..2c71f191b 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": "b8c6daceccead49d779e0d125186376e", + "content-hash": "7d5f761634519e35800eec5c52544c5c", "packages": [ { "name": "acmephp/core", @@ -151,16 +151,16 @@ }, { "name": "cloudflare/sdk", - "version": "1.3.0", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/cloudflare/cloudflare-php.git", - "reference": "fdfc656aa8b78016f4722acec30b54136c027d8e" + "reference": "2d3f198773e865b5de2357d7bdbc52bdf42e8f97" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cloudflare/cloudflare-php/zipball/fdfc656aa8b78016f4722acec30b54136c027d8e", - "reference": "fdfc656aa8b78016f4722acec30b54136c027d8e", + "url": "https://api.github.com/repos/cloudflare/cloudflare-php/zipball/2d3f198773e865b5de2357d7bdbc52bdf42e8f97", + "reference": "2d3f198773e865b5de2357d7bdbc52bdf42e8f97", "shasum": "" }, "require": { @@ -193,22 +193,22 @@ "description": "PHP binding for v4 of the Cloudflare Client API.", "support": { "issues": "https://github.com/cloudflare/cloudflare-php/issues", - "source": "https://github.com/cloudflare/cloudflare-php/tree/1.3.0" + "source": "https://github.com/cloudflare/cloudflare-php/tree/1.4.0" }, - "time": "2021-10-13T03:40:33+00:00" + "time": "2024-12-17T23:18:20+00:00" }, { "name": "composer/ca-bundle", - "version": "1.5.3", + "version": "1.5.5", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "3b1fc3f0be055baa7c6258b1467849c3e8204eb2" + "reference": "08c50d5ec4c6ced7d0271d2862dec8c1033283e6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/3b1fc3f0be055baa7c6258b1467849c3e8204eb2", - "reference": "3b1fc3f0be055baa7c6258b1467849c3e8204eb2", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/08c50d5ec4c6ced7d0271d2862dec8c1033283e6", + "reference": "08c50d5ec4c6ced7d0271d2862dec8c1033283e6", "shasum": "" }, "require": { @@ -255,7 +255,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.5.3" + "source": "https://github.com/composer/ca-bundle/tree/1.5.5" }, "funding": [ { @@ -271,7 +271,7 @@ "type": "tidelift" } ], - "time": "2024-11-04T10:15:26+00:00" + "time": "2025-01-08T16:17:16+00:00" }, { "name": "composer/composer", @@ -799,15 +799,15 @@ }, "type": "ee-cli-package", "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - }, "bundled": true, "commands": [ "admin-tools", "admin-tools enable", "admin-tools disable" - ] + ], + "branch-alias": { + "dev-master": "1.x-dev" + } }, "autoload": { "files": [ @@ -845,9 +845,6 @@ }, "type": "ee-cli-package", "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - }, "bundled": true, "commands": [ "auth", @@ -855,7 +852,10 @@ "auth delete", "auth list", "auth update" - ] + ], + "branch-alias": { + "dev-master": "1.x-dev" + } }, "autoload": { "files": [ @@ -895,15 +895,15 @@ }, "type": "ee-cli-package", "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - }, "bundled": true, "commands": [ "config", "config set", "config get" - ] + ], + "branch-alias": { + "dev-master": "1.x-dev" + } }, "autoload": { "files": [ @@ -941,9 +941,6 @@ }, "type": "ee-cli-package", "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - }, "bundled": true, "commands": [ "cron", @@ -952,7 +949,10 @@ "cron update", "cron list", "cron run-now" - ] + ], + "branch-alias": { + "dev-master": "1.x-dev" + } }, "autoload": { "files": [ @@ -992,13 +992,13 @@ }, "type": "ee-cli-package", "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - }, "bundled": true, "commands": [ "log show" - ] + ], + "branch-alias": { + "dev-master": "1.x-dev" + } }, "autoload": { "files": [ @@ -1035,16 +1035,16 @@ }, "type": "ee-cli-package", "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - }, "bundled": true, "commands": [ "mailhog", "mailhog enable", "mailhog disable", "mailhog status" - ] + ], + "branch-alias": { + "dev-master": "1.x-dev" + } }, "autoload": { "files": [ @@ -1082,9 +1082,6 @@ }, "type": "ee-cli-package", "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - }, "bundled": true, "commands": [ "service", @@ -1092,7 +1089,10 @@ "service disable", "service restart", "service reload" - ] + ], + "branch-alias": { + "dev-master": "1.x-dev" + } }, "autoload": { "files": [ @@ -1131,13 +1131,13 @@ }, "type": "ee-cli-package", "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - }, "bundled": true, "commands": [ "shell" - ] + ], + "branch-alias": { + "dev-master": "1.x-dev" + } }, "autoload": { "files": [ @@ -1161,16 +1161,16 @@ }, { "name": "easyengine/site-command", - "version": "v3.3.3", + "version": "v3.3.5", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "d930519cc0ad6c9fe81bd17f23692e9f2830feb2" + "reference": "8f509d82070909636101e1e41b72581e2b71cef3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/d930519cc0ad6c9fe81bd17f23692e9f2830feb2", - "reference": "d930519cc0ad6c9fe81bd17f23692e9f2830feb2", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/8f509d82070909636101e1e41b72581e2b71cef3", + "reference": "8f509d82070909636101e1e41b72581e2b71cef3", "shasum": "" }, "require": { @@ -1184,9 +1184,6 @@ }, "type": "ee-cli-package", "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - }, "bundled": true, "commands": [ "site create --type=html", @@ -1202,7 +1199,10 @@ "site restart --type=html", "site share", "site clean" - ] + ], + "branch-alias": { + "dev-master": "1.x-dev" + } }, "autoload": { "files": [ @@ -1231,22 +1231,22 @@ "homepage": "https://github.com/easyengine/site-command", "support": { "issues": "https://github.com/EasyEngine/site-command/issues", - "source": "https://github.com/EasyEngine/site-command/tree/v3.3.3" + "source": "https://github.com/EasyEngine/site-command/tree/v3.3.5" }, - "time": "2024-11-26T09:06:35+00:00" + "time": "2025-02-13T11:47:17+00:00" }, { "name": "easyengine/site-type-php", - "version": "v1.9.0", + "version": "v1.9.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-php.git", - "reference": "7a38595e198650a2091c1497e3ce54c5c5485587" + "reference": "523df86ffc70b29b8c93aa9a88002bf53334d887" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/7a38595e198650a2091c1497e3ce54c5c5485587", - "reference": "7a38595e198650a2091c1497e3ce54c5c5485587", + "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/523df86ffc70b29b8c93aa9a88002bf53334d887", + "reference": "523df86ffc70b29b8c93aa9a88002bf53334d887", "shasum": "" }, "require-dev": { @@ -1254,9 +1254,6 @@ }, "type": "ee-cli-package", "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - }, "bundled": true, "commands": [ "site create --type=php", @@ -1272,7 +1269,10 @@ "site restart --type=php", "site share", "site clean" - ] + ], + "branch-alias": { + "dev-master": "1.x-dev" + } }, "autoload": { "files": [ @@ -1290,22 +1290,22 @@ "homepage": "https://github.com/easyengine/site-type-php", "support": { "issues": "https://github.com/EasyEngine/site-type-php/issues", - "source": "https://github.com/EasyEngine/site-type-php/tree/v1.9.0" + "source": "https://github.com/EasyEngine/site-type-php/tree/v1.9.1" }, - "time": "2024-11-26T08:38:27+00:00" + "time": "2025-02-13T11:48:36+00:00" }, { "name": "easyengine/site-type-wp", - "version": "v1.9.0", + "version": "v1.9.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-wp.git", - "reference": "afcba8ca7429f6a8dc4db608c5acab36921a1193" + "reference": "f95ab4c2f1d6c38fb7a61f24825ec9aac405d4cc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/afcba8ca7429f6a8dc4db608c5acab36921a1193", - "reference": "afcba8ca7429f6a8dc4db608c5acab36921a1193", + "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/f95ab4c2f1d6c38fb7a61f24825ec9aac405d4cc", + "reference": "f95ab4c2f1d6c38fb7a61f24825ec9aac405d4cc", "shasum": "" }, "require-dev": { @@ -1313,9 +1313,6 @@ }, "type": "ee-cli-package", "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - }, "bundled": true, "commands": [ "site create --type=wp", @@ -1331,7 +1328,10 @@ "site restart --type=wp", "site share", "site clean" - ] + ], + "branch-alias": { + "dev-master": "1.x-dev" + } }, "autoload": { "files": [ @@ -1349,9 +1349,9 @@ "homepage": "https://github.com/easyengine/site-type-wp", "support": { "issues": "https://github.com/EasyEngine/site-type-wp/issues", - "source": "https://github.com/EasyEngine/site-type-wp/tree/v1.9.0" + "source": "https://github.com/EasyEngine/site-type-wp/tree/v1.9.1" }, - "time": "2024-11-26T08:38:22+00:00" + "time": "2025-02-13T11:48:15+00:00" }, { "name": "guzzlehttp/guzzle", @@ -2830,16 +2830,16 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v2.5.3", + "version": "v2.5.4", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "80d075412b557d41002320b96a096ca65aa2c98d" + "reference": "605389f2a7e5625f273b53960dc46aeaf9c62918" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/80d075412b557d41002320b96a096ca65aa2c98d", - "reference": "80d075412b557d41002320b96a096ca65aa2c98d", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/605389f2a7e5625f273b53960dc46aeaf9c62918", + "reference": "605389f2a7e5625f273b53960dc46aeaf9c62918", "shasum": "" }, "require": { @@ -2847,12 +2847,12 @@ }, "type": "library", "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, "branch-alias": { "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -2877,7 +2877,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.3" + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.4" }, "funding": [ { @@ -2893,7 +2893,7 @@ "type": "tidelift" } ], - "time": "2023-01-24T14:02:46+00:00" + "time": "2024-09-25T14:11:13+00:00" }, { "name": "symfony/event-dispatcher", @@ -3002,12 +3002,12 @@ }, "type": "library", "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, "branch-alias": { "dev-main": "1.1-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -3209,8 +3209,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -3288,8 +3288,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -3362,8 +3362,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -3438,8 +3438,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -3518,8 +3518,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -3576,20 +3576,20 @@ }, { "name": "symfony/process", - "version": "v4.4.44", + "version": "v5.4.47", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "5cee9cdc4f7805e2699d9fd66991a0e6df8252a2" + "reference": "5d1662fb32ebc94f17ddb8d635454a776066733d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/5cee9cdc4f7805e2699d9fd66991a0e6df8252a2", - "reference": "5cee9cdc4f7805e2699d9fd66991a0e6df8252a2", + "url": "https://api.github.com/repos/symfony/process/zipball/5d1662fb32ebc94f17ddb8d635454a776066733d", + "reference": "5d1662fb32ebc94f17ddb8d635454a776066733d", "shasum": "" }, "require": { - "php": ">=7.1.3", + "php": ">=7.2.5", "symfony/polyfill-php80": "^1.16" }, "type": "library", @@ -3618,7 +3618,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v4.4.44" + "source": "https://github.com/symfony/process/tree/v5.4.47" }, "funding": [ { @@ -3634,7 +3634,7 @@ "type": "tidelift" } ], - "time": "2022-06-27T13:16:42+00:00" + "time": "2024-11-06T11:36:42+00:00" }, { "name": "symfony/serializer", @@ -3720,16 +3720,16 @@ }, { "name": "symfony/service-contracts", - "version": "v2.5.3", + "version": "v2.5.4", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "a2329596ddc8fd568900e3fc76cba42489ecc7f3" + "reference": "f37b419f7aea2e9abf10abd261832cace12e3300" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/a2329596ddc8fd568900e3fc76cba42489ecc7f3", - "reference": "a2329596ddc8fd568900e3fc76cba42489ecc7f3", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/f37b419f7aea2e9abf10abd261832cace12e3300", + "reference": "f37b419f7aea2e9abf10abd261832cace12e3300", "shasum": "" }, "require": { @@ -3745,12 +3745,12 @@ }, "type": "library", "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, "branch-alias": { "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -3783,7 +3783,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v2.5.3" + "source": "https://github.com/symfony/service-contracts/tree/v2.5.4" }, "funding": [ { @@ -3799,7 +3799,7 @@ "type": "tidelift" } ], - "time": "2023-04-21T15:04:16+00:00" + "time": "2024-09-25T14:11:13+00:00" }, { "name": "symfony/translation", @@ -3892,16 +3892,16 @@ }, { "name": "symfony/translation-contracts", - "version": "v2.5.3", + "version": "v2.5.4", "source": { "type": "git", "url": "https://github.com/symfony/translation-contracts.git", - "reference": "b0073a77ac0b7ea55131020e87b1e3af540f4664" + "reference": "450d4172653f38818657022252f9d81be89ee9a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/b0073a77ac0b7ea55131020e87b1e3af540f4664", - "reference": "b0073a77ac0b7ea55131020e87b1e3af540f4664", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/450d4172653f38818657022252f9d81be89ee9a8", + "reference": "450d4172653f38818657022252f9d81be89ee9a8", "shasum": "" }, "require": { @@ -3912,12 +3912,12 @@ }, "type": "library", "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, "branch-alias": { "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -3950,7 +3950,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/translation-contracts/tree/v2.5.3" + "source": "https://github.com/symfony/translation-contracts/tree/v2.5.4" }, "funding": [ { @@ -3966,7 +3966,7 @@ "type": "tidelift" } ], - "time": "2024-01-23T13:51:25+00:00" + "time": "2024-09-25T14:11:13+00:00" }, { "name": "symfony/yaml", @@ -4542,16 +4542,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.12.1", + "version": "1.13.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845" + "reference": "024473a478be9df5fdaca2c793f2232fe788e414" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/123267b2c49fbf30d78a7b2d333f6be754b94845", - "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/024473a478be9df5fdaca2c793f2232fe788e414", + "reference": "024473a478be9df5fdaca2c793f2232fe788e414", "shasum": "" }, "require": { @@ -4590,7 +4590,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.12.1" + "source": "https://github.com/myclabs/DeepCopy/tree/1.13.0" }, "funding": [ { @@ -4598,7 +4598,7 @@ "type": "tidelift" } ], - "time": "2024-11-08T17:47:46+00:00" + "time": "2025-02-12T12:17:51+00:00" }, { "name": "nikic/php-parser", @@ -6217,16 +6217,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.11.1", + "version": "3.11.3", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "19473c30efe4f7b3cd42522d0b2e6e7f243c6f87" + "reference": "ba05f990e79cbe69b9f35c8c1ac8dca7eecc3a10" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/19473c30efe4f7b3cd42522d0b2e6e7f243c6f87", - "reference": "19473c30efe4f7b3cd42522d0b2e6e7f243c6f87", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/ba05f990e79cbe69b9f35c8c1ac8dca7eecc3a10", + "reference": "ba05f990e79cbe69b9f35c8c1ac8dca7eecc3a10", "shasum": "" }, "require": { @@ -6291,9 +6291,13 @@ { "url": "https://opencollective.com/php_codesniffer", "type": "open_collective" + }, + { + "url": "https://thanks.dev/phpcsstandards", + "type": "thanks_dev" } ], - "time": "2024-11-16T12:02:36+00:00" + "time": "2025-01-23T17:04:15+00:00" }, { "name": "theseer/tokenizer", From 629fbab8da76424951bc9dd3c247643825624371 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 13 Feb 2025 17:25:43 +0530 Subject: [PATCH 1010/1044] Bump to version v4.8.1 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 88f181192..697e99391 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.8.0 +4.8.1 From b19d94fe5fe7a4be00c6cb33011649a1e9636b24 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Fri, 11 Jul 2025 18:10:12 +0530 Subject: [PATCH 1011/1044] chore(deps): update rmccue/requests to ^2.0 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index bb7dd6be5..ed0c20ecb 100644 --- a/composer.json +++ b/composer.json @@ -44,7 +44,7 @@ "easyengine/site-type-wp": "v1.9.1", "monolog/monolog": "1.24.0", "mustache/mustache": "2.14.1", - "rmccue/requests": "1.8.0", + "rmccue/requests": "^2.0", "symfony/config": "4.4.*", "symfony/console": "4.4.*", "symfony/debug": "4.4.*", From 371ffb70a492be741023192bce1bbf767859cf26 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Fri, 11 Jul 2025 18:10:42 +0530 Subject: [PATCH 1012/1044] chore(deps): update dependencies and versions in composer.lock --- composer.lock | 175 ++++++++++++++++++++++++++++++-------------------- 1 file changed, 107 insertions(+), 68 deletions(-) diff --git a/composer.lock b/composer.lock index 2c71f191b..fe0f02cba 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": "7d5f761634519e35800eec5c52544c5c", + "content-hash": "33efb86d35dc33fe989439e04fa7c155", "packages": [ { "name": "acmephp/core", @@ -199,16 +199,16 @@ }, { "name": "composer/ca-bundle", - "version": "1.5.5", + "version": "1.5.7", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "08c50d5ec4c6ced7d0271d2862dec8c1033283e6" + "reference": "d665d22c417056996c59019579f1967dfe5c1e82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/08c50d5ec4c6ced7d0271d2862dec8c1033283e6", - "reference": "08c50d5ec4c6ced7d0271d2862dec8c1033283e6", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/d665d22c417056996c59019579f1967dfe5c1e82", + "reference": "d665d22c417056996c59019579f1967dfe5c1e82", "shasum": "" }, "require": { @@ -255,7 +255,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.5.5" + "source": "https://github.com/composer/ca-bundle/tree/1.5.7" }, "funding": [ { @@ -271,7 +271,7 @@ "type": "tidelift" } ], - "time": "2025-01-08T16:17:16+00:00" + "time": "2025-05-26T15:08:54+00:00" }, { "name": "composer/composer", @@ -595,24 +595,24 @@ }, { "name": "composer/spdx-licenses", - "version": "1.5.8", + "version": "1.5.9", "source": { "type": "git", "url": "https://github.com/composer/spdx-licenses.git", - "reference": "560bdcf8deb88ae5d611c80a2de8ea9d0358cc0a" + "reference": "edf364cefe8c43501e21e88110aac10b284c3c9f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/560bdcf8deb88ae5d611c80a2de8ea9d0358cc0a", - "reference": "560bdcf8deb88ae5d611c80a2de8ea9d0358cc0a", + "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/edf364cefe8c43501e21e88110aac10b284c3c9f", + "reference": "edf364cefe8c43501e21e88110aac10b284c3c9f", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^0.12.55", - "symfony/phpunit-bridge": "^4.2 || ^5" + "phpstan/phpstan": "^1.11", + "symfony/phpunit-bridge": "^3 || ^7" }, "type": "library", "extra": { @@ -655,7 +655,7 @@ "support": { "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/spdx-licenses/issues", - "source": "https://github.com/composer/spdx-licenses/tree/1.5.8" + "source": "https://github.com/composer/spdx-licenses/tree/1.5.9" }, "funding": [ { @@ -671,7 +671,7 @@ "type": "tidelift" } ], - "time": "2023-11-20T07:44:33+00:00" + "time": "2025-05-12T21:07:07+00:00" }, { "name": "composer/xdebug-handler", @@ -1481,16 +1481,16 @@ }, { "name": "guzzlehttp/promises", - "version": "2.0.4", + "version": "2.2.0", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455" + "reference": "7c69f28996b0a6920945dd20b3857e499d9ca96c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/f9c436286ab2892c7db7be8c8da4ef61ccf7b455", - "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455", + "url": "https://api.github.com/repos/guzzle/promises/zipball/7c69f28996b0a6920945dd20b3857e499d9ca96c", + "reference": "7c69f28996b0a6920945dd20b3857e499d9ca96c", "shasum": "" }, "require": { @@ -1544,7 +1544,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/2.0.4" + "source": "https://github.com/guzzle/promises/tree/2.2.0" }, "funding": [ { @@ -1560,7 +1560,7 @@ "type": "tidelift" } ], - "time": "2024-10-17T10:06:22+00:00" + "time": "2025-03-27T13:27:01+00:00" }, { "name": "guzzlehttp/psr7", @@ -1962,6 +1962,16 @@ "issues": "https://github.com/Seldaek/monolog/issues", "source": "https://github.com/Seldaek/monolog/tree/1.24.0" }, + "funding": [ + { + "url": "https://github.com/Seldaek", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/monolog/monolog", + "type": "tidelift" + } + ], "time": "2018-11-05T09:00:11+00:00" }, { @@ -2335,36 +2345,50 @@ }, { "name": "rmccue/requests", - "version": "v1.8.0", + "version": "v2.0.15", "source": { "type": "git", "url": "https://github.com/WordPress/Requests.git", - "reference": "afbe4790e4def03581c4a0963a1e8aa01f6030f1" + "reference": "877cd66169755899682f1595e057334b40d9d149" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/WordPress/Requests/zipball/afbe4790e4def03581c4a0963a1e8aa01f6030f1", - "reference": "afbe4790e4def03581c4a0963a1e8aa01f6030f1", + "url": "https://api.github.com/repos/WordPress/Requests/zipball/877cd66169755899682f1595e057334b40d9d149", + "reference": "877cd66169755899682f1595e057334b40d9d149", "shasum": "" }, "require": { - "php": ">=5.2" + "ext-json": "*", + "php": ">=5.6" }, "require-dev": { "dealerdirect/phpcodesniffer-composer-installer": "^0.7", "php-parallel-lint/php-console-highlighter": "^0.5.0", - "php-parallel-lint/php-parallel-lint": "^1.3", + "php-parallel-lint/php-parallel-lint": "^1.3.1", "phpcompatibility/php-compatibility": "^9.0", - "phpunit/phpunit": "^4.8 || ^5.7 || ^6.5 || ^7.5", - "requests/test-server": "dev-master", - "squizlabs/php_codesniffer": "^3.5", - "wp-coding-standards/wpcs": "^2.0" + "requests/test-server": "dev-main", + "roave/security-advisories": "dev-latest", + "squizlabs/php_codesniffer": "^3.6", + "wp-coding-standards/wpcs": "^2.0", + "yoast/phpunit-polyfills": "^1.0.0" + }, + "suggest": { + "art4/requests-psr18-adapter": "For using Requests as a PSR-18 HTTP Client", + "ext-curl": "For improved performance", + "ext-openssl": "For secure transport support", + "ext-zlib": "For improved performance when decompressing encoded streams" }, "type": "library", "autoload": { - "psr-0": { - "Requests": "library/" - } + "files": [ + "library/Deprecated.php" + ], + "psr-4": { + "WpOrg\\Requests\\": "src/" + }, + "classmap": [ + "library/Requests.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2373,11 +2397,23 @@ "authors": [ { "name": "Ryan McCue", - "homepage": "http://ryanmccue.info" + "homepage": "https://rmccue.io/" + }, + { + "name": "Alain Schlesser", + "homepage": "https://github.com/schlessera" + }, + { + "name": "Juliette Reinders Folmer", + "homepage": "https://github.com/jrfnl" + }, + { + "name": "Contributors", + "homepage": "https://github.com/WordPress/Requests/graphs/contributors" } ], "description": "A HTTP library written in PHP, for human beings.", - "homepage": "http://github.com/WordPress/Requests", + "homepage": "https://requests.ryanmccue.info/", "keywords": [ "curl", "fsockopen", @@ -2388,10 +2424,11 @@ "sockets" ], "support": { + "docs": "https://requests.ryanmccue.info/", "issues": "https://github.com/WordPress/Requests/issues", - "source": "https://github.com/WordPress/Requests/tree/v1.8.0" + "source": "https://github.com/WordPress/Requests" }, - "time": "2021-04-27T11:05:25+00:00" + "time": "2025-01-21T10:13:31+00:00" }, { "name": "seld/jsonlint", @@ -3185,7 +3222,7 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", @@ -3244,7 +3281,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.32.0" }, "funding": [ { @@ -3264,19 +3301,20 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341" + "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341", - "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493", + "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493", "shasum": "" }, "require": { + "ext-iconv": "*", "php": ">=7.2" }, "provide": { @@ -3324,7 +3362,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.32.0" }, "funding": [ { @@ -3340,11 +3378,11 @@ "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2024-12-23T08:48:59+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", @@ -3400,7 +3438,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.32.0" }, "funding": [ { @@ -3420,16 +3458,16 @@ }, { "name": "symfony/polyfill-php80", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8" + "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", - "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608", + "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608", "shasum": "" }, "require": { @@ -3480,7 +3518,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.32.0" }, "funding": [ { @@ -3496,11 +3534,11 @@ "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2025-01-02T08:10:11+00:00" }, { "name": "symfony/polyfill-php81", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", @@ -3556,7 +3594,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.32.0" }, "funding": [ { @@ -4398,6 +4436,7 @@ "issues": "https://github.com/Behat/Transliterator/issues", "source": "https://github.com/Behat/Transliterator/tree/v1.5.0" }, + "abandoned": true, "time": "2022-03-30T09:27:43+00:00" }, { @@ -4542,16 +4581,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.13.0", + "version": "1.13.3", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "024473a478be9df5fdaca2c793f2232fe788e414" + "reference": "faed855a7b5f4d4637717c2b3863e277116beb36" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/024473a478be9df5fdaca2c793f2232fe788e414", - "reference": "024473a478be9df5fdaca2c793f2232fe788e414", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/faed855a7b5f4d4637717c2b3863e277116beb36", + "reference": "faed855a7b5f4d4637717c2b3863e277116beb36", "shasum": "" }, "require": { @@ -4590,7 +4629,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.13.0" + "source": "https://github.com/myclabs/DeepCopy/tree/1.13.3" }, "funding": [ { @@ -4598,7 +4637,7 @@ "type": "tidelift" } ], - "time": "2025-02-12T12:17:51+00:00" + "time": "2025-07-05T12:25:42+00:00" }, { "name": "nikic/php-parser", @@ -6217,16 +6256,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.11.3", + "version": "3.13.2", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "ba05f990e79cbe69b9f35c8c1ac8dca7eecc3a10" + "reference": "5b5e3821314f947dd040c70f7992a64eac89025c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/ba05f990e79cbe69b9f35c8c1ac8dca7eecc3a10", - "reference": "ba05f990e79cbe69b9f35c8c1ac8dca7eecc3a10", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/5b5e3821314f947dd040c70f7992a64eac89025c", + "reference": "5b5e3821314f947dd040c70f7992a64eac89025c", "shasum": "" }, "require": { @@ -6293,11 +6332,11 @@ "type": "open_collective" }, { - "url": "https://thanks.dev/phpcsstandards", + "url": "https://thanks.dev/u/gh/phpcsstandards", "type": "thanks_dev" } ], - "time": "2025-01-23T17:04:15+00:00" + "time": "2025-06-17T22:17:01+00:00" }, { "name": "theseer/tokenizer", From 7c3d539e435ddda30aa8f3d9bab8112730d0c261 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Fri, 11 Jul 2025 18:11:32 +0530 Subject: [PATCH 1013/1044] fix(requests): update Requests class and certificate path --- .../Bootstrap/IncludeFrameworkAutoloader.php | 3 +- php/utils.php | 43 +++++++++++-------- tests/test-utils.php | 2 +- 3 files changed, 28 insertions(+), 20 deletions(-) diff --git a/php/EE/Bootstrap/IncludeFrameworkAutoloader.php b/php/EE/Bootstrap/IncludeFrameworkAutoloader.php index 43c8f3d91..13303b360 100644 --- a/php/EE/Bootstrap/IncludeFrameworkAutoloader.php +++ b/php/EE/Bootstrap/IncludeFrameworkAutoloader.php @@ -34,7 +34,7 @@ public function process( BootstrapState $state ) { $mappings = [ 'EE' => EE_ROOT . '/php/EE', 'cli' => EE_VENDOR_DIR . '/wp-cli/php-cli-tools/lib/cli', - 'Requests' => EE_VENDOR_DIR . '/rmccue/requests/library/Requests', + 'WpOrg\\Requests' => EE_VENDOR_DIR . '/rmccue/requests/src', // New PSR-4 mapping 'Symfony\Component\Finder' => EE_VENDOR_DIR . '/symfony/finder/', 'Psr\Log' => EE_VENDOR_DIR . '/psr/log/Psr/Log/', 'Monolog' => EE_VENDOR_DIR . '/monolog/monolog/src/Monolog', @@ -47,7 +47,6 @@ public function process( BootstrapState $state ) { ); } - include_once EE_VENDOR_DIR . '/rmccue/requests/library/Requests.php'; include_once EE_VENDOR_DIR . '/wp-cli/mustangostang-spyc/Spyc.php'; $autoloader->register(); diff --git a/php/utils.php b/php/utils.php index 985f9802a..98052a3b9 100644 --- a/php/utils.php +++ b/php/utils.php @@ -492,12 +492,13 @@ function replace_path_consts( $source, $path ) { * @param string $method HTTP method (GET, POST, DELETE, etc.) * @param string $url URL to make the HTTP request to. * @param array $headers Add specific headers to the request. + * @param array $data * @param array $options * @return object */ function http_request( $method, $url, $data = null, $headers = array(), $options = array() ) { - $cert_path = '/rmccue/requests/library/Requests/Transport/cacert.pem'; + $cert_path = '/rmccue/requests/certificates/cacert.pem'; $halt_on_error = ! isset( $options['halt_on_error'] ) || (bool) $options['halt_on_error']; if ( inside_phar() ) { // cURL can't read Phar archives @@ -521,23 +522,31 @@ function http_request( $method, $url, $data = null, $headers = array(), $options } try { - return \Requests::request( $url, $headers, $data, $method, $options ); - } catch ( \Requests_Exception $ex ) { - // CURLE_SSL_CACERT_BADFILE only defined for PHP >= 7. - if ( 'curlerror' !== $ex->getType() || ! in_array( curl_errno( $ex->getData() ), array( CURLE_SSL_CONNECT_ERROR, CURLE_SSL_CERTPROBLEM, 77 /*CURLE_SSL_CACERT_BADFILE*/ ), true ) ) { - $error_msg = sprintf( "Failed to get url '%s': %s.", $url, $ex->getMessage() ); - if ( $halt_on_error ) { - EE::error( $error_msg ); - } - throw new \RuntimeException( $error_msg, null, $ex ); - } + // Updated class name: \WpOrg\Requests\Requests + $response = \WpOrg\Requests\Requests::request( $url, $headers, $data, $method, $options ); + return $response; + } catch ( \WpOrg\Requests\Exception $ex ) { // Updated exception class name + // Handle SSL certificate issues gracefully - \EE::warning( sprintf( "Re-trying without verify after failing to get verified url '%s' %s.", $url, $ex->getMessage() ) ); - $options['verify'] = false; - try { - return \Requests::request( $url, $headers, $data, $method, $options ); - } catch ( \Requests_Exception $ex ) { - $error_msg = sprintf( "Failed to get non-verified url '%s' %s.", $url, $ex->getMessage() ); + $curl_error = false; + if ( $ex instanceof \WpOrg\Requests\Exception\Transport\Curl ) { + $curl_error = true; + } + + if ( $curl_error && in_array( $ex->getCode(), array( CURLE_SSL_CONNECT_ERROR, CURLE_SSL_CERTPROBLEM, 77 /*CURLE_SSL_CACERT_BADFILE*/ ), true ) ) { + \EE::warning( sprintf( "Re-trying without verify after failing to get verified url '%s' %s.", $url, $ex->getMessage() ) ); + $options['verify'] = false; + try { + return \WpOrg\Requests\Requests::request( $url, $headers, $data, $method, $options ); + } catch ( \WpOrg\Requests\Exception $ex ) { + $error_msg = sprintf( "Failed to get non-verified url '%s' %s.", $url, $ex->getMessage() ); + if ( $halt_on_error ) { + EE::error( $error_msg ); + } + throw new \RuntimeException( $error_msg, null, $ex ); + } + } else { + $error_msg = sprintf( "Failed to get url '%s': %s.", $url, $ex->getMessage() ); if ( $halt_on_error ) { EE::error( $error_msg ); } diff --git a/tests/test-utils.php b/tests/test-utils.php index f682d7cfe..c6b6c175a 100644 --- a/tests/test-utils.php +++ b/tests/test-utils.php @@ -383,7 +383,7 @@ public function testHttpRequestBadCAcert() { // Hack to create bad CAcert, using Utils\get_vendor_paths() preference for a path as part of a Composer-installed larger project. $vendor_dir = EE_ROOT . '/../../../vendor'; - $cert_path = '/rmccue/requests/library/Requests/Transport/cacert.pem'; + $cert_path = '/rmccue/requests/certificates/cacert.pem'; $bad_cacert_path = $vendor_dir . $cert_path; if ( ! file_exists( $bad_cacert_path ) ) { // Capture any directories created so can clean up. From 1df854a638505fac85052139725db7ad343aa131 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Fri, 11 Jul 2025 18:11:41 +0530 Subject: [PATCH 1014/1044] fix(phar): update path for cacert.pem in make-phar.php --- utils/make-phar.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/make-phar.php b/utils/make-phar.php index 3e5c4a51c..4429f36bc 100644 --- a/utils/make-phar.php +++ b/utils/make-phar.php @@ -320,7 +320,7 @@ function get_composer_versions( $current_version ) { add_file( $phar, EE_VENDOR_DIR . '/composer/composer/LICENSE' ); add_file( $phar, EE_VENDOR_DIR . '/composer/composer/res/composer-schema.json' ); } -add_file( $phar, EE_VENDOR_DIR . '/rmccue/requests/library/Requests/Transport/cacert.pem' ); +add_file( $phar, EE_VENDOR_DIR . '/rmccue/requests/certificates/cacert.pem' ); set_file_contents( $phar, EE_ROOT . '/COMPOSER_VERSIONS', get_composer_versions( $current_version ) ); set_file_contents( $phar, EE_ROOT . '/VERSION', $current_version ); From 5165d5338dbfa568ce1db9aa59d19ee853379021 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Fri, 11 Jul 2025 18:18:31 +0530 Subject: [PATCH 1015/1044] Update composer packages for v4.9.0 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 3 ++- composer.lock | 60 +++++++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 55 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index ed0c20ecb..9744b1bdf 100644 --- a/composer.json +++ b/composer.json @@ -35,11 +35,12 @@ "easyengine/auth-command": "v1.2.1", "easyengine/config-command": "v1.0.2", "easyengine/cron-command": "v2.1.0", + "easyengine/dash-command": "v1.0.0", "easyengine/log-command": "v1.1.0", "easyengine/mailhog-command": "v1.0.3", "easyengine/service-command": "v1.6.1", "easyengine/shell-command": "v1.1.3", - "easyengine/site-command": "v3.3.5", + "easyengine/site-command": "v3.4.0", "easyengine/site-type-php": "v1.9.1", "easyengine/site-type-wp": "v1.9.1", "monolog/monolog": "1.24.0", diff --git a/composer.lock b/composer.lock index fe0f02cba..cdc7c9fa7 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": "33efb86d35dc33fe989439e04fa7c155", + "content-hash": "561521d547ba776378f4862fee337661", "packages": [ { "name": "acmephp/core", @@ -976,6 +976,51 @@ }, "time": "2024-05-27T13:06:26+00:00" }, + { + "name": "easyengine/dash-command", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/EasyEngine/dash-command.git", + "reference": "83f20d113b28211dfb9851b7670603d832e4a735" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/EasyEngine/dash-command/zipball/83f20d113b28211dfb9851b7670603d832e4a735", + "reference": "83f20d113b28211dfb9851b7670603d832e4a735", + "shasum": "" + }, + "type": "ee-cli-package", + "extra": { + "bundled": true, + "commands": [ + "dash", + "dash init" + ], + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "files": [ + "dash-command.php" + ], + "psr-4": { + "": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Command to manage dash", + "homepage": "https://github.com/easyengine/dash-command", + "support": { + "issues": "https://github.com/EasyEngine/dash-command/issues", + "source": "https://github.com/EasyEngine/dash-command/tree/v1.0.0" + }, + "time": "2025-07-10T12:39:35+00:00" + }, { "name": "easyengine/log-command", "version": "v1.1.0", @@ -1161,16 +1206,16 @@ }, { "name": "easyengine/site-command", - "version": "v3.3.5", + "version": "v3.4.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "8f509d82070909636101e1e41b72581e2b71cef3" + "reference": "2281c1b120f647cd3ff7d208a7b96a05a87e6436" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/8f509d82070909636101e1e41b72581e2b71cef3", - "reference": "8f509d82070909636101e1e41b72581e2b71cef3", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/2281c1b120f647cd3ff7d208a7b96a05a87e6436", + "reference": "2281c1b120f647cd3ff7d208a7b96a05a87e6436", "shasum": "" }, "require": { @@ -1213,6 +1258,7 @@ "src/helper/SimpleDnsCloudflareSolver.php", "src/helper/Site_Self_Signed.php", "src/helper/Site_Letsencrypt.php", + "src/helper/Site_Backup_Restore.php", "src/helper/Shutdown_Handler.php", "src/clone/Cloner.php", "src/clone/clone-utils.php" @@ -1231,9 +1277,9 @@ "homepage": "https://github.com/easyengine/site-command", "support": { "issues": "https://github.com/EasyEngine/site-command/issues", - "source": "https://github.com/EasyEngine/site-command/tree/v3.3.5" + "source": "https://github.com/EasyEngine/site-command/tree/v3.4.0" }, - "time": "2025-02-13T11:47:17+00:00" + "time": "2025-07-11T12:38:36+00:00" }, { "name": "easyengine/site-type-php", From 70f88873a3bbd6e4bb0223ab415b5b0d973789a4 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Fri, 11 Jul 2025 18:18:43 +0530 Subject: [PATCH 1016/1044] Update images for v4.9.0 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- img-versions.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/img-versions.json b/img-versions.json index fa334a567..9a2c58d83 100644 --- a/img-versions.json +++ b/img-versions.json @@ -1,5 +1,5 @@ { - "easyengine/cron": "v4.8.1", + "easyengine/cron": "v4.9.0", "easyengine/mailhog": "v4.6.5", "easyengine/mariadb": "v4.6.6", "easyengine/nginx-proxy": "v4.8.1", @@ -11,11 +11,11 @@ "easyengine/php7.3": "v4.7.4", "easyengine/php7.4": "v4.7.4", "easyengine/php8.0": "v4.8.1", - "easyengine/php8.1": "v4.8.1", - "easyengine/php8.2": "v4.8.1", - "easyengine/php8.3": "v4.8.1", - "easyengine/php8.4": "v4.8.0", + "easyengine/php8.1": "v4.9.0", + "easyengine/php8.2": "v4.9.0", + "easyengine/php8.3": "v4.9.0", + "easyengine/php8.4": "v4.9.0", "easyengine/postfix": "v4.8.1", "easyengine/redis": "v4.8.1", - "easyengine/newrelic-daemon": "v4.8.1" + "easyengine/newrelic-daemon": "v4.9.0" } From 7956af92fd3f08c021b2572f670ee7c1d9f2f17c Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Fri, 11 Jul 2025 18:18:55 +0530 Subject: [PATCH 1017/1044] Bump to version v4.9.0 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 697e99391..6ed7776bf 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.8.1 +4.9.0 From 29f3cb3ba5a0759881efb5d738aeba75fbd03647 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Fri, 11 Jul 2025 19:17:11 +0530 Subject: [PATCH 1018/1044] fix(deps): update easyengine/site-type-php to v1.9.2 --- composer.json | 2 +- composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index 9744b1bdf..9e7000ddd 100644 --- a/composer.json +++ b/composer.json @@ -41,7 +41,7 @@ "easyengine/service-command": "v1.6.1", "easyengine/shell-command": "v1.1.3", "easyengine/site-command": "v3.4.0", - "easyengine/site-type-php": "v1.9.1", + "easyengine/site-type-php": "v1.9.2", "easyengine/site-type-wp": "v1.9.1", "monolog/monolog": "1.24.0", "mustache/mustache": "2.14.1", diff --git a/composer.lock b/composer.lock index cdc7c9fa7..67636eee1 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": "561521d547ba776378f4862fee337661", + "content-hash": "b336604236351416f1290c9ab9397458", "packages": [ { "name": "acmephp/core", @@ -1283,16 +1283,16 @@ }, { "name": "easyengine/site-type-php", - "version": "v1.9.1", + "version": "v1.9.2", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-php.git", - "reference": "523df86ffc70b29b8c93aa9a88002bf53334d887" + "reference": "d597f47a8bb55cf497909774e5a1ffcd7398ced8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/523df86ffc70b29b8c93aa9a88002bf53334d887", - "reference": "523df86ffc70b29b8c93aa9a88002bf53334d887", + "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/d597f47a8bb55cf497909774e5a1ffcd7398ced8", + "reference": "d597f47a8bb55cf497909774e5a1ffcd7398ced8", "shasum": "" }, "require-dev": { @@ -1336,9 +1336,9 @@ "homepage": "https://github.com/easyengine/site-type-php", "support": { "issues": "https://github.com/EasyEngine/site-type-php/issues", - "source": "https://github.com/EasyEngine/site-type-php/tree/v1.9.1" + "source": "https://github.com/EasyEngine/site-type-php/tree/v1.9.2" }, - "time": "2025-02-13T11:48:36+00:00" + "time": "2025-07-11T14:19:02+00:00" }, { "name": "easyengine/site-type-wp", From ca30c0775b9074f2876be174c1858a221e84f423 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Wed, 3 Sep 2025 18:17:59 +0530 Subject: [PATCH 1019/1044] Update composer packages for v4.9.1 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- composer.json | 4 +- composer.lock | 180 ++++++++++++++++++++++++++++++++------------------ 2 files changed, 118 insertions(+), 66 deletions(-) diff --git a/composer.json b/composer.json index 9e7000ddd..7edaaee2d 100644 --- a/composer.json +++ b/composer.json @@ -40,8 +40,8 @@ "easyengine/mailhog-command": "v1.0.3", "easyengine/service-command": "v1.6.1", "easyengine/shell-command": "v1.1.3", - "easyengine/site-command": "v3.4.0", - "easyengine/site-type-php": "v1.9.2", + "easyengine/site-command": "v3.5.0", + "easyengine/site-type-php": "v1.9.3", "easyengine/site-type-wp": "v1.9.1", "monolog/monolog": "1.24.0", "mustache/mustache": "2.14.1", diff --git a/composer.lock b/composer.lock index 67636eee1..eb17dbaf4 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": "b336604236351416f1290c9ab9397458", + "content-hash": "9248b3c648111dba8ba7c9ca356cbb9d", "packages": [ { "name": "acmephp/core", @@ -199,16 +199,16 @@ }, { "name": "composer/ca-bundle", - "version": "1.5.7", + "version": "1.5.8", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "d665d22c417056996c59019579f1967dfe5c1e82" + "reference": "719026bb30813accb68271fee7e39552a58e9f65" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/d665d22c417056996c59019579f1967dfe5c1e82", - "reference": "d665d22c417056996c59019579f1967dfe5c1e82", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/719026bb30813accb68271fee7e39552a58e9f65", + "reference": "719026bb30813accb68271fee7e39552a58e9f65", "shasum": "" }, "require": { @@ -255,7 +255,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.5.7" + "source": "https://github.com/composer/ca-bundle/tree/1.5.8" }, "funding": [ { @@ -265,13 +265,9 @@ { "url": "https://github.com/composer", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" } ], - "time": "2025-05-26T15:08:54+00:00" + "time": "2025-08-20T18:49:47+00:00" }, { "name": "composer/composer", @@ -1206,16 +1202,16 @@ }, { "name": "easyengine/site-command", - "version": "v3.4.0", + "version": "v3.5.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "2281c1b120f647cd3ff7d208a7b96a05a87e6436" + "reference": "e2d2c9c14f09ecd8d71147131ff730f8a5eb6137" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/2281c1b120f647cd3ff7d208a7b96a05a87e6436", - "reference": "2281c1b120f647cd3ff7d208a7b96a05a87e6436", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/e2d2c9c14f09ecd8d71147131ff730f8a5eb6137", + "reference": "e2d2c9c14f09ecd8d71147131ff730f8a5eb6137", "shasum": "" }, "require": { @@ -1277,22 +1273,22 @@ "homepage": "https://github.com/easyengine/site-command", "support": { "issues": "https://github.com/EasyEngine/site-command/issues", - "source": "https://github.com/EasyEngine/site-command/tree/v3.4.0" + "source": "https://github.com/EasyEngine/site-command/tree/v3.5.0" }, - "time": "2025-07-11T12:38:36+00:00" + "time": "2025-09-03T12:41:55+00:00" }, { "name": "easyengine/site-type-php", - "version": "v1.9.2", + "version": "v1.9.3", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-php.git", - "reference": "d597f47a8bb55cf497909774e5a1ffcd7398ced8" + "reference": "c85b623cb2a2ff3dfe2b483f157fe6e1f2ce042c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/d597f47a8bb55cf497909774e5a1ffcd7398ced8", - "reference": "d597f47a8bb55cf497909774e5a1ffcd7398ced8", + "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/c85b623cb2a2ff3dfe2b483f157fe6e1f2ce042c", + "reference": "c85b623cb2a2ff3dfe2b483f157fe6e1f2ce042c", "shasum": "" }, "require-dev": { @@ -1336,9 +1332,9 @@ "homepage": "https://github.com/easyengine/site-type-php", "support": { "issues": "https://github.com/EasyEngine/site-type-php/issues", - "source": "https://github.com/EasyEngine/site-type-php/tree/v1.9.2" + "source": "https://github.com/EasyEngine/site-type-php/tree/v1.9.3" }, - "time": "2025-07-11T14:19:02+00:00" + "time": "2025-09-03T12:44:10+00:00" }, { "name": "easyengine/site-type-wp", @@ -1527,16 +1523,16 @@ }, { "name": "guzzlehttp/promises", - "version": "2.2.0", + "version": "2.3.0", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "7c69f28996b0a6920945dd20b3857e499d9ca96c" + "reference": "481557b130ef3790cf82b713667b43030dc9c957" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/7c69f28996b0a6920945dd20b3857e499d9ca96c", - "reference": "7c69f28996b0a6920945dd20b3857e499d9ca96c", + "url": "https://api.github.com/repos/guzzle/promises/zipball/481557b130ef3790cf82b713667b43030dc9c957", + "reference": "481557b130ef3790cf82b713667b43030dc9c957", "shasum": "" }, "require": { @@ -1544,7 +1540,7 @@ }, "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", - "phpunit/phpunit": "^8.5.39 || ^9.6.20" + "phpunit/phpunit": "^8.5.44 || ^9.6.25" }, "type": "library", "extra": { @@ -1590,7 +1586,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/2.2.0" + "source": "https://github.com/guzzle/promises/tree/2.3.0" }, "funding": [ { @@ -1606,7 +1602,7 @@ "type": "tidelift" } ], - "time": "2025-03-27T13:27:01+00:00" + "time": "2025-08-22T14:34:08+00:00" }, { "name": "guzzlehttp/psr7", @@ -3268,7 +3264,7 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.32.0", + "version": "v1.33.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", @@ -3327,7 +3323,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.32.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.33.0" }, "funding": [ { @@ -3338,6 +3334,10 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" @@ -3347,7 +3347,7 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.32.0", + "version": "v1.33.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", @@ -3408,7 +3408,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.32.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.33.0" }, "funding": [ { @@ -3419,6 +3419,10 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" @@ -3428,7 +3432,7 @@ }, { "name": "symfony/polyfill-php73", - "version": "v1.32.0", + "version": "v1.33.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", @@ -3484,7 +3488,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.32.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.33.0" }, "funding": [ { @@ -3495,6 +3499,10 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" @@ -3504,7 +3512,7 @@ }, { "name": "symfony/polyfill-php80", - "version": "v1.32.0", + "version": "v1.33.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", @@ -3564,7 +3572,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.32.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.33.0" }, "funding": [ { @@ -3575,6 +3583,10 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" @@ -3584,7 +3596,7 @@ }, { "name": "symfony/polyfill-php81", - "version": "v1.32.0", + "version": "v1.33.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", @@ -3640,7 +3652,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.32.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.33.0" }, "funding": [ { @@ -3651,6 +3663,10 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" @@ -4627,16 +4643,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.13.3", + "version": "1.13.4", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "faed855a7b5f4d4637717c2b3863e277116beb36" + "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/faed855a7b5f4d4637717c2b3863e277116beb36", - "reference": "faed855a7b5f4d4637717c2b3863e277116beb36", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/07d290f0c47959fd5eed98c95ee5602db07e0b6a", + "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a", "shasum": "" }, "require": { @@ -4675,7 +4691,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.13.3" + "source": "https://github.com/myclabs/DeepCopy/tree/1.13.4" }, "funding": [ { @@ -4683,7 +4699,7 @@ "type": "tidelift" } ], - "time": "2025-07-05T12:25:42+00:00" + "time": "2025-08-01T08:46:24+00:00" }, { "name": "nikic/php-parser", @@ -5506,16 +5522,16 @@ }, { "name": "sebastian/comparator", - "version": "4.0.8", + "version": "4.0.9", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a" + "reference": "67a2df3a62639eab2cc5906065e9805d4fd5dfc5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/67a2df3a62639eab2cc5906065e9805d4fd5dfc5", + "reference": "67a2df3a62639eab2cc5906065e9805d4fd5dfc5", "shasum": "" }, "require": { @@ -5568,15 +5584,27 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.9" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/comparator", + "type": "tidelift" } ], - "time": "2022-09-14T12:41:17+00:00" + "time": "2025-08-10T06:51:50+00:00" }, { "name": "sebastian/complexity", @@ -5843,16 +5871,16 @@ }, { "name": "sebastian/global-state", - "version": "5.0.7", + "version": "5.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9" + "reference": "b6781316bdcd28260904e7cc18ec983d0d2ef4f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", - "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/b6781316bdcd28260904e7cc18ec983d0d2ef4f6", + "reference": "b6781316bdcd28260904e7cc18ec983d0d2ef4f6", "shasum": "" }, "require": { @@ -5895,15 +5923,27 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.7" + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.8" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/global-state", + "type": "tidelift" } ], - "time": "2024-03-02T06:35:11+00:00" + "time": "2025-08-10T07:10:35+00:00" }, { "name": "sebastian/lines-of-code", @@ -6076,16 +6116,16 @@ }, { "name": "sebastian/recursion-context", - "version": "4.0.5", + "version": "4.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" + "reference": "539c6691e0623af6dc6f9c20384c120f963465a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/539c6691e0623af6dc6f9c20384c120f963465a0", + "reference": "539c6691e0623af6dc6f9c20384c120f963465a0", "shasum": "" }, "require": { @@ -6127,15 +6167,27 @@ "homepage": "https://github.com/sebastianbergmann/recursion-context", "support": { "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.6" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/recursion-context", + "type": "tidelift" } ], - "time": "2023-02-03T06:07:39+00:00" + "time": "2025-08-10T06:57:39+00:00" }, { "name": "sebastian/resource-operations", From cef52a9cd3fb2b32917418bfa4e3576302578472 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Wed, 3 Sep 2025 18:18:24 +0530 Subject: [PATCH 1020/1044] Update images for v4.9.1 Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com> --- img-versions.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/img-versions.json b/img-versions.json index 9a2c58d83..bbc931720 100644 --- a/img-versions.json +++ b/img-versions.json @@ -1,8 +1,8 @@ { - "easyengine/cron": "v4.9.0", + "easyengine/cron": "v4.9.1", "easyengine/mailhog": "v4.6.5", "easyengine/mariadb": "v4.6.6", - "easyengine/nginx-proxy": "v4.8.1", + "easyengine/nginx-proxy": "v4.9.1", "easyengine/nginx": "v4.7.6", "easyengine/php": "v4.6.6", "easyengine/php5.6": "v4.7.4", @@ -12,10 +12,10 @@ "easyengine/php7.4": "v4.7.4", "easyengine/php8.0": "v4.8.1", "easyengine/php8.1": "v4.9.0", - "easyengine/php8.2": "v4.9.0", - "easyengine/php8.3": "v4.9.0", - "easyengine/php8.4": "v4.9.0", + "easyengine/php8.2": "v4.9.1", + "easyengine/php8.3": "v4.9.1", + "easyengine/php8.4": "v4.9.1", "easyengine/postfix": "v4.8.1", - "easyengine/redis": "v4.8.1", + "easyengine/redis": "v4.9.1", "easyengine/newrelic-daemon": "v4.9.0" } From 73be7e9cb7b63e0546cff4c31ba2b2dae9616e34 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Wed, 3 Sep 2025 18:25:33 +0530 Subject: [PATCH 1021/1044] chore(changelog): update changelog script for accuracy --- utils/changelog.sh | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/utils/changelog.sh b/utils/changelog.sh index b7d342537..15c5c6496 100644 --- a/utils/changelog.sh +++ b/utils/changelog.sh @@ -1,21 +1,41 @@ -#!/usr/bin/env bash +#!/bin/bash -echo "## What's Changed" > changelog.txt +echo -e "## What's Changed\n" > changelog.txt +# Get the creation date of the most recent release createdAt=$(gh api graphql -F owner='EasyEngine' -F name='easyengine' -f query=' query { repository(owner: "EasyEngine", name: "easyengine") { - releases(first: 1, orderBy: { field: CREATED_AT, direction: DESC }) { + releases(first: 1, orderBy: {field: CREATED_AT, direction: DESC}) { nodes { tagName, createdAt } } } } ' | jq -r '.data.repository.releases.nodes[0].createdAt') +# Also get the tag name for verification +tagName=$(gh api graphql -F owner='EasyEngine' -F name='easyengine' -f query=' + query { + repository(owner: "EasyEngine", name: "easyengine") { + releases(first: 1, orderBy: {field: CREATED_AT, direction: DESC}) { + nodes { tagName, createdAt } + } + } + } +' | jq -r '.data.repository.releases.nodes[0].tagName') + +echo "Last release: $tagName ($createdAt)" + +# Search for merged PRs since the last release with proper pagination +# Using merged:>$createdAt instead of updated:>$createdAt gh api graphql --paginate -f query=" -query { - search(query: \"org:Easyengine updated:>$createdAt state:closed is:pr\", type:ISSUE, first: 100) { +query(\$endCursor: String) { + search(query: \"org:EasyEngine merged:>$createdAt is:pr is:merged\", type: ISSUE, first: 100, after: \$endCursor) { repositoryCount + pageInfo { + hasNextPage + endCursor + } edges { node { ... on PullRequest { @@ -25,10 +45,13 @@ query { author { login } - updatedAt + mergedAt + repository { + name + } } } } } } -" --template '{{range .data.search.edges}}{{"* "}}{{.node.title}}{{" "}}{{.node.permalink}}{{" "}}{{.node.state}}{{" @"}}{{.node.author.login}}{{"\n"}}{{end}}' | sed '/CLOSED/d' | sed 's/ MERGED//g' >> changelog.txt +" --template '{{range .data.search.edges}}{{"* "}}{{.node.title}} {{.node.permalink}}{{" @"}}{{.node.author.login}}{{"\n"}}{{end}}' >> changelog.txt From b4dccb7a8f8055cba4e4573984d39a5dd4216426 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 4 Sep 2025 12:34:21 +0530 Subject: [PATCH 1022/1044] chore(dependencies): update service and site command versions --- composer.json | 4 ++-- composer.lock | 26 +++++++++++++------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/composer.json b/composer.json index 7edaaee2d..71191f4f9 100644 --- a/composer.json +++ b/composer.json @@ -38,9 +38,9 @@ "easyengine/dash-command": "v1.0.0", "easyengine/log-command": "v1.1.0", "easyengine/mailhog-command": "v1.0.3", - "easyengine/service-command": "v1.6.1", + "easyengine/service-command": "v1.6.2", "easyengine/shell-command": "v1.1.3", - "easyengine/site-command": "v3.5.0", + "easyengine/site-command": "v3.5.1", "easyengine/site-type-php": "v1.9.3", "easyengine/site-type-wp": "v1.9.1", "monolog/monolog": "1.24.0", diff --git a/composer.lock b/composer.lock index eb17dbaf4..2db4aa2b5 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": "9248b3c648111dba8ba7c9ca356cbb9d", + "content-hash": "86ccc311bc5e1c62b4bbb296a8d98fdf", "packages": [ { "name": "acmephp/core", @@ -1109,16 +1109,16 @@ }, { "name": "easyengine/service-command", - "version": "v1.6.1", + "version": "v1.6.2", "source": { "type": "git", "url": "https://github.com/EasyEngine/service-command.git", - "reference": "a730ce0419d6f2b18d1d0206438125e2de9d2ac8" + "reference": "d6f642d26b019bee68b3f23f3ccb59c2ee4266ae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/a730ce0419d6f2b18d1d0206438125e2de9d2ac8", - "reference": "a730ce0419d6f2b18d1d0206438125e2de9d2ac8", + "url": "https://api.github.com/repos/EasyEngine/service-command/zipball/d6f642d26b019bee68b3f23f3ccb59c2ee4266ae", + "reference": "d6f642d26b019bee68b3f23f3ccb59c2ee4266ae", "shasum": "" }, "type": "ee-cli-package", @@ -1152,9 +1152,9 @@ "homepage": "https://github.com/easyengine/service-command", "support": { "issues": "https://github.com/EasyEngine/service-command/issues", - "source": "https://github.com/EasyEngine/service-command/tree/v1.6.1" + "source": "https://github.com/EasyEngine/service-command/tree/v1.6.2" }, - "time": "2024-05-27T13:07:27+00:00" + "time": "2025-09-04T07:03:26+00:00" }, { "name": "easyengine/shell-command", @@ -1202,16 +1202,16 @@ }, { "name": "easyengine/site-command", - "version": "v3.5.0", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "e2d2c9c14f09ecd8d71147131ff730f8a5eb6137" + "reference": "c6fc3b1d9cd6ae533e2c0d32c60d66eb36bdc2dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/e2d2c9c14f09ecd8d71147131ff730f8a5eb6137", - "reference": "e2d2c9c14f09ecd8d71147131ff730f8a5eb6137", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/c6fc3b1d9cd6ae533e2c0d32c60d66eb36bdc2dd", + "reference": "c6fc3b1d9cd6ae533e2c0d32c60d66eb36bdc2dd", "shasum": "" }, "require": { @@ -1273,9 +1273,9 @@ "homepage": "https://github.com/easyengine/site-command", "support": { "issues": "https://github.com/EasyEngine/site-command/issues", - "source": "https://github.com/EasyEngine/site-command/tree/v3.5.0" + "source": "https://github.com/EasyEngine/site-command/tree/v3.5.1" }, - "time": "2025-09-03T12:41:55+00:00" + "time": "2025-09-04T07:03:05+00:00" }, { "name": "easyengine/site-type-php", From eef812fd4c217a9f0327a4246103c8d5c5ba3680 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 4 Sep 2025 12:36:08 +0530 Subject: [PATCH 1023/1044] chore(version): Bump version to 4.9.1 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 6ed7776bf..5b341fd79 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.9.0 +4.9.1 From 5ced2ec91619b38803d069524f293a2fd0f24583 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 4 Sep 2025 14:21:54 +0530 Subject: [PATCH 1024/1044] chore(dependencies): update site-command to v3.5.2 --- composer.json | 2 +- composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index 71191f4f9..38362be85 100644 --- a/composer.json +++ b/composer.json @@ -40,7 +40,7 @@ "easyengine/mailhog-command": "v1.0.3", "easyengine/service-command": "v1.6.2", "easyengine/shell-command": "v1.1.3", - "easyengine/site-command": "v3.5.1", + "easyengine/site-command": "v3.5.2", "easyengine/site-type-php": "v1.9.3", "easyengine/site-type-wp": "v1.9.1", "monolog/monolog": "1.24.0", diff --git a/composer.lock b/composer.lock index 2db4aa2b5..c7297f077 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": "86ccc311bc5e1c62b4bbb296a8d98fdf", + "content-hash": "fda6d0da6c7c541d635f3e24ea141ab7", "packages": [ { "name": "acmephp/core", @@ -1202,16 +1202,16 @@ }, { "name": "easyengine/site-command", - "version": "v3.5.1", + "version": "v3.5.2", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "c6fc3b1d9cd6ae533e2c0d32c60d66eb36bdc2dd" + "reference": "33a11a3d2355650ca41985ab2d2ff7fbb965d270" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/c6fc3b1d9cd6ae533e2c0d32c60d66eb36bdc2dd", - "reference": "c6fc3b1d9cd6ae533e2c0d32c60d66eb36bdc2dd", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/33a11a3d2355650ca41985ab2d2ff7fbb965d270", + "reference": "33a11a3d2355650ca41985ab2d2ff7fbb965d270", "shasum": "" }, "require": { @@ -1273,9 +1273,9 @@ "homepage": "https://github.com/easyengine/site-command", "support": { "issues": "https://github.com/EasyEngine/site-command/issues", - "source": "https://github.com/EasyEngine/site-command/tree/v3.5.1" + "source": "https://github.com/EasyEngine/site-command/tree/v3.5.2" }, - "time": "2025-09-04T07:03:05+00:00" + "time": "2025-09-04T08:47:57+00:00" }, { "name": "easyengine/site-type-php", From 3e6769a2ff01bc719863b522d814be60e41e2988 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 4 Sep 2025 14:22:09 +0530 Subject: [PATCH 1025/1044] chore(versions): update mariadb version for v4.9.1 --- img-versions.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/img-versions.json b/img-versions.json index bbc931720..d0cafc83b 100644 --- a/img-versions.json +++ b/img-versions.json @@ -1,7 +1,7 @@ { "easyengine/cron": "v4.9.1", "easyengine/mailhog": "v4.6.5", - "easyengine/mariadb": "v4.6.6", + "easyengine/mariadb": "v4.9.1", "easyengine/nginx-proxy": "v4.9.1", "easyengine/nginx": "v4.7.6", "easyengine/php": "v4.6.6", From 46a5afaf349ec6e0025b050b9763c198212a5b3b Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Fri, 5 Sep 2025 12:43:22 +0530 Subject: [PATCH 1026/1044] chore(dependencies): update site-command to v3.5.3 --- composer.json | 2 +- composer.lock | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/composer.json b/composer.json index 38362be85..44d244ad5 100644 --- a/composer.json +++ b/composer.json @@ -40,7 +40,7 @@ "easyengine/mailhog-command": "v1.0.3", "easyengine/service-command": "v1.6.2", "easyengine/shell-command": "v1.1.3", - "easyengine/site-command": "v3.5.2", + "easyengine/site-command": "v3.5.3", "easyengine/site-type-php": "v1.9.3", "easyengine/site-type-wp": "v1.9.1", "monolog/monolog": "1.24.0", diff --git a/composer.lock b/composer.lock index c7297f077..d7aec87f7 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": "fda6d0da6c7c541d635f3e24ea141ab7", + "content-hash": "6d25d459d9c1fcec9cfdcaeda705312b", "packages": [ { "name": "acmephp/core", @@ -1202,16 +1202,16 @@ }, { "name": "easyengine/site-command", - "version": "v3.5.2", + "version": "v3.5.3", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "33a11a3d2355650ca41985ab2d2ff7fbb965d270" + "reference": "be13167e1b0af1d16a4d5257d5b65eadde318ce2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/33a11a3d2355650ca41985ab2d2ff7fbb965d270", - "reference": "33a11a3d2355650ca41985ab2d2ff7fbb965d270", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/be13167e1b0af1d16a4d5257d5b65eadde318ce2", + "reference": "be13167e1b0af1d16a4d5257d5b65eadde318ce2", "shasum": "" }, "require": { @@ -1273,9 +1273,9 @@ "homepage": "https://github.com/easyengine/site-command", "support": { "issues": "https://github.com/EasyEngine/site-command/issues", - "source": "https://github.com/EasyEngine/site-command/tree/v3.5.2" + "source": "https://github.com/EasyEngine/site-command/tree/v3.5.3" }, - "time": "2025-09-04T08:47:57+00:00" + "time": "2025-09-05T07:09:43+00:00" }, { "name": "easyengine/site-type-php", @@ -6354,16 +6354,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.13.2", + "version": "3.13.4", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "5b5e3821314f947dd040c70f7992a64eac89025c" + "reference": "ad545ea9c1b7d270ce0fc9cbfb884161cd706119" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/5b5e3821314f947dd040c70f7992a64eac89025c", - "reference": "5b5e3821314f947dd040c70f7992a64eac89025c", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/ad545ea9c1b7d270ce0fc9cbfb884161cd706119", + "reference": "ad545ea9c1b7d270ce0fc9cbfb884161cd706119", "shasum": "" }, "require": { @@ -6434,7 +6434,7 @@ "type": "thanks_dev" } ], - "time": "2025-06-17T22:17:01+00:00" + "time": "2025-09-05T05:47:09+00:00" }, { "name": "theseer/tokenizer", From 0f622987c56517ec64df546d272923b855a26eef Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Fri, 5 Sep 2025 12:43:36 +0530 Subject: [PATCH 1027/1044] chore(version): bump version to 4.9.2 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 5b341fd79..dad10c76d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.9.1 +4.9.2 From 36028177840ee32faeeb6e9dfda04c2108663f46 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Sat, 27 Sep 2025 11:59:37 +0530 Subject: [PATCH 1028/1044] chore(dependencies): update config-command and site-command versions --- composer.json | 4 ++-- composer.lock | 54 ++++++++++++++++++++++++++++++++------------------- 2 files changed, 36 insertions(+), 22 deletions(-) diff --git a/composer.json b/composer.json index 44d244ad5..26ff3d7be 100644 --- a/composer.json +++ b/composer.json @@ -33,14 +33,14 @@ "daverandom/libdns": "^2.0", "easyengine/admin-tools-command": "v1.1.0", "easyengine/auth-command": "v1.2.1", - "easyengine/config-command": "v1.0.2", + "easyengine/config-command": "v1.1.0", "easyengine/cron-command": "v2.1.0", "easyengine/dash-command": "v1.0.0", "easyengine/log-command": "v1.1.0", "easyengine/mailhog-command": "v1.0.3", "easyengine/service-command": "v1.6.2", "easyengine/shell-command": "v1.1.3", - "easyengine/site-command": "v3.5.3", + "easyengine/site-command": "v3.6.0", "easyengine/site-type-php": "v1.9.3", "easyengine/site-type-wp": "v1.9.1", "monolog/monolog": "1.24.0", diff --git a/composer.lock b/composer.lock index d7aec87f7..9be106a07 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": "6d25d459d9c1fcec9cfdcaeda705312b", + "content-hash": "bcd9aa03e412b4987b41bd4ed27da152", "packages": [ { "name": "acmephp/core", @@ -877,16 +877,16 @@ }, { "name": "easyengine/config-command", - "version": "v1.0.2", + "version": "v1.1.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/config-command.git", - "reference": "b48e8cdb9456f7a6a7492415b177867f4228d3f6" + "reference": "78bf37e1161bd6449270a108c309d686849fb723" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/config-command/zipball/b48e8cdb9456f7a6a7492415b177867f4228d3f6", - "reference": "b48e8cdb9456f7a6a7492415b177867f4228d3f6", + "url": "https://api.github.com/repos/EasyEngine/config-command/zipball/78bf37e1161bd6449270a108c309d686849fb723", + "reference": "78bf37e1161bd6449270a108c309d686849fb723", "shasum": "" }, "type": "ee-cli-package", @@ -895,7 +895,9 @@ "commands": [ "config", "config set", - "config get" + "config get", + "config unset", + "config list" ], "branch-alias": { "dev-master": "1.x-dev" @@ -917,9 +919,9 @@ "homepage": "https://github.com/easyengine/config-command", "support": { "issues": "https://github.com/EasyEngine/config-command/issues", - "source": "https://github.com/EasyEngine/config-command/tree/master" + "source": "https://github.com/EasyEngine/config-command/tree/v1.1.0" }, - "time": "2018-12-28T16:04:46+00:00" + "time": "2025-09-27T06:24:03+00:00" }, { "name": "easyengine/cron-command", @@ -1202,16 +1204,16 @@ }, { "name": "easyengine/site-command", - "version": "v3.5.3", + "version": "v3.6.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "be13167e1b0af1d16a4d5257d5b65eadde318ce2" + "reference": "1703db69b0fc6b36cc9fd70cbf34093b7c7fb214" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/be13167e1b0af1d16a4d5257d5b65eadde318ce2", - "reference": "be13167e1b0af1d16a4d5257d5b65eadde318ce2", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/1703db69b0fc6b36cc9fd70cbf34093b7c7fb214", + "reference": "1703db69b0fc6b36cc9fd70cbf34093b7c7fb214", "shasum": "" }, "require": { @@ -1273,9 +1275,9 @@ "homepage": "https://github.com/easyengine/site-command", "support": { "issues": "https://github.com/EasyEngine/site-command/issues", - "source": "https://github.com/EasyEngine/site-command/tree/v3.5.3" + "source": "https://github.com/EasyEngine/site-command/tree/v3.6.0" }, - "time": "2025-09-05T07:09:43+00:00" + "time": "2025-09-27T06:19:10+00:00" }, { "name": "easyengine/site-type-php", @@ -5794,16 +5796,16 @@ }, { "name": "sebastian/exporter", - "version": "4.0.6", + "version": "4.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72" + "reference": "14c6ba52f95a36c3d27c835d65efc7123c446e8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/78c00df8f170e02473b682df15bfcdacc3d32d72", - "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/14c6ba52f95a36c3d27c835d65efc7123c446e8c", + "reference": "14c6ba52f95a36c3d27c835d65efc7123c446e8c", "shasum": "" }, "require": { @@ -5859,15 +5861,27 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.6" + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.8" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/exporter", + "type": "tidelift" } ], - "time": "2024-03-02T06:33:00+00:00" + "time": "2025-09-24T06:03:27+00:00" }, { "name": "sebastian/global-state", From 08587c65330033871f245a29d2a821c7f74cdd68 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Sat, 27 Sep 2025 11:59:45 +0530 Subject: [PATCH 1029/1044] chore(version): bump version to 4.9.3 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index dad10c76d..c01c41335 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.9.2 +4.9.3 From a7619050a2671d8fa92c6e0d768fe857c0407f63 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Sat, 27 Sep 2025 13:09:40 +0530 Subject: [PATCH 1030/1044] chore(dependencies): update site-command to v3.6.1 --- composer.json | 2 +- composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index 26ff3d7be..d66775148 100644 --- a/composer.json +++ b/composer.json @@ -40,7 +40,7 @@ "easyengine/mailhog-command": "v1.0.3", "easyengine/service-command": "v1.6.2", "easyengine/shell-command": "v1.1.3", - "easyengine/site-command": "v3.6.0", + "easyengine/site-command": "v3.6.1", "easyengine/site-type-php": "v1.9.3", "easyengine/site-type-wp": "v1.9.1", "monolog/monolog": "1.24.0", diff --git a/composer.lock b/composer.lock index 9be106a07..c42802f6c 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": "bcd9aa03e412b4987b41bd4ed27da152", + "content-hash": "38239b1f3f76566f4fd12060f79d65d0", "packages": [ { "name": "acmephp/core", @@ -1204,16 +1204,16 @@ }, { "name": "easyengine/site-command", - "version": "v3.6.0", + "version": "v3.6.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "1703db69b0fc6b36cc9fd70cbf34093b7c7fb214" + "reference": "8a13026a9e499d1318b369adc93f953a0afc1a66" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/1703db69b0fc6b36cc9fd70cbf34093b7c7fb214", - "reference": "1703db69b0fc6b36cc9fd70cbf34093b7c7fb214", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/8a13026a9e499d1318b369adc93f953a0afc1a66", + "reference": "8a13026a9e499d1318b369adc93f953a0afc1a66", "shasum": "" }, "require": { @@ -1275,9 +1275,9 @@ "homepage": "https://github.com/easyengine/site-command", "support": { "issues": "https://github.com/EasyEngine/site-command/issues", - "source": "https://github.com/EasyEngine/site-command/tree/v3.6.0" + "source": "https://github.com/EasyEngine/site-command/tree/v3.6.1" }, - "time": "2025-09-27T06:19:10+00:00" + "time": "2025-09-27T07:38:40+00:00" }, { "name": "easyengine/site-type-php", From a9a56b64d3de6b0c5ec868b2de5a7873a6c27987 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Wed, 1 Oct 2025 14:58:59 +0530 Subject: [PATCH 1031/1044] feat(migrations): implement concurrent docker image pulls --- ...asyengine_insert_docker_images_version.php | 40 +++++++++++++++++-- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/migrations/db/20181016052850_easyengine_insert_docker_images_version.php b/migrations/db/20181016052850_easyengine_insert_docker_images_version.php index c9f6f1cb5..f8d0d35a1 100644 --- a/migrations/db/20181016052850_easyengine_insert_docker_images_version.php +++ b/migrations/db/20181016052850_easyengine_insert_docker_images_version.php @@ -4,6 +4,7 @@ use EE; use EE\Migration\Base; +use Symfony\Component\Process\Process; class InsertDockerImagesVersion extends Base { @@ -37,18 +38,51 @@ public function up() { 'easyengine/php7.2', 'easyengine/php7.3', 'easyengine/php7.4', + 'easyengine/php', 'easyengine/php8.0', 'easyengine/php8.1', + 'easyengine/php8.4', + 'easyengine/mailhog', 'easyengine/newrelic-daemon', ]; + + $pull_queue = []; foreach ( $images as $image => $tag ) { if ( in_array( $image, $skip_download ) ) { continue; } - EE::log( "Checking and Pulling docker image $image:$tag" ); - if ( ! \EE::exec( "docker pull ${image}:${tag}", true, true ) ) { - throw new \Exception( "Unable to pull ${image}:${tag}. Please check logs for more details." ); + $pull_queue[] = [ $image, $tag ]; + } + + $concurrency = 4; + $running = []; + $successful_pulls = []; + + while ( ! empty( $pull_queue ) || ! empty( $running ) ) { + // Start new processes if under concurrency limit + while ( count( $running ) < $concurrency && ! empty( $pull_queue ) ) { + list( $image, $tag ) = array_shift( $pull_queue ); + EE::log( "Checking and Pulling docker image $image:$tag" ); + $process = new Process( [ 'docker', 'pull', "$image:$tag" ] ); + $process->start(); + $running[] = [ $process, $image, $tag ]; } + + // Check for finished processes + foreach ( $running as $key => list( $process, $image, $tag ) ) { + if ( ! $process->isRunning() ) { + if ( ! $process->isSuccessful() ) { + throw new \Exception( "Unable to pull $image:$tag: " . $process->getErrorOutput() ); + } + $successful_pulls[] = [ $image, $tag ]; + unset( $running[ $key ] ); + } + } + + usleep( 100000 ); // Sleep 100ms to avoid busy loop + } + + foreach ( $successful_pulls as list( $image, $tag ) ) { $query .= "INSERT INTO options VALUES( '${image}', '${tag}' );"; } From 7f8dfedb7f9324a476c1fee971ffd8d666004196 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Wed, 1 Oct 2025 15:01:00 +0530 Subject: [PATCH 1032/1044] chore(migrations): remove php8.4 from skip download list --- .../20181016052850_easyengine_insert_docker_images_version.php | 1 - 1 file changed, 1 deletion(-) diff --git a/migrations/db/20181016052850_easyengine_insert_docker_images_version.php b/migrations/db/20181016052850_easyengine_insert_docker_images_version.php index f8d0d35a1..8fb651702 100644 --- a/migrations/db/20181016052850_easyengine_insert_docker_images_version.php +++ b/migrations/db/20181016052850_easyengine_insert_docker_images_version.php @@ -41,7 +41,6 @@ public function up() { 'easyengine/php', 'easyengine/php8.0', 'easyengine/php8.1', - 'easyengine/php8.4', 'easyengine/mailhog', 'easyengine/newrelic-daemon', ]; From 285886fe409499eef3d88f8eff1a7606fd673b3b Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Wed, 1 Oct 2025 15:07:59 +0530 Subject: [PATCH 1033/1044] fix(formatter): improve JSON output formatting --- php/EE/Formatter.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/php/EE/Formatter.php b/php/EE/Formatter.php index b3dab359f..cee1e4857 100644 --- a/php/EE/Formatter.php +++ b/php/EE/Formatter.php @@ -156,9 +156,9 @@ private function format( $items, $ascii_pre_colorized = false ) { if ( 'json' === $this->args['format'] ) { if ( defined( 'JSON_PARTIAL_OUTPUT_ON_ERROR' ) ) { - echo json_encode( $out, JSON_PARTIAL_OUTPUT_ON_ERROR ); + echo json_encode( $out, JSON_PRETTY_PRINT | JSON_PARTIAL_OUTPUT_ON_ERROR ); } else { - echo json_encode( $out ); + echo json_encode( $out, JSON_PRETTY_PRINT ); } } elseif ( 'yaml' === $this->args['format'] ) { echo Spyc::YAMLDump( $out, 2, 0 ); @@ -200,7 +200,7 @@ private function show_single_field( $items, $field ) { } if ( 'json' == $this->args['format'] ) { - echo json_encode( $values ); + echo json_encode( $values, JSON_PRETTY_PRINT ); } } From 01ccc23003b5888865a46e8e98cacf0a9f54a200 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 9 Oct 2025 10:14:53 +0530 Subject: [PATCH 1034/1044] update(dependencies): update site-command to v3.6.2 --- composer.json | 2 +- composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index d66775148..260673182 100644 --- a/composer.json +++ b/composer.json @@ -40,7 +40,7 @@ "easyengine/mailhog-command": "v1.0.3", "easyengine/service-command": "v1.6.2", "easyengine/shell-command": "v1.1.3", - "easyengine/site-command": "v3.6.1", + "easyengine/site-command": "v3.6.2", "easyengine/site-type-php": "v1.9.3", "easyengine/site-type-wp": "v1.9.1", "monolog/monolog": "1.24.0", diff --git a/composer.lock b/composer.lock index c42802f6c..201a8c70f 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": "38239b1f3f76566f4fd12060f79d65d0", + "content-hash": "f7be5c6119b8b30c621ba02872957f6e", "packages": [ { "name": "acmephp/core", @@ -1204,16 +1204,16 @@ }, { "name": "easyengine/site-command", - "version": "v3.6.1", + "version": "v3.6.2", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "8a13026a9e499d1318b369adc93f953a0afc1a66" + "reference": "a3a5890d5a4d42c15f09f80d7cb63f3ef1e14c4a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/8a13026a9e499d1318b369adc93f953a0afc1a66", - "reference": "8a13026a9e499d1318b369adc93f953a0afc1a66", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/a3a5890d5a4d42c15f09f80d7cb63f3ef1e14c4a", + "reference": "a3a5890d5a4d42c15f09f80d7cb63f3ef1e14c4a", "shasum": "" }, "require": { @@ -1275,9 +1275,9 @@ "homepage": "https://github.com/easyengine/site-command", "support": { "issues": "https://github.com/EasyEngine/site-command/issues", - "source": "https://github.com/EasyEngine/site-command/tree/v3.6.1" + "source": "https://github.com/EasyEngine/site-command/tree/v3.6.2" }, - "time": "2025-09-27T07:38:40+00:00" + "time": "2025-10-09T04:43:43+00:00" }, { "name": "easyengine/site-type-php", From ebe0496bf7dd96f58ee0af4521406758af72be3b Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 30 Oct 2025 15:12:39 +0530 Subject: [PATCH 1035/1044] fix(dependencies): update site-command to v3.6.4 and site-type-wp to v1.9.2 --- composer.json | 4 ++-- composer.lock | 26 +++++++++++++------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/composer.json b/composer.json index 260673182..d58e4abd4 100644 --- a/composer.json +++ b/composer.json @@ -40,9 +40,9 @@ "easyengine/mailhog-command": "v1.0.3", "easyengine/service-command": "v1.6.2", "easyengine/shell-command": "v1.1.3", - "easyengine/site-command": "v3.6.2", + "easyengine/site-command": "v3.6.4", "easyengine/site-type-php": "v1.9.3", - "easyengine/site-type-wp": "v1.9.1", + "easyengine/site-type-wp": "v1.9.2", "monolog/monolog": "1.24.0", "mustache/mustache": "2.14.1", "rmccue/requests": "^2.0", diff --git a/composer.lock b/composer.lock index 201a8c70f..2c1daf0cc 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": "f7be5c6119b8b30c621ba02872957f6e", + "content-hash": "aa1dbc1668ea67aa104ffe8d173f39b8", "packages": [ { "name": "acmephp/core", @@ -1204,16 +1204,16 @@ }, { "name": "easyengine/site-command", - "version": "v3.6.2", + "version": "v3.6.4", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "a3a5890d5a4d42c15f09f80d7cb63f3ef1e14c4a" + "reference": "2c078b856bd704e534780fdf79ceae8cccfed075" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/a3a5890d5a4d42c15f09f80d7cb63f3ef1e14c4a", - "reference": "a3a5890d5a4d42c15f09f80d7cb63f3ef1e14c4a", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/2c078b856bd704e534780fdf79ceae8cccfed075", + "reference": "2c078b856bd704e534780fdf79ceae8cccfed075", "shasum": "" }, "require": { @@ -1275,9 +1275,9 @@ "homepage": "https://github.com/easyengine/site-command", "support": { "issues": "https://github.com/EasyEngine/site-command/issues", - "source": "https://github.com/EasyEngine/site-command/tree/v3.6.2" + "source": "https://github.com/EasyEngine/site-command/tree/v3.6.4" }, - "time": "2025-10-09T04:43:43+00:00" + "time": "2025-10-30T09:29:46+00:00" }, { "name": "easyengine/site-type-php", @@ -1340,16 +1340,16 @@ }, { "name": "easyengine/site-type-wp", - "version": "v1.9.1", + "version": "v1.9.2", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-wp.git", - "reference": "f95ab4c2f1d6c38fb7a61f24825ec9aac405d4cc" + "reference": "3e2d24c3e00728441956179bd5f75687f21ffe33" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/f95ab4c2f1d6c38fb7a61f24825ec9aac405d4cc", - "reference": "f95ab4c2f1d6c38fb7a61f24825ec9aac405d4cc", + "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/3e2d24c3e00728441956179bd5f75687f21ffe33", + "reference": "3e2d24c3e00728441956179bd5f75687f21ffe33", "shasum": "" }, "require-dev": { @@ -1393,9 +1393,9 @@ "homepage": "https://github.com/easyengine/site-type-wp", "support": { "issues": "https://github.com/EasyEngine/site-type-wp/issues", - "source": "https://github.com/EasyEngine/site-type-wp/tree/v1.9.1" + "source": "https://github.com/EasyEngine/site-type-wp/tree/v1.9.2" }, - "time": "2025-02-13T11:48:15+00:00" + "time": "2025-09-03T12:44:39+00:00" }, { "name": "guzzlehttp/guzzle", From cb00d67380650bc2f30e7e3879f662fa76bcfc0b Mon Sep 17 00:00:00 2001 From: L0RD-ZER0 <68327382+L0RD-ZER0@users.noreply.github.com> Date: Wed, 26 Nov 2025 15:04:16 +0530 Subject: [PATCH 1036/1044] feat: php-fpm 8.5 support --- .github/workflows/test_and_build.yml | 2 +- img-versions.json | 1 + php/EE/Migration/Containers.php | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index dae8c244f..3057c075d 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -92,7 +92,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4'] + php: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5'] steps: - name: Check out source code uses: actions/checkout@v3 diff --git a/img-versions.json b/img-versions.json index d0cafc83b..7ce534fba 100644 --- a/img-versions.json +++ b/img-versions.json @@ -15,6 +15,7 @@ "easyengine/php8.2": "v4.9.1", "easyengine/php8.3": "v4.9.1", "easyengine/php8.4": "v4.9.1", + "easyengine/php8.5": "v4.9.4", "easyengine/postfix": "v4.8.1", "easyengine/redis": "v4.9.1", "easyengine/newrelic-daemon": "v4.9.0" diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index 70101a0ca..b00b94918 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -39,6 +39,7 @@ public static function start_container_migration() { 'easyengine/php8.2', 'easyengine/php8.3', 'easyengine/php8.4', + 'easyengine/php8.5', 'easyengine/newrelic-daemon', ]; @@ -140,7 +141,7 @@ public static function update_docker_compose() { $fs = new Filesystem(); if ( ! $fs->exists( EE_BACKUP_DIR ) ) { $fs->mkdir( EE_BACKUP_DIR ); - } + } $fs->copy( $docker_compose_path, $docker_compose_backup_path ); EE::exec( "curl -L https://github.com/docker/compose/releases/download/v2.27.0/docker-compose-$(uname -s)-$(uname -m) -o $docker_compose_new_path && chmod +x $docker_compose_new_path" ); From b4bd92c2ba22a6f057255f3f4cd43e10f6cb8dc7 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 11 Dec 2025 14:44:51 +0530 Subject: [PATCH 1037/1044] fix(img-versions): update php8.5 version to v4.10.0 --- img-versions.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/img-versions.json b/img-versions.json index 7ce534fba..a935e75a6 100644 --- a/img-versions.json +++ b/img-versions.json @@ -15,7 +15,7 @@ "easyengine/php8.2": "v4.9.1", "easyengine/php8.3": "v4.9.1", "easyengine/php8.4": "v4.9.1", - "easyengine/php8.5": "v4.9.4", + "easyengine/php8.5": "v4.10.0", "easyengine/postfix": "v4.8.1", "easyengine/redis": "v4.9.1", "easyengine/newrelic-daemon": "v4.9.0" From 889f56943dd2fd0fb6ed0ca5588240ab1a6d99b6 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 11 Dec 2025 15:01:48 +0530 Subject: [PATCH 1038/1044] update(img-versions): update images for v4.10.0 --- img-versions.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/img-versions.json b/img-versions.json index a935e75a6..90b99eda2 100644 --- a/img-versions.json +++ b/img-versions.json @@ -1,8 +1,8 @@ { - "easyengine/cron": "v4.9.1", + "easyengine/cron": "v4.10.0", "easyengine/mailhog": "v4.6.5", "easyengine/mariadb": "v4.9.1", - "easyengine/nginx-proxy": "v4.9.1", + "easyengine/nginx-proxy": "v4.10.0", "easyengine/nginx": "v4.7.6", "easyengine/php": "v4.6.6", "easyengine/php5.6": "v4.7.4", @@ -13,10 +13,10 @@ "easyengine/php8.0": "v4.8.1", "easyengine/php8.1": "v4.9.0", "easyengine/php8.2": "v4.9.1", - "easyengine/php8.3": "v4.9.1", - "easyengine/php8.4": "v4.9.1", + "easyengine/php8.3": "v4.10.0", + "easyengine/php8.4": "v4.10.0", "easyengine/php8.5": "v4.10.0", - "easyengine/postfix": "v4.8.1", - "easyengine/redis": "v4.9.1", - "easyengine/newrelic-daemon": "v4.9.0" + "easyengine/postfix": "v4.10.0", + "easyengine/redis": "v4.10.0", + "easyengine/newrelic-daemon": "v4.10.0" } From e84521f8251caf32292d0dfe74de2f864026e00a Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 11 Dec 2025 15:18:33 +0530 Subject: [PATCH 1039/1044] chrom(dependencies): update dash-command and site packages --- composer.json | 8 ++-- composer.lock | 123 +++++++++++++++++++++++--------------------------- 2 files changed, 60 insertions(+), 71 deletions(-) diff --git a/composer.json b/composer.json index d58e4abd4..15e7614d0 100644 --- a/composer.json +++ b/composer.json @@ -35,14 +35,14 @@ "easyengine/auth-command": "v1.2.1", "easyengine/config-command": "v1.1.0", "easyengine/cron-command": "v2.1.0", - "easyengine/dash-command": "v1.0.0", + "easyengine/dash-command": "v1.0.1", "easyengine/log-command": "v1.1.0", "easyengine/mailhog-command": "v1.0.3", "easyengine/service-command": "v1.6.2", "easyengine/shell-command": "v1.1.3", - "easyengine/site-command": "v3.6.4", - "easyengine/site-type-php": "v1.9.3", - "easyengine/site-type-wp": "v1.9.2", + "easyengine/site-command": "v3.7.0", + "easyengine/site-type-php": "v1.10.0", + "easyengine/site-type-wp": "v1.10.0", "monolog/monolog": "1.24.0", "mustache/mustache": "2.14.1", "rmccue/requests": "^2.0", diff --git a/composer.lock b/composer.lock index 2c1daf0cc..9ae2860e0 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": "aa1dbc1668ea67aa104ffe8d173f39b8", + "content-hash": "0d1a2c50f57ccae3588bfcb0155c3b0b", "packages": [ { "name": "acmephp/core", @@ -199,16 +199,16 @@ }, { "name": "composer/ca-bundle", - "version": "1.5.8", + "version": "1.5.10", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "719026bb30813accb68271fee7e39552a58e9f65" + "reference": "961a5e4056dd2e4a2eedcac7576075947c28bf63" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/719026bb30813accb68271fee7e39552a58e9f65", - "reference": "719026bb30813accb68271fee7e39552a58e9f65", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/961a5e4056dd2e4a2eedcac7576075947c28bf63", + "reference": "961a5e4056dd2e4a2eedcac7576075947c28bf63", "shasum": "" }, "require": { @@ -255,7 +255,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.5.8" + "source": "https://github.com/composer/ca-bundle/tree/1.5.10" }, "funding": [ { @@ -267,7 +267,7 @@ "type": "github" } ], - "time": "2025-08-20T18:49:47+00:00" + "time": "2025-12-08T15:06:51+00:00" }, { "name": "composer/composer", @@ -976,16 +976,16 @@ }, { "name": "easyengine/dash-command", - "version": "v1.0.0", + "version": "v1.0.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/dash-command.git", - "reference": "83f20d113b28211dfb9851b7670603d832e4a735" + "reference": "ad84e936af9f28d19e911c330752e5ebe282cc5d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/dash-command/zipball/83f20d113b28211dfb9851b7670603d832e4a735", - "reference": "83f20d113b28211dfb9851b7670603d832e4a735", + "url": "https://api.github.com/repos/EasyEngine/dash-command/zipball/ad84e936af9f28d19e911c330752e5ebe282cc5d", + "reference": "ad84e936af9f28d19e911c330752e5ebe282cc5d", "shasum": "" }, "type": "ee-cli-package", @@ -1015,9 +1015,9 @@ "homepage": "https://github.com/easyengine/dash-command", "support": { "issues": "https://github.com/EasyEngine/dash-command/issues", - "source": "https://github.com/EasyEngine/dash-command/tree/v1.0.0" + "source": "https://github.com/EasyEngine/dash-command/tree/v1.0.1" }, - "time": "2025-07-10T12:39:35+00:00" + "time": "2025-12-11T04:42:36+00:00" }, { "name": "easyengine/log-command", @@ -1204,16 +1204,16 @@ }, { "name": "easyengine/site-command", - "version": "v3.6.4", + "version": "v3.7.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "2c078b856bd704e534780fdf79ceae8cccfed075" + "reference": "420d131add02a30fcdff4ff8ce79969134f76a7f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/2c078b856bd704e534780fdf79ceae8cccfed075", - "reference": "2c078b856bd704e534780fdf79ceae8cccfed075", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/420d131add02a30fcdff4ff8ce79969134f76a7f", + "reference": "420d131add02a30fcdff4ff8ce79969134f76a7f", "shasum": "" }, "require": { @@ -1275,22 +1275,22 @@ "homepage": "https://github.com/easyengine/site-command", "support": { "issues": "https://github.com/EasyEngine/site-command/issues", - "source": "https://github.com/EasyEngine/site-command/tree/v3.6.4" + "source": "https://github.com/EasyEngine/site-command/tree/v3.7.0" }, - "time": "2025-10-30T09:29:46+00:00" + "time": "2025-12-11T09:40:02+00:00" }, { "name": "easyengine/site-type-php", - "version": "v1.9.3", + "version": "v1.10.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-php.git", - "reference": "c85b623cb2a2ff3dfe2b483f157fe6e1f2ce042c" + "reference": "f91ddb15b0353a9e4e15bc53b5dbbdf98b2c7b50" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/c85b623cb2a2ff3dfe2b483f157fe6e1f2ce042c", - "reference": "c85b623cb2a2ff3dfe2b483f157fe6e1f2ce042c", + "url": "https://api.github.com/repos/EasyEngine/site-type-php/zipball/f91ddb15b0353a9e4e15bc53b5dbbdf98b2c7b50", + "reference": "f91ddb15b0353a9e4e15bc53b5dbbdf98b2c7b50", "shasum": "" }, "require-dev": { @@ -1334,22 +1334,22 @@ "homepage": "https://github.com/easyengine/site-type-php", "support": { "issues": "https://github.com/EasyEngine/site-type-php/issues", - "source": "https://github.com/EasyEngine/site-type-php/tree/v1.9.3" + "source": "https://github.com/EasyEngine/site-type-php/tree/v1.10.0" }, - "time": "2025-09-03T12:44:10+00:00" + "time": "2025-12-11T09:40:43+00:00" }, { "name": "easyengine/site-type-wp", - "version": "v1.9.2", + "version": "v1.10.0", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-type-wp.git", - "reference": "3e2d24c3e00728441956179bd5f75687f21ffe33" + "reference": "1dffdfffdd45d188a069144fd8e8969508c29101" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/3e2d24c3e00728441956179bd5f75687f21ffe33", - "reference": "3e2d24c3e00728441956179bd5f75687f21ffe33", + "url": "https://api.github.com/repos/EasyEngine/site-type-wp/zipball/1dffdfffdd45d188a069144fd8e8969508c29101", + "reference": "1dffdfffdd45d188a069144fd8e8969508c29101", "shasum": "" }, "require-dev": { @@ -1393,9 +1393,9 @@ "homepage": "https://github.com/easyengine/site-type-wp", "support": { "issues": "https://github.com/EasyEngine/site-type-wp/issues", - "source": "https://github.com/EasyEngine/site-type-wp/tree/v1.9.2" + "source": "https://github.com/EasyEngine/site-type-wp/tree/v1.10.0" }, - "time": "2025-09-03T12:44:39+00:00" + "time": "2025-12-11T09:41:04+00:00" }, { "name": "guzzlehttp/guzzle", @@ -2389,16 +2389,16 @@ }, { "name": "rmccue/requests", - "version": "v2.0.15", + "version": "v2.0.16", "source": { "type": "git", "url": "https://github.com/WordPress/Requests.git", - "reference": "877cd66169755899682f1595e057334b40d9d149" + "reference": "babd303d2084cf2690db536aeb6eef58326ee3ff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/WordPress/Requests/zipball/877cd66169755899682f1595e057334b40d9d149", - "reference": "877cd66169755899682f1595e057334b40d9d149", + "url": "https://api.github.com/repos/WordPress/Requests/zipball/babd303d2084cf2690db536aeb6eef58326ee3ff", + "reference": "babd303d2084cf2690db536aeb6eef58326ee3ff", "shasum": "" }, "require": { @@ -2406,15 +2406,14 @@ "php": ">=5.6" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || ^1.0", "php-parallel-lint/php-console-highlighter": "^0.5.0", "php-parallel-lint/php-parallel-lint": "^1.3.1", - "phpcompatibility/php-compatibility": "^9.0", + "phpcompatibility/php-compatibility": "^10.0.0@dev", "requests/test-server": "dev-main", - "roave/security-advisories": "dev-latest", "squizlabs/php_codesniffer": "^3.6", "wp-coding-standards/wpcs": "^2.0", - "yoast/phpunit-polyfills": "^1.0.0" + "yoast/phpunit-polyfills": "^1.1.5" }, "suggest": { "art4/requests-psr18-adapter": "For using Requests as a PSR-18 HTTP Client", @@ -2472,7 +2471,7 @@ "issues": "https://github.com/WordPress/Requests/issues", "source": "https://github.com/WordPress/Requests" }, - "time": "2025-01-21T10:13:31+00:00" + "time": "2025-11-21T23:56:29+00:00" }, { "name": "seld/jsonlint", @@ -4705,16 +4704,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.19.4", + "version": "v4.19.5", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "715f4d25e225bc47b293a8b997fe6ce99bf987d2" + "reference": "51bd93cc741b7fc3d63d20b6bdcd99fdaa359837" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/715f4d25e225bc47b293a8b997fe6ce99bf987d2", - "reference": "715f4d25e225bc47b293a8b997fe6ce99bf987d2", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/51bd93cc741b7fc3d63d20b6bdcd99fdaa359837", + "reference": "51bd93cc741b7fc3d63d20b6bdcd99fdaa359837", "shasum": "" }, "require": { @@ -4729,11 +4728,6 @@ "bin/php-parse" ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.9-dev" - } - }, "autoload": { "psr-4": { "PhpParser\\": "lib/PhpParser" @@ -4755,9 +4749,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.19.4" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.19.5" }, - "time": "2024-09-29T15:01:53+00:00" + "time": "2025-12-06T11:45:25+00:00" }, { "name": "phar-io/manifest", @@ -6368,16 +6362,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.13.4", + "version": "3.13.5", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "ad545ea9c1b7d270ce0fc9cbfb884161cd706119" + "reference": "0ca86845ce43291e8f5692c7356fccf3bcf02bf4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/ad545ea9c1b7d270ce0fc9cbfb884161cd706119", - "reference": "ad545ea9c1b7d270ce0fc9cbfb884161cd706119", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/0ca86845ce43291e8f5692c7356fccf3bcf02bf4", + "reference": "0ca86845ce43291e8f5692c7356fccf3bcf02bf4", "shasum": "" }, "require": { @@ -6394,11 +6388,6 @@ "bin/phpcs" ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" @@ -6448,20 +6437,20 @@ "type": "thanks_dev" } ], - "time": "2025-09-05T05:47:09+00:00" + "time": "2025-11-04T16:30:35+00:00" }, { "name": "theseer/tokenizer", - "version": "1.2.3", + "version": "1.3.1", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" + "reference": "b7489ce515e168639d17feec34b8847c326b0b3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", - "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b7489ce515e168639d17feec34b8847c326b0b3c", + "reference": "b7489ce515e168639d17feec34b8847c326b0b3c", "shasum": "" }, "require": { @@ -6490,7 +6479,7 @@ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "support": { "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.3" + "source": "https://github.com/theseer/tokenizer/tree/1.3.1" }, "funding": [ { @@ -6498,7 +6487,7 @@ "type": "github" } ], - "time": "2024-03-03T12:36:25+00:00" + "time": "2025-11-17T20:03:58+00:00" }, { "name": "wp-coding-standards/wpcs", From 1130ab50b3c536072149b05a3925c982f587fb24 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 11 Dec 2025 15:18:59 +0530 Subject: [PATCH 1040/1044] chore(version): update version from 4.9.3 to 4.10.0 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index c01c41335..2da431623 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.9.3 +4.10.0 From 2ae8a606fa8b7d84be5264c5c1a2316ce6fc3cb2 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Thu, 11 Dec 2025 18:40:42 +0530 Subject: [PATCH 1041/1044] fix(img-versions): correct postfix version to v4.8.1 --- img-versions.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/img-versions.json b/img-versions.json index 90b99eda2..99284685f 100644 --- a/img-versions.json +++ b/img-versions.json @@ -16,7 +16,7 @@ "easyengine/php8.3": "v4.10.0", "easyengine/php8.4": "v4.10.0", "easyengine/php8.5": "v4.10.0", - "easyengine/postfix": "v4.10.0", + "easyengine/postfix": "v4.8.1", "easyengine/redis": "v4.10.0", "easyengine/newrelic-daemon": "v4.10.0" } From 4978a824431c5872752d0fa04a8dcd73bbae49c4 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Mon, 22 Dec 2025 11:46:52 +0530 Subject: [PATCH 1042/1044] update(dependencies): update site-command to v3.7.1 --- composer.json | 2 +- composer.lock | 36 ++++++++++++++++++------------------ 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/composer.json b/composer.json index 15e7614d0..e8e9bd2c1 100644 --- a/composer.json +++ b/composer.json @@ -40,7 +40,7 @@ "easyengine/mailhog-command": "v1.0.3", "easyengine/service-command": "v1.6.2", "easyengine/shell-command": "v1.1.3", - "easyengine/site-command": "v3.7.0", + "easyengine/site-command": "v3.7.1", "easyengine/site-type-php": "v1.10.0", "easyengine/site-type-wp": "v1.10.0", "monolog/monolog": "1.24.0", diff --git a/composer.lock b/composer.lock index 9ae2860e0..d269da268 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": "0d1a2c50f57ccae3588bfcb0155c3b0b", + "content-hash": "820a570b529827488e4436bc9d855829", "packages": [ { "name": "acmephp/core", @@ -1204,16 +1204,16 @@ }, { "name": "easyengine/site-command", - "version": "v3.7.0", + "version": "v3.7.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "420d131add02a30fcdff4ff8ce79969134f76a7f" + "reference": "4fc12e9e0fbf7df8288c64f500add8e400835f68" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/420d131add02a30fcdff4ff8ce79969134f76a7f", - "reference": "420d131add02a30fcdff4ff8ce79969134f76a7f", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/4fc12e9e0fbf7df8288c64f500add8e400835f68", + "reference": "4fc12e9e0fbf7df8288c64f500add8e400835f68", "shasum": "" }, "require": { @@ -1275,9 +1275,9 @@ "homepage": "https://github.com/easyengine/site-command", "support": { "issues": "https://github.com/EasyEngine/site-command/issues", - "source": "https://github.com/EasyEngine/site-command/tree/v3.7.0" + "source": "https://github.com/EasyEngine/site-command/tree/v3.7.1" }, - "time": "2025-12-11T09:40:02+00:00" + "time": "2025-12-22T05:53:17+00:00" }, { "name": "easyengine/site-type-php", @@ -1713,16 +1713,16 @@ }, { "name": "justinrainbow/json-schema", - "version": "5.3.0", + "version": "5.3.1", "source": { "type": "git", "url": "https://github.com/jsonrainbow/json-schema.git", - "reference": "feb2ca6dd1cebdaf1ed60a4c8de2e53ce11c4fd8" + "reference": "b5a44b6391a3bbb75c9f2b73e1ef03d6045e1e20" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/jsonrainbow/json-schema/zipball/feb2ca6dd1cebdaf1ed60a4c8de2e53ce11c4fd8", - "reference": "feb2ca6dd1cebdaf1ed60a4c8de2e53ce11c4fd8", + "url": "https://api.github.com/repos/jsonrainbow/json-schema/zipball/b5a44b6391a3bbb75c9f2b73e1ef03d6045e1e20", + "reference": "b5a44b6391a3bbb75c9f2b73e1ef03d6045e1e20", "shasum": "" }, "require": { @@ -1772,9 +1772,9 @@ ], "support": { "issues": "https://github.com/jsonrainbow/json-schema/issues", - "source": "https://github.com/jsonrainbow/json-schema/tree/5.3.0" + "source": "https://github.com/jsonrainbow/json-schema/tree/5.3.1" }, - "time": "2024-07-06T21:00:26+00:00" + "time": "2025-12-12T08:56:22+00:00" }, { "name": "league/flysystem", @@ -2389,16 +2389,16 @@ }, { "name": "rmccue/requests", - "version": "v2.0.16", + "version": "v2.0.17", "source": { "type": "git", "url": "https://github.com/WordPress/Requests.git", - "reference": "babd303d2084cf2690db536aeb6eef58326ee3ff" + "reference": "74d1648cc34e16a42ea25d548fc73ec107a90421" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/WordPress/Requests/zipball/babd303d2084cf2690db536aeb6eef58326ee3ff", - "reference": "babd303d2084cf2690db536aeb6eef58326ee3ff", + "url": "https://api.github.com/repos/WordPress/Requests/zipball/74d1648cc34e16a42ea25d548fc73ec107a90421", + "reference": "74d1648cc34e16a42ea25d548fc73ec107a90421", "shasum": "" }, "require": { @@ -2471,7 +2471,7 @@ "issues": "https://github.com/WordPress/Requests/issues", "source": "https://github.com/WordPress/Requests" }, - "time": "2025-11-21T23:56:29+00:00" + "time": "2025-12-12T17:47:19+00:00" }, { "name": "seld/jsonlint", From 390bf548e9729a68573cc75d3376dd2d5cb7bbe5 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Fri, 26 Dec 2025 15:36:50 +0530 Subject: [PATCH 1043/1044] chore(dependencies): update admin-tools-command to v1.1.1 and site-command to v3.7.2 --- composer.json | 4 ++-- composer.lock | 26 +++++++++++++------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/composer.json b/composer.json index e8e9bd2c1..2d14743d9 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "composer/composer": "2.2.24", "composer/semver": "3.2.4", "daverandom/libdns": "^2.0", - "easyengine/admin-tools-command": "v1.1.0", + "easyengine/admin-tools-command": "v1.1.1", "easyengine/auth-command": "v1.2.1", "easyengine/config-command": "v1.1.0", "easyengine/cron-command": "v2.1.0", @@ -40,7 +40,7 @@ "easyengine/mailhog-command": "v1.0.3", "easyengine/service-command": "v1.6.2", "easyengine/shell-command": "v1.1.3", - "easyengine/site-command": "v3.7.1", + "easyengine/site-command": "v3.7.2", "easyengine/site-type-php": "v1.10.0", "easyengine/site-type-wp": "v1.10.0", "monolog/monolog": "1.24.0", diff --git a/composer.lock b/composer.lock index d269da268..dd55d7f6d 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": "820a570b529827488e4436bc9d855829", + "content-hash": "56f7965b03832415cb0cc5a7abd55e32", "packages": [ { "name": "acmephp/core", @@ -781,16 +781,16 @@ }, { "name": "easyengine/admin-tools-command", - "version": "v1.1.0", + "version": "v1.1.1", "source": { "type": "git", "url": "https://github.com/EasyEngine/admin-tools-command.git", - "reference": "6c7b1cc950e8012e521336260ac60052769c5918" + "reference": "2bdafc7d683424a156c00b5c82a4ac45f6797c74" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/admin-tools-command/zipball/6c7b1cc950e8012e521336260ac60052769c5918", - "reference": "6c7b1cc950e8012e521336260ac60052769c5918", + "url": "https://api.github.com/repos/EasyEngine/admin-tools-command/zipball/2bdafc7d683424a156c00b5c82a4ac45f6797c74", + "reference": "2bdafc7d683424a156c00b5c82a4ac45f6797c74", "shasum": "" }, "type": "ee-cli-package", @@ -821,9 +821,9 @@ "homepage": "https://github.com/easyengine/amdin-tools", "support": { "issues": "https://github.com/EasyEngine/admin-tools-command/issues", - "source": "https://github.com/EasyEngine/admin-tools-command/tree/v1.1.0" + "source": "https://github.com/EasyEngine/admin-tools-command/tree/v1.1.1" }, - "time": "2021-06-16T14:18:24+00:00" + "time": "2025-12-26T10:05:26+00:00" }, { "name": "easyengine/auth-command", @@ -1204,16 +1204,16 @@ }, { "name": "easyengine/site-command", - "version": "v3.7.1", + "version": "v3.7.2", "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "4fc12e9e0fbf7df8288c64f500add8e400835f68" + "reference": "092418cbcbe448b49fb599d60d86ed2f5f93a411" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/4fc12e9e0fbf7df8288c64f500add8e400835f68", - "reference": "4fc12e9e0fbf7df8288c64f500add8e400835f68", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/092418cbcbe448b49fb599d60d86ed2f5f93a411", + "reference": "092418cbcbe448b49fb599d60d86ed2f5f93a411", "shasum": "" }, "require": { @@ -1275,9 +1275,9 @@ "homepage": "https://github.com/easyengine/site-command", "support": { "issues": "https://github.com/EasyEngine/site-command/issues", - "source": "https://github.com/EasyEngine/site-command/tree/v3.7.1" + "source": "https://github.com/EasyEngine/site-command/tree/v3.7.2" }, - "time": "2025-12-22T05:53:17+00:00" + "time": "2025-12-26T10:03:57+00:00" }, { "name": "easyengine/site-type-php", From 615809176222dab5df92f38612dac5e716967828 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi <riddhesh237@gmail.com> Date: Fri, 26 Dec 2025 15:37:09 +0530 Subject: [PATCH 1044/1044] chore(version): update version from 4.10.0 to 4.10.1 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 2da431623..ad96464c4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.10.0 +4.10.1