Returns extension root.

@return string|bool
Extension root directory or false if it was not found.
338869
public static function getExtensionRoot($directory) {
    $extension_root = FALSE;
    for ($i = 1; $i <= 5; $i++) {
      $info_file = $directory . '/' . basename($directory) . '.info';
      if ((file_exists($info_file) && basename($directory) !== 'drush') || file_exists($info_file . '.yml')) {
        $extension_root = $directory;
        break;
      }
      $directory = dirname($directory);
    }
    return $extension_root;
  }
1012709
public function getRootDir()
    {
        if (!is_null($this->rootDirPrefix)) {
            return $this->rootDirPrefix;
        }

        $bundles = array_map(function ($bundle) {
            return is_object($bundle)
                ? get_class($bundle)
                : $bundle;
        }, $this->bundlesToLoad);
        $config = $this->configuration;
        $routes = $this->routes;
        sort($bundles);
        sort($routes);
        $this->sortArray($config);

        return sys_get_temp_dir().'/base-kernel/'.'kernel-'.(
            hash(
                'md5',
                json_encode([
                    $bundles,
                    $config,
                    $routes,
                ])
            )
        );
    }
389318
public function get_extension()
	{
		if ($this->link !== null)
		{
			$url = SimplePie_Misc::parse_url($this->link);
			if ($url['path'] !== '')
			{
				return pathinfo($url['path'], PATHINFO_EXTENSION);
			}
		}
		return null;
	}
317599
public function getPath()
    {
        $path = !empty($this->info['path']) ? '/'.implode('/', $this->info['path']).'/' : '/';

        if (!empty($this->info['file'])) {
            $path .= $this->info['file'];

            if (!empty($this->info['extension'])) {
                $path .= '.'.$this->info['extension'];
            }
        }

        return $path;
    }
751107
public function url()
    {
        $dirname = $this->parent->url();

        if ($this->parent instanceof Root) { //at root

            return $dirname.$this->basename();
        }

        return sprintf('%s/%s', $dirname, $this->basename());

    }
1205781
public function getRootDirectory()
    {
        $dir = $this->getWorktreeDirectory();
        $relativeRoot = trim(str_replace(DIRECTORY_SEPARATOR, '/', $this->gitRepository->getDirectoryToParse()), '/');
        if ($relativeRoot !== '') {
            $dir .= '/' . $relativeRoot;
        }

        return $dir;
    }
1300502
public static function getRootUrl()
    {
        if (empty(self::$root) && defined('ROOT_URL')) {
            self::$root = ROOT_URL;
            if (!preg_match("/\/$/", self::$root)) {
                self::$root .= '/';
            }
        }

        return self::$root;
    }
361729
public function getExtensions()
  {
    $ext = array();

    foreach ($this->Config->get('file-extensions') as $key => $value)
    {
      $ext = array_merge($ext, $value['extensions']);
    }

    return $ext;
  }
717241
private function determineExtension()
    {
        $ext = 'php';
        if (in_array($this->driverClass, $this->extensionToDriver)) {
            $map = array_flip($this->extensionToDriver);
            $ext = $map[$this->driverClass];
        }
        return $ext;
    }
835275
public function getExtension()
  {
    $f = $this->getValue();

    if ($f) {
      return $f instanceof UploadedFile ? $f->getClientOriginalExtension() : $f->getExtension();
    }

    return false;
  }
922007
public function rootUrl()
    {
        $base = $this->root();
        $root = strpos($base, '.') ? ltrim(dirname($base), DIRECTORY_SEPARATOR) : $base;
        if ('' != $root) {
            $root = '/' . ltrim($root, '/');
        }
        return $root;
    }
1109981
public function ext()
    {
        if (!$this->info) {
            $this->info();
        }
        if (isset($this->info['extension'])) {
            return $this->info['extension'];
        }

        return false;
    }
910682
public function getRoot()
    {
        $path = $this->owner->getPath();
        $path = array_shift($path);
        $query = $this->owner->find();
        /** @var \yii\db\ActiveQuery $query */
        $query
            ->andWhere([$this->keyColumn => $path])
            ->limit(1);
        $query->multiple = false;
        return $query;
    }
1126902
public static function GetExtensionName()
    {
        self::CheckBackend();

        $name = self::$backend->Get("name");

        if(strlen($name) <= 0)
        {
            $dir_parts = explode(
                "/",
                str_replace("\\", "/", self::$backend->directory)
            );

            $name = $dir_parts[count($dir_parts) - 1];
        }

        return $name;
    }
648218
public function getFilenameWithExtension() {
		if ($this->extension === null) {
			return $this->filename;
		}
		else {
			return $this->filename . '.' . $this->extension;
		}
	}
1208408
public function resolveExtension()
    {
        if (($pos = strrpos($this->path, '.')) !== false) {
            return substr($this->path, $pos + 1);
        }

        return '';
    }
877197
public function getExt()
    {
        if (is_null($this->ext) && $this->originFile) {
            $file = basename($this->originFile);
            // Use substr instead of pathinfo, because pathinfo may return error value in unicode
            if (false !== $pos = strrpos($file, '.')) {
                $this->ext = strtolower(substr($file, $pos + 1));
            } else {
                $this->ext = '';
            }
        }
        return $this->ext;
    }