0

我正在尝试MopaBootstrapSandbox在我的 Win 7 / Xampp 安装上启动并运行演示。我可以看到主演示页面,但它没有样式。当我查看样式表时,我在其中看到以下异常......这不是整个异常,因为它与 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 还很陌生,因此我们将不胜感激。

谢谢

4

1 回答 1

0

我不确定这是否对您有帮助,但是,leafo/lessphp 可能是问题..我在编译较少的文件时遇到了类似的问题,发现leafo 没有定期更新..(论坛帖子)你可以轻松地从 leafo 更改为更稳定的分布 ( oyejorge/less.php )

将 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.

于 2014-05-17T15:40:59.220 回答