hiqdev\assetpackagist\console\BowerPackageController::getComponents PHP Method

getComponents() private method

Gets components array from bower API.
private getComponents ( boolean $skipCache = false ) : array
$skipCache boolean whether to skip using local cache
return array
    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);
    }
BowerPackageController