3

我使用Yii-​​boilerplate(Haml分支)生成了一个新项目,但是出现错误:

Use of undefined constant HAMLPHP_ROOT - assumed 'HAMLPHP_ROOT' in \yii-boilerplate\protected\extensions\yiihppie\vendors\HamlPHP\src\HamlPHP\Lang\Nodes\DoctypeNode.php.

关于如何解决它的任何建议?

更新: HAMLPHP_ROOT已定义\yii-boilerplate\protected\extensions\yiihppie\vendors\HamlPHP\src\HamlPHP\Config.php

define('HAMLPHP_ROOT', dirname(__FILE__).DIRECTORY_SEPARATOR);
4

2 回答 2

4

最后我设法解决了这个问题。问题是\yii-boilerplate\protected\extensions\yiihppie\vendors\HamlPHP\src\HamlPHP\HamlPHP.php包括错误的Config.php

require_once 'Config.php';

它实际上包括Config.php来自 Pear 目录,而不是来自当前目录。所以我明确地将其指定为

require_once dirname(__FILE__) . '/Config.php';

它有效。

于 2012-10-13T15:10:16.167 回答
2

在 index.php 或 config.php 中定义常量 HAMLPHP_ROOT

于 2012-10-13T09:11:27.997 回答