Skip to content

贡献指南(Contributing)

Dreamszhu(朱宗鑫) edited this page Dec 13, 2017 · 2 revisions

Phalcon7 是一个开源项目需要志愿者的支持。

  • 我们接受 bug 报告、新特性需求、PR 等方式的帮助。
  • 我们对项目改进作出巨大贡献的给予一定的奖励。

Bug 报告指南

为了使我们更容易复制和修复错误,请尝试将以下信息包含到您的 bug 报告中:

  • 你到底是怎么触发这个错误的?
  • 你期望得到什么
  • 究竟发生了什么?

请提供任何可能有用的信息修复错误,比如:

  • Operating System 版本
  • PHP 版本
  • Phalcon 版本
  • 一个简短的能够重现问题的脚本
  • 任何其他独特的或具体的设置

Bug Reporting Guidelines

All bug reports are welcome. However, to make it easier for us to reproduce and fix the bug, please try to include the following information to your bug report:

  • what exactly you did to trigger the bug
  • what you expected to get
  • what actually happened

Please supply any information that may be useful in fixing the bug:

  • operating system
  • PHP version
  • Phalcon version
  • a short script that reproduces the problem (please!)
  • any other information unique or specific to your setup

If you are reporting a crash, please try to build Phalcon in the debug mode and try to get the backtrace.

构建 Debug 版本(How to Build Phalcon in Debug Mode)

cd ext
phpize
./configure CFLAGS="-O0 -g3 -Wall"
make
sudo make install

生成生成回溯跟踪(How to Generate Backtrace)

To generate a meaningful backtrace, please build Phalcon in the debug mode (see above).

  1. Remove any limits you may have on core dump size from your shell: * bash/dash/sh: ulimit -c unlimited * tcsh: unlimit coredumpsize
  2. Please make sure that the directory in which you are running PHP has write permissions for the user who's running PHP.
  3. If you use Ubuntu, please make sure to stop apport: sudo service apport stop
  4. Make sure that core dumps are enabled; to do so, please run these commands (you need to be root): echo core > /proc/sys/kernel/core_pattern; echo 1 > /proc/sys/kernel/core_uses_pid
  5. Crash PHP: * PHP CGI: Simply run php with the script that crashes it * PHP Apache Module: Run httpd -X, and access the script that crashes PHP (hint: you may need to set CoreDumpDirectory)

Once PHP (or Apache) crashes, you should have the core file (it will be named core.XXXXX, where XXXXX is a number (ID of the crashed process)).

Now install gdb if you have not installed it yet (sudo apt-get install gdb for Debian based systems) and run it with the path to the PHP or Apache (whichever you used) and the core file. The command should look like this:

gdb /usr/bin/php /path/to/core

or

gdb /usr/sbin/apache2 /path/to/core

Then, at the gdb prompt, please type

bt full

and copy and paste the output to the bug report.

Use quit to exit gdb.

Thanks!
Phalcon Team