Function __global->addon_installed

Definitions

sources/global3.php

  • Check to see if an addon is installed.Will also include check database tables for addons that are hook-based, just in case filesystem and database got out of sync.For addons with no addon_registry hook can also check the database (if requested via $check_hookless).
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: bool

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$addon_name ID_TEXT No No required parameter N/A N/A The addon name
$check_hookless boolean No No False N/A N/A Whether to check addons with no addon_registry hook (it's very rare to need this)
$deep_scan boolean No No True N/A N/A Do a deep scan of the database to see if the addon is fully installed
$disabled_scan boolean No No True N/A N/A Consider whether the addon is set as disabled
$force_custom boolean No No False N/A N/A Whether to forcefully check custom even if in safe mode

Returns

  • Whether it is
  • Type: boolean
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Check to see if an addon is installed.Will also include check database tables for addons that are hook-based, just in case filesystem and database got out of sync.For addons with no addon_registry hook can also check the database (if requested via $check_hookless).
 *
 * @param  ID_TEXT $addon_name The addon name
 * @param  boolean $check_hookless Whether to check addons with no addon_registry hook (it's very rare to need this)
 * @param  boolean $deep_scan Do a deep scan of the database to see if the addon is fully installed
 * @param  boolean $disabled_scan Consider whether the addon is set as disabled
 * @param  boolean $force_custom Whether to forcefully check custom even if in safe mode
 * @return boolean Whether it is
 */

function addon_installed(string $addon_name, bool $check_hookless = false, bool $deep_scan = true, bool $disabled_scan = true, bool $force_custom = false) : bool