How to Contribute

Reporting an Issue

Bonfire uses GitHub Issue Tracking to track issues (primarily bugs and new code contributions). If you find a bug in Bonfire, this is the place to start. You will need a (free) GitHub account in order to help out.

Creating a Bug Report

If you have found a problem in Bonfire start by searching the existing issues at GitHub to make sure it hasn't already been reported. If there is not existing issue you can add a new one.

At a minimum, your issue report needs a title and a description of the problem. But that's not all, that's just the minimum. You should include a code sample, if applicable, and the steps needed to recreate. It is also recommended to include your PHP version, and operating system. The goal is to make it easy for yourself--or others--to recreate and fix the bug.

You should also assign one of the labels to the issue. For most issues, simply assigning the 'Bug' label will be all you need to do. If you have found a truly critical bug that stops the execution of the program and makes it completely unusable (as opposed to just an annoyance or part not working) you can assign the 'Critical' label to it. Please be considerate of the developers, though, and don't use this label unless it is absolutely a show stopper.

Once you've submitted your report, don't hold your breath for a fix. Unless this is flagged as a "Critical, It Won't Work At All!" type of bug, you are creating the issue in the hopes that other developers will work with you to find a fix. There is no guarantee that someone else will jump in a fix the problem for you. Creating an issue like this is mostly to help yourself start on the path of fixing the problem and for others to confirm it with a "I'm having this problem too" comment.

Submitting Feature Requests

You can submit a feature request in much the same was reporting a bug (above). This time, however, you need to make sure to add a 'Feature Request' label to the issue so that everyone can easily sort the issues.

Helping Fix Existing Issues

The next step beyond reporting issues is to help the core team resolve existing issues. If you check the Everyone's Issues list in GitHub, you're sure to find issues that already need resolving. Here's how you--regardless of your technical expertise--can help out.

Verifying Bug Reports

For starters, it helps to just verify bug reports. Can you reproduce the reported issue on your own computer? If so, you can add a comment to the issue saying that you're seeing the same thing.

If something is very vague, can you help squish it down into something specific? Maybe you can provide additional information to help reproduce a bug, or eliminate needless steps that aren't required to help demonstrate the problem.

Anything you can do to make bug reports more succinct or easier to reproduce is a help to folks trying to write code to fix those bugs--whether you end up writing the code yourself or not.

Testing Patches

You can also help out by examining pull requests that have been submitted to Bonfire via GitHub. To apply someone's changes you need to first create a dedicated branch:

$ git checkout -b testing_branch

Then you can use their remote branch to update your codebase. For example, let's say the GitHub user JohnSmith has forked and pushed to the topic branch located at https://github.com/JohnSmith/Bonfire.

$ git remote add JohnSmith git://github.com/JohnSmith/Bonfire.git
$ git pull JohnSmith topic

After applying their branch, test it out! Here are some things to think about:

  • Does the change actually work?
  • Are you happy with the tests? Can you follow what they're testing? Are there any tests missing?
  • Does it have proper documentation coverage? Should documentation elsewhere be updated?
  • Do you like the implementation? Can you think of a nicer or faster way to implement a part of their change?

Once you're happy that the pull request contains a good change, comment on the GitHub issue indicating your approval. Your comment should indicate that you like the change and what you like about it. Something like:

I like the way you've restructured that code in generate_finder_sql, much nicer. The tests look good too.

If your comment simply says "+1", then odds are that other reviewers aren't going to take it too seriously. Show that you took the time to review the pull request.

Contributing to Bonfire Documentation

Bonfire has two main sets of documentation: the Guides help you learn Bonfire, while the API is a reference.

You can help improve the guides by making them more coherent, adding missing information, correcting factual errors, fixing typos, bringing it up to date with the latest edge Bonfire. To get involved in the translation of Bonfire guides, please see Translating Bonfire Guides.

Changes are made directly within this wiki so please double-check all edits for correctness and good English. If you are a non-native English speaker, feel free to post on the forums or post an issue here on GitHub asking someone to look over your English for the portion you edited.

If you are unsure of the documentation changes, you can create an issue in the Bonfire issues tracker on GitHub.

When working with documentation, please take into account the API Documentation Guidelines and the Coding Conventions.

Contributing to the Bonfire Code

Clone the Bonfire Repository

The first thing you need to do to be able to contribute code is to clone the repository:

$ git clone git://github.com/ci-bonfire/Bonfire.git

and create a dedicated branch:

$ cd Bonfire
$ git checkout -b my_new_branch

It doesn't really matter what name you use, because this branch will only exist on your local computer.

Write Your Code

Now get busy and add or edit code. You're on your branch now, so you can write whatever you want (you can check to make sure you're on the right branch with git branch -a). But if you're planning to submit your change back for inclusion in Bonfire, keep a few things in mind:

  • Get the code right
  • Use Bonfire idioms and classes
  • Include tests that fail without your code, and pass with it
  • Update the documentation, the surrounding one, examples elsewhere, guides, whatever is affected by your contribution

Follow the Coding Conventions

Bonfire follows a simple set of Coding Conventions which are summarized here, but are given a more complete treatment in their own guide.

  • Spaces, not tabs, are preferred.
  • No trailing whitespace. Blank lines should not have any space.
  • Prefer && / || over AND / OR.
  • Always use brackets for foreach, if else, etc.
  • Brackets on their own lines.
  • Follow the conventions you see used in the source already.

Sanity Check

You should not be the only person who looks at the code before you submit it. You know at least one other developer, right? Show them what you're doing and ask for feedback. Doing this in private before you push a patch out publicly is the "smoke test" for a patch: if you can't convince one other developer of the beauty of your code, you're unlikely to convince the core team either.

Commit Your Changes

When you're happy with the code on your computer, you need to commit the changes to git:

$ git commit -a -m "Here is a commit message on what I changed in this commit"

Update Master

It's pretty likely that other changes to master have happened while you were working. Go get them:

$ git checkout master
$ git pull

Now reapply your patch on top of the latest changes:

$ git checkout my_new_branch
$ git rebase master

No conflicts? Change still seems reasonable to you? Then move on.

Fork

Navigate to the Bonfire GitHub repository and press "Fork" in the upper right hand corner.

Add the new remote to your local repository on your local machine:

$ git remote add mine git@github.com:<your user name>/Bonfire.git

Push to your remote:

$ git push mine my_new_branch

Issue a Pull Request

Navigate to the Bonfire repository you just pushed to (e.g. https://github.com/your-user-name/Bonfire) and press "Pull Request" in the upper right hand corner.

Write your branch name in branch field (is filled with master by default) and press "Update Commit Range"

Ensure the changesets you introduced are included in the "Commits" tab and that the "Files Changed" incorporate all of your changes.

Fill in some details about your potential patch including a meaningful title. When finished, press "Send pull request." Bonfire Core will be notified about your submission.

Iterate as Necessary

It's entirely possible that the feedback you get will suggest changes. Don't get discouraged: the whole point of contributing to an active open source project is to tap into community knowledge. If people are encouraging you to tweak your code, then it's worth making the tweaks and resubmitting.

And then...think about your next contribution!

Profiler
Profiler Console 0 Load Time 12.9ms Memory Used 1.07 MB Database 4 Queries vars & Config Files 87

Console

Memory Usage

Benchmarks

1 ms Loading Time: Base Classes
8 ms Controller Execution Time ( Docs / Index )
13 ms Total Execution Time

Queries

0.0001 SELECT GET_LOCK('cc7e6b769942f78311bf4b4761f90fa702a692fe', 300) AS ci_session_lockSpeed: 0.0001 - Possible keys: - Key Used: - Type: - Rows: - Extra: No tables used
0.0021 SELECT `data` FROM `bf_ci3_sessions` WHERE `id` = 'cc7e6b769942f78311bf4b4761f90fa702a692fe'Speed: 0.0021 - Possible keys: - Key Used: - Type: - Rows: - Extra: no matching row IN const table
0.0004 SHOW TABLES FROM `remytek`
0.0003 SELECT * FROM `bf_settings`Speed: 0.0003 - Possible keys: - Key Used: - Type: ALL - Rows: 37 - Extra:
0.0029 Total Query Execution Time

Session User Data

__ci_last_regenerate 1537481813
requested_page http://remytek.com/index.php/docs/developer/how_to_contribute
previous_page http://remytek.com/index.php/docs/developer/how_to_contribute

GET DATA

No GET data exists

POST DATA

No POST data exists

URI STRING

docs/developer/how_to_contribute

CLASS/METHOD

docs/index

HTTP HEADERS

HTTP_ACCEPT text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_USER_AGENT CCBot/2.0 (https://commoncrawl.org/faq/)
HTTP_CONNECTION Keep-Alive
SERVER_PORT 80
SERVER_NAME remytek.com
REMOTE_ADDR 54.158.52.166
SERVER_SOFTWARE Apache/2.4.18 (Ubuntu)
HTTP_ACCEPT_LANGUAGE
SCRIPT_NAME /index.php
REQUEST_METHOD GET
HTTP_HOST
REMOTE_HOST
CONTENT_TYPE
SERVER_PROTOCOL HTTP/1.1
QUERY_STRING
HTTP_ACCEPT_ENCODING gzip
HTTP_X_FORWARDED_FOR

CONFIG VARIABLES

base_url http://remytek.com/
index_page index.php
uri_protocol AUTO
url_suffix
language english
charset UTF-8
enable_hooks true
subclass_prefix MY_
composer_autoload false
permitted_uri_chars a-z 0-9~%.:_-
allow_get_array true
enable_query_strings false
controller_trigger c
function_trigger m
directory_trigger d
log_threshold 0
log_path /var/www/clients/client2/web2/bonfire/application/logs/
log_file_extension
log_file_permissions 420
log_date_format Y-m-d H:i:s
error_views_path
cache_path /var/www/clients/client2/web2/bonfire/application/cache/
cache_query_string false
encryption_key a9ff89765e5fc8a4ee203140cfff9400
sess_cookie_name bf_session
sess_expiration 7200
sess_time_to_update 300
sess_match_ip false
sess_expire_on_close false
sess_encrypt_cookie false
sess_use_database false
sess_table_name sessions
sess_match_useragent true
sess_driver database
sess_regenerate_destroy false
sess_save_path ci3_sessions
cookie_prefix
cookie_domain
cookie_path /
cookie_secure false
cookie_httponly false
standardize_newlines false
global_xss_filtering false
csrf_protection true
csrf_token_name ci_csrf_token
csrf_cookie_name ci_csrf_token
csrf_expire 7200
csrf_regenerate true
csrf_exclude_uris Array ( )
compress_output false
time_reference utc
rewrite_short_tags false
proxy_ips
bonfire.installed 1
site.default_user_timezone UM8
modules_locations Array ( [/var/www/clients/client2/web2/bonfire/application/modules/] =&gt; ../../application/modules/ [/var/www/clients/client2/web2/bonfire/bonfire/modules/] =&gt; ../../bonfire/modules/ )
site.backup_folder archives/
contexts Array ( [0] =&gt; content [1] =&gt; reports [2] =&gt; settings [3] =&gt; developer )
enable_activity_logging true
sparks_path ../sparks/
template.site_path /var/www/clients/client2/web2/web/
template.theme_paths Array ( [0] =&gt; themes )
template.default_layout index
template.ajax_layout ajax
template.use_mobile_themes false
template.default_theme default/
template.admin_theme admin
template.message_template &lt;div class=&quot;alert alert-{type} alert-dismissable&quot;&gt; &lt;button type=&quot;button&quot; class=&quot;close&quot; data-dismiss=&quot;alert&quot; aria-hidden=&quot;true&quot;&gt;&amp;times;&lt;/button&gt; &lt;div&gt;{message}&lt;/div&gt; &lt;/div&gt;
template.breadcrumb_symbol :
template.parse_views false
assets.directories Array ( [base] =&gt; assets [cache] =&gt; cache [css] =&gt; css [image] =&gt; images [js] =&gt; js [module] =&gt; module )
assets.js_opener $(document).ready(function() {
assets.js_closer });
assets.css_combine false
assets.js_combine false
assets.css_minify true
assets.js_minify true
assets.encrypt_name false
assets.encode false
assets.base_folder assets
assets.asset_folders Array ( [css] =&gt; css [js] =&gt; js [image] =&gt; images )
ui.current_shortcuts Array ( [form_save] =&gt; Array ( [description] =&gt; Save any form in the admin area. [action] =&gt; $(&quot;input[name=save]&quot;).click();return false; ) [create_new] =&gt; Array ( [description] =&gt; Create a new record in the module. [action] =&gt; window.location.href=$(&quot;a#create_new&quot;).attr(&quot;href&quot;); ) [select_all] =&gt; Array ( [description] =&gt; Select all records in an index page. [action] =&gt; $(&quot;table input[type=checkbox]&quot;).click();return false; ) [delete] =&gt; Array ( [description] =&gt; Delete the record(s). [action] =&gt; $(&quot;#delete-me.btn-danger&quot;).click(); ) [module_index] =&gt; Array ( [description] =&gt; Return to the index of the current module. [action] =&gt; window.location.href=$(&quot;a#list&quot;).attr(&quot;href&quot;); ) [goto_content] =&gt; Array ( [description] =&gt; Jump to the Content context. [action] =&gt; window.location.href=$(&quot;#tb_content&quot;).attr(&quot;href&quot;) ) [goto_reports] =&gt; Array ( [description] =&gt; Jump to the Reports context. [action] =&gt; window.location.href=$(&quot;#tb_reports&quot;).attr(&quot;href&quot;) ) [goto_settings] =&gt; Array ( [description] =&gt; Jump to the Settings context. [action] =&gt; window.location.href=$(&quot;#tb_settings&quot;).attr(&quot;href&quot;) ) [goto_developer] =&gt; Array ( [description] =&gt; Jump to the Developer context. [action] =&gt; window.location.href=$(&quot;#tb_developer&quot;).attr(&quot;href&quot;) ) )
emailer.write_to_file false
migrate.auto_core false
migrate.auto_app false
commonmark.valid_drivers Array ( [0] =&gt; Parsedown [1] =&gt; Markdown [2] =&gt; MarkdownExtra [3] =&gt; LeagueCommonMark )
commonmark.driver MarkdownExtended
docs.theme docs
docs.default_group developer
docs.show_dev_docs true
docs.show_app_docs true
docs.toc_file _toc.ini
docs.permitted_environments Array ( [0] =&gt; development [1] =&gt; testing [2] =&gt; production )

Files

application.php
/var/www/clients/client2/web2/bonfire/application/config/application.php
autoload.php
/var/www/clients/client2/web2/bonfire/application/config/autoload.php
config.php
/var/www/clients/client2/web2/bonfire/application/config/config.php
constants.php
/var/www/clients/client2/web2/bonfire/application/config/constants.php
database.php
/var/www/clients/client2/web2/bonfire/application/config/database.php
events.php
/var/www/clients/client2/web2/bonfire/application/config/events.php
hooks.php
/var/www/clients/client2/web2/bonfire/application/config/hooks.php
mimes.php
/var/www/clients/client2/web2/bonfire/application/config/mimes.php
profiler.php
/var/www/clients/client2/web2/bonfire/application/config/profiler.php
routes.php
/var/www/clients/client2/web2/bonfire/application/config/routes.php
Base_Controller.php
/var/www/clients/client2/web2/bonfire/application/core/Base_Controller.php
MY_Model.php
/var/www/clients/client2/web2/bonfire/application/core/MY_Model.php
App_hooks.php
/var/www/clients/client2/web2/bonfire/application/hooks/App_hooks.php
application_lang.php
/var/www/clients/client2/web2/bonfire/application/language/english/application_lang.php
Profiler.php
/var/www/clients/client2/web2/bonfire/application/libraries/Profiler.php
Base.php
/var/www/clients/client2/web2/bonfire/application/third_party/MX/Base.php
Config.php
/var/www/clients/client2/web2/bonfire/application/third_party/MX/Config.php
Controller.php
/var/www/clients/client2/web2/bonfire/application/third_party/MX/Controller.php
Lang.php
/var/www/clients/client2/web2/bonfire/application/third_party/MX/Lang.php
Loader.php
/var/www/clients/client2/web2/bonfire/application/third_party/MX/Loader.php
Benchmark.php
/var/www/clients/client2/web2/bonfire/bonfire/ci3/core/Benchmark.php
CodeIgniter.php
/var/www/clients/client2/web2/bonfire/bonfire/ci3/core/CodeIgniter.php
Common.php
/var/www/clients/client2/web2/bonfire/bonfire/ci3/core/Common.php
Config.php
/var/www/clients/client2/web2/bonfire/bonfire/ci3/core/Config.php
Controller.php
/var/www/clients/client2/web2/bonfire/bonfire/ci3/core/Controller.php
Hooks.php
/var/www/clients/client2/web2/bonfire/bonfire/ci3/core/Hooks.php
Input.php
/var/www/clients/client2/web2/bonfire/bonfire/ci3/core/Input.php
Lang.php
/var/www/clients/client2/web2/bonfire/bonfire/ci3/core/Lang.php
Loader.php
/var/www/clients/client2/web2/bonfire/bonfire/ci3/core/Loader.php
Log.php
/var/www/clients/client2/web2/bonfire/bonfire/ci3/core/Log.php
Model.php
/var/www/clients/client2/web2/bonfire/bonfire/ci3/core/Model.php
Output.php
/var/www/clients/client2/web2/bonfire/bonfire/ci3/core/Output.php
Router.php
/var/www/clients/client2/web2/bonfire/bonfire/ci3/core/Router.php
Security.php
/var/www/clients/client2/web2/bonfire/bonfire/ci3/core/Security.php
URI.php
/var/www/clients/client2/web2/bonfire/bonfire/ci3/core/URI.php
Utf8.php
/var/www/clients/client2/web2/bonfire/bonfire/ci3/core/Utf8.php
hash.php
/var/www/clients/client2/web2/bonfire/bonfire/ci3/core/compat/hash.php
mbstring.php
/var/www/clients/client2/web2/bonfire/bonfire/ci3/core/compat/mbstring.php
password.php
/var/www/clients/client2/web2/bonfire/bonfire/ci3/core/compat/password.php
standard.php
/var/www/clients/client2/web2/bonfire/bonfire/ci3/core/compat/standard.php
DB.php
/var/www/clients/client2/web2/bonfire/bonfire/ci3/database/DB.php
DB_driver.php
/var/www/clients/client2/web2/bonfire/bonfire/ci3/database/DB_driver.php
DB_query_builder.php
/var/www/clients/client2/web2/bonfire/bonfire/ci3/database/DB_query_builder.php
DB_result.php
/var/www/clients/client2/web2/bonfire/bonfire/ci3/database/DB_result.php
mysqli_driver.php
/var/www/clients/client2/web2/bonfire/bonfire/ci3/database/drivers/mysqli/mysqli_driver.php
mysqli_result.php
/var/www/clients/client2/web2/bonfire/bonfire/ci3/database/drivers/mysqli/mysqli_result.php
directory_helper.php
/var/www/clients/client2/web2/bonfire/bonfire/ci3/helpers/directory_helper.php
form_helper.php
/var/www/clients/client2/web2/bonfire/bonfire/ci3/helpers/form_helper.php
language_helper.php
/var/www/clients/client2/web2/bonfire/bonfire/ci3/helpers/language_helper.php
url_helper.php
/var/www/clients/client2/web2/bonfire/bonfire/ci3/helpers/url_helper.php
profiler_lang.php
/var/www/clients/client2/web2/bonfire/bonfire/ci3/language/english/profiler_lang.php
Cache.php
/var/www/clients/client2/web2/bonfire/bonfire/ci3/libraries/Cache/Cache.php
Cache_dummy.php
/var/www/clients/client2/web2/bonfire/bonfire/ci3/libraries/Cache/drivers/Cache_dummy.php
Driver.php
/var/www/clients/client2/web2/bonfire/bonfire/ci3/libraries/Driver.php
Session.php
/var/www/clients/client2/web2/bonfire/bonfire/ci3/libraries/Session/Session.php
Session_driver.php
/var/www/clients/client2/web2/bonfire/bonfire/ci3/libraries/Session/Session_driver.php
Session_database_driver.php
/var/www/clients/client2/web2/bonfire/bonfire/ci3/libraries/Session/drivers/Session_database_driver.php
BF_Lang.php
/var/www/clients/client2/web2/bonfire/bonfire/core/BF_Lang.php
BF_Loader.php
/var/www/clients/client2/web2/bonfire/bonfire/core/BF_Loader.php
BF_Model.php
/var/www/clients/client2/web2/bonfire/bonfire/core/BF_Model.php
BF_Router.php
/var/www/clients/client2/web2/bonfire/bonfire/core/BF_Router.php
BF_Security.php
/var/www/clients/client2/web2/bonfire/bonfire/core/BF_Security.php
BF_directory_helper.php
/var/www/clients/client2/web2/bonfire/bonfire/helpers/BF_directory_helper.php
BF_form_helper.php
/var/www/clients/client2/web2/bonfire/bonfire/helpers/BF_form_helper.php
application_helper.php
/var/www/clients/client2/web2/bonfire/bonfire/helpers/application_helper.php
config_file_helper.php
/var/www/clients/client2/web2/bonfire/bonfire/helpers/config_file_helper.php
markdown_extended_helper.php
/var/www/clients/client2/web2/bonfire/bonfire/helpers/markdown_extended_helper.php
markdown_helper.php
/var/www/clients/client2/web2/bonfire/bonfire/helpers/markdown_helper.php
Assets.php
/var/www/clients/client2/web2/bonfire/bonfire/libraries/Assets.php
CommonMark.php
/var/www/clients/client2/web2/bonfire/bonfire/libraries/CommonMark.php
CommonMarkDriver.php
/var/www/clients/client2/web2/bonfire/bonfire/libraries/CommonMark/CommonMarkDriver.php
CommonMark_MarkdownExtended.php
/var/www/clients/client2/web2/bonfire/bonfire/libraries/CommonMark/drivers/CommonMark_MarkdownExtended.php
Console.php
/var/www/clients/client2/web2/bonfire/bonfire/libraries/Console.php
Events.php
/var/www/clients/client2/web2/bonfire/bonfire/libraries/Events.php
Modules.php
/var/www/clients/client2/web2/bonfire/bonfire/libraries/Modules.php
Route.php
/var/www/clients/client2/web2/bonfire/bonfire/libraries/Route.php
Template.php
/var/www/clients/client2/web2/bonfire/bonfire/libraries/Template.php
docs.php
/var/www/clients/client2/web2/bonfire/bonfire/modules/docs/config/docs.php
routes.php
/var/www/clients/client2/web2/bonfire/bonfire/modules/docs/config/routes.php
Docs.php
/var/www/clients/client2/web2/bonfire/bonfire/modules/docs/controllers/Docs.php
docs_lang.php
/var/www/clients/client2/web2/bonfire/bonfire/modules/docs/language/english/docs_lang.php
_sidebar.php
/var/www/clients/client2/web2/bonfire/bonfire/modules/docs/views/_sidebar.php
index.php
/var/www/clients/client2/web2/bonfire/bonfire/modules/docs/views/index.php
Settings_lib.php
/var/www/clients/client2/web2/bonfire/bonfire/modules/settings/libraries/Settings_lib.php
Settings_model.php
/var/www/clients/client2/web2/bonfire/bonfire/modules/settings/models/Settings_model.php
index.php
index.php
index.php
themes/docs/index.php