We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
in Opencart by default are THREE path to product page:
crawler algorithm contain 1 and 2, path 3 (by manufacturer_id) forgotten!
on huge number of products, for example, more than 6000, array urls() exceed php memory limit and crawler stop!
that's why I replace in
catalog/controller/extension/module/lscache.php
echo 'recache product urls...' . ($cli ? '' : '<br>') . PHP_EOL; foreach ($this->model_catalog_product->getProducts() as $result) { foreach ($this->model_catalog_product->getCategories($result['product_id']) as $category) { if (isset($categoryPath[$category['category_id']])) { $urls[] = $this->url->link('product/product', 'path=' . $categoryPath[$category['category_id']] . '&product_id=' . $result['product_id']); } } $urls[] = $this->url->link('product/product', 'product_id=' . $result['product_id']); } $this->crawlUrls($urls, $cli);
by this:
echo 'recache product urls...' . ($cli ? '' : '<br>') . PHP_EOL; $UrlsCount = 0; $UrlsCountCount = 0; $this->load->model('catalog/manufacturer'); foreach ($this->model_catalog_product->getProducts() as $result) { foreach ($this->model_catalog_product->getCategories($result['product_id']) as $category) { if(isset( $categoryPath[$category['category_id']] )){ $urls[] = $this->url->link('product/product', 'path=' . $categoryPath[$category['category_id']] . '&product_id=' . $result['product_id']); $UrlsCount++; } } $urls[] = $this->url->link('product/product', 'manufacturer_id=' . $result['manufacturer_id'] . '&product_id=' . $result['product_id']); $UrlsCount++; $urls[] = $this->url->link('product/product', 'product_id=' . $result['product_id']); $UrlsCount++; if ( $UrlsCount > 4096 ) { $UrlsCountCount++; echo 'recache '. $UrlsCountCount . ' part of product urls...' . ($cli ? '' : '<br>') . PHP_EOL; $this->crawlUrls($urls, $cli); $urls = array(); $UrlsCount = 0; } } echo 'recache '. $UrlsCountCount . ' part of product urls...' . ($cli ? '' : '<br>') . PHP_EOL; $this->crawlUrls($urls, $cli);
The text was updated successfully, but these errors were encountered:
after some tests in heavy load real conditions I investigate that 4096 urls in array urls() also can exceed php memory limit
problem in $categoryPath that also required more memory.
I decide reduce limit of $UrlsCount to 2048. testing .......
echo 'recache product urls...' . ($cli ? '' : '<br>') . PHP_EOL; $UrlsCount = 0; $UrlsCountCount = 0; $this->load->model('catalog/manufacturer'); foreach ($this->model_catalog_product->getProducts() as $result) { foreach ($this->model_catalog_product->getCategories($result['product_id']) as $category) { if(isset( $categoryPath[$category['category_id']] )){ $urls[] = $this->url->link('product/product', 'path=' . $categoryPath[$category['category_id']] . '&product_id=' . $result['product_id']); $UrlsCount++; } } $urls[] = $this->url->link('product/product', 'manufacturer_id=' . $result['manufacturer_id'] . '&product_id=' . $result['product_id']); $UrlsCount++; $urls[] = $this->url->link('product/product', 'product_id=' . $result['product_id']); $UrlsCount++; if ( $UrlsCount > 2048 ) { $UrlsCountCount++; echo 'recache '. $UrlsCountCount . ' part of product urls...' . ($cli ? '' : '<br>') . PHP_EOL; $this->crawlUrls($urls, $cli); $urls = array(); $UrlsCount = 0; } } if ( $UrlsCountCount > 0 ) { echo 'recache '. $UrlsCountCount . ' part of product urls...' . ($cli ? '' : '<br>') . PHP_EOL; } $this->crawlUrls($urls, $cli);
Sorry, something went wrong.
No branches or pull requests
in Opencart by default are THREE path to product page:
crawler algorithm contain 1 and 2, path 3 (by manufacturer_id) forgotten!
on huge number of products, for example, more than 6000, array urls() exceed php memory limit and crawler stop!
that's why I replace in
catalog/controller/extension/module/lscache.php
by this:
The text was updated successfully, but these errors were encountered: