BlueSpice MediaWiki REL1_27
 All Classes Namespaces Files Functions Variables Groups Pages
Less_Parser Class Reference

Public Member Functions

 __construct ($env=null)
 
 Reset ($options=null)
 
 SetOptions ($options)
 
 SetOption ($option, $value)
 
 registerFunction ($name, $callback)
 
 unregisterFunction ($name)
 
 getCss ()
 
 parse ($str, $file_uri=null)
 
 parseFile ($filename, $uri_root= '', $returnRoot=false)
 
 ModifyVars ($vars)
 
 SetFileInfo ($filename, $uri_root= '')
 
 SetCacheDir ($dir)
 
 SetImportDirs ($dirs)
 
 SetInput ($file_path)
 
 UnsetInput ()
 
 CacheFile ($file_path)
 
 save ()
 
 PeekReg ($tok)
 
 PeekChar ($tok)
 
 skipWhitespace ($length)
 
 expect ($tok, $msg=NULL)
 
 expectChar ($tok, $msg=null)
 
 parseUnicodeDescriptor ()
 
 parseExtend ($isRule=false)
 
 parseAnonymousValue ()
 
 parseMultiplication ()
 
 NewObj0 ($class)
 
 NewObj1 ($class, $arg)
 
 NewObj2 ($class, $args)
 
 NewObj3 ($class, $args)
 
 NewObj4 ($class, $args)
 
 NewObj5 ($class, $args)
 
 NewObj6 ($class, $args)
 
 NewObj7 ($class, $args)
 
 ObjCache ($obj, $class, $args=array())
 
 ArgCache ($args)
 
 Error ($msg)
 
 CacheEnabled ()
 

Static Public Member Functions

static AddParsedFile ($file)
 
static AllParsedFiles ()
 
static FileParsed ($file)
 
static serializeVars ($vars)
 
static is_method ($a, $b)
 
static round ($i, $precision=0)
 
static ArgString ($arg)
 
static WinPath ($path)
 

Static Public Attributes

static $default_options
 
static $options = array()
 
static $has_extends = false
 
static $next_id = 0
 
static $contentsMap = array()
 

Protected Attributes

 $rules = array()
 

Constructor & Destructor Documentation

Less_Parser::__construct (   $env = null)
Parameters
Less_Environment | array | null$env

Member Function Documentation

static Less_Parser::ArgString (   $arg)
static

Convert an argument to a string for use in the parser cache

Returns
string
Less_Parser::expect (   $tok,
  $msg = NULL 
)
Parameters
string$tok
string | null$msg
Less_Parser::expectChar (   $tok,
  $msg = null 
)
Parameters
string$tok
static Less_Parser::FileParsed (   $file)
static
Parameters
string$file
Less_Parser::getCss ( )

Get the current css buffer

Returns
string
static Less_Parser::is_method (   $a,
  $b 
)
static

Some versions of php have trouble with method_exists($a,$b) if $a is not an object

Parameters
string$b
Less_Parser::ModifyVars (   $vars)

Allows a user to set variables values

Parameters
array$vars
Returns
Less_Parser
Less_Parser::NewObj0 (   $class)

Create Less_Tree_* objects and optionally generate a cache string

Returns
mixed
Less_Parser::parse (   $str,
  $file_uri = null 
)

Parse a Less string into css

Parameters
string$strThe string to convert
string$uri_rootThe url of the file
Returns
Less_Tree_Ruleset|Less_Parser
Less_Parser::parseFile (   $filename,
  $uri_root = '',
  $returnRoot = false 
)

Parse a Less string from a given file

Exceptions
Less_Exception_Parser
Parameters
string$filenameThe file to parse
string$uri_rootThe url of the file
bool$returnRootIndicates whether the return value should be a css string a root node
Returns
Less_Tree_Ruleset|Less_Parser
Less_Parser::parseMultiplication ( )

Parses multiplication operation

Returns
Less_Tree_Operation|null
Less_Parser::PeekChar (   $tok)
Parameters
string$tok
Less_Parser::PeekReg (   $tok)

Same as match(), but don't change the state of the parser, just return the match.

Parameters
string$tok
Returns
integer
Less_Parser::registerFunction (   $name,
  $callback 
)

Registers a new custom function

Parameters
string$namefunction name
callable$callbackcallback
Less_Parser::Reset (   $options = null)

Reset the parser state completely

static Less_Parser::round (   $i,
  $precision = 0 
)
static

Round numbers similarly to javascript eg: 1.499999 to 1 instead of 2

Less_Parser::SetCacheDir (   $dir)
Deprecated:
1.5.1.2
Less_Parser::SetFileInfo (   $filename,
  $uri_root = '' 
)
Parameters
string$filename
Less_Parser::SetImportDirs (   $dirs)

Set a list of directories or callbacks the parser should use for determining import paths

Parameters
array$dirs
Less_Parser::SetInput (   $file_path)

Set up the input buffer

Less_Parser::SetOption (   $option,
  $value 
)

Set one compiler option

Less_Parser::SetOptions (   $options)

Set one or more compiler options options: import_dirs, cache_dir, cache_method

Less_Parser::skipWhitespace (   $length)
Parameters
integer$length
Less_Parser::unregisterFunction (   $name)

Removed an already registered function

Parameters
string$namefunction name
Less_Parser::UnsetInput ( )

Free up some memory

Member Data Documentation

Less_Parser::$default_options
static
Initial value:
= array(
'compress' => false,
'strictUnits' => false,
'strictMath' => false,
'relativeUrls' => true,
'urlArgs' => '',
'numPrecision' => 8,
'import_dirs' => array(),
'import_callback' => null,
'cache_dir' => null,
'cache_method' => 'php',
'cache_callback_get' => null,
'cache_callback_set' => null,
'sourceMap' => false,
'sourceMapBasepath' => null,
'sourceMapWriteTo' => null,
'sourceMapURL' => null,
'indentation' => ' ',
'plugins' => array(),
)

Default parser options


The documentation for this class was generated from the following file: