本文整理汇总了PHP中PhabricatorRepository::execxRemoteCommand方法的典型用法代码示例。如果您正苦于以下问题:PHP PhabricatorRepository::execxRemoteCommand方法的具体用法?PHP PhabricatorRepository::execxRemoteCommand怎么用?PHP PhabricatorRepository::execxRemoteCommand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhabricatorRepository
的用法示例。
在下文中一共展示了PhabricatorRepository::execxRemoteCommand方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: verifySubversionRoot
private function verifySubversionRoot(PhabricatorRepository $repository)
{
list($xml) = $repository->execxRemoteCommand('info --xml %s', $repository->getSubversionPathURI());
$xml = phutil_utf8ize($xml);
$xml = new SimpleXMLElement($xml);
$remote_root = (string) $xml->entry[0]->repository[0]->root[0];
$expect_root = $repository->getSubversionPathURI();
$normal_type_svn = PhabricatorRepositoryURINormalizer::TYPE_SVN;
$remote_normal = id(new PhabricatorRepositoryURINormalizer($normal_type_svn, $remote_root))->getNormalizedPath();
$expect_normal = id(new PhabricatorRepositoryURINormalizer($normal_type_svn, $expect_root))->getNormalizedPath();
if ($remote_normal != $expect_normal) {
throw new Exception(pht('Repository "%s" does not have a correctly configured remote URI. ' . 'The remote URI for a Subversion repository MUST point at the ' . 'repository root. The root for this repository is "%s", but the ' . 'configured URI is "%s". To resolve this error, set the remote URI ' . 'to point at the repository root. If you want to import only part ' . 'of a Subversion repository, use the "Import Only" option.', $repository->getDisplayName(), $remote_root, $expect_root));
}
}
示例2: executeCreate
protected function executeCreate(PhabricatorRepository $repository, $local_path)
{
$repository->execxRemoteCommand('clone --origin origin %s %s', $repository->getRemoteURI(), rtrim($local_path, '/'));
}
示例3: executeHgCreate
/**
* @task hg
*/
private function executeHgCreate(PhabricatorRepository $repository, $path)
{
$repository->execxRemoteCommand('clone %s %s', $repository->getRemoteURI(), rtrim($path, '/'));
}
示例4: getSVNLogXMLObject
private function getSVNLogXMLObject(PhabricatorRepository $repository, $uri, $revision)
{
list($xml) = $repository->execxRemoteCommand('log --xml --verbose --limit 1 %s@%d', $uri, $revision);
// Subversion may send us back commit messages which won't parse because
// they have non UTF-8 garbage in them. Slam them into valid UTF-8.
$xml = phutil_utf8ize($xml);
return new SimpleXMLElement($xml);
}
示例5: lookupRecursiveFileList
private function lookupRecursiveFileList(PhabricatorRepository $repository, array $info)
{
$path = $info['rawPath'];
$rev = $info['rawCommit'];
$path = $this->encodeSVNPath($path);
$hashkey = md5($repository->getDetail('remote-uri') . $path . '@' . $rev);
// This method is quite horrible. The underlying challenge is that some
// commits in the Facebook repository are enormous, taking multiple hours
// to 'ls -R' out of the repository and producing XML files >1GB in size.
// If we try to SimpleXML them, the object exhausts available memory on a
// 64G machine. Instead, cache the XML output and then parse it line by line
// to limit space requirements.
$cache_loc = sys_get_temp_dir() . '/diffusion.' . $hashkey . '.svnls';
if (!Filesystem::pathExists($cache_loc)) {
$tmp = new TempFile();
$repository->execxRemoteCommand('--xml ls -R %s%s@%d > %s', $repository->getDetail('remote-uri'), $path, $rev, $tmp);
execx('mv %s %s', $tmp, $cache_loc);
}
$map = $this->parseRecursiveListFileData($cache_loc);
Filesystem::remove($cache_loc);
return $map;
}