-
Notifications
You must be signed in to change notification settings - Fork 269
Expand file tree
/
Copy pathSettingsServiceInterface.php
More file actions
150 lines (130 loc) · 3.27 KB
/
Copy pathSettingsServiceInterface.php
File metadata and controls
150 lines (130 loc) · 3.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2026 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 3.0 Alpha 4
*/
declare(strict_types=1);
namespace SMF\Services\Contracts;
/**
* Interface for Settings.php configuration management service.
*
* This service handles file-based configuration stored in Settings.php.
* These are system-level settings like database credentials, directory paths,
* and core configuration that rarely changes.
*/
interface SettingsServiceInterface
{
/****************
* Public methods
****************/
/**
* Get a configuration value from Settings.php.
*
* @param string $key The configuration key
* @param mixed $default Default value if key doesn't exist
* @return mixed The configuration value
*/
public function get(string $key, mixed $default = null): mixed;
/**
* Set a configuration value (in memory only).
*
* This does not persist to Settings.php. Use updateFile() to persist.
*
* @param string $key The configuration key
* @param mixed $value The value to set
*/
public function set(string $key, mixed $value): void;
/**
* Update the Settings.php file.
*
* @param array $configVars Array of configuration variables to update
* @param bool $keepQuotes Whether to keep quotes around values
* @param bool $rebuild Whether to rebuild the file
* @return bool Success status
*/
public function updateFile(array $configVars, bool $keepQuotes = false, bool $rebuild = false): bool;
/**
* Get the board URL.
*
* @return string The board URL
*/
public function getBoardUrl(): string;
/**
* Get the script URL.
*
* @return string The script URL
*/
public function getScriptUrl(): string;
/**
* Get the board directory.
*
* @return string The board directory path
*/
public function getBoardDir(): string;
/**
* Get the sources directory.
*
* @return string The sources directory path
*/
public function getSourcesDir(): string;
/**
* Get the cache directory.
*
* @return string The cache directory path
*/
public function getCacheDir(): string;
/**
* Get the languages directory.
*
* @return string The languages directory path
*/
public function getLanguagesDir(): string;
/**
* Check if maintenance mode is enabled.
*
* @return bool True if maintenance mode is enabled
*/
public function isMaintenanceMode(): bool;
/**
* Get the maintenance mode level.
*
* @return int Maintenance mode level (0, 1, or 2)
*/
public function getMaintenanceLevel(): int;
/**
* Get the forum name.
*
* @return string The forum name
*/
public function getForumName(): string;
/**
* Get the database type.
*
* @return string The database type (mysql, postgresql, etc.)
*/
public function getDatabaseType(): string;
/**
* Get the database server.
*
* @return string The database server
*/
public function getDatabaseServer(): string;
/**
* Get the database name.
*
* @return string The database name
*/
public function getDatabaseName(): string;
/**
* Get the database prefix.
*
* @return string The database table prefix
*/
public function getDatabasePrefix(): string;
}