summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Carper2009-10-04 07:20:31 (GMT)
committer Mike Carper2009-10-04 07:20:31 (GMT)
commit3cb54e11d694af09fd47777670d53230ed0d3f50 (patch)
tree8e4cc868c8570ab8fba2069c1519dbd408f56439
parent5f532f07c825b8626f1e6fb44aba6afa4fcbc81d (diff)
#593788 by marcingy: Fix php warning.
-rw-r--r--boost.module36
1 files changed, 22 insertions, 14 deletions
diff --git a/boost.module b/boost.module
index 8103aa1..8e8f34b 100644
--- a/boost.module
+++ b/boost.module
@@ -11,6 +11,9 @@
define('BOOST_PATH', dirname(__FILE__));
define('BOOST_ENABLED', variable_get('boost_enabled', CACHE_DISABLED));
+define('BOOST_TIME', time());
+
+// Dir & File Structure
define('BOOST_MULTISITE_SINGLE_DB', variable_get('boost_multisite_single_db', FALSE));
define('BOOST_ROOT_CACHE_DIR', variable_get('boost_root_cache_dir', 'cache'));
define('BOOST_NORMAL_DIR', variable_get('boost_normal_dir', ''));
@@ -20,16 +23,17 @@ define('BOOST_PERM_GZ_DIR', variable_get('boost_perm_gz_dir', 'gz'));
define('BOOST_CHAR', variable_get('boost_char', '_'));
define('BOOST_PERM_CHAR', variable_get('boost_perm_char', '_'));
define('BOOST_HOST', variable_get('boost_host', ''));
-define('BOOST_FILE_PATH', BOOST_MULTISITE_SINGLE_DB ? boost_cache_directory(NULL, FALSE) : variable_get('boost_file_path', boost_cache_directory(BOOST_HOST, FALSE)));
-define('BOOST_GZIP_FILE_PATH', implode('/', array_filter(explode('/', str_replace(BOOST_ROOT_CACHE_DIR . '/' . BOOST_NORMAL_DIR, BOOST_ROOT_CACHE_DIR . '/' . BOOST_GZIP_DIR . '/', BOOST_FILE_PATH)))));
-define('BOOST_PERM_GZIP_FILE_PATH', implode('/', array_filter(explode('/', str_replace(BOOST_ROOT_CACHE_DIR . '/' . BOOST_NORMAL_DIR, BOOST_ROOT_CACHE_DIR . '/' . BOOST_PERM_GZ_DIR . '/', BOOST_FILE_PATH)))));
-define('BOOST_PERM_FILE_PATH', implode('/', array_filter(explode('/', str_replace(BOOST_ROOT_CACHE_DIR . '/' . BOOST_NORMAL_DIR, BOOST_ROOT_CACHE_DIR . '/' . BOOST_PERM_NORMAL_DIR . '/', BOOST_FILE_PATH)))));
define('BOOST_FILE_EXTENSION', variable_get('boost_file_extension', '.html'));
define('BOOST_XML_EXTENSION', variable_get('boost_xml_extension', '.xml'));
define('BOOST_JSON_EXTENSION', variable_get('boost_json_extension', '.json'));
define('BOOST_CSS_EXTENSION', variable_get('boost_css_extension', '.css'));
define('BOOST_JS_EXTENSION', variable_get('boost_js_extension', '.js'));
define('BOOST_GZIP_EXTENSION', variable_get('boost_gzip_extension', '.gz'));
+define('BOOST_ROOT_FILE', variable_get('boost_root_file', '.boost'));
+define('BOOST_FLUSH_DIR', variable_get('boost_flush_dir', TRUE));
+define('BOOST_MAX_PATH_DEPTH', 10);
+
+// Cacheing Options
define('BOOST_CACHE_XML', variable_get('boost_cache_xml', FALSE));
define('BOOST_CACHE_JSON', variable_get('boost_cache_json', FALSE));
define('BOOST_CACHE_HTML', variable_get('boost_cache_html', TRUE));
@@ -41,9 +45,10 @@ define('BOOST_PUSH_JSON', variable_get('boost_push_json', FALSE));
define('BOOST_CACHE_LIFETIME', variable_get('boost_cache_lifetime', 3600));
define('BOOST_CACHE_XML_LIFETIME', variable_get('boost_cache_xml_lifetime', 3600));
define('BOOST_CACHE_JSON_LIFETIME', variable_get('boost_cache_json_lifetime', 3600));
-define('BOOST_MAX_PATH_DEPTH', 10);
define('BOOST_CACHEABILITY_OPTION', variable_get('boost_cacheability_option', 0));
define('BOOST_CACHEABILITY_PAGES', variable_get('boost_cacheability_pages', ''));
+
+// Advanced Settings
define('BOOST_FETCH_METHOD', variable_get('boost_fetch_method', 'php'));
define('BOOST_PRE_PROCESS_FUNCTION', variable_get('boost_pre_process_function', ''));
define('BOOST_POST_UPDATE_COMMAND', variable_get('boost_post_update_command', ''));
@@ -55,9 +60,6 @@ define('BOOST_AGGRESSIVE_GZIP', variable_get('boost_aggressive_gzip', FALSE
define('BOOST_CLEAR_CACHE_OFFLINE', variable_get('boost_clear_cache_offline', TRUE));
define('BOOST_HALT_ON_ERRORS', variable_get('boost_halt_on_errors', FALSE));
define('BOOST_HALT_ON_MESSAGES', variable_get('boost_halt_on_messages', TRUE));
-define('BOOST_ROOT_FILE', variable_get('boost_root_file', '.boost'));
-define('BOOST_FLUSH_DIR', variable_get('boost_flush_dir', TRUE));
-define('BOOST_TIME', time());
define('BOOST_CACHE_QUERY', variable_get('boost_cache_query', TRUE));
define('BOOST_IGNORE_FLUSH', variable_get('boost_ignore_flush', 0));
define('BOOST_PERMISSIONS_FILE', variable_get('boost_permissions_file', ''));
@@ -67,15 +69,13 @@ define('BOOST_DISABLE_CLEAN_URL', variable_get('boost_disable_clean_url', FAL
define('BOOST_VERBOSE', variable_get('boost_verbose', 5));
define('BOOST_FLUSH_NODE_TERMS', variable_get('boost_flush_node_terms', TRUE));
define('BOOST_MAX_TIMESTAMP', variable_get('boost_max_timestamp', BOOST_TIME));
+
+// Crawler Settings
define('BOOST_CHECK_BEFORE_CRON_EXPIRE', variable_get('boost_check_before_cron_expire', FALSE));
define('BOOST_CRAWL_ON_CRON', variable_get('boost_crawl_on_cron', FALSE));
define('BOOST_CRAWLER_THROTTLE', variable_get('boost_crawler_throttle', 0));
define('BOOST_CRAWLER_THREADS', variable_get('boost_crawler_threads', 2));
-define('BOOST_CRAWLER_BATCH_SIZE', variable_get('boost_crawler_batch_size', min(15, ini_get('max_execution_time')/(2 * boost_average_time()))));
define('BOOST_CRAWL_URL_ALIAS', variable_get('boost_crawl_url_alias', FALSE));
-global $base_url;
-define('BOOST_CRAWLER_SELF', $base_url . '/' . 'boost-crawler?nocache=1&key=' . variable_get('boost_crawler_key', FALSE));
-define('BOOST_MAX_THREAD_TIME', max(300, 2 * boost_average_time() * BOOST_CRAWLER_THREADS * BOOST_CRAWLER_BATCH_SIZE));
define('BOOST_MAX_THREADS', 8);
define('BOOST_LOOPBACK_BYPASS', BOOST_OVERWRITE_FILE ? variable_get('boost_loopback_bypass', FALSE) : FALSE);
@@ -88,8 +88,16 @@ define('BOOST_COOKIE', variable_get('boost_cookie', 'DRUPAL_UID'))
// static version):
define('BOOST_BANNER', variable_get('boost_banner', "Page cached by Boost @ %cached_at, expires @ %expires_at"));
-// This is needed since the $user object is already destructed in _boost_ob_handler():
-define('BOOST_USER_ID', @$GLOBALS['user']->uid);
+// Requires Boost Functions or global scope, Define These Last
+global $base_url;
+define('BOOST_CRAWLER_SELF', $base_url . '/' . 'boost-crawler?nocache=1&key=' . variable_get('boost_crawler_key', FALSE));
+define('BOOST_FILE_PATH', BOOST_MULTISITE_SINGLE_DB ? boost_cache_directory(NULL, FALSE) : variable_get('boost_file_path', boost_cache_directory(BOOST_HOST, FALSE)));
+define('BOOST_GZIP_FILE_PATH', implode('/', array_filter(explode('/', str_replace(BOOST_ROOT_CACHE_DIR . '/' . BOOST_NORMAL_DIR, BOOST_ROOT_CACHE_DIR . '/' . BOOST_GZIP_DIR . '/', BOOST_FILE_PATH)))));
+define('BOOST_PERM_GZIP_FILE_PATH', implode('/', array_filter(explode('/', str_replace(BOOST_ROOT_CACHE_DIR . '/' . BOOST_NORMAL_DIR, BOOST_ROOT_CACHE_DIR . '/' . BOOST_PERM_GZ_DIR . '/', BOOST_FILE_PATH)))));
+define('BOOST_PERM_FILE_PATH', implode('/', array_filter(explode('/', str_replace(BOOST_ROOT_CACHE_DIR . '/' . BOOST_NORMAL_DIR, BOOST_ROOT_CACHE_DIR . '/' . BOOST_PERM_NORMAL_DIR . '/', BOOST_FILE_PATH)))));
+define('BOOST_CRAWLER_BATCH_SIZE', variable_get('boost_crawler_batch_size', min(15, ini_get('max_execution_time')/(2 * boost_average_time()))));
+define('BOOST_MAX_THREAD_TIME', max(300, 2 * boost_average_time() * BOOST_CRAWLER_THREADS * BOOST_CRAWLER_BATCH_SIZE));
+
//////////////////////////////////////////////////////////////////////////////
// Global variables