You are here

protected function FeedsExBase::debug in Feeds extensible parsers 7

Same name and namespace in other branches
  1. 7.2 src/FeedsExBase.inc \FeedsExBase::debug()

Renders our debug messages into a list.

Parameters

mixed $data: The result of an expression. Either a scalar or a list of scalars.

string $machine_name: The source key that produced this query.

1 call to FeedsExBase::debug()
FeedsExBase::executeSources in src/FeedsExBase.inc
Executes the source expressions.

File

src/FeedsExBase.inc, line 387
Contains FeedsExBase.

Class

FeedsExBase
The Feeds extensible parser.

Code

protected function debug($data, $machine_name) {
  $name = $machine_name;
  if ($this->config['sources'][$machine_name]['name']) {
    $name = $this->config['sources'][$machine_name]['name'];
  }
  $output = '<strong>' . $name . ':</strong>';
  $data = is_array($data) ? $data : array(
    $data,
  );
  foreach ($data as $key => $value) {
    $data[$key] = check_plain($value);
  }
  $output .= theme('item_list', array(
    'items' => $data,
  ));
  $this
    ->getMessenger()
    ->setMessage($output);
}