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
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
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
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.
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
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
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
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
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
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
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.
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
per suggestions,
changed permissions to allow write access on target directories
for apache user
Cheers,
Andrew.
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
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
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
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
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
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
19 matches
Mail list logo