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

Breadcrumb

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

function Updater::getProjectName

Gets the name of the project directory (basename).

@todo It would be nice, if projects contained an info file which could provide their canonical name.

Parameters

string $directory: The full directory path.

Return value

string The name of the project.

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

File

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

Class

Updater
Defines the base class for Updaters used in Drupal.

Namespace

Drupal\Core\Updater

Code

public static function getProjectName($directory) {
    return \Drupal::service('file_system')->basename($directory);
}

API Navigation

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