Commit Graph

367 Commits

Author SHA1 Message Date
Wez Furlong
659a071e3d Streams are all tracked as resources now.
Add some logic that will help track down leaks
when debug is enabled.
2002-03-20 14:21:30 +00:00
Wez Furlong
14a3911866 fix for bug #16168 2002-03-19 17:49:02 +00:00
Wez Furlong
6abe71bebc s/fgetwrapperdata/file_get_wrapper_data/ 2002-03-19 13:33:07 +00:00
Wez Furlong
c9d5e13738 TSRMLS related work on streams, as discussed with Zeev.
# Should be the last "broad" commit for a while
# Don't forget to make clean ; make
2002-03-18 18:54:32 +00:00
Zeev Suraski
73e79322ba Fix the build and all of the outstanding VC++ warnings 2002-03-18 08:05:28 +00:00
Wez Furlong
0895998bef s/get_file_contents/file_get_contents/ 2002-03-16 16:52:24 +00:00
Wez Furlong
201446c2b5 Ooops. 2002-03-16 16:14:56 +00:00
Wez Furlong
0447327118 Implement get_file_contents() as discussed (briefly!) by myself, Derick
and Sterling on php-dev some months ago.
It returns the file contents as a string, and uses mmap if possible.
2002-03-16 16:06:18 +00:00
Wez Furlong
636829345e Allow php_stream_copy_to_stream to do nothing when used with code
that calculates a max length of zero. (Thanks again Marcus).
2002-03-16 02:48:35 +00:00
Wez Furlong
52982c422e This should help with some build problems/warnings under win32.
Someone still needs to add the streams.c file to the MSVC
project/workspace though (there are so many that I don't really know
what I am doing :-).
2002-03-16 02:33:00 +00:00
Wez Furlong
a184f5d1d3 * formatting, plus remove some old fopen wrappers 2002-03-16 01:34:52 +00:00
Wez Furlong
0f65280cb5 New PHP streams... 2002-03-15 21:03:08 +00:00
Sebastian Bergmann
90613d2282 Maintain headers. 2002-02-28 08:29:35 +00:00
Markus Fischer
1e2b854bba - mkdir(): made second (mode) parameter optional, default to 0777
switched to zend_parse_parameters().
# Added vim 'noet' setting
2002-01-11 10:44:24 +00:00
Derick Rethans
e5c08b815f - Added open basedir checks to file functions. (Patch by
Christoph Kassen <chkassen@chkassen.de>)
2001-12-21 08:04:21 +00:00
Sean Bright
25058db066 Use memset() instead. 2001-12-21 03:50:07 +00:00
Sean Bright
33730ca2b9 Initialize variable to avoid bogus data and possible segfault. 2001-12-21 03:10:11 +00:00
Sean Bright
0ca4f69d31 Switched some functions to use zend_parse_parameters, cleaned up some
unused variables and some whitespace work.
2001-12-21 01:53:25 +00:00
Sebastian Bergmann
38933514e1 Update headers. 2001-12-11 15:32:16 +00:00
Hartmut Holzgraefe
94737d086f proto fix 2001-12-07 07:27:00 +00:00
Hartmut Holzgraefe
c1626365f9 proto fixes 2001-12-06 18:59:22 +00:00
Sterling Hughes
886ad91adf Make the length parameter to fgets optional (defaults to 1024) 2001-12-04 19:40:48 +00:00
foobar
fc3906e93a WS fix 2001-11-18 03:34:23 +00:00
Sterling Hughes
42b9349d8b Many other reasons that setvbuf can fail than "wrong arguments", returning
false should be enough
2001-11-14 12:57:06 +00:00
Jeroen van Wolffelaar
5ccdb1d352 Fix all (at least, I tried to catch all) proto's in file.c 2001-11-11 20:33:27 +00:00
Jeroen van Wolffelaar
788b1552a7 Add warning when set_file_buffer() fails 2001-11-11 19:42:31 +00:00
Derick Rethans
88c6758d4e - Fixing this bad idea 2001-11-10 18:06:28 +00:00
James Moore
4f78737000 Fix apache win32 dso build.
(This is untested on linux but shouldnt break anything)
2001-11-10 17:24:02 +00:00
foobar
f73ee14bd9 Check that realpath is available. Bug: #9469
# TSRM still uses it without checking. I can't fix that.
2001-10-23 11:14:51 +00:00
Sascha Schumann
a92fa9b2bc Either sizeof(struct stat) or sizeof f_stat, but not sizeof stat. 2001-10-13 23:43:49 +00:00
Derick Rethans
62fb3d63c5 @- Added mmapfile(), read a file into a variabele with mmap (Ilia A, Derick)
- Added mmapfile(), read a file into a variabele with mmap (Patch by:
  Ilia A. <ilia@prohost.org>)
2001-10-07 18:34:44 +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
Sterling Hughes
c53f80fb23 1) update to the ZEND_NUM_ARGS() and Z_*_P{0,2} macros
2) minor ws improvements, removing unecessary error checking logic, and
making the error messages a bit nicer looking
2001-08-17 09:08:03 +00:00
Sterling Hughes
8300abe367 Removed select(), fd_set(), etc. (wasn't present in the first place, and
these are implemented in the sockwasn't present in the first place, and
 these are implemented in the sockets extension))
2001-08-15 05:21:43 +00:00
Zeev Suraski
c0404f4631 Whitespace 2001-08-11 17:03:37 +00:00
Sascha Schumann
23b9300fd1 more tsrm cleanup 2001-08-06 03:50:52 +00:00
Sascha Schumann
373b3e101e more tsrm cleanup -- output.c is not doing any fetches anymore 2001-08-05 15:55:43 +00:00
Zeev Suraski
1159c84ab7 - TSRMLS_FETCH work
- whitespace fixes
2001-08-05 01:43:02 +00:00
Sean Bright
d789d45a2e WS Pollution 2001-08-04 13:47:44 +00:00
Sean Bright
fff883689e Don't allocated quoted strings unless we are in a META tag. 2001-08-04 12:36:51 +00:00
Zeev Suraski
b1de7fc900 More TSRMLS_FETCH annihilation. Enough for today... 2001-07-31 07:09:49 +00:00
Zeev Suraski
bc42c37513 More TSRMLS_FETCH work. Got it under 400 now. 2001-07-31 06:28:05 +00:00
Zeev Suraski
aa1772ca72 More TSRMLS_FETCH annihilation 2001-07-31 05:44:11 +00:00
Zeev Suraski
c43806f415 Zend compatibility patch 2001-07-30 08:24:42 +00:00
Zeev Suraski
797a079a95 More TSRMLS_FETCH work, and a bit of cleanup 2001-07-30 06:18:13 +00:00
Zeev Suraski
7b1c400631 More TSRMLS_FETCH annihilation (Zend compatibility patch) 2001-07-30 04:58:07 +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
Stanislav Malyshev
cdf0532ad3 Make read always 0-terminate strings 2001-07-16 15:44:36 +00:00
Zeev Suraski
94f5950438 Get rid of var_uninit() 2001-07-15 19:03:04 +00:00
Sean Bright
9d05cba6b8 This should be lower-cased per the documentation and previous
implementation.
2001-07-05 23:29:11 +00:00
Sean Bright
55fecbab76 Remove unused variable. 2001-07-01 14:07:44 +00:00
Sean Bright
1b0356e0f7 Fix for bug #11796. Also, fixed a problem in get_meta_tags that required
NAME and CONTENT to be in that order.  Meta tags with no CONTENT attribute
are now added to the array as empty strings.  Meta tags with no NAME
attribute are ignored.
2001-06-30 20:07:12 +00:00
Rasmus Lerdorf
81e2cf03ac Fix folding and clean up some extensions 2001-06-06 13:06:12 +00:00
Rasmus Lerdorf
25c3a3a39d vim-6 does folding - clean up a bunch of missing folding tags plus
some misguided RINIT and RSHUTDOWN calls in a few fringe extensions
2001-06-05 13:12:10 +00:00
Rasmus Lerdorf
ae3dda8285 Fix bug #9526 2001-05-19 22:50:44 +00:00
Sascha Schumann
d5cfb03ac9 munmap() file in RSHUTDOWN, if PHPWRITE fails. 2001-05-18 23:38:46 +00:00
Sascha Schumann
0255bb01e4 Files should be shared among processes. 2001-05-18 17:48:43 +00:00
Wez Furlong
7a88deb402 expose streams to other extensions. 2001-05-12 21:48:39 +00:00
Jason Greene
c115a75544 Rewrote stat() and fstat() to be memory efficient, due to a recent
thread on php-dev.

Note: I added a macro that might have use in other instances, but for now
is included in php_filestat.h
2001-05-11 19:55:44 +00:00
Jason Greene
0ed93d71b2 @fstat() and stat() now return identical output by returning a numerical and
@string indexed array (Jason)

(Andrei's suggestion to still allow backwords compatibility.)
2001-05-11 01:47:46 +00:00
Andi Gutmans
4c823e8a89 - Change macros from V_ to VCWD_ because of AIX name clash 2001-04-30 12:45:02 +00:00
Wez Furlong
86c84da7c2 Discovered warn_not_available and used it. 2001-04-17 17:08:03 +00:00
Wez Furlong
57af70f707 Changes for streams. Added temporary fopenstream function to PHP so that
the streams can be tested.
2001-04-17 17:06:06 +00:00
Alexander Feldman
f0abfcc894 Fixed typo. 2001-04-15 19:03:12 +00:00
Alexander Feldman
531b8042ad We shoud not fseek in a pipe and this caused a problem with popen and
fgets on the platforms where the buffer fix was applied (Solaris, FreeBSD).
Now the fseek is done only when the handle is of type fopen.
2001-04-15 18:42:50 +00:00
foobar
176f5847be ws pollution removed. 2001-04-07 21:46:43 +00:00
Romolo Manfredini
01ac20050e Added target ownership check in function copy for safe_mode operations 2001-03-23 09:30:51 +00:00
Alexander Feldman
397c76d787 Fixed a compatibility problem is some file functions (fgets, fputs, fread,
fwrite). The ANSI standard says that if a file is opened in read/write
mode, fseek() should be called before switching from reading to writing
and vice versa.
2001-03-11 10:08:27 +00:00
Sean Bright
5d3939ac39 Typo.
# I don't know where I got 4.02 from
2001-03-06 04:42:04 +00:00
Sean Bright
64ad839328 get_meta_tags now allows attributes that are not quoted as well as those
that are.  It follows the HTML 4.01 specification for attribute values
outlined here -> http://www.w3.org/TR/html4/intro/sgmltut.html#h-3.2.2
2001-03-06 04:34:05 +00:00
Sean Bright
dca3c8753f get_meta_tags now handles single quoted attributes as well as those that
are double quoted.
2001-03-05 00:20:41 +00:00
Andi Gutmans
eb6ba01d1c - Fix copyright notices with 2001 2001-02-26 06:11:02 +00:00
Sascha Schumann
c2fb53bed7 Finish fopen-wrappers rename. 2001-02-23 22:07:16 +00:00
Sascha Schumann
47f7795594 Correctly check for the existence of the st_rdev field.
Note that this field is required to exist for SUSv3 conformance.

Submitted by: amra@us.ibm.com
PR: #9358
2001-02-21 07:18:28 +00:00
Egon Schmid
d27ebba71f Wrong return type. 2001-02-16 13:13:52 +00:00
Thies C. Arntzen
8499b430cf @- Fixed some modules to allow using output-buffering. (Thies)
i nuked all unneded calls to php_header() - i'm not too sure how we do
handle HEAD Requests as they were only detected via php_header(). but calling
php_header from a module makes output-buffering unusable.

NOTICE: there is some EBSDIC stuff in gd.c - i think it's obsolete.
2001-02-15 14:49:01 +00:00
Sean Bright
ef2e1a72cf Fix for bug #4556
# This is pretty much a total rewrite of get_meta_tags using a simple
# handwritten tokenizer.  It might be overkill, but it works.
2001-02-11 02:38:40 +00:00
Rasmus Lerdorf
4877d13ffa What the heck is CUT? Assume someone meant UTC here. And fix a
warning.
2001-02-09 15:28:23 +00:00
Stanislav Malyshev
5af00138e9 Add utility function 2001-02-01 10:24:02 +00:00
Rasmus Lerdorf
83cf6629ec @BeOS patch from svanegmond@bang.dhs.org modified somewhat by Rasmus
BeOS patch from svanegmond@bang.dhs.org modified somewhat by Rasmus
2001-01-21 17:29:15 +00:00
Thies C. Arntzen
6b84fb1cde fixed readfile() fd-leak.
guys, always remember that every function that *generates output* could cause a
bailout if ignore_user_abort is set to false (and the user _aborts_ the
connection). in this case a longjump will be performed and our function (in
this case readfile) will have no chance to clean-up. having said that it's a
good idea to register all opened files using REGISTER_RESOURCE - that way the
engine will make sure they get closed on request end.
2001-01-14 14:11:38 +00:00
Zeev Suraski
a85da45a66 Both thread-safe and thread-unsafe builds should be ok now 2001-01-13 23:49:44 +00:00
Zeev Suraski
86624dfad9 - Fix exec() bug
- Merge fsock and file globals
2001-01-13 13:59:22 +00:00
Zeev Suraski
338b9b0819 - Make the INI mechanism thread safe (fix necessary API changes from Zend)
- Make the Win32 non-TS configuration build again
2000-12-27 15:43:05 +00:00
Sascha Schumann
9815d5c94c Signal an error condition, if write was unable to perform the complete
operation.
2000-12-22 19:26:02 +00:00
Sascha Schumann
663d426e74 NULL is a valid return value of mmap. Check against (void *) MAP_FAILED. 2000-12-22 16:39:01 +00:00
Sascha Schumann
3c9f50efaf (php_file_copy) Use mmap to map the source file into our address space
and then simply write it out to the target file.  That avoids switching
between user and kernel land too many times.  If that does not work, we
fall back to the read/write method.
2000-12-22 16:34:11 +00:00
Hartmut Holzgraefe
9b1b253548 fgetcsv() will now work correct with empty fields in tab delimited files
# fix for bug #8258 and regression test
2000-12-14 14:18:36 +00:00
Stanislav Malyshev
0d02c7d337 Open files in binary mode - should fix readfile() on Windows 2000-12-12 17:42:53 +00:00
Sascha Schumann
4ada3dd3a0 Hardcode all functions which are mentioned in the Large File Support Spec
http://ewe3.sas.com/standards/large.file/specs/api+.007.html
2000-12-07 12:09:38 +00:00
Daniel Beulshausen
2fefaba7b6 tsrm realpath implementation is fixed
@ Fixed realpath() in Virtual Directory mode (Daniel)
2000-11-22 10:08:25 +00:00
Stanislav Malyshev
fb8be26654 Fix crash (#7802) 2000-11-15 09:36:21 +00:00
Andi Gutmans
d0ec3df288 - Use CHECKUID_* #define's instead of cryptic numbers in php_checkuid()
- I did not test for validity of the actual php_checkuid() calls and there
- might be mistakes in the previous code.
2000-11-02 23:08:07 +00:00
Andi Gutmans
b25b80c147 - Change some estrdup()'s to estrndup()'s 2000-11-01 14:48:00 +00:00
Zeev Suraski
7ab46420be mode_t fixes 2000-10-31 18:05:19 +00:00
Thies C. Arntzen
825457ae64 update my email. 2000-10-29 09:14:55 +00:00
Daniel Beulshausen
52e45f514b use V_RENAME makro instead 2000-10-26 18:17:45 +00:00
Andrei Zmievski
f1dcb32c9f Use zend_register_list_destructors_ex() instead. 2000-10-25 17:44:02 +00:00
Andrei Zmievski
7b4983c8f8 Mega-patch to get better resource information for modules.
* Fixed a bug in zend_rsrc_list_get_rsrc_type()
  * Switched register_list_destructors() to use
    zend_register_list_destructors_ex() instead
  * Updated all relevant modules to provide the resource type name
    to register_list_destructors() call
  * Updated var_dump() to output resource type name instead of number

@- Made resource type names visible, e.g. var_dump() and
@  get_resource_type() display "file" for file resources. (Andrei)
2000-10-20 18:25:16 +00:00
Sascha Schumann
2e4ab68995 Automatic conversion might cause interpretation of 0xff as EOF, so we store
the result in an object of type int first.

Submitted by: melchers@cis.fu-berlin.de
2000-09-27 16:08:26 +00:00
Andi Gutmans
88b469203c - Fix bug #5997 2000-09-12 04:13:21 +00:00
Andi Gutmans
824fc6a084 - Move php_open_temporary_file() out of file.c 2000-09-11 18:56:47 +00:00
Sascha Schumann
f45f6d788f Kill a warning 2000-09-11 16:25:36 +00:00
Zeev Suraski
3115a0ccfe Fix UNIX build 2000-09-09 12:02:31 +00:00
Zeev Suraski
6c4cb4c079 Security related updates:
- Introduce php_open_temporary_file(), in place of tempnam().  Still
  needs testing under UNIX (mkstemp()), works reliably under Windows now.
- Reimplement the mechanism for unlinking uploaded files at the end of the request
  (was it ever tested?).  Files moved with move_uploaded_file() will not be unlink()'d
  again, to avoid (albeit very unlikely) race conditions.
2000-09-09 11:41:14 +00:00
Stig Bakken
7918735b11 * compile fix 2000-09-09 01:15:50 +00:00
Zeev Suraski
3edf46ff73 Implement move_uploaded_file() (untested) 2000-09-08 22:31:21 +00:00
Torben Wilson
410ac013e8 Fixed segfault with fgets(), fgetcsv(), fgetss(), and fread() when
called with negative length argument.
2000-08-21 19:24:44 +00:00
Stanislav Malyshev
ce0c4a7991 Fix fgetc (#6259) and ftell error condition returns 2000-08-20 13:24:14 +00:00
Sascha Schumann
fbdf502307 Remove php_realpath from build.
It was broken and should not be used in any way.
2000-08-20 05:27:59 +00:00
Frank M. Kromann
61df257c0f We only need winsock.h one time 2000-08-19 21:15:43 +00:00
Zeev Suraski
7a45e3cb89 - Update NEWS
- Fix non ZTS Windows build
2000-08-19 18:01:04 +00:00
Andi Gutmans
c756ae2d9f Virtualize realpath, chmod, chown and utime
This should fix #5935 and #5904
@- Virtualize realpath, chmod, chown and utime (Stas)
2000-08-06 16:22:07 +00:00
Stanislav Malyshev
fda23fc253 Fix fclose prototype (#5930) 2000-08-03 16:37:35 +00:00
David Croft
a5a9a4928b # zeev is god 2000-07-22 04:23:41 +00:00
David Croft
89153d9c05 fixed socket_set blocking in windows
(bug 3845)
2000-07-22 01:53:16 +00:00
Stanislav Malyshev
4d41c8ba49 Fix fgets re-allocation (add +1 to accomondate ending \0). 2000-07-07 09:06:47 +00:00
Andi Gutmans
b9037f7d69 - Make PHP compile again under Windows.
- Please be careful when you make such changes.
2000-07-02 15:12:34 +00:00
Stanislav Malyshev
e8c219fef2 Make fgets not use maximal buffer length always, but shrink buffer
if it's too big.
2000-06-29 13:34:55 +00:00
Thies C. Arntzen
e834812a06 (fgetcsv) fixed leak 2000-06-27 09:55:52 +00:00
Zeev Suraski
52dd20177c Removed 8KB limit on line length of the file() function 2000-06-26 20:52:04 +00:00
Egon Schmid
bcb308c522 Fixed some protos. 2000-06-26 17:57:46 +00:00
Zeev Suraski
6614e8edb4 - I wrote a long msg but the commit didn't go through.
- So here is the short version:
- a) Start moving to binary opens in Windows
- b) Give checkuid_mode() a small face lift including the fopen-wrappers.c
- The mode to this function should at least be a #define but that is for
- another day. Anyway this whole stuff should be given more face lifts in
- the future.
2000-06-25 17:02:59 +00:00
Sascha Schumann
2456af596f Remove some unnecessary CLS_FETCH()s. 2000-06-23 00:53:33 +00:00
Thies C. Arntzen
7dca298b21 copy() now creates the destination file with mode 0777 again. this is
the way it used to be in PHP 3
2000-06-13 15:48:38 +00:00
Andi Gutmans
719d995a9d - On UNIX support popen() which works with current working directory
- when in VIRTUAL_DIR mode.
2000-06-12 19:39:04 +00:00
Clayton Collie
0b7fd17c2b Added sscanf() function. 2000-06-06 18:58:15 +00:00
Thies C. Arntzen
10eb67a3aa @- added fflush() function. (Eric Huss)
# the socket fsync() might not work on Win32.
#
# i'm not sure if we need any code for flushing sockets as they are
# currently alway written via write().
2000-06-06 12:16:44 +00:00
Rasmus Lerdorf
1cefd77f1c Oops, fixed slight miscue there. Now it works. 2000-06-05 19:35:15 +00:00
Rasmus Lerdorf
194e8828a1 @ Clean up constants in flock() function and add optional 3rd arg which
@ is set to true on EWOULDBLOCK (Rasmus)
Clean up constants in flock() function and add optional 3rd arg which
is set to true on EWOULDBLOCK
2000-06-05 17:56:01 +00:00
Zeev Suraski
8715b55ce0 Remove stale macro 2000-05-29 15:31:19 +00:00
Zeev Suraski
124fe30f03 More secure mode 2000-05-29 11:47:38 +00:00
Andi Gutmans
afccb58612 - I'm not sure if PHP_NOT_IN_THIS_BUILD is the way to handle these
- functions but in any case I have changed it to PHP_NOT_IN_THIS_BUILD()
2000-05-27 18:55:11 +00:00
Hartmut Holzgraefe
69d1e788c0 if a module provides a function it should also do so if the function
is not functional due to configure findings
the function should offer a meaningful warning if it is not supported
instead of just beeing undefined
i had already changed this in 'gd', now this is doing it for 'standard'
2000-05-26 17:04:02 +00:00
Hartmut Holzgraefe
df4547a3df another bunch of proto fixes 2000-05-23 23:13:02 +00:00
Andi Gutmans
617266e33e - Virtual current working directory is now enabled
- Added support for mkdir()/rmdir() and more
2000-05-23 17:02:21 +00:00
Andi Gutmans
521f03c184 - Support virtual unlink() 2000-05-23 14:36:27 +00:00
Zeev Suraski
e043439ff6 Update the license with the new clause 6 2000-05-18 15:34:45 +00:00
Andi Gutmans
e13285ded7 - Take Sascha's advice and create on V_OPEN() which replaces open().
- Unlike the other macros its argument has to have braces around it, for
- example, open(filename, flags) becomse V_OPEN((filename, flags))
- Made small conversion to new Zend macros. The ugly (*foo)->value.str.val
- now becomes Z_STRVAL_PP(foo). PP means pointer pointer, there also exist
- single P's for example foo->value.str.val becomes Z_STRVAL_P(foo).
2000-04-30 16:32:36 +00:00
Andrei Zmievski
ec997d5c5b Exterminate warnings. 2000-04-24 14:19:21 +00:00
Andrei Zmievski
071c01a019 The third argument to fseek() is now one of the standard SEEK_* constants.
# The previous change to support seekfrom stuff was incorrect.
2000-04-24 14:18:11 +00:00
Sterling Hughes
21416083b1 @-Add an optional third argument to fseek to indicate were to seek from. (Sterling) 2000-04-23 19:16:24 +00:00
Rasmus Lerdorf
03b562c93e fgetcsv() patch from Nick Talbott
@ The fgetcsv() function now handles embedded end-of-line in a quoted field
@ (Nick Talbott)
2000-04-19 13:03:47 +00:00
Sterling Hughes
b3ecf2feaf ftruncate returns 1 on success and 0 on failure instead of 0 on success and -1 on failure. 2000-03-17 00:44:55 +00:00
Kristian Köhntopp
85940d676f Finished porting recode module. 2000-03-12 19:42:29 +00:00
Sascha Schumann
caeaaf4d98 Fix build on systems which lack snprintf or vsnprintf.
PR: #3786
2000-03-12 15:47:34 +00:00
Stig Bakken
99e0b36321 @Cleaned up extension namespace (Stig)
Cleaned up extension namespace, and changed ext/standard into one single
extension.
2000-03-06 20:37:11 +00:00
Andrei Zmievski
5610800a7b @Added ftruncate() and fstat(), courtesy of Faisal Nasim <faisal@nasim.org> 2000-03-04 17:23:03 +00:00
Egon Schmid
7da7a50c69 More protos. 2000-02-24 08:07:29 +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
29280bb9ec - Get rid of some more evil MSVC5's and switch standard/ to use PHP_WIN32 2000-02-10 21:53:56 +00:00
Zeev Suraski
489b705d4b @- Fixed memory corruption in fgetss(), strip_tags() and gzgetss() (Zeev) 2000-02-08 21:29:18 +00:00
Andrei Zmievski
83a0278171 Not needed. 2000-02-01 22:17:06 +00:00
Zeev Suraski
c47452f729 Compile fix 2000-02-01 22:13:13 +00:00
Andrei Zmievski
a753430fb9 - Implemented socket_get_status() function. Some more stuff can be added
to it in the future.
- Renamed set_socket_timeout() to socket_set_timeout()
- Renamed set_socket_blocking() to socket_set_blocking() but kept the
  old name for compatibility. It now outputs a warning that
  set_socket_timeout() is deprecated but still goes through.
@ Added socket_get_status() function. Renamed:
@   set_socket_timeout() -> socket_set_timeout()
@   set_socket_blocking() -> socket_set_blocking(). (Andrei)
2000-02-01 20:02:44 +00:00
Andrei Zmievski
91bb21c522 Implemented realpath().
@ Added realpath() function. (Andrei)
2000-02-01 06:06:03 +00:00
Andrei Zmievski
bfc85c288a Fix prototype. 2000-01-15 19:42:40 +00:00
Andrei Zmievski
4423bf9d10 Added ability to set timeout on socket read operations. New function
set_socket_timeout(socket, seconds, microseconds) sets the timeout.
@- Added ability to set timeout on socket read operations through
@ set_socket_timeout() function. (Andrei)
2000-01-15 19:41:17 +00:00
Thies C. Arntzen
48e10ec9c4 @- Applied safe-mode patch to popen(). (Patch by Kristian Köhntopp) 2000-01-06 15:27:03 +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
Thies C. Arntzen
e96c5401f1 commented out select() & friends for now - we need to come up with a good API for those! 1999-12-21 16:51:27 +00:00
Andrei Zmievski
1ad5180f28 getParameters -> zend_get_parameters 1999-12-20 17:34:55 +00:00
Zeev Suraski
a1ad2872ee - The tree compiles again 1999-12-18 22:40:35 +00:00
Zeev Suraski
3ee4e65c95 More php3_ annihilation 1999-12-18 04:01:20 +00:00
Zeev Suraski
fb1c77bd4f - Made PHP_VERSION and PHP_OS work again
- More php3_ cleanup
@- Restored the PHP_VERSION and PHP_OS constants (Zeev)
1999-12-17 20:55:31 +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
Andrei Zmievski
33d82cb6d1 get_meta_tags() was using php_stristr() so it needed to be changed.
Optimized it to use php_memnstr() directly.
1999-12-11 19:51:04 +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
Andi Gutmans
2337d110f9 - Added opened_path to php_fopen_wrapper() and the URL fopen wrapper (it's not
always properly set, it's a TODO for all of us).  This enables us to implement
  true 'use' support.
@- Added support for the 'use' keyword - behaves like 'require', but will not
@  use the same file more than once (Andi & Zeev, Zend library)
1999-11-30 20:18:11 +00:00
Sascha Schumann
d462115341 Killing some unused variable warnings 1999-11-24 17:56:31 +00:00
Evan Klinger
18fb96efb4 Freeing the memory would be a good idea... 1999-11-24 06:16:37 +00:00
Evan Klinger
633d18de0f Can't forget fd_isset() 1999-11-24 03:47:58 +00:00
Evan Klinger
769e25e168 First attempt at fd_set() and select()
# Please test thoroughly
1999-11-24 03:05:10 +00:00
Stig Bakken
5f8f410e51 @Added tmpfile() function (Stig)
Removed the mkstemp stuff and added tmpfile() function instead.
1999-11-14 11:05:37 +00:00
Thies C. Arntzen
6b69ebf2b8 eliminated warinigs 1999-10-26 20:09:59 +00:00
Andrei Zmievski
9e0017536d _php3/_php3i -> php rename 1999-10-16 16:35:20 +00:00
Thies C. Arntzen
b5c3c7bfc9 files are now resources, file.c is thread-safe, the le_ vars are no longer shared,
but they are accessible thru "php_file_le_socket(), php_file_le_uploads()..."
i also updated the ftp, pdf and file-upload stuff to match the new requirements.
@- Cleaned up File-Module (Thies)
1999-10-15 15:22:25 +00:00
Thies C. Arntzen
e2d66a6d28 new api fo dl() - renamed php3_dl to php_dl (added compat header) 1999-10-13 19:55:25 +00:00
Thies C. Arntzen
0cc1641447 starting to clean-up/new API'ize and resourcify the file-stuff - nothing happened yet - just renaming things around. 1999-10-12 18:50:05 +00:00
Rasmus Lerdorf
cd0957112b fgetss/gzgetss fixes 1999-09-21 17:50:51 +00:00
Egon Schmid
565c322797 Here was also something missing. 1999-09-20 20:05:26 +00:00
Rasmus Lerdorf
c0dcedcafc Added optional allowable_tags arguments to strip_tags() and fgetss() to
allow you to specify a string of tags that are not to be stripped

Could have used flex for this, and Andrew sent me a flex file to do this,
but I could do the same thing with only minor additions to the existing
state machine and the resulting code is much smaller and tighter.
1999-09-20 15:50:56 +00:00
Andi Gutmans
100148168a - Thread-unsafe win32 compiles again
- Some strlcpy changes including one bug fix.
1999-09-15 05:42:36 +00:00
Zeev Suraski
9e3315799c That's important enough to be cached 1999-09-12 20:36:48 +00:00
Sascha Schumann
2f39b484f5 avoid mmap overhead for small files 1999-09-11 18:38:34 +00:00
Sascha Schumann
dda0b783df optimize fpassthru/readfile to use mmap instead of fread
which especially increases speed on large files.
1999-09-11 18:15:39 +00:00
Zeev Suraski
c12d4bc7d4 *** empty log message *** 1999-09-04 13:18:59 +00:00
Sascha Schumann
52cd153723 merge in fix from php3 1999-08-28 13:53:46 +00:00
Zeev Suraski
3cb1eb0471 Removed '3' from key functions in PHP (maintained compatibility through
php3_compat.h)
1999-08-02 19:17:14 +00:00
Andrey Hristov
1b2c932cc2 More symbol work.
I've defined a few macros to help with module/request init/startup function definitions.
Basically:

PHP_MINIT_FUNCTION(module)
PHP_MSHUTDOWN_FUNCTION(module)
PHP_RINIT_FUNCTION(module)
PHP_RSHUTDOWN_FUNCTION(module)
PHP_MINFO_FUNCTION(module)

These will expand to proper function prototypes.

Now to specify these in the module entry, use:

PHP_MINIT(module)
PHP_MSHUTDOWN(module)
PHP_RINIT(module)
PHP_RSHUTDOWN(module)
PHP_MINFO(module)

I've updated all modules in ext/standard and everything from ext/apache to ext/db.
If you can, please update your module to use these macros.
1999-07-26 20:09:08 +00:00
Andrey Hristov
736f4831a5 A bunch of grunt work updating function entries and declarations. 1999-07-24 22:16:54 +00:00
Andrey Hristov
d1b1e3513f Kill compiler warnings. 1999-07-19 15:07:17 +00:00
Zeev Suraski
c5724cbd14 License update 1999-07-16 13:13:16 +00:00
Sascha Schumann
e205a6749d more porting 1999-06-27 21:45:06 +00:00
Stig Bakken
117a2fba07 * fixed some #if/#ifdef issues
* hand-patched in php3 changes from 3.0.6 to HEAD in these files:
   fopen-wrappers.[ch] ext/standard/file.[ch] ext/standard/fsock.[ch]
   ext/standard/php3_string.h ext/standard/string.c
* added some new file/socket macros for more readable code:
   FP_FGETS(buf,len,sock,fp,issock)
   FP_FREAD(buf,len,sock,fp,issock)
   FP_FEOF(sock,fp,issock)
   FP_FGETC(sock,fp,issock)
1999-06-16 17:06:53 +00:00