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.

Download rah_plugin_dev v0.6

Image: rah_plugin_dev

Image: rah_plugin_dev

List of features

Requirements

Minimum requirements:

Minimum:

Recommended:

Installation

  1. Install the plugin code by importing it via your TXP’s plugin tab.
  2. Navigate to TXP / Extensions / Plugin Dev.
  3. 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.

  1. The root directories inside the main directory (/rah_plugin_dev/) are the plugin names.
  2. The directories inside the plugin directory are versions. The newest version is loaded to DB, others are kept in the state they are.
  3. 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:

  1. Contain the source code for the plugin.
  2. Should be named after the plugin database field.
  3. Allowed file extensions are .php, .htm, .html, .txt and .shtml.
  4. Allowed file names are all the field names in database, expect name field, which is taken from the plugin directory name.
  5. Allowed file names include: status, author, author_uri, version, description, help, code, code_restore, code_md5, type, load_order and flags.
  6. 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 help

	p. It's my plugin help.
code.php
	<?php

		function rah_myfirst_plugin() {
			return 'hello world';
		}
	?>
type.txt
	1
load_order.txt
	1

Note the known facts

  1. Plugin sorts version directories and load the newest build by using Numerical Quicksort. Please use version numbers that can be arranged correctly by it.
  2. If you use rah_plugin_dev on a live/public server, remember to secure the SVN folder really tight (write/read access).
  3. Some security modules might not like rah_plugin_dev. It’s recommeded to turn file function content filters and similiar off.
  4. 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

Changelog

Version 0.6

Version 0.5

Version 0.4.1

Version 0.4

Version 0.3.2

Version 0.3.1

Version 0.3

Version 0.2

Version 0.1