EHS Blog
Home  
 
 
  Previous 10 Posts
  - Chunk_split() Overflow not fixed at all...
  - What site do you want to break today?
  - BlogSecurity Interview
  - About the CSRF Redirector
  - More CSRF Redirectors
  - MOPB Exploits taken down
  - HTML Purifier
  - Planet Web Security
  - iPhone Security Concern
  - CSRF Redirector
   

 
Categories


Web Hosting
Website Design
PHP
Perl
JSP
   

 
Archives

No Records !!!
   
 

 
dirname(__FILE__)
at 2007-08-12 15:10:22

This expression - dirname(__FILE__) - is used in a real lot of places. The reason is simple - libraries want to include files relative to library top directory, and do not want to count on include path. And relative include resolution rules in PHP not clear to all, so people prefer to be sure. The downside here is that this expression is dynamic - executed at run-time. Meaning it’s slower and less toolable and also makes a bad habit of putting dynamic things into include (which is not a problem here, since it’s “static dynamic” thing, but still a bad habit).

So why won’t we have constant that would mean dirname(__FILE__)? Something like __FILEDIR__. Would make a lot of code cleaner.

The problem with it of course to make real use in code we should travel back in time to 1996 and add it there :)



Blog Source - http://php100.wordpress.com/feed/
 


Check Out Amazon