The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Perinci::Sub::Wrapper::Patch::HandlePHPArray - Convert {} to [] or vice versa to match functions' expectations

VERSION

version 0.02

SYNOPSIS

 use Perinci::Sub::Wrapper::HandlePHPArray;

DESCRIPTION

This module patches Perinci::Sub::Wrapper so the generated function wrapper code can convert argument {} to [] when function expects argument to be an array, or vice versa [] to {} when function expects a hash argument. This can help if function is being called by PHP clients, because in PHP Array() is ambiguous, it can be an empty hash or an empty array.

To make this work, you have to specify schema in your argument specification in your Rinci metadata, and the type must be hash or array.

This is a temporary/stop-gap solution. The more "official" solution is to use Perinci::Access::HTTP::Server which has the deconfuse_php_clients option (by default turned on).

HOMEPAGE

Please visit the project's homepage at https://metacpan.org/release/Perinci-Sub-Wrapper-Patch-HandlePHPArray.

SOURCE

Source repository is at https://github.com/sharyanto/perl-Perinci-Sub-Wrapper-Patch-HandlePHPArray.

BUGS

Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Perinci-Sub-Wrapper-Patch-HandlePHPArray

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

AUTHOR

Steven Haryanto <stevenharyanto@gmail.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2014 by Steven Haryanto.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.