Added sprintf to the forming shields.io request

This commit is contained in:
corpsee 2015-05-03 00:44:23 +06:00
parent 02ca67a89e
commit ea09c0f82b

View file

@ -87,12 +87,12 @@ class BuildStatusController extends \PHPCI\Controller
} }
$color = ($status == 'passing') ? 'green' : 'red'; $color = ($status == 'passing') ? 'green' : 'red';
$image = file_get_contents( $image = file_get_contents(sprintf('http://img.shields.io/badge/%s-%s-%s.svg?style=%s',
'http://img.shields.io/badge/' . $label,
$label . '-' . $status,
$status . '-' . $color,
$color . '.svg?style=' . $style $style
); ));
$this->response->disableLayout(); $this->response->disableLayout();
$this->response->setHeader('Content-Type', 'image/svg+xml'); $this->response->setHeader('Content-Type', 'image/svg+xml');