<?php
/**
 * AncestorPress Core Library (ANCP Core) - bundle entry point.
 *
 * The core is an embedded, versioned PHP library bundled inside every
 * AncestorPress suite plugin (the Freemius SDK pattern). It is NOT a plugin.
 * At runtime the newest bundled version across all active suite plugins wins
 * and registers itself; it owns core schema creation/migrations and exposes
 * the core API. See spec-00-shared-core.md.
 *
 * Each bundling plugin does exactly one thing with the core: require this file.
 * This file registers THIS bundle's version with the shared loader; the loader
 * boots the highest registered version once, on plugins_loaded.
 *
 * @package AncestorPress\Core
 * @since   0.1.0
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Version of the ANCP Core bundled in THIS plugin.
 *
 * Bump on any core schema or API change. The loader compares this across all
 * bundling plugins with version_compare(); the highest wins.
 */
$ancestorpress_core_version = '0.23.0';

// The loader is a tiny, stable registry shared by all bundles. The first bundle
// to load defines it; later bundles reuse it (class_exists guard inside).
require_once __DIR__ . '/includes/class-loader.php';

// Register this bundle: version => absolute path to this bundle's core root.
AncestorPress\Core\Loader::register( $ancestorpress_core_version, __DIR__ );

// Boot the winning version once every active plugin has registered its bundle.
// All active plugin files are included before plugins_loaded fires, so by this
// point every bundle is registered and "newest wins" is decidable. Activation
// runs its own explicit boot (see the plugin activator) because the activation
// hook can fire without a fresh plugins_loaded for the activating plugin.
if ( function_exists( 'add_action' ) ) {
	add_action( 'plugins_loaded', array( 'AncestorPress\Core\Loader', 'boot' ), 1 );
}
