Re: Xaraya_user Digest, Vol 46, Issue 7

jojodee <jojodee-8nna1qhvBBM9QQeoy3GH/[email protected]> Mon, 23 Jun 2008 07:32:54 +0930
Newsgroups gmane.comp.cms.xaraya.user
Organization Xaraya
Message-ID <[email protected]>
Mark Frawley wrote:
> I just encountered this problem - Jojo's fix worked for me fine, I
> prefer the following syntax however:
> 
> -    $tplData['_bl_data'] = $tplData;
> +
>      extract($tplData, EXTR_OVERWRITE);
> +    $_bl_data = $tplData;

It is nicer and also different result. However I couldn't vouch with 
certainty that this doesn't overwrite a required value so I picked a 
safer path until someone can vouch.
''''

> Instead of using assertions which are
> configuration dependent and not recommended by the PHP manual for
> param checking, there should be type checking and/or exceptions thrown
> if tplData is not an array.

I wouldn't use assertions if it could be helped,I agree  and type 
checking should be encouraged and is used where applicable. Those 
assertions in the code have been there a while and for the purpose of 
picking up results of incorrect logic not to specifically check vars; 
part of debugging i'm assuming. Should be taken out when that process is 
agreed as fixed, but I wouldn't take them out until proper type checking 
and flow of logic through all those functions is corrected. Not such a 
small task.

The cost of duplication of a variable is also discussed on the forum in 
the related thread.

Any time donated to review and rewrite all the related functions for 
eventual removal of eval i'm sure would be useful for 1x uers. The task 
was earmarked for xaraya 2x and some work has been done there afaik.

cheers
Jo


> Mark
> 
> 

-- 
http://xarigami.com :: Creative web development with Xaraya
http://2skies.com   :: Open source hosting and development