Olly Betts
32283991c5
Don't generate a .php wrapper file by default
...
It's now only generated if something to put in it is specified via:
%pragma(php) include=...
or
%pragma(php) code=...
2021-05-04 14:14:56 +12:00
Olly Betts
61f00daee4
Fix extension= value for PHP < 7.2
2021-05-04 08:04:36 +12:00
Olly Betts
586eb24efe
php: Stop using dl()
...
With modern PHP it only works with the CLI version of PHP, so it's
better to direct users to load the extension via "extension=" in
php.ini.
Suggested by ferdynator in #1529 .
2021-05-03 18:42:28 +12:00
Olly Betts
c87047fd39
Merge branch 'master' into gsoc2017-php7-classes-via-c-api
2021-05-03 16:17:02 +12:00
Olly Betts
81d1618777
Adjust director_finalizer_runme.php
...
Without inventing a SWIG/PHP-specific mechanism, we can't really
finalise objects in the way the testcase expects, so adjust the
testcase minimally so we avoid triggering C++ undefined behaviour
(use-after-free).
2021-05-03 16:07:50 +12:00
Olly Betts
9ddc9dceb7
Remove support for $source and $target
...
These were officially deprecated in 2001, and attempts to use them have
resulted in a warning (including a pointer to what to update them to)
for most if not all of that time.
Fixes #1984
2021-04-30 10:20:14 +12:00
William S Fulton
5f8768daed
Support testing on AIX for tcl
...
Contributed by Tony Reix
Closes #1922
2021-04-28 00:04:50 +01:00
William S Fulton
429288fa1c
Fix Java %interface family of macros
...
when returning by const pointer reference
Closes #1987
2021-04-27 23:37:18 +01:00
William S Fulton
f14c712001
Correct disabling of c++11 testing
...
C++11 testing was not being turned off when the
C++ compiler check for C++11 features failed and
'configure --enable-cpp11-testing' was used
2021-04-26 22:32:52 +01:00
Olly Betts
50426aae20
Make PHP directors work more like other languages
...
A PHP exception now gets translated to a C++ exception to skips over C++
code to get back to PHP, avoiding the need to gate every directorout
typemap on EG(exception).
2021-04-22 14:40:21 +12:00
Olly Betts
3e8373b09a
Merge branch 'master' into gsoc2017-php7-classes-via-c-api
2021-04-21 16:05:24 +12:00
Olly Betts
1d617c2b9b
perl5: Enable more testcases
2021-04-21 15:46:41 +12:00
Olly Betts
5840aca0d9
php: Enable more testcases
2021-04-21 15:46:41 +12:00
Olly Betts
c705ef8f32
Use PHP objects instead of resources to wrap pointers
...
Pointer to member is currently still wrapped as a resource.
2021-04-21 15:40:35 +12:00
Olly Betts
f1aaeeea1c
Fix -prefix to prefix PHP class names
2021-04-20 18:23:23 +12:00
Olly Betts
f24ea7c162
php: Enable prefix testcase
...
This tests that the SWIG/PHP -prefix command line option works. It
has a _runme.php and the testcase passes, but it wasn't listed to
be run.
2021-04-20 12:11:13 +12:00
Olly Betts
f45bf4db23
php: Fix director_profile_runme.php
...
Since 76c2c4675b the fn method is
renamed to c_fn, because `fn` was added as a keyword in PHP 7.4.
2021-04-20 12:04:02 +12:00
Olly Betts
d084173ee7
php: Enable testcase director_stl
...
This already had a _runme.php which passes as-is, but wasn't listed to
be run.
2021-04-20 12:02:21 +12:00
Olly Betts
e44ac904c4
java: Remove duplicate li_std_map entry
...
It's in CPP_STD_TEST_CASES so no need for Java to specifically add
it to CPP_TEST_CASES.
2021-04-20 11:56:27 +12:00
Olly Betts
ff1c88f5ba
Hook up sym testcase
...
This has existed since at least the "great merge" and even has a
_runme.php, but seems to have never actually been listed as a testcase
to run.
2021-04-20 11:56:27 +12:00
Olly Betts
b1923af3ee
Remove left-over arrayptr_runme.php
...
The arrayptr testcase was eliminated back in 2003 by
da53ad7bf2 .
2021-04-19 19:06:10 +12:00
Olly Betts
1bf23edc06
Remove PHP-specific testcase workarounds
...
The changes on this branch mean these are no longer required.
2021-04-19 18:57:17 +12:00
Olly Betts
9a82261e4a
Fix GCC -Wstringop-truncation warning
...
The code in testcase memberin_extend_c would end up without a
terminating nul if passed a 50 byte string, and then make_upper()
would run off the end of the buffer.
Fix by using strncat() (which always nul terminates the result, and
also doesn't zero-fill the tail of the buffer if the result is
shorter).
2021-04-19 18:13:02 +12:00
Olly Betts
d6f9f4b6c0
Make examples fail on any PHP diagnostic
...
Previously we called set_error_handler() in tests.php to do this, but
that only sets it for the test-suite. Now we set it in on the PHP
command line, which works for both.
2021-04-19 13:40:46 +12:00
Olly Betts
09d06843d1
Fix PHP sync example
...
Mostly it was missing `%include <std_string.i>`
2021-04-19 11:26:32 +12:00
Olly Betts
a49cc60772
Adjust PHP sync example
...
Make it work with how globals are actually wrapped. It looks like
this example has never been right, but nobody noticed before PHP 8
started warning about the use of unset variables.
This reveals that handling of std::string properties needs fixing.
2021-04-18 10:00:34 +12:00
Olly Betts
0a437cddcc
Simplify magic property methods
2021-04-17 19:01:32 +12:00
Olly Betts
db358d1e42
Expand li_std_string_runme.php
...
Re-enable a disabled check and implement more checks based on those
in perl5/li_std_string_runme.pl.
2021-04-17 18:53:50 +12:00
Olly Betts
3e4b7b3368
Drop special case for PHP in allowexcept.i
...
Now the varinit typemaps are gone we no longer take the address of
the variable in the generated code.
2021-04-17 07:38:23 +12:00
Olly Betts
14edc26c8d
Add PHP run test for global_vars
2021-04-17 06:11:49 +12:00
Olly Betts
a51a5c77f2
Modernise checks for PHP NULL and resources
2021-04-17 05:36:13 +12:00
Olly Betts
12bcd36923
Filter less in check::functions()
...
Stop filtering /^new_/ - we no longer generate these for classes, so
only the li_carrays and li_carrays_cpp testcases generate new_* flat
functions, and it's helpful to check those are generated.
Stop filtering /_(alter|get)_newobject$/' - we no longer generate
these, as they weren't used or documented.
2021-04-17 04:14:33 +12:00
Olly Betts
451998f27b
Fix in typemap for void** and void*&
...
Mark the parameter as "byref" and write back through the reference
after the call.
Adjust testcase argout to uncomment the part that's meant to test this,
and to remove lingering traces of PHP's old call-time pass-by-reference
(which was completely removed before PHP 7).
Fixes #1457
2021-04-14 17:05:19 +12:00
Olly Betts
b430832a08
Restore checks for flat functions in php testcases
2021-04-14 12:44:48 +12:00
Olly Betts
8cb0c185ac
Restore checks for globals in php testcases
2021-04-14 11:15:43 +12:00
Olly Betts
50f92dca08
Mark wrapped abstract classes
...
This allows restoring reflection checks in testcase director_abstract.
2021-04-14 10:59:12 +12:00
Olly Betts
40906ae856
Reenable check::classes() and check::classmethods()
2021-04-14 10:05:20 +12:00
Olly Betts
40da8bcbb6
php: Wrap classes using only swig_object_wrapper
...
We no longer use PHP resources to wrap classes, and the proxy classes no
longer has a _cPtr property.
2021-04-04 07:45:20 +12:00
Olly Betts
904f5a65d8
Merge branch 'master' into gsoc2017-php7-classes-via-c-api
2021-03-31 04:53:40 +13:00
Olly Betts
c9d64f0bed
php: Test multiple return values in pointer example
2021-03-31 04:49:38 +13:00
Olly Betts
1eab01ad1f
Fix comment typo
2021-03-31 04:46:32 +13:00
Olly Betts
8cd98ec74e
Eliminate use of fn in testcases
...
Fix cpp11_lambda_functions and rname to use fn1 instead of fn, since
fn is a reserved word as of PHP 7.4.
2021-03-30 11:01:51 +13:00
Olly Betts
49d923b917
php: Fix director_overload_runme.php printing empty line
2021-03-30 10:56:23 +13:00
Olly Betts
2ba0f82720
Merge branch 'master' into gsoc2017-php7-classes-via-c-api
2021-03-26 12:00:59 +13:00
Olly Betts
c78325a82a
php: Remove out-dated remark from funcptr example
...
The function pointers are wrapped as resources not "swig style string
pointers".
2021-03-26 08:24:12 +13:00
Olly Betts
eb8024f18b
php: Use qualified constant names in funcptr example
2021-03-26 08:24:12 +13:00
Olly Betts
8ded9d8dae
Merge branch 'master' into gsoc2017-php7-classes-via-c-api
2021-03-25 17:45:17 +13:00
William S Fulton
33513d5118
testcase fixes for gcc-9
2021-03-25 16:17:06 +13:00
Olly Betts
704ec59f29
[php] Fix widespread use of bare strings in testsuite
...
These generate warnings with PHP 7.3, which will become errors in a
future version.
2021-03-25 16:17:06 +13:00
Olly Betts
12026c66f1
php: Remove out-dated remark from funcptr example
...
The function pointers are wrapped as resources not "swig style string
pointers".
2021-03-25 13:28:43 +13:00