You are here

function drd_server_server_php_error_log in Drupal Remote Dashboard Server 7

Same name and namespace in other branches
  1. 6.2 drd_server.server.inc \drd_server_server_php_error_log()
  2. 6 drd_server.server.inc \drd_server_server_php_error_log()
  3. 7.2 drd_server.server.inc \drd_server_server_php_error_log()
1 string reference to 'drd_server_server_php_error_log'
drd_server_xmlrpc in ./drd_server.module
Implementation of hook_xmlrpc().

File

./drd_server.server.inc, line 158

Code

function drd_server_server_php_error_log($sid, $max_length = 5000) {
  $user = drd_server_load_user($sid);
  if (is_string($user)) {
    return drd_server_error($user);
  }
  $log_file = ini_get('error_log');
  if (!file_exists($log_file)) {
    return drd_server_error(t('PHP Error Log does not exist.'));
  }
  $offset = max(-1, filesize($log_file) - $max_length);
  $log = file_get_contents($log_file, FILE_BINARY, NULL, $offset);
  return drd_server_result('server.php.error.log', array(
    $log,
  ));
}