Difference between revisions of "Using the installer API to support package installation"
From Joomla! Documentation
|Line 1:||Line 1:|
Revision as of 04:11, 5 July 2008
This article is tagged because it NEEDS REVIEW. You can help the Joomla! Documentation Wiki by contributing to it.
More pages that need help similar to this one are here. NOTE-If you feel the need is satistified, please remove this notice.
The script needs to be extended for sorting your files into folders within the archive, which are needed for the Joomla! extension installer API. See the recommended file locations below:
|Development file||Archive folder|
|/components/com_<component name>/**||/site/** (mimic folder structure)|
|/adminsitrator/components/com_<component name>/**||/admin/** (mimic folder structure)|
|/language/en-GB/en-GB.com_<component name>.ini||/language/site (flatten structure: discard language code subfolders)|
|administrator/language/en-GB/en-GB.com_<component name>.ini||/language/admin (flatten structure: discard language code subfolders)|
|<component name>.xml The manifest file||/|
The Component Manifest File
Your component needs an xml-file declaring meta data (author, license, etc.), which files are included and indicates some special files to the installer API, like the included languages and SQL-scripts for (un)installing.
The most important xml-elements are explained below. For a full syntax refer to the manifest's DTD:
The root element
<install type="component|module|..." method="upgrade"> <name>component name</name> <version>x.y</version> ...
Enter the type of your extension, and indicate whether the installer shall be able to overwrite existing files. If the method attribute is not given, the installer will quit gracefully when encountering any existing file on the webspace.
The file list
<install> <files folder="site"> <folder>views</folder> ... <filename>component-name.php</file> ... <administration> <files folder="admin"> ...
List all files which make up the code of your component, which will later go to the component subfolder of the site. Same for the administration part.
The language files