CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This 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 Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Settings API
Pages: 1 2 [3] 4

Author Topic: Settings API  (Read 5877 times)

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Settings API
October 11, 2012, 06:42:36 pm
Argh - it's hopeless cropped - you can't see the 'revert' link where the default differs from your site
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Settings API
October 12, 2012, 01:01:51 am
More discussion about it with eileen on IRC.

I don't think it's the group:field is a good path:
- it looks weird (especially with the group name in Camel With Space and field all lowercase)
- it introduces yet another syntax on the top of the already custom ones (use "." as separator (return.first_name=1)
- what's happening to the getfields? are we breaking the rule and have a key that isn't in the getfields list?
- conceptually, that's a limbo between config is flat or config is hierarchy. I think we should go for one or another.

It seems that the flat is the option preferred, so I'd  rather see

Code: [Select]
civicrm_api('setting','create', array(  'extensionDir' => x));

For the few that are ambiguous

Code: [Select]
civicrm_api('setting','create', array(  'isEnabled' => x))1

Modify the name to add the prefix, only when needed so rename to MultisiteEnabled.


Quote from: Eileen on October 11, 2012, 05:11:15 pm
OK - so after some discussion with Lobo / Tim on IRC it seems the only option is to backtrack & go with

civicrm_api('setting','create', array(
  'Directory Preferences:extensionDir' => x,
  'Multisite Preferences:is_enabled' => 1
);
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Settings API
October 12, 2012, 08:14:00 am

My main concerns are:

1. This project scope is getting to be a lot larger than what was started with

2. I do agree that improving / fixing the current system is a good thing

3. If we agree on a naming convention and protocol, we then need to go back and fix all the places that use various config settings today, unless we do it in a backward compatible manner. Depending on how we do this, it could potentially impact all templates

4. We need to ensure that we dont increase the number of dbQueries significantly due to this change. There are a few settings that are used on ALL pages (specifically the url and path settings)

5.  I'll strongly vote for config is hierarchy :)

6. If we are doing all the above, should we consider and benchmark the "lets cache the settings in a PHP file" idea of Xavier
 
7. Fix the upgrade and the new install scripts to implement the above

8. Migrate all / most of the settings currently stored in $config (in the serialized array) into their own settings array

if folks think they have the time and energy to push this thru for 4.3, then you can start work on this in a branch. Once that branch is stable, we can merge it into trunk

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Settings API
October 12, 2012, 09:29:22 am
For ref, the config object as assigned to the template
So all flat but the userSystem.

Code: [Select]
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 = "/"


Few comments:
- countryLimit doesn't seem to be used in any template. Could we simply remove it (not sure I could really use the list of country id anyway without their name?
- can't we remove the dns from the config in tpl (that's IMO the riskier data to expose, and the one making the debug mode dangerous)
- The is a lot overlap between the config object and the api.setting, but not 100%. can/could be with different structure (flat/hierarchy) or even field name).
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Settings API
October 12, 2012, 10:15:25 am

we've been removing more and more settings from the config object and moving them into the settings table. We still have quite a few more variables to migrate

i think the next set should be all the ones that are used in only specific workflows (recaptcha, mapping, mailer, search etc)

If keen, you can make a big push and strip most / all the variables from the config object

another related area that needs cleanup is the whole state / country stuff. These days with ajax and retrieving states automatically, i suspect we can do the right stuff rather than loading the entire set in memory / tables etc

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

totten

  • Administrator
  • Ask me questions
  • *****
  • Posts: 695
  • Karma: 64
Re: Settings API
October 12, 2012, 10:26:59 am
I think the main appeal of the flat (no-groups) approach is that it's simpler to implement -- the code for Eileen's APIs is simpler, and the refactoring of $config (hunt+rewrite) is simpler (i.e. we can reengineer $config to load from settings while preserving the current $config interface). And bear in mind... we don't need to remove "group_name" (EDIT: or change any setting names) to satisfy those constraints -- we just need to guarantee that the uniqueness key is (name,domain_id) and not (name,group_name,domain_id).

More generally, I agree that there are reasons to do grouping, such as:

  • "Lifecycle": if several settings are defined together (eg  by an extension), then they can be added/removed together
  • "Collisions": how to ensure that different software packages (components/extensions/modules) don't accidentally create settings with colliding names
  • "Performance": how to optimize database fetches (or caches) so that related settings are loaded together or not loaded all (eg if sending email, then load the SMTP host, SMTP port, SMTP user, SMTP password; otherwise don't load them)
  • "Behavior": some settings are processed similarly -- even if they're used or declared in different contexts (eg all "Directory Preferences" are absolutized/relativized, but the usage patterns for imageUploadDir and extensionsDir are different)

Looking at that list of reasons/considerations, a few design approaches stand out

  • One approach (used in D6/D7) is to ignore those four considerations and do "the simplest thing possible".  For example, one can use a soft prefixing convention to address the collision issues.  For the performance, one might indiscriminatey prefetch all settings (which would be acceptable on my dev site where civicrm_setting+config_backend are only ~4k).  For behavior, one might do a soft suffixing convention.
  • Another approach (used in Civi 4.1) is to say "we'll add a group_name functionality and use that functionality for whatever purpose arises". One may contrive cases where those four different purposes don't agree, but our current situation is forgiving -- 10 groups, 40 settings, one codebase, performance wiggle-room -- so it's feasible to artisanally handle groupings in a way which balances the four considerations.
  • A third approach is to break out the four design considerations and address each separately.  For example, one might address lifecycle by automatically tracking which module added each setting; and then avoid collisions with a soft prefixing convention; and use a "prefetch_group_name" for performance; and use a type system for the behaviors ("setting_type=url; setting_type=directory").

I think that any of the three approaches is workable at our current stage. My preference would be to break out the considerations and deal with each separately -- but that may be the most expensive?

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Settings API
October 12, 2012, 04:35:47 pm
OK - so the specific task I have been working on is moving some config variables to settings - with two done (max_attachments & contact_undelete) - both of which are accessed in only a small handful of places. My focus is on moving the localisation settings as these are the settings that a given integrator is most likely to want to standardise across several installs (e.g set them all to Canadian $$).

The other specific changes I would like to make are

1) make group an optional part of the setting namespace & require the name+domain_id+contact_id to be unique (this second is currently true)
2) allow getValue requests to provide either group or name or both


Other steps I will need to take

1) create an action that converts config settings to settings settings that will run on upgrate / setup.sh / probably from system api.

This wouldn't stop existing settings from working

Some other notes

1) the project scope is to be able to set common config attributes via the api - the problem is that they are stored in different places :-( A lot of the meta-data about what settings are available is currently hard-coded into the form layer.

2) there are a small number of settings that are used all the time (paths & urls). These are currently cached in the $config object as well as stored as settings. I have any short-term plans to change this. Tim has some suggestions about the idea of a $setting namespace instead. The accepted process here is than in 6 months time I will finally understand the full wisdom of Tim's idea, present it as my own & bask in the kudos of Tim endorsing 'my' idea. However, if Tim wants to establish a new crmSetting or an alternative to $config then I will happily implement the code per his method when moving items from config to settings (& existing settings within reason)

3) I don't personally want to get into changing the caching at this time. url paths & directories will still be cached in config. If you access settings with the 'group' in the name it will still be cached as a group. If you access the setting as a single name it probably shouldn't be cached at all. None of this precludes implementing Xavier's idea later (or Tim's ideas once they have been refactored as my own).

4) Country Limit- I still don't really have a clear idea of how this should be implemented - although I think we should be switching to autocomplete. I did create a separate thread on this

5) X - $config->userSystem is a REAL object - with proper class-based function calls - not a setting. I copied this structure for userPermission object in 4.3 as well.

6) agree with Xavier that not exposing dsn via &smartyDebug=1 is a GOOD Idea.

7) Tim - I had been working off the idea that in non-performance sensitive situations (configuration , upgrade, module changes rather than sending a CiviMail) we could use the metadata for considerations around lifecycle.

8) Some settings are so closely tied together (e.g. SMTP host, SMTP port, SMTP user, SMTP password) that they are currently stored as a single setting in a serialised array. This is also part of the drupal approach - some modules choose to store an array rather than individual settings

9) I guess the fact that means I'm talking about your approach 3? That'll have been my idea all along in 6 months :-)

NB Tim's action list (from pastebin)
Quote
1. Add uniqueness constraint on civicrm_setting for (name,domain_id,contact_id)
2. Implement $config->settings (for lookups) and new read/write/cache behavior
3. Implement CRM_Core_BAO_Setting::getGroup($groupName) which fetches all items in a group
4. 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
« Last Edit: October 12, 2012, 11:21:36 pm by Eileen »
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Settings API
October 19, 2012, 12:32:32 am
OK - so,

I guess I put this on ice this week but next week I'll need to decide what to continue with & what to drop.

So, fundamentally the question is: Xavier, Tim, Joe & I converged on the idea that the value in the 'name' field should (remain) unique for each setting & the decisions made were pretty much all based on that.

Can I go ahead with that? (& probably add an appropriate index) or do I need to back-up & revise the underlying premise & come up with a new plan?

Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Settings API
October 22, 2012, 02:04:19 am
I wrote an extension to manage the settings that are exposed through the API

https://github.com/TechToThePeople/eu.tttp.setting

Right now, most useful feature is being able to revert.

Work in progress with Eileen on it. Next steps are to clarify which settings should be on that list (eg they are plenty of settings that don't have a default value, so we can't reverse I suppose)

see how to improve the default value presentation (seems to have escaping problems, eg \n not being displayed as <br>)

and edit in place (at least for the strings, no idea what to do wit most of the arrays)

-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Settings API
October 24, 2012, 04:42:02 am
X - I have converted the underlying metadata to php arrays (per the A-Team opinion :-)

That fixes the /n thing

"Should we display all the settings, including the ones that don't have a default?
Should we make editable the ones that are of type string? "

Yes to both.

We should also only show the revert button if the default differs from the set var. I think I did that in the tpl file on the first cut ?
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Settings API
November 27, 2012, 04:27:14 am
I have documented where this is at. I probably need to distribute the link more widely but at least one person (although a rather clever person) has already managed to make sense of adding a new setting

http://wiki.civicrm.org/confluence/display/CRM/Settings+Metadata+and+Usage
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Settings API
November 27, 2012, 08:11:09 am
Not without a lot of wrong turns and stopping to ask directions.

I'd like to make one last plea for each setting to have just one name instead of two. The namespace can be part of the name, which will ensure all the names are unique and not require two params to retrieve a setting.
Try asking your question on the new CiviCRM help site.

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Settings API
November 27, 2012, 01:17:50 pm
Coleman - I think that is the preference of Xavier, Joe, Tim & I. Lobo wasn't convinced though. At the moment the setting name ARE all unique so it would still be relatively easy to switch across - there are a couple of proposals earlier in this thread about it.
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Settings API
November 29, 2012, 09:45:07 am
That's definitely my preference too.

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Settings API
November 29, 2012, 07:56:58 pm

a few thoughts:

1. The settings stuff is now pushed to 4.4 since we are at a code freeze and no major changes

2. Given the above, we should take a look at D8's configuration system and see if we can adopt some / most / all of the ideas they've incorporated into D8. I suspect they've put a lot of thought and design work into this and performance etc

3. I'm still a strong -1 on a flat namespace. We have quite a few settings and config variables and this will increase significantly as we unify everything under settings.

4. This seems like a great project for a sprint, where a group of folks tackle and wrap this up during a sprint. I think its a fairly big task for one person (eileen) to plod away and get consensus on various things

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: 1 2 [3] 4
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Settings API

This forum was archived on 2017-11-26.