无法在symfony2中设置lessphp

时间:2014-12-03 17:00:32

标签: symfony lessphp

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

我已成功安装了包含composer的软件包,并按照以下说明设置了配置:

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

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

1 个答案:

答案 0 :(得分:0)

好的很奇怪。

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

它不存在,所以我手动添加它。

它现在试图解析文件。