Skip to main content

Module platform

Module platform 

Source
Expand description

Port of Composer\Repository\PlatformRepository: the platform packages (composer*, php*, ext-, lib-, hhvm) in Composer’s exact order, with the config.platform overrides. Probing the current PHP is done by assets/platform-probe.php (a transcription of initialize(), raw versions); normalization and its fallbacks are replayed here with the exact port of VersionParser.

Structs§

PlatformError

Constants§

COMPOSER_VERSION
Emulated Composer version and its APIs (Composer::VERSION, PluginInterface::PLUGIN_API_VERSION, Composer::RUNTIME_API_VERSION).
PLUGIN_API_VERSION
RUNTIME_API_VERSION

Functions§

check_install
install’s platform verification on the full platform repository (PlatformRepository: php, extensions, lib-* libraries, the composer-*-api packages, config.platform overrides), the way Installer::doInstall checks the lock: every platform requirement of the lock’s platform/platform-dev sections and of the wanted packages must be satisfied by a platform package’s name, or by one of its provide/replace links (lib-dom-libxml through lib-libxml, php-64bit through php).
ini_files
XdebugHandler::getAllIniFiles() from the probe’s ini entry: COMPOSER_ORIGINAL_INIS (set by a Composer restarted without xdebug) wins; else [php_ini_loaded_file()] + the trimmed scanned files.
is_platform_package
PlatformRepository::PLATFORM_PACKAGE_REGEX.
loaded_extensions
The extensions the probed PHP has loaded (extension_loaded), before any config.platform override: ext-<name> keys, lowercased.
platform_packages
The ordered list of platform packages (getPackages()), probed being the probe output and overrides config.platform.
probe
Runs the probe on the current PHP (VIVACITY_PHP or php), through a disk cache: a php process costs 30–60 ms, most of a no-op install. The cache is keyed on what the result depends on — the php binary (path, mtime, size), every ini file PHP loaded or scanned plus the scan directory, and PHPRC / PHP_INI_SCAN_DIR / XDEBUG_MODE / XDEBUG_CONFIG. VIVACITY_NO_PLATFORM_CACHE=1 bypasses it.