The goal of this file ([login to view URL]) is to read a simple dynamic php-website and publish it as a static html-version. And before that, take a backup of the previous static html-version. The website has a couple of language versions and this file publishes only one language at a time, based on parameter given in the url: [login to view URL]
The website will only contain 10-30 pages per language and this "static publishing" is not done very often.
I also might need to adjust something with my mediocre php-skills.
Therefore it is good if you favor simplicity and basic php over elegant and maybe more efficient solutions.
Also please comment your code.
NOTE! All files are UTF-8 and all files created must also be UTF-8
TO PUT IT SHORT:
So the stuff found from folder named "dev" should create the folders "en", "fr" and "backup" and everything inside them. See the attached zip, so you will know what I mean.
THE CODE DOES THESE STEPS:
Open php/[login to view URL] and read the sitemap
Take backup of the previously published content (folder) of this specific language (if it exists) and save it to:
- Backups/$lang/YEAR_MONTH_DAY_HOUR_MIN_SEC/
Open language [login to view URL] from the language folder
Loop all pages from the sitemap through and do this for each page:
- Open & read the file
- do a simple string replacement for the contents, like convert all "a" letters to "x"
- I will later replace this with something useful, so think of this as just a placeholder
- Save the file with the filename and location that is specified in $lang/[login to view URL]
This project is for 6stech only!