// Changed max_execution_time for big product selection removal #PSCFV-3181

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16870 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
dMetzger
2012-08-16 13:23:52 +00:00
parent 92c22de458
commit f09026be73
+7 -1
View File
@@ -681,12 +681,18 @@ class ProductCore extends ObjectModel
public function deleteSelection($products)
{
$return = 1;
if (is_array($products) && count($products))
if (is_array($products) && ($count = count($products)))
{
// Deleting products can be quite long on a cheap server. Let's say 1.5 seconds by product (I've seen it!).
if (intval(ini_get('max_execution_time')) < round($count * 1.5))
ini_set('max_execution_time', round($count * 1.5));
foreach ($products as $id_product)
{
$product = new Product((int)$id_product);
$return &= $product->delete();
}
}
return $return;
}