martinixs
martinixs

Reputation: 325

Fresh Yii Boilerplate Project Reports An Error

I've generated a new project using the Yii-​​boilerplate(Haml branch), but there is an error:

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

Any advices on how to solve it?

Update: HAMLPHP_ROOT is already defined in \yii-boilerplate\protected\extensions\yiihppie\vendors\HamlPHP\src\HamlPHP\Config.php as

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

Upvotes: 3

Views: 464

Answers (2)

martinixs
martinixs

Reputation: 325

Finally I've managed to resolve the issue. The problem was that \yii-boilerplate\protected\extensions\yiihppie\vendors\HamlPHP\src\HamlPHP\HamlPHP.php includes wrong Config.php

require_once 'Config.php';

It actually includes Config.php from the Pear directory, not from the current one. So I've specified it unambigiously as

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

and it works.

Upvotes: 4

knowill
knowill

Reputation: 69

define of the constant HAMLPHP_ROOT in index.php or config.php

Upvotes: 2

Related Questions