The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Project structure / design
#1
Hi,
I'm wondering, what is the best/recommended structure or design for a project based on/including UserSpice. Our project will offer several web services. So, starting at the root folder I have e.g. a folder for service1, another for service2 etc. Now, I like the idea to have one UserSpice system, i.e. the users and usersc folders, e.g. located in the root folder. I'm not sure, but I think that in this case I would need a lot of additional files, e.g. an extra header.php for each service, an extra navigation.php for each service, extra custom_login_script.php. Additionally I think I would need a lot of additional logic to check where I am and then which files to choose etc. Hopefully, I'm wrong and there is a much better solution/way.
Another possibility, which came to my mind is to have an UserSpice system (the folders users and usersc) in each of the service subfolders. In this case I could clearly separate all stuff and I could have different header.php, navigation.php and all the custum stuff in the separate usersc folders. All UserSpice systems could of course access the same data base, so, for the user it looks like one system. But I'm scared about maintaining all UserSpice systems regarding patches or other changes or changes by myself.
So, would be happy to hear some good advice.
Thanks,
Sebastian
  Reply
#2
Hmmm. I'm trying to think through that. I tend to think you're right on the first idea. Put all those things as subfolders.

One of the things to remember is that userspice is really tolerant of how you organize your stuff, as long as it knows where to look. As long as that z_us_root.php file is in the root of your userspice folder, it can get to everything else via a relative path from there.

It also doesn't really make much of a difference if you use the userspice headers etc as long as the path to the init.php /helpers file is correct and you add that line that says

Code:
<?php if (!securePage($_SERVER['PHP_SELF'])){die();} ?>

Beyond that, userspice is really pretty good about keeping it all sorted out. Since 4.1 it stores the paths of the files in the database, so that gives you a ton of flexibility.

  Reply
#3
Ok, thanks for the infos. I will definitely go with the one UserSpice system and the different folders for the services. I thought again about all that, and I think now it's actually not a big problem and should work fine.
Thanks,
Sebastian
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)