PHP code example of opxcore / config-cache-files

1. Go to this page and download the library: Download opxcore/config-cache-files 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/ */

    

opxcore / config-cache-files example snippets


use OpxCore\Config\ConfigCacheFiles;

$configFiles = new ConfigCacheFiles($path);

use OpxCore\Config\Interfaces\ConfigCacheInterface;
use OpxCore\Config\ConfigCacheFiles;

$container->bind(
    ConfigCacheInterface::class, 
    ConfigCacheFiles::class, 
    ['path' => $path]
);

$configCache = $container->make(ConfigCacheInterface::class);

// or

$container->bind(ConfigCacheInterface::class, ConfigCacheFiles::class);

$configCache = $container->make(ConfigCacheInterface::class, ['path' => $path]);

$loaded = $configCache->load($config, $profile)

$configCache->save($config, $profile, $ttl)