src/Module/Cache/CalgamoFileCacheModule.php
public function install(ApplicationInterface $app)
    {
        try{
            $cache_driver = new FileCacheDriver([
                FileCacheConfig::KEY_CACHE_ROOT => $app->fileSystem()->getDirectory('cache'),
                FileCacheConfig::KEY_CACHE_EXPIRE => 6000,  // cache expires 1 minute
            ]);
            $cache = new CalgamoCacheAdapter($cache_driver);
            $app->cache($cache);

            // fire event
            $app->eventstream()->channel(Channels::SYSTEM)->push(Events::CACHE_ATTACHED, $cache);
        }
        catch(\Throwable $e)
        {
            throw new ModuleInstallationException(self::class, $e->getMessage(), $e);
        }
    }
public function install(ApplicationInterface $app)
    {
        try{
            $cache_driver = new FileCacheDriver([
                FileCacheConfig::KEY_CACHE_ROOT => $app->fileSystem()->getDirectory('cache'),
                FileCacheConfig::KEY_CACHE_EXPIRE => 6000,  // cache expires 1 minute
            ]);
            $cache = new CalgamoCacheAdapter($cache_driver);
            $app->cache($cache);

            // fire event
            $app->eventstream()->channel(Channels::SYSTEM)->push(Events::CACHE_ATTACHED, $cache);
        }
        catch(\Throwable $e)
        {
            throw new ModuleInstallationException(self::class, $e->getMessage(), $e);
        }
    }
public function install ( ApplicationInterface $ app ) { try { $ cache_driver = new FileCacheDriver ( [ FileCacheConfig :: KEY_CACHE_ROOT => $ app -> fileSystem ( ) -> getDirectory ( 'cache' ) , FileCacheConfig :: KEY_CACHE_EXPIRE => 6000 , // cache expires 1 minute ] ) ; $ cache = new CalgamoCacheAdapter ( $ cache_driver ) ; $ app -> cache ( $ cache ) ; // fire event $ app -> eventstream ( ) -> channel ( Channels :: SYSTEM ) -> push ( Events :: CACHE_ATTACHED , $ cache ) ; } catch ( \ Throwable $ e ) { throw new ModuleInstallationException ( self :: class , $ e -> getMessage ( ) , $ e ) ; } }
Install module

@param ApplicationInterface $app

@throws ModuleInstallationException
Install module