You are here

public function SiteVerifyService::siteVerifyGetEngines in Site verification 8

Fetch an array of supported search engines.

1 call to SiteVerifyService::siteVerifyGetEngines()
SiteVerifyService::siteVerifyEngineLoad in src/Service/SiteVerifyService.php
Menu load callback; loads engine details.

File

src/Service/SiteVerifyService.php, line 55

Class

SiteVerifyService
Class SiteVerifyService.

Namespace

Drupal\site_verify\Service

Code

public function siteVerifyGetEngines() {
  static $engines;
  if (!isset($engines)) {

    // Fetch the list of engines and allow other modules to alter it.
    $engines = \Drupal::moduleHandler()
      ->invokeAll('site_verify_engine_info');
    \Drupal::moduleHandler()
      ->alter('site_verify_engine', $engines);

    // Merge the default values for each engine entry.
    foreach ($engines as $key => $engine) {
      $engines[$key] += [
        'key' => $key,
        'name' => Unicode::ucfirst($engine['name']),
        'file' => FALSE,
        'file_example' => FALSE,
        'file_validate' => [],
        'file_contents' => FALSE,
        'file_contents_example' => FALSE,
        'file_contents_validate' => [],
        'meta' => FALSE,
        'meta_example' => FALSE,
        'meta_validate' => [],
      ];
    }
  }
  return $engines;
}