1 | <?php |
||
5 | class Config |
||
6 | { |
||
7 | /** |
||
8 | * Instance of self. |
||
9 | * |
||
10 | * @var Config |
||
11 | */ |
||
12 | private static $instance; |
||
13 | |||
14 | /** |
||
15 | * Yarak config array. |
||
16 | * |
||
17 | * @var array |
||
18 | */ |
||
19 | protected $configArray; |
||
20 | |||
21 | /** |
||
22 | * Private constructor. |
||
23 | */ |
||
24 | private function __construct(array $configArray) |
||
28 | |||
29 | /** |
||
30 | * Get instance of self with config array set. |
||
31 | * |
||
32 | * @param array $configArray |
||
33 | * |
||
34 | * @return Config |
||
35 | */ |
||
36 | public static function getInstance(array $configArray = []) |
||
44 | |||
45 | /** |
||
46 | * Get a value from the config array. |
||
47 | * |
||
48 | * @param string|array $value |
||
49 | * |
||
50 | * @return mixed |
||
51 | */ |
||
52 | public function get($value) |
||
66 | |||
67 | /** |
||
68 | * Return config array. |
||
69 | * |
||
70 | * @return array |
||
71 | */ |
||
72 | public function getAll() |
||
76 | |||
77 | /** |
||
78 | * Return the database directory path. |
||
79 | * |
||
80 | * @return string |
||
81 | */ |
||
82 | public function getDatabaseDirectory() |
||
86 | |||
87 | /** |
||
88 | * Return the migration directory path. |
||
89 | * |
||
90 | * @param string $path |
||
91 | * |
||
92 | * @return string |
||
93 | */ |
||
94 | public function getMigrationDirectory($path = '') |
||
98 | |||
99 | /** |
||
100 | * Return the factory directory path. |
||
101 | * |
||
102 | * @param string $path |
||
103 | * |
||
104 | * @return string |
||
105 | */ |
||
106 | public function getFactoryDirectory($path = '') |
||
110 | |||
111 | /** |
||
112 | * Return the seeds directory path. |
||
113 | * |
||
114 | * @param string $path |
||
115 | * |
||
116 | * @return string |
||
117 | */ |
||
118 | public function getSeedDirectory($path = '') |
||
122 | |||
123 | /** |
||
124 | * Make database directory structure if it doesn't exist. |
||
125 | */ |
||
126 | public function getAllDatabaseDirectories() |
||
135 | } |
||
136 |