yiisoft/yii2 — pull request #5236 by Alex-Code (2014-09-29 09:21:04+00:00)
Title: Addition of `afterPublish` callback

Addition of ```afterPublish``` callback, Will be called after all files and directories have been copied.

I needed this to simplify using CKEditor via bower with some custom plugins.
After CKEditor's files have been copied my custom plugins will be copied too.

e.g.
```
class CKEditorAsset extends \yii\web\AssetBundle
{
public $sourcePath = '@vendor/bower/ckeditor';
public $sourcePathExtra = '@common/widgets/ckeditor';
...
public function init()
{
parent::init();
$this->publishOptions['afterPublish'] = [$this, 'afterPublish'];
}

public function afterPublish($am, $dst)
{
\yii\helpers\FileHelper::copyDirectory(\Yii::getAlias($this->sourcePathExtra), $dst, [
'dirMode' => $am->dirMode,
'fileMode' => $am->fileMode,
]);
}
}
```