Skip to content

satmaelstorm/LargeArrayWriter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LargeArrayWriter

It was originally created for recording SiteMap files with their limitations of 50 MB and 50,000 lines per 1 file. Later useful for recording all sorts of feeds.

Simple Version (1.0)

Usage

$writer = new LargeArrayWriter(
"sitemap_%NUM%.xml",
"/tmp/" ,
true,
"<?xml version=\"1.0\" encoding=\"UTF-8\"?><urlset xmlns=\"http:https://www.sitemaps.org/schemas/sitemap/0.9\">\n",
"</urlset>",
50000,
50 * 1000 * 1000,
1000
);

Add string to file:

$writer->addString("<url><loc>URL</loc><lastmod>DATE</lastmod><changefreq>daily</changefreq></url>\n");

After all, finalize writer:

$files = $writer->finalize();

Extended Version (2.0)

FileNumerator

Saver

LAWriter

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages