public static function loadCmdLineArgs($settings)
    {
        $error = false;

        static $ktr = [
            '-' => '',
        ];

        foreach ($settings as $k => $v) {
            $k = strtolower(strtr($k, $ktr));

            if ($k === 'config') {
                $k = 'configfile';
            }

            if (($k === 'user') || ($k === 'group')) {
                if ($v === '') {
                    $v = null;
                }
            }
            if (isset(Daemon::$config->{$k})) {
                Daemon::$config->{$k}->setHumanValue($v);
                Daemon::$config->{$k}->source = 'cmdline';
            } else {
                Daemon::log('Unrecognized parameter \'' . $k . '\'');
                $error = true;
            }
        }

        return !$error;
    }
public static function loadCmdLineArgs($settings)
    {
        $error = false;

        static $ktr = [
            '-' => '',
        ];

        foreach ($settings as $k => $v) {
            $k = strtolower(strtr($k, $ktr));

            if ($k === 'config') {
                $k = 'configfile';
            }

            if (($k === 'user') || ($k === 'group')) {
                if ($v === '') {
                    $v = null;
                }
            }
            if (isset(Daemon::$config->{$k})) {
                Daemon::$config->{$k}->setHumanValue($v);
                Daemon::$config->{$k}->source = 'cmdline';
            } else {
                Daemon::log('Unrecognized parameter \'' . $k . '\'');
                $error = true;
            }
        }

        return !$error;
    }
public static function loadCmdLineArgs ( $ settings ) { $ error = false ; static $ ktr = [ '-' => '' , ] ; foreach ( $ settings as $ k => $ v ) { $ k = strtolower ( strtr ( $ k , $ ktr ) ) ; if ( $ k === 'config' ) { $ k = 'configfile' ; } if ( ( $ k === 'user' ) || ( $ k === 'group' ) ) { if ( $ v === '' ) { $ v = null ; } } if ( isset ( Daemon :: $ config -> { $ k } ) ) { Daemon :: $ config -> { $ k } -> setHumanValue ( $ v ) ; Daemon :: $ config -> { $ k } -> source = 'cmdline' ; } else { Daemon :: log ( 'Unrecognized parameter \'' . $ k . '\'' ) ; $ error = true ; } } return ! $ error ; }
Imports parameters from command line args
@param array Settings.
@return boolean - Success.
Imports parameters from command line args