Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Proposed resolution
Remaining tasks
User interface changes
API changes
Comment | File | Size | Author |
---|---|---|---|
#13 | interdiff.txt | 1.59 KB | dawehner |
#13 | transaction-2245905-13.patch | 21.67 KB | dawehner |
#11 | interdiff.txt | 2.66 KB | dawehner |
#11 | fake_connection-2245905-10.patch | 21.42 KB | dawehner |
#8 | interdiff.txt | 4.85 KB | dawehner |
Comments
Comment #1
dawehnerComment #2
chx CreditAttribution: chx commentedSure, why not. But won't this make the 'php' driver appear in the installer? If not, what keeps it from? I honestly do not know, I never even followed really the move of fake connection from migrate to driver.
Comment #3
dawehnerThis function is somehow called when you have a transaction in your code. My goal is to use a fake connection for one of the tests, which uses a transaction internally.
Comment #4
dawehnerIt seems not trivial support transaction support in PHP.
Comment #5
chx CreditAttribution: chx commentedSure it is: save the whole database array and on rollback put it back. It's good enough. It's not MVCC but then again you only have a single client with a single thread so you are good.
Comment #6
dawehnerWell, I tried to get the test suite for transactions running, and here we go. This was fun!
Comment #8
dawehnerThe test relied on public properties.
Comment #9
chx CreditAttribution: chx commentedwhy not just
return end($this->databaseContentsStack);
?end(array_keys($this->databaseContentsStack))
would perhaps be better but that's a strict notice. However,end((array_keys($this->databaseContentsStack)))
works just fine. (Madness!) Compare http://3v4l.org/CNLVT to http://3v4l.org/168fi.Comment #10
chx CreditAttribution: chx commentedApparently (( )) is classified as a https://bugs.php.net/bug.php?id=55222 bug so let's not do that.
Comment #11
dawehnerSo let's try to improve the rest of the code.
Comment #12
chx CreditAttribution: chx commentedDid you test this patch doesn't make the driver show up in the installer?
Also in popCommittableTransactions
You are removing the second-to-last entry? But why? Anyways, this is best done with
array_splice($this->databaseContentsStack, -2, 1)
Comment #13
dawehnerJust did, it does not appear.
Well, the idea is to commit the one with $name, I guess the new code is a bit clearer.
Comment #15
jhedstromPatch no longer applies. Also tagging for an IS update since the IS is currently blank :)