X-Git-Url: http://git.pk910.de/?p=PHP-P10.git;a=blobdiff_plain;f=Uplink%2FP10Formatter.class.php;fp=Uplink%2FP10Formatter.class.php;h=d280bf212b8f09827a300c0322e6668725444272;hp=0000000000000000000000000000000000000000;hb=642e5fa114096506072cbc9ef6f16e31eecd7abf;hpb=d50b17d7f0ebc21c1c70f2ba513e0973ce9fc789 diff --git a/Uplink/P10Formatter.class.php b/Uplink/P10Formatter.class.php new file mode 100644 index 0000000..d280bf2 --- /dev/null +++ b/Uplink/P10Formatter.class.php @@ -0,0 +1,54 @@ + "PASS :%s", + "SERVER" => "SERVER %s 1 %s %s J10 %s]]] +s :%s", + "ERROR" => "ERROR :%s" + ); + + public static function formatCMD($numeric, $command, $args) { + if(array_key_exists($command, self::$commands)) { + $command = self::$commands[$command]; + $command = vsprintf($command, $args); + } else { + $command = vsprintf($command, $args); + } + return str_replace("{num}", $numeric, $command); + } +} + +?> \ No newline at end of file