mod_pinp
PINP Is Not PHP, its a subset of PHP for safe online programming.
PINP is an extensible subset of PHP. You can use any expression and control structure of PHP and most of the array, string, date, time and regular expression functions of PHP. Furthermore you can easily add other functions to the language, since all you need to do is tell the PINP compiler that a function is allowed for it to be used.
In Ariadne PINP is used in object templates. The PINP compiler takes an object template and rewrites it. It prepends variables with $this-> and unknown functions with $this->_. e.g.:
$data->name |
-> | $this->data->name |
$path |
-> | $this->path |
get($parent,'show.name.phtml'); |
-> | $this->_get($this->parent, |
etc.
In the class definition of pobject and others, 'safe' functions for use in object templates are therefor prepended with an underscore ('_'). A full list of these safe functions can be found in the class reference at each class.
PINP code must be contained in special code tags, <pinp>
and </pinp>
. All other code tags corresponding with PHP code are removed, including their contents. e.g. <?php ?>
, <% %>
, <script language="php"></script>
, etc.
Besides these Ariadne specific functions, PINP allows a number of often used PHP functions. The current list of available functions, with links to the corresponding section in the online PHP manual:
control structures:
if, while, for, switch, break, continue
array functions:
array, array_count_values, array_flip, array_keys, array_merge, array_pad, array_pop, array_push, array_reverse, array_shift, array_slice, array_splice, array_unshift, array_values, array_walk, arsort, asort, count, current, each, end, in_array, key, krsort, ksort, list, next, pos, prev, range, reset, rsort, shuffle, sizeof, sort
string functions:
AddSlashes, bin2hex, Chop, Chr, chunk_split, convert_cyr_string, crypt, echo, explode, flush, get_html_translation_table, htmlentities, htmlspecialchars, implode, join, ltrim, md5, Metaphone, nl2br, Ord, print, printf, quoted_printable_decode, QuoteMeta, rawurldecode, rawurlencode, setlocale, similar_text, soundex, sprintf, strcasecmp, strchar, strcmp, strcspn, strip_tags, StripCSlashes, StripSlashes, stristr, strlen, strpos, strrchr, str_repeat, strrev, strrpos, strspn, strstr, strtok, strtolower, strtoupper, str_replace, strtr, substr, substr_replace, trim, ucfirst, ucwords
math functions:
abs, acos, asin, atan, atan2, base_convert, bindec, ceil, cos, decbin, dechex, decoct, exp, floor, getrandmax, hexdec, log, log10, max, min, mt_rand, mt_srand, mt_getrandmax, number_format, octdec, pi, pow, rand, round, sin, sqrt, srand, tan
Variable functions:
doubleval, empty, gettype, intval, is_array, is_double, is_float, is_int, is_integer, is_long, is_object, is_real, is_string, isset, settype, strval, unset
date en time functions:
checkdate, date, getdate, gettimeofday, gmdate, gmmktime, gmstrftime, microtime, mktime, strftime, time, easter_days, easter_date
regular expressions:
ereg, ereg_replace, eregi, eregi_replace, split