Select the types of activity you want to include in your feed.
@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
···88 $request = $this->getRequest();
99 $uri = $request->getRequestURI();
10101111+ $user_agent = idx($_SERVER, 'HTTP_USER_AGENT');
1212+1113 // Check if this is a VCS request, e.g. from "git clone", "hg clone", or
1214 // "svn checkout". If it is, we jump off into repository serving code to
1315 // process the request.
···2729 //
2830 // ...to get a human-readable error.
2931 $vcs = $request->getExists('__vcs__');
3232+ } else if (strncmp($user_agent, "git/", 4) === 0) {
3333+ $vcs = PhabricatorRepositoryType::REPOSITORY_TYPE_GIT;
3034 } else if ($request->getExists('service')) {
3135 $service = $request->getStr('service');
3236 // We get this initially for `info/refs`.
···538542539543 if (!PhabricatorEnv::getEnvConfig('diffusion.allow-http-auth')) {
540544 // No HTTP auth permitted.
545545+ return null;
546546+ }
547547+548548+ if (!strlen($username)) {
549549+ // No username.
550550+ return null;
551551+ }
552552+553553+ if (!strlen($password->openEnvelope())) {
554554+ // No password.
541555 return null;
542556 }
543557
···11+<?php
22+33+abstract class BuildStepImplementation {
44+55+ private $settings;
66+77+ const SETTING_TYPE_STRING = 'string';
88+ const SETTING_TYPE_INTEGER = 'integer';
99+ const SETTING_TYPE_BOOLEAN = 'boolean';
1010+1111+ public static function getImplementations() {
1212+ $symbols = id(new PhutilSymbolLoader())
1313+ ->setAncestorClass("BuildStepImplementation")
1414+ ->setConcreteOnly(true)
1515+ ->selectAndLoadSymbols();
1616+ return ipull($symbols, 'name');
1717+ }
1818+1919+ /**
2020+ * The name of the implementation.
2121+ */
2222+ abstract public function getName();
2323+2424+ /**
2525+ * The generic description of the implementation.
2626+ */
2727+ public function getGenericDescription() {
2828+ return '';
2929+ }
3030+3131+ /**
3232+ * The description of the implementation, based on the current settings.
3333+ */
3434+ public function getDescription() {
3535+ return '';
3636+ }
3737+3838+ /**
3939+ * Run the build step against the specified build.
4040+ */
4141+ abstract public function execute(HarbormasterBuild $build);
4242+4343+ /**
4444+ * Gets the settings for this build step.
4545+ */
4646+ public function getSettings() {
4747+ return $this->settings;
4848+ }
4949+5050+ /**
5151+ * Validate the current settings of this build step.
5252+ */
5353+ public function validate() {
5454+ return true;
5555+ }
5656+5757+ /**
5858+ * Loads the settings for this build step implementation from the build step.
5959+ */
6060+ public final function loadSettings(HarbormasterBuildStep $build_step) {
6161+ $this->settings = array();
6262+ $this->validateSettingDefinitions();
6363+ foreach ($this->getSettingDefinitions() as $name => $opt) {
6464+ $this->settings[$name] = $build_step->getDetail($name);
6565+ }
6666+ return $this->settings;
6767+ }
6868+6969+ /**
7070+ * Validates that the setting definitions for this implementation are valid.
7171+ */
7272+ public final function validateSettingDefinitions() {
7373+ foreach ($this->getSettingDefinitions() as $name => $opt) {
7474+ if (!isset($opt['type'])) {
7575+ throw new Exception(
7676+ 'Setting definition \''.$name.
7777+ '\' is missing type requirement.');
7878+ }
7979+ }
8080+ }
8181+8282+ /**
8383+ * Return an array of settings for this step implementation.
8484+ */
8585+ public function getSettingDefinitions() {
8686+ return array();
8787+ }
8888+}