Edit report at https://bugs.php.net/bug.php?id=60075&edit=1

 ID:                 60075
 Comment by:         ly...@php.net
 Reported by:        paul dot a dot norman at gmail dot com
 Summary:            using -t /myPath does not add /myPath to
                     include_path
 Status:             Assigned
 Type:               Feature/Change Request
 Package:            Built-in web server
 Operating System:   Win32
 PHP Version:        5.4.0beta1
 Assigned To:        moriyoshi
 Block user comment: N
 Private report:     N

 New Comment:

You don't need a new flag.

php -B ini_set('include_path', get_include_path() . PATH_SEPARATOR . '/myPath')

NOTE:
Never used -B, so maybe you need "" around it or whatever, but you get the 
point.


Previous Comments:
------------------------------------------------------------------------
[2012-03-08 05:09:14] reeze dot xia at gmail dot com

Hi, Stuart

    I think add doc-root to include_path may impact the behavior of your 
application, because this changes the include path of your application too. 
maybe some application didn't add docroot to it's include_path , but the server 
add it. (include require autoload etc.).

    if you just want to set router script easily, I don't think it deserve the 
change.  And this behavior different with the way we use cli tools:
ie:
$ ls -l file.php
just print the information of  $PWD's file.php but not some other folder's 
file.php. This is confusing

If we want to add include path maybe a new option like -I /new/include/path 
maybe useful.

so -1 for me ;-)

Thanks.
reeze

------------------------------------------------------------------------
[2012-03-04 18:04:05] stuart at 3ft9 dot com

This is my first patch so I may have missed something. This patch simply 
prepends 
the document root to include_path for each request.

------------------------------------------------------------------------
[2011-10-17 07:59:21] paul dot a dot norman at gmail dot com

Description:
------------
If the php internal server is launched using php -S localhost:8001 -t /myPath 
server_process.php

and server_process.php is in /myPath the following would result

Warning: Unknown: failed to open stream: No such file or directory in Unknown 
on 
line 0

Fatal error: Unknown: Failed opening required 'server_process.php' 
(include_path='.;C:\php\pear') in Unknown on line 0

Obviously using: ... -t /myPath /myPath/server_process.php
works as expected, 

but it would seem intuitive that when using: 

php -S localhost:8001 -t something

that "something" would be automatically added to the include_path ?

P.S. the php internal server is a brilliant addition, facilitates making 
virtual 
desktop applications in the browser a cinch! Allows the leveraging of browser 
technology jQuery and all the rest with php on the client -- very powerful!!!

Add in http://gluescript.sourceforge.net/ http://gtk.php.net/ or simillar for 
local wxWdiget dialogues called as necessary from php 
http://php.net/manual/en/function.system.php and an almost complete powerful  
solution is available.

Paul




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



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

Reply via email to