[PHP-DEV] Is it possible to override internal function?

2005-04-05 Thread Piotr Roszatycki
I'd like to create PECL module which could replace mail() function. The new 
function would use SMTP protocol. I can't call any external utilities so this 
is the only posibility to send the mails. The environment is shared hosting 
platform so there are some limits, like forbidding the calling suid-ed 
binaries (like /usr/sbin/sendmail) and low number of user processes.

This have to be hidden implementation so the users won't need to change their 
code, especially calling of mail() function.

Is it possible to override the internal function in additional module?

-- 
 .''`.Piotr Roszatycki, Netia SA
: :' :mailto:[EMAIL PROTECTED]
`. `' mailto:[EMAIL PROTECTED]
  `-

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Build system support for stock FreeBSD autoconf ports

2005-04-05 Thread Joe Orton
On Mon, Apr 04, 2005 at 01:35:37AM -0400, Jon Parise wrote:
 Index: build/build2.mk
 ===
 RCS file: /repository/php-src/build/build2.mk,v
 retrieving revision 1.35
 diff -u -r1.35 build2.mk
 --- build/build2.mk   3 Feb 2005 17:42:42 -   1.35
 +++ build/build2.mk   30 Mar 2005 03:36:08 -
 @@ -32,6 +32,9 @@
  
  targets = $(TOUCH_FILES) configure $(config_h_in)
  
 +PHP_AUTOCONF ?= 'autoconf'
 +PHP_AUTOHEADER ?= 'autoheader'
 +

I doubt that is portable make syntax.

joe

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DEV] Re: Is it possible to override internal function?

2005-04-05 Thread Johannes Schlueter
Hi,

the funxtions are stored in the EG(function_table) hash table. So you could
delete or rename the mail function from there and add a new one. 

APD has an override_function() and a rename_function() which can be used to
replace/rename a function by a user defined one. Maybe the code of these
help you a bit.

http://lxr.php.net/source/pecl/apd/php_apd.c#608

For this being successfull it's important that your extension is loaded
after the standard extension.

Even though this works I doubt that you can can rely on it. (stability,
changing APIs, ...)

johannes

Piotr Roszatycki wrote:

 I'd like to create PECL module which could replace mail() function. The
 new function would use SMTP protocol. I can't call any external utilities
 so this is the only posibility to send the mails. The environment is
 shared hosting platform so there are some limits, like forbidding the
 calling suid-ed binaries (like /usr/sbin/sendmail) and low number of user
 processes.
 
 This have to be hidden implementation so the users won't need to change
 their code, especially calling of mail() function.
 
 Is it possible to override the internal function in additional module?
 

-- 
Johannes Schlter   Mayflower GmbH / ThinkPHP
http://thinkphp.dehttp://blog.thinkphp.de

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DEV] Re: cvs: php-src /ext/spl php_spl.c

2005-04-05 Thread Sebastian Bergmann
Andrey Hristov wrote:
 isn't this going to blow up existing applications that define class 
 File?

 It already blew up existing applications before this commit.

-- 
Sebastian Bergmann  http://www.sebastian-bergmann.de/
GnuPG Key: 0xB85B5D69 / 27A7 2B14 09E4 98CD 6277 0E5B 6867 C514 B85B 5D69

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Re: __autoload() enhancement

2005-04-05 Thread Marcus Boerger
Hello Greg,

Monday, April 4, 2005, 2:04:47 PM, you wrote:

 Andrey Hristov wrote:
  Stanislav,
 Greg probable means something like a stack trace of the autload callbacks
 that were called. This will be a nice addition just like Exception 
 stacktraces
 are (I wish there were stacktraces for Fatal errors).

 yes, a stack trace would be ideal - I knew there was a name for that 
 thing I was describing :)

A stack trace is only some additional information that has no real added
information. Also it is not a real stack trace since what you asked is
just a list of functions called at one level and not the trace up to
that part where a class was missing (which would be a stack trace).

After my last commit you can get a stack trace by throwing an exception
in the last called function. To get a list of all functions being called
just check spl_autoload_functions().

A combination of both would require the engine to be changed to be capable
of handling multiple exceptions - which hopefully we do not want. Right
now a second exception while an exception is already pending results in a
fatal error.

-- 
Best regards,
 Marcusmailto:[EMAIL PROTECTED]

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DEV] Re: cvs: php-src /ext/spl php_spl.c

2005-04-05 Thread Lukas Smith
Sebastian Bergmann wrote:
Andrey Hristov wrote:
isn't this going to blow up existing applications that define class 
File?

 It already blew up existing applications before this commit.
I'd say that all extensions should really follow the 1 prefix per ext 
for anything that ends up in the global namespace (classes, functions. 
constants ..) rule. Just as we did in the past with new procudural 
extensions.

This has the advantage of:
- limiting the number of namespace clashes with user code
- makes it clear what extensions may/are colliding and what steps need 
to be taken to fix the situation

regards,
Lukas
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP-DEV] Re: cvs: php-src /ext/spl php_spl.c

2005-04-05 Thread Jared Williams
 
 I'd say that all extensions should really follow the 1 prefix 
 per ext for anything that ends up in the global namespace 
 (classes, functions. 
 constants ..) rule. Just as we did in the past with new 
 procudural extensions.
 
 This has the advantage of:
 - limiting the number of namespace clashes with user code
 - makes it clear what extensions may/are colliding and what 
 steps need to be taken to fix the situation
 

I'd prefered explicit importing of classes.

?php
spl_import('File'); 
?

To bring in the File class (and any dependancies) into the global namespace, at 
run time.

Jared 

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] PHP 5.1 Beta 1

2005-04-05 Thread Sebastian Bergmann
Andi Gutmans wrote:
 I'd like to roll PHP 5.1 Beta 1 very soon.

 What about the ability to declare type-hinted parameters as optional?

-- 
Sebastian Bergmann  http://www.sebastian-bergmann.de/
GnuPG Key: 0xB85B5D69 / 27A7 2B14 09E4 98CD 6277 0E5B 6867 C514 B85B 5D69

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Re: cvs: php-src /ext/spl php_spl.c

2005-04-05 Thread Marcus Boerger
Hello Jared,

Tuesday, April 5, 2005, 1:58:04 PM, you wrote:

 
 I'd say that all extensions should really follow the 1 prefix 
 per ext for anything that ends up in the global namespace 
 (classes, functions. 
 constants ..) rule. Just as we did in the past with new 
 procudural extensions.
 
 This has the advantage of:
 - limiting the number of namespace clashes with user code
 - makes it clear what extensions may/are colliding and what 
 steps need to be taken to fix the situation
 

 I'd prefered explicit importing of classes.

 ?php
 spl_import('File'); 
?

 To bring in the File class (and any dependancies) into the global namespace, 
 at run time.

That'd be to slow because that looks like doing it all the time.
If only we could manage to have a nice way to only need to do that
once...

Best regards,
 Marcusmailto:[EMAIL PROTECTED]

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Re: __autoload() enhancement

2005-04-05 Thread Greg Beaver
Marcus Boerger wrote:
Hello Greg,
Monday, April 4, 2005, 2:04:47 PM, you wrote:

Andrey Hristov wrote:
Stanislav,
Greg probable means something like a stack trace of the autload callbacks
that were called. This will be a nice addition just like Exception 
stacktraces
are (I wish there were stacktraces for Fatal errors).

yes, a stack trace would be ideal - I knew there was a name for that 
thing I was describing :)

A stack trace is only some additional information that has no real added
information. Also it is not a real stack trace since what you asked is
just a list of functions called at one level and not the trace up to
that part where a class was missing (which would be a stack trace).
I imagined that a failed __autoload() would leave the old on one the 
call stack, as if the user had inserted the call to the new __autoload() 
before the last closing }.

After my last commit you can get a stack trace by throwing an exception
in the last called function. To get a list of all functions being called
just check spl_autoload_functions().
The exception solution will only work if the user puts a throw() in 
there.  The list of functions would be more useful, imo.

A combination of both would require the engine to be changed to be capable
of handling multiple exceptions - which hopefully we do not want. Right
now a second exception while an exception is already pending results in a
fatal error.
I don't think putting exceptions into __autoload is a good idea at all, 
the only use exceptions serve is to bubble out of contexts, whereas an 
undefined class will simply error out.  Simpler is to provide an option 
for users to define an error handler that can display the __autoload() 
functions used with some kind of listing function, whether it is 
spl_autoload_functions() or an engine feature.

Greg
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DEV] Re: __autoload() enhancement

2005-04-05 Thread Stanislav Malyshev
GBcall stack, as if the user had inserted the call to the new
GB__autoload()  before the last closing }.

Too much magic, IMO. All you need to know is the list of functions, you 
don't need any 'stack' since they do not call each one.

-- 
Stanislav Malyshev, Zend Products Engineer   
[EMAIL PROTECTED]  http://www.zend.com/ +972-3-6139665 ext.115

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Re: __autoload() enhancement

2005-04-05 Thread Andrey Hristov
Marcus Boerger wrote:
Hello Andrey,
Tuesday, April 5, 2005, 5:21:17 PM, you wrote:

Stanislav Malyshev wrote:
GBcall stack, as if the user had inserted the call to the new
GB__autoload()  before the last closing }.
Too much magic, IMO. All you need to know is the list of functions, you 
don't need any 'stack' since they do not call each one.
I completeley agree with Stanislav here, way to much magic: The engine
should never fumble around with a trace before making it accessible.
 Stanislav,
a stack is a list and a list is a stack, right ? :)

Wrong, by list we mean all registered autoload functions which
can be retrived by 'print_r(spl_autoload_functions())' and the
stack trace from main to the autoload call.
 Marcus,
for the record, he mentioned stack not stacktrace :)
Andrey
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DEV] libpq version

2005-04-05 Thread Edin Kadribasic
Which version of libpq is required to compile the new pgsql prepare/execute
commands in php 5.1? I'm getting compilation probles with 8.0.0 client lib
where PQprepare() and PQsendPrepare() seem to be missing.

Edin

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] libpq version

2005-04-05 Thread Derick Rethans
On Tue, 5 Apr 2005, Edin Kadribasic wrote:

 Which version of libpq is required to compile the new pgsql prepare/execute
 commands in php 5.1? I'm getting compilation probles with 8.0.0 client lib
 where PQprepare() and PQsendPrepare() seem to be missing.

I would suggest to fix this, as there are still plenty of people using 
7.x...

Derick

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] libpq version

2005-04-05 Thread Edin Kadribasic
Derick Rethans wrote:
I would suggest to fix this, as there are still plenty of people using 
7.x...
This is only relevant on Windows, autoconf takes care of it on unix 
platforms.

Edin
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DEV] PHP Patch submission

2005-04-05 Thread John Higgins
Hi all,
I would like to submit a patch for PHP 4 as well as PHP 5.  The patch 
will update PHP's UODBC
module to work with more recent versions of Birdstep Technology's RDM Server 
product.  The files
affected are ext/odbc/config.m4  ext/odbc/php_odbc.h.  Below is the diff 
output for the two files
based on the PHP 4 version, but the changes are the same for PHP 4  PHP 5. 
If you have any
suggestions or feedback I would love to hear them, as I am new to 
automake/m4 etc...  I would also
like to know what to expect from here...  Will somebody take these changes 
and commit them?  Do I
need to do more before they'll be committed?  If they are committed, when 
will they find their way to
the public?

Thanks!

diff for config.m4

298c298,312

---
   ac_birdstep_uname_s=`uname -s 2/dev/null`
   ac_birdstep_uname_p=`uname -p 2/dev/null`
   case $ac_birdstep_uname_s in
 AIX) AC_DEFINE(AIX,1,[ ]);;
 HP-UX) AC_DEFINE(HPUX,1,[ ]);;
 Linux) AC_DEFINE(LINUX,1,[ ]);;
 QNX) AC_DEFINE(NEUTRINO,1,[ ]);;
 SunOS)
   if test $ac_birdstep_uname_p == i386; then
 AC_DEFINE(ISOLARIS,1,[ ])
   elif test $ac_birdstep_uname_p == sparc; then
 AC_DEFINE(SOLARIS,1,[ ])
   fi;;
 UnixWare) AC_DEFINE(UNIXWARE,1,[ ]);;
   esac
310c324,328
 
ODBC_LIBS=-lCadm -lCdict -lCenc -lCrdm -lCrpc -lCrdbc -lCrm -lCuapi -lutil
---
 if test -e $ODBC_LIBDIR/libCrdbc32.so -o -e 
 $ODBC_LIBDIR/libCrdbc32.sl; then
   ODBC_LIBS=-lCrdbc32 -lCadm32 -lCncp32 -lCrdbc32 -lCrm32 -lCsql32 
 -lCdict32 
  -lCrdm32 -lCrpc32 -lutil
 elif test -e $ODBC_LIBDIR/libCrdbc.so -o -e 
 $ODBC_LIBDIR/libCrdbc.sl; then
   ODBC_LIBS=-lCrdbc -lCadm -lCncp -lCrdbc -lCrm -lCsql -lCdict -lCrdm 
  -lCrpc -lutil
 fi
312d329

506,508c523,527
 ext_shared=$shared
 PHP_EVAL_LIBLINE([$ODBC_LFLAGS $ODBC_LIBS], ODBC_SHARED_LIBADD)
 AC_DEFINE(HAVE_SQLDATASOURCES,1,[ ])
---
   ext_shared=$shared
   PHP_EVAL_LIBLINE([$ODBC_LFLAGS $ODBC_LIBS], ODBC_SHARED_LIBADD)
 if test $ODBC_TYPE != birdstep; then
   AC_DEFINE(HAVE_SQLDATASOURCES,1,[ ])
 fi


diff for php_odbc.h
36c36
 #if defined(HAVE_DBMAKER) || defined(PHP_WIN32) || defined(HAVE_IBMDB2) || 
defined(HAVE_UNIXODBC)
---
 #if defined(HAVE_DBMAKER) || defined(PHP_WIN32) || defined(HAVE_IBMDB2) || 
 defined(HAVE_UNIXODBC) || defined(HAVE_BIRDSTEP)

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] PHP Patch submission

2005-04-05 Thread Derick Rethans
On Tue, 5 Apr 2005, John Higgins wrote:

 Hi all,
 I would like to submit a patch for PHP 4 as well as PHP 5.  The patch 
 will update PHP's UODBC
 module to work with more recent versions of Birdstep Technology's RDM Server 
 product.  The files
 affected are ext/odbc/config.m4  ext/odbc/php_odbc.h.  Below is the diff 
 output for the two files
 based on the PHP 4 version, but the changes are the same for PHP 4  PHP 5. 

Please do cvs diff in the source of the tree, and put that file 
online. Makes things much easier to read...

regards,
Derick

-- 
Derick Rethans
http://derickrethans.nl | http://ez.no | http://xdebug.org

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DEV] 5.0.4 won't compile as per your instructions

2005-04-05 Thread Jeff Beidler

Hello, 

I have been trying to compile PHP 5.0.4 (downloaded fresh today) and have been 
following your instructions at 
http://www.php.net/manual/en/install.windows.building.php to the letter.  I 
always end up with the same thing when trying to compile... 3 errors and a 
bunch of warnings.  I have attached the output from the compiler (Visual C++ 
6.0) for reference.

One other thing of note (I don't know whether this relates to my problem or 
not) is that when opening the workspace, VC++ also wants the path to 
php5activescript.dsp, which is nowhere to be found in the php-5.0.4 tree.

Would you please be so kind as to take a look at the errors I'm getting and 
steer me in the right direction?

Many thanks,

Jeff Beidler
[EMAIL PROTECTED]
Deleting intermediate files and output files for project 'TSRM - Win32 
Release_TS'.
Deleting intermediate files and output files for project 'EngineSelect - Win32 
Release'.
Deleting intermediate files and output files for project 'ZendTS - Win32 
Release_TS'.
Deleting intermediate files and output files for project 'libsqlite - Win32 
Release_TS'.
Deleting intermediate files and output files for project 'php5dllts - Win32 
Release_TS'.
Deleting intermediate files and output files for project 'php5ts - Win32 
Release_TS'.
Configuration: TSRM - Win32 Release_TS
Compiling...
TSRM.c
tsrm_strtok_r.c
tsrm_virtual_cwd.c
tsrm_win32.c
Creating library...
Configuration: EngineSelect - Win32 
Release
Configuration: ZendTS - Win32 Release_TS
Performing Custom Build Step on .\zend_language_parser.y
Performing Custom Build Step on .\zend_ini_parser.y
zend_ini_parser.y contains 4 shift/reduce conflicts.
Performing Custom Build Step on .\zend_language_scanner.l
Performing Custom Build Step on .\zend_ini_scanner.l
Compiling...
zend.c
zend_alloc.c
zend_API.c
zend_builtin_functions.c
C:\JeffB\php-5.0.4\Zend\zend_builtin_functions.c(1203) : warning C4018: '==' : 
signed/unsigned mismatch
zend_compile.c
C:\JeffB\php-5.0.4\Zend\zend_compile.c(1962) : warning C4018: '' : 
signed/unsigned mismatch
zend_constants.c
zend_default_classes.c
zend_dynamic_array.c
zend_exceptions.c
zend_execute.c
C:\JeffB\php-5.0.4\Zend\zend_execute.c(113) : warning C4018: '=' : 
signed/unsigned mismatch
C:\JeffB\php-5.0.4\Zend\zend_execute.c(480) : warning C4018: '=' : 
signed/unsigned mismatch
zend_execute_API.c
C:\JeffB\php-5.0.4\Zend\zend_execute_API.c(481) : warning C4018: '==' : 
signed/unsigned mismatch
zend_extensions.c
zend_hash.c
zend_highlight.c
zend_indent.c
zend_ini.c
zend_ini_parser.c
zend_ini_scanner.c
zend_interfaces.c
zend_iterators.c
Generating Code...
Compiling...
zend_language_parser.c
zend_language_scanner.c
zend_list.c
zend_llist.c
zend_mm.c
zend_object_handlers.c
zend_objects.c
zend_objects_API.c
zend_opcode.c
zend_operators.c
zend_ptr_stack.c
zend_qsort.c
zend_reflection_api.c
zend_sprintf.c
zend_stack.c
zend_stream.c
C:\JeffB\php-5.0.4\Zend\zend_stream.c(97) : warning C4018: '' : 
signed/unsigned mismatch
zend_strtod.c
C:\JeffB\php-5.0.4\Zend\zend_strtod.c(1753) : warning C4244: '=' : conversion 
from 'double ' to '__int32 ', possible loss of data
zend_ts_hash.c
zend_variables.c
Generating Code...
Creating library...
Configuration: libsqlite - Win32 
Release_TS
Performing Custom Build Step on sqlite.w32.h
1 file(s) copied.
Performing Custom Build Step on config_static.w32.h
1 file(s) copied.
Compiling...
attach.c
auth.c
btree.c
C:\JeffB\php-5.0.4\ext\sqlite\libsqlite\src\btree.c(796) : error C2065: 
'SQLITE_NOTADB' : undeclared identifier
btree_rb.c
build.c
copy.c
date.c
C:\JeffB\php-5.0.4\ext\sqlite\libsqlite\src\date.c(235) : warning C4244: '=' : 
conversion from 'double ' to 'int ', possible loss of data
C:\JeffB\php-5.0.4\ext\sqlite\libsqlite\src\date.c(236) : warning C4244: '=' : 
conversion from 'double ' to 'int ', possible loss of data
C:\JeffB\php-5.0.4\ext\sqlite\libsqlite\src\date.c(343) : warning C4244: '=' : 
conversion from 'double ' to 'int ', possible loss of data
C:\JeffB\php-5.0.4\ext\sqlite\libsqlite\src\date.c(344) : warning C4244: '=' : 
conversion from 'double ' to 'int ', possible loss of data
C:\JeffB\php-5.0.4\ext\sqlite\libsqlite\src\date.c(347) : warning C4244: '=' : 
conversion from 'double ' to 'int ', possible loss of data
C:\JeffB\php-5.0.4\ext\sqlite\libsqlite\src\date.c(348) : warning C4244: '=' : 
conversion from 'double ' to 'int ', possible loss of data
C:\JeffB\php-5.0.4\ext\sqlite\libsqlite\src\date.c(349) : warning C4244: '=' : 
conversion from 'double ' to 'int ', possible loss of data
C:\JeffB\php-5.0.4\ext\sqlite\libsqlite\src\date.c(350) : warning C4244: '=' : 
conversion from 'double ' to 'int ', possible loss of data
C:\JeffB\php-5.0.4\ext\sqlite\libsqlite\src\date.c(364) : warning C4244: '=' : 
conversion from 'double ' to 'int ', possible loss of data

[PHP-DEV] Re: PHP 4.3.11 5.0.4 Released!

2005-04-05 Thread Quanah Gibson-Mount
In article [EMAIL PROTECTED], [EMAIL PROTECTED] says...
 The PHP Development Team would like to announce the immediate release of 
 PHP 4.3.11 and 5.0.4.  These are maintenance releases that in addition 
 to fixing over 70 non-critical bugs, address several security issues. 
 The addressed security issues include fixes to the exif and fbsql 
 extensions, as well as fixes to unserialize(), swf_definepoly() and 
 getimagesize().
 
 All users of PHP are strongly encouraged to upgrade to this release.
 
 Aside from the above mentioned issues this release includes the 
 following important fixes:
 
 * Crash in bzopen() if supplied path to non-existent file.
 * DOM crashing when attribute appended to Document.
 * unserialize() float problem on non-English locales.
 * Crash in msg_send() when non-string is stored without being serialized.
 * Possible infinite loop in imap_mail_compose().
 * Fixed crash in chunk_split(), when chunklen  strlen.
 * session_set_save_handler crashes PHP when supplied non-existent object 
 reference.
 * Memory leak in zend_language_scanner.c.
 * Compile failures of zend_strtod.c.
 * Fixed crash in overloaded objects  overload() function.
 * cURL functions bypass open_basedir.
 
 The PHP Development Team would like to thank all the people who have 
 identified the security faults in PHP and helped us address them.

Hm, I thought this release was going to include bug #30819, after the 
discussion about that bug that was held on here... Is the fix for PHP's 
broken LDAP SASL behavior waiting on 5.1 instead?

--Quanah

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] 5.0.4 won't compile as per your instructions

2005-04-05 Thread Uwe Schindler
PHP 5 has a new Unix-Like build system. The DSP files are not longer 
maintained. To compile you have to configure first and then compile at the 
command line. You need Windows Scripting (for JavaScript configure script) 
and a Microsoft Compiler to start the configure.js script and then nmake.

At 00:12 06.04.2005, Jeff Beidler wrote:
Hello,
I have been trying to compile PHP 5.0.4 (downloaded fresh today) and have 
been following your instructions at 
http://www.php.net/manual/en/install.windows.building.php to the 
letter.  I always end up with the same thing when trying to compile... 3 
errors and a bunch of warnings.  I have attached the output from the 
compiler (Visual C++ 6.0) for reference.

One other thing of note (I don't know whether this relates to my problem 
or not) is that when opening the workspace, VC++ also wants the path to 
php5activescript.dsp, which is nowhere to be found in the php-5.0.4 tree.

Would you please be so kind as to take a look at the errors I'm getting 
and steer me in the right direction?

Many thanks,
Jeff Beidler
[EMAIL PROTECTED]
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
-
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de - http://www.schindlers-software.de
eMails: [EMAIL PROTECTED] (private); [EMAIL PROTECTED] (company)
Tel./Fax: +49 700 PCLATEIN (+49 700 72528346)
Schindlers Software - Home of Schindlers PC-LATEIN 3.10
DIE Software zum Lateinlernen!  

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP-DEV] 5.0.4 won't compile as per your instructions

2005-04-05 Thread David Kingma | jool.nl
Hi Jeff, 

 -Original Message-
 From: Jeff Beidler [mailto:[EMAIL PROTECTED] 
 Would you please be so kind as to take a look at the errors 
 I'm getting and steer me in the right direction?

The solution for error about SQLITE_NOTADB has passed the mailinglist
before:
http://www.mail-archive.com/internals@lists.php.net/msg13735.html

Regards,

David

PS. http://www.google.nl/search?q=SQLITE_NOTADB first hit.

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] PHP Patch submission

2005-04-05 Thread John Higgins
Shoot, I copied the wrong diff file, here is the correct diff, please ignore 
the previous posting.

cvs diff: Diffing ext/odbc
Index: ext/odbc/config.m4
===
RCS file: /repository/php-src/ext/odbc/config.m4,v
retrieving revision 1.55.2.10
diff -u -r1.55.2.10 config.m4
--- ext/odbc/config.m4  18 Jan 2005 21:21:16 -  1.55.2.10
+++ ext/odbc/config.m4  5 Apr 2005 22:51:23 -
@@ -304,7 +304,21 @@
   install directory, defaults to 
/usr/local/birdstep.],
 [
   PHP_WITH_SHARED
-
+  ac_birdstep_uname_s=`uname -s 2/dev/null`
+  ac_birdstep_uname_p=`uname -p 2/dev/null`
+  case $ac_birdstep_uname_s in
+AIX) AC_DEFINE(AIX,1,[ ]);;
+HP-UX) AC_DEFINE(HPUX,1,[ ]);;
+Linux) AC_DEFINE(LINUX,1,[ ]);;
+QNX) AC_DEFINE(NEUTRINO,1,[ ]);;
+SunOS)
+  if test $ac_birdstep_uname_p == i386; then
+AC_DEFINE(ISOLARIS,1,[ ])
+  elif test $ac_birdstep_uname_p == sparc; then
+AC_DEFINE(SOLARIS,1,[ ])
+  fi;;
+UnixWare) AC_DEFINE(UNIXWARE,1,[ ]);;
+  esac
   if test $withval != no; then
 if test $withval = yes; then
 ODBC_INCDIR=/usr/local/birdstep/include
@@ -316,7 +330,11 @@
 ODBC_INCLUDE=-I$ODBC_INCDIR
 ODBC_TYPE=birdstep
 ODBC_LFLAGS=-L$ODBC_LIBDIR
- 
   ODBC_LIBS=-lCadm -lCdict -lCenc -lCrdm -lCrpc -lCrdbc -lCrm -lCuapi -lutil
+if test -e $ODBC_LIBDIR/libCrdbc32.so -o -e 
$ODBC_LIBDIR/libCrdbc32.sl; then
+ 
 ODBC_LIBS=-lCrdbc32 -lCadm32 -lCncp32 -lCrm32 -lCsql32 -lCdict32 -lCrdm32 
 -lCrpc32 -lutil
+elif test -e $ODBC_LIBDIR/libCrdbc.so -o -e 
$ODBC_LIBDIR/libCrdbc.sl; then
+ 
 ODBC_LIBS=-lCrdbc -lCadm -lCncp -lCrm -lCsql -lCdict -lCrdm -lCrpc -lutil
+fi
 AC_DEFINE(HAVE_BIRDSTEP,1,[ ])

 AC_MSG_RESULT(yes)
Index: ext/odbc/php_odbc.h
===
RCS file: /repository/php-src/ext/odbc/php_odbc.h,v
retrieving revision 1.48.4.5
diff -u -r1.48.4.5 php_odbc.h
--- ext/odbc/php_odbc.h 14 Jul 2003 16:13:30 -  1.48.4.5
+++ ext/odbc/php_odbc.h 5 Apr 2005 22:51:23 -
@@ -33,7 +33,7 @@
 extern zend_module_entry odbc_module_entry;
 #define odbc_module_ptr odbc_module_entry

-#if defined(HAVE_DBMAKER) || defined(PHP_WIN32) || defined(HAVE_IBMDB2) || 
defined(HAVE_UNIXODBC)
+#if defined(HAVE_DBMAKER) || defined(PHP_WIN32) || defined(HAVE_IBMDB2) || 
defined(HAVE_UNIXODBC) || defined(HAVE_BIRDSTEP)
 # define PHP_ODBC_HAVE_FETCH_HASH 1
 #endif



John Higgins [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Ok, done, is this better?

 In config.m4 I am doing 2 things.

 First, I am using uname to get the platform being compiled on, then 
 using this info to set the appropriate define needed by RDM Server, i.e. 
 LINUX, SOLARIS, etc.

 Secondly, because RDM Server library names changed when 64-bit support was 
 added, I added a test to figure out which libraries to link to.

 In php_odbc.h I simply added birdstep to the list of db's for which 
 PHP_ODBC_HAVE_FETCH_HASH  needs to be define.

 cvs diff: Diffing ext/odbc
 Index: ext/odbc/config.m4
 ===
 RCS file: /repository/php-src/ext/odbc/config.m4,v
 retrieving revision 1.55.2.10
 diff -u -r1.55.2.10 config.m4
 --- ext/odbc/config.m4  18 Jan 2005 21:21:16 -  1.55.2.10
 +++ ext/odbc/config.m4  5 Apr 2005 22:25:01 -
 @@ -1,11 +1,11 @@
 dnl
 -dnl $Id: config.m4,v 1.55.2.10 2005/01/18 21:21:16 tony2001 Exp $
 +dnl $Id: config.m4,v 1.55.2.8 2003/11/25 08:08:30 sniper Exp $
 dnl

 dnl
 dnl Figure out which library file to link with for the Solid support.
 dnl
 -AC_DEFUN([AC_FIND_SOLID_LIBS],[
 +AC_DEFUN(AC_FIND_SOLID_LIBS,[
   AC_MSG_CHECKING([Solid library file])
   ac_solid_uname_r=`uname -r 2/dev/null`
   ac_solid_uname_s=`uname -s 2/dev/null`
 @@ -71,7 +71,7 @@
 dnl
 dnl Figure out which library file to link with for the Empress support.
 dnl
 -AC_DEFUN([AC_FIND_EMPRESS_LIBS],[
 +AC_DEFUN(AC_FIND_EMPRESS_LIBS,[
   AC_MSG_CHECKING([Empress library file])
   ODBC_LIBS=`echo $1/libempodbccl.so | cut -d' ' -f1`
   if test ! -f $ODBC_LIBS; then
 @@ -80,7 +80,7 @@
   AC_MSG_RESULT(`echo $ODBC_LIBS | sed -e 's!.*/!!'`)
 ])

 -AC_DEFUN([AC_FIND_EMPRESS_BCS_LIBS],[
 +AC_DEFUN(AC_FIND_EMPRESS_BCS_LIBS,[
   AC_MSG_CHECKING([Empress local access library file])
   ODBCBCS_LIBS=`echo $1/libempodbcbcs.a | cut -d' ' -f1`
   if test ! -f $ODBCBCS_LIBS; then
 @@ -194,15 +194,6 @@
   ODBC_INCDIR=$withval/include
   ODBC_LIBDIR=$withval/lib
 fi
 -
 -if ! test -f $ODBC_INCDIR/sqlcli1.h; then
 -  AC_MSG_ERROR([IBM DB2 header files not found])
 -fi
 -
 -if ! test -f $ODBC_LIBDIR/libdb2.so; then
 -  AC_MSG_ERROR([IBM DB2 required libraries not found])
 -fi
 -
 ODBC_INCLUDE=-I$ODBC_INCDIR
 ODBC_LFLAGS=-L$ODBC_LIBDIR
 ODBC_TYPE=db2
 @@ -304,7 +295,21 @@
   install directory, defaults to 
 

[PHP-DEV] Possible error with DOMNode::replaceChild() in 5.0.4

2005-04-05 Thread James Crumpton
After upgrading to 5.0.4, a script of mine that relies on the DocumentFragment
object suddenly started to segfault. Some debugging of the script found the line
 that was causing the segfault to be a call to DOMNode::replaceChild(). The
script is complex enough that it's turning out to be rather difficult to reduce
the code to a small script that can reproduce the error. I was, however, able to
track the error down with gdb:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (LWP 30537)]
0x403490ac in zif_dom_node_replace_child (ht=2, return_value=0x835c0cc,
this_ptr=0x835c10c, return_value_used=0)
at /home/james/php-5.0.4/ext/dom/node.c:1150
1150prevsib-next = newchild;
The problem seems to be related to the fix for bug #32011 (Fixed bug #32011
(Fragments which replaced Nodes are not globaly useable)).
The relevant code from node.c being:
xmlNodePtr fragment, prevsib, nextsib;
fragment = newchild;
prevsib = oldchild-prev;
nextsib = oldchild-next;
newchild = fragment-children;
xmlUnlinkNode(oldchild);
if (prevsib == NULL  nextsib == NULL) {
nodep-children = newchild;
nodep-last = fragment-last;
} else {
if (newchild) {
prevsib-next = newchild;--- segfault is here
newchild-prev = prevsib;
fragment-last-next = nextsib;
if (nextsib) {
nextsib-prev = fragment-last;
} else {
nodep-last = fragment-last;
}
}
}
It turns out that I am somehow encountering a situation in which prevsib is 
NULL, which the code doesn't account for.

The following fix works for me:
1150,1155c1150,1151
   if (prevsib) {
   prevsib-next = newchild;
   newchild-prev = prevsib;
   } else {
   nodep-children = newchild;
   }
---
  prevsib-next = newchild;
  newchild-prev = prevsib;
(Note: fix and works are in quotes because a) i know very very little C, b) 
i
know nothing about working with zend extensions, and c) the Apache error_log is
reporting memory leaks due to my change :( )
I should also note that the code added for bug #32011 changes the behavior of
DocumentFragments slightly, in that prior to the fix, one was able to reference
the child nodes of a fragment after some node was replaced by the fragment. That
is no longer the case, as after the replacement, the fragment has no child 
nodes.
Now, that may in fact be the proper way to handle things... however, it was very
handy to be able to replace a single node with multiple top level nodes (what
DocumentFragments are good for in the first place), and then being able to
further process all those top level nodes by referencing the DocumentFragment,
rather than writing a bunch of code to try and figure out which nodes were newly
added.
-james
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DEV] Possible error with DOMNode::replaceChild() in 5.0.4

2005-04-05 Thread Rob Richards
Please bug this.
James Crumpton wrote:
Now, that may in fact be the proper way to handle things... however, 
it was very
handy to be able to replace a single node with multiple top level 
nodes (what
DocumentFragments are good for in the first place), and then being 
able to
further process all those top level nodes by referencing the 
DocumentFragment,
rather than writing a bunch of code to try and figure out which nodes 
were newly
added.
Behavior was wrong, inconsistant with append behavior and breaks xsl, 
xpath and a few other things.

Rob
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DEV] Compiling a new library

2005-04-05 Thread Michel JORDA
Thanks for your help everybody ! it seems that the better way i found
is

cd mydirectory 
phpize 
autoconf 
./configure 
make 
make install

assuming that php is installed in the machine. I dont think the src are
needed. 
Thanks for your help

Michel

Andrey Hristov [EMAIL PROTECTED] wrote:

 Michel JORDA wrote:  Hi everybody  I Have to compile a library (namely,
 a payment library) and the bank  release a .c source. Therefore I need to
 make and compile it, but they  mention that  you need to install the
 php-devel package in order to compile...  what should I download  - on
 my macosx  - and on my linux  to compile that ?  Thanks for your help 
 MJ  Hi, you may get PHP sources from www.php.net . Then untar in some
 directory. Then you need to create the skeleton of your extension by
 either executing ext/ext_skel.sh or using PEAR's module for doing that.
 Then you need to edit your config.m4 which will be under ext/xyz/config.m4
 (xyz is the name of the extension). Then re-run ./buidlconf . After that
 just use configure (configure --help | less should show your extension).
 For compiling - make. Every time you change sth in config.m4 you have to
 re-run buildconf. There is a way to build only a specific directory with
 phpize but then you need to have this php-devel package or to have
 installed from source with make install.
 
 HTH, Andrey

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] 5.0.4 won't compile as per your instructions

2005-04-05 Thread Steph
erm - when was the decision to no longer maintain the .dsp files made?

Did I go to sleep?

- Original Message - 
From: Uwe Schindler [EMAIL PROTECTED]
To: Jeff Beidler [EMAIL PROTECTED]; internals@lists.php.net
Cc: Jeff Beidler [EMAIL PROTECTED]
Sent: Tuesday, April 05, 2005 11:38 PM
Subject: Re: [PHP-DEV] 5.0.4 won't compile as per your instructions


 PHP 5 has a new Unix-Like build system. The DSP files are not longer
 maintained. To compile you have to configure first and then compile at the
 command line. You need Windows Scripting (for JavaScript configure script)
 and a Microsoft Compiler to start the configure.js script and then nmake.

 At 00:12 06.04.2005, Jeff Beidler wrote:

 Hello,
 
 I have been trying to compile PHP 5.0.4 (downloaded fresh today) and have
 been following your instructions at
 http://www.php.net/manual/en/install.windows.building.php to the
 letter.  I always end up with the same thing when trying to compile... 3
 errors and a bunch of warnings.  I have attached the output from the
 compiler (Visual C++ 6.0) for reference.
 
 One other thing of note (I don't know whether this relates to my problem
 or not) is that when opening the workspace, VC++ also wants the path to
 php5activescript.dsp, which is nowhere to be found in the php-5.0.4
tree.
 
 Would you please be so kind as to take a look at the errors I'm getting
 and steer me in the right direction?
 
 Many thanks,
 
 Jeff Beidler
 [EMAIL PROTECTED]
 
 --
 PHP Internals - PHP Runtime Development Mailing List
 To unsubscribe, visit: http://www.php.net/unsub.php

 -
 Uwe Schindler
 H.-H.-Meier-Allee 63, D-28213 Bremen
 http://www.thetaphi.de - http://www.schindlers-software.de
 eMails: [EMAIL PROTECTED] (private); [EMAIL PROTECTED] (company)
 Tel./Fax: +49 700 PCLATEIN (+49 700 72528346)

 Schindlers Software - Home of Schindlers PC-LATEIN 3.10
 DIE Software zum Lateinlernen!

 -- 
 PHP Internals - PHP Runtime Development Mailing List
 To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DEV] Re: libpq version

2005-04-05 Thread Christopher Kings-Lynne
Which version of libpq is required to compile the new pgsql prepare/execute
commands in php 5.1? I'm getting compilation probles with 8.0.0 client lib
where PQprepare() and PQsendPrepare() seem to be missing.
You required the libpq from PostgreSQL 7.4...
All use of those two functions is protected by autoconf checks, so I 
have no idea what's happening.  It works fine for me on 8.0.2beta.  Care 
to send me more detailed error messages/output?

Chris
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DEV] libpq version

2005-04-05 Thread Christopher Kings-Lynne
I would suggest to fix this, as there are still plenty of people using 
7.x...
This is only relevant on Windows, autoconf takes care of it on unix 
platforms.
I strongly suspect that he is not in fact linking against libpq version 
8.  Is ONLY PQprepare and PQsendPrepare missing?  What about the rest?

Gah - Windows.  I'm not able to build on windows...  I just followed the 
existing windows config.w32 which already required PostgreSQL 7.4 or 
above libpq (AFAICT).  The functions I added require 7.4 or above as well.

There is no difference between 7.4 and 8.0's libpq in terms of functions.
Basically before I made any changes, this was in config.w32:
ADD_FLAG(CFLAGS_PGSQL, /D HAVE_PG_CONFIG_H /D PGSQL_EXPORTS /D 
HAVE_PQSETNONBLOCKING /D HAVE_PQCMDTUPLES /D HAVE_PQCLIENTENCODING /D 
HAVE_PQESCAPE /D HAVE_PQPARAMETERSTATUS /D HAVE_PGTRANSACTIONSTATUS);

Note that that FORCES PQparameterStatus and PQtransactionStatus to be 
assumed to exist.  Both of those functions are PostgreSQL 7.4 only and 
in fact it was Edin himself who added them.  All I did was add a bunch 
more /D's:

ADD_FLAG(CFLAGS_PGSQL, /D HAVE_PG_CONFIG_H /D PGSQL_EXPORTS /D 
HAVE_PQSETNONBLOCKING /D HAVE_PQCMDTUPLES /D HAVE_PQCLIENTENCODING /D 
HAVE_PQESCAPE /D HAVE_PQPARAMETERSTATUS /D HAVE_PGTRANSACTIONSTATUS /D 
HAVE_PQEXECPARAMS /D HAVE_PQPREPARE /D HAVE_PQEXECPREPARED /D 
HAVE_PQRESULTERRORFIELD /D HAVE_PQSENDQUERYPARAMS /D HAVE_PQSENDPREPARE 
/D HAVE_PQSENDQUERYPREPARED /D HAVE_PQPUTCOPYDATA /D HAVE_PQPUTCOPYEND 
/D HAVE_PQGETCOPYDATA /D HAVE_PQSETERRORVERBOSITY /D HAVE_PQUNESCAPEBYTEA);

However, all those new /D's are also 7.4 only.  So I don't see exactly 
what I did any differently?  If someone wants to make Windows build 
against versions pre-7.4, then I don't know how to do it.  I just 
assumed that whoever came before me knew what they were doing :)

Chris
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DEV] Any intest in PHP 5.1/PDO Memory leaks?

2005-04-05 Thread Davey
Hey,
I have a ORM wrapper for PDO which I've been working on for
several weeks. Whilst all of my .phpt tests work just
fine on PHP 5.0.4 (or snaps, depends on my mood) with snaps
PDO binaries on WinXP.
As Wez knows, there are issues with OSX/PHP 5.0.x/PDO, so on
Rasmus' advice I went with current CVS HEAD PHP.
When I ran the tests on OSX, I got a bunch of failures, now when
I went to test why I got a segfault.
So, I compiled a --enable-debug build and now get plenty of memory leaks.
Is this interesting to anyone?
The following looks like the most serious, but I don't have a clue about 
these things :)

/Library/WebServer/public_html/php-cvs/php-src/ext/pdo/pdo_stmt.c(830) : 
 Freeing 0x01FF3658 (16 bytes), 
script=/Library/WebServer/public_html/cerebralcortex/packages/Crtx_DB/tests/Crtx_DB_DataObject/Find_No_ID.php
Last leak repeated 179 times
/Library/WebServer/public_html/php-cvs/php-src/ext/pdo/pdo_stmt.c(471) : 
 Freeing 0x01FF3398 (13 bytes), 
script=/Library/WebServer/public_html/cerebralcortex/packages/Crtx_DB/tests/Crtx_DB_DataObject/Find_No_ID.php
Last leak repeated 179 times
=== Total 360 memory leaks detected ===

I have 15 different tests failing with mem leaks.
- Davey
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DEV] Scheme identification in stream wrappers

2005-04-05 Thread Morgan L. Owens
It was suggested I post this here.
In PHP, the character sequence :// separates the protocol name from 
the protocol-specific part of a stream name. Clearly, the intention is 
that these stream names are URLs (i.e., URIs that actually provide a 
location for the identified resource). However, the URI specification 
(RFC 3986) states that the scheme delimiter is merely :, and that 
:// is only applicable for _some_ URI formats. There are URLs in 
common use that do not use :// (e.g., mailto:), and in fact support 
for zlib: is a hardwired exception in the present code.

May I propose that the parser which parses out the scheme from the rest 
of the URL look only for the initial : in the stream name, rather than 
://.

Existing uses of stream wrappers will continue to function, since the 
name of the scheme won't actually change, and it's the wrapper author's 
responsibility to parse the rest of the URL anyway; but it will become 
possible to correctly write, e.g., mailto:[EMAIL PROTECTED] instead of 
mailto://[EMAIL PROTECTED], or (to use the example used in the manual 
to describe stream_wrapper_register()) var:myvar instead of var://myvar.

This would also make use of parse_url() more consistent as, for example, 
parse_url('var:myvar') will put the name of myvar into the path element 
of the returned array, instead of mistakenly putting it in the host element.

MLO
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php