1
0
Fork 0

Add support for .inc files in classmap, fixes #1396

pull/1410/head
Jordi Boggiano 2012-12-08 21:54:51 +01:00
parent 6d2b4354f4
commit aefe3a0b11
4 changed files with 4 additions and 3 deletions

View File

@ -416,7 +416,8 @@ use an empty prefix like:
The `classmap` references are all combined, during install/update, into a single The `classmap` references are all combined, during install/update, into a single
key => value array which may be found in the generated file key => value array which may be found in the generated file
`vendor/composer/autoload_classmap.php`. `vendor/composer/autoload_classmap.php`. This map is built by scanning for
classes in all `.php` and `.inc` files in the given directories/files.
You can use the classmap generation support to define autoloading for all libraries You can use the classmap generation support to define autoloading for all libraries
that do not follow PSR-0. To configure this you specify all directories or files that do not follow PSR-0. To configure this you specify all directories or files

View File

@ -71,7 +71,7 @@ class ClassMapGenerator
$filePath = $file->getRealPath(); $filePath = $file->getRealPath();
if (pathinfo($filePath, PATHINFO_EXTENSION) !== 'php') { if (!in_array(pathinfo($filePath, PATHINFO_EXTENSION), array('php', 'inc'))) {
continue; continue;
} }

View File

@ -27,7 +27,7 @@ class ClassMapGeneratorTest extends \PHPUnit_Framework_TestCase
{ {
$data = array( $data = array(
array(__DIR__.'/Fixtures/Namespaced', array( array(__DIR__.'/Fixtures/Namespaced', array(
'Namespaced\\Bar' => realpath(__DIR__).'/Fixtures/Namespaced/Bar.php', 'Namespaced\\Bar' => realpath(__DIR__).'/Fixtures/Namespaced/Bar.inc',
'Namespaced\\Foo' => realpath(__DIR__).'/Fixtures/Namespaced/Foo.php', 'Namespaced\\Foo' => realpath(__DIR__).'/Fixtures/Namespaced/Foo.php',
'Namespaced\\Baz' => realpath(__DIR__).'/Fixtures/Namespaced/Baz.php', 'Namespaced\\Baz' => realpath(__DIR__).'/Fixtures/Namespaced/Baz.php',
)), )),