You are here

function automatic_updates_exec_command in Automatic Updates 7

Helper method to execute exec command.

Parameters

string $command_argument: The command argument.

Return value

array An array with results of the command.

2 calls to automatic_updates_exec_command()
InPlaceUpdate::cacheClear in ./InPlaceUpdate.php
Clear cache on successful update.
InPlaceUpdate::update in ./InPlaceUpdate.php

File

./automatic_updates.module, line 176
Contains automatic_updates.module.

Code

function automatic_updates_exec_command($command_argument) {
  $module_path = drupal_get_path('module', 'automatic_updates');
  $command = [
    automatic_updates_find_php(),
    $module_path . '/scripts/automatic_update_tools',
    $command_argument,
  ];
  $output = [];
  $return_code = 0;
  exec(implode(' ', $command), $output, $return_code);
  return [
    'output' => $output,
    'return_code' => $return_code,
  ];
}