简体   繁体   中英

Create a demo of a webapp

I've got a webapp (basically a CMS) running on Apache built with PHP5/MySQL. Which would be the best practice to create a demo version on the web?

The only way I can think of is duplicating the entire database for each new user and running a cron job one or twice a day to remove those duplicates.

What these guys said is fine, just make sure you have some measures in place to flag dodgy content. If your CMS allows picture uploads then people could upload all sorts of nasties.

You could also just create a new field in the database that stores users session IDs and only display the content that the particular user has uploaded/edited. Be a little more work but safer if your worried about dodgy content being published for all to see.

I have seen the method you are talking about before, a site would create a whole new demo for you. Instead of a user for the app you would get to demo a whole new fresh version.

The way I would do it is to keep 1 copy of the code, and then in the DB connection area, have it select the appropriate DB for each demo user created. I would then run a cron job to delete old demo DB's after x amount of days

I don't think it's necessary to duplicate the entire database for each user (they should all be using the same demo account anyways). It seems that what most demo apps do is periodically restore the database to its original condition. Like every 6 hours or so all tables get cleared - something along those lines.

Most CMS demos just create 1 user (guest) and display that login information before the user gets to the demo. Then every few hours or once a day they run a cron job that restores the databases to their original condition. That way you won't need to deal with multiple logins, cloning databases, etc. A good example of this system in action is opensourcecms.com

我在其他演示中看到的是,他们仅对所有用户使用一个演示,并使用cron每天加载一次数据库的新副本。

You could also try creating a default username and password. Get the system to a state that you like then using cron flush and rebuild every so often.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM