1. Go to this page and download the library: Download xervice/processor 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/ */
xervice / processor example snippets
/**
* @return \Xervice\Processor\Business\Model\InputHandler\InputHandlerInterface
*/
public function getInputHandler(): InputHandlerInterface
{
return new RawJsonFileRowInputHandler();
}
/**
* @return \Xervice\Validator\Business\Dependency\ValidatorConfigurationProviderPluginInterface[]
*/
public function getValidatorConfigurationPlugins(): array
{
return [
new TestValidator()
];
}
class TestValidator implements ValidatorConfigurationProviderPluginInterface
{
/**
* @return array
*/
public function getValidatorConfiguration(): array
{
return [
[
'test' => [
'
/**
* @return \Xervice\Processor\Business\Dependency\ProcessHydratorPluginInterface[]
*/
public function getHydratorPlugins(): array
{
return [
new TestHydrator()
];
}
class TestHydrator implements ProcessHydratorPluginInterface
{
/**
* @return array
*/
public function getHydratorConfiguration(): array
{
return [
[
'newValues' => function (array $payload) {
return [
[
$payload['test'][0]
],
[
$payload['test'][1]
]
];
},
'test'
]
];
}
}
/**
* @return \Xervice\Processor\Business\Dependency\ProcessTranslationPluginInterface[]
*/
public function getTranslatorPlugins(): array
{
return [
new TestTranslator()
];
}
/**
* @return \Xervice\Processor\Business\Model\OutputHandler\OutputHandlerInterface
*/
public function getOutputHandler(): OutputHandlerInterface
{
return new RawJsonFileOutputHandler();
}
$processConfig = (new ProcessRunDataProvider())
->setName('YOUR_PROCESS_PROCESS')
->setInput('input')
->setOutput('output');
$processorFacade->runProcess($processConfig);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.