This commit is contained in:
Astrologies 2021-12-12 04:19:18 -05:00
commit 9bd3b5a2c1
2 changed files with 30 additions and 2 deletions

View File

@ -409,6 +409,16 @@ namespace Alphaland\Client {
$combinedDependencies = self::GetApplicationSettings($applicationName);
foreach ($currentDependencies as $dependency) {
// skip it if it doesn't exist just to be safe
if (!self::ApplicationExists($dependency)) {
continue;
}
// Check if the dependency has a dep on us already
if (self::ApplicationHasDependency($dependency, $applicationName)) {
continue;
}
if ($recursive && self::ApplicationHasAnyDependencies($dependency)) {
$combinedDependencies = array_merge($combinedDependencies, self::FetchCombinedApplicationDependencies($dependency, $recursive));
} else {
@ -464,7 +474,7 @@ namespace Alphaland\Client {
/**
* The client settings kind.
*/
class ClientSettingsKind
abstract class ClientSettingsKind
{
public const Unscoped = "Unscoped";
public const FastLog = "FastLog";

View File

@ -15,7 +15,7 @@ namespace Alphaland\Web {
use PDO;
class WebsiteSettings
/* public static */ class WebsiteSettings
{
// default return if no settings are found
// because there may be a NULL value in the database
@ -99,6 +99,24 @@ namespace Alphaland\Web {
return self::ConvertStringToValue($result['value'], $result['type']);
}
/**
* Gets or sets the value of a website setting.
*
* @param string $name The name of the setting.
* @param mixed $value The value of the setting.
* @param string $type The type of the setting.
*
* @return mixed The value of the setting.
*/
public static function GetOrCreateSetting(string $name, $value = null, string $type = null)
{
if (!self::SettingExists($name)) {
self::UpdateSetting($name, $value, $type);
}
return self::GetSetting($name);
}
/**
* Sets a website setting.
*