So

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

becomes

$config['foo']['bar']['baz']['quux'];
// OR
$config['foo.bar.baz.quux'];
Files: 
CommentFileSizeAuthor
#8 drupal-cmi_shortcuts-1812764-8.patch2.55 KBGaelan
PASSED: [[SimpleTest]]: [MySQL] 48,168 pass(es). View
#3 drupal-cmi_shortcuts-1812764-3.patch2.55 KBGaelan
FAILED: [[SimpleTest]]: [MySQL] Drupal installation failed. View

Comments

beejeebus’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
FAILED: [[SimpleTest]]: [MySQL] Drupal installation failed. View

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
PASSED: [[SimpleTest]]: [MySQL] 48,168 pass(es). View

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

heyrocker’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.