PHP code example of mammatus / kubernetes-attributes

1. Go to this page and download the library: Download mammatus/kubernetes-attributes 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/ */

    

mammatus / kubernetes-attributes example snippets




declare(strict_types=1);

namespace WyriHaximus\Apps\WorldOfWarcraft\DataMiner\Images\BLP;

use Mammatus\Cron\Attributes\Cron;
use Mammatus\Cron\Contracts\Action;
use Mammatus\Kubernetes\Attributes\Resources;
use Mammatus\Kubernetes\Attributes\SplitOut;
use Psr\Log\LoggerInterface;

use function React\Async\await;
use function substr;

#[SplitOut]
#[Cron(
    'scan-images-blp-to-png',
    259200,
    '8 7 * * *',
    new Resources(
        cpu: 0.666,
        memory: 3,
    ),
)]
final readonly class Scan implements Action
{
    public function __construct(
        private LoggerInterface $logger,
    ) {
    }

    public function perform(): void
    {
        $this->logger->debug('Performing Cron Job');
    }
}