1. Go to this page and download the library: Download docplanner/tasks-bundle 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/ */
docplanner / tasks-bundle example snippets
class SamplePayload extends BaseTaskPayload
{
protected $someValue;
public function __construct(string $someValue)
{
$this->someValue = $someValue;
}
public function getSomeValue() : string
{
return $this->someValue;
}
}
class SampleTask extends BaseTask
{
/**
* @var SamplePayload $payload
*/
protected function execute(BaseTaskPayload $payload): bool
{
file_put_contents('/tmp/payload.log', var_export($payload, true) . PHP_EOL . $payload->getSomeValue());
return true;
}
public function supports(BaseTaskPayload $payload): bool
{
return $payload instanceof SamplePayload;
}
}