src/Rocketeer/Services/Environment/Modules/ServerPathfinder.php
public function getFolder(...$folder)
    {
        $folder = implode('/', $folder);
        $folder = $this->modulable->replacePatterns($folder);

        $base = $this->connections->is('local') ? getcwd() : $this->getHomeFolder();
        $base = $base.'/';
        $stage = $this->connections->getCurrentConnectionKey()->stage;
        if ($folder && $stage) {
            $base .= $stage.'/';
        }

        // Replace base and cap it
        $folder = preg_replace('#^'.$base.'#', null, $folder);
        $folder = $base.$folder;

        return $folder;
    }
public function getFolder(...$folder)
    {
        $folder = implode('/', $folder);
        $folder = $this->modulable->replacePatterns($folder);

        $base = $this->connections->is('local') ? getcwd() : $this->getHomeFolder();
        $base = $base.'/';
        $stage = $this->connections->getCurrentConnectionKey()->stage;
        if ($folder && $stage) {
            $base .= $stage.'/';
        }

        // Replace base and cap it
        $folder = preg_replace('#^'.$base.'#', null, $folder);
        $folder = $base.$folder;

        return $folder;
    }
public function getFolder ( ... $ folder ) { $ folder = implode ( '/' , $ folder ) ; $ folder = $ this -> modulable -> replacePatterns ( $ folder ) ; $ base = $ this -> connections -> is ( 'local' ) ? getcwd ( ) : $ this -> getHomeFolder ( ) ; $ base = $ base . '/' ; $ stage = $ this -> connections -> getCurrentConnectionKey ( ) -> stage ; if ( $ folder && $ stage ) { $ base .= $ stage . '/' ; } // Replace base and cap it $ folder = preg_replace ( '#^' . $ base . '#' , null , $ folder ) ; $ folder = $ base . $ folder ; return $ folder ; }
Get the path to a folder, taking into account application name and stage.

@param string|null ...$folder

@return string
Get the path to a folder taking into account application name and stage .