2016-07-21 17:14:34 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class PhabricatorPackagesApplication extends PhabricatorApplication {
|
|
|
|
|
|
|
|
public function getName() {
|
|
|
|
return pht('Packages');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getShortDescription() {
|
|
|
|
return pht('Publish Software');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getFlavorText() {
|
|
|
|
return pht('Applications and Extensions');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getBaseURI() {
|
|
|
|
return '/packages/';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getIcon() {
|
|
|
|
return 'fa-gift';
|
|
|
|
}
|
|
|
|
|
2016-08-12 05:04:25 +02:00
|
|
|
public function getApplicationGroup() {
|
|
|
|
return self::GROUP_UTILITIES;
|
|
|
|
}
|
|
|
|
|
2016-07-21 17:14:34 +02:00
|
|
|
public function isPrototype() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2016-07-22 15:03:31 +02:00
|
|
|
protected function getCustomCapabilities() {
|
|
|
|
return array(
|
|
|
|
PhabricatorPackagesCreatePublisherCapability::CAPABILITY => array(
|
|
|
|
'default' => PhabricatorPolicies::POLICY_ADMIN,
|
|
|
|
),
|
|
|
|
PhabricatorPackagesPublisherDefaultEditCapability::CAPABILITY => array(
|
|
|
|
'caption' => pht('Default edit policy for newly created publishers.'),
|
|
|
|
'template' => PhabricatorPackagesPublisherPHIDType::TYPECONST,
|
|
|
|
'default' => PhabricatorPolicies::POLICY_NOONE,
|
|
|
|
),
|
|
|
|
PhabricatorPackagesPackageDefaultViewCapability::CAPABILITY => array(
|
|
|
|
'caption' => pht('Default edit policy for newly created packages.'),
|
|
|
|
'template' => PhabricatorPackagesPackagePHIDType::TYPECONST,
|
|
|
|
),
|
|
|
|
PhabricatorPackagesPackageDefaultEditCapability::CAPABILITY => array(
|
|
|
|
'caption' => pht('Default view policy for newly created packages.'),
|
|
|
|
'template' => PhabricatorPackagesPackagePHIDType::TYPECONST,
|
|
|
|
'default' => PhabricatorPolicies::POLICY_NOONE,
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
2016-07-21 17:14:34 +02:00
|
|
|
public function getRoutes() {
|
|
|
|
return array(
|
|
|
|
'/package/' => array(
|
|
|
|
'(?P<publisherKey>[^/]+)/' => array(
|
|
|
|
'' => 'PhabricatorPackagesPublisherViewController',
|
2016-07-21 19:39:59 +02:00
|
|
|
'(?P<packageKey>[^/]+)/' => array(
|
|
|
|
'' => 'PhabricatorPackagesPackageViewController',
|
2016-07-21 21:11:11 +02:00
|
|
|
'(?P<versionKey>[^/]+)/' =>
|
|
|
|
'PhabricatorPackagesVersionViewController',
|
2016-07-21 19:39:59 +02:00
|
|
|
),
|
2016-07-21 17:14:34 +02:00
|
|
|
),
|
|
|
|
),
|
|
|
|
'/packages/' => array(
|
|
|
|
'publisher/' => array(
|
|
|
|
$this->getQueryRoutePattern() =>
|
|
|
|
'PhabricatorPackagesPublisherListController',
|
|
|
|
$this->getEditRoutePattern('edit/') =>
|
|
|
|
'PhabricatorPackagesPublisherEditController',
|
|
|
|
),
|
2016-07-21 19:39:59 +02:00
|
|
|
'package/' => array(
|
|
|
|
$this->getQueryRoutePattern() =>
|
|
|
|
'PhabricatorPackagesPackageListController',
|
|
|
|
$this->getEditRoutePattern('edit/') =>
|
|
|
|
'PhabricatorPackagesPackageEditController',
|
|
|
|
),
|
2016-07-21 21:11:11 +02:00
|
|
|
'version/' => array(
|
|
|
|
$this->getQueryRoutePattern() =>
|
|
|
|
'PhabricatorPackagesVersionListController',
|
|
|
|
$this->getEditRoutePattern('edit/') =>
|
|
|
|
'PhabricatorPackagesVersionEditController',
|
|
|
|
),
|
2016-07-21 17:14:34 +02:00
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|