protected function execute(InputInterface $input, OutputInterface $output) { $number = $input->getOption('num'); $password = $input->getOption('pass'); $extension = $input->getOption('ext'); $user = new User($number, $password, $extension); $recipients = $input->getOption('recipient'); $recs = array(); foreach ($recipients as $recipient) { $numbers = explod("|", $recipient); $name = isset($numbers[1]) ?: ''; $recs[] = new NamedNumber($numbers[0], $name); } $coverPage = $input->getOption("coverpage"); $coverPageText = $input->getOption("coverpage-text"); $resolution = $input->getOption("resolution"); $sendTime = new \DateTime(); $sendTime->setTimezone(new \DateTimeZone('GMT')); $sendTime->setTimestamp(strtotime($input->getOption("sendtime"))); $attachments = $input->getOption("attach"); $browser = new Browser(); $faxout = new FaxOut($browser); $res = $faxout->sendFax($user, $recs, $coverPage, $coverPageText, $resolution, $sendTime, $attachments); $output->writeln($res); }
function pro($s, $lv) { if ($lv == count($GLOBALS['sep_array'])) { return proc($s); } if ($_POST['sep_pcre'] == 'on') { $a = preg_explode($GLOBALS['sep_array'][$lv], $s); $step = 2; } else { $a = explod($GLOBALS['sep_array'][$lv], $s); $step = 1; } $ct = 0; $x = count($a); for ($i = 0; $i < $x; $i += $step) { if (in_opt_range($ct, $lv, $x)) { $a[$i] = pro($a[$i], $lv + 1); } ++$ct; } if ($_POST['sep_pcre'] == 'on') { $s = implode('', $a); } else { $s = implode($GLOBALS['sep_array'][$lv], $a); } return $s; }