@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
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Make default database namespace configurable

Summary: Allow the default namespace to be set in configuration, so you can juggle multiple copies of sandbox test data or whatever.

Test Plan: Changed default namespace, verified web UI and "storage" script respect it.

Reviewers: btrahan, vrana, jungejason

Reviewed By: vrana

CC: aran

Maniphest Tasks: T345

Differential Revision: https://secure.phabricator.com/D2341

+34 -6
+7
conf/default.conf.php
··· 719 719 // fits within configured limits. 720 720 'storage.engine-selector' => 'PhabricatorDefaultFileStorageEngineSelector', 721 721 722 + // Phabricator puts databases in a namespace, which defualts to "phabricator" 723 + // -- for instance, the Differential database is named 724 + // "phabricator_differential" by default. You can change this namespace if you 725 + // want. Normally, you should not do this unless you are developing 726 + // Phabricator and using namespaces to separate multiple sandbox datasets. 727 + 'storage.default-namespace' => 'phabricator', 728 + 722 729 723 730 // -- Search ---------------------------------------------------------------- // 724 731
+1 -1
scripts/sql/manage_storage.php
··· 40 40 $default_user = $conf->getUser(); 41 41 $default_password = $conf->getPassword(); 42 42 $default_host = $conf->getHost(); 43 - $default_namespace = 'phabricator'; 43 + $default_namespace = PhabricatorLiskDAO::getDefaultStorageNamespace(); 44 44 45 45 try { 46 46 $args->parsePartial(
+25 -4
src/applications/base/storage/lisk/PhabricatorLiskDAO.php
··· 23 23 abstract class PhabricatorLiskDAO extends LiskDAO { 24 24 25 25 private $edges = array(); 26 - private static $namespace = 'phabricator'; 26 + private static $namespaceStack = array(); 27 27 28 28 29 29 /* -( Managing Edges )----------------------------------------------------- */ ··· 65 65 /** 66 66 * @task config 67 67 */ 68 - public static function setApplicationNamespace($namespace) { 69 - self::$namespace = $namespace; 68 + public static function pushStorageNamespace($namespace) { 69 + self::$namespaceStack[] = $namespace; 70 70 } 71 71 72 + /** 73 + * @task config 74 + */ 75 + public static function popStorageNamespace($namespace) { 76 + array_pop(self::$namespaceStack); 77 + } 78 + 79 + /** 80 + * @task config 81 + */ 82 + public static function getDefaultStorageNamespace() { 83 + return PhabricatorEnv::getEnvConfig('storage.default-namespace'); 84 + } 72 85 73 86 /** 74 87 * @task config 75 88 */ 76 89 public function establishLiveConnection($mode) { 90 + $namespace = end(self::$namespaceStack); 91 + if (!strlen($namespace)) { 92 + $namespace = self::getDefaultStorageNamespace(); 93 + } 94 + if (!strlen($namespace)) { 95 + throw new Exception("No storage namespace configured!"); 96 + } 97 + 77 98 $conf = PhabricatorEnv::newObjectFromConfig( 78 99 'mysql.configuration-provider', 79 - array($this, $mode, self::$namespace)); 100 + array($this, $mode, $namespace)); 80 101 81 102 return PhabricatorEnv::newObjectFromConfig( 82 103 'mysql.implementation',
+1 -1
src/infrastructure/setup/storage/management/PhabricatorStorageManagementAPI.php
··· 25 25 26 26 public function setNamespace($namespace) { 27 27 $this->namespace = $namespace; 28 - PhabricatorLiskDAO::setApplicationNamespace($namespace); 28 + PhabricatorLiskDAO::pushStorageNamespace($namespace); 29 29 return $this; 30 30 } 31 31