I will introduce you how to develop preloads with Subversion. If you put your preloads under /preload directory, it is difficult to manage the versions of its. Because, Subversion treats not only your preload but also the other ones. In such a case, you can make subdirectories under /preload. This way helps you to increase your manageability.

配布することを考えれば、サブディレクトリにLicense.txtやReadme.txtを置くといいでしょう。そうしておくと、svn -exportでプリロードの配布パッケージが簡単に生成できます。

If you plan to distribute your preload, you may put License.txt or Readme.txt under the subdirectory. It is a smart way. You only have to command "svn -export" at the subdirectory when you distribute it.


		/VersionedPreload.class.php (a)
			/VersionedPrelaod.class.php (b)

VersionedPreload.class.php (a)のソース


$file = basename(__FILE__);
$dir  = str_replace('.class.php', '', $file);

require $dir.'/'.$file;



The (a) only includes your preload. You can apply this sample to your any other preloads. Because, this sample get the file name dynamically. If you create the (a) once, you only have to copy and rename it, when you create a new preload. It is useful.

VersionedPreload.class.php (b)のソース

 * @package    Versioned Preload
 * @author     Foo Bar <>
 * @copyright  2010 Foo Bar
 * @license GNU GPL v2 or later

if ( !defined('XOOPS_ROOT_PATH') ) exit;

class VersionedPreload extends XCube_ActionFilter
	public function preBlockFilter()
		$this->mRoot->mDelegateManager->add('Delegate.Name', array(__CLASS__, 'doSomething'));

	public static funciton doSomething(&$param)
		// Do something here.