Commit Graph

1004 Commits

Author SHA1 Message Date
Sascha Schumann
16017f6d78 Change header protection macros to conform to standard.
Draft 3 of IEEE 1003.1 200x, "2.2 The Compilation Environment"

  All identifiers that begin with an underscore and either an uppercase
  letter or another underscore are always reserved for any use by the
  implementation.
2000-07-02 23:46:51 +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
Kristian Köhntopp
0249137148 unlink() is not a function related to HAVE_SYMLINK. It is being
used to delete files (actually, in Unix, names of files, as in
Unix nobody has deleted a file, ever).
2000-07-02 13:41:26 +00:00
Andi Gutmans
50e9b1fe36 - Commit tiny patch to remove redundant code by Amit Schreiber. 2000-07-01 12:23:09 +00:00
Zeev Suraski
7fb72c1726 Fixed opendir() thoroughly 2000-06-29 21:51:40 +00:00
Stanislav Malyshev
740fc2f5de Lowercase class name before looking for it 2000-06-29 14:49:23 +00:00
Kristian Köhntopp
02cad904ee ezmlm_hash() function also available for php4. 2000-06-29 14:07:10 +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
Andrei Zmievski
49365eea79 Oops, didn't mean to commit that. 2000-06-28 20:09:04 +00:00
Andrei Zmievski
29e8e565c6 @- Added an optional parameter to preg_replace() that can be used to
@  specify how many replacements to make. (Andrei)
2000-06-28 20:07:26 +00:00
Zeev Suraski
c860633741 Fixed a bug in opendir(), which prevented readdir() from working properly if
the $dir argument wasn't explicitly specified
2000-06-27 18:44:30 +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
Zeev Suraski
33d4092590 - Disabled dl() when PHP is being used as a module inside a multithreaded web
server - it didn't work before, and caused weird results (Zeev)
2000-06-26 18:27:12 +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
Egon Schmid
bcb308c522 Fixed some protos. 2000-06-26 17:57:46 +00:00
Stanislav Malyshev
8fd20c3ec7 Make exec() fwork on Unix again 2000-06-26 17:12:38 +00:00
Kristian Köhntopp
2c32d120b2 Corrected a syntax error: Macro requires braces. 2000-06-26 14:55:38 +00:00
Kristian Köhntopp
c54fa54e36 Added function php_sapi_name() as written by Stefan Livieratos. 2000-06-26 14:43:37 +00:00
Egon Schmid
2deed22e5c Now its a todo. 2000-06-25 17:55:13 +00:00
Egon Schmid
9f0eba9f10 It was Jouni: Prevent Hartmut finding this until it is actually implemented... 2000-06-25 17:21:04 +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
Egon Schmid
5f98304f55 The second array_merge() is now array_merge_recursive(). 2000-06-25 13:21:37 +00:00
Egon Schmid
ac523aa37e Correct protos call_user_func() and call_user_method(). 2000-06-24 18:46:17 +00:00
Zeev Suraski
d1a6a64675 - Make the output globals accessible from the outside world
- Fix Win32 compilation
2000-06-24 13:27:34 +00:00
Egon Schmid
e9484d5c37 Added a description to get_browser(). 2000-06-23 19:55:49 +00:00
Sascha Schumann
1702067ac0 API change: Use zval * instead of zval ** 2000-06-23 16:58:30 +00:00
Sascha Schumann
091dc3840d Move the incomplete class stuff into its own file, so that we can
make it easier accessible to WDDX.
2000-06-23 16:46:04 +00:00
Sascha Schumann
2297f670b1 Change the serialization semantics to:
* if a certain object is of class INCOMPLETE_CLASS, the serializer will
    lookup the previously stored original class name of that object, and
    use that class name to serialize the object.

Change the deserialization semantics to:

  * if the class of an object, which is to be instantiated, is not found
    in the current context, the class name will be stored for later
    retrieval, and the class of that object is changed to INCOMPLETE_CLASS.

All function calls, property gets, and property sets operating on an
object of class INCOMPLETE_CLASS cause the execution to halt and to
output an informative error message.
2000-06-23 16:21:31 +00:00
Thies C. Arntzen
cfa7028d66 @- added spliti() function. (Thies) 2000-06-23 11:48:02 +00:00
Hartmut Holzgraefe
7d3341bee3 debug-code removed 2000-06-23 05:49:32 +00:00
Hartmut Holzgraefe
234f029727 this change should solve all problems regarding trans_sid_id and
"empty" href urls like "", "#name", "?param=val" ...
2000-06-23 05:42:41 +00:00
Sascha Schumann
2456af596f Remove some unnecessary CLS_FETCH()s. 2000-06-23 00:53:33 +00:00
Rasmus Lerdorf
777f8dccca Add a crc32 checksum function - used by the udm_search search engine
and currently run through a system call.  This will speed up the udm_search
php frontend significantly.
@ Add a crc32 checksum function - used by the udm_search search engine
@ and currently run through a system call.  This will speed up the udm_search
@ php frontend significantly. (Rasmus)
2000-06-21 22:51:29 +00:00
Sascha Schumann
9d640cc990 Revert earlier commit. 2000-06-21 18:35:54 +00:00
Thies C. Arntzen
bc8d0782dd unserialize() and wddx_deserialize() now create an empty class if they enconter
a class which's code is yet unknown. this makes sessionized data retain the
class name of objects even if you visited pages that don't have the classes
code available.
2000-06-21 18:22:22 +00:00
Ben Mansell
6a449f2b02 Initialise lcg_globals correctly
# Fixes bug 5075
2000-06-20 11:35:12 +00:00
Thies C. Arntzen
520602ae4e (fsockopen) fix #5090 2000-06-19 09:02:48 +00:00
Andi Gutmans
baadf90fb5 - Nuke warning 2000-06-18 20:09:17 +00:00
Thies C. Arntzen
5b1f7bc8ac (implode), (strtr) no longer touch the internal array-pointer. 2000-06-18 10:37:01 +00:00
Thies C. Arntzen
405d07de96 (serialize) no longer touches the internal array-pointer 2000-06-18 10:25:39 +00:00
Andrei Zmievski
10b5f74855 One more place. 2000-06-18 03:45:08 +00:00
Andrei Zmievski
789aa48043 @- Modified in_array() to not touch array pointer. (Andrei) 2000-06-18 03:43:58 +00:00
Zeev Suraski
da66298659 - Fix a couple of wranings in the FTP code and in parsedate.y
- Be safer with LC_MESSAGES
- Align with the latest Zend change in call_user_function_ex()
2000-06-17 16:49:03 +00:00
Andrei Zmievski
6e1dee8c1e Have to use zval_ptr_dtor() on values returned from user functions. 2000-06-17 15:53:33 +00:00
Andi Gutmans
1e5a405c5c - Make Windows compile
- Windows doesn't support LC_MESSAGES
2000-06-17 14:48:03 +00:00
Hartmut Holzgraefe
1d92510032 changed default cell alignment to "left" (see bug id #5048) 2000-06-17 07:08:53 +00:00
Hartmut Holzgraefe
34cc1de229 setlocale didn't recognize LC_MESSAGES (BUG ID#3957) 2000-06-17 06:25:47 +00:00
Andrei Zmievski
39aa0c4d3a Just to make extra sure. 2000-06-16 19:55:51 +00:00
Andrei Zmievski
f14961b005 Plug a memory leak: retval_ptr should be destroyed. 2000-06-16 19:53:06 +00:00
Hartmut Holzgraefe
d19a44a6aa typo fix 2000-06-16 18:46:57 +00:00
Andrei Zmievski
71d4206074 Typo. 2000-06-16 18:36:30 +00:00
Hartmut Holzgraefe
87a491d7b6 C++ // comments are evil ... 2000-06-16 18:24:02 +00:00
Andrei Zmievski
e48192fbb5 Use hardcoded 3600 seconds offset instead of altzone which may not be present
on all systems.
2000-06-15 22:23:08 +00:00
Brian Moon
e38d7accb7 set_file_buffer was not being exported. This is now fixed. 2000-06-15 19:02:02 +00:00
Andrei Zmievski
59b455cf2f @- Updated strtotime() to handle many more formats. It now has complete
@  feature parity with GNU date command. (Andrei)
2000-06-15 16:24:10 +00:00
Hartmut Holzgraefe
9ded807a20 return FALSE from strftime on negative timestamp values
they do not make sense anyway and seem to crash win2k
2000-06-14 22:11:10 +00:00
Rasmus Lerdorf
f38e760c39 Refine checkdate() fix to accept numeric strings and floating point as well 2000-06-14 20:31:31 +00:00
Rasmus Lerdorf
0b5ca3f7d5 Require the year arg to checkdate to be an integer - fix for bug #5034
@Require the year arg to checkdate to be an integer (Rasmus)
2000-06-14 16:35:48 +00:00
Andrei Zmievski
e5360259a4 We should define symlink functions only when HAVE_SYMLINK is defined.
Otherwise, they should be aliased as not available.
2000-06-13 18:07:19 +00:00
Sascha Schumann
3ce3e9ba27 Include <math.h> in php_math.h. This is necessary, because we might
otherwise redefine system macros.
2000-06-13 16:35:40 +00:00
Sascha Schumann
66175ef9fe Delete phpdir.h. Someone moved this to php_dir.h in the past and
forgot to delete it.
2000-06-13 16:34:18 +00:00
Sascha Schumann
d1c1e99d98 Rename phpmath.h to php_math.h. 2000-06-13 16:31:57 +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
Sascha Schumann
6caf633cf7 Proper casts 2000-06-13 09:17:06 +00:00
Sascha Schumann
5bbc4114f1 Remove extra cast. ch' is already of type char *'.
This unbreaks the build with xlc on AIX.
2000-06-13 09:09:33 +00:00
Sascha Schumann
165361a515 Remove single ; 2000-06-13 09:06:31 +00:00
Andrei Zmievski
c85390a691 (php_math_number_format) Simplifying the logic also fixed bugs #4954
and #4998.
2000-06-13 04:31:02 +00:00
Zeev Suraski
6bbf0105af Fix a bug in extension_dir, where PG(extension_dir) is not yet initialized by the time php_dl() is called 2000-06-12 21:01:03 +00:00
Zeev Suraski
fce92e3ca2 Avoid using E_CORE_* errorlevels in any place which is not in the global startup sequence 2000-06-12 20:22:17 +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
Andrei Zmievski
ab99eb59fb (PHP str_pad) Terminate string with a null. 2000-06-12 16:06:27 +00:00
Egon Schmid
e465e94a12 Fixed a proto. 2000-06-12 15:17:08 +00:00
Egon Schmid
1769d69ca3 Fixed protos. 2000-06-12 14:44:16 +00:00
Andi Gutmans
e7c50e4866 - Untested but it should fix the problem with cyr_convert() not being
- binary safe and destroying other values in the script
2000-06-11 17:23:38 +00:00
Stig Venaas
2e738b519f Forgot to set_compare_func in the new array functions, had only tested
with older source.
2000-06-11 12:20:42 +00:00
Stig Venaas
f18b903d5f Changed array_subtract to array_diff 2000-06-10 19:09:56 +00:00
Stig Venaas
99f151f1bd Adding fuctions array_unique, array_intersect and array_subtract. 2000-06-10 18:58:45 +00:00
Andrei Zmievski
3570258050 @- Fixed 'Z' flag in date() to adjust for daylight savings time. (Andrei) 2000-06-09 20:18:36 +00:00
Zeev Suraski
d975678006 @- Fixed var_dump() not to modify the internal order of array elements (Zeev)
Fixed the buffer overflow as well
2000-06-09 15:13:36 +00:00
Andrei Zmievski
ef1d6987fd @- Fixed stripcslashes() to remove to strip \ in unknown escapes instead of
@  leaving it. (Andrei)
2000-06-09 13:58:10 +00:00
Zeev Suraski
cbd3f41ba8 Fix #4928
Be *CAREFUL* with the _ex API, guys!
2000-06-09 13:15:19 +00:00
Stanislav Malyshev
6cac26c21f Make chmod in safe mode not allow SUID bits 2000-06-09 10:34:53 +00:00
Andi Gutmans
6ce07a85e4 - Change register_internal_class to zend_register_internal_class for
- consistency.
- Andrei: I'm still thinking about the _ex you want me to implement
2000-06-09 08:41:59 +00:00
Zeev Suraski
9c88d20070 Move back everything to where it belongs... 2000-06-09 01:50:44 +00:00
Zeev Suraski
2ffa48b447 Restore the check for the trailing slash. Windows does not apply s#/+#/# (PR 4375) 2000-06-09 00:43:43 +00:00
Thies C. Arntzen
c183168481 beautify 2000-06-07 09:55:37 +00:00
Rasmus Lerdorf
ff843bacf4 Make trim strip \0 to match php 3
@ Make trim strip \0 to match php 3 (Rasmus)
2000-06-07 00:59:14 +00:00
Andrei Zmievski
b928bdceb8 @- Added str_pad() for padding a string with an arbitrary string on left or
@  right. (Andrei)

Added str_pad() for padding a string with an arbitrary string on left or right.

# With all those macros, the code is starting to eerily resemble Perl's guts.
2000-06-06 20:42:33 +00:00
Clayton Collie
8e58cc501f Modified Makefile.in so scanf.c compiles 2000-06-06 19:11:50 +00:00
Clayton Collie
0b7fd17c2b Added sscanf() function. 2000-06-06 18:58:15 +00:00
Andi Gutmans
d7ac0f2c9d - I didn't have anything to do with this buggy code. Just kidding :) 2000-06-06 18:54:00 +00:00
Frank M. Kromann
a14261bc42 adding definition for EWOULDBLOCK for Win32 to compile 2000-06-06 18:30:06 +00:00
Hartmut Holzgraefe
7864fdfdee added missing '/' to closing <center> tag (BUG ID #4416) 2000-06-06 17:26: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
Sascha Schumann
45a5555b09 Move global.h to php_global.h. 2000-06-05 23:59:06 +00:00
Sascha Schumann
102c6ce4b8 Move main.h to php_main.h. 2000-06-05 23:24:42 +00:00
Andi Gutmans
3701bc4207 - ARG_COUNT(ht) -> ZEND_NUM_ARGS() mega patch 2000-06-05 19:47:54 +00:00
Rasmus Lerdorf
1cefd77f1c Oops, fixed slight miscue there. Now it works. 2000-06-05 19:35:15 +00:00
Jouni Ahto
9d2bcf2bd0 - Restore locale settings to state they were at module startup if they
were changed.
2000-06-05 18:47:34 +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
4a1da8b6f9 Fix Win32 build 2000-06-04 22:00:17 +00:00
Rasmus Lerdorf
7eec1997ef @ Add SWF support to getimagesize() function (Derick Rethans)
Add SWF support to getimagesize() function
2000-06-04 18:29:15 +00:00
Stanislav Malyshev
a23c64ee8b \0 is part of they key, but not of the variable 2000-06-04 15:43:04 +00:00
Stanislav Malyshev
5af7dff758 add opendir to VIRTUAL_DIR 2000-06-04 08:29:11 +00:00
Stanislav Malyshev
7f158268aa chdir returns 0 on success, compare against it 2000-06-04 07:57:40 +00:00
Zeev Suraski
5673378ea6 - Allow all functions that receive user-defined function callbacks to accept
an array that contains an object and a method name, in place of a function
  name, e.g. usort($array, array($obj, "ObjSort"))
(I checked the code in array.c and basic_functions.c, other code which uses
call_user_function() may still force the function_name argument to be of type
IS_STRING, which prevents this feature from working - and is no longer necessary)
2000-06-03 04:16:46 +00:00
Zeev Suraski
d1f1d40527 - Make the INI entries sorted in phpinfo() 2000-06-03 03:05:29 +00:00
Zeev Suraski
ab36e22aeb Small optimization 2000-06-02 12:24:24 +00:00
Jouni Ahto
467c4314b8 (ucwords) Remove unnecessary code.
# Didn't keep my promise to stop...
2000-06-01 14:56:28 +00:00
Jouni Ahto
c106ab8ba0 (ucwords) Yet another fix for #4748.
# Last one from me today, I must have a beer now.
2000-06-01 14:40:41 +00:00
Andrei Zmievski
48db9618b8 Some tweaks. 2000-06-01 14:18:45 +00:00
Andrei Zmievski
4c818aec33 @- Added third argument to in_array(). If it's true, then in_array()
@  will use strict comparison instead of the default one. (Andrei)

Fixes bug #4753
2000-06-01 13:52:08 +00:00
Jouni Ahto
30c5b53ad1 (ucwords) Fixed fix for fix for fix for #4748.
# Today's most fixed bug.
2000-06-01 13:38:23 +00:00
Hartmut Holzgraefe
a35237795f uh, off by one?!! this time it's regression-tested, fast and compact 2000-06-01 11:47:48 +00:00
Jouni Ahto
3c51a88d0c (ucwords) Another try to fix #4748. 2000-06-01 10:07:44 +00:00
Hartmut Holzgraefe
f27956eb19 ucwords will now test against isspace() instead of just ==" "
(see BUG #4748)
2000-06-01 09:56:54 +00:00
Jouni Ahto
8fe69306dc Correct fix this time... (?) 2000-05-31 22:44:29 +00:00
Jouni Ahto
1e7c5b8562 Fix a nasty off-by-one with negative numbers.
# Hey, this has been there for years undetected.
2000-05-31 22:27:09 +00:00
Andrei Zmievski
01a4220954 @- Added array_merge_recursive() that will recursively merge values
@  under the same keys. (Andrei)
2000-05-30 17:03:56 +00:00
Zeev Suraski
666a53a247 Forgot to update the makefile 2000-05-29 18:56:51 +00:00
Zeev Suraski
3637589db1 Oh yeah, I said there's no need for it to be defined didn't I? :) 2000-05-29 16:51:27 +00:00
Zeev Suraski
c07a056dac There's really no need for an entire file for a one line function... 2000-05-29 16:13:38 +00:00
Thies C. Arntzen
635d7fbfae allow_call_time_pass_reference fix: similar_text 2000-05-29 15:38:32 +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
Sascha Schumann
0d9c0616f9 Use php_syslog() for system call. On OpenServer 5, syslog is defined to
var_syslog/sys_syslog which causes various problems.

Submitted by: Paul Gardiner <I.T.Manager@barleychalu.co.uk>
2000-05-28 16:22:28 +00:00
Sascha Schumann
9cd4929417 Make syslog module thread-safe. 2000-05-28 16:19:45 +00:00
Hartmut Holzgraefe
fb39eda0d8 a second (cleaner?) try on warnings about unsupported functions 2000-05-27 19:27:20 +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
Zeev Suraski
abb31591ff Add Sam Ruby 2000-05-27 00:24:03 +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
Kristian Köhntopp
e5835b63c9 - Added credits. 2000-05-25 11:01:31 +00:00
Andrei Zmievski
4197a68602 @ Fixed min()/max() segfault. (Andrei) 2000-05-24 19:07:17 +00:00
Hartmut Holzgraefe
e191baa1a3 php_basename() prototype changed according to latest changes in string.c 2000-05-24 05:51:33 +00:00
Hartmut Holzgraefe
df4547a3df another bunch of proto fixes 2000-05-23 23:13:02 +00:00
Rasmus Lerdorf
7182e722ca Need a PHPAPI version of basename for some stuff I am working on.
Also fixed a bug along the way in the basename function.  If it
was fed something like "filename.ext/////" it would return the string
with all the slashes whereas if you fed it "/path/filename.ext////" it
would get it right.
@ Fixed basename() bug where "file.ext///" would not return the same
@ as "/path/file.ext///" (Rasmus)
2000-05-23 20:16:14 +00:00
Hartmut Holzgraefe
ee82f87cbf one little unimportant detail (cut&paste is evil :) 2000-05-23 20:13:10 +00:00
Hartmut Holzgraefe
251cda4941 a little less optimized, but no dirty tricks anymore 2000-05-23 20:07:32 +00:00
Sascha Schumann
5d10b23a78 Make calc_levdist static and fix pointer swapping. 2000-05-23 19:27: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
Sascha Schumann
2aaa538aef Use reentrant version of readdir. If the target platform does not support
the POSIX-like readdir_r, we fall back to readdir. In ZTS mode, this will
cause php_readdir_r calls to be serialized.
2000-05-23 15:13:16 +00:00
Andi Gutmans
22dba603f5 - English fix. 2000-05-23 14:42:22 +00:00
Hartmut Holzgraefe
4571d8ddea name changed from levdist() to levenshtein()
(although i bet we'll get a    levenstein() alias some day)
2000-05-23 14:37:39 +00:00
Andi Gutmans
521f03c184 - Support virtual unlink() 2000-05-23 14:36:27 +00:00
Hartmut Holzgraefe
0eb51100b7 added function "int levdist(string str1, string str2)"
that will calculate the Levenshtein distance between two
strings (faster and possibly more accurate than similar_text())
2000-05-23 14:10:37 +00:00
Andrei Zmievski
03851ced5f Clean up the patch by Hartmut. 2000-05-23 12:38:12 +00:00
Sascha Schumann
4686a3b50e Use #ifdef COMPILE_DL_EXTNAME solely. 2000-05-23 09:33:51 +00:00
Sascha Schumann
2472700dd1 Only print the attention thing, if the MD5 and DES checks failed. 2000-05-23 09:09:11 +00:00
Hartmut Holzgraefe
78cec9f33e again (due to feature request in bug id #3251)
added optional 3rd parameter 'limit' to explode() as in split()
2000-05-23 05:04:28 +00:00