1. Go to this page and download the library: Download kukewang/hyperf_xxl_job 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/ */
declare(strict_types=1);
namespace App\Command;
use Hyperf\XxlJob\Annotation\XxlJob;
use Hyperf\XxlJob\Handler\AbstractJobHandler;
use Hyperf\XxlJob\Requests\RunRequest;
/**
* @XxlJob(jobHandler="testJobHandler",init="init",destroy="destroy")
*/
class TestCommand extends AbstractJobHandler
{
public function init()
{
var_dump('init');
}
public function execute(RunRequest $request): void
{
var_dump(1);
}
public function destroy()
{
var_dump('destroy');
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.