You are here

function drd_server_domain_php in Drupal Remote Dashboard Server 7.2

Same name and namespace in other branches
  1. 6.2 drd_server.domain.inc \drd_server_domain_php()

Parameters

string $php:

Return value

string

1 string reference to 'drd_server_domain_php'
drd_server_drd_server_actions in ./drd_server.module
Implements hook_drd_server_actions().

File

./drd_server.domain.inc, line 326
Provides domain related functionality triggered by DRD.

Code

function drd_server_domain_php($php) {
  try {
    if (module_exists('php')) {
      php_eval($php);
    }
    else {
      $filename = 'temporary://drd_remote_php.inc';
      file_put_contents($filename, $php);
      include_once $filename;
      unlink($filename);
    }
  } catch (Exception $ex) {
    watchdog_exception('DRD Server', $ex, 'Error while executing PHP.');
  }
  return drd_server_result('php', '');
}