I have a large code base I've written in Perl for a web application. Recently, I've decided to use Braintree's payment system, but their Perl library is deprecated. I decided I'd have to write a new set of PHP scripts that duplicated quite a few user functions from my Perl code, which, obviously, is less than ideal. Then I came across PHP::Interface on CPAN and the PECL Perl extension for PHP, both of which promise to allow code from the one language to be interpreted in the other, exposing variables across the language divide, etc. Either would be a huge help, but both appear unmaintained and broken in modern environments. Is there some currently maintained way to either expose my Perl modules to PHP or some PHP functions into Perl?
Asked
Active
Viewed 122 times
3
-
http://search.cpan.org/~karasik/PHP-0.11/PHP.pm ? – el.pescado - нет войне Jul 21 '16 at 06:24
-
1I wondered why Braintree doesn't simply expose a REST API. Their reasoning is at https://www.braintreepayments.com/blog/when-rest-isnt-good-enough/. – BarneySchmale Jul 21 '16 at 07:00
-
1If you are proficient in Perl, I would suggest installing the PHP library and copying the behaviour in Perl. According to their docs, it's a REST client with an authentication layer and encryption. Sounds like any other REST client. Or ask them what they say you should do. You're their client, they want your business. Usually when confronted with clients that don't use what they think everyone uses, those companies are quite forthcoming. – simbabque Jul 21 '16 at 09:02
-
@el.pescado The latest version is 0.15, not 0.11. Regardless, the maintainer [doesn't exactly give it a ringing endorsement](http://stackoverflow.com/a/32211331). – ThisSuitIsBlackNot Jul 21 '16 at 15:58
-
I'll endorse PHP-0.15 on Linux, with single-threaded perl, with php you build from source with `./configure --enable-embed ...` – mob Jul 21 '16 at 16:26