private function crawlUrls($urls, $cli = false)
private function crawlUrls($urls, $cli=false, $showpathcount=false, $pathcount=1, $totalurls = 0 )
$url = str_replace('&', '&', $url);
$url = str_replace('&%3B', '&', $url);
$url = str_replace('?amp%3B', '?', $url);
$url = str_replace('page%3D', '&page=', $url);
if ($cli) {
echo $current . '/' . $count . ' ' . $url . ' : ' . $httpcode . PHP_EOL;
} else {
echo $current . '/' . $count . ' ' . $url . ' : ' . $httpcode . '<br/>' . PHP_EOL;
}
if ( $showpathcount ) {
echo $current . '/' . $count . '/' . $pathcount . '/' . $totalurls . ' ' . $url . ' : ' . $httpcode . ($cli ? '' : '<br>') . PHP_EOL;
} else {
echo $current . '/' . $count . ' ' . $url . ' : ' . $httpcode . ($cli ? '' : '<br>') . PHP_EOL;
}
$includeUrls = isset($this->lscache->setting['module_lscache_include_urls']) ? explode(PHP_EOL, $this->lscache->setting['module_lscache_include_urls']) : null;
$this->lscache->includeUrls = $includeUrls;
// additional sorts and filters to recache_options
$includeSorts = isset($this->lscache->setting['module_lscache_include_sorts']) ? preg_split( '/\n|\r\n?/', $this->lscache->setting['module_lscache_include_sorts']) : null;
$this->lscache->includeSorts=$includeSorts;
$includeFilters = isset($this->lscache->setting['module_lscache_include_filters']) ? preg_split( '/\n|\r\n?/', $this->lscache->setting['module_lscache_include_filters']) : null;
$this->lscache->includeFilters=$includeFilters;
// Include Sorts/Filters
$_['entry_include_sorts'] = 'Include Sorts/Filters';
$_['entry_include_filters'] = 'Include Journal Specific';
$_['entry_module_lscache_product_list_recache_total'] = 'Total Product URLs';
$_['entry_module_lscache_product_list_last_recached'] = 'Already Recached Product URLs';
$_['entry_module_lscache_product_list_recache_status'] = 'Product URLs List Status';
$_['hint_include_sorts'] = "Please input one kind of sorts or filter per line. \neg: \nsort=p.date_added&order=DESC \neg: \nfm=11";
$_['hint_include_filters'] = "Please input one Journal specific product url/popup per line. \neg: \npopup=options&product_quantity=1&";
$_['help_include_sorts'] = 'Additional sorts/filters to recache';
$_['help_include_filters'] = 'Additional Journal specific product url/popup to recache';
// What Recache
$_['entry_recache_option_what'] = 'Choose what to recache';
$_['entry_recache_option_what_button'] = 'Recache';
$_['text_recache_what_default'] = 'recache whole site';
$_['text_recache_what_products'] = 'recache only products';
$_['text_recache_what_category'] = 'recache only categories';
$_['text_recache_what_manufacturer'] = 'recache only manufacturers';
$_['text_recache_what_catalog'] = 'recache only catalog';
$_['text_recache_what_category_products'] = 'recache categories and products';
$_['text_recache_what_manufacturer_category_products'] = 'recache manufacturers, categories and products';
$_['text_recache_what_manufacturer_products'] = 'recache manufacturers and products';
$_['text_recache_what_catalog_products'] = 'recache catalog and products';
$_['text_recache_what_catalog_category_products'] = 'recache catalog, categories and products';
$_['text_recache_what_catalog_manufacturer'] = 'recache catalog and manufacturers';
$_['text_recache_what_catalog_manufacturer_products'] = 'recache catalog, manufacturers and products';
$_['button_recacheWhat'] = 'Rebuild Part of LiteSpeed Cache by your choose';
$data["button_recacheAll"] .= $data["text_curl_not_support"];
$data["button_recacheWhat"] .= $data["text_curl_not_support"];
$recacheLink = $siteUrl->link('extension/module/lscache/recache', 'user_token=' . $this->session->data['user_token'],true);
$this->load->model('extension/module/lscache');
$settingWhat = $this->model_extension_module_lscache->getItems();
$recacheLinkWhat = $siteUrl->link('extension/module/lscache/recache', 'what=' . $settingWhat['module_lscache_recache_option_what'] . '&user_token=' . $this->session->data['user_token'],true);
if(!isset($oldSetting["module_lscache_vary_safari"])){
$oldSetting["module_lscache_vary_safari"] = '0';
}
// add variables for what recache
if(!isset($oldSetting["module_lscache_recache_option_what"])){
$oldSetting["module_lscache_recache_option_what"] = '1111';
}
$data['recacheAll'] = $this->isCurl()? $recacheLink : '#';
$data['recacheWhat'] = $this->isCurl()? $recacheLinkWhat : '#';
$this->db->query(" insert into " . DB_PREFIX . "setting (store_id, code, `key`, value, serialized) values ('0', 'module_lscache', 'module_lscache_vary_safari', '0', '0')") ;
// lscache crawler what recache variabels
$this->db->query(" insert into " . DB_PREFIX . "setting (store_id, code, `key`, value, serialized) values ('0', 'module_lscache', 'module_lscache_recache_option_what', '1111', '0')") ;
<div class="form-group">
<label class="col-sm-2 control-label" for="module_lscache_include_urls"><span data-toggle="tooltip" title="{{ help_include_urls }}">{{ entry_include_urls }}</span></label>
<div class="col-sm-10">
<textarea name="module_lscache_include_urls" placeholder="{{ hint_include_urls }}" class="form-control" rows="3">{{ module_lscache_include_urls }}</textarea>
</div>
</div>
<!-- Include sorts to recache -->
<div class="form-group">
<label class="col-sm-2 control-label" for="module_lscache_include_sorts"><span data-toggle="tooltip" title="{{ help_include_sorts }}">{{ entry_include_sorts }}</span></label>
<div class="col-sm-10">
<textarea name="module_lscache_include_sorts" placeholder="{{ hint_include_sorts }}" class="form-control" rows="3">{{ module_lscache_include_sorts }}</textarea>
</div>
</div>
<!-- Include filter to recache -->
<div class="form-group">
<label class="col-sm-2 control-label" for="module_lscache_include_filetrs"><span data-toggle="tooltip" title="{{ help_include_filters }}">{{ entry_include_filters }}</span></label>
<div class="col-sm-10">
<textarea name="module_lscache_include_filters" placeholder="{{ hint_include_filters }}" class="form-control" rows="3">{{ module_lscache_include_filters }}</textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="module_lscache_purge_url">
<button type="submit" name='purgeURL' form="form-lscache-module" data-toggle="tooltip" class="btn btn-warning"><i class="fa fa-trash"> {{ entry_purge_urls }}</i></button>
</label>
<div class="col-sm-10">
<textarea name="lscache_purge_url" placeholder="{{ hint_purge_urls }}" class="form-control" rows="3">{{ lscache_purge_urls }}</textarea>
</div>
</div>
<!-- Choose what to recache -->
<div class="form-group">
<label class="col-sm-2 control-label" for="module_lscache_recache_option_what">{{ entry_recache_option_what }}
<a href="{{ recacheWhat }}" data-toggle="tooltip" title="{{ button_recacheWhat }}" class="btn btn-success"><i class="fa fa-flash"> </i></a>
</label>
<div class="col-sm-10">
<select name="module_lscache_recache_option_what" class="form-control">
<option value="1111" {{ selectDisable.check(module_lscache_recache_option_what, '1111') }}>{{ text_recache_what_default }}</option>
<option value="1" {{ selectDisable.check(module_lscache_recache_option_what, '1') }}>{{ text_recache_what_products }}</option>
<option value="10" {{ selectDisable.check(module_lscache_recache_option_what, '10') }}>{{ text_recache_what_category }}</option>
<option value="100" {{ selectDisable.check(module_lscache_recache_option_what, '100') }}>{{ text_recache_what_manufacturer }}</option>
<option value="1000" {{ selectDisable.check(module_lscache_recache_option_what, '1000') }}>{{ text_recache_what_catalog }}</option>
<option value="11" {{ selectDisable.check(module_lscache_recache_option_what, '11') }}>{{ text_recache_what_category_products }}</option>
<option value="111" {{ selectDisable.check(module_lscache_recache_option_what, '111') }}>{{ text_recache_what_manufacturer_category_products }}</option>
<option value="1001" {{ selectDisable.check(module_lscache_recache_option_what, '1001') }}>{{ text_recache_what_catalog_products }}</option>
<option value="1011" {{ selectDisable.check(module_lscache_recache_option_what, '1011') }}>{{ text_recache_what_catalog_category_products }}</option>
<option value="1100" {{ selectDisable.check(module_lscache_recache_option_what, '1100') }}>{{ text_recache_what_catalog_manufacturer }}</option>
<option value="1101" {{ selectDisable.check(module_lscache_recache_option_what, '1101') }}>{{ text_recache_what_catalog_manufacturer_products }}</option>
<option value="101" {{ selectDisable.check(module_lscache_recache_option_what, '101') }}>{{ text_recache_what_manufacturer_products }}</option>
</select>
</div>
</div>
<search><![CDATA[public function recache()]]></search>
<add position="replace" offset="139">