Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / applications / repository / storage / PhabricatorRepositoryGitLFSRef.php
blob6e55c03891f04bfdbdb27e3177d86b6d5fa624eb
1 <?php
3 final class PhabricatorRepositoryGitLFSRef
4 extends PhabricatorRepositoryDAO
5 implements
6 PhabricatorPolicyInterface,
7 PhabricatorDestructibleInterface {
9 protected $repositoryPHID;
10 protected $objectHash;
11 protected $byteSize;
12 protected $authorPHID;
13 protected $filePHID;
15 protected function getConfiguration() {
16 return array(
17 self::CONFIG_COLUMN_SCHEMA => array(
18 'objectHash' => 'bytes64',
19 'byteSize' => 'uint64',
21 self::CONFIG_KEY_SCHEMA => array(
22 'key_hash' => array(
23 'columns' => array('repositoryPHID', 'objectHash'),
24 'unique' => true,
27 ) + parent::getConfiguration();
31 /* -( PhabricatorPolicyInterface )----------------------------------------- */
34 public function getCapabilities() {
35 return array(
36 PhabricatorPolicyCapability::CAN_VIEW,
40 public function getPolicy($capability) {
41 return PhabricatorPolicies::getMostOpenPolicy();
44 public function hasAutomaticCapability($capability, PhabricatorUser $viewer) {
45 return false;
49 /* -( PhabricatorDestructibleInterface )----------------------------------- */
52 public function destroyObjectPermanently(
53 PhabricatorDestructionEngine $engine) {
55 $file_phid = $this->getFilePHID();
57 $file = id(new PhabricatorFileQuery())
58 ->setViewer($engine->getViewer())
59 ->withPHIDs(array($file_phid))
60 ->executeOne();
61 if ($file) {
62 $engine->destroyObject($file);
65 $this->delete();