Files And Directories - mudmin/UserSpice5-Dev GitHub Wiki

File "z_us_root.php"

This file, located in the root of the UserSpice directory system, defines 3 constants:

Constant US_DOC_ROOT

Corresponds to the PHP $_SERVER['DOC_ROOT'] under normal circumstances. Points to the document root, the place in the file system where pages will be sourced from. For example, in WAMP this might be c:/wamp/www while on a Debian linux system it might be /var/www/html. It should not have a trailing slash. Use forward slashes (not back slashes) in all cases.

Constant US_ROOT_DIR

This is an absolute path to the users/ directory in UserSpice. For example, if you were running US in a directory called UserSpice in WAMP this might look like c:/wamp/www/UserSpice/users/. There should be a trailing slash here.

Constant US_URL_ROOT

This is the preferred path in the URL context to access the users/ directory in UserSpice. For example, if your actual URL to access the users/ directory was https://www.example.com/myapp/users/ then this constant would be defined as /myapp/users/. The trailing slash should appear in the definition.

These constants are determined at installation time and this file is dynamically created during the installation process.

Directory "users/core/"

Making changes to any files or directories in or under the users/core/ directory is strongly discouraged. Nearly any changes desired can be made in the local/ directory instead and when done in that way will not be over-written when installing upgrades to UserSpice.

Directory "users/local/"

If you wish to make changes to UserSpice you should make it within the directories and files under users/local/.

Typically this is done by copying a given file from users/core/ under the same path & filename in users/local/ and making your changes in this copy. Thus if you wanted to make a change to users/core/forms/admin_users.php you would copy that file to users/local/forms/admin_users.php and then make your changes to the copied file. UserSpice automatically detects the your locally modified copy and uses it instead of the core file.

In the special case of changes to the files within the directory users/core/classes you will find that these files already exist in local/core/classes with appropriate inheritance set up. To modify something you will edit the existing copies in local/core/classes and make the desired changes there.