includes/constants.php
anymore. This is not really a big problem in the most cases. However it comes to problems, when the values of said constants are used in phpBB. One example here is the log-system we have:phpBB itself currently uses the following log cases:
Code: Select all
// Log types
define('LOG_ADMIN', 0);
define('LOG_MOD', 1);
define('LOG_CRITICAL', 2);
define('LOG_USERS', 3);
to add a new log case, you currently add a new constant to the file:
Code: Select all
define('LOG_GALLERY', 4);
to the edit. This however does not work anymore, as edits should be omitted the user will not see it. Now, that alone will not break stuff. However, if you have another MOD, that uses the log system, you will get a conflict, as the number 4 is already taken.If the number 4 is already a Log of an other MOD, just use the next free number.
There are two ways to circumvent this problem:
- The MOD authors use "big" numbers, to avoid collisions. Randomly chosen this can still give you a conflict, when two MOD authors choose the same value.
- We make a system (wiki) where its written which Constant is used for what. In this case there would be a section "logs" with a table for the constants, their name, author/extension and description:
MOD authors could then apply for a key and would be given one.
Code: Select all
// Log types 0 LOG_ADMIN core 1 LOG_MOD core 2 LOG_CRITICAL core 3 LOG_USERS core 4-10 N/A core Reserved 11 LOG_GALLERY nickvergessen/gallery phpBB Gallery Log (images and albums)