A typical ZIP archive with an extension has the following structure of
files and directories:
example-extension.zip
|
+-meta.xml
+-DESCRIPTION.md
+-CHANGES.md
+-/htdocs/
|
+-index.php
+-public/
+-...
+-/plib/
|
+--controllers
| IndexController.php
|
+---scripts
| post-install.php
| pre-install.php
| pre-uninstall.php
|
+---views
| ---scripts
| ---index
| index.phtml
|
+-/hooks/
|
+-...
+-/library/
|
+-...
+-/sbin/
|
+-...
+-/var/
|
+-...
+-/_meta/
|
+-...
The description of the most important files and directories is as
follows:
meta.xml
- The XML-formatted description of the extension. During
the extension installation, this file is extracted to
PRODUCT_ROOT_D/admin/plib/modules/EXTENSION_ID/meta.xml
, where
PRODUCT_ROOT_D
is /usr/local/psa
on Linux systems and
%plesk_dir%
on Windows systems. See the detailed description of this
file structure.
DESCRIPTION.md
- The extended description of the extension. The
description must be written in markdown. See the detailed description
for more information.
CHANGES.md
- The changelog of the extension. The changelog must be
written in markdown. See the detailed description for more information.
/htdocs
- All entry points of an extension, CSS, Javascript, and
graphics files should be placed in this directory. During installation,
the contents of this directory are extracted directly into the
/PRODUCT_ROOT_DIR/admin/htdocs/modules/EXTENSION_ID/
directory.
/htdocs/public
- Contains the scripts that do not require
authorization (bypassing controllers). For example if your extension
exposes its own API.
/plib
- This directory should contain PHP classes that are
responsible for the logic of an extension. During installation, the
contents of this directory are extracted directly into the
PRODUCT_ROOT_D/admin/plib/modules/MODULE_ID/
directory.
/plib/conrollers
- This directory should contain the extension’s
controllers (for details, read the description of MVC
pattern).
This directory is automatically generated when the extension is created
and contains the default controller for requests processing,
IndexController.php
.
<code class="…