[wp-trac] [WordPress Trac] #17092: use dirname(__file__).'/file.php' instead of './file' for includes

WordPress Trac wp-trac at lists.automattic.com
Sat Apr 9 13:13:04 UTC 2011


#17092: use dirname(__file__).'/file.php' instead of './file' for includes
-----------------------------------+------------------------------
 Reporter:  ketwaroo               |       Owner:
     Type:  enhancement            |      Status:  new
 Priority:  normal                 |   Milestone:  Awaiting Review
Component:  General                |     Version:  3.1.1
 Severity:  minor                  |  Resolution:
 Keywords:  has-patch 2nd-opinion  |
-----------------------------------+------------------------------

Comment (by ketwaroo):

 for example.

 wrapper.php in /path/to/site1.com/htdocs
 {{{
   define ('COREDIR','/path/to/wordpress/');
   // do some wrapper stuff
    include COREDIR.'/index.php';

 }}}

 index.php
 {{{
   require('./wp-blog-header.php');
 }}}

 A fatal error occurs as index.php is looking for wp-blog-header.php in
 /path/to/site1.com/htdocs. and as you said, ./ skips include_path so I
 can't set it in the wrapper.

 It's a rare case scenario, but still.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/17092#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list