Yii Framework Forum: Creating A Cms With Auto Update Feature - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Creating A Cms With Auto Update Feature Just like WordPress does - update to a newer version with one click Rate Topic: ***** 1 Votes

#1 User is offline   freezingbanana 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 02-March 13

Posted 02 March 2013 - 12:01 PM

Hello,

I am currently working on a CMS project that I'd like to integrate the auto-update feature, just like WordPress. I am pretty familiar with the procedure:

- Check on remote server if newer version exists
- If so, temporarily lock the app, download the zip file with code & db changes to a tmp directory
- Make a backup of the current files that will be changed
- Replace the old files with the new ones and apply db changes
- If something went wrong revent back to previous working state
- If everything is OK, delete the backup files & new zip from tmp and inform user that update is successfull.

Do you think its OK to replace Models/Controllers/Components on a live application? Is it save to give write permissions to PHP to change the app files? Isn't it kind of dangerous if it gets to the wrong hands? Also after the update is complete do I need to clear certain folders, such as cache or assets folder? (I'm sorry I'm new to Yii and I'm still learning).

I'd love to hear your ideas on this.
0

#2 User is offline   outrage 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 312
  • Joined: 10-November 09
  • Location:Blackpool, United Kingdom

Posted 02 March 2013 - 11:35 PM

View Postfreezingbanana, on 02 March 2013 - 12:01 PM, said:

Hello,

I am currently working on a CMS project that I'd like to integrate the auto-update feature, just like WordPress. I am pretty familiar with the procedure:

- Check on remote server if newer version exists
- If so, temporarily lock the app, download the zip file with code & db changes to a tmp directory
- Make a backup of the current files that will be changed
- Replace the old files with the new ones and apply db changes
- If something went wrong revent back to previous working state
- If everything is OK, delete the backup files & new zip from tmp and inform user that update is successfull.
Not sure if I'd delete this right away. maybe make this an admin task.

Do you think its OK to replace Models/Controllers/Components on a live application?
Depends on how critical the application is. I'd like to do some testing in a live environment first.

Is it save to give write permissions to PHP to change the app files?
You do this every time you allow an upload, so why not?
Isn't it kind of dangerous if it gets to the wrong hands?
It's up to you to make sure only authorised people are able to do this. Of course, you can't account for password compromises so, yes, it's dangerous.
Also after the update is complete do I need to clear certain folders, such as cache or assets folder? (I'm sorry I'm new to Yii and I'm still learning).
I would certainly clear the assets folder and ensure other static resources such as CSS, JS, images etc are renamed or somehow forced to refresh, where they are new.


I'd love to hear your ideas on this.

0

#3 User is offline   freezingbanana 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 02-March 13

Posted 03 March 2013 - 08:41 AM

Hi outrage,

of course the update task will be an admin task and before releasing an update I would test it.

Thanks for your reply!
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users