ConfigEngineInterface.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  4. * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
  5. *
  6. * Licensed under The MIT License
  7. * For full copyright and license information, please see the LICENSE.txt
  8. * Redistributions of files must retain the above copyright notice.
  9. *
  10. * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
  11. * @link https://cakephp.org CakePHP(tm) Project
  12. * @since 1.0.0
  13. * @license https://opensource.org/licenses/mit-license.php MIT License
  14. */
  15. namespace Cake\Core\Configure;
  16. /**
  17. * An interface for creating objects compatible with Configure::load()
  18. */
  19. interface ConfigEngineInterface
  20. {
  21. /**
  22. * Read a configuration file/storage key
  23. *
  24. * This method is used for reading configuration information from sources.
  25. * These sources can either be static resources like files, or dynamic ones like
  26. * a database, or other datasource.
  27. *
  28. * @param string $key Key to read.
  29. * @return array An array of data to merge into the runtime configuration
  30. */
  31. public function read($key);
  32. /**
  33. * Dumps the configure data into the storage key/file of the given `$key`.
  34. *
  35. * @param string $key The identifier to write to.
  36. * @param array $data The data to dump.
  37. * @return bool True on success or false on failure.
  38. */
  39. public function dump($key, array $data);
  40. }