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

Breadcrumb

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

function DrupalFinder::shiftPathUp

Returns parent directory.

Parameters

string: Path to start from

Return value

string|false Parent path of given path or false when $path is filesystem root

1 call to DrupalFinder::shiftPathUp()
DrupalFinder::discoverRoots in vendor/webflo/drupal-finder/src/DrupalFinder.php
Discover all valid paths.

File

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

Class

DrupalFinder

Namespace

DrupalFinder

Code

private function shiftPathUp($path) {
    $parent = dirname($path);
    return in_array($parent, [
        '.',
        $path,
    ]) ? false : $parent;
}

API Navigation

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