User:Cakemix/Scripts/PHP/CommandRenderNew

<?php

$settingFile = file("C:\PHP5\data\system\settings.ini"); foreach ($settingFile as $v) { if (substr($v, 0, 8) == "aliases.") { $al = preg_split("/=/", substr($v, 8)); if ($aliases[trim($al[1])]) $aliases[trim($al[1])] = strtoupper($aliases[trim($al[1])] . ", " . ucfirst(trim($al[0]))); else $aliases[trim($al[1])] = strtoupper(trim($al[0])); } } foreach ($settingFile as $value) { if (substr($value, 0, 14) == "plugins.loaded") { $p = array(trim(substr($value, strpos($value, "=") + 1)), "plug" . trim(substr($value, strpos($value, "=") + 1)) . ".php"); include("C:/php5/plugins/" . $p[1]); $refClass = new ReflectionClass('plug' . $p[0]); foreach ($refClass->getMethods as $refMethod) { $refName = strtolower($refMethod->getName); if ((substr($refName, 0, 2) == 'on') && (substr($refName, 2, 7) == 'command' && strlen($refName) > 9)) { $command[] = $refMethod->getName; $CommandArgs[$refMethod->getName]["CommandName"] = strtoupper(substr($refMethod->getName, 9)); foreach ($refMethod->getParameters as $refParam) { if ($refParam->getName != "event" && $refParam->getName != "dh") { if ($refParam->isDefaultValueAvailable) { if (is_array($refParam->getDefaultValue)) { $CommandArgs[$refMethod->getName][$refParam->getName] = implode(", ", $refParam->getDefaultValue); } else { $CommandArgs[$refMethod->getName][$refParam->getName] = $refParam->getDefaultValue; }                       } else { $CommandArgs[$refMethod->getName][$refParam->getName] = null; }                   }                }            }        }        foreach ($command as $c) { $c = ($CommandArgs[$c]); $data[] = ""; }   } } $data = array_unique($data); sort($data); print_r($data);