// Retrieve the public name of a GitHub repository $publicName = getPublicName('https://github.com/user/repo.git'); echo $publicName; // Output: repo // Retrieve the public name of a GitLab project $publicName = getPublicName('git@gitlab.com:user/group/project.git'); echo $publicName; // Output: project
// Retrieve the public name of a Subversion repository $publicName = getPublicName('svn://example.com/repo/trunk'); echo $publicName; // Output: repoPackage library: This library could potentially be part of a larger package or library focused on version control system utilities, or it could be a standalone package with a specific use case.