rah_plugin_dev
Published under current TXP projects
Plugin development API for Textpattern CMS. Provides simple version control, Source-to-DB -importing and testing tool.
Image: rah_plugin_dev
List of features
- Simple plugin version control.
- Provides directly managable plugin source files.
- Each plugin database field is cut into it’s own file (code.php, help.html, description.txt etc).
- Each version/build is in it’s own directory.
- Imports and auto-installs newest build files from SVN to the plugin database.
- Interface to under Extensions to change Import/SVN-load setting.
Requirements
Minimum requirements:
Minimum:
- TXP 4.0.7+
- PHP 4.3.0+
Recommended:
- TXP 4.2.0+
- PHP 5.1.2+
- Safe mode off.
- MySQL 5.0.6+
- Strict mode off.
Installation
- Install the plugin code by importing it via your TXP’s plugin tab.
- Navigate to
TXP / Extensions / Plugin Dev. - Change SVN/Build directory path to your likes. Default is
~/textpattern/rah_plugin_dev/.
Build directory and SVN
The build directory is located in the path set in TXP / Extensions / Plugin Dev options. The structure of the directory is simple.
- The root directories inside the main directory (
/rah_plugin_dev/) are the plugin names. - The directories inside the plugin directory are versions. The newest version is loaded to DB, others are kept in the state they are.
- Inside the “plugin version” subfolder are located the souce files of the plugin, each DB field cut into it’s own file.
Example of the build directory structure:
/textpattern/rah_plugin_dev/
/rah_author/
/0.1/
author.txt
author_uri.txt
code.php
description.txt
help.txt
load_order.txt
status.txt
type.txt
version.txt
/0.2/
author.txt
author_uri.txt
code.php
description.txt
help.txt
load_order.txt
status.txt
type.txt
version.txt
/rah_metas/
/0.1/
[...]
/0.2/
[...]
/0.3/
[...]
/0.3.1/
[...]
/0.3.2/
[...]
Plugin source files
Each plugin version directory should contain punch of files. Those files:
- Contain the source code for the plugin.
- Should be named after the plugin database field.
- Allowed file extensions are .php, .htm, .html, .txt and .shtml.
- Allowed file names are all the field names in database, expect name field, which is taken from the plugin directory name.
- Allowed file names include: status, author, author_uri, version, description, help, code, code_restore, code_md5, type, load_order and flags.
- Each file should be encoded in UTF-8 and saved without BOM.
Example file contents (file|content):
status.txt 0 author.txt Jukka Svahn author_uri.txt http://rahforum.biz description.txt My plugin description here. help.txt h1. My plugin helpp. It's my plugin help. code.php <?phpfunction rah_myfirst_plugin() { return 'hello world'; } ?> type.txt 1 load_order.txt 1
Note the known facts
- Plugin sorts version directories and load the newest build by using Numerical Quicksort. Please use version numbers that can be arranged correctly by it.
- If you use rah_plugin_dev on a live/public server, remember to secure the SVN folder really tight (write/read access).
- Some security modules might not like rah_plugin_dev. It’s recommeded to turn file function content filters and similiar off.
- It’s recommeded to use the plugin on local/secure server. Tho, live works also, exspecially when only manual import/SVN load is used.
Extra features
- All source files, when imported to db, are trimed from file ending whitespace.
- Plugin code file (code.php) can contain starting/ending
<?php,<?and?>tags. Those are cleaned while importing. - Features manual import tool. If required, you can turn automatic import off and use the manual instead. Manual import is found from the Extensions panel.
- Writes log to Textpattern’s Tag Trace.
Changelog
Version 0.6
- Added pracket tags:
[PLUGIN_AUTHOR],[PLUGIN_URI]and[PLUGIN_DESCRIPTION].
Version 0.5
- Added option to add code to the top of the plugin source code. Good way to automatically add signatures, checksums, license notices and copyrights. Feature support following pracket tags:
[PLUGIN_NAME],[PLUGIN_VERSION],[YEAR]and[MD5]. - Added unified installer.
- Added
is_readableandis_filechecks before trying to read anything. - Removed empty default value from not null fields in the installer. In strict mode your can’t insert empty default value.
- Removed
rah_plugin_dev_trace(); it’s no longer called multiple times. Code applied directly torah_plugin_dev(). - Removed non-used
$sqland$tracearrays. Everything is nowdays done in-house. - Fixed: now escapes the directory name (version) when inserting it to the db.
- Now escapes the path in the preferences panel’s HTML source.
- Now check if the folder containes nothing before adding it to the bending.
- Changed the panel
$eventfromrah_plugin_dev_pagetorah_plugin_dev. - Integration support to rah_plugin_download.
Version 0.4.1
- Fixed a small typo: at to as.
Version 0.4
- Added option to Textile help file.
- Added changes for future plans: seperated file lookup and DB updater.
Version 0.3.2
- Fixed: double slash insert query escaping.
Version 0.3.1
- Fixed: XHTML markup error on Extensions panel.
Version 0.3
- Fixed: now manual plugin loader works also with
None/Disabledautomatic loader. - Secured Manual Runonce Plugin Loader function with TXP user auth.
Version 0.2
- Fixed: now
path-option has a effect.
Version 0.1
- First public release.