1. Go to this page and download the library: Download survos/media-bundle 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/ */
survos / media-bundle example snippets
use Survos\DataContracts\Util\MediaKeyService;
$key = MediaKeyService::keyFromString('https://example.com/image.jpg');
$url = MediaKeyService::stringFromEncoded($key); // round-trips
use Survos\DataContracts\Util\MediaIdentity;
$id = MediaIdentity::idFromOriginalUrl('https://example.com/image.jpg');
// => 16 lowercase hex chars, e.g. "0c05e2ff8ac3dd8f"
use Survos\MediaBundle\Entity\BaseMedia;
use Survos\MediaBundle\Workflow\MediaWorkflowDefinition;
use Survos\WorkflowExtrasBundle\Attribute\AsWorkflow;
#[AsWorkflow(supports: [BaseMedia::class], name: self::WORKFLOW_NAME)]
final class MediaWorkflow extends MediaWorkflowDefinition
{
public const WORKFLOW_NAME = 'media';
}