我喜欢从php脚本运行抓取。我碰巧做了git克隆而不是wget,但同样的原则仍然适用。尝试以下操作:
git clone "https://bitBucketUsername:[email protected]/organization/theme/get/master.git"
实际上,您需要转义您的用户名和密码,就像这样。
$bitBucketUsername = "[email protected]";
$bitBucketPassword = \'ILikeTurtles\';
$bitBucketCredentials = urlencode($bitBucketUsername).\':\'.urlencode($bitBucketPassword).\'@\';
$cmd = "git clone \\"https://{$bitBucketCredentials}bitbucket.org/organization/theme/get/master.git\\"";
exec($cmd, $output, $return);
if ($return != 0) {
if (is_array($output)) {
$output = var_export($output, true);
}
print "Yikes, got ($return). output: $output";
} else {
// seems to have worked
// maybe activate the plugin?
}
要在使用git时获得更安全的解决方案,请搜索“助手凭据”