You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the current default handling for setCacheLocation, it processes the result through realpath(). If the defined folder does not exist (e.g. {core_path}components/spiefeed/cache), the code attempts to create it.
However, it never succeeds.
Since realpath() cannot handle nonexistent files/folders, the result is always empty. That said, the value passed to mkdir is an empty string, and the cache folder is not created. The only reason it does not error is the error suppressor @ at the front.
$cachePath = realpath($scriptProperties['setCacheLocation']);
if (!is_dir($cachePath)) {
@mkdir($cachePath, 0755);
}
Perhaps the default handling should pass $scriptProperties['setCacheLocation'] to mkdir(), or come up with an alternative to realpath() to handle this correctly?
---
Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/36659981-missing-cache-folder-realpath-does-not-support-nonexistent-directory?utm_campaign=plugin&utm_content=tracker%2F5873226&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F5873226&utm_medium=issues&utm_source=github).
The text was updated successfully, but these errors were encountered:
Perhaps it is due to assets/components/spiefeed/cache existing, but $defaultCacheLocation check is actually prefixed by core_path?
Personally, I think it would be safer to store in core_path (and not assets_path) anyway, so perhaps the folder(and accompanying .gitignore) also needs to be created?
In the current default handling for
setCacheLocation
, it processes the result throughrealpath()
. If the defined folder does not exist (e.g. {core_path}components/spiefeed/cache), the code attempts to create it.However, it never succeeds.
Since
realpath()
cannot handle nonexistent files/folders, the result is always empty. That said, the value passed tomkdir
is an empty string, and the cache folder is not created. The only reason it does not error is the error suppressor@
at the front.Perhaps the default handling should pass
--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/36659981-missing-cache-folder-realpath-does-not-support-nonexistent-directory?utm_campaign=plugin&utm_content=tracker%2F5873226&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F5873226&utm_medium=issues&utm_source=github).$scriptProperties['setCacheLocation']
tomkdir()
, or come up with an alternative torealpath()
to handle this correctly?The text was updated successfully, but these errors were encountered: