yiisoft / yii2

Yii 2: The Fast, Secure and Professional PHP Framework
http://www.yiiframework.com
BSD 3-Clause "New" or "Revised" License
14.23k stars 6.92k forks source link

yii2-bootstap application setup #325

Closed schmunk42 closed 11 years ago

schmunk42 commented 11 years ago

Would be nice, if creating a yii2-bootstrap project could also setup permissions for runtime and www/assets and also migrations or any command provided by package.

Could be implemented with composer scripts, here's a sample implementation for Yii 1.x.

tonydspaniard commented 11 years ago

Agree with Tobias, Yiinitializr is another example (http://yiinitializr.2amigos.us) Enviado desde mi BlackBerry® de Vodafone

-----Original Message----- From: Tobias Munk notifications@github.com Date: Tue, 21 May 2013 00:19:25 To: yiisoft/yii2yii2@noreply.github.com Reply-To: yiisoft/yii2 reply@reply.github.com Subject: [yii2] yii2-bootstap application setup (#325)

Would be nice, if creating a yii2-bootstrap project could also setup permissions for runtime and www/assets and also migrations or any command provided by package.

Could be implemented with composer scripts, here's a sample implementation for Yii 1.x.


Reply to this email directly or view it on GitHub: https://github.com/yiisoft/yii2/issues/325

samdark commented 11 years ago

This one is the composer config for application template: https://github.com/yiisoft/yii2/blob/master/apps/bootstrap/composer.json

@schmunk42 @tonydspaniard can you handle creating a pull request with code that will set permissions?

schmunk42 commented 11 years ago

@samdark For sure I can create a PR for this, but I've some questions first, maybe there are changes in Yii2 which could make the process even easier.

If we want to trigger something via composer scripts, we have to deliver it in the yii2-bootstrap package, because we don't know the exact dependency order in advance. (We get yiisoft/yii2-bootstrap before we get yiisoft/yii2!)

So I created this callback script, which can be configured in console.php which commands to run, when a certain package gets installed (or updated).

This was the only way for me in Yii 1.x to accomplish the task of running a command. But this may be improved in Yii2.

Any suggestions before I start? Eg. conventions about the command name for the root package and/or extension packages, we shouldn't have to configure every command in advance - at the end.

schmunk42 commented 11 years ago

btw: Here are the docs about composer scripts.

samdark commented 11 years ago

I think it can be just a dummy static class with a single install method. No need to use Yii for the install script itself.

qiangxue commented 11 years ago

All done.