├── .github ├── .metadata.json ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── COPYING.txt ├── LICENSE.txt ├── README.md ├── autoload.php ├── bin ├── .gitignore ├── ece-patches └── magento-patches ├── bootstrap.php ├── codeception.dist.yml ├── composer.json ├── config ├── patch-categories.json └── services.xml ├── patches.json ├── patches ├── AC-384__Fix_Incompatible_PHP_Method__2.3.7-p1_ce.patch ├── AC-384__Fix_Incompatible_PHP_Method__2.4.3_ce.patch ├── ACPT-1876__attribute_reader_should_use_factory_for_collection__2.4.7.patch ├── B2B-4051__fields_hydration_company_account_create_request__1.3.3.patch ├── BUNDLE-2554__set_payment_info_bug_fix__3.4.1.patch ├── BUNDLE-2683__braintree_settlement_report_fix__4.1.0.patch ├── BUNDLE-3137__braintree_create_order_fix__2.4.5.patch ├── MAGECLOUD-1567__fix_import_during_ece_tools_dump__2.2.2.patch ├── MAGECLOUD-1582__fix_session_manager_locking__2.1.10.patch ├── MAGECLOUD-1582__fix_session_manager_locking__2.2.0.patch ├── MAGECLOUD-1601__configure_scd_on_demand_for_cloud__2.1.4.patch ├── MAGECLOUD-1601__configure_scd_on_demand_for_cloud__2.2.0.patch ├── MAGECLOUD-1607__overhaul_cron_implementation__2.1.13.patch ├── MAGECLOUD-1607__overhaul_cron_implementation__2.1.14.patch ├── MAGECLOUD-1607__overhaul_cron_implementation__2.1.4.patch ├── MAGECLOUD-1607__overhaul_cron_implementation__2.1.5.patch ├── MAGECLOUD-1607__overhaul_cron_implementation__2.2.0.patch ├── MAGECLOUD-1607__overhaul_cron_implementation__2.2.2.patch ├── MAGECLOUD-1607__overhaul_cron_implementation__2.2.4.patch ├── MAGECLOUD-1736__respect_minification_override__2.1.4.patch ├── MAGECLOUD-1736__respect_minification_override__2.2.0.patch ├── MAGECLOUD-1998__unify_sitemapxml_and_robotstxt_generation__2.1.11.patch ├── MAGECLOUD-1998__unify_sitemapxml_and_robotstxt_generation__2.1.4.patch ├── MAGECLOUD-2033__prevent_deadlock_during_db_dump__2.2.0.patch ├── MAGECLOUD-2159__unlock_locale_editing_when_scd_on_demand__2.2.0.patch ├── MAGECLOUD-2173__the_recursion_error_during_deployment__2.2.0.patch ├── MAGECLOUD-2209__write_logs_for_failed_process_of_generating_factories_in_extensions__2.2.0.patch ├── MAGECLOUD-2427__resolve_issues_with_cron_schedule__2.1.10.patch ├── MAGECLOUD-2445__do_not_run_cron_when_it_is_disabled__2.1.4.patch ├── MAGECLOUD-2464__fix_problems_with_consumer_runners_on_cloud_clusters__2.2.0.patch ├── MAGECLOUD-2464__fix_problems_with_consumer_runners_on_cloud_clusters__2.2.4.patch ├── MAGECLOUD-2509__remove_permission_check_for_console_application__2.2.0.patch ├── MAGECLOUD-2509__remove_permission_check_for_console_application__2.2.6.patch ├── MAGECLOUD-2521__zendframework1_use_TLS_1.2__2.1.4.patch ├── MAGECLOUD-2573__installation_without_admin_creation__2.1.4.patch ├── MAGECLOUD-2573__installation_without_admin_creation__2.2.2.patch ├── MAGECLOUD-2602__fix_timezone_parsing_for_cron__2.1.13.patch ├── MAGECLOUD-2602__fix_timezone_parsing_for_cron__2.1.4.patch ├── MAGECLOUD-2602__fix_timezone_parsing_for_cron__2.1.5.patch ├── MAGECLOUD-2793__fix_monolog_slack_handler__2.1.x.patch ├── MAGECLOUD-2820__implement_isolated_connections_mechanism__2.1.13.patch ├── MAGECLOUD-2820__implement_isolated_connections_mechanism__2.1.4.patch ├── MAGECLOUD-2820__implement_isolated_connections_mechanism__2.1.5.patch ├── MAGECLOUD-2820__implement_isolated_connections_mechanism__2.2.0.patch ├── MAGECLOUD-2822__configure_max_execution_time__2.2.0.patch ├── MAGECLOUD-2822__configure_max_execution_time__2.3.1.patch ├── MAGECLOUD-2850__fix_amazon_payment_module__2.2.6.patch ├── MAGECLOUD-2899__fix_redis_slave_configuration__2.1.16.patch ├── MAGECLOUD-2899__fix_redis_slave_configuration__2.2.3.patch ├── MAGECLOUD-2899__fix_redis_slave_configuration__2.3.0.patch ├── MAGECLOUD-3054__add_zookeeper_and_flock_locks__2.2.5.patch ├── MAGECLOUD-3054__add_zookeeper_and_flock_locks__2.3.0.patch ├── MAGECLOUD-3054__add_zookeeper_and_flock_locks__2.3.1.patch ├── MAGECLOUD-3392__reduce_q-ty_of_error_report_files__2.1.17.patch ├── MAGECLOUD-3392__reduce_q-ty_of_error_report_files__2.1.4.patch ├── MAGECLOUD-3392__reduce_q-ty_of_error_report_files__2.1.8.patch ├── MAGECLOUD-3392__reduce_q-ty_of_error_report_files__2.2.0.patch ├── MAGECLOUD-3392__reduce_q-ty_of_error_report_files__2.2.5.patch ├── MAGECLOUD-3392__reduce_q-ty_of_error_report_files__2.2.6.patch ├── MAGECLOUD-3392__reduce_q-ty_of_error_report_files__2.2.8.patch ├── MAGECLOUD-3392__reduce_q-ty_of_error_report_files__2.3.0.patch ├── MAGECLOUD-3392__reduce_q-ty_of_error_report_files__2.3.1.patch ├── MAGECLOUD-3392__reduce_q-ty_of_error_report_files__2.3.2.patch ├── MAGECLOUD-3611__multi_thread_scd__2.2.0.patch ├── MAGECLOUD-3611__multi_thread_scd__2.2.4.patch ├── MAGECLOUD-3611__multi_thread_scd__2.3.0.patch ├── MAGECLOUD-3611__multi_thread_scd__2.3.2.patch ├── MAGECLOUD-3806__error_code_fix_for_setup_upgrade__2.2.0.patch ├── MAGECLOUD-3806__error_code_fix_for_setup_upgrade__2.2.1.patch ├── MAGECLOUD-3806__error_code_fix_for_setup_upgrade__2.3.0.patch ├── MAGECLOUD-3913__fix_problems_with_consumer_runners_on_cloud_clusters__2.2.5_ce.patch ├── MAGECLOUD-3913__fix_problems_with_consumer_runners_on_cloud_clusters__2.2.5_ee.patch ├── MAGECLOUD-3913__fix_problems_with_consumer_runners_on_cloud_clusters__2.2.6_ce.patch ├── MAGECLOUD-3913__fix_problems_with_consumer_runners_on_cloud_clusters__2.2.6_ee.patch ├── MAGECLOUD-3913__fix_problems_with_consumer_runners_on_cloud_clusters__2.2.7_ce.patch ├── MAGECLOUD-3913__fix_problems_with_consumer_runners_on_cloud_clusters__2.2.7_ee.patch ├── MAGECLOUD-3913__fix_problems_with_consumer_runners_on_cloud_clusters__2.2.8_ce.patch ├── MAGECLOUD-3913__fix_problems_with_consumer_runners_on_cloud_clusters__2.2.8_ee.patch ├── MAGECLOUD-3913__fix_problems_with_consumer_runners_on_cloud_clusters__2.3.0.patch ├── MAGECLOUD-3913__fix_problems_with_consumer_runners_on_cloud_clusters__2.3.1.patch ├── MAGECLOUD-4071__terminate_consumers_if_the_queue_is_empty__2.2.0.patch ├── MAGECLOUD-4071__terminate_consumers_if_the_queue_is_empty__2.3.2.patch ├── MAGECLOUD-414__remove_unnecessary_permission_checks__2.1.4.patch ├── MAGECLOUD-414__remove_unnecessary_permission_checks__2.2.0.patch ├── MAGECLOUD-4407__fix_namespace_vertex_tax__3.2.0.patch ├── MAGECLOUD-4442__fix_backward_compatibility_of_new_mail_interfaces__2.3.3.patch ├── MAGECLOUD-4530__fix_cron_deadlocks_and_improve_job_locking__2.2.10.patch ├── MAGECLOUD-4530__fix_cron_deadlocks_and_improve_job_locking__2.2.5.patch ├── MAGECLOUD-4530__fix_cron_deadlocks_and_improve_job_locking__2.2.9.patch ├── MAGECLOUD-4530__fix_cron_deadlocks_and_improve_job_locking__2.3.0.patch ├── MAGECLOUD-4530__fix_cron_deadlocks_and_improve_job_locking__2.3.1.patch ├── MAGECLOUD-4530__fix_cron_deadlocks_and_improve_job_locking__2.3.2.patch ├── MAGECLOUD-4530__fix_cron_deadlocks_and_improve_job_locking__2.3.3.patch ├── MAGECLOUD-4847__elasticsearch_and_products_display_fix__2.3.3.patch ├── MAGECLOUD-5069__fpc_is_getting_disabled_during_deployments__2.3.2.patch ├── MAGECLOUD-5069__fpc_is_getting_disabled_during_deployments__2.3.5.patch ├── MAGECLOUD-589__load_appropriate_js_files__2.1.4.patch ├── MAGECLOUD-6029__add_processor_interface__2.1.x.patch ├── MAGETWO-45357__avoid_nonexistent_setup_area__2.1.4.patch ├── MAGETWO-53941__fix_enterprise_braintree_code__100.1.6.patch ├── MAGETWO-53941__fix_enterprise_paypal_codes__100.1.6.patch ├── MAGETWO-56675__dont_skip_setup_scoped_plugins__2.1.4.patch ├── MAGETWO-57413__move_vendor_path_autoloader__2.1.4.patch ├── MAGETWO-57414__load_static_assets_without_rewrites__2.1.17.patch ├── MAGETWO-57414__load_static_assets_without_rewrites__2.1.4.patch ├── MAGETWO-62660__prevent_excessive_js_optimization__2.1.4.patch ├── MAGETWO-63020__fix_scd_with_multiple_languages__2.1.4.patch ├── MAGETWO-63032__skip_unnecessary_write_permission_check__2.1.4.patch ├── MAGETWO-67097__fix_credis_pipeline_bug__2.1.4.patch ├── MAGETWO-67805__fix_image_resizing_after_upgrade__2.1.6.patch ├── MAGETWO-69847__support_credis_forking_during_scd__2.1.4.patch ├── MAGETWO-69847__support_credis_forking_during_scd__2.2.0.patch ├── MAGETWO-82752__reload_js_translation_data__2.2.0.patch ├── MAGETWO-84444__fix_mview_on_staging__2.1.10.patch ├── MAGETWO-84444__fix_mview_on_staging__2.1.4.patch ├── MAGETWO-84444__fix_mview_on_staging__2.1.5.patch ├── MAGETWO-84507__fix_complex_folder_js_bundling__2.2.0.patch ├── MAGETWO-88336__fix_complex_folder_js_bundling__2.1.4.patch ├── MAGETWO-92926__fix_for_multi-site_configuration_issue__2.2.4.patch ├── MAGETWO-93036__cannot_change_the_applied_theme__2.2.5.patch ├── MAGETWO-93083__optimize_retrieving_product_attributes__2.2.5.patch ├── MAGETWO-93265__fix_depth_of_recursive_check_of_directory_permissions__2.1.4.patch ├── MAGETWO-95591__customer_attributes_issue__2.2.6.patch ├── MAGETWO-98129__transaction_field_is_removed_by_authorize_net__100.2.0.patch ├── MAGETWO-98833__turn_off_google_chart_api__2.x.patch ├── MAGETWO-99902__pass_store_view_scope_in_async_web_api__2.3.1.patch ├── MAGETWO-99902__pass_store_view_scope_in_async_web_api__2.3.2.patch ├── MC-21820__fix_broken_method_chaining__2.3.3.patch ├── MC-31387__fix_paypal_issue_with_region__100.3.4.patch ├── MC-42674__paypal_checkout__2.3.7-p1.patch ├── MC-43048__set_rate_limits__2.3.7-p1.patch ├── MC-43048__set_rate_limits__2.4.3.patch ├── MC-5964__preauth_sql__2.1.4.patch ├── MC-5964__preauth_sql__2.2.0.patch ├── MC-5964__preauth_sql__2.3.0.patch ├── MCLOUD-10032__Increment_number_for_catalog_product_entity_tables__2.4.3-p1.patch ├── MCLOUD-10226__fix_regexp_cache_tag_validation__2.4.6.patch ├── MCLOUD-10279__errors_when_flushing_js_css_cache_from_admin__2.4.0.patch ├── MCLOUD-10279__errors_when_flushing_js_css_cache_from_admin__2.4.4.patch ├── MCLOUD-10604__performance_degradation_around_deployment_configuration__2.4.6.patch ├── MCLOUD-11329__missed_jobs_unnecessarily_wait_for_cron_job_locks__2.4.6.patch ├── MCLOUD-11514__enhanced_layout_cache_efficiency__2.4.6-p3.patch ├── MCLOUD-11623__requisition_list_exports_saved_to_var_directory__2.4.5-p1.patch ├── MCLOUD-12969__Patch_for_CVE_2024_34102_CosmicSting__2.4.4.patch ├── MCLOUD-12969__Patch_for_CVE_2024_34102_CosmicSting__2.4.5.patch ├── MCLOUD-12969__Patch_for_CVE_2024_34102_CosmicSting__2.4.6.patch ├── MCLOUD-12969__Patch_for_CVE_2024_34102_CosmicSting__2.4.7.patch ├── MCLOUD-12969__Patch_for_CVE_2024_34102_KeyRotation__2.4.4.patch ├── MCLOUD-12969__Patch_for_CVE_2024_34102_KeyRotation__2.4.5.patch ├── MCLOUD-12969__Patch_for_CVE_2024_34102_KeyRotation__2.4.6.patch ├── MCLOUD-12969__Patch_for_CVE_2024_34102_KeyRotation__2.4.7.patch ├── MCLOUD-13240__Patch_for_CVE_2025_24434_improve_web_api_async__2.4.4.patch ├── MCLOUD-13240__Patch_for_CVE_2025_24434_improve_web_api_async__2.4.5.patch ├── MCLOUD-13240__Patch_for_CVE_2025_24434_improve_web_api_async__2.4.6.patch ├── MCLOUD-13240__Patch_for_CVE_2025_24434_improve_web_api_async__2.4.7.patch ├── MCLOUD-13605__B2B_SQL_syntax_error_due_to_the_REGEXP_LIKE_function__1.5.2.patch ├── MCLOUD-13619__Improve_web_api_async_performance__2.4.x.patch ├── MCLOUD-3025__sitemap_generation_warnings__2.3.0.patch ├── MCLOUD-3025__sitemap_generation_warnings__2.3.3.patch ├── MCLOUD-5650__hold_deployment_config_after_reading_from_file__2.3.3.patch ├── MCLOUD-5684__pagination_not_working_product_list_limit_all__2.3.2.patch ├── MCLOUD-5684__pagination_not_working_product_list_limit_all__2.3.4.patch ├── MCLOUD-5837__fix_filesystem_load_balancer_issue__2.3.4.patch ├── MCLOUD-6139_MCLOUD-6211__redis_improvement_patches__2.3.0.patch ├── MCLOUD-6139_MCLOUD-6211__redis_improvement_patches__2.3.1.patch ├── MCLOUD-6139_MCLOUD-6211__redis_improvement_patches__2.3.2.patch ├── MCLOUD-6139_MCLOUD-6211__redis_improvement_patches__2.3.3-p1.patch ├── MCLOUD-6139_MCLOUD-6211__redis_improvement_patches__2.3.3.patch ├── MCLOUD-6139_MCLOUD-6211__redis_improvement_patches__2.3.4.patch ├── MCLOUD-6211__redis_improvement_patches__2.3.5.patch ├── MCLOUD-6659__fix_L2_redis_cache__2.4.0.patch ├── MCLOUD-6923__layered_navigation_filter_is_present_only_when_product_is_present_on_the_listing_page_with_enabled_shared_catalog__2.3.5.patch ├── MCLOUD-7845__fix_local_flushing_L2_cache__2.4.0.patch ├── MCLOUD-8279__Fixed_currency_displaying_on_product_page__2.4.3.patch ├── MCLOUD_6139__improvement_flock_locks__2.3.2.patch ├── MDVA-22950__large_amount_of_keys_block_cache__2.3.1.patch ├── MDVA-2470__fix_asset_locking_race_condition__2.1.4.patch ├── MDVA-2470__fix_asset_locking_race_condition__2.2.0.patch ├── MDVA-43443__parser_token_new_fix__2.3.3-p1.patch ├── MDVA-43443__parser_token_new_fix__2.3.4-p2.patch ├── MDVA-43443__parser_token_new_fix__2.4.3.patch ├── MDVA-8695__properly_encode_characters_in_emails__2.1.4.patch ├── MSI-2210__price_indexer_fails_with_large_catalogs__1.0.3.patch ├── MSI-GH-2350__avoid_quering_inventory_default_stock_view_in_storefront__1.0.3.patch ├── MSI-GH-2515__eliminate_group_concat_from_source_item_indexer__configurable-product-indexer__1.0.3.patch ├── MSI-GH-2515__eliminate_group_concat_from_source_item_indexer__grouped-product-indexer__1.0.3.patch ├── MSI-GH-2515__eliminate_group_concat_from_source_item_indexer__indexer__1.0.3.patch ├── MSI-GH-2515__eliminate_group_concat_from_source_item_indexer__reservations__1.0.3.patch ├── PB-319__fix_pagebuilder_module__2.3.1.patch ├── PB-320__fix_pagebuilder_module__2.3.2.patch ├── PB-322__fix_pagebuilder_module__2.3.2-p1.patch ├── PB-323__fix_pagebuilder_module__2.3.3.patch ├── PRODSECBUG-2233__fix_xss_in_order_history__2.2.0.patch ├── PRODSECBUG-2233__fix_xss_in_order_history__2.2.7.patch ├── PRODSECBUG-2233__fix_xss_in_order_history__2.3.0.patch ├── PRODSECBUG-2432__admin_path_disclosure_bug__2.1.4.patch ├── PRODSECBUG-2432__admin_path_disclosure_bug__2.2.0.patch ├── PRODSECBUG-2432__admin_path_disclosure_bug__2.3.0.patch ├── SET-36__fix_oom_during_customer_import__2.1.11.patch ├── SET-36__fix_oom_during_customer_import__2.1.4.patch ├── SET-36__fix_oom_during_customer_import__2.2.0.patch └── SET-36__fix_oom_during_customer_import__2.2.4.patch ├── src ├── App │ ├── Container.php │ ├── GenericException.php │ ├── Logger.php │ ├── Logger │ │ └── LineFormatterFactory.php │ └── RuntimeException.php ├── Application.php ├── ApplicationEce.php ├── Command │ ├── AbstractCommand.php │ ├── Apply.php │ ├── Ece │ │ ├── Apply.php │ │ └── Revert.php │ ├── Process │ │ ├── Action │ │ │ ├── ActionInterface.php │ │ │ ├── ActionPool.php │ │ │ ├── ApplyOptionalAction.php │ │ │ ├── ConfirmRequiredAction.php │ │ │ ├── ProcessDeprecatedAction.php │ │ │ ├── RevertAction.php │ │ │ └── ReviewAppliedAction.php │ │ ├── ApplyLocal.php │ │ ├── ApplyOptional.php │ │ ├── ApplyRequired.php │ │ ├── Ece │ │ │ ├── ApplyOptional.php │ │ │ └── Revert.php │ │ ├── ProcessInterface.php │ │ ├── Renderer.php │ │ ├── Revert.php │ │ └── ShowStatus.php │ ├── Revert.php │ └── Status.php ├── Composer │ ├── MagentoVersion.php │ ├── Package.php │ └── QualityPackage.php ├── Console │ ├── ConfirmationQuestionFactory.php │ ├── QuestionFactory.php │ └── TableFactory.php ├── Environment │ ├── Config.php │ └── ConfigReader.php ├── Filesystem │ ├── DirectoryList.php │ ├── FileList.php │ ├── FileSystemException.php │ ├── Filesystem.php │ └── JsonConfigReader.php ├── Patch │ ├── AggregatedPatchFactory.php │ ├── Aggregator.php │ ├── Applier.php │ ├── ApplierException.php │ ├── CategoriesList │ │ ├── GetLocalPatchCategories.php │ │ └── GetSupportPatchCategories.php │ ├── Collector │ │ ├── CloudCollector.php │ │ ├── CollectorException.php │ │ ├── CommunityCollector.php │ │ ├── GetCommunityPatchesConfig.php │ │ ├── GetPatchesConfigInterface.php │ │ ├── GetSupportPatchesConfig.php │ │ ├── LocalCollector.php │ │ ├── SupportCollector.php │ │ └── ValidatePatchesConfig.php │ ├── CollectorInterface.php │ ├── Conflict │ │ ├── Analyzer.php │ │ ├── ApplyChecker.php │ │ └── Processor.php │ ├── Data │ │ ├── AggregatedPatch.php │ │ ├── AggregatedPatchInterface.php │ │ ├── Patch.php │ │ └── PatchInterface.php │ ├── FilterFactory.php │ ├── GetCategoriesList.php │ ├── GetCategoriesListInterface.php │ ├── GitConverter.php │ ├── PatchBuilder.php │ ├── PatchCommand.php │ ├── PatchCommandException.php │ ├── PatchCommandInterface.php │ ├── PatchCommandNotFound.php │ ├── PatchIntegrityException.php │ ├── Pool │ │ ├── LocalPool.php │ │ ├── OptionalPool.php │ │ ├── PatchNotFoundException.php │ │ └── RequiredPool.php │ ├── RevertValidator.php │ ├── RollbackProcessor.php │ ├── SourceProvider.php │ ├── SourceProviderException.php │ └── Status │ │ ├── LocalResolver.php │ │ ├── OptionalResolver.php │ │ ├── ResolverInterface.php │ │ ├── StatusPool.php │ │ └── StatusResolverException.php ├── Shell │ ├── Command │ │ ├── DriverException.php │ │ ├── DriverInterface.php │ │ ├── GitDriver.php │ │ └── PatchDriver.php │ ├── PackageNotFoundException.php │ └── ProcessFactory.php └── Test │ ├── Functional │ ├── Acceptance.suite.dist.yml │ └── Acceptance │ │ ├── AbstractCest.php │ │ ├── Acceptance71CeCest.php │ │ ├── Acceptance71CePart2Cest.php │ │ ├── Acceptance71Cest.php │ │ ├── Acceptance71Part2Cest.php │ │ ├── Acceptance72CeCest.php │ │ ├── Acceptance72Cest.php │ │ ├── Acceptance73CeCest.php │ │ ├── Acceptance73Cest.php │ │ ├── Acceptance74CeCest.php │ │ ├── Acceptance74Cest.php │ │ ├── Acceptance81Cest.php │ │ ├── Acceptance82Cest.php │ │ ├── Acceptance83Cest.php │ │ ├── AcceptanceCest.php │ │ └── PatchApplierCest.php │ └── Unit │ ├── Command │ ├── ApplyTest.php │ ├── Ece │ │ ├── ApplyTest.php │ │ └── RevertTest.php │ ├── Process │ │ ├── Action │ │ │ ├── ApplyOptionalActionTest.php │ │ │ ├── ConfirmRequiredActionTest.php │ │ │ ├── ProcessDeprecatedActionTest.php │ │ │ ├── RevertActionTest.php │ │ │ └── ReviewAppliedActionTest.php │ │ ├── ApplyLocalTest.php │ │ ├── ApplyOptionalTest.php │ │ ├── ApplyRequiredTest.php │ │ ├── Ece │ │ │ ├── ApplyOptionalTest.php │ │ │ └── RevertTest.php │ │ ├── RendererTest.php │ │ ├── RevertTest.php │ │ └── ShowStatusTest.php │ ├── RevertTest.php │ └── StatusTest.php │ ├── Composer │ └── MagentoVersionTest.php │ ├── Environment │ ├── ConfigReaderTest.php │ ├── ConfigTest.php │ └── _file │ │ └── .magento.env.yaml │ ├── Filesystem │ ├── DirectoryListTest.php │ ├── FileListTest.php │ └── _files │ │ └── .gitignore │ ├── Patch │ ├── AggregatedPatchFactoryTest.php │ ├── AggregatorTest.php │ ├── ApplierTest.php │ ├── Collector │ │ ├── CloudCollectorTest.php │ │ ├── Fixture │ │ │ ├── cloud_config_valid.php │ │ │ ├── m2-hotfixes │ │ │ │ ├── patch1.patch │ │ │ │ ├── patch2.patch │ │ │ │ └── readme.md │ │ │ ├── quality_config_invalid.php │ │ │ └── quality_config_valid.php │ │ ├── LocalCollectorTest.php │ │ └── QualityCollectorTest.php │ ├── Conflict │ │ ├── AnalyzerTest.php │ │ ├── ApplyCheckerTest.php │ │ └── ProcessorTest.php │ ├── FilterFactoryTest.php │ ├── Fixture │ │ └── MC-1__testfixture__1.1.patch │ ├── GitConverterTest.php │ ├── PatchBuilderTest.php │ ├── Pool │ │ ├── LocalPoolTest.php │ │ ├── OptionalPoolTest.php │ │ └── RequiredPoolTest.php │ ├── RevertValidatorTest.php │ ├── RollbackProcessorTest.php │ ├── SourceProviderTest.php │ └── Status │ │ ├── LocalResolverTest.php │ │ ├── OptionalResolverTest.php │ │ └── StatusPoolTest.php │ └── Shell │ └── Command │ └── PatchDriverTest.php └── tests ├── functional ├── _data │ ├── .gitkeep │ └── files │ │ ├── debug_logging │ │ └── .magento.env.yaml │ │ └── patches │ │ ├── .apply_quality_patches.env.yaml │ │ ├── patch.patch │ │ ├── target_file.md │ │ └── target_file_applied_patch.md └── _output │ └── .gitignore ├── static ├── Sniffs │ ├── Directives │ │ └── StrictTypesSniff.php │ └── Whitespace │ │ └── MultipleEmptyLinesSniff.php ├── phpcs-ruleset.xml └── phpmd-ruleset.xml └── unit ├── .gitignore ├── _data └── files │ ├── file1.md │ ├── file1.patch │ ├── file1_and_file2.patch │ ├── file1_applied_patch.md │ ├── file2.md │ └── file2_applied_patch.md ├── phpunit.xml.dist └── var └── .gitignore /.github/.metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "templateVersion": "0.2", 3 | "product": { 4 | "name": "Magento Cloud Patches", 5 | "description": "The Magento Cloud Patches package is a set of patches, previously used within the ece-tools package to improve the integration of all Magento versions with Cloud environments and to deliver critical fixes quickly" 6 | }, 7 | "contacts": { 8 | "team": { 9 | "name": "Mystic Mountain", 10 | "DL": "Grp-Mystic-Mountain", 11 | "slackChannel": "#mystic-mountain-team" 12 | } 13 | }, 14 | "ticketTracker": { 15 | "functionalJiraQueue": { 16 | "projectKey": "MCLOUD" 17 | }, 18 | "securityJiraQueue": { 19 | "projectKey": "MAGREQ", 20 | "component": "MAGREQ/Magento Cloud Engineering" 21 | } 22 | }, 23 | "productionCodeBranches": ["1.0"] 24 | } 25 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Technical issue with the Magento Cloud Patches 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | --- 8 | 9 | 19 | 20 | ### Preconditions 21 | 25 | 1. 26 | 2. 27 | 28 | ### Steps to reproduce 29 | 33 | 1. 34 | 2. 35 | 3. 36 | 37 | ### Expected result 38 | 39 | 1. [Screenshots, logs or description] 40 | 41 | ### Actual result 42 | 43 | 1. [Screenshots, logs or description] 44 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | --- 8 | 9 | **Is your feature request related to a problem? Please describe.** 10 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 11 | 12 | **Describe the solution you'd like** 13 | A clear and concise description of what you want to happen. 14 | 15 | **Describe alternatives you've considered** 16 | A clear and concise description of any alternative solutions or features you've considered. 17 | 18 | **Additional context** 19 | Add any other context or screenshots about the feature request here. 20 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | ### Description 12 | 16 | 17 | ### Fixed Issues (if relevant) 18 | 22 | 1. magento/magento-cloud-patches#: Issue title 23 | 2. ... 24 | 25 | ### Manual testing scenarios 26 | 30 | 1. ... 31 | 2. ... 32 | 33 | ### Release notes 34 | 35 | For user-facing changes, add a meaningful release note. For examples, see [Magento Cloud Patches release notes](https://devdocs.magento.com/cloud/release-notes/mcp-release-notes.html). 36 | 37 | ### Associated documentation updates 38 | 41 | Add link to Magento DevDocs PR or Issue, if needed. 42 | 43 | ### Contribution checklist 44 | - [ ] Pull request has a meaningful description of its purpose 45 | - [ ] Pull request introduces user-facing changes and includes meaningful updates for any required release notes and documentation changes 46 | - [ ] All commits are accompanied by meaningful commit messages 47 | - [ ] All new or changed code is covered with unit/integration tests (if applicable) 48 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | /.idea 3 | /vendor 4 | /composer.phar 5 | /composer.lock 6 | /auth.json 7 | /codeception.yml 8 | /_workdir 9 | -------------------------------------------------------------------------------- /COPYING.txt: -------------------------------------------------------------------------------- 1 | Copyright © 2013-present Magento, Inc. 2 | 3 | Each Magento source file included in this distribution is licensed under OSL-3.0 license. 4 | See the `LICENSE.txt` file for the full text of the OSL-3.0 license or visit http://opensource.org/licenses/osl-3.0.php 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Magento Cloud Patches 2 | 3 | ## Welcome 4 | The Magento Cloud Patches package is a set of patches, previously used within the ece-tools package to improve the integration of all Magento versions with Cloud environments and to deliver critical fixes quickly. Beginning with ece-tools version `2002.0.22` and `2002.1.0`, the Magento Cloud Patches package is required so that patches can be applied with same workflow used in ece-tools `2002.0.21` and earlier versions. 5 | 6 | ## Contributing to Magento Cloud Patches Code Base 7 | You can submit pull requests to fix potential bugs. If you find a bug or have a new suggestion, let us know by creating a Github issue. 8 | 9 | **Note:** This repository is not an official support channel. To receive project-specific help, submit a support ticket using the [Magento Support Portal](https://support.magento.com). Any support-related issues opened in this repository will be closed with a request to open a support ticket. 10 | 11 | # Magento Cloud Suite 12 | The Magento Cloud Suite includes a set of packages designed to deploy and manage Magento Commerce installations on the Cloud platform. 13 | - The [ece-tools package](https://github.com/magento/ece-tools) - A set of scripts and tools designed to manage and deploy Cloud projects 14 | - [Magento Cloud Components](https://github.com/magento/magento-cloud-components) package - Extended Magento Commerce core functionality for sites deployed on the Cloud platform 15 | - [Magento Cloud Docker](https://github.com/magento/magento-cloud-docker) package - Functionality and Docker images to deploy Magento Commerce to a local Cloud environment 16 | - [Magento Cloud Patches](https://github.com/magento/magento-cloud-patches) package - A set of patches which improve the integration of all Magento versions with Cloud environments 17 | 18 | ## Useful Resources 19 | - [Release Notes](https://github.com/magento/magento-cloud-patches/releases) 20 | - [Magento Cloud Guide DevDocs](https://devdocs.magento.com/guides/v2.3/cloud/bk-cloud.html) 21 | - [Cloud Knowledge Base and Support](https://support.magento.com) 22 | - [Cloud Slack Channel](https://magentocommeng.slack.com) (join #cloud and #cloud-docker) 23 | 24 | ## License 25 | Each Magento source file included in this distribution is licensed under OSL-3.0 license. 26 | 27 | See [LICENSE.txt](https://github.com/magento/magento-cloud-patches/blob/develop/LICENSE.txt) for the full text of the [Open Software License v. 3.0 (OSL-3.0)](http://opensource.org/licenses/osl-3.0.php) 28 | -------------------------------------------------------------------------------- /autoload.php: -------------------------------------------------------------------------------- 1 | run(); 12 | -------------------------------------------------------------------------------- /bin/magento-patches: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | run(); 11 | -------------------------------------------------------------------------------- /bootstrap.php: -------------------------------------------------------------------------------- 1 | fileDenyList as $file) { 7 | $baseName = pathinfo($actualPath, PATHINFO_BASENAME); 8 | - if (str_contains($baseName, $file) || preg_match('#' . "\." . $file . '#', $fullPath)) { 9 | + if (strpos($baseName, $file) !== false || preg_match('#' . "\." . $file . '#', $fullPath)) { 10 | throw new ValidatorException( 11 | new Phrase('"%1" is not a valid file path', [$path]) 12 | ); 13 | -------------------------------------------------------------------------------- /patches/AC-384__Fix_Incompatible_PHP_Method__2.4.3_ce.patch: -------------------------------------------------------------------------------- 1 | diff -Nuar a/vendor/magento/framework/Filesystem/Directory/DenyListPathValidator.php b/vendor/magento/framework/Filesystem/Directory/DenyListPathValidator.php 2 | --- a/vendor/magento/framework/Filesystem/Directory/DenyListPathValidator.php (revision d40e8cbfd24ac841900166877e9910f9d549fdf5) 3 | +++ b/vendor/magento/framework/Filesystem/Directory/DenyListPathValidator.php (revision 7d6a3eeb669d4a11978bf639dc2536ef23d56d09) 4 | @@ -71,7 +71,7 @@ 5 | 6 | foreach ($this->fileDenyList as $file) { 7 | $baseName = pathinfo($actualPath, PATHINFO_BASENAME); 8 | - if (str_contains($baseName, $file) || preg_match('#' . "\." . $file . '#', $fullPath)) { 9 | + if (strpos($baseName, $file) !== false || preg_match('#' . "\." . $file . '#', $fullPath)) { 10 | throw new ValidatorException( 11 | new Phrase('"%1" is not a valid file path', [$path]) 12 | ); 13 | -------------------------------------------------------------------------------- /patches/BUNDLE-2683__braintree_settlement_report_fix__4.1.0.patch: -------------------------------------------------------------------------------- 1 | diff -Naur a/vendor/paypal/module-braintree-core/Ui/Component/Report/Listing/Column/PaymentType.php b/vendor/paypal/module-braintree-core/Ui/Component/Report/Listing/Column/PaymentType.php 2 | --- a/vendor/paypal/module-braintree-core/Ui/Component/Report/Listing/Column/PaymentType.php 3 | +++ b/vendor/paypal/module-braintree-core/Ui/Component/Report/Listing/Column/PaymentType.php 4 | @@ -44,8 +44,6 @@ private function getAvailablePaymentTypes(): array 5 | // @codingStandardsIgnoreStart 6 | return [ 7 | PaymentInstrumentType::PAYPAL_ACCOUNT => __(PaymentInstrumentType::PAYPAL_ACCOUNT), 8 | - PaymentInstrumentType::COINBASE_ACCOUNT => __(PaymentInstrumentType::COINBASE_ACCOUNT), 9 | - PaymentInstrumentType::EUROPE_BANK_ACCOUNT => __(PaymentInstrumentType::EUROPE_BANK_ACCOUNT), 10 | PaymentInstrumentType::CREDIT_CARD => __(PaymentInstrumentType::CREDIT_CARD), 11 | PaymentInstrumentType::APPLE_PAY_CARD => __(PaymentInstrumentType::APPLE_PAY_CARD), 12 | PaymentInstrumentType::ANDROID_PAY_CARD => __(PaymentInstrumentType::ANDROID_PAY_CARD) 13 | -------------------------------------------------------------------------------- /patches/BUNDLE-3137__braintree_create_order_fix__2.4.5.patch: -------------------------------------------------------------------------------- 1 | diff -Nuar a/vendor/paypal/module-braintree-core/Block/Form.php b/vendor/paypal/module-braintree-core/Block/Form.php 2 | index 4bc1bdf1..70559bbe 100755 3 | --- a/vendor/paypal/module-braintree-core/Block/Form.php 4 | +++ b/vendor/paypal/module-braintree-core/Block/Form.php 5 | @@ -66,6 +66,7 @@ public function __construct( 6 | GatewayConfig $gatewayConfig, 7 | CcType $ccType, 8 | LoggerInterface $logger, 9 | + Data $paymentDataHelper, 10 | array $data = [] 11 | ) { 12 | parent::__construct($context, $paymentConfig, $data); 13 | @@ -74,6 +75,7 @@ public function __construct( 14 | $this->gatewayConfig = $gatewayConfig; 15 | $this->ccType = $ccType; 16 | $this->logger = $logger; 17 | + $this->paymentDataHelper = $paymentDataHelper; 18 | } 19 | 20 | /** 21 | -------------------------------------------------------------------------------- /patches/MAGECLOUD-1567__fix_import_during_ece_tools_dump__2.2.2.patch: -------------------------------------------------------------------------------- 1 | diff -Nuar a/vendor/magento/module-config/Model/Config/Importer.php b/vendor/magento/module-config/Model/Config/Importer.php 2 | --- a/vendor/magento/module-config/Model/Config/Importer.php 3 | +++ b/vendor/magento/module-config/Model/Config/Importer.php 4 | @@ -129,8 +129,10 @@ class Importer implements ImporterInterface 5 | 6 | // Invoke saving of new values. 7 | $this->saveProcessor->process($changedData); 8 | - $this->flagManager->saveFlag(static::FLAG_CODE, $data); 9 | }); 10 | + 11 | + $this->scope->setCurrentScope($currentScope); 12 | + $this->flagManager->saveFlag(static::FLAG_CODE, $data); 13 | } catch (\Exception $e) { 14 | throw new InvalidTransitionException(__('%1', $e->getMessage()), $e); 15 | } finally { 16 | -------------------------------------------------------------------------------- /patches/MAGECLOUD-1582__fix_session_manager_locking__2.1.10.patch: -------------------------------------------------------------------------------- 1 | diff -Nuar a/vendor/magento/framework/Session/SessionManager.php b/vendor/magento/framework/Session/SessionManager.php 2 | --- a/vendor/magento/framework/Session/SessionManager.php 3 | +++ b/vendor/magento/framework/Session/SessionManager.php 4 | @@ -470,18 +470,9 @@ class SessionManager implements SessionManagerInterface 5 | if (headers_sent()) { 6 | return $this; 7 | } 8 | - //@see http://php.net/manual/en/function.session-regenerate-id.php#53480 workaround 9 | + 10 | if ($this->isSessionExists()) { 11 | - $oldSessionId = session_id(); 12 | - session_regenerate_id(); 13 | - $newSessionId = session_id(); 14 | - session_id($oldSessionId); 15 | - session_destroy(); 16 | - 17 | - $oldSession = $_SESSION; 18 | - session_id($newSessionId); 19 | - session_start(); 20 | - $_SESSION = $oldSession; 21 | + session_regenerate_id(true); 22 | } else { 23 | session_start(); 24 | } 25 | -------------------------------------------------------------------------------- /patches/MAGECLOUD-1582__fix_session_manager_locking__2.2.0.patch: -------------------------------------------------------------------------------- 1 | diff -Nuar a/vendor/magento/framework/Session/SessionManager.php b/vendor/magento/framework/Session/SessionManager.php 2 | --- a/vendor/magento/framework/Session/SessionManager.php 3 | +++ b/vendor/magento/framework/Session/SessionManager.php 4 | @@ -504,18 +504,8 @@ class SessionManager implements SessionManagerInterface 5 | return $this; 6 | } 7 | 8 | - //@see http://php.net/manual/en/function.session-regenerate-id.php#53480 workaround 9 | if ($this->isSessionExists()) { 10 | - $oldSessionId = session_id(); 11 | - session_regenerate_id(); 12 | - $newSessionId = session_id(); 13 | - session_id($oldSessionId); 14 | - session_destroy(); 15 | - 16 | - $oldSession = $_SESSION; 17 | - session_id($newSessionId); 18 | - session_start(); 19 | - $_SESSION = $oldSession; 20 | + session_regenerate_id(true); 21 | } else { 22 | session_start(); 23 | } 24 | -------------------------------------------------------------------------------- /patches/MAGECLOUD-1736__respect_minification_override__2.1.4.patch: -------------------------------------------------------------------------------- 1 | diff -Nuar a/vendor/magento/framework/View/Design/FileResolution/Fallback/TemplateFile.php b/vendor/magento/framework/View/Design/FileResolution/Fallback/TemplateFile.php 2 | --- a/vendor/magento/framework/View/Design/FileResolution/Fallback/TemplateFile.php 3 | +++ b/vendor/magento/framework/View/Design/FileResolution/Fallback/TemplateFile.php 4 | @@ -107,11 +107,15 @@ class TemplateFile extends File 5 | */ 6 | private function getMinifiedTemplateInProduction($template) 7 | { 8 | - if ($this->deploymentConfig->getConfigData( 9 | - ConfigOptionsListConstants::CONFIG_PATH_SCD_ON_DEMAND_IN_PRODUCTION 10 | - )) { 11 | + $forceMinified = $this->deploymentConfig->getConfigData( 12 | + ConfigOptionsListConstants::CONFIG_PATH_SCD_ON_DEMAND_IN_PRODUCTION 13 | + ) 14 | + || $this->deploymentConfig->getConfigData('force_html_minification'); 15 | + 16 | + if ($forceMinified) { 17 | return $this->templateMinifier->getMinified($template); 18 | } 19 | + 20 | return $this->templateMinifier->getPathToMinified($template); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /patches/MAGECLOUD-1736__respect_minification_override__2.2.0.patch: -------------------------------------------------------------------------------- 1 | diff -Nuar a/vendor/magento/framework/View/Design/FileResolution/Fallback/TemplateFile.php b/vendor/magento/framework/View/Design/FileResolution/Fallback/TemplateFile.php 2 | --- a/vendor/magento/framework/View/Design/FileResolution/Fallback/TemplateFile.php 3 | +++ b/vendor/magento/framework/View/Design/FileResolution/Fallback/TemplateFile.php 4 | @@ -107,9 +107,12 @@ class TemplateFile extends File 5 | */ 6 | private function getMinifiedTemplateInProduction($template) 7 | { 8 | - if ($this->deploymentConfig->getConfigData( 9 | - ConfigOptionsListConstants::CONFIG_PATH_SCD_ON_DEMAND_IN_PRODUCTION 10 | - )) { 11 | + $forceMinified = $this->deploymentConfig->getConfigData( 12 | + ConfigOptionsListConstants::CONFIG_PATH_SCD_ON_DEMAND_IN_PRODUCTION 13 | + ) 14 | + || $this->deploymentConfig->getConfigData('force_html_minification'); 15 | + 16 | + if ($forceMinified) { 17 | return $this->templateMinifier->getMinified($template); 18 | } 19 | return $this->templateMinifier->getPathToMinified($template); 20 | -------------------------------------------------------------------------------- /patches/MAGECLOUD-2033__prevent_deadlock_during_db_dump__2.2.0.patch: -------------------------------------------------------------------------------- 1 | diff -Nuar a/vendor/magento/module-support/Console/Command/AbstractBackupDumpCommand.php b/vendor/magento/module-support/Console/Command/AbstractBackupDumpCommand.php 2 | --- a/vendor/magento/module-support/Console/Command/AbstractBackupDumpCommand.php 3 | +++ b/vendor/magento/module-support/Console/Command/AbstractBackupDumpCommand.php 4 | @@ -181,7 +181,7 @@ class AbstractBackupDumpCommand extends AbstractBackupCommand 5 | : $this->getParam(ConfigOptionsListConstants::KEY_HOST); 6 | 7 | $this->dbConnectionParams = sprintf( 8 | - '-u%s -h%s %s %s %s', 9 | + '-u%s -h%s %s %s %s %s', 10 | $this->getParam(ConfigOptionsListConstants::KEY_USER), 11 | $host, 12 | $port, 13 | -------------------------------------------------------------------------------- /patches/MAGECLOUD-2173__the_recursion_error_during_deployment__2.2.0.patch: -------------------------------------------------------------------------------- 1 | diff -Nuar a/vendor/magento/module-config/App/Config/Type/System.php b/vendor/magento/module-config/App/Config/Type/System.php 2 | --- a/vendor/magento/module-config/App/Config/Type/System.php 3 | +++ b/vendor/magento/module-config/App/Config/Type/System.php 4 | @@ -155,7 +155,11 @@ class System implements ConfigTypeInterface 5 | } 6 | $scopeId = array_shift($pathParts); 7 | if (!isset($this->data[$scopeType][$scopeId])) { 8 | - $this->data = array_replace_recursive($this->loadScopeData($scopeType, $scopeId), $this->data); 9 | + $scopeData = $this->loadScopeData($scopeType, $scopeId); 10 | + /* Starting from 2.2.0 $this->data can be already loaded with $this->loadScopeData */ 11 | + if (!isset($this->data[$scopeType][$scopeId])) { 12 | + $this->data = array_replace_recursive($scopeData, $this->data); 13 | + } 14 | } 15 | return isset($this->data[$scopeType][$scopeId]) 16 | ? $this->getDataByPathParts($this->data[$scopeType][$scopeId], $pathParts) 17 | -------------------------------------------------------------------------------- /patches/MAGECLOUD-2427__resolve_issues_with_cron_schedule__2.1.10.patch: -------------------------------------------------------------------------------- 1 | diff -Nuar a/vendor/magento/module-cron/etc/cron_groups.xml b/vendor/magento/module-cron/etc/cron_groups.xml 2 | --- a/vendor/magento/module-cron/etc/cron_groups.xml 3 | +++ b/vendor/magento/module-cron/etc/cron_groups.xml 4 | @@ -11,8 +11,8 @@ 5 | 20 6 | 15 7 | 10 8 | - 10080 9 | - 10080 10 | + 60 11 | + 4320 12 | 0 13 | 14 | 15 | diff -Nuar a/vendor/magento/module-indexer/etc/cron_groups.xml b/vendor/magento/module-indexer/etc/cron_groups.xml 16 | --- a/vendor/magento/module-indexer/etc/cron_groups.xml 17 | +++ b/vendor/magento/module-indexer/etc/cron_groups.xml 18 | @@ -11,8 +11,8 @@ 19 | 4 20 | 2 21 | 10 22 | - 10080 23 | - 10080 24 | + 60 25 | + 4320 26 | 1 27 | 28 | 29 | -------------------------------------------------------------------------------- /patches/MAGECLOUD-2464__fix_problems_with_consumer_runners_on_cloud_clusters__2.2.0.patch: -------------------------------------------------------------------------------- 1 | diff -Nuar a/vendor/magento/module-message-queue/Model/Cron/ConsumersRunner/PidConsumerManager.php b/vendor/magento/module-message-queue/Model/Cron/ConsumersRunner/PidConsumerManager.php 2 | --- a/vendor/magento/module-message-queue/Model/Cron/ConsumersRunner/PidConsumerManager.php 3 | +++ b/vendor/magento/module-message-queue/Model/Cron/ConsumersRunner/PidConsumerManager.php 4 | @@ -119,7 +119,7 @@ class PidConsumerManager 5 | */ 6 | public function getPid($consumerName) 7 | { 8 | - $pidFile = $consumerName . static::PID_FILE_EXT; 9 | + $pidFile = $this->getPidFileName($consumerName); 10 | /** @var WriteInterface $directory */ 11 | $directory = $this->filesystem->getDirectoryWrite(DirectoryList::VAR_DIR); 12 | 13 | @@ -138,7 +138,7 @@ class PidConsumerManager 14 | */ 15 | public function getPidFilePath($consumerName) 16 | { 17 | - return $this->directoryList->getPath(DirectoryList::VAR_DIR) . '/' . $consumerName . static::PID_FILE_EXT; 18 | + return $this->directoryList->getPath(DirectoryList::VAR_DIR) . '/' . $this->getPidFileName($consumerName); 19 | } 20 | 21 | /** 22 | @@ -152,4 +152,17 @@ class PidConsumerManager 23 | $file->write(function_exists('posix_getpid') ? posix_getpid() : getmypid()); 24 | $file->close(); 25 | } 26 | + 27 | + /** 28 | + * Returns default file name with PID by consumers name 29 | + * 30 | + * @param string $consumerName The consumers name 31 | + * @return string The file name with PID 32 | + */ 33 | + private function getPidFileName($consumerName) 34 | + { 35 | + $sanitizedHostname = preg_replace('/[^a-z0-9]/i', '', gethostname()); 36 | + 37 | + return $consumerName . '-' . $sanitizedHostname . static::PID_FILE_EXT; 38 | + } 39 | } 40 | -------------------------------------------------------------------------------- /patches/MAGECLOUD-2464__fix_problems_with_consumer_runners_on_cloud_clusters__2.2.4.patch: -------------------------------------------------------------------------------- 1 | diff -Nuar a/vendor/magento/module-message-queue/Model/Cron/ConsumersRunner.php b/vendor/magento/module-message-queue/Model/Cron/ConsumersRunner.php 2 | --- a/vendor/magento/module-message-queue/Model/Cron/ConsumersRunner.php 3 | +++ b/vendor/magento/module-message-queue/Model/Cron/ConsumersRunner.php 4 | @@ -139,6 +139,8 @@ class ConsumersRunner 5 | */ 6 | private function getPidFilePath($consumerName) 7 | { 8 | - return $consumerName . static::PID_FILE_EXT; 9 | + $sanitizedHostname = preg_replace('/[^a-z0-9]/i', '', gethostname()); 10 | + 11 | + return $consumerName . '-' . $sanitizedHostname . static::PID_FILE_EXT; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /patches/MAGECLOUD-2509__remove_permission_check_for_console_application__2.2.6.patch: -------------------------------------------------------------------------------- 1 | diff -Naur a/vendor/magento/framework/Console/Cli.php b/vendor/magento/framework/Console/Cli.php 2 | --- a/vendor/magento/framework/Console/Cli.php 3 | +++ b/vendor/magento/framework/Console/Cli.php 4 | @@ -9,7 +9,6 @@ use Magento\Framework\App\Bootstrap; 5 | use Magento\Framework\App\DeploymentConfig; 6 | use Magento\Framework\App\Filesystem\DirectoryList; 7 | use Magento\Framework\App\ProductMetadata; 8 | -use Magento\Framework\App\State; 9 | use Magento\Framework\Composer\ComposerJsonFinder; 10 | use Magento\Framework\Console\Exception\GenerationDirectoryAccessException; 11 | use Magento\Framework\Filesystem\Driver\File; 12 | @@ -74,7 +73,6 @@ class Cli extends Console\Application 13 | 14 | $this->assertCompilerPreparation(); 15 | $this->initObjectManager(); 16 | - $this->assertGenerationPermissions(); 17 | } catch (\Exception $exception) { 18 | $output = new \Symfony\Component\Console\Output\ConsoleOutput(); 19 | $output->writeln( 20 | @@ -167,33 +165,6 @@ class Cli extends Console\Application 21 | $omProvider->setObjectManager($this->objectManager); 22 | } 23 | 24 | - /** 25 | - * Checks whether generation directory is read-only. 26 | - * Depends on the current mode: 27 | - * production - application will proceed 28 | - * default - application will be terminated 29 | - * developer - application will be terminated 30 | - * 31 | - * @return void 32 | - * @throws GenerationDirectoryAccessException If generation directory is read-only in developer mode 33 | - */ 34 | - private function assertGenerationPermissions() 35 | - { 36 | - /** @var GenerationDirectoryAccess $generationDirectoryAccess */ 37 | - $generationDirectoryAccess = $this->objectManager->create( 38 | - GenerationDirectoryAccess::class, 39 | - ['serviceManager' => $this->serviceManager] 40 | - ); 41 | - /** @var State $state */ 42 | - $state = $this->objectManager->get(State::class); 43 | - 44 | - if ($state->getMode() !== State::MODE_PRODUCTION 45 | - && !$generationDirectoryAccess->check() 46 | - ) { 47 | - throw new GenerationDirectoryAccessException(); 48 | - } 49 | - } 50 | - 51 | /** 52 | * Checks whether compiler is being prepared. 53 | * 54 | -------------------------------------------------------------------------------- /patches/MAGECLOUD-2899__fix_redis_slave_configuration__2.1.16.patch: -------------------------------------------------------------------------------- 1 | diff -Nuar a/vendor/colinmollenhour/cache-backend-redis/Cm/Cache/Backend/Redis.php b/vendor/colinmollenhour/cache-backend-redis/Cm/Cache/Backend/Redis.php 2 | --- a/vendor/colinmollenhour/cache-backend-redis/Cm/Cache/Backend/Redis.php 3 | +++ b/vendor/colinmollenhour/cache-backend-redis/Cm/Cache/Backend/Redis.php 4 | @@ -111,6 +111,13 @@ class Cm_Cache_Backend_Redis extends Zend_Cache_Backend implements Zend_Cache_Ba 5 | */ 6 | protected $_luaMaxCStack = 5000; 7 | 8 | + /** 9 | + * If 'retry_reads_on_master' is truthy then reads will be retried against master when slave returns "(nil)" value 10 | + * 11 | + * @var boolean 12 | + */ 13 | + protected $_retryReadsOnMaster = false; 14 | + 15 | /** 16 | * @var stdClass 17 | */ 18 | @@ -316,6 +323,10 @@ class Cm_Cache_Backend_Redis extends Zend_Cache_Backend implements Zend_Cache_Ba 19 | $this->_luaMaxCStack = (int) $options['lua_max_c_stack']; 20 | } 21 | 22 | + if (isset($options['retry_reads_on_master'])) { 23 | + $this->_retryReadsOnMaster = (bool) $options['retry_reads_on_master']; 24 | + } 25 | + 26 | if (isset($options['auto_expire_lifetime'])) { 27 | $this->_autoExpireLifetime = (int) $options['auto_expire_lifetime']; 28 | } 29 | @@ -371,6 +382,11 @@ class Cm_Cache_Backend_Redis extends Zend_Cache_Backend implements Zend_Cache_Ba 30 | { 31 | if ($this->_slave) { 32 | $data = $this->_slave->hGet(self::PREFIX_KEY.$id, self::FIELD_DATA); 33 | + 34 | + // Prevent compounded effect of cache flood on asynchronously replicating master/slave setup 35 | + if ($this->_retryReadsOnMaster && $data === false) { 36 | + $data = $this->_redis->hGet(self::PREFIX_KEY.$id, self::FIELD_DATA); 37 | + } 38 | } else { 39 | $data = $this->_redis->hGet(self::PREFIX_KEY.$id, self::FIELD_DATA); 40 | } 41 | -------------------------------------------------------------------------------- /patches/MAGECLOUD-2899__fix_redis_slave_configuration__2.2.3.patch: -------------------------------------------------------------------------------- 1 | diff -Nuar a/vendor/colinmollenhour/cache-backend-redis/Cm/Cache/Backend/Redis.php b/vendor/colinmollenhour/cache-backend-redis/Cm/Cache/Backend/Redis.php 2 | --- a/vendor/colinmollenhour/cache-backend-redis/Cm/Cache/Backend/Redis.php 3 | +++ b/vendor/colinmollenhour/cache-backend-redis/Cm/Cache/Backend/Redis.php 4 | @@ -111,6 +111,13 @@ class Cm_Cache_Backend_Redis extends Zend_Cache_Backend implements Zend_Cache_Ba 5 | */ 6 | protected $_luaMaxCStack = 5000; 7 | 8 | + /** 9 | + * If 'retry_reads_on_master' is truthy then reads will be retried against master when slave returns "(nil)" value 10 | + * 11 | + * @var boolean 12 | + */ 13 | + protected $_retryReadsOnMaster = false; 14 | + 15 | /** 16 | * @var stdClass 17 | */ 18 | @@ -326,6 +333,10 @@ class Cm_Cache_Backend_Redis extends Zend_Cache_Backend implements Zend_Cache_Ba 19 | $this->_luaMaxCStack = (int) $options['lua_max_c_stack']; 20 | } 21 | 22 | + if (isset($options['retry_reads_on_master'])) { 23 | + $this->_retryReadsOnMaster = (bool) $options['retry_reads_on_master']; 24 | + } 25 | + 26 | if (isset($options['auto_expire_lifetime'])) { 27 | $this->_autoExpireLifetime = (int) $options['auto_expire_lifetime']; 28 | } 29 | @@ -428,6 +439,11 @@ class Cm_Cache_Backend_Redis extends Zend_Cache_Backend implements Zend_Cache_Ba 30 | { 31 | if ($this->_slave) { 32 | $data = $this->_slave->hGet(self::PREFIX_KEY.$id, self::FIELD_DATA); 33 | + 34 | + // Prevent compounded effect of cache flood on asynchronously replicating master/slave setup 35 | + if ($this->_retryReadsOnMaster && $data === false) { 36 | + $data = $this->_redis->hGet(self::PREFIX_KEY.$id, self::FIELD_DATA); 37 | + } 38 | } else { 39 | $data = $this->_redis->hGet(self::PREFIX_KEY.$id, self::FIELD_DATA); 40 | } 41 | -------------------------------------------------------------------------------- /patches/MAGECLOUD-2899__fix_redis_slave_configuration__2.3.0.patch: -------------------------------------------------------------------------------- 1 | diff -Nuar a/vendor/colinmollenhour/cache-backend-redis/Cm/Cache/Backend/Redis.php b/vendor/colinmollenhour/cache-backend-redis/Cm/Cache/Backend/Redis.php 2 | --- a/vendor/colinmollenhour/cache-backend-redis/Cm/Cache/Backend/Redis.php 3 | +++ b/vendor/colinmollenhour/cache-backend-redis/Cm/Cache/Backend/Redis.php 4 | @@ -111,6 +111,13 @@ class Cm_Cache_Backend_Redis extends Zend_Cache_Backend implements Zend_Cache_Ba 5 | */ 6 | protected $_luaMaxCStack = 5000; 7 | 8 | + /** 9 | + * If 'retry_reads_on_master' is truthy then reads will be retried against master when slave returns "(nil)" value 10 | + * 11 | + * @var boolean 12 | + */ 13 | + protected $_retryReadsOnMaster = false; 14 | + 15 | /** 16 | * @var stdClass 17 | */ 18 | @@ -339,6 +346,10 @@ class Cm_Cache_Backend_Redis extends Zend_Cache_Backend implements Zend_Cache_Ba 19 | $this->_luaMaxCStack = (int) $options['lua_max_c_stack']; 20 | } 21 | 22 | + if (isset($options['retry_reads_on_master'])) { 23 | + $this->_retryReadsOnMaster = (bool) $options['retry_reads_on_master']; 24 | + } 25 | + 26 | if (isset($options['auto_expire_lifetime'])) { 27 | $this->_autoExpireLifetime = (int) $options['auto_expire_lifetime']; 28 | } 29 | @@ -441,6 +452,11 @@ class Cm_Cache_Backend_Redis extends Zend_Cache_Backend implements Zend_Cache_Ba 30 | { 31 | if ($this->_slave) { 32 | $data = $this->_slave->hGet(self::PREFIX_KEY.$id, self::FIELD_DATA); 33 | + 34 | + // Prevent compounded effect of cache flood on asynchronously replicating master/slave setup 35 | + if ($this->_retryReadsOnMaster && $data === false) { 36 | + $data = $this->_redis->hGet(self::PREFIX_KEY.$id, self::FIELD_DATA); 37 | + } 38 | } else { 39 | $data = $this->_redis->hGet(self::PREFIX_KEY.$id, self::FIELD_DATA); 40 | } 41 | -------------------------------------------------------------------------------- /patches/MAGECLOUD-3806__error_code_fix_for_setup_upgrade__2.2.0.patch: -------------------------------------------------------------------------------- 1 | diff -Nuar a/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php b/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php 2 | --- a/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php 3 | +++ b/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php 4 | @@ -77,6 +77,7 @@ class UpgradeCommand extends AbstractSetupCommand 5 | protected function execute(InputInterface $input, OutputInterface $output) 6 | { 7 | try { 8 | + $resultCode = \Magento\Framework\Console\Cli::RETURN_SUCCESS; 9 | $keepGenerated = $input->getOption(self::INPUT_KEY_KEEP_GENERATED); 10 | $installer = $this->installerFactory->create(new ConsoleLogger($output)); 11 | $installer->updateModulesSequence($keepGenerated); 12 | @@ -87,10 +88,10 @@ class UpgradeCommand extends AbstractSetupCommand 13 | $importConfigCommand = $this->getApplication()->find(ConfigImportCommand::COMMAND_NAME); 14 | $arrayInput = new ArrayInput([]); 15 | $arrayInput->setInteractive($input->isInteractive()); 16 | - $importConfigCommand->run($arrayInput, $output); 17 | + $resultCode = $importConfigCommand->run($arrayInput, $output); 18 | } 19 | 20 | - if (!$keepGenerated) { 21 | + if ($resultCode !== \Magento\Framework\Console\Cli::RETURN_FAILURE && !$keepGenerated) { 22 | $output->writeln( 23 | 'Please re-run Magento compile command. Use the command "setup:di:compile"' 24 | ); 25 | @@ -100,6 +101,6 @@ class UpgradeCommand extends AbstractSetupCommand 26 | return \Magento\Framework\Console\Cli::RETURN_FAILURE; 27 | } 28 | 29 | - return \Magento\Framework\Console\Cli::RETURN_SUCCESS; 30 | + return $resultCode; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /patches/MAGECLOUD-3806__error_code_fix_for_setup_upgrade__2.2.1.patch: -------------------------------------------------------------------------------- 1 | diff -Nuar a/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php b/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php 2 | --- a/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php 3 | +++ b/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php 4 | @@ -87,6 +87,7 @@ protected function configure() 5 | protected function execute(InputInterface $input, OutputInterface $output) 6 | { 7 | try { 8 | + $resultCode = \Magento\Framework\Console\Cli::RETURN_SUCCESS; 9 | $keepGenerated = $input->getOption(self::INPUT_KEY_KEEP_GENERATED); 10 | $installer = $this->installerFactory->create(new ConsoleLogger($output)); 11 | $installer->updateModulesSequence($keepGenerated); 12 | @@ -97,10 +98,11 @@ protected function execute(InputInterface $input, OutputInterface $output) 13 | $importConfigCommand = $this->getApplication()->find(ConfigImportCommand::COMMAND_NAME); 14 | $arrayInput = new ArrayInput([]); 15 | $arrayInput->setInteractive($input->isInteractive()); 16 | - $importConfigCommand->run($arrayInput, $output); 17 | + $resultCode = $importConfigCommand->run($arrayInput, $output); 18 | } 19 | 20 | - if (!$keepGenerated && $this->appState->getMode() === AppState::MODE_PRODUCTION) { 21 | + if ($resultCode !== \Magento\Framework\Console\Cli::RETURN_FAILURE 22 | + && !$keepGenerated && $this->appState->getMode() === AppState::MODE_PRODUCTION) { 23 | $output->writeln( 24 | 'Please re-run Magento compile command. Use the command "setup:di:compile"' 25 | ); 26 | @@ -110,6 +112,6 @@ protected function execute(InputInterface $input, OutputInterface $output) 27 | return \Magento\Framework\Console\Cli::RETURN_FAILURE; 28 | } 29 | 30 | - return \Magento\Framework\Console\Cli::RETURN_SUCCESS; 31 | + return $resultCode; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /patches/MAGECLOUD-3806__error_code_fix_for_setup_upgrade__2.3.0.patch: -------------------------------------------------------------------------------- 1 | diff -Nuar a/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php b/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php 2 | --- a/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php 3 | +++ b/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php 4 | @@ -126,7 +126,10 @@ protected function execute(InputInterface $input, OutputInterface $output) 5 | $importConfigCommand = $this->getApplication()->find(ConfigImportCommand::COMMAND_NAME); 6 | $arrayInput = new ArrayInput([]); 7 | $arrayInput->setInteractive($input->isInteractive()); 8 | - $importConfigCommand->run($arrayInput, $output); 9 | + $result = $importConfigCommand->run($arrayInput, $output); 10 | + if ($result === \Magento\Framework\Console\Cli::RETURN_FAILURE) { 11 | + throw new \Magento\Framework\Exception\RuntimeException(__('%1 failed. See previous output.', ConfigImportCommand::COMMAND_NAME)); 12 | + } 13 | } 14 | 15 | if (!$keepGenerated && $this->appState->getMode() === AppState::MODE_PRODUCTION) { 16 | -------------------------------------------------------------------------------- /patches/MAGECLOUD-414__remove_unnecessary_permission_checks__2.1.4.patch: -------------------------------------------------------------------------------- 1 | diff -Naur b/vendor/magento/framework/Setup/FilePermissions.php a/vendor/magento/framework/Setup/FilePermissions.php 2 | --- b/vendor/magento/framework/Setup/FilePermissions.php 2016-09-23 16:01:12.000000000 -0500 3 | +++ a/vendor/magento/framework/Setup/FilePermissions.php 2016-09-23 16:22:09.000000000 -0500 4 | @@ -233,26 +233,8 @@ 5 | */ 6 | public function getMissingWritablePathsForInstallation($associative = false) 7 | { 8 | - $required = $this->getInstallationWritableDirectories(); 9 | - $current = $this->getInstallationCurrentWritableDirectories(); 10 | - $missingPaths = []; 11 | - foreach (array_diff($required, $current) as $missingPath) { 12 | - if (isset($this->nonWritablePathsInDirectories[$missingPath])) { 13 | - if ($associative) { 14 | - $missingPaths[$missingPath] = $this->nonWritablePathsInDirectories[$missingPath]; 15 | - } else { 16 | - $missingPaths = array_merge( 17 | - $missingPaths, 18 | - $this->nonWritablePathsInDirectories[$missingPath] 19 | - ); 20 | - } 21 | - } 22 | - } 23 | - if ($associative) { 24 | - $required = array_flip($required); 25 | - $missingPaths = array_merge($required, $missingPaths); 26 | - } 27 | - return $missingPaths; 28 | + // Unnecessary check in controlled environment 29 | + return []; 30 | } 31 | 32 | /** 33 | @@ -275,8 +257,7 @@ 34 | */ 35 | public function getUnnecessaryWritableDirectoriesForApplication() 36 | { 37 | - $required = $this->getApplicationNonWritableDirectories(); 38 | - $current = $this->getApplicationCurrentNonWritableDirectories(); 39 | - return array_diff($required, $current); 40 | + // Unnecessary check in controlled environment 41 | + return []; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /patches/MAGECLOUD-414__remove_unnecessary_permission_checks__2.2.0.patch: -------------------------------------------------------------------------------- 1 | diff -Naur b/vendor/magento/framework/Setup/FilePermissions.php a/vendor/magento/framework/Setup/FilePermissions.php 2 | --- b/vendor/magento/framework/Setup/FilePermissions.php 2016-09-23 16:01:12.000000000 -0500 3 | +++ a/vendor/magento/framework/Setup/FilePermissions.php 2016-09-23 16:22:09.000000000 -0500 4 | @@ -233,26 +233,8 @@ 5 | */ 6 | public function getMissingWritablePathsForInstallation($associative = false) 7 | { 8 | - $required = $this->getInstallationWritableDirectories(); 9 | - $current = $this->getInstallationCurrentWritableDirectories(); 10 | - $missingPaths = []; 11 | - foreach (array_diff($required, $current) as $missingPath) { 12 | - if (isset($this->nonWritablePathsInDirectories[$missingPath])) { 13 | - if ($associative) { 14 | - $missingPaths[$missingPath] = $this->nonWritablePathsInDirectories[$missingPath]; 15 | - } else { 16 | - $missingPaths = array_merge( 17 | - $missingPaths, 18 | - $this->nonWritablePathsInDirectories[$missingPath] 19 | - ); 20 | - } 21 | - } 22 | - } 23 | - if ($associative) { 24 | - $required = array_flip($required); 25 | - $missingPaths = array_merge($required, $missingPaths); 26 | - } 27 | - return $missingPaths; 28 | + // Unnecessary check in controlled environment 29 | + return []; 30 | } 31 | 32 | /** 33 | @@ -275,8 +257,7 @@ 34 | */ 35 | public function getUnnecessaryWritableDirectoriesForApplication() 36 | { 37 | - $required = $this->getApplicationNonWritableDirectories(); 38 | - $current = $this->getApplicationCurrentNonWritableDirectories(); 39 | - return array_diff($required, $current); 40 | + // Unnecessary check in controlled environment 41 | + return []; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /patches/MAGECLOUD-4407__fix_namespace_vertex_tax__3.2.0.patch: -------------------------------------------------------------------------------- 1 | diff -Naur a/vendor/vertex/module-tax/Model/FlexField/Processor/OrderCurrencyGetterProcessor.php b/vendor/vertex/module-tax/Model/FlexField/Processor/OrderCurrencyGetterProcessor.php 2 | --- a/vendor/vertex/module-tax/Model/FlexField/Processor/OrderCurrencyGetterProcessor.php 3 | +++ b/vendor/vertex/module-tax/Model/FlexField/Processor/OrderCurrencyGetterProcessor.php 4 | @@ -4,7 +4,7 @@ 5 | * @author Mediotype https://www.mediotype.com/ 6 | */ 7 | 8 | -namespace Vertex\Tax\Model\Flexfield\Processor; 9 | +namespace Vertex\Tax\Model\FlexField\Processor; 10 | 11 | use Magento\Framework\Exception\NoSuchEntityException; 12 | use Magento\Quote\Api\CartRepositoryInterface; 13 | -------------------------------------------------------------------------------- /patches/MAGECLOUD-589__load_appropriate_js_files__2.1.4.patch: -------------------------------------------------------------------------------- 1 | MAGECLOUD-589 MAGETWO-64955 2 | diff -Naur a/vendor/magento/framework/View/Asset/File/FallbackContext.php b/vendor/magento/framework/View/Asset/File/FallbackContext.php 3 | --- a/vendor/magento/framework/View/Asset/File/FallbackContext.php 2016-10-15 12:38:21.595266000 +0000 4 | +++ b/vendor/magento/framework/View/Asset/File/FallbackContext.php 2016-10-15 12:39:13.587266000 +0000 5 | @@ -103,6 +103,6 @@ 6 | */ 7 | public function getConfigPath() 8 | { 9 | - return $this->getPath() . ($this->isSecure ? '/' . self::SECURE_PATH : ''); 10 | + return $this->getPath(); 11 | } 12 | } 13 | 14 | diff -Nuar a/vendor/magento/framework/View/Asset/Repository.php b/vendor/magento/framework/View/Asset/Repository.php 15 | --- a/vendor/magento/framework/View/Asset/Repository.php 2017-02-16 16:50:18.000000000 +0000 16 | +++ b/vendor/magento/framework/View/Asset/Repository.php 2017-02-22 14:29:40.000000000 +0000 17 | @@ -269,8 +269,7 @@ 18 | 'baseUrl' => $url, 19 | 'areaType' => $area, 20 | 'themePath' => $themePath, 21 | - 'localeCode' => $locale, 22 | - 'isSecure' => $isSecure 23 | + 'localeCode' => $locale 24 | ] 25 | ); 26 | } 27 | -------------------------------------------------------------------------------- /patches/MAGECLOUD-6029__add_processor_interface__2.1.x.patch: -------------------------------------------------------------------------------- 1 | diff -Naur a/vendor/monolog/monolog/src/Monolog/Processor/ProcessorInterface.php b/vendor/monolog/monolog/src/Monolog/Processor/ProcessorInterface.php 2 | --- /dev/null 3 | +++ b/vendor/monolog/monolog/src/Monolog/Processor/ProcessorInterface.php 4 | @@ -0,0 +1,25 @@ 5 | + 11 | + * 12 | + * For the full copyright and license information, please view the LICENSE 13 | + * file that was distributed with this source code. 14 | + */ 15 | + 16 | +namespace Monolog\Processor; 17 | + 18 | +/** 19 | + * An optional interface to allow labelling Monolog processors. 20 | + * 21 | + * @author Nicolas Grekas 22 | + */ 23 | +interface ProcessorInterface 24 | +{ 25 | + /** 26 | + * @return array The processed records 27 | + */ 28 | + public function __invoke(array $records); 29 | +} 30 | -------------------------------------------------------------------------------- /patches/MAGETWO-45357__avoid_nonexistent_setup_area__2.1.4.patch: -------------------------------------------------------------------------------- 1 | Ticket MAGETWO-45357 2 | diff -Nuar a/vendor/magento/framework/App/ObjectManager/ConfigLoader/Compiled.php b/vendor/magento/framework/App/ObjectManager/ConfigLoader/Compiled.php 3 | --- a/vendor/magento/framework/App/ObjectManager/ConfigLoader/Compiled.php 4 | +++ b/vendor/magento/framework/App/ObjectManager/ConfigLoader/Compiled.php 5 | @@ -37,6 +37,9 @@ class Compiled implements ConfigLoaderInterface 6 | */ 7 | public static function getFilePath($area) 8 | { 9 | + if ($area == 'setup') { 10 | + $area = 'global'; 11 | + } 12 | return BP . '/var/di/' . $area . '.ser'; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /patches/MAGETWO-53941__fix_enterprise_braintree_code__100.1.6.patch: -------------------------------------------------------------------------------- 1 | diff -Nuar a/vendor/magento/module-braintree/Gateway/Request/ChannelDataBuilder.php b/vendor/magento/module-braintree/Gateway/Request/ChannelDataBuilder.php 2 | --- a/vendor/magento/module-braintree/Gateway/Request/ChannelDataBuilder.php 3 | +++ b/vendor/magento/module-braintree/Gateway/Request/ChannelDataBuilder.php 4 | @@ -26,7 +26,7 @@ 5 | /** 6 | * @var string 7 | */ 8 | - private static $channelValue = 'Magento2_Cart_%s_BT'; 9 | + private static $channelValue = 'Magento_Enterprise_Cloud_BT'; 10 | 11 | /** 12 | * Constructor 13 | @@ -44,7 +44,7 @@ 14 | public function build(array $buildSubject) 15 | { 16 | return [ 17 | - self::$channel => sprintf(self::$channelValue, $this->productMetadata->getEdition()) 18 | + self::$channel => self::$channelValue 19 | ]; 20 | } 21 | } 22 | diff -Nuar a/vendor/magento/module-braintree/Test/Unit/Gateway/Request/ChannelDataBuilderTest.php b/vendor/magento/module-braintree/Test/Unit/Gateway/Request/ChannelDataBuilderTest.php 23 | --- a/vendor/magento/module-braintree/Test/Unit/Gateway/Request/ChannelDataBuilderTest.php 24 | +++ b/vendor/magento/module-braintree/Test/Unit/Gateway/Request/ChannelDataBuilderTest.php 25 | @@ -40,7 +40,7 @@ 26 | public function testBuild($edition, array $expected) 27 | { 28 | $buildSubject = []; 29 | - $this->productMetadataMock->expects(static::once()) 30 | + $this->productMetadataMock->expects(static::never()) 31 | ->method('getEdition') 32 | ->willReturn($edition); 33 | 34 | @@ -54,8 +54,8 @@ 35 | public function buildDataProvider() 36 | { 37 | return [ 38 | - ['FirstEdition', ['channel' => 'Magento2_Cart_FirstEdition_BT']], 39 | - ['SecondEdition', ['channel' => 'Magento2_Cart_SecondEdition_BT']], 40 | + ['FirstEdition', ['channel' => 'Magento_Enterprise_Cloud_BT']], 41 | + ['SecondEdition', ['channel' => 'Magento_Enterprise_Cloud_BT']], 42 | ]; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /patches/MAGETWO-53941__fix_enterprise_paypal_codes__100.1.6.patch: -------------------------------------------------------------------------------- 1 | diff -Nuar a/vendor/magento/module-paypal/Model/AbstractConfig.php b/vendor/magento/module-paypal/Model/AbstractConfig.php 2 | --- a/vendor/magento/module-paypal/Model/AbstractConfig.php 3 | +++ b/vendor/magento/module-paypal/Model/AbstractConfig.php 4 | @@ -59,7 +59,7 @@ 5 | /** 6 | * @var string 7 | */ 8 | - private static $bnCode = 'Magento_Cart_%s'; 9 | + private static $bnCode = 'Magento_Enterprise_Cloud'; 10 | 11 | /** 12 | * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig 13 | @@ -335,7 +335,7 @@ 14 | */ 15 | public function getBuildNotationCode() 16 | { 17 | - return sprintf(self::$bnCode, $this->getProductMetadata()->getEdition()); 18 | + return self::$bnCode; 19 | } 20 | 21 | /** 22 | diff -Nuar a/vendor/magento/module-paypal/Test/Unit/Model/AbstractConfigTest.php b/vendor/magento/module-paypal/Test/Unit/Model/AbstractConfigTest.php 23 | --- a/vendor/magento/module-paypal/Test/Unit/Model/AbstractConfigTest.php 24 | +++ b/vendor/magento/module-paypal/Test/Unit/Model/AbstractConfigTest.php 25 | @@ -293,7 +293,7 @@ 26 | public function testGetBuildNotationCode() 27 | { 28 | $productMetadata = $this->getMock(ProductMetadataInterface::class, [], [], '', false); 29 | - $productMetadata->expects($this->once()) 30 | + $productMetadata->expects($this->never()) 31 | ->method('getEdition') 32 | ->will($this->returnValue('SomeEdition')); 33 | 34 | @@ -304,6 +304,6 @@ 35 | $productMetadata 36 | ); 37 | 38 | - $this->assertEquals('Magento_Cart_SomeEdition', $this->config->getBuildNotationCode()); 39 | + $this->assertEquals('Magento_Enterprise_Cloud', $this->config->getBuildNotationCode()); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /patches/MAGETWO-56675__dont_skip_setup_scoped_plugins__2.1.4.patch: -------------------------------------------------------------------------------- 1 | Patch regarding MAGETWO-56675. 2 | diff -Nuar a/vendor/magento/framework/Interception/PluginList/PluginList.php b/vendor/magento/framework/Interception/PluginList/PluginList.php 3 | --- a/vendor/magento/framework/Interception/PluginList/PluginList.php 4 | +++ b/vendor/magento/framework/Interception/PluginList/PluginList.php 5 | @@ -277,6 +277,7 @@ class PluginList extends Scoped implements InterceptionPluginList 6 | $virtualTypes = []; 7 | foreach ($this->_scopePriorityScheme as $scopeCode) { 8 | if (false == isset($this->_loadedScopes[$scopeCode])) { 9 | + $this->_loadedScopes[$scopeCode] = true; 10 | $data = $this->_reader->read($scopeCode); 11 | unset($data['preferences']); 12 | if (!count($data)) { 13 | @@ -285,7 +286,6 @@ class PluginList extends Scoped implements InterceptionPluginList 14 | $this->_inherited = []; 15 | $this->_processed = []; 16 | $this->merge($data); 17 | - $this->_loadedScopes[$scopeCode] = true; 18 | foreach ($data as $class => $config) { 19 | if (isset($config['type'])) { 20 | $virtualTypes[] = $class; 21 | -------------------------------------------------------------------------------- /patches/MAGETWO-57413__move_vendor_path_autoloader__2.1.4.patch: -------------------------------------------------------------------------------- 1 | Ticket MAGETWO-57413 2 | diff -Naur a/app/autoload.php b/app/autoload.php 3 | --- a/app/autoload.php 4 | +++ b/app/autoload.php 5 | @@ -13,16 +13,7 @@ use Magento\Framework\Autoload\ClassLoaderWrapper; 6 | */ 7 | define('BP', dirname(__DIR__)); 8 | 9 | -define('VENDOR_PATH', BP . '/app/etc/vendor_path.php'); 10 | - 11 | -if (!file_exists(VENDOR_PATH)) { 12 | - throw new \Exception( 13 | - 'We can\'t read some files that are required to run the Magento application. ' 14 | - . 'This usually means file permissions are set incorrectly.' 15 | - ); 16 | -} 17 | - 18 | -$vendorDir = require VENDOR_PATH; 19 | +$vendorDir = './vendor'; 20 | $vendorAutoload = BP . "/{$vendorDir}/autoload.php"; 21 | 22 | /* 'composer install' validation */ 23 | 24 | diff -Naur a/vendor/magento/framework/App/Arguments/FileResolver/Primary.php b/vendor/magento/framework/App/Arguments/FileResolver/Primary.php 25 | --- a/vendor/magento/framework/App/Arguments/FileResolver/Primary.php 26 | +++ b/vendor/magento/framework/App/Arguments/FileResolver/Primary.php 27 | @@ -29,7 +29,7 @@ class Primary implements \Magento\Framework\Config\FileResolverInterface 28 | \Magento\Framework\Filesystem $filesystem, 29 | \Magento\Framework\Config\FileIteratorFactory $iteratorFactory 30 | ) { 31 | - $this->configDirectory = $filesystem->getDirectoryRead(DirectoryList::CONFIG); 32 | + $this->configDirectory = $filesystem->getDirectoryRead(DirectoryList::APP); 33 | $this->iteratorFactory = $iteratorFactory; 34 | } 35 | 36 | -------------------------------------------------------------------------------- /patches/MAGETWO-63020__fix_scd_with_multiple_languages__2.1.4.patch: -------------------------------------------------------------------------------- 1 | MAGETWO-63020 2 | diff --Naur a/vendor/magento/framework/View/Design/Theme/FlyweightFactory.php b/vendor/magento/framework/View/Design/Theme/FlyweightFactory.php 3 | --- a/vendor/magento/framework/View/Design/Theme/FlyweightFactory.php 2017-01-06 20:41:07.000000000 +0000 4 | +++ b/vendor/magento/framework/View/Design/Theme/FlyweightFactory.php 2017-01-06 20:42:33.000000000 +0000 5 | @@ -61,7 +61,7 @@ 6 | } else { 7 | $themeModel = $this->_loadByPath($themeKey, $area); 8 | } 9 | - if (!$themeModel->getId()) { 10 | + if (!$themeModel->getCode()) { 11 | throw new \LogicException("Unable to load theme by specified key: '{$themeKey}'"); 12 | } 13 | $this->_addTheme($themeModel); 14 | -------------------------------------------------------------------------------- /patches/MAGETWO-63032__skip_unnecessary_write_permission_check__2.1.4.patch: -------------------------------------------------------------------------------- 1 | MAGETWO-63032 2 | diff -Naur a/vendor/magento/framework/Console/Cli.php b/vendor/magento/framework/Console/Cli.php 3 | --- a/vendor/magento/framework/Console/Cli.php 2016-09-28 00:46:02.000000000 -0500 4 | +++ b/vendor/magento/framework/Console/Cli.php 2016-09-28 00:46:38.000000000 -0500 5 | @@ -56,15 +56,6 @@ 6 | { 7 | $this->serviceManager = \Zend\Mvc\Application::init(require BP . '/setup/config/application.config.php') 8 | ->getServiceManager(); 9 | - $generationDirectoryAccess = new GenerationDirectoryAccess($this->serviceManager); 10 | - if (!$generationDirectoryAccess->check()) { 11 | - $output = new ConsoleOutput(); 12 | - $output->writeln( 13 | - 'Command line user does not have read and write permissions on var/generation directory. Please' 14 | - . ' address this issue before using Magento command line.' 15 | - ); 16 | - exit(0); 17 | - } 18 | /** 19 | * Temporary workaround until the compiler is able to clear the generation directory 20 | * @todo remove after MAGETWO-44493 resolved 21 | -------------------------------------------------------------------------------- /patches/MAGETWO-67097__fix_credis_pipeline_bug__2.1.4.patch: -------------------------------------------------------------------------------- 1 | diff -Nuar a/vendor/colinmollenhour/credis/Client.php b/vendor/colinmollenhour/credis/Client.php 2 | --- a/vendor/colinmollenhour/credis/Client.php 3 | +++ b/vendor/colinmollenhour/credis/Client.php 4 | @@ -1017,6 +1017,7 @@ class Credis_Client { 5 | } else { 6 | $this->isMulti = TRUE; 7 | $this->redisMulti = call_user_func_array(array($this->redis, $name), $args); 8 | + return $this; 9 | } 10 | } 11 | else if($name == 'exec' || $name == 'discard') { 12 | -------------------------------------------------------------------------------- /patches/MAGETWO-82752__reload_js_translation_data__2.2.0.patch: -------------------------------------------------------------------------------- 1 | --- a/vendor/magento/module-translation/Model/Json/PreProcessor.php 2 | +++ b/vendor/magento/module-translation/Model/Json/PreProcessor.php 3 | @@ -77,7 +77,7 @@ class PreProcessor implements PreProcessorInterface 4 | if ($context instanceof FallbackContext) { 5 | $themePath = $context->getThemePath(); 6 | $areaCode = $context->getAreaCode(); 7 | - $this->translate->setLocale($context->getLocale()); 8 | + $this->translate->setLocale($context->getLocale())->loadData($areaCode); 9 | } 10 | 11 | $area = $this->areaList->getArea($areaCode); 12 | -------------------------------------------------------------------------------- /patches/MAGETWO-84507__fix_complex_folder_js_bundling__2.2.0.patch: -------------------------------------------------------------------------------- 1 | diff -Nuar a/vendor/magento/module-require-js/Model/FileManager.php b/vendor/magento/module-require-js/Model/FileManager.php 2 | --- a/vendor/magento/module-require-js/Model/FileManager.php 3 | +++ b/vendor/magento/module-require-js/Model/FileManager.php 4 | @@ -183,6 +183,9 @@ 5 | } 6 | 7 | foreach ($libDir->read($bundleDir) as $bundleFile) { 8 | + if (pathinfo($bundleFile, PATHINFO_EXTENSION) !== 'js') { 9 | + continue; 10 | + } 11 | $relPath = $libDir->getRelativePath($bundleFile); 12 | $bundles[] = $this->assetRepo->createArbitrary($relPath, ''); 13 | } 14 | -------------------------------------------------------------------------------- /patches/MAGETWO-88336__fix_complex_folder_js_bundling__2.1.4.patch: -------------------------------------------------------------------------------- 1 | diff -Nuar a/vendor/magento/module-require-js/Model/FileManager.php b/vendor/magento/module-require-js/Model/FileManager.php 2 | --- a/vendor/magento/module-require-js/Model/FileManager.php 3 | +++ b/vendor/magento/module-require-js/Model/FileManager.php 4 | @@ -164,6 +164,9 @@ 5 | } 6 | 7 | foreach ($libDir->read($bundleDir) as $bundleFile) { 8 | + if (pathinfo($bundleFile, PATHINFO_EXTENSION) !== 'js') { 9 | + continue; 10 | + } 11 | $relPath = $libDir->getRelativePath($bundleFile); 12 | $bundles[] = $this->assetRepo->createArbitrary($relPath, ''); 13 | } 14 | -------------------------------------------------------------------------------- /patches/MAGETWO-92926__fix_for_multi-site_configuration_issue__2.2.4.patch: -------------------------------------------------------------------------------- 1 | diff -Nuar a/app/etc/di.xml b/app/etc/di.xml 2 | --- a/app/etc/di.xml 3 | +++ b/app/etc/di.xml 4 | @@ -232,6 +233,11 @@ 5 | Magento\Backend\App\Request\PathInfoProcessor\Proxy 6 | 7 | 8 | + 9 | + 10 | + Magento\Framework\Session\Config\ConfigInterface\Proxy 11 | + 12 | + 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /patches/MAGETWO-93036__cannot_change_the_applied_theme__2.2.5.patch: -------------------------------------------------------------------------------- 1 | diff -Nuar a/vendor/magento/module-email/Model/AbstractTemplate.php b/vendor/magento/module-email/Model/AbstractTemplate.php 2 | --- a/vendor/magento/module-email/Model/AbstractTemplate.php 3 | +++ b/vendor/magento/module-email/Model/AbstractTemplate.php 4 | @@ -534,10 +534,9 @@ protected function cancelDesignConfig() 5 | */ 6 | public function setForcedArea($templateId) 7 | { 8 | - if ($this->area) { 9 | - throw new \LogicException(__('Area is already set')); 10 | + if (!isset($this->area)) { 11 | + $this->area = $this->emailConfig->getTemplateArea($templateId); 12 | } 13 | - $this->area = $this->emailConfig->getTemplateArea($templateId); 14 | return $this; 15 | } 16 | 17 | -------------------------------------------------------------------------------- /patches/MAGETWO-93265__fix_depth_of_recursive_check_of_directory_permissions__2.1.4.patch: -------------------------------------------------------------------------------- 1 | diff -Nuar a/vendor/magento/framework/Setup/FilePermissions.php b/vendor/magento/framework/Setup/FilePermissions.php 2 | --- a/vendor/magento/framework/Setup/FilePermissions.php 3 | +++ b/vendor/magento/framework/Setup/FilePermissions.php 4 | @@ -137,6 +137,7 @@ class FilePermissions 5 | */ 6 | private function checkRecursiveDirectories($directory) 7 | { 8 | + /** @var $directoryIterator \RecursiveIteratorIterator */ 9 | $directoryIterator = new \RecursiveIteratorIterator( 10 | new \RecursiveDirectoryIterator($directory, \RecursiveDirectoryIterator::SKIP_DOTS), 11 | \RecursiveIteratorIterator::CHILD_FIRST 12 | @@ -155,6 +156,8 @@ class FilePermissions 13 | ] 14 | ); 15 | 16 | + $directoryIterator->setMaxDepth(1); 17 | + 18 | $foundNonWritable = false; 19 | 20 | try { 21 | -------------------------------------------------------------------------------- /patches/MC-21820__fix_broken_method_chaining__2.3.3.patch: -------------------------------------------------------------------------------- 1 | diff -Naur a/vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php b/vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php 2 | --- a/vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php 3 | +++ b/vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php 4 | @@ -1584,6 +1584,8 @@ class Collection extends \Magento\Catalog\Model\ResourceModel\Collection\Abstrac 5 | } else { 6 | return parent::addAttributeToFilter($attribute, $condition, $joinType); 7 | } 8 | + 9 | + return $this; 10 | } 11 | 12 | /** 13 | -------------------------------------------------------------------------------- /patches/MC-42674__paypal_checkout__2.3.7-p1.patch: -------------------------------------------------------------------------------- 1 | diff --git a/vendor/magento/module-paypal/Controller/Express/AbstractExpress/PlaceOrder.php b/vendor/magento/module-paypal/Controller/Express/AbstractExpress/PlaceOrder.php 2 | index 055af4162d5f3..3f4fafc110ae2 100644 3 | --- a/vendor/magento/module-paypal/Controller/Express/AbstractExpress/PlaceOrder.php 4 | +++ b/vendor/magento/module-paypal/Controller/Express/AbstractExpress/PlaceOrder.php 5 | @@ -99,6 +99,7 @@ public function execute() 6 | 7 | // prepare session to success or cancellation page 8 | $this->_getCheckoutSession()->clearHelperData(); 9 | + $this->_getSession()->unsQuoteId(); 10 | 11 | // "last successful quote" 12 | $quoteId = $this->_getQuote()->getId(); 13 | -------------------------------------------------------------------------------- /patches/MC-43048__set_rate_limits__2.3.7-p1.patch: -------------------------------------------------------------------------------- 1 | diff --git a/app/etc/di.xml b/app/etc/di.xml 2 | index ace043beb62..7751604ea1d 100644 3 | --- a/app/etc/di.xml 4 | +++ b/app/etc/di.xml 5 | @@ -1896,12 +1896,12 @@ 6 | 7 | 8 | 9 | - 20 10 | + 999999 11 | 12 | 13 | 14 | 15 | - 300 16 | + 999999 17 | 18 | 19 | 20 | @@ -1914,7 +1914,7 @@ 21 | 22 | 23 | 24 | - 300 25 | + 999999 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /patches/MC-43048__set_rate_limits__2.4.3.patch: -------------------------------------------------------------------------------- 1 | diff --git a/app/etc/di.xml b/app/etc/di.xml 2 | index 078fe71913f..6ab3bdfd35c 100644 3 | --- a/app/etc/di.xml 4 | +++ b/app/etc/di.xml 5 | @@ -1946,12 +1946,12 @@ 6 | 7 | 8 | 9 | - 20 10 | + 999999 11 | 12 | 13 | 14 | 15 | - 300 16 | + 999999 17 | 18 | 19 | 20 | @@ -1964,7 +1964,7 @@ 21 | 22 | 23 | 24 | - 300 25 | + 999999 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /patches/MC-5964__preauth_sql__2.1.4.patch: -------------------------------------------------------------------------------- 1 | diff -Naur a/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php b/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php 2 | --- a/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php 3 | +++ b/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php 4 | @@ -2955,7 +2955,7 @@ class Mysql extends \Zend_Db_Adapter_Pdo_Mysql implements AdapterInterface 5 | if (isset($condition['to'])) { 6 | $query .= empty($query) ? '' : ' AND '; 7 | $to = $this->_prepareSqlDateCondition($condition, 'to'); 8 | - $query = $this->_prepareQuotedSqlCondition($query . $conditionKeyMap['to'], $to, $fieldName); 9 | + $query = $query . $this->_prepareQuotedSqlCondition($conditionKeyMap['to'], $to, $fieldName); 10 | } 11 | } elseif (array_key_exists($key, $conditionKeyMap)) { 12 | $value = $condition[$key]; 13 | -------------------------------------------------------------------------------- /patches/MCLOUD-10032__Increment_number_for_catalog_product_entity_tables__2.4.3-p1.patch: -------------------------------------------------------------------------------- 1 | diff -Nuar a/vendor/magento/module-catalog/Model/ResourceModel/AbstractResource.php b/vendor/magento/module-catalog/Model/ResourceModel/AbstractResource.php 2 | index c71225b4fc6..3f0ee96d70e 100644 3 | --- a/vendor/magento/module-catalog/Model/ResourceModel/AbstractResource.php 4 | +++ b/vendor/magento/module-catalog/Model/ResourceModel/AbstractResource.php 5 | @@ -24,14 +24,14 @@ use Magento\Eav\Model\Entity\Attribute\UniqueValidationInterface; 6 | abstract class AbstractResource extends \Magento\Eav\Model\Entity\AbstractEntity 7 | { 8 | /** 9 | - * Store manager 10 | + * Store manager to get the store information 11 | * 12 | * @var \Magento\Store\Model\StoreManagerInterface 13 | */ 14 | protected $_storeManager; 15 | 16 | /** 17 | - * Model factory 18 | + * Model factory to create a model object 19 | * 20 | * @var \Magento\Catalog\Model\Factory 21 | */ 22 | @@ -325,7 +325,25 @@ abstract class AbstractResource extends \Magento\Eav\Model\Entity\AbstractEntity 23 | */ 24 | protected function _updateAttribute($object, $attribute, $valueId, $value) 25 | { 26 | - return $this->_saveAttributeValue($object, $attribute, $value); 27 | + $entity = $attribute->getEntity(); 28 | + $row = $this->getAttributeRow($entity, $object, $attribute); 29 | + $hasSingleStore = $this->_storeManager->hasSingleStore(); 30 | + $storeId = $hasSingleStore 31 | + ? $this->getDefaultStoreId() 32 | + : (int) $this->_storeManager->getStore($object->getStoreId())->getId(); 33 | + if ($valueId > 0 && array_key_exists('store_id', $row) && $storeId === $row['store_id']) { 34 | + $table = $attribute->getBackend()->getTable(); 35 | + $connection = $this->getConnection(); 36 | + $connection->update( 37 | + $table, 38 | + ['value' => $this->_prepareValueForSave($value, $attribute)], 39 | + sprintf('%s=%d', $connection->quoteIdentifier('value_id'), $valueId) 40 | + ); 41 | + 42 | + return $this; 43 | + } else { 44 | + return $this->_saveAttributeValue($object, $attribute, $value); 45 | + } 46 | } 47 | 48 | /** 49 | -------------------------------------------------------------------------------- /patches/MCLOUD-10226__fix_regexp_cache_tag_validation__2.4.6.patch: -------------------------------------------------------------------------------- 1 | diff -Naur a/vendor/magento/framework/Cache/Core.php b/vendor/magento/framework/Cache/Core.php 2 | --- a/vendor/magento/framework/Cache/Core.php 2023-02-23 14:11:04 3 | +++ b/vendor/magento/framework/Cache/Core.php 2023-04-14 11:54:58 4 | @@ -5,6 +5,10 @@ namespace Magento\Framework\Cache; 5 | */ 6 | namespace Magento\Framework\Cache; 7 | 8 | +use Magento\Framework\Cache\Backend\Redis; 9 | +use Zend_Cache; 10 | +use Zend_Cache_Exception; 11 | + 12 | class Core extends \Zend_Cache_Core 13 | { 14 | /** 15 | @@ -124,6 +128,34 @@ class Core extends \Zend_Cache_Core 16 | { 17 | $tags = $this->_tags($tags); 18 | return parent::getIdsNotMatchingTags($tags); 19 | + } 20 | + 21 | + /** 22 | + * Validate a cache id or a tag (security, reliable filenames, reserved prefixes...) 23 | + * 24 | + * Throw an exception if a problem is found 25 | + * 26 | + * @param string $string Cache id or tag 27 | + * @throws Zend_Cache_Exception 28 | + * @return void 29 | + */ 30 | + protected function _validateIdOrTag($string) 31 | + { 32 | + if ($this->_backend instanceof Redis) { 33 | + if (!is_string($string)) { 34 | + Zend_Cache::throwException('Invalid id or tag : must be a string'); 35 | + } 36 | + if (substr($string, 0, 9) == 'internal-') { 37 | + Zend_Cache::throwException('"internal-*" ids or tags are reserved'); 38 | + } 39 | + if (!preg_match('~^[a-zA-Z0-9_{}]+$~D', $string)) { 40 | + Zend_Cache::throwException("Invalid id or tag '$string' : must use only [a-zA-Z0-9_{}]"); 41 | + } 42 | + 43 | + return; 44 | + } 45 | + 46 | + parent::_validateIdOrTag($string); 47 | } 48 | 49 | /** 50 | -------------------------------------------------------------------------------- /patches/MCLOUD-10279__errors_when_flushing_js_css_cache_from_admin__2.4.0.patch: -------------------------------------------------------------------------------- 1 | diff -Nuar a/vendor/magento/framework/Filesystem/Driver/File.php b/vendor/magento/framework/Filesystem/Driver/File.php 2 | index 1affad552137..4edb095f6c48 100644 3 | --- a/vendor/magento/framework/Filesystem/Driver/File.php 4 | +++ b/vendor/magento/framework/Filesystem/Driver/File.php 5 | @@ -391,8 +391,8 @@ public function symlink($source, $destination, DriverInterface $targetDriver = n 6 | */ 7 | public function deleteFile($path) 8 | { 9 | - $result = @unlink($this->getScheme() . $path); 10 | - if (!$result) { 11 | + @unlink($this->getScheme() . $path); 12 | + if ($this->isFile($path)) { 13 | throw new FileSystemException( 14 | new Phrase( 15 | 'The "%1" file can\'t be deleted. %2', 16 | @@ -400,7 +400,7 @@ public function deleteFile($path) 17 | ) 18 | ); 19 | } 20 | - return $result; 21 | + return true; 22 | } 23 | 24 | /** 25 | -------------------------------------------------------------------------------- /patches/MCLOUD-10279__errors_when_flushing_js_css_cache_from_admin__2.4.4.patch: -------------------------------------------------------------------------------- 1 | diff -Nuar a/vendor/magento/framework/Filesystem/Driver/File.php b/vendor/magento/framework/Filesystem/Driver/File.php 2 | index 5dcfeeef23ab..e26acb5a9369 100644 3 | --- a/vendor/magento/framework/Filesystem/Driver/File.php 4 | +++ b/vendor/magento/framework/Filesystem/Driver/File.php 5 | @@ -440,11 +440,12 @@ public function symlink($source, $destination, DriverInterface $targetDriver = n 6 | */ 7 | public function deleteFile($path) 8 | { 9 | - $result = @unlink($this->getScheme() . $path); 10 | + @unlink($this->getScheme() . $path); 11 | if ($this->stateful) { 12 | clearstatcache(true, $this->getScheme() . $path); 13 | } 14 | - if (!$result) { 15 | + 16 | + if ($this->isFile($path)) { 17 | throw new FileSystemException( 18 | new Phrase( 19 | 'The "%1" file can\'t be deleted. %2', 20 | @@ -452,7 +453,7 @@ public function deleteFile($path) 21 | ) 22 | ); 23 | } 24 | - return $result; 25 | + return true; 26 | } 27 | 28 | /** 29 | -------------------------------------------------------------------------------- /patches/MCLOUD-11623__requisition_list_exports_saved_to_var_directory__2.4.5-p1.patch: -------------------------------------------------------------------------------- 1 | diff --git a/vendor/magento/module-requisition-list/Controller/Requisition/Export.php b/vendor/magento/module-requisition-list/Controller/Requisition/Export.php 2 | index e8332a7f1091..7eee2f51b7f4 100644 3 | --- a/vendor/magento/module-requisition-list/Controller/Requisition/Export.php 4 | +++ b/vendor/magento/module-requisition-list/Controller/Requisition/Export.php 5 | @@ -101,9 +101,15 @@ public function execute() 6 | 7 | $fileName = "{$requisitionList->getName()}.{$writer->getFileExtension()}"; 8 | 9 | + $content = [ 10 | + 'type' => "string", 11 | + 'value' => $this->requisitionListExport->export(), 12 | + 'rm' => true, 13 | + ]; 14 | + 15 | return $this->fileFactory->create( 16 | $fileName, 17 | - $this->requisitionListExport->export(), 18 | + $content, 19 | DirectoryList::VAR_DIR, 20 | $writer->getContentType() 21 | ); 22 | 23 | -------------------------------------------------------------------------------- /patches/MCLOUD-13605__B2B_SQL_syntax_error_due_to_the_REGEXP_LIKE_function__1.5.2.patch: -------------------------------------------------------------------------------- 1 | diff --git a/vendor/magento/module-company/Setup/Patch/Data/SetCompanyForStructure.php b/vendor/magento/module-company/Setup/Patch/Data/SetCompanyForStructure.php 2 | index 4dcb3dbcb5b3..7ba339a8703e 100644 3 | --- a/vendor/magento/module-company/Setup/Patch/Data/SetCompanyForStructure.php 4 | +++ b/vendor/magento/module-company/Setup/Patch/Data/SetCompanyForStructure.php 5 | @@ -71,7 +71,7 @@ public function apply() 6 | $this->moduleDataSetup->getConnection()->update( 7 | $this->moduleDataSetup->getTable('company_structure'), 8 | ['company_id' => $company['entity_id']], 9 | - ['REGEXP_LIKE(path, ?)' => 10 | + ['path REGEXP ?' => 11 | '^' . $adminStructureIds[$company['super_user_id']]['structure_id'] . '(/.+)?$'] 12 | ); 13 | } 14 | 15 | -------------------------------------------------------------------------------- /patches/MCLOUD-13619__Improve_web_api_async_performance__2.4.x.patch: -------------------------------------------------------------------------------- 1 | diff --git a/vendor/magento/module-webapi-async/Controller/Rest/Asynchronous/InputParamsResolver.php b/vendor/magento/module-webapi-async/Controller/Rest/Asynchronous/InputParamsResolver.php 2 | index 93555559ac9a1..2f46685c6b117 100644 3 | --- a/vendor/magento/module-webapi-async/Controller/Rest/Asynchronous/InputParamsResolver.php 4 | +++ b/vendor/magento/module-webapi-async/Controller/Rest/Asynchronous/InputParamsResolver.php 5 | @@ -70,6 +70,11 @@ class InputParamsResolver 6 | */ 7 | private $methodsMap; 8 | 9 | + /** 10 | + * @var array 11 | + */ 12 | + private array $inputData = []; 13 | + 14 | /** 15 | * Initialize dependencies. 16 | * 17 | @@ -156,8 +161,14 @@ public function resolve() 18 | */ 19 | public function getInputData() 20 | { 21 | + if (!empty($this->inputData)) { 22 | + return $this->inputData; 23 | + } 24 | + 25 | if ($this->isBulk === false) { 26 | - return [$this->inputParamsResolver->getInputData()]; 27 | + $this->inputData = [$this->inputParamsResolver->getInputData()]; 28 | + 29 | + return $this->inputData; 30 | } 31 | $inputData = $this->request->getRequestData(); 32 | 33 | @@ -167,7 +178,7 @@ public function getInputData() 34 | $inputData = array_merge($requestBodyParams, $inputData); 35 | } 36 | 37 | - return array_map(function ($singleEntityParams) { 38 | + $this->inputData = array_map(function ($singleEntityParams) { 39 | if (is_array($singleEntityParams)) { 40 | $singleEntityParams = $this->filterInputData($singleEntityParams); 41 | $singleEntityParams = $this->paramsOverrider->override( 42 | @@ -178,6 +189,8 @@ public function getInputData() 43 | 44 | return $singleEntityParams; 45 | }, $inputData); 46 | + 47 | + return $this->inputData; 48 | } 49 | 50 | /** 51 | -------------------------------------------------------------------------------- /patches/MCLOUD-5684__pagination_not_working_product_list_limit_all__2.3.2.patch: -------------------------------------------------------------------------------- 1 | diff -Nuar a/vendor/magento/module-elasticsearch/Model/ResourceModel/Fulltext/Collection/SearchCriteriaResolver.php b/vendor/magento/module-elasticsearch/Model/ResourceModel/Fulltext/Collection/SearchCriteriaResolver.php 2 | --- a/vendor/magento/module-elasticsearch/Model/ResourceModel/Fulltext/Collection/SearchCriteriaResolver.php 3 | +++ b/vendor/magento/module-elasticsearch/Model/ResourceModel/Fulltext/Collection/SearchCriteriaResolver.php 4 | @@ -76,11 +76,13 @@ 5 | */ 6 | public function resolve(): SearchCriteria 7 | { 8 | - $this->builder->setPageSize($this->size); 9 | $searchCriteria = $this->builder->create(); 10 | $searchCriteria->setRequestName($this->searchRequestName); 11 | $searchCriteria->setSortOrders($this->orders); 12 | $searchCriteria->setCurrentPage($this->currentPage - 1); 13 | + if ($this->size) { 14 | + $searchCriteria->setPageSize($this->size); 15 | + } 16 | 17 | return $searchCriteria; 18 | } 19 | -------------------------------------------------------------------------------- /patches/MCLOUD-5684__pagination_not_working_product_list_limit_all__2.3.4.patch: -------------------------------------------------------------------------------- 1 | diff -Nuar a/vendor/magento/module-elasticsearch/Model/ResourceModel/Fulltext/Collection/SearchCriteriaResolver.php b/vendor/magento/module-elasticsearch/Model/ResourceModel/Fulltext/Collection/SearchCriteriaResolver.php 2 | --- a/vendor/magento/module-elasticsearch/Model/ResourceModel/Fulltext/Collection/SearchCriteriaResolver.php 3 | +++ b/vendor/magento/module-elasticsearch/Model/ResourceModel/Fulltext/Collection/SearchCriteriaResolver.php 4 | @@ -80,6 +80,9 @@ 5 | $searchCriteria->setRequestName($this->searchRequestName); 6 | $searchCriteria->setSortOrders($this->orders); 7 | $searchCriteria->setCurrentPage($this->currentPage - 1); 8 | + if ($this->size) { 9 | + $searchCriteria->setPageSize($this->size); 10 | + } 11 | 12 | return $searchCriteria; 13 | } 14 | -------------------------------------------------------------------------------- /patches/MCLOUD-6659__fix_L2_redis_cache__2.4.0.patch: -------------------------------------------------------------------------------- 1 | diff -Nuar a/vendor/magento/framework/Cache/Backend/RemoteSynchronizedCache.php b/vendor/magento/framework/Cache/Backend/RemoteSynchronizedCache.php 2 | --- a/vendor/magento/framework/Cache/Backend/RemoteSynchronizedCache.php 3 | +++ b/vendor/magento/framework/Cache/Backend/RemoteSynchronizedCache.php 4 | @@ -237,7 +237,7 @@ class RemoteSynchronizedCache extends \Zend_Cache_Backend implements \Zend_Cache 5 | $dataToSave = $data; 6 | $remHash = $this->loadRemoteDataVersion($id); 7 | 8 | - if ($remHash !== false) { 9 | + if ($remHash !== false && $this->getDataVersion($data) === $remHash) { 10 | $dataToSave = $this->remote->load($id); 11 | } else { 12 | $this->remote->save($data, $id, $tags, $specificLifetime); 13 | @@ -248,9 +248,23 @@ class RemoteSynchronizedCache extends \Zend_Cache_Backend implements \Zend_Cache 14 | $this->unlock($id); 15 | } 16 | 17 | + if (!mt_rand(0, 100) && $this->checkIfLocalCacheSpaceExceeded()) { 18 | + $this->local->clean(); 19 | + } 20 | + 21 | return $this->local->save($dataToSave, $id, [], $specificLifetime); 22 | } 23 | 24 | + /** 25 | + * Check if local cache space bigger that configure amount 26 | + * 27 | + * @return bool 28 | + */ 29 | + private function checkIfLocalCacheSpaceExceeded() 30 | + { 31 | + return $this->getFillingPercentage() >= 95; 32 | + } 33 | + 34 | /** 35 | * @inheritdoc 36 | */ 37 | @@ -266,7 +280,8 @@ class RemoteSynchronizedCache extends \Zend_Cache_Backend implements \Zend_Cache 38 | */ 39 | public function clean($mode = \Zend_Cache::CLEANING_MODE_ALL, $tags = []) 40 | { 41 | - return $this->remote->clean($mode, $tags); 42 | + return $this->remote->clean($mode, $tags) && 43 | + $this->local->clean($mode, $tags); 44 | } 45 | 46 | /** 47 | -------------------------------------------------------------------------------- /patches/MCLOUD-7845__fix_local_flushing_L2_cache__2.4.0.patch: -------------------------------------------------------------------------------- 1 | diff -Nuar a/vendor/magento/framework/Cache/Backend/RemoteSynchronizedCache.php b/vendor/magento/framework/Cache/Backend/RemoteSynchronizedCache.php 2 | index d0c05613..96f7ad84 100644 3 | --- a/vendor/magento/framework/Cache/Backend/RemoteSynchronizedCache.php 4 | +++ b/vendor/magento/framework/Cache/Backend/RemoteSynchronizedCache.php 5 | @@ -248,9 +248,23 @@ class RemoteSynchronizedCache extends \Zend_Cache_Backend implements \Zend_Cache 6 | $this->unlock($id); 7 | } 8 | 9 | + if (!mt_rand(0, 100) && $this->checkIfLocalCacheSpaceExceeded()) { 10 | + $this->local->clean(); 11 | + } 12 | + 13 | return $this->local->save($dataToSave, $id, [], $specificLifetime); 14 | } 15 | 16 | + /** 17 | + * Check if local cache space bigger that configure amount 18 | + * 19 | + * @return bool 20 | + */ 21 | + private function checkIfLocalCacheSpaceExceeded() 22 | + { 23 | + return $this->getFillingPercentage() >= 95; 24 | + } 25 | + 26 | /** 27 | * @inheritdoc 28 | */ 29 | @@ -266,7 +280,8 @@ class RemoteSynchronizedCache extends \Zend_Cache_Backend implements \Zend_Cache 30 | */ 31 | public function clean($mode = \Zend_Cache::CLEANING_MODE_ALL, $tags = []) 32 | { 33 | - return $this->remote->clean($mode, $tags); 34 | + return $this->remote->clean($mode, $tags) && 35 | + $this->local->clean($mode, $tags); 36 | } 37 | 38 | /** 39 | -------------------------------------------------------------------------------- /patches/MCLOUD_6139__improvement_flock_locks__2.3.2.patch: -------------------------------------------------------------------------------- 1 | diff -Nuar a/vendor/magento/framework/Lock/Backend/FileLock.php b/vendor/magento/framework/Lock/Backend/FileLock.php 2 | --- a/vendor/magento/framework/Lock/Backend/FileLock.php 3 | +++ b/vendor/magento/framework/Lock/Backend/FileLock.php 4 | @@ -91,6 +91,7 @@ class FileLock implements LockManagerInterface 5 | 6 | while (!$this->tryToLock($fileResource)) { 7 | if (!$skipDeadline && $deadline <= microtime(true)) { 8 | + $this->tryToUnlock($fileResource); 9 | $this->fileDriver->fileClose($fileResource); 10 | return false; 11 | } 12 | @@ -124,6 +125,7 @@ class FileLock implements LockManagerInterface 13 | } else { 14 | $result = true; 15 | } 16 | + $this->tryToUnlock($fileResource); 17 | $this->fileDriver->fileClose($fileResource); 18 | } 19 | } catch (FileSystemException $exception) { 20 | -------------------------------------------------------------------------------- /patches/MDVA-22950__large_amount_of_keys_block_cache__2.3.1.patch: -------------------------------------------------------------------------------- 1 | diff -Nuar a/vendor/magento/module-swatches/Block/Product/Renderer/Listing/Configurable.php b/vendor/magento/module-swatches/Block/Product/Renderer/Listing/Configurable.php 2 | --- a/vendor/magento/module-swatches/Block/Product/Renderer/Listing/Configurable.php 3 | +++ b/vendor/magento/module-swatches/Block/Product/Renderer/Listing/Configurable.php 4 | @@ -9,7 +9,6 @@ use Magento\Catalog\Block\Product\Context; 5 | use Magento\Catalog\Helper\Product as CatalogProduct; 6 | use Magento\Catalog\Model\Product; 7 | use Magento\Catalog\Model\Layer\Resolver; 8 | -use Magento\Catalog\Model\Layer\Category as CategoryLayer; 9 | use Magento\ConfigurableProduct\Helper\Data; 10 | use Magento\ConfigurableProduct\Model\ConfigurableAttributeData; 11 | use Magento\Customer\Helper\Session\CurrentCustomer; 12 | @@ -244,9 +243,12 @@ class Configurable extends \Magento\Swatches\Block\Product\Renderer\Configurable 13 | 14 | $layeredAttributes = []; 15 | 16 | - $configurableAttributes = array_map(function ($attribute) { 17 | - return $attribute->getAttributeCode(); 18 | - }, $configurableAttributes); 19 | + $configurableAttributes = array_map( 20 | + function ($attribute) { 21 | + return $attribute->getAttributeCode(); 22 | + }, 23 | + $configurableAttributes 24 | + ); 25 | 26 | $commonAttributeCodes = array_intersect( 27 | $configurableAttributes, 28 | @@ -259,17 +261,4 @@ class Configurable extends \Magento\Swatches\Block\Product\Renderer\Configurable 29 | 30 | return $layeredAttributes; 31 | } 32 | - 33 | - /** 34 | - * @inheritdoc 35 | - * @since 100.3.1 36 | - */ 37 | - public function getCacheKeyInfo() 38 | - { 39 | - $cacheKeyInfo = parent::getCacheKeyInfo(); 40 | - /** @var CategoryLayer $catalogLayer */ 41 | - $catalogLayer = $this->layerResolver->get(); 42 | - $cacheKeyInfo[] = $catalogLayer->getStateKey(); 43 | - return $cacheKeyInfo; 44 | - } 45 | } 46 | -------------------------------------------------------------------------------- /patches/MDVA-8695__properly_encode_characters_in_emails__2.1.4.patch: -------------------------------------------------------------------------------- 1 | diff -Nuar a/vendor/magento/framework/Mail/Message.php b/vendor/magento/framework/Mail/Message.php 2 | --- a/vendor/magento/framework/Mail/Message.php 3 | +++ b/vendor/magento/framework/Mail/Message.php 4 | @@ -15,6 +15,7 @@ class Message extends \Zend_Mail implements MessageInterface 5 | public function __construct($charset = 'utf-8') 6 | { 7 | parent::__construct($charset); 8 | + $this->setHeaderEncoding(\Zend_Mime::ENCODING_BASE64); 9 | } 10 | 11 | /** 12 | -------------------------------------------------------------------------------- /patches/MSI-GH-2515__eliminate_group_concat_from_source_item_indexer__reservations__1.0.3.patch: -------------------------------------------------------------------------------- 1 | diff -Nuar a/vendor/magento/module-inventory-reservations/etc/di.xml b/vendor/magento/module-inventory-reservations/etc/di.xml 2 | --- a/vendor/magento/module-inventory-reservations/etc/di.xml 3 | +++ b/vendor/magento/module-inventory-reservations/etc/di.xml 4 | @@ -13,7 +13,7 @@ 5 | 6 | 7 | 8 | - 2000 9 | + 32768 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /patches/PRODSECBUG-2432__admin_path_disclosure_bug__2.1.4.patch: -------------------------------------------------------------------------------- 1 | diff -Nuar a/vendor/magento/framework/App/Router/ActionList.php b/vendor/magento/framework/App/Router/ActionList.php 2 | --- a/vendor/magento/framework/App/Router/ActionList.php 3 | +++ b/vendor/magento/framework/App/Router/ActionList.php 4 | @@ -8,6 +7,9 @@ namespace Magento\Framework\App\Router; 5 | 6 | use Magento\Framework\Module\Dir\Reader as ModuleReader; 7 | 8 | +/** 9 | + * Class to retrieve action class. 10 | + */ 11 | class ActionList 12 | { 13 | /** 14 | @@ -74,6 +76,7 @@ class ActionList 15 | if ($area) { 16 | $area = '\\' . $area; 17 | } 18 | + $namespace = strtolower($namespace); 19 | if (strpos($namespace, self::NOT_ALLOWED_IN_NAMESPACE_PATH) !== false) { 20 | return null; 21 | } 22 | -------------------------------------------------------------------------------- /patches/PRODSECBUG-2432__admin_path_disclosure_bug__2.2.0.patch: -------------------------------------------------------------------------------- 1 | diff -Nuar a/vendor/magento/framework/App/Router/ActionList.php b/vendor/magento/framework/App/Router/ActionList.php 2 | --- a/vendor/magento/framework/App/Router/ActionList.php 3 | +++ b/vendor/magento/framework/App/Router/ActionList.php 4 | @@ -10,6 +9,9 @@ use Magento\Framework\Serialize\SerializerInterface; 5 | use Magento\Framework\Serialize\Serializer\Serialize; 6 | use Magento\Framework\Module\Dir\Reader as ModuleReader; 7 | 8 | +/** 9 | + * Class to retrieve action class. 10 | + */ 11 | class ActionList 12 | { 13 | /** 14 | @@ -91,6 +93,7 @@ class ActionList 15 | if ($area) { 16 | $area = '\\' . $area; 17 | } 18 | + $namespace = strtolower($namespace); 19 | if (strpos($namespace, self::NOT_ALLOWED_IN_NAMESPACE_PATH) !== false) { 20 | return null; 21 | } 22 | 23 | -------------------------------------------------------------------------------- /patches/PRODSECBUG-2432__admin_path_disclosure_bug__2.3.0.patch: -------------------------------------------------------------------------------- 1 | diff -Nuar a/vendor/magento/framework/App/Router/ActionList.php b/vendor/magento/framework/App/Router/ActionList.php 2 | --- a/vendor/magento/framework/App/Router/ActionList.php 3 | +++ b/vendor/magento/framework/App/Router/ActionList.php 4 | @@ -10,6 +9,9 @@ use Magento\Framework\Serialize\SerializerInterface; 5 | use Magento\Framework\Serialize\Serializer\Serialize; 6 | use Magento\Framework\Module\Dir\Reader as ModuleReader; 7 | 8 | +/** 9 | + * Class to retrieve action class. 10 | + */ 11 | class ActionList 12 | { 13 | /** 14 | @@ -91,6 +93,7 @@ class ActionList 15 | if ($area) { 16 | $area = '\\' . $area; 17 | } 18 | + $namespace = strtolower($namespace); 19 | if (strpos($namespace, self::NOT_ALLOWED_IN_NAMESPACE_PATH) !== false) { 20 | return null; 21 | } 22 | 23 | -------------------------------------------------------------------------------- /src/App/GenericException.php: -------------------------------------------------------------------------------- 1 | getPatchLog(); 33 | $logDir = $filesystem->getDirectory($logPath); 34 | $filesystem->createDirectory($logDir); 35 | 36 | if ($filesystem->isWritable($logDir)) { 37 | try { 38 | $handlerInstance = new StreamHandler($logPath, Logger::DEBUG); 39 | $formatter = $lineFormatterFactory->create(); 40 | $handlerInstance->setFormatter($formatter); 41 | $handlers[] = $handlerInstance; 42 | } catch (\Exception $e) { 43 | $handlers[] = new NullHandler(); 44 | } 45 | } else { 46 | $handlers[] = new NullHandler(); 47 | } 48 | 49 | parent::__construct('default', $handlers); 50 | } 51 | 52 | /** 53 | * @inheritDoc 54 | */ 55 | public function info($message, array $context = []): void 56 | { 57 | $message = strip_tags($message); 58 | 59 | parent::info($message, $context); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/App/Logger/LineFormatterFactory.php: -------------------------------------------------------------------------------- 1 | container = $container; 30 | 31 | parent::__construct( 32 | $container->get(Composer::class)->getPackage()->getPrettyName(), 33 | $container->get(Composer::class)->getPackage()->getPrettyVersion() 34 | ); 35 | } 36 | 37 | /** 38 | * @inheritdoc 39 | */ 40 | protected function getDefaultCommands(): array 41 | { 42 | return array_merge(parent::getDefaultCommands(), [ 43 | $this->container->get(Command\Apply::class), 44 | $this->container->get(Command\Revert::class), 45 | $this->container->get(Command\Status::class) 46 | ]); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/ApplicationEce.php: -------------------------------------------------------------------------------- 1 | container = $container; 30 | 31 | parent::__construct( 32 | $container->get(Composer::class)->getPackage()->getPrettyName(), 33 | $container->get(Composer::class)->getPackage()->getPrettyVersion() 34 | ); 35 | } 36 | 37 | /** 38 | * @inheritdoc 39 | */ 40 | protected function getDefaultCommands(): array 41 | { 42 | return array_merge(parent::getDefaultCommands(), [ 43 | $this->container->get(Command\Ece\Apply::class), 44 | $this->container->get(Command\Ece\Revert::class), 45 | $this->container->get(Command\Status::class) 46 | ]); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/Command/AbstractCommand.php: -------------------------------------------------------------------------------- 1 | actions = $actions; 41 | } 42 | 43 | /** 44 | * @inheritDoc 45 | */ 46 | public function execute(InputInterface $input, OutputInterface $output, array $patchFilter) 47 | { 48 | foreach ($this->actions as $action) { 49 | $action->execute($input, $output, $patchFilter); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/Command/Process/ApplyOptional.php: -------------------------------------------------------------------------------- 1 | filterFactory = $filterFactory; 48 | $this->actionPool = $actionPool; 49 | $this->logger = $logger; 50 | } 51 | 52 | /** 53 | * @inheritDoc 54 | */ 55 | public function run(InputInterface $input, OutputInterface $output) 56 | { 57 | $argPatches = $input->getArgument(Apply::ARG_LIST_OF_PATCHES); 58 | $patchFilter = $this->filterFactory->createApplyFilter($argPatches); 59 | if ($patchFilter === null) { 60 | return; 61 | } 62 | 63 | $this->logger->notice('Start of applying optional patches'); 64 | $this->logger->info('Command argument: ' . implode(' ', $argPatches)); 65 | $this->actionPool->execute($input, $output, $patchFilter); 66 | $this->logger->notice('End of applying optional patches'); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/Command/Process/Ece/ApplyOptional.php: -------------------------------------------------------------------------------- 1 | filterFactory = $filterFactory; 56 | $this->actionPool = $actionPool; 57 | $this->logger = $logger; 58 | $this->config = $config; 59 | } 60 | 61 | /** 62 | * @inheritDoc 63 | */ 64 | public function run(InputInterface $input, OutputInterface $output) 65 | { 66 | $envQualityPatches = $this->config->getQualityPatches(); 67 | $patchFilter = $this->filterFactory->createApplyFilter($envQualityPatches); 68 | if ($patchFilter === null) { 69 | return; 70 | } 71 | 72 | $this->logger->notice('Start of applying optional patches'); 73 | $this->logger->info('QUALITY_PATCHES env variable: ' . implode(' ', $envQualityPatches)); 74 | $this->actionPool->execute($input, $output, $patchFilter); 75 | $this->logger->notice('End of applying optional patches'); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /src/Command/Process/ProcessInterface.php: -------------------------------------------------------------------------------- 1 | filterFactory = $filterFactory; 50 | $this->revertAction = $revertAction; 51 | $this->logger = $logger; 52 | } 53 | 54 | /** 55 | * @inheritDoc 56 | */ 57 | public function run(InputInterface $input, OutputInterface $output) 58 | { 59 | $argPatches = $input->getArgument(RevertCommand::ARG_LIST_OF_PATCHES); 60 | $optAll = $input->getOption(RevertCommand::OPT_ALL); 61 | $patchFilter = $this->filterFactory->createRevertFilter($optAll, $argPatches); 62 | 63 | if ($patchFilter === null) { 64 | return; 65 | } 66 | $this->logger->notice('Start of reverting optional patches'); 67 | 68 | $this->logger->info('Command argument: ' . implode(' ', $argPatches)); 69 | $this->logger->info('Command option: ' . $optAll ? '--all' : ''); 70 | $this->revertAction->execute($input, $output, $patchFilter); 71 | 72 | $this->logger->notice('End of reverting optional patches'); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /src/Command/Status.php: -------------------------------------------------------------------------------- 1 | showStatus = $showStatus; 44 | $this->logger = $logger; 45 | 46 | parent::__construct(self::NAME); 47 | } 48 | 49 | /** 50 | * @inheritDoc 51 | */ 52 | protected function configure() 53 | { 54 | $this->setName(self::NAME) 55 | ->setDescription('Shows the list of available patches and their statuses') 56 | ->addOption('format', 'f', InputOption::VALUE_OPTIONAL, 'Output format', 'table'); 57 | 58 | parent::configure(); 59 | } 60 | 61 | /** 62 | * {@inheritDoc} 63 | */ 64 | public function execute(InputInterface $input, OutputInterface $output): int 65 | { 66 | try { 67 | $this->showStatus->run($input, $output); 68 | } catch (RuntimeException $e) { 69 | $output->writeln('' . $e->getMessage() . ''); 70 | $this->logger->error($e->getMessage()); 71 | 72 | return self::RETURN_FAILURE; 73 | } catch (\Exception $e) { 74 | $this->logger->critical($e); 75 | 76 | throw $e; 77 | } 78 | 79 | return self::RETURN_SUCCESS; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /src/Composer/Package.php: -------------------------------------------------------------------------------- 1 | repository = $composer->getRepositoryManager()->getLocalRepository(); 38 | $this->magentoVersion = $magentoVersion; 39 | } 40 | 41 | /** 42 | * Checks whether package with specific constraint exists in the system. 43 | * 44 | * @param string $packageName 45 | * @param string $packageConstraint 46 | * @return bool True if patch with provided constraint exists, false otherwise. 47 | */ 48 | public function matchConstraint(string $packageName, string $packageConstraint): bool 49 | { 50 | return $this->magentoVersion->matchPackageGit($packageName, $packageConstraint) || 51 | $this->repository->findPackage($packageName, $packageConstraint) instanceof PackageInterface; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/Composer/QualityPackage.php: -------------------------------------------------------------------------------- 1 | patchesDirectory = $info->getPatchesDirectory(); 43 | $this->supportPatchesConfig = $info->getSupportPatchesConfig(); 44 | $this->communityPatchesConfig = $info->getCommunityPatchesConfig(); 45 | $this->categoriesConfig = $info->getCategoriesConfig(); 46 | } 47 | } 48 | 49 | /** 50 | * Returns path to patches directory. 51 | * 52 | * @return string|null 53 | */ 54 | public function getPatchesDirectoryPath() 55 | { 56 | return $this->patchesDirectory; 57 | } 58 | 59 | /** 60 | * Returns path to support patches configuration file. 61 | * 62 | * @return string|null 63 | */ 64 | public function getSupportPatchesConfigPath() 65 | { 66 | return $this->supportPatchesConfig; 67 | } 68 | 69 | /** 70 | * Returns path to community patches configuration file. 71 | * 72 | * @return string|null 73 | */ 74 | public function getCommunityPatchesConfigPath() 75 | { 76 | return $this->communityPatchesConfig; 77 | } 78 | 79 | /** 80 | * Returns path to the categories configuration file. 81 | * 82 | * @return string|null 83 | */ 84 | public function getCategoriesConfigPath() 85 | { 86 | return $this->categoriesConfig; 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /src/Console/ConfirmationQuestionFactory.php: -------------------------------------------------------------------------------- 1 | configReader = $configReader; 43 | } 44 | /** 45 | * Checks if it's Cloud environment. 46 | * 47 | * @return bool 48 | */ 49 | public function isCloud(): bool 50 | { 51 | return (bool)$this->getEnv(self::ENV_VAR_CLOUD) || defined(self::CONST_IS_CLOUD); 52 | } 53 | 54 | /** 55 | * Returns quality patches env variable. 56 | * 57 | * @return array 58 | * @throws FileSystemException 59 | */ 60 | public function getQualityPatches(): array 61 | { 62 | $result = $this->getEnv(self::ENV_VAR_QUALITY_PATCHES); 63 | if ($result === false) { 64 | $result = $this->configReader->read()['stage']['build'][self::ENV_VAR_QUALITY_PATCHES] ?? []; 65 | } 66 | 67 | return $result ?: []; 68 | } 69 | 70 | /** 71 | * 'getEnv' method is an abstraction for _ENV and getenv. 72 | * If _ENV is enabled in php.ini, use that. If not, fall back to use getenv. 73 | * returns false if not found 74 | * 75 | * @param string $key 76 | * @return array|string|int|null|bool 77 | */ 78 | private function getEnv(string $key) 79 | { 80 | return $_ENV[$key] ?? getenv($key); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /src/Environment/ConfigReader.php: -------------------------------------------------------------------------------- 1 | fileList = $fileList; 45 | $this->filesystem = $filesystem; 46 | } 47 | 48 | /** 49 | * Returns config. 50 | * 51 | * @return array 52 | * @throws ParseException 53 | * @throws FileSystemException 54 | */ 55 | public function read(): array 56 | { 57 | if ($this->config === null) { 58 | $path = $this->fileList->getEnvConfig(); 59 | 60 | if (!$this->filesystem->exists($path)) { 61 | $this->config = []; 62 | } else { 63 | $parseFlag = defined(Yaml::class . '::PARSE_CONSTANT') ? Yaml::PARSE_CONSTANT : 0; 64 | $this->config = (array)Yaml::parse($this->filesystem->get($path), $parseFlag); 65 | } 66 | } 67 | 68 | return $this->config; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/Filesystem/DirectoryList.php: -------------------------------------------------------------------------------- 1 | root = realpath($root); 32 | $this->magentoRoot = realpath($magentoRoot); 33 | } 34 | 35 | /** 36 | * @return string 37 | */ 38 | public function getRoot(): string 39 | { 40 | return $this->root; 41 | } 42 | 43 | /** 44 | * @return string 45 | */ 46 | public function getMagentoRoot(): string 47 | { 48 | return $this->magentoRoot; 49 | } 50 | 51 | /** 52 | * @return string 53 | */ 54 | public function getPatches(): string 55 | { 56 | return $this->getRoot() . '/patches'; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/Filesystem/FileList.php: -------------------------------------------------------------------------------- 1 | directoryList = $directoryList; 26 | } 27 | 28 | /** 29 | * @return string 30 | */ 31 | public function getPatches(): string 32 | { 33 | return $this->directoryList->getRoot() . '/patches.json'; 34 | } 35 | 36 | /** 37 | * @return string 38 | */ 39 | public function getCategoriesConfig(): string 40 | { 41 | return $this->directoryList->getRoot() . '/config/patch-categories.json'; 42 | } 43 | 44 | /** 45 | * @return string 46 | */ 47 | public function getPatchLog(): string 48 | { 49 | return $this->directoryList->getMagentoRoot() . '/var/log/patch.log'; 50 | } 51 | 52 | /** 53 | * @return string 54 | */ 55 | public function getEnvConfig(): string 56 | { 57 | return $this->directoryList->getMagentoRoot() . '/.magento.env.yaml'; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/Filesystem/FileSystemException.php: -------------------------------------------------------------------------------- 1 | filesystem = $filesystem; 28 | } 29 | 30 | /** 31 | * @param string $configPath 32 | * @return array 33 | * @throws SourceProviderException 34 | */ 35 | public function read(string $configPath): array 36 | { 37 | try { 38 | $content = $this->filesystem->get($configPath); 39 | } catch (FileSystemException $e) { 40 | throw new SourceProviderException($e->getMessage(), $e->getCode(), $e); 41 | } 42 | $result = json_decode($content, true); 43 | if (json_last_error() !== JSON_ERROR_NONE) { 44 | throw new SourceProviderException( 45 | "Unable to unserialize configuration '{$configPath}'. Error: " . json_last_error_msg() 46 | ); 47 | } 48 | return $result; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/Patch/Aggregator.php: -------------------------------------------------------------------------------- 1 | aggregatedPatchFactory = $aggregatedPatchFactory; 29 | } 30 | 31 | /** 32 | * Returns collection of aggregated patches. 33 | * 34 | * @param PatchInterface[] $patches 35 | * @return AggregatedPatchInterface[] 36 | */ 37 | public function aggregate(array $patches): array 38 | { 39 | $patchGroups = []; 40 | foreach ($patches as $patch) { 41 | $patchGroups[$patch->getId()][] = $patch; 42 | } 43 | 44 | $result = []; 45 | foreach ($patchGroups as $patchGroup) { 46 | $result[] = $this->aggregatedPatchFactory->create($patchGroup); 47 | } 48 | 49 | return $result; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/Patch/ApplierException.php: -------------------------------------------------------------------------------- 1 | fileList = $fileList; 36 | $this->jsonConfigReader = $jsonConfigReader; 37 | } 38 | 39 | /** 40 | * @inheritDoc 41 | */ 42 | public function execute(): array 43 | { 44 | return $this->jsonConfigReader->read($this->fileList->getCategoriesConfig()); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/Patch/CategoriesList/GetSupportPatchCategories.php: -------------------------------------------------------------------------------- 1 | qualityPackage = $qualityPackage; 37 | $this->jsonConfigReader = $jsonConfigReader; 38 | } 39 | 40 | /** 41 | * @inheritDoc 42 | */ 43 | public function execute(): array 44 | { 45 | return $this->qualityPackage->getCategoriesConfigPath() 46 | ? $this->jsonConfigReader->read($this->qualityPackage->getCategoriesConfigPath()) 47 | : []; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/Patch/Collector/CollectorException.php: -------------------------------------------------------------------------------- 1 | sourceProvider = $sourceProvider; 40 | $this->validatePatchesConfig = $validatePatchesConfig; 41 | } 42 | 43 | /** 44 | * @return array 45 | * @throws CollectorException 46 | */ 47 | public function execute(): array 48 | { 49 | if (empty($this->config)) { 50 | try { 51 | $this->config = $this->sourceProvider->getCommunityPatches(); 52 | } catch (SourceProviderException $e) { 53 | throw new CollectorException($e->getMessage(), $e->getCode(), $e); 54 | } 55 | $this->validatePatchesConfig->execute($this->config); 56 | } 57 | 58 | return $this->config; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/Patch/Collector/GetPatchesConfigInterface.php: -------------------------------------------------------------------------------- 1 | sourceProvider = $sourceProvider; 40 | $this->validatePatchesConfig = $validatePatchesConfig; 41 | } 42 | 43 | /** 44 | * @return array 45 | * @throws CollectorException 46 | */ 47 | public function execute(): array 48 | { 49 | if (empty($this->config)) { 50 | try { 51 | $this->config = $this->sourceProvider->getSupportPatches(); 52 | } catch (SourceProviderException $e) { 53 | throw new CollectorException($e->getMessage(), $e->getCode(), $e); 54 | } 55 | $this->validatePatchesConfig->execute($this->config); 56 | } 57 | 58 | return $this->config; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/Patch/Collector/LocalCollector.php: -------------------------------------------------------------------------------- 1 | sourceProvider = $sourceProvider; 40 | $this->patchBuilder = $patchBuilder; 41 | } 42 | 43 | /** 44 | * Collects local patches. 45 | * 46 | * @return PatchInterface[] 47 | */ 48 | public function collect(): array 49 | { 50 | $files = $this->sourceProvider->getLocalPatches(); 51 | $result = []; 52 | foreach ($files as $file) { 53 | $shortPath = '../' . SourceProvider::HOT_FIXES_DIR . '/' . basename($file); 54 | $this->patchBuilder->setId($shortPath); 55 | $this->patchBuilder->setTitle($shortPath); 56 | $this->patchBuilder->setFilename(basename($file)); 57 | $this->patchBuilder->setPath($file); 58 | $this->patchBuilder->setType(PatchInterface::TYPE_CUSTOM); 59 | $this->patchBuilder->setOrigin(self::ORIGIN); 60 | $this->patchBuilder->setCategories(['Other']); 61 | $result[] = $this->patchBuilder->build(); 62 | } 63 | 64 | return $result; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/Patch/CollectorInterface.php: -------------------------------------------------------------------------------- 1 | applier = $applier; 46 | $this->optionalPool = $optionalPool; 47 | $this->filesystem = $filesystem; 48 | } 49 | 50 | /** 51 | * Returns true if listed patches with all dependencies can be applied to clean Magento instance. 52 | * 53 | * @param string[] $patchIds 54 | * @return boolean 55 | */ 56 | public function check(array $patchIds): bool 57 | { 58 | $patchItems = $this->optionalPool->getList($patchIds); 59 | $content = $this->getContent($patchItems); 60 | 61 | return $this->applier->checkApply($content); 62 | } 63 | 64 | /** 65 | * Returns aggregated patch content. 66 | * 67 | * @param PatchInterface[] $patches 68 | * @return string 69 | */ 70 | private function getContent(array $patches): string 71 | { 72 | $result = ''; 73 | foreach ($patches as $patch) { 74 | $result .= $this->filesystem->get($patch->getPath()); 75 | } 76 | 77 | return $result; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /src/Patch/Data/AggregatedPatchInterface.php: -------------------------------------------------------------------------------- 1 | providers = $providers; 26 | } 27 | 28 | /** 29 | * @inheritDoc 30 | */ 31 | public function execute(): array 32 | { 33 | $categories = []; 34 | foreach ($this->providers as $provider) { 35 | $categories = array_merge($categories, $provider->execute()); 36 | } 37 | 38 | return array_unique($categories, SORT_REGULAR); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/Patch/GetCategoriesListInterface.php: -------------------------------------------------------------------------------- 1 | drivers = $drivers; 34 | } 35 | 36 | /** 37 | * @inheritDoc 38 | */ 39 | public function apply(string $patch) 40 | { 41 | $this->getDriver()->apply($patch); 42 | } 43 | 44 | /** 45 | * @inheritDoc 46 | */ 47 | public function revert(string $patch) 48 | { 49 | $this->getDriver()->revert($patch); 50 | } 51 | 52 | /** 53 | * @inheritDoc 54 | */ 55 | public function applyCheck(string $patch) 56 | { 57 | $this->getDriver()->applyCheck($patch); 58 | } 59 | 60 | /** 61 | * @inheritDoc 62 | */ 63 | public function revertCheck(string $patch) 64 | { 65 | $this->getDriver()->revertCheck($patch); 66 | } 67 | 68 | /** 69 | * Returns first available driver 70 | * 71 | * @return DriverInterface 72 | * @throws PatchCommandNotFound 73 | */ 74 | private function getDriver(): DriverInterface 75 | { 76 | if ($this->driver === null) { 77 | foreach ($this->drivers as $driver) { 78 | if ($driver->isInstalled()) { 79 | $this->driver = $driver; 80 | break; 81 | } 82 | } 83 | if ($this->driver === null) { 84 | throw new PatchCommandNotFound(); 85 | } 86 | } 87 | return $this->driver; 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /src/Patch/PatchCommandException.php: -------------------------------------------------------------------------------- 1 | items = $localCollector->collect(); 30 | } 31 | 32 | /** 33 | * Returns list of patches. 34 | * 35 | * @return PatchInterface[] 36 | */ 37 | public function getList() 38 | { 39 | return $this->items; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/Patch/Pool/PatchNotFoundException.php: -------------------------------------------------------------------------------- 1 | items = array_merge($this->items, $collector->collect()); 33 | } 34 | } 35 | 36 | /** 37 | * Returns list of patches. 38 | * 39 | * @return PatchInterface[] 40 | */ 41 | public function getList() 42 | { 43 | return $this->items; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/Patch/RevertValidator.php: -------------------------------------------------------------------------------- 1 | optionalPool = $optionalPool; 38 | $this->statusPool = $statusPool; 39 | } 40 | 41 | /** 42 | * Verifies that there are no applied dependent patches. 43 | * 44 | * @param string[] $patchFilter 45 | * @return void 46 | * @throws RuntimeException 47 | */ 48 | public function validate(array $patchFilter) 49 | { 50 | $errors = []; 51 | foreach ($patchFilter as $patchId) { 52 | $appliedDependents = array_filter( 53 | $this->optionalPool->getDependentOn($patchId), 54 | function ($patchId) { 55 | return $this->statusPool->isApplied($patchId); 56 | } 57 | ); 58 | if (array_diff($appliedDependents, $patchFilter)) { 59 | $errors[] = sprintf( 60 | 'Patch %1$s is a dependency for %2$s. Please, revert %2$s first', 61 | $patchId, 62 | implode(' ', $appliedDependents) 63 | ); 64 | } 65 | } 66 | 67 | if ($errors) { 68 | throw new RuntimeException(implode(PHP_EOL, $errors)); 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/Patch/RollbackProcessor.php: -------------------------------------------------------------------------------- 1 | applier = $applier; 37 | $this->logger = $logger; 38 | } 39 | 40 | /** 41 | * Rollback applied patches. 42 | * 43 | * @param PatchInterface[] $appliedPatches 44 | * @return string[] 45 | */ 46 | public function process(array $appliedPatches): array 47 | { 48 | if (empty($appliedPatches)) { 49 | return []; 50 | } 51 | 52 | $message = 'Start of rollback'; 53 | $this->logger->info($message); 54 | $messages[] = $message; 55 | 56 | foreach (array_reverse($appliedPatches) as $appliedPatch) { 57 | $message = $this->applier->revert($appliedPatch->getPath(), $appliedPatch->getId()); 58 | $messages[] = $message; 59 | $this->logger->info($message, ['file' => $appliedPatch->getPath()]); 60 | } 61 | 62 | $message = 'End of rollback'; 63 | $this->logger->info($message); 64 | $messages[] = $message; 65 | 66 | return $messages; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/Patch/SourceProviderException.php: -------------------------------------------------------------------------------- 1 | filesystem = $filesystem; 46 | $this->applier = $applier; 47 | $this->localPool = $localPool; 48 | } 49 | 50 | /** 51 | * @inheritDoc 52 | */ 53 | public function resolve(): array 54 | { 55 | $result = []; 56 | foreach ($this->localPool->getList() as $patch) { 57 | try { 58 | $content = $this->filesystem->get($patch->getPath()); 59 | } catch (FileSystemException $e) { 60 | throw new StatusResolverException($e->getMessage(), $e->getCode(), $e); 61 | } 62 | 63 | $result[$patch->getId()] = $this->applier->status($content); 64 | } 65 | 66 | return $result; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/Patch/Status/ResolverInterface.php: -------------------------------------------------------------------------------- 1 | resolve(); 55 | } 56 | $this->result = array_merge([], ...$result); 57 | } 58 | 59 | /** 60 | * Returns status of patch. 61 | * 62 | * @param string $id 63 | * @return string 64 | */ 65 | public function get($id) 66 | { 67 | return $this->result[$id] ?? self::NA; 68 | } 69 | 70 | /** 71 | * Checks if patch is applied. 72 | * 73 | * @param string $id 74 | * @return bool 75 | */ 76 | public function isApplied($id) 77 | { 78 | return $this->result[$id] === self::APPLIED; 79 | } 80 | 81 | /** 82 | * Checks if patch is not applied. 83 | * 84 | * @param string $id 85 | * @return bool 86 | */ 87 | public function isNotApplied($id) 88 | { 89 | return $this->result[$id] === self::NOT_APPLIED; 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /src/Patch/Status/StatusResolverException.php: -------------------------------------------------------------------------------- 1 | getMessage(); 25 | if ($previous instanceof ProcessFailedException) { 26 | $message = $previous->getProcess()->getErrorOutput() ?: ($previous->getProcess()->getOutput() ?: $message); 27 | } 28 | parent::__construct($message, $previous->getCode(), $previous); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Shell/Command/DriverInterface.php: -------------------------------------------------------------------------------- 1 | directoryList = $directoryList; 41 | $this->repository = $composer->getLocker()->getLockedRepository(); 42 | } 43 | 44 | /** 45 | * Creates process. 46 | * 47 | * @param array $cmd 48 | * @param string|null $input 49 | * @return Process 50 | * @throws PackageNotFoundException 51 | */ 52 | public function create(array $cmd, ?string $input = null): Process 53 | { 54 | return new Process( 55 | $this->processSupportsArrayParam() ? $cmd : implode(' ', $cmd), 56 | $this->directoryList->getMagentoRoot(), 57 | null, 58 | $input 59 | ); 60 | } 61 | 62 | /** 63 | * Test if symfony/process is current enough to support an array for its first parameter. 64 | * 65 | * @throws PackageNotFoundException 66 | */ 67 | private function processSupportsArrayParam(): bool 68 | { 69 | $package = $this->repository->findPackage('symfony/process', '*'); 70 | 71 | if ($package === null) { 72 | throw new PackageNotFoundException('Could not find symfony/process package.'); 73 | } 74 | 75 | return Comparator::greaterThanOrEqualTo($package->getVersion(), self::ARRAY_PARAM_MIN_VERSION); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /src/Test/Functional/Acceptance.suite.dist.yml: -------------------------------------------------------------------------------- 1 | actor: CliTester 2 | modules: 3 | enabled: 4 | - Magento\CloudDocker\Test\Functional\Codeception\TestInfrastructure 5 | - Magento\CloudDocker\Test\Functional\Codeception\Docker 6 | - PhpBrowser 7 | - Asserts 8 | -------------------------------------------------------------------------------- /src/Test/Functional/Acceptance/Acceptance71CeCest.php: -------------------------------------------------------------------------------- 1 | '2.1.16'], 22 | ['templateVersion' => '2.1.17'], 23 | ['templateVersion' => '2.1.18'], 24 | ['templateVersion' => '2.2.0'], 25 | ['templateVersion' => '2.2.1'], 26 | ['templateVersion' => '2.2.2'], 27 | ['templateVersion' => '2.2.3'], 28 | ]; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Test/Functional/Acceptance/Acceptance71Part2Cest.php: -------------------------------------------------------------------------------- 1 | '2.2.4'], 22 | ['templateVersion' => '2.2.5'], 23 | ['templateVersion' => '2.2.6'], 24 | ['templateVersion' => '2.2.7'], 25 | ['templateVersion' => '2.2.8'], 26 | ['templateVersion' => '2.2.9'], 27 | ['templateVersion' => '2.2.10'], 28 | ['templateVersion' => '2.2.11'], 29 | ]; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Test/Functional/Acceptance/Acceptance72CeCest.php: -------------------------------------------------------------------------------- 1 | '2.3.0'], 22 | ['templateVersion' => '2.3.1'], 23 | ['templateVersion' => '2.3.2', 'magentoVersion' => '2.3.2'], 24 | ['templateVersion' => '2.3.2', 'magentoVersion' => '2.3.2-p2'], 25 | ]; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Test/Functional/Acceptance/Acceptance73CeCest.php: -------------------------------------------------------------------------------- 1 | '2.3.3', 'magentoVersion' => '2.3.3'], 22 | ['templateVersion' => '2.3.3', 'magentoVersion' => '2.3.3-p1'], 23 | ['templateVersion' => '2.3.4', 'magentoVersion' => '2.3.4'], 24 | ['templateVersion' => '2.3.4', 'magentoVersion' => '2.3.4-p2'], 25 | ['templateVersion' => '2.3.5', 'magentoVersion' => '2.3.5'], 26 | ['templateVersion' => '2.3.5', 'magentoVersion' => '2.3.5-p1'], 27 | ['templateVersion' => '2.3.5', 'magentoVersion' => '2.3.5-p2'], 28 | ['templateVersion' => '2.3.6', 'magentoVersion' => '2.3.6'], 29 | ['templateVersion' => '2.3.6', 'magentoVersion' => '2.3.6-p1'], 30 | ['templateVersion' => '2.3.7', 'magentoVersion' => '2.3.7'], 31 | ['templateVersion' => '2.3.7', 'magentoVersion' => '2.3.7-p1'], 32 | ['templateVersion' => '2.3.7', 'magentoVersion' => '2.3.7-p2'], 33 | ['templateVersion' => '2.3.7', 'magentoVersion' => '2.3.7-p3'], 34 | ['templateVersion' => '2.3.7', 'magentoVersion' => '2.3.7-p4'], 35 | ['templateVersion' => '2.4.0', 'magentoVersion' => '2.4.0'], 36 | ]; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/Test/Functional/Acceptance/Acceptance74CeCest.php: -------------------------------------------------------------------------------- 1 | '2.4.0', 'magentoVersion' => '2.4.0'], 27 | ['templateVersion' => '2.4.0', 'magentoVersion' => '2.4.0-p1'], 28 | ['templateVersion' => '2.4.1', 'magentoVersion' => '2.4.1'], 29 | ['templateVersion' => '2.4.1', 'magentoVersion' => '2.4.1-p1'], 30 | ['templateVersion' => '2.4.2', 'magentoVersion' => '2.4.2'], 31 | ['templateVersion' => '2.4.2', 'magentoVersion' => '2.4.2-p1'], 32 | ['templateVersion' => '2.4.2', 'magentoVersion' => '2.4.2-p2'], 33 | // Magento 2.4.3 CE does not work on the cloud 34 | // ['templateVersion' => '2.4.3', 'magentoVersion' => '2.4.3'], 35 | // ['templateVersion' => '2.4.3', 'magentoVersion' => '2.4.3-p1'], 36 | // ['templateVersion' => '2.4.3', 'magentoVersion' => '2.4.3-p2'], 37 | ]; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/Test/Functional/Acceptance/Acceptance74Cest.php: -------------------------------------------------------------------------------- 1 | '2.4.0', 'magentoVersion' => '2.4.0'], 22 | ['templateVersion' => '2.4.0', 'magentoVersion' => '2.4.0-p1'], 23 | ['templateVersion' => '2.4.1', 'magentoVersion' => '2.4.1'], 24 | ['templateVersion' => '2.4.1', 'magentoVersion' => '2.4.1-p1'], 25 | ['templateVersion' => '2.4.2', 'magentoVersion' => '2.4.2'], 26 | ['templateVersion' => '2.4.2', 'magentoVersion' => '2.4.2-p1'], 27 | ['templateVersion' => '2.4.2', 'magentoVersion' => '2.4.2-p2'], 28 | ['templateVersion' => '2.4.3', 'magentoVersion' => '2.4.3'], 29 | ['templateVersion' => '2.4.3', 'magentoVersion' => '2.4.3-p1'], 30 | ['templateVersion' => '2.4.3', 'magentoVersion' => '2.4.3-p2'], 31 | ['templateVersion' => '2.4.3', 'magentoVersion' => '2.4.3-p3'], 32 | ]; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Test/Functional/Acceptance/Acceptance81Cest.php: -------------------------------------------------------------------------------- 1 | '2.4.4-p1-p8', 'magentoVersion' => '2.4.4-p1'], 22 | ['templateVersion' => '2.4.4-p1-p8', 'magentoVersion' => '2.4.4-p2'], 23 | ['templateVersion' => '2.4.4-p1-p8', 'magentoVersion' => '2.4.4-p3'], 24 | ['templateVersion' => '2.4.4-p1-p8', 'magentoVersion' => '2.4.4-p4'], 25 | ['templateVersion' => '2.4.4-p1-p8', 'magentoVersion' => '2.4.4-p5'], 26 | ['templateVersion' => '2.4.4-p1-p8', 'magentoVersion' => '2.4.4-p6'], 27 | ['templateVersion' => '2.4.4-p1-p8', 'magentoVersion' => '2.4.4-p7'], 28 | ['templateVersion' => '2.4.4-p1-p8', 'magentoVersion' => '2.4.4-p8'], 29 | ['templateVersion' => '2.4.5-p1-p7', 'magentoVersion' => '2.4.5'], 30 | ['templateVersion' => '2.4.5-p1-p7', 'magentoVersion' => '2.4.5-p1'], 31 | ['templateVersion' => '2.4.5-p1-p7', 'magentoVersion' => '2.4.5-p2'], 32 | ['templateVersion' => '2.4.5-p1-p7', 'magentoVersion' => '2.4.5-p3'], 33 | ['templateVersion' => '2.4.5-p1-p7', 'magentoVersion' => '2.4.5-p4'], 34 | ['templateVersion' => '2.4.5-p1-p7', 'magentoVersion' => '2.4.5-p5'], 35 | ['templateVersion' => '2.4.5-p1-p7', 'magentoVersion' => '2.4.5-p6'], 36 | ['templateVersion' => '2.4.5-p1-p7', 'magentoVersion' => '2.4.5-p7'], 37 | ]; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/Test/Functional/Acceptance/Acceptance82Cest.php: -------------------------------------------------------------------------------- 1 | '2.4.6', 'magentoVersion' => '2.4.6'], 22 | ['templateVersion' => '2.4.6', 'magentoVersion' => '2.4.6-p1'], 23 | ['templateVersion' => '2.4.7', 'magentoVersion' => null], 24 | ]; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Test/Functional/Acceptance/Acceptance83Cest.php: -------------------------------------------------------------------------------- 1 | '2.4.7', 'magentoVersion' => '2.4.7'], 22 | ]; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Test/Functional/Acceptance/AcceptanceCest.php: -------------------------------------------------------------------------------- 1 | prepareTemplate($I, $data['templateVersion'], $data['magentoVersion'] ?? null); 34 | $I->copyFileToWorkDir('files/patches/.apply_quality_patches.env.yaml', '.magento.env.yaml'); 35 | $I->generateDockerCompose(sprintf( 36 | '--mode=production --env-vars="%s"', 37 | $this->convertEnvFromArrayToJson(['MAGENTO_CLOUD_PROJECT' => 'travis-testing']) 38 | )); 39 | $I->assertTrue($I->runDockerComposeCommand('run build cloud-build')); 40 | $I->assertTrue($I->startEnvironment()); 41 | $I->assertTrue($I->runDockerComposeCommand('run deploy cloud-deploy')); 42 | $I->assertTrue($I->runDockerComposeCommand('run deploy cloud-post-deploy')); 43 | $I->amOnPage('/'); 44 | $I->see('Home page'); 45 | $I->see('CMS homepage content goes here.'); 46 | } 47 | 48 | /** 49 | * @return array 50 | */ 51 | abstract protected function patchesDataProvider(): array; 52 | } 53 | -------------------------------------------------------------------------------- /src/Test/Unit/Environment/ConfigTest.php: -------------------------------------------------------------------------------- 1 | configReader = $this->createMock(ConfigReader::class); 36 | 37 | $this->config = new Config($this->configReader); 38 | } 39 | 40 | /** 41 | * Tests Cloud environment. 42 | */ 43 | public function testIsCloud() 44 | { 45 | $_ENV[Config::ENV_VAR_CLOUD] = ''; 46 | $this->assertFalse($this->config->isCloud()); 47 | 48 | $_ENV[Config::ENV_VAR_CLOUD] = '123'; 49 | $this->assertTrue($this->config->isCloud()); 50 | } 51 | 52 | /** 53 | * Tests retrieving QUALITY_PATCHES from env variable. 54 | */ 55 | public function testGetQualityPatchesEnv() 56 | { 57 | $_ENV[Config::ENV_VAR_QUALITY_PATCHES] = ['MC-1', 'MC-2']; 58 | 59 | $this->configReader->expects($this->never()) 60 | ->method('read'); 61 | 62 | $this->assertEquals( 63 | ['MC-1', 'MC-2'], 64 | $this->config->getQualityPatches() 65 | ); 66 | } 67 | 68 | /** 69 | * Tests retrieving QUALITY_PATCHES from env config. 70 | */ 71 | public function testGetQualityPatchesConfig() 72 | { 73 | unset($_ENV[Config::ENV_VAR_QUALITY_PATCHES]); 74 | $this->assertArrayNotHasKey(Config::ENV_VAR_QUALITY_PATCHES, $_ENV); 75 | 76 | $config['stage']['build'][Config::ENV_VAR_QUALITY_PATCHES] = ['MC-1', 'MC-2']; 77 | $this->configReader->expects($this->once()) 78 | ->method('read') 79 | ->willReturn($config); 80 | 81 | $this->assertEquals( 82 | ['MC-1', 'MC-2'], 83 | $this->config->getQualityPatches() 84 | ); 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /src/Test/Unit/Environment/_file/.magento.env.yaml: -------------------------------------------------------------------------------- 1 | stage: 2 | build: 3 | QUALITY_PATCHES: 4 | - MC-1 5 | - MC-2 6 | -------------------------------------------------------------------------------- /src/Test/Unit/Filesystem/DirectoryListTest.php: -------------------------------------------------------------------------------- 1 | directoryList = new DirectoryList( 39 | $this->root, 40 | $this->magentoRoot 41 | ); 42 | } 43 | 44 | public function testGetRoot() 45 | { 46 | $this->assertSame( 47 | $this->root, 48 | $this->directoryList->getRoot() 49 | ); 50 | } 51 | 52 | public function testGetMagentoRoot() 53 | { 54 | $this->assertSame( 55 | $this->magentoRoot, 56 | $this->directoryList->getMagentoRoot() 57 | ); 58 | } 59 | 60 | public function testGetPatches() 61 | { 62 | $this->assertSame( 63 | $this->root . '/patches', 64 | $this->directoryList->getPatches() 65 | ); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/Test/Unit/Filesystem/FileListTest.php: -------------------------------------------------------------------------------- 1 | directoryListMock = $this->createMock(DirectoryList::class); 35 | 36 | $this->directoryListMock->method('getRoot') 37 | ->willReturn('root'); 38 | 39 | $this->directoryListMock->method('getMagentoRoot') 40 | ->willReturn('magento_root'); 41 | 42 | $this->fileList = new FileList( 43 | $this->directoryListMock 44 | ); 45 | } 46 | 47 | public function testGetPatches() 48 | { 49 | $this->assertSame( 50 | 'root/patches.json', 51 | $this->fileList->getPatches() 52 | ); 53 | } 54 | 55 | public function testGetPatchLog() 56 | { 57 | $this->assertSame( 58 | 'magento_root/var/log/patch.log', 59 | $this->fileList->getPatchLog() 60 | ); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/Test/Unit/Filesystem/_files/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magento/magento-cloud-patches/3f5f1565e209759e2ef6b150554165b73ab8af18/src/Test/Unit/Filesystem/_files/.gitignore -------------------------------------------------------------------------------- /src/Test/Unit/Patch/Collector/Fixture/cloud_config_valid.php: -------------------------------------------------------------------------------- 1 | [ 12 | 'Fix asset locker race condition when using Redis' => [ 13 | '2.1.4 - 2.1.14' => 'MDVA-2470__fix_asset_locking_race_condition__2.1.4.patch', 14 | '2.2.0 - 2.2.5' => 'MDVA-2470__fix_asset_locking_race_condition__2.2.0.patch' 15 | ], 16 | ], 17 | 'magento/magento2-ee-base' => [ 18 | 'Fix asset locker race condition when using Redis EE' => [ 19 | '2.2.0 - 2.2.5' => 'MDVA-2470__fix_asset_locking_race_condition__2.2.0_ee.patch' 20 | ], 21 | 'Allow DB dumps done with the support module to complete' => [ 22 | '2.2.0 - 2.2.5' => 'MAGECLOUD-2033__prevent_deadlock_during_db_dump__2.2.0.patch' 23 | ] 24 | ] 25 | ]; 26 | -------------------------------------------------------------------------------- /src/Test/Unit/Patch/Collector/Fixture/m2-hotfixes/patch1.patch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magento/magento-cloud-patches/3f5f1565e209759e2ef6b150554165b73ab8af18/src/Test/Unit/Patch/Collector/Fixture/m2-hotfixes/patch1.patch -------------------------------------------------------------------------------- /src/Test/Unit/Patch/Collector/Fixture/m2-hotfixes/patch2.patch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magento/magento-cloud-patches/3f5f1565e209759e2ef6b150554165b73ab8af18/src/Test/Unit/Patch/Collector/Fixture/m2-hotfixes/patch2.patch -------------------------------------------------------------------------------- /src/Test/Unit/Patch/Collector/Fixture/m2-hotfixes/readme.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magento/magento-cloud-patches/3f5f1565e209759e2ef6b150554165b73ab8af18/src/Test/Unit/Patch/Collector/Fixture/m2-hotfixes/readme.md -------------------------------------------------------------------------------- /src/Test/Unit/Patch/Collector/Fixture/quality_config_invalid.php: -------------------------------------------------------------------------------- 1 | [ 12 | 'categories' => [ 13 | 'Performance' 14 | ], 15 | 'title' => 'Allow DB dumps done with the support module to complete', 16 | 'packages' => [ 17 | 'magento/magento2-ee-base' => [ 18 | '2.2.0 - 2.2.5' => [ 19 | 'require' => 'MC-11111 MC-22222', 20 | 'replaced-with' => ['MC-33333'], 21 | 'deprecated' => 1 22 | ] 23 | ] 24 | ], 25 | ], 26 | ]; 27 | -------------------------------------------------------------------------------- /src/Test/Unit/Patch/Collector/Fixture/quality_config_valid.php: -------------------------------------------------------------------------------- 1 | [ 12 | 'categories' => [ 13 | 'Performance' 14 | ], 15 | 'title' => 'Fix asset locker race condition when using Redis', 16 | 'packages' => [ 17 | 'magento/magento2-base' => [ 18 | '2.1.4 - 2.1.14' => [ 19 | 'file' => 'MDVA-2470__fix_asset_locking_race_condition__2.1.4.patch' 20 | ], 21 | '2.2.0 - 2.2.5' => [ 22 | 'file' => 'MDVA-2470__fix_asset_locking_race_condition__2.2.0.patch' 23 | ] 24 | ], 25 | 'magento/magento2-ee-base' => [ 26 | '2.2.0 - 2.2.5' => [ 27 | 'file' => 'MDVA-2470__fix_asset_locking_race_condition__2.2.0_ee.patch' 28 | ] 29 | ] 30 | ], 31 | ], 32 | 'MDVA-2033' => [ 33 | 'categories' => [ 34 | 'Performance' 35 | ], 36 | 'title' => 'Allow DB dumps done with the support module to complete', 37 | 'packages' => [ 38 | 'magento/magento2-ee-base' => [ 39 | '2.2.0 - 2.2.5' => [ 40 | 'file' => 'MDVA-2033__prevent_deadlock_during_db_dump__2.2.0.patch', 41 | 'require' => ['MC-11111', 'MC-22222'], 42 | 'replaced-with' => 'MC-33333', 43 | 'deprecated' => true 44 | ] 45 | ] 46 | ], 47 | ], 48 | ]; 49 | -------------------------------------------------------------------------------- /src/Test/Unit/Patch/Fixture/MC-1__testfixture__1.1.patch: -------------------------------------------------------------------------------- 1 | diff -Nuar a/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php b/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php 2 | --- a/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php 3 | +++ b/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php 4 | @@ -77,6 +77,7 @@ class UpgradeCommand extends AbstractSetupCommand 5 | protected function execute(InputInterface $input, OutputInterface $output) 6 | { 7 | 8 | diff -Nuar a/vendor/magento/module-email/Model/Transport.php b/vendor/magento/module-email/Model/Transport.php 9 | --- a/vendor/magento/module-email/Model/Transport.php 10 | +++ b/vendor/magento/module-email/Model/Transport.php 11 | @@ -9,7 +9,6 @@ namespace Magento\Email\Model; 12 | 13 | use Magento\Framework\App\Config\ScopeConfigInterface; 14 | use Magento\Framework\Exception\MailException; 15 | 16 | diff -Nuar a/vendor/magento/framework/Mail/EmailMessage.php b/vendor/magento/framework/Mail/EmailMessage.php 17 | --- a/vendor/magento/framework/Mail/EmailMessage.php 18 | +++ b/vendor/magento/framework/Mail/EmailMessage.php 19 | @@ -10,19 +10,13 @@ namespace Magento\Framework\Mail; 20 | use Magento\Framework\Mail\Exception\InvalidArgumentException; 21 | use Zend\Mail\Address as ZendAddress; 22 | -------------------------------------------------------------------------------- /src/Test/Unit/Patch/Pool/LocalPoolTest.php: -------------------------------------------------------------------------------- 1 | createPatch('HotFix-1'); 28 | $patch2 = $this->createPatch('HotFix-2'); 29 | $patch3 = $this->createPatch('HotFix-3'); 30 | 31 | /** @var LocalCollector|MockObject $localCollector */ 32 | $localCollector = $this->createMock(LocalCollector::class); 33 | $localCollector->expects($this->once()) 34 | ->method('collect') 35 | ->willReturn([$patch1, $patch2, $patch3]); 36 | 37 | $pool = new LocalPool($localCollector); 38 | 39 | $this->assertEquals([$patch1, $patch2, $patch3], $pool->getList()); 40 | } 41 | 42 | /** 43 | * Creates patch mock. 44 | * 45 | * @param string $id 46 | * @return Patch|MockObject 47 | */ 48 | private function createPatch(string $id) 49 | { 50 | $patch = $this->createMock(Patch::class); 51 | $patch->method('getId')->willReturn($id); 52 | 53 | return $patch; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/Test/Unit/Patch/Pool/RequiredPoolTest.php: -------------------------------------------------------------------------------- 1 | createPatch('MCLOUD-1'); 27 | $patch2 = $this->createPatch('MCLOUD-2'); 28 | $patch3 = $this->createPatch('MCLOUD-3'); 29 | 30 | /** @var CloudCollector|MockObject $cloudCollector */ 31 | $cloudCollector = $this->createMock(CloudCollector::class); 32 | $cloudCollector->expects($this->once()) 33 | ->method('collect') 34 | ->willReturn([$patch1, $patch2, $patch3]); 35 | 36 | $pool = new RequiredPool([$cloudCollector]); 37 | 38 | $this->assertEquals([$patch1, $patch2, $patch3], $pool->getList()); 39 | } 40 | 41 | /** 42 | * Creates patch mock. 43 | * 44 | * @param string $id 45 | * @return Patch|MockObject 46 | */ 47 | private function createPatch(string $id) 48 | { 49 | $patch = $this->createMock(Patch::class); 50 | $patch->method('getId')->willReturn($id); 51 | 52 | return $patch; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/Test/Unit/Patch/Status/StatusPoolTest.php: -------------------------------------------------------------------------------- 1 | StatusPool::APPLIED, 'MC-2' => StatusPool::NOT_APPLIED]; 25 | $resolver1 = $this->getMockForAbstractClass(ResolverInterface::class); 26 | $resolver1->method('resolve')->willReturn($result1); 27 | 28 | $result2 = ['MC-3' => StatusPool::APPLIED, 'MC-4' => StatusPool::NA]; 29 | $resolver2 = $this->getMockForAbstractClass(ResolverInterface::class); 30 | $resolver2->method('resolve')->willReturn($result2); 31 | 32 | $statusPool = new StatusPool([$resolver1, $resolver2]); 33 | 34 | $this->assertEquals(StatusPool::APPLIED, $statusPool->get('MC-1')); 35 | $this->assertEquals(StatusPool::NOT_APPLIED, $statusPool->get('MC-2')); 36 | $this->assertEquals(StatusPool::APPLIED, $statusPool->get('MC-3')); 37 | $this->assertEquals(StatusPool::NA, $statusPool->get('MC-4')); 38 | $this->assertEquals(StatusPool::NA, $statusPool->get('NotExistingId')); 39 | $this->assertEquals(true, $statusPool->isNotApplied('MC-2')); 40 | $this->assertEquals(true, $statusPool->isApplied('MC-3')); 41 | $this->assertEquals(false, $statusPool->isNotApplied('MC-3')); 42 | } 43 | 44 | /** 45 | * Tests a case when exception happens after an instantiating status pool with the wrong resolver. 46 | */ 47 | public function testResolveWithException() 48 | { 49 | $invalidResolver = new \stdClass(); 50 | 51 | $this->expectException(\InvalidArgumentException::class); 52 | new StatusPool([$invalidResolver]); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /tests/functional/_data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/magento/magento-cloud-patches/3f5f1565e209759e2ef6b150554165b73ab8af18/tests/functional/_data/.gitkeep -------------------------------------------------------------------------------- /tests/functional/_data/files/debug_logging/.magento.env.yaml: -------------------------------------------------------------------------------- 1 | stage: 2 | global: 3 | MIN_LOGGING_LEVEL: debug 4 | 5 | log: 6 | file: 7 | min_level: "debug" 8 | stream: 9 | min_level: "debug" 10 | -------------------------------------------------------------------------------- /tests/functional/_data/files/patches/.apply_quality_patches.env.yaml: -------------------------------------------------------------------------------- 1 | stage: 2 | build: 3 | QUALITY_PATCHES: 4 | - '*' 5 | -------------------------------------------------------------------------------- /tests/functional/_data/files/patches/patch.patch: -------------------------------------------------------------------------------- 1 | --- target_file.md 2018-01-26 16:04:11.000000000 -0600 2 | +++ target_file.md 2018-01-26 16:04:45.000000000 -0600 3 | @@ -1 +1,3 @@ 4 | -# Hello World 5 | +# Hello Magento 6 | + 7 | +## Additional Info 8 | -------------------------------------------------------------------------------- /tests/functional/_data/files/patches/target_file.md: -------------------------------------------------------------------------------- 1 | # Hello World 2 | -------------------------------------------------------------------------------- /tests/functional/_data/files/patches/target_file_applied_patch.md: -------------------------------------------------------------------------------- 1 | # Hello Magento 2 | 3 | ## Additional Info 4 | -------------------------------------------------------------------------------- /tests/functional/_output/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /tests/static/Sniffs/Whitespace/MultipleEmptyLinesSniff.php: -------------------------------------------------------------------------------- 1 | getTokens(); 32 | if ($phpcsFile->hasCondition($stackPtr, T_FUNCTION) 33 | || $phpcsFile->hasCondition($stackPtr, T_CLASS) 34 | || $phpcsFile->hasCondition($stackPtr, T_INTERFACE) 35 | ) { 36 | if ($tokens[($stackPtr - 1)]['line'] < $tokens[$stackPtr]['line'] 37 | && $tokens[($stackPtr - 2)]['line'] === $tokens[($stackPtr - 1)]['line'] 38 | ) { 39 | // This is an empty line and the line before this one is not 40 | // empty, so this could be the start of a multiple empty line block 41 | $next = $phpcsFile->findNext(T_WHITESPACE, $stackPtr, null, true); 42 | $lines = $tokens[$next]['line'] - $tokens[$stackPtr]['line']; 43 | if ($lines > 1) { 44 | $error = 'Code must not contain multiple empty lines in a row; found %s empty lines'; 45 | $data = [$lines]; 46 | $phpcsFile->addError($error, $stackPtr, 'MultipleEmptyLines', $data); 47 | } 48 | } 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /tests/static/phpcs-ruleset.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | Custom Magento ECE Tools coding standard. 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | _files 29 | _file 30 | 31 | -------------------------------------------------------------------------------- /tests/static/phpmd-ruleset.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 12 | Magento Cloud Code Check Rules 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | _files 48 | 49 | -------------------------------------------------------------------------------- /tests/unit/.gitignore: -------------------------------------------------------------------------------- 1 | /phpunit.xml 2 | -------------------------------------------------------------------------------- /tests/unit/_data/files/file1.md: -------------------------------------------------------------------------------- 1 | ## File 1 2 | -------------------------------------------------------------------------------- /tests/unit/_data/files/file1.patch: -------------------------------------------------------------------------------- 1 | diff --git a/file1.md b/file1.md 2 | index abe4d18..2f8298f 100644 3 | --- a/file1.md 4 | +++ b/file1.md 5 | @@ -1 +1,3 @@ 6 | -## File 1 7 | +# File One 8 | + 9 | +## Description 10 | -------------------------------------------------------------------------------- /tests/unit/_data/files/file1_and_file2.patch: -------------------------------------------------------------------------------- 1 | diff --git a/file1.md b/file1.md 2 | index abe4d18..2f8298f 100644 3 | --- a/file1.md 4 | +++ b/file1.md 5 | @@ -1 +1,3 @@ 6 | -## File 1 7 | +# File One 8 | + 9 | +## Description 10 | diff --git a/file2.md b/file2.md 11 | index 37ae4d5..c49d210 100644 12 | --- a/file2.md 13 | +++ b/file2.md 14 | @@ -1 +1,3 @@ 15 | -## File 2 16 | +# File Two 17 | + 18 | +## Description 19 | -------------------------------------------------------------------------------- /tests/unit/_data/files/file1_applied_patch.md: -------------------------------------------------------------------------------- 1 | # File One 2 | 3 | ## Description 4 | -------------------------------------------------------------------------------- /tests/unit/_data/files/file2.md: -------------------------------------------------------------------------------- 1 | ## File 2 2 | -------------------------------------------------------------------------------- /tests/unit/_data/files/file2_applied_patch.md: -------------------------------------------------------------------------------- 1 | # File Two 2 | 3 | ## Description 4 | -------------------------------------------------------------------------------- /tests/unit/phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 11 | ../../src/Test/Unit 12 | 13 | 14 | 15 | 16 | ../../src 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /tests/unit/var/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | --------------------------------------------------------------------------------