Actions

Difference between revisions of "Packaging a extension"

From Joomla! Documentation

m (Wilsonge moved page Packaging the template to Packaging a extension: This makes it much more generic)
 
(5 intermediate revisions by 4 users not shown)
Line 1: Line 1:
A directory with several loose files is not a convenient package for distribution. So the final step is to make a ''package''. This is a compressed archive containing the directory structure and all the files. The package can be in '''ZIP''' format (with a <tt>.zip</tt> extension), in '''TAR-gzip''' format (with a <tt>.tar.gz</tt> extension), or in '''TAR-bz2''' format (with a <tt>.tar.bz2</tt> extension).  
+
<noinclude><languages /></noinclude>
 +
<translate><!--T:1-->
 +
A directory with several loose files is not a convenient package for distribution. So the final step is to make a ''package''. This is a compressed archive containing the directory structure and all the files. The package can be in '''ZIP''' format (with a <tt>.zip</tt> extension), in '''TAR-gzip''' format (with a <tt>.tar.gz</tt> extension), or in '''TAR-bz2''' format (with a <tt>.tar.bz2</tt> extension).</translate>
  
If your template is in a directory <tt>mytemplate/</tt> then to make the package you can connect to that directory and use commands like:
+
<translate><!--T:2-->
 +
If your template is in a directory <tt>mytemplate/</tt> then to make the package you can connect to that directory and use commands like:</translate>
 
* <tt>tar cvvzf ../mytemplate.tar.gz *</tt>
 
* <tt>tar cvvzf ../mytemplate.tar.gz *</tt>
* <tt>zip -a -r ..\mytemplate.zip *.*</tt>
+
* <tt>zip -r ..\mytemplate.zip *.*</tt>
  
=== Note to Mac OS X users ===
+
<translate>
Note to template developers using Mac OS X systems: the Finder's "compress" menu item produces a usable ZIP format package, but with one catch. It stores the files in [[AppleDouble]] format, adding extra files with names beginning with "<tt>._</tt>". Thus it adds a file named "<tt>._templateDetails.xml</tt>, which Joomla 1.5.x can sometimes misinterpret. The symptom is an error message, "XML Parsing Error at 1:1. Error 4: Empty document". The workaround is to compress from the command line, and set a shell environment variable "COPYFILE_DISABLE" to "true" before using "compress" or "tar". See the [[AppleDouble]] article for more information.
+
=== Note to Mac OS X users === <!--T:3-->
 +
</translate>
 +
<translate><!--T:4-->
 +
Note to template developers using Mac OS X systems: the Finder's "compress" menu item produces a usable ZIP format package, but with one catch. It stores the files in '''AppleDouble''' format, adding extra files with names beginning with "<tt>._</tt>". Thus it adds a file named "<tt>._templateDetails.xml</tt>", which Joomla 1.5.x can sometimes misinterpret. The symptom is an error message, "XML Parsing Error at 1:1. Error 4: Empty document". The workaround is to compress from the command line, and set a shell environment variable "COPYFILE_DISABLE" to "true" before using "compress" or "tar". See the [http://en.wikipedia.org/wiki/AppleSingle_and_AppleDouble_formats AppleDouble] article for more information.</translate>
  
To set an environment variable on a Mac, open a terminal window and type:
+
<translate><!--T:5-->
 +
To set an environment variable on a Mac, open a terminal window and type:</translate>
 
  export COPYFILE_DISABLE=true
 
  export COPYFILE_DISABLE=true
  
Then in the same terminal window, change directories into where your template files reside and issue the zip command.  For instance, if your template files have been built in a folder in your personal directory called myTemplate, then you would do the following:
+
<translate><!--T:6-->
 +
Then in the same terminal window, change directories into where your template files reside and issue the zip command.  For instance, if your template files have been built in a folder in your personal directory called myTemplate, then you would do the following:</translate>
 
  cd myTemplate
 
  cd myTemplate
 
  zip -r myTemplate.zip *
 
  zip -r myTemplate.zip *
 +
 +
<noinclude>
 +
<translate>
 +
<!--T:7-->
 +
[[Category:Extension development]]
 +
[[Category:Tutorials]]
 +
</translate>
 +
</noinclude>

Latest revision as of 15:59, 28 October 2015

Other languages:
English • ‎español • ‎français • ‎Nederlands

A directory with several loose files is not a convenient package for distribution. So the final step is to make a package. This is a compressed archive containing the directory structure and all the files. The package can be in ZIP format (with a .zip extension), in TAR-gzip format (with a .tar.gz extension), or in TAR-bz2 format (with a .tar.bz2 extension).

If your template is in a directory mytemplate/ then to make the package you can connect to that directory and use commands like:

  • tar cvvzf ../mytemplate.tar.gz *
  • zip -r ..\mytemplate.zip *.*

Note to Mac OS X users

Note to template developers using Mac OS X systems: the Finder's "compress" menu item produces a usable ZIP format package, but with one catch. It stores the files in AppleDouble format, adding extra files with names beginning with "._". Thus it adds a file named "._templateDetails.xml", which Joomla 1.5.x can sometimes misinterpret. The symptom is an error message, "XML Parsing Error at 1:1. Error 4: Empty document". The workaround is to compress from the command line, and set a shell environment variable "COPYFILE_DISABLE" to "true" before using "compress" or "tar". See the AppleDouble article for more information.

To set an environment variable on a Mac, open a terminal window and type:

export COPYFILE_DISABLE=true

Then in the same terminal window, change directories into where your template files reside and issue the zip command. For instance, if your template files have been built in a folder in your personal directory called myTemplate, then you would do the following:

cd myTemplate
zip -r myTemplate.zip *