src/Rocketeer/Services/Connections/Shell/Modules/Flow.php
public function share($file)
    {
        $mapping = $this->config->get('remote.directories');

        // Get path to current file and shared file
        $currentFile = $this->releasesManager->getCurrentReleasePath($file);
        $sharedFile = preg_replace('#'.$mapping['releases'].'/[0-9]+/#', $mapping['shared'].'/', $currentFile);

        // If no instance of the shared file exists, use current one
        if (!$this->modulable->fileExists($sharedFile)) {
            $this->modulable->move($currentFile, $sharedFile);
        }

        $this->explainer->line('Sharing file '.$currentFile);

        return $this->modulable->symlink($sharedFile, $currentFile);
    }
public function share($file)
    {
        $mapping = $this->config->get('remote.directories');

        // Get path to current file and shared file
        $currentFile = $this->releasesManager->getCurrentReleasePath($file);
        $sharedFile = preg_replace('#'.$mapping['releases'].'/[0-9]+/#', $mapping['shared'].'/', $currentFile);

        // If no instance of the shared file exists, use current one
        if (!$this->modulable->fileExists($sharedFile)) {
            $this->modulable->move($currentFile, $sharedFile);
        }

        $this->explainer->line('Sharing file '.$currentFile);

        return $this->modulable->symlink($sharedFile, $currentFile);
    }
public function share ( $ file ) { $ mapping = $ this -> config -> get ( 'remote.directories' ) ; // Get path to current file and shared file $ currentFile = $ this -> releasesManager -> getCurrentReleasePath ( $ file ) ; $ sharedFile = preg_replace ( '#' . $ mapping [ 'releases' ] . '/[0-9]+/#' , $ mapping [ 'shared' ] . '/' , $ currentFile ) ; // If no instance of the shared file exists, use current one if ( ! $ this -> modulable -> fileExists ( $ sharedFile ) ) { $ this -> modulable -> move ( $ currentFile , $ sharedFile ) ; } $ this -> explainer -> line ( 'Sharing file ' . $ currentFile ) ; return $ this -> modulable -> symlink ( $ sharedFile , $ currentFile ) ; }
Share a file or folder between releases.

@param string $file Path to the file in a release folder

@return string
Share a file or folder between releases .