Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

remove deleted lines when storing output of apigen

  • Loading branch information...
commit dc2adcac32cbc097878d45cd694e5f202ac2f11f 1 parent 95ddaf9
@juzna authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 app/models/Generator.php
View
7 app/models/Generator.php
@@ -107,12 +107,17 @@ private function exec($cmd, &$result = null) {
echo "$cmd\n";
exec($cmd, $output, $retval);
+ $data = implode("\n", $output);
+ $data = preg_replace('~^.*\x08~m', '', $data);
+ $data = str_replace(realpath(APP_DIR . '/..'), '...', $data); // remove local paths from output
+
+
// Store results
$result = $this->db->table('result')->insert(array(
'repo_id' => $this->itemId,
'cmd' => $cmd,
'ok' => $retval == 0,
- 'output' => $data = str_replace(realpath(APP_DIR . '/..'), '...', implode("\n", $output)), // remove local paths from output,
+ 'output' => $data, // remove local paths from output,
));
return $retval == 0;
Please sign in to comment.
Something went wrong with that request. Please try again.