Not a bug Unable to check if data folder exists with abstractedPathExists

Snog

Well-known member
Affected version
2.1
You must specify a path to a file ( data://afilename.ext ) when checking if the abstractedPathExists and you're unable to check if data:// exists.

If you just specify data:// the end result will always be false.

I know there are ways around it when the data folder is local on the server, but when the abstracted path may be on a different server it becomes impossible to check if the path exists.

As a side note, there is also no isWritable function for an abstracted path.
 
This is expected really. If the mount (data://) doesn't exist then it is automatically created.

(You can test this by deleting or moving the data directory and loading any page).
 
@Chris D this is a result of the problem where the Flysytem is throwing an error that the data folder doesn't exist on the abstracted path. I realize it's probably a problem with the user's server configuration, but some way to check the abstracted path for the data folder would alleviate errors from the Flysystem later in other functions.
 
As I say, if it doesn't exist then we attempt to create it. If that fails for any reason, indeed it is something related to the server configuration. It isn't something you need to be verifying in your code.

We'd strongly urge against using FTP as a mechanism for offloading data/internal_data btw. Just because you can, doesn't mean you should. It certainly doesn't make for a performant or reliable method.
 
We'd strongly urge against using FTP as a mechanism for offloading data/internal_data btw. Just because you can, doesn't mean you should. It certainly doesn't make for a performant or reliable method.
I fully agree, but it's quite hard to explain to someone when the folder exists on their server and is writable but for some reason because of their configuration FTP is kicking in during an abstract copy.
 
Top Bottom