Plugins

<< Click to Display Table of Contents >>

Navigation:  Work With Administration Panel >

Plugins

This plugin system allows you to modify any part of the engine at your discretion. Plugins installation and update requires just one click in Control Panel of DataLife Engine. If the plugin is developed for this new system, then users no longer have to read installation instructions, edit anything in the engine files, etc. You simply upload the plugin to the Administration Panel.

 

Plugin system is built using the virtual file system technology. In your plugin you describe file which should be affected and actions to be performed. Based on this information DataLife Engine creates virtual copies of these files with all the necessary changes and modifications and works with the created virtual copies without affecting the original files. It allows you to describe the changes in almost all files, except for some basic files, i.e. root files, but they do not carry any functionality except for connecting other files. Also, the functionality of the files responsible for AJAX functions can be changed. For this they were completely rewritten to work through the controller. What are the advantages of this? Firstly, the original files always remain unchanged, so the plugins can be easily changed, deleted, updated, etc. Secondly, this system applies the least possible load on sites, because virtual copies of files are created only once at the time of plugins installation or update, after which the DataLife Engine works with these new files as with native files and there are no memory costs for call points, storage and control of information about where and what functionality should be changed. The server load will increase only by the load that the plugin causes. The plugin management system will not cause any additional load. Thirdly, there is no problem with updating the engine. It can be updated and your plugins are automatically associated with new versions. It allows various plugins to modify the same file without causing conflicts, provided of course that different plugins do not perform directly opposite actions.

 

So in the plugin management module you can either create a plugin directly in the Control Panel or download it. Let’s consider adding a new plugin directly to Control Panel:

 

On the first tab you specify the general data about the plugin – its name, its short description. For a convenient distinction from other plugins, you can set an icon which will be displayed in the plugins list. Also you specify the plugin version, and compatible DataLife Engine version.

 

On the next tab, you specify the actions on files to be performed. You can perform actions on one or more files, and assign one or more actions to be performed on each file. Several actions may be performed on files:

 

1. Find and replace code.

2. Find and add code above.

3. Find and add code below.

4. Completely replace the contents of the file.

5. Create a new virtual file that does not exist in the original DLE.

 

You can add or delete files, change or delete actions on files at any time. For convenience of perception and editing, all the code is highlighted, and the fields can be dynamically stretched.

 

On the next tab, you can add actions to the MySQL database which plugin should perform in certain situations. You can specify a list of MySQL queries that must be performed on plugin installation, plugin update, on its disabling or enabling, and when it is uninstalled. For each action you can specify a single query or a list of several database queries.

 

For the installed plugin, you can perform the following actions: You can disable it. It remains on the site, but is completely ignored by the engine, and it stops affecting all files. You can update it if there is a new version. Download plugin on your computer to install it on another site. The file itself is downloaded in XML format, and this file contains a description of all the actions. In fact, the plugin is an XML file that can be installed in Administration Panel.

 

Let's consider installation of a plugin. You can download and install any plugin on your site. When you click the corresponding button you can download either the XML plugin file or the ZIP archive with the plugin. This allows you to create very complex plugins that contain a large number of additional files, both graphical and PHP files. For example, if you do not describe all the actions directly in the plugin itself, you can create additional files and pack them into an archive, storing them in other places. It is important to know that archive can contain only those PHP files that are not included in the distribution kit, but only additional files. If there are files in the distribution kit, it will be blocked. Modification of standard files can be described in the plugin itself. The XML plugin file should be in the root directory of your archive.

 

If you upload the plugin archive and DataLife Engine does not have write rights in your archive, it will automatically request FTP access to download your archive. If no access is required, everything will be copied automatically. Note that these accesses will not be stored. They will be automatically deleted when they are no longer needed.

 

The new plugin management system also has an integrated plugin error logging system. If some action on the files cannot be performed or if some errors occur, you can easily see and fix them. It is extremely useful if your plugin is not compatible with the next version of DLE. You will quickly see it, and you can easily adapt the plugin.