Have a question about CiviCRM? Get it answered quickly at the new CiviCRM Stack Exchange Q+A siteThis forum was archived on 25 November 2017. Learn more.How to get involved.What to do if you think you've found a bug.
civicrm_api('setting','create', array( 'extensionDir' => x));
civicrm_api('setting','create', array( 'isEnabled' => x))1
OK - so after some discussion with Lobo / Tim on IRC it seems the only option is to backtrack & go withcivicrm_api('setting','create', array( 'Directory Preferences:extensionDir' => x, 'Multisite Preferences:is_enabled' => 1);
CRM_Core_Config Object (113)->dsn = "mysql://trunk:trunk@localhost/trunk"->userFramework = "Drupal"->userFrameworkURLVar = "q"->userFrameworkDSN = "mysql://trunk:trunk@localhost/trunk"->userSystem = CRM_Utils_System_Drupal Object (4) ->is_drupal = true ->is_joomla = false ->is_wordpress = false ->supports_form_extensions = true->templateCompileDir = "/var/www/drupal/trunk/sites/default/f..."->configAndLogDir = "/var/www/drupal/trunk/sites/default/f..."->initialized = 1->componentRegistry = CRM_Core_Component Object (0)->inCiviCRM = false->recaptchaPublicKey = null->debug = "1"->backtrace = "1"->smartyDir = "/var/www/drupal/trunk/sites/all/modul..."->pluginsDir = "/var/www/drupal/trunk/sites/all/modul..."->templateDir = Array (1) 0 => "/var/www/drupal/trunk/sites/all/modul..."->resourceBase = "/sites/all/modules/civicrm/"->uploadDir = "/var/www/drupal/trunk/sites/default/f..."->imageUploadDir = "/var/www/drupal/trunk/sites/default/f..."->customFileUploadDir = "/var/www/drupal/trunk/sites/default/f..."->imageUploadURL = "http://trunk.crm/sites/default/files/..."->extensionsURL = "http://trunk.crm/sites/all/modules/ci..."->cleanURL = 1->countryLimit = Array (247) 0 => "1228" 1 => "1240" 2 => "1239" 3 => "1237" 4 => "1236" 5 => "1235" 6 => "1234" 7 => "1031" 8 => "1233" 9 => "1232" 10 => "1231" 11 => "1230" 12 => "1229" 13 => "1227" 14 => "1226" 15 => "1225" 16 => "1224" 17 => "1223" 18 => "1222" 19 => "1221" 20 => "1220" 21 => "1219" 22 => "1218" 23 => "1217" 24 => "1216" 25 => "1215" 26 => "1214" 27 => "1063" 28 => "1211" 29 => "1210" 30 => "1209" 31 => "1208" 32 => "1206" 33 => "1205" 34 => "1204" 35 => "1203" 36 => "1202" 37 => "1201" 38 => "1200" 39 => "1199" 40 => "1198" 41 => "1247" 42 => "1197" 43 => "1196" 44 => "1195" 45 => "1194" 46 => "1193" 47 => "1192" 48 => "1249" 49 => "1191" 50 => "1190" 51 => "1189" 52 => "1238" 53 => "1242" 54 => "1188" 55 => "1187" 56 => "1207" 57 => "1186" 58 => "1185" 59 => "1184" 60 => "1183" 61 => "1182" 62 => "1181" 63 => "1180" 64 => "1178" 65 => "1177" 66 => "1176" 67 => "1179" 68 => "1175" 69 => "1174" 70 => "1173" 71 => "1172" 72 => "1171" 73 => "1170" 74 => "1169" 75 => "1168" 76 => "1167" 77 => "1166" 78 => "1165" 79 => "1164" 80 => "1163" 81 => "1162" 82 => "1161" 83 => "1160" 84 => "1159" 85 => "1158" 86 => "1157" 87 => "1156" 88 => "1155" 89 => "1154" 90 => "1153" 91 => "1152" 92 => "1150" 93 => "1149" 94 => "1148" 95 => "1035" 96 => "1147" 97 => "1146" 98 => "1145" 99 => "1243" 100 => "1144" 101 => "1143" 102 => "1142" 103 => "1141" 104 => "1140" 105 => "1139" 106 => "1138" 107 => "1137" 108 => "1136" 109 => "1135" 110 => "1134" 111 => "1133" 112 => "1132" 113 => "1131" 114 => "1130" 115 => "1129" 116 => "1128" 117 => "1127" 118 => "1126" 119 => "1125" 120 => "1124" 121 => "1123" 122 => "1122" 123 => "1121" 124 => "1120" 125 => "1119" 126 => "1118" 127 => "1117" 128 => "1116" 129 => "1115" 130 => "1114" 131 => "1113" 132 => "1112" 133 => "1111" 134 => "1110" 135 => "1244" 136 => "1109" 137 => "1108" 138 => "1107" 139 => "1106" 140 => "1246" 141 => "1105" 142 => "1104" 143 => "1103" 144 => "1102" 145 => "1101" 146 => "1100" 147 => "1099" 148 => "1098" 149 => "1097" 150 => "1096" 151 => "1095" 152 => "1094" 153 => "1093" 154 => "1092" 155 => "1091" 156 => "1245" 157 => "1090" 158 => "1089" 159 => "1088" 160 => "1087" 161 => "1086" 162 => "1085" 163 => "1084" 164 => "1083" 165 => "1082" 166 => "1081" 167 => "1213" 168 => "1080" 169 => "1079" 170 => "1078" 171 => "1077" 172 => "1076" 173 => "1075" 174 => "1074" 175 => "1073" 176 => "1072" 177 => "1070" 178 => "1069" 179 => "1068" 180 => "1067" 181 => "1066" 182 => "1065" 183 => "1064" 184 => "1062" 185 => "1061" 186 => "1060" 187 => "1059" 188 => "1054" 189 => "1058" 190 => "1057" 191 => "1248" 192 => "1056" 193 => "1055" 194 => "1053" 195 => "1052" 196 => "1050" 197 => "1051" 198 => "1049" 199 => "1048" 200 => "1047" 201 => "1046" 202 => "1045" 203 => "1044" 204 => "1043" 205 => "1042" 206 => "1041" 207 => "1040" 208 => "1039" 209 => "1038" 210 => "1037" 211 => "1036" 212 => "1034" 213 => "1033" 214 => "1032" 215 => "1030" 216 => "1029" 217 => "1028" 218 => "1027" 219 => "1026" 220 => "1250" 221 => "1025" 222 => "1024" 223 => "1023" 224 => "1022" 225 => "1021" 226 => "1020" 227 => "1019" 228 => "1018" 229 => "1017" 230 => "1016" 231 => "1212" 232 => "1015" 233 => "1014" 234 => "1013" 235 => "1012" 236 => "1011" 237 => "1010" 238 => "1009" 239 => "1008" 240 => "1007" 241 => "1006" 242 => "1005" 243 => "1004" 244 => "1003" 245 => "1002" 246 => "1001"->provinceLimit = Array (1) 0 => "1228"->defaultContactCountry = "1109"->defaultCurrency = "USD"->lcMessages = "en_US"->dateformatDatetime = "%B %E%f, %Y %l:%M %P"->dateformatFull = "%B %E%f, %Y"->dateformatPartial = "%B %Y"->dateformatYear = "%Y"->dateformatTime = "%l:%M %P"->timeInputFormat = 1->dateInputFormat = "mm/dd/yy"->fiscalYearStart = Array (2) M => 1 d => 1->moneyformat = "%c %a"->moneyvalueformat = "%!i"->currencySymbols = ""->defaultCurrencySymbol = "$"->monetaryDecimalPoint = "."->monetaryThousandSeparator = ","->gettextCodeset = "utf-8"->gettextDomain = "civicrm"->gettextResourceDir = "/var/www/drupal/trunk/sites/all/modul..."->userFrameworkVersion = "7.14"->userFrameworkUsersTableName = "users"->userFrameworkClass = "CRM_Utils_System_Drupal"->userHookClass = "CRM_Utils_Hook_Drupal"->userPermissionClass = CRM_Core_Permission_Drupal Object (0)->userFrameworkBaseURL = "http://trunk.crm/"->userFrameworkResourceURL = "http://trunk.crm/sites/all/modules/ci..."->userFrameworkFrontend = false->userFrameworkLogging = "0"->maxImportFileSize = 2097152->maxAttachments = 3->maxFileSize = 2->localeCustomStrings = null->mapProvider = null->mapAPIKey = null->geoProvider = null->geoAPIKey = null->geocodeMethod = ""->mapGeoCoding = 1->contactUndelete = true->logging = false->versionCheck = true->enableComponents = Array (6) 0 => "CiviContribute" 1 => "CiviPledge" 2 => "CiviMember" 3 => "CiviEvent" 4 => "CiviMail" 5 => "CiviReport"->enableComponentIDs = Array (6) 0 => 1 1 => 6 2 => 2 3 => 3 4 => 4 5 => 8->enableSSL = false->fatalErrorTemplate = "CRM/common/fatal.tpl"->fatalErrorHandler = ""->legacyEncoding = "Windows-1252"->fieldSeparator = ","->maxLocationBlocks = 2->captchaFontPath = "/usr/X11R6/lib/X11/fonts/"->captchaFont = "HelveticaBold.ttf"->includeWildCardInName = 1->includeEmailInName = 1->includeNickNameInName = 0->smartGroupCacheTimeout = 0->defaultSearchProfileID = null->dashboardCacheTimeout = 1440->doNotResetCache = 0->includeAlphabeticalPager = 1->includeOrderByClause = 1->oldInputStyle = 1->formKeyDisable = false->doNotAttachPDFReceipt = false->wkhtmltopdfPath = false->civiRelativeURL = "/"->customTranslateFunction = ""->_qf_default = "Localization:next"->_qf_Localization_next = "Save"->inheritLocale = 0->civiModules = Array (2) publicautocomplete => "eu.tttp.publicautocomplete/publicauto..." tobechecked => "eu.tttp.tobechecked/tobechecked.php"->verpSeparator = "."->mailerPeriod = 180->mailerSpoolLimit = 0->mailerBatchLimit = 0->mailerJobSize = 0->mailerJobsMax = 0->mailThrottleTime = 0->customTemplateDir = null->customPHPPathDir = null->extensionsDir = "/var/www/civi.custom/extensions"->customCSSURL = null->sqlDir = "/var/www/drupal/trunk/sites/all/modul..."->importDataSourceDir = "/var/www/drupal/trunk/sites/all/modul..."->groupTree = false->revampPages = Array (0)->useIDS = true->useFrameworkRelativeBase = "/"
1. Add uniqueness constraint on civicrm_setting for (name,domain_id,contact_id)2. Implement $config->settings (for lookups) and new read/write/cache behavior3. Implement CRM_Core_BAO_Setting::getGroup($groupName) which fetches all items in a group4. Rewrite/simplify CRM_Core_BAO_Setting::getItem() -- it should simply call getGroup() or $config->settings (depending on which parameters are passed in)5. Rewrite/simplify CRM_Core_BAO_Setting::setItem() -- it should simply call $config->settings