private function getComponents($skipCache = false)
{
$url = 'http://bower-component-list.herokuapp.com';
$componentsFilePath = Yii::getAlias('@runtime/bower-cache/components.list');
if (!$skipCache && is_file($componentsFilePath) && time() - filemtime($componentsFilePath) < 60 * 60 * 6) {
// 6 hours
$raw = file_get_contents($componentsFilePath);
} else {
$result = (new \GuzzleHttp\Client())->request('GET', $url);
$raw = $result->getBody();
FileHelper::createDirectory(dirname($componentsFilePath));
file_put_contents($componentsFilePath, $raw);
}
return Json::decode($raw);
}