1: <?php
2: /**
3: * This file is part of the Autarky package.
4: *
5: * (c) Andreas Lutro <anlutro@gmail.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:
11: namespace Autarky\Config;
12:
13: /**
14: * Interface for configuration stores.
15: */
16: interface ConfigInterface
17: {
18: /**
19: * Determine if a key exists in the store.
20: *
21: * Should return true even if the value is null.
22: *
23: * @param string $key
24: *
25: * @return boolean
26: */
27: public function has($key);
28:
29: /**
30: * Get an item from the store.
31: *
32: * @param string $key
33: * @param mixed $default If the value is not found, return this instead.
34: *
35: * @return mixed
36: */
37: public function get($key, $default = null);
38:
39: /**
40: * Set an item in the store temporarily - more specifically, the lifetime of
41: * the store object.
42: *
43: * @param string $key
44: * @param mixed $value
45: *
46: * @return void
47: */
48: public function set($key, $value);
49:
50: /**
51: * Mount a path to a specific location in the config tree.
52: *
53: * @param string $location
54: * @param string $path
55: *
56: * @return void
57: */
58: public function mount($location, $path);
59:
60: /**
61: * Set the environment.
62: *
63: * @param string $environment
64: */
65: public function setEnvironment($environment);
66: }
67: