nitropack
Last commit date
classes
4 years ago
nitropack-sdk
4 years ago
view
4 years ago
advanced-cache.php
5 years ago
batcache-compat.php
4 years ago
cf-helper.php
5 years ago
constants.php
4 years ago
diagnostics.php
4 years ago
functions.php
4 years ago
integrations.php
4 years ago
main.php
4 years ago
readme.txt
4 years ago
uninstall.php
4 years ago
wp-cli.php
5 years ago
constants.php
34 lines
| 1 | <?php |
| 2 | |
| 3 | defined( 'ABSPATH' ) or die( 'No script kiddies please!' ); |
| 4 | |
| 5 | function nitropack_trailingslashit($string) { |
| 6 | return rtrim( $string, '/\\' ) . '/'; |
| 7 | } |
| 8 | |
| 9 | define( 'NITROPACK_VERSION', '1.5.8' ); |
| 10 | define( 'NITROPACK_OPTION_GROUP', 'nitropack' ); |
| 11 | define( 'NITROPACK_DATA_DIR', nitropack_trailingslashit(WP_CONTENT_DIR) . 'nitropack' ); |
| 12 | define( 'NITROPACK_CONFIG_FILE', nitropack_trailingslashit(NITROPACK_DATA_DIR) . 'config.json' ); |
| 13 | define( 'NITROPACK_PLUGIN_DIR', nitropack_trailingslashit(dirname(__FILE__))); |
| 14 | define( 'NITROPACK_CLASSES_DIR', nitropack_trailingslashit(NITROPACK_PLUGIN_DIR . 'classes') ); |
| 15 | define( 'NITROPACK_HEARTBEAT_INTERVAL', 60*5); // 5min |
| 16 | |
| 17 | if (!defined("NITROPACK_USE_REDIS")) define("NITROPACK_USE_REDIS", false); // Set this to true to enable storing cache in Redis |
| 18 | if (!defined("NITROPACK_REDIS_HOST")) define("NITROPACK_REDIS_HOST", "127.0.0.1"); // Set this to the IP of your Redis server |
| 19 | if (!defined("NITROPACK_REDIS_PORT")) define("NITROPACK_REDIS_PORT", 6379); // Set this to the port of your Redis server |
| 20 | if (!defined("NITROPACK_REDIS_PASS")) define("NITROPACK_REDIS_PASS", NULL); // Set this to the password of your redis server if authentication is needed |
| 21 | if (!defined("NITROPACK_REDIS_DB")) define("NITROPACK_REDIS_DB", NULL); // Set this to the number of the Redis DB if you'd like to not use the default one |
| 22 | |
| 23 | if (!defined("NITROPACK_SUPPORT_BUBBLE_VISIBLE")) define("NITROPACK_SUPPORT_BUBBLE_VISIBLE", true); |
| 24 | if (!defined("NITROPACK_SUPPORT_BUBBLE_URL")) define("NITROPACK_SUPPORT_BUBBLE_URL", "https://support.nitropack.io/"); |
| 25 | |
| 26 | spl_autoload_register(function($class) { |
| 27 | $filename = str_replace("\\", "/", $class) . ".php"; |
| 28 | $filename = str_replace("NitroPack/", "", $filename); |
| 29 | $filepath = NITROPACK_CLASSES_DIR . ltrim($filename, "/"); |
| 30 | if (file_exists($filepath)) { |
| 31 | require_once $filepath; |
| 32 | } |
| 33 | }); |
| 34 |