PHP code example of camilord / utilus

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

    

camilord / utilus example snippets


// I need UUID
echo UUID::v4();

// I need to process upload file
$tmp_dir = '/tmp/junkies/';
$uploader = new FileUpload($_FILES);
$uploader->setTemporaryUploadDir($tmp_dir, true);
$fileObj = $uploader->processUpload('document_name');
echo $fileObj->getFilePath();

// I need to know the number of days left for my domain SSL
$sslUtil = new SSLUtil();
$url = 'https://www.abcs.co.nz';
$days = $sslUtil->getSslDaysLeft($url);
if ($days === false) {
    echo "Error! Cannot fetch SSL information.";
} else {
    echo $days.' days left';
}

$chunks = ArrayUtilus::aws_sqs_array_chunk($data);

foreach ($chunks as $chunk) 
{
    $this->bus->dispatch(new DataUpdateMessage($chunk));
}

$chunks = ArrayUtilus::aws_sqs_array_chunk($data);

foreach ($chunks as $chunk) 
{
    DataUpdateQueue::dispatch($chunk)->onConnection($sqs_connection);
}