src/Psecio/Iniscan/Command/FixCommand.php
public function generateIniOutput($rules)
    {
        $ini = '';
        $config = array();

        foreach ($rules as $section => $ruleSet) {
            foreach ($ruleSet as $rule) {
                if (isset($rule->test)) {
                    if (is_object($rule->test)) {
                        if (!in_array($rule->test->operation, array('isset'))) {
                            $ini .= $rule->test->key.' = '.$rule->test->value."\n";
                        }
                    } else if (is_string($rule->test)) {
                        // no test object defined, this is a custom test
                        $testPath = '\\Psecio\\Iniscan\\Rule\\'.$rule->test;
                        if (class_exists($testPath)) {
                            $test = new $testPath($config, $section);
                            if (method_exists($test, '__toString')) {
                                $ini .= $test;
                            }
                        }
                    }
                }
            }
        }
        $ini .= "\n";
        return $ini;
    }
public function generateIniOutput($rules)
    {
        $ini = '';
        $config = array();

        foreach ($rules as $section => $ruleSet) {
            foreach ($ruleSet as $rule) {
                if (isset($rule->test)) {
                    if (is_object($rule->test)) {
                        if (!in_array($rule->test->operation, array('isset'))) {
                            $ini .= $rule->test->key.' = '.$rule->test->value."\n";
                        }
                    } else if (is_string($rule->test)) {
                        // no test object defined, this is a custom test
                        $testPath = '\\Psecio\\Iniscan\\Rule\\'.$rule->test;
                        if (class_exists($testPath)) {
                            $test = new $testPath($config, $section);
                            if (method_exists($test, '__toString')) {
                                $ini .= $test;
                            }
                        }
                    }
                }
            }
        }
        $ini .= "\n";
        return $ini;
    }
public function generateIniOutput ( $ rules ) { $ ini = '' ; $ config = array ( ) ; foreach ( $ rules as $ section => $ ruleSet ) { foreach ( $ ruleSet as $ rule ) { if ( isset ( $ rule -> test ) ) { if ( is_object ( $ rule -> test ) ) { if ( ! in_array ( $ rule -> test -> operation , array ( 'isset' ) ) ) { $ ini .= $ rule -> test -> key . ' = ' . $ rule -> test -> value . "\n" ; } } else if ( is_string ( $ rule -> test ) ) { // no test object defined, this is a custom test $ testPath = '\\Psecio\\Iniscan\\Rule\\' . $ rule -> test ; if ( class_exists ( $ testPath ) ) { $ test = new $ testPath ( $ config , $ section ) ; if ( method_exists ( $ test , '__toString' ) ) { $ ini .= $ test ; } } } } } } $ ini .= "\n" ; return $ ini ; }
Generate the output string of the more secure ini settings

@param array $rules Set of current rules
@return string INI string
Generate the output string of the more secure ini settings