<?php
/**
 * Packaged runtime-profile loader.
 *
 * @package ScheduledChanges
 */

namespace ScheduledChanges\Bootstrap;

/** Loads the release-selected module profile after Composer is available. */
final class PackagedRuntimeProfile {
	/**
	 * Loads a packaged module-profile value from a release configuration file.
	 *
	 * @param string $file Configuration file path.
	 */
	public static function load( string $file ): void {
		$profile = is_readable( $file ) ? require $file : null;

		if (
			is_string( $profile )
			&& '' !== $profile
			&& ! defined( 'SCHEDULED_CHANGES_PACKAGED_MODULE_PROFILE' )
		) {
			define( 'SCHEDULED_CHANGES_PACKAGED_MODULE_PROFILE', $profile );
		}
	}

	/** Prevents instantiation. */
	private function __construct() {
	}
}
