Keith Solomon cb584e9d3a Restore consoleLog helper and remove test stub masking production fatal
The v2 rewrite of processLogEntries() calls consoleLog(...) at two
skip branches (no id, and no deposited/withdrawn). Commit 3ebc5e2 had
removed the project helper from includes/utilities.php, leaving a
production runtime fatal ("Call to undefined function consoleLog()")
the first time a non-vault entry flowed through fetchAndStoreLogPage
-> processLogEntries in real use.

The previous test appeared to pass only because it defined a local
no-op consoleLog stub via function_exists() guard — masking the defect
behind a test fixture that never reached either skip branch.

Fix:
  - Restore the original consoleLog() helper to
    includes/utilities.php (unchanged from the pre-3ebc5e2 codebase;
    spec lists it as unchanged).
  - Remove the local consoleLog stub from
    tests/process_log_entries_test.php so the test now exercises
    the real production code path.
2026-08-03 13:34:29 -05:00

Torn Vault Tracker icon Torn Vault Tracker

PHP Version Database Deployed with FTP Deploy Action

A web-based tracking system for monitoring shared vault transactions in the Torn City MMORPG.

Description

This tool automatically tracks deposits and withdrawals from your Torn City private island vault using the official Torn API. It provides real-time balance tracking, available vault space calculations, and a transaction history display for multiple users.

Key Features:

  • 🕒 Automatic transaction synchronization via Torn API
  • 💰 Real-time balance calculations (individual & combined)
  • 📊 Color-coded transaction history (green deposits/red withdrawals)
  • 🛡️ Secure API key management
  • 📈 Vault space monitoring with individual user shares
  • 💾 SQLite database for persistent storage

Features

Core Functionality

  • Automated API polling for vault transaction logs
  • Duplicate transaction prevention
  • Responsive HTML/CSS interface
  • Error handling for API failures and database issues
  • Automatic database schema creation and history population

Financial Tracking

  • Individual user balances
  • Total vault balance calculation
  • Remaining vault space tracking (500M per user / 1B total)
  • Historical transaction records with timestamps

Installation

Requirements

  • Web server with PHP 8.1+
  • SQLite3 extension enabled
  • Write permissions for web server user

Note

If you need hosting, I recommend InfinityFree. They have a robust free hosting package that has everything you need to run this project (I run my personal copy of this project on their service).

Setup Steps

  1. Upload the project files to your web hosting. You can do this with an FTP client or by using git directly on the server (if your host supports it).

    • To use git: Clone repository to web directory (the command as written will put all files in a tvt directory):

      git clone https://github.com/yourusername/tvt.git
      
  2. Open config.php and configure the API keys and other settings.

  3. Access the project in your web browser to initialize the database and start tracking transactions. The first run will create the database and import the vault transactions for both users.

Depending on the number of transactions, this may take some time (my dev install took about 25 seconds to pull in ~2,100 transactions). The browser will refresh when the process is complete.

Configuration

Important

API keys must have "Full Access" permissions to access log endpoints.

Edit config.php to set up API access:

  • username1 and username2 should be changed to your usernames.

    const USER_KEYS = [
     'username1' => 'your_api_key_here',
     'username2' => 'partner_api_key_here'
    ];
    
  • If you want to change the number of rows per page in the transactions table (default is 15), change the ROWS_PER_PAGE constant

Usage

Access the tracker through your web browser after setup and configuration:

  • Transactions will automatically sync on page load going forward
  • Balance calculations update in real-time
  • Recent transactions display in chronological order

Contribution

We welcome contributions! Please follow these guidelines:

  • Fork the repository
  • Create feature branch (git checkout -b feature/improvement)
  • Follow existing PHP coding standards
  • Test changes thoroughly
  • Submit a pull request

Credits

Primary Author: Keith Solomon (ZarathosX75 in Torn City)

Acknowledgements

Important

Disclaimer: This project is not affiliated with or endorsed by Torn City

S
Description
No description provided
Readme
1.4 MiB
Languages
PHP 92.3%
JavaScript 5%
CSS 2.7%