1
<?xml version="1.0" encoding="iso-8859-1"?>
2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
<html xmlns="http://www.w3.org/1999/xhtml">
5
<!-- template designed by Marco Von Ballmoos -->
6
<title>Docs For Class Savant2_Compiler_basic</title>
7
<link rel="stylesheet" href="../media/stylesheet.css" />
8
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
11
<div class="page-body">
12
<h2 class="class-name">Class Savant2_Compiler_basic</h2>
14
<a name="sec-description"></a>
15
<div class="info-box">
16
<div class="info-box-title">Description</div>
18
<span class="disabled">Description</span> |
19
<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
20
| <a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
23
<div class="info-box-body">
24
<!-- ========== Info from phpDoc block ========= -->
25
<p class="short-description">Abstract Savant2_Compiler class.</p>
26
<p class="description"><p>You have to extend this class for it to be useful; e.g., "class Savant2_Plugin_example extends Savant2_Plugin".</p><p>$Id: Compiler.php,v 1.5 2005/08/09 22:19:39 pmjones Exp $</p></p>
28
<li><span class="field">author:</span> Paul M. Jones <<a href="mailto:pmjones@ciaweb.net">pmjones@ciaweb.net</a>></li>
31
Located in <a class="field" href="_lib---Savant2---Savant2_Compiler_basic.php.html">/lib/Savant2/Savant2_Compiler_basic.php</a> (line <span class="field">72</span>)
35
<pre><a href="../Savant2/Savant2_Compiler.html">Savant2_Compiler</a>
37
--Savant2_Compiler_basic</pre>
44
<a name="sec-var-summary"></a>
45
<div class="info-box">
46
<div class="info-box-title">Variable Summary</span></div>
48
<a href="#sec-description">Description</a> |
49
<span class="disabled">Vars</span> (<a href="#sec-vars">details</a>)
51
<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
54
<div class="info-box-body">
55
<div class="var-summary">
56
<div class="var-title">
57
<span class="var-type">array</span>
58
<a href="#$allowedFunctions" title="details" class="var-name">$allowedFunctions</a>
60
<div class="var-title">
61
<span class="var-type">array</span>
62
<a href="#$allowedStatic" title="details" class="var-name">$allowedStatic</a>
64
<div class="var-title">
65
<span class="var-type">string</span>
66
<a href="#$compileDir" title="details" class="var-name">$compileDir</a>
68
<div class="var-title">
69
<span class="var-type">array</span>
70
<a href="#$convert" title="details" class="var-name">$convert</a>
72
<div class="var-title">
73
<span class="var-type">bool</span>
74
<a href="#$forceCompile" title="details" class="var-name">$forceCompile</a>
76
<div class="var-title">
77
<span class="var-type">array</span>
78
<a href="#$prefix" title="details" class="var-name">$prefix</a>
80
<div class="var-title">
81
<span class="var-type">bool</span>
82
<a href="#$strict" title="details" class="var-name">$strict</a>
84
<div class="var-title">
85
<span class="var-type">array</span>
86
<a href="#$suffix" title="details" class="var-name">$suffix</a>
92
<a name="sec-method-summary"></a>
93
<div class="info-box">
94
<div class="info-box-title">Method Summary</span></div>
96
<a href="#sec-description">Description</a> |
97
<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
100
<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
102
<div class="info-box-body">
103
<div class="method-summary">
105
<div class="method-definition">
106
<span class="method-result">Savant2_Compiler_basic</span>
107
<a href="#Savant2_Compiler_basic" title="details" class="method-name">Savant2_Compiler_basic</a>
108
([<span class="var-type"></span> <span class="var-name">$conf</span> = <span class="var-default">array()</span>])
110
<div class="method-definition">
111
<span class="method-result">void</span>
112
<a href="#allowedFunctions" title="details" class="method-name">allowedFunctions</a>
115
<div class="method-definition">
116
<span class="method-result">void</span>
117
<a href="#allowedStatic" title="details" class="method-name">allowedStatic</a>
120
<div class="method-definition">
121
<span class="method-result">array</span>
122
<a href="#analyze" title="details" class="method-name">analyze</a>
123
(<span class="var-type"></span> <span class="var-name">&$php</span>)
125
<div class="method-definition">
126
<span class="method-result">void</span>
127
<a href="#changed" title="details" class="method-name">changed</a>
128
(<span class="var-type"></span> <span class="var-name">$tpl</span>)
130
<div class="method-definition">
131
<span class="method-result">void</span>
132
<a href="#compile" title="details" class="method-name">compile</a>
133
(<span class="var-type"></span> <span class="var-name">$tpl</span>)
135
<div class="method-definition">
136
<span class="method-result">void</span>
137
<a href="#getPath" title="details" class="method-name">getPath</a>
138
(<span class="var-type"></span> <span class="var-name">$tpl</span>)
140
<div class="method-definition">
141
<span class="method-result">void</span>
142
<a href="#saveCompiled" title="details" class="method-name">saveCompiled</a>
143
(<span class="var-type"></span> <span class="var-name">$tpl</span>, <span class="var-type"></span> <span class="var-name">$php</span>)
149
<a name="sec-vars"></a>
150
<div class="info-box">
151
<div class="info-box-title">Variables</div>
152
<div class="nav-bar">
153
<a href="#sec-description">Description</a> |
154
<a href="#sec-var-summary">Vars</a> (<span class="disabled">details</span>)
158
<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
161
<div class="info-box-body">
162
<a name="var$allowedFunctions" id="$allowedFunctions"><!-- --></A>
165
<div class="var-header">
166
<span class="var-title">
167
<span class="var-type">array</span>
168
<span class="var-name">$allowedFunctions</span>
169
= <span class="var-default">array()</span> (line <span class="line-number">160</span>)
173
<!-- ========== Info from phpDoc block ========= -->
174
<p class="short-description">The list of allowed functions when in restricted mode.</p>
176
<li><span class="field">access:</span> public</li>
184
<a name="var$allowedStatic" id="$allowedStatic"><!-- --></A>
185
<div class="evenrow">
187
<div class="var-header">
188
<span class="var-title">
189
<span class="var-type">array</span>
190
<span class="var-name">$allowedStatic</span>
191
= <span class="var-default">array()</span> (line <span class="line-number">173</span>)
195
<!-- ========== Info from phpDoc block ========= -->
196
<p class="short-description">The list of allowed static methods when in restricted mode.</p>
198
<li><span class="field">access:</span> public</li>
206
<a name="var$compileDir" id="$compileDir"><!-- --></A>
209
<div class="var-header">
210
<span class="var-title">
211
<span class="var-type">string</span>
212
<span class="var-name">$compileDir</span>
213
= <span class="var-default"> null</span> (line <span class="line-number">186</span>)
217
<!-- ========== Info from phpDoc block ========= -->
218
<p class="short-description">The directory where compiled templates are saved.</p>
220
<li><span class="field">access:</span> public</li>
228
<a name="var$convert" id="$convert"><!-- --></A>
229
<div class="evenrow">
231
<div class="var-header">
232
<span class="var-title">
233
<span class="var-type">array</span>
234
<span class="var-name">$convert</span>
235
= <span class="var-default">array(<br /> <br /> // branching<br /> '(if\s*(.+):)' => '$1',<br /> '(elseif\s*(.+):)' => '$1',<br /> '(else\s*(.+):)' => '$1',<br /> '(endif)' => '$1',<br /> '(switch\s*(.+):)' => '$1',<br /> '(case\s*(.+):)' => '$1',<br /> '(default:)' => '$1',<br /> '(endswitch)' => '$1',<br /> '(break)' => '$1',<br /> <br /> // looping<br /> '(foreach\s*(.+):)' => '$1',<br /> '(endforeach)' => '$1',<br /> '(for\s*(.+):)' => '$1',<br /> '(endfor)' => '$1',<br /> '(while\s*(.+):)' => '$1',<br /> '(endwhile)' => '$1',<br /> '(continue)' => '$1',<br /> <br /> // simple variable printing<br /> '(\$(.+))' => 'print $1',<br /> <br /> // extended printing<br /> '(\:(.+))' => 'print ($2)',<br /> <br /> // comments<br /> '\*(.*)?\*' => '/**$1*/',<br /> <br /> // template includes<br /> 'tpl (.*)' => 'include $this->findTemplate($1)',<br /> <br /> // plugins<br /> '\[\s*(.+)?\s*\]' => '$this->plugin($1)',<br /> )</span> (line <span class="line-number">111</span>)
239
<!-- ========== Info from phpDoc block ========= -->
240
<p class="short-description">The conversion regular expressions.</p>
242
<li><span class="field">access:</span> public</li>
250
<a name="var$forceCompile" id="$forceCompile"><!-- --></A>
253
<div class="var-header">
254
<span class="var-title">
255
<span class="var-type">bool</span>
256
<span class="var-name">$forceCompile</span>
257
= <span class="var-default"> false</span> (line <span class="line-number">199</span>)
261
<!-- ========== Info from phpDoc block ========= -->
262
<p class="short-description">Whether or not to force every template to be compiled every time.</p>
264
<li><span class="field">access:</span> public</li>
272
<a name="var$prefix" id="$prefix"><!-- --></A>
273
<div class="evenrow">
275
<div class="var-header">
276
<span class="var-title">
277
<span class="var-type">array</span>
278
<span class="var-name">$prefix</span>
279
= <span class="var-default"> '{'</span> (line <span class="line-number">85</span>)
283
<!-- ========== Info from phpDoc block ========= -->
284
<p class="short-description">The template directive prefix.</p>
286
<li><span class="field">access:</span> public</li>
294
<a name="var$strict" id="$strict"><!-- --></A>
297
<div class="var-header">
298
<span class="var-title">
299
<span class="var-type">bool</span>
300
<span class="var-name">$strict</span>
301
= <span class="var-default"> false</span> (line <span class="line-number">216</span>)
305
<!-- ========== Info from phpDoc block ========= -->
306
<p class="short-description">Whether or not to strict-check the compiled template.</p>
307
<p class="description"><p>Strict-checks are off by default until all problems with PhpCodeAnalyzer have been resolved.</p></p>
309
<li><span class="field">access:</span> public</li>
317
<a name="var$suffix" id="$suffix"><!-- --></A>
318
<div class="evenrow">
320
<div class="var-header">
321
<span class="var-title">
322
<span class="var-type">array</span>
323
<span class="var-name">$suffix</span>
324
= <span class="var-default"> '}'</span> (line <span class="line-number">98</span>)
328
<!-- ========== Info from phpDoc block ========= -->
329
<p class="short-description">The template directive suffix.</p>
331
<li><span class="field">access:</span> public</li>
b'\t\t\t\t\t\t\t<h4>Inherited Variables</h4>'
340
<A NAME='inherited_vars'><!-- --></A>
341
<p>Inherited from <span class="classname"><a href="../Savant2/Savant2_Compiler.html">Savant2_Compiler</a></span></p>
343
<span class="var-title">
344
<span class="var-name"><a href="../Savant2/Savant2_Compiler.html#var$Savant">Savant2_Compiler::$Savant</a></span><br>
351
<a name="sec-methods"></a>
352
<div class="info-box">
353
<div class="info-box-title">Methods</div>
354
<div class="nav-bar">
355
<a href="#sec-description">Description</a> |
356
<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
357
<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
360
<div class="info-box-body">
361
<A NAME='method_detail'></A>
363
<a name="methodSavant2_Compiler_basic" id="Savant2_Compiler_basic"><!-- --></a>
366
<div class="method-header">
367
<span class="method-title">Constructor Savant2_Compiler_basic</span> (line <span class="line-number">225</span>)
370
<!-- ========== Info from phpDoc block ========= -->
371
<p class="short-description">Constructor.</p>
373
<div class="method-signature">
374
<span class="method-result">Savant2_Compiler_basic</span>
375
<span class="method-name">
376
Savant2_Compiler_basic
378
([<span class="var-type"></span> <span class="var-name">$conf</span> = <span class="var-default">array()</span>])
381
<ul class="parameters">
383
<span class="var-type"></span>
384
<span class="var-name">$conf</span> </li>
389
<a name="methodallowedFunctions" id="allowedFunctions"><!-- --></a>
390
<div class="evenrow">
392
<div class="method-header">
393
<span class="method-title">allowedFunctions</span> (line <span class="line-number">628</span>)
396
<!-- ========== Info from phpDoc block ========= -->
397
<p class="short-description">A list of allowed functions for templates.</p>
399
<div class="method-signature">
400
<span class="method-result">void</span>
401
<span class="method-name">
410
<a name="methodallowedStatic" id="allowedStatic"><!-- --></a>
413
<div class="method-header">
414
<span class="method-title">allowedStatic</span> (line <span class="line-number">616</span>)
417
<!-- ========== Info from phpDoc block ========= -->
418
<p class="short-description">A list of allowed static method calls for templates.</p>
419
<p class="description"><p>The format is ...</p><p>array( 'Class1' => array('method1', 'method2'), 'Class2' => array('methodA', 'methodB'), 'Class3' => '*' );</p><p>If you want to allow all methods from the static class to be allowed, use a '*' in the method name list.</p></p>
421
<div class="method-signature">
422
<span class="method-result">void</span>
423
<span class="method-name">
432
<a name="methodanalyze" id="analyze"><!-- --></a>
433
<div class="evenrow">
435
<div class="method-header">
436
<span class="method-title">analyze</span> (line <span class="line-number">405</span>)
439
<!-- ========== Info from phpDoc block ========= -->
440
<p class="short-description">Analyze a compiled template for restriction violations.</p>
442
<li><span class="field">var:</span> The compiled PHP code from a template source.</li>
443
<li><span class="field">return:</span> An array of restriction violations; if empty, then there were no violations discovered by analysis.</li>
444
<li><span class="field">access:</span> public</li>
447
<div class="method-signature">
448
<span class="method-result">array</span>
449
<span class="method-name">
452
(<span class="var-type"></span> <span class="var-name">&$php</span>)
455
<ul class="parameters">
457
<span class="var-type"></span>
458
<span class="var-name">&$php</span> </li>
463
<a name="methodchanged" id="changed"><!-- --></a>
466
<div class="method-header">
467
<span class="method-title">changed</span> (line <span class="line-number">244</span>)
470
<!-- ========== Info from phpDoc block ========= -->
471
<p class="short-description">Has the source template changed since it was last compiled?</p>
473
<li><span class="field">var:</span> The source template file.</li>
474
<li><span class="field">access:</span> public</li>
477
<div class="method-signature">
478
<span class="method-result">void</span>
479
<span class="method-name">
482
(<span class="var-type"></span> <span class="var-name">$tpl</span>)
485
<ul class="parameters">
487
<span class="var-type"></span>
488
<span class="var-name">$tpl</span> </li>
493
<a name="methodcompile" id="compile"><!-- --></a>
494
<div class="evenrow">
496
<div class="method-header">
497
<span class="method-title">compile</span> (line <span class="line-number">314</span>)
500
<!-- ========== Info from phpDoc block ========= -->
501
<p class="short-description">Compiles a template source into PHP code for Savant.</p>
503
<li><span class="field">var:</span> The source template file.</li>
504
<li><span class="field">access:</span> public</li>
507
<div class="method-signature">
508
<span class="method-result">void</span>
509
<span class="method-name">
512
(<span class="var-type"></span> <span class="var-name">$tpl</span>)
515
<ul class="parameters">
517
<span class="var-type"></span>
518
<span class="var-name">$tpl</span> </li>
521
<hr class="separator" />
522
<div class="notes">Redefinition of:</div>
524
<dt><a href="../Savant2/Savant2_Compiler.html#methodcompile">Savant2_Compiler::compile()</a></dt>
525
<dd>Stub method for extended behaviors.</dd>
529
<a name="methodgetPath" id="getPath"><!-- --></a>
532
<div class="method-header">
533
<span class="method-title">getPath</span> (line <span class="line-number">294</span>)
536
<!-- ========== Info from phpDoc block ========= -->
537
<p class="short-description">Gets the path to the compiled PHP for a template source.</p>
539
<li><span class="field">var:</span> The source template file.</li>
540
<li><span class="field">access:</span> public</li>
543
<div class="method-signature">
544
<span class="method-result">void</span>
545
<span class="method-name">
548
(<span class="var-type"></span> <span class="var-name">$tpl</span>)
551
<ul class="parameters">
553
<span class="var-type"></span>
554
<span class="var-name">$tpl</span> </li>
559
<a name="methodsaveCompiled" id="saveCompiled"><!-- --></a>
560
<div class="evenrow">
562
<div class="method-header">
563
<span class="method-title">saveCompiled</span> (line <span class="line-number">271</span>)
566
<!-- ========== Info from phpDoc block ========= -->
567
<p class="short-description">Saves the PHP compiled from template source.</p>
569
<li><span class="field">var:</span> The source template file.</li>
570
<li><span class="field">access:</span> public</li>
573
<div class="method-signature">
574
<span class="method-result">void</span>
575
<span class="method-name">
578
(<span class="var-type"></span> <span class="var-name">$tpl</span>, <span class="var-type"></span> <span class="var-name">$php</span>)
581
<ul class="parameters">
583
<span class="var-type"></span>
584
<span class="var-name">$tpl</span> </li>
586
<span class="var-type"></span>
587
<span class="var-name">$php</span> </li>
592
<h4>Inherited Methods</h4>
593
<a name='inherited_methods'><!-- --></a>
594
<!-- =========== Summary =========== -->
595
<p>Inherited From <span class="classname"><a href="../Savant2/Savant2_Compiler.html">Savant2_Compiler</a></span></p>
597
<span class="method-name"><a href="../Savant2/Savant2_Compiler.html#methodSavant2_Compiler">Savant2_Compiler::Savant2_Compiler()</a></span><br>
598
<span class="method-name"><a href="../Savant2/Savant2_Compiler.html#methodcompile">Savant2_Compiler::compile()</a></span><br>
605
<p class="notes" id="credit">
606
Documentation generated on Sun, 22 Jun 2008 00:40:52 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.1</a>
b'\\ No newline at end of file'