#ICYDK: In this article, I will explain how to execute a PHP Script within the Mule Flow. First, we need to include the mule-module-php.jar file on our project. Mule needs this library to be able to execute the PHP script at runtime. You can download the jar file here: https://github.com/jdeoliveira/mule-module-php/downloads. info(“Hello, ” . $h->getName(). “! You are ”. $h->isAdult()); $h = new User(“Jose”,39); $log->info(“Hello, ” . $h->getName(). “! You are ”. $h->isAdult()); return “Hi From PHP To ” . $payload ?>]]>
The above Mule flow runs every 5 seconds to execute the Script Component that contains our PHP code. Inside that component, it is simple to initialize the PHP class User located in /src/main/resources/ and invoke its methods or functions. Also, note that the Script Component engine should be set to php. https://goo.gl/D3AEaG #DataIntegration #ML
Share this:
- Click to share on Facebook (Opens in new window)
- Click to share on Twitter (Opens in new window)
- Click to email a link to a friend (Opens in new window)
- Click to share on LinkedIn (Opens in new window)
- Click to share on Tumblr (Opens in new window)
- Click to share on Pinterest (Opens in new window)
- Click to share on Reddit (Opens in new window)