You are here

protected function Dbug::varIsResource in dBug for Drupal 8

Same name and namespace in other branches
  1. 2.0.x src/Dbug.php \Drupal\dbug\Dbug::varIsResource()
  2. 1.0.x src/Dbug.php \Drupal\dbug\Dbug::varIsResource()

If variable is a resource type.

Parameters

mixed $var: The variable.

1 call to Dbug::varIsResource()
Dbug::checkType in src/Dbug.php
Check variable type.

File

src/Dbug.php, line 449

Class

Dbug
Implementation of dBug for Drupal.

Namespace

Drupal\dbug

Code

protected function varIsResource($var) {
  $this
    ->makeTableHeader("resourceC", "resource", 1);
  $this->output[] = "<tr>\n<td>\n";
  switch (get_resource_type($var)) {
    case "fbsql result":
    case "mssql result":
    case "msql query":
    case "pgsql result":
    case "sybase-db result":
    case "sybase-ct result":
    case "mysql result":
      $db = current(explode(" ", get_resource_type($var)));
      $this
        ->varIsDbResource($var, $db);
      break;
    case "gd":
      $this
        ->varIsGdResource($var);
      break;
    case "xml":
      $this
        ->varIsXmlResource($var);
      break;
    default:
      $this->output[] = get_resource_type($var) . $this
        ->closeTdRow();
      break;
  }
  $this->output[] = $this
    ->closeTdRow() . "</table>\n";
}