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

Breadcrumb

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

function DrupalFinder::getValidEnvironmentVariablePath

Get path stored in environment variable.

Parameters

string $variable: The name of the environment variable to retrieve the path from.

Return value

false|string A path if it is valid. False otherwise.

3 calls to DrupalFinder::getValidEnvironmentVariablePath()
DrupalFinder::getComposerRoot in vendor/webflo/drupal-finder/src/DrupalFinder.php
Get the Composer root.
DrupalFinder::getDrupalRoot in vendor/webflo/drupal-finder/src/DrupalFinder.php
Get the Drupal root.
DrupalFinder::getVendorDir in vendor/webflo/drupal-finder/src/DrupalFinder.php
Get the vendor path.

File

vendor/webflo/drupal-finder/src/DrupalFinder.php, line 280

Class

DrupalFinder

Namespace

DrupalFinder

Code

protected function getValidEnvironmentVariablePath($variable) {
    $path = getenv($variable);
    if (is_string($path) && is_dir($path)) {
        return $path;
    }
    return false;
}

API Navigation

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