Source of file BugzScoutLogWriterTestTask.php
Size: 0,898 Bytes - Last Modified: 2021-12-23T10:47:48+00:00
/var/www/docs.ssmods.com/process/src/code/BugzScoutLogWriterTestTask.php
1234567891011121314151617181920212223242526272829 | <?php /** */ class BugzScoutLogWriterTestTask extends BuildTask { protected $title = __CLASS__; protected $description = 'Test correct configuration by forcing an error.'; public function run($request) { $writers = SS_Log::get_writers(); print("<pre>The following log writers have been registered:" . PHP_EOL); foreach ($writers as $w) { printf(" * %s" . PHP_EOL, get_class($w)); if (get_class($w) == 'BugzScoutLogWriter') { $lw = $w; } } if ($lw) { printf('</pre><p>This task forces an error. If configured correctly, a new bug will be opened in <a href="%s">%s</a>.</p>', $lw->host(), $lw->host()); user_error('test error'); } else { print("</pre><p>No BugzScoutLogWriter instances found. Please review your setup.</p>"); } } } |