October 12th, 2005, 03:06 AM
PHP and symlinking....
This is something I've been wondering for a while... I've worked with PHP frameworks that map virtuall sub-directories to functions within certain PHP scripts, so (for instance) /main/edit/ might resolve to some function editMain() in some file.
Any idea how to implement this?
October 12th, 2005, 03:33 AM
I'm not sure I understand what it is you're trying to do. You want to have a directory name corospond to a function in PHP? For example if you had /this/function/ it would run thisfunction()?
You might be able to get it working with a mixture of PHP's FILE functions, and regexp, but you'd have to run loads of security checks, because if not, it might be possible to exploit it and do bad things. We all know, bad things are bad.
Or are you asking what use this would be? It would be useful if you want to run certian tasks on certian files or directories clearing a temp file, makeing entries every time something happens to a file or dir, etc. It's even possible to do dynamic functions in PHP.
Anyway, hopefully that helped, sorry if it didn't, some elaboration might help.