Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b98983d
commit 0a3d9e6
Showing
4 changed files
with
78 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
--- | ||
title: Converting an older plugin | ||
description: | ||
weight: 80 | ||
layout: docs | ||
--- | ||
|
||
**Note** For simplicity, files like `license.txt`, `README.txt` and `docs` are omitted; no changes are made to those files, which are not deployed. | ||
|
||
Converting an older plugin to use the encapsulated architecture can be done | ||
following these steps: | ||
|
||
### 1. Create the plugin's file hierarchy. | ||
|
||
As a general rule, this just means moving the files you currently have in the | ||
plugin's top level folder under a new folder with the name | ||
<i>Plugin Name/Version</i>. | ||
|
||
For example, the Mod List files, prior to conversion, were: | ||
|
||
``` | ||
./admin/includes/languages/english/extra_definitions/mod_list.php | ||
./admin/includes/languages/english/mod_list.php | ||
./admin/includes/extra_configures/mod_list.php | ||
./admin/mod_list.php | ||
``` | ||
|
||
These become: | ||
|
||
``` | ||
./ModList/1.4.0/admin/includes/languages/english/extra_definitions/mod_list.php | ||
./ModList/1.4.0/admin/includes/languages/english/mod_list.php | ||
./ModList/1.4.0/admin/includes/extra_configures/mod_list.php | ||
./ModList/1.4.0/admin/mod_list.php | ||
``` | ||
|
||
### 2. Add the Manifest | ||
|
||
Create a [manifest file](/dev/plugins/encapsulated_plugins/manifests/). In our example, this will be placed in | ||
|
||
``` | ||
./ModList/1.4.0/manifest.php | ||
``` | ||
|
||
|
||
### 3. Add the Plugin Installer script | ||
|
||
Create an [installer script](/dev/plugins/encapsulated_plugins/installer_classes/). | ||
|
||
In our example, this will be placed in | ||
|
||
``` | ||
./ModList/1.4.0/Installer/PluginInstaller.php | ||
``` | ||
|
||
### 4. (optional) Create install and uninstall files | ||
|
||
If the installer script you created above did not do the SQL operations | ||
required by the plugin, you can use [plain SQL files](/dev/plugins/encapsulated_plugins/sql_installation/). | ||
|
||
In our example, these will be placed in | ||
|
||
``` | ||
./ModList/1.4.0/Installer/uninstall.sql | ||
./ModList/1.4.0/Installer/install.sql | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters