1. Go to this page and download the library: Download nixphp/schedule 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/ */
nixphp / schedule example snippets
use NixPHP\Schedule\Core\ScheduledJobInterface;
use NixPHP\Queue\QueueJobInterface;
class CleanupTempFiles implements ScheduledJobInterface, QueueJobInterface
{
public function getCronExpression(): string
{
return '0 * * * *'; // every hour
}
public function execute(): void
{
// cleanup logic
}
}
// app/config.php
return [
'queue' => [
// If true (default): only the latest scheduled job is kept
// If false: every scheduled run is queued and processed
'coalesce' => true,
],
];
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.