Textpattern Forum

You are not logged in. Register | Login | Help

#121 2011-06-21 06:27:08

Gocom
Developer
Registered: 2006-07-14
Posts: 4,471
Website

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)


Rah-plugins | What? I’m a little confused… again :-) <txp:is_god />

Offline

#122 2011-06-21 07:31:11

artagesw
Developer
From: Seattle, WA
Registered: 2007-04-29
Posts: 227
Website

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

Gocom
Developer
Registered: 2006-07-14
Posts: 4,471
Website

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.


Rah-plugins | What? I’m a little confused… again :-) <txp:is_god />

Offline

#124 2011-06-21 10:47:50

AdamK
Member
From: Kraków, Poland
Registered: 2009-08-11
Posts: 45

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

maniqui
Moderator
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 2,975
Website

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.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#126 2011-06-21 17:41:51

artagesw
Developer
From: Seattle, WA
Registered: 2007-04-29
Posts: 227
Website

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

Gocom
Developer
Registered: 2006-07-14
Posts: 4,471
Website

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.


Rah-plugins | What? I’m a little confused… again :-) <txp:is_god />

Offline

#128 2011-06-22 09:11:26

AdamK
Member
From: Kraków, Poland
Registered: 2009-08-11
Posts: 45

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: 64

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

jakob
Moderator
From: Germany
Registered: 2005-01-20
Posts: 1,895
Website

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

Board footer

Powered by FluxBB