PHP code example of roiarthurb / openmole

1. Go to this page and download the library: Download roiarthurb/openmole library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

roiarthurb / openmole example snippets


$myWrapper = new \RoiArthurB\OpenMole\OpenMole( $url = "api.myopenmole.org", $port = 8080, $https = false);

$result = $myWrapper->getJobs();
var_dump($result); // array(2) { [0]=> object(stdClass)#34 (1) { ["id"]=> string(36) "1b303e8a-b739-46bb-8b9d-323c588e74ff" } [1]=> object(stdClass)#35 (1) { ["id"]=> string(36) "9a1d21e0-c9ed-42e8-b0f3-ba6de6abda53" } } 

$result = $myWrapper->getJobState("1b303e8a-b739-46bb-8b9d-323c588e74ff");
var_dump($result); // object(stdClass)#34 (1) { ["state"]=> string(8) "finished" }