On Tue, Jan 21, 2003 at 05:02:06PM +0100, Armand A. Verstappen wrote:

> On Tue, 2003-01-21 at 12:39, Anatol Mayr / HEXAGON wrote:
> > I use "mgd_eval" to make it possible to use php-code in templates.
> > I've made redhat73-rpms for midgard-1.4.4 but it seems as if this
> > function is not available in 1.4.4 or it is undocumented.
> > The OO-PHP-classes I use work fine with midgard 1.4.1 and midgard 1.4.3.
> 
> mgd_eval is made available through a configure switch:
> 
>   --with-eval-hack        Hack to change eval into mgd_eval on the fly.
>                           Discouraged, but necesary for backwards
> compatibility,
>                           and therefore enabled by default.
> 
> ... and sticking to that default gives me a working mgd_eval overhere.

mgd_eval is available if you compile midgard-php --with-old-mod-midgard
(enabled by default). If you use MMP (and thus the preparser in
midgard-lib), mgd_eval is a 'language construct' that is morphed into
a regular eval call during parsing:

$ echo '<?php mgd_eval("some code"); ?>' | midgard-preparse
<?php eval(' ?>'.mgd_preparse('<?php '."some code".' ?>').'<?php '); ?>

If you have --with-eval-hack, 

$ echo '<?php eval("some code"); ?>' | midgard-preparse

will yield the same. Without it, the preparser won't touch regular
evals (which is why it's enabled by default).

Emile

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to