本文整理汇总了PHP中Less_Environment::Init方法的典型用法代码示例。如果您正苦于以下问题:PHP Less_Environment::Init方法的具体用法?PHP Less_Environment::Init怎么用?PHP Less_Environment::Init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Less_Environment
的用法示例。
在下文中一共展示了Less_Environment::Init方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Reset
/**
* Reset the parser state completely
*
*/
public function Reset($options = null)
{
$this->rules = array();
self::$imports = array();
self::$has_extends = false;
self::$imports = array();
self::$contentsMap = array();
$this->env = new Less_Environment($options);
$this->env->Init();
//set new options
if (is_array($options)) {
$this->SetOptions(Less_Parser::$default_options);
$this->SetOptions($options);
}
}
示例2: __construct
/**
* @param Less_Environment|array|null $env
*/
public function __construct($env = null)
{
// Top parser on an import tree must be sure there is one "env"
// which will then be passed around by reference.
if ($env instanceof Less_Environment) {
$this->env = $env;
} else {
//reset
self::$imports = array();
self::$has_extends = false;
self::$imports = array();
self::$contentsMap = array();
$this->SetOptions(Less_Parser::$default_options);
//set new options
$this->env = new Less_Environment($env);
$this->env->Init();
if (is_array($env)) {
$this->SetOptions($env);
}
}
$this->pos = $this->farthest = 0;
}