Skip to content

Class layout, autoloader, translation, and logging #29

Closed

Description

@somethingwithproof

Summary

One object-oriented layout for all code after the PHP check, matching plugin_smokeping.

Requirements

  • REQ-CODE-001 Classes MUST live in lib/ under the Somethingwithproof\Cloud namespace, one class per file, with no subdirectories.
  • REQ-CODE-002 The autoloader MUST be registered only after the PHP version check.
  • REQ-CODE-003 Procedural code MUST be limited to Cacti entry points (lifecycle functions, hook callbacks, page scripts, the script server function, the collector CLI), each delegating to a class.
  • REQ-CODE-004 Dependencies MUST come through constructors; classes MUST NOT read Cacti globals.
  • REQ-CODE-005 Strings MUST use the cloud text domain, and the POT file MUST be regenerated when strings change.
  • REQ-CODE-006 Logging MUST use cacti_log() with the CLOUD tag and MUST NOT include secrets.
  • REQ-CODE-007 The release archive MUST contain no Composer runtime dependencies and nothing under vendor/.

Acceptance criteria

  • PHPStan passes on lib/ with Cacti core on its scan path.
  • A source rule test fails on globals or SQL outside repositories.

References

Dependencies

Activity

  1. somethingwithproof commented on Nov 15, 2026

    @somethingwithproof
    OwnerAuthor

    Done in #81 (merged as b3730b1).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions