1. Go to this page and download the library: Download dragonmantank/sched 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/ */
dragonmantank / sched example snippets
return [
'cron' => [
[
'name' => 'Name of cron job, for logging',
'expression' => '* * * * *',
'worker' => // Invokable that needs to run at this time
]
],
'logger' => MyLoggingFactory::class,
'custom_commands' => [MyCommand::class, MyOtherCommand::class],
'manager' => [
'max_workers' => 10,
'max_workers_per_tube' => 5,
],
'pheanstalk' => [
'host' => '127.0.0.1',
'port' => 113900,
'timeout' => 10,
],
'queues' => [
'queueName' => [
'worker' => // Invokable that processes the queue
],
],
];
// QueueFieldsForProcessing.php
use Me\MyApp\Command;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class QueueFilesForProcessing extends Command
{
protected static $defaultName = 'app:customcommand';
protected function configure(): void
{
$this
->setHelp('This is a sample command');
}
protected function execute(InputInterface $input, OutputInterface $output)
{
// Do some stuff
Return Command::SUCCESS;
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.