Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
How are version-specific Textpattern updates handled?
I will admit right now that I’m not 100% clear on how textpattern/update
scripts are handled on installation and upgrade.
I would appreciate some clarification on the following scenarios, starting with whether my logic/understanding is correct.
- Brand new instance of Textpattern 4.5.7:
textpattern/setup/txpsql.php
is processed, thentextpattern/setup/update/_to_4.5.7.php
is processed - Textpattern 4.5.5 instance upgraded to Textpattern 4.5.7: only
textpattern/setup/update/_to_4.5.7.php
is processed (i.e.,txpsql.php
is omitted) - Textpattern 4.4.1 instance upgraded to Textpattern 4.5.7:
textpattern/setup/update/_to_4.5.0.php
is processed, thentextpattern/setup/update/_to_4.5.7.php
is processed - Textpattern g1.19 instance upgraded to Textpattern 4.5.7: everything in
textpattern/setup/update/
is processed in order
Am I right? Am I close? Or am I way out?
Thanks in advance.
Last edited by gaekwad (2014-10-09 09:37:15)
Offline
Re: How are version-specific Textpattern updates handled?
gaekwad wrote #284630:
Am I close?
Very.
Spot on, except for (1). With a brand new instance of any version, txpsql.php
is run and then every version-numbered file in /update/
is processed in order until it runs out of update files. This ensures we have a baseline (txpsql.php
) and then cumulative “patches” (as it were) are applied to adjust things and bring the system up-to-date. If we jumped straight to _to_4.5.7.php
, then other things upon which it relied might not have been done and it may well fail.
That’s kind of why our update process is both good (because upgrading is fairly painless most of the time) but crap insofar as if there’s ever a problem due to permissions or whatehaveyou, the process derails badly and gets progressively worse with each successive update script that runs, leaving the system in an unexpected and often unusable state.
Oh, there’s also a special case: development. If the $txp_using_svn
flag is set true (in the root index.php
) then the most recent upgrade file is always processed if its date stamp has changed since last time, to allow for incremental testing of upgrades.
Note to self: rename $txp_using_svn
at some point after 4.6.0 lands.
Last edited by Bloke (2014-10-09 10:43:02)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: How are version-specific Textpattern updates handled?
Nice one, Stef – thanks.
Offline