Skip to content

devel_coding_style

Wojciech Rygielski edited this page Oct 6, 2015 · 1 revision

UWAGA: Ten dokument został automatycznie przekonwertowany podczas migracji Google Code -> GitHub i może zawierać błędne formatowanie.

coding rules (code format, commits)

code formatting

code should be formatted using PSR-2 coding style format. please refer to https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md note: always use 4 spaces instead tab.

database structure changes - sql alters

When you perform changes on database structure, please attach file witch sql code in directory sqlAlters (https://code.google.com/p/opencaching-pl/source/browse/#svn%2Ftrunk%2FsqlAlters). File have to be named witch date and description, example: 2014-05-24_NewCacheLog.sql. For now, changes in db on production server have to be done manually by their admins. (In future we will implement automatic db update, based on .sql files in this directory).

Follow example in 1970-01-01_ExampleSqlAlter.sql

debug tool

OC code has installed tool for debugging - kint (http://raveren.github.io/kint/) for debug a variable just simply type in code

d($variableName);

type d(1); to get stack trace. type dd($variable) to dump variable to screen and stop code executing.