public function createRoleFiles($inputDir, $outputDir, $roleFileDir = null)
    {
        $roleFileDir = $roleFileDir ?  : $inputDir;
        $outputDir = realpath($outputDir);
        $seenDirs = array();
        $longPaths = array();
        $roleFiles = array();

        foreach ($this->getWebRoleNames() as $roleName) {
            $dir = realpath($inputDir);
            $roleFilePath = sprintf('%s/%s.roleFiles.txt', $roleFileDir, $roleName);
            $roleFiles[$roleName] = $roleFilePath;

            if (isset($seenDirs[$dir])) {
                // we have seen this directory already, just copy the known
                // file with a new role file name.
                copy($seenDirs[$dir], $roleFilePath);
                continue;
            }
            $seenDirs[$dir] = $roleFilePath;
            $roleFile = $this->computeRoleFileContents($dir, $roleName, $outputDir, $longPaths);

            file_put_contents($roleFilePath, $roleFile);
        }

        if ($longPaths) {
            throw new \RuntimeException("Paths are too long. Not more than 248 chars per directory and 260 per file name allowed:\n" . implode("\n", $longPaths));
        }
        return $roleFiles;
    }
public function createRoleFiles($inputDir, $outputDir, $roleFileDir = null)
    {
        $roleFileDir = $roleFileDir ?  : $inputDir;
        $outputDir = realpath($outputDir);
        $seenDirs = array();
        $longPaths = array();
        $roleFiles = array();

        foreach ($this->getWebRoleNames() as $roleName) {
            $dir = realpath($inputDir);
            $roleFilePath = sprintf('%s/%s.roleFiles.txt', $roleFileDir, $roleName);
            $roleFiles[$roleName] = $roleFilePath;

            if (isset($seenDirs[$dir])) {
                // we have seen this directory already, just copy the known
                // file with a new role file name.
                copy($seenDirs[$dir], $roleFilePath);
                continue;
            }
            $seenDirs[$dir] = $roleFilePath;
            $roleFile = $this->computeRoleFileContents($dir, $roleName, $outputDir, $longPaths);

            file_put_contents($roleFilePath, $roleFile);
        }

        if ($longPaths) {
            throw new \RuntimeException("Paths are too long. Not more than 248 chars per directory and 260 per file name allowed:\n" . implode("\n", $longPaths));
        }
        return $roleFiles;
    }
public function createRoleFiles ( $ inputDir , $ outputDir , $ roleFileDir = null ) { $ roleFileDir = $ roleFileDir ? : $ inputDir ; $ outputDir = realpath ( $ outputDir ) ; $ seenDirs = array ( ) ; $ longPaths = array ( ) ; $ roleFiles = array ( ) ; foreach ( $ this -> getWebRoleNames ( ) as $ roleName ) { $ dir = realpath ( $ inputDir ) ; $ roleFilePath = sprintf ( '%s/%s.roleFiles.txt' , $ roleFileDir , $ roleName ) ; $ roleFiles [ $ roleName ] = $ roleFilePath ; if ( isset ( $ seenDirs [ $ dir ] ) ) { // we have seen this directory already, just copy the known // file with a new role file name. copy ( $ seenDirs [ $ dir ] , $ roleFilePath ) ; continue ; } $ seenDirs [ $ dir ] = $ roleFilePath ; $ roleFile = $ this -> computeRoleFileContents ( $ dir , $ roleName , $ outputDir , $ longPaths ) ; file_put_contents ( $ roleFilePath , $ roleFile ) ; } if ( $ longPaths ) { throw new \ RuntimeException ( "Paths are too long. Not more than 248 chars per directory and 260 per file name allowed:\n" . implode ( "\n" , $ longPaths ) ) ; } return $ roleFiles ; }
Create the role files for this service definition.

A role file is a semicolon seperated list of target and destination
paths. Only these files are then copied during the cspack.exe process to
the target deployment directory or package file.

@param string $inputDir
@param string $outputDir
@param string $roleFileDir
@return array
Create the role files for this service definition .