PHP code example of freshvine / expiringmediacache

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

    

freshvine / expiringmediacache example snippets


composer 



// Create an instance of the Expiring Media Cache
$ExpiringMedia = new \FreshVine\ExpiringMediaCache\ExpiringMediaCache();

// Get a local URL for cached media
$Cached = $ExpiringMedia->cacheThis('https://github.com/FreshVine/expiring-media-cache/raw/main/test/images/rodin-thinker.jpg');
$URL = $ExpiringMedia->getURL( $Cached );


// Expire media which has outlived its 
$ExpiringMedia->cleanUp();



$ExpiringMedia = new FreshVine\ExpiringMediaCache\ExpiringMediaCache( '/var/www/html/media/', 'http://localhost:8080/media/' );