public function parseFile( $filename, $uri_root = '', $returnRoot = false){

		if( !file_exists($filename) ){
			$this->Error(sprintf('File `%s` not found.', $filename));
		}


		// fix uri_root?
		// Instead of The mixture of file path for the first argument and directory path for the second argument has bee
		if( !$returnRoot && !empty($uri_root) && basename($uri_root) == basename($filename) ){
			$uri_root = dirname($uri_root);
		}


		$previousFileInfo = $this->env->currentFileInfo;


		if( $filename ){
			$filename = self::AbsPath($filename, true);
		}
		$uri_root = self::WinPath($uri_root);

		$this->SetFileInfo($filename, $uri_root);

		self::AddParsedFile($filename);

		if( $returnRoot ){
			$rules = $this->GetRules( $filename );
			$return = new Less_Tree_Ruleset(array(), $rules );
		}else{
			$this->_parse( $filename );
			$return = $this;
		}

		if( $previousFileInfo ){
			$this->env->currentFileInfo = $previousFileInfo;
		}

		return $return;
	}
public function parseFile( $filename, $uri_root = '', $returnRoot = false){

		if( !file_exists($filename) ){
			$this->Error(sprintf('File `%s` not found.', $filename));
		}


		// fix uri_root?
		// Instead of The mixture of file path for the first argument and directory path for the second argument has bee
		if( !$returnRoot && !empty($uri_root) && basename($uri_root) == basename($filename) ){
			$uri_root = dirname($uri_root);
		}


		$previousFileInfo = $this->env->currentFileInfo;


		if( $filename ){
			$filename = self::AbsPath($filename, true);
		}
		$uri_root = self::WinPath($uri_root);

		$this->SetFileInfo($filename, $uri_root);

		self::AddParsedFile($filename);

		if( $returnRoot ){
			$rules = $this->GetRules( $filename );
			$return = new Less_Tree_Ruleset(array(), $rules );
		}else{
			$this->_parse( $filename );
			$return = $this;
		}

		if( $previousFileInfo ){
			$this->env->currentFileInfo = $previousFileInfo;
		}

		return $return;
	}
public function parseFile ( $ filename , $ uri_root = '' , $ returnRoot = false ) { if ( ! file_exists ( $ filename ) ) { $ this -> Error ( sprintf ( 'File `%s` not found.' , $ filename ) ) ; } // fix uri_root? // Instead of The mixture of file path for the first argument and directory path for the second argument has bee if ( ! $ returnRoot && ! empty ( $ uri_root ) && basename ( $ uri_root ) == basename ( $ filename ) ) { $ uri_root = dirname ( $ uri_root ) ; } $ previousFileInfo = $ this -> env -> currentFileInfo ; if ( $ filename ) { $ filename = self :: AbsPath ( $ filename , true ) ; } $ uri_root = self :: WinPath ( $ uri_root ) ; $ this -> SetFileInfo ( $ filename , $ uri_root ) ; self :: AddParsedFile ( $ filename ) ; if ( $ returnRoot ) { $ rules = $ this -> GetRules ( $ filename ) ; $ return = new Less_Tree_Ruleset ( array ( ) , $ rules ) ; } else { $ this -> _parse ( $ filename ) ; $ return = $ this ; } if ( $ previousFileInfo ) { $ this -> env -> currentFileInfo = $ previousFileInfo ; } return $ return ; }
Parse a Less string from a given file

@throws Less_Exception_Parser
@param string $filename The file to parse
@param string $uri_root The url of the file
@param bool $returnRoot Indicates whether the return value should be a css string a root node
@return Less_Tree_Ruleset|Less_Parser
Parse a Less string from a given file