Documentation
¶
Overview ¶
Package xf provides utilities for XenForo installation detection and management.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrMetadataNotFound is returned when the metadata file cannot be found. ErrMetadataNotFound = errors.New("metadata not found") )
Functions ¶
func GetXenForoDir ¶
GetXenForoDir finds the XenForo root directory by traversing up from startDir. It also checks the XF_DIR environment variable as a fallback.
func UpdateMetadataVersion ¶
UpdateMetadataVersion updates the version information in the metadata.
func WriteMetadata ¶
WriteMetadata writes metadata to the metadata file.
Types ¶
type Metadata ¶
type Metadata struct {
// LicenseKey is the license key used for this installation
LicenseKey string `json:"license_key"`
// InstanceName is the Docker instance name
InstanceName string `json:"instance_name"`
// InstalledProducts tracks which products were installed
InstalledProducts []string `json:"installed_products"`
// InstalledVersion is the version that was installed
InstalledVersion string `json:"installed_version"`
// InstalledVersionID is the version ID that was installed
InstalledVersionID int `json:"installed_version_id"`
// CreatedAt is when the installation was created
CreatedAt time.Time `json:"created_at"`
// UpdatedAt is when the metadata was last updated
UpdatedAt time.Time `json:"updated_at"`
}
Metadata stores CLI-specific information about a XenForo installation. This file is created during `init` and used by `upgrade` to remember settings.
func ReadMetadata ¶
ReadMetadata reads the metadata file. Returns ErrMetadataNotFound if the file doesn't exist.
type Version ¶
type Version struct {
String string // e.g., "2.3.8"
ID int // e.g., 2030871
// contains filtered or unexported fields
}
Version represents a XenForo version with both string and ID representations.
func DetectVersion ¶
DetectVersion reads the core add-on version, checking it against src/XF.php. If the core add-on manifest is absent, it uses src/XF.php alone.
func DetectVersionFS ¶ added in v0.5.0
DetectVersionFS is DetectVersion for a filesystem rooted at the installation.
func ParseVersionID ¶
ParseVersionID converts a version ID into a Version structure.