protected function debug($actions, &$context)
    {
        if (!is_array($actions)) {
            return;
        }
        foreach ($actions as $action => $parameters) {
            if ('display' == $action) {
                foreach ($parameters as $var) {
                    echo "\n";
                    echo $var.' => ';
                    $command = 'print_r($'.$var.');';
                    eval($command);
                }
                flush();
                ob_flush();
            }

            if ('break' == $action && false !== $parameters) {
                if (function_exists('xdebug_break')) {
                    xdebug_break();
                }
            }

            if ('sleep' == $action) {
                echo 'Sleeping for '.$parameters.' seconds due to sleep step...'."\n";
                sleep($parameters);
            }

            if ('exit' == $action && false !== $parameters) {
                echo 'Exit due to debug step'."\n";
                exit;
            }
        }

        return;
    }