|
Posted by Alan Little on 05/15/06 12:59
Carved in mystic runes upon the very living rock, the last words of
Chung Leong of comp.lang.php make plain:
> Alan Little wrote:
>> OK. When you said, "using includes as functions", I took it to mean
>> having a bit of code that's called from various places in the main
>> code, and putting it in an included file, rather than a function. I
>> once had a date-selector generator that I did that with, but long ago
>> converted it to a function. I'm not trying to be a smart@$$, I just
>> didn't see how that applied to plugins.
>
> Whether the code is included once or many times is unimportant. The
> key deficencies of includes are the lack of a clear interface and the
> lack of variable scoping. For your plug-ins, how are the authors
> supposed to know what variables are available? I mean their code would
> just inherit the entire global scope. How do you prevent them from
> accidently overwriting variables?
Good points. So far I've been the only one to write plugins, so it hasn't
been a problem, and I've considered operating in the global scope a plus.
Of course, a lot of what we've discussed in this thread is moot, as far
as Phorm is concerned. The next release will be v4, which is a complete
re-build from the ground up, and is done as a class, so things are much
more encapsulated.
But you've certainly given me some things to think about. Thanks.
--
Alan Little
Phorm PHP Form Processor
http://www.phorm.com/
[Back to original message]
|