Skip to content

refactor(installer): variablize fogprogramdir through installer and derive PHP constants from it #850

@mastacontrola

Description

@mastacontrola

Background

The FOG base path /opt/fog is currently hardcoded in multiple places:

Problem

Non-standard installs (different base path) require manual edits across multiple files.
There is no single source of truth for the FOG base directory that both the shell installer
and the PHP runtime share.

Proposed Solution

  • Audit all hardcoded /opt/fog references in lib/common/functions.sh and replace with
    $fogprogramdir (already defined in config.sh)
  • Have the installer write fogprogramdir into a PHP-readable location — either the
    generated service/etc/config.php or a new packages/web/commons/fogpaths.php — as a
    define() so the PHP runtime knows the real base path
  • Update system.class.php to derive FOG_BASE_DIR from that generated define rather
    than hardcoding it, with /opt/fog as fallback if not defined
  • All other path constants (FOG_CACHE_DIR etc.) derive from FOG_BASE_DIR

Notes

Acceptance Criteria

  • fogprogramdir change in .fogsettings is fully respected by installer
  • PHP runtime derives FOG_BASE_DIR from installer-written value, not hardcoded string
  • Fresh install and upgrade paths both work on all supported distros
  • No hardcoded /opt/fog strings remain in functions.sh

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions