Commit 10f5b47d authored by Mark A. Hershberger's avatar Mark A. Hershberger

Imported Upstream version 5.0.5

parent 0e920280
......@@ -69,7 +69,7 @@ clean:
distclean: clean
rm -f config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h stamp-h php5.spec sapi/apache/libphp5.module buildmk.stamp
egrep define'.*include/php' configure|sed 's/.*>//'|xargs rm -f
egrep define'.*include/php' $(top_srcdir)/configure|sed 's/.*>//'|xargs rm -f
find . -name Makefile | xargs rm -f
.PHONY: all clean install distclean test
......
This diff is collapsed.
......@@ -535,12 +535,6 @@ TSRM_API void tsrm_mutex_free(MUTEX_T mutexp)
#ifdef TSRM_WIN32
DeleteCriticalSection(mutexp);
free(mutexp);
#elif defined(NETWARE)
#ifdef USE_MPK
kMutexFree(mutexp);
#else
NXMutexFree(mutexp);
#endif
#elif defined(GNUPTH)
free(mutexp);
#elif defined(PTHREADS)
......@@ -570,12 +564,6 @@ TSRM_API int tsrm_mutex_lock(MUTEX_T mutexp)
#ifdef TSRM_WIN32
EnterCriticalSection(mutexp);
return 1;
#elif defined(NETWARE)
#ifdef USE_MPK
return kMutexLock(mutexp);
#else
return NXLock(mutexp);
#endif
#elif defined(GNUPTH)
return pth_mutex_acquire(mutexp, 0, NULL);
#elif defined(PTHREADS)
......@@ -601,12 +589,6 @@ TSRM_API int tsrm_mutex_unlock(MUTEX_T mutexp)
#ifdef TSRM_WIN32
LeaveCriticalSection(mutexp);
return 1;
#elif defined(NETWARE)
#ifdef USE_MPK
return kMutexUnlock(mutexp);
#else
return NXUnlock(mutexp);
#endif
#elif defined(GNUPTH)
return pth_mutex_release(mutexp);
#elif defined(PTHREADS)
......
......@@ -87,7 +87,7 @@ int main() {
], [
dnl For cross compiling running this test is of no use. NetWare supports pthreads
pthreads_working=no
case $target_alias in
case $host_alias in
*netware*)
pthreads_working=yes
esac
......
......@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
/* $Id: tsrm_virtual_cwd.c,v 1.62.2.5 2005/03/11 11:09:42 hyanantha Exp $ */
/* $Id: tsrm_virtual_cwd.c,v 1.62.2.7 2005/07/16 11:50:59 hyanantha Exp $ */
#include <sys/types.h>
#include <sys/stat.h>
......@@ -42,8 +42,7 @@
#endif
#ifdef NETWARE
/*#include "pipe.h"*/
#include "tsrm_nw.h"
#include <fsio.h>
#endif
#ifndef HAVE_REALPATH
......@@ -142,15 +141,9 @@ static int php_check_dots(const char *element, int n)
static int php_is_dir_ok(const cwd_state *state)
{
#if !(defined(NETWARE) && defined(CLIB_STAT_PATCH))
struct stat buf;
if (stat(state->cwd, &buf) == 0 && S_ISDIR(buf.st_mode))
#else
struct stat_libc buf;
if (stat(state->cwd, (struct stat*)(&buf)) == 0 && S_ISDIR(buf.st_mode))
#endif
return (0);
return (1);
......@@ -158,15 +151,9 @@ static int php_is_dir_ok(const cwd_state *state)
static int php_is_file_ok(const cwd_state *state)
{
#if !(defined(NETWARE) && defined(CLIB_STAT_PATCH))
struct stat buf;
if (stat(state->cwd, &buf) == 0 && S_ISREG(buf.st_mode))
#else
struct stat_libc buf;
if (stat(state->cwd, (struct stat*)(&buf)) == 0 && S_ISREG(buf.st_mode))
#endif
return (0);
return (1);
......@@ -202,7 +189,20 @@ CWD_API void virtual_cwd_startup(void)
char cwd[MAXPATHLEN];
char *result;
#ifdef NETWARE
result = getcwdpath(cwd, NULL, 1);
if(result)
{
char *c=cwd;
while(c = strchr(c, '\\'))
{
*c='/';
++c;
}
}
#else
result = getcwd(cwd, sizeof(cwd));
#endif
if (!result) {
cwd[0] = '\0';
}
......@@ -445,8 +445,19 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
state->cwd[state->cwd_length++] = DEFAULT_SLASH;
}
#elif defined(NETWARE)
/* If the token is a volume name, it will have colon at the end -- so, no slash before it */
if (ptr[ptr_length-1] != ':') {
/*
Below code keeps appending to state->cwd a File system seperator
cases where this appending should not happen is given below,
a) sys: should just be left as it is
b) sys:system should just be left as it is,
Colon is allowed only in the first token as volume names alone can have the : in their names.
Files and Directories cannot have : in their names
So the check goes like this,
For second token and above simply append the DEFAULT_SLASH to the state->cwd.
For first token check for the existence of :
if it exists don't append the DEFAULT_SLASH to the state->cwd.
*/
if(((state->cwd_length == 0) && (strchr(ptr, ':') == NULL)) || (state->cwd_length > 0)) {
state->cwd[state->cwd_length++] = DEFAULT_SLASH;
}
#else
......@@ -716,7 +727,6 @@ CWD_API int virtual_rename(char *oldname, char *newname TSRMLS_DC)
return retval;
}
#if !(defined(NETWARE) && defined(CLIB_STAT_PATCH))
CWD_API int virtual_stat(const char *path, struct stat *buf TSRMLS_DC)
{
cwd_state new_state;
......@@ -730,21 +740,6 @@ CWD_API int virtual_stat(const char *path, struct stat *buf TSRMLS_DC)
CWD_STATE_FREE(&new_state);
return retval;
}
#else
CWD_API int virtual_stat(const char *path, struct stat_libc *buf TSRMLS_DC)
{
cwd_state new_state;
int retval;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
virtual_file_ex(&new_state, path, NULL, 1);
retval = stat(new_state.cwd, (struct stat*)buf);
CWD_STATE_FREE(&new_state);
return retval;
}
#endif
#ifndef TSRM_WIN32
CWD_API int virtual_lstat(const char *path, struct stat *buf TSRMLS_DC)
......
......@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
/* $Id: tsrm_virtual_cwd.h,v 1.42.2.1 2005/03/11 11:07:17 hyanantha Exp $ */
/* $Id: tsrm_virtual_cwd.h,v 1.42.2.3 2005/07/16 11:50:59 hyanantha Exp $ */
#ifndef VIRTUAL_CWD_H
#define VIRTUAL_CWD_H
......@@ -74,10 +74,8 @@ typedef unsigned short mode_t;
#define DEFAULT_DIR_SEPARATOR ';'
#define IS_SLASH(c) ((c) == '/' || (c) == '\\')
#define IS_SLASH_P(c) IS_SLASH(*(c))
#define COPY_WHEN_ABSOLUTE(path) \
(strchr(path, ':') - path + 1) /* Take the volume name which ends with a colon */
#define IS_ABSOLUTE_PATH(path, len) \
(strchr(path, ':') != NULL) /* Colon indicates volume name */
((strchr(path, ':') != NULL) || ((len >= 1) && ((path[0] == '/') || (path[0] == '\\'))))
#else
#ifdef HAVE_DIRENT_H
......@@ -141,11 +139,7 @@ CWD_API FILE *virtual_fopen(const char *path, const char *mode TSRMLS_DC);
CWD_API int virtual_open(const char *path TSRMLS_DC, int flags, ...);
CWD_API int virtual_creat(const char *path, mode_t mode TSRMLS_DC);
CWD_API int virtual_rename(char *oldname, char *newname TSRMLS_DC);
#if !(defined(NETWARE) && defined(CLIB_STAT_PATCH))
CWD_API int virtual_stat(const char *path, struct stat *buf TSRMLS_DC);
#else
CWD_API int virtual_stat(const char *path, struct stat_libc *buf TSRMLS_DC);
#endif
#if !defined(TSRM_WIN32) && !defined(NETWARE)
CWD_API int virtual_lstat(const char *path, struct stat *buf TSRMLS_DC);
#endif
......
dnl
dnl $Id: Zend.m4,v 1.43.2.4 2005/03/10 09:50:37 hyanantha Exp $
dnl $Id: Zend.m4,v 1.43.2.5 2005/06/07 17:22:56 sniper Exp $
dnl
dnl This file contains Zend specific autoconf functions.
dnl
......@@ -136,6 +136,15 @@ AC_ARG_ENABLE(debug,
AC_DEFUN([LIBZEND_OTHER_CHECKS],[
AC_ARG_ENABLE(zend-memory-manager,
[ --disable-zend-memory-manager
Disable the Zend memory manager - FOR DEVELOPERS ONLY!!],
[
ZEND_USE_ZEND_ALLOC=$enableval
], [
ZEND_USE_ZEND_ALLOC=yes
])
AC_ARG_ENABLE(maintainer-zts,
[ --enable-maintainer-zts Enable thread safety - for code maintainers only],[
ZEND_MAINTAINER_ZTS=$enableval
......@@ -165,6 +174,9 @@ AC_ARG_ENABLE(zend-multibyte,
ZEND_MULTIBYTE=no
])
AC_MSG_CHECKING(whether to enable the Zend memory manager)
AC_MSG_RESULT($ZEND_USE_ZEND_ALLOC)
AC_MSG_CHECKING(whether to enable thread-safety)
AC_MSG_RESULT($ZEND_MAINTAINER_ZTS)
......@@ -195,6 +207,12 @@ fi
test -n "$DEBUG_CFLAGS" && CFLAGS="$CFLAGS $DEBUG_CFLAGS"
if test "$ZEND_USE_ZEND_ALLOC" = "yes"; then
AC_DEFINE(USE_ZEND_ALLOC,1,[Use Zend memory manager])
else
AC_DEFINE(USE_ZEND_ALLOC,0,[Use Zend memory manager])
fi
if test "$ZEND_MAINTAINER_ZTS" = "yes"; then
AC_DEFINE(ZTS,1,[ ])
CFLAGS="$CFLAGS -DZTS"
......
......@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
/* $Id: acconfig.h,v 1.34.2.2 2005/03/11 06:51:01 hyanantha Exp $ */
/* $Id: acconfig.h,v 1.34.2.3 2005/07/29 09:20:02 hyanantha Exp $ */
#define ZEND_API
#define ZEND_DLEXPORT
......@@ -98,6 +98,13 @@ int zend_sprintf(char *buffer, const char *format, ...);
#endif /* ifndef ZEND_ACCONFIG_H_NO_C_PROTOS */
#ifdef NETWARE
#ifdef USE_WINSOCK
#/*This detection against winsock is of no use*/ undef HAVE_SOCKLEN_T
#/*This detection against winsock is of no use*/ undef HAVE_SYS_SOCKET_H
#endif
#endif
/*
* Local variables:
* tab-width: 4
......
......@@ -39,5 +39,5 @@ echo "Done\n";
2
3
Done
test::destructor
test::__destruct
test::destructor
......@@ -64,11 +64,3 @@ string(3) "foo"
Notice: Undefined variable: a in %s on line %d
Strict Standards: Only variable references should be returned by reference in %s on line %d
string(3) "foo"
'foo'
Notice: Undefined variable: a in %s on line %d
Strict Standards: Only variable references should be returned by reference in %s on line %d
--TEST--
Bug #27268 (Bad references accentuated by clone)
--FILE--
<?php
class A
{
public function &getA()
{
return $this->a;
}
}
$A = new A;
$A->a = array(1);
$x = $A->getA();
$clone = clone $A;
$clone->a = array();
print_r($A);
?>
--EXPECT--
A Object
(
[a] => Array
(
[0] => 1
)
)
--TEST--
Bug #27304
--FILE--
<?php
class Staticexample
{
static function test()
{
var_dump(isset($this));
}
}
$b = new Staticexample();
Staticexample::test();
$b->test();
?>
===DONE===
--EXPECT--
bool(false)
bool(false)
===DONE===
--TEST--
Bug #27598 (list() array key assignment causes HUGE memory leak)
--FILE--
<?php
list($out[0]) = array(1);
var_dump($out);
?>
--EXPECT--
array(1) {
[0]=>
int(1)
}
--TEST--
Bug #28377 (debug_backtrace is intermittently passing args)
--FILE--
<?php
function doit($a, $b)
{
$trace = debug_backtrace();
custom_callback('dereferenced', $trace);
custom_callback('direct', debug_backtrace());
}
function custom_callback($traceName, $btInfo)
{
echo $traceName ." -- args: ";
echo isset($btInfo[0]['args']) ? count($btInfo[0]['args']) : 'does not exist';
echo "\n";
}
doit('a','b');
?>
--EXPECT--
dereferenced -- args: 2
direct -- args: 2
--TEST--
Bug #29015 (Incorrect behavior of member vars(non string ones)-numeric mem vars und others)
--FILE--
<?php
$a = new stdClass();
$x = "";
$a->$x = "string('')";
var_dump($a);
?>
--EXPECTF--
Fatal error: Cannot access empty property in %sbug29015.php on line 4
--TEST--
Bug #29104 Function declaration in method doesn't work
--FILE--
<?php
class A
{
function g()
{
echo "function g - begin\n";
function f()
{
echo "function f\n";
}
echo "function g - end\n";
}
}
$a = new A;
$a->g();
f();
?>
--EXPECT--
function g - begin
function g - end
function f
--TEST--
Bug #29210 Function: is_callable - no support for private and protected classes
--FILE--
<?php
class test_class {
private function test_func1() {
echo "test_func1\n";
}
protected function test_func2() {
echo "test_func2\n";
}
static private function test_func3() {
echo "test_func3\n";
}
static protected function test_func4() {
echo "test_func4\n";
}
function test() {
if (is_callable(array($this,'test_func1'))) {
$this->test_func1();
} else {
echo "test_func1 isn't callable from inside\n";
}
if (is_callable(array($this,'test_func2'))) {
$this->test_func2();
} else {
echo "test_func2 isn't callable from inside\n";
}
if (is_callable(array('test_class','test_func3'))) {
test_class::test_func3();
} else {
echo "test_func3 isn't callable from inside\n";
}
if (is_callable(array('test_class','test_func4'))) {
test_class::test_func4();
} else {
echo "test_func4 isn't callable from inside\n";
}
}
}
class foo extends test_class {
function test() {
if (is_callable(array($this,'test_func1'))) {
$this->test_func1();
} else {
echo "test_func1 isn't callable from child\n";
}
if (is_callable(array($this,'test_func2'))) {
$this->test_func2();
} else {
echo "test_func2 isn't callable from child\n";
}
if (is_callable(array('test_class','test_func3'))) {
test_class::test_func3();
} else {
echo "test_func3 isn't callable from child\n";
}
if (is_callable(array('test_class','test_func4'))) {
test_class::test_func4();
} else {
echo "test_func4 isn't callable from child\n";
}
}
}
$object = new test_class;
$object->test();
if (is_callable(array($object,'test_func1'))) {
$object->test_func1();
} else {
echo "test_func1 isn't callable from outside\n";
}
if (is_callable(array($object,'test_func2'))) {
$object->test_func2();
} else {
echo "test_func2 isn't callable from outside\n";
}
if (is_callable(array('test_class','test_func3'))) {
test_class::test_func3();
} else {
echo "test_func3 isn't callable from outside\n";
}
if (is_callable(array('test_class','test_func4'))) {
test_class::test_func4();
} else {
echo "test_func4 isn't callable from outside\n";
}
$object = new foo();
$object->test();
?>
--EXPECT--
test_func1
test_func2
test_func3
test_func4
test_func1 isn't callable from outside
test_func2 isn't callable from outside
test_func3 isn't callable from outside
test_func4 isn't callable from outside
test_func1 isn't callable from child