groupId; $artifactId = $xml->artifactId; $version = $xml->version; $path = str_replace(".", "/", $groupId) . "/" . $artifactId . "/" . $version; $dest = Config::$dest . "/maven/" . $path; if (!file_exists($dest)) mkdir($dest, 0777, true); if (file_exists($dest . "/" . $base . ".jar")) unlink($dest . "/" . $base . ".jar"); if (file_exists($dest . "/" . $base . ".pom")) unlink($dest . "/" . $base . ".pom"); foreach ([$jar, $pom] as $f) { copy($f, $dest . "/" . basename($f)); file_put_contents($dest . "/" . basename($f) . ".md5", md5_file($f)); file_put_contents($dest . "/" . basename($f) . ".sha1", sha1_file($f)); unlink($f); } } }