function boost_crawler_add_to_table in Boost 6
Add URL's to the boost_crawler table.
Parameters
$push_setting: Default crawler setting for the content type
$extension: File extension, controls the content type DB lookup
$expire: Has the site changed, if so get expire column
1 call to boost_crawler_add_to_table()
- boost_crawler_seed_tables in ./
boost.module - Logic to get boost_crawler table ready.
File
- ./
boost.module, line 6105 - Provides static file caching for Drupal text output. Pages, Feeds, ect...
Code
function boost_crawler_add_to_table($push_setting, $extension, $expire) {
// Insert batch of URL's into boost_crawler table
$count = BOOST_CRAWL_DB_IMPORT_SIZE;
$total = boost_crawler_count($push_setting, $extension, $expire);
$loaded = variable_get('boost_crawler_loaded_count' . $extension, 0);
if ($total > $loaded) {
if ($push_setting) {
if ($expire && BOOST_LOOPBACK_BYPASS) {
@db_query_range("INSERT INTO {boost_crawler} (url, hash) SELECT url, hash_url FROM {boost_cache} WHERE push != 0 AND extension = '%s' AND expire BETWEEN 0 AND %d", $extension, BOOST_TIME, $loaded, $count);
}
else {
@db_query_range("INSERT INTO {boost_crawler} (url, hash) SELECT url, hash_url FROM {boost_cache} WHERE push != 0 AND extension = '%s' AND expire = 0", $extension, $loaded, $count);
}
}
else {
if ($expire && BOOST_LOOPBACK_BYPASS) {
@db_query_range("INSERT INTO {boost_crawler} (url, hash) SELECT url, hash_url FROM {boost_cache} WHERE push = 1 AND extension = '%s' AND expire BETWEEN 0 AND %d", $extension, BOOST_TIME, $loaded, $count);
}
else {
@db_query_range("INSERT INTO {boost_crawler} (url, hash) SELECT url, hash_url FROM {boost_cache} WHERE push = 1 AND extension = '%s' AND expire = 0", $extension, $loaded, $count);
}
}
variable_set('boost_crawler_loaded_count' . $extension, $loaded + $count);
return FALSE;
}
else {
return TRUE;
}
}