1 | <?php |
||
7 | trait PathHelpers |
||
8 | { |
||
9 | /** |
||
10 | * Get a value from the config array. |
||
11 | * |
||
12 | * @param string|array $value |
||
13 | * |
||
14 | * @return mixed |
||
15 | */ |
||
16 | abstract public function get($value); |
||
17 | |||
18 | /** |
||
19 | * Return true if config array has given value. |
||
20 | * |
||
21 | * @param mixed $value |
||
22 | * |
||
23 | * @return bool |
||
24 | */ |
||
25 | abstract public function has($value); |
||
26 | |||
27 | /** |
||
28 | * Validate that a setting exists. |
||
29 | * |
||
30 | * @param array $settings |
||
31 | * |
||
32 | * @throws InvalidConfig |
||
33 | */ |
||
34 | abstract public function validate(array $settings); |
||
35 | |||
36 | /** |
||
37 | * Return the app path. |
||
38 | * |
||
39 | * @return string |
||
40 | */ |
||
41 | public function getAppPath() |
||
47 | |||
48 | /** |
||
49 | * Return the database directory path. |
||
50 | * |
||
51 | * @return string |
||
52 | */ |
||
53 | public function getDatabaseDirectory() |
||
59 | |||
60 | /** |
||
61 | * Return the migration directory path. |
||
62 | * |
||
63 | * @param string $path |
||
64 | * |
||
65 | * @return string |
||
66 | */ |
||
67 | public function getMigrationDirectory($path = '') |
||
71 | |||
72 | /** |
||
73 | * Return the factory directory path. |
||
74 | * |
||
75 | * @param string $path |
||
76 | * |
||
77 | * @return string |
||
78 | */ |
||
79 | public function getFactoryDirectory($path = '') |
||
83 | |||
84 | /** |
||
85 | * Return the seeds directory path. |
||
86 | * |
||
87 | * @param string $path |
||
88 | * |
||
89 | * @return string |
||
90 | */ |
||
91 | public function getSeedDirectory($path = '') |
||
95 | |||
96 | /** |
||
97 | * Make database directory structure if it doesn't exist. |
||
98 | */ |
||
99 | public function getAllDatabaseDirectories() |
||
108 | |||
109 | /** |
||
110 | * Get the console directory path. |
||
111 | * |
||
112 | * @param string $path |
||
113 | * |
||
114 | * @return string |
||
115 | */ |
||
116 | public function getConsoleDirectory($path = '') |
||
125 | |||
126 | /** |
||
127 | * Get the commands directory path. |
||
128 | * |
||
129 | * @param string $path |
||
130 | * |
||
131 | * @return string |
||
132 | */ |
||
133 | public function getCommandsDirectory($path = '') |
||
144 | } |
||
145 |