-
-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for filesystem adapters #25
Comments
No, it won't. If there are many URLs keeping it all in memory and then writing at once will cause huge memory usage. |
Ok, adding an append() method would be useful interface FilesystemAdapterInterface
{
/**
* Create a file or update if exists.
*
* @param string $path The path to the file.
* @param string $contents The file contents.
*
* @return bool True on success, false on failure.
*/
public function put($path, $contents);
/**
* Append content to an existing file.
*
* @param string $path The path to the file.
* @param string $content The content to append.
*
* @return bool True on success, false on failure.
*/
public function append($path, $content);
} |
How to handle overwriting of existing files? |
|
OK. Makes sense. @WinterSilence what do you think? |
@samdark Maybe - need tests. Class implemented
|
How to get a list of file names written then? |
@samdark |
That would do, yes. |
@samdark What's next? |
If you have extra time to burn you may implement refactoring. Along with https://github.com/samdark/sitemap/tree/refactroring it could be released as a new major version. |
This is based on discussion in #24 where I want to be able to write the sitemaps and index to Amazon S3.
I think a very simple interface like this may work:
And then a FilesystemAdapter could be passed into the constructor and used when writing files.
The text was updated successfully, but these errors were encountered: