PHP code example of iiifx-production / yii2-folder-dependency

1. Go to this page and download the library: Download iiifx-production/yii2-folder-dependency 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/ */

    

iiifx-production / yii2-folder-dependency example snippets

 php
use iiifx\cache\dependency\FolderDependency;

$cache = Yii::$app->cache;

# Проверяем наличие кэша
if ( ( $cachedData = $cache->get( 'some-cache-key' ) ) === FALSE ) {

    # Кэша нет, подготавливаем данные
    $cachedData = [ /* .. */ ];

    # Создаем зависимость для кэша
    $folderDependency = new FolderDependency( [
        'folder' => '/path/to/folder'
    ] );

    # Кэшируем данные
    $cache->set( 'some-cache-key', $cachedData, 0, $folderDependency );

}

# Пользуемся данными
var_export( $cachedData );