Reputation: 3668
I have created an extension in magento; The extension is basically one php file. this is how it is supposed to work: It includes the mage.php file and gets contents of a store and writes an xml file. Now this XML file needs to be accessed and read by another script through the web. The problem is that the installed magento extensions folder is not web accessible.
/app/code/community/[CompanyName]/[PackageName]
But I know that when my file is located at the root folder of a magento installation, it works. 1. How can i create the extension to make it be installed in the root folder or any folder which is web accessible?
Thanks.
Upvotes: 1
Views: 555
Reputation: 37700
You can put your files anywhere you like if they don't have to be available to the rest of Magento. It sounds like you are not writing a module so does not need to be in the app/code/
folder. When packaging your extension remember to use the content target "Other web accessible file" which is relative to the root folder.
A more conventional way is to write a module with a controller. It will be the controller that responds to requests with XML content. The URL can then be anything by leveraging Magento's URL rewrites. This way the XML can be generated on demand so it is always accurate. Some servers won't necessarily have full write access to the root folder for security reasons.
Upvotes: 2