Commit Graph

411 Commits

Author SHA1 Message Date
foobar
92279e5e06 MFB 2003-02-14 14:38:20 +00:00
Marcus Boerger
aa8dfa0b74 fix non FCGI build 2003-02-13 19:46:40 +00:00
Shane Caraveo
a13ef6ec42 There is *absolutely no* definitive way to know if argv0 is the
actual php script, or if it is the beginning of a query string.
Additionaly, passing parameters on the command line is
not part of CGI spec, and is not required by either
Apache or IIS.  So I have removed that code altogether,
and done some further cleanup.  Also fix pre4.3 behaviour if fix_pathinfo=0.
I've tested with IIS and Apache 1.3.27 on w2k and RH 7.3.
2003-02-13 18:21:12 +00:00
Shane Caraveo
1a4c82e014 fix bug 21261
putenv on some platforms requires we provide the memory
    cleanup env parsing logic
fix bug 21367
    missed optargs in a previous patch
2003-01-25 22:01:53 +00:00
Ilia Alshanetsky
5de9962d50 Fixed bug #21297. The fix also fixes miscalculation of lines numbers by 1
due the previously mentioned bug.
2003-01-08 00:41:53 +00:00
Zeev Suraski
6591b9c826 Add missing call 2003-01-07 16:33:28 +00:00
Zeev Suraski
19d47d9f6e Initialize lineno using the new infrastructure 2003-01-05 16:10:35 +00:00
Sebastian Bergmann
2c5d4b8c23 Bump year. 2002-12-31 15:59:15 +00:00
George Schlossnagle
190867c800 fixed ws 2002-12-25 21:18:37 +00:00
George Schlossnagle
abbf745211 fix for 21177 2002-12-25 20:38:37 +00:00
Stefan Esser
66ebbb5ae1 fix compile warning 2002-12-24 23:46:17 +00:00
Shane Caraveo
75cbbfacb1 fix use of Alias under apache by defaulting script_name to redirect_url
dont lstat, stat.
2002-12-02 02:16:38 +00:00
Shane Caraveo
a3bd39429c Fix CGI to match cgi spec.
This patch properly fixes support for CGI in PHP.  For backwards compatible
broken behaviour, cgi.fix_pathinfo can be set to zero in php.ini.
CGI failed to work under apache at all, either using the cgi-script directive
or as a ScriptAlias setup. Typicaly it would try to parse itself.  This will
still happen if you dissable fix_pathinfo, and set DISCARD_PATH.
This also fixes PATH_INFO, and finally we can run pres2 under cgi or fastcgi.
This patch has been tested under Apache 1.3, 2.0, IIS, as both cgi and fastcgi,
on Windows and OSX.  A followup patch with build stuff for linux will follow.
2002-12-01 21:37:14 +00:00
foobar
dd53efc196 - Made the STANDARD_SAPI_MODULE_PROPERTIES be what it says it is. 2002-11-26 05:57:06 +00:00
Shane Caraveo
95b4045f48 configure now supports building the cgi-fcgi module
configure --enable-fastcgi
2002-11-26 05:51:16 +00:00
Edin Kadribasic
81711ba621 Avoid possible buffer overflow. 2002-11-22 15:47:39 +00:00
Edin Kadribasic
fd47c5bb32 MFB: Don't send default http status (200). 2002-11-22 13:55:27 +00:00
Edin Kadribasic
714a5be6cc Fixed bug #19207 by adding cgi.rfc2616_headers configuration directive. 2002-11-22 10:15:47 +00:00
Andrei Zmievski
ca332dfc96 Oops. 2002-11-15 00:32:42 +00:00
Andrei Zmievski
3e8a800a96 Fix function prototype. 2002-11-15 00:31:10 +00:00
Andrei Zmievski
e09d62c435 Sort the modules and extensions before printing them when -m switch is used. 2002-11-14 20:32:28 +00:00
Marcus Boerger
cecb9dfc79 Implemented -n switch to skip parsing ini at startup as suggested by Wez.
#The switch 'n' was planned to be used for beautifying....delete n to make
#clear these functions do not have a switch yet.
2002-11-12 20:56:47 +00:00
Hartmut Holzgraefe
cb6202bbe8 reverting accidential commit 2002-11-12 16:41:14 +00:00
Hartmut Holzgraefe
0c395d0f4c *** empty log message *** 2002-11-12 16:37:47 +00:00
Ilia Alshanetsky
64f77577f0 Fixed bug #20035. ZE now allows us to pass the current line position by
setting zend_lineno to (current_line * -1).
2002-11-05 22:04:12 +00:00
Derick Rethans
d82565fb7a - Fix build
#- Jan, please TEST! before committing :-)
2002-10-25 14:33:46 +00:00
Jan Lehnardt
ed29169f91 - alphabetcial output for php -h (cgi)
- cosmetics
2002-10-25 09:28:55 +00:00
Sascha Schumann
2909e5c9c9 centralize #include "build-defs.h" and drop (sometimes inconsistent) other
instances
2002-10-24 13:15:49 +00:00
Shane Caraveo
69f56e8c4a make fastcgi usage threadsafe, ready for future multithreaded fastcgi implementation
get rid of environment overwriting but hooking into php's environment function
set $_ENV correctly for mod_fastcgi
add -b to specify binding for fastcgi
new readme file with information for running under apache2.0 and iis
2002-10-13 09:40:44 +00:00
Zeev Suraski
d31604997b We leak quite a few things intentionally, if you want to debug it - enable
explicitly please..
2002-09-23 11:35:22 +00:00
Zeev Suraski
76312b4508 another startup initialization fix - only ISAPI and CGI SAPI's tested,
minor compile buglets might occur in other SAPIs, but should be trivial
to fix...
2002-09-18 21:57:42 +00:00
Marcus Boerger
0b25d07f15 Fix headers when default content type is used.
#THIS fixes the problems with error_log()
2002-09-04 15:30:56 +00:00
Edin Kadribasic
1fb6a30f0f Debug functions should only work in debug mode. 2002-08-19 13:46:39 +00:00
Harald Radi
e84bddf76a dump memory leaks on shutdown 2002-08-07 18:16:44 +00:00
Sascha Schumann
2c3801b979 Generate content-type header, if the user did not specify one of its own.
Noticed by: Edin Kadribasic <edink@proventum.net>
2002-07-04 08:13:19 +00:00
Sascha Schumann
b3e562f9ef Add CRLF after complete HTTP reply header 2002-07-03 11:46:37 +00:00
Sascha Schumann
99cfb41da0 Use "Status: %d" instead of "HTTP/1.0 %d X" in the CGI SAPI module
as per the CGI RFC.

The status notation is incompatible with Apache's non-parsed-header mode
"nph-*", but that has never worked before anyway.  One could make the
format string configurable.

Noticed by: Sebastian Bergmann
2002-07-03 11:44:48 +00:00
Andi Gutmans
805a1653f0 - Revert WS changes 2002-06-22 13:59:13 +00:00
Andi Gutmans
85983fe957 - This shouldn't have snuck in. 2002-06-22 13:58:32 +00:00
Andi Gutmans
4216379152 - Stop using persist_alloc(). 2002-06-22 13:53:44 +00:00
Edin Kadribasic
2d953b348a Merge from cli. 2002-05-26 13:12:30 +00:00
Edin Kadribasic
8e15de012a Added copyright notice to php -v output. 2002-05-11 14:26:30 +00:00
Zeev Suraski
5af649efbd Revert to the old php_ini.c, and reimplement the binary-path searching.
Should now also work under UNIX (CLI/CGI)
2002-05-11 03:41:17 +00:00
Markus Fischer
ccbadfc111 - Prefix the first version line with 'PHP' so it's easier to use shell tools to
parse the version number (both CLI and CGI).
2002-05-10 16:18:00 +00:00
Markus Fischer
bf351e9639 - This affects both CGI and CLI sapi:
Remove Zend version output from -m switch and move it over to the output of
  the -v switch (-v is supposed to list version numbers, not -m).
2002-05-10 16:04:03 +00:00
Preston L. Bannister
57c5998ff9 Backed out preceding change. 2002-05-09 23:33:27 +00:00
Preston L. Bannister
d706e224ac Detect when running under IIS and default force_redirect to zero. This This means an explicit php.ini setting is no longer required.
(No extraneous whitespace changes this time :).
2002-05-09 21:03:30 +00:00
foobar
42c82bb40d Revert the last patches. 2002-05-09 20:03:36 +00:00
Preston L. Bannister
06f375b1cf Detect when running under IIS and not require explicit setting of force_redirect.
This means an explicit php.ini setting is no longer required.
2002-05-09 19:32:39 +00:00
Sander Roobol
7586cdc654 Added the current SAPI to the output of php -v 2002-05-09 09:36:45 +00:00
Sander Roobol
7a64b2b7e5 Fixed some minor typos 2002-05-02 17:19:42 +00:00
Sebastian Bergmann
edba077000 Fix build. 2002-05-02 15:18:26 +00:00
James Cox
ba85302e79 updated cgi warning notice. 2002-05-02 14:55:12 +00:00
Yasuo Ohgaki
439b56842f CGI/CLI take file and dir for -c option by this.
@ Both 'file' and 'path to php.ini' is allowed for "-c" cli/cgi option. (Yasuo)
2002-04-12 00:20:29 +00:00
Wez Furlong
abc5a2cacb fix quoting 2002-04-02 16:45:10 +00:00
James Cox
99a68d4f83 just did... 2002-04-02 01:35:45 +00:00
James Cox
f3d107a180 updated the alert sent to the browser. removed the verbosity, and linked to more info. 2002-04-02 01:34:15 +00:00
Shane Caraveo
c806dca62c add security impersonation feature for running under IIS security 2002-03-18 04:48:34 +00:00
Shane Caraveo
c8f5565bf3 woohoo, take some credit! 2002-03-10 22:08:09 +00:00
Shane Caraveo
f3a60dd1a6 children should be zero by default, enable by setting PHP_FCGI_CHILDREN env var. 2002-03-10 21:52:00 +00:00
Shane Caraveo
79bb884eec combine fastcgi capability with regular cgi binary
include fastcgi library for ease of windows builds
NOTE: included fastcgi library is modified for thread safety, but
	fastcgi support in cgi_main.c is only written for single
	threaded serving.  This does not present any issue for using
	fastcgi.
2002-03-10 21:39:28 +00:00
Derick Rethans
393cbe0ac3 - Put them back (and do it right) 2002-03-06 13:25:25 +00:00
Derick Rethans
c8740575c4 - Remove unused variables 2002-03-06 11:31:56 +00:00
Shane Caraveo
db73f90953 add comment for IIS users
fix some whitespace
2002-03-01 06:34:08 +00:00
Shane Caraveo
cd18533a10 This is much better. With FORCE_CGI_REDIRECT turned on by default for compilation,
we can now define this in the ini file.  So it can be turned on for apache, turned
off for IIS which does not have a redirect issue.  Alternately, a different 'REDIRECT_STATUS'
environment var can be defined in case some web server out there needs it.

new ini vars
cgi.force_redirect 0|1
cgi.redirect_status_env ENV_VAR_NAME
2002-03-01 01:58:20 +00:00
Shane Caraveo
e2b1161ea6 fix force redirect crash under multithreaded compile
should be discused: fix redirect detection to only work with apache or netscape,
where we know they set an environment variable regarding redirect.  IIS has
no security issue here.  Don't know about other windows web servers.
2002-03-01 00:19:01 +00:00
Derick Rethans
b8a5daf59c - Make the errorcode 255. (Doing docs right away) 2002-02-15 09:06:45 +00:00
Derick Rethans
86fa2d3937 - Let php_execute_script return 0 on failure and 1 on sucess, and change
SAPIs accordingly. (Andrei, Derick)
2002-02-14 20:16:08 +00:00
Sebastian Bergmann
dcd4e0a2ec Remove obsolete CG(extended_info) = 0 calls, we already do this in zend_set_default_compile_time_values(). 2002-02-02 19:53:43 +00:00
Edin Kadribasic
1769e3fcdc Fixed bug #9041 and others in the same class (patch by pete.lee@ubs.com) 2002-01-20 23:58:37 +00:00
Shane Caraveo
6120b8dc5a reimplement extension listing 2002-01-18 20:27:09 +00:00
Sebastian Bergmann
38933514e1 Update headers. 2001-12-11 15:32:16 +00:00
Thies C. Arntzen
f026dae4f2 @- Added -w option to the cgi-version. This will remove all comments and
@  whitespace from teh script. (Thies)
2001-12-08 12:27:01 +00:00
Rui Hirokawa
975ed901aa fixed output problem with output buffering handler. 2001-11-11 23:11:23 +00:00
Alex Waugh
bddb9539f7 Convert PATH_TRANSLATED for RISC OS 2001-11-04 12:46:30 +00:00
Jeroen van Wolffelaar
eb38ca844b Undo Z_ subst for sapi and ext/yaz 2001-09-27 20:01:23 +00:00
Jeroen van Wolffelaar
c033288573 Back-substitute for Z_* macro's. If it breaks some extension (the script isn't optimal, it parses for example var->zval.value incorrect) please let me know. 2001-09-25 21:58:48 +00:00
Derick Rethans
78747bd2df - Don't wrap lines... this is annoying while coding. 2001-09-09 13:29:31 +00:00
Zeev Suraski
8021e65569 Revert an old bogus patch 2001-08-14 23:17:02 +00:00
Zeev Suraski
6ecae422c4 Use zend_first_try 2001-08-08 14:01:22 +00:00
Sascha Schumann
b349df6364 some more eliminate-fetches-or-escalate-them-at-least 2001-08-05 16:21:33 +00:00
Sascha Schumann
8aef193056 more tsrm cleanup 2001-08-05 15:29:47 +00:00
Thies C. Arntzen
578c395411 delay module_shutdown even further. zend_try and _catch need the current
globals as well.
zeev, is this a chicken & egg problem?
2001-08-05 14:07:33 +00:00
Thies C. Arntzen
0fe837b448 module_shutdown() calls ts_free_thread in ZTS mode. so SG() cannot be accessed
afterwards.
2001-08-05 14:04:23 +00:00
Zeev Suraski
1159c84ab7 - TSRMLS_FETCH work
- whitespace fixes
2001-08-05 01:43:02 +00:00
Zeev Suraski
2ec440078a Get rid of a couple of bogus persist_alloc()'s, and some cleanup 2001-08-03 07:15:14 +00:00
Zeev Suraski
b1de7fc900 More TSRMLS_FETCH annihilation. Enough for today... 2001-07-31 07:09:49 +00:00
Zeev Suraski
d76cf1da18 More TSRMLS_FETCH work 2001-07-31 04:53:54 +00:00
Thies C. Arntzen
b1cc3bd1d6 fix compile 2001-07-30 14:52:16 +00:00
Zeev Suraski
c43806f415 Zend compatibility patch 2001-07-30 08:24:42 +00:00
Zeev Suraski
d87cc976e1 Redesigned thread safety mechanism - nua nua 2001-07-28 11:36:37 +00:00
Zeev Suraski
fe6f8712a4 - Get rid of ELS_*(), and use TSRMLS_*() instead.
- Move to the new ts_allocate_id() API
This patch is *bound* to break some files, as I must have had typos somewhere.
If you use any uncommon extension, please try to build it...
2001-07-27 10:16:41 +00:00
Zeev Suraski
e280c3e555 Fix a corrupted memory access 2001-07-27 07:37:16 +00:00
Andi Gutmans
4715403906 - Fix __FILE__ in the main script in CGI/command line mode. 2001-07-21 15:11:30 +00:00
Zeev Suraski
336004f4bc Improved bailout mechanism, supports nested bailouts a-la try..catch
Note:  You may *not* return directly from a catch block
2001-07-21 14:27:56 +00:00
Zeev Suraski
85b4df53c0 Improved interactive mode - it is now available in all builds, without any significant slowdown 2001-07-15 14:08:58 +00:00
Zeev Suraski
551f1831a7 Fix a major thread safety bug in the output mechanism
@- Fixed a major memory corruption bug in the thread safe version (Zeev)
2001-07-02 18:17:10 +00:00
Zeev Suraski
8332ab409a Spit out errors 2001-06-21 14:18:23 +00:00
Sebastian Bergmann
49ab8cb8f1 Remove bogus '.'. 2001-06-06 13:24:17 +00:00
Rasmus Lerdorf
81e2cf03ac Fix folding and clean up some extensions 2001-06-06 13:06:12 +00:00
Shane Caraveo
f0b6b8ab52 The -c commandline option was not working at all, need to set the path
override before calling on the module startup.
2001-05-22 23:05:08 +00:00
Sascha Schumann
bc7a582f84 Use write(2), if we can successfully write to stdout. 2001-05-19 14:30:33 +00:00
Thies C. Arntzen
e80abfa40c revert parts of last commit - stupid me! 2001-05-18 14:40:02 +00:00
Thies C. Arntzen
2db3431f00 --enable-memory-usage-info id deprecated. use --enable-memory-limit instead! 2001-05-18 14:32:05 +00:00
Zeev Suraski
4afa93f716 @- Fixed a possible crash in the PHP CGI when no input file is
@  specified (Zeev)
Fixed bug 7822
2001-05-10 14:13:18 +00:00
Zeev Suraski
6cd3b987b8 $argc was off by one in -f (fix bug #9289) 2001-05-08 00:51:11 +00:00
Andi Gutmans
a166b6146b - Remove unused variable 2001-05-01 07:16:57 +00:00
Sterling Hughes
ba49860cc8 fix for bug 6491, http://www.php.net/bugs.php?id=6491, removes a bit of
(what I think is) broken logic.

#  This is as discussed on the mailing list previously.  This change
#  does fix the problem, however, the extra code was in there for a
#  reason (I'm guessing :), i'm ready to revert this patch in a jiffy
#  if someone has a good reason why that (just removed) extra logic
#  should be in there.
2001-05-01 03:48:27 +00:00
Andi Gutmans
6196e0bc4d - Fix for Bug id #10071
PR:
Submitted by:
Reviewed by:
Obtained from:
2001-04-30 22:47:51 +00:00
Andi Gutmans
4c823e8a89 - Change macros from V_ to VCWD_ because of AIX name clash 2001-04-30 12:45:02 +00:00
Stig Bakken
0b2641efa6 @Added -C command-line option to avoid chdir to the script's directory (Stig) 2001-04-16 23:20:47 +00:00
Ben Mansell
4549e389bb Fix a bug with POST requests. If the Content-Type header wasn't present,
we were setting SG(request_info).content_type to NULL, instead of
an empty string. This was stopping PHP from processing the data.
2001-03-22 18:54:51 +00:00
foobar
f4917d49c3 Fixed the help for other options too. 2001-03-07 13:24:12 +00:00
foobar
356fc41a0a Fix help text for -f 2001-03-05 15:08:36 +00:00
foobar
81a2669216 Can't output any error messages if there isn't any function initialized
to do it..
# Bug report: #7650
2001-03-05 01:26:36 +00:00
Zeev Suraski
ce39c56c8b whitespace fix 2001-03-04 01:08:46 +00:00
Andi Gutmans
a0d3c5a88e - Finally rename modules.h to zend_modules.h for consistency (first try
was 2000-03-11).
- Remove the first_arg_force_ref[]; and friends extern from php.h as they
  are included via zend_API.h
2001-02-26 18:14:50 +00:00
Andi Gutmans
eb6ba01d1c - Fix copyright notices with 2001 2001-02-26 06:11:02 +00:00
Sascha Schumann
adb3e3992c php_register_command_line_global_vars only needs file scope. 2001-02-24 21:07:07 +00:00
Sascha Schumann
280e10aac7 Neither the CGI nor the Servlet SAPI module call syslog, so remove
references to the syslog include files.
2001-02-24 21:05:02 +00:00
Sascha Schumann
c2fb53bed7 Finish fopen-wrappers rename. 2001-02-23 22:07:16 +00:00
Zeev Suraski
bd0ac7fe14 Many patches. I hope I remember them all:
- Make sapi_module available to external modules (PHPAPI)
- Make the php.ini path reported in phpinfo() always point to
  real full path of the php.ini file
- Optimized the ISAPI module not to read unnecessary server
  variables and read necessary variables at most once.
2001-01-02 22:49:31 +00:00
Sascha Schumann
c95a8f39b9 Merge with php_4_0_4 2000-12-03 08:37:43 +00:00
Sascha Schumann
6c1af20310 Set the exit status from the return value of php_execute_script() 2000-11-22 04:24:04 +00:00
Zeev Suraski
030b707296 Update SAPI modules to interface with the new TSRM.
Enable thread-safety memory debugging in ISAPI when in debug mode
2000-11-18 02:44:04 +00:00
Zeev Suraski
0f7f5c2c0e - Import Jade Nicoletti's transparent gzip encoding support as an output
handler.  Works quite nicely!
- Fix buglets in output buffering
- Add output_handler INI directive
2000-11-13 18:54:37 +00:00
Zeev Suraski
9e40204f00 @- In CGI mode, $HTTP_SERVER_VARS now includes all of the environment variables
@  as well (Zeev)
2000-11-07 18:25:29 +00:00
Zeev Suraski
efd8117fd4 Fixed a bug in $argv and $argc not being properly defined in command-line mode
@- Fixed a bug that prevented $argv and $argc from being defined in the command
@  line version of PHP (Stas)
2000-11-06 09:55:53 +00:00
Stanislav Malyshev
24035faa29 I guess SG(request_info).argv0 and not !SG(request_info).argv0 was an intent, otherwise it doesn't make much sense. 2000-11-06 09:31:48 +00:00
Daniel Beulshausen
5e48df787a use argv[1] if it's given, thanks to Bob Denny <rdenny@dc3.com> 2000-11-03 09:55:54 +00:00
Stanislav Malyshev
3bc3677439 Fix -d functionality 2000-10-31 16:16:57 +00:00
Sascha Schumann
bed7034f92 Unify aborted connection handling 2000-10-29 16:02:40 +00:00
Zeev Suraski
1fd09132c2 Initial steps to move the INI mechanism to the Zend engine 2000-10-29 11:38:26 +00:00
Thies C. Arntzen
825457ae64 update my email. 2000-10-29 09:14:55 +00:00
Sascha Schumann
6ff371d9f7 Leave initializing of auth_(user|password) to php_handle_auth_data(). 2000-10-27 10:31:10 +00:00
Sascha Schumann
b725c6eef3 The CGI RFC allows servers to pass Authorization data to the script,
if the server did not use the information contained therein.

See 6.1.5 and 11.2 of the proposed spec.
2000-10-27 10:26:57 +00:00
Andi Gutmans
2946f87f00 - Fix new -m on Windows 2000-10-26 23:50:17 +00:00
Mathieu Kooiman
717e934a88 Added -m (Shows list of modules) to commandline.. 2000-10-26 22:31:06 +00:00
Frank M. Kromann
878e348ff9 Adding type cast to remove compiler warning 2000-10-20 19:08:59 +00:00
Andi Gutmans
f3232e99c3 - Commit Kristian's PHP 3 patch to PHP 4. Kristian I hope it's also the
same here.
2000-10-11 17:48:44 +00:00
Andi Gutmans
38423a895b - Fix request_uri to take it's value from SCRIPT_NAME if PATH_INFO is not
defined
2000-10-03 13:02:30 +00:00
Andi Gutmans
2622eba31d - Cleanup some output functions 2000-09-30 16:13:48 +00:00
Zeev Suraski
91c808ecc4 Restore the headers_only test to the centralized SAPI startup. If necessary, it can
be overriden in the activate() callback.
2000-09-08 14:43:57 +00:00
Stig Bakken
315f4f5658 @PHP 3 regression testing framework re-born (Stig)
Took the old PHP 3 regression testing framework and rewrote it in PHP.
Should work on both Windows and UNIX, however I have not tested it on
Windows.  See tests/README for how to write tests.  Added the PHP 3
tests and converted most of them.
2000-08-27 19:46:06 +00:00
Stanislav Malyshev
5090b1e8d5 Fix zend_fiel_handle handling. Should fix URL include
and various opened_path inconsistencies.
2000-08-13 18:00:50 +00:00
Stanislav Malyshev
db0872123b Fix crash on broken setups (#5979) 2000-08-05 11:28:32 +00:00
Rasmus Lerdorf
76a2d2538c Heads up! I have moved the headers_only and response_code checks out of
SAPI and down into the individual SAPI modules.  I have made the
appropriate changes in all the SAPI modules, but please verify these.
The reason for this change is that Apache sometimes will feed PHP
a request_method of GET but have r->header_only set to true.  This happens
in an ErrorDocument redirect.  In this same scenario we want to preserve
the status code as well instead of just overwriting it with a 200 and
losing this information.  For now the other sapi modules act exactly as
before since they probably do not make this distinction, and they may
not even have a valid response code this early in the request.
@ Fix HEAD request bug on an Apache ErrorDocument redirect and preserve
@ the status code across the redirect as well.  (Rasmus)
2000-08-02 22:48:45 +00:00
Zeev Suraski
52ff887db5 Made ob_start() and friends reentrant. It's now possible to implement this
long-requested functionality, now that output buffering is re-entrant:

function eval_ret($code)
{
	ob_start();
	eval($code);
	$retval = ob_get_contents();
	ob_end_clean();
	return $retval;
}
2000-07-29 14:46:09 +00:00
Hartmut Holzgraefe
1a7f851985 added '-l' option to command line / CGI version for 'syntax check only'
plus a little cleanup and rearranging in command line option parsing

@ CGI aka. command line version has now an option '-l' for syntax check
@   without execution (Hartmut)
2000-07-28 15:21:20 +00:00
Stanislav Malyshev
4c6ffdb1c2 make -c in stand-alone mode work again.
Setting ini_path after php_module_startup doesn't do much good -
since php_module_startup reads .ini.
# This fix is very ugly. Everyone is welcome to make better fix
# that won't report errors twice and won't scan argument 3 times
2000-07-13 09:17:39 +00:00
Andi Gutmans
85422c3c60 - Extra newline crept in somehow 2000-06-29 13:34:58 +00:00
Andi Gutmans
1f828a6e88 - Fix problem with DICARD_PATH being defined in windows 2000-06-29 13:31:52 +00:00
Andrei Zmievski
4010b422dd Separate plain name returned by php_sapi_module() and pretty name
used for output.
2000-06-26 18:05:55 +00:00
Andi Gutmans
fd11a7e13e - Pray this is an OK fix for the DISCARD_PATH junk 2000-06-26 17:57:03 +00:00
Stanislav Malyshev
378440f7cf Right name for the function persist_alloc 2000-06-26 16:26:20 +00:00
Andi Gutmans
91ed009ae2 - Try two in fixing the problem with memory leaks reporting path_translated 2000-06-26 16:17:58 +00:00
Zeev Suraski
effa42696e - Fix problem with filename being freed before possible memory leaks are
- reported by the memory manager
2000-06-26 15:55:59 +00:00
Stanislav Malyshev
5be54abf24 If we freed it, we might not touch it
# BTW, this is not a real fix - we still might use it
# when reporting memory leaks, but at least we won't reference
# unitialized memory
2000-06-26 12:26:40 +00:00
Andi Gutmans
17ce56825d - Beautify a bit 2000-06-15 22:46:17 +00:00
Andi Gutmans
fcefeee914 - Try and fix crash with CGI.
- Please check out the comment I wrote in init_request_info(). There was a
- lot of code there which was running for no apparent reason. Should it be
- removed or should it actually run?
2000-06-15 22:40:52 +00:00
Andi Gutmans
4c99114a25 - Unncessary SLS_FETCH(); 2000-06-15 21:34:00 +00:00
Sascha Schumann
6caf633cf7 Proper casts 2000-06-13 09:17:06 +00:00
Andi Gutmans
77f4e1c8c7 - This seems to be a bug. Anyone know who wrote this code? Should it stay
- in?
2000-06-10 09:05:22 +00:00
Sascha Schumann
102c6ce4b8 Move main.h to php_main.h. 2000-06-05 23:24:42 +00:00
Andi Gutmans
8c82566b48 - Fix problem in sessions module under Win32. Need to use ; as an options
- delimiter in save_path instead of :.
2000-05-27 16:38:49 +00:00
Zeev Suraski
1895a09749 Only fetch globals if it's necessary (which it usually won't be) 2000-05-25 14:43:30 +00:00
Thies C. Arntzen
e319b5f6a5 @- ignore_user_abort() & friends should now work in CGI mode as well.
@  (Patch by daniel.braun@ercom.fr)
2000-05-25 07:01:34 +00:00
Hartmut Holzgraefe
22bfb799a7 -i, -v, -h and -? execution pathes didn't flush the output buffer
on exit, resultiong in no output at all when "output-buffering=On"
( BUG id#3420 )
2000-05-22 22:49:18 +00:00
Zeev Suraski
e043439ff6 Update the license with the new clause 6 2000-05-18 15:34:45 +00:00
Andi Gutmans
0d194ec80b - Fix problem with sapi_globals being used before it is initialized. 2000-05-05 07:21:48 +00:00
Andi Gutmans
198537b70f - Make Windows compile again. 2000-05-05 07:18:50 +00:00
Zeev Suraski
0b33ac7627 - Add -z and -g switches to the CGI 2000-05-04 13:42:21 +00:00
Andi Gutmans
9aba6a94d3 - Another PHP_WIN32 patch 2000-04-20 13:43:48 +00:00
Andi Gutmans
f9e9cab7ac - Change to PHP_WIN32 2000-04-20 13:23:19 +00:00
Thies C. Arntzen
0540bbe5af improve fix 2000-04-20 07:35:22 +00:00
Frank M. Kromann
429cf808e6 SIGPIPE is unknown on WIN32 platforms 2000-04-19 17:28:23 +00:00
Thies C. Arntzen
19a9577901 ignore SIGPIPE in standalone-mode so that one can actually use fsockopen() *and* have the remote side close the socket whithout PHP dying! 2000-04-19 15:37:43 +00:00
Sascha Schumann
bb09ee9505 Use sprintf everywhere and define sprintf to php_sprintf, if sprintf is broken. 2000-03-12 17:18:21 +00:00
Sascha Schumann
caeaaf4d98 Fix build on systems which lack snprintf or vsnprintf.
PR: #3786
2000-03-12 15:47:34 +00:00
Zeev Suraski
1261271839 Allow the INI callbacks to know at what stage PHP is 2000-02-26 15:36:23 +00:00
Thies C. Arntzen
b7e53b12f6 compile-fix 2000-02-21 14:01:19 +00:00
Zeev Suraski
86fa2aade2 the pipe is breaking all the time 2000-02-19 23:41:32 +00:00
Zeev Suraski
80bdd19e03 Fine tune Andi's patch 2000-02-11 15:59:30 +00:00
Andi Gutmans
f9e0d94a65 - Baby steps with PHP_WIN32 :) 2000-02-11 12:56:54 +00:00
Zeev Suraski
6723bdd920 request_info.c is giving up 2000-02-10 20:03:17 +00:00
Zeev Suraski
6d0ab6166c SAPIfication, Episode VI: Return of the SAPI
Remove mostly all references to APACHE and CGI_BINARY from the code.

- Apache include files are no longer included by any PHP code, except for the Apache SAPI module.
- No server specific code is in any of the base PHP code.

Still left to be done:
- Eliminate any references to APACHE from the few remaining modules.
- Move request_info.c's logic to SAPI
- Modify the regex function names, and globals, so that we can always
  include them, without having to fear any interference with Apache;
  Always use the bundled regex library
2000-02-10 19:41:21 +00:00
Zeev Suraski
5bdd18caf1 Yes, you guessed it... More cleanup 2000-02-10 18:44:33 +00:00
Zeev Suraski
0fd89aa20d More cleanup - move getenv() to SAPI 2000-02-10 17:55:01 +00:00
Zeev Suraski
7d926a0e0c More cleanup... 2000-02-10 17:26:57 +00:00
Andrei Zmievski
681f352a9d Should be 'deactivate' rather than the opposite. 2000-02-10 16:48:22 +00:00
Zeev Suraski
073b148167 More abstraction 2000-02-10 16:44:59 +00:00
Zeev Suraski
59b53ea2c8 Always use getopt with CGI, never use it for anything else 2000-02-10 16:27:28 +00:00
Zeev Suraski
404bbe1f26 Move the logging mechanism to SAPI 2000-02-10 15:55:10 +00:00
Zeev Suraski
b2449f929c - Change the argument order of php_register_variable() to something more
intuitive.
- Make the authentication variables be a part of the HTTP_SERVER_VARS[] array
2000-01-29 11:55:44 +00:00
Zeev Suraski
99f079a349 - A few fixes
- Added register_argv_argc directive to allow disabling of argv/argc
2000-01-28 18:29:37 +00:00
Zeev Suraski
9ab35ae393 Tried to centralize global variable registration as much as possible:
- Added $HTTP_ENV_VARS[] and $HTTP_SERVER_VARS[] support, which similarly
  to $HTTP_GET_VARS[], contain environment and server variables.  Setting
  register_globals to Off will now also prevent registration of the
  environment and server variables into the global scope (Zeev)
- Renamed gpc_globals to register_globals (Zeev)
- Introduced variables_order that deprecates gpc_order, and allows control
  over the server and environment variables, in addition to GET/POST/Cookies
  (Zeev)
2000-01-28 17:24:53 +00:00
Zeev Suraski
972631be71 - Added flush() support to SAPI
- Got rid of the old flush() implemenetation in favour of the new one
- Added implicit_flush() support to the output buffering layer.
@- Added implicit_flush() to control whether flush() should be called
@  implicitly after any output (Zeev)
2000-01-13 17:37:25 +00:00
Sascha Schumann
43ae2bffbb Happy Y2K patch! Happy new year (or the new millennium, depending on whether
you start counting at 0 or 1).
2000-01-01 01:32:05 +00:00
Zeev Suraski
b640c27a08 @- Fixed -c support in the standalone CGI binary (Zeev)
Fixed -c support in the standalone CGI binary (Zeev)
1999-12-27 21:21:26 +00:00
Sascha Schumann
ed0a307ccd Use sapi_module_struct to contain SAPI module name 1999-12-20 23:09:54 +00:00
Zeev Suraski
a3c6514332 More php3_ annihilation 1999-12-17 19:51:39 +00:00
Zeev Suraski
02d3b39420 More php3_ annihilation 1999-12-17 19:16:50 +00:00
Sascha Schumann
4a60eed469 Fix some warnings 1999-12-05 16:25:32 +00:00
Sascha Schumann
5b983c944f Clean up php3.*\.h files. The files itself are renamed, and references in all
.*\.[ch] files were changed. There is a slight chance that my script missed
a few changes, please correct them manually.
1999-12-04 19:19:57 +00:00
Sascha Schumann
8713ce5d38 Remove code references to serverapi 1999-12-04 18:06:15 +00:00
Zeev Suraski
da5464b145 - zend_file_handles must now flag whether their .filename property should be
free by Zend or not (uses e*() functions)
1999-12-04 13:25:41 +00:00
Andrei Zmievski
9781bf59cb (main) In this special case, free path_translated. Fix for #2795. 1999-11-23 20:25:55 +00:00
Sascha Schumann
2681a6b169 (main) Remove redundant statement, this is part of the initialization
function.
1999-11-23 15:39:09 +00:00
Andi Gutmans
133c95cf8c - It's OK if we link dynamically. 1999-10-16 11:57:52 +00:00
Andi Gutmans
ad84f02efb - Get windows version to compile again. No biggy if array_map is not #if 0'd
out even if it doesn't work.
1999-10-16 10:14:47 +00:00
Stig Bakken
2a854ca8b9 Generalized server-API build process on UNIX. Each SAPI
implementation now has its own directory under sapi/, just like
extensions have theirs under ext/.  To make the final targets appear
in the main dir, the top-level Makefile includes sapi/NN/Makefile.inc
from the selected sapi backend.  This is a plan Makefile stub without
any autoconf substitutions.  Each SAPI backend also has its own
config.m4 like extensions (read at the end of diversion 2) and
config.h.stub files.

Each SAPI backend has to contain:

config.m4: just like for extensions, this file contains
autoconf/automake directives that end up in the configure script.  The
only difference is that the sapi config.m4 files are read in diversion
(output block) 2 instead of 3.  The sapi config.m4 files should set
two variables: PHP_SAPI (which sapi backend to choose) and SAPI_TARGET
(the name of the resulting library or program, previously BINNAME).
If they are not specified, they will default to "cgi" and "php",
respectively.

Makefile.inc: has to exist, has to define "INSTALL_IT" to the command
used to install the final target (or ":" for no operation).  It also
has to define a plain Makefile rule (without autoconf substitutions)
to build $(SAPI_TARGET)

Makefile.am: just what you think.  Make sure your target is called
"libphpsapi_NNN.a", where NNN is the value of PHP_SAPI.

Some testing and fixing probably remains.  To make everything hang
together, I've done some ugly tricks that I can imagine causing some
problems.  I've built and run the CGI version and built the Apache
DSO.
1999-09-27 16:34:28 +00:00