/** * @param Application $application * @return string */ public function getWorkspacePath(Application $application) { $workspacePath = FLOW_PATH_DATA . 'Surf/'; if ($application->hasOption('repositoryUrl')) { $urlParts = GeneralUtility::getUrlPartsFromRepositoryUrl($application->getOption('repositoryUrl')); $workspacePath .= preg_replace('/[^a-zA-Z0-9]/', '-', $urlParts['path']); $workspacePath .= '_' . substr(sha1($application->getOption('repositoryUrl')), 0, 5); } else { // Default $workspacePath .= $this->getName() . '/' . $application->getName(); } return $workspacePath; }