PHP code example of virtubrick / grid

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

    

virtubrick / grid example snippets


use Virtubrick\Grid\GridService;
use Virtubrick\Grid\Rcc\{Job, LuaScript};

$job = (new Job($jobId = '', $expirationInSeconds = 120))
		->arbiter(new GridService('http://127.0.0.1:64989'))
		->script(new LuaScript(
			$name = "RenderThumbnail {$key}",
			$script = $script,
			$arguments = $arguments
		));

[$renderB64, $assetDependencies] = $job->batch();

header('x-asset-dependencies', implode(',', $assetDependencies));
exit(base64_decode($renderB64));