Symfony2 MopaBootstrap - BootstrapSandbox CSS中的异常

时间:2013-07-25 12:53:58

标签: symfony twitter-bootstrap

我正在尝试在Win 7 / Xampp安装上运行MopaBootstrapSandbox演示并运行。我可以看到主要的演示页面,但它没有样式。当我查看样式表时,我在其中看到以下异常...这不是整个异常,因为它与css交错。

[exception] 500 | Internal Server Error | Exception
[message] expected color value: failed at `color: darken(@grayLight, 10%); }` line: 33
[1] Exception: expected color value: failed at `color: darken(@grayLight, 10%); }`     

行:33

at n/a
    in C:\xampp\htdocs\T1\vendor\leafo\lessphp\lessc.inc.php line 3258

at lessc_parser->throwError('expected color value', '399')
    in C:\xampp\htdocs\T1\vendor\leafo\lessphp\lessc.inc.php line 1862

at lessc->throwError('expected color value')
    in C:\xampp\htdocs\T1\vendor\leafo\lessphp\lessc.inc.php line 1070

at lessc->assertColor(array('keyword', ''))
    in C:\xampp\htdocs\T1\vendor\leafo\lessphp\lessc.inc.php line 919

at lessc->colorArgs(array('list', ',', array(array('keyword', ''), array('number', '10', '%'))))
    in C:\xampp\htdocs\T1\vendor\leafo\lessphp\lessc.inc.php line 926

at lessc->lib_darken(array('list', ',', array(array('keyword', ''), array('number', '10', '%'))), object(lessc))
    in  line 

at call_user_func(array(object(lessc), 'lib_darken'), array('list', ',', array(array('keyword', ''), array('number', '10', '%'))), object(lessc))
    in C:\xampp\htdocs\T1\vendor\leafo\lessphp\lessc.inc.php line 1275

at lessc->reduce(array('function', 'darken', array('list', ',', array(array('variable', '@grayLight'), array('number', '10', '%')))))
    in C:\xampp\htdocs\T1\vendor\leafo\lessphp\lessc.inc.php line 617

at lessc->compileProp(array('assign', 'color', array('function', 'darken', array('list', ',', array(array('variable', '@grayLight'), array('number', '10', '%')))), '399'), object(stdClass), object(stdClass))
    in C:\xampp\htdocs\T1\vendor\leafo\lessphp\lessc.inc.php line 277

at lessc->compileProps(object(stdClass), object(stdClass))
    in C:\xampp\htdocs\T1\vendor\leafo\lessphp\lessc.inc.php line 215

at lessc->compileCSSBlock(object(stdClass))
    in C:\xampp\htdocs\T1\vendor\leafo\lessphp\lessc.inc.php line 189

at lessc->compileBlock(object(stdClass))
    in C:\xampp\htdocs\T1\vendor\leafo\lessphp\lessc.inc.php line 622

at lessc->compileProp(array('block', object(stdClass), '431'), object(stdClass), object(stdClass))
    in C:\xampp\htdocs\T1\vendor\leafo\lessphp\lessc.inc.php line 277

at lessc->compileProps(object(stdClass), object(stdClass))
    in C:\xampp\htdocs\T1\vendor\leafo\lessphp\lessc.inc.php line 271

at lessc->compileRoot(object(stdClass))
    in C:\xampp\htdocs\T1\vendor\leafo\lessphp\lessc.inc.php line 186

at lessc->compileBlock(object(stdClass))
    in C:\xampp\htdocs\T1\vendor\leafo\lessphp\lessc.inc.php line 1663

at lessc->compile('//

这是composer.json(部分)

"require": {
    "php": ">=5.3.3",
    "symfony/symfony": "2.3.*",
    "jms/security-extra-bundle": "dev-master",
    "doctrine/orm": ">=2.2.3,<2.4-dev",
    "doctrine/doctrine-bundle": "1.2.*",
    "twig/extensions": "1.0.*",
    "symfony/assetic-bundle": "2.3.*",
    "symfony/swiftmailer-bundle": "2.3.*",
    "symfony/monolog-bundle": "2.3.*",
    "sensio/distribution-bundle": "2.3.*",
    "sensio/framework-extra-bundle": "2.3.*",
    "sensio/generator-bundle": "2.3.*",
    "incenteev/composer-parameter-handler": "~2.0",
    "mopa/bootstrap-bundle": "master",
    "twitter/bootstrap": "2.3.1",
    "knplabs/knp-paginator-bundle": "dev-master",
    "knplabs/knp-menu": "dev-master",
    "knplabs/knp-menu-bundle": "2.0.*@dev",
    "craue/formflow-bundle": "dev-master",
    "leafo/lessphp": "0.3.9",
    "liip/theme-bundle": "dev-Versionfix as master",
},

   "scripts": {
    "post-install-cmd": [ ... 
        "Mopa\\Bundle\\BootstrapBundle\\Composer\\ScriptHandler::postInstallSymlinkTwitterBootstrap"
    ],
    "post-update-cmd": [ ...
        "Mopa\\Bundle\\BootstrapBundle\\Composer\\ScriptHandler::postInstallSymlinkTwitterBootstrap"
    ]
},

老实说,我对Symfony 2很陌生,所以任何帮助都会受到赞赏。

由于

1 个答案:

答案 0 :(得分:0)

我不确定这是否对您有所帮助,但是,leafo / lessphp可能是问题..我在编译的文件较少时发现了类似的问题,发现leafo没有定期更新..({ {3}}) 您可以轻松地从leafo更改为更稳定的分布(Forum post

将composer.phar文件更改为:

"oyejorge/less.php": "~1.5",

运行:

php composer.phar update

这将删除lefo并安装oyejorge 将config.yml文件更改为:

assetic:
    debug:          "%kernel.debug%"
    use_controller: false
    #bundles:        [ ]
    #java: /usr/bin/java
    filters:
        lessphp:
            file: %kernel.root_dir%/../vendor/oyejorge/less.php/lessc.inc.php
            apply_to: ".less$"
            # Formatter options: compressed, lessjs, classic
            formatter: "compressed"
            preserve_comments: false

如果您愿意,可以将过滤器名称更改为less而不是lessphp