public function run(OutputInterface $output, $response)
    {
        $output->writeln('<comment>Diagnostics:</comment>');

        foreach ($response as $key => $value) {
            if (strcasecmp('php_version', $key) == 0) {
                $output->writeln('Checking php settings:');

                $output->writeln(
                    sprintf(
                        '- Requires PHP ' . ApiDiagnose::PHP_MIN . ' or better %s',
                        is_bool($value) ? '<error>FAIL</error>' : '<info>OK</info>'
                    )
                );
                if ($output->isVeryVerbose() && is_bool($value)) {
                    $this->writeComment(
                        $output,
                        'Upgrading to PHP ' .
                        ApiDiagnose::PHP_RECOMMANDED . ' or higher is recommended.'
                    );
                }
            }

            if (strcasecmp('php_ini', $key) == 0) {
                $output->writeln(
                    sprintf(
                        '- php.ini file loaded <info>%s</info>',
                        is_bool($value) ? 'NONE' : $value
                    )
                );
            }

            if (preg_match('/^(.*)_loaded$/', $key, $matches)) {
                // checks extensions loaded
                if (strcasecmp('xdebug', $matches[1]) == 0) {
                    // Xdebug is special case (performance issue)
                    $output->writeln(
                        sprintf(
                            '- Xdebug extension loaded %s',
                            $value ? '<warning>YES</warning>' : '<info>NO</info>'
                        )
                    );
                    if ($output->isVeryVerbose()) {
                        $this->writeComment(
                            $output,
                            'You are encouraged to unload xdebug extension' .
                            ' to speed up execution.'
                        );
                    }
                    if ($output->isVeryVerbose() && $response['xdebug_profiler_enable']) {
                        $this->writeComment(
                            $output,
                            'The xdebug.profiler_enable setting is enabled,' .
                            ' this can slow down execution a lot.'
                        );
                    }
                } else {
                    $output->writeln(
                        sprintf(
                            '- %s extension loaded %s',
                            $matches[1],
                            $value ? '<info>YES</info>' : '<error>FAIL</error>'
                        )
                    );
                }
            }
        }
    }
public function run(OutputInterface $output, $response)
    {
        $output->writeln('<comment>Diagnostics:</comment>');

        foreach ($response as $key => $value) {
            if (strcasecmp('php_version', $key) == 0) {
                $output->writeln('Checking php settings:');

                $output->writeln(
                    sprintf(
                        '- Requires PHP ' . ApiDiagnose::PHP_MIN . ' or better %s',
                        is_bool($value) ? '<error>FAIL</error>' : '<info>OK</info>'
                    )
                );
                if ($output->isVeryVerbose() && is_bool($value)) {
                    $this->writeComment(
                        $output,
                        'Upgrading to PHP ' .
                        ApiDiagnose::PHP_RECOMMANDED . ' or higher is recommended.'
                    );
                }
            }

            if (strcasecmp('php_ini', $key) == 0) {
                $output->writeln(
                    sprintf(
                        '- php.ini file loaded <info>%s</info>',
                        is_bool($value) ? 'NONE' : $value
                    )
                );
            }

            if (preg_match('/^(.*)_loaded$/', $key, $matches)) {
                // checks extensions loaded
                if (strcasecmp('xdebug', $matches[1]) == 0) {
                    // Xdebug is special case (performance issue)
                    $output->writeln(
                        sprintf(
                            '- Xdebug extension loaded %s',
                            $value ? '<warning>YES</warning>' : '<info>NO</info>'
                        )
                    );
                    if ($output->isVeryVerbose()) {
                        $this->writeComment(
                            $output,
                            'You are encouraged to unload xdebug extension' .
                            ' to speed up execution.'
                        );
                    }
                    if ($output->isVeryVerbose() && $response['xdebug_profiler_enable']) {
                        $this->writeComment(
                            $output,
                            'The xdebug.profiler_enable setting is enabled,' .
                            ' this can slow down execution a lot.'
                        );
                    }
                } else {
                    $output->writeln(
                        sprintf(
                            '- %s extension loaded %s',
                            $matches[1],
                            $value ? '<info>YES</info>' : '<error>FAIL</error>'
                        )
                    );
                }
            }
        }
    }
public function run ( OutputInterface $ output , $ response ) { $ output -> writeln ( '<comment>Diagnostics:</comment>' ) ; foreach ( $ response as $ key => $ value ) { if ( strcasecmp ( 'php_version' , $ key ) == 0 ) { $ output -> writeln ( 'Checking php settings:' ) ; $ output -> writeln ( sprintf ( '- Requires PHP ' . ApiDiagnose :: PHP_MIN . ' or better %s' , is_bool ( $ value ) ? '<error>FAIL</error>' : '<info>OK</info>' ) ) ; if ( $ output -> isVeryVerbose ( ) && is_bool ( $ value ) ) { $ this -> writeComment ( $ output , 'Upgrading to PHP ' . ApiDiagnose :: PHP_RECOMMANDED . ' or higher is recommended.' ) ; } } if ( strcasecmp ( 'php_ini' , $ key ) == 0 ) { $ output -> writeln ( sprintf ( '- php.ini file loaded <info>%s</info>' , is_bool ( $ value ) ? 'NONE' : $ value ) ) ; } if ( preg_match ( '/^(.*)_loaded$/' , $ key , $ matches ) ) { // checks extensions loaded if ( strcasecmp ( 'xdebug' , $ matches [ 1 ] ) == 0 ) { // Xdebug is special case (performance issue) $ output -> writeln ( sprintf ( '- Xdebug extension loaded %s' , $ value ? '<warning>YES</warning>' : '<info>NO</info>' ) ) ; if ( $ output -> isVeryVerbose ( ) ) { $ this -> writeComment ( $ output , 'You are encouraged to unload xdebug extension' . ' to speed up execution.' ) ; } if ( $ output -> isVeryVerbose ( ) && $ response [ 'xdebug_profiler_enable' ] ) { $ this -> writeComment ( $ output , 'The xdebug.profiler_enable setting is enabled,' . ' this can slow down execution a lot.' ) ; } } else { $ output -> writeln ( sprintf ( '- %s extension loaded %s' , $ matches [ 1 ] , $ value ? '<info>YES</info>' : '<error>FAIL</error>' ) ) ; } } } }
Diagnose run results

@param OutputInterface $output   Console Output concrete instance
@param array           $response Render config:validate command
Diagnose run results