# Features — fim

Evidence date: 2026-10-15. Source: `git@bitbucket.org:overdrive/fim.git` at `41df15e` (`master`).

No feature list existed in the repository or in Silicon Ark. Status below is from the tree and from the three-commit history. "Current" means the behaviour is on the default path or is reachable with the committed config. It does not mean the script is deployed.

## Current

| Feature | What it does | Where | Status |
|---|---|---|---|
| Cron entry | Includes config and class, reads `sesFile.txt`, switches on `$_REQUEST["Action"]` | `fim.cron.php` | Current |
| Directory walk | `scandir` recursion from the configured root | `NemoFIM::Record` | Current |
| Wildcard skip | Exact, prefix, suffix, and contains matches using `%` | `NemoFIM::in_array_wildcard` | Current |
| Audit insert | One MySQL insert per visited file or directory | `NemoFIM::Save` | Current |
| Content hash | SHA-1 of file bytes mixed with owner, mode, size, and mtime | `NemoFIM::Save` case `File` | Current |
| Directory hash | SHA-1 of relative path, owner, and mode. Contents are not hashed | `NemoFIM::Save` case `Dir` | Current |
| Permission normalisation | chmod directory `0755`, file `0644`, after the insert | `NemoFIM::iniSetPermissions` | Current |
| Run timer | Stop after `$ProcessMaxRuntime` seconds when `$processUseTimer` is `1` (committed: 5 seconds, on) | `NemoFIM::Record` | Current |
| Pause file | `sesFile.txt` stores completion flag and counter | `fim.cron.php`, `NemoFIM::Record` | Current |
| Compare | Changes, missing, and new against `sysAudit_master` | `NemoFIM::Compare` | Current |
| HTML report | Summary counts plus up to 50 rows per category | `NemoFIM::Compare` | Current |
| Email | `mail()` when the combined count is greater than 0 | `NemoFIM::Compare` | Current |
| Ignore one change or missing row | Master `strHash` set to `IGNORE` | `NemoFIM::Ignore` | Current |
| Ignore all missing | Same, with `ID=*` | `NemoFIM::Ignore` case `MISSING` | Current |
| Ignore one new row | Insert master row with hash `IGNORE` | `NemoFIM::Ignore` case `NEW` | Current |
| Update one or all changes | Copy live metadata onto the master path | `NemoFIM::Update` case `CHANGES` | Current |
| Update one or all new paths | Insert live rows into master | `NemoFIM::Update` case `NEW` | Current |
| Reset master | Truncate master and copy today's environment rows | `NemoFIM::ResetMaster` | Current |
| CLI versus web root | `argv[0]` path, or `DOCUMENT_ROOT/fim/folder_structure` | `fim.config.php` | Current |
| Fixture tree | Sample folders for a scan | `folder_structure/` | Current as data, not as logic |
| Debug print | `print_rr` of each visited path, of the pause file on compare, and of update arguments | `fim.cls.php`, `fim.cron.php` | Current |

## Completed and then replaced

| Feature | Evidence | Status |
|---|---|---|
| PHP session pause | `8e2c48d` used `session_start()`, `$_SESSION["intProcessComplete"]`, and `$_SESSION["strLastFileArrID"]`. `921e87f` removed them | Removed. Replaced by `sesFile.txt` |
| `$siteBaseURL` on report links | Assigned in `921e87f` to an American Shutters QA hostname. `41df15e` removed the assignment | Removed. Links use `$FIMBaseURL` |
| Multipart mail preamble | `41df15e` commented out the MIME boundary lines and set `Content-type: text/html` | Removed from the sent body. The boundary fragment remains on the header string |

## Present but not on the default path

| Feature | Evidence | Status |
|---|---|---|
| Counter limit | `$processUseCounter = 0`, so `$ProcessMaxCount` is not applied | Implemented, inactive in committed config |
| Pull remote audit rows | `NemoFIM::PullData` | Implemented, not called |
| Action `FIM: PULL MASTER DATA` | Empty `break` in `fim.cron.php` | Stub |
| Update of missing rows | `NemoFIM::Update` case `MISSING` is empty | Stub |
| Ignore-all for changes | No `ID=*` branch in `Ignore` case `CHANGES`. The email has no such link | Not implemented |
| Ignore-all for new rows | `Ignore` case `NEW` uses `ID` as a literal row id | Not implemented for `*` |
| Create tables on startup | DDL present, `mysqli_query` commented out | Inactive |
| Nemo mailer | `include_once("_nemo.email.cls.php")` is commented out. File is absent | Inactive |
| Schema unique key and indexes | Only inside the commented DDL | Not applied by this script |

## Planned

None found. No issue list, README, or branch describes work after `41df15e`.

## Deprecated or removed files

No file was deleted after the initial commit. `folder_structure/` is unchanged since `8e2c48d`.

## Recently changed

All of the following landed in `41df15e` (2020-04-23), the tip of `master`:

- Report links and the related `global` lines use `$FIMBaseURL` (`localhost/fim/` in config) instead of `$siteBaseURL`.
- Mail content-type is `text/html; charset=iso-8859-1`. The multipart body prefix is commented out.
- Timer exhaustion sends `header("Location: http://www.redirect.to.url.com/")` before `exit`.
- `Save()` keeps the walked path when it already contains `$siteDirectory`, and uses `realpath()` only otherwise.
- CLI invocation sets the scan root from `argv[0]` after stripping `fim.cron.php` and `fim_2.0`. Web invocation keeps `DOCUMENT_ROOT/fim/folder_structure`.
- A `print_rr($arrSession)` call moved from file-read time to the compare branch. A `print_rr("test")` call was removed.

`921e87f` (2020-04-22) is the session-to-file change described above.

## Not in git, listed on the onboarding issue

`sonar-project.properties` and `sonarqube_scan.bat` were in the scan-host directory listing and are not in `git ls-files` at `41df15e`. They are not a feature of this revision. **Unknown / Requires Confirmation.**

## Related products already in Silicon Ark

`timesheet` documents a `fim_2.0/` tree. `sawis_api` and `sawis_api_old` document `cron.fim.php` and `_nemo.fim.cls.php`. This repository uses the class name `NemoFIM` and strips `fim_2.0` from CLI paths. A byte-level comparison was not done. Treat those as related names, not as confirmed forks.
