Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2008-06-14 21:25:12

sthmtc
Member
From: CGN, GER
Registered: 2005-01-17
Posts: 586
Website

Re: allow extensive versioning

chriloi wrote:

If you all are fine with it, I’d like to make this idea into a plugin.

wow, a dream would come true if this is actually going to work! :)

Offline

#14 2008-06-15 00:08:09

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: allow extensive versioning

Christian, That sounds like a great idea didn’t think of that approach.


Shoving is the answer – pusher robot

Offline

#15 2008-06-15 02:41:58

chriloi
Plugin Author
From: Vienna, Austria
Registered: 2006-01-17
Posts: 120
Website

Re: allow extensive versioning

I had a run: Download cnk_versioning BETA

Please use this with care! Your pages/forms are deleted from the database, when you delete the corresponding files.

Before installation, you have to create a “forms” and a “pages” directory with chmod 777 in the textpattern root directory, then go to “presentation” > “versioning” and click install. After that just click “write pages and forms to files”.

Everytime a front-end page is viewed with production_status != ‘live’, the plugin loads all files to the database, which have a modification timestamp greater than the one stored in the database. Deleted files will also delete forms/pages from database. New files will create new pages/forms.

The filename-pattern works as following:

for forms: <form_name>.<form_type>.txp
pages: <page_name>.txp

Have fun with it!

Offline

#16 2008-06-15 07:40:25

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

Re: allow extensive versioning

Haven’t had a chance to try it yet, but this sounds like an excellent tool. Now if only it could tell my hoster to fix their damn NTP clock so it wasn’t 4 minutes different from the rest of the world so I could actually use it… :-) Causes much confusion/annoyance when I choose to overwrite only new files in my FTP client and it doesn’t do it. Grrr.

But thank you for putting this together. I’ll try it on my test server at work instead when I get a chance.

Kudos!

P.S. it looks like you’re using the old version of ied_plugin_composer. The latest version there has some more bells and whistles and outputs code in the standard template block style too. You might want to check it out.

Last edited by Bloke (2008-06-15 07:43:55)


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

#17 2008-06-15 07:48:55

sthmtc
Member
From: CGN, GER
Registered: 2005-01-17
Posts: 586
Website

Re: allow extensive versioning

ZOMG.

christian, this is nothing but amazing. installed on my local testserver and despite from giving some php warnings it seems to work!
will post again after some more testing :)

EDIT: the warnings only occured because i’ve saved the files first, then intalled the tables. my fault..

Last edited by sthmtc (2008-06-15 08:36:09)

Offline

#18 2008-06-15 11:58:39

chriloi
Plugin Author
From: Vienna, Austria
Registered: 2006-01-17
Posts: 120
Website

Re: allow extensive versioning

Thanks Stef, I updated my plugin composer.

I figured out, that I have to fix some issues:

1. Instead of saving database current time, php unixtime should be saved. Prevents issues if MySQL doesn’t have the same time as the server where the files are stored.
2. Forgot to export styles…

Anything else?

Offline

#19 2008-06-15 19:13:24

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,323
Website Mastodon

Re: allow extensive versioning

It might be reasonable to adopt the same directory structure as mcw_templates, as these two plugins share a common ground, though in reverse directions.

Offline

#20 2008-06-15 19:16:27

sthmtc
Member
From: CGN, GER
Registered: 2005-01-17
Posts: 586
Website

Re: allow extensive versioning

yup, i was thinking about that too. however, i like the fact that in christians current version all files share a .txp extension.

Offline

#21 2008-06-15 23:31:46

chriloi
Plugin Author
From: Vienna, Austria
Registered: 2006-01-17
Posts: 120
Website

Re: allow extensive versioning

I think I will make the directories and file extensions an option in the next version.

One thing has to be clarified: What should happen, if someone alters templates in the txp-backend? (I think immediately altering the text files is not a good idea…)

Offline

#22 2008-06-16 00:14:04

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: allow extensive versioning

Why do you think that’s a bad idea?


Shoving is the answer – pusher robot

Offline

#23 2008-06-16 01:40:53

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: allow extensive versioning

I thought the external text files were to be under version control — so couldn’t you simply use your external system-of-choice to revert the change if you need to?


Steve

Offline

#24 2008-06-16 06:29:15

sthmtc
Member
From: CGN, GER
Registered: 2005-01-17
Posts: 586
Website

Re: allow extensive versioning

chriloi wrote:

What should happen, if someone alters templates in the txp-backend? (I think immediately altering the text files is not a good idea…)

would it be an option to disallow access to the pages and forms tab in the backend while production status != live and/or the plugin is active? i guess that would be a solution that would fit my needs, however, i can see that this could potentially cause problems…

btw: from my quick testing i can say that this dramatically improves the development speed! :)

EDIT: maybe there could be a switch in the plugins tab to “lock down” pages/forms/styles in the backend while working on it, to make sure that nobody else is doing stuff he shouldn’t be doing.

Last edited by sthmtc (2008-06-16 06:39:43)

Offline

Board footer

Powered by FluxBB