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
{{ message }}
This repository has been archived by the owner on Jun 21, 2024. It is now read-only.
Add a new class OCA\DataExporter\Utilities\FSAccess. This class will be a wrapper around standard PHP FS operations. There are a couple of extra features to include:
Change the base root folder of all operations. This mean that all operations will be made inside that target folder. For example, if the root folder is changed to "/tmp/my/root", the real target of a "/myfile.txt" will be "/tmp/my/root/myfile.txt"
No operations will be made until the base root folder is set
The base root folder will be set only once. Changing it won't be possible.
Note that it's expected to wrap only the operations we need, and / or provide enhanced operations (mainly for copying files around).
In addition, the symfony's Filesystem class will be removed because of problems with big files. Our FSAccess class will replace it.
Usage expectations
Neither importers nor exporters will have a direct dependency on this class.
For importers:
The import method signature will be changed to (need to check more options):
public function import(AbstractModel $modelToImport, FSAccess $fs);
It's expected that the caller of the root importer has properly set the base root folder before calling the import method. In case of import dependencies, the FSAccess object will be passed around.
Note that the one needing to access to the FS might be quite down in the dependency tree, and the one setting the base root folder should be one of the commands.
For exporters:
The extract method signature will be changed to:
public function extract(AbstractModel $parentModel, FSAccess $fs);
This will allow to extractors to write or copy files if needed.
The text was updated successfully, but these errors were encountered:
In addition, the symfony's Filesystem class will be removed because of problems with big files.
Which problems?
The property of the symfony thing I like most is that you can operate on nested paths e.g dump_file("foo/bar/hello.txt") and it will implicitly create the whole path.
Another option would be to just checkin the symfony Filesystem component and modify it to our needs as it is only a single file.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Implement custom FS access
Add a new class
OCA\DataExporter\Utilities\FSAccess
. This class will be a wrapper around standard PHP FS operations. There are a couple of extra features to include:Note that it's expected to wrap only the operations we need, and / or provide enhanced operations (mainly for copying files around).
In addition, the symfony's
Filesystem
class will be removed because of problems with big files. OurFSAccess
class will replace it.Usage expectations
Neither importers nor exporters will have a direct dependency on this class.
For importers:
The import method signature will be changed to (need to check more options):
It's expected that the caller of the root importer has properly set the base root folder before calling the import method. In case of import dependencies, the
FSAccess
object will be passed around.Note that the one needing to access to the FS might be quite down in the dependency tree, and the one setting the base root folder should be one of the commands.
For exporters:
The text was updated successfully, but these errors were encountered: