PHP code example of der-spiegel / amendo-client

1. Go to this page and download the library: Download der-spiegel/amendo-client 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/ */

    

der-spiegel / amendo-client example snippets


$amendoConfig = new AmendoConfig($amendoServerUrl);

$amendoClient = new AmendoClient($amendoConfig, $logger);

$jobTicket = new SimpleJobTicket();

$jobTicket->setJobName('Test-' . time());

$jobTicket->setAssemblyLineReference($assemblyLine);

$jobTicket->setJobPriority(60);

$jobTicket->setStringProperty('Custom', 'AString', 'Text');
$jobTicket->setBooleanProperty('Custom', 'ABool', true);
$jobTicket->setIntegerProperty('Custom', 'AnInteger', 42);
$jobTicket->setFloatProperty('Custom', 'AFloat', 0.815);

$file = $jobTicket->addFile($filePath);

$file = $jobTicket->addUri($filePath);

$file = $jobTicket->addDownloadUri($filePath);

$file->setStringProperty('Custom', 'AString', 'FileText');
$file->setBooleanProperty('Custom', 'ABool', false);
$file->setIntegerProperty('Custom', 'AnInteger', 15);
$file->setFloatProperty('Custom', 'AFloat', 3.1415);

$jobId = $amendoClient->startJobTicket($jobTicket);

$result = $amendoClient->getJobOverview($jobId);

$ docker run -it --rm --name amendo-client-example \
  --volume "$PWD":/usr/src/myapp --workdir /usr/src/myapp \
  php:8.3-cli php MyExample.php