Skip to content

Commit

Permalink
Add PHP typemap for gdBuffer. This patch adds a SWIG typemap to retur…
Browse files Browse the repository at this point in the history
…n gdBuffer as a string in PHP, similar to the Python Mapscript behaviour (ref. RFC-16). This fixes the bug reported in #5798, where PHP Mapscript msIO_getStdoutBufferBytes() returns a resource handle instead of the actual buffer.
  • Loading branch information
bragef committed Dec 5, 2019
1 parent 55a653d commit 0ff3d79
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions mapscript/phpng/php7module.i
Expand Up @@ -3,3 +3,11 @@
php_info_print_table_row(2, \"MapServer Version\", msGetVersion());
php_info_print_table_end();
"


/* To support imageObj::getBytes */
%typemap(out) gdBuffer {
RETVAL_STRINGL((const char*)$1.data, $1.size);
if( $1.owns_data )
msFree($1.data);
}

0 comments on commit 0ff3d79

Please sign in to comment.