Jump to content

Check in/Check out for multiple user CMS system


rich1983

Recommended Posts

Hello,

I have recently started a CMS project which allows users to create custom flash movies for a training system.  This uses a flash based back end, where users can design the look of the training.  This is sent to php files, which then query a mySQL database which then stores the content.  The content is then outputted in xml format and generates the content of the flash movies.

I know how I plan to implement the above areas.  However the system will have multiple training documents and multiple users.  I can see a problem where 2 or more users are using the system to update a particular section of the training.  Read/write conflicts would occur if one user decides they wish to update a part which being updated by another user.  For example, training could be overwritten by a user, or the system could crash if both users try and save at the same time or when another user is editing a section, etc.

I thought using a check in/check out system would solve this.  For example, a user would select a training they wish to edit, locking out it from all other users.  Then when they have finished editing it, it would be unlocked and available to all users again.  My knowledge of file handling and this area in general is limited.

Does anyone have any thoughts or suggestions on how best to implement something like this?  I have also looked at fopen and fwrite, but I am not sure these are of any use for what I want to achieve.

Thank you

Richard
Link to comment
Share on other sites


Hey Richard,

Why not just put an "is_locked TINYINT(1) NOT NULL" column in your mySQL database?  When an upload begins, it first checks that value, and gives an error if it's 1.  Otherwise, it'll set the value to 1 locking out all other users, and once the upload is complete, puts it back to 0.

Matt
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.