importer->getConfig(); $body = $message['origbody']; // Prepend the default commands. User-added commands will override the default commands. if ($config['parser']['config']['default_commands']) { $body = trim($config['parser']['config']['default_commands']) ."\n". $body; } $commands = array(); $endcommands = NULL; // Collect the commands and locate signature $lines = explode("\n", $body); for ($i = 0; $i < count($lines); $i++) { $line = trim($lines[$i]); $words = explode(' ', $line); // Look for a command line. if not present, note which line number is the boundary if (substr($words[0], -1) == ':' && !isset($endcommands)) { // Looks like a name: value pair $commands[$i] = explode(': ', $line, 2); } else { if (!isset($endcommands)) $endcommands = $i; } } $this->commands = $commands; } /** * Process parsed commands by applying / manipulating the node object. * * @param $object * Node object of the node being built for submission. */ abstract public function process(&$message, $source); }