-1

这个线程开始,我被要求尝试实现lessphp,看看它是否与商业应用程序的当前版本兼容(最初开发时它不是)。

我已经使用 composer 成功安装了 bundle 并按照如下说明设置了配置:

filters: lessphp: file: %kernel.root_dir%/../vendor/leafo/lessphp/lessc.inc.php apply_to: "\.less$" # Formatter options: compressed, lessjs, classic formatter: "compressed" preserve_comments: false

我已经确认不太主要的类加载良好,并带有一个好的 ol' die 语句。

但我在尝试时收到以下错误assetic/dump

Fatal error: Call to undefined method Assetic\Filter\LessphpFilter::setLoadPaths() in C:\Dropbox\xampp\htdocs\SBSonline\sbsonline-v2\app\cache\dev\appDevDebugProjectContainer.php on line 118

Call Stack:
    0.0002     126720   1. {main}() C:\Dropbox\xampp\htdocs\SBSonline\sbsonline-v2\app\console:0
    0.0150    1257016   2. Symfony\Component\Console\Application->run() C:\Dropbox\xampp\htdocs\SBSonline\sbsonline-v2\app\console:22
    0.0187    1405928   3. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() C:\Dropbox\xampp\htdocs\SBSonline\sbsonline-v2\vendor\symfony\symfony\src\Symfony\Component\Console\Application.php:105
    3.2818   28230888   4. Symfony\Component\Console\Application->doRun() C:\Dropbox\xampp\htdocs\SBSonline\sbsonline-v2\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Console\Application.php:78
    3.2841   28231512   5. Symfony\Component\Console\Command\Command->run() C:\Dropbox\xampp\htdocs\SBSonline\sbsonline-v2\vendor\symfony\symfony\src\Symfony\Component\Console\Application.php:199
    3.2844   28233736   6. Symfony\Bundle\AsseticBundle\Command\DumpCommand->initialize() C:\Dropbox\xampp\htdocs\SBSonline\sbsonline-v2\vendor\symfony\symfony\src\Symfony\Component\Console\Command\Command.php:227
    3.2844   28233960   7. Symfony\Component\DependencyInjection\Container->get() C:\Dropbox\xampp\htdocs\SBSonline\sbsonline-v2\vendor\symfony\assetic-bundle\Symfony\Bundle\AsseticBundle\Command\DumpCommand.php:53
    3.2845   28234360   8. appDevDebugProjectContainer->getAssetic_AssetManagerService() C:\Dropbox\xampp\htdocs\SBSonline\sbsonline-v2\app\bootstrap.php.cache:211
    3.2845   28234424   9. Symfony\Component\DependencyInjection\Container->get() C:\Dropbox\xampp\htdocs\SBSonline\sbsonline-v2\app\cache\dev\appDevDebugProjectContainer.php:61
    3.2845   28234768  10. appDevDebugProjectContainer->getAssetic_AssetFactoryService() C:\Dropbox\xampp\htdocs\SBSonline\sbsonline-v2\app\bootstrap.php.cache:211
    3.2845   28235776  11. Symfony\Component\DependencyInjection\Container->get() C:\Dropbox\xampp\htdocs\SBSonline\sbsonline-v2\app\cache\dev\appDevDebugProjectContainer.php:3700
    3.2845   28236112  12. appDevDebugProjectContainer->getAssetic_Filter_LessphpService() C:\Dropbox\xampp\htdocs\SBSonline\sbsonline-v2\app\bootstrap.php.cache:211

有人可以帮忙吗?我有一种感觉,我错过了一些明显的东西,但我找不到它。

4

1 回答 1

0

好奇怪。

根据lessphp的文档,应该有一个明显调用的函数::setLoadPaths()

它不在那里,所以我手动添加了它。

它现在正在尝试解析文件。

于 2014-12-04T09:12:35.510 回答