0

I am currently in the final stages of creating a PHP application which I intend to sell as a hosted application.

The apps is effectively a file manager and does not reply on any DB.

My question is, what would be the best way to go about making this apps hosted.

My initial idea was to have a ZIP file containing the files of the hosted app, then when a user signed up this zip would be extracted to their user folder ( http://domain.com/username ), and the config file within this directory would then be editied to reflect their settings.

Is this overkill? If there more practical ways of doing this?

Any help / suggestions would be much appreciated.

Thanks.

DaveE
  • 1,643
  • 2
  • 16
  • 29
  • 1
    how come you aren't using the same codebase and handling user registration/access? – Jacob Feb 13 '11 at 23:51
  • 2
    Can you clarify what you mean by "hosted app"? You mean Software as a Service? People pay you to use your service on your server, and you want to know how to customize for an individual user? – deceze Feb 13 '11 at 23:51
  • Sorry I didn't explain it better. @Jacob - The app deals with user uploaded files so giving every user there own directory seemed like the way to go. @deceze - Yes, I mean software as a service. My plan was to duplicate all the PHP file required for the app into each new users designated folder (i.e http://domain.com/username). But to me copying and extracting all the files after each user registration seemed excessive. I was wondering if anyone had any experience with a case like this? – DaveE Feb 14 '11 at 00:03
  • I would concentrate more on using the same code instance, and having different user directories for the uploaded file (or handling that differently). Otherwise you'll have the exact same code for every user. – Jacob Feb 14 '11 at 00:07

2 Answers2

2

The last thing you possibly want is to accumulate a new file for each new user, much less a complete new copy of your code base. Just imagine the mess you would will get into if when you need to fix a bug and have 1000 copies of your code base floating around. It's great that your app works without a database, but that's pretty impractical in a multi-user setup.

  • Keep one copy of your code base that all users use.
  • Make that code multi-user aware and dynamically pull its settings from somewhere for each user.
  • The best solution for this somewhere is a database.
deceze
  • 510,633
  • 85
  • 743
  • 889
  • I think this is the probably the best solution. The only problem is it's going to take a lot of re-writing of the code :-|. – DaveE Feb 14 '11 at 00:12
  • @dave That's why you plan these kind of things ahead of time. Sorry. ;-) – deceze Feb 14 '11 at 00:17
  • True, but the app in question was planned as downloadable script up until 3 hours ago, so I had to think of the quickest solution to make it hostable. – DaveE Feb 14 '11 at 00:21
1

You shouldn't copy the code for every user. What you want to do is create one instance of the application, and give it the capability to handle multiple users independently. Give it a login system so that users can log in and manage/upload their files.

Jonah
  • 9,991
  • 5
  • 45
  • 79