You are here

public function SimpleInstagramFeedLibrary::isAvailable in Simple Instagram Feed Block 8.3

Check library avalilability.

Parameters

bool $warning: Add a warning message if library is not available.

Return value

bool

Overrides SimpleInstagramFeedLibraryInterface::isAvailable

File

src/Services/SimpleInstagramFeedLibrary.php, line 25

Class

SimpleInstagramFeedLibrary
Implements Simple Instagram Feed Library service.

Namespace

Drupal\simple_instagram_feed\Services

Code

public function isAvailable(bool $warning = FALSE) {
  if (!file_exists($this->root . $this
    ->getPath())) {
    if ($warning) {
      $this
        ->messenger()
        ->addWarning($this
        ->getWarningMessage());
    }
    return FALSE;
  }
  return TRUE;
}