Add support for .inc files in classmap, fixes #1396
parent
6d2b4354f4
commit
aefe3a0b11
|
@ -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
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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',
|
||||||
)),
|
)),
|
||||||
|
|
Loading…
Reference in New Issue