Returns the shared directory

takes directory name from option "sharedDirectory"
if option is not set or empty constant DEFAULT_SHARED_DIR "shared" is used

@return string
@throws InvalidConfigurationException
777629
public function getSharedDirectory()
    {
        $result = self::DEFAULT_SHARED_DIR;
        if ($this->hasOption('sharedDirectory') && !empty($this->getOption('sharedDirectory'))) {
            $sharedPath = $this->getOption('sharedDirectory');
            if (preg_match('/(^|\/)\.\.(\/|$)/', $sharedPath)) {
                throw new InvalidConfigurationException(
                    sprintf(
                        'Relative constructs as "../" are not allowed in option "sharedDirectory". Given option: "%s"',
                        $sharedPath
                    ),
                    1490107183141
                );
            }
            $result = rtrim($sharedPath, '/');
        }
        return $result;
    }
564337
protected function getBaseDir()
    {
        if (!isset($this->config['mp3']['baseDir'])) {
            throw new \Exception(
                $this->translate->translate(
                    'baseDir is not currently set',
                    'mp3'
                )
            );
        }

        return $this->config['mp3']['baseDir'];
    }
1216420
public function getAsString()
	{
		$permissions	= @fileperms( $this->pathName );
		if( FALSE === $permissions )
			throw new InvalidArgumentException( 'Could not get permissions of file "'.$this->pathName.'"' );
		return self::getStringFromOctal( $permissions );
	}
1076996
private function getUserDirectory()
    {
        $userDirectory = null;
        if (isset($_SERVER['HOME'])) {
            $userDirectory = $_SERVER['HOME'];
        } elseif (isset($_SERVER['USERPROFILE'])) {
            $userDirectory = $_SERVER['USERPROFILE'];
        }
        $userDirectory = realpath($userDirectory.'/../');
        $userDirectory .= '/'.$this->authenticationUsername;

        return $userDirectory;
    }
758686
private function defaultConfiguration() : string
    {
        $supportedFiles = [
            'larastan.neon',
            'phpstan.neon',
            'phpstan.neon.dist',
        ];

        foreach ($supportedFiles as $file) {
            $filePath = base_path($file);

            if (file_exists($filePath)) {
                return $filePath;
            }
        }

        return __DIR__.'/../../extension.neon';
    }
116611
protected function getBaseDirectory()
    {
        if (! $this->fileSystem) {
            $this->fileSystem = $this->getServiceLocator()
                ->get(FileSystemService::SERVICE_ID)
                ->getDirectory($this->getFileSystemId());
        }

        return $this->fileSystem;
    }
334449
protected function getRepositoryDirectory()
    {
        if($config = $this->configFileMissing()) {
            return $this->error($config);
        }

        return 'app/' . rtrim($this->getConfigRepositoryDirectory(), '/\\') . '/';
    }
873373
public function getRootDirectory()
    {
        $config = $this->composer->getConfig();
        
        return str_replace($config->get('vendor-dir', Config::RELATIVE_PATHS), '', $config->get('vendor-dir'));
    }
535887
public function getDirectory()
    {
        if ($this->directory instanceof \Closure) {
            return call_user_func($this->directory, $this->form);
        }

        return $this->directory ?: $this->defaultDirectory();
    }
926250
private function _getRoots()
    {
        $directories = [];

        if (is_string($this->module->root)) {
            $root = Yii::getAlias($this->module->root);
            if ($this->module->scanRootParentDirectory) {
                $root = dirname($root);
            }

            $directories[] = $root;
        } elseif (is_array($this->module->root)) {
            foreach ($this->module->root as $root) {
                $directories[] = Yii::getAlias($root);
            }
        } else {
            throw new InvalidConfigException('Invalid `root` option value!');
        }

        return $directories;
    }
630688
public static function getDirPath()
    {
        $dir = Composer::getComposerVendorDir().'/config';
        self::$dirPath = self::$dirPath === null ? $dir : self::$dirPath;
        self::$dirPath = str_replace('\\', '/', self::$dirPath);
        return self::$dirPath;
    }
540324
static function compilationDirectory()
    {
        if ( isset( $GLOBALS['eZTemplateCompilerSettings']['compilation-directory'] ) and
             $GLOBALS['eZTemplateCompilerSettings']['compilation-directory'] !== null )
        {
            return $GLOBALS['eZTemplateCompilerSettings']['compilation-directory'];
        }

        $compilationDirectory =& $GLOBALS['eZTemplateCompilerDirectory'];
        if ( !isset( $compilationDirectory ) )
        {
            $ini = eZINI::instance();
            $shareTemplates = $ini->hasVariable( 'TemplateSettings', 'ShareCompiledTemplates' ) ?
                                $ini->variable( 'TemplateSettings', 'ShareCompiledTemplates' ) == 'enabled' :
                                false;
            if ( $shareTemplates &&
                 $ini->hasVariable( 'TemplateSettings', 'SharedCompiledTemplatesDir' ) &&
                 trim( $ini->variable( 'TemplateSettings', 'SharedCompiledTemplatesDir' ) ) != '' )
            {
                $compilationDirectory = eZDir::path( array( $ini->variable( 'TemplateSettings', 'SharedCompiledTemplatesDir' ) ) );
            }
            else
            {
                $compilationDirectory = eZDir::path( array( eZSys::cacheDirectory(), 'template/compiled' ) );
            }
        }
        return $compilationDirectory;
    }
40408
public function getDirectory()
    {
        $dir = new Directory($this->getDirname());

        $namespaces = explode('\\', $this->getNameSpace());
        array_pop($namespaces);
        $dir->setNamespace(join('\\', $namespaces));

        return $dir;
    }
1094082
private function getIterator()
    {
        if (null === $this->getPath()) {
            throw new \RuntimeException('Commands config path not set');
        }
        if (null === $this->it) {
            $this->it =  new \DirectoryIterator($this->getPath());
        }
        return $this->it;
    }
789859
public static function getRootFolder()
    {
        $filesystem = new Filesystem();
        $folder     = $filesystem->normalizePath(__DIR__ . '/../');

        if (! is_dir($folder)) {
            throw new RuntimeException(
                sprintf(
                    'Could not find a matching folder for folder name "%1$s".',
                    $folder
                )
            );
        }

        return $folder;
    }
315400
public function getDirectoryList($path = null, $showHidden = true)
    {
        $uri = 'directory.list';
        $uriData = [];

        if ($path) {
            $uriData['path'] = $path;
        }
        if ($showHidden) {
            $uriData['show_hidden'] = true;
        }

        try {
            $response = $this->_request(
                [
                    'uri' => $uri,
                    'type' => 'get',
                    'data' => $uriData
                ]
            );
        } catch (\Exception $e) {
            throw new InvalidException($e->getMessage());
        }

        return $response->getBody()->getContents();
    }
815253
public function getDefaultPath()
    {
        if (false === file_exists(self::FILE_NAME)) {
            if (false === file_exists(self::FILE_NAME . '.dist')) {
                throw new RuntimeException(
                    sprintf('The configuration file could not be found.')
                );
            }

            return realpath(self::FILE_NAME . '.dist');
        }

        return realpath(self::FILE_NAME);
    }