|HomeLearn moreFeaturesScreenshotsPrivacy / SecurityDownloads|
Developing an extensionThrough its extensions architecture, Weezo can offer new types of resources.
PHP skills are required to develop plugins.
A Weezo extension is a set of PHP scripts plus a text file named "describer.ini".
To be redistributed, all this files must be placed into a 7zip archive, which name will define resource's name. This archive's extension should be renamed to .weezoResource to ease installation (as .weezoResource files are associated with Weezo).
Weezo integrated extension installer unpacks your extension files in the directory: /www/res/misc/zipfile_name.
The describer.ini file format and a detailed set of instructions are located in the file /www/res/misc/describer.ini.readme.txt
Session managementdescriber.ini file defines "resourceStartsSession" parameter.
Set this parameter to true if you need to do your own session management (opening and closing sessions).
This is the recommended setting for adapting existing applications as it maximizes inependance with Weezo application: using session_destroy or unsetting $_SESSION array won't destroy weezo session and thus not disconnect the user.
If resourceStartsSession is set to false, weezo session is not closed before starting extension scripts. All weezo session data is therefore accessible.
Keep in mind that a session_write_close will disconnect user !
You may add a "license.txt" file in the root directory of the extension. It's content will be displayed during the extension installation process.
Resource configurationIf a config.php script is located into your root directory, it'll be considered as resource configuration script. If you wish to use another script for configuration, modify the describer.ini accordingly.
If no configuration script is set, Weezo interface will display a simple script allowing user to change resource name.
You may specify standaloneConfig=true and configStartsSession=true in describer.ini if you want your script to be totally independant of Weezo's architecture. Instructions below are then irrelevant
If you want to use Weezo features, set standaloneConfig=false.
You should then use an existing config.php script to understand how it works.
When called from user interface or remote administration, configuration script is included by a script which has already inserted head> /head> and body>.
This script may also be directly called by user (this is the "limited configuration" case). You should then rely on rcConfigRights() for access control and head/body insertion.
Configuration script structure:
rcConfigRights($limitedConfigAllowed=false); // used to check access rights. if $limitedConfigAllowed is false, user may not access configuration script. If true, user may access configuration an thus change some parameters for this session
rcInsertIconName($resourceData); // Insert resource's icon and resource name selection control
[rcProcessData(...)] // see below
rcButtonSaveCancel() // Insert save/cancel buttons (remote administration only) and some scripts
rcWriteResourceFile($resourceData, $fileName); // Commit changes
rcProcessData function defines and process a parameter.
Format: rcProcessData(data_name, format (dataBoolean, dataList, dataNumeric, dataText, dataPath), default value, contstraints, display, line_break(true/false), sensitive_data(Y/N)); Calling this function will:
Once again, it's highly recommended to use an existing config.php to understant how this stuff works...
rcAdvancedConfigStart() defines the begining of "advanced configuration" block (see files explorer for exemple).
All data is stored into $resourceData array.
Main resource scriptsYou may do whatever you want !
Just remember those simple rules:
Access right management
Access right management is integrated into Weezo core. You don't have to develop it in your extension scripts.
Be well aware though that any non-PHP file remains accessible, even to non authenticated users.
Apache / PHP Environment
Because two good examples are always better than a bad explanation (and a long one at that), you can check the php.ini and httpd.conf files used by Weezo. They are located in the directory : /data/default.
How to develop and test your extension?
The simplest to do is to directly develop in the directory /www/res/misc/extension_name
Once a minimal describer.ini is created and the index script defined, your extension will appear into the Weezo interface (restart Weezo first...).
Can I start from scripts provided with Weezo?
Of course you can! The level of excellency reached by our team of thousands of expert developers is such, we don't doubt their pedagogical potential is of the utmost value ;-)
Joke aside, all scripts provided with Weezo are open source (PHP license). You can modify them at will.
Can I adapt existing scripts to work within Weezo ?
Yes, it is possible. You just have to go by the rules defined upthere.