<?php
/**
 * Minimal vendor autoloader for the EAC CMS.
 *
 * The project ships a hand-installed copy of TCPDF (tecnickcom/tcpdf) instead of
 * a full Composer install, so this file simply loads TCPDF on demand. If the
 * project is later migrated to a real `composer install`, Composer will
 * overwrite this file with its own autoloader — no code changes needed.
 */

spl_autoload_register(function ($class) {
  // TCPDF ships as a flat class (no namespace) in tcpdf.php
  if ($class === 'TCPDF' || $class === 'TCPDF_FONTS' || $class === 'TCPDF_STATIC'
      || $class === 'TCPDF_COLORS' || $class === 'TCPDF_IMAGES' || $class === 'TCPDF_IMPORT'
      || $class === 'TCPDF_FONT_DATA' || $class === 'TCPDF_BARCODE'
      || $class === 'QRcode' || $class === 'PDF417' || $class === 'Datamatrix') {
    $main = __DIR__ . '/tecnickcom/tcpdf/tcpdf.php';
    if (is_file($main)) require_once $main;
  }
});
