Composer 类映射和加载具有非标准扩展名的文件 [英] Composer classmap and loading files with non-standard extensions
问题描述
当通过 composer classmap 功能加载文件时,是否可以加载具有非标准扩展名的 PHP 文件,例如 myFileName.stub
或 myFileName.foo
?
When loading files through the composer classmap functionality is it possible to load PHP files that have non-standard extensions such as myFileName.stub
or myFileName.foo
?
目前似乎没有加载它们.
At present it seems not to be loading them.
推荐答案
Composer 当前将包含具有以下扩展名的文件:
Composer will currently include files with the following extensions:
.php.inc.hh
.php .inc .hh
最后一个用于 HHVM.
The last one is for HHVM stuff.
来自类映射生成器的相关行在这里:
Relevant lines from the class map generator here:
https://github.com/composer/composer/blob/master/src/Composer/Autoload/ClassMapGenerator.php#L62https://github.com/composer/composer/blob/master/src/Composer/Autoload/ClassMapGenerator.php#L76
所以,看起来您需要一个自定义地图生成器...
So, looks like you'll need a custom map generator...
这篇关于Composer 类映射和加载具有非标准扩展名的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!