Backup on logout of secondary languages

Discussions and requests related to new CMSimple features, plugins, templates etc. and how to develop.
Please don't ask for support at this forums!
Post Reply
svasti
Posts: 1659
Joined: Wed Dec 17, 2008 5:08 pm

Backup on logout of secondary languages

Post by svasti » Sat Jan 11, 2014 10:48 pm

Hi developers,

I noticed when editing text first in language A and then in language B and logging out from language B that only the language B will get a backup.

What about implementing some counter ($de_edited=false; $en_edited=false; etc.) that would be set to true when any language got editied, and that on logout the counter would trigger the backup of the edited language contents.

Would have the additional benefit, that no superfluous backup would be triggered when I log in, do something in some plugin and log out without changing the content.htm.

Plugins like "logout_nobackup" wouldn't be needed any more.

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Backup on logout of secondary languages

Post by cmb » Sun Jan 12, 2014 7:05 pm

svasti wrote:What about implementing some counter ($de_edited=false; $en_edited=false; etc.) that would be set to true when any language got editied, and that on logout the counter would trigger the backup of the edited language contents.
The counter(s) would have to be permanent, however, e.g. stored in a session variable or a file.

Another possibility would be to compare the current content file with the latest backup on logout; if they have the same contents, no backup is necessary. To keep the additional memory consumption low, we might use md5_file() to compare hashes of the files -- collisions are very rare, and even if they happen the "error" would just be a duplicate backup.

Anyway, making backups of all (modified) language contents on logout would be great.

PS: I've put it on the roadmap.
Last edited by cmb on Sun Jan 12, 2014 7:49 pm, edited 1 time in total.
Reason: added PS
Christoph M. Becker – Plugins for CMSimple_XH

svasti
Posts: 1659
Joined: Wed Dec 17, 2008 5:08 pm

Re: Backup on logout of secondary languages

Post by svasti » Mon Jan 13, 2014 12:02 am

If you don't mind I'd specify the roadmap item to: On logout: check which language content was changed and backup only that.

I like to keep real backups instead of producing duplicates, expecially if checking a website of a friend or a customer. Would be nice to be able to get rid of the plugin "Logout_nobackup".

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Backup on logout of secondary languages

Post by cmb » Mon Jan 13, 2014 1:44 pm

svasti wrote:If you don't mind I'd specify the roadmap item to: On logout: check which language content was changed and backup only that.
We might divide it into two roadmap items. :?
svasti wrote:I like to keep real backups instead of producing duplicates, expecially if checking a website of a friend or a customer. Would be nice to be able to get rid of the plugin "Logout_nobackup".
Logging out without making a backup might still be useful in some cases. OTOH this could easily be accomplished by an alternative admin menu extension or even by the user manually requesting ?logout=no_backup.
Christoph M. Becker – Plugins for CMSimple_XH

Holger
Site Admin
Posts: 3470
Joined: Mon May 19, 2008 7:10 pm
Location: Hessen, Germany

Re: Backup on logout of secondary languages

Post by Holger » Mon Jan 13, 2014 10:45 pm

cmb wrote:Another possibility would be to compare the current content file with the latest backup on logout; if they have the same contents, no backup is necessary. To keep the additional memory consumption low, we might use md5_file() to compare hashes of the files -- collisions are very rare, and even if they happen the "error" would just be a duplicate backup.

Anyway, making backups of all (modified) language contents on logout would be great.
Good idea!
+1

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Backup on logout of secondary languages

Post by cmb » Sun May 04, 2014 2:53 pm

Done (r1259-1261).
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply