On Tue, 14 May 2002, 1LT John W. Holmes wrote: > ----- Original Message ----- > From: "Miguel Cruz" <[EMAIL PROTECTED]> >> On Tue, 14 May 2002, Collins, Robert wrote: >>> $core_functions = >>> "http://www.domain.com/path/to/file/core_functions.php"; >>> require_once($core_functions); >> >> 1) You'd have to eval() it rather than requiring it. > > I don't think you can eval() a remote file.
I didn't provide code, but the idea was that you'd read the remote file into a string and then eval it. Though, now, upon reading the documentation for include(), I see that you can just do that without all my eval nonsense. >> 2) lynx -source -dump > http://www.domain.com/path/to/file/core_functions.php > core_functions.php > > All this will do is return you the HTML generated by the PHP file, which > will be empty, probably, if this is a file of function declarations. Yes, fair enough, in order for the above (eval / require) to work as described, the server would have to be willing to hand you the PHP source. Which, in many cases, wouldn't happen with a .php suffix. Anyway, the point is that anything that you can require() or include() or whatever off a remote server, can also be fetched with other tools for leisurely inspection and duplication. >> 3) As in Jason's somewhat more effective example, it's slow. > > Could you imagine if this worked? You could "include" code from anyone's PHP > server. Someone please correct me if I've just got this all wrong. Jason's example was just a slightly ornate form of RPC. I don't see any reason why it wouldn't work, I just think it introduces performance problems and failure points and therefore isn't an optimal solution. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php