Example #1
0
 public static function parseCFMLFile($file, $vars = array())
 {
     self::$fallback = $vars;
     self::$variables = method_exists($vars, 'getRecord') ? (array) $vars->getRecord() : (array) $vars;
     $parser = new CFMLParser();
     $tokens = $parser->tokenize($file);
     $output = $parser->parse($tokens);
     return $output;
 }
Example #2
0
}
class CFML_Variable_Exception extends CFML_Exception
{
}
class CFML_Parser_Exception extends CFML_Exception
{
}
class CFML
{
    public static $variables = array();
    public function parseCFML($string)
    {
        $fp = fopen('php://temp', 'w+');
        fwrite($fp, $string);
        return $this->parseCFMLFile($fp);
        fclose($fp);
    }
    public function parseCFMLFile($file)
    {
        $parser = new CFMLParser();
        $tokens = $parser->tokenize($file);
        echo '<pre>';
        var_dump($tokens);
        echo '</pre>';
        $output = $parser->parse($tokens);
        return $output;
    }
}
$cfml = new CFML();
$output = $cfml->parseCFMLFile('/var/www/test.cfm');
echo $output;