Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

#30881 [Opn]: C++ like include (path/search) in PHP?
ID:               30881
Updated by:       vrana@php.net
Reported By:      ovdspek at liacs dot nl
Status:           Open
Bug Type:         Documentation problem
Operating System: Debian Linux Sarge
PHP Version:      4.3.9
New Comment:

You are right, documentation is not absolutely clear. Documented
behavior is valid only if you don't go to upper directory in include.

b/2.php: <?php include "c/3.php"; ?>
b/c/3.php: b/c/3
`php b/2.php` works as documented - prints b/c/3 (if c/3.php doesn't
exist).

I will update the docs.


Previous Comments:
------------------------------------------------------------------------

[2004-11-26 11:39:05] ovdspek at liacs dot nl

> Current working
directory can be something different than directory of a script.

I understand, but apparently your implementation doesn't.
Why else would "include('../1.php');" fail?

------------------------------------------------------------------------

[2004-11-26 11:29:43] vrana@php.net

"Files for including are first looked in include_path relative to the
current working directory and then in include_path relative to the
directory of current script." in include() page. Current working
directory can be something different than directory of a script.

------------------------------------------------------------------------

[2004-11-26 11:10:37] ovdspek at liacs dot nl

So exactly where is that documented?
At http://php.net/include/ I see no exceptions for CLI and at
http://php.net/manual/en/features.commandline.php I see no exceptions
for include.

It does say "It does not change the working directory to that of the
script. (-C and --no-chdir switches kept for compatibility)", but
that's not relevant, as the include docs say it searches the directory
of the current script, not the current working directory.
If your implementation relies on the current working directory being
the directory of the current script, then your implementation (of this
docs/specs) is wrong.

------------------------------------------------------------------------

[2004-11-26 10:53:51] tony2001@php.net

>In that case, please update your documentation so it
>doesn't say it'll search relative to the directory of
>current script.
All SAPIs except CLI DO search relative to the directory of current
running script.
But you're using CLI and this feature is documented too.

------------------------------------------------------------------------

[2004-11-26 10:12:22] ovdspek at liacs dot nl

In that case, please update your documentation so it doesn't say it'll
search relative to the directory of current script.

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/30881

--
Edit this bug report at http://bugs.php.net/?id=30881&edit=1

Report this thread to moderator Post Follow-up to this message
Old Post
vrana@php.net
11-26-04 09:07 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Documentation archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:42 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.