Download the PHP package vhall/php-coverage without Composer

On this page you can find all versions of the php package vhall/php-coverage. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-coverage

package clone by https://github.com/woojean/PHPCoverage couse of composer do not work

PHPCoverage说明文档

PHPCoverage是一款基于xdebug实现的PHP代码覆盖率统计工具,可以方便地对PHP项目的代码覆盖率情况进行统计。

使用

PHPCoverage的使用非常简单,在下载了PHPCoverage的项目代码至本地后,只需在项目的主入口处(通常是项目的index.php文件的开头处)引用插桩文件,并添加插桩代码即可。

插桩代码的示例如下:

index.php文件开头处

参数说明:
log_dir

log_dir应该是一个PHP具有写权限的目录的路径(绝对路径),用于生成覆盖率统计文件及最终的覆盖率报告

ignore_file

ignore_file用于指定需要忽略掉的文件,比如第三方的代码、框架文件以及其他不想关注的文件。 该文件使用PHP数组描述,在PHPCoverage项目的ignores文件夹中包含一个示例文件example.ignore,内容如下:

is_repeat

is_repeat可以指定为ture或false,用于控制是否进行叠加测试。 当is_repeat为false时,将不进行叠加测试,这意味着每次开始执行测试之前,都会清空log_dir目录中的所有文件(即之前的测试记录)。 当is_repeat为true时,将进行叠加测试,这意味着多次测试生成的文件将会被保留,并最终进行合并分析。 如果想对单次PHP请求的代码覆盖率情况进行统计,应该将is_repeat设为false。 如果想要统计多次代码执行累计的代码覆盖率情况,则应该讲is_repeat设为true。 也可以手工清除log_dir中的内容以保证之前的测试结果不会被之后的测试一起统计。

报告说明:

当测试结束后,会在插桩时指定的log_dir目录下生成覆盖率统计文件和报告文件,其中index.html文件为报告的入口文件:

image

打开index.html文件后,内容如下:

image

文件顶部为本次测试的总体统计信息:

image

文件左侧为本次测试覆盖到的所有文件的列表(不含在ignore_file忽略的文件),点击文件列表中的任意文件,将在右侧展示该文件的覆盖情况。

其中灰色的行为不可执行代码:

image

其中淡黄色的行为可执行代码但未覆盖的代码:

image

绿色的行为被覆盖的可执行代码:

image

同时,在左侧文件列表中,针对不同的代码覆盖程度,也给出了不同颜色区分的标记:

image

通过Composer安装使用

Composer包名:

woojean/php-coverage

插桩代码的示例如下:

index.php文件开头处

参数配置及说明见上文。


All versions of php-coverage with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package vhall/php-coverage contains the following files

Loading the files please wait ....