sqd/phpgists
Composer 安装命令:
composer require sqd/phpgists
包简介
Set of php functions and tools to help with CCN projects
README 文档
README
This is a set of PHP functions and tools to help build my PHP projects.
run a phpunit test
You can install phpunit globally with composer global require phpunit.
Once it's installed, run something like : phpunit .\tests\ArrayTest.php to run the ArrayTest tests for example.
Configure debugging with vscode and xdebug
On Windows
- download xdebug and place in your php ext directory (where there are a lot of php_xxx.dll files)
- in your php.ini add the following lines (you can change the port if you want)
zend_extension=[absolute path to your php_xdebug.dll]
xdebug.remote_enable=1
xdebug.remote_autostart = 1
xdebug.remote_port=9900
xdebug.remote_log=[choose an absolute path to xdebug.log]
To debug a script, no need to use xdebug, just use the default vscode script config
On Linux
sudo apt-get install php-xdebug- add the following lines in /etc/php/7.x/mods-available/xdebug.ini
xdebug.show_error_trace = 1
xdebug.remote_enable=1
xdebug.remote_autostart = 1
sudo service apache2 restart
How to use XDebug
- check that xdebug is ok by running
php -i | grep xdebug - in vscode configure xdebug on port 9900 (the one you put in php.ini)
To debug something with xdebug (typically a phpunit test):
- place a breakpoint somewhere
- run the xdebug listener in vscode
- run the command you want like
phpunit ./tests/ArrayTest.php - if you want to run only some functions, in the test file, add a
--filter patternargument in the phpunit command line
Documentation
Install phpDocumentor on Windows
- download the phpdoc.phar from the phpDocumentor website and add it to your PATH
- create in the same folder as phpdoc.phar, a phpdoc.cmd with this line :
@php "%~dp0phpdoc.phar" %*)
Generate the HTML doc
- cd in the project and run
phpdoc.cmd -d ./src -t ./docs
Tools
There are some useful tools to help developping this module for example :
php ./tools/main.php create_test Arrayto create a new test file to test the functions in file 'Array.php'
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2019-11-06