UserSpice's page scanner watches a list of folders and auto-registers any new .php file it finds in them — that's how a brand-new page picks up its row in the pages table and stops throwing "illegal offset" errors. Out of the box it watches the project root, users/, and usersc/. If you keep your app code somewhere else, you need to tell UserSpice about it.

  1. 01 Recommended

    From the dashboard (recommended)

    The cleanest way is straight from the admin UI — no file editing, no chance of typos.

    • 1Go to Admin Dashboard → Manage → Pages.
    • 2At the top of the page, you'll see "UserSpice is currently monitoring the following folders: ..." followed by a Change button.
    • 3Click Change, type the folder path (with a trailing slash, e.g. app/), and click Monitor Folder.
    • 4Refresh the page. UserSpice immediately rescans and registers any .php files it finds.

    Heads up: the Change button only appears for users in the $master_account array, since this writes to z_us_root.php on disk. The same modal also lets you remove a folder you no longer want monitored. users/ and usersc/ can't be removed — they're treated as permanent.

  2. 02 By hand

    By editing z_us_root.php

    The dashboard's "Change" button is just a wrapper around editing one line of z_us_root.php in your project root. If you can't use the dashboard (maybe you're not a Master Account, or you're scripting a deploy), edit the file directly.

    Open z_us_root.php. The default looks like this:

    <?php
    $path=['','users/','usersc/'];

    Each entry is a folder, relative to the project root, with a trailing slash. The empty string '' means the project root itself. To also monitor an app/ folder, add it:

    <?php
    $path=['','users/','usersc/','app/'];

    Save the file. Visit Manage → Pages in the dashboard and the new folder's PHP files appear in the list automatically.

  3. 03 Gotchas

    Rules and gotchas

    • Folders must live inside the project root. You can't monitor a path above the UserSpice install — there's no ../ escape.
    • Trailing slash is required (app/, not app). The dashboard's add-folder action rejects entries without one.
    • The folder must already exist on disk before you add it. UserSpice verifies the path before writing the change.
    • users/ and usersc/ are permanent. The remove-folder action refuses to take them out of the list.
    • Use securePage() in a folder that's not monitored? The page scanner deletes its row on the next sweep, which breaks the permission check. Always add the folder before you start writing protected pages there.