From 3b2f5dd606d47d04469a03114dc279a3e0608d6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Baptiste=20Clavi=C3=A9?= Date: Wed, 6 Jun 2018 08:34:53 +0200 Subject: [PATCH] composer: add new autoloader options (#40439) * Add support for classmap-authoritative option for composer * Add support for apcu-autoloader option for composer * Fix a typo for the no-plugins option --- .../modules/packaging/language/composer.py | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/packaging/language/composer.py b/lib/ansible/modules/packaging/language/composer.py index 437662d729b..3b83fccc7a3 100644 --- a/lib/ansible/modules/packaging/language/composer.py +++ b/lib/ansible/modules/packaging/language/composer.py @@ -92,6 +92,22 @@ options: default: true type: bool aliases: [ optimize-autoloader ] + classmap_authoritative: + version_added: "2.7" + description: + - Autoload classes from classmap only. + - Implicitely enable optimize_autoloader. + - Recommended especially for production, but can take a bit of time to run. + default: false + type: bool + aliases: [ classmap-authoritative ] + apcu_autoloader: + version_added: "2.7" + description: + - Uses APCu to cache found/not-found classes + default: false + type: bool + aliases: [ apcu-autoloader ] ignore_platform_reqs: version_added: "2.0" description: @@ -182,7 +198,9 @@ def main(): no_dev=dict(default=True, type="bool", aliases=["no-dev"]), no_scripts=dict(default=False, type="bool", aliases=["no-scripts"]), no_plugins=dict(default=False, type="bool", aliases=["no-plugins"]), + apcu_autoloader=dict(default=False, type="bool", aliases=["apcu-autoloader"]), optimize_autoloader=dict(default=True, type="bool", aliases=["optimize-autoloader"]), + classmap_authoritative=dict(default=False, type="bool", aliases=["classmap-authoritative"]), ignore_platform_reqs=dict(default=False, type="bool", aliases=["ignore-platform-reqs"]), ), required_if=[('global_command', False, ['working_dir'])], @@ -220,8 +238,10 @@ def main(): 'prefer_dist': 'prefer-dist', 'no_dev': 'no-dev', 'no_scripts': 'no-scripts', - 'no_plugins': 'no_plugins', + 'no_plugins': 'no-plugins', + 'apcu_autoloader': 'acpu-autoloader', 'optimize_autoloader': 'optimize-autoloader', + 'classmap_authoritative': 'classmap-authoritative', 'ignore_platform_reqs': 'ignore-platform-reqs', }