ConfigCacheFactoryInterface.php 977 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Config;
  11. /**
  12. * Interface for a ConfigCache factory. This factory creates
  13. * an instance of ConfigCacheInterface and initializes the
  14. * cache if necessary.
  15. *
  16. * @author Matthias Pigulla <mp@webfactory.de>
  17. */
  18. interface ConfigCacheFactoryInterface
  19. {
  20. /**
  21. * Creates a cache instance and (re-)initializes it if necessary.
  22. *
  23. * @param string $file The absolute cache file path
  24. * @param callable $callable The callable to be executed when the cache needs to be filled (i. e. is not fresh). The cache will be passed as the only parameter to this callback
  25. *
  26. * @return ConfigCacheInterface The cache instance
  27. */
  28. public function cache(string $file, callable $callable);
  29. }