PHP code example of mrnaeem4 / ci3-request-analysis

1. Go to this page and download the library: Download mrnaeem4/ci3-request-analysis library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mrnaeem4 / ci3-request-analysis example snippets




$config['enable_hooks']      = TRUE;
$config['composer_autoload'] = TRUE; // or absolute path to vendor/autoload.php

$hook['post_controller_constructor'] = function () {
    (new \MrNaeem\Ci3RequestAnalysis\Hooks\RequestLogHook())->before();
};



$dotenv = Dotenv\Dotenv::createUnsafeImmutable(FCPATH);
$dotenv->safeLoad();
nginx
location ~ \.php$ {
    fastcgi_param REQUEST_LOG_ENABLED true;
    # ...
}
json
{
  "log_data": {
    "timestamp": "2026-08-31T02:15:04+00:00",
    "domain": "app.example.com",
    "path": "/api/profile/update",
    "method": "POST",
    "srcip": "203.0.113.10",
    "user_agent": "Mozilla/5.0 ...",
    "query_string": "page=1",
    "headers": { "Content-Type": "application/json", ... },
    "raw_body": "{\"name\":\"User\",\"email\":\"[email protected]\",\"password\":\"***REDACTED***\"}",
    "file_count": 1,
    "file_names": ["shell.php.jpg"],
    "file_metadata": [
      {
        "original_name": "shell.php.jpg",
        "size": 20480,
        "mime_type": "image/jpeg",
        "extension": "jpg",
        "hash": "3c98...",
        "has_double_extension": true
      }
    ]
  },
  "retry_count": 0,
  "last_attempt": null,
  "created_at": "2026-08-31T02:15:04+00:00"
}