Commit Graph

137 Commits

Author SHA1 Message Date
Felipe Pena
8775a37559 - Year++ 2012-01-01 13:15:04 +00:00
Rasmus Lerdorf
e0df4e3dba Fix a couple of warnings. Use %zu to printf a time_t and get_request_time
actually returns a double, not a time_t.
2011-05-16 15:52:31 +00:00
Scott MacVicar
ca378eefa0 Add header_register_callback(), allows a userland function
to be called as all the headers are being sent and after all
of the default headers have been merged.

headers_list(), header_remove() and header() can all be used
inside the callback.

<?php

header('Content-Type: text/plain');
header('X-Test: foo');

function foo() {
  foreach (headers_list() as $header) {
    if (strpos($header, 'X-Powered') !== false) {
      header_remove('X-Powered-By');
    }
    header_remove('X-Test');
  }
}

$result = header_register_callback('foo');
echo "a";
2011-02-03 16:47:28 +00:00
Felipe Pena
0203cc3d44 - Year++ 2011-01-01 02:17:06 +00:00
Jérôme Loyet
e1b87cce1f - Fixed #52045 (FPM tries to open php.ini from the current dir)
- Add php_ini_ignore_cwd to _sapi_module_struct
2010-11-11 17:24:27 +00:00
Ilia Alshanetsky
f89effd2a8 Updated _SERVER['REQUEST_TIME'] to include microsecond precision. 2010-11-06 17:14:21 +00:00
Pierre Joye
05383a1072 - drop TSRMLS_FETCH in sapi_register_* (won't bring much at runtime :) ) and cleanup/group the upgrade guide, no need of twenty titles for the same change 2010-09-17 08:41:05 +00:00
Kalle Sommer Nielsen
34b631f679 Pass the TSRMS pointers to sapi_module_struct.log_message, this saves some TSRMLS_FETCH() calls in a few of our SAPI's 2010-08-18 13:34:40 +00:00
Andrei Zmievski
f92fae2f66 I am sorry I tried fixing PHP without extensive discussion on the mailing list.
I am sorry I tried fixing PHP without extensive discussion on the mailing list.
I am sorry I tried fixing PHP without extensive discussion on the mailing list.

Hope all the relevant parties are satisfied.
2010-03-18 22:37:25 +00:00
Andrei Zmievski
3220f15ca2 Fix a few problems with large (2G-4G) file uploads. Added
--enable-large-uploads-fix switch because one change was in SAPI.h structure.
2010-03-18 21:07:38 +00:00
Sebastian Bergmann
9ba1e81665 sed -i "s#1997-2009#1997-2010#g" **/*.c **/*.h **/*.php 2010-01-03 09:23:27 +00:00
Stanislav Malyshev
94b7a00760 fix for #47930 2009-04-28 21:30:23 +00:00
Marcus Boerger
88f19296c9 - Add needed include as reported by Pierre 2008-12-31 17:33:05 +00:00
Marcus Boerger
f77719d800 MFH
- Changed dl() to be disabled by default. Enabled only when explicitly
  registered by the SAPI layer. Enabled only with CLI, CGI and EMBED. (Dmitry)
[DOC]
2008-12-31 14:27:09 +00:00
Sebastian Bergmann
08659c2dcd MFH: Bump copyright year, 3 of 3. 2008-12-31 11:15:49 +00:00
Arnaud Le Blanc
8c4151ad72 Added header_remove() (chsc at peytz dotdk, Arnaud)
[DOC] proto void header_remove([string header_name])
      Removes an HTTP header previously set using header()
      The header_name parameter is optionnal, all headers are
      removed if it is not set

[SAPIs] The header_handler callback in sapi_module_struct has
           been changed, it now take a new argument.

           When it is set to SAPI_HEADER_DELETE, sapi_header->header is
           the name of an header, header_handler has to delete it.

           When it is set to SAPI_HEADER_DELETE_ALL, header_handler has
           to delete all headers.

           When sapi_header_op_enum is SAPI_HEADER_ADD or _REPLACE,
           sapi_header->header is in the form "Name: value", header_handler
           has to add or replace the given header.

           In all cases, header_handler must not free sapi_header or
           sapi_header->header. SAPI_HEADER_ADD must be returned if the
           header has been added or replaced, or 0 in other cases.
2008-11-13 10:14:04 +00:00
Rasmus Lerdorf
6c158374ba exit_on_timeout patch
After the sigsetjmp change, this is patch #2 in an effort to get some
sanity restored to signal handling in PHP.

This patch does two things.  First, it makes it possible to reset the
timeout without resetting the signal handlers.  This is important for
cases where an extension may have deferred signals in its MINIT in order
to implement critical sections. It also lays the groundwork for cleaning
up our signal handling and perhaps eventually implementing our own
signal deferring mechanism so we can have true critical sections.

The second thing this does is to make it possible to terminate the current
child process (only for Apache1 at the moment) on a timeout.  There are
a number of extensions that are unhappy about being longjmp'ed out of
and when this happens on a timeout they are left in an inconsistent state.
By turning on exit_on_timeout you can now force the process to terminate
on a timeout which will clean up any hanging locks and/or memory left
hanging after the longjmp.
2008-03-18 21:42:50 +00:00
Dmitry Stogov
240fa244c3 Improved PHP binary size and startup speed with GCC4 visibility control (Nuno) 2008-01-30 09:41:12 +00:00
Sebastian Bergmann
d1dded8751 MFH: Bump copyright year, 2 of 2. 2007-12-31 07:17:19 +00:00
Jani Taskinen
11750c315d MFH: ws 2007-08-31 07:43:37 +00:00
Sebastian Bergmann
4223aa4d5e MFH: Bump year. 2007-01-01 09:36:18 +00:00
Dmitry Stogov
7d14dad02e MFH: Fixed mess with CGI/CLI -d command line option (now it works with cgi; constants are working exactly like in php.ini; with FastCGI -d affects all requests). 2006-09-19 20:33:12 +00:00
foobar
5bd93221a8 bump year and license version 2006-01-01 12:51:34 +00:00
foobar
23e671a51e - Bumber up year 2005-08-03 14:08:58 +00:00
Rui Hirokawa
8235a70ef9 added a server variable PHP_AUTH_DIGEST to support HTTP Digest Authentication. 2005-04-04 15:06:36 +00:00
Rasmus Lerdorf
3c0411c496 Fix for bug #32263
This adds proto_num to request_info.  It is defaulted to HTTP 1.0 (1000)
such that it has a valid value even if the underlying sapi doesn't set it
correctly.  It is then used to determine if a 302 or a 303 should be sent
on a Location redirect.  Any non GET/HEAD HTTP 1.1 redirect will get a 303
instead of a 302 to be compatible with the HTTP spec.
2005-03-14 19:25:39 +00:00
Moriyoshi Koizumi
0d7845384f - Fix bug #28568 (known_post_content_types is not thread safe).
# What is eventually necessiated is entire SAPI redesign, I think.
2005-02-21 15:14:02 +00:00
Frank M. Kromann
e398e6b7d6 Fix win32 compilation. Missing uid_t and gid_t definitions. 2004-08-21 03:09:45 +00:00
Rasmus Lerdorf
cad60c3760 Add SAPI hook to get the request time if provided by the web server,
otherwise call time(0) on the first call and store it so subsequent
calls will get the same time.  Hook support for Apache1/2 included.
2004-08-10 17:40:00 +00:00
foobar
ccfc46b0aa - Happy new year and PHP 5 for rest of the files too..
# Should the LICENSE and Zend/LICENSE dates be updated too?
2004-01-08 17:33:29 +00:00
Derick Rethans
630e1692d6 - Fixed standard wrapper for input filter. 2003-11-30 20:07:58 +00:00
Derick Rethans
750b0338bf - Fix sapi_input_filter patch. Returning 1 from the filter handler should
make PHP register the variable, returning 0 shouldn't. The new length of
  the variables being filtered is now returned in the new_val_len argument
  of the function.
2003-11-29 15:24:35 +00:00
Ard Biesheuvel
3d6426ee14 Fix use of EXTERN_C macros 2003-09-02 13:34:23 +00:00
Wez Furlong
ef498a27b8 linkage for C++ 2003-08-18 23:19:27 +00:00
James Cox
f68c7ff249 updating license information in the headers. 2003-06-10 20:04:29 +00:00
Marcus Boerger
3e621fac94 make phpinfo() depend on executed sapi 2003-03-18 20:52:52 +00:00
Marcus Boerger
63739c7db8 give sapi modules the possibility to overwrite default ini settings 2003-03-18 15:53:33 +00:00
Rasmus Lerdorf
d08a0e99c8 An input filter might not simply strip stuff, it might also turn things
into entities or use some other mechanism which causes the filtered data
to be longer than the original data.  Ergo, pass in the address of the
buffer instead so the filter is free to reallocate it.
2003-02-20 22:21:49 +00:00
Rasmus Lerdorf
7429c2dc3f Input Filter support. See README.input_filter for details.
@- Input Filter support added. See  README.input_filter. (Rasmus)
2003-02-19 19:41:09 +00:00
foobar
8e3f23e3c0 ws fixes + missing $Id$ tags, headers added 2003-02-19 08:40:19 +00:00
Sascha Schumann
294e776d95 add sapi_get_target_uid/_gid for obtaining information about the
non-privileged user the web server is running as.  this is useful
for creating shared memory segments which need to be accessed by
the child processes/threads.
2003-01-21 11:03:58 +00:00
Sascha Schumann
6f4333c7ae scrap STANDARD_SAPI_MODULE_PROPERTIES; it is causing more harm than good 2003-01-15 21:13:01 +00:00
Sascha Schumann
4668b7130b whitespace 2003-01-15 11:22:04 +00:00
Derick Rethans
b9e54cb693 - Fixed bug #21169: Compile Failure, and lots of warnings on UnixWare 2003-01-02 18:01:10 +00:00
Sebastian Bergmann
2c5d4b8c23 Bump year. 2002-12-31 15:59:15 +00:00
Sascha Schumann
2b95b3c83b add a "force HTTP/1.0 response" facility to the SAPI layer
this is necessary, when you want to take over control of a connection
and the web server is doing stupid things by default (like enabling
chunked transfer encoding for no reason).
2002-12-01 03:28:21 +00:00
foobar
dd53efc196 - Made the STANDARD_SAPI_MODULE_PROPERTIES be what it says it is. 2002-11-26 05:57:06 +00:00
Sascha Schumann
09f463ddae Add sapi_get_fd() and implement it for the Apache/thttpd SAPIs. 2002-11-26 05:15:55 +00:00
Sebastian Bergmann
51e4dbaba0 Fix ZTS build. 2002-11-18 06:04:06 +00:00
George Schlossnagle
99c7ddc3a8 added support functions for the apache_hooks SAPI 2002-11-18 00:59:23 +00:00