Too long path #2

Closed
opened 2024-04-23 15:44:36 -05:00 by gacekssj4 · 1 comment
gacekssj4 commented 2024-04-23 15:44:36 -05:00 (Migrated from github.com)

I got error today. Client watched way too many products. Most probably path is too long

UnexpectedValueException::RecursiveDirectoryIterator::__construct(/home/exampleuser/public_html/example.com/cache/smarty/cache/crossselling/shoppingcart/766/842/843/946/855/973/980/988/1205/1162/633/982/804/975/884/1210/1203/1152/1108/1111/1073/1053/1044/1045/1155/1042/856/767/769/787/1018/989/981/846/879/881/911/916/931/940/967/968/969/1/1/3/3/14/ca/97): Failed to open directory: No such file or directory --

 $cacheId = 'crossselling|shoppingcart|'.implode('|', $products);

Cold be either changed to

 $cacheId = 'crossselling|shoppingcart|'.md5(implode('|', $products));
// or 
$cacheId = 'crossselling|shoppingcart|'.implode('|', array_slice($products,0,4)).'|'.md5(implode('|', $products));

Or something like this, to shorten path.

I got error today. Client watched way too many products. Most probably path is too long UnexpectedValueException::RecursiveDirectoryIterator::__construct(/home/exampleuser/public_html/example.com/cache/smarty/cache/crossselling/shoppingcart/766/842/843/946/855/973/980/988/1205/1162/633/982/804/975/884/1210/1203/1152/1108/1111/1073/1053/1044/1045/1155/1042/856/767/769/787/1018/989/981/846/879/881/911/916/931/940/967/968/969/1/1/3/3/14/ca/97): Failed to open directory: No such file or directory -- ```php $cacheId = 'crossselling|shoppingcart|'.implode('|', $products); ``` Cold be either changed to ```php $cacheId = 'crossselling|shoppingcart|'.md5(implode('|', $products)); // or $cacheId = 'crossselling|shoppingcart|'.implode('|', array_slice($products,0,4)).'|'.md5(implode('|', $products)); ``` Or something like this, to shorten path.
getdatakick commented 2024-04-24 04:04:03 -05:00 (Migrated from github.com)

Thank you, I've implemented your suggestion.

Thank you, I've implemented your suggestion.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-thirtybees/crossselling#2
No description provided.