Module::getResourcesDir

@param string|null $subDir

@return bool|string
332666
public function getResourcesDir($subDir = null)
    {
        $dirResources = PATH_RESOURCES;

        $dirPath = str_replace(PATH_APP, '', $this->getRealPath());
        $dirPathParts = explode(DIRECTORY_SEPARATOR, $dirPath);

        if(count($dirPathParts)) {
            $dirPathParts = array_map('dash', $dirPathParts);
            $dirResources.= implode(DIRECTORY_SEPARATOR, $dirPathParts);
        }

        if (is_null($subDir)) {
            return $dirResources;
        } elseif (is_dir($dirResources . $subDir . DIRECTORY_SEPARATOR)) {
            return $dirResources . $subDir . DIRECTORY_SEPARATOR;
        }

        return false;
    }
1158468
public function getSubDirectory()
    {
        $subDirectory = '';
        if ($this->getGenerator()->getOptionCategory() === GeneratorOptions::VALUE_CAT) {
            $subDirectory = $this->getContextualPart();
        }
        return $subDirectory;
    }
92871
protected function _subdirs($path) {
		return ($stat = $this->stat($path)) && isset($stat['dirs']) ? $stat['dirs'] : false;
	}
1035318
public function getPath($sub = null)
    {
        if (is_array($sub)) {
            $sub = implode(DIRECTORY_SEPARATOR, $sub);
        }

        $path = $this->path;
        if (!is_null($sub)) {
            $path .= DIRECTORY_SEPARATOR.$sub;
        }

        return $path;
    }
174509
public function setFilePath($subdir)
    {
        $path = $this->getFilePath($subdir, '', true);
        if(is_dir($path))
            return $path;
        elseif(mkdir($path, 0777)) {
            foreach($this->owner->sizes as $size) {
                if($size['catalog']) {
                    if(mkdir($path . $size['catalog'], 0777))
                        continue;
                    else
                        return false;
                } else
                    continue;
            }
            return $path;
        } else
            return false;
    }
938536
public static function calc_directory_for_subsite($subsite)
    {
        //$subsite = Subsite::currentSubsite();
        if ($subsite) {
            $title = $subsite->Title;
            $url = strtolower(singleton('SiteTree')->generateURLSegment($title));

            return $url;
        } else {
            return false;
        }
    }
37681
public function getParentDirectory(): ?FilePathInterface
    {
        if ($this->myParentDirectory($aboveBaseLevel, $directoryParts)) {
            return new self($this->myIsAbsolute, $aboveBaseLevel, $this->myDrive, $directoryParts, null);
        }

        return null;
    }
1020486
def _get_subdirectory(cls, location):
        """"""
        # find the repo root
        git_dir = cls.run_command(['rev-parse', '--git-dir'],
                                  show_stdout=False, cwd=location).strip()
        if not os.path.isabs(git_dir):
            git_dir = os.path.join(location, git_dir)
        root_dir = os.path.join(git_dir, '..')
        # find setup.py
        orig_location = location
        while not os.path.exists(os.path.join(location, 'setup.py')):
            last_location = location
            location = os.path.dirname(location)
            if location == last_location:
                # We've traversed up to the root of the filesystem without
                # finding setup.py
                logger.warning(
                    "Could not find setup.py for directory %s (tried all "
                    "parent directories)",
                    orig_location,
                )
                return None
        # relative path of setup.py to repo root
        if samefile(root_dir, location):
            return None
        return os.path.relpath(location, root_dir)
52289
protected function getSubdomain( $subdomainId = null )
    {
        static $subdomains = array();
        $siteInfo = $this->getSiteInfo();

        if ( empty( $subdomainId ) || $siteInfo->getSubdomainId() == $subdomainId )
        {
            return $siteInfo->getSubdomain();
        }

        if ( ! isset( $subdomains[$subdomainId] ) )
        {
            /* @var $model \Grid\Core\Model\Uri\Model */
            $service    = $this->getServiceLocator();
            $model      = $service->get( 'Grid\Core\Model\SubDomain\Model' );
            $subdomain  = $model->find( $subdomainId );

            if ( empty( $subdomain ) )
            {
                $subdomains[$subdomainId] = '';
            }
            else
            {
                $subdomains[$subdomainId] = $subdomain->subdomain;
            }
        }

        return $subdomains[$subdomainId];
    }
575147
private function getDirectories($dir, $directoryName = null)
    {
        $finder = new Finder();
        $finder->directories()->in($dir);

        if (null !== $directoryName) {
            $finder->name($directoryName);
        }

        if (iterator_count($finder) > 0) {
            return iterator_to_array($finder);
        }

        return false;
    }
530013
public function dirs($resource, $recursive = false, $filter = null)
    {
        return $this->ls($resource, self::LS_MODE_DIR, $recursive, $filter);
    }
17999
static public function getFolders( $dir, $recursive = false )
    {
        $subDirs = [];
        if ( ( $dh = opendir( $dir ) ) ) {
            while ( ( $file = readdir( $dh ) ) !== false ) {
                if ( $file !== '.' && $file !== '..' && is_dir( $dir . '/' . $file ) ) {
                    $subDirs[] = $file;
                    if ( $recursive ) {
                        $subDirs = array_merge( $subDirs, self::getFolders( $dir . DS . $file, true ) );
                    }
                }
            }
            closedir( $dh );
        }
        return $subDirs;
    }
667278
public function directories($directory = null, $recursive = false)
    {

        $directories = [ ];

        foreach (Finder::create()->in($directory)->directories() as $dir) {
            $directories[] = $dir->getPathname();
        }

        return $directories;
    }
1320606
protected function getCacheFileURL($subdir, $safe_filename)
    {
        $path = $this->getCachePathFromWebRoot($subdir);

        return URL::getInstance()->absoluteUrl(sprintf("%s/%s", $path, $safe_filename), null, URL::PATH_TO_FILE, $this->cdnBaseUrl);
    }
312822
public static function get_subsystem_directory($subsystem) {
        self::init();

        if (!isset(self::$subsystems[$subsystem])) {
            return null;
        }
        return self::$subsystems[$subsystem];
    }
704423
public function getDirectories(Array $ignores = NULL, $subdirs = TRUE) {
    /* wir starten eine Breitensuche (BFS) auf dem Verzeichnis */
    
    $dirs = array(); // Verzeichnisse die schon besucht wurden
    $queue = array($this);

    while (count($queue) > 0) {
      $elem = array_pop($queue);

      /* dies machen wir deshalb, da wenn extension gesetzt ist, keine verzeichnisse gesetzt werden */
      foreach($elem->getContents(NULL,$ignores) as $item) {
        if ($item instanceof Dir && !array_key_exists((string) $item, $dirs)) { // ist das verzeichnis schon besucht worden?

          if ($subdirs) // wenn nicht wird hier nichts der queue hinzugefügt und wir bearbeiten kein unterverzeichnis
            array_unshift($queue,$item);

          /* besucht markieren */
          $dirs[(string) $item] = $item;
        }
      }
    }
    
    return $dirs;
  }
763885
protected function getCachePathFromWebRoot($subdir = null)
    {
        $cache_dir_from_web_root = $this->getCacheDirFromWebRoot();

        if ($subdir != null) {
            $safe_subdir = basename($subdir);

            $path = sprintf("%s/%s", $cache_dir_from_web_root, $safe_subdir);
        } else {
            $path = $cache_dir_from_web_root;
        }

        // Check if path is valid, e.g. in the cache dir
        return $path;
    }