You are here

public function ComposerDependenciesCheck::check in CloudFlare 8

Tests that composer dependencies for CloudFlare are met.

Return value

bool TRUE if composer dependencies are met. FALSE otherwise.

Overrides CloudFlareComposerDependenciesCheckInterface::check

1 call to ComposerDependenciesCheck::check()
ComposerDependenciesCheck::assert in src/ComposerDependenciesCheck.php
Asserts that composer dependencies for CloudFlare are met.

File

src/ComposerDependenciesCheck.php, line 49

Class

ComposerDependenciesCheck
Tests that composer dependencies are met.

Namespace

Drupal\cloudflare

Code

public function check() {

  // This check will help prevent multiple redundant criticals from being
  // logged.
  if (!is_null(self::$areDependenciesMet)) {
    return self::$areDependenciesMet;
  }
  if (class_exists('\\CloudFlarePhpSdk\\ApiEndpoints\\ZoneApi')) {
    self::$areDependenciesMet = TRUE;
  }
  else {
    self::$areDependenciesMet = FALSE;
    $this->logger
      ->critical(self::ERROR_MESSAGE);
  }
  return self::$areDependenciesMet;
}