PHP Classes

File: tests/preproc.php

Recommend this page to a friend!
  Classes of Alexander Selifonov   PHP Code Preprocessor   tests/preproc.php   Download  
File: tests/preproc.php
Role: Example script
Content type: text/plain
Description: Using example
Class: PHP Code Preprocessor
Preprocess code or text like in the C language
Author: By
Last change: fixed files
Date: 8 years ago
Size: 621 bytes


Class file image Download
* Testing class.preProcessor.php functionality
include '../src/class.codePreprocessor.php';
$srcfile = 'source_example.txt';

$myvars = array(
'use_auth' => FALSE
,'my_auth' => 1
,'sw_lang' => 'de'
,'program_title' => 'Sample string to demonstrate %var% substitution in Preprocessor'

$preproc = new CodePreprocessor();

"Preprocessed text:\n-----------------------------------------\n";
echo (
$preproc -> parse($srcfile, $myvars, TRUE));

"\n-----------------------------------------\nError/warning messages:\n";
implode("\n", $preproc->getErrorMessages());