Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#121 2011-06-21 06:27:08
Re: [plugin] [ORPHAN] cnk_versioning
artagesw wrote:
It seems that the plugin simply reads/writes a shared file system on the server instead of the database.
It auto-imports the files to the database from the file system. Also it disables the admin-interface that would allow editing presentation related items.
But how does it prevent overwrites or conflicts between multiple authors? How do you provide multiple authors with access to this shared space without conflicts?
It doesn’t, but version control system. Commonly no one edits the shared production files directly, but has their own checkouts and commits to the repository. Then from the repository the code is auto-deployed to the production environment when proven stable. As version control system is used, no overwrites are possible and changing the code is safe.
Last edited by Gocom (2011-06-21 06:56:43)
Offline
#122 2011-06-21 07:31:11
Re: [plugin] [ORPHAN] cnk_versioning
Gocom wrote:
It doesn’t, but version control system. Commonly no one edits the shared production files directly, but has their own checkouts and commits to the repository.
OK, so am I correct to assume that this model also requires each author to run their own instance of Textpattern, which reads/writes to their own checkout directory?
Offline
#123 2011-06-21 08:33:53
Re: [plugin] [ORPHAN] cnk_versioning
artagesw wrote:
OK, so am I correct to assume that this model also requires each author to run their own instance of Textpattern, which reads/writes to their own checkout directory?
Sam, I don’t really understand what you mean by reading and writing, sorry. Cnk_versioning just imports files to database. It doesn’t write anything, apart from exporting feature it offers. Updating the files doesn’t require TXP as updating isn’t done from TXP.
If a person, a developer, wants to test changes locally, then yes, they would have their own Textpattern install as usually the Textpattern side of the team have. That goes without saying. One can also use centralized testing/staging servers where the changes are deployed. What ever works best for the team.
I read that by authors you refer to the content editors, end-users. Content editors usually don’t touch the code, if that isn’t what they are responsible for. Those that are not required to touch the code, shouldn’t have to touch code (if they don’t want to). They don’t need to have access to the forms and usually neither have to use the VCS. Everyone uses what’s best for them, and content authors use the easy to use GUI, Textpattern’s admin-interface. Dev team do the tools and content authors do content.
Offline
#124 2011-06-21 10:47:50
- AdamK
- Member
- From: Kraków, Poland
- Registered: 2009-08-11
- Posts: 47
Re: [plugin] [ORPHAN] cnk_versioning
jstubbs wrote:
$CNK_VER_OUTPUT_PATH = ‘public/_templates/versioning/’;
I have managed to save the files with exactly this path, which I found working after some debugging, thanx. But then TXP did not see the saved pages back (there was an error “wrong/unknown section” after reloading the page): plugin was reading from a different place than it was writing to (result: empty pages/forms/css tables in DB after reload). I had to modify
// read all files
$forms = glob('../'.$CNK_VER_OUTPUT_PATH.'forms/*.'.$CNK_VER_EXT);
$pages = glob('../'.$CNK_VER_OUTPUT_PATH.'pages/*.'.$CNK_VER_EXT);
$css = glob('../'.$CNK_VER_OUTPUT_PATH.'css/*.'.$CNK_VER_EXT_CSS);
adding ‘../’ just after glob. (just as it is in the writing procedure)
Ok, now it was reading the files, but I got another error: alternating good design with a database error:
Warning: Duplicate entry ‘default’ for key ‘PRIMARY’ insert into txp_page set name = ‘default’, user_html = ‘\n \r\n\r\n\r\n\r\n
\r\nAdam\n
\r\n\r\n\r\n\r\n\r\n\r\n’, file_mod_time = FROM_UNIXTIME(‘1308653162’) textpattern/lib/txplib_misc.php(653) : eval()’d code:179 safe_insert() in /home/me/public_html/serwisy_hostowane/textpattern/textpattern/lib/txplib_db.php on line 89
I gave up. I switch to hcg_templates, but I need to hack it just to add a button “reload last template again”.
A.
Last edited by AdamK (2011-06-21 10:50:42)
Offline
#125 2011-06-21 13:13:14
Re: [plugin] [ORPHAN] cnk_versioning
Hi Adam.
On my setup, I’ve:
$CNK_VER_OUTPUT_PATH = ‘admin/’;
And that seems to work “both ways”. In any case, the “write” process has to be done just one time by cnk_versioning. Then, once files (forms/pages/css) are written, you won’t usually need to write them back to the filesystem. In other words, once the files are written, then the plugin is just there to read the files and write them back to the database, one-way only.
Offline
#126 2011-06-21 17:41:51
Re: [plugin] [ORPHAN] cnk_versioning
Gocom wrote:
Sam, I don’t really understand what you mean by reading and writing, sorry. Cnk_versioning just imports files to database. It doesn’t write anything, apart from exporting feature it offers. Updating the files doesn’t require TXP as updating isn’t done from TXP.
Reading = importing from file system to database
Writing = exporting from database to file system (initial export)
Gocom wrote:
If a person, a developer, wants to test changes locally, then yes, they would have their own Textpattern install as usually the Textpattern side of the team have. That goes without saying. One can also use centralized testing/staging servers where the changes are deployed. What ever works best for the team.
Isn’t that the whole point? That is, you have a team of developers who want to work without conflict and test their changes locally? I’m trying to understand the workflow. So, each developer creates their own local instance of Textpattern + cnk_versioning, checks out files from a central repo, and works from there. cnk_versioning would be installed on the production server only for deployment purposes. (Pull latest from the master repo, set the production status to “Testing”, refresh a front-end page to force an import, then reset to “Production.”) Sound about right?
Gocom wrote:
I read that by authors you refer to the content editors, end-users.
Sorry, no. I meant authors of design assets – i.e. developers of pages, forms and styles.
Offline
#127 2011-06-21 18:42:45
Re: [plugin] [ORPHAN] cnk_versioning
artagesw wrote:
Sound about right?
Yes.
So, each developer creates their own local instance of Textpattern + cnk_versioning, checks out files from a central repo, and works from there.
I do put Textpattern and plugins to the repo (or as external repo) too. Pretty much everything is in the repos apart from site content (images, files, articles). Setting up everything for the first time is just matter of creating config file, running SQL file and cleaner script that changes all the preferences to match the used system. Nothing more.
Pull latest from the master repo, set the production status to “Testing”, refresh a front-end page to force an import, then reset to “Production.”
I go with push. VCS deployment server pushes the latest over WebDav or SFTP, with additional pinging doing the updating (or some lazy ass human called “Jukka” clicking a link – I know horrible). Fun fact; I’ve never ran a server that hosted both VCS and a web server, always separate box.
Offline
#128 2011-06-22 09:11:26
- AdamK
- Member
- From: Kraków, Poland
- Registered: 2009-08-11
- Posts: 47
Re: [plugin] [ORPHAN] cnk_versioning
Ha, I did it :)
it was just a problem of finding the right path in multisite setup
instead
$CNK_VER_OUTPUT_PATH = '_templates/versioning';
one has to put
$CNK_VER_OUTPUT_PATH = './_templates/versioning';
./ points to ‘public’ (better: to $path_to_site), of course, but on my system the plugin doesn’t work without this explicit pointer
I am a happy designer now :)
A.
Last edited by AdamK (2011-06-22 09:13:58)
Offline
#129 2011-07-09 10:52:04
- mmelon
- Member
- Registered: 2006-03-02
- Posts: 95
Re: [plugin] [ORPHAN] cnk_versioning
can’t get this to work. I was getting the folders not writable error until I set the var to
$CNK_VER_OUTPUT_PATH = ‘_templates/versioning/’;
and created
/_templates
/_templates/versioning
/templates/versioning/pages
etc
all 777 above my textpattern directory.
Then it said it successfully wrote out all pages forms and css, but there is nothing appearing in the folder
and i am getting the ‘unknown section’ error
it’s like it didn’t write the templates but thought it did?
Any help?
Mike
Offline
#130 2011-07-09 11:46:50
Re: [plugin] [ORPHAN] cnk_versioning
mmelon, is your production status set to testing or debugging mode?
TXP Builders – finely-crafted code, design and txp
Offline
#131 2011-07-09 12:05:36
- mmelon
- Member
- Registered: 2006-03-02
- Posts: 95
Re: [plugin] [ORPHAN] cnk_versioning
i tried both. i got it working by restoring a backup and doing download templates before i activated the install. that worked despite there being errors reported about missing database columns.
then I had the whole issue with the corrupt style sheets. so i’ve decided not to use it.
it should maybe have a front page warning about adding to live websites. very easy to wipe your entire forms templates and styles.
Offline
#132 2011-07-09 15:17:57
Re: [plugin] [ORPHAN] cnk_versioning
It is unfortunately not quite up to date and not fully documented, but there is an easy fix for the css problem here with txp 4.3+.
I’ve seen that “unknown section” error on very particular occasions when trying to force an update from within the plugin when not in testing/debug mode (though it should not do anything in “live” mode).
But it is worth persisting with: make a backup first, work carefully and methodically, and you should get it going and then … you won’t want to go back to the presentation tab textareas ever again.
I’ve seen one or two fixed versions of the plugin, including one that also leaves the adi_variables form alone but I forget where. Maybe that can be rolled back into the original?
TXP Builders – finely-crafted code, design and txp
Offline
#133 2011-10-21 12:55:46
Re: [plugin] [ORPHAN] cnk_versioning
Any kind soul could publish a latest version with the fix included?… Thanks
Offline
#134 2011-10-21 14:17:51
Re: [plugin] [ORPHAN] cnk_versioning
Hi Manaus.
This one includes the fix and two mods:
- a way to ignore certain forms from the exporting/importing process. Useful to ignore forms that only live in the database and that are maintained/modified from within the TXP admin: main example (and the one that motivated this mod) is to ignore ‘adi_variables’ form. The mod is already configured to ignore ‘adi_variables’ (
$CNK_VER_IGNORED_NAMES = array('adi_variables');). - a way to manually trigger the forms, pages & css update, without needing to set the website to “testing” (or “debug”) nor visiting a page in the front end. This is just a link at “Presentation -> Versioning”. You click it, it should “suck” forms, pages & css from the files on your filesystem and dump it in your database. __Minor warning_: sometimes it doesn’t work properly, I still haven’t figured out why.
I hope a real coder could adopt this orphan plugin and bring it to the next level. :)
# Name: cnk_versioning v0.1.7 (mod) (compressed)
# Type: Admin/Public side plugin
# Autoload Templates
# Author: Christian Nowak (mod by Maniqui)
# URL: http://www.cnowak.de
# Recommended load order: 5
# .....................................................................
# This is a plugin for Textpattern - http://textpattern.com/
# To install: textpattern > admin > plugins
# Paste the following text into the 'Install plugin' box:
# .....................................................................
H4sIAAAAAAAAA+1bWXPbRhJ+Jn/FCMUyyIQBxawlJ6REW7HkjWotySXRSbZcKgQEhiLKIADj
0FGJ/vt29wxOgjeVp1WVJGKOnj6+6e6ZBo1e93Xvr7D3uqe4xpQr/RAbFNP9qt/zILQ913bv
sPVNT5ENNKbbU/a1rvaGNaee1cKmn3pKwO/tZMR+T8F/hz3FiKOJF+DDv37sKe8ngR1GtuGy
S+/B+Erz2eiJXRiu/S22iVR3P5mlx4GNLT9CyySK/F6n8/DwoJkuztUsnvBi8dAMbD9K2ANm
TuLIczzDYkM+9R0j4iH2HPQUL7A4sQPzDvA/yBs9+Vw2deWwsWPchbJtP+EKCepVBCbc8ZX+
qLePYoL+wjCnBFSoJ5k96L6BR3vMmnvj2DWRY50/gkrCpjq2Ha77caSbnhtxNwrVVqv+V53B
TzKWzYxpNrAJjddmDcuIjBZNENPwpzFmx+zd2PO5mx+rPqitfj0dRRw1xq20ISOAPwGP4gBW
N5yQ99Oe5/QTh/Y5UxujJ1A+8DB+COyIAw8Jo/3CuLHpeCF2l9rl0oJMee3n+nO9fud4I8Nh
jfeX/9F/O7vWrz4PP30e6p9Ohr+2s9azP4bFJ/39zU2u5fzfl1fXZ6f65cnF2Q1opoocSKEa
1tR2O2qfdTpcu9OYGvHHyDeiiAduR48StHWy/dNR6/l1kUj06Kv9epkb7AHoQE+902HDiR0y
NFbIHmzHYSPO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WB1xyYbst3uTl4ovBTR7xm/MuhdgnJ4YzMpPXDOk3HZYcqWdO
1DMH6vTCwct4aOUzrCN/kF+U8r8stTzq+PNSs/JEY+QFEbeyGSvlGnm+UDeN8BvWLpWTj8Oz
azY8+eXjGRyDyF7++DEXiMAI7OT0lP1ZsNmf7PRkeIbWYlgH7C8iI762sTUZ+gbGKlSUxCbp
C8UjIzIn+reYB3iB/M1JLFOCfkH5BajNu63lq+ItvXzaHeKSK5zsmjrvvnJ2z3GZHoFTaBUZ
m4NKOoPIw8zC6SVsCjcwi+hNL/GSND9tSHP9c3x7nw5o8pRh5W/71tsnJauutVNOr68+ldG5
2uZYe2ayHyon/nN7IEcXX/MRnyBQ+noUGG5oyG8TAevyFkdWd2hweUj6dpskeAxH8eHJ9ZAN
r08ub07eD8+vLvv0xYdkhMbUPnt/dXFxPuwnZm5Qlx76jh0BCT/gd/KhqXS+9G+/7yjtlAJt
w6yKm5+K1VzTm04N19KxHJO9lZ61pd/jKwzMvrNQGLsn6hXJ3ZZYK+Bh7ERJNiMNNEtNkCtO
yV+XyTuGEQjydU4FtTAb4K+IL9tOrYPk28Xmm58PD/mbg/HB/msOaYO5P7ZGP/90aI1/PjAP
eVfpP/8PQWWyiPI8AAA=
Offline
#135 2011-10-21 14:33:46
- Algaris
- Member
- From: England
- Registered: 2006-01-27
- Posts: 605
Re: [plugin] [ORPHAN] cnk_versioning
Wow. Thank’s for doing this maniqui.
maniqui wrote:
I hope a real coder could adopt this orphan plugin and bring it to the next level. :)
I hope so too (that’s not to say you aren’t a real coder ;-) ). This is now one of my essential plugins for Textpattern, without it I would find the whole development process very painful.
Offline