You are here

function disqus_api in Disqus 8

Same name and namespace in other branches
  1. 7 disqus.module \disqus_api()

Creates an instance of the Disqus PHP API.

Return value

object The instance of the Disqus API.

5 calls to disqus_api()
DisqusComment::import in src/Plugin/migrate/destination/DisqusComment.php
Import the row.
DisqusComment::initializeIterator in src/Plugin/migrate/source/DisqusComment.php
Initializes the iterator with the source data.
DisqusComment::rollback in src/Plugin/migrate/destination/DisqusComment.php
Delete the specified destination object from the target Drupal.
disqus_entity_delete in ./disqus.module
Implements hook_entity_delete().
disqus_entity_update in ./disqus.module
Implements hook_entity_update().

File

./disqus.module, line 259
The Disqus Drupal module.

Code

function disqus_api() {
  try {
    $disqus = new DisqusAPI(\Drupal::config('disqus.settings')
      ->get('advanced.disqus_secretkey'));
  } catch (Exception $exception) {
    \Drupal::messenger()
      ->addError(t('There was an error loading the Disqus PHP API. Please check your API keys and try again.'));
    \Drupal::logger('disqus')
      ->error('Error loading the Disqus PHP API. Check your API keys.', []);
    return FALSE;
  }
  return $disqus;
}