This repository is used to manage all swoft components.
All components will NOT be modified in the original repository of component, SHOULD ALWAYS be modified in this repository, also commit and push to this repository, and then @swoft-bot would sync changes to the original repository of component by git subtree push
, notice that this action needs triggered by the repositories owner.
git subtree add --prefix=src/[folder] [repository] [ref] --squash
Note that
--squash
option is required.
e.g. Add swoft/config component as a Sub Repository,
git subtree add --prefix=src/config git@github.com:swoft-cloud/swoft-config master --squash
Just use git commit
as usual, and Push to this repository
git subtree push --prefix=src/[folder] [repository] [ref] --squash
Note that
--squash
option is required.
e.g. Add swoft/config component as a Sub Repository
git subtree push --prefix=src/config git@github.com:swoft-cloud/swoft-config master --squash
Tips: You could use
remote
to instead of[repository]
property for easier to use. e.g. AddRemote
first,git remote add -f config git@github.com:swoft-cloud/swoft-config.git
, after this, you could useconfig
instead of[repository]
, for examplegit subtree push --prefix=src/config config master --squash
After Sync changes to the Original Repository of Component
, you just need to Release a new version in the original repository of component.
We do NOT suggest modifying code in the original repository, but if you do, you could use the command below to merge it.
git subtree pull --prefix=src/[folder] [repository] [ref] --squash
Note that
--squash
option is required.
e.g. Pull swoft/config repository into src/config
git subtree pull --prefix=src/config git@github.com:swoft-cloud/swoft-config master --squash
Quick run tests for component:
// For all components
./phpunit.sh all
// For multi components
./phpunit.sh db event
// For one component
./phpunit.sh event
Only tests an special component:
php run.php -c src/event/phpunit.xml
php run.php -c src/event/phpunit.xml --filter testAddModule
Output coverage data(TODO):
// output coverage. require xdebug ext
phpunit --coverage-text
// output coverage without xdebug
phpdbg -dauto_globals_jit=Off -qrr /usr/local/bin/phpunit --coverage-text
phpdbg -dauto_globals_jit=Off -qrr run.php --coverage-text -c src/event/phpunit.xml