Skip to content

Commit

Permalink
+ asset-package/update-all action
Browse files Browse the repository at this point in the history
  • Loading branch information
hiqsol committed May 10, 2016
1 parent b4d5c47 commit 9499664
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
File renamed without changes.
13 changes: 11 additions & 2 deletions src/console/AssetPackageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,22 @@ public function actionUpdate($type, $name)
echo 'updated ' . $package->getHash() . ' ' . $package->getFullName() . "\n";
}

public function actionUpdateList()
public function actionUpdateList($file = STDIN)
{
while ($line = fgets(STDIN)) {
$handler = is_resource($file) ? $file : fopen($file, 'r');
while ($line = fgets($handler)) {
list($full) = preg_split('/\s+/', trim($line));
list($type, $name) = AssetPackage::splitFullName($full);
$this->actionUpdate($type, $name);
}
if (!is_resource($file)) {
fclose($handler);
}
}

public function actionUpdateAll()
{
$this->actionUpdateList(Yii::getAlias('@hiqdev/assetpackagist/config/packages.list'));
}

public function actionList()
Expand Down

0 comments on commit 9499664

Please sign in to comment.