[ 'host' => '127.0.0.1', 'port' => 11211, 'weight' => 0, ], ] )); /* * Optional path to unix socket file, leave '' if to not use. * If using a unix socket file, the server list is overridden. * This should be faster than using the host/port if your cache server is local. * * @example '/var/run/redis/redis.sock' * @note By default, redis and memcached do not have a socket file, you must configure them. * @note Read and write access is required to the socket file. * @default '' */ define('NN_CACHE_SOCKET_FILE', ''); /* * Timeout for connecting to cache server(s). * * @default 10 */ define('NN_CACHE_TIMEOUT', 10); /* * Memcached allows to compress the data, saving RAM at the expense of CPU time. * * @note Does nothing on redis. * @default false */ define('NN_CACHE_COMPRESSION', false); /* * Serialization is a way of converting data in PHP into strings of text which can be stored on the cache server. * * 0 - Use the PHP serializer. Recommended for most people. * 1 - [Requires igbinary] Use igbinary serializer which is faster and uses less memory, works * on Memcached / Redis / APC, read the notes below. * 2 - [Redis Only] Use no serializer. * * @note igbinary must be compiled and enabled in php.ini * @note APC/APCu: This setting is ignored, set this in php.ini with apc.serializer * @note Memcached/Redis must be compiled with igbinary support as well to use igbinary. * @note Read the igbinary page how to compile / enable. * @see https://github.com/phadej/igbinary * @default 0 * @version 3 */ define('NN_CACHE_SERIALIZER', 0); /* * Amount of time in seconds to expire data from the cache server. * The developers of NN decide what should be set as short/medium/long, depending on the type of data. * * @defaults 300/600/900 */ define('NN_CACHE_EXPIRY_SHORT', 300); define('NN_CACHE_EXPIRY_MEDIUM', 600); define('NN_CACHE_EXPIRY_LONG', 900); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////// Log Settings ////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* * Display debug messages on console or web page. * * @default false */ define('NN_DEBUG', false); /* * Log debug messages to newznab/resources/debug.log * * @default false */ define('NN_LOGGING', false); /* * var_dump missing autoloader files. * * @note Dev setting. * @default false */ define('NN_LOGAUTOLOADER', false); /* * How many log files to keep in the log folder. * * @default 20 */ define('NN_LOGGING_MAX_LOGS', 20); /* * How large can the log files be in MegaBytes before we create a new one? The old files are compressed. * * @default 30 */ define('NN_LOGGING_MAX_SIZE', 30); /* * The folder to put the log files in. Put quotes, example : '/var/log/NN/' * The default is in the NN root folder /resources/logs/ * * @example '/var/log/NN/' * @default NN_LOGS */ define('NN_LOGGING_LOG_FOLDER', NN_LOGS); /* * The name of the log file. * Must be alphanumeric (a-z 0-9) and contain no file extensions. * * @default 'newznab' */ define('NN_LOGGING_LOG_NAME', 'nntmux'); /* * Display memory usage in log file and debug message output? * * @default true */ define('NN_LOGGING_LOG_MEMORY_USAGE', true); /* * Display CPU load in log file and debug message output? * * @default true */ define('NN_LOGGING_LOG_CPU_LOAD', true); /* * Display running time in log file and debug message output? * * @default true */ define('NN_LOGGING_LOG_RUNNING_TIME', true); /* * Display resource usage in log file and debug message output? * * @default false */ define('NN_LOGGING_LOG_RESOURCE_USAGE', false); /********************************************************************************* * The following options require either NN_DEBUG OR NN_LOGGING to be true: * *********************************************************************************/ /* * Log and/or echo debug Info messages. * * @default false */ define('NN_LOGINFO', false); /* * Log and/or echo debug Notice messages. * * @default false */ define('NN_LOGNOTICE', false); /* * Log and/or echo debug Warning messages. * * @default false */ define('NN_LOGWARNING', false); /* * Log and/or echo debug Error messages. * * @default false */ define('NN_LOGERROR', false); /* * Log and/or echo debug Fatal messages. * * @default false */ define('NN_LOGFATAL', false); /* * Log and/or echo debug failed SQL queries. * * @default false */ define('NN_LOGQUERIES', false); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////// SQL Settings ////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* * Strip white space (space, carriage return, new line, tab, etc) from queries before sending to MySQL. * This is useful if you use the MySQL slow query log. * * @note This slows down query processing, leave it false unless you turn on the MySQL slow query log. * @default false */ define('NN_QUERY_STRIP_WHITESPACE', false); /* * Use transactions when doing certain SQL jobs. * This has advantages and disadvantages. * If there's a problem during a transaction, MySQL can revert the row inserts which is beneficial. * Transactions can cause deadlocks however if you are trying to insert into the same table from another process. * * @note If all your tables are MyISAM you can set this to false, as MyISAM does not support transactions. * @default true */ define('NN_USE_SQL_TRANSACTIONS', true); /* * Allows the use of LOW_PRIORITY in certain DELETE queries. * This prevents table locks by deleting only when no SELECT queries are active on the table. * This works on MyISAM/ARIA, not INNODB. * * @note Does not cause any errors or warnings if enabled on INNODB. * @link https://dev.mysql.com/doc/refman/5.7/en/delete.html * @default false * @version 1 */ define('NN_SQL_DELETE_LOW_PRIORITY', false); /* * Allows the use QUICK in certain DELETE queries. * This makes DELETE queries faster on MyISAM/ARIA tables by not merging index leaves. * Only supported on MyISAM/ARIA * * @note Does not cause any errors or warnings if enabled on INNODB. * @link https://dev.mysql.com/doc/refman/5.7/en/delete.html * @default false * @version 1 */ define('NN_SQL_DELETE_QUICK', false); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////// PHP CLI Settings /////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// if (Utility::isCLI()) { /* * Your server's local timezone. * @note Uncomment to enable. * @see https://secure.php.net/manual/en/timezones.php * @version 4 */ //ini_set('date.timezone', 'America/New_York'); /* * Maximum amount of memory a PHP script can consume before being terminated. * @note Uncomment to enable. * @default '1024M' * @version 4 */ //ini_set('memory_limit', '1024M'); /* * Show PHP errors on CLI output. * @note Set to '1' for development. * @default '0' * @version 4 */ ini_set('display_errors', '0'); /* * Show startup errors on CLI output. * @note Set to '1' for development/debugging. * @default '0' * @version 4 */ ini_set('display_startup_errors', '0'); /* * Type of errors to display. * @note For development/debugging set to E_ALL * @default E_ALL & ~E_DEPRECATED & ~E_STRICT * @see https://secure.php.net/manual/en/errorfunc.constants.php * @version 4 */ ini_set('error_reporting', E_ALL); /* * Turn off HTML tags in error messages. * @default '1' * @version 4 */ ini_set('html_errors', '1'); /* * Set the location to log PHP errors. * @default NN_LOGS . 'php_errors.log' * @note To log to syslog, put in 'syslog' * @version 4 */ ini_set('error_log', NN_LOGS.'php_errors_cli.log'); /* * Log errors to error_log? * @default '1' * @version 4 */ ini_set('log_errors', '1'); /* * Max line length for a error. * @default 1024 * @version 4 */ ini_set('log_errors_max_len', '1024'); /* * Store the last PHP error in $php_errormsg * @default '0' * @note This is a development/debugging option. * @version 4 */ ini_set('track_errors', '0'); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////// PHP Web Settings /////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// } else { /* * Your server's local timezone. * @note Uncomment to enable. * @see https://secure.php.net/manual/en/timezones.php * @version 4 */ //ini_set('date.timezone', 'America/New_York'); /* * Maximum amount of seconds a script can run before being terminated. * @default '120' * @version 4 */ ini_set('max_execution_time', '120'); /* * Maximum amount of memory a PHP script can consume before being terminated. * @note Uncomment to enable. * @default '1024M' * @version 4 */ //ini_set('memory_limit', '1024M'); /* * Show PHP errors on web browser. * @note Set to '1' for development. * @default '0' * @version 4 */ ini_set('display_errors', '0'); /* * Show startup errors on web browser. * @note Set to '1' for development/debugging. * @default '0' * @version 4 */ ini_set('display_startup_errors', '0'); /* * Type of errors to display. * @note For development/debugging set to E_ALL * @default E_ALL & ~E_DEPRECATED & ~E_STRICT * @see https://secure.php.net/manual/en/errorfunc.constants.php * @version 4 */ ini_set('error_reporting', E_ALL); /* * Turn off HTML tags in error messages. * @default '1' * @version 4 */ ini_set('html_errors', '1'); /* * Set the location to log PHP errors. * @default NN_LOGS . 'php_errors.log' * @note To log to syslog, put in 'syslog' * @version 4 */ ini_set('error_log', NN_LOGS.'php_errors_web.log'); /* * Log errors to error_log? * @default '1' * @version 4 */ ini_set('log_errors', '1'); /* * Max line length for a error. * @default 1024 * @version 4 */ ini_set('log_errors_max_len', '1024'); /* * Store the last PHP error in $php_errormsg * @default '0' * @note This is a development/debugging option. * @version 4 */ ini_set('track_errors', '0'); } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////// PHP Xdebug Settings ////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// if (extension_loaded('xdebug')) { /* * Display colors on xdebug CLI output? * 0 - off, 1 - on only if on a TTY with ansi support, 2 - on regardless of TTY or ansi support. * @default 0 * @version 4 */ ini_set('xdebug.cli_color', '0'); /* * Replace PHP's var_dump with xdebug's own? * @default '1' * @version 4 */ ini_set('xdebug.overload_var_dump', '1'); /* * How many items in a array or object to display on var_dump. * @note Set to '-1' for no limit. * @default '128' * @version 4 */ ini_set('xdebug.var_display_max_children', '128'); /* * Maximum string length on var_dump. (anything over is truncated) * @note Set to '-1' for no limit. * @default '512' * @version 4 */ ini_set('xdebug.var_display_max_data', '512'); /* * How many nested arrays / objects deep to display on var_dump. * @note Set to '-1' for no limit. * @note Maximum value is '1023' * @default '3' * @version 4 */ ini_set('xdebug.var_display_max_depth', '3'); } /*********************************************************************************************************************** * //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// * //////////////////////////////////////////////// Change log //////////////////////////////////////////////////////////// * //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// * * 2015-08-26 v4 Add settings for PHP web/CLI SAPI's. * Add settings for Xdebug. * All new settings start from the "PHP CLI Settings" up to the "Change log", lines ~544 to ~768 * * 2015-06-11 v3 Add support for APC or APCu extensions for caching data. Search for @version 3 for the changes. * * 2015-05-10 v2 Update path to find_password_hash_cost.php in comments. Search for @version 2 for the changes. * * 2015-05-03 v1 Track settings.php.example changes. * Add support for quick and low_priority on MySQL DELETE queries. * Search for @version 1 in this file to quickly find these additions. * * //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/