Changeset View
Changeset View
Standalone View
Standalone View
src/workflow/ArcanistBaseWorkflow.php
| Show First 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | abstract class ArcanistBaseWorkflow extends Phobject { | ||||
| private $arcanistConfiguration; | private $arcanistConfiguration; | ||||
| private $parentWorkflow; | private $parentWorkflow; | ||||
| private $workingDirectory; | private $workingDirectory; | ||||
| private $repositoryVersion; | private $repositoryVersion; | ||||
| private $changeCache = array(); | private $changeCache = array(); | ||||
| public function __construct() { | public function __construct() {} | ||||
| } | |||||
| abstract public function run(); | abstract public function run(); | ||||
| /** | /** | ||||
| * Finalizes any cleanup operations that need to occur regardless of | * Finalizes any cleanup operations that need to occur regardless of | ||||
| * whether the command succeeded or failed. | * whether the command succeeded or failed. | ||||
| */ | */ | ||||
| ▲ Show 20 Lines • Show All 225 Lines • ▼ Show 20 Lines | final public function authenticateConduit() { | ||||
| try { | try { | ||||
| if (!$credentials) { | if (!$credentials) { | ||||
| throw new Exception( | throw new Exception( | ||||
| 'Set conduit credentials with setConduitCredentials() before '. | 'Set conduit credentials with setConduitCredentials() before '. | ||||
| 'authenticating conduit!'); | 'authenticating conduit!'); | ||||
| } | } | ||||
| if (empty($credentials['user'])) { | if (empty($credentials['user'])) { | ||||
| throw new ConduitClientException('ERR-INVALID-USER', | throw new ConduitClientException( | ||||
| 'ERR-INVALID-USER', | |||||
| 'Empty user in credentials.'); | 'Empty user in credentials.'); | ||||
| } | } | ||||
| if (empty($credentials['certificate'])) { | if (empty($credentials['certificate'])) { | ||||
| throw new ConduitClientException('ERR-NO-CERTIFICATE', | throw new ConduitClientException( | ||||
| 'ERR-NO-CERTIFICATE', | |||||
| 'Empty certificate in credentials.'); | 'Empty certificate in credentials.'); | ||||
| } | } | ||||
| $description = idx($credentials, 'description', ''); | $description = idx($credentials, 'description', ''); | ||||
| $user = $credentials['user']; | $user = $credentials['user']; | ||||
| $certificate = $credentials['certificate']; | $certificate = $credentials['certificate']; | ||||
| $connection = $this->getConduit()->callMethodSynchronous( | $connection = $this->getConduit()->callMethodSynchronous( | ||||
| 'conduit.connect', | 'conduit.connect', | ||||
| ▲ Show 20 Lines • Show All 1,455 Lines • Show Last 20 Lines | |||||