return the base directory for extensions

@param eZINI|null $siteINI Optional parameter to be able to only do change on specific instance of site.ini
@return string
437668
static function baseDirectory( eZINI $siteINI = null )
    {
        if ( $siteINI === null )
            $siteINI = eZINI::instance();
        $extensionDirectory = $siteINI->variable( 'ExtensionSettings', 'ExtensionDirectory' );
        return $extensionDirectory;
    }
408575
public static function get_plugin_directory($plugintype, $pluginname) {
        if (empty($pluginname)) {
            // Invalid plugin name, sorry.
            return null;
        }

        self::init();

        if (!isset(self::$plugins[$plugintype][$pluginname])) {
            return null;
        }
        return self::$plugins[$plugintype][$pluginname];
    }
1341176
protected function getExtension(Location $location): ExtensionInterface
    {
        foreach ($this->extensions as $extension) {
            if ($extension->matches($location)) {
                return $extension;
            }
        }

        return $this->fallbackExtension;
    }
529782
def plugins_path
      if site.config["plugins_dir"].eql? Bunto::Configuration::DEFAULTS["plugins_dir"]
        [site.in_source_dir(site.config["plugins_dir"])]
      else
        Array(site.config["plugins_dir"]).map { |d| File.expand_path(d) }
      end
    end
106557
protected function moduleDir($ext=null) {
        if (!isset($this->base_dir)) { $this->base_dir = realpath(__DIR__.'/../..'); }
        return $this->base_dir.($ext === null ? '' : '/'.$ext);
    }
1271690
public function extend($basedir = null, $overwrite = false)
    {
        if (null === $basedir) {
            $basedir = $this->basedir;
        }

        $basedir = File::realpath($basedir);

        if (false === $this->loadFromCache($basedir)) {
            $this->loadFromBaseDir($basedir, $overwrite);
            $this->saveToCache($basedir);
        }

        if (
            !empty($this->environment)
            && false === strpos($this->environment, $basedir)
            && is_dir($basedir.DIRECTORY_SEPARATOR.$this->environment)
        ) {
            $this->extend($basedir.DIRECTORY_SEPARATOR.$this->environment, $overwrite);
        }

        return $this;
    }
220329
private function getRootFolderName(SiteConfig $siteConfig)
    {
        return ($this->owner->has_extension('RootFolder')) ? $this->owner->getRootFolderName() : $siteConfig->getRootFolderName();
    }
938247
public function adminAction($siteId = null)
    {
        $contextManager = $this->get('open_orchestra_backoffice.context_backoffice_manager');

        if ($siteId) {
            $site = $this->get('open_orchestra_model.repository.site')->findOneBySiteId($siteId);
            $contextManager->setSite($site->getSiteId(), $site->getName(), $site->getDefaultLanguage(), $site->getLanguages());
        }
        $clientConfiguration = $this->get('open_orchestra_backoffice.manager.client_configuration');

        return $this->render('OpenOrchestraBackofficeBundle::layout.html.twig' , array(
            'clientConfiguration' => $clientConfiguration->getClientConfiguration()
        ));
    }
57790
public function create($uri = null, $baseuri = null)
    {
        if (empty($uri) && empty($baseuri)) {
            // Empty uri means baseurl
            return $this->baseUrl
                . (($this->urlType == self::URL_APPEND)
                    ? "/$this->scriptName"
                    : null);
        } elseif (empty($uri)) {
            // Empty uri means baseurl with appended $baseuri
            ;
        } elseif (substr($uri, 0, 7) == "http://"
            || substr($uri, 0, 8) == "https://"
            || substr($uri, 0, 2) == "//"
        ) {
            // Fully qualified, just leave as is.
            return $uri;
        } elseif ($uri[0] == "/") {
            // Absolute url, prepend with siteUrl
            //return rtrim($this->siteUrl . rtrim($uri, '/'), '/');
            return $this->siteUrl . $uri;
        } elseif ($uri[0] == "#"
            || $uri[0] == "?"
        ) {
            // Hashtag url to local page, or query part leave as is.
            return $uri;
        } elseif (substr($uri, 0, 7) == "mailto:"
            || substr(html_entity_decode($uri), 0, 7) == "mailto:") {
            // Leave mailto links as is
            // The odd fix is for markdown converting mailto: to UTF-8
            // Might be a better way to solve this...
            return $uri;
        }

        // Prepend uri with baseuri
        $uri = rtrim($uri, "/");
        if (!empty($baseuri)) {
            $uri = rtrim($baseuri, "/") . "/$uri";
        }

        // Remove the trailing index part of the url
        if (basename($uri) == "index") {
            $uri = dirname($uri);
        }

        if ($this->urlType == self::URL_CLEAN) {
            return rtrim($this->baseUrl . "/" . $uri, "/");
        } else {
            return rtrim($this->baseUrl . "/" . $this->scriptName . "/" . $uri, "/");
        }
    }
1091098
public function getNodeFromContextPath($contextPath, Site $site = null, Domain $domain = null, $includeAll = false)
    {
        $nodePathAndContext = NodePaths::explodeContextPath($contextPath);
        $nodePath = $nodePathAndContext['nodePath'];
        $workspaceName = $nodePathAndContext['workspaceName'];
        $dimensions = $nodePathAndContext['dimensions'];

        $contextProperties = $this->prepareContextProperties($workspaceName, $dimensions);

        if ($site === null) {
            list(, , $siteNodeName) = explode('/', $nodePath);
            $site = $this->siteRepository->findOneByNodeName($siteNodeName);
        }

        if ($domain === null) {
            $domain = $this->domainRepository->findOneBySite($site);
        }

        $contextProperties['currentSite'] = $site;
        $contextProperties['currentDomain'] = $domain;
        if ($includeAll === true) {
            $contextProperties['invisibleContentShown'] = true;
            $contextProperties['removedContentShown'] = true;
        }

        $context = $this->contextFactory->create(
            $contextProperties
        );

        $workspace = $context->getWorkspace(false);
        if (!$workspace) {
            return new Error(
                sprintf('Could not convert the given source to Node object because the workspace "%s" as specified in the context node path does not exist.', $workspaceName), 1451392329);
        }

        return $context->getNode($nodePath);
    }
699674
@VisibleForTesting
    URI getBaseDir() {
        URI baseDir = job.getInputDir();

        final Collection<FileInfo> fis = job.getFileInfo();
        for (final FileInfo fi : fis) {
            final URI res = fi.result.resolve(".");
            baseDir = Optional.ofNullable(getCommonBase(baseDir, res)).orElse(baseDir);
        }

        return baseDir;
    }
1106816
public static function base($uri = '', $relativeTo = '')
    {
        $app = App::getInstance();

        $scheme = parse_url($uri, PHP_URL_SCHEME);
        if (isset($scheme)) {
            return $uri;
        }

        // We use server script name instead from slim env script name
        // because slim env script name truncate the index.php file from the
        // result
        $dir = $_SERVER['SCRIPT_NAME'];
        if (substr($dir, -4) === '.php') {
            $dir = dirname($dir);
        }

        if ($dir === '/') {
            $dir = '';
        }

        if ($relativeTo === false) {
            $relativeTo = $dir;
        } elseif (!$relativeTo) {
            $relativeTo = $app->environment['slim.url_scheme'].'://'.$app->environment['HTTP_HOST'].$dir;
        }

        return $relativeTo.'/'.trim($uri, '/');
    }
292166
public function getBaseSnippetPath($type = null)
    {
        $path = '/' . $this->getPath('base') . '/' . $this->getPath('snippet');

        if ($type) {
            $path .= '/' . $type;
        }

        return $path;
    }
1193625
static public function getPathPrefix()
    {
        $ini = eZINI::instance();

        return $ini->hasVariable( 'SiteAccessSettings', 'PathPrefix' ) &&
            $ini->variable( 'SiteAccessSettings', 'PathPrefix' ) != ''
            ? eZURLAliasML::cleanURL( $ini->variable( 'SiteAccessSettings', 'PathPrefix' ) )
            : false;
    }
847730
public function getDirectory(): UrlPathInterface
    {
        return new self($this->myIsAbsolute, $this->myAboveBaseLevel, $this->myDirectoryParts, null);
    }
489602
public function getSiteInstance()
    {
        return $this->site == null ? $this->site = new SiteImpl($this) : $this->site;
    }
362359
public function getBaseUri()
    {
        $script = $this->get('script');
        $base   = str_replace('\\', '/', dirname($script));

        if ($base != '/') {
            $url = strtolower($this->get('scheme')) . $this->get('name') . $base;
        } else {
            $url = strtolower($this->get('scheme')) . $this->get('name');
        }

        return $url;
    }