Page MenuHomePhorge
Diviner Tech Docs DiffusionRequest

abstract class DiffusionRequest
Phorge Technical Documentation (Diffusion)

Contains logic to parse Diffusion requests, which have a complicated URI structure.

Tasks

Creating Requests

  • final public static function newFromDictionary($data) — Create a new synthetic request from a parameter dictionary. If you need a @{class:DiffusionRequest} object in order to issue a DiffusionQuery, you can use this method to build one.
  • private function __construct() — Internal.
  • private static function newFromIdentifier($identifier, $viewer, $need_edit) — Internal. Use @{method:newFromDictionary}, not this method.
  • private static function newFromRepository($repository) — Internal. Use @{method:newFromDictionary}, not this method.
  • private function initializeFromDictionary($data) — Internal. Use @{method:newFromDictionary}, not this method.

Managing Diffusion URIs

  • public static function parseRequestBlob($blob, $supports_branches) — Internal. Public only for unit tests.

Other Methods

Methods

public function __get($name)
Inherited

This method is not documented.
Parameters
$name
Return
wild

public function __set($name, $value)
Inherited

This method is not documented.
Parameters
$name
$value
Return
wild

public function current()
Inherited

This method is not documented.
Return
wild

public function key()
Inherited

This method is not documented.
Return
wild

public function next()
Inherited

This method is not documented.
Return
wild

public function rewind()
Inherited

This method is not documented.
Return
wild

public function valid()
Inherited

This method is not documented.
Return
wild

private function throwOnAttemptedIteration()
Inherited

This method is not documented.
Return
wild

public function getPhobjectClassConstant($key, $byte_limit)
Inherited

Phobject

Read the value of a class constant.

This is the same as just typing self::CONSTANTNAME, but throws a more useful message if the constant is not defined and allows the constant to be limited to a maximum length.

Parameters
string$keyName of the constant.
int|null$byte_limitMaximum number of bytes permitted in the value.
Return
stringValue of the constant.

final public function supportsBranches()

This method is not documented.
Return
wild

abstract protected function isStableCommit($symbol)

This method is not documented.
Parameters
$symbol
Return
wild

protected function didInitialize()

This method is not documented.
Return
wild

final public static function newFromDictionary($data)

Create a new synthetic request from a parameter dictionary. If you need a DiffusionRequest object in order to issue a DiffusionQuery, you can use this method to build one.

Parameters are:

  • repository Repository object or identifier.
  • user Viewing user. Required if repository is an identifier.
  • branch Optional, branch name.
  • path Optional, file path.
  • commit Optional, commit identifier.
  • line Optional, line range.
Parameters
map$dataSee documentation.
Return
DiffusionRequestNew request object.

private function __construct()

Internal.

Return
this//Implicit.//

private static function newFromIdentifier($identifier, $viewer, $need_edit)

Internal. Use newFromDictionary(), not this method.

Parameters
string$identifierRepository identifier.
PhabricatorUser$viewerViewing user.
$need_edit
Return
DiffusionRequestNew request object.

private static function newFromRepository($repository)

Internal. Use newFromDictionary(), not this method.

Parameters
PhabricatorRepository$repositoryRepository object.
Return
DiffusionRequestNew request object.

private function initializeFromDictionary($data)

Internal. Use newFromDictionary(), not this method.

Parameters
map$dataMap of parsed data.
Return
void

final public function setUser($user)

This method is not documented.
Parameters
PhabricatorUser$user
Return
wild

final public function getUser()

This method is not documented.
Return
wild

public function getRepository()

This method is not documented.
Return
wild

public function setPath($path)

This method is not documented.
Parameters
$path
Return
wild

public function getPath()

This method is not documented.
Return
wild

public function getLine()

This method is not documented.
Return
wild

public function getCommit()

This method is not documented.
Return
wild

public function getSymbolicCommit()

Get the symbolic commit associated with this request.

A symbolic commit may be a commit hash, an abbreviated commit hash, a branch name, a tag name, or an expression like "HEAD^^^". The symbolic commit may also be absent.

This method always returns the symbol present in the original request, in unmodified form.

See also getStableCommit().

Return
string|nullSymbolic commit, if one was present in the request.

public function updateSymbolicCommit($symbol)

Modify the request to move the symbolic commit elsewhere.

Parameters
string$symbolNew symbolic commit.
Return
this

public function getSymbolicType()

Get the ref type (commit or tag) of the location associated with this request.

If a symbolic commit is present in the request, this method identifies the type of the symbol. Otherwise, it identifies the type of symbol of the location the request is implicitly associated with. This will probably always be commit.

Return
stringSymbolic commit type (`commit` or `tag`).

public function getStableCommit()

Retrieve the stable, permanent commit name identifying the repository location associated with this request.

This returns a non-symbolic identifier for the current commit: in Git and Mercurial, a 40-character SHA1; in SVN, a revision number.

See also getSymbolicCommit().

Return
stringStable commit name, like a git hash or SVN revision. Not a symbolic commit reference.

public function getBranch()

This method is not documented.
Return
wild

public function getLint()

This method is not documented.
Return
wild

protected function getArcanistBranch()

This method is not documented.
Return
wild

public function loadBranch()

This method is not documented.
Return
wild

public function loadCoverage()

This method is not documented.
Return
wild

public function loadCommit()

This method is not documented.
Return
wild

public function loadCommitData()

This method is not documented.
Return
wild

public function generateURI($params)

This method is not documented.
Parameters
array$params
Return
wild

public static function parseRequestBlob($blob, $supports_branches)

Internal. Public only for unit tests.

Parse the request URI into components.

Parameters
string$blobURI blob.
bool$supports_branchesTrue if this VCS supports branches.
Return
mapParsed URI.

protected function validateWorkingCopy($path)

Check that the working copy of the repository is present and readable.

Parameters
string$pathPath to the working copy.
Return
wild

protected function raisePermissionException()

This method is not documented.
Return
wild

protected function raiseCloneException()

This method is not documented.
Return
wild

private function queryStableCommit()

This method is not documented.
Return
wild

public function getRefAlternatives()

This method is not documented.
Return
wild

private function chooseBestRefMatch($ref, $results)

This method is not documented.
Parameters
$ref
array$results
Return
wild

public function resolveRefs($refs, $types)

This method is not documented.
Parameters
array$refs
array$types
Return
wild

public function setIsClusterRequest($is_cluster_request)

This method is not documented.
Parameters
$is_cluster_request
Return
wild

public function getIsClusterRequest()

This method is not documented.
Return
wild