[PHP-DEV] Persistent streams in an extension

2006-07-03 Thread Andrew Mather
I am trying to use a php_stream* as a global (and hence persistent) resource, but gdb detects a memory leak at the end of the request, and subsequent calls to the stream say the stream is no longer seekable. How do I declare a php_stream (opened presumably with php_stream_open_wrapper) to be a per

[PHP-DEV] -- zend engine guru/consultancy required --

2006-06-29 Thread Andrew Mather
I have written a C++ extension for php which accesses an external .so proprietary data engine. The extension basically works, but the engine - reliable when accessed outside php/zend - is generating stream based errors, possibly due my poor understanding of the streams/threading requirements in su

[PHP-DEV] Streams and Threads under Php

2006-06-25 Thread Andrew Mather (BT Std)
I have a C++ based php-extension accessing a C++ based non-php .so data engine, which reads and writes using the open/read/write/close calls in fcntl.h. The non-php engine is reliable away from php, but when accessed via the php extension, it works, but runs into two forms of errors: a) seek/r

[PHP-DEV] RESOLVED: Contamination by file include in zend_register_functions

2006-03-22 Thread Andrew Mather
Turns out that even though the missing functions had no impact in code, they do indeed cause the register functions process to throw an error, leading to a sigseg fault. At least it encourages tight and tidy code! A.

[PHP-DEV] Contamination by file include in zend_register_functions

2006-03-22 Thread Andrew Mather (BT Std)
l now. Could this be the 'NULL function referred to below? If anyone has come across a similar phenomenon, or can shed light on the matter, I'd be most grateful. Cheers, Andrew Mather. - backtrace from gdb - PHP Warning: PhpClassFactory::SelfRegister(...) in Unknown on

[PHP-DEV] Celebration and thank you - C++ class factory for php objects

2006-03-14 Thread Andrew Mather
To Jay Smith, Marcus Boerger, George Schlossnagle, Sara Golemon, Michael Walter in particular, and all who've kindly responded to my struggle to upgrade my C++ to handle my hopes on php, thank you. We now have a C++ class factory for generating Php objects derived from C++ classes, as I'd original

[PHP-DEV] Passing a C++ Class Member Function to the (*create_object) in zend_class_entry

2006-03-14 Thread Andrew Mather (BT Std)
Is it possible to pass a C++ member function to the create_object member in zend_class_entry ? This would allow a factory-like generator of zend/c++ object pairs. error: argument of type ` zend_object_value (MyClassFactory::)(zend_class_entry*, void***)' does not match `zend_object_value

[PHP-DEV] RESOLVED: Separating C++ zend object creation code from module code

2006-03-12 Thread Andrew Mather (BT Std)
Courtesy of Sara Golemon and a helpful tutorial on the impact of the 'static' keyword in function declaration. Greatly appreciated. Andrew. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DEV] Separating C++ zend object creation code from module code

2006-03-11 Thread Andrew Mather (BT Std)
Hi there, I've successfully developed a stripped down C++ php class creator, with private storage, a la Marcus Boerger util.c, and following Jay Smith, George Schlossnagle et al. For neater code, I've stripped out function declarations, function entry tables, class entry etc. into a second .h/.c

[PHP-DEV] RESOLVED: Private data in C/C++ generated classes - example

2006-03-05 Thread Andrew Mather (BT Std)
at: http://somabo.de/php/ext/util/ Simple test script below // written by Andrew Mather - ie: not an authorised test! // (Does work however - I leave it to you to change the target dir) $path = "/home/andrew"; $u = new dirs($path); $upath = $u->getPath

[PHP-DEV] Private data in C/C++ generated classes for Php - example?

2006-03-05 Thread Andrew Mather
Further to my earlier mail, does anyone have/know of a working example that demonstrates private data held in C/C++ and encapsulated within a Php/Zend object for storage, exposing a Php class, per George Schlossnagle's recommendation/example? Cheers, Andrew.

[PHP-DEV] Private data requiring custom object creation error

2006-03-04 Thread Andrew Mather (BT Std)
I'm working through George Schlossnagle's Advanced PHP Programming, (which I'm happy to plug. Excellent). Having successfully used C++ to generate extensions (per Jay Smith tutorial) I am now checking out the facility to store custom objects - packaged private data alongside the native zend object

[PHP-DEV] RESOLVED: [PHP-DEV] File access fails in external lib called from extension

2006-02-20 Thread Andrew Mather
per suggestions, changed permissions to allow write access on target directories for apache user Cheers, Andrew.

[PHP-DEV] File access fails in external lib called from extension

2006-02-20 Thread Andrew Mather (BT Std)
I have an external library (C++, .so shared lib) that uses functions (open, etc) to access local disk resources, to create a data repository. I have written a standalone KDE client that affirms that the library is functioning correctly. When I try to use a class from that library in a PHP-C++ e

[PHP-DEV] RESOLVED (sort of): [PHP-DEV] PHP / C++ Interaction

2006-02-20 Thread Andrew Mather
George Schlossnagle sent me the following link to a a tutorial by Jay Smith: http://142.166.76.45/software/php5cpp/php5cpp/ This provides full code for a C++ based extension. On a Suse 9.3 distribution of Php5 this results in an (unresolved) error, but with an Apache2/Php5 build from source, the

[PHP-DEV] PHP / C++ Interaction

2006-02-13 Thread Andrew Mather
Having got a PHP/C extension .so shared library working, (courtesy this mailing list), and now also ported a C++ data server to Linux, which could also be a (C++) .so, the obvious question is: - can I talk to a C++ library from PHP, either directly or via a PHP/C extension? - aka: is there a 'co

[PHP-DEV] RESOLVED: Dead C Scrolls - Standalone Extensions - FLAW IN SUSE RPM

2006-02-11 Thread Andrew Mather
Please see George Schlossnagle's response above. ... for want of a nail... Essence of George's reply: - the SuSE rpm may install it's header files in $foo/php5, but PHP always expects them to be in $foo/php. You can manually fix this by editing the executable 'php-config' (use locat

[PHP-DEV] Dead C Scrolls - Missing Code for Writing New Extensions without recompiling PHP

2006-02-10 Thread Andrew Mather
My thanks to the contributors and for the resource documentation that: a) has confirmed that writing extensions without recompiling PHP is possible b) have provided sample code that requires recompilation of PHP As a Linux newbie but experienced Windows programmer I do not have the arcane knowl

[PHP-DEV] Writing PHP extensions without re-building PHP

2006-02-08 Thread Andrew Mather
n to be in order, if it moves us forward). Cheers, Andrew Mather. ps: the example given at http://www.zend.com/php/internals/ makes sense, as such, but while the first two command (phpize, ./configure, seem to work, the make command throws errors like confetti, based on the lack of php.h, zend.h