From 49d4054e51d283290af3cf6bf5dbd517d879096b Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Mon, 14 Apr 2014 12:47:47 +0200 Subject: [PATCH] Handle files with no php at all, fixes #2910 --- src/Composer/Autoload/ClassMapGenerator.php | 5 ++++- .../Test/Autoload/Fixtures/template/notphp.inc | 11 +++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 tests/Composer/Test/Autoload/Fixtures/template/notphp.inc diff --git a/src/Composer/Autoload/ClassMapGenerator.php b/src/Composer/Autoload/ClassMapGenerator.php index e7547cb04..f98543f88 100644 --- a/src/Composer/Autoload/ClassMapGenerator.php +++ b/src/Composer/Autoload/ClassMapGenerator.php @@ -124,7 +124,10 @@ class ClassMapGenerator $contents = preg_replace('{"[^"\\\\]*(\\\\.[^"\\\\]*)*"|\'[^\'\\\\]*(\\\\.[^\'\\\\]*)*\'}s', 'null', $contents); // strip leading non-php code if needed if (substr($contents, 0, 2) !== '.+<\?}s', '?> array +( + 'handler' => array ('midgard_admin_asgard_handler_preferences', 'ajax'), + 'fixed_args' => array('preferences', 'ajax'), + 'variable_args' => 0, +),