<?php
/**
 * WIKINDX : Bibliographic Management system.
 *
 * @see https://wikindx.sourceforge.io/ The WIKINDX SourceForge project
 *
 * @author The WIKINDX Team
 * @license https://www.isc.org/licenses/ ISC License
 */

/**
 * WIKINDX CONFIGURATION FILE
 *
 * NB. BEFORE YOU MAKE CHANGES TO THIS FILE, BACK IT UP!
 * NB. BEFORE YOU MAKE CHANGES TO THIS FILE, BACK IT UP!
 * NB. BEFORE YOU MAKE CHANGES TO THIS FILE, BACK IT UP!
 *
 * If you make changes, backup the edited file as future upgrades of WIKINDX might overwrite this file - no questions asked!
 *
 * You must follow the syntaxic rules of the PHP programming language. For example, ensure you use double quotes around string values.
 */

if (count(get_included_files()) <= 1)
{
	header('HTTP/1.1 403 Forbidden');
	die('Access forbidden.');
}

class CONFIG
{
/*****
 * START DATABASE CONFIGURATION
 *
 * WIKINDX supports only MySQL with mysqli PHP driver (WIKINDX_DB_TYPE parameter is deprecated).
 *
 * The database and permissions for accessing it must be created using your RDBMS client. WIKINDX
 * will NOT do this for you.  If unsure how to do this, contact your server admin. After you have
 * set up an empty database with the correct permissions (GRANT ALL), the first running of WIKINDX
 * will create the necessary database tables.
 *
 * WIKINDX uses caching in the database _cache table for lists of creators, keywords etc.  If you have a large
 * database, you may get SQL errors as WIKINDX attempts to write these cache data.  You will need to increase
 * max_allowed_packet in my.cnf and restart the MySQL server.
 *
 */

/**
 * Name of the MariaDB/MySQL host server (case-insensitive)
 *
 * Host on which the MariaDB/MySQL Relational Database management system (RDBMS) is running.
 * Usually localhost if the web server and the DBMS are hosted on the same server.
 *
 * If your DB server uses persistent mode, then you should set something
 * like p:localhost where localhost is the host name.
 *
 * If your DB server is on a non-standard port (not 3306), then you should set something
 * like localhost:xxxx where localhost is the host name
 * and 'xxxx' is the port.
 *
 * If your DB server uses a custom socket, then you should set something
 * like localhost:xxxx where localhost is the host name
 * and 'xxxx' is the socket path (e.g. /tmp/mysql8.sock).
 *
 * You can combine persistent mode and a custom port or a socket,
 * but not a custom port and a socket (e.g. p:localhost:xxxx).
 *
 * WIKINDX use only the first four parameters of the mysqli class constructor.
 * @see https://www.php.net/manual/en/mysqli.construct.php
 *
 * @global string WIKINDX_DB_HOST Default is "localhost"
 */
public string $WIKINDX_DB_HOST = %%WIKINDX_DB_HOST%%;

/**
 * Name of the MariaDB/MySQL database (case-sensitive)
 *
 * MUST be a lowercase word of 64 characters max.
 * SHOULD be in ASCII only without special characters.
 *
 * @see https://dev.mysql.com/doc/mysql-reslimits-excerpt/5.6/en/identifier-length.html
 *
 * @global string WIKINDX_DB Default is "wikindx"
 */
public string $WIKINDX_DB = %%WIKINDX_DB%%;

/**
 * Username required to connect to and open the database (case-sensitive)
 *
 * SHOULD be in ASCII only without special characters.
 *
 * @global string WIKINDX_DB_USER Default is "wikindx"
 */
public string $WIKINDX_DB_USER = %%WIKINDX_DB_USER%%;

/**
 * Password of the user required to connect to and open the database (case-sensitive)
 *
 * You SHOULD use a strong and random password of at least 16-20 characters generated with tool like:
 *
 * @see https://www.motdepasse.xyz/
 *
 * NEVER use special characters. They are a source of problems for some programs like backup tools.
 *
 * @global string WIKINDX_DB_PASSWORD Default is "wikindx"
 */
public string $WIKINDX_DB_PASSWORD = %%WIKINDX_DB_PASSWORD%%;

/*
 * END DATABASE CONFIGURATION
 **********************************************************************************/

/*****
 * START PATHS CONFIGURATION
 */

/**
 * Path auto-detection feature (for Virtual Host Apache config) (boolean)
 *
 * The auto-detection of the path installation and the base url is an experimental feature
 * which you can disable by changing this parameter to FALSE.
 *
 * If you deactivate auto-detection you must fill in the option WIKINDX_URL_BASE.
 * If you don't define this option, auto-detection is enabled by default.
 *
 * @global bool WIKINDX_PATH_AUTO_DETECTION Default is TRUE
 */
public bool $WIKINDX_PATH_AUTO_DETECTION = %%WIKINDX_PATH_AUTO_DETECTION%%;

/**
 * Base URL of WIKINDX
 *
 * If option auto-detection is disabled you must define the base URL for the WIKINDX installation.
 *
 * You have to indicate the protocol HTTP / HTTPS and remove the terminal /.
 *
 * e.g. if WIKINDX's index.php file is in /wikindx/ under the httpd/ (or similar)
 * folder on the www.myserver.com, then set the variable to http://www.myserver.com/wikindx
 * Otherwise, leave as "".
 *
 * @global string WIKINDX_URL_BASE Default is ""
 */
public string $WIKINDX_URL_BASE = %%WIKINDX_URL_BASE%%;

/*
 * END PATHS CONFIGURATION
 **********************************************************************************/

/*****
 * START PHP MEMORY AND EXECUTION CONFIGURATION
 */
 
/**
 * WIKINDX usually runs fine with the standard PHP memory limit value and standard PHP execution timeouts (max_execution_time). These 
 * values are typically 128MB and 30secs. respectively. However, some operations on large databases might require more memory and/or 
 * more execution time—these might be upgrades to the database or, especially, exporting large numbers of resources to external formats 
 * such as RTF, HTML, Endnote, bibTeX, and so on. If your error reporting is turned on (in the Admin::Configure menu), you will be 
 * notified of any cases where there is too little memory for the operation or the operation times out. If error reporting is off, you 
 * get a blank page.
 *
 * Since v6.6.0, the default values are 1GB and 60seconds. These can be changed below.
 */

/**
 * Custom value for PHP memory_limit option (interger, string, or FALSE)
 *
 * If this is FALSE, the value set in php.ini is used (typically 128M).
 * If you are unable to update php.ini's memory_limit yourself,
 * WIKINDX_MEMORY_LIMIT may be set (an integer such as 128 or 256 followed by 'M' or '-1' [unlimited]).
 *
 * @see https://www.php.net/manual/en/ini.core.php#ini.memory-limit
 * @see https://www.php.net/manual/en/faq.using.php#faq.using.shorthandbytes
 *
 * @global bool|int|string WIKINDX_MEMORY_LIMIT Default is FALSE
 */
public $WIKINDX_MEMORY_LIMIT = %%WIKINDX_MEMORY_LIMIT%%;

/**
 * Max execution time of a script/page (in seconds, or FALSE)
 *
 * If this is FALSE, the value set in php.ini is used (typically 30 seconds),
 * Otherwise the value is a positive integer number of seconds (without quotation marks).
 *
 * @see https://www.php.net/manual/en/info.configuration.php#ini.max-execution-time
 *
 * @global bool|int WIKINDX_MAX_EXECUTION_TIMEOUT Default is FALSE
 */
public $WIKINDX_MAX_EXECUTION_TIMEOUT = %%WIKINDX_MAX_EXECUTION_TIMEOUT%%;

/*
 * END PHP MEMORY AND EXECUTION CONFIGURATION
 **********************************************************************************/
}
