I am trying to create a dynamic sitemap for my site, which runs on Zend.
I want one of my controllers to be able to write to the /public directory, but I can’t figure out how to get the file written to the right place.
My relevant directory structure is something like:
.application/
….modules/
…….my_module/
……….controllers/
………….SitemapController.php
.library/
.public/
Is this a simple way in Zend to point at the public/ directory without writing something ugly like “file://../../../public/” every time?
The Zend framework bootstrap defines a constant called APPLICATION_PATH following that guideline you can initialize another constant that points to the public path:
This will then be available everywhere. Make sure that the webserver has write permissions to the folder you want to store files in.