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] --squashNote that
--squashoption 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 --squashJust use git commit as usual, and Push to this repository
git subtree push --prefix=src/[folder] [repository] [ref] --squashNote that
--squashoption 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 --squashTips: You could use
remoteto instead of[repository]property for easier to use. e.g. AddRemotefirst,git remote add -f config git@github.com:swoft-cloud/swoft-config.git, after this, you could useconfiginstead 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] --squashNote that
--squashoption 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 --squashQuick run tests for component:
// For all components
./phpunit.sh all
// For multi components
./phpunit.sh db event
// For one component
./phpunit.sh eventOnly tests an special component:
./phpunit.sh event
// use run.php
php run.php -c src/event/phpunit.xml
// filter test method name
php run.php -c src/event/phpunit.xml --filter testAddModuleOutput 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