HEX
Server: Apache
System: Linux WWW 6.1.0-40-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.153-1 (2025-09-20) x86_64
User: web11 (1011)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /var/www/apklausos/application/libraries/PluginManager/EventDocumentor.php
<?php

/**
 * This file will scan all files in the project and output an array with event names.
 */

$basePath = dirname(dirname(dirname(__FILE__)));

$i = new RecursiveDirectoryIterator($basePath);
$i2 = new RecursiveIteratorIterator($i);
$events = array();


foreach ($i2 as $file) {
    /* @var $file SplFileInfo */


    if (substr((string) $file->getFileName(), -3, 3) == 'php') {
        scanFile($file->getPathname());
    }
}

$events = array_unique($events);
sort($events);
print_r($events);

function scanFile($fileName)
{
    global $events;
    $contents = file_get_contents($fileName);

    $regex = '/(.*)new[[:space:]]+PluginEvent[[:space:]]*\([[:space:]]*[\'"]+(.*)[\'"]+/';

    $count = preg_match_all($regex, $contents, $matches);
    if ($count > 0) {
        $events = array_merge($events, $matches[2]);
    }
}