-
Notifications
You must be signed in to change notification settings - Fork 0
Composer plan
It seems either we're using Yii2 as composer package in our apps or it hits us back with lots of bad stuff. Using Yii2 as a package will require some rethinking and restructuring because of the following:
- You can't have 2 composer packages in the same repo.
- There's no good/reliable way to include only some files from repo into composer package.
We're going to have the following repositories and packages:
Main development repository. Consolidates all the core issues. Includes almost everything: core framework, application templates, documentation, tests, build scripts etc.
apps
bootstrap — default app teamplate, subtree source for read-only yii2-app-bootstrap
build
docs
tests
yii — core framework, subtree for read-only yii2-core
extensions
smarty — smarty support, subtree for read-only yii2-smarty
twig - twig support, subtree for read-only yii2-twig
git subtree of yiisoft/yii2/yii repo dir.
Read only. Serves as a main yiisoft/yii2 composer package.
The reason is because there's no other way to have clean yiisoft/yii2 package w/o docs and extras.
Dependencies are the ones strictly required for the core itself, nothing more. That means nothing about Twig or Smarty in
composer.json.
Default application template. Read only. git subtree of ``yiisoft/yii2/app/bootstrap. Defines yiisoft/yii2-app-bootstrap`
composer package that depends on `yiisoft/yii2`.
In the readme we'll recommend the following way of starting development with Yii2:
curl -s http://getcomposer.org/installer | php
php composer.phar create-project yiisoft/yii-app-bootstrap path/to/install
It fully replaces yiic app so we're going to remove it.
After running the command above we have the followig structure:
assets
css
img
js
protected
vendor
yiisoft
yii2 — framework here
autoload.php — composer autoload, used from index.php
index.php
There will be multiple zips available from website:
- yii2 core only - for advanced users who don't want composer. Contents are cloned
yii-corerepo after runningcomposer install. - yii2 default - for regular users who don't want composer. Contents are cloned
yii-default-apprepo after runningcomposer install. It will be a default app with yii under protected/vendor and all other dependencies included. - Any additional application templates.
All these zips are just fallbacks for people who are afraid of composer or have problems with CLI PHP. The official way to use Yii2 is via composer.
In order to keep read-only subtree repositories in sync we need to use git subtree feature and update subtrees on commit to primary repository. In order to achieve it we need:
- Configure github hook.
- On our server use a script such as split.sh.