TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 02-19-2008, 12:55 PM   #1 (permalink)
The Contributor
 
flyingbuddha's Avatar
 
Join Date: Jan 2008
Location: Birmingham, UK
Posts: 60
Thanks: 10
flyingbuddha is on a distinguished road
Help Versioning design patterns

Hey all,

I'm about to start developing a cms in actionscript 3 (in order to learn the language), one of the features that I'd like to learn more about prior to starting my personal project is design patterns for versioning (i.e. cvs,subversion, etc.)

I'm not so interested in the actual code, more the algorithm's and best practices.

I've created one in the past in php that stores the intended query to be executed and a viewable version of changes into an 'approval' table (using mysql), if this gets approved then the query is fired (such as insert/update/delete), but it felt a bit messy - someone could come along between one person's changes, edit and submit an old version with their changes.

I'm looking for really simple ideas, nothing as complex as subversion,etc. All data will be stored in a db (again, not code-specific), and I'd need to be able to roll back, store drafts, etc.

I realise this can be a bit of a dry subject, but really would appreciate feedback :)
__________________
Pro. Geek
http://www.mikeholloway.co.uk
flyingbuddha is offline  
Reply With Quote
Old 02-19-2008, 04:40 PM   #2 (permalink)
The Wanderer
 
Join Date: Feb 2008
Location: Blackpool, England
Posts: 16
Thanks: 2
Andrial12 is on a distinguished road
Default

To be honest I think storing queries inside a table is never a good idea.

The problem is scaleabilty. Once you have all these 'too be updated' records stored, what happens in the future if you need to use somthing such as mysql_insert_id(), add another column or like you suggest some one could submit an old version.

What you could try is using a temporary table which has identical columns to your main table. Once you approve the article or what ever. You can issue a query that copies the row to your main table.

Sounds like an interesting idea that your on here.
Andrial12 is offline  
Reply With Quote
Old 02-19-2008, 05:23 PM   #3 (permalink)
The Contributor
 
flyingbuddha's Avatar
 
Join Date: Jan 2008
Location: Birmingham, UK
Posts: 60
Thanks: 10
flyingbuddha is on a distinguished road
Default

Hey Andrial,

Thanks for the reply, totally agree with the scalability problem.
Not too keen on the temporary table idea as that will mean I'd have to have loads of temp. tables per project.

I'm going along these lines at the moment (hope you can understand my fragmented thoughts)

versions
--------
version_id
table
primary_id (of table)
data
title
description
tags
created


workflow:
Code:
workarea    |   staging area    |   live
--------------------------------------------------------
load version    store version       copy version to live
snapshots
---------
snapshot_id
title
description
file (complete dump of database, physical file)
created

- before restore of db:
"their has been x submissions since last snapshot"

- snapshot's can be automated by user defined time period
__________________
Pro. Geek
http://www.mikeholloway.co.uk
flyingbuddha is offline  
Reply With Quote
Old 02-19-2008, 05:24 PM   #4 (permalink)
The Contributor
 
flyingbuddha's Avatar
 
Join Date: Jan 2008
Location: Birmingham, UK
Posts: 60
Thanks: 10
flyingbuddha is on a distinguished road
Default

Credit where credit's due, this link helped a lot:
CMS Version Control
__________________
Pro. Geek
http://www.mikeholloway.co.uk
flyingbuddha is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 04:41 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design