spindle / lib-template
composer库模板
1.0.2
2014-06-28 17:37 UTC
Requires
- php: >=5.3.2
Requires (Dev)
- apigen/apigen: *
- dg/texy: <v2.5
- nette/nette: <2.2
- pdepend/pdepend: *
- phpunit/phpunit: *
This package is not auto-updated.
Last update: 2024-09-24 02:13:43 UTC
README
这是使用Composer创建库时的模板。由于采用CC0-1.0(放弃权利),因此复制粘贴时无需特别联系或表示致谢。
安装
$ composer create-project spindle/lib-template path/to/project-dir
或者
$ git clone git://github.com/spindle/spindle-lib-template.git path/to/project-dir
$ cd path/to/project-dir
$ rm -rf .git
$ composer install
完成项目后,添加gulp。
$ sudo yum install nodejs npm $ sudo npm install -g gulp $ npm install
根据需要将gitattributes添加到git中。可以在github.com生成的zip文件内容中进行自定义。
$ mv gitattributes .gitattributes
请确定包名并编辑文件。
$ vim composer.json $ vim README.md
将phpunit.xml.dist复制到phpunit.xml,并更改设置以生成HTML覆盖率报告。另外,由于(clover的)输出在本地环境中是不需要的,因此请将其删除。
开发
单元测试
$ gulp test
PHPUnit启动并执行tests/目录下的所有测试用例。
检查
$ gulp inspect
PHP_Depend
和ApiGen
启动,并将报告输出到builds/目录。为src目录下的源代码创建API文档,并测量代码度量。
文件更改监控 & 自动测试
$ gulp server
监控src/和tests/目录下的文件写入操作,并在有任何变化时自动执行PHPUnit。此外,通过http://localhost:9000/启动Web服务器。访问此链接可以阅读生成的文档和覆盖率报告。与文件写入操作联动,如有变化则自动重新加载报告。(实时加载)