Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Updater.php

function Updater::getProjectTitle

Returns the project name from a Drupal info file.

Parameters

string $directory: Directory to search for the info file.

Return value

string The title of the project.

Throws

\Drupal\Core\Updater\UpdaterException

1 call to Updater::getProjectTitle()
Updater::__construct in core/lib/Drupal/Core/Updater/Updater.php
Constructs a new updater.

File

core/lib/Drupal/Core/Updater/Updater.php, line 188

Class

Updater
Defines the base class for Updaters used in Drupal.

Namespace

Drupal\Core\Updater

Code

public static function getProjectTitle($directory) {
    $info_file = self::findInfoFile($directory);
    $info = \Drupal::service('info_parser')->parse($info_file);
    if (empty($info)) {
        throw new UpdaterException("Unable to parse info file: '{$info_file}'.");
    }
    return $info['name'];
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal