Crafty_Compiler class implementation
This is the compiler class of the Crafty template engine. If you just want to write templates, you will not need to make use of it. The Crafty class will spawn an instance for internal usage if required.
Located in /crafty/Crafty_Compiler.class.php (line 54)
Stores all Crafty_Block instances
All blocks loaded will be created and stored in this array. They are indexed by their name.
Stores the root Crafty_Config object
This object is loaded by the constructor from the Crafty_Compiler.config.xml file
Stores all Crafty_Core_* instances
All Crafty_Core_* instances that are loaded, except for Crafty_Core_Define and Crafty_Core_Require, will be stored in this array indexed by their classname.
Object handle of a Crafty object
This is the object that created the current Crafty_Compiler class. Set by the Constructor
Stores defined values
Associative array of all defines, created by load() using Crafty_Core_Define
Final replacements for $preparse_search
Those will be replaced just after parsing. Security will be cared of afterwards.
Temporary replacements during the parsing process for $preparse_search
The constructor will create this array by some sha1 hashes
Array of strings that need to be replaced before parsing
Double backslashes, backslash and single quote, backslash and double quote are replaced during the process of parsing to protect the core pregs from beeing confused.
Stores the name of the compiled template and its directory
This is the MD5 hash of realpath($template_name), constructed by Crafty::display()
Path to the uncompiled template
Set by load() and used by several Crafty_Core objects, e.g. to check if an external block is present.
Are variable blocks used?
If this is TRUE compile() will also compile every loaded block as variable block into a separate file.
Stores a filehandle to the compiled (binary) template
Crafty_Block::compileElement() will use this filehandle to write the compiled content into the file.
Initializes a Crafty_Compiler instance
The constructor intializes a Crafty_Compiler instance and loads the required framework files, such as the class definitions for Crafty_Config, Crafty_Block, Crafty_Core, Crafty_Core_Define, Crafty_Core_Require and all other Crafty_Core_* classes.
It also instantiates the Crafty_Core_* classes and stores them in $cores
Adds a character(sequence) that will be able to be escaped by a backslash
Booleanize a value
Check the string for true|yes|on|1 / false|no|off|0 and return a boolean in that case
Compiles a template
This method basically opens a compiled template file, adds the php tags and compiles the "main" block.
If variable blocks are used it also compiles any loaded template file into a separate file.
Gets the linenumber of an offset
Loads a template file.
This method loads a template file, parses the $defines using Crafty_Core_Define, parses the requires using Crafty_Core_Require and calling itself for each require.
Then it parses the blocks and stores them in the $blocks array.
Documentation generated on Sat, 19 Feb 2005 01:43:40 +0100 by phpDocumentor 1.3.0RC3