I'm interested to use swig to wrap a c++ api in php and use it from a web
I success to compile some swig examples , create c++ objects in php on an apache
web server and use it :)
My problem is how to save the swig object from one page to another one.
I know Php have session, but I failed to save objects inside a session, the
serialize/unserialize process don't work well(garbage collector have probably
deleted the memory and when I try to use saved object, the c++ memory is not yet
It's is important to my application to not have to call the constructor every
I saw on internet I'm not the first to have this issue, some people said to
specify "$myObject->thisown = 0;" to avoid garbage collector to delete the c++
memory. Maybe it's possible to retrieve the c++ memory from the address
previously saved, but to my understanding there is no guaranty than the
operating system will not modify the c++ memory between two pages actualization.
With FastCGI it's possible to not create an object on every php file, but I will
prefer to use Swig if possible, please indicate me how to have a swig object in
a php session.
Thank you and Best Regards.