summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>1999-08-24 23:12:50 +0000
committerZeev Suraski <zeev@php.net>1999-08-24 23:12:50 +0000
commit7e250d06f5eb50c12d99921d768a8469d7de9c46 (patch)
tree29d634dc7aa35ea3d03cccb786c64fb91acd6845
parentd8a322e7be07473647730144a5507f7da82b9680 (diff)
downloadphp-git-7e250d06f5eb50c12d99921d768a8469d7de9c46.tar.gz
Add output_buffering directive
-rw-r--r--ChangeLog10
-rw-r--r--ext/rpc/com/COM.c4
-rw-r--r--main/main.c4
-rw-r--r--main/php_globals.h1
-rw-r--r--output.c12
-rw-r--r--php.ini-dist8
-rw-r--r--php4dll.dsp12
7 files changed, 40 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 4c506649bb..4fcf27ca81 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,10 @@ PHP 4.0 CHANGE LOG ChangeLog
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ?? 1999, Version 4.0 Beta 3
+- Added output_buffering directive to php.ini, to enable output buffering
+ for all PHP scripts (default is off).
+- Fix some more class inheritance issues (Zeev, Zend library)
+- Fixed array_walk to always reset array pointer before working (Andrey)
- Fixed Apache build wrt to shared modules on FreeBSD/Linux (Sascha)
- Added session.extern_referer_chk which checks whether session ids were
referred to by an external site and eliminates them (Sascha)
@@ -17,7 +21,7 @@ PHP 4.0 CHANGE LOG ChangeLog
- Fixed persistency of MHASH_* constants (Sascha)
- Oracle is now ZTS-Save (Thies)
- Fixed flushing of cached information to disk in DBA's DB2 module (Sascha)
-- OCI8 is now ZTS-Save (Thies)
+- OCI8 is now ZTS-Safe (Thies)
- Fixed is_writeable/is_writable problem; they are both defined now (Andrey)
- Imported PHP 3.0 diskfreespace() function (Thies)
- Fixed thread-safety issues in the MySQL module (Zeev)
@@ -57,13 +61,13 @@ August 9 1999, Version 4.0 Beta 2
- Fixed various inheritance problems (Andi & Zeev, Zend library)
- Children now inherit their parent's constructor, if they do not supply a
constructor of their own.
-- Fixed runtime inheritence of classes (parent methods/properties were
+- Fixed runtime inheritance of classes (parent methods/properties were
overriding their children) (Zeev, Zend library)
- Fixed backwards incompatibility with the "new" operator (Andi, Zend library)
- Fixed bugs in uksort() and ksort() sort ordering (Andrey)
- Fixed a memory leak when using assignment-op operators with lvalue of type
string (Zeev, Zend library)
-- Fixed a problem in inheritence from classes that are defined in include()d
+- Fixed a problem in inheritance from classes that are defined in include()d
files (Zeev, Zend library)
- Fixed a problem with the PHP error handler that could result in a crash
on certain operating systems (Zeev)
diff --git a/ext/rpc/com/COM.c b/ext/rpc/com/COM.c
index 6adab50be2..9fc392a697 100644
--- a/ext/rpc/com/COM.c
+++ b/ext/rpc/com/COM.c
@@ -680,8 +680,6 @@ VARIANTARG _php_COM_get_property_handler(zend_property_reference *property_refer
int type;
VARIANTARG var_result;
- /*printf("Reading a property from a TestClass object:\n");*/
-
/* fetch the IDispatch interface */
zend_hash_index_find(object->value.obj.properties, 0, (void **) &idispatch_handle);
@@ -753,8 +751,6 @@ int php_COM_set_property_handler(zend_property_reference *property_reference, pv
int type;
VARIANTARG var_result;
- /*printf("Reading a property from a TestClass object:\n");*/
-
/* fetch the IDispatch interface */
zend_hash_index_find(object->value.obj.properties, 0, (void **) &idispatch_handle);
diff --git a/main/main.c b/main/main.c
index 0d0f136f21..8bd3ef9a2d 100644
--- a/main/main.c
+++ b/main/main.c
@@ -174,6 +174,7 @@ PHP_INI_BEGIN()
STD_PHP_INI_BOOLEAN("short_open_tag", "1", PHP_INI_ALL, OnUpdateInt, short_tags, php_core_globals, core_globals)
STD_PHP_INI_BOOLEAN("asp_tags", "0", PHP_INI_ALL, OnUpdateInt, asp_tags, php_core_globals, core_globals)
PHP_INI_ENTRY("precision", "14", PHP_INI_ALL, OnSetPrecision)
+ STD_PHP_INI_BOOLEAN("output_buffering", "0", PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateInt, output_buffering, php_core_globals, core_globals)
PHP_INI_ENTRY_EX("highlight.comment", HL_COMMENT_COLOR, PHP_INI_ALL, NULL, php_ini_color_displayer_cb)
PHP_INI_ENTRY_EX("highlight.default", HL_DEFAULT_COLOR, PHP_INI_ALL, NULL, php_ini_color_displayer_cb)
@@ -640,6 +641,9 @@ int php_request_startup(CLS_D ELS_DC PLS_DC SLS_DC)
{
zend_output_startup();
+ if (PG(output_buffering)) {
+ zend_start_ob_buffering();
+ }
#if APACHE
/*
* For the Apache module version, this bit of code registers a cleanup
diff --git a/main/php_globals.h b/main/php_globals.h
index 7817643612..be8b5e3890 100644
--- a/main/php_globals.h
+++ b/main/php_globals.h
@@ -50,6 +50,7 @@ struct _php_core_globals {
long asp_tags;
long short_tags;
+ long output_buffering;
long safe_mode;
long sql_safe_mode;
diff --git a/output.c b/output.c
index 56949dd777..bb13f471de 100644
--- a/output.c
+++ b/output.c
@@ -45,6 +45,7 @@ static inline void zend_ob_send();
* Main
*/
+/* Start output layer */
PHPAPI void zend_output_startup()
{
ob_buffer = NULL;
@@ -53,6 +54,7 @@ PHPAPI void zend_output_startup()
}
+/* Start output buffering */
void zend_start_ob_buffering()
{
zend_ob_init(4096, 1024);
@@ -60,6 +62,7 @@ void zend_start_ob_buffering()
}
+/* End output buffering */
void zend_end_ob_buffering(int send_buffer)
{
SLS_FETCH();
@@ -92,7 +95,7 @@ static inline void zend_ob_allocate()
}
-void zend_ob_init(uint initial_size, uint block_size)
+static void zend_ob_init(uint initial_size, uint block_size)
{
if (ob_buffer) {
return;
@@ -104,7 +107,7 @@ void zend_ob_init(uint initial_size, uint block_size)
}
-void zend_ob_destroy()
+static void zend_ob_destroy()
{
if (ob_buffer) {
efree(ob_buffer);
@@ -113,7 +116,7 @@ void zend_ob_destroy()
}
-void zend_ob_append(const char *text, uint text_length)
+static void zend_ob_append(const char *text, uint text_length)
{
char *target;
int original_ob_text_length=ob_text_length;
@@ -126,7 +129,7 @@ void zend_ob_append(const char *text, uint text_length)
}
-void zend_ob_prepend(const char *text, uint text_length)
+static void zend_ob_prepend(const char *text, uint text_length)
{
char *p, *start;
@@ -152,6 +155,7 @@ static inline void zend_ob_send()
}
+/* Return the current output buffer */
int zend_ob_get_buffer(pval *p)
{
if (!ob_buffer) {
diff --git a/php.ini-dist b/php.ini-dist
index 5f54386575..2342219ad5 100644
--- a/php.ini-dist
+++ b/php.ini-dist
@@ -38,9 +38,16 @@ short_open_tag = On ; allow the <? tag. otherwise, only <?php and <script> tags
asp_tags = Off ; allow ASP-style <% %> tags
precision = 14 ; number of significant digits displayed in floating point numbers
y2k_compliance = Off ; whether to be year 2000 compliant (will cause problems with non y2k compliant browsers)
+output_buffering = Off ; Output buffering allows you to send header lines (including cookies)
+ ; even after you send body content, in the price of slowing PHP's
+ ; output layer a bit.
+ ; You can enable output buffering by in runtime by calling the output
+ ; buffering functions, or enable output buffering for all files
+ ; by setting this directive to On.
; Safe Mode
safe_mode = Off
safe_mode_exec_dir =
+
; Colors for Syntax Highlighting mode. Anything that's acceptable in <font color=???> would work.
highlight.string = #DD0000
highlight.comment = #FF8000
@@ -48,6 +55,7 @@ highlight.keyword = #007700
highlight.bg = #FFFFFF
highlight.default = #0000BB
highlight.html = #000000
+
; Misc
allow_builtin_links = Off ; Sets whether phpinfo() will generate built-in links that display the PHP
; and Zend logos, and tells PHP whether to honor them or not.
diff --git a/php4dll.dsp b/php4dll.dsp
index 5221544703..a55ee886c5 100644
--- a/php4dll.dsp
+++ b/php4dll.dsp
@@ -795,5 +795,17 @@ InputPath=".\configuration-scanner.l"
# End Source File
# End Group
+# Begin Group "Text Files"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\ChangeLog
+# End Source File
+# Begin Source File
+
+SOURCE=.\LICENSE
+# End Source File
+# End Group
# End Target
# End Project