PhoenixKit.System.Dependencies (phoenix_kit v2.52.2)

Copy Markdown View Source

System dependency checker for PhoenixKit.

Probes for the external programs PhoenixKit shells out to (ImageMagick, FFmpeg, Poppler); external_tools/0 lists them all. Results are cached to avoid repeated system calls.

Summary

Types

One external program and whether it was found.

Functions

Check if FFmpeg is installed and available.

Check if FFmpeg is installed (cached version).

Check if ImageMagick is installed and available.

Check if ImageMagick is installed (cached version).

Check if Poppler (pdftoppm/pdfinfo) is installed and available.

Check if Poppler is installed (cached version).

Clear the dependency check cache.

Every external program PhoenixKit uses, each with its detected status: {:ok, version} (the bare version number, or the first line of the version output when no number is found) or {:error, :not_installed}.

Types

tool()

@type tool() :: %{
  id: atom(),
  name: String.t(),
  command: String.t(),
  used_for: atom(),
  status: {:ok, String.t()} | {:error, :not_installed}
}

One external program and whether it was found.

Functions

check_ffmpeg()

Check if FFmpeg is installed and available.

Returns:

  • {:ok, version} - FFmpeg is installed with version string
  • {:error, :not_installed} - FFmpeg not found
  • {:error, reason} - Other error occurred

check_ffmpeg_cached()

Check if FFmpeg is installed (cached version).

Returns the cached result if available, otherwise probes system.

check_imagemagick()

Check if ImageMagick is installed and available.

Returns:

  • {:ok, version} - ImageMagick is installed with version string
  • {:error, :not_installed} - ImageMagick not found
  • {:error, reason} - Other error occurred

check_imagemagick_cached()

Check if ImageMagick is installed (cached version).

Returns the cached result if available, otherwise probes system.

check_poppler()

Check if Poppler (pdftoppm/pdfinfo) is installed and available.

Returns:

  • {:ok, version} - Poppler is installed with version string
  • {:error, :not_installed} - Poppler not found
  • {:error, reason} - Other error occurred

check_poppler_cached()

Check if Poppler is installed (cached version).

Returns the cached result if available, otherwise probes system.

clear_cache()

Clear the dependency check cache.

Useful for testing or when you know system dependencies have changed.

external_tools()

@spec external_tools() :: [tool()]

Every external program PhoenixKit uses, each with its detected status: {:ok, version} (the bare version number, or the first line of the version output when no number is found) or {:error, :not_installed}.

Cached like the single checks; clear_cache/0 forces a fresh probe.