Update wrt PHP4.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10636 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
3d3bc01a2f
commit
fa5b3a0b66
1 changed files with 18 additions and 26 deletions
|
|
@ -43,21 +43,24 @@
|
|||
<b>Caution: This chapter (and module!) is still under construction</b>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
SWIG supports generating wrappers for PHP5. Support for PHP4 has been removed
|
||||
as of SWIG 1.3.37. The PHP developers are no longer making new PHP4 releases,
|
||||
and won't even be patching critical security issues after 2008-08-08, so it
|
||||
doesn't make much sense for SWIG to continue to support PHP4 at this point.
|
||||
If you need to continue to use PHP4, stick with SWIG 1.3.36.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
In this chapter, we discuss SWIG's support of PHP. The PHP module
|
||||
was extensively rewritten in release 1.3.26, and although it is
|
||||
significantly more functional, it still does not implement all the
|
||||
was extensively rewritten in release 1.3.26, and support for generating
|
||||
OO wrappers for PHP5 was added in 1.3.30. The PHP module works fairly
|
||||
well, but currently does not implement all the
|
||||
features available in some of the other languages.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The examples and test cases have been developed with PHP4. Release
|
||||
1.3.30 added support for generating PHP5 class wrappers for C++
|
||||
libraries.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
In order to use this module, you will need to have a copy of the PHP4 or PHP5
|
||||
In order to use this module, you will need to have a copy of the PHP5
|
||||
include files to compile the SWIG generated files. If you installed
|
||||
PHP from a binary package, you may need to install a "php-dev" or "php-devel"
|
||||
package for these to be installed. You can find out where these files are
|
||||
|
|
@ -717,20 +720,9 @@ variable, or assigning <tt>NULL</tt> to a variable.
|
|||
|
||||
|
||||
<p>
|
||||
SWIG defaults to wrapping C++ structs and classes with PHP classes. This
|
||||
requires SWIG to generate different code for PHP4 and PHP5, so you must
|
||||
specify which you want using <tt>-php4</tt> or <tt>-php5</tt> (currently
|
||||
<tt>-php</tt> generates PHP4 class wrappers for compatibility with
|
||||
SWIG 1.3.29 and earlier, but this may change in the future).
|
||||
</p>
|
||||
|
||||
<p>
|
||||
PHP4 classes are implemented entirely using the Zend C API so
|
||||
no additional php code is generated. For PHP5, a PHP wrapper
|
||||
SWIG defaults to wrapping C++ structs and classes with PHP classes
|
||||
unless "-noproxy" is specified. For PHP5, a PHP wrapper
|
||||
class is generated which calls a set of flat functions wrapping the C++ class.
|
||||
In many cases the PHP4 and PHP5 wrappers will behave the same way,
|
||||
but the PHP5 ones make use of better PHP5's better OO functionality
|
||||
where appropriate.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
|
@ -754,7 +746,7 @@ struct Complex {
|
|||
</pre></div>
|
||||
|
||||
<p>
|
||||
Would be used in the following way from either PHP4 or PHP5:
|
||||
Would be used in the following way from PHP5:
|
||||
</p>
|
||||
|
||||
<div class="code"><pre>
|
||||
|
|
@ -854,9 +846,9 @@ the programmer can either reassign the variable or call
|
|||
|
||||
|
||||
<p>
|
||||
Static member variables are not supported in PHP4, and it does not
|
||||
appear to be possible to intercept accesses to static member variables
|
||||
in PHP5. Therefore, static member variables are
|
||||
Static member variables in C++ are not wrapped as such in PHP
|
||||
as it does not appear to be possible to intercept accesses to such variables.
|
||||
Therefore, static member variables are
|
||||
wrapped using a class function with the same name, which
|
||||
returns the current value of the class variable. For example
|
||||
</p>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue