CI4 for Perfex CRM By Head Random • 2026-11-26 12:00 PM

Perfex CRM Module Compatibility Scanner & Auto-Quarantine Guard Guide

260.04 ms

IgniteCore protects production Perfex CRM deployments through two coordinated diagnostic engines (Ignite_core_diagnostics_suite and Ignite_core_compatibility_guard): a deterministic 0-100 Module Compatibility Scanner for PHP 8.2/8.3 static audits and a self-healing Auto-Quarantine Circuit Breaker (PerfexIncidentGuard). Whenever any Dual-Mode module throws 3 or more HTTP 500+ runtime exceptions within 300 seconds, IgniteCore automatically isolates its routes back to CodeIgniter 3 fallback and invalidates OPcache without taking the CRM offline.

How the Bounded Module Compatibility Scanner Works

Running unbounded regex scans across thousands of third-party vendor files slows down shared hosting servers and triggers PHP timeouts. To keep audits fast and deterministic inside Setup > IgniteCore > Benchmark & Compatibility, Ignite_core_diagnostics_suite scans every module folder under modules/* using strict safety bounds:

  • Bounded File Budget: Scans a maximum of 35 PHP files per module, skipping any file larger than 512 KB.
  • Directory Exclusions: Automatically skips vendor/, tests/, dist/, and system/ directories so bundled third-party libraries or test fixtures do not skew module scores.
  • Deterministic 0-100 Health Scoring: Deducts weighted points per verified static or structural finding and maps each module into one of four clear operational statuses:
Health Status Score Range / Condition Meaning for Administrators
healthy 85 - 100 Module passes PHP 8.2/8.3 static checks and contract validations with zero blocking issues
warning 60 - 84 Non-fatal deprecation patterns, session hints, or route prefix notices need review before major PHP bumps
incompatible < 60 Multiple PHP 8.2+ breaking calls, raw session interference, or malformed ignite/manifest.php contracts detected
quarantined Active Circuit Breaker Lock Dual-Mode CI4 routes were isolated after breaching the runtime exception threshold; traffic runs on CI3 fallback

The 4 Static PHP 8.2/8.3 Rules & Contract Inspections

During each scan, the Compatibility Scanner inspects source tokens and configuration files across four core static rules plus three Perfex integration checks:

Rule / Check Pattern Inspected Why It Breaks on PHP 8.2/8.3 or Dual-Kernel Recommended Remediation
Rule 1: Removed / Deprecated Functions utf8_encode, utf8_decode, strftime, gmstrftime, create_function create_function is fatal in PHP 8+; the others emit deprecations in PHP 8.2+ that corrupt JSON AJAX and PDF output Replace with mb_convert_encoding(), IntlDateFormatter, and anonymous closures
Rule 2: Deprecated ${var} Interpolation "${variable}" or "${expr}" inside double-quoted strings Deprecated since PHP 8.2 and scheduled for removal; pollutes JSON responses when display errors or logs trigger Rewrite using standard "{$variable}" syntax
Rule 3: Direct session_start() Calls Unmanaged session_start() inside module controllers or hooks Bypasses Perfex tblsessions and locks concurrent PHP session files during parallel AJAX requests Use Perfex CI3 session helpers or CI4 PerfexDatabaseSessionHandler
Rule 4: Raw $_SESSION[...] Access Direct reads/writes to PHP $_SESSION superglobals Creates state drift between CI3 tblsessions and CI4 routes, breaking cross-kernel SSO parity Read/write through Perfex session APIs or PerfexAuthService
CSRF Exclude Parity Legacy $app_csrf_exclude_uris inside application/config/my_routes.php Custom webhook exclusions in my_routes.php may diverge from module config/csrf_exclude_uris.php Mirror exclusions in config/csrf_exclude_uris.php so PerfexCsrfFilter inherits them
SDK Contract Check modules/{slug}/ignite/manifest.php schema & PSR-4 namespace check Missing schema_version => 1 or invalid controller mappings prevent clean CI4 dispatch Run php modules/ignite_core/spark ignite:manifest to validate schema
Route Prefix Overlap Dual-Mode route prefixes vs my_routes.php custom overrides Conflicting prefixes can route requests unexpectedly depending on rewrite precedence Inspect highlighted overlaps in Modules & Routes and assign distinct prefixes

The 8 Runtime Error Classification Categories

Beyond static code audits, Ignite_core_diagnostics_suite parses both CodeIgniter 4 logs (modules/ignite_core/runtime/writable/logs/log-*.log) and Perfex CI3 logs (application/logs/log-*.php). Benign HTTP 404 Page Not Found noise is intentionally filtered out so administrators only see actionable runtime faults grouped into 8 root-cause categories:

# Error Category Typical PHP / Log Signature Automated Remediation Guidance
1 PHP 8.2+ Signature Mismatch Declaration of ... must be compatible with ... Align child method parameter types and return types with parent CI4 or Perfex classes
2 PHP 8.2 Dynamic Property Creation of dynamic property ... is deprecated Declare explicit class properties or apply #[\AllowDynamicProperties] on legacy CI3 models
3 PHP 8 Strict Null/Key Access TypeError: strlen(): Argument #1 must be of type string, null given or Undefined array key Guard nullable inputs with ?? '' and array_key_exists() before string or array operations
4 Missing Database Table Table '...tbl...' doesn't exist or MySQL error 1146 Run module migrations or verify Perfex DB prefix (APP_DB_PREFIX) alignment
5 Autoload / PSR-4 Mismatch Class "Modules\...\..." not found Verify PSR-4 namespace casing matches ignite/manifest.php psr4 map and file paths
6 Cross-Kernel CSRF Mismatch 403 / CSRF verification failed on Dual-Mode POST Confirm form includes csrf_token_name or X-CSRF-TOKEN header matching csrf_cookie_name
7 Memory Exhaustion Allowed memory size of ... bytes exhausted Profile query batch sizes, avoid loading full tables into RAM, or route heavy endpoints to CI4
8 Runtime Exception Uncaught Error, Exception, or ErrorException not matching categories 1-7 Inspect attributed stack trace file/line in module_incidents.json and patch controller logic

Auto-Quarantine Circuit Breaker (PerfexIncidentGuard)

flowchart TD
    ERR["Unhandled HTTP 500+ Exception in CI4"] --> GUARD["PerfexIncidentGuard::record()"]
    GUARD --> TRACE["Stack Trace Attribution (Owning modules/{slug}/ignite/)"]
    TRACE --> CLASS["8-Category Classifier & Remediation Advice"]
    CLASS --> LOG["Persist in module_incidents.json (Max 100 Entries)"]
    LOG --> CHECK{"Auto-Quarantine ON AND<br/>>= 3 Incidents Within 300s?"}
    CHECK -->|"No"| MONITOR["Surface Warning in Admin Diagnostics Tab"]
    CHECK -->|"Yes"| QUAR["Disable Module Routes in tblignite_core_route_toggles"]
    QUAR --> REBUILD["Recompile route_manifest.php & opcache_invalidate()"]
    REBUILD --> FALLBACK["Instant Perfex CI3 Fallback + Audit Log Entry"]
    FALLBACK --> RESTORE["Admin 1-Click Restore After Module Fix"]

When a Dual-Mode module encounters an unhandled HTTP 500+ exception inside the CodeIgniter 4 kernel, Ignite_core_compatibility_guard and PerfexIncidentGuard execute an automated isolation workflow so a single buggy module never degrades the rest of your CRM:

  1. Stack Trace Attribution: PerfexIncidentGuard::record() inspects the exception backtrace to identify the owning modules/{slug}/ignite/ module directory.
  2. Incident Persistence: The attributed fault and its 8-category root-cause label are appended to modules/ignite_core/runtime/writable/module_incidents.json (bounded to the 100 most recent incidents to prevent disk bloat).
  3. Threshold Evaluation: When ignite_core_auto_quarantine is enabled (1), IgniteCore checks whether the same module has recorded >= 3 HTTP 500+ exceptions within a 300-second window.
  4. Automatic Route Isolation: Upon crossing the threshold, IgniteCore marks the module's routes as quarantined in tblignite_core_route_toggles, recompiles route_manifest.php, and calls opcache_invalidate() so the change takes effect immediately on the very next HTTP request.
  5. Instant CI3 Fallback & Self-Protection: Subsequent requests to that module's routes bypass CI4 cleanly and execute on Perfex CI3 fallback. By design, IgniteCore never quarantines ignite_core itself, preserving admin access to the Control Plane at all times.

Manual 1-Click Quarantine & Restore

Administrators retain full manual override inside Setup > IgniteCore > Benchmark & Compatibility:

  • Quarantine Now: Immediately pins any Dual-Mode module back to CI3 fallback while your team investigates a reported bug.
  • Restore Module: After deploying a patch, click Restore to clear the quarantine lock, re-enable the module's CI4 routes in tblignite_core_route_toggles, and rebuild the OPcache route manifest.

Frequently Asked Questions

Does the Compatibility Scanner slow down my live Perfex CRM site? No. Scans run on demand from the Admin Control Plane (never on frontend or API requests) and enforce strict bounds of 35 PHP files per module (<= 512 KB per file) while skipping vendor/, tests/, dist/, and system/.

What happens to customer data when Auto-Quarantine isolates a module? Nothing is lost. Auto-Quarantine only toggles CI4 route routing back to Perfex CI3 fallback in tblignite_core_route_toggles and invalidates route_manifest.php in OPcache. All MySQL tables and uploaded assets remain intact.

Can Auto-Quarantine ever lock administrators out of IgniteCore itself? No. PerfexIncidentGuard enforces a hard guard that never quarantines ignite_core itself, ensuring Setup > IgniteCore and emergency recovery controls stay accessible.

Why does the log parser ignore 404 errors? Bot scans and broken external links generate frequent HTTP 404 entries in framework logs. Filtering out benign 404s prevents false positives and keeps the 8 error categories focused strictly on code, database, CSRF, and PHP 8.2+ runtime faults.

Related Guides

HeadRandom Perfex CRM Engineering

Need a Custom Perfex CRM Module, Bug Fix, or CodeIgniter 4 Upgrade?

Avoid broken updates, PHP 8.2-8.4 errors, and risky core edits. HeadRandom provides custom Perfex CRM module development, upgrade, and bug-fixing services for any third-party or custom module on your Perfex CRM installation, plus upgrading Perfex CRM from CodeIgniter 3 to CodeIgniter 4 via IgniteCore for Perfex CRM.

Build, Upgrade & Fix Any Perfex CRM Module

Develop new custom modules from scratch, patch bugs or hook conflicts on existing client modules, and update legacy code for clean PHP 8.2-8.4 compatibility with zero core file hacks. View Perfex CRM module development scope.

CodeIgniter 3 to CodeIgniter 4 via IgniteCore

Migrate your Perfex CRM runtime to CodeIgniter 4 (4.7.6) using IgniteCore for Perfex CRM (independent module by HeadRandom) with Dual-Mode CI3 fallback, 32% to 75% lower latency, 50% less RAM, and custom CI4 porting for third-party modules. See CI3 to CI4 upgrade options.

40+ Commercial Modules Published100% Zero Core File Edits0 High Security Audit GateTransparent Pricing from $39

Combine 2+ HeadRandom services (Custom Module, IgniteCore CI4 Upgrade, or Website Care) to save 30% automatically.