note 72441 added to function.include

From: Date: Thu, 18 Jan 2007 21:49:15 +0000
Subject: note 72441 added to function.include
Groups: php.notes 
Request: Send a blank email to php-notes+get-121903@lists.php.net to get a copy of this message
When I'm dealing with a package that uses relative includes of its own, rather than modify all of their includes, I found it was easier to change PHP's working directory before and after the include, like so: <? $wd_was = getcwd(); chdir("/path/to/included/app"); include("mainfile.php"); chdir($wd_was); ?> This way neither my includes nor theirs are affected; they all work as expected. ---- Server IP: 216.194.113.175 Probable Submitter: 24.8.1.144 ---- Manual Page -- http://www.php.net/manual/en/function.include.php Edit -- https://master.php.net/note/edit/72441 Del: integrated -- https://master.php.net/note/delete/72441/integrated Del: useless -- https://master.php.net/note/delete/72441/useless Del: bad code -- https://master.php.net/note/delete/72441/bad+code Del: spam -- https://master.php.net/note/delete/72441/spam Del: non-english -- https://master.php.net/note/delete/72441/non-english Del: in docs -- https://master.php.net/note/delete/72441/in+docs Del: other reasons-- https://master.php.net/note/delete/72441 Reject -- https://master.php.net/note/reject/72441 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#121903) next »