<?php
/**
 * Arsenal Nexora 1.7.0 - Campaign Manager runner.
 * WebEngine cron selects the operational realm before including this file.
 */
try {
    if(!class_exists('Plugin\\ItemShop\\ItemShop')) return;
    $shop = new \Plugin\ItemShop\ItemShop();
    if(!$shop->campaignSchemaReady()) return;
    $result = $shop->processCampaigns(50);
    if(!empty($result['errors'])) {
        @error_log('[Arsenal Campaigns]['.$shop->getRealm().'] '.implode(' | ', array_slice($result['errors'],0,5)));
    }
} catch(Throwable $e) {
    @error_log('[Arsenal Campaigns] '.$e->getMessage());
}
