Prose\FromHost::getLegacyAppSetting PHP Метод

getLegacyAppSetting() защищенный Метод

protected getLegacyAppSetting ( string $appName, string $settingName ) : mixed
$appName string
$settingName string
Результат mixed
    protected function getLegacyAppSetting($appName, $settingName)
    {
        // what are we doing?
        $log = usingLog()->startAction("get {$settingName} for '{$appName}' from host '{$this->args[0]}'");
        // make sure we have valid host details
        $hostDetails = $this->getHostDetails();
        // do we have any app settings?
        if (!isset($hostDetails->appSettings)) {
            $log->endAction("host has no appSettings at all");
            throw new E5xx_ActionFailed(__METHOD__);
        }
        if (!isset($hostDetails->appSettings->{$appName})) {
            $log->endAction("host has no appSettings for {$appName}");
            throw new E5xx_ActionFailed(__METHOD__);
        }
        if (!isset($hostDetails->appSettings->{$appName}->{$settingName})) {
            $log->endAction("host has no appSetting '{$settingName}' for {$appName}");
            throw new E5xx_ActionFailed(__METHOD__);
        }
        // yes we do
        $value = $hostDetails->appSettings->{$appName}->{$settingName};
        // log the settings
        $printer = new DataPrinter();
        $logValue = $printer->convertToString($value);
        $log->endAction("setting for '{$appName}' is '{$logValue}'");
        // all done
        return $value;
    }