Path: blob/master/src/infrastructure/storage/management/PhabricatorStoragePatch.php
12241 views
<?php12final class PhabricatorStoragePatch extends Phobject {34private $key;5private $fullKey;6private $name;7private $type;8private $after;9private $legacy;10private $dead;11private $phase;1213const PHASE_DEFAULT = 'default';14const PHASE_WORKER = 'worker';1516public function __construct(array $dict) {17$this->key = $dict['key'];18$this->type = $dict['type'];19$this->fullKey = $dict['fullKey'];20$this->legacy = $dict['legacy'];21$this->name = $dict['name'];22$this->after = $dict['after'];23$this->dead = $dict['dead'];24$this->phase = $dict['phase'];25}2627public function getLegacy() {28return $this->legacy;29}3031public function getAfter() {32return $this->after;33}3435public function getType() {36return $this->type;37}3839public function getName() {40return $this->name;41}4243public function getFullKey() {44return $this->fullKey;45}4647public function getKey() {48return $this->key;49}5051public function getPhase() {52return $this->phase;53}5455public function isDead() {56return $this->dead;57}5859public function getIsGlobalPatch() {60return ($this->getType() == 'php');61}6263public static function getPhaseList() {64return array_keys(self::getPhaseMap());65}6667public static function getDefaultPhase() {68return self::PHASE_DEFAULT;69}7071private static function getPhaseMap() {72return array(73self::PHASE_DEFAULT => array(74'order' => 0,75),76self::PHASE_WORKER => array(77'order' => 1,78),79);80}8182public function newSortVector() {83$map = self::getPhaseMap();84$phase = $this->getPhase();8586return id(new PhutilSortVector())87->addInt($map[$phase]['order']);88}8990}919293