Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2014-10-09 09:16:47

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,137
GitHub

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.

  1. Brand new instance of Textpattern 4.5.7: textpattern/setup/txpsql.php is processed, then textpattern/setup/update/_to_4.5.7.php is processed
  2. 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)
  3. Textpattern 4.4.1 instance upgraded to Textpattern 4.5.7: textpattern/setup/update/_to_4.5.0.php is processed, then textpattern/setup/update/_to_4.5.7.php is processed
  4. 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

#2 2014-10-09 10:37:50

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,271
Website GitHub

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

#3 2014-10-09 13:02:08

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,137
GitHub

Re: How are version-specific Textpattern updates handled?

Nice one, Stef – thanks.

Offline

Board footer

Powered by FluxBB