function httprl_pr

cis7 httprl.module httprl_pr($input)
cle7 httprl.module httprl_pr($input)
elmsmedia7 httprl.module httprl_pr($input)
icor7 httprl.module httprl_pr($input)
meedjum_blog7 httprl.module httprl_pr($input)
mooc7 httprl.module httprl_pr($input)

Pretty print data.

Parameters

string $input: Data In.

Return value

string Human readable HTML version of the data.

13 calls to httprl_pr()
advagg_admin_get_file_info_callback in sites/all/modules/ulmus/advagg/advagg.admin.inc
Display file info via ajax callback.
advagg_admin_get_file_info_submit in sites/all/modules/ulmus/advagg/advagg.admin.inc
Display file info in a drupal message.
advagg_validator_admin_test_advagg_css_callback in sites/all/modules/ulmus/advagg/advagg_validator/advagg_validator.admin.inc
Display file info via ajax callback.
advagg_validator_admin_test_advagg_css_directory_callback in sites/all/modules/ulmus/advagg/advagg_validator/advagg_validator.admin.inc
Display file info via ajax callback.
advagg_validator_admin_test_advagg_css_directory_submit in sites/all/modules/ulmus/advagg/advagg_validator/advagg_validator.admin.inc
Display file info in a drupal message.

... See full list

6 string references to 'httprl_pr'
httprl.examples.php in sites/all/modules/ulmus/httprl/examples/httprl.examples.php
HTTP Parallel Request Library code examples.
httprl_parse_data in sites/all/modules/ulmus/httprl/httprl.module
Extract the header and meta data from the http data stream.
httprl_parse_url in sites/all/modules/ulmus/httprl/httprl.module
Run parse_url and handle any errors.
httprl_send_request in sites/all/modules/ulmus/httprl/httprl.module
Perform many HTTP requests.
httprl_set_socket in sites/all/modules/ulmus/httprl/httprl.module
Create the TCP/SSL socket connection string.

... See full list

File

sites/all/modules/ulmus/httprl/httprl.module, line 2624
HTTP Parallel Request Library module.

Code

function httprl_pr($input) {
  $old_setting = ini_set('mbstring.substitute_character', '"none"');

  // Get extra arguments passed in.
  $input = func_get_args();

  // If bool or strlen = 0 use var_export on that variable.
  $data = httprl_print_empty($input);

  // Merge into base array if only one argument passed in.
  if (count($data) == 1) {
    $data = array_pop($data);
  }

  // Print_r the input.
  $output = print_r($data, TRUE);

  // Remove non UTF-8 Characters.
  if (function_exists('mb_convert_encoding')) {
    $translated = mb_convert_encoding($output, 'UTF-8', 'auto');
  }
  else {
    $translated = @iconv('utf-8', 'utf-8//TRANSLIT//IGNORE', $output);
  }

  // Convert html entities.
  $options = ENT_QUOTES;
  if (defined('ENT_SUBSTITUTE')) {
    $options = ENT_QUOTES | ENT_SUBSTITUTE;
  }
  elseif (defined('ENT_IGNORE')) {
    $options = ENT_QUOTES | ENT_IGNORE;
  }
  $translated = htmlentities($translated, $options, 'UTF-8');

  // Make sure the UTF-8 translation didn't kill the output.
  $original_size = strlen($output);
  $translated_size = strlen($translated);
  $ratio = 0;
  if ($original_size != 0) {
    $ratio = ($original_size - $translated_size) / $original_size;
  }

  // Decide to use the original output or the translated one.
  if (!empty($translated_size) && !empty($ratio) && $ratio < 0.5) {
    $html_output = TRUE;
    $output = $translated;
  }
  else {
    $output = '<pre>' . str_replace(array('<', '>'), array('&lt;', '&gt;'), $output) . '</pre>';
  }

  // Remove extra new lines.
  $output = array_filter(explode("\n", $output), 'strlen');

  // Whitespace compression.
  foreach ($output as $key => $value) {
    if (str_replace('    ', '', $value) == "(") {
      $output[$key - 1] .= ' (';
      unset($output[$key]);
    }
  }

  // Replace whitespace with html markup.
  $output = implode("\n", $output);
  if (!empty($html_output)) {
    $output = str_replace('    ', '&nbsp;&nbsp;&nbsp;&nbsp;', nl2br($output)) . '<br />';
  }

  ini_set('mbstring.substitute_character', $old_setting);
  return $output;
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.