So

$config.get("foo.bar.baz.quux");

becomes

$config['foo']['bar']['baz']['quux'];
// OR
$config['foo.bar.baz.quux'];
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Anonymous’s picture

please no.

moshe weitzman’s picture

Status: Active » Closed (won't fix)

Not much interest. Folks can reopen with an implementation.

Gaelan’s picture

Title: __get and __set syntactic sugar for CMI » ArrayAccess syntactic sugar for CMI
FileSize
2.55 KB

Patch. Decided to use ArrayAccess after all. Gives us these:

$config['foo'] = 'bar';
$value = $config['foo'];
$exists = isset($config['foo']);
unset($config['foo']);
Gaelan’s picture

Status: Closed (won't fix) » Needs review

Whoops…

Status: Needs review » Needs work
Issue tags: -Configuration system

The last submitted patch, drupal-cmi_shortcuts-1812764-3.patch, failed testing.

Anonymous’s picture

Issue summary: View changes

Formatting fix

Gaelan’s picture

Issue summary: View changes

Updated issue summary for ArrayAccess.

Gaelan’s picture

Status: Needs work » Needs review

This code shouldn't do anything that prevents installation…

#3: drupal-cmi_shortcuts-1812764-3.patch queued for re-testing.

Status: Needs review » Needs work
Issue tags: +Configuration system

The last submitted patch, drupal-cmi_shortcuts-1812764-3.patch, failed testing.

Gaelan’s picture

Status: Needs work » Needs review
FileSize
2.55 KB

Forgot a backslash. Was looking for Drupal\\Core\\Config\\ArrayAccess. Nope, not there.

gdd’s picture

What's the use case for doing this? We've made explicit decisions to move away from array-centric APIs, and I don't see a lot of value in hiding our nice new API behind old pretending they still exist.

Gaelan’s picture

Status: Needs review » Closed (won't fix)

Ah. Didn't know about these decisions. Marking as won't fix.

Gaelan’s picture

Issue summary: View changes

Updated issue summary.