You are here

public function Nodejs::safeNodeServerVersion in Node.js integration 8

1 call to Nodejs::safeNodeServerVersion()
Nodejs::sendMessage in src/Nodejs.php

File

src/Nodejs.php, line 79

Class

Nodejs

Namespace

Drupal\nodejs

Code

public function safeNodeServerVersion() {
  if ($this->nodeServerVersion === NULL) {
    $this
      ->healthCheck();
  }
  if (empty($this->nodeServerVersion)) {

    // Version number is missing. Assume incompatibility.
    return FALSE;
  }
  $current_major = (int) $this->nodeServerVersion;
  $required_major = (int) self::SAFE_NODE_SERVER_VERSION;
  return $current_major == $required_major && version_compare($this->nodeServerVersion, self::SAFE_NODE_SERVER_VERSION) >= 0;
}