You are here

class SjLocalDevClient in Acquia Cloud Site Factory Connector 8.2

Same name and namespace in other branches
  1. 8 acsf_sj/src/Api/SjLocalDevClient.php \Drupal\acsf_sj\Api\SjLocalDevClient

Provides a Scheduled Jobs API local development client.

Hierarchy

Expanded class hierarchy of SjLocalDevClient

File

acsf_sj/src/Api/SjLocalDevClient.php, line 10

Namespace

Drupal\acsf_sj\Api
View source
class SjLocalDevClient extends SjApiClient implements SjClientInterface {

  /**
   * {@inheritdoc}
   */
  public function addJob($drush_command, $reason = NULL, $timestamp = NULL, $domain = NULL, $timeout = NULL, $drush_executable = NULL, $drush_options = NULL) {
    try {
      $this
        ->inputValidation($drush_command, $timestamp, $domain, $timeout, $drush_executable, $drush_options);
    } catch (\Exception $e) {
      $this->logger
        ->log(LogLevel::ERROR, 'Local dev: unable to add the scheduled job: @message', [
        '@message' => $e
          ->getMessage(),
      ]);
      return FALSE;
    }
    $sjadd_arguments = $this
      ->prepareCommandArguments($drush_command, $reason, $timestamp, $domain, $timeout, $drush_executable, $drush_options);
    $this->logger
      ->log(LogLevel::NOTICE, 'Local dev: sjadd @arguments', [
      '@arguments' => $sjadd_arguments,
    ]);
    return TRUE;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
SjApiClient::$binary private property Scheduled Job's binaries path.
SjApiClient::$domain protected property Current domain of this site.
SjApiClient::$logger protected property A logger instance for acsf_sj.
SjApiClient::executeSjAdd private function Executes the sjadd command.
SjApiClient::inputValidation protected function Validates/completes the sjadd input.
SjApiClient::prepareCommandArguments protected function Compiles the argument to the sjadd command.
SjApiClient::__construct public function Constructs the ACSF SJ Client.
SjLocalDevClient::addJob public function Adds a scheduled job. Overrides SjApiClient::addJob