Changeset View
Changeset View
Standalone View
Standalone View
src/applications/settings/storage/PhabricatorUserSSHKey.php
<?php | <?php | ||||
final class PhabricatorUserSSHKey extends PhabricatorUserDAO { | final class PhabricatorUserSSHKey extends PhabricatorUserDAO { | ||||
protected $userPHID; | protected $userPHID; | ||||
protected $name; | protected $name; | ||||
protected $keyType; | protected $keyType; | ||||
protected $keyBody; | protected $keyBody; | ||||
protected $keyHash; | protected $keyHash; | ||||
protected $keyComment; | protected $keyComment; | ||||
public function getConfiguration() { | |||||
return array( | |||||
self::CONFIG_COLUMN_SCHEMA => array( | |||||
'name' => 'text255', | |||||
'keyType' => 'text255', | |||||
'keyBody' => 'text', | |||||
'keyHash' => 'bytes32', | |||||
'keyComment' => 'text255?', | |||||
), | |||||
self::CONFIG_KEY_SCHEMA => array( | |||||
'userPHID' => array( | |||||
'columns' => array('userPHID'), | |||||
), | |||||
'keyHash' => array( | |||||
'columns' => array('keyHash'), | |||||
'unique' => true, | |||||
), | |||||
), | |||||
) + parent::getConfiguration(); | |||||
} | |||||
public function getEntireKey() { | public function getEntireKey() { | ||||
$parts = array( | $parts = array( | ||||
$this->getKeyType(), | $this->getKeyType(), | ||||
$this->getKeyBody(), | $this->getKeyBody(), | ||||
$this->getKeyComment(), | $this->getKeyComment(), | ||||
); | ); | ||||
return trim(implode(' ', $parts)); | return trim(implode(' ', $parts)); | ||||
} | } | ||||
} | } |